This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 582901 - guestfish chmod/umask commands do not check invalid mode value
guestfish chmod/umask commands do not check invalid mode value
Status: CLOSED UPSTREAM
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
unspecified
All Linux
low Severity medium
: ---
: ---
Assigned To: Richard W.M. Jones
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-04-16 03:05 EDT by Pengzhen Cao
Modified: 2010-05-20 20:31 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-05-12 08:26:09 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Pengzhen Cao 2010-04-16 03:05:43 EDT
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 15:12:04 EDT
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 18:25:33 EDT
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 08:42:23 EDT
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-20 20:31:15 EDT
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.

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