aboutsummaryrefslogtreecommitdiffstats
path: root/init-sh
diff options
context:
space:
mode:
authorYoann Vandoorselaere <yoann@mandriva.com>1999-12-01 11:39:58 +0000
committerYoann Vandoorselaere <yoann@mandriva.com>1999-12-01 11:39:58 +0000
commit3e51d5bb01c84dff7fe1b114c2f1e281bdf2219d (patch)
treeacbcb16ee5923073dc64a9353a616f7debe1505c /init-sh
parent6b9df4eac57b3b7118aa3f680913f623e8cedfe1 (diff)
downloadmsec-3e51d5bb01c84dff7fe1b114c2f1e281bdf2219d.tar
msec-3e51d5bb01c84dff7fe1b114c2f1e281bdf2219d.tar.gz
msec-3e51d5bb01c84dff7fe1b114c2f1e281bdf2219d.tar.bz2
msec-3e51d5bb01c84dff7fe1b114c2f1e281bdf2219d.tar.xz
msec-3e51d5bb01c84dff7fe1b114c2f1e281bdf2219d.zip
Now preserve file indentation
Diffstat (limited to 'init-sh')
-rwxr-xr-xinit-sh/level4.sh9
-rw-r--r--init-sh/lib.sh11
2 files changed, 13 insertions, 7 deletions
diff --git a/init-sh/level4.sh b/init-sh/level4.sh
index a762c2d..bc18c5f 100755
--- a/init-sh/level4.sh
+++ b/init-sh/level4.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash
#
@@ -80,6 +80,8 @@ echo "Setting secure level variable to 4 :"
AddRules "SECURE_LEVEL=4" /etc/profile
export SECURE_LEVEL=4
+IFS="
+"
echo -n "Disabling all service, except : {"
for service in `chkconfig --list | awk '{print $1}'`; do
if grep -qx ${service} /etc/security/msec/init-sh/server.4; then
@@ -98,7 +100,8 @@ echo -e "done.\n";
# /etc/profile
echo "Setting umask to 022 (u=rw,g=rx) for root, 077 (u=rw) for user :"
-AddRules "if [ ${UID} == 0 ]; then umask 022; else umask 077; fi" /etc/profile
+AddRules "if [ \${UID} == 0 ]; then umask 022; else umask 077; fi" /etc/profile
echo "Adding \"normal\" PATH variable :"
AddRules "PATH=\$PATH:/usr/X11R6/bin" /etc/profile quiet
-AddRules "export PATH SECURE_LEVEL" /etc/profile \ No newline at end of file
+AddRules "export PATH SECURE_LEVEL" /etc/profile
+
diff --git a/init-sh/lib.sh b/init-sh/lib.sh
index d9e7107..499e81e 100644
--- a/init-sh/lib.sh
+++ b/init-sh/lib.sh
@@ -48,8 +48,8 @@ AddRules () {
fi
if ! grep -Eqx "^${string}" ${file}; then
- echo "${COMMENT}" >> ${file};
- echo "${string}" >> ${file};
+ echo -e "${COMMENT}" >> ${file};
+ echo -e "${string}" >> ${file};
fi
if [ -z ${3} ]; then
echo -e "done.\n"
@@ -64,6 +64,8 @@ CleanRules() {
mv -f ${file} /tmp/secure.tmp
touch ${file}
+ IFS="
+"
while read line; do
if [ ${ctrl} == 1 ]; then
ctrl=0
@@ -78,7 +80,8 @@ CleanRules() {
echo "${line}" >> ${file}
fi
done < /tmp/secure.tmp
-
+ IFS=" "
+
rm -f /tmp/secure.tmp
echo "done."
@@ -122,7 +125,7 @@ LiloUpdate() {
echo "Do you want a password authentication at boot time ?"
echo "Be very carefull,"
echo "this will prevent your server to reboot without an operator to enter password".
- WaitAnswer
+ WaitAnswer;
if [ "${answer}" == "yes" ]; then
echo -n "Please enter the password which will be used at boot time : "
read password