*/
#ifndef lint
-static char rcsid[] = "$Id: options.c,v 1.44 1998/11/07 06:59:28 paulus Exp $";
+static char rcsid[] = "$Id: options.c,v 1.47 1999/03/02 05:59:21 paulus Exp $";
#endif
#include <ctype.h>
static option_t *find_option __P((char *name));
static int process_option __P((option_t *, char **));
static int n_arguments __P((option_t *));
-static int readable __P((int fd));
/*
* Valid arguments.
char *arg;
option_t *opt;
+ privileged_option = privileged;
while (argc > 0) {
arg = *argv++;
--argc;
int ret;
struct passwd *pw;
- pw = getpwuid(getuid());
+ pw = getpwuid(uid);
if (pw == NULL || (user = pw->pw_dir) == NULL || user[0] == 0)
return 1;
file = _PATH_USEROPT;
/*
* readable - check if a file is readable by the real user.
*/
-static int
+int
readable(fd)
int fd;
{
- uid_t uid;
int ngroups, i;
struct stat sbuf;
GIDSET_TYPE groups[NGROUPS_MAX];
- uid = getuid();
if (uid == 0)
return 1;
if (fstat(fd, &sbuf) != 0)