]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-solaris10-suser-replace-20061228
authorDale Ghent <daleg@umbc.edu>
Thu, 28 Dec 2006 21:50:58 +0000 (21:50 +0000)
committerDerrick Brashear <shadow@dementia.org>
Thu, 28 Dec 2006 21:50:58 +0000 (21:50 +0000)
FIXES 50246

suser is dead, long live suser

(cherry picked from commit 7756a870f37134d33d1c3ceb4ef780e0cfd4beb0)

src/afs/SOLARIS/osi_machdep.h
src/afs/afs_osi.c
src/afs/sysincludes.h

index b2731aee3a3892b70e97085c33e53dee16e1ffc2..eb94b2d7c8195be2324b897928eebd54d796735e 100644 (file)
@@ -60,8 +60,10 @@ extern void *afs_osi_Alloc_NoSleep(size_t size);
 #define gop_rdwr(rw,gp,base,len,offset,segflg,ioflag,ulimit,cr,aresid) \
   vn_rdwr((rw),(gp),(base),(len),(offset),(segflg),(ioflag),(ulimit),(cr),(aresid))
 
-#define        afs_suser(x)        suser(x)
 
+#if !defined(AFS_SUN510_ENV)
+#define        afs_suser(x)        suser(x)
+#endif
 
 #ifdef KERNEL
 /*
index 559657c411bb6d62eae8bb592fb0b476c870e87c..4fb288d22d49383c4e5296864edb46d45f6d6f6a 100644 (file)
@@ -589,10 +589,12 @@ shutdown_osi(void)
 
 #ifndef AFS_OBSD_ENV
 int
-afs_osi_suser(void *credp)
+afs_osi_suser(void *cr)
 {
-#if defined(AFS_SUN5_ENV)
-    return afs_suser(credp);
+#if defined(AFS_SUN510_ENV)
+    return (priv_policy(cr, PRIV_SYS_SUSER_COMPAT, B_FALSE, EPERM, NULL) == 0);
+#elif defined(AFS_SUN5_ENV)
+    return afs_suser(cr);
 #else
     return afs_suser(NULL);
 #endif
index 5326c057ee631e72527058d148fea739bfc6afa1..55ca2bb077115d5db5e5c68a1351197f8cf9986a 100644 (file)
@@ -215,6 +215,7 @@ typedef unsigned short etap_event_t;
 
 #ifdef AFS_SUN510_ENV
 #include <sys/cred_impl.h>
+#include <sys/policy.h>
 #endif
 
 #include "h/socket.h"