[yast-commit] r64680 - in /trunk/registration: package/yast2-registration.changes src/clients/inst_suse_register.ycp

Author: jdsn Date: Thu Jun 30 20:39:42 2011 New Revision: 64680 URL: http://svn.opensuse.org/viewcvs/yast?rev=64680&view=rev Log: cleanup xauth export after interactive registration (bnc#702638) Modified: trunk/registration/package/yast2-registration.changes trunk/registration/src/clients/inst_suse_register.ycp Modified: trunk/registration/package/yast2-registration.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/registration/package/yast2-regist... ============================================================================== --- trunk/registration/package/yast2-registration.changes (original) +++ trunk/registration/package/yast2-registration.changes Thu Jun 30 20:39:42 2011 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Thu Jun 30 19:45:18 CEST 2011 - jdsn@suse.de + +- cleanup xauth export after interactive registration (bnc#702638) + +------------------------------------------------------------------- Tue Jun 28 19:11:55 CEST 2011 - jdsn@suse.de - bump version Modified: trunk/registration/src/clients/inst_suse_register.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/registration/src/clients/inst_sus... ============================================================================== --- trunk/registration/src/clients/inst_suse_register.ycp (original) +++ trunk/registration/src/clients/inst_suse_register.ycp Thu Jun 30 20:39:42 2011 @@ -502,6 +502,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 @@ -514,6 +515,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 @@ -521,7 +524,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 ); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
jdsn@svn2.opensuse.org