LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware 14.2 changes permission when mounting NTFS partition (https://www.linuxquestions.org/questions/slackware-14/slackware-14-2-changes-permission-when-mounting-ntfs-partition-4175603778/)

aparicio 04-13-2017 11:01 AM

Slackware 14.2 changes permission when mounting NTFS partition
 
Dear all,


I am not an expert but a normal, regular user of Slackware for the last 16 years.

This time I could not find a way to solve the problem by myself

Sorry if the question is simple.
I have seen problems like this in the past but nothing mentioned in the case of 14.2 specifically.

I have an external HD (NTFS) and 2 PCs (one with 14.1 and the new one with a fresh 14.2, with patches and multilib installed).
I got the following when mounting the HD (both auto/xfce and manually):



Permissions when mounting in Slackware 14.1:
drwx------

Permissions when mounting in Slackware 14.2:
drwxrwxrwx


In version 14.2, too many permissions are given to all of the directories and files in the disk.
I would like to keep permissions as they were in previous version 14.1.


It may be a change with the command mount itself?

Slackware 14.1
mount from util-linux 2.21.2 (with libblkid support)

Slackware 14.2
mount from util-linux 2.27.1 (libmount 2.27.0: assert, debug)

If so, is it possible to recompile mount to suport ``right'' permissions for NTFS?
Permissions works as expected with ext4 partitions.

Please, any help would be appreciated.

Thank you very much in advance.

Ricardo

bassmadrigal 04-14-2017 09:34 AM

According to this man page for ntfs-3g the default for permissions is "everybody has full read, write, execution and directory browsing permissions." So, based on that, it seems the mounting in 14.1 is not following the standard. But I haven't used NTFS drives in Linux for a few years, so my information is a bit rusty.

However, you should be able to override the permissions by passing a umask to the mount options. umask=0077 would make all files and folders unaccessible to anyone but the owner.

aparicio 04-15-2017 05:01 PM

Quote:

Originally Posted by bassmadrigal (Post 5696891)
According to this man page for ntfs-3g the default for permissions is "everybody has full read, write, execution and directory browsing permissions." So, based on that, it seems the mounting in 14.1 is not following the standard. But I haven't used NTFS drives in Linux for a few years, so my information is a bit rusty.

However, you should be able to override the permissions by passing a umask to the mount options. umask=0077 would make all files and folders unaccessible to anyone but the owner.


Bassmadrigal,

thank your for answering.

Based on your suggestion, the problem was solved (I have used this command line):
mount -t ntfs-3g -o fmask=133,dmask=022,gid=users,uid=1000 /dev/sdb1 /mnt/disk1/

I am trying now to understand what can be done in the case of automount.
I could not find a configuration file with mounting options.

After many hours, I found this thread but it did not came up to a solution (/etc/fstab does not seem to be used by automount):
http://www.linuxquestions.org/questi...-a-4175498579/

If you have anything else you think might help in this case, please let me know.

Thank you very much for your time.

Best wishes.

bassmadrigal 04-15-2017 05:29 PM

I'm pretty sure this is going to require you to create a udev rule, but I am not nearly competent enough to do it without a ton of research (which, unfortunately, I just don't have that kind of time available right now).

I know you can specify filesystem types in a rule using ENV{ID_FS_TYPE}=="ntfs", but I am not sure how to ensure it is mounted using automount when it detects a usb device plugged in with that matches that rule.

In some quick searching, I did come across these two pages, but I don't have time to really dig into them to see what is needed and what should be ignored. Hopefully you can do some sleuthing and come up with something based on these little breadcrumbs I gave you.

https://bbs.archlinux.org/viewtopic.php?id=142475
https://wiki.archlinux.org/index.php/udisks

aparicio 04-15-2017 07:03 PM

Default mounting parameters have changed since 14.1, indeed.
As another example I found, a same FAT32 pendrive mounts differently (also different from NTFS).

Code:

$ more /etc/mtab

14.1
/dev/sdc1 /run/media/aparicio/00FF-85F1 vfat rw,nosuid,nodev,uid=1000,gid=100,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks2 0 0

14.2
/dev/sdc1 /run/media/aparicio/00FF-85F1 vfat rw,nodev,nosuid,uid=1000,gid=100,shortname=mixed,utf8=1,showexec,flush,uhelper=udisks2 0 0

It is very difficult for me to figure out the right way to go as it seems there are many pieces of software which makes automount to work, including thunar, udisks2, gnome gvfs, etc.

Thank you for your indication that an udev rule may be a possibility.

Best regards.

bassmadrigal 04-15-2017 08:05 PM

Slackware did change from udev to eudev between 14.1 and 14.2, so that could be where the difference is coming from.

aparicio 04-18-2017 07:32 AM

Quote:

Originally Posted by bassmadrigal (Post 5697498)
Slackware did change from udev to eudev between 14.1 and 14.2, so that could be where the difference is coming from.

Thank you very much for your help.


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