From: Günther Deschner Date: Tue, 22 Feb 2011 10:57:23 +0000 (+0100) Subject: s3-waf: add check for realpath() NULL arg. X-Git-Tag: tevent-0.9.11~371 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4fe3ecefa04d7ca1321109574014950503fca5b8;p=thirdparty%2Fsamba.git s3-waf: add check for realpath() NULL arg. Guenther --- diff --git a/source3/wscript b/source3/wscript index ddfad069df8..de626406c97 100644 --- a/source3/wscript +++ b/source3/wscript @@ -1268,6 +1268,27 @@ main() { dev_t dev = makedev(1,2); return 0; } addmain=False, msg='Checking whether the macro for makedev is available') + conf.CHECK_CODE(''' +#include +#include +#include + +void exit_on_core(int ignored) { + exit(1); +} + +main() { + char *newpath; + signal(SIGSEGV, exit_on_core); + newpath = realpath("/tmp", NULL); + exit((newpath != NULL) ? 0 : 1); +} +''', + 'REALPATH_TAKES_NULL', + addmain=False, + execute=True, + msg='Checking whether the realpath function allows a NULL argument') + default_static_modules=TO_LIST('''pdb_smbpasswd pdb_tdbsam pdb_wbc_sam auth_sam auth_unix auth_winbind auth_wbc auth_server auth_domain auth_builtin vfs_default