diff options
Diffstat (limited to 'examples/libsmbclient/testbrowse.c')
-rw-r--r-- | examples/libsmbclient/testbrowse.c | 62 |
1 files changed, 2 insertions, 60 deletions
diff --git a/examples/libsmbclient/testbrowse.c b/examples/libsmbclient/testbrowse.c index 8122df5e2e..27d6a69738 100644 --- a/examples/libsmbclient/testbrowse.c +++ b/examples/libsmbclient/testbrowse.c @@ -5,8 +5,9 @@ #include <stdio.h> #include <string.h> #include <popt.h> -#include <libsmbclient.h> #include <stdlib.h> +#include <libsmbclient.h> +#include "get_auth_data_fn.h" void error_message(char * pMessage) { @@ -14,65 +15,6 @@ void error_message(char * pMessage) } -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'); -} - - int main(int argc, char * argv[]) { |