r6149: Fixes bugs #2498 and 2484.
[samba.git] / examples / libsmbclient / teststat.c
index 46eeb13985a7b0d58103957fe6b922f6531a6b95..bea34cfc098e0800a83b7846818f970411187b06 100644 (file)
@@ -3,65 +3,7 @@
 #include <string.h> 
 #include <time.h> 
 #include <libsmbclient.h> 
-
-static void
-get_auth_data_fn(const char * pServer,
-                 const char * pShare,
-                 char * pWorkgroup,
-                 int maxLenWorkgroup,
-                 char * pUsername,
-                 int maxLenUsername,
-                 char * pPassword,
-                 int maxLenPassword)
-    
-{
-    char temp[128];
-    
-    printf("Entered get_auth_data_fn\n");
-
-    fprintf(stdout, "Need password for //%s/%s\n", pServer, pShare);
-    
-    fprintf(stdout, "Username: [%s] ", pUsername);
-    fgets(temp, sizeof(temp), stdin);
-    
-    if (temp[strlen(temp) - 1] == '\n') /* A new line? */
-    {
-        temp[strlen(temp) - 1] = '\0';
-    }
-    
-    if (temp[0] != '\0')
-    {
-        strncpy(pUsername, temp, maxLenUsername - 1);
-    }
-    
-    strcpy(temp, getpass("Password: "));
-    
-    if (temp[strlen(temp) - 1] == '\n') /* A new line? */
-    {
-        temp[strlen(temp) - 1] = '\0';
-    }
-    
-    if (temp[0] != '\0')
-    {
-        strncpy(pPassword, temp, maxLenPassword - 1);
-    }
-
-    fprintf(stdout, "Workgroup: ");
-    fgets(temp, sizeof(temp), stdin);
-    
-    if (temp[strlen(temp) - 1] == '\n') /* A new line? */
-    {
-        temp[strlen(temp) - 1] = '\0';
-    }
-    
-    if (temp[0] != '\0')
-    {
-        strncpy(pWorkgroup, temp, maxLenWorkgroup - 1);
-    }
-
-    putchar('\n');
-}
-
+#include "get_auth_data_fn.h"
 
 
 int main(int argc, char * argv[])