John Gehring John.Gehring at lefthandnetworks.com
Mon Feb 25 14:52:06 GMT 2002

After repeatedly issuing a getpwent() command from a simple c program, 
getpwent eventually fails to bring over a list of users from the ntdc 
(takes about 15 to 30 seconds: roughly 2000 iterations of the 
while(keepon) loop). In the log.winbind file, I find the following lines 
near the end of the log:

[2002/02/25 22:13:44, 5] rpc_parse/parse_prs.c:prs_ntstatus(587)

Here's the code:

#include <stdio.h>
#include <stdlib.h>
#include <pwd.h>
#include <sys/types.h>
#include <time.h>
#include <sys/time.h>

int main( int argc, char *argv[] )
     int i;
     passwd *passwdStruct;
     bool keepon = true;

     while( keepon ) {
         i = 0;
         while( ( passwdStruct = getpwent() ) != NULL ) {
         time_t the_time;
         the_time = time( NULL );
         printf( "i is %d:  %s", i, ctime( &the_time) );

         if( i<29 ) { // 28 is the number of users in /etc/passwd
             keepon = false;

Why? Why? Why?! I realize that the program does not really represent 
real-time-like behavior/use of the ntdc, but I still don't expect 
winbindd to stop pulling over users.

Is anybody else seeing this behavior? Any suggestions? Thanks.

John Gehring
john.gehring at lefthandnetworks.com

More information about the samba mailing list