diff options
author | Andreas Gruenbacher <andreas.gruenbacher@gmail.com> | 2015-04-13 11:56:05 +0200 |
---|---|---|
committer | Andreas Gruenbacher <andreas.gruenbacher@gmail.com> | 2015-04-13 12:06:29 +0200 |
commit | 124e431e677f5ed3c45f71105a6770ceb96199dd (patch) | |
tree | 37079c37d3845c25b976a50e84783e7ad0537ec8 /libacl | |
parent | 62ce6354ef5a8eb5644908748f79c8cd18474d4c (diff) | |
download | acl-124e431e677f5ed3c45f71105a6770ceb96199dd.tar.gz |
libacl: acl_set_file: Remove unnecesary racy check
Only directories can have default acls. This is checked in the kernel, and
unnecessarily also in acl_set_file. There is a window between checking the file
type and setting the acl, so the check in acl_set_file isn't even safe. Remove
it.
Reported by Lennart Poettering <lpoetter@redhat.com>.
Diffstat (limited to 'libacl')
-rw-r--r-- | libacl/acl_set_file.c | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/libacl/acl_set_file.c b/libacl/acl_set_file.c index 6821851..a7e368f 100644 --- a/libacl/acl_set_file.c +++ b/libacl/acl_set_file.c @@ -54,19 +54,6 @@ acl_set_file(const char *path_p, acl_type_t type, acl_t acl) return -1; } - if (type == ACL_TYPE_DEFAULT) { - struct stat st; - - if (stat(path_p, &st) != 0) - return -1; - - /* Only directories may have default ACLs. */ - if (!S_ISDIR(st.st_mode)) { - errno = EACCES; - return -1; - } - } - ext_acl_p = __acl_to_xattr(acl_obj_p, &size); if (!ext_acl_p) return -1; |