]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
examples: Use explicit SMBCCTX
authorVolker Lendecke <vl@samba.org>
Wed, 23 Aug 2023 14:46:56 +0000 (16:46 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 25 Sep 2023 19:01:34 +0000 (19:01 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
examples/libsmbclient/teststat.c

index 593609bd9cffd5345becb9e39a420d5277ba660b..714bffebb2d3f974e246af4f697f8bb55c9d2c6f 100644 (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;
+       }
+
+       smbc_setOptionDebugToStderr(ctx, 1);
+       smbc_setDebug(ctx, debug);
+       smbc_init_context(ctx);
+       smbc_setFunctionAuthData(ctx, get_auth_data_fn);
 
-       ret = smbc_stat(pSmbPath, &st);
+       ret = smbc_getFunctionStat(ctx)(ctx, pSmbPath, &st);
        if (ret < 0) {
                perror("smbc_stat");
                return 1;