I want to run the following code setuid through a shell script.I setuid the script,but the setuid bit is not honoured.Could anybody suggest how to do it?
The code is below:
The immediate reason is,the user is in a remote area where USB modem is the only option to connect to internet.The user is a computer-illiterate.The modem in question,is actually in the database of usb_modeswitch program,but inspite of the corresponding rule in /etc/udev/rules.d/51–usb_modeswitch.rules,udev action for this device is not triggered.[Please see the rule line quoted below]But manual invocation as above triggers mode-switch and knetworkmanager recognition.
Now I do not want to expose the user to root’s password.I plan to write a script,make root the owner and setuid the script and crealte a launcher which will execute that.It did not work,the bit is ignored.How can I do it?OR any other alternative?
UDEV rule which fails to trigger is below.I have done a ‘udevadm info’ check to see that the rules match.
as far as I know it is not allowed to set suid bit for bash scripts. If you do this it gets ignored.
As a workaround I would suggest to use sudo. You can configure sudo so that some commands don’t require a password. Look at the sudo manpage for more details.
Monex wrote:
> Hi,
>
> as far as I know it is not allowed to set suid bit for bash scripts. If
> you do this it gets ignored.
>
> As a workaround I would suggest to use sudo. You can configure sudo so
> that some commands don’t require a password. Look at the sudo manpage
> for more details.
>
> Hope this helps
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/