summaryrefslogtreecommitdiffstats
path: root/support/suexec.c
diff options
context:
space:
mode:
authorManoj Kasichainula <manoj@apache.org>2000-10-23 17:30:57 +0200
committerManoj Kasichainula <manoj@apache.org>2000-10-23 17:30:57 +0200
commitb1fb90877e90fcf1a55f1ec129e31de12bf938e2 (patch)
tree9cfcad3f96739acbead64dbbf874ddbd80748d59 /support/suexec.c
parentLondon Sun. (diff)
downloadapache2-b1fb90877e90fcf1a55f1ec129e31de12bf938e2.tar.xz
apache2-b1fb90877e90fcf1a55f1ec129e31de12bf938e2.zip
Add back suexec support.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86712 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'support/suexec.c')
-rw-r--r--support/suexec.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/support/suexec.c b/support/suexec.c
index 84c17d7b61..b1d24e6d9b 100644
--- a/support/suexec.c
+++ b/support/suexec.c
@@ -77,6 +77,14 @@
#include "suexec.h"
+#if HAVE_PWD_H
+#include <pwd.h>
+#endif
+
+#if HAVE_GRP_H
+#include <grp.h>
+#endif
+
/*
***********************************************************************
* There is no initgroups() in QNX, so I believe this is safe :-)
@@ -319,9 +327,17 @@ int main(int argc, char *argv[])
/*
* Error out if the target username is invalid.
*/
- if ((pw = getpwnam(target_uname)) == NULL) {
- log_err("invalid target user name: (%s)\n", target_uname);
- exit(105);
+ if (strspn(target_uname, "1234567890") != strlen(target_uname)) {
+ if ((pw = getpwnam(target_uname)) == NULL) {
+ log_err("invalid target user name: (%s)\n", target_uname);
+ exit(105);
+ }
+ }
+ else {
+ if ((pw = getpwuid(atoi(target_uname))) == NULL) {
+ log_err("invalud target user id: (%s)\n", target_uname);
+ exit(121);
+ }
}
/*