LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 02-27-2020, 08:37 PM   #1
maschelsea
Member
 
Registered: Dec 2016
Distribution: Slackware 64bit 14.2
Posts: 468

Rep: Reputation: Disabled
Permissions issue: Lots of '?"...


Hello. I keep my mp3 files in a separate directory to make it easier to copy them the our USB car drive as needed. The directory I store them is is quaintly named mp3/ This directory is located at /otherstuff/othermp3/mp3/. I did this because there are a LOT of directories and I ran out of space on my /home partition pretty quickly. I had to move it into root space. Root space occupies most of the 1TB drive.
Code:
root@caitlyn:/otherstuff/othermp3/mp3# ls -l
total 715132
-rw-r--r-- 1 michael users  6164026 Jun  5  2017 01-03-\ 1985.mp3
-rw-r--r-- 1 michael users  8040113 Jun  5  2017 01-05-\ 1985\ (Original\ Version)\ [Explicit].mp3
-rw-r--r-- 1 michael users  8372335 Jun  5  2017 01-07-\ Troll\ Doll\ Celebrities\ (Stand\ Up).mp3
-rw-r--r-- 1 michael users  9505644 Jun  5  2017 01-13-\ Troll\ Doll\ Jingles\ Medley\ (Stand\ Up).mp3
-rw-r--r-- 1 michael users  1943528 Jun  5  2017 01-14-\ Spider\ Pig.mp3
-rw-r--r-- 1 michael users  3886783 Jun  5  2017 01\ -\ A\ Mhaire\ Bhruinneall.mp3
-rw-r--r-- 1 michael users  5080418 Oct 24  2017 01\ -\ Angel\ Eyes.mp3
-rw-r--r-- 1 michael users  4440240 Jun  5  2017 01\ -\ Blitzkreig\ Bop\ (Remastered\ Version\ ).mp3
-rw-r--r-- 1 michael users  8134189 Jun  5  2017 01\ -\ Come\ To\ The\ Dance.mp3
-rw-r--r-- 1 michael users  7218199 Jun  5  2017 01\ -\ Don't\ Stop\ Believin'.mp3
-rw-r--r-- 1 michael users  5024770 Jun  5  2017 01\ -\ Drunken\ Sailor.mp3
-rw-r--r-- 1 michael users  5881809 Nov 14  2017 01\ -\ Everything\ Is\ Awesome!!!\ (Feat.\ The\ Lonely\ Island).mp3
-rw-r--r-- 1 michael users  8374521 Jun  5  2017 01\ -\ Half-Truism.mp3
-rw------- 1 michael users  7732591 Jun  5  2017 01\ -\ Helluva\ Life.mp3
-rw-r--r-- 1 michael users  4727801 Jun  5  2017 01\ -\ If\ I\ Should\ Fall\ From\ Grace\ With\ God.mp3
-rw-r--r-- 1 michael users  7420507 Jun  5  2017 01\ -\ I'm\ Gonna\ Be\ (500\ Miles).mp3
-rw-r--r-- 1 michael users  8466999 Feb 18 22:15 01\ -\ Mo\ Ghile\ Mear.mp3
-rw-r--r-- 1 michael users  6837289 Jun  5  2017 01\ -\ Paddy's\ Green\ Shamrock\ Shore.mp3
-rw-r--r-- 1 michael users  5947296 Jun  5  2017 01\ -\ Sir\ Isaac\ Newton\ vs\ Bill\ Nye.mp3
-rw-r--r-- 1 michael users  7379315 Jun  5  2017 01\ -\ Things\ That\ Stop\ You\ Dreaming\ [Explicit].mp3
-rw-r--r-- 1 michael users  9919188 Jun  5  2017 01\ -\ While\ My\ Guitar\ Gently\ Weeps.mp3
NOTE This is just a few of the files in mp3/ The above listing was gathered from the root account. However, when I ask for the same listing from my user account, I see:
Code:
michael@caitlyn othermp3 $ ls -l mp3/total 0
-????????? ? ? ? ?            ? 01-03- 1985.mp3
-????????? ? ? ? ?            ? 01-05- 1985 (Original Version) [Explicit].mp3
-????????? ? ? ? ?            ? 01-07- Troll Doll Celebrities (Stand Up).mp3
-????????? ? ? ? ?            ? 01-13- Troll Doll Jingles Medley (Stand Up).mp3
-????????? ? ? ? ?            ? 01-14- Spider Pig.mp3
-????????? ? ? ? ?            ? 01 - A Mhaire Bhruinneall.mp3
-????????? ? ? ? ?            ? 01 - Angel Eyes.mp3
-????????? ? ? ? ?            ? 01 - Blitzkreig Bop (Remastered Version ).mp3
-????????? ? ? ? ?            ? 01 - Come To The Dance.mp3
-????????? ? ? ? ?            ? 01 - Don't Stop Believin'.mp3
-????????? ? ? ? ?            ? 01 - Drunken Sailor.mp3
-????????? ? ? ? ?            ? 01 - Everything Is Awesome!!! (Feat. The Lonely Island).mp3
-????????? ? ? ? ?            ? 01 - Half-Truism.mp3
-????????? ? ? ? ?            ? 01 - Helluva Life.mp3
-????????? ? ? ? ?            ? 01 - If I Should Fall From Grace With God.mp3
-????????? ? ? ? ?            ? 01 - I'm Gonna Be (500 Miles).mp3
-????????? ? ? ? ?            ? 01 - Mo Ghile Mear.mp3
-????????? ? ? ? ?            ? 01 - Paddy's Green Shamrock Shore.mp3
-????????? ? ? ? ?            ? 01 - Sir Isaac Newton vs Bill Nye.mp3
-????????? ? ? ? ?            ? 01 - Things That Stop You Dreaming [Explicit].mp3
-????????? ? ? ? ?            ? 01 - While My Guitar Gently Weeps.mp3
Can anybody tell me why? I have soft links to all these files in /home/michael/mp3. They all LOOK legitimate, but they all return error code 22. I looked up error code 22 tonight, and it means invalid command. It's obvious to me that some package has gone wrong, but which one? If necessary I can send you any other information you need from me in order to solve this. Thank you in advance for any assistance you can offer in resolution of this issue.
 
Old 02-27-2020, 09:02 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Probably, the permissions of the parent directory do not have the traverse, 'x', attribute set for the user.

What does this say?

Code:
ls -ld /otherstuff/othermp3/mp3
To fix it...

Code:
chmod +x /otherstuff/othermp3/mp3
For files the 'x' attribute is 'execute' and is used to make the file executable, oddly enough.

But for directories 'x' means 'traverse' and allows the relevant users to traverse the directory boundary. Having read permission lets you see the file names which are directory meta data, but you cannot traverse the directory to read the file meta-data or attributes, hence the ???'s.

Last edited by astrogeek; 02-27-2020 at 09:14 PM.
 
2 members found this post helpful.
Old 02-28-2020, 12:54 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,804

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
probably they are stored on another filesystem with different permissions (which are not specified in the current OS) - like different user/group id.
 
Old 02-28-2020, 05:02 AM   #4
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
You should first of all do some fsck on your file. This can be indication is corrupted. Provide all information: partition layout, file system, mounts. You were working as root via login or via su command? Suspend all activities go to runlevel 1. You can try to use mc and see what output is. Be sure that ls really points to /usr/bin/ls. Reinstall coreutils package. I don't understand why there is no backslashes in outptut. Create another user. Just plain. As this another user try access these files. List all configuration files in home directory. What is in .bashrc file? There are some strange file in your home directory? Try to list with full path. What tool have you used to create links?
 
Old 02-28-2020, 05:35 AM   #5
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018
Quote:
Originally Posted by igadoter View Post
You should first of all do some fsck on your file.
No, they should follow astrogeek's advice in post #2, as it's almost certainly the correct answer.
 
Old 02-28-2020, 05:58 AM   #6
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
So you are trying to tell me OP created directory in $HOME with -x permission? It is not possible. For file creation there system wide defaults. Only explicitly issuing command chmod -x on directory can change that. So something is broken. What @astrogeek propose perhaps is a solution but it does not explain why such situation appeared. I might add do all test on your hard drive to verify its health.

Ok I re-read first post more carefully again. I don't know how it was done but for me it seem OP copied files as root - then changing ownership. But no-matter directories owned by root are still readable - say /usr/bin. So how it looks like
Code:
$ ls -ld /otherstuff
$ ls -ld /otherstuff/othermp3
Besides you can as well use different home directory. It is only agreement to put user home directory under /home. Change home directory temporary say under /usr/local move you files there and resize /home. Then switch back. Or create additional user in system: say user mp3, group mp3 with nologin option to have access to your mp3 via group membership. And put home directory for this user say at /usr/local. You won't be messing with /. There are other possibilities. You can set locally http server to have access to your mp3.

Last edited by igadoter; 02-28-2020 at 06:56 AM.
 
Old 02-28-2020, 06:40 AM   #7
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018
The files aren't in /home. You're not reading his post properly, they were copied/moved elsewhere when he ran out of space in /home.
OP didn't state how that was done, so we can only guess, but the directory permissions may well have been lost in that process: maybe he accidentally set umask 333 instead of 222, we simply don't know.

I don't know what the user has done, nor do I care. What is important is the current state, and to work the problem.

Given that I know from experience a missing 'x' permission on a directory would present exactly like this, astrogeek's suggestion to check and rule that out is the most obvious first step. As stated by OP, root can clearly list the files properly which supports the likelihood of a permissions issue on the directory and also makes it less likely to be filesystem corruption.

Once the simple things are ruled out one can move onto the more exotic potential causes. No need to over-complicate things right at the start. If I were a beginner your post asking about everything and the kitchen sink would have had me running for the hills.
 
Old 02-28-2020, 06:47 AM   #8
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
simple fix.
put it back.
check this out.
mine
Code:
$ ls -la /media/data
total 28
drwxrwxr--  4 userx users  4096 Feb 27 17:03 .
drwxr-xr-x 20 root  root   4096 Feb 26 03:48 ..
drwxrwxr--  2 userx users  4096 Feb 27 17:06 Favorites
drwxrwxr--  2 userx users 16384 Feb 27 08:17 lost+found
userx@slacky.mac:~
make it roots
Code:
$ sudo chown root: /media/data


userx@slacky.mac:~
$ ls -la /media/data
ls: cannot access '/media/data/lost+found': Permission denied
ls: cannot access '/media/data/..': Permission denied
ls: cannot access '/media/data/Favorites': Permission denied
ls: cannot access '/media/data/.': Permission denied
total 0
d????????? ? ? ? ?            ? .
d????????? ? ? ? ?            ? ..
d????????? ? ? ? ?            ? Favorites
d????????? ? ? ? ?            ? lost+found
userx@slacky.mac:~
loses what it is.
give it proper permissions
Code:
$ sudo chmod 775 /media/data -R
 
$ ls -la /media/data
total 28
drwxrwxr-x  4 root  root   4096 Feb 27 17:03 .
drwxr-xr-x 20 root  root   4096 Feb 26 03:48 ..
drwxrwxr-x  2 userx users  4096 Feb 27 17:06 Favorites
drwxrwxr-x  2 userx users 16384 Feb 27 08:17 lost+found
here are two bash functions I wrote to deal with links, you can mod them to work with your data types. just put them into a script and make them work. easy enough to figure out, yes/No?
Code:
deleteDeadLinks()
{
	echo "Deleting dead Links..."
	#Delete any dead links to files
	[[ -d "$localEterm" ]] && 
# here if total links are too great, I fixed it by just cd into dir where
#links are kept then delete the bad ones. 

	{ cd /usr/local/share/Eterm/pix/scale ;
	#sudo find  . -xtype l -delete ;}
	#for FreeBSD
	#sudo find -L . \( -lname "*.jpg" -o -lname "*.png" \)  -exec rm -v {} \; ;}
	#finds bad links in current dir
        find -L . \( -lname "*.jpg" -o -lname "*.png" \)  -print0 | xargs -0 sudo rm -v ;}

	[[ -d "$usrEterm" ]] && { cd /usr/share/Eterm/pix/scale ;
		#sudo find  . -xtype l -delete ; }
		#for FreeBSD
	#sudo find -L . \( -lname "*.jpg" -o -lname "*.png" \)  -exec rm -v {} \; ;}
	find -L . \( -lname "*.jpg" -o -lname "*.png" \)  -print0 | xargs -0 sudo rm -v ;}
		
	echo "Done deleting dead links.."
	exitCode=$?

}
linkImages()
{
	 
	#soft link images into Eterms pix scale dir
	echo "Linking Images ..."
	while IFS= read -r var
	do
		file=$(basename "$var")
		
		if [[ -d "$localEterm" ]] ; then
			[[ ! -L "$localEterm"/pix/scale/$file ]] &&
			{ sudo ln -sn  "$var" "$localEterm"/pix/scale ;
				echo "HEY "$localEterm"/pix/scale/$file" ; }
		elif [[ -d "$usrEterm" ]] ; then
			[[ ! -L "$usrEterm"/pix/scale/$file ]] &&
			{ sudo ln -sn "$var" "$usrEterm"/pix/scale ; 
				echo "HEY2 "$usrEterm"/pix/scale/$file" ; }
			
		else
		{
			echo "I have no Idea where Eterm is, exiting ..."
			exit
		}
		fi
	done < <(find "$finalDestanation"  \( -type f -name "*png" -o -type f  -name "*.jpg" \) )
	echo "Done Linking Images..."
}

Last edited by BW-userx; 02-28-2020 at 06:58 AM.
 
Old 02-28-2020, 03:47 PM   #9
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
Quote:
Originally Posted by GazL View Post
I don't know what the user has done, nor do I care. What is important is the current state, and to work the problem.
The action of OP was not as user but as root. So you should care. Now OP will be acting as root again so carelessness may cost quite a high price. So it is important to find why this happened.
 
Old 02-28-2020, 03:56 PM   #10
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
lets try to reproduce what he did.

you are root, in your root account original files are linked to a dir in a user account, permissions come up ??? in user account.
yes?
Code:
userx@bobsyouruncle:~
$ su -
Password: 
root@bobsyouruncle:~# pwd
/root
root@bobsyouruncle:~# touch myfileinroot
root@bobsyouruncle:~# ls
myfileinroot
root@bobsyouruncle:~# ln -s $(pwd)/myfileinroot /home/userx/
root@bobsyouruncle:~# ls -la /home/userx/
lrwxrwxrwx   1 root  root        18 Feb 28 09:59 myfileinroot -> /root/myfileinroot
or make the file users
Code:
root@bobsyouruncle:~# chown userx: myfileinroot
ls -la
-rw-r--r--  1 userx userx    0 Feb 28 09:59 myfileinroot
root@bobsyouruncle:~# ln -s $(pwd)/myfileinroot /home/userx
root@bobsyouruncle:~# ls -la /home/userx/myfileinroot
lrwxrwxrwx 1 root root 18 Feb 28 10:04 /home/userx/myfileinroot -> /root/myfileinroot
still good
lets try user owns file in root, from user account link it from root into user account.
Code:
 rm myfileinroot
ln -s /root/myfileinroot .
$ ls -la myfileinroot
lrwxrwxrwx 1 userx userx 18 Feb 28 10:07 myfileinroot -> /root/myfileinroot


what steps did you take to do all of this OP?

Last edited by BW-userx; 02-28-2020 at 04:08 PM.
 
Old 02-28-2020, 04:26 PM   #11
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
It is not clear for me does the situation appeared recently - I mean earlier everything was ok but today something happened and OP can't any more read files. This was my first claim. That's why I proposed to verify hard drive and file system. I thought that say yesterday OP can list these mp3 files but today can't. The other scenario is just after OP created directory and copied files into it (as root) it appeared it can't list them. In the first scenario is reasonable presume something wrong with hard drive or/and file system. In the second the first is what was the command used to copy these files. We can have a look into command history. If it was say mc used: I don't know why this happened. The command umask is used to set default file creation permission. Perhaps other tool were used which actually changed umask value recognizing is used by root. Kind of overprotective. I don't know. Perhaps OP allow root to use desktop - and kind of drag and drop action inside file manager. I think desktop file managers are not well suited if at all to work on root account. Some of them issue warnings other work silently. And who knows what's going on under the hood. This is essentially my point view. Oh and one more thing just came to my mind: different file systems on home partition and system partition. Perhaps not all file attributes can be transferred between them. Just guess only.

Last edited by igadoter; 02-28-2020 at 04:32 PM.
 
Old 02-28-2020, 05:22 PM   #12
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
yep, one can only surmise until OP gets back to cue us in on what s/he did to get that.
 
Old 02-28-2020, 07:01 PM   #13
glorsplitz
Senior Member
 
Registered: Dec 2002
Distribution: slackware!
Posts: 1,308

Rep: Reputation: 368Reputation: 368Reputation: 368Reputation: 368
If I mount a share as user using fuse then become root this is what I see, root doesn't have permission to see the user fuse mount.

Also see here Why does root get Permission denied when accessing FUSE directory?

Quote:
It's the way fuse works. If you want to allow access to root or others users, you have to add:

user_allow_other

Last edited by glorsplitz; 02-28-2020 at 07:04 PM.
 
1 members found this post helpful.
Old 03-02-2020, 07:40 PM   #14
maschelsea
Member
 
Registered: Dec 2016
Distribution: Slackware 64bit 14.2
Posts: 468

Original Poster
Rep: Reputation: Disabled
What astrogeek said to do indeed solved this issue for me. Thank you for your help.
 
2 members found this post helpful.
  


Reply



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
LXer: VIDEO: Cooking With Linux: Lots and Lots of Word Processors! The Tuesday Linux Journal Show LXer Syndicated Linux News 0 03-25-2018 03:32 AM
aptitude shows lots of unresolved dependencies and lots of packages to remove rey Linux - Software 6 06-04-2013 10:01 PM
need lots &lots of help sigsbyj Linux - Newbie 11 08-19-2011 03:27 PM
Help With Java Problem Please"""""""""""" suemcholan Linux - Newbie 1 04-02-2008 06:02 PM
New To """"l I N U X"""" chawla_ab LinuxQuestions.org Member Intro 3 01-22-2006 11:03 AM

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

All times are GMT -5. The time now is 10:10 AM.

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
Open Source Consulting | Domain Registration