LinuxQuestions.org
Review your favorite Linux distribution.
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 01-07-2023, 08:25 AM   #1
Apprentice+
Member
 
Registered: May 2021
Distribution: Slackware64-Current
Posts: 43

Rep: Reputation: Disabled
Unhappy Problem with file permissions


Good morning everyone.

These are the permissions I normally use and should work
Code:
bash-5.2# ls -l
total 144
-rw------- 1 hc hc    533 May 13  2018 Conta\ Espaços\ em\ Branco.txt
-rw------- 1 hc hc 120003 May 13  2018 Count\ white\ spaces.png
-rw------- 1 hc hc      3 Jan  7 11:04 test.txt
-rw------- 1 hc hc   1494 Feb 15  2019 \ remove\ all\ extra\ blank\ spaces\ from\ giv.txt
-rw------- 1 hc hc   1451 Feb 15  2019 \ trim\ both\ leading\ and\ trailing\ white\ s.txt
-rw------- 1 hc hc   1374 Feb 15  2019 \ trim\ leading\ white\ space\ characters\ fr.txt
-rw------- 1 hc hc   1342 Feb 15  2019 trim\ trailing\ white\ space\ characters\ fr.txt

bash-5.2# lsattr 
--------------e------- ./ trim both leading and trailing white s.txt
--------------e------- ./ remove all extra blank spaces from giv.txt
--------------e------- ./Conta Espaços em Branco.txt
--------------e------- ./ trim leading white space characters fr.txt
--------------e------- ./test.txt
--------------e------- ./trim trailing white space characters fr.txt
--------------e------- ./Count white spaces.png
The problem is that I can't see the text of the file, not even using the cat command
I can't even rename the file

Notice in image 1 that what is different is that the file has a lock on it, and when I open it, the name of the file is in parentheses. And it doesn't show the file

In pictures 2 and 3 are the permissions
I notice that in image 4 the normal working file it shows the permissions differently in the window!

I don't know what happened to make the file unavailable, because it wasn't like this.

I don't know of any other permission that could prevent me from accessing the file!
To the best of my knowledge, all files have the same permissions, so they should work accordingly!

Does anyone know how I can fix this?
Attached Thumbnails
Click image for larger version

Name:	1.png
Views:	32
Size:	134.9 KB
ID:	40176   Click image for larger version

Name:	2.png
Views:	26
Size:	150.6 KB
ID:	40177   Click image for larger version

Name:	3.png
Views:	25
Size:	20.7 KB
ID:	40178   Click image for larger version

Name:	4.png
Views:	22
Size:	26.5 KB
ID:	40179  
 
Old 01-07-2023, 09:31 AM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,165

Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
try
Code:
cd /path/to/files/
sudo chown $USER:$USER *
sudo chmod 660 *
 
Old 01-07-2023, 09:36 AM   #3
Apprentice+
Member
 
Registered: May 2021
Distribution: Slackware64-Current
Posts: 43

Original Poster
Rep: Reputation: Disabled
Unhappy

Quote:
Originally Posted by Keith Hedger View Post
try
Code:
cd /path/to/files/
sudo chown $USER:$USER *
sudo chmod 660 *
That doesn't change anything! It just gives more permission! Not solving the problem!
I showed in the question that I already had read and write permission!

Adding: I am as root user, i.e., I have no root access to the file! Nor as hc user obviously!

Last edited by Apprentice+; 01-07-2023 at 09:41 AM.
 
Old 01-07-2023, 10:08 AM   #4
gus3
Member
 
Registered: Jun 2014
Distribution: Slackware
Posts: 491

Rep: Reputation: Disabled
My next guess: are there lock files attached? Take a look at:
Code:
# ls -l *txt .*txt
This won't fix anything, but it may show the next step.
 
Old 01-07-2023, 11:02 AM   #5
jayjwa
Member
 
Registered: Jul 2003
Location: NY
Distribution: Slackware, Termux
Posts: 805

Rep: Reputation: 257Reputation: 257Reputation: 257
You might have something odd going on with your file system and/or disk as this is not normal behaviour. Normally I'd say you made a file with a weird special character that you couldn't later access, but if you can click on it within a GUI that's not the case. Let's see 'stat *' on the files. What's that filesystem actually on? Are you trying to access a remote filesystem that is offline?
 
Old 01-07-2023, 11:24 AM   #6
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,468

Rep: Reputation: 4227Reputation: 4227Reputation: 4227Reputation: 4227Reputation: 4227Reputation: 4227Reputation: 4227Reputation: 4227Reputation: 4227Reputation: 4227Reputation: 4227
And : getfacl /path/to/file ?
 
Old 01-07-2023, 11:28 AM   #7
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,468

Rep: Reputation: 4227Reputation: 4227Reputation: 4227Reputation: 4227Reputation: 4227Reputation: 4227Reputation: 4227Reputation: 4227Reputation: 4227Reputation: 4227Reputation: 4227
Quote:
Originally Posted by Apprentice+ View Post
That doesn't change anything! It just gives more permission! Not solving the problem!
I showed in the question that I already had read and write permission!

Adding: I am as root user, i.e., I have no root access to the file! Nor as hc user obviously!
root doesn't need explicit read permission to read files, even the permissions look like this
Code:
.---------  2,3k marav marav 17 oct.   2022 test
Also, if your files are on separate partition, it will be useful to have the mount options used in fstab
And, I suggest you, in a general manner, to avoid spaces in file names

Last edited by marav; 01-07-2023 at 11:42 AM.
 
Old 01-07-2023, 11:46 AM   #8
Apprentice+
Member
 
Registered: May 2021
Distribution: Slackware64-Current
Posts: 43

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by gus3 View Post
My next guess: are there lock files attached? Take a look at:
Code:
# ls -l *txt .*txt
This won't fix anything, but it may show the next step.
Code:
bash-5.2# ls -l *txt .*txt
ls: cannot access '.*txt': No such file or directory
-rw-rw---- 1 hc hc  533 May 13  2018 Conta\ Espaços\ em\ Branco.txt
-rw-rw---- 1 hc hc    3 Jan  7 11:04 test.txt
-rw-rw---- 1 hc hc 1494 Feb 15  2019 \ remove\ all\ extra\ blank\ spaces\ from\ giv.txt
-rw-rw---- 1 hc hc 1451 Feb 15  2019 \ trim\ both\ leading\ and\ trailing\ white\ s.txt
-rw-rw---- 1 hc hc 1374 Feb 15  2019 \ trim\ leading\ white\ space\ characters\ fr.txt
-rw-rw---- 1 hc hc 1342 Feb 15  2019 trim\ trailing\ white\ space\ characters\ fr.txt
I don't understand where you are going with this!
I had already run ls in the question!

Last edited by Apprentice+; 01-07-2023 at 11:50 AM.
 
Old 01-07-2023, 11:48 AM   #9
Apprentice+
Member
 
Registered: May 2021
Distribution: Slackware64-Current
Posts: 43

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jayjwa View Post
You might have something odd going on with your file system and/or disk as this is not normal behaviour. Normally I'd say you made a file with a weird special character that you couldn't later access, but if you can click on it within a GUI that's not the case. Let's see 'stat *' on the files. What's that filesystem actually on? Are you trying to access a remote filesystem that is offline?
I use ext4 on Slackware64

Code:
bash-5.2# stat *
  File: Conta Espaços em Branco.txt
  Size: 533       	Blocks: 8          IO Block: 4096   regular file
Device: 8,5	Inode: 23069945    Links: 1
Access: (0660/-rw-rw----)  Uid: ( 1000/      hc)   Gid: ( 1000/      hc)
Access: 2023-01-07 10:52:54.429729901 -0300
Modify: 2018-05-13 13:51:00.000000000 -0300
Change: 2023-01-07 12:34:07.713910068 -0300
 Birth: 2018-05-13 13:52:46.821651188 -0300
  File: Count white spaces.png
  Size: 120003    	Blocks: 240        IO Block: 4096   regular file
Device: 8,5	Inode: 23069311    Links: 1
Access: (0660/-rw-rw----)  Uid: ( 1000/      hc)   Gid: ( 1000/      hc)
Access: 2023-01-07 12:39:56.104920403 -0300
Modify: 2018-05-13 13:51:00.000000000 -0300
Change: 2023-01-07 12:34:07.713910068 -0300
 Birth: 2018-05-13 13:52:46.146651221 -0300
  File: test.txt
  Size: 3         	Blocks: 8          IO Block: 4096   regular file
Device: 8,5	Inode: 33947659    Links: 1
Access: (0660/-rw-rw----)  Uid: ( 1000/      hc)   Gid: ( 1000/      hc)
Access: 2023-01-07 12:40:15.454920977 -0300
Modify: 2023-01-07 11:04:17.355750161 -0300
Change: 2023-01-07 12:34:07.713910068 -0300
 Birth: 2023-01-07 10:16:54.443665824 -0300
  File:  remove all extra blank spaces from giv.txt
  Size: 1494      	Blocks: 8          IO Block: 4096   regular file
Device: 8,5	Inode: 23729391    Links: 1
Access: (0660/-rw-rw----)  Uid: ( 1000/      hc)   Gid: ( 1000/      hc)
Access: 2023-01-07 11:06:03.257753302 -0300
Modify: 2019-02-15 15:36:00.000000000 -0200
Change: 2023-01-07 12:34:07.713910068 -0300
 Birth: 2019-02-17 11:02:11.251033487 -0300
  File:  trim both leading and trailing white s.txt
  Size: 1451      	Blocks: 8          IO Block: 4096   regular file
Device: 8,5	Inode: 23729390    Links: 1
Access: (0660/-rw-rw----)  Uid: ( 1000/      hc)   Gid: ( 1000/      hc)
Access: 2023-01-07 11:33:59.393803026 -0300
Modify: 2019-02-15 15:36:00.000000000 -0200
Change: 2023-01-07 12:34:07.713910068 -0300
 Birth: 2019-02-17 11:02:11.199033486 -0300
  File:  trim leading white space characters fr.txt
  Size: 1374      	Blocks: 8          IO Block: 4096   regular file
Device: 8,5	Inode: 23729388    Links: 1
Access: (0660/-rw-rw----)  Uid: ( 1000/      hc)   Gid: ( 1000/      hc)
Access: 2023-01-07 11:33:51.659802796 -0300
Modify: 2019-02-15 15:35:00.000000000 -0200
Change: 2023-01-07 12:34:07.713910068 -0300
 Birth: 2019-02-17 11:02:11.097033483 -0300
  File: trim trailing white space characters fr.txt
  Size: 1342      	Blocks: 8          IO Block: 4096   regular file
Device: 8,5	Inode: 23729389    Links: 1
Access: (0660/-rw-rw----)  Uid: ( 1000/      hc)   Gid: ( 1000/      hc)
Access: 2023-01-07 11:33:35.372802313 -0300
Modify: 2019-02-15 15:35:00.000000000 -0200
Change: 2023-01-07 12:34:07.713910068 -0300
 Birth: 2019-02-17 11:02:11.148033484 -0300
 
Old 01-07-2023, 11:50 AM   #10
Apprentice+
Member
 
Registered: May 2021
Distribution: Slackware64-Current
Posts: 43

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by marav View Post
And : getfacl /path/to/file ?
Code:
bash-5.2# getfacl /mnt/dados/development/c/help/variables-pointers-define/strings/Spaces
getfacl: Removing leading '/' from absolute path names
# file: mnt/dados/development/c/help/variables-pointers-define/strings/Spaces
# owner: hc
# group: hc
user::rwx
group::---
other::---
 
Old 01-07-2023, 11:55 AM   #11
Apprentice+
Member
 
Registered: May 2021
Distribution: Slackware64-Current
Posts: 43

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by marav View Post
root doesn't need explicit read permission to read files, even the permissions look like this
Code:
.---------  2,3k marav marav 17 oct.   2022 test
Also, if your files are on separate partition, it will be useful to have the mount options used in fstab
And, I suggest you, in a general manner, to avoid spaces in file names
These files were saved, I don't know why they stayed like that.

And at the moment, as I informed you, I can't even rename them.
They are on a separate partition, which is automatically mounted by fstab at boot time!

LABEL=dados /mnt/dados ext4 defaults 0 1
 
Old 01-07-2023, 11:57 AM   #12
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,468

Rep: Reputation: 4227Reputation: 4227Reputation: 4227Reputation: 4227Reputation: 4227Reputation: 4227Reputation: 4227Reputation: 4227Reputation: 4227Reputation: 4227Reputation: 4227
Quote:
Originally Posted by Apprentice+ View Post
These files were saved, I don't know why they stayed like that.

And at the moment, as I informed you, I can't even rename them.
They are on a separate partition, which is automatically mounted by fstab at boot time!

LABEL=dados /mnt/dados ext4 defaults 0 1
cat /etc/mtab | grep dados
 
Old 01-07-2023, 12:03 PM   #13
Apprentice+
Member
 
Registered: May 2021
Distribution: Slackware64-Current
Posts: 43

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jayjwa View Post
You might have something odd going on with your file system and/or disk as this is not normal behaviour. Normally I'd say you made a file with a weird special character that you couldn't later access, but if you can click on it within a GUI that's not the case. Let's see 'stat *' on the files. What's that filesystem actually on? Are you trying to access a remote filesystem that is offline?
I didn't create the files, I brought them from my cell phone a few years ago. At the time they worked normally.
Today I noticed this problem, and there are others in other folders that are like this too!
And yes, I'm worried that it's a HD problem
 
Old 01-07-2023, 12:04 PM   #14
Apprentice+
Member
 
Registered: May 2021
Distribution: Slackware64-Current
Posts: 43

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by marav View Post
cat /etc/mtab | grep dados
Code:
bash-5.2# cat /etc/mtab | grep dados
/dev/sda5 /mnt/dados ext4 rw,relatime 0 0
 
Old 01-07-2023, 12:32 PM   #15
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,962

Rep: Reputation: 1573Reputation: 1573Reputation: 1573Reputation: 1573Reputation: 1573Reputation: 1573Reputation: 1573Reputation: 1573Reputation: 1573Reputation: 1573Reputation: 1573
Quote:
Originally Posted by Apprentice+ View Post
I can't even rename them.
What is the error message when you try to rename:
Code:
# mv Conta* conta_renamed.txt
 
1 members found this post helpful.
  


Reply

Tags
file access, permission denied



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
File permissions question - Cento & Ubuntu / same file / same permissions but... Robert.Thompson Linux - Newbie 10 03-17-2016 09:49 AM
[SOLVED] Permissions Permissions Permissions! makem Linux - Newbie 13 07-30-2015 11:54 AM
File Permissions- Once again the Permissions questions?? fusionstate Linux - Newbie 2 01-04-2014 12:47 PM
File permissions v. directory permissions Completely Clueless Linux - Newbie 7 07-09-2009 08:33 AM
file permissions OK, but command permissions? stabu Linux - General 2 10-05-2005 12:00 PM

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

All times are GMT -5. The time now is 08:22 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
Open Source Consulting | Domain Registration