Bug 16039 - chown misinterprets "." as group separator
Summary: chown misinterprets "." as group separator
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.36.x
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-17 15:57 UTC by Matthew Slowe
Modified: 2024-04-17 15:57 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
possible fix (573 bytes, application/octet-stream)
2024-04-17 15:57 UTC, Matthew Slowe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Slowe 2024-04-17 15:57:16 UTC
Created attachment 9736 [details]
possible fix

In uidgid_get.c there is a parse_chown_usergroup_or_die() function which continues to implement a very old BSD(?) notation of user.group as well as user:group -- the code assumes that the first "." is a separater.

I don't know what else calls it but, for the chown applet, the implementation precludes support of users with "."s in (such as "test.test") when invoked with "chown test.test file":

     # chown test.test /tmp/test
     chown: unknown user/group test:test

https://github.com/mirror/busybox/blame/master/libpwdgrp/uidgid_get.c#L96

There is no reference to this interpretation in the code comment of the usage string:

    Usage: chown [-RhLHPcvf]... USER[:[GRP]] FILE...

Given that this notation appears to have been deprecated back in 2001, is now the time to remove this?

Possible patch to fix attached