Re: [gentoo-dev] How to force homedir on enewuser

2008-01-18 Thread Marius Mauch
On Fri, 18 Jan 2008 03:46:58 +0100
Hanno Böck [EMAIL PROTECTED] 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



Re: [gentoo-dev] How to force homedir on enewuser

2008-01-18 Thread Mike Frysinger
On Friday 18 January 2008, Marius Mauch wrote:
 Hanno Böck [EMAIL PROTECTED] 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


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-dev] How to force homedir on enewuser

2008-01-18 Thread Roy Marples

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



[gentoo-dev] How to force homedir on enewuser

2008-01-17 Thread Hanno Böck
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: [EMAIL PROTECTED]


signature.asc
Description: This is a digitally signed message part.