[Bug 864115] New: /sbin/ is not in sudo's path
https://bugzilla.novell.com/show_bug.cgi?id=864115 https://bugzilla.novell.com/show_bug.cgi?id=864115#c0 Summary: /sbin/ is not in sudo's path Classification: openSUSE Product: openSUSE 13.1 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: illumilore@gmail.com QAContact: qa-bugs@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0 When running as an administrative user "sudo reboot" I get an error that reboot is not found because /sbin/ is not in the users path. Given that this is the only and administrative user on the machine, the default path should have /sbin/ in it, otherwise, what is the point of having sudo on the system? Reproducible: Always Steps to Reproduce: 1. 2. 3. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=864115
https://bugzilla.novell.com/show_bug.cgi?id=864115#c
zhang jiajun
https://bugzilla.novell.com/show_bug.cgi?id=864115
https://bugzilla.novell.com/show_bug.cgi?id=864115#c1
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=864115
https://bugzilla.novell.com/show_bug.cgi?id=864115#c3
Vitezslav Cizek
When running as an administrative user "sudo reboot" I get an error that reboot is not found because /sbin/ is not in the users path.
Just add /sbin to your PATH and it'll work fine. The other way is to add line: Defaults secure_path="/usr/sbin:/usr/bin:/sbin:/bin" to your sudoers file. Which will reset the PATH for the command run in sudo. This has recently become the new default in Factory, so it'll appear in next openSUSE release. However I don't want to fix the already released distibutions.
Given that this is the only and administrative user on the machine, the default path should have /sbin/ in it, otherwise, what is the point of having sudo on the system?
The PATH comes probably from /etc/profile. But Werner surely knows better why the default PATH doesn't include /sbin and such. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=864115
https://bugzilla.novell.com/show_bug.cgi?id=864115#c4
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=864115
https://bugzilla.novell.com/show_bug.cgi?id=864115#c5
Vitezslav Cizek
When running as an administrative user "sudo reboot" I get an error that reboot is not found because /sbin/ is not in the users path. Given that this is the only and administrative user on the machine, the default path should have /sbin/ in it, otherwise, what is the point of having sudo on the system?
You can always specify a full path when running a command. There's nothing to be fixed in sudo. Regarding the administrative user not having /sbin in path, that should be fixed in the installer. Reassigning to yast2-maintainers. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=864115
https://bugzilla.novell.com/show_bug.cgi?id=864115#c11
--- Comment #11 from ill lume
https://bugzilla.novell.com/show_bug.cgi?id=864115
https://bugzilla.novell.com/show_bug.cgi?id=864115#c13
Jiří Suchomel
https://bugzilla.novell.com/show_bug.cgi?id=864115
https://bugzilla.novell.com/show_bug.cgi?id=864115#c14
ill lume
https://bugzilla.novell.com/show_bug.cgi?id=864115
https://bugzilla.novell.com/show_bug.cgi?id=864115#c15
Jiří Suchomel
https://bugzilla.novell.com/show_bug.cgi?id=864115
https://bugzilla.novell.com/show_bug.cgi?id=864115#c16
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=864115
https://bugzilla.novell.com/show_bug.cgi?id=864115#c17
Vitezslav Cizek
https://bugzilla.novell.com/show_bug.cgi?id=864115
https://bugzilla.novell.com/show_bug.cgi?id=864115#c18
Vitezslav Cizek
https://bugzilla.novell.com/show_bug.cgi?id=864115
https://bugzilla.novell.com/show_bug.cgi?id=864115#c19
--- Comment #19 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=864115
https://bugzilla.novell.com/show_bug.cgi?id=864115#c21
--- Comment #21 from Vitezslav Cizek
Thanks a lot, albeit you may send the patch upstream. Hopefully it will added as it was done for su in util-linux.
I'll send it upstream. We'll see if it ends up there or not. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=864115
https://bugzilla.novell.com/show_bug.cgi?id=864115#c22
Marcus Meissner
https://bugzilla.novell.com/show_bug.cgi?id=864115
https://bugzilla.novell.com/show_bug.cgi?id=864115#c23
--- Comment #23 from Marcus Meissner
https://bugzilla.novell.com/show_bug.cgi?id=864115
https://bugzilla.novell.com/show_bug.cgi?id=864115#c24
--- Comment #24 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=864115
https://bugzilla.novell.com/show_bug.cgi?id=864115#c25
Vitezslav Cizek
also the code adds it uncondiotionally
+ else { + char *new_path = NULL; + /* + if (runas_pw->pw_uid) + new_path = clearsbin(path); + else + new_path = addsbin(path); + */ + new_path = addsbin(path); + + if (new_path) + path = new_path; + }
and not just for root.
This was a change done by me. I made it this way so the intention was clearly visible. I assume complaints when sudo strips the *sbin from the path for non-root target user. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=864115
https://bugzilla.novell.com/show_bug.cgi?id=864115#c26
Leonardo Chiquitto
https://bugzilla.novell.com/show_bug.cgi?id=864115
https://bugzilla.novell.com/show_bug.cgi?id=864115#c27
--- Comment #27 from Vitezslav Cizek
participants (1)
-
bugzilla_noreply@novell.com