svn commit: samba r14087 - in branches/SAMBA_3_0/source/utils: .
jra at samba.org
jra at samba.org
Thu Mar 9 18:35:59 GMT 2006
Author: jra
Date: 2006-03-09 18:35:57 +0000 (Thu, 09 Mar 2006)
New Revision: 14087
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=14087
Log:
Protect against domain being NULL. Finish Coverity #152.
Jeremy.
Modified:
branches/SAMBA_3_0/source/utils/net_rpc_join.c
Changeset:
Modified: branches/SAMBA_3_0/source/utils/net_rpc_join.c
===================================================================
--- branches/SAMBA_3_0/source/utils/net_rpc_join.c 2006-03-09 18:35:37 UTC (rev 14086)
+++ branches/SAMBA_3_0/source/utils/net_rpc_join.c 2006-03-09 18:35:57 UTC (rev 14087)
@@ -196,6 +196,12 @@
rpccli_lsa_close(pipe_hnd, mem_ctx, &lsa_pol);
cli_rpc_pipe_close(pipe_hnd); /* Done with this pipe */
+ /* Bail out if domain didn't get set. */
+ if (!domain) {
+ DEBUG(0, ("Could not get domain name.\n"));
+ goto done;
+ }
+
/* Create domain user */
pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_SAMR, &result);
if (!pipe_hnd) {
@@ -402,10 +408,12 @@
/* Display success or failure */
- if (retval != 0) {
- fprintf(stderr,"Unable to join domain %s.\n",domain);
- } else {
- printf("Joined domain %s.\n",domain);
+ if (domain) {
+ if (retval != 0) {
+ fprintf(stderr,"Unable to join domain %s.\n",domain);
+ } else {
+ printf("Joined domain %s.\n",domain);
+ }
}
cli_shutdown(cli);
More information about the samba-cvs
mailing list