Clean up ftrustee, namspace and unxlog warning paths
This commit is contained in:
@@ -33,7 +33,7 @@ static gid_t *act_grouplist=NULL; /* first element is counter !! */
|
||||
|
||||
void set_default_guid(void)
|
||||
{
|
||||
seteuid(0);
|
||||
if (seteuid(0)) {}
|
||||
setgroups(0, NULL);
|
||||
if (setegid(default_gid) < 0 || seteuid(default_uid) < 0) {
|
||||
errorp(1, "set_default_guid, !! SecurityAbort !!",
|
||||
@@ -60,7 +60,7 @@ void set_guid(int gid, int uid)
|
||||
} else if (act_gid != gid || act_uid != uid) {
|
||||
struct passwd *pw = getpwuid(uid);
|
||||
if (NULL != pw) {
|
||||
seteuid(0);
|
||||
if (seteuid(0)) {}
|
||||
initgroups(pw->pw_name, gid);
|
||||
}
|
||||
act_gid = gid;
|
||||
@@ -124,8 +124,8 @@ int get_unix_access_rights(struct stat *stb, uint8 *unixname)
|
||||
euid=geteuid();
|
||||
rgid=getgid();
|
||||
|
||||
setreuid(act_uid,0);
|
||||
setgid(act_gid);
|
||||
if (setreuid(act_uid,0)) {}
|
||||
if (setgid(act_gid)) {}
|
||||
|
||||
if (!access(unixname, F_OK)) {
|
||||
|
||||
@@ -139,8 +139,8 @@ int get_unix_access_rights(struct stat *stb, uint8 *unixname)
|
||||
|
||||
/* mode |= get_unix_eff_rights(stb) & ~(R_OK|W_OK|X_OK); */
|
||||
}
|
||||
setgid(rgid);
|
||||
setreuid(ruid, euid);
|
||||
if (setgid(rgid)) {}
|
||||
if (setreuid(ruid, euid)) {}
|
||||
|
||||
return(mode);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user