Minor security fix.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@640 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -134,7 +134,20 @@ static int (*Setpag)(void);
|
|||||||
|
|
||||||
#include "dlfcn.h"
|
#include "dlfcn.h"
|
||||||
|
|
||||||
int aix_setup(void)
|
static
|
||||||
|
int
|
||||||
|
isSuid()
|
||||||
|
{
|
||||||
|
int uid = getuid();
|
||||||
|
int gid = getgid();
|
||||||
|
int euid = getegid();
|
||||||
|
int egid = getegid();
|
||||||
|
return (uid != euid) || (gid != egid);
|
||||||
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
int
|
||||||
|
aix_setup(void)
|
||||||
{
|
{
|
||||||
#ifdef STATIC_AFS_SYSCALLS
|
#ifdef STATIC_AFS_SYSCALLS
|
||||||
Pioctl = aix_pioctl;
|
Pioctl = aix_pioctl;
|
||||||
@@ -142,7 +155,10 @@ int aix_setup(void)
|
|||||||
#else
|
#else
|
||||||
void *ptr;
|
void *ptr;
|
||||||
char path[MaxPathLen], *p;
|
char path[MaxPathLen], *p;
|
||||||
if((p = getenv("AFSLIBPATH")) != NULL)
|
/*
|
||||||
|
* If we are root or running setuid don't trust AFSLIBPATH!
|
||||||
|
*/
|
||||||
|
if (getuid() != 0 && !isSuid() && (p = getenv("AFSLIBPATH")) != NULL)
|
||||||
strcpy(path, p);
|
strcpy(path, p);
|
||||||
else
|
else
|
||||||
sprintf(path, "%s/afslib.so", LIBDIR);
|
sprintf(path, "%s/afslib.so", LIBDIR);
|
||||||
|
Reference in New Issue
Block a user