*/
#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.46 1999/02/26 11:03:34 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;
/*
* readable - check if a file is readable by the real user.
*/
-static int
+int
readable(fd)
int fd;
{
return -1;
}
+ if (!privileged_option) {
+ if (!quiet)
+ option_error("setting the device name requires root privilege");
+ return -1;
+ }
+
(void) strncpy(devnam, cp, MAXPATHLEN);
devnam[MAXPATHLEN-1] = 0;
default_device = FALSE;
- devnam_info.priv = privileged_option;
- devnam_info.source = option_source;
return 1;
}