chmod giving strange results in Mint 17.3 Cinnamon [solved]

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
Kurt3162
Level 4
Level 4
Posts: 230
Joined: Wed Apr 02, 2014 2:05 pm

chmod giving strange results in Mint 17.3 Cinnamon [solved]

Post by Kurt3162 »

This one has left me scratching my head. I wanted to make my "Downloads" folder non-execute, meaning just "read-write" for myself and "read" for everyone else.

AFAIK the command to do this would be chmod 644 Downloads, wouldn't it.
After doing that chmod, a ls-l shows the folder's permissions are now "drw-r--r--", which sounds like the thing I wanted.
Except that all of a sudden I couldn't write anything into that folder! Neither Firefox, nor the Nemo file manger could write into it (no access). :shock:

Just to be sure, I did a chmod 744 Downloads, the folder changed to "drwxr--r--" and after that I was able to write into it. You need "execute" permission to write a file? That's not normal, is it?


Has anyone a rational explanation to this?

As said in the title I'm on Mint 17.3 Cinnamon, the disk is ext4 and I'm indeed the owner (owner and group) of my home folder and everything in it.
Last edited by Kurt3162 on Sat May 05, 2018 11:32 am, edited 1 time in total.
altair4
Level 20
Level 20
Posts: 10394
Joined: Tue Feb 03, 2009 10:27 am

Re: chmod giving strange results in Mint 17.3 Cinnamon

Post by altair4 »

The execute bit on a directory allows one to open it to get to what is inside - traverse as the silver backs would say.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Kurt3162
Level 4
Level 4
Posts: 230
Joined: Wed Apr 02, 2014 2:05 pm

Re: chmod giving strange results in Mint 17.3 Cinnamon

Post by Kurt3162 »

Thanks. So there is no way to prevent stuff from being executed in a specific folder? Everybody needs to have execution permissions to be able to put stuff in there?
altair4
Level 20
Level 20
Posts: 10394
Joined: Tue Feb 03, 2009 10:27 am

Re: chmod giving strange results in Mint 17.3 Cinnamon

Post by altair4 »

A folder needs to have the execute bit enabled in order for anyone to open it. It has nothing to do with what happens after they open it.

A "7" allows a user to open the directly ( 1 ) , see the contents ( +4 ), and add / delete things ( +2 ).

A "5" allows a user to open the directly ( 1 ) , and see the contents ( +4 ) only.

If you have a file that is executable within that folder both scenarios would allow execution of that file only if the permissions on that file allow that user to execute it.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Kurt3162
Level 4
Level 4
Posts: 230
Joined: Wed Apr 02, 2014 2:05 pm

Re: chmod giving strange results in Mint 17.3 Cinnamon

Post by Kurt3162 »

Yes, I got all that, thanks. My point is security, preventing stuff downloaded to be executed (despite it being executable). I guess I can always add a noexec line in /etc/fstab, but I'm lazy and hadn't understood the "Exec" part of Linux permissions, so I thought I could do something similar just with permissions...
altair4
Level 20
Level 20
Posts: 10394
Joined: Tue Feb 03, 2009 10:27 am

Re: chmod giving strange results in Mint 17.3 Cinnamon [solved]

Post by altair4 »

A "noexec" does not prevent the execution of a file. All it means is that the file will have to be called on by an interpreter to run.

dobadthing.sh will not run from a noexec fileystem even if the execute bit is set. But sh dobadthing.sh will run even in a noexec filesystem and even if the file itself is not marked as executable.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Kurt3162
Level 4
Level 4
Posts: 230
Joined: Wed Apr 02, 2014 2:05 pm

Re: chmod giving strange results in Mint 17.3 Cinnamon [solved]

Post by Kurt3162 »

That's unfortunate. :?
Still, it adds a little hurdle, doesn't it.
Post Reply

Return to “Newbie Questions”