sas Sun Feb 9 16:28:50 2003 EDT Modified files: (Branch: PHP_4_3) /php4/main SAPI.c SAPI.h /php4/sapi/apache mod_php4.c /php4/sapi/thttpd thttpd.c Log: MFH 0/-1 changes Index: php4/main/SAPI.c diff -u php4/main/SAPI.c:1.155.2.5 php4/main/SAPI.c:1.155.2.6 --- php4/main/SAPI.c:1.155.2.5 Sun Feb 9 14:10:32 2003 +++ php4/main/SAPI.c Sun Feb 9 16:28:49 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: SAPI.c,v 1.155.2.5 2003/02/09 19:10:32 sniper Exp $ */ +/* $Id: SAPI.c,v 1.155.2.6 2003/02/09 21:28:49 sas Exp $ */ #include <ctype.h> #include <sys/stat.h> @@ -856,7 +856,7 @@ if (sapi_module.get_fd) { return sapi_module.get_fd(fd TSRMLS_CC); } else { - return -1; + return FAILURE; } } @@ -865,9 +865,29 @@ if (sapi_module.force_http_10) { return sapi_module.force_http_10(TSRMLS_C); } else { - return -1; + return FAILURE; + } +} + + +SAPI_API int sapi_get_target_uid(uid_t *obj TSRMLS_DC) +{ + if (sapi_module.get_target_uid) { + return sapi_module.get_target_uid(obj TSRMLS_CC); + } else { + return FAILURE; + } +} + +SAPI_API int sapi_get_target_gid(gid_t *obj TSRMLS_DC) +{ + if (sapi_module.get_target_gid) { + return sapi_module.get_target_gid(obj TSRMLS_CC); + } else { + return FAILURE; } } + /* * Local variables: Index: php4/main/SAPI.h diff -u php4/main/SAPI.h:1.87.2.4 php4/main/SAPI.h:1.87.2.5 --- php4/main/SAPI.h:1.87.2.4 Wed Jan 15 16:20:05 2003 +++ php4/main/SAPI.h Sun Feb 9 16:28:49 2003 @@ -190,6 +190,9 @@ SAPI_API int sapi_get_fd(int *fd TSRMLS_DC); SAPI_API int sapi_force_http_10(TSRMLS_D); +SAPI_API int sapi_get_target_uid(uid_t * TSRMLS_DC); +SAPI_API int sapi_get_target_gid(gid_t * TSRMLS_DC); + struct _sapi_module_struct { char *name; char *pretty_name; @@ -231,6 +234,9 @@ int (*get_fd)(int *fd TSRMLS_DC); int (*force_http_10)(TSRMLS_D); + + int (*get_target_uid)(uid_t * TSRMLS_DC); + int (*get_target_gid)(gid_t * TSRMLS_DC); }; Index: php4/sapi/apache/mod_php4.c diff -u php4/sapi/apache/mod_php4.c:1.146.2.3 php4/sapi/apache/mod_php4.c:1.146.2.4 --- php4/sapi/apache/mod_php4.c:1.146.2.3 Wed Jan 15 06:29:05 2003 +++ php4/sapi/apache/mod_php4.c Sun Feb 9 16:28:49 2003 @@ -17,9 +17,10 @@ | PHP 4.0 patches by Zeev Suraski <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: mod_php4.c,v 1.146.2.3 2003/01/15 11:29:05 sas Exp $ */ +/* $Id: mod_php4.c,v 1.146.2.4 2003/02/09 21:28:49 sas Exp $ */ #include "php_apache_http.h" +#include "http_conf_globals.h" #ifdef NETWARE #define SIGPIPE SIGINT @@ -354,9 +355,9 @@ if (fd >= 0) { if (nfd) *nfd = fd; - return 0; + return SUCCESS; } - return -1; + return FAILURE; } /* }}} */ @@ -368,7 +369,23 @@ r->proto_num = HTTP_VERSION(1,0); - return 0; + return SUCCESS; +} + +/* {{{ sapi_apache_get_target_uid + */ +static int sapi_apache_get_target_uid(uid_t *obj TSRMLS_DC) +{ + *obj = ap_user_id; + return SUCCESS; +} + +/* {{{ sapi_apache_get_target_gid + */ +static int sapi_apache_get_target_gid(gid_t *obj TSRMLS_DC) +{ + *obj = ap_group_id; + return SUCCESS; } /* {{{ sapi_module_struct apache_sapi_module @@ -415,7 +432,9 @@ NULL, /* exe location */ 0, /* ini ignore */ sapi_apache_get_fd, - sapi_apache_force_http_10 + sapi_apache_force_http_10, + sapi_apache_get_target_uid, + sapi_apache_get_target_gid }; /* }}} */ Index: php4/sapi/thttpd/thttpd.c diff -u php4/sapi/thttpd/thttpd.c:1.77.2.3 php4/sapi/thttpd/thttpd.c:1.77.2.4 --- php4/sapi/thttpd/thttpd.c:1.77.2.3 Fri Jan 17 14:11:38 2003 +++ php4/sapi/thttpd/thttpd.c Sun Feb 9 16:28:49 2003 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: thttpd.c,v 1.77.2.3 2003/01/17 19:11:38 sas Exp $ */ +/* $Id: thttpd.c,v 1.77.2.4 2003/02/09 21:28:49 sas Exp $ */ #include "php.h" #include "SAPI.h" @@ -349,7 +349,7 @@ static int sapi_thttpd_get_fd(int *nfd TSRMLS_DC) { if (nfd) *nfd = TG(hc)->conn_fd; - return 0; + return SUCCESS; } static sapi_module_struct thttpd_sapi_module = {
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php