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.