[BACK]Return to doas.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / doas

Diff for /src/usr.bin/doas/doas.c between version 1.23 and 1.24

version 1.23, 2015/07/26 19:08:17 version 1.24, 2015/07/26 19:14:46
Line 284 
Line 284 
   
 static int  static int
 checkconfig(const char *confpath, int argc, char **argv,  checkconfig(const char *confpath, int argc, char **argv,
     uid_t uid, gid_t *groups, int ngroups, uid_t target) {      uid_t uid, gid_t *groups, int ngroups, uid_t target)
   {
         struct rule *rule;          struct rule *rule;
   
         setresuid(uid, uid, uid);          setresuid(uid, uid, uid);
Line 295 
Line 296 
         if (permit(uid, groups, ngroups, &rule, target, argv[0],          if (permit(uid, groups, ngroups, &rule, target, argv[0],
             (const char **)argv + 1)) {              (const char **)argv + 1)) {
                 printf("permit%s\n", (rule->options & NOPASS) ? " nopass" : "");                  printf("permit%s\n", (rule->options & NOPASS) ? " nopass" : "");
                 return 1;                  exit(0);
         } else {          } else {
                 printf("deny\n");                  printf("deny\n");
                 return 0;                  exit(1);
         }          }
 }  }
   
Line 369 
Line 370 
                 argc = 1;                  argc = 1;
         }          }
   
         if (confpath)          if (confpath) {
                 exit(!checkconfig(confpath, argc, argv, uid, groups, ngroups,                  checkconfig(confpath, argc, argv, uid, groups, ngroups,
                     target));                      target);
                   exit(1);        /* fail safe */
           }
   
         parseconfig("/etc/doas.conf", 1);          parseconfig("/etc/doas.conf", 1);
   
         /* cmdline is used only for logging, no need to abort on truncate */          /* cmdline is used only for logging, no need to abort on truncate */

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24