From: Dale Ghent Date: Thu, 28 Dec 2006 21:49:33 +0000 (+0000) Subject: DEVEL15-solaris10-suser-replace-20061228 X-Git-Tag: openafs-devel-1_5_14~45 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=7f93f8262e19d62c2bd962a3c9426684cf56645f;p=packages%2Fo%2Fopenafs.git DEVEL15-solaris10-suser-replace-20061228 FIXES 50246 suser is dead, long live suser (cherry picked from commit 7756a870f37134d33d1c3ceb4ef780e0cfd4beb0) --- 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 5326c057e..55ca2bb07 100644 --- a/src/afs/sysincludes.h +++ b/src/afs/sysincludes.h @@ -215,6 +215,7 @@ typedef unsigned short etap_event_t; #ifdef AFS_SUN510_ENV #include +#include #endif #include "h/socket.h"