Dealing with precompiled quirks and undocumented design.

I heard someone ask the question once of some piece of software "Why did they hard code that value into the program?". The posed answer to that question was "My only guess would be to maximize suckage."

The FrontPage extensions have some values hard coded into the programs that really shouldn't be. The one that I had the most trouble with was the user web directory suffix. The FrontPage extension binaries are hard coded to use the web suffix public_html. For some reason recently, this whole public_html user web directory suffix standard has been catching on, and I guess Microsoft decided that they would push it along even further. I personally don't think that public_html is a good name for the suffix. The older convention of using www makes more sense because it doesn't lend itself to any one document format that might be replaced someday. Anyways, I won't ramble on about my opinions here anymore.

If you need to change the web suffix that the binaries use you can accomplish this by editing the programs with a text editor that has a binary editing mode. Both Emacs and Vi have binary editing modes. See the documentation on those programs for details.

In the binary program files you can search for the string public_html, which is in each file about three times. Once you have located the relevant text, you can overwrite the word public_html with the suffix that you use followed by a null character.

WARNING: It is very important that you do not change the length of the file. Otherwise the binary program file will cease to work and will dump core every time you try to run it. Therefore, you must replace the word public_html like this:

original: public_html
replacement: www^@ic_html

The ^@ symbol is a two character sequence that represents the null character in most editors. To give you an example using vi, you can open the file with vi -b <binaryfilename> and then in command mode type /public_html. This will take you to the first instance of the word public_html. Right before the word public_html there should be a null character. I wasn't able to figure out how to type in a null character in vi without copying one into the paste buffer so what you'll have to do is delete one of the null characters in the file with the cut command, reinsert the character back where it was using the P key, and then paste the null character still in your paste buffer overtop of the first l in public_html. So here would be the exact sequence of keys (arrow keys, return and escape are specified in angle brackets):

Step Command to run What you're doing
1. vi -b shtml.exe <return> [Open the file in binary mode.]
2. /public_html <return> [Search for the string.]
3. <left arrow> [Move over top of the null character.]
4. x [Cut the character under the cursor.]
5. P [Paste it back in the current position.]
6. 4l [Move one position right 4 times.]
7. p [Paste the character after the cursor.]
8. 4h [Move left 4 characters.]
9. 4x [Cut 4 characters after the cursor.]
10. i [Insert mode.]
11. www [type in the www string.]
12. <escape> [Go back to command mode.]
13. n [find the next instance of public_html.]
14. [repeat steps 3-13 until all strings are replaced.]
15. ZZ [Exit vi, saving the file.]

Now do the same thing for the other binary files. The binaries that you will need to modify are located at:

     /usr/local/frontpage/version4.0/bin/fpsrvadm.exe
     /usr/local/frontpage/version4.0/exes/_vti_bin/shtml.exe
     /usr/local/frontpage/version4.0/exes/_vti_bin/_vti_adm/admin.exe
     /usr/local/frontpage/version4.0/exes/_vti_bin/_vti_aut/author.exe

You will obviously need to adjust these instructions depending on what your web directory suffix is and how many characters the suffix is.

Next
Apache and Frontpage Copyright 2001 Suso Banderas (suso@suso.org)