Is this a bug? File permissions and ext4 [SOLVED]

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post please read this

Is this a bug? File permissions and ext4 [SOLVED]

Postby ronin701 on Sat Jun 23, 2012 4:05 pm

I was setting file/directory permissions, specifically I wanted to remove execute permissions from a directory and it's contents and I found something interesting that I didn't see in previous file systems.
If I chmod 644 it works fine on a specific file, allowing user rw, group and others r, but if I chmod -R 644 \mydirector it removes the users access to the directory, I also tried a-x recursive with the same result????
In the Info Properties GUI it shows; owner - List, create/delete, no access, group - List files only, Others - List files only.
Kinda weird!
Anybody else come across this or have a workaround?
BTW, I'm running Mint 13 Mate edition and it's fantastic, big whooyaa to the development team..........
-F

Thanks for the info, missed the subtle difference between folder execution and file execution.
I guess this is one place where the Info Properties GUI is more useful than the terminal, I can uncheck execute, apply permissions to enclosed files and be on my happy way (as long as there are no contained directories of course)<G>.
-F
Last edited by ronin701 on Sat Jun 23, 2012 9:11 pm, edited 3 times in total.
ronin701
Level 1
Level 1
 
Posts: 2
Joined: Sat Jun 23, 2012 3:45 pm

Linux Mint is funded by ads and donations.
 

Re: Is this a bug? File permissions and ext4

Postby xenopeek on Sat Jun 23, 2012 4:14 pm

Read up a bit on Linux filesystem permissions :wink: For example here: https://www.linux.com/learn/tutorials/3 ... ermissions

The execute bit on a directory controls whether you can browse the contents of the directory, not whether you can execute it :wink:
User avatar
xenopeek
Level 21
Level 21
 
Posts: 14660
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Is this a bug? File permissions and ext4

Postby altair4 on Sat Jun 23, 2012 4:31 pm

And just in case you are tempted to go to the opposite extreme and do the following:
Code: Select all
chmod -R 755 /mydirector

That's not right either since you will not only set directories to be executable, which you must have, but also every file which you probably don't want to have.

The octal mode in chmod isn't smart enough to differentiate between a folder and a file so I would suggest something like the following:
Code: Select all
chmod -R a+rwX,go-w /mydirectory

Every folder will be executable, group and other will be read only, owner has full access, but files will not be set to executable unless they were that way to begin with. That's what the big "X" does.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 15
Level 15
 
Posts: 5924
Joined: Tue Feb 03, 2009 10:27 am


Return to Other topics

Who is online

Users browsing this forum: No registered users and 3 guests