WYAE - FWTOOLS Mailing List Archive
| Problem with "unquoted" comments
|
| From: | "WISNIEWSKI, DANIEL (SBCSI)" |
| Date: | Fri, 8 Oct 2004 09:02:22 -0400
|
It may be a case of one (1) word ( character or numbers) gets no
quotes... and fails to get picked up by the scrip=20
=20
=20
=20
:comments ()
:comments ("Firewall Services")
:comments ("Troubleshooting services")
:comments ("Support Services") <----RULE 8
:comments (BGP) <-------------------- RULE 9
:comments (OSPF) <-------------------- RULE 10
:comments () <------------------------------RULE
11 --- a true empty field.
:comments (Stealth) <------------------------
RULE 12
:comments ("04/26/02 initial build - ggf")
:comments ("04/26/02 initial build - ggf")
:comments ("04/26/02 initial build - ggf")
:comments ("04/26/02 initial build - ggf")
:comments ("01/29/03 #464509 - ggf")
:comments ("07/10/03 #527679 - ggf;07/25/03
#536399 - ggf")
:comments ("04/26/02 initial build -
ggf;08/08/02 #413618 - ggf;10/04/02 #428752 - ggf")
:comments ("04/26/02 initial build - ggf")
:comments ()
:comments ("Last Rule, if not previously allowed
it's too late")
Another Example
=20
:comments ("rh3136#322469, rh3136#322477")
:comments ("jy9462#179137,
lb1653#225793,;er1416#307835")
:comments ("kd7617#259958, kd7617#291343
484853")
:comments (635722)
:comments ("kd7617#175957")
:comments ("js2931#243035,
js2931#243037,;kd7617#250083")
:comments ("jj3259#210474,
jj3259#210464,;jj32593#215384, er1416#223934,;lb1653#225793,
dl4234#302954, 547598")
:comments
("345178,kd7617#351102,;ld931a#370127, 669143 ")
:comments (97090512p)
:comments ("3/22/04 657337 sib")
:comments ()
=20
=20
=20
=20
=20
=20
=20
=20
-----Original Message-----
From: WISNIEWSKI, DANIEL (SBCSI)=20
Sent: Thursday, October 07, 2004 2:28 PM
To: 'Reto Schuettel'; fwtools@wyae.de
Subject: RE: [fwtools] Suggestion - Null Values in Templates
=09
=09
Hi -
Thanks for responding....
=20
Yes, I had thought about doing that as another processing
script, as I renumber rule numbers from 1 -> 9 to 001-> 009.
remove / add/ change other stuff. so maybe I'll just grab each
position and if its' empty - change it=20
=20
as for the comments try this out:
=20
copy your rulebases_5_0.fws into someplace you can "play: with
it.
=20
Now if grep for comments ( Where all the rule comments are) I
have , as an example
=09
:comments ("rx1489#566389,
rx1649#795276")
:comments ("rl2435#795641")
:comments ()
:comments (562424)
:comments (562428)
:comments ()
:comments ()
:comments ()
:comments ("jy2967#551747")
=20
If you notice, there are no quotes (") for 562424. so
, edit a comment ( or add a comment) and add it just as a number. -
better yet - make a comment in one of your rulebases and just add
numbers ( no other characters ) -=20
and the script won't pick it up. I'm trying to track
it down.
=20
Thanks again for the advice - i'll give it a try.
=20
dan
=20
=20
=20
=20
=20
-----Original Message-----
From: Reto Schuettel [mailto:reto-fwtools@schuettel.ch]=20
Sent: Thursday, October 07, 2004 1:48 PM
To: fwtools@wyae.de
Cc: WISNIEWSKI, DANIEL (SBCSI)
Subject: Re: [fwtools] Suggestion - Null Values in
Templates
=09
=09
Hi Dan=20
You wrote:=20
> ITEM 1=3D=3D=3D=3D=3D=3D=3D=3D=3D=20
> =20
> I use Templates to Load into MySQL=20
Hm, you could use the templates for creating sql code
directly :)?=20
> Accordingly, at times I need to find fields that have
"null" ( empty)=20
> values. =20
> =20
> Perhaps a change in code=20
> =20
> around line 3267=20
>=20
> ## For DB Nulls=20
> if ( $access_comment[$i] ) {=20
> $line =3D~
s/<<>>/$access_comment[$i]/g;=20
> } else {=20
> $line =3D~ s/<<>>/NULL/g;=20
> fi=20
> }=20
Hm, in my opinion this solution is quiet ugly, because
it breaks=20
everything :). You have to implement that as an optional
parameter, like=20
--print-nulls or something like that, you should never
change the default=20
behavior!=20
As an temporary workaround (until somebody implement
this features - who=20
volunteers? :)) you could use a postprocess script,
which replaces the=20
'empty' values with a NULL.=20
If you use tabs as delimiter:=20
# fwtool.pl ...=20
# perl -i -pe 's/\t\t/\tNULL\t/g' output.tsv # these
both commands=20
# perl -i -pe 's/\t\n/\tNULL\n/g' output.tsv # replaces
all the empty=20
# strings
with NULL=20
#
(untested)=20
# mysql 'LOAD INTO FILE .. bla bla output.tsv'=20
> ITEM 2 =3D=3D=3D=3D=3D=3D=3D=3D=20
> =20
> COMMENTS that are entered with just a numerical value
- DO NOT SHOW UP=20
> when used with templates. It appears CP add's a
"quote" to any=20
> "character string" - but not a numerical value:=20
> =20
> Therefore IF you add a comment such as a tracking
number ie: 2766 =20
> It will not show up in your template output.=20
> However, IF you added a comment such as : #2766 it
will show up.=20
Hm, atm I don't have an fw rulebase with such comments,
but if I have=20
time I'll try to verify that tomorrow. Empty comments
are exported=20
correctly:=20
(i used vim with ':set list' output, with this options
all the tabs are represended with '^I')=20
9^I160.59.191.192/27^I194.69.181.57^Itcp22^ISSH admin
access for NCC / ENG.$=20
5^I192.168.190.126^I192.168.190.126^Itcp18191, tcp256,
udp6372^I$=20
as you can see, the rule nr 5 has an 'emtpy' field.=20
- reto=20
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---