Re: file handling with fopen() and fclose()



On Wed, 27 Feb 2002 12:53:53 +0800, John Breen <locutus borg apana org au>  said:

> fp=fopen("/etc/shadow");

SYNOPSIS
       #include <stdio.h>

       FILE *fopen(const char *path, const char *mode);


Might want to pass a mode there, it would SIGSEGV pretty quickly otherwise.

Also, note that /etc/shadow is probably only readable by root - which means
that you're in for *LOADS* of security fun (you get to run set-UID, or
run as root, or figure out how to use PAM on systems that support it).

Personally, I think PAM is your best bet if you can use it.

-- 
				Valdis Kletnieks
				Computer Systems Senior Engineer
				Virginia Tech

Attachment: pgpHpS36XbZKH.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]