From 22a8c3113bbd6e4d7015f1bffc8be5d091789566 Mon Sep 17 00:00:00 2001 From: foobar Date: Mon, 10 Apr 2006 11:56:18 +0000 Subject: [PATCH] MFH: - Fixed bug #36909 (ld: Undefined symbols: _lchown) --- TSRM/tsrm_virtual_cwd.h | 4 ++++ ext/standard/filestat.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/TSRM/tsrm_virtual_cwd.h b/TSRM/tsrm_virtual_cwd.h index 5ad435d274..b92f0f2875 100644 --- a/TSRM/tsrm_virtual_cwd.h +++ b/TSRM/tsrm_virtual_cwd.h @@ -243,8 +243,10 @@ extern virtual_cwd_globals cwd_globals; #define VCWD_CHMOD(path, mode) virtual_chmod(path, mode TSRMLS_CC) #if !defined(TSRM_WIN32) && !defined(NETWARE) #define VCWD_CHOWN(path, owner, group) virtual_chown(path, owner, group, 0 TSRMLS_CC) +#if HAVE_LCHOWN #define VCWD_LCHOWN(path, owner, group) virtual_chown(path, owner, group, 1 TSRMLS_CC) #endif +#endif #else @@ -286,8 +288,10 @@ extern virtual_cwd_globals cwd_globals; #define VCWD_CHMOD(path, mode) chmod(path, mode) #if !defined(TSRM_WIN32) && !defined(NETWARE) #define VCWD_CHOWN(path, owner, group) chown(path, owner, group) +#if HAVE_LCHOWN #define VCWD_LCHOWN(path, owner, group) lchown(path, owner, group) #endif +#endif #endif diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 93945e00b4..845b1c574d 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -358,7 +358,9 @@ static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) } if (do_lchgrp) { +#if HAVE_LCHOWN ret = VCWD_LCHOWN(Z_STRVAL_PP(filename), -1, gid); +#endif } else { ret = VCWD_CHOWN(Z_STRVAL_PP(filename), -1, gid); } @@ -432,7 +434,9 @@ static void php_do_chown(INTERNAL_FUNCTION_PARAMETERS, int do_lchown) } if (do_lchown) { +#if HAVE_LCHOWN ret = VCWD_LCHOWN(Z_STRVAL_PP(filename), uid, -1); +#endif } else { ret = VCWD_CHOWN(Z_STRVAL_PP(filename), uid, -1); } -- 2.50.1