[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#671701: RFS: autofs/5.0.6-1 [ITA] -- kernel-based automounter for Linux



On 06.05.2012 09:45, Dmitry Smirnov wrote:
>> ++        p = (unsigned int)atoi(strtok(my_utsname.release, "."));
>> ++        q = (unsigned int)atoi(strtok(NULL, "."));
>> ++        r = (unsigned int)atoi(strtok(NULL, "."));
>> ++        return KERNEL_VERSION(p, q, r);
>> ++}
>>
>> This will break with 2-number kernel version string.  There
>> were several tools who assumed 3-component version string
>> and who broke when 3.0-rc come out, so Linus decided to
>> postprone defaulting to 2-component version.  Many packages
>> has been fixed since, but here autofs introduces a new bug
>> of the same theme.

> I'm not sure if I fully understand the implications...
> As far as I know it works well with 3.2 kernel...
> Any suggestions are welcome.

If the kernel version number will be, say, 3.2 instead of 3.2.0,
the 3rd atoi() above will crash, since strtok() will return NULL.

Linus expecially reverted the change which he made before 3.0
went out -- change to return 3.0 instead of 3.0.0.  This has been
done merely in order to let userspace to fix the errors like the
above, since it turned out there were lots of userspace code like
this which "thought" that kernel version string will always gave
3 components.  Most or all code has been fixed by now to allow
either 2 or 3 components.  But this _new_ code repeats the same
bug again.

I'll talk with Ian about all this -- maybe he'll just revert/rebase
it in his autofs tree, I dunno yet.

> By the way, many thanks to you for your work on 'mdadm' package.
> I'm in your debt for this. 
> Eventually I might be available for help but you're doing great already. :)

Um... thank you for your apprecation but.. I'm doing almost nothing :)

I'm waiting for the next version which should be out RSN to package
it -- it should close a few bugs right away.  But I have done almost
nothing with the scripts -- like "check" cron job suggestions or other
stuff in that area...

But this is a different topic entirely :)

Thanks,

/mjt



Reply to: