Comment 2 for bug 1335384

Revision history for this message
Wren Turkal (wt-penguintechs-org) wrote : Re: [Bug 1335384] Re: udisks does not update permissions on /media/<username> directory after uid change

Sure, changing a uid is not that common, but it is a supported operation
through the usermod tool, and there are valid reasons to do it.

In this specific case, I didn't change the uid while logged in. I logged
out, logged in with a different user on tty1, "sudo -i" to get a root
shell, then changed the uid of said user, and then chowned the old home to
the new uid.

Also, I even rebooted after doing this and not being able to mount media as
said user. I thought maybe the system (I didn't know about udisks yet)
would fix things on reboot. However, it did not.

Honestly, udisk creates the user's media directory. I found the code that
does it. However, it just silently does nothing in the case where the
directory already exists. Why shouldn't it fix the same directory when it
has the wrong permissions? If security is a concern, I can understand that.
At the very least, it should inform the user of the situation so that they
don't have to troubleshoot such an issue blindly. As it stands now, it's
just bad UX.

wt
On Jun 30, 2014 8:01 AM, "Phillip Susi" <email address hidden> wrote:

> No, it shouldn't. It generally isn't a good idea to change uids in the
> first place, and certainly not while logged in. If you do, then the
> change does not take affect until you log out and back in anyhow, and
> any permissions in the filesystem will not be updated unless you update
> them.
>
>
> ** Changed in: udisks2 (Ubuntu)
> Status: New => Invalid
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1335384
>
> Title:
> udisks does not update permissions on /media/<username> directory
> after uid change
>
> Status in “udisks2” package in Ubuntu:
> Invalid
>
> Bug description:
> I am using a just updated copy of 14.04. The version of the udisks2
> package is 2.1.3-1.
>
> I changed the UID of a user on my system from 1001 to something else.
> After the change, the ACL permissions on /media/<username> still
> reflected the old UID. After I deleted the directory and inserted a
> usb thumbdrive, the directory was recreated with the correct acl
> permissions.
>
> ACLs after UID change but before removing the directory:
> $ getfacl /media/rat
> getfacl: Removing leading '/' from absolute path names
> # file: media/rat
> # owner: root
> # group: root
> user::rwx
> user:1001:r-x
> group::---
> mask::r-x
> other::---
>
> After removing the dir, inserting a thumb drive, and then removing the
> thumb drive:
> $ getfacl /media/rat
> getfacl: Removing leading '/' from absolute path names
> # file: media/rat
> # owner: root
> # group: root
> user::rwx
> user:rat:r-x
> group::---
> mask::r-x
> other::---
>
> Since udisks controls the /media directory, shouldn't it just verify
> and update the permissions of the directory?
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/udisks2/+bug/1335384/+subscriptions
>