Mailinglist Archive: opensuse-bugs (6897 mails)

< Previous Next >
[Bug 188068] pin -v 100 foo tries to "su 100" ("su $2")
  • From: bugzilla_noreply@xxxxxxxxxx
  • Date: Tue, 27 Mar 2007 02:53:34 -0600 (MDT)
  • Message-id: <20070327085334.C2722DDF@xxxxxxxxxxxxxxxxxxxxxx>
https://bugzilla.novell.com/show_bug.cgi?id=188068


volker3204@xxxxxxxxxxxxxxx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|VERIFIED                    |REOPENED
          Component|Basesystem                  |Basesystem
            Product|SUSE Linux 10.1             |openSUSE 10.2
         Resolution|FIXED                       |




------- Comment #16 from volker3204@xxxxxxxxxxxxxxx  2007-03-27 02:53 MST -------
Sorry, but the "fix" proposed by CB breaks pin fatally. su --help shows that -c
is a required argument when giving a command with su, and it means it. See bug
#225602 for what bad things happen without -c.

This change

--- /usr/bin/pin.orig   2006-11-26 12:27:30.000000000 +1300
+++ /usr/bin/pin        2007-03-27 20:39:07.000000000 +1200
@@ -172,7 +172,7 @@
   if test "$UID" != "0" -a "$USER" != root -a -z "$ROOT" ; then
     echo -e "\n *** pin found no ARCHIVES_"$USED_VERSION".gz file in
$ARC_DIR\n
     pin will copy the files,  please enter rootpassword :\n\n"
-    su - root -- "$0" "$@"
+    showargs su - root -- -c "$0" "$@"
     exit
   fi
   # test for old ARC files

shows:

> pin -f 'asd cdf' 'mean & $a'

 *** pin found no ARCHIVES_10.2.gz file in /var/lib/pin/

    pin will copy the files,  please enter rootpassword :


argv (#=9): su - root -- -c /usr/bin/pin -f asd cdf mean & $a
argv[0]: '/home/user/bin/showargs'
argv[1]: 'su'
argv[2]: '-'
argv[3]: 'root'
argv[4]: '--'
argv[5]: '-c'
argv[6]: '/usr/bin/pin'
argv[7]: '-f'
argv[8]: 'asd cdf'
argv[9]: 'mean & $a'

and therefore appears to be working. All special characters and arguments are
correctly preserved. showargs is a script showing its arguments (google for
scriptutils). Removing the showargs (which is obviously only for debugging ;) )
makes a functional pin script. And pin -v 100 works too!

> echo $USER, $SHELL
user, /bin/tcsh

This is in 10.2 final. Can you please fix for 10.3? Thanks!


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

< Previous Next >
This Thread
  • No further messages