monotone-debian
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-debian] Bug#437978: Problem Found


From: Berg, Michael
Subject: [Monotone-debian] Bug#437978: Problem Found
Date: Sat, 03 Nov 2007 23:56:36 -0600
User-agent: Mozilla-Thunderbird 2.0.0.6 (X11/20071008)

I spent some time going through /var/lib/dpkg/info/monotone-server.postinst
and noticed that all user:group and permissions settings on lines
124-148 were getting done except for the "if"-block on lines 126-140.
The if-block that isn't getting done is
==========
if [ -z "`id -u monotone 2>/dev/null`" ]; then
   ...
==========

After purging the installed monotone-server package, the monotone user
and group where still present on the system -- so when I would reinstall
 monotone-server, none of the user:group or permissions settings in that
if-block were being done on the newly created directories.

The monotone user and group were still present because of the section in
/var/lib/dpkg/info/monotone-server.postrm starting at line 80 with the
description:
==========
# if deluser/delgroup exist, remove the server user and group.
# do not do this if /var/lib/monotone still exists (so that it
# will still have a named user owning it).
==========

I use a key name for the monotone server that is different from the
auto-generated one, so there was still that key file in
/var/lib/monotone/keys, so /var/lib/monotone was still present and
prevented the monotone user and group from being removed, messing up
directory permissions on a reinstall.

Once I manually removed the user and group, installing monotone-server
sets the user:group and permissions correctly.


As one potential solution, would it work to move the "chown" and "chmod"
lines to just after the "`id -u monotone 2>/dev/null`" if-block down to
with all the other "chown" and "chmod" lines being done on a new install?

That way the monotone user and group being present would only effect the
"adduser" command and not the settings for the newly created directories.

Potential patch is attached.


- Michael Berg

--- monotone-server.postinst    2007-11-03 23:49:54.000000000 -0600
+++ monotone-server.postinst.fixed      2007-11-03 23:51:31.000000000 -0600
@@ -127,18 +127,18 @@
               adduser --system --group --home $MTN_HOME \
               --no-create-home --disabled-password --quiet        \
               --gecos "Monotone" monotone
-              
-              chown monotone:monotone $MTN_HOME
-               chown monotone:monotone $MTN_CONFDIR
-               chown monotone:monotone $MTN_KEYDIR
-               chown monotone:monotone /var/log/monotone
-               chown monotone:monotone /var/run/monotone
-
-               chmod 0750 $MTN_HOME
-               chmod 0750 $MTN_CONFDIR
-               chmod 0750 $MTN_KEYDIR
            fi
 
+           chown monotone:monotone $MTN_HOME
+           chown monotone:monotone $MTN_CONFDIR
+           chown monotone:monotone $MTN_KEYDIR
+           chown monotone:monotone /var/log/monotone
+           chown monotone:monotone /var/run/monotone
+
+           chmod 0750 $MTN_HOME
+           chmod 0750 $MTN_CONFDIR
+           chmod 0750 $MTN_KEYDIR
+
            chown monotone:monotone /etc/monotone/write-permissions
            chown monotone:monotone /etc/monotone/read-permissions
            chown monotone:monotone /etc/monotone/hooks.lua

reply via email to

[Prev in Thread] Current Thread [Next in Thread]