mirror of
https://github.com/3proxy/3proxy.git
synced 2025-02-24 02:55:40 +08:00
Use setreuid/setregid instead of setuid / setgid
This commit is contained in:
parent
a44a32c484
commit
f67c9a39f1
@ -1293,7 +1293,7 @@ static int h_plugin(int argc, unsigned char **argv){
|
|||||||
static int h_setuid(int argc, unsigned char **argv){
|
static int h_setuid(int argc, unsigned char **argv){
|
||||||
int res;
|
int res;
|
||||||
res = atoi((char *)argv[1]);
|
res = atoi((char *)argv[1]);
|
||||||
if(!res || setuid(res)) {
|
if(!res || setreuid(res,res)) {
|
||||||
fprintf(stderr, "Unable to set uid %d", res);
|
fprintf(stderr, "Unable to set uid %d", res);
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
@ -1304,7 +1304,7 @@ static int h_setgid(int argc, unsigned char **argv){
|
|||||||
int res;
|
int res;
|
||||||
|
|
||||||
res = atoi((char *)argv[1]);
|
res = atoi((char *)argv[1]);
|
||||||
if(!res || setgid(res)) {
|
if(!res || setregid(res,res)) {
|
||||||
fprintf(stderr, "Unable to set gid %d", res);
|
fprintf(stderr, "Unable to set gid %d", res);
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user