I think I remember reading that SME Server is only designed to support  500
users max.  The problem you discovered may never have been addressed because
it was never designed to handle such a large user base.

Best Regards,
David Davis

----- Original Message -----
From: "Abe Loveless" <[EMAIL PROTECTED]>
To: "Devinfo" <[EMAIL PROTECTED]>
Sent: Tuesday, July 23, 2002 1:58 PM
Subject: [e-smith-devinfo] Possible Bug: devinfo-usermanager



I believe I may have found a bug in the devinfo-usermanager.  (Or more
likely, a limitation in apache) I'm using
devinfo-mitel-usermanager-pkg-0.0.1-6.noarch.rpm.

After adding approx. 1900 users, httpd-admin no longer loaded.  It told
me the error occurred on line such and such of
/etc/httpd/admin-conf/httpd.conf, which turned out to be generated by
.../templates/etc/httpd/admin-conf/httpd.conf/90e-smithAccess30user.  I
believe the error was caused because the "require user ...." line was
too long in the 2 user panel "<Directory>" sections.

After some experimentation, I figured out that apache will accept
multiple "require user..." lines in the same <Directory></Directory>
segment.  (I couldn't find any Apache documentation on this, but it
works on my SME 5.5 machine.)  So, I altered the 90e-smithAccess30user
file to count the number of users it processes.  Once it reaches 500
users, it inserts a line break and begins a new "require user" line
within the same $require variable.

The file is listed below, I left my changes aligned to the left for
easier readability.  I added 6 lines.  A declaration of "$i", an "if"
statement within the original "while" loop, and a $i++.

I wanted to send this out to the group for consideration.

Thanks,
Abe



#------------------------------------------------------------
# e-smith-user panel
#------------------------------------------------------------
{
    use esmith::db;

    my %accounts;
    tie %accounts, 'esmith::config', '/home/e-smith/accounts';

    my %panelshash;
    opendir (DIR, "/etc/e-smith/web/panels/user/cgi-bin")
        || die "Can't open /etc/e-smith/web/panels/user/cgi-bin
directory.\n";

    my @files = sort (grep
(!/(^\.\.?$)|(^pleasewait$)|(^userpanel-[a-z][\-\_a-z0-9]*)/,
readdir(DIR)));

    closedir (DIR);

my $i = 0;
    my $key;
    my $value;
    my $require = "require user";

    while (($key,$value) = each %accounts)
    {
        my ($type, %properties) = split (/\|/, $value, -1);
        if ($type eq 'user')
        {

if ($i == 500) {
    $require .= " \n    require user";
    $i = 0;
}
$i++;
            # Build the all-users require line:
           $require .= " $key";

            foreach $file (@files)
            {
                my $adminpanels = db_get_prop(\%accounts, $key,
'AdminPanels');
                if ( defined $adminpanels )
                {
                    my @adminpanels = split (/,/, $adminpanels, -1);
                    if (grep /^$file$/, @adminpanels)
                    {
                        # Build a files require line for each panel
                        $panelshash{$file} .= " $key"
                    }
                }
            }
        }
    }




    # Select the newer header image if it's found:
    my $imageName = -e '/etc/e-smith/web/common/server-manager.jpg' ?
                    'server-manager.jpg' : 'e-smith-manager.gif';
    $OUT .= <<HERE;
<Directory \"/etc/e-smith/web/panels/user/html\" >
    Options Includes Indexes FollowSymLinks
    AllowOverride None
    order deny,allow
    deny from all
    allow from $localAccess
    AuthName "Mitel Networks SME User manager"
    AuthType Basic
    AuthExternal pwauth
    $require
    SetEnv IMGHDR_SRC \"/e-smith-common/$imageName\"
    Satisfy all
</Directory>

<Directory \"/etc/e-smith/web/panels/user/cgi-bin\" >
    Options Includes Indexes FollowSymLinks
    AllowOverride None
    order deny,allow
    deny from all
    allow from $localAccess
    AuthName "Mitel Networks SME User Manager"
    AuthType Basic
    AuthExternal pwauth
    $require
    SetEnv IMGHDR_SRC \"/e-smith-common/$imageName\"
    Satisfy all
HERE

    foreach $file (@files)
    {
        my $requireuser = "require user admin";
        $requireuser .= $panelshash{$file} if ( defined
($panelshash{$file}) );
        $OUT .= "\n";
        $OUT .= "    <Files $file>\n";
        $OUT .= "        AuthName \"Mitel Networks SME User
manager\"\n";
        $OUT .= "        AuthType Basic\n";
        $OUT .= "        AuthExternal pwauth\n";
        $OUT .= "        $requireuser\n";
        $OUT .= "    </Files>\n";
    }

    $OUT .= "</Directory>\n";
}


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.377 / Virus Database: 211 - Release Date: 7/15/2002



--
Please report bugs to [EMAIL PROTECTED]
Please mail [EMAIL PROTECTED] (only) to discuss security issues
Support for registered customers and partners to [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Archives by mail and http://www.mail-archive.com/devinfo%40lists.e-smith.org






--
Please report bugs to [EMAIL PROTECTED]
Please mail [EMAIL PROTECTED] (only) to discuss security issues
Support for registered customers and partners to [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Archives by mail and http://www.mail-archive.com/devinfo%40lists.e-smith.org

Reply via email to