2 * Copyright (c) 1996, 1998-2005, 2007-2009
3 * Todd C. Miller <Todd.Miller@courtesan.com>
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 * Sponsored in part by the Defense Advanced Research Projects
18 * Agency (DARPA) and Air Force Research Laboratory, Air Force
19 * Materiel Command, USAF, under agreement number F39502-99-1-0512.
23 * Lock the sudoers file for safe editing (ala vipw) and check for parse errors.
34 #include <sys/types.h>
35 #include <sys/param.h>
37 #include <sys/socket.h>
40 # include <sys/file.h>
51 #endif /* STDC_HEADERS */
55 # ifdef HAVE_STRINGS_H
58 #endif /* HAVE_STRING_H */
61 #endif /* HAVE_UNISTD_H */
68 #include <netinet/in.h>
69 #include <arpa/inet.h>
71 #if TIME_WITH_SYS_TIME
80 # include <emul/timespec.h>
84 #include "interfaces.h"
96 struct sudoersfile *next;
100 * Function prototypes
102 static RETSIGTYPE quit __P((int));
103 static char *get_args __P((char *));
104 static char *get_editor __P((char **));
105 static void get_hostname __P((void));
106 static char whatnow __P((void));
107 static int check_aliases __P((int, int));
108 static int check_syntax __P((char *, int, int));
109 static int edit_sudoers __P((struct sudoersfile *, char *, char *, int));
110 static int install_sudoers __P((struct sudoersfile *, int));
111 static int print_unused __P((void *, void *));
112 static int reparse_sudoers __P((char *, char *, int, int));
113 static int run_command __P((char *, char **));
114 static void print_undefined __P((char *name, int, int, int));
115 static void setup_signals __P((void));
116 static void usage __P((void)) __attribute__((__noreturn__));
118 extern void yyerror __P((const char *));
119 extern void yyrestart __P((FILE *));
122 * External globals exported by the parser
124 extern struct rbtree *aliases;
126 extern char *sudoers, *errorfile;
127 extern int errorlineno, parse_error;
138 struct interface *interfaces;
139 struct sudo_user sudo_user;
140 struct passwd *list_pw;
141 static struct sudoerslist {
142 struct sudoersfile *first, *last;
144 static struct rbtree *alias_freelist;
151 struct sudoersfile *sp;
152 char *args, *editor, *sudoers_path;
153 int ch, checkonly, quiet, strict, oldperms;
154 #if defined(SUDO_DEVEL) && defined(__OpenBSD__)
155 extern char *malloc_options;
156 malloc_options = "AFGJPR";
160 if ((Argc = argc) < 1)
166 checkonly = oldperms = quiet = strict = FALSE;
167 sudoers_path = _PATH_SUDOERS;
168 while ((ch = getopt(argc, argv, "Vcf:sq")) != -1) {
171 (void) printf("%s version %s\n", getprogname(), PACKAGE_VERSION);
174 checkonly++; /* check mode */
177 sudoers_path = optarg; /* sudoers file path */
181 strict++; /* strict mode */
184 quiet++; /* quiet mode */
198 /* Mock up a fake sudo_user struct. */
200 if ((sudo_user.pw = sudo_getpwuid(getuid())) == NULL)
201 errorx(1, "you don't exist in the passwd database");
204 /* Setup defaults data structures. */
208 exit(check_syntax(sudoers_path, quiet, strict));
211 * Parse the existing sudoers file(s) in quiet mode to highlight any
212 * existing errors and to pull in editor and env_editor conf values.
214 if ((yyin = open_sudoers(sudoers_path, TRUE, NULL)) == NULL) {
215 error(1, "%s", sudoers_path);
217 init_parser(sudoers_path, 0);
219 (void) update_defaults(SETDEF_GENERIC|SETDEF_HOST|SETDEF_USER);
221 editor = get_editor(&args);
223 /* Install signal handlers to clean up temp files if we are killed. */
226 /* Edit the sudoers file(s) */
227 tq_foreach_fwd(&sudoerslist, sp) {
230 if (sp != tq_first(&sudoerslist)) {
231 printf("press return to edit %s: ", sp->path);
232 while ((ch = getchar()) != EOF && ch != '\n')
235 edit_sudoers(sp, editor, args, -1);
238 /* Check edited files for a parse error and re-edit any that fail. */
239 reparse_sudoers(editor, args, strict, quiet);
241 /* Install the sudoers temp files. */
242 tq_foreach_fwd(&sudoerslist, sp) {
244 (void) unlink(sp->tpath);
246 (void) install_sudoers(sp, oldperms);
253 * Edit each sudoers file.
254 * Returns TRUE on success, else FALSE.
257 edit_sudoers(sp, editor, args, lineno)
258 struct sudoersfile *sp;
262 int tfd; /* sudoers temp file descriptor */
263 int modified; /* was the file modified? */
264 int ac; /* argument count */
265 char **av; /* argument vector for run_command */
266 char *cp; /* scratch char pointer */
267 char buf[PATH_MAX*2]; /* buffer used for copying files */
268 char linestr[64]; /* string version of lineno */
269 struct timespec ts1, ts2; /* time before and after edit */
270 struct timespec orig_mtim; /* starting mtime of sudoers file */
271 off_t orig_size; /* starting size of sudoers file */
272 ssize_t nread; /* number of bytes read */
273 struct stat sb; /* stat buffer */
276 if (fstat(sp->fd, &sb) == -1)
278 if (stat(sp->path, &sb) == -1)
280 error(1, "can't stat %s", sp->path);
281 orig_size = sb.st_size;
282 orig_mtim.tv_sec = mtim_getsec(sb);
283 orig_mtim.tv_nsec = mtim_getnsec(sb);
285 /* Create the temp file if needed and set timestamp. */
286 if (sp->tpath == NULL) {
287 easprintf(&sp->tpath, "%s.tmp", sp->path);
288 tfd = open(sp->tpath, O_WRONLY | O_CREAT | O_TRUNC, 0600);
290 error(1, "%s", sp->tpath);
292 /* Copy sp->path -> sp->tpath and reset the mtime. */
293 if (orig_size != 0) {
294 (void) lseek(sp->fd, (off_t)0, SEEK_SET);
295 while ((nread = read(sp->fd, buf, sizeof(buf))) > 0)
296 if (write(tfd, buf, nread) != nread)
297 error(1, "write error");
299 /* Add missing newline at EOF if needed. */
300 if (nread > 0 && buf[nread - 1] != '\n') {
307 (void) touch(-1, sp->tpath, &orig_mtim);
309 /* Find the length of the argument vector */
310 ac = 3 + (lineno > 0);
315 for (wasblank = FALSE, cp = args; *cp; cp++) {
316 if (isblank((unsigned char) *cp))
325 /* Build up argument vector for the command */
326 av = emalloc2(ac, sizeof(char *));
327 if ((av[0] = strrchr(editor, '/')) != NULL)
333 (void) snprintf(linestr, sizeof(linestr), "+%d", lineno);
337 for ((cp = strtok(args, " \t")); cp; (cp = strtok(NULL, " \t")))
340 av[ac++] = sp->tpath;
345 * We cannot check the editor's exit value against 0 since
346 * XPG4 specifies that vi's exit value is a function of the
347 * number of errors during editing (?!?!).
350 if (run_command(editor, av) != -1) {
355 if (stat(sp->tpath, &sb) < 0) {
356 warningx("cannot stat temporary file (%s), %s unchanged",
357 sp->tpath, sp->path);
360 if (sb.st_size == 0 && orig_size != 0) {
361 warningx("zero length temporary file (%s), %s unchanged",
362 sp->tpath, sp->path);
367 warningx("editor (%s) failed, %s unchanged", editor, sp->path);
371 /* Set modified bit if use changed the file. */
373 if (orig_size == sb.st_size &&
374 orig_mtim.tv_sec == mtim_getsec(sb) &&
375 orig_mtim.tv_nsec == mtim_getnsec(sb)) {
377 * If mtime and size match but the user spent no measurable
378 * time in the editor we can't tell if the file was changed.
380 #ifdef HAVE_TIMESPECSUB2
381 timespecsub(&ts1, &ts2);
383 timespecsub(&ts1, &ts2, &ts2);
385 if (timespecisset(&ts2))
390 * If modified in this edit session, mark as modified.
393 sp->modified = modified;
395 warningx("%s unchanged", sp->tpath);
401 * Parse sudoers after editing and re-edit any ones that caused a parse error.
402 * Returns TRUE on success, else FALSE.
405 reparse_sudoers(editor, args, strict, quiet)
409 struct sudoersfile *sp, *last;
414 * Parse the edited sudoers files and do sanity checking
417 sp = tq_first(&sudoerslist);
418 last = tq_last(&sudoerslist);
419 fp = fopen(sp->tpath, "r+");
421 errorx(1, "can't re-open temporary file (%s), %s unchanged.",
422 sp->tpath, sp->path);
424 /* Clean slate for each parse */
426 init_parser(sp->path, quiet);
428 /* Parse the sudoers temp file */
430 if (yyparse() && parse_error != TRUE) {
431 warningx("unabled to parse temporary file (%s), unknown error",
436 if (check_aliases(strict, quiet) != 0)
440 * Got an error, prompt the user for what to do now
444 case 'Q' : parse_error = FALSE; /* ignore parse error */
446 case 'x' : cleanup(0);
452 /* Edit file with the parse error */
453 tq_foreach_fwd(&sudoerslist, sp) {
454 if (errorfile == NULL || strcmp(sp->path, errorfile) == 0) {
455 edit_sudoers(sp, editor, args, errorlineno);
460 errorx(1, "internal error, can't find %s in list!", sudoers);
463 /* If any new #include directives were added, edit them too. */
464 for (sp = last->next; sp != NULL; sp = sp->next) {
465 printf("press return to edit %s: ", sp->path);
466 while ((ch = getchar()) != EOF && ch != '\n')
468 edit_sudoers(sp, editor, args, errorlineno);
470 } while (parse_error);
476 * Set the owner and mode on a sudoers temp file and
477 * move it into place. Returns TRUE on success, else FALSE.
480 install_sudoers(sp, oldperms)
481 struct sudoersfile *sp;
487 * Change mode and ownership of temp file so when
488 * we move it to sp->path things are kosher.
491 /* Use perms of the existing file. */
493 if (fstat(sp->fd, &sb) == -1)
495 if (stat(sp->path, &sb) == -1)
497 error(1, "can't stat %s", sp->path);
498 (void) chown(sp->tpath, sb.st_uid, sb.st_gid);
499 (void) chmod(sp->tpath, sb.st_mode & 0777);
501 if (chown(sp->tpath, SUDOERS_UID, SUDOERS_GID) != 0) {
502 warning("unable to set (uid, gid) of %s to (%d, %d)",
503 sp->tpath, SUDOERS_UID, SUDOERS_GID);
506 if (chmod(sp->tpath, SUDOERS_MODE) != 0) {
507 warning("unable to change mode of %s to 0%o", sp->tpath,
514 * Now that sp->tpath is sane (parses ok) it needs to be
515 * rename(2)'d to sp->path. If the rename(2) fails we try using
516 * mv(1) in case sp->tpath and sp->path are on different file systems.
518 if (rename(sp->tpath, sp->path) == 0) {
522 if (errno == EXDEV) {
524 warningx("%s and %s not on the same file system, using mv to rename",
525 sp->tpath, sp->path);
527 /* Build up argument vector for the command */
528 if ((av[0] = strrchr(_PATH_MV, '/')) != NULL)
537 if (run_command(_PATH_MV, av)) {
538 warningx("command failed: '%s %s %s', %s unchanged",
539 _PATH_MV, sp->tpath, sp->path, sp->path);
540 (void) unlink(sp->tpath);
548 warning("error renaming %s, %s unchanged", sp->tpath, sp->path);
549 (void) unlink(sp->tpath);
593 const struct passwd *pw;
595 return (pw->pw_passwd);
599 * Assuming a parse error occurred, prompt the user for what they want
600 * to do now. Returns the first letter of their choice.
608 (void) fputs("What now? ", stdout);
610 for (c = choice; c != '\n' && c != EOF;)
622 (void) puts("Options are:");
623 (void) puts(" (e)dit sudoers file again");
624 (void) puts(" e(x)it without saving changes to sudoers file");
625 (void) puts(" (Q)uit and save changes to sudoers file (DANGER!)\n");
631 * Install signal handlers for visudo.
639 * Setup signal handlers to cleanup nicely.
641 zero_bytes(&sa, sizeof(sa));
642 sigemptyset(&sa.sa_mask);
643 sa.sa_flags = SA_RESTART;
644 sa.sa_handler = quit;
645 (void) sigaction(SIGTERM, &sa, NULL);
646 (void) sigaction(SIGHUP, &sa, NULL);
647 (void) sigaction(SIGINT, &sa, NULL);
648 (void) sigaction(SIGQUIT, &sa, NULL);
652 run_command(path, argv)
659 switch (pid = fork()) {
661 error(1, "unable to run %s", path);
662 break; /* NOTREACHED */
666 closefrom(STDERR_FILENO + 1);
668 warning("unable to run %s", path);
670 break; /* NOTREACHED */
675 rv = sudo_waitpid(pid, &status, 0);
679 } while (rv == -1 && errno == EINTR);
681 if (rv == -1 || !WIFEXITED(status))
683 return(WEXITSTATUS(status));
687 check_syntax(sudoers_path, quiet, strict)
695 if ((yyin = fopen(sudoers_path, "r")) == NULL) {
697 warning("unable to open %s", sudoers_path);
700 init_parser(sudoers_path, quiet);
701 if (yyparse() && parse_error != TRUE) {
703 warningx("failed to parse %s file, unknown error", sudoers_path);
707 if (check_aliases(strict, quiet) != 0)
713 (void) printf("parse error in %s near line %d\n", errorfile,
716 (void) printf("%s: parsed OK\n", sudoers_path);
718 /* Check mode and owner in strict mode. */
720 if (strict && fstat(fileno(yyin), &sb) == 0)
722 if (strict && stat(sudoers_path, &sb) == 0)
725 if (sb.st_uid != SUDOERS_UID || sb.st_gid != SUDOERS_GID) {
728 fprintf(stderr, "%s: wrong owner (uid, gid) should be (%d, %d)\n",
729 sudoers_path, SUDOERS_UID, SUDOERS_GID);
732 if ((sb.st_mode & 07777) != SUDOERS_MODE) {
735 fprintf(stderr, "%s: bad permissions, should be mode 0%o\n",
736 sudoers_path, SUDOERS_MODE);
745 * Used to open (and lock) the initial sudoers file and to also open
746 * any subsequent files #included via a callback from the parser.
749 open_sudoers(path, doedit, keepopen)
754 struct sudoersfile *entry;
757 /* Check for existing entry */
758 tq_foreach_fwd(&sudoerslist, entry) {
759 if (strcmp(path, entry->path) == 0)
763 entry = emalloc(sizeof(*entry));
764 entry->path = estrdup(path);
767 entry->fd = open(entry->path, O_RDWR | O_CREAT, SUDOERS_MODE);
770 entry->doedit = doedit;
771 if (entry->fd == -1) {
772 warning("%s", entry->path);
776 if (!lock_file(entry->fd, SUDO_TLOCK))
777 errorx(1, "%s busy, try again later", entry->path);
778 if ((fp = fdopen(entry->fd, "r")) == NULL)
779 error(1, "%s", entry->path);
780 /* XXX - macro here? */
781 if (sudoerslist.last == NULL)
782 sudoerslist.first = sudoerslist.last = entry;
784 sudoerslist.last->next = entry;
785 sudoerslist.last = entry;
788 /* Already exists, open .tmp version if there is one. */
789 if (entry->tpath != NULL) {
790 if ((fp = fopen(entry->tpath, "r")) == NULL)
791 error(1, "%s", entry->tpath);
793 if ((fp = fdopen(entry->fd, "r")) == NULL)
794 error(1, "%s", entry->path);
798 if (keepopen != NULL)
807 char *Editor, *EditorArgs, *EditorPath, *UserEditor, *UserEditorArgs;
810 * Check VISUAL and EDITOR environment variables to see which editor
811 * the user wants to use (we may not end up using it though).
812 * If the path is not fully-qualified, make it so and check that
813 * the specified executable actually exists.
815 UserEditorArgs = NULL;
816 if ((UserEditor = getenv("VISUAL")) == NULL || *UserEditor == '\0')
817 UserEditor = getenv("EDITOR");
818 if (UserEditor && *UserEditor == '\0')
820 else if (UserEditor) {
821 UserEditorArgs = get_args(UserEditor);
822 if (find_path(UserEditor, &Editor, NULL, getenv("PATH")) == FOUND) {
825 if (def_env_editor) {
826 /* If we are honoring $EDITOR this is a fatal error. */
827 errorx(1, "specified editor (%s) doesn't exist!", UserEditor);
829 /* Otherwise, just ignore $EDITOR. */
836 * See if we can use the user's choice of editors either because
837 * we allow any $EDITOR or because $EDITOR is in the allowable list.
839 Editor = EditorArgs = EditorPath = NULL;
840 if (def_env_editor && UserEditor) {
842 EditorArgs = UserEditorArgs;
843 } else if (UserEditor) {
844 struct stat editor_sb;
845 struct stat user_editor_sb;
846 char *base, *userbase;
848 if (stat(UserEditor, &user_editor_sb) != 0) {
849 /* Should never happen since we already checked above. */
850 error(1, "unable to stat editor (%s)", UserEditor);
852 EditorPath = estrdup(def_editor);
853 Editor = strtok(EditorPath, ":");
855 EditorArgs = get_args(Editor);
857 * Both Editor and UserEditor should be fully qualified but
860 if ((base = strrchr(Editor, '/')) == NULL)
862 if ((userbase = strrchr(UserEditor, '/')) == NULL) {
869 * We compare the basenames first and then use stat to match
872 if (strcmp(base, userbase) == 0) {
873 if (stat(Editor, &editor_sb) == 0 && S_ISREG(editor_sb.st_mode)
874 && (editor_sb.st_mode & 0000111) &&
875 editor_sb.st_dev == user_editor_sb.st_dev &&
876 editor_sb.st_ino == user_editor_sb.st_ino)
879 } while ((Editor = strtok(NULL, ":")));
883 * Can't use $EDITOR, try each element of def_editor until we
884 * find one that exists, is regular, and is executable.
886 if (Editor == NULL || *Editor == '\0') {
888 EditorPath = estrdup(def_editor);
889 Editor = strtok(EditorPath, ":");
891 EditorArgs = get_args(Editor);
892 if (sudo_goodpath(Editor, NULL))
894 } while ((Editor = strtok(NULL, ":")));
896 /* Bleah, none of the editors existed! */
897 if (Editor == NULL || *Editor == '\0')
898 errorx(1, "no editor found (editor path = %s)", def_editor);
905 * Split out any command line arguments and return them.
914 while (*args && !isblank((unsigned char) *args))
918 while (*args && isblank((unsigned char) *args))
921 return(*args ? args : NULL);
925 * Look up the hostname and set user_host and user_shost.
930 char *p, thost[MAXHOSTNAMELEN + 1];
932 if (gethostname(thost, sizeof(thost)) != 0) {
933 user_host = user_shost = "localhost";
936 thost[sizeof(thost) - 1] = '\0';
937 user_host = estrdup(thost);
939 if ((p = strchr(user_host, '.'))) {
941 user_shost = estrdup(user_host);
944 user_shost = user_host;
949 alias_remove_recursive(name, type)
956 if ((a = alias_find(name, type)) != NULL) {
957 tq_foreach_fwd(&a->members, m) {
958 if (m->type == ALIAS) {
959 alias_remove_recursive(m->name, type);
964 a = alias_remove(name, type);
966 rbinsert(alias_freelist, a);
970 * Iterate through the sudoers datastructures looking for undefined
971 * aliases or unused aliases.
974 check_aliases(strict, quiet)
979 struct member *m, *binding;
980 struct privilege *priv;
983 int atype, error = 0;
985 alias_freelist = rbcreate(alias_compare);
988 tq_foreach_fwd(&userspecs, us) {
989 tq_foreach_fwd(&us->users, m) {
990 if (m->type == ALIAS) {
992 if (alias_find(m->name, USERALIAS) == NULL) {
993 print_undefined(m->name, USERALIAS, strict, quiet);
998 tq_foreach_fwd(&us->privileges, priv) {
999 tq_foreach_fwd(&priv->hostlist, m) {
1000 if (m->type == ALIAS) {
1002 if (alias_find(m->name, HOSTALIAS) == NULL) {
1003 print_undefined(m->name, HOSTALIAS, strict, quiet);
1008 tq_foreach_fwd(&priv->cmndlist, cs) {
1009 tq_foreach_fwd(&cs->runasuserlist, m) {
1010 if (m->type == ALIAS) {
1012 if (alias_find(m->name, RUNASALIAS) == NULL) {
1013 print_undefined(m->name, RUNASALIAS, strict, quiet);
1018 if ((m = cs->cmnd)->type == ALIAS) {
1020 if (alias_find(m->name, CMNDALIAS) == NULL) {
1021 print_undefined(m->name, CMNDALIAS, strict, quiet);
1029 /* Reverse check (destructive) */
1030 tq_foreach_fwd(&userspecs, us) {
1031 tq_foreach_fwd(&us->users, m) {
1032 if (m->type == ALIAS) {
1033 (void) alias_remove_recursive(m->name, USERALIAS);
1036 tq_foreach_fwd(&us->privileges, priv) {
1037 tq_foreach_fwd(&priv->hostlist, m) {
1038 if (m->type == ALIAS)
1039 (void) alias_remove_recursive(m->name, HOSTALIAS);
1041 tq_foreach_fwd(&priv->cmndlist, cs) {
1042 tq_foreach_fwd(&cs->runasuserlist, m) {
1043 if (m->type == ALIAS)
1044 (void) alias_remove_recursive(m->name, RUNASALIAS);
1046 if ((m = cs->cmnd)->type == ALIAS)
1047 (void) alias_remove_recursive(m->name, CMNDALIAS);
1051 tq_foreach_fwd(&defaults, d) {
1059 case DEFAULTS_RUNAS:
1066 continue; /* not an alias */
1068 tq_foreach_fwd(&d->binding, binding) {
1069 for (m = binding; m != NULL; m = m->next) {
1070 if (m->type == ALIAS)
1071 (void) alias_remove_recursive(m->name, atype);
1075 rbdestroy(alias_freelist, alias_free);
1077 /* If all aliases were referenced we will have an empty tree. */
1081 alias_apply(print_unused, strict ? "Error" : "Warning");
1083 return (strict ? 1 : 0);
1087 print_undefined(name, type, strict, quiet)
1094 warningx("%s: %s_Alias `%s' referenced but not defined",
1095 strict ? "Error" : "Warning",
1096 type == HOSTALIAS ? "Host" : type == CMNDALIAS ? "Cmnd" :
1097 type == USERALIAS ? "User" : type == RUNASALIAS ? "Runas" :
1103 print_unused(v1, v2)
1107 struct alias *a = (struct alias *)v1;
1108 char *prefix = (char *)v2;
1110 warningx("%s: unused %s_Alias %s", prefix,
1111 a->type == HOSTALIAS ? "Host" : a->type == CMNDALIAS ? "Cmnd" :
1112 a->type == USERALIAS ? "User" : a->type == RUNASALIAS ? "Runas" :
1113 "Unknown", a->name);
1118 * Unlink any sudoers temp files that remain.
1124 struct sudoersfile *sp;
1126 tq_foreach_fwd(&sudoerslist, sp) {
1127 if (sp->tpath != NULL)
1128 (void) unlink(sp->tpath);
1137 * Unlink sudoers temp files (if any) and exit.
1144 #define emsg " exiting due to signal.\n"
1145 write(STDERR_FILENO, getprogname(), strlen(getprogname()));
1146 write(STDERR_FILENO, emsg, sizeof(emsg) - 1);
1153 (void) fprintf(stderr, "usage: %s [-c] [-q] [-s] [-V] [-f sudoers]\n",