#define PATH_MAX 4096
#endif
-int main()
-{
+int realpath_returns_]]ret_t[[() {
]]ret_t[[ r;
char p[8] = "/bin/sh\000";
char resv[PATH_MAX];
}
return res;
}
+
+int main()
+{
+ return realpath_returns_]]ret_t[[();
+}
]])],
resvar[=yes],
resvar[=no],
#define FOLLOW_FREE_STRATEGY 1
#define FOLLOW_REALLOC_STRATEGY 1
-int main()
+int owner_of_object_returned_by_realpath()
{
void *r; /* any pointer is just fine */
char p[8] = "/bin/sh\000";
#else
return 1;
#endif
+}
+
+int main()
+{
+ return owner_of_object_returned_by_realpath();
}
]])],
resvar[=user],
#define PATH_MAX 4096
#endif
-int main()
+int realpath_can_operate_on_protected_mem_blocks()
{
char resv[PATH_MAX];
realpath("/bin/sh", NULL);
realpath("/bin/sh", resv);
return 0;
}
+
+int main()
+{
+ return realpath_can_operate_on_protected_mem_blocks();
+}
]])],
resvar[=yes],
resvar[=no],
static char p[24] = "/nobody/has/this/file\000";
-int main()
+int realpath_survives_non_existent_path()
{
char *r;
char resv[PATH_MAX];
return ((r == NULL) == 0);
}
+
+int main()
+{
+ return realpath_survives_non_existent_path();
+}
]])],
resvar[=yes],
resvar[=no],
# include <libgen.h>
#endif
-int main()
+int dirname_modifies_argument()
{
char p[11] = "somefile\000";
dirname(p);
return ((p[0] == '.' && p[1] == '\0') == 0);
}
+
+int main()
+{
+ return dirname_modifies_argument();
+}
]])],
resvar[=yes],
resvar[=no],
## anything ... took me fucking ages to find out what's going on
## so let's drink to the morons responsible for THAT!
AC_MSG_CHECKING([to whom belongs the object returned by dirname])
+ if test "$opsys" = "darwin" ; then
+ resvar=sys
+ else
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#ifdef HAVE_LIBGEN_H
# include <libgen.h>
#define FOLLOW_FREE_STRATEGY 1
#define FOLLOW_REALLOC_STRATEGY 1
-int main()
+int owner_of_object_returned_by_dirname()
{
void *r; /* any pointer is just fine */
char p[11] = "./somefile\000";
#else
return 1;
#endif
+}
+
+int main()
+{
+ return owner_of_object_returned_by_dirname();
}
]])],
resvar[=user],
resvar[=sys],
resvar[=sys])
+ fi
if test "${malloc_check}" = "" ; then
unset MALLOC_CHECK_
else
# include <libgen.h>
#endif
-int main()
+int dirname_can_operate_on_protected_mem_blocks()
{
dirname("./somefile");
return 0;
}
+
+int main()
+{
+ return dirname_can_operate_on_protected_mem_blocks();
+}
]])],
resvar[=yes],
resvar[=no],
static char f[11] = "./somefile\000";
-int main()
+int dirname_can_operate_on_c99_restrict()
{
const char *restrict p = &f;
dirname((char*)p);
return 0;
}
+
+int main()
+{
+ return dirname_can_operate_on_c99_restrict();
+}
]])],
resvar[=yes],
resvar[=no],