On Fri, Aug 29, 2025 at 09:10:15PM -0500, Rob Browning wrote:
Offhand, and without remembering perl's exact semantics on this front,
I'd guess this is a case of assuming paths are decodable in the current
locale. If so, it should be possible to reproduce the problem from a
UTF-8 locale like this:

 touch /any/where/not-utf-8-but-possible-$'\177'
 deluser --remove-all-files someuser

Here the equivalent eventually fails to remove /home/someuser,
reporting:

 invalid characters in input string, see trace output for more details
 at /usr/share/perl5/Debian/AdduserCommon.pm line 143.

I was able to reproduce this, write a test case, and change the code so that the deluser call now proceeds correctly. Files belonging to the user that is being deleted AND have strange file names might stay aroud now. I think that addressing this is much harder.

Would you want to review https://salsa.debian.org/debian/adduser/-/merge_requests/107 ?

Greetings
Marc


--
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany    |  lose things."    Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421

Reply via email to