Skip to content

Commit 44a3b87

Browse files
author
Miklos Szeredi
committed
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: [email protected] Cc: [email protected] Signed-off-by: Miklos Szeredi <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
1 parent 9470451 commit 44a3b87

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: fs/utimes.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ long do_utimes(int dfd, const char __user *filename, struct timespec64 *times,
9595
goto out;
9696
}
9797

98-
if (flags & ~AT_SYMLINK_NOFOLLOW)
98+
if (flags & ~(AT_SYMLINK_NOFOLLOW | AT_EMPTY_PATH))
9999
goto out;
100100

101101
if (filename == NULL && dfd != AT_FDCWD) {
102102
struct fd f;
103103

104-
if (flags & AT_SYMLINK_NOFOLLOW)
104+
if (flags)
105105
goto out;
106106

107107
f = fdget(dfd);
@@ -117,6 +117,8 @@ long do_utimes(int dfd, const char __user *filename, struct timespec64 *times,
117117

118118
if (!(flags & AT_SYMLINK_NOFOLLOW))
119119
lookup_flags |= LOOKUP_FOLLOW;
120+
if (flags & AT_EMPTY_PATH)
121+
lookup_flags |= LOOKUP_EMPTY;
120122
retry:
121123
error = user_path_at(dfd, filename, lookup_flags, &path);
122124
if (error)

0 commit comments

Comments
 (0)