| OLD | NEW |
| 1 #!/bin/sh | 1 #!/bin/sh |
| 2 #--------------------------------------------- | 2 #--------------------------------------------- |
| 3 # xdg-su | 3 # xdg-su |
| 4 # | 4 # |
| 5 # Utility script to run a command as an alternate user, generally | 5 # Utility script to run a command as an alternate user, generally |
| 6 # the root user, with a graphical prompt for the root | 6 # the root user, with a graphical prompt for the root |
| 7 # password if needed | 7 # password if needed |
| 8 # | 8 # |
| 9 # Refer to the usage() function below for usage. | 9 # Refer to the usage() function below for usage. |
| 10 # | 10 # |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 else | 353 else |
| 354 su_generic | 354 su_generic |
| 355 fi | 355 fi |
| 356 } | 356 } |
| 357 | 357 |
| 358 su_generic() | 358 su_generic() |
| 359 { | 359 { |
| 360 if [ -z "$user" ] ; then | 360 if [ -z "$user" ] ; then |
| 361 xterm -geom 60x5 -T "xdg-su: $cmd" -e su -c "$cmd" | 361 xterm -geom 60x5 -T "xdg-su: $cmd" -e su -c "$cmd" |
| 362 else | 362 else |
| 363 xterm -geom 60x5 -T "xdg-su: $cmd" -e su -u "$user" -c "$cmd" | 363 xterm -geom 60x5 -T "xdg-su: $cmd" -e su -c "$cmd" "$user" |
| 364 fi | 364 fi |
| 365 | 365 |
| 366 if [ $? -eq 0 ]; then | 366 if [ $? -eq 0 ]; then |
| 367 exit_success | 367 exit_success |
| 368 else | 368 else |
| 369 exit_failure_operation_failed | 369 exit_failure_operation_failed |
| 370 fi | 370 fi |
| 371 } | 371 } |
| 372 | 372 |
| 373 [ x"$1" != x"" ] || exit_failure_syntax | 373 [ x"$1" != x"" ] || exit_failure_syntax |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 | 429 |
| 430 generic) | 430 generic) |
| 431 su_generic | 431 su_generic |
| 432 ;; | 432 ;; |
| 433 | 433 |
| 434 *) | 434 *) |
| 435 [ x"$user" = x"" ] && user=root | 435 [ x"$user" = x"" ] && user=root |
| 436 exit_failure_operation_impossible "no graphical method available for invokin
g '$cmd' as '$user'" | 436 exit_failure_operation_impossible "no graphical method available for invokin
g '$cmd' as '$user'" |
| 437 ;; | 437 ;; |
| 438 esac | 438 esac |
| OLD | NEW |