Bug#856602: postinst sed delimiter causes failure

2017-03-03 Thread Markus Koschany
Am 03.03.2017 um 23:41 schrieb Josh Powers:
> On Fri, Mar 3, 2017 at 3:25 PM, Emmanuel Bourg  > wrote:
> 
> Le 3/03/2017 à 23:07, Markus Koschany a écrit :
> 
> > I think we could reassign this bug report to tomcat8 which is also
> affected.
> 
> Or merged with #770911 which has been fixed 3 months ago.
> 
> 
> We had this reported in Ubuntu and I wanted to see about getting it fixed in
> Debian or at least see how others might resolve it. The fix in #770911 looks
> good to me, however Tomcat 7 will continue to run into the issue.
 ^^

I suppose that should be an 8 here. I agree that the sed behavior for
Tomcat 7 and Tomcat 8 in the postinst script should be identical.

Regards,

Markus



signature.asc
Description: OpenPGP digital signature


Bug#856602: postinst sed delimiter causes failure

2017-03-03 Thread Josh Powers
On Fri, Mar 3, 2017 at 3:25 PM, Emmanuel Bourg  wrote:

> Le 3/03/2017 à 23:07, Markus Koschany a écrit :
>
> > I think we could reassign this bug report to tomcat8 which is also
> affected.
>
> Or merged with #770911 which has been fixed 3 months ago.
>

We had this reported in Ubuntu and I wanted to see about getting it fixed in
Debian or at least see how others might resolve it. The fix in #770911 looks
good to me, however Tomcat 7 will continue to run into the issue.

Thanks,
Josh


Bug#856602: postinst sed delimiter causes failure

2017-03-03 Thread Emmanuel Bourg
Le 3/03/2017 à 23:07, Markus Koschany a écrit :

> I think we could reassign this bug report to tomcat8 which is also affected.

Or merged with #770911 which has been fixed 3 months ago.



Bug#856602: postinst sed delimiter causes failure

2017-03-03 Thread Markus Koschany
Am 03.03.2017 um 00:00 schrieb Emmanuel Bourg:
> Hi Joshua,
> 
> The tomcat7/7.0.75-1 package no longer exist in unstable/testing. Did
> you mean to report this issue against the Jessie backport?

I think we could reassign this bug report to tomcat8 which is also affected.

Regards,

Markus




signature.asc
Description: OpenPGP digital signature


Bug#856602: postinst sed delimiter causes failure

2017-03-02 Thread Emmanuel Bourg
Hi Joshua,

The tomcat7/7.0.75-1 package no longer exist in unstable/testing. Did
you mean to report this issue against the Jessie backport?

Emmanuel Bourg



Bug#856602: postinst sed delimiter causes failure

2017-03-02 Thread Joshua Powers
Package: tomcat7
Version: 7.0.75-1

Similiar to Debian bug #597814, the sed statement in the postinst
assumes there is no '%' in a user's JAVA_OPTS. However, this is a valid
possiblity, for example:

-XX:ErrorFile=/var/log/tomcat7/java_error%p.log

This will cause the sed command to fail as it finds a % too early. The
delimiter was previous a '/' however, that can obviously be found in a
path. I would propose that this be changed to use the '|' symbol as it
should be even less common then the % symbol.

Another alternative to remove this situation entirely would be to escape
the strings matching the delimeter. 

debian/tomcat7.postinst debian/tomcat7.postinst
index a8919dd..083c6a3 100644
--- debian/tomcat7.postinst
+++ debian/tomcat7.postinst
@@ -20,9 +20,9 @@ case "$1" in
tmpfile=`mktemp /tmp/tomcat7.XX`
chmod 644 $tmpfile
cat $TEMPLATE \
-   | sed "s%^TOMCAT7_USER=.*$%TOMCAT7_USER=$TOMCAT7_USER%" \
-   | sed "s%^TOMCAT7_GROUP=.*$%TOMCAT7_GROUP=$TOMCAT7_GROUP%" \
-   | sed "s%^JAVA_OPTS=.*$%JAVA_OPTS=\"$JAVA_OPTS\"%" \
+   | sed "s|^TOMCAT7_USER=.*$|TOMCAT7_USER=$TOMCAT7_USER|" \
+   | sed "s|^TOMCAT7_GROUP=.*$|TOMCAT7_GROUP=$TOMCAT7_GROUP|" \
+   | sed "s|^JAVA_OPTS=.*$|JAVA_OPTS=\"$JAVA_OPTS\"|" \
>> $tmpfile
ucf --debconf-ok --sum-file /usr/share/tomcat7/defaults.md5sum $tmpfile 
$CONFFILE
rm -f $tmpfile


-- 
Joshua Powers
Ubuntu Server
Canonical Ltd