1 |
On Thursday 01 November 2007, Bernard Cafarelli wrote: |
2 |
> Le Thu, 1 Nov 2007 16:06:51 +0100 |
3 |
> |
4 |
> Marius Mauch <genone@g.o> a écrit: |
5 |
> > On Thu, 1 Nov 2007 15:43:18 +0100 |
6 |
> > |
7 |
> > Bernard Cafarelli <voyageur@g.o> wrote: |
8 |
> > > Le Wed, 31 Oct 2007 16:42:35 -0700 |
9 |
> > > |
10 |
> > > Donnie Berkholz <dberkholz@g.o> a écrit: |
11 |
> > > > On 19:49 Wed 31 Oct , Bernard Cafarelli (voyageur) wrote: |
12 |
> > > > > 1.1 |
13 |
> > > > > net-misc/nxserver-freenx/nxserver-freenx-0.7.1.ebuild |
14 |
> > > > > |
15 |
> > > > > file : |
16 |
> > > > > http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/nxserver-f |
17 |
> > > > >reenx/nxserver-freenx-0.7.1.ebuild?rev=1.1&view=markup plain: |
18 |
> > > > > http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/nxserver-f |
19 |
> > > > >reenx/nxserver-freenx-0.7.1.ebuild?rev=1.1&content-type=text/plain |
20 |
> > > > > |
21 |
> > > > > pkg_postinst () { |
22 |
> > > > > usermod -s /usr/bin/nxserver nx || die "Unable to set |
23 |
> > > > > login shell of nx user!!" usermod -d ${NX_HOME_DIR} nx || die |
24 |
> > > > > "Unable to set home directory of nx user!!" |
25 |
> > > > |
26 |
> > > > This isn't safe with ROOT != / and it looks wrong too, you oughta |
27 |
> > > > be using enewuser for this stuff. |
28 |
> > > > |
29 |
> > > > Thanks, |
30 |
> > > > Donnie |
31 |
> > > |
32 |
> > > The problem is, enewuser can not be used to modify already existing |
33 |
> > > user accounts.This happens if another nxserver was installed before |
34 |
> > > (which uses the same account, but with different shell and home |
35 |
> > > directory). |
36 |
> > > |
37 |
> > > I'll fix ROOT handling in the meantime, this should be better: |
38 |
> > > usermod -s "${ROOT}"/usr/bin/nxserver nx |
39 |
> > > usermod -d "${ROOT}"{NX_HOME_DIR} nx |
40 |
> > |
41 |
> > Should it really? Wouldn't it modify /etc/passwd instead of the one in |
42 |
> > $ROOT, in which case it would actually be worse? |
43 |
> > Might be better to make it conditional on ROOT = /, and show a |
44 |
> > warning if ROOT != /, unless you can find a solution that is safe for |
45 |
> > ROOT != / |
46 |
> |
47 |
> Yes, as pointed out on IRC by zlin, this does not fix the problem at |
48 |
> all (and make it a little worse!). |
49 |
> |
50 |
> Making it conditional on ROOT != / is a good workaround in the |
51 |
> meantime: not breaking anything in all cases, and as the problem only |
52 |
> appears if a different nxserver was installed before, it still works in |
53 |
> most cases. Thanks! |
54 |
|
55 |
presumably you have init.d scripts which would start the daemons ? in that |
56 |
case, it'd make more sense i think to move the user account check to the |
57 |
init.d start() function and error out telling the user what to do instead of |
58 |
modifying things on them (which i think is bad form). see the cheesy check |
59 |
in openntpd's "ntpd" init.d script as an example. |
60 |
-mike |