From: Daniel Kahn Gillmor Date: Thu, 10 Feb 2011 23:38:58 +0000 (-0500) Subject: avoid chowning where possible -- create files with the correct user in the first... X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=048402723e3f162341bc0280e6be274d285cf8af;p=kvm-manager.git avoid chowning where possible -- create files with the correct user in the first place --- 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/"