Skip to content

Commit a3653bf

Browse files
committed
Check for issetugid (BSD function)
1 parent 143e960 commit a3653bf

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,7 @@ AC_CHECK_FUNCS(m4_normalize([
557557
getwd
558558
glob
559559
gmtime_r
560+
issetugid
560561
lchown
561562
localtime_r
562563
memcntl

main/php_glob.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,11 @@ static const Char *globtilde(const Char *pattern, Char *patbuf, size_t patbuf_le
460460
* handle a plain ~ or ~/ by expanding $HOME
461461
* first and then trying the password file
462462
*/
463+
#ifdef HAVE_ISSETUGID
463464
if (issetugid() != 0 || (h = getenv("HOME")) == NULL) {
465+
#else
466+
if ((h = getenv("HOME")) == NULL) {
467+
#endif
464468
getpwuid_r(getuid(), &pwstore, pwbuf, sizeof(pwbuf),
465469
&pwd);
466470
if (pwd == NULL)

0 commit comments

Comments
 (0)