JDK-6256798 : error message at rpm uninstall, deleted /etc/mailcap
  • Type: Bug
  • Component: install
  • Sub-Component: install
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2005-04-18
  • Updated: 2013-06-04
  • Resolved: 2006-11-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.2_14 b01Fixed
Description
FULL PRODUCT VERSION :
java version "1.4.2_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_07-b05)
Java HotSpot(TM) Client VM (build 1.4.2_07-b05, mixed mode)
But it also happens with
java version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Linux hpme 2.6.8-24.11-smp #1 SMP Fri Jan 14 13:01:26 UTC 2005 i686 i686 i386 GNU/Linux

EXTRA RELEVANT SYSTEM CONFIGURATION :
not relevant

A DESCRIPTION OF THE PROBLEM :
The rpm postuninstall scriptlet contains a typo:
if [ -w $MAILCAP_FILE ]; then
  jGrep=`grep -n ${MIME_TYPE} $MAILCAP_FILE`
  if [ -n "$jGrep" ]; then
    MC_TEXT=`grep -v ${MIME_TYPE} < $MAILCAP_FILE | grep -v ${MC_COMMENT}"`
    echo -e "${MC_TEXT}" > ${MAILCAP_FILE}
  fi
else
...
The 4th line contains a double quote which causes an error message on screen
during uninstall or upgrade from 1.4.2_05 (since the posuninstall from that
version is executed which also contains this bug). Therefore $MC_TEXT is empty
and $MAIL_CAP is truncated to empty file in line 5.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
issue an rpm uninstall:
hpme:~ # rpm -e j2sdk
You also get this error if you upgrade from 1.4.2_05.


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I expect to not loose my /etc/mailcap and to not see any error message
ACTUAL -
/etc/mailcap is truncated, contains only one byte 0x0a

ERROR MESSAGES/STACK TRACES THAT OCCUR :
/var/tmp/rpm-tmp.62955: command substitution: line 62: unexpected EOF while looking for matching `"'
/var/tmp/rpm-tmp.62955: command substitution: line 63: syntax error: unexpected end of file


REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
make a copy of /etc/mailcap before uninstall/upgrade,
after uninstall/upgrade copy back
###@###.### 2005-04-18 19:30:12 GMT

Comments
EVALUATION This bug was accidentally backported with some other changes from Tiger back in the December 2003/January 2004 timeframe. Although it's an easy fix, CTE can decide if they think it's worth it to fix at this point. ###@###.### 2005-04-19 15:17:27 GMT
2005-04-19