git://git.onelab.eu
/
util-vserver.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
There's no need to call getpwuid/getpwnam_r 5 times. Do it once before chroot, once...
[util-vserver.git]
/
scripts
/
chcontext
diff --git
a/scripts/chcontext
b/scripts/chcontext
index
bfe2d51
..
905d7e3
100755
(executable)
--- a/
scripts/chcontext
+++ b/
scripts/chcontext
@@
-1,5
+1,5
@@
#! /bin/bash
#! /bin/bash
-# $Id: chcontext
,v 1.19 2005/04/08 19:14:47 ensc Exp
$
+# $Id: chcontext
2383 2006-11-17 18:48:33Z dhozac
$
# Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#
# Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#
@@
-27,7
+27,7
@@
test -e "$UTIL_VSERVER_VARS" || {
function showHelp()
{
echo \
function showHelp()
{
echo \
-$"Usage:
/usr/sbin/chcontext
[--cap [!]<cap_name>] [--secure] [--xid <num>] [--disconnect]
+$"Usage:
$1
[--cap [!]<cap_name>] [--secure] [--xid <num>] [--disconnect]
[--domainname <name>] [--hostname <name>] [--flag <flags>+]
[--silent] [--] command arguments ...
[--domainname <name>] [--hostname <name>] [--flag <flags>+]
[--silent] [--] command arguments ...
@@
-84,7
+84,7
@@
By default, a new/unused context is allocated
Do not print the allocated context number.
Report bugs to <$PACKAGE_BUGREPORT>."
Do not print the allocated context number.
Report bugs to <$PACKAGE_BUGREPORT>."
- exit $
1
+ exit $
2
}
function showVersion()
}
function showVersion()
@@
-114,8
+114,8
@@
OPT_INITPID=
while true; do
case "$1" in
while true; do
case "$1" in
- --help) showHelp $0 ;;
- --version) showVersion ;;
+ --help) showHelp $0
0
;;
+ --version) showVersion
0
;;
--cap) OPT_CAPS=( "${OPT_CAPS[@]}" "$2" ); shift;;
--ctx|--xid) OPT_CTX=$2; shift;;
--disconnect) OPT_DISCONNECT=1;;
--cap) OPT_CAPS=( "${OPT_CAPS[@]}" "$2" ); shift;;
--ctx|--xid) OPT_CTX=$2; shift;;
--disconnect) OPT_DISCONNECT=1;;
@@
-153,9
+153,9
@@
test -z "$OPT_DOMAINNAME$OPT_HOSTNAME" || \
chain_cmd=( "${chain_cmd[@]}"
--
$_VATTRIBUTE --set
chain_cmd=( "${chain_cmd[@]}"
--
$_VATTRIBUTE --set
+ ${OPT_SECURE:+--secure}
${OPT_CAPS:+--bcap "${OPT_CAPS[*]}"}
${OPT_CAPS:+--bcap "${OPT_CAPS[*]}"}
- ${OPT_FLAGS:+--flag "${OPT_FLAGS[*]}"}
- ${OPT_SECURE:+--secure} )
+ ${OPT_FLAGS:+--flag "${OPT_FLAGS[*]}"} )
migrate_cmd=( $_VCONTEXT
${OPT_SILENT:+--silent}
migrate_cmd=( $_VCONTEXT
${OPT_SILENT:+--silent}