diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2020-05-14 16:44:24 +0200 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2020-05-14 16:44:24 +0200 |
commit | 44a3b87444058b2cb055092cdebc63858707bf66 (patch) | |
tree | 5e4f969f0b34d36de230a06b66615f9ff57c7d74 /fs/utimes.c | |
parent | 9470451505efbcc9eef2d7e74251e6402f5ea385 (diff) | |
download | linux-stable-44a3b87444058b2cb055092cdebc63858707bf66.tar.gz linux-stable-44a3b87444058b2cb055092cdebc63858707bf66.tar.bz2 linux-stable-44a3b87444058b2cb055092cdebc63858707bf66.zip |
utimensat: AT_EMPTY_PATH support
This makes it possible to use utimensat on an O_PATH file (including
symlinks).
It supersedes the nonstandard utimensat(fd, NULL, ...) form.
Cc: linux-api@vger.kernel.org
Cc: linux-man@vger.kernel.org
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/utimes.c')
-rw-r--r-- | fs/utimes.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/utimes.c b/fs/utimes.c index 1d17ce98cb80..b7b927502d6e 100644 --- a/fs/utimes.c +++ b/fs/utimes.c @@ -95,13 +95,13 @@ long do_utimes(int dfd, const char __user *filename, struct timespec64 *times, goto out; } - if (flags & ~AT_SYMLINK_NOFOLLOW) + if (flags & ~(AT_SYMLINK_NOFOLLOW | AT_EMPTY_PATH)) goto out; if (filename == NULL && dfd != AT_FDCWD) { struct fd f; - if (flags & AT_SYMLINK_NOFOLLOW) + if (flags) goto out; f = fdget(dfd); @@ -117,6 +117,8 @@ long do_utimes(int dfd, const char __user *filename, struct timespec64 *times, if (!(flags & AT_SYMLINK_NOFOLLOW)) lookup_flags |= LOOKUP_FOLLOW; + if (flags & AT_EMPTY_PATH) + lookup_flags |= LOOKUP_EMPTY; retry: error = user_path_at(dfd, filename, lookup_flags, &path); if (error) |