LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-10-2017, 01:38 PM   #1
coralfang
Member
 
Registered: Nov 2010
Location: Bristol, UK
Distribution: Slackware, FreeBSD
Posts: 494
Blog Entries: 3

Rep: Reputation: 157Reputation: 157
/usr permissions changing for converted packages?


I've just noticed that the permissions on my /usr folder are not owned by root....
Code:
[ricky][1][darkstar|~]
$ ls -l /
total 116
drwxr-xr-x   2 root  root   4096 Oct 28 23:27 bin
drwxr-xr-x   4 root  root   4096 Oct 11 17:14 boot
drwxr-xr-x  19 root  root   5940 Nov 10 18:15 dev
drwxr-xr-x 124 root  root  12288 Nov 10 18:15 etc
drwxr-xr-x   4 root  root   4096 Apr 20  2017 home
drwxr-xr-x   7 root  root   4096 Nov  2 18:33 lib
drwxr-xr-x   2 root  root  20480 Nov  7 20:04 lib64
drwx------   2 root  root  16384 Jun 20  2014 lost+found
drwxr-xr-x  16 root  root   4096 May 31  2016 media
drwxr-xr-x  13 root  root   4096 Sep 26  2006 mnt
drwxr-xr-x  11 root  root   4096 Oct 24 14:10 opt
dr-xr-xr-x 221 root  root      0 Nov 10 18:08 proc
drwx--x---  49 root  root  12288 Nov 10 02:29 root
drwxr-xr-x   9 root  root    240 Nov 10 18:15 run
drwxr-xr-x   2 root  root  12288 Nov  3 00:52 sbin
drwxr-xr-x   2 root  root   4096 Sep 26  2016 slackarm
drwxr-xr-x   2 root  root   4096 Oct 25 17:43 srv
dr-xr-xr-x  12 root  root      0 Nov 10 18:08 sys
drwxrwxrwt   6 root  root    180 Nov 10 18:23 tmp
drwxr-xr-x  18 ricky users  4096 Nov  9 00:14 usr
drwxr-xr-x  16 root  root   4096 Nov  1 23:52 var

[ricky][1][darkstar|~]
$ ls -l /usr/
total 744
lrwxrwxrwx    1 root  root       5 May 31  2016 X11 -> X11R6
drwsrwsrwt    2 root  root    4096 May 31  2016 X11R6
lrwxrwxrwx    1 root  root       8 May 31  2016 adm -> /var/adm
drwxr-xr-x    4 ricky users 135168 Nov  9 00:14 bin
lrwxrwxrwx    1 root  root      10 May 31  2016 dict -> share/dict
drwxr-xr-x 1774 ricky users  73728 Nov  9 00:14 doc
drwxr-xr-x    2 root  root    4096 Jan 26  2017 games
drwxr-xr-x  595 root  root   69632 Nov  9 00:06 include
drwxr-xr-x    2 root  root   12288 Nov  6 22:58 info
drwxr-xr-x   58 root  root   69632 Nov  7 20:39 lib
drwxr-xr-x    2 root  root    4096 Feb  1  2015 lib32
drwxr-xr-x  254 ricky users 307200 Nov  9 00:14 lib64
drwxr-xr-x   28 root  root    4096 Nov  1 23:52 libexec
drwxr-xr-x   13 root  root    4096 Oct  8 20:37 local
drwxr-xr-x   64 ricky users   4096 Nov  9 00:14 man
drwxr-xr-x    2 root  root   20480 Nov  7 20:02 sbin
drwxr-xr-x  496 ricky users  20480 Nov  9 00:14 share
lrwxrwxrwx    1 root  root      10 May 31  2016 spool -> /var/spool
drwxr-xr-x    5 root  root    4096 Nov  7 20:39 src
lrwxrwxrwx    1 root  root       8 May 31  2016 tmp -> /var/tmp
drwxr-xr-x    4 root  root    4096 Sep 26 01:23 x86_64-slackware-linux

[ricky][1][darkstar|~]
$


However if i grep /usr/bin , i notice these permissions are only set from packages converted with rpm2tgz / deb2tgz, and they somehow changed the permissions of the top level folders. How can i stop the permissions on /usr from messing up in the future when installing packages like this?
Code:
[ricky][2][darkstar|/usr/bin]
$ ls -l | grep ricky
-rwxr-xr-x   1 ricky  users       5504 Oct 25 23:50 kodi
-rwxr-xr-x   1 ricky  users       1830 Oct 25 23:50 kodi-standalone
-rwxr-xr-x   1 ricky  users        322 Sep 22 15:39 skypeforlinux

[ricky][2][darkstar|/usr/bin]
$
Should be safe to just chown the entire /usr recursively back to root:root ?
 
Old 11-10-2017, 01:59 PM   #2
coralfang
Member
 
Registered: Nov 2010
Location: Bristol, UK
Distribution: Slackware, FreeBSD
Posts: 494
Blog Entries: 3

Original Poster
Rep: Reputation: 157Reputation: 157
Okay i think i messed something up doing "chown root:root -R /usr"...

Code:
[ricky][3][darkstar|~]
$ sudo
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
Fixed that one by logging in as root with "su" and then reinstalling sudo, but is there anything else obvious which could be broken after resetting permissions to root?
 
Old 11-10-2017, 02:20 PM   #3
Petri Kaukasoina
Member
 
Registered: Mar 2007
Posts: 270

Rep: Reputation: 115Reputation: 115
Quote:
Originally Posted by coralfang View Post
Okay i think i messed something up doing "chown root:root -R /usr"...


Fixed that one by logging in as root with "su" and then reinstalling sudo, but is there anything else obvious which could be broken after resetting permissions to root?
Every SUID or SGID binary and everything not owned by root:root.
 
1 members found this post helpful.
Old 11-10-2017, 03:18 PM   #4
bassmadrigal
Senior Member
 
Registered: Nov 2003
Location: Newport News, VA
Distribution: Slackware
Posts: 4,571

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
Quote:
Originally Posted by coralfang View Post
However if i grep /usr/bin , i notice these permissions are only set from packages converted with rpm2tgz / deb2tgz, and they somehow changed the permissions of the top level folders. How can i stop the permissions on /usr from messing up in the future when installing packages like this?
Code:
[ricky][2][darkstar|/usr/bin]
$ ls -l | grep ricky
-rwxr-xr-x   1 ricky  users       5504 Oct 25 23:50 kodi
-rwxr-xr-x   1 ricky  users       1830 Oct 25 23:50 kodi-standalone
-rwxr-xr-x   1 ricky  users        322 Sep 22 15:39 skypeforlinux

[ricky][2][darkstar|/usr/bin]
$
The obvious solution would be to not use those programs since there's no guarantee that an rpm or deb package will work on Slackware. kodi is available on SBo as is skypeforlinux. kodi does require compilation and dependencies, so it is a bit more work to get it, but then it is built against libraries on your computer. skypeforlinux is a simple repackaging of the deb package, but it has been verified to work on Slackware and won't jack up your ownership.

The other option would be to try running those conversion scripts as root, but I don't think it is normally required, so it might've been some option you passed when you ran them that adjusted the ownership of the files (I'm not really familiar with either since I refuse to use them -- I'd much rather repackage it by hand or develop a SlackBuild for it rather than use those).
 
1 members found this post helpful.
Old 11-10-2017, 03:27 PM   #5
coralfang
Member
 
Registered: Nov 2010
Location: Bristol, UK
Distribution: Slackware, FreeBSD
Posts: 494
Blog Entries: 3

Original Poster
Rep: Reputation: 157Reputation: 157
Quote:
Originally Posted by bassmadrigal View Post
The obvious solution would be to not use those programs since there's no guarantee that an rpm or deb package will work on Slackware. kodi is available on SBo as is skypeforlinux. kodi does require compilation and dependencies, so it is a bit more work to get it, but then it is built against libraries on your computer. skypeforlinux is a simple repackaging of the deb package, but it has been verified to work on Slackware and won't jack up your ownership.

The other option would be to try running those conversion scripts as root, but I don't think it is normally required, so it might've been some option you passed when you ran them that adjusted the ownership of the files (I'm not really familiar with either since I refuse to use them -- I'd much rather repackage it by hand or develop a SlackBuild for it rather than use those).
Yeah, i haven't been able to build kodi from slackbuilds lately, it always fails with the included ffmpeg for some reason, so i had tried installing an rpm which ended up working for a bit.

As for me stupidly chowning my entire /usr, this shouldn't break my system should it?
So far i've only found "sudo" to be a problem so far.
 
Old 11-10-2017, 03:56 PM   #6
Petri Kaukasoina
Member
 
Registered: Mar 2007
Posts: 270

Rep: Reputation: 115Reputation: 115
Quote:
Originally Posted by coralfang View Post
As for me stupidly chowning my entire /usr, this shouldn't break my system should it?
So far i've only found "sudo" to be a problem so far.
There could be problems with: at cgexec chage chfn chsh crontab cu expiry fdmount gpasswd kppp lockfile mlocate newgidmap newgrp newuidmap passwd pkexec procmail rcp rlogin rsh slrnpull traceroute6 uucp uuname uustat uux wall write xlock xscreensaver
 
2 members found this post helpful.
Old 11-10-2017, 04:10 PM   #7
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 14.2 + Multilib
Posts: 1,092

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
Quote:
Originally Posted by coralfang View Post
Yeah, i haven't been able to build kodi from slackbuilds lately, it always fails with the included ffmpeg for some reason, so i had tried installing an rpm which ended up working for a bit.

As for me stupidly chowning my entire /usr, this shouldn't break my system should it?
So far i've only found "sudo" to be a problem so far.
coralfang --

Yes there could be, especially for suid programs.

Below is a Q&D list of files under /usr/ on my system that are not chown root:root ( I also excluded stuff that may not affect your operation ).

Your list will vary because we've installed different packages and I don't have a pure-D Slackware64 14.2 System up-and-running at this minute, but it is a start.

The ones to fix are the ones with one-or more 's' bits set in the permissions column.

HTH.

-- kjh

Code:
# find . -type f -print0  | xargs -0 ls -lad  |grep -v -e 'root  *root' -e ./share/ -e  ./local/ -e ./man/

-rwxr-sr-x   1 root   tty         23416 Dec 15  2015 ./bin/32/wall
-rwxr-sr-x   1 root   tty         11820 Dec 15  2015 ./bin/32/write
-rwxr-xr-x   1 root   bin         12610 May 23  2009 ./bin/Pnews
-rwxr-xr-x   1 root   bin          6131 May 23  2009 ./bin/Rnmail
-rwxr-xr-x   1 root   bin         92624 Oct  2  2008 ./bin/amp
-rwsr-sr-x   1 daemon daemon      48040 Jun 29  2016 ./bin/at
-r-sr-xr--   1 uucp   uucp       156544 Oct 31  2008 ./bin/cu
-rwxr-xr-x   1 root   floppy      14992 Aug  2  2013 ./bin/diskd
-rwxr-xr-x   1 root   floppy      15072 Aug  2  2013 ./bin/diskseekd
-rwxr-xr-x   1 root   bin         23728 Oct 15  2008 ./bin/encapsulate
-rwxr-xr-x   1 root   bin         19400 Oct 15  2008 ./bin/faucet
-rwsr-x---   1 root   floppy      23200 Aug  2  2013 ./bin/fdmount
-rwxr-xr-x   1 root   floppy      11368 Aug  2  2013 ./bin/fdrawcmd
-rwxr-xr-x   1 root   floppy      21320 Aug  2  2013 ./bin/floppycontrol
-rwxr-xr-x   1 root   floppy      19400 Aug  2  2013 ./bin/floppymeter
-rwxr-xr-x   1 root   bin         34056 Oct 31  2008 ./bin/formail
-rwxr-xr-x   1 root   floppy      20464 Aug  2  2013 ./bin/getfdprm
-rwxr-xr-x   1 root   bin          7336 Oct 15  2008 ./bin/getpeername
-rwxr-xr-x   1 root   bin         19744 Oct 15  2008 ./bin/hose
-rwxr-sr-x   1 root   mail        16080 Oct 31  2008 ./bin/lockfile
-rwxr-xr-x   1 root   bin          5859 Oct 31  2008 ./bin/mailstat
-rwxr-xr-x   1 root   bin          2947 May 23  2009 ./bin/newsetup
-rwxr-xr-x   1 root   bin          1939 May 23  2009 ./bin/newsgroups
-rwxr-xr-x   1 news   news       278976 Nov 11  2009 ./bin/nn
-rwxr-xr-x   1 news   news          978 Nov 11  2009 ./bin/nngrab
-rwxr-xr-x   1 news   news         3312 Nov 11  2009 ./bin/nnstats
-rwxr-xr-x   1 root   bin         15408 May 23  2009 ./bin/nntplist
-rwxr-xr-x   1 news   news         1379 Nov 11  2009 ./bin/nnusage
-rwsr-sr-x   1 root   mail        81984 Oct 31  2008 ./bin/procmail
-rwxr-xr-x   1 root   bin         10856 Aug  3  2015 ./bin/psc
-rwxr-xr-x   1 root   bin        284968 Aug  3  2015 ./bin/sc
-rwxr-xr-x   1 root   bin         26360 Aug  3  2015 ./bin/scqref
-rwxr-xr-x   1 root   bin        112784 Dec 14  2008 ./bin/seejpeg
-rwxr-xr-x   1 root   floppy      41680 Aug  2  2013 ./bin/setfdprm
-rwxr-sr-x   1 root   slocate     36288 Aug 30  2012 ./bin/slocate
-rwxr-s---   1 root   news        95904 Apr 19  2015 ./bin/slrnpull
-rwxr-xr-x   1 root   bin          6752 Oct 15  2008 ./bin/sockdown
-rwxr-xr-x   1 root   floppy      64880 Aug  2  2013 ./bin/superformat
-rwxr-xr-x   1 root   bin          8408 Oct 15  2008 ./bin/timelimit
-rwxr-xr-x   1 root   bin        306920 May 23  2009 ./bin/trn
-rwxr-xr-x   1 root   bin         19520 May 23  2009 ./bin/trn-artchk
-r-sr-xr--   1 uucp   uucp       106432 Oct 31  2008 ./bin/uucp
-r-sr-xr--   1 uucp   uucp        46984 Oct 31  2008 ./bin/uuname
-r-sr-xr--   1 uucp   uucp       119144 Oct 31  2008 ./bin/uustat
-r-sr-xr--   1 uucp   uucp       108312 Oct 31  2008 ./bin/uux
-rwxr-sr-x   1 root   tty         27960 Dec 10  2015 ./bin/wall
-rwxr-sr-x   1 root   tty         15448 Dec 10  2015 ./bin/write
-rwxr-xr-x   1 root   floppy      15768 Aug  2  2013 ./bin/xdfcopy
-rwxr-s--x   1 root   shadow    3137336 Mar 19  2015 ./bin/xlock
-rwxr-s--x   1 root   shadow     243704 Jul  5 15:24 ./bin/xscreensaver
-rwxr-sr-x   1 root   postdrop    14912 Oct  1 04:10 ./sbin/postdrop
-rwxr-sr-x   1 root   postdrop    23136 Oct  1 04:10 ./sbin/postqueue
-r-sr-xr--   1 uucp   uucp       270648 Oct 31  2008 ./sbin/uucico
-r-sr-xr--   1 uucp   uucp       121792 Oct 31  2008 ./sbin/uuxqt
-rwsr-x---   1 root messagebus    56672 Jul 26 19:44 ./libexec/dbus-daemon-launch-helper
-rwxr-s--x   1 root games         14696 Sep 12 13:10 ./libexec/emacs/25.3/x86_64-slackware-linux/update-game-score
-rwxr-sr-x   1 root utmp          13568 Nov 21  2015 ./libexec/gnome-pty-helper
-rwxr-sr-x 1 root utmp    10096 Mar 19  2016 ./lib64/utempter/utempter
-rwxr-sr-x 1 root nogroup   54448 Jan 10  2016 ./lib64/kde4/libexec/kdesud
-rwxr-xr-x 1 news news    12638 Nov 11  2009 ./lib64/nn/aux
-rw-r--r-- 1 news news      998 Nov 11  2009 ./lib64/nn/conf
-rw-r--r-- 1 news news   267630 Nov 11  2009 ./lib64/nn/help/Manual
-rw-r--r-- 1 news news      396 Nov 11  2009 ./lib64/nn/help/adm.upgrade1
-rw-r--r-- 1 news news      670 Nov 11  2009 ./lib64/nn/help/adm.upgrade2
-rw-r--r-- 1 news news      630 Nov 11  2009 ./lib64/nn/help/adm.upgrade3
-rw-r--r-- 1 news news      481 Nov 11  2009 ./lib64/nn/help/adm.upgrade4
-rw-r--r-- 1 news news      540 Nov 11  2009 ./lib64/nn/help/adm.welcome
-rw-r--r-- 1 news news      324 Nov 11  2009 ./lib64/nn/help/help.attr
-rw-r--r-- 1 news news     2968 Nov 11  2009 ./lib64/nn/help/help.commands
-rw-r--r-- 1 news news     1349 Nov 11  2009 ./lib64/nn/help/help.extended
-rw-r--r-- 1 news news      310 Nov 11  2009 ./lib64/nn/help/help.help
-rw-r--r-- 1 news news      767 Nov 11  2009 ./lib64/nn/help/help.map
-rw-r--r-- 1 news news     1043 Nov 11  2009 ./lib64/nn/help/help.menu
-rw-r--r-- 1 news news     1206 Nov 11  2009 ./lib64/nn/help/help.more
-rw-r--r-- 1 news news       11 Nov 11  2009 ./lib64/nn/help/help.read
-rw-r--r-- 1 news news      407 Nov 11  2009 ./lib64/nn/help/help.set
-rw-r--r-- 1 news news      587 Nov 11  2009 ./lib64/nn/help/help.show
-rw-r--r-- 1 news news      876 Nov 11  2009 ./lib64/nn/help/help.sort
-rw-r--r-- 1 news news     7321 Nov 11  2009 ./lib64/nn/help/help.variables
-rwxr-xr-x 1 news news     1067 Nov 11  2009 ./lib64/nn/upgrade_rc

Last edited by kjhambrick; 11-10-2017 at 04:11 PM.
 
4 members found this post helpful.
Old 11-10-2017, 04:12 PM   #8
coralfang
Member
 
Registered: Nov 2010
Location: Bristol, UK
Distribution: Slackware, FreeBSD
Posts: 494
Blog Entries: 3

Original Poster
Rep: Reputation: 157Reputation: 157
Alright thanks... i just restarted the xserver, and it failed to load, so i just went and reinstalled xorg* packages, this fixed that.
Rebooted, everything seems fine, except for networkmanager not working. I had to use wpa_supplicant/dhcpcd manually to get online.

I think i'm just going to do this:
Code:
rsync -avP rsync://ftp.osuosl.org/slackware/slackware64-current/ .
And then reinstall/upgrade every package from there. This should fix all of these problems right?
 
Old 11-10-2017, 04:16 PM   #9
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 14.2 + Multilib
Posts: 1,092

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
coralfang --

Yep, that outta do it

-- kjh
 
Old 11-10-2017, 06:29 PM   #10
coralfang
Member
 
Registered: Nov 2010
Location: Bristol, UK
Distribution: Slackware, FreeBSD
Posts: 494
Blog Entries: 3

Original Poster
Rep: Reputation: 157Reputation: 157
Ok, lesson learned:
DO NOT RECURSIVELY CHOWN TOP LEVEL DIRECTORIES UNDER /

Took a while, but after reinstalling every package set to be safe, everything is back working as it should.
In case anyone reads this, having the same problem, you'll want to basically reinstall every package to get back the correct permissions. Seems to be the simplest way to go about doing this, as opposed to looking up each files individual permissions.

Solved i guess, and i'll probably stop installing converted deb/rpm packages in future to avoid this happening again.
 
Old 11-10-2017, 07:14 PM   #11
bassmadrigal
Senior Member
 
Registered: Nov 2003
Location: Newport News, VA
Distribution: Slackware
Posts: 4,571

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
Quote:
Originally Posted by coralfang View Post
Yeah, i haven't been able to build kodi from slackbuilds lately, it always fails with the included ffmpeg for some reason, so i had tried installing an rpm which ended up working for a bit.
Feel free to create a new post on this, because I haven't had any issues with building kodi, although, I'm not running -current. If there is an issue in -current, I'm sure ponce would be happy to incorporate changes to the kodi SlackBuild in his repo.
 
Old 11-10-2017, 09:36 PM   #12
glorsplitz
Member
 
Registered: Dec 2002
Distribution: slackware!
Posts: 497

Rep: Reputation: 88
I built kodi in -current from slackbuilds about year ago without issue, worked fine.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
careless changes to /usr permissions, /usr/share for USB, ALSA, wireless et al Can-ned Food Linux - Newbie 1 10-02-2015 10:31 AM
chmod: changing permissions of `/usr../bin': Read-only file File System Issue cdhar Linux - Newbie 3 12-31-2012 07:17 AM
Permissions changing, System Changing swgeek Linux - Desktop 2 09-24-2011 12:37 PM
File Permissions for /usr 06jer Linux - Newbie 2 09-07-2007 12:18 PM
/usr/ permissions all screwed up! ptafflogic Linux - Security 4 10-31-2004 04:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration