2015-02-12 16:25:47 +00:00
|
|
|
#!/bin/sh
|
2017-10-25 14:10:28 +00:00
|
|
|
set -e
|
2015-02-13 09:13:16 +00:00
|
|
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1142153
|
2015-02-12 16:25:47 +00:00
|
|
|
M=META-INF/MANIFEST.MF
|
2017-10-25 14:10:28 +00:00
|
|
|
#P=/usr/lib/jvm/java/jre/lib/security/policy
|
|
|
|
P=$1/lib/security/policy
|
|
|
|
ERRORS=0
|
|
|
|
for type in unlimited limited ; do
|
2015-02-12 16:25:47 +00:00
|
|
|
for f in local_policy.jar US_export_policy.jar ; do
|
2017-10-25 14:10:28 +00:00
|
|
|
ORIG=$P/$type/$f
|
2015-02-12 16:25:47 +00:00
|
|
|
echo "processing $f ($ORIG)"
|
|
|
|
if [ ! -f $ORIG ]; then
|
2015-08-13 14:49:11 +00:00
|
|
|
echo "File not found! $ORIG"
|
2017-10-25 14:10:28 +00:00
|
|
|
let ERRORS=$ERRORS+1
|
2015-02-12 16:25:47 +00:00
|
|
|
continue
|
|
|
|
fi
|
|
|
|
d=`mktemp -d`
|
|
|
|
NW=$d/$f
|
|
|
|
pushd $d
|
|
|
|
jar xf $ORIG
|
|
|
|
cat $M
|
|
|
|
# sed -i "s/Created-By.*/Created-By: 1.7.0/g" $M
|
|
|
|
sed -i "s/Created-By.*/Created-By: $2/g" $M
|
|
|
|
cat $M
|
|
|
|
find . -exec touch -t 201401010000 {} +
|
|
|
|
zip -rX $f *
|
|
|
|
popd
|
|
|
|
echo "replacing $ORIG"
|
2015-08-13 14:49:11 +00:00
|
|
|
touch -t 201401010000 $ORIG
|
2015-02-12 16:25:47 +00:00
|
|
|
md5sum $ORIG
|
|
|
|
sha256sum $ORIG
|
|
|
|
echo "by $NW"
|
|
|
|
md5sum $NW
|
|
|
|
sha256sum $NW
|
2015-08-13 14:49:11 +00:00
|
|
|
touch -t 201401010000 $NW
|
2015-02-12 16:25:47 +00:00
|
|
|
cp $NW $ORIG
|
|
|
|
md5sum $ORIG
|
|
|
|
sha256sum $ORIG
|
2015-08-13 14:49:11 +00:00
|
|
|
touch -t 201401010000 $ORIG
|
2015-02-12 16:25:47 +00:00
|
|
|
rm -rfv $d
|
|
|
|
done
|
2017-10-25 14:10:28 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
exit $ERRORS
|