lkml.org 
[lkml]   [2014]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH v2 1/2] include/uapi: Define AT_ABSOLUTE to allow only absolute paths
This way people can use existing functionality (passing an invalid value
for dirfd to allow only absolute paths in *at style functions) and be
compatible for the future if Linux ever adds in new AT_* flags.

Signed-off-by: Steven Stewart-Gallus <sstewartgallus00@mylangara.bc.ca>
---
include/uapi/linux/fcntl.h | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/fcntl.h b/include/uapi/linux/fcntl.h
index 074b886..c4c5705 100644
--- a/include/uapi/linux/fcntl.h
+++ b/include/uapi/linux/fcntl.h
@@ -38,9 +38,16 @@
#define DN_ATTRIB 0x00000020 /* File changed attibutes */
#define DN_MULTISHOT 0x80000000 /* Don't remove notifier */

+#define AT_FDABSOLUTE -1 /* Special value used to indicate
+ openat should not use any directory
+ and only accept absolute values.
+ Currently, other values work for this
+ but in the future that might
+ change. */
#define AT_FDCWD -100 /* Special value used to indicate
- openat should use the current
- working directory. */
+ openat should use the current
+ working directory. */
+
#define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */
#define AT_REMOVEDIR 0x200 /* Remove directory instead of
unlinking file. */
--
1.7.9.5



\
 
 \ /
  Last update: 2014-07-10 02:41    [W:0.031 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site