1. create new context with smbc_new_context() 2. set auth callback with smbc_setFunctionAuthDataWithContext() 3. call smbc_init_context() on the context 4. NULL is returned and errno is set to EINVAL. This is due to the following test in libsmb_context.c: if (!smbc_getFunctionAuthData(context) || smbc_getDebug(context) < 0 || smbc_getDebug(context) > 100) { errno = EINVAL; return NULL; } smbc_getFunctionAuthData() always returns NULL when callback with context is set via smbc_setFunctionAuthDataWithContext(). Modifying the test however causes crash in further code - please check as well.
Fixed with commit 38eab68dfb2d8abe8ad00f5a86fc54c778d0d303. Thanks for the report! Derrell