From 048402723e3f162341bc0280e6be274d285cf8af Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Thu, 10 Feb 2011 18:38:58 -0500 Subject: avoid chowning where possible -- create files with the correct user in the first place --- kvm-creator | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'kvm-creator') 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/" -- cgit v1.2.3