cramer | 24 May 14:37
Picon
Favicon

candidatul fara studii


http://www.altphel.ro/2012/05/dobre-arata-ne-diploma/
 To unsubscribe please send email to unsubscribe <at> cc.psd-prahova.ro
--
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

cramer | 24 May 13:23
Picon
Favicon

candidatul fara studii


http://www.altphel.ro/2012/05/dobre-arata-ne-diploma/
 To unsubscribe please send email to unsubscribe <at> cc.psd-prahova.ro
--
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

Jim Meyering | 23 May 22:37

[PATCH] avoid overflow for very long variable name


Otherwise, this:
  $ perl -le 'print "v"x(2**31+1) ."=1"' | dash
provokes integer overflow:

  (gdb) bt
  #0  doformat (dest=0x61d580, f=0x416a08 "%s: %d: %s: ", ap=0x7fffffffd308)
      at output.c:310
  #1  0x00000000004128c1 in outfmt (file=0x61d580, fmt=0x416a08 "%s: %d: %s: ")
      at output.c:257
  #2  0x000000000040382e in exvwarning2 (msg=0x417339 "Out of space",
      ap=0x7fffffffd468) at error.c:125
  #3  0x000000000040387e in exverror (cond=1, msg=0x417339 "Out of space",
      ap=0x7fffffffd468) at error.c:156
  #4  0x0000000000403938 in sh_error (msg=0x417339 "Out of space") at error.c:172
  #5  0x000000000040c970 in ckmalloc (nbytes=18446744071562067984)
      at memalloc.c:57
  #6  0x000000000040ca78 in stalloc (nbytes=18446744071562067972)
      at memalloc.c:132
  #7  0x000000000040ece9 in grabstackblock (len=18446744071562067972)
      at memalloc.h:67
  #8  0x00000000004106b5 in readtoken1 (firstc=118, syntax=0x419522 "",
      eofmark=0x0, striptabs=0) at parser.c:1040
  #9  0x00000000004101a4 in xxreadtoken () at parser.c:826
  #10 0x000000000040fe1d in readtoken () at parser.c:697
  #11 0x000000000040edcc in parsecmd (interact=0) at parser.c:145
  #12 0x000000000040c679 in cmdloop (top=1) at main.c:224
  #13 0x000000000040c603 in main (argc=2, argv=0x7fffffffd9f8) at main.c:178

  #8  0x00000000004106b5 in readtoken1 (firstc=118, syntax=0x419522 "",
(Continue reading)

cramer | 2 May 15:14
Picon
Favicon

Spital nou de pediatrie


http://www.youtube.com/watch?feature=player_embedded&v=phjGxHn3uKU
 To unsubscribe please send email to unsubscribe <at> cc.psd-prahova.ro
--
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

Stefano Lattarini | 23 Apr 18:53
Picon

[BUG] dash doesn't report syntax error when it should on stray "fi"

How to reproduce:

  $ dash -c ':; fi'; echo stat = $?
  stat = 0

Behaviour of other shells:

  $ bash-4.1 -c ':; fi'; echo stat = $?  # Bash 4.1.5
  bash-4.1: -c: line 0: syntax error near unexpected token `fi'
  bash-4.1: -c: line 0: `:; fi'
  stat = 1

  $ bash-3.2 -c ':; fi'; echo stat = $? # Bash 3.2.0
  bash-3.2: -c: line 0: syntax error near unexpected token `fi'
  bash-3.2: -c: line 0: `:; fi'
  stat = 2

  $ ksh -c ':; fi'; echo stat = $? # AT&T Ksh
  ksh: syntax error at line 1: `fi' unexpected
  stat = 3

  $ pdksh -c ':; fi'; echo stat = $? # Public Domain Ksh, version 5.2.14
  pdksh: syntax error: `fi' unexpected
  stat = 1

  $ zsh -c ':; fi'; echo stat = $?  # Zsh 4.3.12
  zsh:1: parse error near `fi'
  stat = 1

Version information:
(Continue reading)

Marc Glisse | 20 Apr 13:31
Picon
Picon
Favicon

wait and ctrl+Z

Hello,

I noticed a strange behavior of "wait" when I suspend and resume a script.

$ cat a.sh
#!/bin/dash
(sleep 7; echo blah) &
(sleep 7; echo bloh) &
wait ; echo coucou
$ ./a.sh
^Z
zsh: suspended  ./a.sh
$ fg
[1]  + continued  ./a.sh
coucou
$ blah
bloh

As you can see, the instruction after "wait" was executed immediatly on 
resume, without waiting for the jobs.

If I replace the ';' after "wait" by "&&" and do the same suspend+resume, 
"coucou" is never printed.

I am using dash version 0.5.7-3 in debian testing.

--

-- 
Marc Glisse
--
To unsubscribe from this list: send the line "unsubscribe dash" in
(Continue reading)

Jim Pryor | 9 Apr 00:09
Picon
Gravatar

local var=$(cat) only reads one line

Hi, I'm not a subscriber to this list and am not sure where's the best
place to report this bug. A cursory search didn't find other reports of
the same issue; but I can imagine there may well be such. If so, excuse
the noise. I'm just trying to help.

I notice the following issue in the version of dash that's bundled in a
recent release of finnix (not sure which one, but the kernel version is
3.0.6, so it's probably finnix 103, released 23 October 2011). I also
see it in the FreeBSD sh, from a FreeBSD-9 release candidate I compiled
in January. I know that's not dash, but I understand the codebases are
closely related. Neither of these are my active systems; hence the fuzzy
details.

Here is a testcase:

#!/bin/dash

test1() {
    local IN=$(cat)
    printf "test1 <%s>\n" "$IN"
}

test2() {
    local IN="$(cat)"
    printf "test2 <%s>\n" "$IN"
}

test3() {
    IN=$(cat)
    printf "test3 <%s>\n" "$IN"
(Continue reading)

Xlpt | 25 Mar 13:04
Favicon

8k9l0O

i8k9n0O1Q1SgUhVj9l9n0O1Q1SgUhVj9l0N0P1RfThUi8k9m0O0PfTgUi8k9ThVj8l9m0O0P1RfTgUi8k9m9N0P1RfTgUi8k9m0N0P1RfTgUhVj9m0hUi8l9n0O1Q1SgUhVj9l9n0O1Q1SgUhVj9l9n0O1Q1SgUhVj9l9n0P1RfThSfTh8k9m9N0P1RfSfSgUhVj9l9n0O0P1RfSfSgUiVj8k9m0O0Q1Q1Vj9l9N0P1RfTgUi8k9m0N0P1RfTgUi8k9m0N0P1RfThUi8k9m0N0P1RiWk9m0O0Q1RfThViWk9l9m0O0P1Q1SfThVj8l9m0O0Q1RfTgUiVj9l9n0N0PVj9l0O0P1RfThVi8k9m0O0P1RfThVj8k9m0O0P1RfThVj8k9m0O0Q1RSgUh8k9m0O0P1RfThUi8k9m0O0P1R1SgUhVj8k9m0O0P1RfTgUhVjQ1SfUi8k9l9N0P1RfSgUi8k9m9N0P1RfSgUi8k9m9N0P1RfTgUi8k9m0P1Q1SgUiWk9l9n0P1Q1SgUiWk9l9m0O0P1RfSgUi8k9l9N1SgUiWj9l9n0P1Q1SgUiWj9l9n0P1Q1SgUiWj9l9n0P1Q1SgUiWk9m0O0QThVj9l9n0O1Q1SgUhVj9l9n0O1Q1SgUhVj9l9n0O1Q1SgUhVj9l9O0SfThVj8l9m0O0Q1SfThVj8l9m0O0Q1SfThVj8l9N0P1RfSgUi8k9m9l9N0Q1SfThVj8l9m0O0Q1SfThVj8l9m0O0Q1SfThVj8l9m0O0Q1SgTh9n0P1RfThVj8k9m0O0Q1RfThVj8k9m0O0Q1RfThVj8k9m0O0Q1RfUiWkO1Q1TgUi8k9m0N0P1RfThUi8k9m0O0P1RfThUi8k9m0O0P1RfThV

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------

办 (蕟)
理 (螵):服务,广告,餐饮,租赁,运费,机械,医疗设备,钢铁,建材,煤炭,石油...等!  详情以下:
                耳关系:13 632 9550 98  小刘
扣  Q: 1 65 33 5 37 69
此信息长期有效!



--------------------------------------------------------------------------------------------------------------------------------------------------------------------------

0O0QeSgUi8k9l9N0P1ReSgUi8k9l9N0P1RfSgUi8k9l9N0P1RfSgVj8l9SgUi8k9m0O0P1RfThVi8k9m0O0P1Q1SgUiWj9l9n0P1Q1SgUiWj9lk9m0P1Q1SgUiWk9l9n0P1ReSgUi8k9l9N0Q1RfThVj8k9m0O0Qi8k9n0O1Q1SgUiVj9l9n0O1Q1SgUiVj9l9n0P1Q1SgUiVj9l9n0P1Q1SgUiW0Q1SgVj8l9m0O0Q1SgThVj8l9m0O0Q1SgThVj9l9n0O1Q1SgThVj9m0N0j8k9n0P1Q1SfThVj8k9m0O0Q1RfThVj8k9m0O0Q1RfThVj8l9m0O1ReSgUi8O0Q1ThVi8k9m0O0P1RfThVj8k9m0O0P1RfThVj8k9m0O0Q1RfThUi8k9m0O0Q1R1SfSgUi8k9l9N0P1RfSgUi8k9m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Q1SgUhVj9l9n0O1Q1SgUhVj9l9n0O1Q1SgUiVj9l9n0O1Q1SgUiVRfThWk9l9N0P1ReSgUi8kn0Q1SfThVj8l9m0O0Q1SgThVj8l9n0O1hVj8l9n0P1Q1SgUiWk9l9N0P1ReSgUi8k9l9N0P1ReSgUi8k9l9N0P1RfSgUm0O0Q1SgUiWk9l9n0P1Q1SgUiWk9l9N0P1ReSgUi8k9l9N0P1Re9m0O1Q1SgUiVj8k9m0O0P1RfThVj8k9m0O0P1RfThVj8k9m0O0Q1SgUieSgUj8l9m0O0Q1RfThVj8l9m0O0Q1SfThVj8l9m0O0Q1SfThVj8l9m0O0Q
harald | 14 Feb 11:48
Picon
Favicon
Gravatar

[PATCH] var.c: check for valid variable name before printing in "export -p"

From: Harald Hoyer <harald <at> redhat.com>

"export -p" prints all environment variables, without checking if the
environment variable is a valid dash variable name.

IMHO, the only valid usecase for "export -p" is to eval the output.

$ eval $(export -p); echo OK
OK

Without this patch the following test does error out with:

test.py:
import os
os.environ["test-test"]="test"
os.environ["test_test"]="test"
os.execv("./dash", [ './dash', '-c', 'eval $(export -p); echo OK' ])

$ python test.py
./dash: 1: export: test-test: bad variable name

Of course the results can be more evil, if the environment variable
name is crafted, that it injects valid shell code.
---
 src/var.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/var.c b/src/var.c
index 027beff..06771d3 100644
--- a/src/var.c
(Continue reading)

Eric Blake | 8 Feb 18:27
Picon
Favicon
Gravatar

bug in handling of ignored traps

Per POSIX requirements on trap, dash is properly refusing to let
non-interactive scripts reset signal handlers via trap if the shell was
started with an inherited ignored signal handler.  However, dash lies to
the user, making it impossible to tell if the user is invoking a shell
in an environment where a signal was inherited as ignored.  ksh and bash
are nicer about things, and at least let the user query whether a shell
is treating a particular signal as non-resettable.

This is important for shell scripts that WANT to guarantee a particular
behavior of SIGPIPE handling (such as this thread on writing a grep test
for covering the behavior of grep both with and without SIGPIPE
inherited as ignored:
https://lists.gnu.org/archive/html/bug-grep/2012-02/msg00016.html).

Bash behavior - you can learn about the ignored handler from the get-go:

$ (trap '' PIPE; bash -c 'trap; echo 0; trap "echo 1" PIPE; trap; \
     echo 2; kill -s PIPE $$; trap; echo 3')
trap -- '' SIGPIPE
0
trap -- '' SIGPIPE
2
trap -- '' SIGPIPE
3

Ksh behavior - you can learn about the ignored handler, but only after
trying to use something else:

$ (trap '' PIPE; ksh -c 'trap; echo 0; trap "echo 1" PIPE; trap; \
     echo 2; kill -s PIPE $$; trap; echo 3')
(Continue reading)

steve | 30 Jan 22:34

[BUG] apache CustomLog pipe to a python script with sys.stdin.read() behaves weirdly with dash as system shell

Hi,

I do not claim to understand what is happening here but I am reporting this as a
dash bug because I've seen this occur only with dash. Here is a description of
the problem:

The Apache module mod_log_config has a directive CustomLog[1] which lets you
send logs to a command rather than a file using the syntax like:

CustomLog "|/path/to/your/command" common

When apache executes, it then forks off a process for this command and executes
it using the default system shell.

I recently noticed that a python script that I had being using in this manner to
process logs for a long time now without any issues, suddenly started consuming
100% cpu, after a system update. When I investigated further, I realized that it
boiled down to a section of the script which was spinning the cpu. It did
something like:

import sys

while True:
    for line in sys.stdin:
        <do something with line>

so, it seemed like sys.stdin was not blocking. An strace proved me right and I
saw read() on stdin returning 0 even tho' no data was being written to the pipe.

After a lot of head-scratching and slow thinking I realized that the one thing
(Continue reading)


Gmane