summaryrefslogtreecommitdiff
path: root/examples/libsmbclient/teststat.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/libsmbclient/teststat.c')
-rw-r--r--examples/libsmbclient/teststat.c60
1 files changed, 1 insertions, 59 deletions
diff --git a/examples/libsmbclient/teststat.c b/examples/libsmbclient/teststat.c
index 46eeb13985..bea34cfc09 100644
--- a/examples/libsmbclient/teststat.c
+++ b/examples/libsmbclient/teststat.c
@@ -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[])