]> granicus.if.org Git - sudo/commitdiff
Add support for -k flag with a command.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 15 Mar 2010 23:41:15 +0000 (19:41 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 15 Mar 2010 23:41:15 +0000 (19:41 -0400)
plugins/sudoers/check.c
plugins/sudoers/sudoers.c
plugins/sudoers/sudoers.h

index b380d5346647aaf5b955a38f0425cb34fca5df22..f6390d04bd51239563a0cff25eb9e225b8394dd9 100644 (file)
@@ -91,7 +91,7 @@ check_user(validated, mode)
     int status, rval = TRUE;
 
     /* Always prompt for a password when -k was specified with the command. */
-    if (ISSET(mode, MODE_INVALIDATE)) {
+    if (ISSET(mode, MODE_IGNORE_TICKET)) {
        SET(validated, FLAG_CHECK_USER);
     } else {
        if (user_uid == 0 || user_uid == runas_pw->pw_uid || user_is_exempt())
@@ -140,7 +140,7 @@ check_user(validated, mode)
        rval = verify_user(auth_pw, prompt);
     }
     /* Only update timestamp if user was validated. */
-    if (ISSET(validated, VALIDATE_OK) && !ISSET(mode, MODE_INVALIDATE) && status != TS_ERROR)
+    if (ISSET(validated, VALIDATE_OK) && !ISSET(mode, MODE_IGNORE_TICKET) && status != TS_ERROR)
        update_timestamp(timestampdir, timestampfile);
     efree(timestampdir);
     efree(timestampfile);
index 69f466cd528eef3128831156102bc75ef5d849fd..33c2e3c67395999dd7d5381031aabf8310b1ddeb 100644 (file)
@@ -1232,7 +1232,7 @@ deserialize_info(char * const settings[], char * const user_info[])
            continue;
        }
        if (MATCHES(*cur, "ignore_ticket=")) {
-           /* XXX */
+           SET(flags, MODE_IGNORE_TICKET);
            continue;
        }
        if (MATCHES(*cur, "login_class=")) {
index 74022082b2fdf6bbc1dbadd4b62b6e4c049d11fa..f77fa0b25c2ad7690db15819b754e8c65c488102 100644 (file)
@@ -130,6 +130,7 @@ struct sudo_user {
 #define MODE_PRESERVE_GROUPS   0x00200000
 #define MODE_PRESERVE_ENV      0x00400000
 #define MODE_NONINTERACTIVE    0x00800000
+#define MODE_IGNORE_TICKET     0x01000000
 
 /*
  * Used with set_perms()