1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

examples: Use explicit SMBCCTX

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2023-08-23 16:46:56 +02:00 committed by Jeremy Allison
parent 3b8cfda1c9
commit 94433d1d01

View File

@ -8,6 +8,7 @@
int main(int argc, char * argv[])
{
SMBCCTX *ctx = NULL;
int debug = 0;
char m_time[32];
char c_time[32];
@ -35,9 +36,18 @@ int main(int argc, char * argv[])
return 1;
}
smbc_init(get_auth_data_fn, debug);
ctx = smbc_new_context();
if (ctx == NULL) {
perror("smbc_new_context failed");
return 1;
}
ret = smbc_stat(pSmbPath, &st);
smbc_setOptionDebugToStderr(ctx, 1);
smbc_setDebug(ctx, debug);
smbc_init_context(ctx);
smbc_setFunctionAuthData(ctx, get_auth_data_fn);
ret = smbc_getFunctionStat(ctx)(ctx, pSmbPath, &st);
if (ret < 0) {
perror("smbc_stat");
return 1;