parse.y: document quoting rules

2012-04-21 Thread Jason McIntyre
it seems that we have lots of config files that currently have no
guidelines as to what needs quoting, and what does not. the diff below
is for pf.conf.5, and attempts to clarify that.

if no one disagrees, i'll do it for all those that use parse.y. that
is:

/usr/src/sbin/iked/parse.y
/usr/src/sbin/ipsecctl/parse.y
/usr/src/sbin/pfctl/parse.y
/usr/src/usr.sbin/bgpd/parse.y
/usr/src/usr.sbin/dvmrpd/parse.y
/usr/src/usr.sbin/hostapd/parse.y
/usr/src/usr.sbin/ifstated/parse.y
/usr/src/usr.sbin/iscsictl/parse.y
/usr/src/usr.sbin/ldapd/parse.y
/usr/src/usr.sbin/ldpd/parse.y
/usr/src/usr.sbin/mrouted/cfparse.y
/usr/src/usr.sbin/ntpd/parse.y
/usr/src/usr.sbin/ospf6d/parse.y
/usr/src/usr.sbin/ospfd/parse.y
/usr/src/usr.sbin/relayd/parse.y
/usr/src/usr.sbin/ripd/parse.y
/usr/src/usr.sbin/smtpd/parse.y
/usr/src/usr.sbin/snmpd/parse.y
/usr/src/usr.sbin/ypldap/parse.y

any dissention, or inaccuracies?

jmc

Index: pf.conf.5
===
RCS file: /cvs/src/share/man/man5/pf.conf.5,v
retrieving revision 1.513
diff -u -r1.513 pf.conf.5
--- pf.conf.5   31 Jan 2012 07:46:32 -  1.513
+++ pf.conf.5   21 Apr 2012 17:32:13 -
@@ -72,14 +72,17 @@
 .Pp
 Additional configuration files can be included with the
 .Ic include
-keyword, for example:
+keyword.
+Note that argument names not beginning with a letter, digit, or underscore
+must be quoted.
+For example:
 .Bd -literal -offset indent
 include "/etc/pf/sub.filter.conf"
 .Ed
 .Pp
 Macros can be defined that will later be expanded in context.
-Macro names must start with a letter, and may contain letters, digits
-and underscores.
+Macro names must start with a letter, digit, or underscore,
+and may contain any of those characters.
 Macro names may not be reserved words (for example
 .Ar pass ,
 .Ar in ,



The rivolution web

2012-04-21 Thread newusers
Hello, I'm Bybor, your new social network!
Get to know me on,   www.bybor.com

[demime 1.01d removed an attachment of type image/jpeg which had a name of 
bybor LOGO.jpg]
 April 27, 2012



Re: parse.y: document quoting rules

2012-04-21 Thread Florian Obser
On 04/21/12 19:33, Jason McIntyre wrote:
> 
> any dissention, or inaccuracies?
> 
> jmc
> 
> Index: pf.conf.5
> ===
> RCS file: /cvs/src/share/man/man5/pf.conf.5,v
> retrieving revision 1.513
> diff -u -r1.513 pf.conf.5
> --- pf.conf.5 31 Jan 2012 07:46:32 -  1.513
> +++ pf.conf.5 21 Apr 2012 17:32:13 -
> @@ -72,14 +72,17 @@
>  .Pp
>  Additional configuration files can be included with the
>  .Ic include
> -keyword, for example:
> +keyword.
> +Note that argument names not beginning with a letter, digit, or underscore
> +must be quoted.
> +For example:
>  .Bd -literal -offset indent
>  include "/etc/pf/sub.filter.conf"
>  .Ed
>  .Pp

Keywords need to be quoted, too.
This does not work (syntax error)
include tag
while this works:
include "tag"

What got me thinking about this: Is that sentence supposed to describe
quoting rules for the "include" keyword (I'm reading it that way) or
should it apply to the whole pf.conf grammar?

I think it should apply to the whole grammar:
This does not work (syntax error)
pass in tag tag
pass in tag /foo
while this works:
pass in tag "tag"
pass in tag "/foo"

One other thing: Are you aiming for an exhaustive list of things that
need to quoted? For example at first I thought that spaces need to be
quoted, it turns out that assumption was wrong, this works:
pass in tag foo bar

I don't know if your sentence + something about keywords would be an
exhaustive list.

florian



Re: parse.y: document quoting rules

2012-04-21 Thread Florian Obser
On 04/21/12 20:45, Florian Obser wrote:
> I think it should apply to the whole grammar:
> This does not work (syntax error)
> pass in tag tag
> pass in tag /foo
> while this works:
> pass in tag "tag"
> pass in tag "/foo"

Of course these rules combined are nonsense. What I meant to say:
I tried both cases on their own. Sorry for the inaccuracy.

florian



Re: parse.y: document quoting rules

2012-04-21 Thread Jason McIntyre
On Sat, Apr 21, 2012 at 08:45:25PM +0200, Florian Obser wrote:
> 
> Keywords need to be quoted, too.
> This does not work (syntax error)
> include tag
> while this works:
> include "tag"
> 
> What got me thinking about this: Is that sentence supposed to describe
> quoting rules for the "include" keyword (I'm reading it that way) or
> should it apply to the whole pf.conf grammar?
> 
> I think it should apply to the whole grammar:
> This does not work (syntax error)
> pass in tag tag
> pass in tag /foo
> while this works:
> pass in tag "tag"
> pass in tag "/foo"
> 
> One other thing: Are you aiming for an exhaustive list of things that
> need to quoted? For example at first I thought that spaces need to be
> quoted, it turns out that assumption was wrong, this works:
> pass in tag foo bar
> 
> I don't know if your sentence + something about keywords would be an
> exhaustive list.
> 
> florian
> 

the sentence was supposed to describe pf grammar (not just "include").
but you've spotted an ambiguity ;( i'd hoped to get away with not making
this too verbose, but i guess it's inevitable.

it's tricky because the grammar is so large. it's not meant to be
exhaustive - just a start. for example, in pf.conf we have to quote "{"
but not "<". i haven;t found a simple way to describe everything.

rewrite below.
jmc

Index: pf.conf.5
===
RCS file: /cvs/src/share/man/man5/pf.conf.5,v
retrieving revision 1.513
diff -u -r1.513 pf.conf.5
--- pf.conf.5   31 Jan 2012 07:46:32 -  1.513
+++ pf.conf.5   21 Apr 2012 20:39:17 -
@@ -70,6 +70,9 @@
 Care should be taken when commenting out multi-line text:
 the comment is effective until the end of the entire block.
 .Pp
+Argument names not beginning with a letter, digit, or underscore
+must be quoted.
+.Pp
 Additional configuration files can be included with the
 .Ic include
 keyword, for example:
@@ -78,8 +81,8 @@
 .Ed
 .Pp
 Macros can be defined that will later be expanded in context.
-Macro names must start with a letter, and may contain letters, digits
-and underscores.
+Macro names must start with a letter, digit, or underscore,
+and may contain any of those characters.
 Macro names may not be reserved words (for example
 .Ar pass ,
 .Ar in ,



sys_pipe: take fd table lock after allocating memory

2012-04-21 Thread Mike Belopuhov
there's no apparent need to take a file descriptor table lock
before we've done allocating pipe structures and buffers. ok?

Index: sys/kern/sys_pipe.c
===
RCS file: /home/cvs/src/sys/kern/sys_pipe.c,v
retrieving revision 1.61
diff -u -p -r1.61 sys_pipe.c
--- sys/kern/sys_pipe.c 8 Jul 2011 19:00:09 -   1.61
+++ sys/kern/sys_pipe.c 11 Apr 2012 18:44:23 -
@@ -108,11 +108,9 @@ sys_pipe(struct proc *p, void *v, regist
} */ *uap = v;
struct filedesc *fdp = p->p_fd;
struct file *rf, *wf;
-   struct pipe *rpipe, *wpipe;
+   struct pipe *rpipe = NULL, *wpipe = NULL;
int fds[2], error;
 
-   fdplock(fdp);
-
rpipe = pool_get(&pipe_pool, PR_WAITOK);
error = pipe_create(rpipe);
if (error != 0)
@@ -120,7 +118,9 @@ sys_pipe(struct proc *p, void *v, regist
wpipe = pool_get(&pipe_pool, PR_WAITOK);
error = pipe_create(wpipe);
if (error != 0)
-   goto free2;
+   goto free1;
+
+   fdplock(fdp);
 
error = falloc(p, &rf, &fds[0]);
if (error != 0)
@@ -157,11 +157,12 @@ free3:
closef(rf, p);
rpipe = NULL;
 free2:
-   (void)pipeclose(wpipe);
+   fdpunlock(fdp);
 free1:
+   if (wpipe != NULL)
+   (void)pipeclose(wpipe);
if (rpipe != NULL)
(void)pipeclose(rpipe);
-   fdpunlock(fdp);
return (error);
 }



Комерческое предложение

2012-04-21 Thread veter
com-bis.com P-P"P :


PoP;ocQaP;QP=oe yP2eP;P8QP5P=P8e
P$oQPP3o P:oPP9 24Q7 P2 P;QP1P>P9 QoQP:P5
P?P;aP=P5QQ
PoQQQP? P: QP>QP3oP2P>P9 P?P;P>Q   P0P4P:P5 P#P:QP0P8P=Q P8 QQQaP=
P!PP
OQP3P0P=P8P7P0QP8Q QeP;P5P2QQ P8 QP8QoP:P>PP2 P8 yQP;yP3
PP5oP3QP0QP8QP5QP:P>P5 QP0QQP8QP5P=P8P5 P1P8P7P=P5Qa
MP>PP5 P>P1P=P>P2P;P5P=P8P5 P8P=QP>QPP1QP0QP=P>P9 QP2QP7P8,
PQP5P4P>QQP0P2P;P5P=P8P5 QQP;QP3 P2 QP5P6P8PP4P4P5QP6P:P8 P2 QP5P6P8PP7PP6P=P>QQP5P9 P?P> QP>P?QP>P2P>P6P4P5P=P8Q
P:P;P8P5P=QP>P2.
PP>QQQP? P: QP>QP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