[PC-BSD Commits] r3718 - in pbibuild/modules/firefox3: . overlay-dir

svn at pcbsd.org svn at pcbsd.org
Tue Mar 31 14:58:37 PST 2009


Author: kris
Date: 2009-03-31 15:58:36 -0700 (Tue, 31 Mar 2009)
New Revision: 3718

Added:
   pbibuild/modules/firefox3/overlay-dir/makedefault.sh
Modified:
   pbibuild/modules/firefox3/build.sh
   pbibuild/modules/firefox3/overlay-dir/PBI.SetupScript.sh
   pbibuild/modules/firefox3/pbi.conf
Log:

Updated how we set FF3 to be the default browser. Now use a helper script, run under user permissions, which should prevent any security issues with root being the user running the setup



Modified: pbibuild/modules/firefox3/build.sh
===================================================================
--- pbibuild/modules/firefox3/build.sh	2009-03-31 20:59:40 UTC (rev 3717)
+++ pbibuild/modules/firefox3/build.sh	2009-03-31 22:58:36 UTC (rev 3718)
@@ -25,3 +25,5 @@
 
 # Save a print setting for ff3
 echo "pref(\"print.whileInPrintPreview\", true);" >> ${PBIDIR}/lib/firefox3/greprefs/all.js
+
+chmod 755 ${PBIDIR}/makedefault.sh

Modified: pbibuild/modules/firefox3/overlay-dir/PBI.SetupScript.sh
===================================================================
--- pbibuild/modules/firefox3/overlay-dir/PBI.SetupScript.sh	2009-03-31 20:59:40 UTC (rev 3717)
+++ pbibuild/modules/firefox3/overlay-dir/PBI.SetupScript.sh	2009-03-31 22:58:36 UTC (rev 3718)
@@ -14,8 +14,6 @@
 # echo 'SETSTEPS: <num>' # Set the current progress of the progress bar
 # echo 'MSG: <text>' # Display this text above progress bar
 #########################################
-ln -fs /Programs/${PROGDIR}/.sbin/firefox3 /usr/local/bin/firefox
-ln -fs /Programs/${PROGDIR}/.sbin/firefox3 /usr/local/bin/firefox3
 
 # Check which font config we want to link to
 if [ -d "/PCBSD/local/etc/fonts" ]
@@ -28,50 +26,13 @@
 if [ "$INSTALLMODE" = "GUI" ]
 then
 
-# Get the users homedir
 USER="$USERNAME"
-HOMEDIR="`cat /etc/passwd | grep ^${USERNAME}: | cut -d ":" -f 6`"
 
-if [ -e "${HOMEDIR}/.kde4" ]
-then
-   KDEDIR=".kde4"
-else
-   KDEDIR=".kde"
-fi
-
   # Ask if we should make this the default browser application for our user
   kdialog --yesno "Do you want to make Firefox the default browser?" --title "Default browser?"
   if [ "$?" = "0" ]
   then
-      # Strip out the old BrowserApplication line to make way for the new
-      TMPKFILE="/tmp/.kdeglobals.$$"
-      TMPKFILE2="/tmp/.kdeglobals2.$$"
-      rm ${TMPKFILE} >/dev/null
-      cat ${HOMEDIR}/${KDEDIR}/share/config/kdeglobals | grep -v '^BrowserApplication' > ${TMPKFILE}
-
-      rm ${TMPKFILE2} >/dev/null
-      touch ${TMPKFILE2}
-      while read line
-      do
-
-         if [ "$line" = "[General]" ]
-         then
-           echo "$line" >> ${TMPKFILE2}
-           if [ "${KDEDIR}" = ".kde4" ]
-           then
-             echo "BrowserApplication[$e]=!/usr/local/bin/firefox3" >> ${TMPKFILE2}
-           else
-             echo "BrowserApplication=!/usr/local/bin/firefox3" >> ${TMPKFILE2}
-           fi
-    	 else
-       	   echo "$line" >> ${TMPKFILE2}
-  	 fi
-      done < ${TMPKFILE}
-
-      # all finished, now move it back over kdeglobals
-      rm ${TMPKFILE}
-      chown ${USERNAME}:${USERNAME} ${TMPKFILE2}
-      mv ${TMPKFILE2} ${HOMEDIR}/${KDEDIR}/share/config/kdeglobals
+     su $USER -c /Programs/${PROGDIR}/makedefault.sh
   fi
 
 else
@@ -80,49 +41,11 @@
   USERS="`cut -d ':' -f 1 /etc/passwd | grep -v '^#'`"
   for i in ${USERS} 
   do
-
-    HOMEDIR="`cat /etc/passwd | grep ^${i}: | cut -d ":" -f 6`"
-
-    if [ -e "${i}/.kde4" ]
-    then
-      KDEDIR=".kde4"
-    else
-      KDEDIR=".kde"
-    fi
-
-    if [ -e "${i}/${KDEDIR}/share/config/kdeglobals" ]
-    then
-
-      TMPKFILE="/tmp/.kdeglobals.$$"
-      TMPKFILE2="/tmp/.kdeglobals2.$$"
-      rm ${TMPKFILE} >/dev/null
-      # Strip out the old BrowserApplication line to make way for the new
-      cat ${HOMEDIR}/${KDEDIR}/share/config/kdeglobals | grep -v '^BrowserApplication' > ${TMPKFILE}
-
-      rm ${TMPKFILE2} >/dev/null
-      touch ${TMPKFILE2}
-      while read line
-      do
-
-         if [ "$line" = "[General]" ]
-         then
-           echo "$line" >> ${TMPKFILE2}
-           if [ "${KDEDIR}" = ".kde4" ]
-           then
-             echo "BrowserApplication[$e]=!/usr/local/bin/firefox3" >> ${TMPKFILE2}
-           else
-             echo "BrowserApplication=!/usr/local/bin/firefox3" >> ${TMPKFILE2}
-           fi
-         else
-           echo "$line" >> ${TMPKFILE2}
-         fi
-      done < ${TMPKFILE}
-
-      # all finished, now move it back over kdeglobals
-      rm ${TMPKFILE}
-      chown ${i}:${i} ${TMPKFILE2}
-      mv ${TMPKFILE2} ${i}/${KDEDIR}/share/config/kdeglobals
-    fi
+     HOMEDIR="`cat /etc/passwd | grep ^${i}: | cut -d ":" -f 6`"
+     if [ -d "${HOMEDIR}/.kde4" -o -d "${HOMEDIR}/.kde" ]
+     then
+       su $i -c /Programs/${PROGDIR}/makedefault.sh
+     fi
   done
 
 fi


Property changes on: pbibuild/modules/firefox3/overlay-dir/makedefault.sh
___________________________________________________________________
Added: svn:executable
   + *

Modified: pbibuild/modules/firefox3/pbi.conf
===================================================================
--- pbibuild/modules/firefox3/pbi.conf	2009-03-31 20:59:40 UTC (rev 3717)
+++ pbibuild/modules/firefox3/pbi.conf	2009-03-31 22:58:36 UTC (rev 3718)
@@ -35,6 +35,6 @@
 
 # Build Key - Change this to anything else to trigger a rebuild 
 #           - The rebuild will take place even if port is still the same ver
-BUILDKEY="02"
+BUILDKEY="01"
 
 export PBIPORT MAKEOPTS PROGNAME PROGWEB PROGAUTHOR OTHERPORT PROGICON PROGLIBS PBIUPDATE BUILDKEY



More information about the Commits mailing list