maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   an already "gainrooted" xterm (https://talk.maemo.org/showthread.php?t=40698)

Matan 2010-01-17 21:04

Re: an already "gainrooted" xterm
 
I forgot a step. Run update-sudoers (as root) after creating the .sudoers file.

Bec 2010-01-17 21:21

Re: an already "gainrooted" xterm
 
ok, now this looks interesting:

Quote:

>>>sudoers file: syntax error, line 2 <<<
>>>sudoers file: syntax error, line 3 <<<
>>>sudoers file: syntax error, line 4 <<<
/etc/sudoers.d/01sudo changes break sudoers
I have no idea what "01sudo" is and I have undone any changes I made to it:
Quote:

Defaults env_check+="HOME DISPLAY"
Defaults env_keep+="HOME DISPLAY"
Defaults env_reset
user ALL = NOPASSWD: /usr/sbin/gainroot
user ALL = NOPASSWD: /usr/sbin/mmc-mount /dev/mmcblk0 /media/mmc1
user ALL = NOPASSWD: /usr/sbin/mmc-mount /dev/mmcblk0p1 /media/mmc1
user ALL = NOPASSWD: /bin/umount /media/mmc1,/bin/umount -l /media/mmc1
user ALL = NOPASSWD: /usr/sbin/osso-usb-mass-storage-enable.sh, /usr/sbin/osso-usb-mass-storage-disable.sh
user ALL = NOPASSWD: /sbin/mkdosfs /dev/mmcblk0*, /usr/sbin/mmc-rename /dev/mmcblk0*
user ALL = NOPASSWD: /etc/init.d/af-base-apps stop , /etc/osso-af-init/gconf-daemon.sh stop
user ALL = NOPASSWD: /etc/init.d/af-base-apps start , /etc/osso-af-init/gconf-daemon.sh start
user ALL = NOPASSWD: /etc/init.d/osso-systemui restart
user ALL = NOPASSWD: /usr/sbin/gconf-clean.sh
user ALL = NOPASSWD: /usr/sbin/chroot /mnt/initfs /usr/bin/retutime *
user ALL = NOPASSWD: /sbin/insmod /mnt/initfs/lib/modules/current/g_file_storage.ko stall=0 file=/dev/mmcblk0
user ALL = NOPASSWD: /sbin/insmod /mnt/initfs/lib/modules/current/g_ether.ko
user ALL = NOPASSWD: /sbin/rmmod g_file_storage
user ALL = NOPASSWD: /sbin/rmmod g_ether
user ALL = NOPASSWD: /usr/sbin/osso-backup-restore-locale
user ALL = (install) NOPASSWD: /usr/bin/app-installer-tool
I removed that file to update and then put it back.
Thanks

fatalsaint 2010-01-17 21:26

Re: an already "gainrooted" xterm
 
Editing the sudoers file is very difficult to use anything but VI. (I don't know what you use)

The actual recommended way is using "visudo".. I don't know if the N900 has that or not.

Essentially even wrong end of line characters can cause sudo to stop working.

Just some thoughts... in vi if you use ":set list" you can see the end of line characters... ^M == bad.

Matan 2010-01-17 21:34

Re: an already "gainrooted" xterm
 
Just don't reboot, Bec, as you might need to reflash your system if you do. Copy a working 01sudo file (for example, from here: http://my.arava.co.il/~matan/770/n900/01sudo ) and run update-sudoers.

YoDude 2010-01-17 21:36

Re: an already "gainrooted" xterm
 
Quote:

Originally Posted by Matan (Post 478547)
Add the application to sudoers by creating a file called
/etc/sudoers.d/emelfm2.sudoers containing:
user ALL = NOPASSWD: /usr/bin/emelfm2
Then use Exec = /usr/bin/sudo /usr/bin/emelfm2
or Exec = osso-xterm "sudo emelfm2"

Now that^ can FUBAR your device if you don't know what you are doing. :eek:

Quote:

Originally Posted by qwerty12 (Post 453247)
...
For future reference: Use visudo instead of editing sudoers directly. visudo tells you if a line will **** up the entire sudo system when exiting the editor.

The simple addition of an extra space in a line while editing with a plain ol' text editor will screw things up...

Bec 2010-01-17 21:48

Re: an already "gainrooted" xterm
 
Quote:

Originally Posted by Matan (Post 478678)
Just don't reboot, Bec, as you might need to reflash your system if you do. Copy a working 01sudo file (for example, from here: http://my.arava.co.il/~matan/770/n900/01sudo ) and run update-sudoers.

Now for the best part...
sudo gainroot asks for a password...

For the first time I use it, no matter how many times I've tried to set one (always the same) it didn't seem to work...

Problem is that the usual password doesn't work...

Matan 2010-01-17 21:54

Re: an already "gainrooted" xterm
 
It asks for user's password, not root password. Did you install openssh server? If so, ssh directly to root.

Bec 2010-01-17 21:59

Re: an already "gainrooted" xterm
 
I've ssh-ited it... surprisingly it stopped asking for a password... awkward

Bec 2010-01-17 22:09

Re: an already "gainrooted" xterm
 
Quote:

Originally Posted by YoDude (Post 478682)
The simple addition of an extra space in a line while editing with a plain ol' text editor will screw things up...

As I do realize how close my ignorance brought me to a re-flash I'd apreaciate some details about visudo.

Thanks

Matan 2010-01-17 22:17

Re: an already "gainrooted" xterm
 
visudo is an editor that checks the file has the corrext syntax for a sudoers file before overwriting the original.


All times are GMT. The time now is 08:12.

vBulletin® Version 3.8.8