[PATCH] mkfs.ubifs: Add support for symlinks in device table
Richard Weinberger
richard at nod.at
Thu May 18 08:27:06 PDT 2017
David,
Am 18.05.2017 um 17:16 schrieb David Engraf:
> Hi Richard,
>
> Am 18.05.2017 um 17:08 schrieb Richard Weinberger:
>> David,
>>
>> Am 18.05.2017 um 17:03 schrieb David Engraf:
>>>>> You're right the permissions are ignored for symlinks but the user and group id is used. Without this flag mkfs.ubifs takes uid/gid from the local system.
>>>>
>>>> IMHO we can just force the uid/gid to 0, no?
>>>
>>> Why? It doesn't make sense to have all uid/gid to 0. This should be decided by the user. The purpose of the device table file is to allow the user to specify the
>>> permissions/uid/gid to his requirements. mkfs.jffs2 handles it like that as well.
>>
>> Since the ownership is ignored too, what is the usecase?
>
> The ownership is not ignored, you can have a different one for a symlink (check "chown -h"). This is supported on ubifs:
>
> lrwxrwxrwx 1 1 1 9 Jan 1 00:00 link -> orig_file
> -rw-r--r-- 1 0 0 0 Jan 1 00:00 orig_file
Ignored in terms of not evaluated.
i.e.
rw at captainhero:/mnt/dir> id
uid=1000(rw) gid=100(users) groups=100(users)
rw at captainhero:/mnt/dir> ls -la
total 0
drwxr-xr-x 2 rw root 240 May 18 17:23 .
drwxr-xr-x 3 root root 224 May 18 17:22 ..
lrwxrwxrwx 1 root root 11 May 18 17:23 s -> /etc/shadow
rw at captainhero:/mnt/dir> rm s
rw at captainhero:/mnt/dir> ls -la
total 0
drwxr-xr-x 2 rw root 176 May 18 17:24 .
drwxr-xr-x 3 root root 224 May 18 17:22 ..
rw at captainhero:/mnt/dir>
Although, user rw is not root, it can delete "s" which is owned by root
because rw has write permission on /mnt/dir.
That's why I'm interested in the usecase.
Thanks,
//richard
More information about the linux-mtd
mailing list