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

Bug#685230: unblock hylafax 3:6.0.6-4



Hi,

On Sat, Dec 01, 2012 at 12:18:43PM +0100, Julien Cristau wrote:
> > diff -ruN 6.0.6-1/debian/hylafax-client.postrm 6.0.6-2~wheezy1/debian/hylafax-client.postrm
> > --- 6.0.6-1/debian/hylafax-client.postrm        2010-06-20 00:29:50.000000000 +0200
> > +++ 6.0.6-2~wheezy1/debian/hylafax-client.postrm        2012-10-12 23:53:34.000000000 +0200
> > @@ -4,8 +4,9 @@
> >  
> >  if [ "$1" = "purge" ]; then
> >      [ -d /etc/hylafax ] && rm -f /etc/hylafax/pagesizes
> > -    rmdir --ignore-fail-on-non-empty /etc/hylafax
> > -    if which ucf >/dev/null 2>&1; then
> > -       ucf --purge /etc/hylafax/pagesizes
> > -    fi
> > +    #rmdir --ignore-fail-on-non-empty /etc/hylafax
> > + 
> > +    # clear and deregister config file out from ucf database
> > +    which ucf >/dev/null && ucf --purge /etc/hylafax/pagesizes
> > +    which ucfr >/dev/null && ucfr --purge hylafax-client /etc/hylafax/pagesizes
> >  fi
> 
> might want an 'exit 0' here to make sure the script doesn't exit with an
> error if ucfr doesn't exist.

> > diff -ruN 6.0.6-1/debian/rules 6.0.6-2~wheezy1/debian/rules
> > --- 6.0.6-1/debian/rules        2012-06-17 14:47:42.000000000 +0200
> > +++ 6.0.6-2~wheezy1/debian/rules        2012-10-13 00:08:17.000000000 +0200
> > @@ -224,6 +224,7 @@
> >         do chmod 755 $(d_server)/var/spool/hylafax/$$i; done
> >         chmod 775 $(d_server)/var/spool/hylafax
> >         chmod 4777 $(d_server)/var/spool/hylafax/tmp
> > +       chmod og+t $(d_server)/var/spool/hylafax/tmp
> 
> Why a separate chmod call for the same directory?
> 
> >         chmod 755  $(d_server)/var/spool/hylafax/dev
> >         chown uucp $(d_server)/etc/hylafax/hosts.hfaxd
> >         chmod 600  $(d_server)/etc/hylafax/hosts.hfaxd
> > 

Probably because the first chmod has to be 1777, not 4777.

I tried to create a new patch for a TPU version which fixes both issues.
However, I ran into a few problems:

After the changes in the patch from http://bugs.debian.org/685230#35, piuparts
still complains about permissions on upgade from squeeze to wheezy. This is
easy to fix with a chmod in the postinst (which is also in -4 in sid). With
these changes, 682824 seems really fixed.

The fix for 661482 is a different story. I don't see any fix for 661482 in the
TPU patch. Looking at the version in sid, it seems piuparts still gives some
errors, because hylafax-server changes the ownership of /var/spool/hylafax,
which is also in capi4hylafax. I reopened 661482 in sid.

As there is still an RC bug in sid, I don't think it makes sense to do a TPU
upload for the other one now. I'm attaching the TPU fix for 682824 for
reference.

It might be best to revert all the changes in unstable (since -1) that are not
suitable for wheezy, and try to get a version in unstable that fixes both RC
bugs in a non-intrusive way (based on -1). That way, the package could be
tested in unstable before it gets to wheezy. The changes that are in -2 could
go to experimental for now.

Cheers,

Ivo

diff --git a/debian/changelog b/debian/changelog
index 21112d9..797b0ff 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,18 @@
+hylafax (3:6.0.6-2~wheezy1) UNRELEASED; urgency=high
+
+  [ Giuseppe Sacco ]
+  * Added restricted deletion flag on tmp directory (Closes: #682824)
+  * Update postinst and postrm scripts for hylafax-client
+    TODO: doesn't really fix 661482
+
+  [ Ivo De Decker ]
+  * Fixes for wheezy. Thanks to Julien Cristau for the review:
+    Make sure hylafax-client.postrm exists successfully.
+    Use correct chmod call for /var/spool/hylafax/tmp.
+  * Also fix permissions for tmp dir on upgrade. 
+
+ -- Ivo De Decker <ivo.dedecker@ugent.be>  Sat, 22 Dec 2012 20:33:42 +0100
+
 hylafax (3:6.0.6-1) unstable; urgency=low
 
   * New upstream relase. Converted to 6.0 branch instead of 6.1 since the
diff --git a/debian/hylafax-client.postinst b/debian/hylafax-client.postinst
index 4cf156e..c0043fd 100644
--- a/debian/hylafax-client.postinst
+++ b/debian/hylafax-client.postinst
@@ -38,6 +38,9 @@ else
 	ucf "$newfile" /etc/hylafax/pagesizes
 fi
 
+# register config file with package name to ucf
+ucfr hylafax-client /etc/hylafax/pagesizes
+
 rm -f "$newfile"
 
 #
diff --git a/debian/hylafax-client.postrm b/debian/hylafax-client.postrm
index 80cde8b..582b5ca 100644
--- a/debian/hylafax-client.postrm
+++ b/debian/hylafax-client.postrm
@@ -4,8 +4,11 @@
 
 if [ "$1" = "purge" ]; then
     [ -d /etc/hylafax ] && rm -f /etc/hylafax/pagesizes
-    rmdir --ignore-fail-on-non-empty /etc/hylafax
-    if which ucf >/dev/null 2>&1; then
-	ucf --purge /etc/hylafax/pagesizes
-    fi
+    #rmdir --ignore-fail-on-non-empty /etc/hylafax
+ 
+    # clear and deregister config file out from ucf database
+    which ucf >/dev/null && ucf --purge /etc/hylafax/pagesizes
+    which ucfr >/dev/null && ucfr --purge hylafax-client /etc/hylafax/pagesizes
 fi
+
+exit 0
diff --git a/debian/hylafax-server.postinst b/debian/hylafax-server.postinst
index 2b88f0d..6500995 100644
--- a/debian/hylafax-server.postinst
+++ b/debian/hylafax-server.postinst
@@ -309,6 +309,12 @@ db_title HylaFAX Server
 	# Remove old broken link on upgrade to 4.2.2. -- Corrected in 4.2.5
 	[ -L /var/spool/hylafax/etc/bin ] && rm /var/spool/hylafax/etc/bin
 
+	# manually fix permissions when upgrading from old package
+	if [ "$1" = configure ] && dpkg --compare-versions "$2" lt 3:6.0.6-4
+	then
+		chmod o+t /var/spool/hylafax/tmp
+	fi
+
 db_stop
 
 exit 0
diff --git a/debian/rules b/debian/rules
index a58757b..7ba179c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -223,7 +223,7 @@ ifneq (,$(findstring hylafax-server, $(shell dh_listpackages)))
 	for i in archive docq doneq pollq sendq; \
 	do chmod 755 $(d_server)/var/spool/hylafax/$$i; done
 	chmod 775 $(d_server)/var/spool/hylafax
-	chmod 4777 $(d_server)/var/spool/hylafax/tmp
+	chmod 1777 $(d_server)/var/spool/hylafax/tmp
 	chmod 755  $(d_server)/var/spool/hylafax/dev
 	chown uucp $(d_server)/etc/hylafax/hosts.hfaxd
 	chmod 600  $(d_server)/etc/hylafax/hosts.hfaxd

Reply to: