diff options
author | Derrell Lipman <derrell@samba.org> | 2005-05-31 23:42:29 +0000 |
---|---|---|
committer | Derrell Lipman <derrell@samba.org> | 2005-05-31 23:42:29 +0000 |
commit | 6625e0ee76e21cfe455b67b78f6f8d4beafae1ea (patch) | |
tree | 240cfc8c167f5c21a37772c53861437770baf9ef /examples/libsmbclient | |
parent | 7d802dbec54a1432674e70c7a800c7b4db42a3b9 (diff) | |
download | samba-6625e0ee76e21cfe455b67b78f6f8d4beafae1ea.tar.gz samba-6625e0ee76e21cfe455b67b78f6f8d4beafae1ea.tar.xz samba-6625e0ee76e21cfe455b67b78f6f8d4beafae1ea.zip |
r7156: file was missing; svn isn't smart enough to even notify me. sigh.
Diffstat (limited to 'examples/libsmbclient')
-rw-r--r-- | examples/libsmbclient/get_auth_data_fn.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/examples/libsmbclient/get_auth_data_fn.h b/examples/libsmbclient/get_auth_data_fn.h new file mode 100644 index 00000000000..2954039f0aa --- /dev/null +++ b/examples/libsmbclient/get_auth_data_fn.h @@ -0,0 +1,52 @@ +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]; + + fprintf(stdout, "Workgroup: [%s] ", pWorkgroup); + 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); + } + + 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); + } + + fprintf(stdout, "Password: "); + fgets(temp, sizeof(temp), stdin); + + if (temp[strlen(temp) - 1] == '\n') /* A new line? */ + { + temp[strlen(temp) - 1] = '\0'; + } + + if (temp[0] != '\0') + { + strncpy(pPassword, temp, maxLenPassword - 1); + } +} |