From 46147ee5df4e270a075f7e5de0d4a811013852b8 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Fri, 11 May 2012 11:15:42 -0600 Subject: [PATCH] Fix root account creation race condition --- packages/00admin/service/sshd/run | 3 --- packages/inferno/service/httpd/run | 3 +-- packages/mcp/service/httpd/run | 2 +- packages/router/service/sshd/run | 2 +- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/00admin/service/sshd/run b/packages/00admin/service/sshd/run index 65dd2e2..f4a6692 100755 --- a/packages/00admin/service/sshd/run +++ b/packages/00admin/service/sshd/run @@ -2,9 +2,6 @@ exec 2>&1 -[ -r /etc/passwd ] || echo 'root:x:0:0:root:/tmp:/bin/sh' > /etc/passwd - -# Always do this, in case something else set a root password echo 'root:$1$i/EeZyl6$5C6Z8s0ftEdTKFLUli1wP1' | chpasswd --encrypted # Bring up the NIC; this will get us at least a link-local address, and diff --git a/packages/inferno/service/httpd/run b/packages/inferno/service/httpd/run index b3d848d..fdd907f 100755 --- a/packages/inferno/service/httpd/run +++ b/packages/inferno/service/httpd/run @@ -2,7 +2,6 @@ exec 2>&1 -cd /var/www - +ln -sf /var/www default exec tcpsvd -l localhost 0 80 /opt/inferno/bin/eris -d diff --git a/packages/mcp/service/httpd/run b/packages/mcp/service/httpd/run index 4180bbd..013b0a3 100755 --- a/packages/mcp/service/httpd/run +++ b/packages/mcp/service/httpd/run @@ -18,5 +18,5 @@ for d in /opt/*; do fi done -cd /var/www +ln -sf /var/www default exec tcpsvd -u ctf ${IP%/*} 80 /opt/mcp/bin/eris -c diff --git a/packages/router/service/sshd/run b/packages/router/service/sshd/run index cfe1216..d063d8c 100755 --- a/packages/router/service/sshd/run +++ b/packages/router/service/sshd/run @@ -2,6 +2,6 @@ exec 2>&1 -echo 'root:$1$xAJ7KwiU$BeKJjYGs9r/hY9Ag4qv4I1:0:0:root:/tmp:/bin/sh' > /etc/passwd +echo 'root:$1$xAJ7KwiU$BeKJjYGs9r/hY9Ag4qv4I1:0:0' | chpasswd --encrypted exec dropbear -r ./rsa.key -E -F