Author: jdsn Date: Thu Jun 30 20:39:50 2011 New Revision: 64681
URL: http://svn.opensuse.org/viewcvs/yast?rev=64681&view=rev Log: cleanup xauth export after interactive registration (bnc#702638)
Modified: branches/SuSE-Code-11-SP1-Branch/registration/package/yast2-registration.changes branches/SuSE-Code-11-SP1-Branch/registration/src/clients/inst_suse_register.ycp
Modified: branches/SuSE-Code-11-SP1-Branch/registration/package/yast2-registration.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/regist... ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/registration/package/yast2-registration.changes (original) +++ branches/SuSE-Code-11-SP1-Branch/registration/package/yast2-registration.changes Thu Jun 30 20:39:50 2011 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Thu Jun 30 20:35:56 CEST 2011 - jdsn@suse.de + +- cleanup xauth export after interactive registration (bnc#702638) + +------------------------------------------------------------------- Fri Apr 8 16:22:22 CEST 2011 - jdsn@suse.de
- fix proxy settings in automatic online update script, bnc#(678888)
Modified: branches/SuSE-Code-11-SP1-Branch/registration/src/clients/inst_suse_register.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/regist... ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/registration/src/clients/inst_suse_register.ycp (original) +++ branches/SuSE-Code-11-SP1-Branch/registration/src/clients/inst_suse_register.ycp Thu Jun 30 20:39:50 2011 @@ -450,6 +450,7 @@
string su_exec(string user, string group, string command) { // (#167255) + // introduce cleanup function to also cleanup the xauth entry (bnc#702638) string exec = sformat(" #!/bin/bash -x
@@ -462,6 +463,8 @@
XA=/root/.xauth mkdir -p $XA +DELETEXAEXPORT=no +[ ! -e $XA/export ] && DELETEXAEXPORT=yes grep ^$user$ $XA/export >/dev/null 2>&1 || echo $user >> $XA/export
mkdir -p $fakehome @@ -469,7 +472,22 @@ tmp=$(mktemp $fakehome/.Xauthority.XXXXXX) || exit 1 chmod 600 $tmp chown $user:$group $tmp $fakehome -trap "rm -rf $fakehome" EXIT INT HUP TERM + + +function cleanup +{ + if [ "x$DELETEXAEXPORT" = "xyes" ] + then + rm -f $XA/export + else + sed -i --follow-symlinks "/^$user$/d" $XA/export + fi + + rm -rf $fakehome +} + + +trap "cleanup" EXIT INT HUP TERM
", user, group, command );
yast-commit@lists.opensuse.org