mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 11:13:24 +02:00
chown: Replace . with : on all shipped scripts
I don't like this messy bootup screen that we have with all sorts of warnings that actually don't cause any problems, but make the boot messy and send the wrong message to users. Signed-off-by: Michael Tremer <michael.tremer@ipfire.org> Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
committed by
Arne Fitzenreiter
parent
7c0241405e
commit
2e92bfc047
2
lfs/frr
2
lfs/frr
@@ -34,7 +34,7 @@ DL_FROM = $(URL_IPFIRE)
|
|||||||
DIR_APP = $(DIR_SRC)/$(THISAPP)
|
DIR_APP = $(DIR_SRC)/$(THISAPP)
|
||||||
TARGET = $(DIR_INFO)/$(THISAPP)
|
TARGET = $(DIR_INFO)/$(THISAPP)
|
||||||
PROG = frr
|
PROG = frr
|
||||||
PAK_VER = 10
|
PAK_VER = 11
|
||||||
|
|
||||||
DEPS =
|
DEPS =
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ DL_FROM = $(URL_IPFIRE)
|
|||||||
DIR_APP = $(DIR_SRC)/$(THISAPP)
|
DIR_APP = $(DIR_SRC)/$(THISAPP)
|
||||||
TARGET = $(DIR_INFO)/$(THISAPP)
|
TARGET = $(DIR_INFO)/$(THISAPP)
|
||||||
PROG = zabbix_agentd
|
PROG = zabbix_agentd
|
||||||
PAK_VER = 14
|
PAK_VER = 15
|
||||||
|
|
||||||
DEPS = fping
|
DEPS = fping
|
||||||
|
|
||||||
|
|||||||
@@ -110,11 +110,11 @@ import_aws_configuration() {
|
|||||||
if [ -n "${key}" ] && ! grep -q "^${key}$" "/home/setup/.ssh/authorized_keys" 2>/dev/null; then
|
if [ -n "${key}" ] && ! grep -q "^${key}$" "/home/setup/.ssh/authorized_keys" 2>/dev/null; then
|
||||||
mkdir -p "/home/setup/.ssh"
|
mkdir -p "/home/setup/.ssh"
|
||||||
chmod 700 "/home/setup/.ssh"
|
chmod 700 "/home/setup/.ssh"
|
||||||
chown setup.nobody "/home/setup/.ssh"
|
chown setup:nobody "/home/setup/.ssh"
|
||||||
|
|
||||||
echo "${key}" >> "/home/setup/.ssh/authorized_keys"
|
echo "${key}" >> "/home/setup/.ssh/authorized_keys"
|
||||||
chmod 600 "/home/setup/.ssh/authorized_keys"
|
chmod 600 "/home/setup/.ssh/authorized_keys"
|
||||||
chown setup.nobody "/home/setup/.ssh/authorized_keys"
|
chown setup:nobody "/home/setup/.ssh/authorized_keys"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -132,12 +132,12 @@ import_azure_configuration() {
|
|||||||
# Install directory
|
# Install directory
|
||||||
mkdir -p "${dir}"
|
mkdir -p "${dir}"
|
||||||
chmod 700 "${dir}"
|
chmod 700 "${dir}"
|
||||||
chown "${user}.nobody" "${dir}"
|
chown "${user}:nobody" "${dir}"
|
||||||
|
|
||||||
# Install the key
|
# Install the key
|
||||||
echo "${key}" >> "${path}"
|
echo "${key}" >> "${path}"
|
||||||
chmod 600 "${path}"
|
chmod 600 "${path}"
|
||||||
chown "${user}.nobody" "${path}"
|
chown "${user}:nobody" "${path}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -76,11 +76,11 @@ import_exoscale_configuration() {
|
|||||||
if [ -n "${key}" ] && ! grep -q "^${key}$" "/home/setup/.ssh/authorized_keys" 2>/dev/null; then
|
if [ -n "${key}" ] && ! grep -q "^${key}$" "/home/setup/.ssh/authorized_keys" 2>/dev/null; then
|
||||||
mkdir -p "/home/setup/.ssh"
|
mkdir -p "/home/setup/.ssh"
|
||||||
chmod 700 "/home/setup/.ssh"
|
chmod 700 "/home/setup/.ssh"
|
||||||
chown setup.nobody "/home/setup/.ssh"
|
chown setup:nobody "/home/setup/.ssh"
|
||||||
|
|
||||||
echo "${key}" >> "/home/setup/.ssh/authorized_keys"
|
echo "${key}" >> "/home/setup/.ssh/authorized_keys"
|
||||||
chmod 600 "/home/setup/.ssh/authorized_keys"
|
chmod 600 "/home/setup/.ssh/authorized_keys"
|
||||||
chown setup.nobody "/home/setup/.ssh/authorized_keys"
|
chown setup:nobody "/home/setup/.ssh/authorized_keys"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Import any previous settings for the local interfaces
|
# Import any previous settings for the local interfaces
|
||||||
|
|||||||
@@ -110,11 +110,11 @@ import_gcp_configuration() {
|
|||||||
if [ -n "${key}" ] && ! grep -q "^${key}$" "/home/setup/.ssh/authorized_keys" 2>/dev/null; then
|
if [ -n "${key}" ] && ! grep -q "^${key}$" "/home/setup/.ssh/authorized_keys" 2>/dev/null; then
|
||||||
mkdir -p "/home/setup/.ssh"
|
mkdir -p "/home/setup/.ssh"
|
||||||
chmod 700 "/home/setup/.ssh"
|
chmod 700 "/home/setup/.ssh"
|
||||||
chown setup.nobody "/home/setup/.ssh"
|
chown setup:nobody "/home/setup/.ssh"
|
||||||
|
|
||||||
echo "${key}" >> "/home/setup/.ssh/authorized_keys"
|
echo "${key}" >> "/home/setup/.ssh/authorized_keys"
|
||||||
chmod 600 "/home/setup/.ssh/authorized_keys"
|
chmod 600 "/home/setup/.ssh/authorized_keys"
|
||||||
chown setup.nobody "/home/setup/.ssh/authorized_keys"
|
chown setup:nobody "/home/setup/.ssh/authorized_keys"
|
||||||
fi
|
fi
|
||||||
done <<<"$(get instance/attributes/ssh-keys)"
|
done <<<"$(get instance/attributes/ssh-keys)"
|
||||||
|
|
||||||
|
|||||||
@@ -139,11 +139,11 @@ import_oci_configuration() {
|
|||||||
if [ -n "${key}" ] && ! grep -q "^${key}$" "/home/setup/.ssh/authorized_keys" 2>/dev/null; then
|
if [ -n "${key}" ] && ! grep -q "^${key}$" "/home/setup/.ssh/authorized_keys" 2>/dev/null; then
|
||||||
mkdir -p "/home/setup/.ssh"
|
mkdir -p "/home/setup/.ssh"
|
||||||
chmod 700 "/home/setup/.ssh"
|
chmod 700 "/home/setup/.ssh"
|
||||||
chown setup.nobody "/home/setup/.ssh"
|
chown setup:nobody "/home/setup/.ssh"
|
||||||
|
|
||||||
echo "${key}" >> "/home/setup/.ssh/authorized_keys"
|
echo "${key}" >> "/home/setup/.ssh/authorized_keys"
|
||||||
chmod 600 "/home/setup/.ssh/authorized_keys"
|
chmod 600 "/home/setup/.ssh/authorized_keys"
|
||||||
chown setup.nobody "/home/setup/.ssh/authorized_keys"
|
chown setup:nobody "/home/setup/.ssh/authorized_keys"
|
||||||
fi
|
fi
|
||||||
done <<<"$(get instance/metadata/ssh_authorized_keys)"
|
done <<<"$(get instance/metadata/ssh_authorized_keys)"
|
||||||
|
|
||||||
|
|||||||
@@ -28,14 +28,14 @@ case "${1}" in
|
|||||||
start)
|
start)
|
||||||
# Fix permissions of configuration directory
|
# Fix permissions of configuration directory
|
||||||
if [ -d "/etc/frr" ]; then
|
if [ -d "/etc/frr" ]; then
|
||||||
chown root.frr /etc/frr
|
chown root:frr /etc/frr
|
||||||
chmod 775 /etc/frr
|
chmod 775 /etc/frr
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for daemon in ${DAEMONS}; do
|
for daemon in ${DAEMONS}; do
|
||||||
if [ -f "/etc/frr/${daemon}.conf" ]; then
|
if [ -f "/etc/frr/${daemon}.conf" ]; then
|
||||||
# Set permissions
|
# Set permissions
|
||||||
chown frr.frr "/etc/frr/${daemon}.conf"
|
chown frr:frr "/etc/frr/${daemon}.conf"
|
||||||
|
|
||||||
boot_mesg "Starting FRRouting ${daemon}..."
|
boot_mesg "Starting FRRouting ${daemon}..."
|
||||||
loadproc "/usr/sbin/${daemon}" --daemon
|
loadproc "/usr/sbin/${daemon}" --daemon
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ case "${1}" in
|
|||||||
start)
|
start)
|
||||||
if [ ! -d "/var/run/zabbix" ]; then
|
if [ ! -d "/var/run/zabbix" ]; then
|
||||||
mkdir -p /var/run/zabbix
|
mkdir -p /var/run/zabbix
|
||||||
chown zabbix.zabbix /var/run/zabbix
|
chown zabbix:zabbix /var/run/zabbix
|
||||||
fi
|
fi
|
||||||
|
|
||||||
boot_mesg "Starting Zabbix Agent..."
|
boot_mesg "Starting Zabbix Agent..."
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ case "${1}" in
|
|||||||
fi
|
fi
|
||||||
if [ ! -e /var/lock/time ]; then
|
if [ ! -e /var/lock/time ]; then
|
||||||
mkdir -p /var/lock/time
|
mkdir -p /var/lock/time
|
||||||
chown nobody.root /var/lock/time
|
chown nobody:root /var/lock/time
|
||||||
fi
|
fi
|
||||||
if [ ! -e /var/run/clamav ]; then
|
if [ ! -e /var/run/clamav ]; then
|
||||||
mkdir -p /var/run/clamav
|
mkdir -p /var/run/clamav
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
setperms)
|
setperms)
|
||||||
chown -R nobody.squid /var/updatecache/
|
chown -R nobody:squid /var/updatecache/
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
|
|||||||
@@ -504,7 +504,7 @@ void startDaemon(void) {
|
|||||||
executeCommand(command);
|
executeCommand(command);
|
||||||
snprintf(command, STRING_SIZE-1, "/usr/sbin/openvpn --config /var/ipfire/ovpn/server.conf");
|
snprintf(command, STRING_SIZE-1, "/usr/sbin/openvpn --config /var/ipfire/ovpn/server.conf");
|
||||||
executeCommand(command);
|
executeCommand(command);
|
||||||
snprintf(command, STRING_SIZE-1, "/bin/chown root.nobody /var/run/ovpnserver.log");
|
snprintf(command, STRING_SIZE-1, "/bin/chown root:nobody /var/run/ovpnserver.log");
|
||||||
executeCommand(command);
|
executeCommand(command);
|
||||||
snprintf(command, STRING_SIZE-1, "/bin/chmod 644 /var/run/ovpnserver.log");
|
snprintf(command, STRING_SIZE-1, "/bin/chmod 644 /var/run/ovpnserver.log");
|
||||||
executeCommand(command);
|
executeCommand(command);
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ int main(int argc, char *argv[])
|
|||||||
sleep(5);
|
sleep(5);
|
||||||
unlink("/var/ipfire/remote/enablessh");
|
unlink("/var/ipfire/remote/enablessh");
|
||||||
safe_system("cat /var/ipfire/remote/settings | sed 's/ENABLE_SSH=on/ENABLE_SSH=off/' > /var/ipfire/remote/settings2 && mv /var/ipfire/remote/settings2 /var/ipfire/remote/settings");
|
safe_system("cat /var/ipfire/remote/settings | sed 's/ENABLE_SSH=on/ENABLE_SSH=off/' > /var/ipfire/remote/settings2 && mv /var/ipfire/remote/settings2 /var/ipfire/remote/settings");
|
||||||
safe_system("chown nobody.nobody /var/ipfire/remote/settings");
|
safe_system("chown nobody:nobody /var/ipfire/remote/settings");
|
||||||
snprintf(command, BUFFER_SIZE-1, "sleep %s && /usr/local/bin/sshctrl &", argv[2]);
|
snprintf(command, BUFFER_SIZE-1, "sleep %s && /usr/local/bin/sshctrl &", argv[2]);
|
||||||
safe_system(command);
|
safe_system(command);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user