生成fcgi(
https://github.com/lighttpd/spawn-fcgi
)是问题所在。
将此补丁应用于src/spawn fcgi.c并重新编译spawn fcgi。在我的例子中,我想运行需要root的nmap-sS。当开发人员决定让作为根用户的运行变得不可能时,这真的让我很恼火,因为这只是在浪费每个人的时间。总是添加一个标志,称之为“超级不安全”,如果你想的话,但至少要把它放在那里!
diff --git a/src/spawn-fcgi.c b/src/spawn-fcgi.c
index 2f320f7..27176d5 100644
--- a/src/spawn-fcgi.c
+++ b/src/spawn-fcgi.c
@@ -385,10 +385,10 @@ static int find_user_group(const char *user, const char *group, uid_t *uid, gid_
}
my_uid = my_pwd->pw_uid;
- if (my_uid == 0) {
+ /*if (my_uid == 0) {
fprintf(stderr, "spawn-fcgi: I will not set uid to 0\n");
return -1;
- }
+ }*/
if (username) *username = user;
} else {
@@ -407,18 +407,18 @@ static int find_user_group(const char *user, const char *group, uid_t *uid, gid_
}
my_gid = my_grp->gr_gid;
- if (my_gid == 0) {
+ /*if (my_gid == 0) {
fprintf(stderr, "spawn-fcgi: I will not set gid to 0\n");
return -1;
- }
+ }*/
}
} else if (my_pwd) {
my_gid = my_pwd->pw_gid;
- if (my_gid == 0) {
+ /*if (my_gid == 0) {
fprintf(stderr, "spawn-fcgi: I will not set gid to 0\n");
return -1;
- }
+ }*/
}
*uid = my_uid;