summaryrefslogtreecommitdiff
path: root/libacl/acl_extended_file_nofollow.c
diff options
context:
space:
mode:
authorKamil Dudka <kdudka@redhat.com>2011-04-04 12:43:39 +0200
committerAndreas Gruenbacher <agruen@linbit.com>2011-04-04 18:40:55 +0200
commit6bf5e24d48077db58b389e90558100fc121b8134 (patch)
treefc760711729113152560c1aae6b9e800d935d80f /libacl/acl_extended_file_nofollow.c
parentcd31bafa745bb0603a26a39ad8d7e4abd2756c10 (diff)
downloadacl-6bf5e24d48077db58b389e90558100fc121b8134.tar.gz
libacl: Add acl_extended_file_nofollow()
This function calls lgetxattr() instead of getxattr(), which helps ls(1) to prevent unnecessary automatic mounts, which acl_extended_file() triggers. See the following bug report for more details: https://bugzilla.redhat.com/692982
Diffstat (limited to 'libacl/acl_extended_file_nofollow.c')
-rw-r--r--libacl/acl_extended_file_nofollow.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/libacl/acl_extended_file_nofollow.c b/libacl/acl_extended_file_nofollow.c
new file mode 100644
index 0000000..8f4711f
--- /dev/null
+++ b/libacl/acl_extended_file_nofollow.c
@@ -0,0 +1,34 @@
+/*
+ File: acl_extended_file.c
+
+ Copyright (C) 2011
+ Andreas Gruenbacher, <a.gruenbacher@bestbits.at>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include <unistd.h>
+#include <attr/xattr.h>
+#include "libacl.h"
+
+#include "__acl_extended_file.h"
+
+
+int
+acl_extended_file_nofollow(const char *path_p)
+{
+ return __acl_extended_file(path_p, lgetxattr);
+}
+