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

Diff for /src/usr.bin/su/su.c between version 1.67 and 1.68

version 1.67, 2015/04/15 02:12:00 version 1.68, 2015/10/23 03:44:59
Line 73 
Line 73 
         uid_t ruid;          uid_t ruid;
         u_int flags;          u_int flags;
   
           if (pledge("stdio rpath getpw proc exec id", NULL) == -1)
                   err(1, "pledge");
   
         while ((ch = getopt(argc, argv, "a:c:fKLlms:-")) != -1)          while ((ch = getopt(argc, argv, "a:c:fKLlms:-")) != -1)
                 switch (ch) {                  switch (ch) {
                 case 'a':                  case 'a':
Line 212 
Line 215 
                 fprintf(stderr, "Login incorrect\n");                  fprintf(stderr, "Login incorrect\n");
         }          }
   
           if (pledge("stdio rpath exec id", NULL) == -1)
                   err(1, "pledge");
   
         if (!altshell) {          if (!altshell) {
                 if (asme) {                  if (asme) {
                         /* if asme and non-std target shell, must be root */                          /* if asme and non-std target shell, must be root */
Line 323 
Line 329 
         }          }
         if (setusercontext(lc, pwd, pwd->pw_uid, flags) != 0)          if (setusercontext(lc, pwd, pwd->pw_uid, flags) != 0)
                 auth_err(as, 1, "unable to set user context");                  auth_err(as, 1, "unable to set user context");
   
           if (pledge("stdio rpath exec", NULL) == -1)
                   err(1, "pledge");
   
         if (pwd->pw_uid && auth_approval(as, lc, pwd->pw_name, "su") <= 0)          if (pwd->pw_uid && auth_approval(as, lc, pwd->pw_name, "su") <= 0)
                 auth_err(as, 1, "approval failure");                  auth_err(as, 1, "approval failure");
         auth_close(as);          auth_close(as);

Legend:
Removed from v.1.67  
changed lines
  Added in v.1.68