Re: sed behavior

2011-06-15 Thread Otto Moerbeek
On Wed, Jun 15, 2011 at 07:44:20AM +0200, Otto Moerbeek wrote:

 On Tue, Jun 14, 2011 at 11:56:27PM +0200, sven falempin wrote:
 
  Hello,
  
  Indeed there is a small problem:
  
  # echo 'abf' | sed -E 's/[a$]/x/g'
  xbf
 
 That is expected. $ is only special when it ocurs as the list char of
 a re.
 
  # echo 'abf' | sed -E 's/a|$/x/g'
  x
 
 This is likely to be a real bug.
 
  
  String modification is done inside the 'case 0:'
  substitute(struct s_command *cp) in src/usr.bin/process.c
  
  But the problem may comme from regexec_e.
  
  Maybe openbsd devs should test another regexp code version ?
 
 Why? If we should change libs on every bug encountered, nothing will
 be left. 
 
 Anyway, thanks for the report.
 
   -Otto
 
  
  Hope it helps,
  Who still use sed anyway :)
  
  Regards.
  
  2011/6/12 Ingo Schwarze schwa...@usta.de
  
   Hi Nils,
  
   Nils Anspach wrote on Sun, Jun 12, 2011 at 12:49:42PM +0200:
  
I have an issue with sed. Why does
   
  echo 'ab' | sed -E 's/a|$/x/g'
   
give 'x' whereas
  
   I sense a bug here.
   Tracing a bit around process(),
   it looks like the first application of the s command
   yields dst = x continue_to_process = b\n,
   and then the second application
   appends \n to dst (should rather append b, i think).
   Maybe something is wrong here with character/pointer counting,
   but i'm somewhat out of time now for tracing.
  
   This is worth more investigation.
  
   Yours,
 Ingo
  
  
  
  
  -- 
  -
  () ascii ribbon campaign - against html e-mail
  /\

This dif fixes your problem here. Big question is of course: does it
break other cases?

-Otto

Index: process.c
===
RCS file: /cvs/src/usr.bin/sed/process.c,v
retrieving revision 1.15
diff -u -p -r1.15 process.c
--- process.c   27 Oct 2009 23:59:43 -  1.15
+++ process.c   15 Jun 2011 06:31:08 -
@@ -336,7 +336,9 @@ substitute(struct s_command *cp)
switch (n) {
case 0: /* Global */
do {
-   if (lastempty || match[0].rm_so != match[0].rm_eo) {
+   if (lastempty || match[0].rm_so != match[0].rm_eo ||
+   (match[0].rm_so == match[0].rm_eo 
+   match[0].rm_so  0)) {
/* Locate start of replaced string. */
re_off = match[0].rm_so;
/* Copy leading retained string. */



Re: sftp bug?

2011-06-15 Thread Alexander Hall
On 06/15/11 05:34, Corey wrote:
 On 06/14/2011 04:52 AM, LEVAI Daniel wrote:
 Hi!


 Uploading a directory recursively fails if it doesn't exist on the
 remote site:

 sftp  put -r nonexistent\ directory/
 Uploading nonexistent directory/ to /tmp/nonexistent directory
 Couldn't canonicalise: No such file or directory
 sftp  mkdir nonexistent\ directory/
 sftp  put -r nonexistent\ directory/
^^^ success

 It should create the directory first, and then copy the content, no?
 This is on -current:
 $ ssh -V
 OpenSSH_5.8, OpenSSL 1.0.0a 1 Jun 2010


 Daniel

 Did you try doing it with a directory without a space in it?  Not that
 the space shouldn't work, but it might narrow down the problem (as might
 grepping the source for that error message).
 

Also, I'd try without the trailing slash.



Re: sftp bug?

2011-06-15 Thread LEVAI Daniel
On Tue, Jun 14, 2011 at 22:34:46 -0500, Corey wrote:
 On 06/14/2011 04:52 AM, LEVAI Daniel wrote:
 Hi!
 
 
 Uploading a directory recursively fails if it doesn't exist on the
 remote site:
 
 sftp  put -r nonexistent\ directory/
 Uploading nonexistent directory/ to /tmp/nonexistent directory
 Couldn't canonicalise: No such file or directory
 sftp  mkdir nonexistent\ directory/
 sftp  put -r nonexistent\ directory/
^^^ success
 
 It should create the directory first, and then copy the content, no?
 This is on -current:
 $ ssh -V
 OpenSSH_5.8, OpenSSL 1.0.0a 1 Jun 2010
 
 
 Daniel
 
 Did you try doing it with a directory without a space in it?  Not
 that the space shouldn't work, but it might narrow down the problem
 (as might grepping the source for that error message).

Yep, it breaks when using a name without space, but it seems that this
is only reproducible with an ssh server running on Linux:
$ ssh -V
OpenSSH_5.8p1, OpenSSL 0.9.8r 8 Feb 2011

So the client is on OpenBSD (also 5.8), and the server is the Linux
version. This is the environment where the bug happens.


Daniel

-- 
LIVAI Daniel
PGP key ID = 0x83B63A8F
Key fingerprint = DBEC C66B A47A DFA2 792D  650C C69B BE4C 83B6 3A8F



Re: sftp bug?

2011-06-15 Thread LEVAI Daniel
On Wed, Jun 15, 2011 at 08:49:57 +0200, Alexander Hall wrote:
 On 06/15/11 05:34, Corey wrote:
  On 06/14/2011 04:52 AM, LEVAI Daniel wrote:
  Hi!
 
 
  Uploading a directory recursively fails if it doesn't exist on the
  remote site:
 
  sftp  put -r nonexistent\ directory/
  Uploading nonexistent directory/ to /tmp/nonexistent directory
  Couldn't canonicalise: No such file or directory
  sftp  mkdir nonexistent\ directory/
  sftp  put -r nonexistent\ directory/
 ^^^ success
 
  It should create the directory first, and then copy the content, no?
  This is on -current:
  $ ssh -V
  OpenSSH_5.8, OpenSSL 1.0.0a 1 Jun 2010
 
 
  Daniel
 
  Did you try doing it with a directory without a space in it?  Not that
  the space shouldn't work, but it might narrow down the problem (as might
  grepping the source for that error message).
  
 
 Also, I'd try without the trailing slash.

It doesn't matter if there is a trailing slash either.


Daniel

-- 
LIVAI Daniel
PGP key ID = 0x83B63A8F
Key fingerprint = DBEC C66B A47A DFA2 792D  650C C69B BE4C 83B6 3A8F



Re: sed behavior

2011-06-15 Thread Alexander Hall
On 06/15/11 08:35, Otto Moerbeek wrote:
 On Wed, Jun 15, 2011 at 07:44:20AM +0200, Otto Moerbeek wrote:
 
 On Tue, Jun 14, 2011 at 11:56:27PM +0200, sven falempin wrote:

 Hello,

 Indeed there is a small problem:

 # echo 'abf' | sed -E 's/[a$]/x/g'
 xbf

 That is expected. $ is only special when it ocurs as the list char of
 a re.

 # echo 'abf' | sed -E 's/a|$/x/g'
 x

 This is likely to be a real bug.


 String modification is done inside the 'case 0:'
 substitute(struct s_command *cp) in src/usr.bin/process.c

 But the problem may comme from regexec_e.

 Maybe openbsd devs should test another regexp code version ?

 Why? If we should change libs on every bug encountered, nothing will
 be left. 

 Anyway, thanks for the report.

  -Otto


 Hope it helps,
 Who still use sed anyway :)

 Regards.

 2011/6/12 Ingo Schwarze schwa...@usta.de

 Hi Nils,

 Nils Anspach wrote on Sun, Jun 12, 2011 at 12:49:42PM +0200:

 I have an issue with sed. Why does

   echo 'ab' | sed -E 's/a|$/x/g'

 give 'x' whereas

 I sense a bug here.
 Tracing a bit around process(),
 it looks like the first application of the s command
 yields dst = x continue_to_process = b\n,
 and then the second application
 appends \n to dst (should rather append b, i think).
 Maybe something is wrong here with character/pointer counting,
 but i'm somewhat out of time now for tracing.

 This is worth more investigation.

 Yours,
   Ingo




 -- 
 -
 () ascii ribbon campaign - against html e-mail
 /\
 
 This dif fixes your problem here. Big question is of course: does it
 break other cases?
 
   -Otto
 
 Index: process.c
 ===
 RCS file: /cvs/src/usr.bin/sed/process.c,v
 retrieving revision 1.15
 diff -u -p -r1.15 process.c
 --- process.c 27 Oct 2009 23:59:43 -  1.15
 +++ process.c 15 Jun 2011 06:31:08 -
 @@ -336,7 +336,9 @@ substitute(struct s_command *cp)
   switch (n) {
   case 0: /* Global */
   do {
 - if (lastempty || match[0].rm_so != match[0].rm_eo) {
 + if (lastempty || match[0].rm_so != match[0].rm_eo ||
 + (match[0].rm_so == match[0].rm_eo 
 + match[0].rm_so  0)) {
   /* Locate start of replaced string. */
   re_off = match[0].rm_so;
   /* Copy leading retained string. */
 

Looks ok to me (I believe the problem was that prior to the intodution
of -E, any matching '$' would always be in the first match.

The diff doesn't break any of the regression tests (not that there are
a lot of them). While at it, here's another one! :-)

/Alexander


Index: Makefile
===
RCS file: /cvs/src/regress/usr.bin/sed/Makefile,v
retrieving revision 1.2
diff -u -p -r1.2 Makefile
--- Makefile13 Oct 2008 13:27:33 -  1.2
+++ Makefile15 Jun 2011 06:55:26 -
@@ -3,7 +3,7 @@

 SED=   /usr/bin/sed

-REGRESS_TARGETS= sedtest hanoi math sierpinski
+REGRESS_TARGETS= sedtest hanoi math sierpinski eol

 sedtest:
sh ${.CURDIR}/$@.sh ${SED} $@.out
@@ -19,6 +19,10 @@ math:

 sierpinski:
${SED} -nf ${.CURDIR}/$@.sed ${.CURDIR}/$@.in  $@.out
+   diff ${.CURDIR}/$@.expected $@.out
+
+eol:
+   ${SED} -Ef ${.CURDIR}/$@.sed ${.CURDIR}/$@.in  $@.out
diff ${.CURDIR}/$@.expected $@.out

 CLEANFILES+=*.out lines* script*
Index: eol.expected
===
RCS file: eol.expected
diff -N eol.expected
--- /dev/null   1 Jan 1970 00:00:00 -
+++ eol.expected15 Jun 2011 06:55:26 -
@@ -0,0 +1 @@
+x
Index: eol.in
===
RCS file: eol.in
diff -N eol.in
--- /dev/null   1 Jan 1970 00:00:00 -
+++ eol.in  15 Jun 2011 06:55:26 -
@@ -0,0 +1 @@
+
Index: eol.sed
===
RCS file: eol.sed
diff -N eol.sed
--- /dev/null   1 Jan 1970 00:00:00 -
+++ eol.sed 15 Jun 2011 06:55:26 -
@@ -0,0 +1 @@
+s/a|$/x/g



Re: sed behavior

2011-06-15 Thread Alexander Hall
On 06/15/11 08:58, Alexander Hall wrote:
 On 06/15/11 08:35, Otto Moerbeek wrote:
 On Wed, Jun 15, 2011 at 07:44:20AM +0200, Otto Moerbeek wrote:

 On Tue, Jun 14, 2011 at 11:56:27PM +0200, sven falempin wrote:

 Hello,

 Indeed there is a small problem:

 # echo 'abf' | sed -E 's/[a$]/x/g'
 xbf

 That is expected. $ is only special when it ocurs as the list char of
 a re.

 # echo 'abf' | sed -E 's/a|$/x/g'
 x

 This is likely to be a real bug.


 String modification is done inside the 'case 0:'
 substitute(struct s_command *cp) in src/usr.bin/process.c

 But the problem may comme from regexec_e.

 Maybe openbsd devs should test another regexp code version ?

 Why? If we should change libs on every bug encountered, nothing will
 be left. 

 Anyway, thanks for the report.

 -Otto


 Hope it helps,
 Who still use sed anyway :)

 Regards.

 2011/6/12 Ingo Schwarze schwa...@usta.de

 Hi Nils,

 Nils Anspach wrote on Sun, Jun 12, 2011 at 12:49:42PM +0200:

 I have an issue with sed. Why does

   echo 'ab' | sed -E 's/a|$/x/g'

 give 'x' whereas

 I sense a bug here.
 Tracing a bit around process(),
 it looks like the first application of the s command
 yields dst = x continue_to_process = b\n,
 and then the second application
 appends \n to dst (should rather append b, i think).
 Maybe something is wrong here with character/pointer counting,
 but i'm somewhat out of time now for tracing.

 This is worth more investigation.

 Yours,
   Ingo




 -- 
 -
 () ascii ribbon campaign - against html e-mail
 /\

 This dif fixes your problem here. Big question is of course: does it
 break other cases?

  -Otto

 Index: process.c
 ===
 RCS file: /cvs/src/usr.bin/sed/process.c,v
 retrieving revision 1.15
 diff -u -p -r1.15 process.c
 --- process.c27 Oct 2009 23:59:43 -  1.15
 +++ process.c15 Jun 2011 06:31:08 -
 @@ -336,7 +336,9 @@ substitute(struct s_command *cp)
  switch (n) {
  case 0: /* Global */
  do {
 -if (lastempty || match[0].rm_so != match[0].rm_eo) {
 +if (lastempty || match[0].rm_so != match[0].rm_eo ||
 +(match[0].rm_so == match[0].rm_eo 
 +match[0].rm_so  0)) {
  /* Locate start of replaced string. */
  re_off = match[0].rm_so;
  /* Copy leading retained string. */

 
 Looks ok to me (I believe the problem was that prior to the intodution
 of -E, any matching '$' would always be in the first match.
 
 The diff doesn't break any of the regression tests (not that there are
 a lot of them). While at it, here's another one! :-)

Hmmm, looking closer I guess this should rather be a part of the sedtest
target...



Re: sed behavior

2011-06-15 Thread Alexander Hall
On 06/15/11 08:35, Otto Moerbeek wrote:
 On Wed, Jun 15, 2011 at 07:44:20AM +0200, Otto Moerbeek wrote:
 
 On Tue, Jun 14, 2011 at 11:56:27PM +0200, sven falempin wrote:

 Hello,

 Indeed there is a small problem:

 # echo 'abf' | sed -E 's/[a$]/x/g'
 xbf

 That is expected. $ is only special when it ocurs as the list char of
 a re.

 # echo 'abf' | sed -E 's/a|$/x/g'
 x

 This is likely to be a real bug.


 String modification is done inside the 'case 0:'
 substitute(struct s_command *cp) in src/usr.bin/process.c

 But the problem may comme from regexec_e.

 Maybe openbsd devs should test another regexp code version ?

 Why? If we should change libs on every bug encountered, nothing will
 be left. 

 Anyway, thanks for the report.

  -Otto


 Hope it helps,
 Who still use sed anyway :)

 Regards.

 2011/6/12 Ingo Schwarze schwa...@usta.de

 Hi Nils,

 Nils Anspach wrote on Sun, Jun 12, 2011 at 12:49:42PM +0200:

 I have an issue with sed. Why does

   echo 'ab' | sed -E 's/a|$/x/g'

 give 'x' whereas

 I sense a bug here.
 Tracing a bit around process(),
 it looks like the first application of the s command
 yields dst = x continue_to_process = b\n,
 and then the second application
 appends \n to dst (should rather append b, i think).
 Maybe something is wrong here with character/pointer counting,
 but i'm somewhat out of time now for tracing.

 This is worth more investigation.

 Yours,
   Ingo




 -- 
 -
 () ascii ribbon campaign - against html e-mail
 /\
 
 This dif fixes your problem here. Big question is of course: does it
 break other cases?

It differs from perl like this:

$ echo 'l1_1' | perl -pe 's/1|$/X/g'
lX_XX
$ echo 'l1_1' | sed -E 's/1|$/X/g'
lX_X

Meaning we don't hit that final '$' if the last match went to eol.

/Alexander



Re: cmpci(4) and S/PDIF?

2011-06-15 Thread Alexandre Ratchov
On Fri, Jun 10, 2011 at 03:36:48PM +, Christian Weisgerber wrote:
 Jacob Meuser jake...@sdf.org wrote:
 
   Strangely, AC3/DTS pass-through does *not* work.
  
  there's this comment in cmpci.c:
  
   /* disable ac3 and 24 and 32 bit s/pdif modes */
  
  and then the relevant register bits are cleared.  feel free to play
  with making it work ;)
 
 I would, but there shouldn't be anything required to make it work.
 The point of AC3/DTS pass-through mode is that it sends what looks
 like 16-bit stereo audio at the S/PDIF level.  It's only the receiver
 that, on seeing a signature bit pattern, re-interprets the data and
 decodes it according to AC3 or DTS.
 

audio is not only about data transfers, it's also a clock source. AC3
data could be sent on the wire, but to make audio work at least the
clock must be properly handled.

So, I don't even understand how AC3 would work at all. I mean, a lot
of programs (ie all using sio_onmove(3)) expect that one second of
s16le at 48kHz be exactly 192000 bytes of data. If AC3 is used, that
wouldn't be true anymore (AC3 is 320kbit/s iirc) and audio would be
broken. And this can't be fixed without adding AC3 specific code.

AFAICS, pass-through would be better outside the audio subsystem,
after all AC3/DTS and friends is to transmit opaque data from one
computer to another without processing it. While audio interfaces are
to play and/or capture analog signals to process them.

 We don't use any AC3 mode for azalia(4) either and pass-through
 works there.
 

I bet it only works in few special cases, probably because the clock
is not involved

-- Alexandre



Re: dhcpd sending sync message failed: no route to host

2011-06-15 Thread Stuart Henderson
On 2011-06-15, Zak Elep zak.e...@orangeandbronze.com wrote:
 On Tue, Jun 14, 2011 at 9:17 PM, Zak Elep zak.e...@orangeandbronze.com
 wrote:
 The firewalls are on the same subnet, and mtrace tells me they are
 directly connected.

 And I tried 'dhcpd -y rl1 -Y ip-address rl1' now, sync seems to work
 without trouble (there's no no route to host message.)  Am I missing
 something here? Or could I have stumbled upon a bug?

The top two reasons for no route to host are

1. not having a valid route to the host, which it sounds like
you have covered (the default 'reject' route for multicast;
setting 'multicast_host=YES' in rc.conf.local is enough for
most people).

confirm with 'route -n get 224.0.1.240'

2. a PF rule blocking the traffic

confirm by using 'log' on your block rules, and watching
'tcpdump -neipflog0'



Re: dhcpd sending sync message failed: no route to host

2011-06-15 Thread Zak Elep
On Wed, Jun 15, 2011 at 4:11 PM, Stuart Henderson s...@spacehopper.org
wrote:
 2. a PF rule blocking the traffic

 confirm by using 'log' on your block rules, and watching
 'tcpdump -neipflog0'

This.  I have a default deny block log rule already in place, and
while a tcpdump watch doesn't yield any block of dhcp traffic,
disabling the block log rule allows the sync to happen.

I was being overly restrictive even on the firewall, specifying only a
select number of ports for it to allow outgoing connections to;
relaxing that with a pass log on egress allowed the firewalls to
sync.

--
Zak B. Elep || orangeandbronze.com
1486 7957 454D E529 E4F1  F75E 5787 B1FD FA53 851D



Re: sed behavior

2011-06-15 Thread sven falempin
Hi,

So what 'sed' shall do when  match[0].rm_so i==0 ?

Regards.

2011/6/15 Alexander Hall ha...@openbsd.org

 On 06/15/11 08:35, Otto Moerbeek wrote:
  On Wed, Jun 15, 2011 at 07:44:20AM +0200, Otto Moerbeek wrote:
 
  On Tue, Jun 14, 2011 at 11:56:27PM +0200, sven falempin wrote:
 
  Hello,
 
  Indeed there is a small problem:
 
  # echo 'abf' | sed -E 's/[a$]/x/g'
  xbf
 
  That is expected. $ is only special when it ocurs as the list char of
  a re.
 
  # echo 'abf' | sed -E 's/a|$/x/g'
  x
 
  This is likely to be a real bug.
 
 
  String modification is done inside the 'case 0:'
  substitute(struct s_command *cp) in src/usr.bin/process.c
 
  But the problem may comme from regexec_e.
 
  Maybe openbsd devs should test another regexp code version ?
 
  Why? If we should change libs on every bug encountered, nothing will
  be left.
 
  Anyway, thanks for the report.
 
   -Otto
 
 
  Hope it helps,
  Who still use sed anyway :)
 
  Regards.
 
  2011/6/12 Ingo Schwarze schwa...@usta.de
 
  Hi Nils,
 
  Nils Anspach wrote on Sun, Jun 12, 2011 at 12:49:42PM +0200:
 
  I have an issue with sed. Why does
 
echo 'ab' | sed -E 's/a|$/x/g'
 
  give 'x' whereas
 
  I sense a bug here.
  Tracing a bit around process(),
  it looks like the first application of the s command
  yields dst = x continue_to_process = b\n,
  and then the second application
  appends \n to dst (should rather append b, i think).
  Maybe something is wrong here with character/pointer counting,
  but i'm somewhat out of time now for tracing.
 
  This is worth more investigation.
 
  Yours,
Ingo
 
 
 
 
  --
 
 -
  () ascii ribbon campaign - against html e-mail
  /\
 
  This dif fixes your problem here. Big question is of course: does it
  break other cases?

 It differs from perl like this:

 $ echo 'l1_1' | perl -pe 's/1|$/X/g'
 lX_XX
 $ echo 'l1_1' | sed -E 's/1|$/X/g'
 lX_X

 Meaning we don't hit that final '$' if the last match went to eol.

 /Alexander




-- 
-
() ascii ribbon campaign - against html e-mail
/\



Re: sed behavior

2011-06-15 Thread Otto Moerbeek
On Wed, Jun 15, 2011 at 09:50:29AM +0200, Alexander Hall wrote:

 On 06/15/11 08:35, Otto Moerbeek wrote:
  On Wed, Jun 15, 2011 at 07:44:20AM +0200, Otto Moerbeek wrote:
  
  On Tue, Jun 14, 2011 at 11:56:27PM +0200, sven falempin wrote:
 
  Hello,
 
  Indeed there is a small problem:
 
  # echo 'abf' | sed -E 's/[a$]/x/g'
  xbf
 
  That is expected. $ is only special when it ocurs as the list char of
  a re.
 
  # echo 'abf' | sed -E 's/a|$/x/g'
  x
 
  This is likely to be a real bug.
 
 
  String modification is done inside the 'case 0:'
  substitute(struct s_command *cp) in src/usr.bin/process.c
 
  But the problem may comme from regexec_e.
 
  Maybe openbsd devs should test another regexp code version ?
 
  Why? If we should change libs on every bug encountered, nothing will
  be left. 
 
  Anyway, thanks for the report.
 
 -Otto
 
 
  Hope it helps,
  Who still use sed anyway :)
 
  Regards.
 
  2011/6/12 Ingo Schwarze schwa...@usta.de
 
  Hi Nils,
 
  Nils Anspach wrote on Sun, Jun 12, 2011 at 12:49:42PM +0200:
 
  I have an issue with sed. Why does
 
echo 'ab' | sed -E 's/a|$/x/g'
 
  give 'x' whereas
 
  I sense a bug here.
  Tracing a bit around process(),
  it looks like the first application of the s command
  yields dst = x continue_to_process = b\n,
  and then the second application
  appends \n to dst (should rather append b, i think).
  Maybe something is wrong here with character/pointer counting,
  but i'm somewhat out of time now for tracing.
 
  This is worth more investigation.
 
  Yours,
Ingo
 
 
 
 
  -- 
  -
  () ascii ribbon campaign - against html e-mail
  /\
  
  This dif fixes your problem here. Big question is of course: does it
  break other cases?
 
 It differs from perl like this:
 
 $ echo 'l1_1' | perl -pe 's/1|$/X/g'
 lX_XX
 $ echo 'l1_1' | sed -E 's/1|$/X/g'
 lX_X
 
 Meaning we don't hit that final '$' if the last match went to eol.
 
 /Alexander

Right.

I took a look at freebsd, thay have some patches in this area. But
applying the changes did not have the desired effect. Have to look deeper.

-Otto



Re: sed behavior

2011-06-15 Thread Otto Moerbeek
On Wed, Jun 15, 2011 at 12:02:44PM +0200, sven falempin wrote:

 Hi,
 
 So what 'sed' shall do when  match[0].rm_so i==0 ?

lastempty is true in that case.

-Otto



Re: sed behavior

2011-06-15 Thread Otto Moerbeek
On Wed, Jun 15, 2011 at 12:17:09PM +0200, Otto Moerbeek wrote:

  It differs from perl like this:
  
  $ echo 'l1_1' | perl -pe 's/1|$/X/g'
  lX_XX
  $ echo 'l1_1' | sed -E 's/1|$/X/g'
  lX_X
  
  Meaning we don't hit that final '$' if the last match went to eol.
  
  /Alexander
 
 Right.
 
 I took a look at freebsd, thay have some patches in this area. But
 applying the changes did not have the desired effect. Have to look deeper.
 
   -Otto

One conclusion: if I port the complete sed from freebsd, it also does
not substitute the eol in your testcase. So no wonder incorporating
the changes into OpenBSD does not fix this case.

-Otto



Re: 4.9 net.inet.tcp

2011-06-15 Thread Kevin Chadwick
On Tue, 14 Jun 2011 22:30:51 -0500
Corey wrote:

 Why?  Because people on this list grew weary of answering questions 
 about what they should be set to, or asking why people (unnecessarily) 
 tweaked them? :)
 
 Seriously, the OpenBSD devs tend to eschew knobs, and they probably 
 found a good way to eliminate these, as someone stated.  But then again 
 there _were_ an awful lot of those questions...

I'm sure that's part of the motivation but these are now automatically
and dynamically tuned now. There was some discussion about bringing
them back for particular cases as an override. Not sure or can't
remember what the outcome was, many would leave them on and get worse
performance as a result and I think the particular case brought up was
already catered for.

It's in the archives. I think Claudios posts likely give the answers.



Re: Support for Intel X520-T2 10GbaseT cards

2011-06-15 Thread Peter Hallin
On 2011-06-15 04:26, Jonathan Gray wrote:
 Claudio has recently synced ix to a newer version of the Intel code,
 if you can try again with -current this should work.

Great, thanks. I tried it out today, but the performance wasn't exactly
what I had expected.

This is a dual port card, so I bridged ix0 with ix1 and ran iperf
between two hosts through the card. The hosts were connected with
1Gbase as I have no other 10Gbase cards.

It only got up to about 450 Mbit/s (standard TCP iperf test) and there
was an unbalance between ix0 and ix1 when it came to interrupts. ix1
only got up to 4000 intr/s whereas ix1 got up to 13000 intr/s (when
monitoring live with systat vmstat). The CPU intr usage was around 50-60%.

Could this possibly be related to the ppb problems we've seen with em(4)
cards?

//Peter

vmstat -iz:

interrupt   total rate
irq0/clock 345997  100
irq144/acpi000
irq96/ppb2  00
irq97/ix0 1046011  302
irq96/ix1  327045   94
irq97/ppb3  00
irq112/em0  52826   15
irq113/em1  00
irq96/ppb7  00
irq98/uhci0   4440
irq99/uhci1 00
irq98/uhci2 00
irq99/uhci3 00
irq98/ehci0 20
irq100/pciide0   14620
irq101/ahci010
irq101/ichiic0  00
irq145/com0 00
irq146/com1 00
irq147/pckbc0   00
Total 1773788  513

dmesg:

OpenBSD 4.9-current (GENERIC) #0: Wed Jun 15 10:51:41 CEST 2011
root@lab:/usr/src/sys/arch/amd64/compile/GENERIC
RTC BIOS diagnostic error 3
real mem = 1065857024 (1016MB)
avail mem = 1023438848 (976MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.5 @ 0x3fa32000 (58 entries)
bios0: vendor Intel Corporation version S5000.86B.11.00.0096.011320091422 
date 01/13/2009
bios0: Intel S5000VSA
acpi0 at bios0: rev 2
acpi0: sleep states S0 S1 S4 S5
acpi0: tables DSDT FACP APIC SPCR HPET MCFG SSDT SSDT SSDT HEST BERT ERST EINJ
acpi0: wakeup devices SLPB(S5) P32_(S5) PS2M(S1) PS2K(S1) UAR1(S5) UAR2(S5) 
UHC1(S1) UHC2(S1) UHC3(S1) UHC4(S1) EHCI(S1) PCIE(S5) PCIO(S5) PCIP(S5) PCIQ(S5)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Xeon(R) CPU E5420 @ 2.50GHz, 2494.10 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,DCA,SSE4.1,XSAVE,NXE,LONG
cpu0: 6MB 64b/line 16-way L2 cache
cpu0: apic clock running at 332MHz
cpu at mainbus0: not configured
cpu at mainbus0: not configured
cpu at mainbus0: not configured
ioapic0 at mainbus0: apid 8 pa 0xfec0, version 20, 24 pins
ioapic1 at mainbus0: apid 9 pa 0xfec8, version 20, 24 pins
acpihpet0 at acpi0: 14318179 Hz
acpimcfg0 at acpi0 addr 0xa000, bus 0-255
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 9 (P32_)
acpiprt2 at acpi0: bus 8 (PEX0)
acpiprt3 at acpi0: bus -1 (PEX1)
acpiprt4 at acpi0: bus -1 (PEX2)
acpiprt5 at acpi0: bus -1 (PEX3)
acpiprt6 at acpi0: bus 1 (PCIE)
acpiprt7 at acpi0: bus 6 (PCIE)
acpiprt8 at acpi0: bus 2 (PCIW)
acpiprt9 at acpi0: bus 3 (PCIO)
acpiprt10 at acpi0: bus 4 (PCIP)
acpiprt11 at acpi0: bus 5 (PCIQ)
acpicpu0 at acpi0: C2, C1, PSS
acpibtn0 at acpi0: SLPB
ipmi at mainbus0 not configured
cpu0: Enhanced SpeedStep 2494 MHz: speeds: 2497, 1998 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 Intel 5000V Host rev 0xb1
ppb0 at pci0 dev 2 function 0 Intel 5000 PCIE x8 rev 0xb1
pci1 at ppb0 bus 1
ppb1 at pci1 dev 0 function 0 Intel 6321ESB PCIE rev 0x01
pci2 at ppb1 bus 2
ppb2 at pci2 dev 0 function 0 Intel 6321ESB PCIE rev 0x01: apic 8 int 16
pci3 at ppb2 bus 3
ix0 at pci3 dev 0 function 0 Intel 82599 T3 rev 0x01: apic 8 int 17, address 
00:1b:21:93:a6:3c
ix1 at pci3 dev 0 function 1 Intel 82599 T3 rev 0x01: apic 8 int 16, address 
00:1b:21:93:a6:3d
ppb3 at pci2 dev 1 function 0 Intel 6321ESB PCIE rev 0x01: apic 8 int 17
pci4 at ppb3 bus 4
ppb4 at pci2 dev 2 function 0 Intel 6321ESB PCIE rev 0x01
pci5 at ppb4 bus 5
em0 at pci5 dev 0 function 0 Intel PRO/1000 PT (80003ES2) rev 0x01: apic 8 
int 18, address 00:15:17:60:97:fc
em1 at pci5 dev 0 function 1 Intel PRO/1000 PT (80003ES2) rev 0x01: apic 8 
int 19, address 00:15:17:60:97:fd
ppb5 at pci1 dev 0 function 3 Intel 6321ESB PCIE-PCIX rev 0x01
pci6 at ppb5 bus 6
ppb6 at pci0 dev 3 function 0 Intel 5000 PCIE rev 0xb1
pci7 at ppb6 bus 7
pchb1 at pci0 dev 16 function 0 Intel 5000 Error Reporting rev 0xb1
pchb2 at pci0 dev 

Re: Support for Intel X520-T2 10GbaseT cards

2011-06-15 Thread Jonathan Gray
On Wed, Jun 15, 2011 at 12:40:32PM +0200, Peter Hallin wrote:
 On 2011-06-15 04:26, Jonathan Gray wrote:
  Claudio has recently synced ix to a newer version of the Intel code,
  if you can try again with -current this should work.
 
 Great, thanks. I tried it out today, but the performance wasn't exactly
 what I had expected.
 
 This is a dual port card, so I bridged ix0 with ix1 and ran iperf
 between two hosts through the card. The hosts were connected with
 1Gbase as I have no other 10Gbase cards.
 
 It only got up to about 450 Mbit/s (standard TCP iperf test) and there
 was an unbalance between ix0 and ix1 when it came to interrupts. ix1
 only got up to 4000 intr/s whereas ix1 got up to 13000 intr/s (when
 monitoring live with systat vmstat). The CPU intr usage was around 50-60%.
 
 Could this possibly be related to the ppb problems we've seen with em(4)
 cards?

Yes this seems low indeed.  You could try use rdomains and route exec
with a cable between the two ports to make packets go over the interfaces
if you don't have another host with 10G interfaces.

If you've had ppb problems with em I'd imagine they would affect ix as well
if it is sitting behind the same ppb.



Re: Support for Intel X520-T2 10GbaseT cards

2011-06-15 Thread FRLinux
On Wed, Jun 15, 2011 at 11:40 AM, Peter Hallin peter.hal...@ldc.lu.se wrote:
 It only got up to about 450 Mbit/s (standard TCP iperf test) and there
 was an unbalance between ix0 and ix1 when it came to interrupts. ix1
 only got up to 4000 intr/s whereas ix1 got up to 13000 intr/s (when
 monitoring live with systat vmstat). The CPU intr usage was around 50-60%.

Just out of curiosity, which iperf settings did you use?

I know this is on a Linux box, but just out of interest, I get full
speed there:

iperf -c xxx.xxx.xxx.xxx -i 5

Client connecting to xxx.xxx.xxx.xxx, TCP port 5001
TCP window size: 16.0 KByte (default)

[  3] local xxx.xxx.xxx.xxx port 47035 connected with xxx.xxx.xxx.xxx port 5001
[ ID] Interval   Transfer Bandwidth
[  3]  0.0- 5.0 sec  5.47 GBytes  9.39 Gbits/sec
[  3]  0.0-10.0 sec  10.9 GBytes  9.40 Gbits/sec

Cards are:
Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection (rev 01)
driver: ixgbe
version: 2.0.44-k2
firmware-version: 0.9-3
bus-info: :05:00.0

Cheers,
Steph



relayd, not more than 59 redirects?

2011-06-15 Thread Marco Fretz
Hi,

I'm using relayd as inbound loadbalancer for about 50 websites and
webservices, https and http. All worked fine in the past few years.
I'm on OpenBSD 4.7 Generic. Currently I've configured 59 redirects.
They are working as expected but as soon as I add another redirect in
the config the last redirect stays down forever and no checks are made
for the table (verified via tcpdump on interface).

# relayd show sum
1   redirectXdown
1   table   X:8082  empty
1   host172.16.17.193   0.00%   down
2   host172.16.17.194   0.00%   down
2   redirectX  active
2   table   X:80  active (2 hosts)
3   host82.82.97.209100.00% up
4   host82.82.97.210100.00% up
3   redirectX active
3   table   X:80  active (2 hosts)
5   host82.82.97.20996.15%  up
6   host82.82.97.210100.00% up
4   redirectXactive
4   table   X:8001active (2 hosts)
7   host82.82.97.20992.31%  up
8   host82.82.97.21092.31%  up

57  redirectX   active
57  table   X:80
active (2 hosts)
113 host172.16.12.148   92.31%  up
114 host172.16.12.149   92.31%  up
58  redirectX  active
58  table  X:8443
active (2 hosts)
115 host172.16.12.148   92.31%  up
116 host172.16.12.149   92.31%  up
59  redirectwebhosting_http active
59  table   webhosting:80   active (2 hosts)
117 host172.16.12.3 96.15%  up
118 host172.16.12.4 100.00% up
60  redirectwebhosting_httpsdown
stays down for ever
60  table   webhosting:443  empty
119 host172.16.12.3 0.00%   down
120 host172.16.12.4 0.00%   down

When I remove any redirect in the config (to reduce number of total
configured redirects) and relayctl reload the last service gets
checked immediately (verified via tcpdump) and is up:

...
58  redirectwebhosting_http active
58  table   webhosting:80   active (2 hosts)
115 host172.16.12.3 50.00%  up
116 host172.16.12.4 100.00% up
59  redirectwebhosting_httpsdown
59  table   webhosting:443  active (2 hosts)
117 host172.16.12.3 50.00%  up
118 host172.16.12.4 50.00%  up

my config looks like this:

log all
interval 10
timeout 1000
...
addr_LBL_hosting=88.82.97.14
...
host_SAM=172.16.12.3
host_DEAN=172.16.12.4
...
table webhosting { $host_SAM, $host_DEAN }

...
redirect webhosting_http {
listen on $addr_LBL_hosting port http
tag RELAYD
sticky-address
forward to webhosting check http / code 200
}
redirect webhosting_https {
listen on $addr_LBL_hosting port https
tag RELAYD
sticky-address
forward to webhosting check https / code 200
}



any ideas? I really looks like a hard-coded limit as I cannot find any
limit setting in the man page... Or is it a bug?


Thanks a lot
best regards
Marco



Re: sftp bug?

2011-06-15 Thread Jan Stary
On Jun 15 08:51:27, LEVAI Daniel wrote:
 On Tue, Jun 14, 2011 at 22:34:46 -0500, Corey wrote:
  On 06/14/2011 04:52 AM, LEVAI Daniel wrote:
  Hi!
  
  
  Uploading a directory recursively fails if it doesn't exist on the
  remote site:
  
  sftp  put -r nonexistent\ directory/
  Uploading nonexistent directory/ to /tmp/nonexistent directory
  Couldn't canonicalise: No such file or directory
  sftp  mkdir nonexistent\ directory/
  sftp  put -r nonexistent\ directory/
 ^^^ success
  
  It should create the directory first, and then copy the content, no?
  This is on -current:
  $ ssh -V
  OpenSSH_5.8, OpenSSL 1.0.0a 1 Jun 2010
  
  
  Daniel
  
  Did you try doing it with a directory without a space in it?  Not
  that the space shouldn't work, but it might narrow down the problem
  (as might grepping the source for that error message).
 
 Yep, it breaks when using a name without space, but it seems that this
 is only reproducible with an ssh server running on Linux:
 $ ssh -V
 OpenSSH_5.8p1, OpenSSL 0.9.8r 8 Feb 2011
 
 So the client is on OpenBSD (also 5.8), and the server is the Linux
 version. This is the environment where the bug happens.

It works fine with an OpenBSD sftp server:

$ mkdir '/tmp/my dir'
$ sftp localhost
hans@localhost's password: 
Connected to localhost.
sftp put -r /tmp/my\ dir
Uploading /tmp/my dir/ to /home/hans/my dir
sftp version
SFTP protocol version 3
sftp ^D
$ ssh -V
OpenSSH_5.8, OpenSSL 1.0.0a 1 Jun 2010
$ uname -a
OpenBSD stary.dhcp.fjfi.cvut.cz 4.9 GENERIC.MP#794 i386

It also works with a linux client and obsd sevrer.

So it's probably the Linux server's problem.  Indeed, grepping
the source shows that the error message appears in exactly one
place, namely

$ grep Couldn't canonicalise *
sftp-client.c:  error(Couldn't canonicalise: %s, fx2txt(status));

which is

if (type == SSH2_FXP_STATUS) {
u_int status = buffer_get_int(msg);
error(Couldn't canonicalise: %s, fx2txt(status));
/* ... */
}

That's the server reporting a problem status to the client.

Trying with a Linux server:

sftp put -r /tmp/my\ dir/
Uploading /tmp/my dir/ to /home/jsta6559/my dir
Couldn't canonicalise: No such file or directory
Unable to canonicalise path /home/jsta6559/my dir

The server cannot resolve the absolute canonicalized name of the dir
to be uploaded if the dir does not already exist; it seems irrelevant
whether the dir name is nice or not (I have tried both 'dir' and 'my
dir', wit the same results).

Jan



Re: relayd, not more than 59 redirects?

2011-06-15 Thread Marco Fretz
Hi,

Just upgraded to 4.9 and problem is solved, now. I read in the changelog,
there was a bug till 4.8 and solved in 4.9. Moving to 4.9 was  good idea
anyway as I still used 4.7 :-)

Thanks for the off-list replies...

Marco

On Jun 15, 2011, at 3:32 PM, Marco Fretz wrote:

 Hi,

 I'm using relayd as inbound loadbalancer for about 50 websites and
 webservices, https and http. All worked fine in the past few years.
 I'm on OpenBSD 4.7 Generic. Currently I've configured 59 redirects.
 They are working as expected but as soon as I add another redirect in
 the config the last redirect stays down forever and no checks are made
 for the table (verified via tcpdump on interface).

 # relayd show sum
 1   redirectXdown
 1   table   X:8082  empty
 1   host172.16.17.193   0.00%   down
 2   host172.16.17.194   0.00%   down
 2   redirectX  active
 2   table   X:80  active (2 hosts)
 3   host82.82.97.209100.00% up
 4   host82.82.97.210100.00% up
 3   redirectX active
 3   table   X:80  active (2 hosts)
 5   host82.82.97.20996.15%  up
 6   host82.82.97.210100.00% up
 4   redirectXactive
 4   table   X:8001active (2 hosts)
 7   host82.82.97.20992.31%  up
 8   host82.82.97.21092.31%  up
 
 57  redirectX   active
 57  table   X:80
 active (2 hosts)
 113 host172.16.12.148   92.31%  up
 114 host172.16.12.149   92.31%  up
 58  redirectX  active
 58  table  X:8443
 active (2 hosts)
 115 host172.16.12.148   92.31%  up
 116 host172.16.12.149   92.31%  up
 59  redirectwebhosting_http active
 59  table   webhosting:80   active (2
hosts)
 117 host172.16.12.3 96.15%  up
 118 host172.16.12.4 100.00% up
 60  redirectwebhosting_httpsdown
stays down for ever
 60  table   webhosting:443  empty
 119 host172.16.12.3 0.00%   down
 120 host172.16.12.4 0.00%   down

 When I remove any redirect in the config (to reduce number of total
 configured redirects) and relayctl reload the last service gets
 checked immediately (verified via tcpdump) and is up:

 ...
 58  redirectwebhosting_http active
 58  table   webhosting:80   active (2
hosts)
 115 host172.16.12.3 50.00%  up
 116 host172.16.12.4 100.00% up
 59  redirectwebhosting_httpsdown
 59  table   webhosting:443  active (2
hosts)
 117 host172.16.12.3 50.00%  up
 118 host172.16.12.4 50.00%  up

 my config looks like this:

 log all
 interval 10
 timeout 1000
 ...
 addr_LBL_hosting=88.82.97.14
 ...
 host_SAM=172.16.12.3
 host_DEAN=172.16.12.4
 ...
 table webhosting { $host_SAM, $host_DEAN }

 ...
 redirect webhosting_http {
listen on $addr_LBL_hosting port http
tag RELAYD
sticky-address
forward to webhosting check http / code 200
 }
 redirect webhosting_https {
listen on $addr_LBL_hosting port https
tag RELAYD
sticky-address
forward to webhosting check https / code 200
 }
 


 any ideas? I really looks like a hard-coded limit as I cannot find any
 limit setting in the man page... Or is it a bug?


 Thanks a lot
 best regards
 Marco



man cp: -i versus -f

2011-06-15 Thread Jan Stary
The manpage of cp says

 -f  For each existing destination pathname, remove it and create a
 new file, without prompting for confirmation, regardless of its
 permissions.  This option overrides any use of -i.

 -i  Write a prompt to the standard error output before copying a file
 that would overwrite an existing file.  If the response from the
 standard input begins with the character `y', the file copy is
 attempted.

but that isnot what cp actually does:

$ rm -f echo bar
$ echo new  foo
$ echo old  bar
$ cp -fi foo bar
overwrite bar? n
$ cat bar
old

Accoording to the manpage, the '-f' should have overrided the '-i'.
Instead, it asked for confirmation, which said 'n', and cp(1) did
not copy foo over bar, as it still has the old content.

Jan



Re: man cp: -i versus -f

2011-06-15 Thread Boudewijn Dijkstra

Op Wed, 15 Jun 2011 16:52:12 +0200 schreef Jan Stary h...@stare.cz:

The manpage of cp says

 -f	 For each existing destination pathname, remove it and  
create a

 new file, without prompting for confirmation, regardless of its
 permissions.  This option overrides any use of -i.

 -i	 Write a prompt to the standard error output before copying  
a file

 that would overwrite an existing file.  If the response from the
 standard input begins with the character `y', the file copy is
 attempted.

but that isnot what cp actually does:

$ rm -f echo bar
$ echo new  foo
$ echo old  bar
$ cp -fi foo bar
overwrite bar? n
$ cat bar
old

Accoording to the manpage, the '-f' should have overrided the '-i'.
Instead, it asked for confirmation, which said 'n', and cp(1) did
not copy foo over bar, as it still has the old content.


Manpage has been like this forever.  Looks like the behaviour has been  
bugged since 1999:


--- src/bin/cp/cp.c 1998/07/03 17:43:56 1.12
+++ src/bin/cp/cp.c 1999/05/06 18:19:45 1.13
@@ -91,7 +91,7 @@ static char rcsid[] = $OpenBSD: cp.c,v 1.12 1998/07/0
 PATH_T to = { to.p_path,  };

 uid_t myuid;
-int Rflag, iflag, pflag, rflag;
+int Rflag, fflag, iflag, pflag, rflag;
 int myumask;

 enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE };
@@ -129,10 +129,12 @@ main(argc, argv)
Rflag = 1;
break;
case 'f':
+   fflag = 1;
iflag = 0;
break;
case 'i':
iflag = isatty(fileno(stdin));
+   fflag = 0;
break;
case 'p':
pflag = 1;

So the behaviour depends on the order of the arguments.  E.g. when doing:
$ cp -if foo bar
no confirmation is asked, and:
$ cat bar
new
.

Here's a fix (tested):

--- src/bin/cp/cp.c.origSun Nov  4 03:01:57 2007
+++ src/bin/cp/cp.c Wed Jun 15 17:20:25 2011
@@ -113,8 +113,10 @@
iflag = 0;
break;
case 'i':
-   iflag = isatty(STDIN_FILENO);
-   fflag = 0;
+   if (!fflag) {
+   iflag = isatty(STDIN_FILENO);
+   fflag = 0;
+   }
break;
case 'p':
pflag = 1;




--
Gemaakt met Opera's revolutionaire e-mailprogramma:  
http://www.opera.com/mail/

(Remove the obvious prefix to reply.)



Re: cmpci(4) and S/PDIF?

2011-06-15 Thread Christian Weisgerber
Alexandre Ratchov:

  I would, but there shouldn't be anything required to make it work.
  The point of AC3/DTS pass-through mode is that it sends what looks
  like 16-bit stereo audio at the S/PDIF level.  It's only the receiver
  that, on seeing a signature bit pattern, re-interprets the data and
  decodes it according to AC3 or DTS.
 
 So, I don't even understand how AC3 would work at all. I mean, a lot
 of programs (ie all using sio_onmove(3)) expect that one second of
 s16le at 48kHz be exactly 192000 bytes of data. If AC3 is used, that
 wouldn't be true anymore (AC3 is 320kbit/s iirc) and audio would be
 broken.

Padding, of course.  A video player like MPlayer will format the
AC3 or DTS audio (both of which support numerous bit rates) in such
a way that the result is a 192000 byte/s stream.

The data on a DTS CD is already preformatted to 176400 byte/s and
just needs to be passed through.  I put the disk in, cdio cdplay,
and the drive, cdio(1), and azalia(4) all think they are dealing
with 44.1 kHz 16-bit stereo audio when in fact it is 6-channel DTS.

As designed, S/PDIF only transmits 20(!)-bit stereo audio at various
sample rates.  However, ISO/IEC 61937 specifies how to carry various
non-PCM audio formats over S/PDIF by formatting them like a 16-bit
stereo stream.  This is widely implemented for AC3 and DTS, rarely
for MPEG audio.

 And this can't be fixed without adding AC3 specific code.

It is handled at the application level.  Check out libmpcodecs/ad_hwac3.c
in the MPlayer source.  There is nothing OpenBSD-specific about
this.  It's the same for FreeBSD, Linux, and probably others.

  We don't use any AC3 mode for azalia(4) either and pass-through
  works there.
 
 I bet it only works in few special cases, probably because the clock
 is not involved

And you will lose that bet.  There is no theoretical reason why it
shouldn't work, and in practice it does with everything I've thrown at
it:
* DVD audio tracks, AC3 (2.0, 4.1, 5.1; 192/224/384/448 kbit/s) and
  DTS (5.1; 768 and 1536 kbit/s)
* DTS CD (44.1 kHz)
* AC3 from digital television (2.0 and 5.1; 192/256/384/448 kbit/s)
* DTS extracted from Blu-ray (at the maximum 1536 kbit/s)

-- 
Christian naddy Weisgerber  na...@mips.inka.de



Re: man cp: -i versus -f

2011-06-15 Thread Otto Moerbeek
On Wed, Jun 15, 2011 at 05:25:17PM +0200, Boudewijn Dijkstra wrote:

 Op Wed, 15 Jun 2011 16:52:12 +0200 schreef Jan Stary h...@stare.cz:
 The manpage of cp says
 
  -f   For each existing destination pathname, remove it and
 create a
   new file, without prompting for confirmation, regardless of its
   permissions.  This option overrides any use of -i.
 
  -i   Write a prompt to the standard error output before
 copying a file
   that would overwrite an existing file.  If the response from the
   standard input begins with the character `y', the file copy is
   attempted.
 
 but that isnot what cp actually does:
 
 $ rm -f echo bar
 $ echo new  foo
 $ echo old  bar
 $ cp -fi foo bar
 overwrite bar? n
 $ cat bar
 old
 
 Accoording to the manpage, the '-f' should have overrided the '-i'.
 Instead, it asked for confirmation, which said 'n', and cp(1) did
 not copy foo over bar, as it still has the old content.
 
 Manpage has been like this forever.  Looks like the behaviour has
 been bugged since 1999:

Comments below.

 
 --- src/bin/cp/cp.c   1998/07/03 17:43:56 1.12
 +++ src/bin/cp/cp.c   1999/05/06 18:19:45 1.13
 @@ -91,7 +91,7 @@ static char rcsid[] = $OpenBSD: cp.c,v 1.12 1998/07/0
  PATH_T to = { to.p_path,  };
 
  uid_t myuid;
 -int Rflag, iflag, pflag, rflag;
 +int Rflag, fflag, iflag, pflag, rflag;
  int myumask;
 
  enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE };
 @@ -129,10 +129,12 @@ main(argc, argv)
   Rflag = 1;
   break;
   case 'f':
 + fflag = 1;
   iflag = 0;
   break;
   case 'i':
   iflag = isatty(fileno(stdin));
 + fflag = 0;
   break;
   case 'p':
   pflag = 1;
 
 So the behaviour depends on the order of the arguments.  E.g. when doing:
   $ cp -if foo bar
 no confirmation is asked, and:
   $ cat bar
   new
 .
 
 Here's a fix (tested):
 
 --- src/bin/cp/cp.c.origSun Nov  4 03:01:57 2007
 +++ src/bin/cp/cp.c Wed Jun 15 17:20:25 2011
 @@ -113,8 +113,10 @@
 iflag = 0;
 break;
 case 'i':
 -   iflag = isatty(STDIN_FILENO);
 -   fflag = 0;
 +   if (!fflag) {
 +   iflag = isatty(STDIN_FILENO);
 +   fflag = 0;

Redundant assignment

Posix does not say anything about the interaction of -i and -f. I
hesitate to change the behaviour. Maybe we should check against other
BSD's first.

-Otto

 +   }
 break;
 case 'p':
 pflag = 1;
 
 
 
 
 -- 
 Gemaakt met Opera's revolutionaire e-mailprogramma:
 http://www.opera.com/mail/
 (Remove the obvious prefix to reply.)



Re: relayd, not more than 59 redirects?

2011-06-15 Thread Stuart Henderson
On 2011-06-15, Marco Fretz marco.fr...@gmail.com wrote:
 Hi,

 Just upgraded to 4.9 and problem is solved, now.

you were running out of file descriptors, an alternative fix would
have been to bump openfiles-cur in /etc/login.conf for daemon.



Re: 4.9 net.inet.tcp

2011-06-15 Thread Stuart Henderson
On 2011-06-14, Kevin Chadwick ma1l1i...@yahoo.co.uk wrote:
 
 Seriously, the OpenBSD devs tend to eschew knobs, and they probably 
 found a good way to eliminate these, as someone stated.  But then again 
 there _were_ an awful lot of those questions...

 I'm sure that's part of the motivation but these are now automatically
 and dynamically tuned now. There was some discussion about bringing
 them back for particular cases as an override. Not sure or can't
 remember what the outcome was, many would leave them on and get worse
 performance as a result and I think the particular case brought up was
 already catered for.

It may be useful to have an override in some special cases (though it
would be better to tweak the autotuning algorithm if possible), but
if there is some override, these particular sysctls are tainted.
People would follow copy-n-paste guides and blindly set buffers to
256k per socket connection on busy servers to improve performance
and wonder why their kernels were running out of memory and crashing.



Re: man cp: -i versus -f

2011-06-15 Thread Ted Unangst
On Wed, Jun 15, 2011 at 10:52 AM, Jan Stary h...@stare.cz wrote:
 The manpage of cp says

 -f  For each existing destination pathname, remove it and create a
 new file, without prompting for confirmation, regardless of its
 permissions.  This option overrides any use of -i.

 -i  Write a prompt to the standard error output before copying a
file
 that would overwrite an existing file.  If the response from
the
 standard input begins with the character `y', the file copy is
 attempted.

 but that isnot what cp actually does:

I think all that's missing is the word previous.  -f overrides any
previous use of -i.  A similar statement should be added to the
section for -i.



Re: man cp: -i versus -f

2011-06-15 Thread Jan Stary
On Jun 15 17:41:08, Otto Moerbeek wrote:
 On Wed, Jun 15, 2011 at 05:25:17PM +0200, Boudewijn Dijkstra wrote:
 
  Op Wed, 15 Jun 2011 16:52:12 +0200 schreef Jan Stary h...@stare.cz:
  The manpage of cp says
  
   -f For each existing destination pathname, remove it and
  create a
  new file, without prompting for confirmation, regardless of its
  permissions.  This option overrides any use of -i.
  
   -i Write a prompt to the standard error output before
  copying a file
  that would overwrite an existing file.  If the response from the
  standard input begins with the character `y', the file copy is
  attempted.
  
  but that isnot what cp actually does:
  
  $ rm -f echo bar
  $ echo new  foo
  $ echo old  bar
  $ cp -fi foo bar
  overwrite bar? n
  $ cat bar
  old
  
  Accoording to the manpage, the '-f' should have overrided the '-i'.
  Instead, it asked for confirmation, which said 'n', and cp(1) did
  not copy foo over bar, as it still has the old content.
  
  Manpage has been like this forever.  Looks like the behaviour has
  been bugged since 1999:
 
 Comments below.
 
  
  --- src/bin/cp/cp.c 1998/07/03 17:43:56 1.12
  +++ src/bin/cp/cp.c 1999/05/06 18:19:45 1.13
  @@ -91,7 +91,7 @@ static char rcsid[] = $OpenBSD: cp.c,v 1.12 1998/07/0
   PATH_T to = { to.p_path,  };
  
   uid_t myuid;
  -int Rflag, iflag, pflag, rflag;
  +int Rflag, fflag, iflag, pflag, rflag;
   int myumask;
  
   enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE };
  @@ -129,10 +129,12 @@ main(argc, argv)
  Rflag = 1;
  break;
  case 'f':
  +   fflag = 1;
  iflag = 0;
  break;
  case 'i':
  iflag = isatty(fileno(stdin));
  +   fflag = 0;
  break;
  case 'p':
  pflag = 1;
  
  So the behaviour depends on the order of the arguments.  E.g. when doing:
  $ cp -if foo bar
  no confirmation is asked, and:
  $ cat bar
  new
  .
  
  Here's a fix (tested):
  
  --- src/bin/cp/cp.c.origSun Nov  4 03:01:57 2007
  +++ src/bin/cp/cp.c Wed Jun 15 17:20:25 2011
  @@ -113,8 +113,10 @@
  iflag = 0;
  break;
  case 'i':
  -   iflag = isatty(STDIN_FILENO);
  -   fflag = 0;
  +   if (!fflag) {
  +   iflag = isatty(STDIN_FILENO);
  +   fflag = 0;
 
 Redundant assignment
 
 Posix does not say anything about the interaction of -i and -f. I
 hesitate to change the behaviour. Maybe we should check against other
 BSD's first.
 

Or maybe just

--- cp.1.orig   Wed Jun 15 18:09:22 2011
+++ cp.1Wed Jun 15 18:09:53 2011
@@ -78,7 +78,7 @@
 For each existing destination pathname, remove it and
 create a new file, without prompting for confirmation,
 regardless of its permissions.
-This option overrides any use of
+This option overrides any previous use of
 .Fl i .
 .It Fl H
 If the

   
  +   }
  break;
  case 'p':
  pflag = 1;
  
  
  
  
  -- 
  Gemaakt met Opera's revolutionaire e-mailprogramma:
  http://www.opera.com/mail/
  (Remove the obvious prefix to reply.)



Bonjour

2011-06-15 Thread Directrice Ledon
B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B
 B B B B B B B B B B B  Bonjour
B B B B B B  Cette nouvelle a pour but de vous
informer sur les faits et les situations de mon entourage et de solliciter
votre soutien. 
B B B B B  Effect,je suis la Directrice dbOrganisation des
jeunes dC)shC)ritC)s ou de parents dC)munis.Cbest une organisation
privC)e.La scolaritC) des C)levC)s est gratuitC).Votre aide concerne aussi les
orphelins,enfants placebb..etc dont la pauvretC) des parents deja morts ou
demunisB ;ne leur offre pas satisfaction et les livre C  la misiere.C   tant une
organisation privC)B ;je refleche C  comment payer les
personnel(EnseignantsB ;professeurs,,bbbetc) de mon C)tablissement de
plus j'ai organisC) une Formation Officiel en C ducation des Jeunes
DC)shC)ritC)s ou parents dC)munis.Je sollicite des moyens financiers pour
aider les misC)rables C  trouver quoi manger pour les soins et leur
C)ducation. 
Moi;la Directrice Ledon Sandra;vous prie de tout mon cEur de me
venir en aide financiC(rement et matC)riellement afin que je puisse remC)dier
aux problC(mes.
B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B
 B B  Adressez-vous ici 
B B B B B B B B B B B B B B B B B B B B B B B 
E-mailB  :directricele...@yahoo.fr
B B B B B B B B B B B B B B B B B B B B B B B  Skype:B B  directrice11
B B B B B B B B B B B B B B B B B B B B B B B  B  B  B  B  B  B  B  B  B  B 
B  B  B  B  B  B  B  B  Merci de votre comprC)hension.



OBSD 4.9 ral and ath not working in HOSTAP Mode

2011-06-15 Thread Mario Kothe

Hello,

I can't get a Ralink- or Atheros- MiniPCI Card to work in a Soekirs 5501 
or ALIX System.


Setup is as follow (OpenBSD host.example.net 4.9 GENERIC#671 i386)

WLAN CARD (ral or ath) - bridge0 - vlan6


The two mentioned card show different behavior.

Atheros card (crashes system)

Atheros card dmesg output:

ath0 at pci0 dev 12 function 0 Atheros AR5413 rev 0x01: irq 9
ath0: AR5413 10.5 phy 6.1 rf 6.3, FCC2A*, address 00:80:48:64:d3:fb

entering the following command (nwid replaced with placeholder):

ifconfig ath0 media autoselect mediaopt hostap mode 11g chan 1 nwid 
name wpa wpakey 0x1...


makes OpenBSD unresponsive to all commands on ssh or serial command line.


Ralink card
(system does not crash but is not working either)

Ralink card dmesg output (ssid replaced with placeholder):
ral0 at pci0 dev 17 function 0 Ralink RT2561S rev 0x00: irq 15, 
address 00:12:0e:61:4e:3c

ral0: MAC/BBP RT2561C, RF RT5225
ral0: creating ibss
ral0: synchronized with 00:12:0e:61:4e:3c ssid name channel 1 start 
1Mb short preamble short slot time

ral0: creating ibss
ral0: synchronized with 00:12:0e:61:4e:3c ssid name channel 1 start 
1Mb short preamble short slot time

ral0: creating ibss
ral0: synchronized with 00:12:0e:61:4e:3c ssid name channel 1 start 
1Mb short preamble short slot time

ral0: creating ibss
ral0: synchronized with 00:12:0e:61:4e:3c ssid name channel 1 start 
1Mb short preamble short slot time


ifconfig ral0

ral0: flags=8947UP,BROADCAST,DEBUG,RUNNING,PROMISC,SIMPLEX,MULTICAST 
mtu 1500

lladdr 00:12:0e:61:4e:3c
priority: 4
groups: wlan
media: IEEE802.11 autoselect mode 11g hostap
status: active
ieee80211: nwid stay-off chan 1 bssid 00:12:0e:61:4e:3c wpakey 
replaced  wpaprotos wpa2 wpaakms psk wpaciphers tkip,ccmp 
wpagroupcipher tkip 100dBm

inet6 fe80::212:eff:fe61:4e3c%ral0 prefixlen 64 scopeid 0x7

With tcpdump I see no traffic on the ral0 interface. Any Client that 
tries connecting is asking for the

wpakey over and over again. But no traffic shows on the ral0 interface.

Searching for the problem I found the following Mail mentioning what 
might be the problem


http://permalink.gmane.org/gmane.os.openbsd.tech/23877

So I tried the snapshot Kernel from June 10 but that did not solve my 
Problem (I did not compile the Kernel just downloaded it)


My question is is anyone else experience the same problem. Or did I miss 
something (e.g. does one of the card not work
with OpenBSD 4.9 in Host AP mode anymore. At least the ral interface 
worked fine in OpenBSD 4.7 in hostap mode)

If more Information is needed let me.

Thanks in advance

Mario Kothe



Re: man cp: -i versus -f

2011-06-15 Thread Otto Moerbeek
On Wed, Jun 15, 2011 at 06:11:37PM +0200, Jan Stary wrote:

 On Jun 15 17:41:08, Otto Moerbeek wrote:
  On Wed, Jun 15, 2011 at 05:25:17PM +0200, Boudewijn Dijkstra wrote:
  
   Op Wed, 15 Jun 2011 16:52:12 +0200 schreef Jan Stary h...@stare.cz:
   The manpage of cp says
   
-f   For each existing destination pathname, remove it and
   create a
 new file, without prompting for confirmation, regardless of its
 permissions.  This option overrides any use of -i.
   
-i   Write a prompt to the standard error output before
   copying a file
 that would overwrite an existing file.  If the response from the
 standard input begins with the character `y', the file copy is
 attempted.
   
   but that isnot what cp actually does:
   
   $ rm -f echo bar
   $ echo new  foo
   $ echo old  bar
   $ cp -fi foo bar
   overwrite bar? n
   $ cat bar
   old
   
   Accoording to the manpage, the '-f' should have overrided the '-i'.
   Instead, it asked for confirmation, which said 'n', and cp(1) did
   not copy foo over bar, as it still has the old content.
   
   Manpage has been like this forever.  Looks like the behaviour has
   been bugged since 1999:
  
  Comments below.
  
   
   --- src/bin/cp/cp.c   1998/07/03 17:43:56 1.12
   +++ src/bin/cp/cp.c   1999/05/06 18:19:45 1.13
   @@ -91,7 +91,7 @@ static char rcsid[] = $OpenBSD: cp.c,v 1.12 1998/07/0
PATH_T to = { to.p_path,  };
   
uid_t myuid;
   -int Rflag, iflag, pflag, rflag;
   +int Rflag, fflag, iflag, pflag, rflag;
int myumask;
   
enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE };
   @@ -129,10 +129,12 @@ main(argc, argv)
 Rflag = 1;
 break;
 case 'f':
   + fflag = 1;
 iflag = 0;
 break;
 case 'i':
 iflag = isatty(fileno(stdin));
   + fflag = 0;
 break;
 case 'p':
 pflag = 1;
   
   So the behaviour depends on the order of the arguments.  E.g. when doing:
 $ cp -if foo bar
   no confirmation is asked, and:
 $ cat bar
 new
   .
   
   Here's a fix (tested):
   
   --- src/bin/cp/cp.c.origSun Nov  4 03:01:57 2007
   +++ src/bin/cp/cp.c Wed Jun 15 17:20:25 2011
   @@ -113,8 +113,10 @@
   iflag = 0;
   break;
   case 'i':
   -   iflag = isatty(STDIN_FILENO);
   -   fflag = 0;
   +   if (!fflag) {
   +   iflag = isatty(STDIN_FILENO);
   +   fflag = 0;
  
  Redundant assignment
  
  Posix does not say anything about the interaction of -i and -f. I
  hesitate to change the behaviour. Maybe we should check against other
  BSD's first.
  
 
 Or maybe just
 
 --- cp.1.orig Wed Jun 15 18:09:22 2011
 +++ cp.1  Wed Jun 15 18:09:53 2011
 @@ -78,7 +78,7 @@
  For each existing destination pathname, remove it and
  create a new file, without prompting for confirmation,
  regardless of its permissions.
 -This option overrides any use of
 +This option overrides any previous use of
  .Fl i .
  .It Fl H
  If the

Yes, that's the wording used for rm(1). And -i should have a similar line.

I checked net and free, they implement -i and -f as we do.

-Otto



Recommended PCI-E adaptor with fibre connection

2011-06-15 Thread James A. Peltier
Hi All,

I'm looking for a new 1Gb or 10Gb PCI-E adaptor with fibre connections.  Can 
anyone make some recommendations on a good performing adapter under OpenBSD.  I 
see there has been a lot of work going on with the Intel ix(4) based adapters 
would these be the recommended cards to use in the 10Gb department?  If so what 
have the developers been using to test/develop this driver with?

-- 
James A. Peltier
IT Services - Research Computing Group
Simon Fraser University - Burnaby Campus
Phone   : 778-782-6573
Fax : 778-782-3045
E-Mail  : jpelt...@sfu.ca
Website : http://www.sfu.ca/itservices
  http://blogs.sfu.ca/people/jpeltier



Re: man cp: -i versus -f

2011-06-15 Thread Ingo Schwarze
Otto Moerbeek wrote on Wed, Jun 15, 2011 at 05:41:08PM +0200:

 Posix does not say anything about the interaction of -i and -f.

I seem to dimly remember that POSIX says something about the
precedence of conflicting options in general (in general as in:
when there is no specific ruling for a specific utility).
I *think* this had something to do with order, but lack the
time to search for that part of the text right now.



Re: man cp: -i versus -f

2011-06-15 Thread Otto Moerbeek
On Wed, Jun 15, 2011 at 08:26:13PM +0200, Ingo Schwarze wrote:

 Otto Moerbeek wrote on Wed, Jun 15, 2011 at 05:41:08PM +0200:
 
  Posix does not say anything about the interaction of -i and -f.
 
 I seem to dimly remember that POSIX says something about the
 precedence of conflicting options in general (in general as in:
 when there is no specific ruling for a specific utility).
 I *think* this had something to do with order, but lack the
 time to search for that part of the text right now.

http://pubs.opengroup.org/onlinepubs/9699919799/

Specifically: 

Guideline 11:
The order of different options relative to one another should not
matter, unless the options are documented as mutually-exclusive and
such an option is documented to override any incompatible options
preceding it.

-Otto



Control of OpenBSD through a web interface

2011-06-15 Thread Jean-François SIMON
Hi,

I have a remote controlled machine which I manage by ssh and yet I'm in the
process of making up a small web page through which basic commands can be
passed.

I have no clear idea regarding how to design this, in the first place I
thought about a cgi script written in C which I did manage to have it say
hello world at the present time, but not yet much more.

There's not yet clear clues regarding how to make this peace of web
interface talk to the system and I would like to make it clean by means of
elegant way to deal with web page - system communication.

Any clue regarding the way it could be ?

Thanks,

Jean-Frangois



Re: man cp: -i versus -f

2011-06-15 Thread Ted Unangst
On Wed, Jun 15, 2011 at 1:56 PM, Otto Moerbeek o...@drijf.net wrote:
 Yes, that's the wording used for rm(1). And -i should have a similar line.

 I checked net and free, they implement -i and -f as we do.

Bizarrely, I read mv where you typed rm and used that.  Now I notice
you said rm.  All three should probably be consistent.  Do we want the
notice posted after each option or after all the options, or both?



Re: man cp: -i versus -f

2011-06-15 Thread Otto Moerbeek
On Wed, Jun 15, 2011 at 03:00:38PM -0400, Ted Unangst wrote:

 On Wed, Jun 15, 2011 at 1:56 PM, Otto Moerbeek o...@drijf.net wrote:
  Yes, that's the wording used for rm(1). And -i should have a similar line.
 
  I checked net and free, they implement -i and -f as we do.
 
 Bizarrely, I read mv where you typed rm and used that.  Now I notice
 you said rm.  All three should probably be consistent.  Do we want the
 notice posted after each option or after all the options, or both?

Not all commands have -f an -i next to each other. I'd say if they are
separate, it should be mentioned with both options.

-Otto



daily script - running through all drives

2011-06-15 Thread Jean-François SIMON
Hello,

Backing up this question, I've not yet been able to clearly understand which
part of the dail / security script makes the system to go through all disks
and certainly dive into the whole of the file system directory.

Has one soul an answer ?

Jean-Frangois



Re: Control of OpenBSD through a web interface

2011-06-15 Thread Comète
Without the need of a web interface, if your goal is to automate some 
boring tasks, you can have a look at Fabric (http://fabfile.org). I use 
it with a lot of servers everyday and it's very easy to script whatever 
you want.


Morgan

Le 15/06/2011 20:36, Jean-Frangois SIMON a icrit :

Hi,

I have a remote controlled machine which I manage by ssh and yet I'm in the
process of making up a small web page through which basic commands can be
passed.

I have no clear idea regarding how to design this, in the first place I
thought about a cgi script written in C which I did manage to have it say
hello world at the present time, but not yet much more.

There's not yet clear clues regarding how to make this peace of web
interface talk to the system and I would like to make it clean by means of
elegant way to deal with web page-  system communication.

Any clue regarding the way it could be ?

Thanks,

Jean-Frangois




Re: man cp: -i versus -f

2011-06-15 Thread Jason McIntyre
On Wed, Jun 15, 2011 at 03:00:38PM -0400, Ted Unangst wrote:
 On Wed, Jun 15, 2011 at 1:56 PM, Otto Moerbeek o...@drijf.net wrote:
  Yes, that's the wording used for rm(1). And -i should have a similar line.
 
  I checked net and free, they implement -i and -f as we do.
 
 Bizarrely, I read mv where you typed rm and used that.  Now I notice
 you said rm.  All three should probably be consistent.  Do we want the
 notice posted after each option or after all the options, or both?
 

after all the options works well for mv, where there's only two options.
but less well for cp and rm, i'd say. also there are no other option
combinations to discuss, like for ls, so i'd say after each option.
however it will just be a matter of taste, so just pick your preference
and make sure it's all consistent.

jmc



Re: Control of OpenBSD through a web interface

2011-06-15 Thread L. V. Lammert
On Wed, 15 Jun 2011, [ISO-8859-1] Jean-Frangois SIMON wrote:

 Hi,

 I have a remote controlled machine which I manage by ssh and yet I'm in the
 process of making up a small web page through which basic commands can be
 passed.

 I have no clear idea regarding how to design this, in the first place I
 thought about a cgi script written in C which I did manage to have it say
 hello world at the present time, but not yet much more.

 There's not yet clear clues regarding how to make this peace of web
 interface talk to the system and I would like to make it clean by means of
 elegant way to deal with web page - system communication.

 Any clue regarding the way it could be ?

 Thanks,

 Jean-Frangois

If you really need a web-GUI, Why not use webmin?

Lee



Re: daily script - running through all drives

2011-06-15 Thread Stuart Henderson
On 2011-06-15, Jean-Fran?ois SIMON jfsimon1...@gmail.com wrote:
 Hello,

 Backing up this question, I've not yet been able to clearly understand which
 part of the dail / security script makes the system to go through all disks
 and certainly dive into the whole of the file system directory.

 Has one soul an answer ?

 Jean-Frangois



See security(8) and pay particular attention to the ENVIRONMENT section.



Re: daily script - running through all drives

2011-06-15 Thread Jean-François SIMON
2011/6/15 Jean-Frangois SIMON jfsimon1...@gmail.com

 Hello,

 Backing up this question, I've not yet been able to clearly understand
 which part of the dail / security script makes the system to go through all
 disks and certainly dive into the whole of the file system directory.

 Has one soul an answer ?

 Jean-Frangois


Sorry, I just understand that apparently this is related to a patch. I've
been using 4.4 for a while.

http://www.openbsd.org/plus46.html

   - Make the
security(8)http://www.openbsd.org/cgi-bin/man.cgi?query=securitysektion=8f
ormat=html
script
   honor the SUIDSKIP variable to exclude paths from setuid and device
checks.



Re: Control of OpenBSD through a web interface

2011-06-15 Thread Jeff Ross

On 06/15/11 12:36, Jean-Frangois SIMON wrote:

Hi,

I have a remote controlled machine which I manage by ssh and yet I'm in the
process of making up a small web page through which basic commands can be
passed.

I have no clear idea regarding how to design this, in the first place I
thought about a cgi script written in C which I did manage to have it say
hello world at the present time, but not yet much more.

There's not yet clear clues regarding how to make this peace of web
interface talk to the system and I would like to make it clean by means of
elegant way to deal with web page-  system communication.

Any clue regarding the way it could be ?

Thanks,

Jean-Frangois


!DSPAM:4df8fc6181751664719687!



I did this for a server in a law office to allow the users to do things 
like kill runaway print jobs and to restart the server.  httpd was *not* 
accessible from the internet by a rule in pf and was run as httpd -u 
(un-chrooted).  You can write CGIs as shell scripts--you just have to 
send the correct headers at the beginning of the script.  Use your 
google-fu to figure those headers out.


If the jobs you need require more than simple shell scripts, you can use 
php or perl.  In the un-chrooted environment they will give you access 
to *everything*.


Hope that helps!

Jeff



Re: Control of OpenBSD through a web interface

2011-06-15 Thread STeve Andre'

On 06/15/11 14:36, Jean-Frangois SIMON wrote:

Hi,

I have a remote controlled machine which I manage by ssh and yet I'm in the
process of making up a small web page through which basic commands can be
passed.

I have no clear idea regarding how to design this, in the first place I
thought about a cgi script written in C which I did manage to have it say
hello world at the present time, but not yet much more.

There's not yet clear clues regarding how to make this peace of web
interface talk to the system and I would like to make it clean by means of
elegant way to deal with web page-  system communication.

Any clue regarding the way it could be ?

Thanks,

Jean-Frangois



Please don't take this the wrong way--I am not trying to be snarky,
but you should not attempt this on your own.

You're creating a great new attack surface which can really hurt
you.

GUI tools for anything (myphpadmin, etc) don't exactly have a
good history of security, at least not for a long time.

You CAN teach non-technical users to use a command line.  I
have done this, including normal people how to use the teco
editor.

--STeve Andre'



Notification num�ro : Z14460

2011-06-15 Thread FreeBox
Freebox

[IMAGE]

Bienvenue chez Free!



Cher membre Free,
II a iti porti ` notre attention que vos informations de facturation
Freebox dossiers ne sont plus ` jour. Cela vous oblige ` mettre ` jour
vos informations. Veuillez bien virifier vos informations, sinon sa se
traduira ` une suspension immidiate du compte.
Cliquez sur le lien ci-dessous et entrez vos informations de connexion
sur la page suivante pour confirmer vos informations de facturation
Freebox.

https://subscribe.free.fr/login/connexion.pl?hid=kC2H.MWVhOGIMid=12104605

Note: Ceci est un troisihme et dernier rappel vous invitant a accider `
votre formulaire de sicuriti dhs que possible, dans le cas contraire nous
ne sommes pas responsables des dibits inhabituels sur votre  compte ou
des utilisations inhabituelles des fonds du compte bancaire.

Cordialement,
L'iquipe Free Adsl (Freebox)

Nous Contacter



Par tiliphone au 3244 *
Par mail: http://www.free.fr/assistance/mail.html
Par Fax: +33 899 90 5000 (1,35 par appel puis 0,34/mn)
Par courrier: Free Haut Dibit - 75371 Paris Cedex

Free est certifii NF Service pour la qualiti de sa relation client.



Informations ligales relatives au forfait Freebox
* gratuiti du temps d'attente ` partir d'une Freebox, tarif local puis
prestation d'assistance ` 0,34/mn sur facture Free

[IMAGE]

[IMAGE]



Re: Control of OpenBSD through a web interface

2011-06-15 Thread Bryan Irvine
If you must do it just use webmin (make sure you have SSLeay installed).

If this is more of a technical exercise for yourself.  Pick up the CGI
Programming in C and PERL book by Thomas Bhoutell.  It's old but it
was one of my faves once upon a time.

-Bryan

2011/6/15 Jean-Frangois SIMON jfsimon1...@gmail.com:
 Hi,

 I have a remote controlled machine which I manage by ssh and yet I'm in the
 process of making up a small web page through which basic commands can be
 passed.

 I have no clear idea regarding how to design this, in the first place I
 thought about a cgi script written in C which I did manage to have it say
 hello world at the present time, but not yet much more.

 There's not yet clear clues regarding how to make this peace of web
 interface talk to the system and I would like to make it clean by means of
 elegant way to deal with web page - system communication.

 Any clue regarding the way it could be ?

 Thanks,

 Jean-Frangois



Re: Control of OpenBSD through a web interface

2011-06-15 Thread ropers
There are free solutions available for web-based SSH; cf. here:

http://en.wikipedia.org/wiki/Web-based_SSH

The way you might want to set this up is so that you might install
your own chosen web-based SSH software on the same OpenBSD box that
also is the one you want to access via web-based SSH. (So the actual
SSH traffic then becomes traffic to localhost.) Be aware that whatever
box the web-based SSH software runs on can potentially see and
intercept the SSH traffic in clear text, so you want to be in control
of that box.

Also, be VERY aware that this -*at best*- reduces the security offered
by SSH to that offered by HTTPS. (Wasn't there some news some time
back that HTTPS had been defeated in some context? Does anyone
remember?)

Whether you are prepared to sacrifice this much security for
convenience obviously is for you to decide.

That said, if you do implement something like this, I'd be interested
in reading your notes about exactly how and you did things. Yeah, I'm
a curious feller.

--regards,
ropers

2011/6/15 Jean-Frangois SIMON jfsimon1...@gmail.com:
 Hi,

 I have a remote controlled machine which I manage by ssh and yet I'm in the
 process of making up a small web page through which basic commands can be
 passed.

 I have no clear idea regarding how to design this, in the first place I
 thought about a cgi script written in C which I did manage to have it say
 hello world at the present time, but not yet much more.

 There's not yet clear clues regarding how to make this peace of web
 interface talk to the system and I would like to make it clean by means of
 elegant way to deal with web page - system communication.

 Any clue regarding the way it could be ?

 Thanks,

 Jean-Frangois



Re: sed behavior

2011-06-15 Thread Nicholas Marriott
FWIW GNU sed also appears to have the same behaviour (different from
perl).



On Wed, Jun 15, 2011 at 12:26:39PM +0200, Otto Moerbeek wrote:
 On Wed, Jun 15, 2011 at 12:17:09PM +0200, Otto Moerbeek wrote:
 
   It differs from perl like this:
   
   $ echo 'l1_1' | perl -pe 's/1|$/X/g'
   lX_XX
   $ echo 'l1_1' | sed -E 's/1|$/X/g'
   lX_X
   
   Meaning we don't hit that final '$' if the last match went to eol.
   
   /Alexander
  
  Right.
  
  I took a look at freebsd, thay have some patches in this area. But
  applying the changes did not have the desired effect. Have to look deeper.
  
  -Otto
 
 One conclusion: if I port the complete sed from freebsd, it also does
 not substitute the eol in your testcase. So no wonder incorporating
 the changes into OpenBSD does not fix this case.
 
   -Otto



Re: sed behavior

2011-06-15 Thread Stuart Henderson
On 2011-06-15, Alexander Hall ha...@openbsd.org wrote:
 This dif fixes your problem here. Big question is of course: does it
 break other cases?

 It differs from perl like this:

 $ echo 'l1_1' | perl -pe 's/1|$/X/g'
 lX_XX
 $ echo 'l1_1' | sed -E 's/1|$/X/g'
 lX_X

 Meaning we don't hit that final '$' if the last match went to eol.

perl regular expressions are expected to behave differently
to posix REs.



Re: Control of OpenBSD through a web interface

2011-06-15 Thread Michael Sioutis
Thank u for this :D I'm just trying out Fabric and it seems very good!

Mike

On Wed, Jun 15, 2011 at 10:15 PM, Comhte com...@daknet.org wrote:
 Without the need of a web interface, if your goal is to automate some
boring
 tasks, you can have a look at Fabric (http://fabfile.org). I use it with a
 lot of servers everyday and it's very easy to script whatever you want.

 Morgan

 Le 15/06/2011 20:36, Jean-Frangois SIMON a icrit :

 Hi,

 I have a remote controlled machine which I manage by ssh and yet I'm in
 the
 process of making up a small web page through which basic commands can be
 passed.

 I have no clear idea regarding how to design this, in the first place I
 thought about a cgi script written in C which I did manage to have it say
 hello world at the present time, but not yet much more.

 There's not yet clear clues regarding how to make this peace of web
 interface talk to the system and I would like to make it clean by means of
 elegant way to deal with web page-  system communication.

 Any clue regarding the way it could be ?

 Thanks,

 Jean-Frangois



Re: Recommended PCI-E adaptor with fibre connection

2011-06-15 Thread James A. Peltier
- Original Message -
| Hi All,
| 
| I'm looking for a new 1Gb or 10Gb PCI-E adaptor with fibre
| connections. Can anyone make some recommendations on a good performing
| adapter under OpenBSD. I see there has been a lot of work going on
| with the Intel ix(4) based adapters would these be the recommended
| cards to use in the 10Gb department? If so what have the developers
| been using to test/develop this driver with?

Anyone have any comments/problems with the following cards?

The following cards look to be well supported.  I'm specifically talking about 
the Intel Gigabit EF Dual port SX adaptor based on the Intel 82576 Gigabit 
Ethernet Controller.  This card supports full hardware virtualization which the 
others don't, so I'd likely go with it even though OpenBSD doesn't do H/W 
virtualization.

http://www.intel.com/Products/Server/Adapters/Gb-EF-Dual-Port/Gb-EF-Dual-Port-overview.htm

For 10GbE the following adaptor looks to be quite good and supported using the 
Intel 82599 10 Gigabit Ethernet Controller

http://www.intel.com/Products/Server/Adapters/X520/ethernet-X520-overview.htm


-- 
James A. Peltier
IT Services - Research Computing Group
Simon Fraser University - Burnaby Campus
Phone   : 778-782-6573
Fax : 778-782-3045
E-Mail  : jpelt...@sfu.ca
Website : http://www.sfu.ca/itservices
  http://blogs.sfu.ca/people/jpeltier



Revisión Urgente de Manuales de Políticas y Procedimientos

2011-06-15 Thread Adriana Hernandez
[IMAGE]

Empresa Registrada ante la STPS Reg. COLG640205CP30005 Smguenos en
Twitter@pmscapacitacion o bien en Facebook PMS de Mixico

Extendemos una cordial invitacisn a este seminario y con gusto esperamos
su respuesta.

Identificacisn de Procesos y Desarrollo de un Manual de Polmticas y
Procedimientos

Este exclusivo e importante seminario para su organizacisn, cuyo
primordial objetivo es que los participantes conozcan lo que es un
proceso organizacional y sus categormas, que entiendan sus
caractermsticas, y que lo identifiquen en el contexto de las actividades
de su organizacisn sea de servicios o de manufactura, grande o pequeqa.

?Dsnde y cuando se presenta?

Ciudad de Mixico este 27 de Junio de 2011.

Duracisn: 10 Horas de Capacitacisn Efectiva impartidas por nuestro
consultor Ing. Enrique Castro B.

?A Quiin va Dirigido?

Toda aquella persona en niveles de toma de decisiones que tengan que ver
con la mejora del desarrollo organizacional y de la productividad de su
organizacisn.

?Quiin imparte nuestro seminario?

El Ing. Enrique Castro B. forma parte del grupo acadimico de PMS
Capacitacisn Efectiva, tiene amplia experiencia como expositor y
consultor en diversas empresas y en diversas universidades de dentro y
fuera del pams. Su nivel acadimico es de maestrma, y es candidato a
doctor en administracisn.

!Inscrmbase Ahora!

!Contamos con Lugares disponibles!

Solicite Mayores informes, Llamenos al (33) 8851-2365, (33) 8851-2741

Uno de nuestros asesores con gusto le atendera
Responda esta invitacisn con sus datos para enviar el programa completo.

Empresa:
Nombre:
Telifono:
Email:
Nzmero de Interesados:

!Gracias!

Copyright (C) 2010, PMS Capacitacisn Efectiva de Mixico  S.C. Derechos
Reservados. PMS de Mixico, El logo de PMS de Mixico son marcas
registradas. ADVERTENCIA PMS de Mixico no cuenta con alianzas
estratigicas de ningzn tipo dentro de la Repzblica Mexicana. NO SE DEJE
ENGAQAR - DIGA NO A LA PIRATERIA. Todos los logotipos, marcas comerciales
e imagenes son propiedad de sus respectivas corporaciones y se utilizan
con fines informativos solamente.

Este Mensaje ha sido enviado a misc@openbsd.org como usuario de Pms de
Mixico o bien un usuario le refiris para recibir este boletmn.
Como usuario de Pms de Mixico, en este acto autoriza de manera expresa
que Pms de Mixico le puede contactar vma correo electrsnico u otros
medios.
Si usted ha recibido este mensaje por error, haga caso omiso de el y
reporte su cuenta respondiendo este correo con el subject BAJAMANUAL

Unsubscribe to this mailing list, reply a blank message with the subject
UNSUBSCRIBE BAJAMANUAL
Tenga en cuenta que la gestisn de nuestras bases de datos es de suma
importancia y no es intencisn de la empresa la inconformidad del
receptor.

[demime 1.01d removed an attachment of type image/png which had a name of 
nlogo.png]



Re: sed behavior

2011-06-15 Thread pablo caballero
On Wed, Jun 15, 2011 at 7:17 AM, Otto Moerbeek o...@drijf.net wrote:
 On Wed, Jun 15, 2011 at 09:50:29AM +0200, Alexander Hall wrote:

 On 06/15/11 08:35, Otto Moerbeek wrote:
  On Wed, Jun 15, 2011 at 07:44:20AM +0200, Otto Moerbeek wrote:
 
  On Tue, Jun 14, 2011 at 11:56:27PM +0200, sven falempin wrote:
 
  Hello,
 
  Indeed there is a small problem:
 
  # echo 'abf' | sed -E 's/[a$]/x/g'
  xbf
 
  That is expected. $ is only special when it ocurs as the list char of
  a re.
 
  # echo 'abf' | sed -E 's/a|$/x/g'
  x
 
  This is likely to be a real bug.
 
 
  String modification is done inside the 'case 0:'
  substitute(struct s_command *cp) in src/usr.bin/process.c
 
  But the problem may comme from regexec_e.
 
  Maybe openbsd devs should test another regexp code version ?
 
  Why? If we should change libs on every bug encountered, nothing will
  be left.
 
  Anyway, thanks for the report.
 
 -Otto
 
 
  Hope it helps,
  Who still use sed anyway :)
 
  Regards.
 
  2011/6/12 Ingo Schwarze schwa...@usta.de
 
  Hi Nils,
 
  Nils Anspach wrote on Sun, Jun 12, 2011 at 12:49:42PM +0200:
 
  I have an issue with sed. Why does
 
echo 'ab' | sed -E 's/a|$/x/g'
 
  give 'x' whereas
 
  I sense a bug here.
  Tracing a bit around process(),
  it looks like the first application of the s command
  yields dst = x continue_to_process = b\n,
  and then the second application
  appends \n to dst (should rather append b, i think).
  Maybe something is wrong here with character/pointer counting,
  but i'm somewhat out of time now for tracing.
 
  This is worth more investigation.
 
  Yours,
Ingo
 
 
 
 
  --
  () ascii ribbon campaign - against html e-mail
  /\
 
  This dif fixes your problem here. Big question is of course: does it
  break other cases?

 It differs from perl like this:

 $ echo 'l1_1' | perl -pe 's/1|$/X/g'
 lX_XX
 $ echo 'l1_1' | sed -E 's/1|$/X/g'
 lX_X

 Meaning we don't hit that final '$' if the last match went to eol.

 /Alexander

 Right.

 I took a look at freebsd, thay have some patches in this area. But
 applying the changes did not have the desired effect. Have to look deeper.

-Otto



HI Otto.

I think that with a minor change (= instead of  in the last line)
your diff works.

Regards

+   if (lastempty || match[0].rm_so != match[0].rm_eo ||
+   (match[0].rm_so == match[0].rm_eo 
+   match[0].rm_so = 0)) {



NEW LOGISTICS

2011-06-15 Thread sunit
Dear misc,

Your Own --- Consolidatation Service Ex all of China (by Sea / by Air)

**Combine all of your goods in China*

**Avoide high warehouse charge in your country*

**Using the fastest vessel*

**Avoide damages of your goods - saving delivering cost in your
country*

Contacting info:

IF YOU ARE INSTERESTING IN IT,PLEASE CONTACT ME. MSN:htshi...@hotmail.com
EMAIL:htshi...@hotmail.com

COMPANY-
HonstyTrusty-Logistics-Co-in-China--Add--RM222-HENGXIN-BUSINESS.CENTRE--YIN.TONG-Street-Zhongshan-China.P.C.5-2-8-4-0-3

**Phone--86-760-883339556---FAX--86-760--88362156--MOBILE--15011802534**

Consolidation HUB -- Guangzhou, the earlist trading ports in China, easy
cutsoms clearance, low local charges

1...Pick up Charge from in China to Guangzhou ( All is in Chinese Yuan -
RMB, 6.5RMB = 1 USD)

Province in China

Small cargo charge as per KG

Charged as per actual weight

Charged by measurment-M3

1-20kg

Min

21-50kgs

50-100kgs

100--500KG

501-1000kgs

1000KGS

1-3CBM

4-6CBM

7-10CBM

10CBM

Shenzhen/Dongguan /Huizhou

3/kg

50

3/kg

2.8/kg

2.5/KG

2.4/K

2/kg

200/CBM

170/CBM

150/CBM

140/CBM

Zhongshan/Zhuhai/Jiangmen/Foshan

3/kg

50

3/kg

2.8/kg

2.5/KG

2.4/K

2.1/kg

200/CBM

170/CBM

150/CBM

140/CBM

Shantou/Zhanjiang

4/kg

80

3.5/kg

3.3/kg

3/KG

2.5/K

2.1/kg

220/CBM

190/CBM

180/CBM

160/CBM

Abvoe is Cities in Guangdong Province

Fujian

4.5/kg

90

4/kg

3.8/kg

3.5/KG

3/K

2.3/kg

250/CBM

220/CBM

210/cbm

200/CBM

Hunan/Zhejiang/Jiangxi/Guangxi

12/kg

150

9/kg

4/kg

3.8/KG

3.4/K

2.8/kg

350/CBM

340/CBM

330/cbm

320/CBM

Jiangsu/Shanghai/Anhui

12/kg

150

12/kg

4/kg

3.8/KG

3.4/K

2.8/kg

370/CBM

360/CBM

350/cbm

340/CBM

Shandong/Henan/Tianjin/Hebei

15/kg

180

14/kg

4/kg

3.8/KG

3.4/K

2.8/kg

400/CBM

390/CBM

380/cbm

370/CBM

Note: to be charged as per the bigger one of Actual weight charge and
Measurment charge.

2...Local charge for Consolidation

1. Pick up Charge

See above

2. Bill of Lading charge

RMB200

3. Storage - 7days free

RMB8/CBM/DAY

4. CFS (loading and unloading)

RMB80/CBM

5. Customs Clearance

A)RMB750 --- for LCL, less than 5CBM, 1 kind of goods B)RMB1000--For LCL,
less than 5cbm, 2kinds of goods

C) RMB1600 /20'container, 1-2 kind of goods D)RMB1800/40'container, 1-2
kinds of goods.

E) RMB2200 /container, 2-5 kind of goods F)RMB2800/container, more than 5
kinds of goods

6. Terminal handling of Guangzhou

RMB350/20' RMB450/40'

7. THC of the shipping line

RMB480/20' RMB760/40'



Re: man cp: -i versus -f

2011-06-15 Thread john slee
On 16 June 2011 04:32, Otto Moerbeek o...@drijf.net wrote:
 Guideline 11:
 The order of different options relative to one another should not
 matter, unless the options are documented as mutually-exclusive and
 such an option is documented to override any incompatible options
 preceding it.

IMHO later options should override earlier options. To not do so may
yield somewhat unexpected results. In the below sample I prefer the
OpenBSD behaviour.

4.9:

$ echo hi  foo ; echo zing  bar
$ alias cp='cp -i'
$ cp foo bar
overwrite bar? n
$ cp -f foo bar
$ cat bar
hi

OSX 10.6.7:

$ alias cp='cp -i'
$ echo hi  foo ; echo zing  bar
$ cp foo bar
overwrite bar? (y/n [n]) n
not overwritten
$ cp -f foo bar
overwrite bar? (y/n [n]) n
not overwritten



Sistema Compranet 5.0 Actualizaciones y uso

2011-06-15 Thread Ana Garcia
[IMAGE]

Empresa Registrada ante la STPS Reg. COLG640205CP30005 Smguenos en
Twitter@pmscapacitacion o bien en Facebook PMS de Mixico

Conozca de la mano de un experto el correcto uso de este sistema !No deje
pasar oportunidades de Negocio!

Manejo Sptimo del Sistema Compranet 5.0

 27 de Junio Ciudad de Mixico / 29 de Junio Guadalajara / 01 de Julio
Monterrey

Este taller esta orientado al uso del sistema Compranet 5.0, el
participante podra realizar una bzsqueda de licitaciones, manejara
correctamente el envmo de propuestas, conociendo al detalle el
funcionamiento de esta nueva plataforma.

!Beneficios que obtendra con este programa!

Le aseguramos que con este programa usted adquirira los conocimientos
necesarios para convertirse en un proveedor de gobierno altamente
efectivo.

Duracisn: 10 horas impartidas por nuestro experto en la materia Mtro.
Alberto Ledesma G.

?A Quiin va Dirigido?

Empresarios, Contratistas, Servidores Pzblicos y personas relacionadas
con cualquier Proceso de Contrataciones y

Licitaciones de Adquisiciones, Arrendamientos y Servicios.

Solicite mas informes y analice este excelente evento. !Reservaciones!

Solicite Mayores informes, Llamenos al (33) 8851-2365, (33) 8851-2741

Uno de nuestros asesores con gusto le atendera
Responda esta invitacisn con sus datos para enviar el programa completo.

Empresa:
Nombre:
Telifono:
Email:
Nzmero de Interesados:

!Gracias!

Copyright (C) 2010, PMS Capacitacisn Efectiva de Mixico  S.C. Derechos
Reservados. PMS de Mixico, El logo de PMS de Mixico son marcas
registradas. ADVERTENCIA PMS de Mixico no cuenta con alianzas
estratigicas de ningzn tipo dentro de la Repzblica Mexicana. NO SE DEJE
ENGAQAR - DIGA NO A LA PIRATERIA. Todos los logotipos, marcas comerciales
e imagenes son propiedad de sus respectivas corporaciones y se utilizan
con fines informativos solamente.

Este Mensaje ha sido enviado a misc@openbsd.org como usuario de Pms de
Mixico o bien un usuario le refiris para recibir este boletmn.
Como usuario de Pms de Mixico, en este acto autoriza de manera expresa
que Pms de Mixico le puede contactar vma correo electrsnico u otros
medios.
Si usted ha recibido este mensaje por error, haga caso omiso de el y
reporte su cuenta respondiendo este correo con el subject BAJACOMPRANET

Unsubscribe to this mailing list, reply a blank message with the subject
UNSUBSCRIBE BAJACOMPRANET
Tenga en cuenta que la gestisn de nuestras bases de datos es de suma
importancia y no es intencisn de la empresa la inconformidad del
receptor.

[demime 1.01d removed an attachment of type image/png which had a name of 
nlogo.png]



Re: man cp: -i versus -f

2011-06-15 Thread Otto Moerbeek
On Thu, Jun 16, 2011 at 01:50:07PM +1000, john slee wrote:

 On 16 June 2011 04:32, Otto Moerbeek o...@drijf.net wrote:
  Guideline 11:
  The order of different options relative to one another should not
  matter, unless the options are documented as mutually-exclusive and
  such an option is documented to override any incompatible options
  preceding it.
 
 IMHO later options should override earlier options. To not do so may
 yield somewhat unexpected results. In the below sample I prefer the
 OpenBSD behaviour.
 
 4.9:
 
 $ echo hi  foo ; echo zing  bar
 $ alias cp='cp -i'
 $ cp foo bar
 overwrite bar? n
 $ cp -f foo bar
 $ cat bar
 hi
 
 OSX 10.6.7:
 
 $ alias cp='cp -i'
 $ echo hi  foo ; echo zing  bar
 $ cp foo bar
 overwrite bar? (y/n [n]) n
 not overwritten
 $ cp -f foo bar
 overwrite bar? (y/n [n]) n
 not overwritten

INded, we don't want to change behaviour. We're just making sure the
manual pages are more clear. 

-Otto



Re: sed behavior

2011-06-15 Thread Otto Moerbeek
On Wed, Jun 15, 2011 at 11:41:51PM -0300, pablo caballero wrote:

 On Wed, Jun 15, 2011 at 7:17 AM, Otto Moerbeek o...@drijf.net wrote:
  On Wed, Jun 15, 2011 at 09:50:29AM +0200, Alexander Hall wrote:
 
  On 06/15/11 08:35, Otto Moerbeek wrote:
   On Wed, Jun 15, 2011 at 07:44:20AM +0200, Otto Moerbeek wrote:
  
   On Tue, Jun 14, 2011 at 11:56:27PM +0200, sven falempin wrote:
  
   Hello,
  
   Indeed there is a small problem:
  
   # echo 'abf' | sed -E 's/[a$]/x/g'
   xbf
  
   That is expected. $ is only special when it ocurs as the list char of
   a re.
  
   # echo 'abf' | sed -E 's/a|$/x/g'
   x
  
   This is likely to be a real bug.
  
  
   String modification is done inside the 'case 0:'
   substitute(struct s_command *cp) in src/usr.bin/process.c
  
   But the problem may comme from regexec_e.
  
   Maybe openbsd devs should test another regexp code version ?
  
   Why? If we should change libs on every bug encountered, nothing will
   be left.
  
   Anyway, thanks for the report.
  
  -Otto
  
  
   Hope it helps,
   Who still use sed anyway :)
  
   Regards.
  
   2011/6/12 Ingo Schwarze schwa...@usta.de
  
   Hi Nils,
  
   Nils Anspach wrote on Sun, Jun 12, 2011 at 12:49:42PM +0200:
  
   I have an issue with sed. Why does
  
 echo 'ab' | sed -E 's/a|$/x/g'
  
   give 'x' whereas
  
   I sense a bug here.
   Tracing a bit around process(),
   it looks like the first application of the s command
   yields dst = x continue_to_process = b\n,
   and then the second application
   appends \n to dst (should rather append b, i think).
   Maybe something is wrong here with character/pointer counting,
   but i'm somewhat out of time now for tracing.
  
   This is worth more investigation.
  
   Yours,
 Ingo
  
  
  
  
   --
   () ascii ribbon campaign - against html e-mail
   /\
  
   This dif fixes your problem here. Big question is of course: does it
   break other cases?
 
  It differs from perl like this:
 
  $ echo 'l1_1' | perl -pe 's/1|$/X/g'
  lX_XX
  $ echo 'l1_1' | sed -E 's/1|$/X/g'
  lX_X
 
  Meaning we don't hit that final '$' if the last match went to eol.
 
  /Alexander
 
  Right.
 
  I took a look at freebsd, thay have some patches in this area. But
  applying the changes did not have the desired effect. Have to look deeper.
 
 -Otto
 
 
 
 HI Otto.
 
 I think that with a minor change (= instead of  in the last line)
 your diff works.
 
 Regards
 
 +   if (lastempty || match[0].rm_so != match[0].rm_eo ||
 +   (match[0].rm_so == match[0].rm_eo 
 +   match[0].rm_so = 0)) {

From a first look I'm not sure about that. YOu might end up doing a
second append later in the match[0].rm_so == 0 case.

-Otto