]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
aix-curpag-redux-20071213
authorDerrick Brashear <shadow@dementia.org>
Thu, 13 Dec 2007 21:21:56 +0000 (21:21 +0000)
committerDerrick Brashear <shadow@dementia.org>
Thu, 13 Dec 2007 21:21:56 +0000 (21:21 +0000)
LICENSE IPL10

add curpag() support for aix, based on work by tom keiser

src/auth/ktc.c
src/pam/afs_util.c
src/sys/pagsh.c

index 0c43582b05aa1c9b8fe6ce5970604fbd6fe7e7ba..b2d1831ef477e585a6240677200c860c390402bd 100644 (file)
@@ -56,6 +56,7 @@ RCSID
 #include <sys/lockf.h>
 #ifdef AFS_AIX51_ENV
 #include <sys/cred.h>
+#include <sys/pag.h>
 #endif
 #endif
 #ifdef HAVE_UNISTD_H
@@ -1614,11 +1615,10 @@ static afs_uint32
 curpag(void)
 {
 #if defined(AFS_AIX51_ENV)
-    afs_int32 pag;
-
-    if (get_pag(PAG_AFS, &pag) < 0 || pag == 0)
-        pag = NOPAG;
-    return pag;
+    int code = getpagvalue("afs");
+    if (code < 0 && errno == EINVAL)
+       code = 0;
+    return code;
 #else
     gid_t groups[NGROUPS_MAX];
     afs_uint32 g0, g1;
index ec43656c4ecd111663c91d95a8d7a46c1f036274..6a28cf309ae83a19bcb0d5ae9d722944cdc2f062 100644 (file)
@@ -21,6 +21,7 @@
 #include <stdlib.h>
 #ifdef AFS_AIX51_ENV
 #include <sys/cred.h>
+#include <sys/pag.h>
 #endif
 
 RCSID
@@ -177,6 +178,12 @@ do_klog(const char *user, const char *password, const char *lifetime,
 static afs_int32
 curpag(void)
 {
+#if defined(AFS_AIX51_ENV)
+    int code = getpagvalue("afs");
+    if (code < 0 && errno == EINVAL)
+        code = 0;
+    return code;
+#else
     gid_t groups[NGROUPS_MAX];
     afs_uint32 g0, g1;
     afs_uint32 h, l, ret;
@@ -200,6 +207,7 @@ curpag(void)
            return -1;
     }
     return -1;
+#endif
 }
 
 /* Returns the AFS pag number, if any, otherwise return -1 */
index 1fe881127b9c8d003fe3b6a74347accd3ce9e4e2..4ab86362370208b238bb27b48dd1d5d460e05261 100644 (file)
@@ -17,6 +17,8 @@ RCSID
 #include <signal.h>
 #ifdef AFS_AIX51_ENV
 #include <sys/cred.h>
+#include <sys/pag.h>
+#include <errno.h>
 #endif
 #endif
 #include <stdio.h>
@@ -88,11 +90,10 @@ static afs_uint32
 curpag(void)
 {
 #if defined(AFS_AIX51_ENV)
-    afs_int32 pag;
-
-    if (get_pag(PAG_AFS, &pag) < 0 || pag == 0)
-        pag = -1;
-    return pag;
+    int code = getpagvalue("afs");
+    if (code < 0 && errno == EINVAL)
+       code = 0;
+    return code;
 #else
     afs_uint32 groups[NGROUPS_MAX];
     afs_uint32 g0, g1;