[apparmor] [PATCH] define PATH_MAX when missing from limits.h

Kees Cook kees at ubuntu.com
Fri May 27 21:10:16 UTC 2011


Some non-Linux systems do not define PATH_MAX (Hurd). Since I have no
interest in supporting a fully dynamic PATH_MAX in AppArmor, work around
this by just defining a static value that matches Linux's limits.h value.

=== modified file 'libraries/libapparmor/src/kernel_interface.c'
--- libraries/libapparmor/src/kernel_interface.c	2011-05-02 20:38:12 +0000
+++ libraries/libapparmor/src/kernel_interface.c	2011-05-27 21:08:42 +0000
@@ -27,6 +27,11 @@
 #include <limits.h>
 #include <stdarg.h>
 
+/* some non-Linux systems do not define a static value */
+#ifndef PATH_MAX
+# define PATH_MAX 4096
+#endif
+
 #define symbol_version(real, name, version) \
 		__asm__ (".symver " #real "," #name "@" #version)
 #define default_symbol_version(real, name, version) \


-- 
Kees Cook
Ubuntu Security Team



More information about the AppArmor mailing list