[Libguestfs] [PATCH version 2] guestfish: Use xstrtol to parse integers (RHBZ#557655).

Jim Meyering jim at meyering.net
Mon Jan 25 12:19:03 UTC 2010


Richard W.M. Jones wrote:
> On Mon, Jan 25, 2010 at 01:05:32PM +0100, Jim Meyering wrote:
>> Richard W.M. Jones wrote:
>> > + chmod 0777 /public  # OK
>> > + chmod 777 /public   # WRONG! This is mode 777 decimal = 01411 octal.
>>
>> This strikes me as surprising enough that it would deserve
>> to emit a warning when there is no leading 0.
>> Doing anything else seems like just asking for trouble.
>
> There's a limit to what we can do here.  We would have to mark this
> parameter in a special way in the generator (not 'Int' but
> 'Int_that_usually_needs_octal_in_guestfish').
>
> While I now think it was a bad idea to use plain types like 'Int' and
> 'String' in the generator (you live and learn, but this is why we
> replaced many uses of 'String' with 'Pathname', 'Device' etc),

Yes, I remember well ;)

> changing this is quite involved for little gain.  And what happens if
> people do want to use decimal modes, eg. if they are generating
> guestfish scripts.  It is also now documented.

I agree that it's probably not worth the effort.




More information about the Libguestfs mailing list