diff options
author | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2011-02-10 18:38:58 -0500 |
---|---|---|
committer | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2011-02-10 18:38:58 -0500 |
commit | 048402723e3f162341bc0280e6be274d285cf8af (patch) | |
tree | 88ed72b0fc0fa3b113a7d3b576494b6fa83f6f18 | |
parent | 9ea0848f2135962f83ced19bce9b3fcf9b5c9b96 (diff) | |
download | kvm-manager-048402723e3f162341bc0280e6be274d285cf8af.tar.gz kvm-manager-048402723e3f162341bc0280e6be274d285cf8af.tar.bz2 |
avoid chowning where possible -- create files with the correct user in the first place
-rwxr-xr-x | kvm-creator | 3 |
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/" |