[rancid] Dell PowerConnect

Alexander Griesser AGriesser at anexia-it.com
Thu Jun 22 18:34:21 UTC 2017


There’s a superfluent ) at the end or a missing one somewhere before, don#t know what exactly you want to do here, but maybe you could try:

m/^username (\S+)(\s.*)? password (\S+|\s+)/

If you want to match case insensitive string, you could also add ‚i‘ at the end, f.ex.:

m/^username (\S+)(\s.*)? password (\S+|\s+)/i

but I’m not sure if this does what you want it to do.
What are you trying to match here?

Your regex matches:

* the string „username“ followed by a space
* at least one non-whitespace character
* optional whitespace
* a mandatory space
* the string „password“ followed by another space
* at least one none-whitespace character or at least one whitespace character

Is that what it should match?

Alexander Griesser
Head of Systems Operations

ANEXIA Internetdienstleistungs GmbH

E-Mail: AGriesser at anexia-it.com<mailto:AGriesser at anexia-it.com>
Web: http://www.anexia-it.com<http://www.anexia-it.com/>

Anschrift Hauptsitz Klagenfurt: Feldkirchnerstraße 140, 9020 Klagenfurt
Geschäftsführer: Alexander Windbichler
Firmenbuch: FN 289918a | Gerichtsstand: Klagenfurt | UID-Nummer: AT U63216601

Von: Rancid-discuss [mailto:rancid-discuss-bounces at shrubbery.net] Im Auftrag von Daniel Schmidt
Gesendet: Donnerstag, 22. Juni 2017 20:21
An: heasley <heas at shrubbery.net>
Cc: rancid-discuss at shrubbery.net
Betreff: Re: [rancid] Dell PowerConnect

Unmatched ) in regex; marked by <-- HERE in m/^username (\S+)(\s.*)? password \S+|\S+) <-- HERE / at /var/lib/rancid/bin/srancid line 336.
I really should get a book on regex, I'm no good at it.  Backslash wrong way?


On Tue, Jun 20, 2017 at 4:56 PM, heasley <heas at shrubbery.net<mailto:heas at shrubbery.net>> wrote:
Mon, Jun 19, 2017 at 11:43:02AM -0600, Daniel Schmidt:
> AAA, Dell R1-2401.  Set to SMC, change one line, seems to work fine.
>
> One annoyance:
> - !username admin password <removed>
> - !username sysad password <removed>
>
> The password are no longer removed and they should be.  Thanks Heas.

Does this handle it? Or does it have an encryption type indicator?

Index: bin/srancid.in<http://srancid.in>
===================================================================
--- bin/srancid.in<http://srancid.in>      (revision 3660)
+++ bin/srancid.in<http://srancid.in>      (working copy)
@@ -20,6 +20,7 @@
 #      DELL PowerConnect 62xx
 #      DELL PowerConnect 7048
 #      DELL 34xx (partially; configuration is incomplete)
+#      DELL R1-2401
 #
 use 5.010;
 no warnings 'uninitialized';
@@ -299,6 +300,16 @@
        /^oob host config/i && ProcessHistory("","","","!$_") && next;
        /^empty configuration/i && ProcessHistory("","","","!$_") && next;

+       if (/^username (\S+)(\s.*)? password \S+|\S+)/) {
+           if ($filter_pwds >= 1) {
+               ProcessHistory("USER","keysort","$1",
+                              "!username $1$2 password <removed>\n");
+           } else {
+               ProcessHistory("USER","keysort","$1","$_");
+           }
+           next;
+       }
+
        if (/^password (\S+) encrypted/ && $filter_pwds > 1) {
            ProcessHistory("","","","!password <removed> encrypted\n");
            next;



E-Mail to and from me, in connection with the transaction
of public business, is subject to the Wyoming Public Records
Act and may be disclosed to third parties.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20170622/79ebcfc0/attachment.html>


More information about the Rancid-discuss mailing list