Bug 761451 - guestfs_utimens cannot set times on a directory
Summary: guestfs_utimens cannot set times on a directory
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-12-08 11:06 UTC by Richard W.M. Jones
Modified: 2011-12-08 11:16 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-08 11:16:33 UTC
Embargoed:


Attachments (Terms of Use)

Description Richard W.M. Jones 2011-12-08 11:06:41 UTC
Description of problem:

You can set times on ordinary files, as in this example:

$ guestfish -N fs -m /dev/sda1 -- \
    touch /foo : utimens /foo -1 -1 -1 -1

But the same call fails for a directory:

$ guestfish -N fs -m /dev/sda1 -- \
    mkdir /foo : utimens /foo -1 -1 -1 -1
libguestfs: error: utimens: open: /foo: Is a directory

The reason is that the current implementation of do_utimens
opens the path first, and the open fails with -EISDIR.

Version-Release number of selected component (if applicable):

1.15.10

How reproducible:

100%

Comment 1 Richard W.M. Jones 2011-12-08 11:16:33 UTC
Fixed in commit 31fba8d8033216f8a288e75fe3f575b73b9ef925.


Note You need to log in before you can comment on or make changes to this bug.