Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-dev
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-dev@g.o
From: Mike Frysinger <vapier@g.o>
Subject: Re: RFC: enewuser should force updates to shell and home
Date: Wed, 13 Jun 2012 15:04:06 -0400
On Wednesday 13 June 2012 14:32:22 Ian Stakenvicius wrote:
> On 13/06/12 02:09 PM, Fabian Groffen wrote:
> > On 13-06-2012 12:00:16 -0400, Ian Stakenvicius wrote:
> >> Hey all - I'd like to propose that enewuser forces updates to a
> >> user's home dir and shell whenever it is called, so that if this
> >> changes with new versions of an ebuild it is dealt with
> >> automatically rather than having to modify them in
> >> pkg_postinst/pkg_setup directly.
> > 
> > What if some admin purposely changed home or shell for a system
> > account? Would be quite annoying if every update would reset that,
> > wouldn't it?
> 
> I considered this case, and that it might be more appropriate to
> duplicate 'enewuser' into a new call 'eforceuser' (or similar) which
> could be used instead of 'enewuser' in cases when the currently
> provided user settings should be forced.
> 
> I decided against this as it seems also to make sense that users
> created by portage should be controlled by portage.

the users only get created by portage if they don't already exist.  so i 
wouldn't say that the user entries in /etc/passwd "belong" to portage.

> I suppose probably the best means of handling this would be to somehow
> detect whether or not the current user settings are default and only
> apply the updates if they are; however a means of doing that (which
> would be transparent to the ebuild) is somewhat beyond my knowledge
> and abilities.

we have egetshell and egethome already.  thus it's fairly easy to detect the 
transition case.  if they installed the older version which set values that 
you now want to change:
if has_version '<foo/pkg-3' && [[ $(egetshell user) == "/bad/shell" ]] ; then
	esetshell user /good/shell
fi
if has_version '<foo/pkg-3' && [[ $(egethome user) == "/old/home" ]] ; then
	esethome user /new/home
fi
-mike
Attachment:
signature.asc (This is a digitally signed message part.)
Replies:
Re: RFC: enewuser should force updates to shell and home
-- Ian Stakenvicius
References:
RFC: enewuser should force updates to shell and home
-- Ian Stakenvicius
Re: RFC: enewuser should force updates to shell and home
-- Fabian Groffen
Re: RFC: enewuser should force updates to shell and home
-- Ian Stakenvicius
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: RFC: enewuser should force updates to shell and home
Next by thread:
Re: RFC: enewuser should force updates to shell and home
Previous by date:
Re: RFC: enewuser should force updates to shell and home
Next by date:
Re: RFC: enewuser should force updates to shell and home


Updated Jun 29, 2012

Summary: Archive of the gentoo-dev mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.