diff options
author | Alexander Bokovoy <ab@samba.org> | 2008-01-16 23:24:44 +0300 |
---|---|---|
committer | Alexander Bokovoy <ab@samba.org> | 2008-01-16 23:24:44 +0300 |
commit | fd03ea4a903b79a0a7894315b3b43fb08108f938 (patch) | |
tree | 0dbce899aca9e727977b2a0becbcc78c6c2de6a4 /examples/libsmbclient/get_auth_data_fn.h | |
parent | e2ffd5110173c6c7d9c15853646988e536331ed0 (diff) | |
parent | 60c3ec3fca08b7d36df760cd6093adb5a807afa0 (diff) | |
download | samba-fd03ea4a903b79a0a7894315b3b43fb08108f938.tar.gz samba-fd03ea4a903b79a0a7894315b3b43fb08108f938.tar.bz2 samba-fd03ea4a903b79a0a7894315b3b43fb08108f938.zip |
Merge branch 'v3-2-test' of ssh://git.samba.org/data/git/samba into v3-2-test
(This used to be commit b01f34141509c90b12003786957790866c286cba)
Diffstat (limited to 'examples/libsmbclient/get_auth_data_fn.h')
-rw-r--r-- | examples/libsmbclient/get_auth_data_fn.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/examples/libsmbclient/get_auth_data_fn.h b/examples/libsmbclient/get_auth_data_fn.h index eb493885af..b1d36c8bea 100644 --- a/examples/libsmbclient/get_auth_data_fn.h +++ b/examples/libsmbclient/get_auth_data_fn.h @@ -8,7 +8,23 @@ get_auth_data_fn(const char * pServer, char * pPassword, int maxLenPassword) { - char temp[128]; + char temp[128]; + char server[256] = { '\0' }; + char share[256] = { '\0' }; + char workgroup[256] = { '\0' }; + char username[256] = { '\0' }; + char password[256] = { '\0' }; + + if (strcmp(server, pServer) == 0 && + strcmp(share, pShare) == 0 && + *workgroup != '\0' && + *username != '\0') + { + strncpy(pWorkgroup, workgroup, maxLenWorkgroup - 1); + strncpy(pUsername, username, maxLenUsername - 1); + strncpy(pPassword, password, maxLenPassword - 1); + return; + } fprintf(stdout, "Workgroup: [%s] ", pWorkgroup); fgets(temp, sizeof(temp), stdin); @@ -48,4 +64,8 @@ get_auth_data_fn(const char * pServer, { strncpy(pPassword, temp, maxLenPassword - 1); } + + strncpy(workgroup, pWorkgroup, sizeof(workgroup) - 1); + strncpy(username, pUsername, sizeof(username) - 1); + strncpy(password, pPassword, sizeof(password) - 1); } |