git.samba.org
/
tridge
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
174a6f1
)
netapi: Fix Bug #5545 (libnetapi_init without $USER)
author
Günther Deschner
<gd@samba.org>
Tue, 17 Jun 2008 08:31:44 +0000
(10:31 +0200)
committer
Karolin Seeger
<kseeger@samba.org>
Tue, 17 Jun 2008 08:53:58 +0000
(10:53 +0200)
Based on patch from Erik van Pienbroek.
Guenther
(cherry picked from commit
71f4cf773022525ba617f09c495dbff97f8eb2d5
)
(cherry picked from commit
7602a4dbfb1b2ae9963f017be62c999af0c2e043
)
source/lib/netapi/netapi.c
patch
|
blob
|
history
diff --git
a/source/lib/netapi/netapi.c
b/source/lib/netapi/netapi.c
index 944c2c9304afee6fa93f928ce50d720c3cb355ac..cf1be00849865c21daecf53ae79e7e6c3ec4ac2e 100644
(file)
--- a/
source/lib/netapi/netapi.c
+++ b/
source/lib/netapi/netapi.c
@@
-85,10
+85,14
@@
NET_API_STATUS libnetapi_init(struct libnetapi_ctx **context)
setenv(KRB5_ENV_CCNAME, ctx->krb5_cc_env, 1);
}
- ctx->username = talloc_strdup(frame, getenv("USER"));
+ if (getenv("USER")) {
+ ctx->username = talloc_strdup(frame, getenv("USER"));
+ } else {
+ ctx->username = talloc_strdup(frame, "");
+ }
if (!ctx->username) {
TALLOC_FREE(frame);
- fprintf(stderr, "out of memory\n");
+ fprintf(stderr, "
libnetapi_init:
out of memory\n");
return W_ERROR_V(WERR_NOMEM);
}