mirror of
https://github.com/php/php-src.git
synced 2024-11-28 12:26:37 +08:00
Added posix_initgroups() function.
This commit is contained in:
parent
aae5df3ffd
commit
3b7be889d8
1
NEWS
1
NEWS
@ -43,6 +43,7 @@ PHP NEWS
|
||||
. Added readInnerXML(), readOuterXML(), readString(), setSchema(). (2.6.20+)
|
||||
. Changed to passing libxml options when loading reader.
|
||||
|
||||
- Added posix_initgroups() function. (Ilia)
|
||||
- Added allow_url_include ini directive to complement allow_url_fopen. (Rasmus)
|
||||
- Added automatic module globals management. (Dmitry)
|
||||
- Added RFC2397 (data: stream) support. (Marcus)
|
||||
|
@ -11,5 +11,5 @@ if test "$PHP_POSIX" = "yes"; then
|
||||
|
||||
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
|
||||
|
@ -110,6 +110,10 @@ PHP_FUNCTION(posix_getpwuid);
|
||||
PHP_FUNCTION(posix_getrlimit);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_INITGROUPS
|
||||
PHP_FUNCTION(posix_initgroups);
|
||||
#endif
|
||||
|
||||
PHP_FUNCTION(posix_get_last_error);
|
||||
PHP_FUNCTION(posix_strerror);
|
||||
|
||||
|
@ -134,6 +134,9 @@ zend_function_entry posix_functions[] = {
|
||||
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}
|
||||
};
|
||||
@ -1056,6 +1059,22 @@ PHP_FUNCTION(posix_strerror)
|
||||
|
||||
#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
|
||||
|
Loading…
Reference in New Issue
Block a user