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

    bug in web interface for bind package

    Scheduled Pinned Locked Moved pfSense Packages
    17 Posts 6 Posters 1.3k 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.
    • bmeeksB
      bmeeks
      last edited by bmeeks

      Usually, the "^M" comes from the Windows (or DOS) line ending sequence of Carriage Return/Line Feed (or 0x0d 0x0a in hex). Unix land hates that. The most likely way to get that in pfSense is by directly pasting something into the text box from the clipboard in Windows. The text will not be converted to Unix line endings automatically when pasted in. Looks like that regex in the package tries, but if the lowercase "M" is correctly written in the post that is incorrect. It needs to be searching for the uppercase "M".

      I get around this in one of two ways, and both are extra work --

      1. Paste in one line at a time but be very sure you do not grab the line ending character. So highlight up to the very last character you see on the Windows screen and then stop. Don't grab multiple lines, and don't grab that little "space" that may highlight at the end of a text line in some Windows text editors.

      2. Create your file of text in Windows, then use WinSCP or something similar to copy the file over to pfSense. WinSCP has an option to transfer as "text", and it will fix the line endings for the destination system when that option is used. So it will strip the 0x0d0x0a character sequence and leave the proper 0x0a value on the FreeBSD side. However, this option is not the default! You must manually choose it. You can set it as the default if you wish. Of course once you get the physical file over on pfSense, you still have to manually get the content into the text box on the GUI tab.

      A 1 Reply Last reply Reply Quote 0
      • A
        aligator638
        last edited by

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • A
          aligator638 @bmeeks
          last edited by

          @bmeeks

          named.conf is rewritten from the xml file every time you save, so it should not be edited manually.

          1 Reply Last reply Reply Quote 0
          • A
            aligator638 @johnpoz
            last edited by

            @johnpoz very odd, I removed the entries, checked named.conf was ok. Retyped everything, and my ^M are back.

            bmeeksB 1 Reply Last reply Reply Quote 0
            • bmeeksB
              bmeeks @aligator638
              last edited by bmeeks

              @aligator638 said in bug in web interface for bind package:

              @johnpoz very odd, I removed the entries, checked named.conf was ok. Retyped everything, and my ^M are back.

              In my previous post, I was talking about typing in any text input box in the pfSense GUI, not editing a file directly on the system. So if you are "pasting" something into a text box in the GUI, and that pasted text contains Windows or DOS line ending sequences, this ^M problem will show up.

              So when you say "typed", do you mean only typing from the keyboard, or are you perhaps pasting in something from elsewhere into the GUI text box? I'm not a user of bind on pfSense, but I assume it has a place for the user to manually enter certain things into the configuration by typing or pasting text into one or more text boxes or text input areas in the GUI screens. If Windows or DOS line endings get copied into those GUI text boxes, they will get saved into the XML and then subsequently written out to the named.conf or any other file generated at runtime by the pfSense system.

              How do I know this can happen? Because I fought it for some time in the code I wrote for the Snort and Suricata packages.

              A 1 Reply Last reply Reply Quote 0
              • A
                aligator638 @bmeeks
                last edited by

                @bmeeks sorry, I re-TYPED everything, not cut and paste. And as explained in previous posts, this happens in all the custom fields in this package.

                1 Reply Last reply Reply Quote 0
                • A
                  aligator638
                  last edited by

                  Checked the main xml file and decoded the saved text (it is base64)

                  cmVjdXJzaW9uIG5vOw0KYWxsb3ctdHJhbnNmZXIgeyBub25lOyB9Ow0KYmluZGtleXMtZmlsZSAiL2V0Yy9uYW1lZC9iaW5kLmtleXMiOw==

                  ==>>

                  recursion no;
                  allow-transfer { none; };
                  bindkeys-file "/etc/named/bind.keys";

                  No ^M characters in the xml file. So these characters are added when the data is saved into named.conf

                  1 Reply Last reply Reply Quote 0
                  • S
                    serbus
                    last edited by

                    Hello!

                    What are you using to view the named.conf after adding custom options with the web gui? e.g. "ssh in with putty on windows and cat the named.conf" , or "Diagnostics -> Edit File in the gui", etc...

                    John

                    Lex parsimoniae

                    A 1 Reply Last reply Reply Quote 0
                    • A
                      aligator638 @serbus
                      last edited by

                      @serbus very interesting comment John, in vi (ssh), I can see the ^M, but not with the GUI editor, just to check I selected into the editor, and copied that data back into vi again, no ^M

                      1 Reply Last reply Reply Quote 0
                      • R
                        retaichraq123 Banned
                        last edited by

                        This post is deleted!
                        1 Reply Last reply Reply Quote 0
                        • R
                          retaichraq123 Banned
                          last edited by

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