Gentoo Archives: gentoo-dev

From: Bernard Cafarelli <voyageur@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in net-misc/nxserver-freenx: nxserver-freenx-0.7.0-r1.ebuild ChangeLog nxserver-freenx-0.7.1.ebuild
Date: Fri, 02 Nov 2007 13:16:58
Message-Id: 601f793be4f9bd08aab8264b38ce6da8@localhost
In Reply to: Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in net-misc/nxserver-freenx: nxserver-freenx-0.7.0-r1.ebuild ChangeLog nxserver-freenx-0.7.1.ebuild by Mike Frysinger
1 On Fri, 2 Nov 2007 03:35:35 -0400, Mike Frysinger <vapier@g.o>
2 wrote:
3 > On Thursday 01 November 2007, Bernard Cafarelli wrote:
4 >> Le Thu, 1 Nov 2007 16:06:51 +0100
5 >>
6 >> Marius Mauch <genone@g.o> a écrit:
7 >> > On Thu, 1 Nov 2007 15:43:18 +0100
8 >> >
9 >> > Bernard Cafarelli <voyageur@g.o> wrote:
10 >> > > Le Wed, 31 Oct 2007 16:42:35 -0700
11 >> > >
12 >> > > Donnie Berkholz <dberkholz@g.o> a écrit:
13 >> > > > On 19:49 Wed 31 Oct , Bernard Cafarelli (voyageur) wrote:
14 >> > > > > 1.1
15 >> > > > > net-misc/nxserver-freenx/nxserver-freenx-0.7.1.ebuild
16 >> > > > >
17 >> > > > > file :
18 >> > > > >
19 > http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/nxserver-f
20 >> > > > >reenx/nxserver-freenx-0.7.1.ebuild?rev=1.1&view=markup plain:
21 >> > > > >
22 > http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/nxserver-f
23 >> > > >
24 >>reenx/nxserver-freenx-0.7.1.ebuild?rev=1.1&content-type=text/plain
25 >> > > > >
26 >> > > > > pkg_postinst () {
27 >> > > > > usermod -s /usr/bin/nxserver nx || die "Unable to set
28 >> > > > > login shell of nx user!!" usermod -d ${NX_HOME_DIR} nx || die
29 >> > > > > "Unable to set home directory of nx user!!"
30 >> > > >
31 >> > > > This isn't safe with ROOT != / and it looks wrong too, you oughta
32 >> > > > be using enewuser for this stuff.
33 >> > > >
34 >> > > > Thanks,
35 >> > > > Donnie
36 >> > >
37 >> > > The problem is, enewuser can not be used to modify already existing
38 >> > > user accounts.This happens if another nxserver was installed before
39 >> > > (which uses the same account, but with different shell and home
40 >> > > directory).
41 >> > >
42 >> > > I'll fix ROOT handling in the meantime, this should be better:
43 >> > > usermod -s "${ROOT}"/usr/bin/nxserver nx
44 >> > > usermod -d "${ROOT}"{NX_HOME_DIR} nx
45 >> >
46 >> > Should it really? Wouldn't it modify /etc/passwd instead of the one in
47 >> > $ROOT, in which case it would actually be worse?
48 >> > Might be better to make it conditional on ROOT = /, and show a
49 >> > warning if ROOT != /, unless you can find a solution that is safe for
50 >> > ROOT != /
51 >>
52 >> Yes, as pointed out on IRC by zlin, this does not fix the problem at
53 >> all (and make it a little worse!).
54 >>
55 >> Making it conditional on ROOT != / is a good workaround in the
56 >> meantime: not breaking anything in all cases, and as the problem only
57 >> appears if a different nxserver was installed before, it still works in
58 >> most cases. Thanks!
59 >
60 > presumably you have init.d scripts which would start the daemons ? in
61 > that
62 > case, it'd make more sense i think to move the user account check to the
63 > init.d start() function and error out telling the user what to do instead
64 > of
65 > modifying things on them (which i think is bad form). see the cheesy
66 > check
67 > in openntpd's "ntpd" init.d script as an example.
68 > -mike
69
70 nxserver-freeedition has one, however freenx only relies on ssh (connecting
71 as nx user will start up the "server").
72 Unless I add one for freenx that only does the user checking (so all NX
73 servers would include a init.d script).
74
75 Another solution would be to fix and update the setup scripts from the NX
76 servers themselves, but this is less portable...
77
78 Bernard
79
80 --
81 gentoo-dev@g.o mailing list