cvs: php-src /ext/posix config.m4 php_posix.h posix.c

From: Date: Mon, 19 Jun 2006 02:19:45 +0000
Subject: cvs: php-src /ext/posix config.m4 php_posix.h posix.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-38786@lists.php.net to get a copy of this message
iliaa Mon Jun 19 02:19:45 2006 UTC Modified files: /php-src/ext/posix config.m4 php_posix.h posix.c Log: MFB: Added posix_initgroups() function. http://cvs.php.net/viewcvs.cgi/php-src/ext/posix/config.m4?r1=1.12&r2=1.13&diff_format=u Index: php-src/ext/posix/config.m4 diff -u php-src/ext/posix/config.m4:1.12 php-src/ext/posix/config.m4:1.13 --- php-src/ext/posix/config.m4:1.12 Thu Jun 30 13:39:42 2005 +++ php-src/ext/posix/config.m4 Mon Jun 19 02:19:45 2006 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.12 2005/06/30 13:39:42 sniper Exp $ +dnl $Id: config.m4,v 1.13 2006/06/19 02:19:45 iliaa Exp $ dnl PHP_ARG_ENABLE(posix,whether to enable POSIX-like functions, @@ -11,5 +11,5 @@ AC_CHECK_HEADERS(sys/mkdev.h) - AC_CHECK_FUNCS(seteuid setegid setsid getsid setpgid getpgid ctermid mkfifo mknod getrlimit getlogin getgroups makedev) + AC_CHECK_FUNCS(seteuid setegid setsid getsid setpgid getpgid ctermid mkfifo mknod getrlimit getlogin getgroups makedev initgroups) fi http://cvs.php.net/viewcvs.cgi/php-src/ext/posix/php_posix.h?r1=1.19&r2=1.20&diff_format=u Index: php-src/ext/posix/php_posix.h diff -u php-src/ext/posix/php_posix.h:1.19 php-src/ext/posix/php_posix.h:1.20 --- php-src/ext/posix/php_posix.h:1.19 Sun Jan 1 13:09:53 2006 +++ php-src/ext/posix/php_posix.h Mon Jun 19 02:19:45 2006 @@ -17,7 +17,7 @@ */ -/* $Id: php_posix.h,v 1.19 2006/01/01 13:09:53 sniper Exp $ */ +/* $Id: php_posix.h,v 1.20 2006/06/19 02:19:45 iliaa Exp $ */ #ifndef PHP_POSIX_H #define PHP_POSIX_H @@ -110,6 +110,10 @@ PHP_FUNCTION(posix_getrlimit); #endif +#ifdef HAVE_INITGROUPS +PHP_FUNCTION(posix_initgroups); +#endif + PHP_FUNCTION(posix_get_last_error); PHP_FUNCTION(posix_strerror); http://cvs.php.net/viewcvs.cgi/php-src/ext/posix/posix.c?r1=1.75&r2=1.76&diff_format=u Index: php-src/ext/posix/posix.c diff -u php-src/ext/posix/posix.c:1.75 php-src/ext/posix/posix.c:1.76 --- php-src/ext/posix/posix.c:1.75 Tue Jun 13 13:12:19 2006 +++ php-src/ext/posix/posix.c Mon Jun 19 02:19:45 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: posix.c,v 1.75 2006/06/13 13:12:19 dmitry Exp $ */ +/* $Id: posix.c,v 1.76 2006/06/19 02:19:45 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -134,6 +134,9 @@ PHP_FE(posix_get_last_error, NULL) PHP_FALIAS(posix_errno, posix_get_last_error, NULL) PHP_FE(posix_strerror, NULL) +#ifdef HAVE_INITGROUPS + PHP_FE(posix_initgroups, NULL) +#endif {NULL, NULL, NULL} }; @@ -144,7 +147,7 @@ static PHP_MINFO_FUNCTION(posix) { php_info_print_table_start(); - php_info_print_table_row(2, "Revision", "$Revision: 1.75 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.76 $"); php_info_print_table_end(); } /* }}} */ @@ -1050,6 +1053,22 @@ #endif +/* {{{ proto bool initgroups(string name, int base_group_id) + Calculate the group access list for the user specified in name. */ +PHP_FUNCTION(posix_initgroups) +{ + long basegid; + char *name; + int name_len; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &name, &name_len, &basegid) == FAILURE) { + RETURN_FALSE; + } + + RETURN_BOOL(!initgroups((const char *)name, basegid)); +} +/* }}} */ + /* * Local variables: * tab-width: 4

« previous php.cvs (#38786) next »