r13058: Add %w macro for the winbind seperator which allows us for example
[Samba/gebeck_regimport.git] / examples / libsmbclient / get_auth_data_fn.h
blob2954039f0aac3ad963bcf35279c495874882b375
1 static void
2 get_auth_data_fn(const char * pServer,
3 const char * pShare,
4 char * pWorkgroup,
5 int maxLenWorkgroup,
6 char * pUsername,
7 int maxLenUsername,
8 char * pPassword,
9 int maxLenPassword)
12 char temp[128];
14 fprintf(stdout, "Workgroup: [%s] ", pWorkgroup);
15 fgets(temp, sizeof(temp), stdin);
17 if (temp[strlen(temp) - 1] == '\n') /* A new line? */
19 temp[strlen(temp) - 1] = '\0';
22 if (temp[0] != '\0')
24 strncpy(pWorkgroup, temp, maxLenWorkgroup - 1);
27 fprintf(stdout, "Username: [%s] ", pUsername);
28 fgets(temp, sizeof(temp), stdin);
30 if (temp[strlen(temp) - 1] == '\n') /* A new line? */
32 temp[strlen(temp) - 1] = '\0';
35 if (temp[0] != '\0')
37 strncpy(pUsername, temp, maxLenUsername - 1);
40 fprintf(stdout, "Password: ");
41 fgets(temp, sizeof(temp), stdin);
43 if (temp[strlen(temp) - 1] == '\n') /* A new line? */
45 temp[strlen(temp) - 1] = '\0';
48 if (temp[0] != '\0')
50 strncpy(pPassword, temp, maxLenPassword - 1);