[maemo-commits] [maemo-commits] r17695 - in projects/haf/trunk/osso-af-startup: . debian

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Mon Mar 16 18:03:11 EET 2009
Author: schulhof
Date: 2009-03-16 18:03:08 +0200 (Mon, 16 Mar 2009)
New Revision: 17695

Modified:
   projects/haf/trunk/osso-af-startup/configure.ac
   projects/haf/trunk/osso-af-startup/debian/changelog
   projects/haf/trunk/osso-af-startup/debian/postinst
   projects/haf/trunk/osso-af-startup/debian/preinst
Log:
Blah

Modified: projects/haf/trunk/osso-af-startup/configure.ac
===================================================================
--- projects/haf/trunk/osso-af-startup/configure.ac	2009-03-16 16:02:08 UTC (rev 17694)
+++ projects/haf/trunk/osso-af-startup/configure.ac	2009-03-16 16:03:08 UTC (rev 17695)
@@ -1,5 +1,5 @@
 AC_INIT(Makefile.am)
-AM_INIT_AUTOMAKE(osso-af-startup, 1.77)
+AM_INIT_AUTOMAKE(osso-af-startup, 1.78)
 
 AC_OUTPUT(Makefile \
 	services/Makefile \

Modified: projects/haf/trunk/osso-af-startup/debian/changelog
===================================================================
--- projects/haf/trunk/osso-af-startup/debian/changelog	2009-03-16 16:02:08 UTC (rev 17694)
+++ projects/haf/trunk/osso-af-startup/debian/changelog	2009-03-16 16:03:08 UTC (rev 17695)
@@ -1,3 +1,10 @@
+osso-af-startup (1.78-1) unstable; urgency=low
+
+  * Don't touch $HOME from (pre|post)(inst|rm) scripts. Use /etc/skel instead.
+  * Fixes: NB#105202 (osso-af-startup must not access $HOME )
+
+ -- Gabriel Schulhof <gabriel.schulhof at nokia.com>  Thu, 12 Mar 2009 10:33:38 +0200
+
 osso-af-startup (1.77-1) unstable; urgency=low
 
   * Kimmo: Change INTERNAL_MMC_MOUNTPOINT to /home/user/MyDocs.

Modified: projects/haf/trunk/osso-af-startup/debian/postinst
===================================================================
--- projects/haf/trunk/osso-af-startup/debian/postinst	2009-03-16 16:02:08 UTC (rev 17694)
+++ projects/haf/trunk/osso-af-startup/debian/postinst	2009-03-16 16:03:08 UTC (rev 17695)
@@ -1,37 +1,17 @@
 #!/bin/sh
 
-TGT=''
+HAVE_SCRATCHBOX=0
 if [ -e /targets/links/scratchbox.config ] ; then
-        . /targets/links/scratchbox.config
-        TGT=$SBOX_TARGET_DIR
+  HAVE_SCRATCHBOX=1
 fi
 
-USER=user
-GROUP=users
-HOME="$TGT/home/$USER"
+HOME=/etc/skel
+
 TMP_DIR=/var/tmp
-# LOCALE_TMP_FILE=$TMP_DIR/osso-af-init.locale.tmp
-# LOCALE_FILE=/etc/osso-af-init/locale
-# LOCALE_ORIG_FILE=/usr/share/osso-af-init/locale.orig
-# LOCALE_ORIG_FILE_OLD=/etc/osso-af-init/locale.orig
 
 rm -f /etc/osso-af-init/gconf-dir
 ln -s /var/lib/gconf /etc/osso-af-init/gconf-dir
 
-# if test -f $LOCALE_TMP_FILE; then
-#   echo "Moving preinst locale file $LOCALE_TMP_FILE to $LOCALE_FILE"
-#   mv -f $LOCALE_TMP_FILE $LOCALE_FILE
-#   # startup wizard needs to be able to modify the locale
-#   echo "Changing ownership of $LOCALE_FILE"
-#   chown $USER:$GROUP $LOCALE_FILE
-# else
-#   echo "preinst locale file $LOCALE_TMP_FILE not found"
-# fi
-
-# # # save the original for Restore Original Settings
-# # cp -f /etc/osso-af-init/locale /etc/osso-af-init/locale.orig
-# # chown $USER:$GROUP /etc/osso-af-init/locale.orig
-
 update-rc.d af-services start 22 2 3 4 5 . stop 22 0 1 6 . > /dev/null
 update-rc.d af-startup start 50 2 3 4 . stop 21 0 1 6 . > /dev/null
 update-rc.d af-base-apps start 60 2 3 4 . stop 20 0 1 5 6 . > /dev/null
@@ -45,15 +25,15 @@
 fi
 
 # create MyDocs and some special directories ("if" is for Scratchbox)
-if [ -w $HOME ]; then
-  MYDOCS=$HOME/MyDocs
-  mkdir -p $MYDOCS/.sounds $MYDOCS/.videos \
-    $MYDOCS/.documents $MYDOCS/.games $MYDOCS/.images 2> /dev/null
-  if [ $? = 0 ]; then
-    chown -R $USER:$GROUP $MYDOCS
+
+if test $HAVE_SCRATCHBOX -eq 1; then
+  if [ -w $HOME ]; then
+    MYDOCS=$HOME/MyDocs
+    mkdir -p $MYDOCS/.sounds $MYDOCS/.videos \
+      $MYDOCS/.documents $MYDOCS/.games $MYDOCS/.images 2> /dev/null
+  else
+    echo "Warning: '$HOME' is not writable, couldn't create e.g. MyDocs directory"
   fi
-else
-  echo "Warning: '$HOME' is not writable, couldn't create e.g. MyDocs directory"
 fi
 
 # evil hack to ensure execute permissions
@@ -69,4 +49,3 @@
 if [ -x /usr/sbin/update-sudoers ]; then
   /usr/sbin/update-sudoers
 fi
-

Modified: projects/haf/trunk/osso-af-startup/debian/preinst
===================================================================
--- projects/haf/trunk/osso-af-startup/debian/preinst	2009-03-16 16:02:08 UTC (rev 17694)
+++ projects/haf/trunk/osso-af-startup/debian/preinst	2009-03-16 16:03:08 UTC (rev 17695)
@@ -1,61 +1,29 @@
 #!/bin/sh
 
-# cat_default_locale_file() # No args
-# {
-# cat <<'EOF'
-# #!/bin/sh
-# 
-# if [ -f /usr/share/osso-af-init/locale ]; then
-#   source /usr/share/osso-af-init/locale
-# else
-#   unset LC_ALL
-#   unset LANGUAGE
-#   export LANG=en_GB
-#   export LC_MESSAGES=en_GB
+# TGT=''
+# if [ -e /targets/links/scratchbox.config ] ; then
+#   . /targets/links/scratchbox.config
+#   TGT=$SBOX_TARGET_DIR
 # fi
-# EOF
-# }
 
-TGT=''
-if [ -e /targets/links/scratchbox.config ] ; then
-        . /targets/links/scratchbox.config
-        TGT=$SBOX_TARGET_DIR
-fi
-
-USER=user
-GROUP=users
-HOME="$TGT/home/$USER"
 TMP_DIR=/var/tmp
-# LOCALE_TMP_FILE=$TMP_DIR/osso-af-init.locale.tmp
-# LOCALE_DIR=/usr/share/osso-af-init
-# LOCALE_FILE=/etc/osso-af-init/locale
-# LOCALE_ORIG_FILE=$LOCALE_DIR/locale.orig
 
-if test "x$1" = "xinstall"; then
-  # walk the user through initial configuration wizards
+# USER=user
+# GROUP=users
+# HOME="$TGT/home/$USER"
+# 
+# if test "x$1" = "xinstall"; then
+#   # walk the user through initial configuration wizards
+# 
+#   if ! test -d $HOME; then
+#     mkdir -p $HOME
+#     chmod 750 $HOME
+#     chown $USER:$GROUP $HOME
+#   fi
+# 
+#   touch $HOME/first-boot-flag
+#   chown $USER:$GROUP $HOME/first-boot-flag
+# fi
 
-  if ! test -d $HOME; then
-    mkdir -p $HOME
-    chmod 750 $HOME
-    chown $USER:$GROUP $HOME
-  fi
-
-  touch $HOME/first-boot-flag
-  chown $USER:$GROUP $HOME/first-boot-flag
-fi
-
 mkdir -p $TMP_DIR
 chmod 1777 $TMP_DIR
-
-# if test -f $LOCALE_FILE; then
-#   echo "osso-af-startup: preinst: Backing up existing locale file to $LOCALE_TMP_FILE"
-#   cp -af $LOCALE_FILE $LOCALE_TMP_FILE
-# else
-#   echo "osso-af-startup: preinst: Creating default locale file in $LOCALE_TMP_FILE"
-#   cat_default_locale_file > $LOCALE_TMP_FILE
-# fi
-# 
-# echo "osso-af-startup: preinst: Creating directory $LOCALE_DIR"
-# mkdir -p $LOCALE_DIR
-# echo "osso-af-startup: preinst: Generating default locale-orig file $LOCALE_ORIG_FILE"
-# cat_default_locale_file > $LOCALE_ORIG_FILE


More information about the maemo-commits mailing list