Web lists-archives.com

Re: File ownership problem using removeable media




On Sun, Dec 23, 2018 at 05:46:17PM +0000, mick crane wrote:
> On 2018-12-23 17:10, tomas@xxxxxxxxxx wrote:

[...]

> >And you do that after each and every mount?
> >
> >Cheers
> >-- tomás
> well no, I didn't read properly and was trying to be helpful without
> understanding what the problem was

I asked because the original poster moves the file system on USB from
one system to another. It might be that the user with the same name
has different UIDs on the different systems -- we don't know. In this
case, he'll be fighting the system...

> what I do is if something isn't automagically mounted is look in
> dmesg to see if something looks like that might be it and mount it
> somewhere, changing file permissions if need be.

Makes sense.

> I sort of understand permissions but I've not really understood what
> "the sticky bit" is.

The sticky bit for files has historical significance. It used to signal
to the operating system to keep that file's program text in virtual
memory, for programs to load faster.

Nowadays it has been recycled to signify that a *directory* with this
bit set won't allow some other than the owner of a file to modify the
directory entry (e.g. to delete the file). This is used for world-writable
directories (think e.g. /tmp) where, due to world-writability, anyone
could delete anyone else's files: not good, that's why you'll find that
/tmp has the sticky bit set

  tomas@trotzki:~$ ls -ld /tmp
  drwxrwxrwt 7 root root 4096 Dec 23 22:17 /tmp
           ^-- the "sticky" bit

It's officially called the "restricted deletion flag" these days. But
"sticky" is just more handy, so it... stuck.

The man page for chmod has some details on this and other special bits
(setuid, setgid).

The info page for file permissions (info "file permissions") has more
details on all that, including the special role of setuid & setgid bits
on directories.

This entry in Wikipedia is also fairly complete:

  https://en.wikipedia.org/wiki/File_system_permissions#Traditional_Unix_permissions

Cheers
-- tomás

Attachment: signature.asc
Description: Digital signature