Bug 557655
Summary: | guestfish number parsing should not use atoi, should support '0...' for octal and '0x...' for hexadecimal | ||
---|---|---|---|
Product: | [Community] Virtualization Tools | Reporter: | Benjamin Gilbert <bgilbert> |
Component: | libguestfs | Assignee: | Richard W.M. Jones <rjones> |
Status: | CLOSED UPSTREAM | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | unspecified | CC: | mbooth, meyering, 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-01-25 12:56:03 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
Benjamin Gilbert
2010-01-22 04:04:55 UTC
Yes I agree this is a bug. At the moment the code does: mode = atoi (argv[0]); which is wrong on several levels. Jim, it seems sensible to ask which gnulib function I should be using here. Hi Rich, xstrtoul should do the trick. Patch posted upstream: http://www.redhat.com/archives/libguestfs/2010-January/msg00020.html This still violates the principle of least surprise. The chmod command-line program doesn't require the leading 0, so users will omit it here too and will get nonsensical file modes. Is it really useful to be able to specify file modes in decimal or hex? See: http://libguestfs.org/FAQ.html#rescue We can cover this in the documentation, but guestfish isn't like bash, and chmod in guestfish is a wrapper around guestfs_chmod, not the chmod program, so it behaves a bit differently (but consistent with other guestfish commands). I updated the patch to add a note to the 'chmod' command in the guestfish manual page. Updated patch posted upstream: http://www.redhat.com/archives/libguestfs/2010-January/msg00022.html Fixed upstream: http://git.annexia.org/?p=libguestfs.git;a=commitdiff;h=58abe782bf7137526b4a5c7e6d5d2b145e3b09d2 This fix will be in 1.0.82. |