From 0c9b5884590e3cb6882a979b59dc718e0352a8d3 Mon Sep 17 00:00:00 2001 From: Dale Ghent Date: Thu, 28 Dec 2006 21:50:58 +0000 Subject: [PATCH] STABLE14-solaris10-suser-replace-20061228 FIXES 50246 suser is dead, long live suser (cherry picked from commit 7756a870f37134d33d1c3ceb4ef780e0cfd4beb0) --- 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 559657c41..4fb288d22 100644 --- a/src/afs/afs_osi.c +++ b/src/afs/afs_osi.c @@ -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 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" -- 2.39.5