Bug 582901

Summary: guestfish chmod/umask commands do not check invalid mode value
Product: [Community] Virtualization Tools Reporter: Pengzhen Cao <pcao>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: unspecifiedCC: mbooth, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-05-12 12:26:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Pengzhen Cao 2010-04-16 07:05:43 UTC
Description of problem:
when running chmod and umask command with an invalid number(negative or number >07777), there is no error message and the mode is set with the wrong value.
I believe other commands like mkdir-mode have same issue.

Version-Release number of selected component (if applicable):
libguestfs-1.0.85-1.fc12.3.x86_64, latest git version 1.3.3

How reproducible:
100%

Steps to Reproduce:
run umask or chmod with an invalid mode, such as 022222 or -1
  
Actual results:
wrong mode is set

Expected results:
should be error message say "out of range" etc

Additional info:


logs:
><fs> version
version
major: 1
minor: 3
release: 3
extra: 
><fs> umask 0000
umask 0
147
><fs> umask 0000
umask 0
0
><fs> umask 0002
umask 2
0
><fs> umask 0002
umask 2
2
><fs> umask -1
umask -1
2
><fs> umask 0000
umask 0
511
><fs> umask 08888
umask: mask: invalid integer parameter (xstrtoll returned 2)
><fs> umask 022222
umask 9362
0
><fs> umask 0000
umask 0
146
><fs> umask 022222
umask 9362
0
><fs> umask 022222
umask 9362
146
><fs> umask 022221
umask 9361
146
><fs> umask 0000
umask 0
145

Comment 2 Fedora Update System 2010-04-20 19:12:04 UTC
libguestfs-1.2.3-1.el5 has been submitted as an update for Fedora EPEL 5.
http://admin.fedoraproject.org/updates/libguestfs-1.2.3-1.el5

Comment 3 Fedora Update System 2010-04-20 22:25:33 UTC
libguestfs-1.2.3-1.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/libguestfs-1.2.3-1.fc13

Comment 4 Fedora Update System 2010-04-21 12:42:23 UTC
libguestfs-1.2.3-1.fc12.6 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/libguestfs-1.2.3-1.fc12.6

Comment 5 Fedora Update System 2010-05-21 00:31:15 UTC
libguestfs-1.2.3-1.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.