diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2011-12-08 11:15:18 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2011-12-09 15:35:32 +0000 |
commit | 289645e80aebef0378ce69db5b0e847e8d6a28c6 (patch) | |
tree | a0e1efadbb1d10cfe05ddf95fdf5bd7e77f7a0d4 | |
parent | 270a26a3d24a6dd0b5553b66490979beb5d04ffc (diff) | |
download | libguestfs-289645e80aebef0378ce69db5b0e847e8d6a28c6.tar.gz libguestfs-289645e80aebef0378ce69db5b0e847e8d6a28c6.tar.xz libguestfs-289645e80aebef0378ce69db5b0e847e8d6a28c6.zip |
daemon: Allow utimens to work for directories (RHBZ#761451).
You don't need to open the file O_WRONLY in order to call futimens on
the file descriptor. Opening it O_WRONLY fails for directories.
Therefore open O_RDONLY instead.
(cherry picked from commit 31fba8d8033216f8a288e75fe3f575b73b9ef925)
-rw-r--r-- | daemon/utimens.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/daemon/utimens.c b/daemon/utimens.c index ae006c60..a9857db7 100644 --- a/daemon/utimens.c +++ b/daemon/utimens.c @@ -37,7 +37,7 @@ do_utimens (const char *path, int r; CHROOT_IN; - fd = open (path, O_WRONLY | O_NOCTTY); + fd = open (path, O_RDONLY | O_NOCTTY); CHROOT_OUT; if (fd == -1) { |