s3-waf: add check for realpath() NULL arg.
authorGünther Deschner <gd@samba.org>
Tue, 22 Feb 2011 10:57:23 +0000 (11:57 +0100)
committerGünther Deschner <gd@samba.org>
Tue, 22 Feb 2011 11:46:06 +0000 (12:46 +0100)
Guenther

source3/wscript

index ddfad069df8c3cb3c01cf873acf6aec43d594177..de626406c97985ebe57679bb1c28ddf2949a7c11 100644 (file)
@@ -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 <stdio.h>
+#include <limits.h>
+#include <signal.h>
+
+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