Bug 761451

Summary: guestfs_utimens cannot set times on a directory
Product: [Community] Virtualization Tools Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED UPSTREAM QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: mbooth, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-08 11:16:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.