File replace-su-with-setpriv.patch of Package orarun.11041

Index: b/oracle
===================================================================
--- a/oracle
+++ b/oracle
@@ -212,10 +212,15 @@ uid_wrapper()
 {
   local username="$1"
   local command="$2"
-
-  su - $username -c "$command"
+  local tmp=`mktemp`
+  local name password uid gid comment home shell
+  getent passwd "$username" >$tmp
+  IFS=: read name password uid gid comment home shell <$tmp
+  rm -f $tmp
+  setpriv --reuid $uid --regid $gid --clear-groups /bin/sh -c "export HOME=$home SHELL=$shell USER=$name LOGNAME=$name; $command"
 }
 
+
 # Here we finally get to do the real work.
 case "$1" in
   start)
openSUSE Build Service is sponsored by