When I create new file in Midnight commander and save it (Shift+F4, write something, F2, name the file), it is created with 640 pemissions even thought my umask is set to 0007 so it should be created with permissions 660. Is there any secret place to set the mc umask? I did not found one.
Asked
Active
Viewed 436 times
1 Answers
0
In order to use your umask, you should deactivate "Preserve permissions" option.
For more information check the man and search umask:
Preserve attributes
determines whether to preserve the permissions, timestamps and (if you
are root) the ownership of the original files. If this option is not
set, the current value of the umask will be respected.
mc is executed by your user, hence the umask to create a new file will be the default umask configured in ~/.bashrc .
In order to setup the umask 0007, edit your ~/.bashrc and add the line:
umask 0007
After that, relaunch mc and test the creation of a new file.
I tested this settings above in a docker container on debian jessie and works fine.
You can find more details about umask here: http://www.cyberciti.biz/tips/understanding-linux-unix-umask-value-usage.html

R.Sicart
- 671
- 3
- 10
-
But this option is for Move/Copy operations, I doubt that the setting influences creation of new file. Or they are somewhere else than in the Copy dialog itself? I did not find it in general Options. – gorn Oct 06 '16 at 09:08
-
My fault, you are right, I didn't see that you wanted to create a new file. I updated the answer. – R.Sicart Oct 06 '16 at 18:12
-
This doesn't solve an issue, also mentioned here: http://midnight-commander.org/ticket/2378 – Vanav Jun 08 '18 at 15:05