Thank you for your donation


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Strange issue: sudo: effective uid is not 0, is sudo installed setuid root?
21st Dec, 2013, 08:50 AM
Post: #16
RE: Strange issue: sudo: effective uid is not 0, is sudo installed setuid root?
do it in Windows, Linux, any other system

… that's why we are booting directly to bash. to go around non-active root account.

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
21st Dec, 2013, 04:59 PM
Post: #17
RE: Strange issue: sudo: effective uid is not 0, is sudo installed setuid root?
(21st Dec, 2013 07:11 AM)mk01 Wrote:  edit /boot/cmdline.txt and add "init=/bin/bash" at the end of line
reboot
xbian will boot directly into command prompt with root privileges
run commands:
Code:
for f in bin etc lib media mnt opt root sbin usr var xbmc-backup; do chown -R root $f; done
chown root:root /home
chown syslog /var/log/*
chown -R man /var/cache/man
chown -R xbian:xbian /usr/local/share/xbmc/addons/plugin.xbianconfig
chmod 4755 /usr/bin/sudo

then update cmdline.txt again - just revert to previous content (remove init=/bin/bash)
after restart

Code:
sudo dpkg-reconfigure -a

Good morning mk01,
the procedure was fine good and xbian is back again.
I was not able to change the owner to /usr/local/share/xbmc/addons/plugin.xbianconfig because the file was not present, but I guess is not important.

Said that, do you have any idea about the root cause?

Thank you
Find all posts by this user
Quote this message in a reply
21st Dec, 2013, 05:19 PM
Post: #18
RE: Strange issue: sudo: effective uid is not 0, is sudo installed setuid root?
@Xenon

plugin.xbianconfig error (files missing) is ok: new version of package has files at /usr, older still at /home. within /home xbian:xbian ownership is desired. it was listed just in case you would have -dev version installed already.

glad to hear that it was ok. reason is clear, mistyped "sudo chown -R xbian /" instead of (./). normally I would say user error (and with this definition "user error" I also include any 3rd party addons/scripts with bug) but easily could be programmer error with such typo in official package's install/maintenance scripts.

I remember I was already checking all scripts for XBian's regular packages - all "chown" calls one by one. generaly we use chown xbian:xbian in XBian's scripts (user and also group would have been changed) and on your XBian just user as owner was changed.

what we can do is just wait if this happens again, please let me know. I will look into your XBian then or ask for some specific logs. otherwise there is not much to do now. so stay in touch !

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
21st Dec, 2013, 11:29 PM
Post: #19
RE: Strange issue: sudo: effective uid is not 0, is sudo installed setuid root?
Hi MK01,

it happens again, the only activity was system update (apt-get update && apt-get upgrade) that was ok.

If needed dpkg.log here: http://pastebin.com/fAa7iD92
source.list: http://pastebin.com/60JiSkme

Even I've again this problem XBMC and actually all system is stable and working (trasmission is working as well as playing movie) while when I had the issue before XBMC quit after few minutes of activity.

If I try to be root, I've set password after having the system working, I have this error:

Code:
xbian@xbian /var/log $ su -
Password:
setgid: Operation not permitted

Cheers
Find all posts by this user
Quote this message in a reply
22nd Dec, 2013, 12:03 AM
Post: #20
RE: Strange issue: sudo: effective uid is not 0, is sudo installed setuid root?
the error will be again caused by setuid bit but non-root ownership.

i will check the packages there in log. in between, can you post this more:

Code:
find /home -type l
find /media -type l

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
22nd Dec, 2013, 02:44 AM
Post: #21
RE: Strange issue: sudo: effective uid is not 0, is sudo installed setuid root?
(22nd Dec, 2013 12:03 AM)mk01 Wrote:  the error will be again caused by setuid bit but non-root ownership.

i will check the packages there in log. in between, can you post this more:

Code:
find /home -type l
find /media -type l

Now I had to change again the HD with NTFS one, long story.
So, using this NTFS (the previous one was extFAT) disk XBMC close (crash???) after few minutes from the boot. This behavious is the same I had when I reopen the post and also in that case I was using NTFS disk (another one). I suspect then this issue with NTFS filesystem make the entire system more unstable.

Back with you request:

Code:
xbian@xbian ~ $ find /home -type l
/home/xbian/incomplete
/home/xbian/torrents
/home/xbian/downloads
xbian@xbian ~ $ find /media -type l
/media/usb0

Code:
xbian@xbian ~ $ ls -la /media/
total 28
drwxr-xr-x 1 xbian root     16 Dec 21 17:29 .
drwxr-xr-x 1 xbian root    184 Nov  1 20:44 ..
drwxrwxrwx 1 xbian xbian 24576 Dec 21 17:31 Dati
lrwxrwxrwx 1 xbian root     11 Dec 21 17:29 usb0 -> /media/Dati

Code:
...
lrwxrwxrwx 1 xbian xbian   22 Dec 21 09:51 downloads -> /media/Dati/downloads/
lrwxrwxrwx 1 xbian xbian   23 Dec 21 09:51 incomplete -> /media/Dati/incomplete/
lrwxrwxrwx 1 xbian xbian   21 Dec 21 09:51 torrents -> /media/Dati/torrents/
...
Find all posts by this user
Quote this message in a reply
22nd Dec, 2013, 02:54 AM
Post: #22
RE: Strange issue: sudo: effective uid is not 0, is sudo installed setuid root?
I checked the two xbian packages and there is no ugly chown. -config-shell is doing chown twice on file, no directory, without -R (descent into hierarchy) and is doing xbian:xbian - so setting group as well.

will think about it

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
22nd Dec, 2013, 05:29 AM
Post: #23
RE: Strange issue: sudo: effective uid is not 0, is sudo installed setuid root?
In
Code:
for f in bin etc lib media mnt opt root sbin usr var xbmc-backup; do chown -R root $f; done
Why not:
Code:
chown -R root:root
Find all posts by this user
Quote this message in a reply
22nd Dec, 2013, 05:44 AM
Post: #24
RE: Strange issue: sudo: effective uid is not 0, is sudo installed setuid root?
because group wasn't changed by the headphone startup script.

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
22nd Dec, 2013, 09:12 AM
Post: #25
RE: Strange issue: sudo: effective uid is not 0, is sudo installed setuid root?
(22nd Dec, 2013 05:44 AM)mk01 Wrote:  because group wasn't changed by the headphone startup script.

That seems to be the case, but things still seem strange... take another look at my root perms, you can clearly see that they have the root:xbian ownership, which isn't correct - or is that correct?
Find all posts by this user
Quote this message in a reply
22nd Dec, 2013, 10:06 AM
Post: #26
RE: Strange issue: sudo: effective uid is not 0, is sudo installed setuid root?
if you mean there http://forum.xbian.org/thread-1922-post-19065.html#pid19065

then looks perfeclty ok for me (ok, beside the xbian uid as owner).

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
22nd Dec, 2013, 10:12 AM
Post: #27
RE: Strange issue: sudo: effective uid is not 0, is sudo installed setuid root?
(22nd Dec, 2013 10:06 AM)mk01 Wrote:  (ok, beside the xbian uid as owner).

You mean "xbian gid as owner", yeah?

That's exactly what I'm talking about - xbian shouldn't own those folders, either as user or group, and the fact that that gid is the owner of those directories leads me to think maybe some other process did something similar to the headphones startup script? Otherwise, how did that happen?

@Xenon and @d4m4s74 - what about you're perms of the top level root folders? What is the gid of the owner?
Find all posts by this user
Quote this message in a reply
22nd Dec, 2013, 11:22 AM
Post: #28
RE: Strange issue: sudo: effective uid is not 0, is sudo installed setuid root?
no, i mean uid. the listing is

UID : GID

xbian : root is user xbian group root. that is in line with the headphones (chown -R xbian = change user only, leave group as is).

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
22nd Dec, 2013, 12:02 PM
Post: #29
RE: Strange issue: sudo: effective uid is not 0, is sudo installed setuid root?
(22nd Dec, 2013 11:22 AM)mk01 Wrote:  no, i mean uid. the listing is

UID : GID

xbian : root is user xbian group root. that is in line with the headphones (chown -R xbian = change user only, leave group as is).

Oh, duh, I should have looked more closely... I transposed those.

What do you think of using root:root when resetting the perms?
Find all posts by this user
Quote this message in a reply
22nd Dec, 2013, 12:26 PM (This post was last modified: 22nd Dec, 2013 12:27 PM by mk01.)
Post: #30
RE: Strange issue: sudo: effective uid is not 0, is sudo installed setuid root?
there are many services / daemons running with different groups (input / video / rsyslog) where access should be restricted - owner is in general root, but service / daemon write access is managed through group.

you would break these. and again, the headphones startup script was changing just the user.

Code:
find / -xdev -type f -print0 | xargs -0 stat --printf="%U %n\n" | grep -v '^root\ '

output is there (all files with non-root uid ownership) http://pastebin.com/hmTBBwTN

system was Raspbian, with XBian .deb packages installed

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies Views: Last Post
  Kodi won't start after sudo apt-get upgrade update karanda 3 3,525 21st Nov, 2015 10:16 PM
Last Post: karanda
Bug sudo: effective uid is not 0 - returns after fix rbellamy 9 7,663 22nd Dec, 2013 04:34 AM
Last Post: mk01

Forum Jump: