LAURENT | 11 Feb 02:30 2016
Picon

Business Partnership

Hello,

I am Mr. LAURENT EYADEMA from Republic of Togo.please read the attached proposal.
Thanks in anticipation of your urgent response,

LAURENT EYADEMA
Attachment (proposal.docx): application/octet-stream, 4239 bytes
LAURENT | 11 Feb 02:01 2016
Picon

Business Partnership

Hello,

I am Mr. LAURENT EYADEMA from Republic of Togo.please read the attached proposal.
Thanks in anticipation of your urgent response,

LAURENT EYADEMA
Attachment (proposal.docx): application/octet-stream, 4239 bytes
Joachim Breitner | 10 Feb 16:18 2016
Picon
Gravatar

dash drops exported bash functions

Dear dash developers,

a change in 0.5.8, very likely this one
http://git.kernel.org/cgit/utils/dash/dash.git/commit/?id=46d3c1a614f11f0d40a7e73376359618ff07abcd
broke the exporting of bash shell functions via the environment.

The attached script shows the breakage, as it outputs

$ ./exporttest.sh 
exportest called ()
Setting up environment
Calling myself
exportest called (1)
function foo successfully called
Calling myself directly
exportest called (2)
function foo successfully called
Calling myself via dash
exportest called (3)
/tmp/exporttest.sh: Zeile 33: foo: Kommando nicht gefunden.
Done

Exporting bash functions via the environment might be a rarely used
feature, but it is used in practice, unfortunately (otherwise I
wouldn’t have noticed this).

Thanks,
Joachim

--

-- 
(Continue reading)

Trek | 20 Jan 22:38 2016
Picon

echo do not print NUL byte

there is no way to print the NUL byte with the echo utility

with an XSI shell (mksh, posh, yash):

  $ sh -c 'echo \\0 | od -An -c'
    \0  \n

with a shell that requires echo -e (ksh, bash, busybox, mksh):

  $ sh -c 'echo -e \\0 | od -An -c'
    \0  \n

with dash (XSI, no -e argument):

  $ dash -c 'echo \\0 | od -An -c'
    \n

where others characters are correctly printed:

  $ dash -c 'echo \\0100 | od -An -c'
      <at>   \n

with dash it only works with printf:

  $ dash -c 'printf \\0\\n | od -An -c'
    \0  \n

I discovered this bug developing a small shell library, where you can
find an use case in the n_bytes_encode function of the lib/bytes.sh file
included in http://www.trek.eu.org/devel/naive/naive-0.0.2.tar.gz
(Continue reading)

Gioele Barabucci | 11 Jan 20:12 2016
Picon

[PATCH] man: Document ulimit -v

Document that `ulimit` can set the `RLIMIT_AS` limit (virtual memory) with
the `-v` flag.

Fixes: https://bugs.debian.org/78556
Reported-by: Vincent Lefevre <vincent <at> vinc17.net>
Signed-off-by: Gioele Barabucci <gioele <at> svario.it>
---
 src/dash.1 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/dash.1 b/src/dash.1
index 832eae7..8b8026d 100644
--- a/src/dash.1
+++ b/src/dash.1
 <at>  <at>  -2114,7 +2114,7  <at>  <at>  printed; for commands and tracked aliases the complete pathname of the
 command is printed.
 .It ulimit Xo
 .Op Fl H \*(Ba Fl S
-.Op Fl a \*(Ba Fl tfdscmlpn Op Ar value
+.Op Fl a \*(Ba Fl tfdscmlpnv Op Ar value
 .Xc
 Inquire about or set the hard or soft limits on processes or set new
 limits.
 <at>  <at>  -2164,6 +2164,9  <at>  <at>  show or set the limit on the number of processes this user can
 have at one time
 .It Fl n
 show or set the limit on the number files a process can have open at once
+.It Fl v
+show or set the limit on the total virtual memory that can be
+in use by a process (in kilobytes)
(Continue reading)

Martijn Dekker | 30 Dec 18:06 2015
Gravatar

Inheriting IFS from environment

Unlike bash, *ksh and zsh, dash allows inheriting IFS from the environment:

$ IFS=bla dash -c "x='hela hola'; echo \$x"
he  ho

This seems a bit dodgy from a security point of view. For instance, most
scripts don't bother to quote their variables in test commands such as [
$var -eq 0 ], making it possible to influence the program flow by
manipulating IFS from the outside.

- M.
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Jonathan Perkin | 11 Dec 14:07 2015

[PATCH] [SHELL] Fix 64-bit Solaris build

In a 64-bit Solaris environment there is no stat64() function, only
stat().  This conflicts with the stat64 #define used to support
dietlibc/klibc when stat64() is not found and results in:

  ./../config.h:194:16: error: redefinition of 'struct stat'
   #define stat64 stat
                ^
  In file included from cd.c:36:0:
  /usr/include/sys/stat.h:217:8: note: originally defined here
   struct stat {
          ^

Instead, add a AC_CHECK_DECL test for stat64, and only perform the
AC_CHECK_FUNC test if it isn't already defined.
---
 configure.ac | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 8ae0dc6..f4c9b87 100644
--- a/configure.ac
+++ b/configure.ac
 <at>  <at>  -139,10 +139,12  <at>  <at>  if test "$ac_cv_func_signal" != yes; then
 fi

 dnl Check for stat64 (dietlibc/klibc).
-AC_CHECK_FUNC(stat64,, [
-	AC_DEFINE(fstat64, fstat, [64-bit operations are the same as 32-bit])
-	AC_DEFINE(lstat64, lstat, [64-bit operations are the same as 32-bit])
-	AC_DEFINE(stat64, stat, [64-bit operations are the same as 32-bit])
(Continue reading)

Jonathan Perkin | 11 Dec 12:56 2015

[PATCH] [SHELL] Fix build on Solaris 9

Ensure dash can build in a default Solaris 9 or older environment:

 - Execute scripts with $SHELL rather than /bin/sh, the latter does not
   support e.g. "if ! .." used by mkbuiltins.

 - /bin/awk does not support ?: syntax, use explicit statements instead.

 - /bin/nl requires no spaces between options and arguments.
---
 src/Makefile.am |  4 ++--
 src/mkbuiltins  | 12 ++++++++----
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 120ffa2..139355e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
 <at>  <at>  -46,13 +46,13  <at>  <at>  EXTRA_DIST = \
 	mknodes.c nodetypes nodes.c.pat mksyntax.c mksignames.c

 token.h token_vars.h: mktokens
-	sh $^
+	$(SHELL) $^

 builtins.def: builtins.def.in $(top_builddir)/config.h
 	$(COMPILE) -E -x c -o $ <at>  $<

 builtins.c builtins.h: mkbuiltins builtins.def
-	sh $^
+	$(SHELL) $^
(Continue reading)

Tobias Klauser | 10 Dec 08:59 2015
Picon
Gravatar

[PATCH] jobs: Don't attempt to access job table for job %0

If job %0 is (mistakenly) specified, an out-of-bounds access to the
jobtab occurs in function getjob() if num = 0:

	jp = jobtab + 0 - 1

Fix this by checking that the job number is larger than 0 before
accessing the jobtab.

Signed-off-by: Tobias Klauser <tklauser <at> distanz.ch>
---
 src/jobs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/jobs.c b/src/jobs.c
index c2c2332a25fa..39978635d891 100644
--- a/src/jobs.c
+++ b/src/jobs.c
 <at>  <at>  -699,7 +699,7  <at>  <at>  check:

 	if (is_number(p)) {
 		num = atoi(p);
-		if (num <= njobs) {
+		if (num > 0 && num <= njobs) {
 			jp = jobtab + num - 1;
 			if (jp->used)
 				goto gotit;
--

-- 
2.6.3.368.gf34be46.dirty

--
(Continue reading)

Jonathan Perkin | 7 Dec 18:50 2015

[PATCH] trap: Implement POSIX.1-2008 trap reset behaviour (#2)

Clarifies a couple of issues with the previous patch, and expands on
the rationale in the commit message.  Sorry for the noise -- jperkin

POSIX.1-2008 for trap adds the following behaviour:

    If the first operand is an unsigned decimal integer, the shell shall
    treat all operands as conditions, and shall reset each condition to
    the default value.

The interpretation of this behaviour differs among other shells.  In the
case where the first operand is an invalid signo:

  bash-4.3.39(1), zsh-5.1.1:

    $ trap echo 1 2 3
    $ trap 100 1 2
    $ trap
    trap -- '100' SIGHUP
    trap -- '100' SIGINT
    trap -- 'echo' SIGQUIT

  mksh-51:

    $ trap echo 1 2 3
    $ trap 100 1 2
    mksh: trap: bad signal '100'
    $ trap
    trap -- echo QUIT

  ksh 93u+:
(Continue reading)

Jonathan Perkin | 7 Dec 14:18 2015

[PATCH] trap: Implement POSIX.1-2008 trap reset behaviour

POSIX.1-2008 for trap adds the following behaviour:

    If the first operand is an unsigned decimal integer, the shell shall
    treat all operands as conditions, and shall reset each condition to
    the default value.

Whilst the standard specifies an "unsigned decimal integer", we take the
pragmatic approach of enabling this behaviour iff the first operand is a
valid signal, otherwise it is interpreted as an action.  This matches
the behaviour of most other shells in this regard.
---
 src/trap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/trap.c b/src/trap.c
index 82d4263..2d20c3f 100644
--- a/src/trap.c
+++ b/src/trap.c
 <at>  <at>  -112,7 +112,7  <at>  <at>  trapcmd(int argc, char **argv)
 		}
 		return 0;
 	}
-	if (!ap[1])
+	if ((!ap[1]) || (decode_signal(*ap, 0) >= 0))
 		action = NULL;
 	else
 		action = *ap++;
--

-- 
2.4.9 (Apple Git-60)

(Continue reading)


Gmane