summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Heim <phreak@gentoo.org>2006-08-13 17:00:37 +0000
committerChristian Heim <phreak@gentoo.org>2006-08-13 17:00:37 +0000
commit193bee631b8444b7667105fe410b8cb2a4112a1d (patch)
treef2ef89e0e72324eac70e9aa6786ebac35340602b
parentMerging r2151 (diff)
downloadbaselayout-vserver-193bee631b8444b7667105fe410b8cb2a4112a1d.tar.gz
baselayout-vserver-193bee631b8444b7667105fe410b8cb2a4112a1d.tar.bz2
baselayout-vserver-193bee631b8444b7667105fe410b8cb2a4112a1d.zip
Merging r2184
svn path=/baselayout-vserver/branches/baselayout-1_12/; revision=410
-rw-r--r--ChangeLog29
-rw-r--r--Makefile2
-rw-r--r--etc/conf.d/rc10
-rw-r--r--etc/inputrc2
-rwxr-xr-xinit.d/bootmisc5
-rwxr-xr-xinit.d/clock8
-rw-r--r--net-scripts/net/wpa_supplicant.sh12
-rwxr-xr-xsbin/rc7
-rw-r--r--sbin/rc-daemon.sh13
-rwxr-xr-xsbin/rc-help.sh14
-rwxr-xr-xsbin/rc-services.sh49
-rwxr-xr-xsbin/runscript.sh28
-rw-r--r--src/awk/cachedepends.awk15
-rw-r--r--src/awk/gendepends.awk3
-rw-r--r--src/runscript.c45
-rwxr-xr-xtarball.sh6
16 files changed, 184 insertions, 64 deletions
diff --git a/ChangeLog b/ChangeLog
index 9d98d52..b1f8b7e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,35 @@
# ChangeLog for Gentoo System Intialization ("rc") scripts
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPLv2
+ 04 Aug 2006; Roy Marples <uberlord@gentoo.org>:
+
+ Add bootchart suppport, #74425 and #141114. Thanks to Paul Pacheco.
+
+* baselayout-1.12.4 (02 Aug 2006)
+
+ 02 Aug 2006; Roy Marples <uberlord@gentoo.org>:
+
+ Updated tarball.sh to make clean before making the tarball, bug #142457
+
+* baselayout-1.12.2 (01 Aug 2006)
+
+ 26 Jul 2006; Roy Marples <uberlord@gentoo.org>:
+
+ wpa_supplicant now launches even when wireless radio has been killed
+ as if the user enables it then it will associate and work without the
+ user having to restart the interface.
+
+ 20 Jul 2006; Roy Marples <uberlord@gentoo.org>:
+
+ Enable RC_NEED="foo" and RC_USE="bar" in /etc/conf.d/${SERVICE}
+ so that users can overlay service dependencies with their own.
+ Bug #140865
+
+ 18 Jul 2006; Roy Marples <uberlord@gentoo.org>:
+
+ Report services scheduled to be started by another service as
+ started OK for splash.
+
12 Jul 2006; Roy Marples <uberlord@gentoo.org>:
Add bootmisc as a CRITICAL_SERVICE as too many init scripts don't
diff --git a/Makefile b/Makefile
index a3618a5..2c870b4 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@
# without an ebuild style package manager.
NAME = baselayout-vserver
-VERSION = 1.12.2
+VERSION = 1.12.4
PKG = $(NAME)-$(VERSION)
ARCH = x86
diff --git a/etc/conf.d/rc b/etc/conf.d/rc
index 1f65fd4..ce80915 100644
--- a/etc/conf.d/rc
+++ b/etc/conf.d/rc
@@ -25,8 +25,9 @@ RC_HOTPLUG="yes"
# start before we are ready for them. If this happens, we can defer these
# services to start in the boot runlevel. Set RC_COLDPLUG="no" if you don't
# want this.
-# NOTE: This does not affect anything coldplug/udev related, just the
-# starting/stopping of the init.d service triggered by coldplug.
+# NOTE: This also affects module coldplugging in udev-096 and higher
+# If you want module coldplugging but not coldplugging of services then you
+# can set RC_COLDPLUG="yes" and RC_PLUG_SERVICES="!*"
RC_COLDPLUG="yes"
@@ -69,6 +70,11 @@ RC_VERBOSE="no"
RC_BOOTLOG="no"
+# Set to "yes" if you want to benchmark system boot with bootchart.
+# You'll need to emerge the apps-benchmark/bootchart package for this to work.
+
+RC_BOOTCHART="no"
+
# RC_USE_FSTAB allows you to override the default mount options for the
# standard /proc, /sys, /dev, and /dev/pts mount points. Note that this
# is the new way for selecting ramfs/tmpfs/etc... for udev mounting.
diff --git a/etc/inputrc b/etc/inputrc
index 8126e2b..8fe3ae1 100644
--- a/etc/inputrc
+++ b/etc/inputrc
@@ -43,6 +43,8 @@ $if mode=emacs
"\e\e[C": forward-word
"\e\e[D": backward-word
# konsole (alt + arrow key)
+"\e[1;3C": forward-word
+"\e[1;3D": backward-word
# aterm / eterm (control + arrow key)
"\eOc": forward-word
"\eOd": backward-word
diff --git a/init.d/bootmisc b/init.d/bootmisc
index 652495b..c79c12a 100755
--- a/init.d/bootmisc
+++ b/init.d/bootmisc
@@ -99,8 +99,11 @@ start() {
(
# Make sure our X11 stuff have the correct permissions
+ # Omit the chown as bootmisc is run before network is up
+ # and users may be using lame LDAP auth #139411
+ rm -rf /tmp/.{ICE,X11}-unix
mkdir -p /tmp/.{ICE,X11}-unix
- chown 0:0 /tmp/.{ICE,X11}-unix
+ #chown 0:0 /tmp/.{ICE,X11}-unix
chmod 1777 /tmp/.{ICE,X11}-unix
[[ -x /sbin/restorecon ]] && restorecon /tmp/.{ICE,X11}-unix
) &> /dev/null
diff --git a/init.d/clock b/init.d/clock
index 9478200..1c6ab61 100755
--- a/init.d/clock
+++ b/init.d/clock
@@ -70,7 +70,7 @@ start() {
setupopts
if [[ ${fakeit} -ne 1 && -e /proc/modules && ! -e /dev/rtc ]] ; then
- modprobe rtc &> /dev/null
+ modprobe rtc &> /dev/null || modprobe genrtc &> /dev/null
fi
ebegin "Setting system clock using the hardware clock [${TBLURB}]"
@@ -88,12 +88,14 @@ start() {
else
ret=0
fi
- errstr="Failed to set system clock to hardware clock"
+ errstr="Failed to set clock"
else
ret=1
errstr="/sbin/hwclock not found"
fi
- eend ${ret} "${errstr}"
+ eend ${ret} "${errstr}" "You will need to set the clock yourself"
+
+ return 0
}
stop() {
diff --git a/net-scripts/net/wpa_supplicant.sh b/net-scripts/net/wpa_supplicant.sh
index a366577..b556020 100644
--- a/net-scripts/net/wpa_supplicant.sh
+++ b/net-scripts/net/wpa_supplicant.sh
@@ -152,7 +152,6 @@ wpa_supplicant_kill() {
wpa_supplicant_associate() {
local iface="$1" ifvar=$(bash_variable "$1") timeout=
timeout="associate_timeout_${ifvar}"
- [[ -z ${!timeout} ]] && timeout="wpa_timeout_${ifvar}"
timeout="${!timeout:--1}"
[[ -z ${actfile} && ${timeout} -lt 0 ]] && timeout="60"
@@ -251,8 +250,15 @@ wpa_supplicant_pre_start() {
# cards may in the future
if [[ -e "/sys/class/net/${iface}/device/rf_kill" ]] ; then
if [[ $( < "/sys/class/net/${iface}/device/rf_kill" ) != 0 ]] ; then
- eerror "Wireless radio has been killed for interface ${iface}"
- return 1
+ ewarn "Wireless radio has been killed for interface ${iface}"
+ local asc="associate_timeout_${ifvar}"
+ if [[ -n ${!asc} && ${!asc} -ge 0 ]] ; then
+ eerror "As you have ${asc} set to 0 or greater"
+ eerror "we will abort as we cannot associate"
+ return 1
+ fi
+ ewarn "wpa_supplicant will launch, but not associate until"
+ ewarn "wireles radio is re-enabled for interface ${iface}"
fi
fi
diff --git a/sbin/rc b/sbin/rc
index 9ca43e7..af3a774 100755
--- a/sbin/rc
+++ b/sbin/rc
@@ -207,6 +207,9 @@ then
is_vserver_sys || try mount -n ${mntcmd:--t proc proc /proc -o noexec,nosuid,nodev}
eend $?
+ # Start profiling init now we have /proc
+ profiling start
+
# Read off the kernel commandline to see if there's any special settings
# especially check to see if we need to set the CDBOOT environment variable
# Note: /proc MUST be mounted
@@ -375,6 +378,8 @@ then
# Needed for some addons like dm-crypt that starts in critical services
local myservice="$1"
+ profiling name "/etc/init.d/${service} start"
+
source "/etc/init.d/${service}"
retval=$?
if [[ ${retval} -ne 0 ]] ; then
@@ -497,6 +502,8 @@ then
# Now that the dependency cache are up to date, make sure these
# are marked as started ...
(
+ profiling name "mark started"
+
# Needed for mark_service_started()
source "${svclib}/sh/rc-services.sh"
diff --git a/sbin/rc-daemon.sh b/sbin/rc-daemon.sh
index f0b3dca..58b0fe0 100644
--- a/sbin/rc-daemon.sh
+++ b/sbin/rc-daemon.sh
@@ -355,10 +355,13 @@ update_service_status() {
start-stop-daemon() {
local args="$( requote "$@" )" result i
local cmd pidfile pid stopping signal nothing=false
- local daemonfile="${svcdir}/daemons/${SVCNAME}"
+ local daemonfile=
local -a RC_DAEMONS=() RC_PIDFILES=()
- [[ -e ${daemonfile} ]] && source "${daemonfile}"
+ if [[ -n ${SVCNAME} ]] ; then
+ daemonfile="${svcdir}/daemons/${SVCNAME}"
+ [[ -e ${daemonfile} ]] && source "${daemonfile}"
+ fi
rc_setup_daemon_vars
@@ -371,7 +374,7 @@ start-stop-daemon() {
if ${stopping}; then
rc_stop_daemon
result="$?"
- if [[ ${result} == "0" ]]; then
+ if [[ ${result} == "0" && -n ${daemonfile} ]]; then
# We stopped the daemon successfully
# so we remove it from our state
for (( i=0; i<${#RC_DAEMONS[@]}; i++ )); do
@@ -389,7 +392,7 @@ start-stop-daemon() {
else
rc_start_daemon
result="$?"
- if [[ ${result} == "0" ]]; then
+ if [[ ${result} == "0" && -n ${daemonfile} ]]; then
# We started the daemon sucessfully
# so we add it to our state
local max="${#RC_DAEMONS[@]}"
@@ -410,7 +413,7 @@ start-stop-daemon() {
# Write the new list of daemon states for this service
if [[ ${#RC_DAEMONS[@]} == "0" ]]; then
[[ -f ${daemonfile} ]] && rm -f "${daemonfile}"
- else
+ elif [[ -n ${daemonfile} ]] ; then
echo "RC_DAEMONS[0]=\"${RC_DAEMONS[0]}\"" > "${daemonfile}"
echo "RC_PIDFILES[0]=\"${RC_PIDFILES[0]}\"" >> "${daemonfile}"
diff --git a/sbin/rc-help.sh b/sbin/rc-help.sh
index 30a5736..769dd91 100755
--- a/sbin/rc-help.sh
+++ b/sbin/rc-help.sh
@@ -225,6 +225,20 @@ echo -e " /etc/conf.d/${SERVICE}${NL} /etc/rc.conf"
if [[ ${BE_VERBOSE} == "yes" ]] ; then
echo -e "
+ You can add extra dependencies to ${SERVICE} by adding some variables to
+ /etc/conf.d/${SERVICE}
+ RC_NEED=\"openvpn ntpd\"
+ RC_USE=\"dns\"
+
+ This makes ${SERVICE} need openvpn and ntpd, while it just uses dns.
+
+ A good example of this is nfsmount needing openvpn if the nfs mounts in
+ /etc/fstab are over the vpn link.
+"
+fi
+
+if [[ ${BE_VERBOSE} == "yes" ]] ; then
+echo -e "
${CYAN}Management:${OFF}
Services are added and removed via the 'rc-update' tool. Running it without
diff --git a/sbin/rc-services.sh b/sbin/rc-services.sh
index 8fcd7c1..cd09965 100755
--- a/sbin/rc-services.sh
+++ b/sbin/rc-services.sh
@@ -407,18 +407,29 @@ start_service() {
${START_CRITICAL} == "yes" ]] ; then
# if we can not start the services in parallel
# then just start it and return the exit status
- ( "/etc/init.d/${service}" start )
- service_started "${service}" || service_inactive "${service}"
+ (
+ profiling name "/etc/init.d/${service} start"
+ "/etc/init.d/${service}" start
+ )
+
+ service_started "${service}" || service_inactive "${service}" \
+ || service_scheduled "${service}"
retval=$?
+
end_service "${service}" "${retval}"
splash "svc_started" "${service}" "${retval}"
+
return "${retval}"
else
# if parallel startup is allowed, start it in background
(
+ profiling name "/etc/init.d/${service} start"
"/etc/init.d/${service}" start
- service_started "${service}" || service_inactive "${service}"
+
+ service_started "${service}" || service_inactive "${service}" \
+ || service_scheduled "${service}"
retval=$?
+
end_service "${service}" "${retval}"
splash "svc_started" "${service}" "${retval}"
) &
@@ -646,6 +657,31 @@ service_stopped() {
return 0
}
+# char service_scheduled_by(service)
+#
+# Returns a list of services which will try and start 'service' when they
+# are started
+#
+service_scheduled_by() {
+ [[ -z $1 ]] && return 1
+
+ local x= s= r=
+ for x in $(dolisting "${svcdir}/scheduled/*/$1") ; do
+ s="${x%/*}"
+ r="${r} ${s##*/}"
+ done
+
+ echo "${r:1}"
+}
+
+# bool service_scheduled()
+#
+# Returns true if 'service' is scheduled to be started by another service
+#
+service_scheduled() {
+ [[ -n $(service_scheduled_by "$@") ]]
+}
+
# bool mark_service_failed(service)
#
# Mark service as failed for current runlevel. Note that
@@ -740,9 +776,8 @@ dependon() {
# This is the main code for valid_after and valid_iuse
# No point in writing it twice!
valid_i() {
- local x
# Just set to dummy for now (don't know if $svcdir/softlevel exists yet).
- local mylevel="${BOOTLEVEL}"
+ local mylevel="${BOOTLEVEL}" x= valid=
[[ $1 != "after" && $1 != "use" ]] && return 1
@@ -753,8 +788,10 @@ valid_i() {
[[ -e "/etc/runlevels/${BOOTLEVEL}/${x}" || \
-e "/etc/runlevels/${mylevel}/${x}" || \
${x} == "net" ]] \
- && echo "${x}"
+ && valid="${valid} ${x}"
done
+
+ echo "${valid:1}"
return 0
}
diff --git a/sbin/runscript.sh b/sbin/runscript.sh
index e8fa562..99feca7 100755
--- a/sbin/runscript.sh
+++ b/sbin/runscript.sh
@@ -194,8 +194,9 @@ svc_stop() {
ewarn "WARNING: you are stopping a boot service."
fi
- if [[ ${svcpause} != "yes" && ${RC_NO_DEPS} != "yes" ]] ; then
- if net_service "${SVCNAME}" ; then
+ if [[ ${svcpause} != "yes" && ${RC_NO_DEPS} != "yes" ]] \
+ && ! service_wasinactive "${SVCNAME}" ; then
+ if net_service "${SVCNAME}" ; then
if is_runlevel_stop || ! is_net_up "${SVCNAME}" ; then
mydeps="net"
fi
@@ -220,6 +221,7 @@ svc_stop() {
service_stopped "${x}" && continue
wait_service "${x}"
if ! service_stopped "${x}" ; then
+ eerror "ERROR: cannot stop ${SVCNAME} as ${x} is still up."
retval=1
break
fi
@@ -227,10 +229,7 @@ svc_stop() {
IN_BACKGROUND="${ib_save}"
- if [[ ${retval} != "0" ]] ; then
- eerror "ERROR: problems stopping dependent services."
- eerror " ${SVCNAME} is still up."
- else
+ if [[ ${retval} == "0" ]] ; then
# Now that deps are stopped, stop our service
(
exit() {
@@ -292,7 +291,7 @@ svc_stop() {
}
svc_start() {
- local x= y= retval=0 startfail= startinactive=
+ local x= y= retval=0 startinactive=
# Do not try to start if i have done so already on runlevel change
if is_runlevel_start && service_failed "${SVCNAME}" ; then
@@ -337,7 +336,7 @@ svc_start() {
local netservices=
for x in $(dolisting "/etc/runlevels/${BOOTLEVEL}/net.*") \
$(dolisting "/etc/runlevels/${mylevel}/net.*") \
- $(dolisting "/etc/runlevels/coldplugged/net.*") ; do
+ $(dolisting "/var/lib/init.d/coldplugged/net.*") ; do
netservices="${netservices} ${x##*/}"
done
@@ -380,23 +379,20 @@ svc_start() {
|| ( net_service "${x}" && ineed -t "${SVCNAME}" net \
&& ! is_net_up ) ; then
if service_inactive "${x}" || service_wasinactive "${x}" || \
- [[ -n $(ls "${svcdir}"/scheduled/*/"${x}" 2>/dev/null) ]] ; then
+ [[ -n $(dolisting "${svcdir}"/scheduled/*/"${x}") ]] ; then
svc_schedule_start "${x}" "${SVCNAME}"
[[ -n ${startinactive} ]] && startinactive="${startinactive}, "
startinactive="${startinactive}${x}"
else
- startfail="${x}"
+ eerror "ERROR: cannot start ${SVCNAME} as ${x} could not start"
+ retval=1
break
fi
fi
fi
done
- if [[ -n ${startfail} ]] ; then
- eerror "ERROR: Problem starting needed service ${startfail}"
- eerror " ${SVCNAME} was not started."
- retval=1
- elif [[ -n ${startinactive} ]] ; then
+ if [[ -n ${startinactive} && ${retval} == "0" ]] ; then
# Change the last , to or for correct grammar.
x="${startinactive##*, }"
startinactive="${startinactive/%, ${x}/ or ${x}}"
@@ -598,7 +594,7 @@ for arg in $* ; do
svc_schedule_start "${SVCNAME}" "${x##*/}"
fi
done
- rm -f "${svcdir}/snapshot/$$"
+ rm -rf "${svcdir}/snapshot/$$"
else
rm -f "${svcdir}"/scheduled/*/"${SVCNAME}"
fi
diff --git a/src/awk/cachedepends.awk b/src/awk/cachedepends.awk
index 46945e9..0629069 100644
--- a/src/awk/cachedepends.awk
+++ b/src/awk/cachedepends.awk
@@ -1,6 +1,5 @@
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header$
function print_start() {
print "source /sbin/functions.sh" >> TMPCACHE
@@ -48,7 +47,7 @@ function print_header2(mtime) {
print "" >> TMPCACHE
print " [ -e /etc/conf.d/net ] && \\" >> TMPCACHE
print " [ \"${SVCNAME%%.*}\" = \"net\" ] && \\" >> TMPCACHE
- print " [ \"${SVCNAME##*.}\" != \"${SVCNAME}\" ] && source /etc/conf.d/net" >> TMPCACHE
+ print " [ \"${SVCNAME#*.}\" != \"${SVCNAME}\" ] && source /etc/conf.d/net" >> TMPCACHE
print "" >> TMPCACHE
print " [ -e \"/etc/conf.d/${SVCNAME}\" ] && source \"/etc/conf.d/${SVCNAME}\"" >> TMPCACHE
print "" >> TMPCACHE
@@ -63,6 +62,16 @@ function print_header2(mtime) {
function print_end() {
print "" >> TMPCACHE
print " depend" >> TMPCACHE
+
+ # Support user defined RC_NEED and RC_USE
+ print "" >> TMPCACHE
+ print " for x in ${RC_NEED} ; do" >> TMPCACHE
+ print " need \"${x}\"" >> TMPCACHE
+ print " done" >> TMPCACHE
+ print "" >> TMPCACHE
+ print " for x in ${RC_USE} ; do" >> TMPCACHE
+ print " use \"${x}\"" >> TMPCACHE
+ print " done" >> TMPCACHE
print ")" >> TMPCACHE
print "" >> TMPCACHE
}
diff --git a/src/awk/gendepends.awk b/src/awk/gendepends.awk
index d092ccb..82f1b54 100644
--- a/src/awk/gendepends.awk
+++ b/src/awk/gendepends.awk
@@ -1,6 +1,5 @@
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header$
# bool check_service(name)
#
diff --git a/src/runscript.c b/src/runscript.c
index 73e41a0..adb56cd 100644
--- a/src/runscript.c
+++ b/src/runscript.c
@@ -2,9 +2,8 @@
* runscript.c
* Handle launching of Gentoo init scripts.
*
- * Copyright 1999-2004 Gentoo Foundation
+ * Copyright 1999-2006 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header$
*/
#include <stdio.h>
@@ -41,9 +40,10 @@ static void (*selinux_run_init_new) (int argc, char **argv);
extern char **environ;
-void setup_selinux(int argc, char **argv) {
+void setup_selinux(int argc, char **argv)
+{
void *lib_handle = NULL;
-
+
lib_handle = dlopen(SELINUX_LIB, RTLD_NOW | RTLD_GLOBAL);
if (NULL != lib_handle) {
selinux_run_init_old = dlsym(lib_handle, "selinux_runscript");
@@ -62,7 +62,8 @@ void setup_selinux(int argc, char **argv) {
}
}
-char **get_whitelist(char **whitelist, char *filename) {
+char **get_whitelist(char **whitelist, char *filename)
+{
char *buf = NULL;
char *tmp_buf = NULL;
char *tmp_p = NULL;
@@ -70,7 +71,7 @@ char **get_whitelist(char **whitelist, char *filename) {
size_t lenght = 0;
int count = 0;
int current = 0;
-
+
if (-1 == file_map(filename, &buf, &lenght))
return NULL;
@@ -83,7 +84,7 @@ char **get_whitelist(char **whitelist, char *filename) {
goto error;
}
tmp_p = tmp_buf;
-
+
/* Strip leading spaces/tabs */
while ((tmp_p[0] == ' ') || (tmp_p[0] == '\t'))
tmp_p++;
@@ -102,7 +103,7 @@ char **get_whitelist(char **whitelist, char *filename) {
* to free below */
tmp_buf = NULL;
}
-
+
file_unmap(buf, lenght);
@@ -117,7 +118,8 @@ error:
return NULL;
}
-char **filter_environ(char *caller) {
+char **filter_environ(char *caller)
+{
char **myenv = NULL;
char **whitelist = NULL;
char *env_name = NULL;
@@ -136,20 +138,20 @@ char **filter_environ(char *caller) {
if (1 == is_file(USR_WHITELIST, 1))
whitelist = get_whitelist(whitelist, USR_WHITELIST);
-
+
if (NULL == whitelist)
/* If no whitelist is present, revert to old behaviour */
return environ;
-
+
if (1 != is_file(PROFILE_ENV, 1))
/* XXX: Maybe warn here? */
check_profile = 0;
-
+
STRING_LIST_FOR_EACH(whitelist, env_name, count) {
char *env_var = NULL;
char *tmp_p = NULL;
int env_len = 0;
-
+
env_var = getenv(env_name);
if (NULL != env_var)
goto add_entry;
@@ -157,7 +159,7 @@ char **filter_environ(char *caller) {
if (1 == check_profile) {
char *tmp_env_name = NULL;
int tmp_len = 0;
-
+
/* The entries in PROFILE_ENV is of the form:
* export VAR_NAME=value */
tmp_len = strlen(env_name) + strlen("export ") + 1;
@@ -167,7 +169,7 @@ char **filter_environ(char *caller) {
goto error;
}
snprintf(tmp_env_name, tmp_len, "export %s", env_name);
-
+
/* Clear errno so that subsequent calls do not trigger
* DBG_MSG */
errno = 0;
@@ -180,7 +182,7 @@ char **filter_environ(char *caller) {
}
continue;
-
+
add_entry:
env_len = strlen(env_name) + strlen(env_var) + 2;
tmp_p = calloc(env_len, sizeof(char *));
@@ -197,22 +199,23 @@ add_entry:
if (NULL == myenv)
/* If all else fails, just add a default PATH */
STRING_LIST_ADD(myenv, strdup(DEFAULT_PATH), error);
-
+
return myenv;
error:
STRING_LIST_FREE(myenv);
STRING_LIST_FREE(whitelist);
-
+
return NULL;
}
-int main(int argc, char *argv[]) {
+int main(int argc, char *argv[])
+{
char *myargs[32];
char **myenv = NULL;
char *caller = argv[1];
int new = 1;
-
+
/* Need to be /bin/bash, else BASH is invalid */
myargs[0] = "/bin/bash";
while (argv[new] != 0) {
@@ -222,7 +225,7 @@ int main(int argc, char *argv[]) {
myargs[new] = NULL;
/* Do not do help for /sbin/rc */
- if (argc < 3 && !IS_SBIN_RC()) {
+ if ((argc < 2) || (argc < 3 && !IS_SBIN_RC())) {
execv(RCSCRIPT_HELP, myargs);
exit(1);
}
diff --git a/tarball.sh b/tarball.sh
index cde0e0f..656697c 100755
--- a/tarball.sh
+++ b/tarball.sh
@@ -1,6 +1,6 @@
#!/bin/bash
export TMP="${TMP:-/tmp}"
-export V="1.12.1"
+export V="1.12.4"
export NAME="baselayout-vserver"
export DEST="${TMP}/${NAME}-${V}"
@@ -27,6 +27,10 @@ done
# do not yet package src/core stuff
#rm -rf ${DEST}/src/core
+# Make clean
+(cd ${DEST}/src; make clean)
+(cd ${DEST}/src/core; make clean)
+
# copy net-scripts and remove older stuff
install -d -m0755 ${DEST}/lib/rcscripts
cp -ax net-scripts/init.d ${DEST}