You are here: Foswiki>Tasks Web>Item2120 (04 Nov 2010, MichaelDaum)Edit Attach

Item2120: Use of uninitialized value $loginName in hash element at /var/www/twiki/lib/Foswiki/Users/LdapUserMapping.pm line 160.

pencil
Priority: Normal
Current State: No Action Required
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: LdapContrib
Branches:
Reported By: EduardoJ
Waiting For:
Last Change By: MichaelDaum
Hi!

With this cronjob for notifications:

0   */2  * * * (cd /var/www/twiki/tools/;  perl -I bin ./mailnotify -q)

I recieve this email, each two hours:

subject   Cron <root@my_machine> (cd /var/www/twiki/tools/; perl -I bin ./mailnotify -q)

Use of uninitialized value $loginName in hash element at /var/www/twiki/lib/Foswiki/Users/LdapUserMapping.pm line 160.
Use of uninitialized value $wikiName in concatenation (.) or string at /var/www/twiki/lib/Foswiki/Users/LdapUserMapping.pm line 176.

I searched the value of $loginName, and it was AdminGroup.

Modifying /lib/Foswiki/Engine/CLI.pm this way solves the problem:

sub prepareHeaders {
    my ( $this, $req ) = @_;
    if ( defined $this->{user} ) {
        $req->remoteUser( $this->{user} );
        delete $this->{user};
    }
    else {
#        $req->remoteUser( $Foswiki::cfg{SuperAdminGroup} );
        $req->remoteUser( $Foswiki::cfg{AdminUserWikiName} );
    }
}

  • mypatch.diff: Replace $req->remoteUser( $Foswiki::cfg{SuperAdminGroup} ); with $req->remoteUser( $Foswiki::cfg{AdminUserWikiName} );

-- EduardoJ - 20 Sep 2009

i presume that Micha should see this to confirm that its gone?

-- SvenDowideit - 29 Jun 2010

According to Foswiki.spec

$Foswiki::cfg{AdminUserWikiName} = 'AdminUser';
$Foswiki::cfg{SuperAdminGroup} = 'AdminGroup';

Both settings should always be defined. Both settings should be okay, that is it is okay to use the AdminGroup as a user. AdminUser should always be member of the AdminGroup as defined in the BaseMapper.

The code lines mentioned above are rather unlikely to run into an undef, e.g. the wikiName defaults to the loginName if it is undefined. The coed never reaches wikiName if even loginName can't be derived from a cUID.

Eduardo, can yo please attach your version of LdapUserMapping.pm. In any case check for updates. Maybe you are using a rather old version of LdapContrib.

-- MichaelDaum - 30 Jun 2010

Closing this due to lack of feedback. Sorry.

-- MichaelDaum - 04 Nov 2010

ItemTemplate edit

Summary Use of uninitialized value $loginName in hash element at /var/www/twiki/lib/Foswiki/Users/LdapUserMapping.pm line 160.
ReportedBy EduardoJ
Codebase 1.0.5
SVN Range SVN 5053: Foswiki-1.1.0-dev, Thu, 03 Sep 2009, build 4764
AppliesTo Extension
Component LdapContrib
Priority Normal
CurrentState No Action Required
WaitingFor
Checkins 14
TargetRelease n/a
ReleasedIn n/a
I Attachment Action Size Date Who Comment
mypatch.diffdiff mypatch.diff manage 402 bytes 20 Sep 2009 - 21:04 EduardoJ Replace $req->remoteUser( $Foswiki::cfg{SuperAdminGroup} ); with $req->remoteUser( $Foswiki::cfg{AdminUserWikiName} );
Topic revision: r4 - 04 Nov 2010, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy