diff options
author | Manoj Kasichainula <manoj@apache.org> | 2000-10-23 17:30:57 +0200 |
---|---|---|
committer | Manoj Kasichainula <manoj@apache.org> | 2000-10-23 17:30:57 +0200 |
commit | b1fb90877e90fcf1a55f1ec129e31de12bf938e2 (patch) | |
tree | 9cfcad3f96739acbead64dbbf874ddbd80748d59 /os | |
parent | London Sun. (diff) | |
download | apache2-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 'os')
-rw-r--r-- | os/beos/os.c | 9 | ||||
-rw-r--r-- | os/bs2000/os.c | 9 | ||||
-rw-r--r-- | os/os2/util_os2.c | 8 | ||||
-rw-r--r-- | os/tpf/os.c | 8 | ||||
-rw-r--r-- | os/unix/Makefile.in | 2 | ||||
-rw-r--r-- | os/unix/unixd.c | 15 | ||||
-rw-r--r-- | os/unix/unixd.h | 2 |
7 files changed, 51 insertions, 2 deletions
diff --git a/os/beos/os.c b/os/beos/os.c index 9b2f647dcf..b040432a1f 100644 --- a/os/beos/os.c +++ b/os/beos/os.c @@ -63,8 +63,17 @@ #include "ap_config.h" #include "os.h" +#include "httpd.h" int ap_os_is_path_absolute(const char *file) { return file[0] == '/'; } + +AP_DECLARE(apr_status_t) ap_os_create_privileged_process(const request_rec *r, + apr_proc_t *newproc, const char *progname, + char *const *args, char **env, + apr_procattr_t *attr, apr_pool_t *p) +{ + return apr_create_process(newproc, progname, args, env, attr, p); +} diff --git a/os/bs2000/os.c b/os/bs2000/os.c index 2ad3a49669..72f7664057 100644 --- a/os/bs2000/os.c +++ b/os/bs2000/os.c @@ -64,6 +64,7 @@ #include "httpd.h" #include "http_core.h" #include "os.h" +#include "httpd.h" /* Check the Content-Type to decide if conversion is needed */ int ap_checkconv(struct request_rec *r) @@ -102,3 +103,11 @@ int ap_checkconv(struct request_rec *r) return convert_to_ascii; } +AP_DECLARE(apr_status_t) ap_os_create_privileged_process(const request_rec *r, + apr_proc_t *newproc, const char *progname, + char *const *args, char **env, + apr_procattr_t *attr, apr_pool_t *p) +{ + return apr_create_process(newproc, progname, args, env, attr, p); +} + diff --git a/os/os2/util_os2.c b/os/os2/util_os2.c index 8d0a5014b5..637eca4642 100644 --- a/os/os2/util_os2.c +++ b/os/os2/util_os2.c @@ -170,3 +170,11 @@ char *ap_os_canonical_filename(apr_pool_t *pPool, const char *szFile) strlwr(szCanonicalFile); return szCanonicalFile; } + +AP_DECLARE(apr_status_t) ap_os_create_privileged_process(const request_rec *r, + apr_proc_t *newproc, const char *progname, + char *const *args, char **env, + apr_procattr_t *attr, apr_pool_t *p) +{ + return apr_create_process(newproc, progname, args, env, attr, p); +} diff --git a/os/tpf/os.c b/os/tpf/os.c index 3833d9957b..a8af4bdaea 100644 --- a/os/tpf/os.c +++ b/os/tpf/os.c @@ -412,4 +412,10 @@ void os_tpf_child(APACHE_TPF_INPUT *input_parms) { ap_restart_time = input_parms->restart_time; } - +AP_DECLARE(apr_status_t) ap_os_create_privileged_process(const request_rec *r, + apr_proc_t *newproc, const char *progname, + char *const *args, char **env, + apr_procattr_t *attr, apr_pool_t *p) +{ + return apr_create_process(newproc, progname, args, env, attr, p); +} diff --git a/os/unix/Makefile.in b/os/unix/Makefile.in index 63596967db..521f298464 100644 --- a/os/unix/Makefile.in +++ b/os/unix/Makefile.in @@ -1,5 +1,5 @@ LTLIBRARY_NAME = libos.la -LTLIBRARY_SOURCES = os-inline.c unixd.c +LTLIBRARY_SOURCES = os-inline.c unixd.c suexec.c include $(top_srcdir)/build/ltlib.mk diff --git a/os/unix/unixd.c b/os/unix/unixd.c index caa87fe45d..d70b3fd5cc 100644 --- a/os/unix/unixd.c +++ b/os/unix/unixd.c @@ -68,6 +68,8 @@ #ifdef HAVE_SYS_RESOURCE_H #include <sys/resource.h> #endif +/* XXX */ +#include <sys/stat.h> #ifdef HAVE_UNISTD_H #include <unistd.h> #endif @@ -214,9 +216,22 @@ const char *unixd_set_group(cmd_parms *cmd, void *dummy, const char *arg) void unixd_pre_config(apr_pool_t *ptemp) { + apr_finfo_t wrapper; + unixd_config.user_name = DEFAULT_USER; unixd_config.user_id = ap_uname2id(DEFAULT_USER); unixd_config.group_id = ap_gname2id(DEFAULT_GROUP); + + /* Check for suexec */ + unixd_config.suexec_enabled = 0; + if ((apr_stat(&wrapper, SUEXEC_BIN, ptemp)) != APR_SUCCESS) { + return; + } + + /* XXX - apr_stat is incapable of checking suid bits (grumble) */ + /* if ((wrapper.filetype & S_ISUID) && wrapper.user == 0) { */ + unixd_config.suexec_enabled = 1; + /* } */ } #ifdef NEED_AP_SYS_SIGLIST diff --git a/os/unix/unixd.h b/os/unix/unixd.h index 0fdfcc2715..d8ac46f87b 100644 --- a/os/unix/unixd.h +++ b/os/unix/unixd.h @@ -60,6 +60,7 @@ #define UNIXD_H #include "httpd.h" +#include "http_config.h" #ifdef HAVE_SYS_RESOURCE_H #include <sys/resource.h> #endif @@ -80,6 +81,7 @@ typedef struct { const char *user_name; uid_t user_id; gid_t group_id; + int suexec_enabled; } unixd_config_rec; extern unixd_config_rec unixd_config; |