diff -ru smbpwman-0.5.orig/smbpwcommon.c smbpwman-0.5/smbpwcommon.c --- smbpwman-0.5.orig/smbpwcommon.c 2004-09-22 11:02:54.000000000 +1000 +++ smbpwman-0.5/smbpwcommon.c 2004-09-22 11:04:44.000000000 +1000 @@ -255,6 +255,8 @@ ssize_t len; char result = 0xff; char *password = 0; + int attempts = 3; + int delay = 1; cs = smbpw_unix_connect(SOCKET_NAME); @@ -260,7 +262,24 @@ if(cs < 0) { - cs = smbpw_unix_connect(SOCKET_NAME); + while(attempts > 0) + { + attempts--; + sleep(delay); + delay = delay * 2; + + cs = smbpw_unix_connect(SOCKET_NAME); + if(cs >= 0) + { + break; + } + } + } + + if(cs < 0) + { + // could not connect to server + return password; } // retrieve