You are not logged in.

#1 2022-04-26 18:37:50

dawnofman
Member
Registered: 2019-07-26
Posts: 140

[solved] about mount permissions for the underlying directory

Quoting man mount (bold text mine):

mount -t type device dir

This tells the kernel to attach the filesystem found on device (which is of type type) at the directory dir. The option -t type is optional. The mount command is usually able to detect a filesystem. The root permissions are necessary to mount a filesystem by default. See section "Non-superuser mounts" below for more details. The previous contents (if any) and owner and mode of dir become invisible, and as long as this filesystem remains mounted, the pathname dir refers to the root of the filesystem on device.

Does it implies that the previous ownership/mode/content becomes irrelevant right ?

Meaning, that once anything is mounted over any given directory, the mount "replaces" the previous ownership/mode/contents with its own right ?

So if I get allow access by the mount nothing in the underlying directory will prevent me accessing the mount right (even if the underlying directory denies me access) right ?

At this point this can seem far to obvious but I think it is a concept I didn't already take it for granted, so better late than never.

Last edited by dawnofman (2022-04-27 05:48:12)

Offline

#2 2022-04-26 19:23:08

mpan
Member
Registered: 2012-08-01
Posts: 1,615
Website

Re: [solved] about mount permissions for the underlying directory

Yes. If a path is used for a mount, that parth is referring to the mount, not to the directory stored int the filesystem.

Offline

#3 2022-04-27 05:47:55

dawnofman
Member
Registered: 2019-07-26
Posts: 140

Re: [solved] about mount permissions for the underlying directory

mpan wrote:

Yes. If a path is used for a mount, that parth is referring to the mount, not to the directory stored int the filesystem.

Perfectly clear. Thanks for your reply mpan smile

Offline

Board footer

Powered by FluxBB