]> granicus.if.org Git - sudo/commitdiff
Sprinkle some volatile qualifiers to prevent over-enthusiastic
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 22 Nov 2002 19:41:13 +0000 (19:41 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 22 Nov 2002 19:41:13 +0000 (19:41 +0000)
optimizers from removing memset() calls.

auth/aix_auth.c
auth/bsdauth.c
auth/fwtk.c
auth/pam.c
auth/sudo_auth.c

index 0fae343e3082bfb7e0d82b43747faef92795056b..898af46be693447f1cc4af3e017222765a8e15e3 100644 (file)
@@ -70,13 +70,14 @@ aixauth_verify(pw, prompt, auth)
     char *prompt;
     sudo_auth *auth;
 {
-    char *message, *pass;
+    volatile char *pass;
+    char *message;
     int reenter = 1;
     int rval = AUTH_FAILURE;
 
     pass = tgetpass(prompt, def_ival(I_PASSWD_TIMEOUT) * 60, tgetpass_flags);
     if (pass) {
-       if (authenticate(pw->pw_name, pass, &reenter, &message) == 0)
+       if (authenticate(pw->pw_name, (char *)pass, &reenter, &message) == 0)
            rval = AUTH_SUCCESS;
        memset(pass, 0, strlen(pass));
     }
index 344176045efdb246b4d9dbd624e1608dfd86221d..77031e7affda4d0e11d0f20f2d0bf00af50007ac 100644 (file)
@@ -112,7 +112,8 @@ bsdauth_verify(pw, prompt, auth)
     char *prompt;
     sudo_auth *auth;
 {
-    char *s, *pass;
+    volatile char *pass;
+    char *s;
     size_t len;
     int authok = 0;
     sigaction_t sa, osa;
@@ -159,7 +160,7 @@ bsdauth_verify(pw, prompt, auth)
        nil_pw = 1;
 
     if (pass) {
-       authok = auth_userresponse(as, pass, 1);
+       authok = auth_userresponse(as, (char *)pass, 1);
        memset(pass, 0, strlen(pass));
     }
 
index 45031f75043599e125f52aa755f0441c81bf10e6..f4e38a7d373e5291526b3998fd3a5b684815ac20 100644 (file)
@@ -108,8 +108,8 @@ fwtk_verify(pw, prompt, auth)
     char *prompt;
     sudo_auth *auth;
 {
-    char *pass;                                /* Password from the user */
-    char buf[SUDO_PASS_MAX + 12];      /* General prupose buffer */
+    volatile char *pass;               /* Password from the user */
+    volatile char buf[SUDO_PASS_MAX + 12]; /* General prupose buffer */
     char resp[128];                    /* Response from the server */
     int error;
     extern int nil_pw;
index 48edc5a5d6d22c41b07b1b431e7b16b81d434457..9496063b928faa8cb603668453a3c821eed67f5b 100644 (file)
@@ -201,10 +201,10 @@ sudo_conv(num_msg, msg, response, appdata_ptr)
     struct pam_response **response;
     VOID *appdata_ptr;
 {
-    struct pam_response *pr;
+    volatile struct pam_response *pr;
     PAM_CONST struct pam_message *pm;
     const char *p = def_prompt;
-    char *pass;
+    volatile char *pass;
     int n;
     extern int nil_pw;
 
index 3661746b741e2cff140091abe8e68c91602d1cdb..0bb2e4396f25cf6a4f2752b7a61acd39916c7289 100644 (file)
@@ -113,7 +113,7 @@ verify_user(pw, prompt)
     int success = AUTH_FAILURE;
     int status;
     int flags;
-    char *p;
+    volatile char *p;
     sudo_auth *auth;
     sigaction_t sa, osa;
 
@@ -188,7 +188,7 @@ verify_user(pw, prompt)
            if (NEEDS_USER(auth))
                set_perms(PERM_USER);
 
-           success = auth->status = (auth->verify)(pw, p, auth);
+           success = auth->status = (auth->verify)(pw, (char *)p, auth);
 
            if (NEEDS_USER(auth))
                set_perms(PERM_ROOT);