sniper Mon May 9 08:16:11 2005 EDT
Modified files: (Branch: PHP_5_0)
/php-src/ext/posix config.m4 php_posix.h posix.c
Log:
MFH: - getlogin() / getgroups() are not necessarily available everywhere
http://cvs.php.net/diff.php/php-src/ext/posix/config.m4?r1=1.7&r2=1.7.14.1&ty=u
Index: php-src/ext/posix/config.m4
diff -u php-src/ext/posix/config.m4:1.7 php-src/ext/posix/config.m4:1.7.14.1
--- php-src/ext/posix/config.m4:1.7 Tue Mar 12 11:32:13 2002
+++ php-src/ext/posix/config.m4 Mon May 9 08:16:11 2005
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.7 2002/03/12 16:32:13 sas Exp $
+dnl $Id: config.m4,v 1.7.14.1 2005/05/09 12:16:11 sniper Exp $
dnl
PHP_ARG_ENABLE(posix,whether to enable POSIX-like functions,
@@ -9,5 +9,5 @@
AC_DEFINE(HAVE_POSIX, 1, [whether to include POSIX-like functions])
PHP_NEW_EXTENSION(posix, posix.c, $ext_shared)
- AC_CHECK_FUNCS(seteuid setegid setsid getsid setpgid getpgid ctermid mkfifo
getrlimit)
+ AC_CHECK_FUNCS(seteuid setegid setsid getsid setpgid getpgid ctermid mkfifo
getrlimit getlogin getgroups)
fi
http://cvs.php.net/diff.php/php-src/ext/posix/php_posix.h?r1=1.14&r2=1.14.2.1&ty=u
Index: php-src/ext/posix/php_posix.h
diff -u php-src/ext/posix/php_posix.h:1.14
php-src/ext/posix/php_posix.h:1.14.2.1
--- php-src/ext/posix/php_posix.h:1.14 Thu Jan 8 12:32:41 2004
+++ php-src/ext/posix/php_posix.h Mon May 9 08:16:11 2005
@@ -17,7 +17,7 @@
*/
-/* $Id: php_posix.h,v 1.14 2004/01/08 17:32:41 sniper Exp $ */
+/* $Id: php_posix.h,v 1.14.2.1 2005/05/09 12:16:11 sniper Exp $ */
#ifndef PHP_POSIX_H
#define PHP_POSIX_H
@@ -54,8 +54,12 @@
#ifdef HAVE_SETEGID
PHP_FUNCTION(posix_setegid);
#endif
+#ifdef HAVE_GETGROUPS
PHP_FUNCTION(posix_getgroups);
+#endif
+#ifdef HAVE_GETLOGIN
PHP_FUNCTION(posix_getlogin);
+#endif
/* POSIX.1, 4.3 */
PHP_FUNCTION(posix_getpgrp);
http://cvs.php.net/diff.php/php-src/ext/posix/posix.c?r1=1.60.2.2&r2=1.60.2.3&ty=u
Index: php-src/ext/posix/posix.c
diff -u php-src/ext/posix/posix.c:1.60.2.2 php-src/ext/posix/posix.c:1.60.2.3
--- php-src/ext/posix/posix.c:1.60.2.2 Thu Jan 27 20:39:35 2005
+++ php-src/ext/posix/posix.c Mon May 9 08:16:11 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: posix.c,v 1.60.2.2 2005/01/28 01:39:35 tony2001 Exp $ */
+/* $Id: posix.c,v 1.60.2.3 2005/05/09 12:16:11 sniper Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -70,8 +70,12 @@
#ifdef HAVE_SETEGID
PHP_FE(posix_setegid, NULL)
#endif
+#ifdef HAVE_GETGROUPS
PHP_FE(posix_getgroups, NULL)
+#endif
+#ifdef HAVE_GETLOGIN
PHP_FE(posix_getlogin, NULL)
+#endif
/* POSIX.1, 4.3 */
PHP_FE(posix_getpgrp, NULL)
@@ -131,7 +135,7 @@
static PHP_MINFO_FUNCTION(posix)
{
php_info_print_table_start();
- php_info_print_table_row(2, "Revision", "$Revision: 1.60.2.2 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.60.2.3 $");
php_info_print_table_end();
}
/* }}} */
@@ -293,6 +297,7 @@
/* {{{ proto array posix_getgroups(void)
Get supplementary group id's (POSIX.1, 4.2.3) */
+#ifdef HAVE_GETGROUPS
PHP_FUNCTION(posix_getgroups)
{
gid_t gidlist[NGROUPS_MAX];
@@ -312,10 +317,12 @@
add_next_index_long(return_value, gidlist[i]);
}
}
+#endif
/* }}} */
/* {{{ proto string posix_getlogin(void)
Get user name (POSIX.1, 4.2.4) */
+#ifdef HAVE_GETLOGIN
PHP_FUNCTION(posix_getlogin)
{
char *p;
@@ -329,6 +336,7 @@
RETURN_STRING(p, 1);
}
+#endif
/* }}} */
/* {{{ proto int posix_getpgrp(void)
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php