sux-1.0-r1.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. --- a/sux
  2. +++ b/sux
  3. @@ -29,7 +29,6 @@
  4. # are on NFS. In such a case, change the default to copy-cookies.
  5. sux_root_cookie_transfer="c"
  6. -
  7. usage()
  8. {
  9. echo "usage: `basename $0` [-m|-p|--preserve-environment]" >&2
  10. @@ -230,10 +229,10 @@
  11. # Remove the old cookies. They may cause trouble if we transfer only one
  12. # cookie, e.g. an MIT cookie, and there's still a stale XDM cookie hanging
  13. # around.
  14. - export TERM="xauth -q remove $DISPLAY 2>/dev/null;"
  15. + export TERM="/usr/X11R6/bin/xauth -q remove $DISPLAY 2>/dev/null;"
  16. if [ -n "$sux_unix_display" ]
  17. then
  18. - TERM="$TERM xauth -q remove $sux_unix_display;"
  19. + TERM="$TERM /usr/X11R6/bin/xauth -q remove $sux_unix_display;"
  20. fi
  21. # Note that there may be more than one cookie to transfer, hence
  22. @@ -250,7 +249,7 @@
  23. sux_i=`expr $sux_i + 1`
  24. if [ $sux_i -eq 9 ]
  25. then
  26. - TERM="$TERM | xauth nmerge - ;"
  27. + TERM="$TERM | /usr/X11R6/bin/xauth nmerge - ;"
  28. sux_i=0
  29. fi
  30. done
  31. @@ -316,12 +316,12 @@
  32. # wouldn't have the proper access rights anyway...
  33. unset XAUTHORITY
  34. +sux_home=`egrep "^$sux_username:" /etc/passwd | cut -d: -f6`
  35. ##
  36. # --preserve-environment special case
  37. if [ -n "$sux_preserve" -a -n "$sux_xauth_cmd" ]
  38. then
  39. - sux_home=`egrep "^$sux_username:" /etc/passwd | cut -d: -f6`
  40. if [ -z "$sux_home" ]
  41. then
  42. echo "WARNING: --preserve-environment has been set, but no good value was found for XAUTHORITY, expect trouble" >&2
  43. @@ -334,4 +334,4 @@
  44. ##
  45. # Execute su
  46. exec su $sux_su_opts -c "$sux_xauth_cmd \
  47. - exec env $sux_xauthority $sux_term DISPLAY='$DISPLAY' $sux_cmd;"
  48. + exec env $sux_xauthority $sux_term HOME='$sux_home' DISPLAY='$DISPLAY' $sux_cmd;"