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
PHP_FUNCTION(posix_getrlimit);
#endif
+#ifdef HAVE_INITGROUPS
+PHP_FUNCTION(posix_initgroups);
+#endif
+
PHP_FUNCTION(posix_get_last_error);
PHP_FUNCTION(posix_strerror);
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}
};
#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