]> granicus.if.org Git - sudo/commitdiff
Fix AIX compilation problems.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 16 Jun 2010 19:35:28 +0000 (15:35 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 16 Jun 2010 19:35:28 +0000 (15:35 -0400)
--HG--
branch : 1.7

aix.c
pwutil.c
set_perms.c
sudo.h

diff --git a/aix.c b/aix.c
index e70abb71a4d82aaa352099a6edf2560fc56c437e..d2f2f66a8476c18a6469d1a2a14522b4c2efd711 100644 (file)
--- a/aix.c
+++ b/aix.c
@@ -29,6 +29,7 @@
 # endif
 #endif /* STDC_HEADERS */
 #include <usersec.h>
+#include <uinfo.h>
 
 #include <compat.h>
 
@@ -163,15 +164,16 @@ aix_restoreauthdb()
 {
     if (saved_authsys[0]) {
        if (setauthdb(saved_authsys, NULL) != 0)
-           error(1, "unable to restore authsystem \"%s\", saved_authsys);
+           error(1, "unable to restore authsystem \"%s\"", saved_authsys);
        saved_authsys[0] = '\0';
     }
 }
 #endif
 
 void
-aix_prep_user(user)
+aix_prep_user(user, tty)
     char *user;
+    char *tty;
 {
     char *info;
     int len;
@@ -179,7 +181,7 @@ aix_prep_user(user)
     /* set usrinfo, like login(1) does */
     /* XXX - should NAME field be pw_gecos? */
     len = easprintf(&info, "NAME=%s%cLOGIN=%s%cLOGNAME=%s%cTTY=%s%c",
-       user, '\0', user, '\0', user, '\0', user_ttypath ? user_ttypath : "");
+       user, '\0', user, '\0', user, '\0', tty ? tty : "");
     (void)usrinfo(SETUINFO, info, len);
     efree(info);
 
index 2895e70cda1d81f3198f633d5f54d6510063f4d1..3b06b06ddc178fcc89095478ba003a65f8e482ac 100644 (file)
--- a/pwutil.c
+++ b/pwutil.c
@@ -225,7 +225,7 @@ sudo_getpwnam(name)
      * Cache passwd db entry if it exists or a negative response if not.
      */
 #ifdef HAVE_SETAUTHDB
-    aix_setauthdb(user);
+    aix_setauthdb(name);
 #endif
     if ((pw = getpwnam(name)) != NULL) {
        pw = sudo_pwdup(pw);
@@ -573,7 +573,7 @@ user_in_group(pw, group)
     struct group *grp;
 
 #ifdef HAVE_SETAUTHDB
-    aix_setauthdb(pw->pw_user);
+    aix_setauthdb(pw->pw_name);
 #endif
     grp = sudo_getgrnam(group);
 #ifdef HAVE_SETAUTHDB
index a8d6301e6f830ec9b7d9e7cb4878ece61ca67b76..cb08385614e815a8ac3933e61b7d6196dd314b97 100644 (file)
@@ -554,7 +554,7 @@ runas_setup(dowait)
     if (runas_pw->pw_name != NULL) {
        gid = runas_gr ? runas_gr->gr_gid : runas_pw->pw_gid;
 #ifdef HAVE_GETUSERATTR
-       aix_prep_user(runas_pw->pw_name);
+       aix_prep_user(runas_pw->pw_name, user_ttypath);
 #endif
 #ifdef HAVE_PAM
        pam_begin_session(runas_pw);
diff --git a/sudo.h b/sudo.h
index 5915e03f782af1cd5fbc0892c75ea5473d81c10b..d62b359b9c1313f1b8d002c0013b0598b10a1202 100644 (file)
--- a/sudo.h
+++ b/sudo.h
@@ -211,7 +211,7 @@ struct passwd;
 struct stat;
 
 /* aix.c */
-void aix_prep_user __P((char *));
+void aix_prep_user __P((char *, char *));
 
 /* boottime.c */
 int get_boottime __P((struct timeval *));