Bugzilla – Bug 373
Bad file number with nested included files
Last modified: 2010-06-18 16:15:28 MDT
If you edit a sudoers file with an included sudoers file and that file have also an included sudoers file (nested include file) you get following error if you are redirected to edit first include file (which contains the nested include file): visudo: can't stat /etc/sudoers.xxxxxx: Bad file number If there are more included files in the sudoers file and one file contains also an included file visudo has an unpredictable behavior by starting sudoers file in stange order and with wrong content (content is belonging to other sudoers file
Created attachment 273 [details] Fix for visudo "Bad file descriptor" error in bug #373 I've attached a fix for the first problem but have not been able to reproduce the second one. I may have misunderstood your description of the problem, though.
Created attachment 275 [details] Example wrong sudoers file opened
Second issue can be reproduced by: Following include entries in /etc/sudoers: #include /var/frits/test/sudoers.fb #include /var/frits/test/sudoers1.fb sudoers.fb contain also an include statement: #include /var/frits/test/sudoers2.fb sudoers1.fb and sudoers2.fb doesn't have include files. Starting visudo opens first /etc/sudoers (normal) seconds it indicate to open /var/frits/test/sudoers.fb bu in fact it opens /var/frits/test/sudoers1.fb See attachement 275
The second problem has the same root cause as the first and the patch I attached fixes it as well.
Fixed in sudo 1.7.3. Beta versions are out now, GA is due at the end of June.