| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
POSIX.1-2008 ยง4.4 "File Access Permission" sayeth:
If execute permission is requested, access shall be granted
if execute permission is granted to at least one user by the
file permission bits or by an alternate access control
mechanism; otherwise, access shall be denied.
For historical reasons, POSIX unfortunately also allows access() and
faccessat() to return success for X_OK if the current process is
privileged, even when the above condition is not fulfilled and actual
execution would fail. On the affected platforms, "test -x <path>" as
root started returning true on nonexecutable files when dash switched
from its own emulation to the true faccessat in v0.5.7~54
(2010-04-02).
Work around this by checking the permissions bits when mode == X_OK
and geteuid() == 0 on such platforms.
Unfortunately the behavior seems to vary from one kernel version to
another, so we cannot just check the behavior at compile time and rely
on that. A survey of some affected kernels:
- NetBSD's kernel moved to the sane semantics in 1997
- OpenBSD's kernel made the same change in version 4.4, three years
ago
- FreeBSD 9's kernel fixes this but hasn't been released yet
It seems safe to only apply the workaround on systems using the
FreeBSD kernel for now, and to push for standardization on the
expected access()/faccessat() semantics so we can drop the workaround
altogether in a few years.
To try it on other platforms, use "./configure --enable-test-workaround".
Reported-by: Christoph Egger <christoph@debian.org>
Analysis-by: Petr Salinger <Petr.Salinger@seznam.cz>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
|
| |
|
|
|
|
|
|
|
| |
Simply specify --disable-lineno to configure.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
|
|
|
|
|
|
|
|
|
|
|
|
| |
dash rather pointlessly calls imaxdiv, only to discard one of its
results. The call was already made conditional a while back because some
systems don't have imaxdiv, but the generated code for the version with
imaxdiv and the one with / and % is identical (with GCC 4.6.1 or ICC
12.0.2, with -O0, -O2 or -Os), so it could just as well go entirely to
clean up the code a little bit.
Signed-off-by: Harald van Dijk <harald@gigawatt.nl>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Hi, Herbert and friends. I've created a small patch that allows dash
to be built on Mac OS X. I'm contributing it here with the hope that
it's suitable for inclusion in dash.
The changes in this patch are:
- __attribute__((__alias__())) is not supported, add an autoconf check
- open64 is not present although the stat64 family is, separate the
autoconf checks
- A syntax error had slipped into a non-glibc codepath
- mkbuiltins had a nonportable mktemp invocation for the case where
tempfile is not availalble
Nothing in this patch is actually Mac OS X-specific, so it might aid
portability to other platforms as well.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
|
|
|
|
|
|
|
|
|
|
| |
Hi, I propose to apply the following patch for dash. The problem is
alloca.h is absent on many platforms including NetBSD I'm running.
Also, NetBSD's version of mktemp doesn't work without temporary
filename pattern.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
|
|
|
|
|
|
|
|
|
|
|
| |
Although in posix, imaxdiv() isn't implemented on Debian/alpha, causing
dash to fail to build. So use / and % operators if imaxdiv() isn't
available.
http://bugs.debian.org/456398
Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
|
|
|
|
|
|
|
|
| |
Debian's libc6 as of 2.6.1-6 has working glob(3)/fnmatch(3) support.
This patch adds the options --enable-glob and --enable-fnmatch to
the configure script. By default glob(3) and fnmatch(3) are still
unused. However, on distros where the glibc is known to work you
may enable these options.
|
|
|
|
| |
Add new option to build statical linked dash.
|
| |
|
|
|
|
|
| |
Add to the configure.ac new option:
--with-libedit - Compile with libedit support.
|
| |
|
|
|
|
|
| |
Unfortunately klibc doesn't provide out-of-line versions of ctypes
functions such as isalpha. This is a nasty hack to create them.
|
|
|
|
| |
Add a dummy sysconf implementation that always fails for klibc.
|
|
|
|
|
| |
klibc doesn't have strtod or atof. So add an implementation that
always fails by setting the end pointer to the input string.
|
|
|
|
|
|
|
|
|
|
| |
For systems without getrlimit (e.g., klibc) we will disable ulimit.
In order to achieve this, builtins.def is now produced by cpp which
allows us to use macros such as HAVE_GETRLIMIT in it.
Thie also means that we can get rid of the cflags parsing code in
mkbuiltins.
|
|
|
|
|
| |
klibc doesn't have killpg. Since we only call it for valid values of
pid, we can call kill instead.
|
|
|
|
| |
klibc doesn't have strsignal but it does have sys_siglist.
|
|
|
|
|
| |
klibc doesn't have and doesn't need getpwnam. This change creates
getpwhome which always returns NULL if getpwnam doesn't exist.
|
|
|
|
| |
Added impelmentation of bsearch since klibc doesn't have it yet.
|
|
|
|
|
|
|
|
|
| |
64-bit file calls such as stat64 don't exist on all architectures for
dietlibc, and they don't exist at all for klibc. In those cases the
normal calls such as stat are already 64-bit.
So simply define stat64 as stat if it doesn't exist. Do the same for
all other 64-bit calls as well.
|
|
|
|
|
|
|
|
| |
klibc has bsd_signal instead of signal. So we will define signal as
bsd_signal if
1) signal does not exist.
2) bsd_signal exists.
|
|
|
|
|
|
|
|
|
|
|
| |
This change updates the BSD licence to the three-clause version since
NetBSD has already done so. This makes dash GPL-compatible.
It also adds Christos Zoulas (NetBSD ash maintainer) to the COPYING file.
I've added "copyright by Herbert Xu" to most files.
Finally all CVS IDs and inclusion of sys/cdefs.h have been removed.
The latter is needed for support of klibc.
|
| |
|
|
|
|
| |
TAG: v0.5.2
|
|
|