- More fix for mimeedit.sh to remove potentially unsafe tmpfile creation

i9cf
Mamoru Tasaka 16 years ago
parent 34beb74c75
commit 5303c68225

@ -1,18 +0,0 @@
Index: src/intviewer/text-render.cc
===================================================================
--- src/intviewer/text-render.cc (revision 1874)
+++ src/intviewer/text-render.cc (working copy)
@@ -1954,7 +1954,12 @@
show_marker = (marker_start!=marker_end);
text_render_utf8_clear_buf(w);
- if (w->priv->hex_offset_display)
+ // Temporary workaround
+ // Currently when "_Decimal Offset in Hexdump" is set,
+ // hex_offset_display is set, however at this state offset must
+ // be displayed in decimal!!
+
+ if (!(w->priv->hex_offset_display))
text_render_utf8_printf(w, "%08lx ", (unsigned long)start_of_line);
else
text_render_utf8_printf(w, "%09lu ", (unsigned long)start_of_line);

@ -7,6 +7,8 @@
# Source10 is created by:
# svn co http://svn.gnome.org/svn/gnome-commander/branches/gcmd-1-3/tools/mimeedit/
# cp -p mimeedit/mimeedit.sh mimeedit-rev%%{mimeedit_rev}.sh
#
# ref: http://lists.gnu.org/archive/html/gcmd-devel/2007-11/msg00076.html
%define EXIV2_REQ 0.14
%define TAGLIB_REQ 1.4
@ -14,7 +16,7 @@
%define use_autotool 0
%define if_pre 0
%define main_release 3
%define main_release 4
#%%define extratag svn1901_trunk
%define mimeedit_rev 1958
@ -205,6 +207,10 @@ scrollkeeper-update -q || :
%{_datadir}/pixmaps/%{name}/
%changelog
* Wed Aug 13 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.2.7-4
- More fix for mimeedit.sh to remove potentially unsafe tmpfile
creation
* Tue Aug 12 2008 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1.2.7-3
- Install mimeedit script pulled from svn to support mime edit
menu (bug 458667)

@ -1,8 +1,75 @@
Index: mimeedit.sh
===================================================================
--- mimeedit.sh (revision 1958)
--- mimeedit.sh (revision 1962)
+++ mimeedit.sh (working copy)
@@ -342,6 +342,7 @@
@@ -63,11 +63,13 @@
# Build a list with registered apps for this mimetype.
#
function deflist (){
- if [ -e "$UTMP.avail" ]; then cleanup;fi
+ TMP_AVAIL="`mktemp /tmp/gnome-commander.XXXXXX`"
+ TMP_CHOSEN="`mktemp /tmp/gnome-commander.XXXXXX`"
+ # if [ -e "$UTMP.avail" ]; then cleanup;fi
# Create the list in "$UTMP.avail" to be used by the zenity list-box
if [ "$NONEW" == 1 ]
then
- echo "FALSE Add_New_App New" > "$UTMP.avail"
+ echo "FALSE Add_New_App New" > $TMP_AVAIL
fi
# Get all sub-mimetypes, one per row.
SUB="$(grep -hs "^$MTPE" $SUBC $G_CACHE $U_CACHE | awk -F= '{print $1}' | sed 's/ /\n/g')"
@@ -77,14 +79,14 @@
then
for i in $(echo "$MTPEs" | sort -u); do
echo "FALSE $i $(grep -hs "^Name=" $GDATA_DIR/$i $DATA_DIR/$i | \
- sed 's/Name=//;s/ /_/g')" >> "$UTMP.avail"
+ sed 's/Name=//;s/ /_/g')" >> $TMP_AVAIL
done
fi
# Change FALSE to TRUE for the default app.
- if grep -q "desktop" "$UTMP.avail"
+ if grep -q "desktop" $TMP_AVAIL
then
DEF_APP=$(gnomevfs-info -s "$ARGU" | grep "Default app" | sed 's/.*: //')
- sed -i "s|FALSE $DEF_APP|TRUE $DEF_APP|" "$UTMP.avail"
+ sed -i "s|FALSE $DEF_APP|TRUE $DEF_APP|" $TMP_AVAIL
fi
# Show the list
zenity --height="350" --width="550" --list --radiolist --text \
@@ -99,17 +101,17 @@
Please select" \
--column "Pick" --column ".desktop file" --column "Application" \
- $(cat "$UTMP.avail") > "$UTMP.chosen"
+ $(cat $TMP_AVAIL ) > $TMP_CHOSEN
retval=$?
- choice=$(cat "$UTMP.chosen")
+ choice=$(cat $TMP_CHOSEN )
if grep -q "$MTPE=$choice" $U_DEF
then
retval=2
fi
case $retval in
0)
- DEF_CH=$(grep -s "$choice" "$UTMP.avail" | awk '{print $2}')
- DEF_NME=$(grep -s "$choice" "$UTMP.avail" | awk '{print $3}')
+ DEF_CH=$(grep -s "$choice" $TMP_AVAIL | awk '{print $2}')
+ DEF_NME=$(grep -s "$choice" $TMP_AVAIL | awk '{print $3}')
if [ "$DEF_CH" = Add_New_App ]
then
newmime
@@ -305,8 +307,8 @@
# Remove tempfiles.
#
function cleanup (){
- rm -f "$UTMP.avail"
- rm -f "$UTMP.chosen"
+ rm -f $TMP_AVAIL
+ rm -f $TMP_CHOSEN
}
#
@@ -342,6 +344,7 @@
# The .desktop file editor
#
function dtfedit (){
@ -10,7 +77,7 @@ Index: mimeedit.sh
USER_DTF="$DT_FILE-$EXT"
if [ -n "$DT_FILE" ]
then
@@ -350,15 +351,22 @@
@@ -350,15 +353,22 @@
then
TO_EDIT="$DATA_DIR/$USER_DTF"
else

Loading…
Cancel
Save