[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.25 and 1.26

version 1.25, 2015/07/26 19:49:11 version 1.26, 2015/07/26 20:47:01
Line 322 
Line 322 
         int ngroups;          int ngroups;
         int i, ch;          int i, ch;
         int sflag = 0;          int sflag = 0;
           int nflag = 0;
   
         while ((ch = getopt(argc, argv, "C:su:")) != -1) {          uid = getuid();
           while ((ch = getopt(argc, argv, "C:nsu:")) != -1) {
                 switch (ch) {                  switch (ch) {
                 case 'C':                  case 'C':
                         confpath = optarg;                          confpath = optarg;
Line 332 
Line 334 
                         if (parseuid(optarg, &target) != 0)                          if (parseuid(optarg, &target) != 0)
                                 errx(1, "unknown user");                                  errx(1, "unknown user");
                         break;                          break;
                   case 'n':
                           nflag = 1;
                           break;
                 case 's':                  case 's':
                         sflag = 1;                          sflag = 1;
                         break;                          break;
Line 396 
Line 401 
         }          }
   
         if (!(rule->options & NOPASS)) {          if (!(rule->options & NOPASS)) {
                   if (nflag)
                           errx(1, "Authorization required");
                 if (!auth_userokay(myname, NULL, NULL, NULL)) {                  if (!auth_userokay(myname, NULL, NULL, NULL)) {
                         syslog(LOG_AUTHPRIV | LOG_NOTICE,                          syslog(LOG_AUTHPRIV | LOG_NOTICE,
                             "failed password for %s", myname);                              "failed password for %s", myname);

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26