#6316 HIGH Never A: become_root is broken.

Zarro Boogs per Child bugtracker at laptop.org
Tue Feb 5 11:13:58 EST 2008


#6316: become_root is broken.
---------------------+------------------------------------------------------
  Reporter:  cscott  |       Owner:  mstone        
      Type:  defect  |      Status:  new           
  Priority:  high    |   Milestone:  Never Assigned
 Component:  distro  |     Version:                
Resolution:          |    Keywords:                
  Verified:  0       |    Blocking:  5537          
 Blockedby:          |  
---------------------+------------------------------------------------------

Comment(by afranke):

 Sounds good to me (but then I'm not an expert).[[BR]]

 It hasn't been mentioned here yet, so I'd like to point out
 that a short-term solution / workaround / hack for d) might be
 a script that takes _only_ the {{{SUGAR_PATH}}} environment variable
 with it when it switches to root, using the {{{env}}} trampoline, and then
 calls
 {{{sugar-control-panel-as-root}}}.[[BR]]

 {{{sugar-control-panel-as-olpc}}} might look like this:
 {{{
 #!/bin/bash -e

 if [ -z "$SUGAR_PATH" ] ; then
     echo "Environment variable SUGAR_PATH is not set!" 1>&2
     exit 1
 else
     exec su -l -c 'env SUGAR_PATH="'"$SUGAR_PATH"'" sugar-control-panel-
 as-root'
 fi
 }}}

 Note the quoting & unquoting around {{{$SUGAR_PATH}}}.  I'm not
 100% sure that it works with all possible special characters
 in existence, but for practical purposes it might be sufficient.

-- 
Ticket URL: <http://dev.laptop.org/ticket/6316#comment:8>
One Laptop Per Child <http://dev.laptop.org>
OLPC bug tracking system



More information about the Bugs mailing list