mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: David Jander <david@protonic.nl>
To: Guillermo Rodriguez Garcia <guille.rodriguez@gmail.com>
Cc: Michael Olbrich <m.olbrich@pengutronix.de>,
	"ptxdist@pengutronix.de" <ptxdist@pengutronix.de>
Subject: Re: [ptxdist] Resend: Home dir fixup for root in systemd
Date: Wed, 27 Jul 2016 07:51:24 +0200	[thread overview]
Message-ID: <20160727075124.28de2cdf@erd980> (raw)
In-Reply-To: <CABDcavaWVOP5kW_5iwrFFhBR-jsaUD5mm-mcCaOf_2swdW-KKA@mail.gmail.com>

On Tue, 26 Jul 2016 19:50:09 +0200
Guillermo Rodriguez Garcia <guille.rodriguez@gmail.com> wrote:

> Hi David,
> 
> 2016-07-26 16:00 GMT+02:00 David Jander <david@protonic.nl>:
> 
> >
> > Dear Guillermo,
> >
> > Thanks for your reply.
> >
> > On Tue, 26 Jul 2016 15:19:59 +0200
> > Guillermo Rodriguez Garcia <guille.rodriguez@gmail.com> wrote:
> >  
> > > 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.  
> >
> > Maybe it would be better to change the default /etc/passwd (and everywhere
> > else) in ptxdist then...
> >  
> 
> I think that the default /etc/passwd (and many other files that are
> distributed
> with ptxdist) should be taken just as generic examples. Ptxdist BSPs are
> expected

Generic examples are expected to at least be semantically correct. This isn't.

> to customize any files as needed and in fact ptxdist is already prepared to
> handle
> that: Just drop your customized files in the projectroot/  dir in your BSP
> and they
> will be picked up, as long as the relevant rules files use the
> install_alternative
> macros.

Of course one can customize these files. But just as with any other default
setting or example configuration, the user expects these settings to be
correct. That said, if I start a new ptxdist project and take the
example /etc/passwd as a starting point I'd assume that it's always best to
not touch defaults I do not need to change for my specific purpose, so I'd
probably leave $HOME=/home just the way it is. The expectation is for that
default to work and behave correctly.
In case I wasn't clear enough: I am not asking for a workaround, I am offering
a fix for a bug in PTXdist and asking for a proper way of submitting that fix.

> > The problem is that what /etc/passwd says is mandatory. The home directory
> > has
> > a special meaning to the user. You can get to the home directory via $HOME
> > passed in the environment, or via the NS-switch (getent) lookup. They are
> > supposed to be the same.
> > systemd has hardcoded defaults in source-code, which by definition is ugly
> > as
> > hell, but the reason is clearly to avoid potentially expensive, blocking
> > NSS-lookups in the early boot stages, so it is understandable. It would be
> > a
> > lot better if there was some configuration setting read from a file I
> > guess,
> > but alas.
> > On PTXdist now (with the default, shipped /etc/passwd), a user logging in
> > as
> > "root" via, say a serial console getty, will have a different $HOME than a
> > systemd service started with User=root. This is bad, and can potentially do
> > funny things people will not like.
> > To solve the problem, there are really only two options AFAICS:
> >
> >  1.- Change PTXdist and all places in it that assume the $HOME=/home for
> > root.
> >  No idea how many places that are, nor how many users already depend on
> > this
> >  historic assumption.
> >
> > or
> >
> >  2.- Patch systemd to adapt to the reality of PTXdist.
> >  
> 
> Yes, or
> 
> 3.- Customize the files in your BSP :-)

No. Like I said in my previous e-mail (the part after this part, that you
omitted from the quote), this way the default PTXdist stays broken and my
intention is to fix just that.

Best regards,

-- 
David Jander
Protonic Holland.

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

  reply	other threads:[~2016-07-27  5:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-26 12:09 David Jander
2016-07-26 13:19 ` Guillermo Rodriguez Garcia
2016-07-26 14:00   ` David Jander
2016-07-26 15:13     ` Ben Stuyts
2016-07-27  5:41       ` David Jander
2016-07-26 17:50     ` Guillermo Rodriguez Garcia
2016-07-27  5:51       ` David Jander [this message]
2016-07-27 12:04         ` Guillermo Rodriguez Garcia
2016-07-27  6:55     ` Michael Olbrich
2016-07-27  8:55       ` David Jander
2016-07-27  9:04         ` Michael Olbrich
2016-07-27  9:11         ` Artur Wiebe
2016-07-27  9:29           ` David Jander
2016-07-27 10:43             ` Michael Olbrich
2016-07-27 11:24               ` David Jander
2016-07-29  8:07       ` Tim Sander

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160727075124.28de2cdf@erd980 \
    --to=david@protonic.nl \
    --cc=guille.rodriguez@gmail.com \
    --cc=m.olbrich@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox