public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] How to force homedir on enewuser
@ 2008-01-18  2:46 Hanno Böck
  2008-01-18  8:12 ` Marius Mauch
  0 siblings, 1 reply; 4+ messages in thread
From: Hanno Böck @ 2008-01-18  2:46 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 765 bytes --]

Hi,

Following situation: Older mailman ebuilds used to set the mailman user home 
to /usr/local/mailman (which is obviously wrong).

Now with the new mailman ebuild, various directories are configurable.

The mailman user is created with the enewuser macro. Now, the problem is that 
enewuser just exits with zero if the user already exists. Thus the old 
homedir is kept.

What is the correct way to handle this? I'd suggest that enewuser might get 
some "force"-parameter that tells it to delete and recreate the user if it 
already exists. Thoughts?

(If noone comes around with a better idea, I'll open a bug with a feature 
request within a few days)

-- 
Hanno Böck		Blog:   http://www.hboeck.de/
GPG: 3DBD3B20		Jabber: hanno@hboeck.de

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] How to force homedir on enewuser
  2008-01-18  2:46 [gentoo-dev] How to force homedir on enewuser Hanno Böck
@ 2008-01-18  8:12 ` Marius Mauch
  2008-01-18 11:41   ` Mike Frysinger
  0 siblings, 1 reply; 4+ messages in thread
From: Marius Mauch @ 2008-01-18  8:12 UTC (permalink / raw
  To: gentoo-dev

On Fri, 18 Jan 2008 03:46:58 +0100
"Hanno Böck" <hanno@gentoo.org> wrote:

> What is the correct way to handle this? I'd suggest that enewuser might get 
> some "force"-parameter that tells it to delete and recreate the user if it 
> already exists. Thoughts?

Tell the user to do it manually in pkg_setup/postinst. This is
something that IMO shouldn't be done by the ebuild/package manager for
two reasons:
- extreme cornercase, or how often does this come up?
- the system might rely on the current settings in unexpected ways

Marius
--
gentoo-dev@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] How to force homedir on enewuser
  2008-01-18  8:12 ` Marius Mauch
@ 2008-01-18 11:41   ` Mike Frysinger
  2008-01-18 11:51     ` Roy Marples
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2008-01-18 11:41 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 918 bytes --]

On Friday 18 January 2008, Marius Mauch wrote:
> "Hanno Böck" <hanno@gentoo.org> wrote:
> > What is the correct way to handle this? I'd suggest that enewuser might
> > get some "force"-parameter that tells it to delete and recreate the user
> > if it already exists. Thoughts?
>
> Tell the user to do it manually in pkg_setup/postinst. This is
> something that IMO shouldn't be done by the ebuild/package manager for
> two reasons:
> - extreme cornercase, or how often does this come up?
> - the system might rely on the current settings in unexpected ways

right, there is no way (by design) to force these settings on an already 
created user.  if the old path really truly should not be the old value, you 
can do something like this in pkg_setup:
if [[ $(egetent passwd user | cut -d: -f6) == "/the/old/path" ]] ; then
	eerror "please run usermod -m -d /new/path ......"
	die "moocow"
fi
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] How to force homedir on enewuser
  2008-01-18 11:41   ` Mike Frysinger
@ 2008-01-18 11:51     ` Roy Marples
  0 siblings, 0 replies; 4+ messages in thread
From: Roy Marples @ 2008-01-18 11:51 UTC (permalink / raw
  To: gentoo-dev


On Fri, 2008-01-18 at 06:41 -0500, Mike Frysinger wrote:
> right, there is no way (by design) to force these settings on an already 
> created user.  if the old path really truly should not be the old value, you 
> can do something like this in pkg_setup:
> if [[ $(egetent passwd user | cut -d: -f6) == "/the/old/path" ]] ; then
> 	eerror "please run usermod -m -d /new/path ......"
> 	die "moocow"
> fi

You should also ensure that ${ROOT} is /

Thanks

Roy

-- 
gentoo-dev@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-01-18 11:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-18  2:46 [gentoo-dev] How to force homedir on enewuser Hanno Böck
2008-01-18  8:12 ` Marius Mauch
2008-01-18 11:41   ` Mike Frysinger
2008-01-18 11:51     ` Roy Marples

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox