Hi, I've tried to create a small program with the new netapi that can be used during the (kickstart-based) installation of Fedora Linux to join the computer to the Active Directory in our environment. This small program works fine when run from an terminal, but fails to run when launched during the kickstart installation or during the startup of the system. After investigation I've found this code in source/lib/netapi/netapi.c : ctx->username = talloc_strdup(frame, getenv("USER")); if (!ctx->username) { TALLOC_FREE(frame); fprintf(stderr, "out of memory\n"); return W_ERROR_V(WERR_NOMEM); } So when there is no user logged in, the libnetapi_init always fails with an cryptic 'out of memory' error. Attached patch fixes this behaviour and also makes the 'out of memory' error somewhat more clear
Created attachment 3347 [details] Proposed patch
Fixed in git, thanks for the report!