[SCM] Samba Shared Repository - branch v3-3-test updated - release-3-2-0pre2-2865-g71f4cf7

Günther Deschner gd at samba.org
Tue Jun 17 08:49:56 GMT 2008


The branch, v3-3-test has been updated
       via  71f4cf773022525ba617f09c495dbff97f8eb2d5 (commit)
      from  7d8d60bcbae79f3cdd55b27217145ffbd19f161d (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test


- Log -----------------------------------------------------------------
commit 71f4cf773022525ba617f09c495dbff97f8eb2d5
Author: Günther Deschner <gd at samba.org>
Date:   Tue Jun 17 10:31:44 2008 +0200

    netapi: Fix Bug #5545 (libnetapi_init without $USER)
    
    Based on patch from Erik van Pienbroek.
    
    Guenther

-----------------------------------------------------------------------

Summary of changes:
 source/lib/netapi/netapi.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/lib/netapi/netapi.c b/source/lib/netapi/netapi.c
index 944c2c9..cf1be00 100644
--- 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);
 	}
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list