[systemd-devel] mkosi.postinst and user home permissions

Lennart Poettering lennart at poettering.net
Mon Jul 10 08:46:06 UTC 2017


On Tue, 04.07.17 12:28, Federico Bruni (fede at inventati.org) wrote:

> Hi all
> 
> I hope this is the right place to ask questions about mkosi.

Hmm, not really. We currently have no mailing list for mkosi
though. Maybe the github issue tracker of mkosi would be the best
place to discuss things like this for now.

But anyway, let's discuss this one issue here, given that it already
has been posted here.

> I'm building fedora-26 in a directory.
> I want to add a normal user, so I've added to mkosi.postinst:
> 
> useradd dev -p mypassword
> usermod dev -a -G wheel
> 
> These two commands work fine, but the permissions are not correct:
> 
> # ls -l /home/
> total 4
> drwxrwxr-x 2 root root 4096 Jul  3 18:13 dev
> 
> Is this a bug? Or maybe what I'm trying to do should be accomplished in
> another way?
> As a workaround, I might try add a third line to mkosi.postinst:

Uh, this appears very strange to me, this feels like a bug in
"useradd" indeed. I have no idea why the directory isn#t created
properly...

if you invoke "stat /home/dev" in that same script right after you
created the user, does it appear correct then?


Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list