Bug 582901 - guestfish chmod/umask commands do not check invalid mode value
Summary: guestfish chmod/umask commands do not check invalid mode value
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-04-16 07:05 UTC by Pengzhen Cao
Modified: 2010-05-21 00:31 UTC (History)
2 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2010-05-12 12:26:09 UTC


Attachments (Terms of Use)

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.


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