Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
No longer relevant these days of 3.X linux.
Signed-off-by: maximilian attems <max@stro.at>
|
|
Removed unused local variable from vsscanf().
Signed-off-by: Greg Thelen <gthelen@google.com>
"POSIX is quite explicit that the unsigned
formats still accept signed input, and since klibc requires that signed
and unsigned integer types are the same the only reason to track it
would be to handle numeric overflow." -hpa
Acked-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Check the poll() return value for error before inspecting its output.
Signed-off-by: Greg Thelen <gthelen@google.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
When building klibc 1.5.25 against linux/master (ie. post 3.1) I'm seeing:
klibc/generated/include/linux/if_packet.h:176: error: expected
specifier-qualifier-list before '__aligned_u64'
which seems to come from upstream commits:
0d4691ce112be025019999df5f2a5e00c03f03c2 remotes/linux/master~90^2~408 (origin)
96c131842aab45b5d139d0bcb417796819f5ee92 remotes/linux/master~90^2~169
(change from aligned_u64 to __aligned_u64)
and collides with klibc/usr/include/sys/types.h
/* Keeps linux/types.h from getting included elsewhere */
#define _LINUX_TYPES_H
not defining __aligned_u64 like the kernel's include/linux/types.h does.
Signed-off-by: maximilian attems <max@stro.at>
|
|
Warnings found via gcc -Wmissing-prototypes.
Signed-off-by: Trevor Keith <tsrk@tsrk.net>
Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
[ ported 4356f4890792a678936c93c9196e8f7742e04535 to klibc
+ minor whitespaces ]
Signed-off-by: maximilian attems <max@stro.at>
|
|
Usage seen in util-linux. Defined according to POSIX:2001 min.
Signed-off-by: maximilian attems <max@stro.at>
|
|
|
|
SUSv3 is silent on that definition, but seen several userspace
software that expects flock to be defined in that file and
complain that it is missing in klibc. Current declaration is in
unistd.h.
Signed-off-by: maximilian attems <max@stro.at>
|
|
Noticed by current cppcheck, all other stdio code is clean.
Signed-off-by: maximilian attems <max@stro.at>
|
|
Function is around since longer.
Signed-off-by: maximilian attems <max@stro.at>
|
|
module-init-tools uses it.
Trivial as klibc has no threading.
Signed-off-by: maximilian attems <max@stro.at>
|
|
Function was around since longer.
Seen while trying to configure against lvm2.
Signed-off-by: maximilian attems <max@stro.at>
|
|
The stdio branch merge warrants major version bump.
|
|
Thanks to the stdio branch merge the error indicator of the stream
can be tested against.
Signed-off-by: maximilian attems <max@stro.at>
|
|
Initial implementation.
Signed-off-by: maximilian attems <max@stro.at>
|
|
__create_file is no longer around.
They are no longer referenced in Kbuild and thus not built.
Signed-off-by: maximilian attems <max@stro.at>
|
|
Fix up minor conflicts in:
usr/include/stdio.h
usr/klibc/Kbuild
|
|
It is used by util-linux mount code:
mount.c:1004:30: error: ‘MNTTYPE_SWAP’ undeclared (first use in this function)
..
Signed-off-by: maximilian attems <max@stro.at>
|
|
Add sys/types.h include to fix:
/usr/lib/klibc/include/sched.h:20:40: error: expected ‘)’ before ‘int’
/usr/lib/klibc/include/sched.h:21:39: error: expected ‘)’ before ‘unsigned’
/usr/lib/klibc/include/sched.h:22:39: error: expected ‘)’ before ‘unsigned’
/usr/lib/klibc/include/sched.h:35:1: error: unknown type name ‘pid_t’
Signed-off-by: maximilian attems <max@stro.at>
|
|
The linux code likes to name it SCHED_NORMAL, userland knows
it under SCHED_OTHER. Use later definition as specified in
POSIX:2001.
Signed-off-by: maximilian attems <max@stro.at>
|
|
Noticed while compiling some util-linux stuff:
gen_uuid.c:507:21: warning: passing argument 2 of 'connect' discards 'const' qualifier from pointer target type [enabled by default]
/usr/lib/klibc/include/sys/socket.h:248:14: note: expected 'struct sockaddr *' but argument is of type 'const struct sockaddr *'
Signed-off-by: maximilian attems <max@stro.at>
|
|
|
|
This patch adds the ability to kinit to allow the dropping of POSIX
capabilities.
kinit is modified by this change, such that it understands the new
kernel command line "drop_capabilities=" that specifies a comma
separated list of capability names that should be dropped before
switching over to the next init in the boot strap (typically on the root
disk).
Dropping of capabilities happens in three parts. We explicitly drop the
capability from init's inherited masks. We also drop the capability
from the bounding set using PR_CAPBSET_DROP so that later setuid execs
are bounded. Lastly, we drop the capabilities from the bset and
inherited masks exposed at /proc/sys/kernel/usermodehelper if available
(introduced in Linux v3.0.0).
In all paths, we treat errors as fatal, as we do not want to continue to
boot if there was a problem dropping capabilities. We fail because the
new drop_capabilities= option on the command line mandates enforcement
of a security policy, and we should err on the side of caution if we
ever fail to satisfy the administrator's intention.
Signed-off-by: Mike Waychison <mikew@google.com>
Reviewed-by: "Andrew G. Morgan" <agm@google.com>
Reviewed-by: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Fix naming.
Signed-off-by: maximilian attems <max@stro.at>
|
|
Uncovered a bug in avr32 signal handling,
might come handy in testing other archs signal.
Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: maximilian attems <max@stro.at>
|
|
The defines of SIOCGIFCONF and SIOCSIFFLAGS are well
hidden in linux-2.6 under #ifdef __KERNEL__ sections
for example in linux/socket.h
Fixes these in kexec-tools against klibc:
| kexec/ifdown.c:46:16: error: 'SIOCGIFCONF' undeclared (first use in
this function)
| kexec/ifdown.c:46:16: note: each undeclared identifier is reported
only once for each function it appears in
| kexec/ifdown.c:65:18: error: 'SIOCSIFFLAGS' undeclared (first use in
this function)
Reported-by: Andrea Adami <andrea.adami@gmail.com>
Suggested-by: KUMAAN <9maaan@gmail.com>
Cc: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: maximilian attems <max@stro.at>
|
|
The XXX is right, it was wrong. :D
Keep the XXX, as I'm unsure about the proper newfstatat() semantics.
Signed-off-by: maximilian attems <max@stro.at>
|
|
Just various small coding style fixes.
Size shows that kinit didn't change as expected.
Signed-off-by: maximilian attems <max@stro.at>
|
|
Later versions of gcc include an option in the form of --param=name=value.
This patch adds support for this.
Signed-off-by: Mike Pagano <mpagano@gentoo.org>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Make check_for_modules() more readable, just allways call
continue on NULL return. That way the possible null dereference
in strlen is no longer possible.
This doesn't yet make it unsuck, but is a small step.
Seen fixed too in blkid there with patch adding ko.gz support.
Cc: Karel Zak <kzak@redhat.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Add support for alphasort() as defined in POSIX.1-2008.
Signed-off-by: Mike Waychison <mikew@google.com>
Reviewed-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Add support for scandir() as defined in POSIX.1-2008.
Signed-off-by: Mike Waychison <mikew@google.com>
Reviewed-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
It breaks macros.
Acked-by: Mike Waychison <mikew@google.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
udev asks for SOCK_CLOEXEC and SOCK_NONBLOCK.
Signed-off-by: maximilian attems <max@stro.at>
|
|
Add the capset and capget system calls to klibc so that userland can
invoke them.
Signed-off-by: Mike Waychison <mikew@google.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
|
|
With some hacks kexec-tools can compile against klibc.
On the klibc side only this addition is missing.
The patch has been carried in OpenEmbedded klibc for some time.
Signed-off-by: Thomas Kunze <thommycheck@gmx.de>
Signed-off-by: Yuri Bushmelev <jay4mail@gmail.com>
Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Found by autotools while configuring util-linux with
./configure --without-ncurses CC=klcc
against klibc-1.5.23 version. It would complain:
configure: WARNING: net/if.h: present but cannot be compiled
configure: WARNING: net/if.h: check for missing prerequisite headers?
configure: WARNING: sys/un.h: present but cannot be compiled
configure: WARNING: sys/un.h: check for missing prerequisite headers?
This where the only two and it both cases sa_family_t def seemed
missing.
Reviewed-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
This patch fixes a parallel make install error.
Signed-off-by: Tim Harder <radhermit@gentoo.org>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Signed-off-by: maximilian attems <max@stro.at>
|
|
unlinkat(2) features a third arg with a flag,
allowing to a nuke a dir with it, fix it.
Signed-off-by: maximilian attems <max@stro.at>
|
|
The variable is not used in our gzip copy.
In the gzip code it is used to strip of .exe of progname,
which makes no sense in a unixish environment.
Cleans up build with recent gcc 4.6 of:
usr/gzip/gzip.c: In function ‘main’:
usr/gzip/gzip.c:231:9: warning: variable ‘proglen’ set but not used [-Wunused-but-set-variable]
Signed-off-by: maximilian attems <max@stro.at>
|
|
fix:
ERROR: do not use assignment in if condition
..
WARNING: line over 80 characters
..
WARNING: labels should not be indented
..
ERROR: space required after that ',' (ctx:VxV)
..
Signed-off-by: maximilian attems <max@stro.at>
|
|
fix:
ERROR: "foo * bar" should be "foo *bar"
ERROR: do not use assignment in if condition
..
ERROR: space required before that '!' (ctx:VxW)
ERROR: space prohibited after that '!' (ctx:VxW)
WARNING: suspect code indent for conditional statements (16, 18)
WARNING: braces {} are not necessary for single statement blocks
..
WARNING: braces {} are not necessary for any arm of this statement
..
WARNING: labels should not be indented
..
Signed-off-by: maximilian attems <max@stro.at>
|
|
ERROR: do not use assignment in if condition
..
WARNING: line over 80 characters
ERROR: space prohibited after that '-' (ctx:WxW)
Signed-off-by: maximilian attems <max@stro.at>
|
|
fix for better codingstyle:
ERROR: "foo * bar" should be "foo *bar"
..
ERROR: switch and case should be at the same indent
WARNING: braces {} are not necessary for single statement blocks
WARNING: labels should not be indented
..
WARNING: braces {} are not necessary for any arm of this statement
..
ERROR: do not use assignment in if condition
ERROR: space prohibited after that '&' (ctx:WxW)
Signed-off-by: maximilian attems <max@stro.at>
|
|
fix:
WARNING: braces {} are not necessary for single statement blocks
ERROR: do not use assignment in if condition
WARNING: braces {} are not necessary for any arm of this statement
WARNING: static char array declaration should probably be static const char
Signed-off-by: maximilian attems <max@stro.at>
|
|
fix several of these:
WARNING: line over 80 characters
..
ERROR: do not use assignment in if condition
..
ERROR: else should follow close brace '}'
..
ERROR: switch and case should be at the same indent
ERROR: trailing statements should be on next line
..
ERROR: space required after that ',' (ctx:VxV)
..
ERROR: code indent should use tabs where possible
..
Signed-off-by: maximilian attems <max@stro.at>
|
|
fix:
WARNING: space prohibited between function name and open parenthesis '('
Signed-off-by: maximilian attems <max@stro.at>
|
|
fixes:
WARNING: braces {} are not necessary for single statement blocks
Signed-off-by: maximilian attems <max@stro.at>
|
|
fixes:
ERROR: trailing statements should be on next line
Signed-off-by: maximilian attems <max@stro.at>
|
|
klibcs ipconfig tries to guess the nameserver if no nameserver is
provided. This may happen due to misconfigured dhcp or the use of
the ip= parameter.
This patch removes the guessing from ipconfig as it is not possible for
any other script to determine if the provided nameserver is valid or
a guessed one. If the old behavior is really needed this could be easily
implemented in an external script.
Analysis shows that ip_nameserver is unused outside of ipconfig,
nor any sign of gethostbyname() or such. mount.c doesn't do dns resolving,
so I'd guess your patch is a welcome fix. I haven't seen this guessing in
linux >= 2.0.
Closes: #594638
Signed-off-by: Ulrich Dangel <uli@spamt.net>
Reviewed-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Signed-off-by: maximilian attems <max@stro.at>
|
|
ported to klibc losetup version from util-linux
108591d2b7860ca0b8d27d114bed1e504a31fa72,
also add -h option. -maks
Reported-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Useless ifdeffery seen on previous cleanup.
Signed-off-by: maximilian attems <max@stro.at>
|
|
No point of using it on a unixish OS.
Signed-off-by: maximilian attems <max@stro.at>
|
|
Add the sched_getaffinity and sched_setaffinity system calls.
Google-Bug-Id: 4725830
Signed-off-by: Mike Waychison <mikew@google.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
fix:
usr/kinit/ipconfig/main.c: In function ‘ipconfig_main’:
usr/kinit/ipconfig/main.c:350:7: warning: ‘ret’ may be used uninitialized in this function [-Wuninitialized]
usr/kinit/ipconfig/main.c:346:6: note: ‘ret’ was declared here
I think the initialisation change in 6df362216a2e5beb4f29feafeabc630034a76914
was unintentional.
Acked-by: Ulrich Dangel <uli@spamt.net>
Signed-off-by: maximilian attems <max@stro.at>
|
|
The allocated string may be shorter than the requested length. Always
use the shortest length to write the terminating zero
Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
Reviewed-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
The use of strlen to get the length of the source string can lead to
undetermined memory access if the source string is not finished with a
zero. Use strnlen to prevent this.
Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
Reviewed-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
|
|
Directly return NULL if malloc failed.
Reviewed-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
mv is needed these days in initramfs.
One needs to move all the data of initramfs /run to the real rootfs.
This minimal mv utiliy originates from the existing ln.
Signed-off-by: maximilian attems <max@stro.at>
|
|
Missing unwrap on error path..
Signed-off-by: maximilian attems <max@stro.at>
|
|
Fix existing definitions according POSIX spec.
Noticed while compiling latest kexecboot against klibc:
util.c:237:34: error: ‘ULLONG_MAX’ undeclared (first use in this function)
Reviewed-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
add latest config.h.
Also update sync README with newer git features.
Signed-off-by: maximilian attems <max@stro.at>
|
|
On Sun, Nov 07, 2010 at 02:21:21AM +0000, Jonathan Nieder wrote:
>
> Just ran into some strange behavior:
>
> $ cat test.sh
> #!/bin/sh
> echo hello >greeting
> cat <<EOF &&
> $(cat greeting)
> EOF
> {
> echo $?
> cat greeting
> } >/dev/null
>
>
> $ sh test.sh
> hello
> test.sh: 7: {: not found
> 127
> hello
> test.sh: 10: Syntax error: "}" unexpected
>
> bash, mksh, pdksh, and ksh93 all print hello as expected. The problem
> is reproducible with all versions of dash in the git repo.
This is caused by the clobbering of checkkwd due to readtoken
recursion while parsing a here document.
This patch fixes it by saving the original value of checkkwd.
Reported-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
When tracing (with the DEBUG compile-time option set to 1 or 2),
exverror calls TRACEV to print its arguments before passing them on.
So the arguments are consumed by the time exvwarning looks for them,
resulting in a segfault:
$ sh -c '"'
sh: Syntax error: Unterminated quoted string
$ sh -o debug -c '"'
sh: Segmentation fault (core dumped)
Make a copy with va_copy to avoid this.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Here's another bug bisecting to f42e443bb ([EXPAND] Fix
ifsfirst/ifslastp leak, 2010-09-08). It was found with the following
test case, based on the configure script for Tracker:
dash -x -c '
<<-_ACEOF
$@
_ACEOF
exec
' - abcdefgh
+
+ exec �a
exec: 1: : Permission denied
The missing ifsfree call is in expandarg when it returns to openhere
during here document expansion.
Reported-by: Aurelien Jarno <aurel32@debian.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
This patch improves LINENO support by storing line numbers in the parse
tree, for commands as well as for function definitions. It makes LINENO
behaves properly when calling functions, and has the added benefit of
improved line numbers in error messages when the last-parsed command is
not the last-executed one. It removes the earlier LINENO support, and
instead sets LINENO from evaltree when a command is executed
Signed-off-by: Harald van Dijk <harald@gigawatt.nl>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
first command
It is not unrelated: I changed the meaning of struct funcnode's field n
to refer to the function definition, rather than the list of the
function's commands, because I needed to refer to the function
definition node from evalfun, which only gets passed a funcnode. But it
is something that could be applied independently (without being useful
by itself), so I've attached it as a separate patch for easier review.
Signed-off-by: Harald van Dijk <harald@gigawatt.nl>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
- Solaris lacks paths.h and the various _PATH_* #defines.
Check for them in configure.ac and fall back on the
usual suspects when they are missing.
- Older Solaris lacks isblank(), and versions that have it
use a macro. Check for the declaration in configure.ac
and fall back on a naive version when missing.
- Older Solaris does not support %jd (intmax_t) in format
strings, but it does support the PRIdMAX macro from inttypes.h.
Do a configure check for PRIdMAX and use it in the code.
If it doesn't exist, define it to "lld" when sizeof(long long)
equals sizeof(intmax_t) as this is more likely to work on
older systems. Otherwise, use "jd" and hope for the best.
- Older Solaris lacks stdint.h, but inttypes.h provides the
same types and works on all platforms I've tried dash on,
so just use it instead.
- Older Solaris doesn't like it when vsnprintf() is passed
a NULL buffer (in violation of the POSIX spec, of course).
Pass a 1-byte dummy buffer instead.
- Solaris lacks tempfile and mktemp programs. Fall back on a
"good-enough" custom function in mkbuiltins.
Signed-off-by: Brian Koropoff <bkoropoff@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
[ minor merge fixup -maks ]
Signed-off-by: maximilian attems <max@stro.at>
|
|
The new read(1) implementation incorrectly assumes that ifsbreakup
ignores characters escaped by CTLESC. As such it fails to handle
backslashes except for escaping newlines.
This patch makes it use recordregion for every part that isn't
escaped by a backslash.
Reported-by: Jilles Tjoelker <jilles@stack.nl>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
[ merge fixups -maks ]
Signed-off-by: maximilian attems <max@stro.at>
|
|
Tim Allen wrote:
> The POSIX specification for the dot command[1] states:
>
> EXIT STATUS
> Returns the value of the last command executed, or a zero exit
> status if no command is executed.
>
> If an empty file is sourced, then "no command is executed"
I agree. Looking through "git log --patch src/main.c", though, I find
v0.5.3~42 (Do not clobber exit status in dotcmd., 2005-03-03), which
appears to have been meant to take care of the following case:
$ cat printstatus.sh
echo $?
$ false
$ . ./printstatus.sh
1
I wonder if the following on top might help (imitating evalcmd)?
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
The changeset 55c46b7286f5d9f2d8291158203e2b61d2494420
[BUILTIN] Honor tab as IFS whitespace when splitting fields in readcmd
uses CTLESC to prevent field splitting in read(1). However,
it did not escape CTLESC itself in the input stream. This patch
adds the necessary CTLESC characters so that CTLESC isn't corrupted.
Reported-by: Alexey Gladkov <gladkov.alexey@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
- AIX lacks a WCOREDUMP macro. It's just used to
append "(core dumped)" to the crash message, so
#ifdef around it.
- For some reason, the nl program on AIX defaults
to not printing line numbers ("-b n"), even though
the spec says it should default to "-b t".
Explicitly pass "-b a" for good measure in mkbuiltins.
Signed-off-by: Brian Koropoff <bkoropoff@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
A tilde expansion generates a valid pathname. Splitting it using IFS
either leaves it unchanged or changes it to something unintended.
This fixes FreeBSD sh test expansion/tilde1.0 and does not change the
outcome of the other tests.
This fixes Debian bug #601096.
Example:
IFS=m HOME=/tmp; printf "%s\n" ~
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
version
Replace noclobberopen() from bash with the FreeBSD code for noclobber
opens.
This also reduces code size by eliminating an unnecessary check.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
On Sun, Nov 07, 2010 at 04:04:20PM -0600, Jonathan Nieder wrote:
>
> Herbert Xu wrote:
>
> > commit f42e443bb511ed3224f09b4fcf0772438ebdbbfa
> > Author: Herbert Xu <herbert@gondor.apana.org.au>
> > Date: Wed Sep 8 20:07:26 2010 +0800
> >
> > [EXPAND] Fix ifsfirst/ifslastp leak
>
> Another puzzle bisecting to f42e443bb. This one comes from the
> grub-mkconfig script:
>
> $ sh -c 'datadir=/usr/share; pkgdatadir=${datadir}/`cat`' 2>&1 | cat -A
> cat: M-^\^M^F^HM-4^M^F^HM-(^M^F^H: No such file or directory$
> cat: M-(^M^F^H: No such file or directory$
>
> Still reproducible with 016b529. I'll try to find time to look into
> it, but thought you might like to know nevertheless.
This is the symptom of another leak. In this case evalbackcmd
occurs in the middle of an expansion (as it should) but the forked
child never clears the previous IFS state.
This patch adds the missing ifsfree call.
This wasn't as much of a problem as the previously discovered leaks
since all it means is that the child gets to carry around the parent's
expansion state and the child is usually short-lived.
Reported-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
trap.c: In function 'exitshell':
trap.c:354: warning: variable 'status' might be clobbered by 'longjmp' or 'vfork'
Signed-off-by: Maciej Żenczykowski <zenczykowski@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
At some point between ash 0.3.5-11.0.1 and ash 0.3.8-37, Debian
ash stopped using the EXSHELLPROC exception to handle shell
scripts without a magic number.
Remove all remaining references to it to avoid confusion.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
The intended semantics of EXEXEC are identical to EXEXIT, so
simplify by using EXEXIT directly.
Functional change: in edge cases (exec within a trap handler),
this causes the exit status from exec not to be clobbered.
For example, without this patch:
$ sh -c 'trap "exec nonexistent" EXIT'; echo $?
exec: 1: nonexistent: not found
0
And with it:
$ sh -c 'trap "exec nonexistent" EXIT'; echo $?
exec: 1: nonexistent: not found
127
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
exist
This commit makes dash exit with return code 127 instead of 2 if
started as non-interactive shell with a non-existent command_file
specified as argument (or a directory), as documented in
http://www.opengroup.org/onlinepubs/009695399/utilities/sh.html#tag_04_128_14
The wrong exit code was reported by Clint Adams and Jari Aalto through
http://bugs.debian.org/548743
http://bugs.debian.org/548687
Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
status
Some errors have exit status values specified by POSIX and it is
therefore desirable to be able to set the exit status at the EXERROR
source rather than in main.c.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
On Wed, Aug 11, 2010 at 08:06:16AM +0000, Guido Berhoerster wrote:
>
> with the latest git version of dash trap actions are not
> evaluated in the context of a function.
>
> The following script demonstrates the bug:
> ----8<----
> read_timeout () {
> saved_traps="$(trap)"
> trap 'printf "timed out\n"; eval "${saved_traps}"; return' TERM
> ( sleep $1; kill -TERM $$ ) >/dev/null 2>&1 &
> timer_pid=$!
> read $2
> kill $timer_pid 2>/dev/null
> }
>
> read_timeout 5 value
> printf "read \"%s\"\n" "${value:=default}"
>
> ---->8----
> The return statement in the trap inside the read_timeout function
> does not return from the function but rather exits the script.
>
> With dash 0.5.5.1 it works as expected.
This bug was caused by the SKIPEVAL removal. When the SKIPEVAL
hack was added to improve set -e support in traps, dotrap was
changed to return whether set -e was detected. After the removal
of SKIPEVAL, set -e is now handled through exraise.
However, dotrap still returned a value which is now incorrectly
used to trigger an exraise.
This patch removes the vestigial link between dotrap and exraise.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
The commit f42e443bb511ed3224f09b4fcf0772438ebdbbfa
[EXPAND] Fix ifsfirst/ifslastp leak
revealed yet another ifsfirst/ifslastp leak in casematch.
Previously it was hidden because ifsfirst/ifslastp was cleared
unconditionally on entry (which caused the leakage of those
entries).
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
evalcommand always clobbers the exit status in case of an EXEXEC
which means that exec always fails with exit status 2 regardless
of what it actually returns.
This patch adds the missing check for EXEXEC so that the correct
exit status is preserved.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
The new read(1) code fails to handle the last variable correctly if
it happens to be terminated by IFS characters. Those characters
are included in the last variable but they should not be.
This patch fixes this.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
As it stands expandarg may return with a non-NULL ifslastp which
then confuses any subsequent ifsbreakup user that doesn't clear
it directly.
What's worse, if we get interrupted before we hit ifsfree in
expandarg we will leak memory.
This patch fixes this by always calling ifsfree in expandarg
thus ensuring that ifslastp is always NULL on the normal path.
It also adds an ifsfree call to the RESET path to ensure that
memory isn't leaked.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
No point in tracing a no longer undeclared "ps->cmd", fixes:
jobs.c: In function \u2018commandtext\u2019:
jobs.c:1192: error: \u2018ps\u2019 undeclared (first use in this function)
jobs.c:1192: error: (Each undeclared identifier is reported only once
jobs.c:1192: error: for each function it appears in.)
Signed-off-by: maximilian attems <max@stro.at>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Git commit 0df96793ef6aa103df228d7dfe56099b7d721a15 "[SHELL] Add
preliminary LINENO support" added the LINENO variable in the middle of
other initialized variables, causing some macros for TERM and HISTSIZE
to break (both of these are only used if libedit support is compiled in,
which is not the case by default).
The breakage is the same as can be seen by setting HISTSIZE=0.
Also add a comment warning about this.
Reported-by: Wez Furlong <kingwez@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Example:
$ dash -c 'set -e; (false); echo here'
here
With this commit, dash exits 1 before echo.
The bug was reported by Stefan Fritsch through
http://bugs.debian.org/514863
Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
The notyet code is identical to the current code.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Brian Koropoff reported that the new var patches broke the following
script:
#!/bin/dash
GDM_LANG="bar"
OPTION="foo"
unset GDM_LANG
# OPTION has mysteriously become unset
echo "$OPTION"
He correctly diagnosed this as a result of removing all variables
in the hash chain preceding the one that should be removed in
setvareq.
He also provided a patch to fix this.
This patch is based on his but without keeping the original vpp.
As a result, we now store new variables at the end of the hash
chain instead of the beginning.
To make this work, setvareq/setvar now returns the vp pointer
modified. In case they're used to unset a variable the pointer
returned is undefined. This is because mklocal needs it and
used to get it by assuming that the new variable always appear
at the beginning of the chain.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
According to
http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_12
"A subshell environment shall be created as a duplicate of the shell
environment, except that signal traps set by that shell environment
shall be set to the default values."
Currently the eflag is cleared when forking a subshell, e.g.
$ dash -c 'set -e ; z=$(false;echo foo) ; echo $z'
foo
With this commit the eflag is preserved for subshells, and dash exits 1
before echo.
The problem was reported by Vincent Lefevre through
http://bugs.debian.org/514863
Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
signals
The recent introduction of SIGCHLD trapping broke read(1) as
each SIGCHLD may cause read(1) to return prematurely. Now if
we did have a trap for SIGCHLD read(1) should actually do this.
However, returning when SIGCHLD isn't trapped is wrong.
This patch fixes this by checking for EINTR and pendingsigs in
read(1).
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
[ merge fixups -maks ]
Signed-off-by: maximilian attems <max@stro.at>
|
|
jobs
The sigsuspend patch broke wait by making it return after just
one job has completed. This is because we rely on pendingsigs
to signal work and never clear it until waitcmd finishes.
This patch adds a separate gotsigchld for this purpose so we
can clear it before we start waiting.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
[ fixup trap.c merge -maks ]
Signed-off-by: maximilian attems <max@stro.at>
|
|
In other ash variants, a partial implementation of ksh-like cmd >file*
adds and removes CTLESC bytes ('\x81') in redirection filenames,
preserving 8-bit transparency. Long ago, dash removed the code to add
the CTLESC bytes, but not the code to remove them, causing corruption of
filenames containing CTLESC. This commit removes the code to remove the
CTLESC bytes.
The CTLESC byte occurs frequently in UTF-8 encoded non-Latin text.
This bug has been reported various times to Ubuntu and Debian (e.g.
Launchpad Ubuntu #422298). This patch is the same as the one submitted
by Alexander Korolkov in Ubuntu #422298.
Signed-off-by: Jilles Tjoelker <jilles@stack.nl>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
In some cases the shell executes a subshell or an external command in
the current process. This is not done if a trap on EXIT has been set, so
that that trap can execute after the subshell or external command has
finished. Extend that check to all traps. (A trap is "set" if a
non-empty command string has been attached to it.)
Improve encapsulation by exporting an accessor function for this and
making the trap array static again.
This is much like FreeBSD SVN r194127, enhanced to apply to subshells
also (see FreeBSD SVN r194774).
Example:
dash -c '{ trap "echo moo" TERM; sleep 3; }& sleep 1; kill $!;wait'
This should print "moo" after 3 seconds.
Example:
dash -c '{ trap "echo moo" TERM; (sleep 3) }& sleep 1; kill $!;wait'
The same.
Example:
dash -c '{ trap "echo moo" TERM; sleep 3; :; }& sleep 1; kill $!;wait'
This works correctly even without this patch.
Signed-off-by: Jilles Tjoelker <jilles@stack.nl>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
[ trivial trap.h merge fixup -maks ]
Signed-off-by: maximilian attems <max@stro.at>
|
|
Just like the poplocalvar problem recently fixed, redirections
can also be leaked in case of an abnormal exit. This patch fixes
it using the same method as poplocalvar, by storing the previous
redirection state and restoring to that point.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
The null redirect checks were added as an optimisation to avoid
unnecessary memory allocations. However, we could avoid this
completely by simply making the caller avoid making a redirection
unless it is not null.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
The recent cmdenviron removal broke regular utilities by calling
poplocalvars too early. This patch fixes that by postponing the
poplocalvars for regular utilities until they have completed.
In order to ensure that local still works, it is now a special
built-in.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
The new localvar code broke the abnormal exit from functions
and built-ins by not restoring the original localvar state.
This patch fixes this by storing the previous localvar state so
that we always unwind correctly in case of an abnormal exit.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
This patch replaces the cmdenviron mechanism for temporary command
variables with the localvars mechanism used by functions.
This reduces code size, and more importantly, makes the variable
assignment take effect immediately as required by POSIX.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
This patch moves the unsetvar code into setvareq so that we can
no have a pathological case of an unset variable hanging around
unless it has a bit pinning it like VEXPORT.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
When a variable is marked as local, we set VSTRFIXED on its vp
recored. However, poplocalvar never clears this flag for variables
that were unset to begin with. Thus if you ever made an unset
variable local, it would get the VSTRFIXED bit and stick around
forever.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
This patch adds localvars nesting infrastructure so we can reuse
the localvars mechanism for command evaluation.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
parse_command_args() returning a **argv pointer with *argv == 0 makes
dash segfault in find_command(). To reproduce run
dash -c 'command --'
With this commit, parse_command_args() returns 0 if *argv is null after
parsing --, and so fixes the subsequent segfault.
Reported by Jonny through http://bugs.debian.org/579543
Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Landed in Ubuntu klibc version 1.5.20-1ubuntu3.
Signed-off-by: maximilian attems <max@stro.at>
|
|
This allows building klibc for the new upcoming Debian port armhf.
It uses -mfloat-abi=hard by default
This was already asked for by Ubuntu arm porter Loïc Minier.
Cc: Loïc Minier <lool@dooz.org>
Signed-off-by: maximilian attems <max@stro.at>
|
|
|
|
Since bd56c54ae409a2c36d23e61d4075e2d1ffcd1a23 aka klibc 1.4.1
the usage of that macro is gone, so just get rid of it.
Signed-off-by: maximilian attems <max@stro.at>
|
|
Use klibc way to define a system dependent preprocessor
definition: disabled by default and enabled for newer arm.
Based on a patch by vorlon that got tested on his beagleboard,
should be functional equivalent. Tested on an arm Debian porter box
for the _KLIBC_ARM_USE_BX == 0 case.
Fixes: https://bugs.launchpad.net/ubuntu/+source/klibc/+bug/527720
Cc: Steve Langasek <steve.langasek@canonical.com>
Cc: Kirill A. Shutemov <kirill@shutemov.name>
Cc: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Dave Martin <dave.martin@linaro.org>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Document it's logic for the reader.
Signed-off-by: maximilian attems <max@stro.at>
|
|
DHCP options like domain-name or hostname are written to
/tmp/net-$DEVICE.conf which is typically later used by other scripts to
determine the network configuration. This is done by sourcing the
/tmp/net-$DEVICE.conf file to get all defined variables.
This patch escapes the DHCP options written to /tmp/net-$DEVICE.conf
to prevent arbitrary code execution.
Signed-off-by: Ulrich Dangel <uli@spamt.net>
Reviewed-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
klibc fails to build with recent binutils as "as" became stricter:
http://sourceware.org/bugzilla/show_bug.cgi?id=12519
binutils 20110225 and later would break klibc's builds as follows:
TYPE unsigned int: size 4, sign 0
TYPE unsigned long: size 4, sign 0
TYPE void *: size 4, sign 0
gcc -Wp,-MD,usr/klibc/syscalls/._exit.o.d -D__ASSEMBLY__ -nostdinc -iwithprefix include -I/build/buildd/klibc-1.5.20/usr/include/arch/arm -Iusr/include/arch/arm -I/build/buildd/klibc-1.5.20/usr/include/bits32 -Iusr/include/bits32 -I/build/buildd/klibc-1.5.20/usr/klibc/../include -Iusr/klibc/../include -I/build/buildd/klibc-1.5.20/usr/include -Iusr/include -I/build/buildd/klibc-1.5.20/linux/include -Ilinux/include -I/build/buildd/klibc-1.5.20/linux/arch/arm/include -Ilinux/arch/arm/include -D__KLIBC__=1 -D__KLIBC_MINOR__=5 -D_BITSIZE=32 -fno-stack-protector -fwrapv -fno-exceptions -mabi=aapcs-linux -mno-thumb-interwork -Os -march=armv4 -mtune=strongarm -W -Wall -Wno-sign-compare -Wno-unused-parameter -D__ASSEMBLY__ -nostdinc -iwithprefix include -I/build/buildd/klibc-1.5.20/usr/include/arch/arm -Iusr/include/arch/arm -I/build/buildd/klibc-1.5.20/usr/include/bits32 -Iusr/include/bits32 -I/build/buildd/klibc-1.5.20/usr/klibc/../include -Iusr/klibc/../include -I/build/buildd/klibc-1.5.20/usr/include -Iusr/include -I/build/buildd/klibc-1.5.20/linux/include -Ilinux/include -I/build/buildd/klibc-1.5.20/linux/arch/arm/include -Ilinux/arch/arm/include -D__KLIBC__=1 -D__KLIBC_MINOR__=5 -D_BITSIZE=32 -fno-stack-protector -fwrapv -fno-exceptions -mabi=aapcs-linux -mno-thumb-interwork -Os -march=armv4 -mtune=strongarm -W -Wall -Wno-sign-compare -Wno-unused-parameter -D__ASSEMBLY__ -nostdinc -iwithprefix include -I/build/buildd/klibc-1.5.20/usr/include/arch/arm -Iusr/include/arch/arm -I/build/buildd/klibc-1.5.20/usr/include/bits32 -Iusr/include/bits32 -I/build/buildd/klibc-1.5.20/usr/klibc/../include -Iusr/klibc/../include -I/build/buildd/klibc-1.5.20/usr/include -Iusr/include -I/build/buildd/klibc-1.5.20/linux/include -Ilinux/include -I/build/buildd/klibc-1.5.20/linux/arch/arm/include -Ilinux/arch/arm/include -D__KLIBC__=1 -D__KLIBC_MINOR__=5 -D_BITSIZE=32 -fno-stack-protector -fwrapv -fno-exceptions -mabi=aapcs-linux -mno-thumb-interwork -Os -march=armv4 -mtune=strongarm -W -Wall -Wno-sign-compare -Wno-unused-parameter -c -o usr/klibc/syscalls/_exit.o usr/klibc/syscalls/_exit.S
usr/klibc/syscalls/_exit.S:1:0: warning: target CPU does not support THUMB instructions
usr/klibc/syscalls/_exit.S: Assembler messages:
usr/klibc/syscalls/_exit.S:29: Error: .size expression does not evaluate to a constant
make[5]: *** [usr/klibc/syscalls/_exit.o] Error 1
sample Ubuntu build log:
http://launchpadlibrarian.net/66527153/buildlog_ubuntu-natty-armel.klibc_1.5.20-1ubuntu3_FAILEDTOBUILD.txt.gz
I've fixed this in Ubuntu with the attached patch, but didn't find
where to upstream it; since you're a klibc upstream developer and since
it probably already affects Debian, I figured it was probably best to
send it here :-)
Fixes http://bugs.debian.org/618616
Reviewed-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Previously klibc $(objtree)/.config depended on the kernel output
directory. This would cause 'defconfig has changed, please remove or
edit .config' build errors if $(KLIBCKERNELOBJ) directory was modified.
This directory dependency is a false dependency that does not indicate
that the target, $(objtree)/.config, needs to be regenerated.
Signed-off-by: Greg Thelen <gthelen@google.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
This patch adds support to klcc for the --param parameter.
Signed-off-by: Mike Pagano <mpagano@gentoo.org>
Signed-off-by: maximilian attems <max@stro.at>
|
|
It may happen that process_receive_event is called with already configured
devices resulting in multiple prints of the device configuration.
This patch changes the behaviour of process_receive_event and ignores
already configured devices.
Signed-off-by: Ulrich Dangel <uli@spamt.net>
Signed-off-by: maximilian attems <max@stro.at>
|
|
process_receive_event.
packet_peek is not really necessary as it does basically nothing besides
testing if a packet is availabe. This is already done in packet_recv.
Adjusted do_pkt_recv to only use process_receive_event.
packet_recv was modified to only receive and use packets from the specified
interface.
process_receive_event was adjusted to handle discared/ignored packages from
the corresponding recv functions. As packet_recv could return 0 for
ignored packets process_receive_event handled them as processed/handled
packets resulting in an endless loop if new (non valid dhcp/bootp) packets
were received.
As a side effect ignored packets are now shown automatically in the debug
output.
Signed-off-by: Ulrich Dangel <uli@spamt.net>
Signed-off-by: maximilian attems <max@stro.at>
|
|
This patch fixes a bug on systems with multiple connected network devices.
As packet_peek uses all devices to receive data instead of a specific
device. As the return value was never reset it was possible that packets
from other devices were returned by packet_peek. That means that the
ifindex did not match any ifindex of the specified devices the packet was
never removed and packets for the correct device were never processed.
This patch enhance packet_peek and packet_discard to only work on packages
for the specified device instead of all packets.
Signed-off-by: Ulrich Dangel <uli@spamt.net>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Issue for i386 and m68k (corrupting stack)
that needs to be fixed for them.
This reverts commit 0b40b7a7f71a773b606369e71fff8a6fbe22dbdf.
|
|
Signed-off-by: Gilles Espinasse <g.esp@free.fr>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Looking in klibc-1.5.21 I see that the published prototype for open() is:
__extern int open(const char *, int, ...);
This looks fine, but the actual definition (which deliberately doesn't see the
above prototype) is:
int open(const char *pathname, int flags, mode_t mode)
{ ... }
This is invalid C, and very sloppy programming.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47533
Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Thorsten Glaser <tg@mirbsd.de>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Overseen in applying the make 3.82 patch
bfd4f2fcdfc43d34895de1872768c6301846d81a, so nuke them all.
No functional change.
Signed-off-by: maximilian attems <max@stro.at>
|
|
They crept in with time, verified no functional change:
ls -l usr/klibc/klibc-*.so
-rwxr-xr-x 2 maks maks 71960 Jan 26 10:31 usr/klibc/klibc-r1_A6R6EwMsdze5h5xz93JiNuoM.so
Signed-off-by: maximilian attems <max@stro.at>
|
|
|
|
Remove FORCE from the list used by if_changed and friends. Otherwise the target
will always be considered out of date when built with make 3.82.
>From GNU make 3.82 NEWS file:
* WARNING: Backward-incompatibility!
The '$?' variable now contains all prerequisites that caused the target to
be considered out of date, even if they do not exist (previously only
existing targets were provided in $?).
Tested-by: Erwan Velu <erwanaliasr1@gmail.com>
Tested-by: crocket <crockabiscuit@gmail.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
For now, disable the use of rt signal system calls, even though that
means we can only access 32 signals on i386. <asm/signal.h> still
defines things in libc system space, in particular it defines
sigset_t, which means that as long as we include <asm/signal.h> we are
stuck using the 32-signal system calls.
The rt system calls DO NOT support 32 signals.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
Some stdarg.h, errno.h and sys/ioctl.h for the good mix.
Signed-off-by: maximilian attems <max@stro.at>
|
|
Several unused errno.h and a stdarg.h.
Signed-off-by: maximilian attems <max@stro.at>
|
|
Found some unused ctype.h, alloca.h and errno.h.
Signed-off-by: maximilian attems <max@stro.at>
|
|
several errno.h for no good reasons.
cleanup losesetup which is not using getopt_long,
thus doesn't need getopt.h included.
Move stdarg.h include up in losesetup to more proper place.
Signed-off-by: maximilian attems <max@stro.at>
|
|
no point in carrying those ifdefs along,
just cleanup the code that seems either BSD specific or
can't work on klibc.
Signed-off-by: maximilian attems <max@stro.at>
|
|
fix ressource leakage.
Signed-off-by: maximilian attems <max@stro.at>
|
|
Signed-off-by: maximilian attems <max@stro.at>
|
|
gets assigned a value without any further usage.
Signed-off-by: maximilian attems <max@stro.at>
|
|
Show usage instead of segfaulting when no args are passed.
0d844078 added typec and assigned value without actually using it.
As variable is properly named just use it in coressponding switch.
Signed-off-by: maximilian attems <max@stro.at>
|
|
fix several ressource leakages.
Signed-off-by: maximilian attems <max@stro.at>
|
|
fix ressource leakage.
Signed-off-by: maximilian attems <max@stro.at>
|
|
close respective file descriptor and stream.
Signed-off-by: maximilian attems <max@stro.at>
|
|
fix ressource leak of fd.
Signed-off-by: maximilian attems <max@stro.at>
|
|
Commit 57c0820992c7b735c7d6283e451b6dac49bf8b05 introduced
and obvious typo - fix it.
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
This adds a new setting: KBUILD_REPRODUCIBLE
If it is non-empty, ar and ranlib will be called in such
a way that timestamps do not affect the build output.
This allows one to get perfectly reproducible builds.
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
scripts/basic/fixdep.c: In function ‘traps’:
scripts/basic/fixdep.c:368: warning: dereferencing type-punned pointer will break strict-aliasing rules
scripts/basic/fixdep.c:370: warning: dereferencing type-punned pointer will break strict-aliasing rules
Fix similar to linux-2.6 d067aa741589a9783cc43315119e0f431b4e382c
commit.
Reported-by: Maciej Żenczykowski <maze@google.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Use some macros to tell gcc that we're using gnu89-style inlines even
if the compiler is in c99/gnu99 mode.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
Remove the unused variable ist in run_init().
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
Include <sys/types.h> in <sys/socket.h>; it prevents <linux/types.h>
from unwantedly getting pulled in -- at least in current kernels that
is a warning and not a failure, but it's still ugly.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
|
|
switch_root in util-linux hasn't it either.
cc0c0262 added the checks, but probably didn't have the following
application in mind.
In fact it can break chainloading of bigger initramfs out of small one:
"I boot via pxe, kernel + very small ramfs this ramfs start an
application that grabs a bigger ramfs and store it locally
I did the following: creating a tmpfs, uncpio the ramfs and try to
run-init on it, but my miniramfs doesn't have a /init as I specified
rdinit=/sbin/init."
So for now just get rid of that check.
Reported-by: Erwan Velu <erwan.velu@zodiacaerospace.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
I was scripting in klibc and wanted to make an action when the dhcp client
failed at grabing an IP after the defined timeout.
I found that klibc always exit 0 which isn't that convenient .
Belows patch fixes the issue.
[ small coding style changes - maks]
Signed-off-by: maximilian attems <max@stro.at>
|
|
I'm trying to boot a KVM over the net with a FAI created nfsroot. The
boot procedure fails with an error message that instructs me to file this bug.
In /live.log I see the following error message:
/init: /tmp/net-eth0.conf: line 9: int-domain2.priv: not found
http://bugs.debian.org/594208
Belows trivial patch addresses this issue.
Signed-off-by: Michael Prokop <mika@debian.org>
Tested-by: Reinhard Tartler <siretart@tauware.de>
Signed-off-by: maximilian attems <max@stro.at>
|
|
packet_recv()
Commit 4efbcf90f60e27febe883ef052454d8cfded5c15 badly broke ipconfig by
turning packet_recv() into an all-or-nothing function. Before this commit,
packet_recv() did distinguish between a DHCP/BOOTP packet that's of interest,
random UDP packets we don't care about and errors.
After the patch, either a packet is a DHCP/BOOTP packet or packet_recv() exits
with an error.
This breaks ipconfig on big, noisy LANs where random UDP traffic can arrive
before the DHCP reply and throw the device into DEVST_ERROR state.
This fixes http://bugs.debian.org/552554
Tested-by: Michael Prokop <mika@debian.org>
Signed-off-by: maximilian attems <max@stro.at>
|
|
The first switch() statement in process_receive_event() did not
handle the DEVST_ERROR state, causing the timeout to be endlessly
increased by 10 seconds at each iteration in the second switch()
statement.
The second switch() statement is only here to catch state changes
caused by the first one, so DEVST_ERROR must be caught by the first
one to ignore the device until the timeout expires.
Tested-by: Michael Prokop <mika@debian.org>
Signed-off-by: maximilian attems <max@stro.at>
|
|
|
|
this assignment is useless these days, so just get rid of it.
Reported-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: maximilian attems <max@stro.at>
|
|
When trying to build klibc on a native i386 box it
failed to include asm/posix_types.h
This was tracked down to a wrong include path.
For x86_64 it was correct.
Fix it for i386.
This should fix the build problem reported Phil Howard.
"FYI basically same patch was done and tested in OpenEmbedded on 2010-07-01"
- Andrea Adami <andrea.adami@gmail.com>
6f08923d3024f108b6262258c913573fb6ea78e6 fixed allmost all other unified
archs.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Phil Howard <kunnskaperen@gmail.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
memset struct sockaddr_in sin and thus get a clean valgrind ipconfig run.
Fixes:
==15636== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)
==15636==
==15636== 1 errors in context 1 of 3:
==15636== Syscall param ioctl(SIOCSIF*ADDR) points to uninitialised byte(s)
==15636== at 0x403EB1: __syscall_common (in /home/maks/src/klibc-latest/usr/kinit/ipconfig/static/ipconfig.g)
==15636== by 0x401859: netdev_setaddress (in /home/maks/src/klibc-latest/usr/kinit/ipconfig/static/ipconfig.g)
==15636== by 0x30687464: ???
==15636== Address 0x7fefffb02 is on thread 1's stack
==15636==
==15636==
==15636== 1 errors in context 2 of 3:
==15636== Syscall param ioctl(SIOCSIF*ADDR) points to uninitialised byte(s)
==15636== at 0x403EB1: __syscall_common (in /home/maks/src/klibc-latest/usr/kinit/ipconfig/static/ipconfig.g)
==15636== by 0x40180D: netdev_setaddress (in /home/maks/src/klibc-latest/usr/kinit/ipconfig/static/ipconfig.g)
==15636== by 0x30687464: ???
==15636== Address 0x7fefffb02 is on thread 1's stack
==15636==
==15636==
==15636== 1 errors in context 3 of 3:
==15636== Syscall param ioctl(SIOCSIF*ADDR) points to uninitialised byte(s)
==15636== at 0x403EB1: __syscall_common (in /home/maks/src/klibc-latest/usr/kinit/ipconfig/static/ipconfig.g)
==15636== by 0x4017C8: netdev_setaddress (in /home/maks/src/klibc-latest/usr/kinit/ipconfig/static/ipconfig.g)
==15636== by 0x30687464: ???
==15636== Address 0x7fefffb02 is on thread 1's stack
==15636==
==15636== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)
Signed-off-by: maximilian attems <max@stro.at>
|
|
Be conversvative and don't use C99 features, just memset the sll struct.
The relevant sll entries are assigned later down the road.
Rewrite struct msghdr msg assignments to not mix declarations and
assignements.
Fixes this valgrind errors:
==3319==
==3319== 1 errors in context 3 of 4:
==3319== Syscall param ioctl(SIOCSIF*ADDR) points to uninitialised byte(s)
==3319== at 0x403BE1: __syscall_common (in /home/maks/src/klibc-latest/usr/kinit/ipconfig/static/ipconfig.g)
==3319== by 0x401724: netdev_setaddress (in /home/maks/src/klibc-latest/usr/kinit/ipconfig/static/ipconfig.g)
==3319== by 0x30687464: ???
==3319== Address 0x7fefffb02 is on thread 1's stack
==3319==
==3319==
==3319== 2 errors in context 4 of 4:
==3319== Syscall param ÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝ points to uninitialised byte(s)
==3319== at 0x403BE1: __syscall_common (in /home/maks/src/klibc-latest/usr/kinit/ipconfig/static/ipconfig.g)
==3319== by 0x401B90: packet_send (in /home/maks/src/klibc-latest/usr/kinit/ipconfig/static/ipconfig.g)
==3319== by 0x7FEFFFA0F: ???
==3319== by 0x13: ???
==3319== by 0x6060DF: ??? (in /home/maks/src/klibc-latest/usr/kinit/ipconfig/static/ipconfig.g)
==3319== by 0x5: ???
==3319== Address 0x7fefffa22 is on thread 1's stack
Signed-off-by: maximilian attems <max@stro.at>
|
|
It turns out that all the CMSG_* structures and macros are hidden behind
__KERNEL__ in current kernel.org kernels. Expose these macros in sys/socket.h
for the time being to make them available.
Signed-off-by: Mike Waychison <mikew@google.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Enable -fwrapv in klibc's build as there may be places that assume that signed
integers can overflow.
Signed-off-by: Mike Waychison <mikew@google.com>
[ I noticed no new warning on klibc build with gcc 4.4. ]
Signed-off-by: maximilian attems <max@stro.at>
|
|
Tested OK on both little endian (amd64) and big endian (powerpc).
Signed-off-by: Benjamin Cama <benoar@free.fr>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Using the patch from bug #574834 klibc now builds, but does not work. It
assumes that the kernel returns the result of the syscalls in register
r3, while it behaves like a normal call, with the results in register
r0.
Also the pipe syscall needs a special handling as on some other
architectures, the structure passed in argument is not filled, instead
the two fd are returned in r0 and r1.
The patch below fixes the problem. It has been tested by creating an
initrd with initramfs and booting the system with it.
Closes: #578076
Signed-off-by: maximilian attems <max@stro.at>
|
|
currently there is no order.
Signed-off-by: maximilian attems <max@stro.at>
|
|
Signed-off-by: maximilian attems <max@stro.at>
|
|
We most propably didn't hibernate in the first place.
s/fprintf/dprintf/
Signed-off-by: maximilian attems <max@stro.at>
|
|
we define rusage, but had no way to see this stats.
it may allow compiling mksh against klibc.
Signed-off-by: maximilian attems <max@stro.at>
|
|
|
|
3-arg faccessat is unfortunately an incomplete implementation.
It does not match user-space needs, for example due to wrong answer
when egid != gid.
dash started to detect klibc faccessat() syscall wrapper.
Signed-off-by: maximilian attems <max@stro.at>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
we merged in 0.5.6, plus minor fixes since.
Signed-off-by: maximilian attems <max@stro.at>
|
|
There seems to be a problem with the new version of dash
with job control off. I can't tell if it is just a warning or is a
manifest bug.
usr/dash/trap.c: In function `exitshell':
usr/dash/trap.c:376: warning: suggest braces around empty body in an `if' statement
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Eric Blake suggested that we should use faccessat so that ACLs
and other corner cases are handled correctly. This patch does
exactly that.
Note that faccessat doesn't handle ACLs when euid != uid, as
this case is currently implemented by glibc instead of the kernel,
using code similar to the existing dash test.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
[ config.h undef HAVE_FACCESSAT ]
Signed-off-by: maximilian attems <max@stro.at>
|
|
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
On Wed, Feb 24, 2010 at 10:23:34AM +0000, Peter Kjellerstedt wrote:
>
> there seems to be a problem with the trap implementation in dash
> (tested with 0.5.4 and 0.5.5.1). If I specify a signal which is not
> supported, the shell unconditionally aborts. E.g., I had expected
> the following to print foo (like bash and zsh do):
>
> # dash -c 'trap "echo trap executed" UNKNOWNSIGNAL || echo "foo"'
> trap: 1: UNKNOWNSIGNAL: bad trap
>
> This means I cannot write a construct like the following to take
> advantage of the ERR signal which is present in some shells:
>
> trap "echo ERR trap executed" ERR 2>/dev/null || :
>
> I also checked the POSIX documentation, and quoting from
> http://www.opengroup.org/onlinepubs/009695399/utilities/trap.html
> (exit status): "For both interactive and non-interactive shells,
> invalid signal names [XSI] [Option Start] or numbers [Option End]
> shall not be considered a syntax error and do not cause the shell
> to abort."
This patch replaces sh_error with a outfmt + return 1 in trapcmd
so that these errors are no longer fatal.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
On review of klibc dash changes:
"Hmm, this breaks the non-glibc case. You're now returning a pointer to
a string on the stack which is illegal." Herbert Xu
Use upstream dash way.
Signed-off-by: maximilian attems <max@stro.at>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
|
|
Butter on bread seems useless for good french cheese.
Although there are many nice usage cases for butter.
This fs seems to be fancy and lately lots of users
were asking for support:
mkfs.btrfs /dev/dualvg0/testb
WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL
WARNING! - see http://btrfs.wiki.kernel.org before using
fs created label (null) on /dev/dualvg0/testb
nodesize 4096 leafsize 4096 sectorsize 4096 size 920.00MB
~/src/klibc-latest$ ./usr/kinit/fstype/static/fstype
/dev/mapper/dualvg0-testb
FSTYPE=btrfs
FSSIZE=964689920
Signed-off-by: maximilian attems <max@stro.at>
|
|
ext4 no longer requires a journal, fix shipped by Ubuntu for some time.
Compare:
http://git.kernel.org/?p=fs/ext2/e2fsprogs.git;a=commitdiff;h=a90f5391dda78f7bc4a8196a78355584ace0adf5
Signed-off-by: Colin Watson <cjwatson@ubuntu.com>
Acked-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: maximilian attems <max@stro.at>
|
|
as bonus this cleanes up also some whitespace violations
in old DEBUG usage.
Signed-off-by: maximilian attems <max@stro.at>
|
|
same switch as ipconfig.
nuke unused include of ipconfig.h in nfsroot.c
Signed-off-by: maximilian attems <max@stro.at>
|
|
compile the relevant printfs if DEBUG is defined
at compile time or nothing if not.
dprintf uses simply printf as definition,
no need to badly invent a new marcro.
nuke comment related to old gcc.
the line ending story of those printf needs to be fixed another time.
Put some dprintf back in, that went missing in latest fixes.
Signed-off-by: maximilian attems <max@stro.at>
|
|
Newer compilers will complain about strict aliasing when casting struct
sockaddr to sockaddr_in. Even though these are legitimate type casts, changing
them to use memcpy is easy enough and silences the warnings.
Signed-off-by: Mike Waychison <mikew@google.com>
Signed-off-by: maximilian attems <max@stro.at>
|
|
s390 known working in debian
ia64 is built staticaly as shared segfault
av32 is not yet seen
Signed-off-by: maximilian attems <max@stro.at>
|
|
make[2]: Entering directory
`/build/buildd-klibc_1.5.17-3-sh4-O7e0CP/klibc-1.5.17'
scripts/Makefile.clean:17:
/build/buildd-klibc_1.5.17-3-sh4-O7e0CP/klibc-1.5.17/usr/klibc/arch/sha/Makefile:
No such file or directory
Debian sh porters sent this patch to fix the issue.
Signed-off-by: maximilian attems <max@stro.at>
|
|
the test wouldn't be enough to catch sparc64 trickery,
but it triggers easily on sparc32 already.
Signed-off-by: maximilian attems <max@stro.at>
|
|
git needs to track c sourcefiles.
Signed-off-by: maximilian attems <max@stro.at>
|
|
this is latest git dash configured with klcc against klibc 1.5.17.
Signed-off-by: maximilian attems <max@stro.at>
|
|
there might be easier ways, but this one worked out.
As bonus rename README.klibc to README.dash.
Signed-off-by: maximilian attems <max@stro.at>
|
|
Another change I'm making to the arith code is making || return 0 or 1
only, matching C, POSIX and other shells.
Apart from the compliance issue, it is also bad to expose implementation
details like the exact meaning of 'noeval' to scripts such that they may
come to depend on them.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
On Tue, Jun 23, 2009 at 10:06:30AM +0000, Nikola Vladov wrote:
> May be this is a bug:
>
> echo XX > uu
> cat <> uu
>
> dash truncates file uu. The open flag O_TRUNC must be removed.
> I'm not 100% shure what POSIX say about: program <> file
Indeed, this is a bug we inherited from NetBSD. This patch removes
the O_TRUNC flag for FROMTO.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Jilles Tjoelker reported that binary operator parsing doesn't
respect operator precedence correctly in the case where a lower-
precedence operator is followed by a higher-precedence operator,
and then by a lower-precedence operator.
This patch fixes this by stopping when we encounter a binary
oeprator with a precedence lower than one that we have already
encountered.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Alexey Gladkov <gladkov.alexey@gmail.com> wrote:
>
> I found another example:
>
> $ tr -d '[:print:]' < /etc/passwd |tr -d '\t\n' |wc -c
> 0
>
> $ dash -c 'while read o p; do printf "[%s] [%s]\n" "$o" "$p"; done <
> /etc/passwd' |tr -d '[:print:]' |tr -d '[:space:]' |wc -c
> 61
>
> bug is not fixed yet :(
This bug is caused by an off-by-one error in the recordregion
call in readcmd. It included the terminating NUL in the region
which causes ifsbreakup to include the string after it for scanning.
Setting the correct length fixes the problem.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
On Mon, Sep 28, 2009 at 11:00:05AM +0200, Jim Meyering wrote:
> A DEL (0177, dec 127) byte in a here-document would cause dash to
> access uninitialized memory at the end of one of the syntax.c tables,
> since those tables are sized to accommodate a maximum index of
> BASESYNTAX + 126. Make the generated tables one byte larger.
> printf ':<<\\E\n\200y\nE'|./dash
> * src/mksyntax.c (filltable): Use 258, not 257 as the size,
> so that BASESYNTAX(=130) + 127 is a valid index.
> (print): Likewise.
> Don't emit explicit array dimension in declaration.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
On Tue, Jul 14, 2009 at 09:39:03PM +0000, Eric Blake wrote:
> For the cd command, POSIX 2008 requires that after all pathnames in CDPATH
> have been tested and failed in step 5, then step 6 interprets the directory
> argument relative to PWD. In other words, this demonstrates a bug:
>
> $ dash -c 'cd /tmp; mkdir -p foo; CDPATH=oops; cd foo; echo $?; pwd'
> cd: 1: can't cd to foo
> 2
> /tmp
>
> while bash gets it correct:
>
> $ bash -c 'cd /tmp; mkdir -p foo; CDPATH=oops; cd foo; echo $?; pwd'
> 0
> /tmp/foo
This patch fixes the problem.
Reported-by: Eric Blake <ebb9@byu.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Pass correct type to ctype macro.
Signed-off-by: Eric Blake <ebb9@byu.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
On Sat, Aug 15, 2009 at 06:07:16PM +0000, Matthew Burgess wrote:
>
> My system has Coreutils-7.4 compiled with the i18n patch from
> http://cvs.fedoraproject.org/viewvc/devel/coreutils/coreutils-i18n.patch.
>
> Using this to compile dash, when in an en_GB.UTF-8 locale, I get the following error:
>
> if gcc -DHAVE_CONFIG_H -I. -I. -I.. -include ../config.h -DBSD=1 -DSHELL -DIFS_BROKEN -Wall -g -O2 -MT eval.o -MD -MP -MF ".deps/eval.Tpo" -c -o eval.o eval.c; \
> then mv -f ".deps/eval.Tpo" ".deps/eval.Po"; else rm -f ".deps/eval.Tpo"; exit 1; fi
> eval.c: In function ‘evalcommand’:
> eval.c:810: error: ‘EXECCMD’ undeclared (first use in this function)
> eval.c:810: error: (Each undeclared identifier is reported only once
> eval.c:810: error: for each function it appears in.)
> eval.c:812: error: ‘COMMANDCMD’ undeclared (first use in this function)
> make[3]: *** [eval.o] Error 1
>
> This is because the src/mkbuiltins script ends up generating an incomplete
> src/builtins.h file. This, in turn, is caused by 'sort -u -k 3,3' not
> working correctly.
>
> The attached patch fixes/works around things by setting LC_CTYPE=C, thus
> overriding the build environment (in a similar manner to the earlier call to
> 'sort' in that same script).
I've changed it to use LC_COLLATE.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Commit 55c46b7286f5d9f2d8291158203e2b61d2494420 ([BUILTIN] Honor
tab as IFS whitespace when splitting fields in readcmd) introduced
a bug where sometimes garbage would follow the last field preceding
the end-of-line. This was caused by an off-by-one error in the
string length calculation.
This patch fixes the bug.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Now that eval handles EV_TESTED correctly, we can remove the
SKIPEVAL hack and simply use EXEXIT for set -e.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
This patch fixes the case where the eval command is used with
set -e and as part of a construct that should not cause the
shell to abort, e.g., as part of the condition of an if statement.
This is achieved by propagating the EV_TESTED flag into the
evalstring function through evalcmd. As this alters the prototype
of evalcmd it is now invoked explicitly by evalbltin. The built-in
infrastructure has been changed to accomodate this special case.
In order to ensure that the EXIT trap is properly executed this
patch clears evalskip in exitshell. This wasn't needed before
because of the broken way evalstring worked where it always clears
evalskip when called by minusc.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|
|
Looks like in contrast to what the dash.1 manual page says, expansion
of PS{1,2,4} does work.
Here is a little patch to set LINENO. The ways in that it is less than
ideal mirror the ways that the line number error reporting is also
less than ideal.
For example if you run this:
(
x=$((1/0))
# Just to add another line
# And another
) # error reports this line
The error reported will be the closing parenthesis even though I
think most people would prefer the error to be the one where x was
set.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
|