FP1: Upgrading 1.0 Extensions to 1.1 Using Netscape UNIX Servers

ID: Q153899


The information in this article applies to:


SYMPTOMS

The Permissions command does not function after you upgrade from FrontPage 1.0 to FrontPage 1.1 when you are using a Netscape UNIX server.

When you upgrade from FrontPage 1.0 to FrontPage 1.1 and if you are using a Netscape UNIX server, the permissions menu may not function on the upgraded Web.


CAUSE

This problem occurs because FrontPage 1.0 does not require an access.cnf file, but FrontPage 1.1 does. The access.cnf file contains server permissions information. This file is not supplied when you upgrade the Web.


RESOLUTION

To work around this problem, run the following UNIX Perl script on each port. This will create the necessary access.cnf files in the root Web and in each sub Web. The script is for use only with Webs running on UNIX Netscape servers, and may be run either before or after the upgrade to 1.1.


MORE INFORMATION

Use the UNIX Perl script provided in this article to create the access.cnf files in the root Web and in each sub Web.

To use the script:

  1. Copy the script to your UNIX server and name it "makeAccess" (without the quotation marks).


  2. Run makeAccess with no parameters to see the help display on using this script.


You will need to run makeAccess once for each port.

UNIX PERL Script


UNIX PERL Script
----------------

#!/usr/local/bin/Perl

# To see the usage message, run makeAccess with no parameters
if ($#ARGV != 1)
{
print STDERR "Usage: makeAccess contentDir serverName\n";
print STDERR "Creates access.cnf file for root Web and each sub Web.\n";
print STDERR "\n";
print STDERR "contentDir is the full path name to the content directory\n";
print STDERR " for the root Web, with no trailing slash.\n";
print STDERR "\n";
print STDERR "serverName is the value of ServerName from the Netscape\n";
print STDERR "server config file in config/magnus.conf\n";
exit 1;
}

# Get command line args
$contentDir = shift;
$serverName = shift;

# Subroutine to create access.cnf file
sub createAccess
{
    local($accessDir, $passwordDir, $realm, $useRealm) = @_;

    $filename = "$accessDir/access.cnf";
    if (-s $filename)
    {
        # If there is already a non-empty access.cnf, don't overwrite it
        print STDERR "Directory \"$accessDir\" already has a non-empty
        access.cnf file\n";
        return;
    }

    open(OH, ">$accessDir/access.cnf") || die("Could not open file
\"$accessDir/access.cnf\" for writing\n  $!");
    print OH "RealmName:$realm\n";
    if ($useRealm ne '')
    {
 print OH "UseRealm:$useRealm\n";
    }
    print OH "PasswordDir:$passwordDir\n";
    close OH;
    print STDOUT "Created file \"$accessDir/access.cnf\"\n";
}

# Create access.cnf file for the root Web
$pvtDir = "$contentDir/_vti_pvt";
&createAccess($pvtDir, $pvtDir, $serverName, "");

# Create access.cnf file for each sub Web

# Get list of sub Webs by reading services.cnf
$servicesFile = "$contentDir/_vti_pvt/services.cnf";
open(IH, "$servicesFile") ||
    die("Could not open \"$servicesFile\" for reading\n
$!");
@file = <IH>;
close(IH);

# Remove newline from each line
chop(@file);

# Get sub Web name from each line
foreach $line (@file)
{
    $line =~ /(\S+)/;
    $Webname = $1;

    # Remove first slash
    $Webname =~ s/^\///;

    # Skip empty Web name (root Web or blank line)
    next
        if ($Webname eq '');

    # Look at .nsconfig file in _vti_adm
    $nsconfig =
"$contentDir/$Webname/_vti_bin/_vti_adm/.nsconfig";
    open(IH, "$nsconfig") ||
        die("Could not open \"$nsconfig\" for reading\n
$!");
    @require = grep(/RequireAuth/, <IH>);
    close(IH);

    # Get the realm value from the RequireAuth line of .nsconfig
    $req = $require[0];
    $req =~ /(realm=\")([^\"]+)(\")/;
    $nsrealm = $2;

    $accessDir = "$contentDir/$Webname/_vti_pvt";

    # If the realm from nsconfig is different from the Web name,
    # then we inherit permissions from the root Web
    if ($nsrealm ne $Webname)
    {
 # Inherit permissions from root Web
 $passwordDir = "$contentDir/_vti_pvt";
 $realm = $serverName;
 $useRealm = "";
    }
    else
    {
 # Unique permissions for sub Web
 $passwordDir = "$contentDir/$Webname/_vti_pvt";
 $realm = $Webname;
 $useRealm = "/$Webname";
    }

    &createAccess($accessDir, $passwordDir, $realm,
$useRealm);
}

-------------------------------------------------------------------- 
The third-party products discussed here are manufactured by vendors independent of Microsoft; we make no warranty, implied or otherwise, regarding these products' performance or reliability.

Additional query words: front page


Keywords          : kb3rdparty kbnetwork kbdta fpext 
Version           : windows:1.1
Platform          : WINDOWS 
Issue type        : kbprb 

Last Reviewed: July 23, 1999