aboutsummaryrefslogtreecommitdiff
path: root/kvm-creator
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2011-02-10 18:38:58 -0500
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2011-02-10 18:38:58 -0500
commit048402723e3f162341bc0280e6be274d285cf8af (patch)
tree88ed72b0fc0fa3b113a7d3b576494b6fa83f6f18 /kvm-creator
parent9ea0848f2135962f83ced19bce9b3fcf9b5c9b96 (diff)
downloadkvm-manager-048402723e3f162341bc0280e6be274d285cf8af.tar.gz
kvm-manager-048402723e3f162341bc0280e6be274d285cf8af.tar.bz2
avoid chowning where possible -- create files with the correct user in the first place
Diffstat (limited to 'kvm-creator')
-rwxr-xr-xkvm-creator3
1 files changed, 1 insertions, 2 deletions
diff --git a/kvm-creator b/kvm-creator
index 5b5771a..9e2ad41 100755
--- a/kvm-creator
+++ b/kvm-creator
@@ -104,8 +104,7 @@ create() {
validate
adduser "$NAME" --disabled-password --gecos "$NAME KVM user,,,"
USERHOMEDIR=$(getent passwd "$NAME" | cut -f6 -d:)
- mkdir -p "$USERHOMEDIR/"{.ssh,vms,"vms/$NAME"}
- chown "$NAME:$NAME" "$USERHOMEDIR/"{.ssh,vms,"vms/$NAME"}
+ chpst -u "$NAME:$NAME" mkdir -p "$USERHOMEDIR/"{.ssh,vms,"vms/$NAME"}
if [ -f /root/.ssh/authorized_keys ]; then
# is this really the right thing to do?
cp /root/.ssh/authorized_keys "$USERHOMEDIR/.ssh/"