Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    SquidGuard db problem

    Scheduled Pinned Locked Moved pfSense Packages
    5 Posts 2 Posters 2.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      Fesoj
      last edited by

      While trying to solve a different problem I found that running db_verify on various domains.db files (in my case coming from shallalist) failed (see also http://forum.pfsense.org/index.php/topic,43675.285.html).

      Has anybody else observed this too? It seems that the "out-of-order" keys do not result in runtime problems.

      1 Reply Last reply Reply Quote 0
      • marcellocM
        marcelloc
        last edited by

        On sqlite, binary from version 3 does not open files from version 2.

        Isn't this the same issue you are getting?

        trying to check a db from a different version.

        Treinamentos de Elite: http://sys-squad.com

        Help a community developer! ;D

        1 Reply Last reply Reply Quote 0
        • F
          Fesoj
          last edited by

          Isn't this the same issue you are getting?

          pfSense2 installs a rather old version of the Berkeley db (4.2). The database files are generated and read by the binaries of the same version and I used the db utilities that came with the 4.2 version, so this should not be an issue.

          On the other hand, the squidGuard version is rather new (with references to db 4.7 and later) and subtle differences in the C API could be responsible for the broken database. Meanwhile I also had a look at the C sources of squidGuard and there is an appreciable amount of low level char* handling. This should be checked as well for subtle bugs. I'll report once I know how things are done there.

          1 Reply Last reply Reply Quote 0
          • F
            Fesoj
            last edited by

            I retrieved the squidGuard tar ball and compiled it with db 4.8 under cygwin on my Windows machine. Using the configuration test1.conf of the squidGuard distribution I generated the db files. The outcome is the same as on my pfSense2 box:

            $ ../src/squidGuard -d -c test1.conf -C all
            …
            db4.8_verify: Page 16: out-of-order key at entry 546
            db4.8_verify: Page 16: out-of-order key at entry 554
            db4.8_verify: Page 16: out-of-order key at entry 558
            db4.8_verify: Page 16: out-of-order key at entry 560
            db4.8_verify: Page 16: out-of-order key at entry 564
            db4.8_verify: Page 16: out-of-order key at entry 566
            db4.8_verify: Page 16: out-of-order key at entry 568
            db4.8_verify: domains.db: DB_VERIFY_BAD: Database verification failed

            I'd say the problem is the squidGuard binary.
            (to be continued)

            1 Reply Last reply Reply Quote 0
            • F
              Fesoj
              last edited by

              This is another example where reading part of the docs is worse than none.

              squidGuard uses its own compare function (domainCompare()), so db_verify() cannot possibly know about the intended sort order. This is why verifying fails. The -o flag allows for skipping the sort order verification and when checking the domains.db files

              db_verify -o domains.db

              should be called. Needless to say, all db files are ok.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.