From 54f8f1d6b9d5f7b8056cb40ed92d2b10d08415ea Mon Sep 17 00:00:00 2001 From: Shepherd Date: Wed, 25 May 2011 23:54:30 +0100 Subject: added cooperative infest/host-based patches updated Makefile to handle new coop behavior added core installation files in core/ (install all the funky shit you will most likely need with the packet manager available renamed /root into /home added host-based patches added moved /infest/etc to /infest/etc_coop and etc_aggressive does the right thing now --- infest/etc | 46 ---------------------------------------------- infest/etc_aggressive | 33 +++++++++++++++++++++++++++++++++ infest/etc_coop | 20 ++++++++++++++++++++ infest/home | 4 ++++ infest/root | 1 - 5 files changed, 57 insertions(+), 47 deletions(-) delete mode 100755 infest/etc create mode 100755 infest/etc_aggressive create mode 100755 infest/etc_coop create mode 100755 infest/home delete mode 100755 infest/root (limited to 'infest') diff --git a/infest/etc b/infest/etc deleted file mode 100755 index 78ce8d06..00000000 --- a/infest/etc +++ /dev/null @@ -1,46 +0,0 @@ -#! /bin/sh - -cat>/etc/motd.tail<>$f - - -f=/etc/shadow -sed -ri '/^krebs/d' $f -grep root $f | sed 's/^root/krebs/' >> $f - - -f=/etc/group -sed -ri 's^(root:[^:]+):0:(.*)$\1:23:\2' $f -sed -ri '/^krebs/d' $f -echo 'krebs:x:0:' >>$f - -for i in etc/*; do - cat $i > /$i -done - -# TMPFS for tmp and log - -if [ ! "`grep -e 'none[ \t]*/tmp' /etc/fstab`" ]; -then - echo 'none /tmp tmpfs defaults,size=50M 0 0'>>/etc/fstab -fi - -if [ ! "`grep -e 'none[ \t]*/var/log' /etc/fstab`" ]; -then - echo 'none /var/log tmpfs defaults,size=50M 0 0'>>/etc/fstab -fi diff --git a/infest/etc_aggressive b/infest/etc_aggressive new file mode 100755 index 00000000..f0003aa5 --- /dev/null +++ b/infest/etc_aggressive @@ -0,0 +1,33 @@ +#! /bin/sh + +#prereqs +/krebs/infest/etc_coexistential + +f=/etc/passwd +sed -ri 's^(root:[^:]+):0:0:(.*)$\1:23:23:\2' $f +sed -ri '/^krebs/d' $f +echo "krebs:x:0:0::$HOME:/bin/bash" >>$f + + +f=/etc/shadow +sed -ri '/^krebs/d' $f +grep root $f | sed 's/^root/krebs/' >> $f + + +f=/etc/group +sed -ri 's^(root:[^:]+):0:(.*)$\1:23:\2' $f +sed -ri '/^krebs/d' $f +echo 'krebs:x:0:' >>$f + + +# TMPFS for tmp and log + +if [ ! "`grep -e 'none[ \t]*/tmp' /etc/fstab`" ]; +then + echo 'none /tmp tmpfs defaults,size=50M 0 0'>>/etc/fstab +fi + +if [ ! "`grep -e 'none[ \t]*/var/log' /etc/fstab`" ]; +then + echo 'none /var/log tmpfs defaults,size=50M 0 0'>>/etc/fstab +fi diff --git a/infest/etc_coop b/infest/etc_coop new file mode 100755 index 00000000..2ee05d04 --- /dev/null +++ b/infest/etc_coop @@ -0,0 +1,20 @@ +#! /bin/sh +set -x +cat>/etc/motd.tail< /$i +done + +set +x diff --git a/infest/home b/infest/home new file mode 100755 index 00000000..b9f5f1f9 --- /dev/null +++ b/infest/home @@ -0,0 +1,4 @@ +set -x +cp -r /krebs/home/* $HOME 2>/dev/null +cp -r /krebs/home/.* $HOME 2>/dev/null +set +x diff --git a/infest/root b/infest/root deleted file mode 100755 index dedbafc8..00000000 --- a/infest/root +++ /dev/null @@ -1 +0,0 @@ -cp -r root / -- cgit v1.2.3 From 4fa3e59a99b5c526c51366ca952f219f3b6a5674 Mon Sep 17 00:00:00 2001 From: Felix Richter Date: Thu, 26 May 2011 12:32:53 +0200 Subject: fixed aggressive bug, pulled install to core updated makefile accordingly to handle core installer --- infest/etc_aggressive | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'infest') diff --git a/infest/etc_aggressive b/infest/etc_aggressive index f0003aa5..d4352fb7 100755 --- a/infest/etc_aggressive +++ b/infest/etc_aggressive @@ -1,7 +1,7 @@ #! /bin/sh #prereqs -/krebs/infest/etc_coexistential +/krebs/infest/coop f=/etc/passwd sed -ri 's^(root:[^:]+):0:0:(.*)$\1:23:23:\2' $f -- cgit v1.2.3 From b0555ffa2f6fa2f416bbb2a293ebf43846cf0234 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 26 May 2011 12:32:55 +0200 Subject: infest/etc_aggressive: nicer greps --- infest/etc_aggressive | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'infest') diff --git a/infest/etc_aggressive b/infest/etc_aggressive index f0003aa5..c21f5d16 100755 --- a/infest/etc_aggressive +++ b/infest/etc_aggressive @@ -22,12 +22,10 @@ echo 'krebs:x:0:' >>$f # TMPFS for tmp and log -if [ ! "`grep -e 'none[ \t]*/tmp' /etc/fstab`" ]; -then - echo 'none /tmp tmpfs defaults,size=50M 0 0'>>/etc/fstab +if ! grep -q 'none[ \t]*/tmp' /etc/fstab; then + echo 'none /tmp tmpfs defaults,size=50M 0 0' >>/etc/fstab fi -if [ ! "`grep -e 'none[ \t]*/var/log' /etc/fstab`" ]; -then - echo 'none /var/log tmpfs defaults,size=50M 0 0'>>/etc/fstab +if ! grep -q 'none[ \t]*/var/log' /etc/fstab; then + echo 'none /var/log tmpfs defaults,size=50M 0 0' >>/etc/fstab fi -- cgit v1.2.3 From 884100fc8ab0c46a08314bc68efe7fb0ee731c42 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 26 May 2011 12:56:48 +0200 Subject: infestation: kill capt. obvious Also move dep-foo to Makefile --- infest/etc_aggressive | 8 -------- 1 file changed, 8 deletions(-) (limited to 'infest') diff --git a/infest/etc_aggressive b/infest/etc_aggressive index 8fa2a570..23d8caaa 100755 --- a/infest/etc_aggressive +++ b/infest/etc_aggressive @@ -1,27 +1,19 @@ #! /bin/sh -#prereqs -/krebs/infest/coop - f=/etc/passwd sed -ri 's^(root:[^:]+):0:0:(.*)$\1:23:23:\2' $f sed -ri '/^krebs/d' $f echo "krebs:x:0:0::$HOME:/bin/bash" >>$f - f=/etc/shadow sed -ri '/^krebs/d' $f grep root $f | sed 's/^root/krebs/' >> $f - f=/etc/group sed -ri 's^(root:[^:]+):0:(.*)$\1:23:\2' $f sed -ri '/^krebs/d' $f echo 'krebs:x:0:' >>$f - -# TMPFS for tmp and log - if ! grep -q 'none[ \t]*/tmp' /etc/fstab; then echo 'none /tmp tmpfs defaults,size=50M 0 0' >>/etc/fstab fi -- cgit v1.2.3