-
Notifications
You must be signed in to change notification settings - Fork 7
Description
I'm using your unixlib for pam authentication in a service communicating with clients over TCP. The important part of code is this:
// disable timeout so connection isn't dropped prior to authentication result is available
this.setTimeout( 0 );
console.log( "authenticating user %s using provided password", username );
var conn = this;
unix.pamauth( "system-auth", username, password, function( isAuthenticated )
{
console.log( "authentication result is" );
console.log( isAuthenticated );
conn.end( isAuthenticated ? "OK\n" : "FAIL\n" );
} );The conn is TCP stream clients are connected through. If I'm testing this service using valid credentials, it's echoing "OK". If I'm using wrong password, service is instantly returning either, but not echoing anything. In first case, the logs of my service include lines "authenticated result is" and "true", while there aren't any lines written on using wrong credentials.
Relying on this observation I consider callback not being invoked in case of wrong credentials at all. I've installed unixlib using
npm --global install unixlib
and it's loaded in code using
var unix = require( "/usr/lib/node_modules/unixlib" );What's missing? Your C++-code seems to be invoking callback every time, though. OS is Ubuntu 12.04 LTS x64, node is 0.8.8 ...