From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: MIME-Version: 1.0 In-Reply-To: <20160726140925.16dc99e7@erd980> References: <20160726140925.16dc99e7@erd980> From: Guillermo Rodriguez Garcia Date: Tue, 26 Jul 2016 15:19:59 +0200 Message-ID: Subject: Re: [ptxdist] Resend: Home dir fixup for root in systemd List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: multipart/mixed; boundary="===============0441912916==" Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: "ptxdist@pengutronix.de" Cc: Michael Olbrich --===============0441912916== Content-Type: multipart/alternative; boundary=001a1144083afa20fe053889c1cf --001a1144083afa20fe053889c1cf Content-Type: text/plain; charset=UTF-8 Wouldn't it be easier to either use a custom /etc/passwd, or create a /root dir in the filesystem ? That sounds better than patching systemd. Guillermo 2016-07-26 14:09 GMT+02:00 David Jander : > > Dear Michael, > > I have prepared a patch against ptxdist git for the package systemd-230. > I would like to know the right way to proceed to submit this patch, since > I am > not a ptxdist developer and am not familiar with how tools like > git-ptxdist-patch are supposed to be used (to generate the correct series > file > in this case). > > The patch is really trivial and I don't know if it deserves so much work (I > suspect that I have to clone the git repository of systemd first and apply > all > patches there, right?). > > What I am trying to fix here is the notion that systemd has about what the > $HOME directory of the user 'root' (uid=0) should be. As it seems, in > systemd > this is hardcoded to be "/root", while ptxdist by default seems to insist > in > "/home" for some reason (according to shipped /etc/passwd). Here's the gist > of what the patch does: > > --- systemd-230.orig/src/basic/user-util.c > +++ systemd-230/src/basic/user-util.c > @@ -123,7 +123,7 @@ int get_user_creds( > *gid = 0; > > if (home) > - *home = "/root"; > + *home = "/home"; > > if (shell) > *shell = "/bin/sh"; > > Without this patch, things like services that declare "User=root" get > screwed > up with the wrong home directory for example. > > Thanks. > > Best regards, > > -- > David Jander > Protonic Holland. > > _______________________________________________ > ptxdist mailing list > ptxdist@pengutronix.de -- Guillermo Rodriguez Garcia guille.rodriguez@gmail.com --001a1144083afa20fe053889c1cf Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Wouldn't it be easier to either use a custom /etc/pass= wd, or create a /root
dir in the filesystem ? That sounds better than p= atching systemd.

Guillermo

2016-07-26 14:09 GMT+02:00 David Ja= nder <david.jander@protonic.nl>:

Dear Michael,

I have prepared a patch against ptxdist git for the package systemd-230. I would like to know the right way to proceed to submit this patch, since I= am
not a ptxdist developer and am not familiar with how tools like
git-ptxdist-patch are supposed to be used (to generate the correct series f= ile
in this case).

The patch is really trivial and I don't know if it deserves so much wor= k (I
suspect that I have to clone the git repository of systemd first and apply = all
patches there, right?).

What I am trying to fix here is the notion that systemd has about what the<= br> $HOME directory of the user 'root' (uid=3D0) should be. As it seems= , in systemd
this is hardcoded to be "/root", while ptxdist by default seems t= o insist in
"/home" for some reason (according to shipped /etc/passwd). Here&= #39;s the gist
of what the patch does:

--- systemd-230.orig/src/basic/user-util.c
+++ systemd-230/src/basic/user-util.c
@@ -123,7 +123,7 @@ int get_user_creds(
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0*gid =3D 0;

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (home)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 *home =3D "/root";
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 *home =3D "/home";

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (shell) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0*shell =3D "/bin/sh";

Without this patch, things like services that declare "User=3Droot&quo= t; get screwed
up with the wrong home directory for example.

Thanks.

Best regards,

--
David Jander
Protonic Holland.

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
=



--
Guillermo Rodr= iguez Garcia
guille.rodriguez@gmail.com
--001a1144083afa20fe053889c1cf-- --===============0441912916== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KcHR4ZGlzdCBt YWlsaW5nIGxpc3QKcHR4ZGlzdEBwZW5ndXRyb25peC5kZQ== --===============0441912916==--