From 7756a870f37134d33d1c3ceb4ef780e0cfd4beb0 Mon Sep 17 00:00:00 2001 From: Dale Ghent Date: Thu, 28 Dec 2006 21:48:25 +0000 Subject: [PATCH] solaris10-suser-replace-20061228 FIXES 50246 suser is dead, long live suser --- src/afs/SOLARIS/osi_machdep.h | 4 +++- src/afs/afs_osi.c | 8 +++++--- src/afs/sysincludes.h | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/afs/SOLARIS/osi_machdep.h b/src/afs/SOLARIS/osi_machdep.h index b2731aee3..eb94b2d7c 100644 --- a/src/afs/SOLARIS/osi_machdep.h +++ b/src/afs/SOLARIS/osi_machdep.h @@ -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 /* diff --git a/src/afs/afs_osi.c b/src/afs/afs_osi.c index e962fb950..f469939a4 100644 --- a/src/afs/afs_osi.c +++ b/src/afs/afs_osi.c @@ -305,10 +305,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 diff --git a/src/afs/sysincludes.h b/src/afs/sysincludes.h index d0e369dae..51b2366ad 100644 --- a/src/afs/sysincludes.h +++ b/src/afs/sysincludes.h @@ -212,6 +212,7 @@ typedef unsigned short etap_event_t; #ifdef AFS_SUN510_ENV #include +#include #endif #include "h/socket.h" -- 2.39.5