svn commit: samba r13615 - in branches/SAMBA_4_0/source: dsdb/samdb/ldb_modules lib/ldb/common lib/ldb/include lib/ldb/ldb_ildap lib/ldb/ldb_ldap lib/ldb/ldb_sqlite3 lib/ldb/ldb_tdb lib/ldb/modules nb
Author: idra Date: 2006-02-22 05:21:43 + (Wed, 22 Feb 2006) New Revision: 13615 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13615 Log: Make ldb_set_errstring get ldb instead of module as parameter. The module was just used to get to the ldb so it was meningless. Also add LDB_WAIT_ONCE e relative code in ldb_ildap.c Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/kludge_acl.c branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/password_hash.c branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/proxy.c branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samldb.c branches/SAMBA_4_0/source/lib/ldb/common/ldb.c branches/SAMBA_4_0/source/lib/ldb/common/ldb_debug.c branches/SAMBA_4_0/source/lib/ldb/include/ldb.h branches/SAMBA_4_0/source/lib/ldb/include/ldb_private.h branches/SAMBA_4_0/source/lib/ldb/ldb_ildap/ldb_ildap.c branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c branches/SAMBA_4_0/source/lib/ldb/ldb_sqlite3/ldb_sqlite3.c branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c branches/SAMBA_4_0/source/lib/ldb/modules/ldb_map.c branches/SAMBA_4_0/source/lib/ldb/modules/objectclass.c branches/SAMBA_4_0/source/nbt_server/wins/wins_ldb.c Changeset: Sorry, the patch is too large (631 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13615
svn commit: samba r13614 - in branches/SAMBA_3_0/source: libsmb utils
Author: jra Date: 2006-02-22 04:56:53 + (Wed, 22 Feb 2006) New Revision: 13614 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13614 Log: First part of the bugfix for #3510 - net join fails against server with schannel disabled. Second part will come tomorrow (fixing net_rpc_join_ok()). Jeremy. Modified: branches/SAMBA_3_0/source/libsmb/clientgen.c branches/SAMBA_3_0/source/utils/net_rpc_join.c Changeset: Modified: branches/SAMBA_3_0/source/libsmb/clientgen.c === --- branches/SAMBA_3_0/source/libsmb/clientgen.c2006-02-22 04:56:50 UTC (rev 13613) +++ branches/SAMBA_3_0/source/libsmb/clientgen.c2006-02-22 04:56:53 UTC (rev 13614) @@ -358,8 +358,14 @@ BOOL cli_rpc_pipe_close(struct rpc_pipe_client *cli) { - BOOL ret = cli_close(cli->cli, cli->fnum); + BOOL ret; + if (!cli) { + return False; + } + + ret = cli_close(cli->cli, cli->fnum); + if (!ret) { DEBUG(0,("cli_rpc_pipe_close: cli_close failed on pipe %s, " "fnum 0x%x " Modified: branches/SAMBA_3_0/source/utils/net_rpc_join.c === --- branches/SAMBA_3_0/source/utils/net_rpc_join.c 2006-02-22 04:56:50 UTC (rev 13613) +++ branches/SAMBA_3_0/source/utils/net_rpc_join.c 2006-02-22 04:56:53 UTC (rev 13614) @@ -88,10 +88,9 @@ struct cli_state *cli; TALLOC_CTX *mem_ctx; uint32 acb_info = ACB_WSTRUST; - uint32 neg_flags = NETLOGON_NEG_AUTH2_FLAGS|NETLOGON_NEG_SCHANNEL; + uint32 neg_flags = NETLOGON_NEG_AUTH2_FLAGS|(lp_client_schannel() ? NETLOGON_NEG_SCHANNEL : 0); uint32 sec_channel_type; struct rpc_pipe_client *pipe_hnd = NULL; - struct rpc_pipe_client *netlogon_schannel_pipe = NULL; /* rpc variables */ @@ -325,29 +324,37 @@ goto done; } - netlogon_schannel_pipe = cli_rpc_pipe_open_schannel_with_key(cli, + /* We can only check the schannel connection if the client is allowed + to do this and the server supports it. If not, just assume success + (after all the rpccli_netlogon_setup_creds() succeeded, and we'll + do the same again (setup creds) in net_rpc_join_ok(). JRA. */ + + if (lp_client_schannel() && (neg_flags & NETLOGON_NEG_SCHANNEL)) { + struct rpc_pipe_client *netlogon_schannel_pipe = + cli_rpc_pipe_open_schannel_with_key(cli, PI_NETLOGON, PIPE_AUTH_LEVEL_PRIVACY, domain, pipe_hnd->dc, &result); - if (!NT_STATUS_IS_OK(result)) { - DEBUG(0, ("Error in domain join verification (schannel setup failed): %s\n\n", - nt_errstr(result))); + if (!NT_STATUS_IS_OK(result)) { + DEBUG(0, ("Error in domain join verification (schannel setup failed): %s\n\n", + nt_errstr(result))); - if ( NT_STATUS_EQUAL(result, NT_STATUS_ACCESS_DENIED) && -(sec_channel_type == SEC_CHAN_BDC) ) { - d_fprintf(stderr, "Please make sure that no computer account\n" -"named like this machine (%s) exists in the domain\n", -global_myname()); + if ( NT_STATUS_EQUAL(result, NT_STATUS_ACCESS_DENIED) && +(sec_channel_type == SEC_CHAN_BDC) ) { + d_fprintf(stderr, "Please make sure that no computer account\n" +"named like this machine (%s) exists in the domain\n", +global_myname()); + } + + goto done; } - - goto done; + cli_rpc_pipe_close(netlogon_schannel_pipe); } cli_rpc_pipe_close(pipe_hnd); - cli_rpc_pipe_close(netlogon_schannel_pipe); /* Now store the secret in the secrets database */
svn commit: samba r13613 - in trunk/source: libsmb utils
Author: jra Date: 2006-02-22 04:56:50 + (Wed, 22 Feb 2006) New Revision: 13613 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13613 Log: First part of the bugfix for #3510 - net join fails against server with schannel disabled. Second part will come tomorrow (fixing net_rpc_join_ok()). Jeremy. Modified: trunk/source/libsmb/clientgen.c trunk/source/utils/net_rpc_join.c Changeset: Modified: trunk/source/libsmb/clientgen.c === --- trunk/source/libsmb/clientgen.c 2006-02-22 03:12:00 UTC (rev 13612) +++ trunk/source/libsmb/clientgen.c 2006-02-22 04:56:50 UTC (rev 13613) @@ -358,8 +358,14 @@ BOOL cli_rpc_pipe_close(struct rpc_pipe_client *cli) { - BOOL ret = cli_close(cli->cli, cli->fnum); + BOOL ret; + if (!cli) { + return False; + } + + ret = cli_close(cli->cli, cli->fnum); + if (!ret) { DEBUG(0,("cli_rpc_pipe_close: cli_close failed on pipe %s, " "fnum 0x%x " Modified: trunk/source/utils/net_rpc_join.c === --- trunk/source/utils/net_rpc_join.c 2006-02-22 03:12:00 UTC (rev 13612) +++ trunk/source/utils/net_rpc_join.c 2006-02-22 04:56:50 UTC (rev 13613) @@ -88,10 +88,9 @@ struct cli_state *cli; TALLOC_CTX *mem_ctx; uint32 acb_info = ACB_WSTRUST; - uint32 neg_flags = NETLOGON_NEG_AUTH2_FLAGS|NETLOGON_NEG_SCHANNEL; + uint32 neg_flags = NETLOGON_NEG_AUTH2_FLAGS|(lp_client_schannel() ? NETLOGON_NEG_SCHANNEL : 0); uint32 sec_channel_type; struct rpc_pipe_client *pipe_hnd = NULL; - struct rpc_pipe_client *netlogon_schannel_pipe = NULL; /* rpc variables */ @@ -325,29 +324,37 @@ goto done; } - netlogon_schannel_pipe = cli_rpc_pipe_open_schannel_with_key(cli, + /* We can only check the schannel connection if the client is allowed + to do this and the server supports it. If not, just assume success + (after all the rpccli_netlogon_setup_creds() succeeded, and we'll + do the same again (setup creds) in net_rpc_join_ok(). JRA. */ + + if (lp_client_schannel() && (neg_flags & NETLOGON_NEG_SCHANNEL)) { + struct rpc_pipe_client *netlogon_schannel_pipe = + cli_rpc_pipe_open_schannel_with_key(cli, PI_NETLOGON, PIPE_AUTH_LEVEL_PRIVACY, domain, pipe_hnd->dc, &result); - if (!NT_STATUS_IS_OK(result)) { - DEBUG(0, ("Error in domain join verification (schannel setup failed): %s\n\n", - nt_errstr(result))); + if (!NT_STATUS_IS_OK(result)) { + DEBUG(0, ("Error in domain join verification (schannel setup failed): %s\n\n", + nt_errstr(result))); - if ( NT_STATUS_EQUAL(result, NT_STATUS_ACCESS_DENIED) && -(sec_channel_type == SEC_CHAN_BDC) ) { - d_fprintf(stderr, "Please make sure that no computer account\n" -"named like this machine (%s) exists in the domain\n", -global_myname()); + if ( NT_STATUS_EQUAL(result, NT_STATUS_ACCESS_DENIED) && +(sec_channel_type == SEC_CHAN_BDC) ) { + d_fprintf(stderr, "Please make sure that no computer account\n" +"named like this machine (%s) exists in the domain\n", +global_myname()); + } + + goto done; } - - goto done; + cli_rpc_pipe_close(netlogon_schannel_pipe); } cli_rpc_pipe_close(pipe_hnd); - cli_rpc_pipe_close(netlogon_schannel_pipe); /* Now store the secret in the secrets database */
svn commit: samba r13612 - branches/SAMBA_3_0/source/client trunk/source/client
Author: tpot Date: 2006-02-22 03:12:00 + (Wed, 22 Feb 2006) New Revision: 13612 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13612 Log: #define NO_SYSLOG is dead as a doornail. Modified: branches/SAMBA_3_0/source/client/smbctool.c trunk/source/client/smbctool.c Changeset: Modified: branches/SAMBA_3_0/source/client/smbctool.c === --- branches/SAMBA_3_0/source/client/smbctool.c 2006-02-22 01:31:49 UTC (rev 13611) +++ branches/SAMBA_3_0/source/client/smbctool.c 2006-02-22 03:12:00 UTC (rev 13612) @@ -22,8 +22,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define NO_SYSLOG - #include "includes.h" #include "libsmbclient.h" #include "client/client_proto.h" Modified: trunk/source/client/smbctool.c === --- trunk/source/client/smbctool.c 2006-02-22 01:31:49 UTC (rev 13611) +++ trunk/source/client/smbctool.c 2006-02-22 03:12:00 UTC (rev 13612) @@ -22,8 +22,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define NO_SYSLOG - #include "includes.h" #include "libsmbclient.h" #include "client/client_proto.h"
svn commit: samba r13611 - in trunk/source/param: .
Author: jra Date: 2006-02-22 01:31:49 + (Wed, 22 Feb 2006) New Revision: 13611 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13611 Log: Patch from Bjoern JACKE <[EMAIL PROTECTED]>. Don't default to /tmp if there is no path in the share, make it unavailable. All printer shares should have a path and IPC$ is already explicitly set to tmpdir(). Jeremy. Modified: trunk/source/param/loadparm.c Changeset: Modified: trunk/source/param/loadparm.c === --- trunk/source/param/loadparm.c 2006-02-22 01:31:43 UTC (rev 13610) +++ trunk/source/param/loadparm.c 2006-02-22 01:31:49 UTC (rev 13611) @@ -2929,10 +2929,12 @@ } if (ServicePtrs[iService]->szPath[0] == '\0' && - strwicmp(ServicePtrs[iService]->szService, HOMES_NAME) != 0) { - DEBUG(0, ("No path in service %s - using %s\n", - ServicePtrs[iService]->szService, tmpdir())); - string_set(&ServicePtrs[iService]->szPath, tmpdir()); + strwicmp(ServicePtrs[iService]->szService, HOMES_NAME) != 0 && + ServicePtrs[iService]->szMSDfsProxy[0] == '\0' + ) { + DEBUG(0, ("WARNING: No path in service %s - making it unavailable!\n", + ServicePtrs[iService]->szService)); + ServicePtrs[iService]->bAvailable = False; } /* If a service is flagged unavailable, log the fact at level 0. */
svn commit: samba r13610 - in branches/SAMBA_3_0/source/param: .
Author: jra Date: 2006-02-22 01:31:43 + (Wed, 22 Feb 2006) New Revision: 13610 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13610 Log: Patch from Bjoern JACKE <[EMAIL PROTECTED]>. Don't default to /tmp if there is no path in the share, make it unavailable. All printer shares should have a path and IPC$ is already explicitly set to tmpdir(). Jeremy. Modified: branches/SAMBA_3_0/source/param/loadparm.c Changeset: Modified: branches/SAMBA_3_0/source/param/loadparm.c === --- branches/SAMBA_3_0/source/param/loadparm.c 2006-02-22 01:31:35 UTC (rev 13609) +++ branches/SAMBA_3_0/source/param/loadparm.c 2006-02-22 01:31:43 UTC (rev 13610) @@ -2929,10 +2929,12 @@ } if (ServicePtrs[iService]->szPath[0] == '\0' && - strwicmp(ServicePtrs[iService]->szService, HOMES_NAME) != 0) { - DEBUG(0, ("No path in service %s - using %s\n", - ServicePtrs[iService]->szService, tmpdir())); - string_set(&ServicePtrs[iService]->szPath, tmpdir()); + strwicmp(ServicePtrs[iService]->szService, HOMES_NAME) != 0 && + ServicePtrs[iService]->szMSDfsProxy[0] == '\0' + ) { + DEBUG(0, ("WARNING: No path in service %s - making it unavailable!\n", + ServicePtrs[iService]->szService)); + ServicePtrs[iService]->bAvailable = False; } /* If a service is flagged unavailable, log the fact at level 0. */
svn commit: samba r13609 - in branches/SAMBA_4_0/source: ldap_server lib/ldb/common lib/ldb/include lib/ldb/ldb_ildap lib/ldb/ldb_sqlite3 lib/ldb/ldb_tdb lib/ldb/tools libcli/ldap
Author: idra Date: 2006-02-22 01:31:35 + (Wed, 22 Feb 2006) New Revision: 13609 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13609 Log: Get in the initial work on making ldb async Currently only ldb_ildap is async, the plan is to first make all backend support the async calls, and then remove the sync functions from backends and keep the only in the API. Modules will need to be transformed along the way. Simo Modified: branches/SAMBA_4_0/source/ldap_server/ldap_backend.c branches/SAMBA_4_0/source/lib/ldb/common/ldb.c branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c branches/SAMBA_4_0/source/lib/ldb/include/ldb.h branches/SAMBA_4_0/source/lib/ldb/include/ldb_private.h branches/SAMBA_4_0/source/lib/ldb/ldb_ildap/ldb_ildap.c branches/SAMBA_4_0/source/lib/ldb/ldb_sqlite3/ldb_sqlite3.c branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_index.c branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_search.c branches/SAMBA_4_0/source/lib/ldb/tools/cmdline.c branches/SAMBA_4_0/source/lib/ldb/tools/ldbsearch.c branches/SAMBA_4_0/source/libcli/ldap/ldap.c branches/SAMBA_4_0/source/libcli/ldap/ldap.h branches/SAMBA_4_0/source/libcli/ldap/ldap_client.c branches/SAMBA_4_0/source/libcli/ldap/ldap_client.h branches/SAMBA_4_0/source/libcli/ldap/ldap_controls.c branches/SAMBA_4_0/source/libcli/ldap/ldap_ildap.c Changeset: Sorry, the patch is too large (1807 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13609
svn commit: samba r13608 - in trunk/source/utils: .
Author: jra Date: 2006-02-22 00:34:36 + (Wed, 22 Feb 2006) New Revision: 13608 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13608 Log: Fix compile - don't ref auto variable in a structure initialization. Fix from Richard Bollinger <[EMAIL PROTECTED]>. Jeremy. Modified: trunk/source/utils/pdbedit.c Changeset: Modified: trunk/source/utils/pdbedit.c === --- trunk/source/utils/pdbedit.c2006-02-22 00:34:35 UTC (rev 13607) +++ trunk/source/utils/pdbedit.c2006-02-22 00:34:36 UTC (rev 13608) @@ -655,7 +655,7 @@ static char *pwd_can_change_time = NULL; static char *pwd_must_change_time = NULL; static char *pwd_time_format = NULL; - BOOL pw_from_stdin = False; + static BOOL pw_from_stdin = False; struct pdb_methods *bdef = NULL; poptContext pc;
svn commit: samba r13607 - in branches/SAMBA_3_0/source/utils: .
Author: jra Date: 2006-02-22 00:34:35 + (Wed, 22 Feb 2006) New Revision: 13607 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13607 Log: Fix compile - don't ref auto variable in a structure initialization. Fix from Richard Bollinger <[EMAIL PROTECTED]>. Jeremy. Modified: branches/SAMBA_3_0/source/utils/pdbedit.c Changeset: Modified: branches/SAMBA_3_0/source/utils/pdbedit.c === --- branches/SAMBA_3_0/source/utils/pdbedit.c 2006-02-22 00:26:56 UTC (rev 13606) +++ branches/SAMBA_3_0/source/utils/pdbedit.c 2006-02-22 00:34:35 UTC (rev 13607) @@ -655,7 +655,7 @@ static char *pwd_can_change_time = NULL; static char *pwd_must_change_time = NULL; static char *pwd_time_format = NULL; - BOOL pw_from_stdin = False; + static BOOL pw_from_stdin = False; struct pdb_methods *bdef = NULL; poptContext pc;
svn commit: samba r13606 - in branches/SAMBA_4_0/source: dsdb/samdb/ldb_modules ldap_server
Author: abartlet Date: 2006-02-22 00:26:56 + (Wed, 22 Feb 2006) New Revision: 13606 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13606 Log: An attempt to fix #3525. The problem was that the supportedControls were being stolen into the result sent to the client, then talloc_free()ed. This caused them to be invalid on the next rootDSE query. This also tries to avoid attaching the result to the long-term samdb context, and avoids an extra loop in the result processing (pointed out by tridge). Andrew BARtlett Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/rootdse.c branches/SAMBA_4_0/source/ldap_server/ldap_backend.c Changeset: Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/rootdse.c === --- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/rootdse.c 2006-02-22 00:18:07 UTC (rev 13605) +++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/rootdse.c 2006-02-22 00:26:56 UTC (rev 13606) @@ -73,8 +73,12 @@ if (do_attribute(s->attrs, "supportedControl")) { int i; for (i = 0; i < priv->num_controls; i++) { + char *control = talloc_strdup(msg, priv->controls[i]); + if (!control) { + goto failed; + } if (ldb_msg_add_string(msg, "supportedControl", - priv->controls[i]) != 0) { + control) != 0) { goto failed; } } Modified: branches/SAMBA_4_0/source/ldap_server/ldap_backend.c === --- branches/SAMBA_4_0/source/ldap_server/ldap_backend.c2006-02-22 00:18:07 UTC (rev 13605) +++ branches/SAMBA_4_0/source/ldap_server/ldap_backend.c2006-02-22 00:26:56 UTC (rev 13606) @@ -153,7 +153,7 @@ struct ldap_Result *done; struct ldapsrv_reply *ent_r, *done_r; void *local_ctx; - struct ldb_context *samdb = call->conn->ldb; + struct ldb_context *samdb = talloc_get_type(call->conn->ldb, struct ldb_context); struct ldb_dn *basedn; struct ldb_result *res = NULL; struct ldb_request lreq; @@ -163,13 +163,13 @@ int success_limit = 1; int result = LDAP_SUCCESS; int ldb_ret; - int i, j, y; + int i, j; DEBUG(10, ("SearchRequest")); DEBUGADD(10, (" basedn: %s", req->basedn)); DEBUGADD(10, (" filter: %s\n", ldb_filter_from_tree(call, req->tree))); - local_ctx = talloc_named(call, 0, "sldb_Search local memory context"); + local_ctx = talloc_new(call); NT_STATUS_HAVE_NO_MEMORY(local_ctx); basedn = ldb_dn_explode(local_ctx, req->basedn); @@ -228,7 +228,8 @@ ldb_ret = ldb_request(samdb, &lreq); - res = talloc_steal(samdb, lreq.op.search.res); + /* Ensure we don't keep the search results around for too long */ + res = talloc_steal(local_ctx, lreq.op.search.res); if (ldb_ret == LDB_SUCCESS) { for (i = 0; i < res->count; i++) { @@ -253,14 +254,8 @@ continue; } ent->attributes[j].num_values = res->msgs[i]->elements[j].num_values; - ent->attributes[j].values = talloc_array(ent->attributes, - DATA_BLOB, ent->attributes[j].num_values); - NT_STATUS_HAVE_NO_MEMORY(ent->attributes[j].values); - for (y=0; y < ent->attributes[j].num_values; y++) { - ent->attributes[j].values[y].length = res->msgs[i]->elements[j].values[y].length; - ent->attributes[j].values[y].data = talloc_steal(ent->attributes[j].values, - res->msgs[i]->elements[j].values[y].data); - } + ent->attributes[j].values = res->msgs[i]->elements[j].values; + talloc_steal(ent->attributes, res->msgs[i]->elements[j].values); } queue_reply: ldapsrv_queue_reply(call, ent_r); @@ -287,6 +282,7 @@ } if (res->controls) { done_r->msg->controls = (struct ldap_Control **)(res->controls); + talloc_steal(done_r, res->controls); } } else { DEBUG(10,("SearchRequest: error\n"));
svn commit: samba r13605 - in branches/SAMBA_4_0/source/script/tests: .
Author: abartlet Date: 2006-02-22 00:18:07 + (Wed, 22 Feb 2006) New Revision: 13605 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13605 Log: Use $BASEDN to ensure this works outside of the 'make test' rig. Andrew Bartlett Modified: branches/SAMBA_4_0/source/script/tests/test_ldap.sh Changeset: Modified: branches/SAMBA_4_0/source/script/tests/test_ldap.sh === --- branches/SAMBA_4_0/source/script/tests/test_ldap.sh 2006-02-21 23:21:28 UTC (rev 13604) +++ branches/SAMBA_4_0/source/script/tests/test_ldap.sh 2006-02-22 00:18:07 UTC (rev 13605) @@ -73,7 +73,7 @@ fi echo "Test Attribute Scope Query Control" -nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=asq:1:member -s base -b 'CN=Administrators,CN=Builtin,DC=samba,DC=example,DC=com' | grep sAMAccountName | wc -l` +nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=asq:1:member -s base -b "CN=Administrators,CN=Builtin,$BASEDN" | grep sAMAccountName | wc -l` if [ $nentries -lt 1 ]; then echo "Attribute Scope Query test returned 0 items" failed=`expr $failed + 1`
Build status as of Wed Feb 22 00:00:02 2006
URL: http://build.samba.org/ --- /home/build/master/cache/broken_results.txt.old 2006-02-21 00:00:09.0 + +++ /home/build/master/cache/broken_results.txt 2006-02-22 00:00:03.0 + @@ -1,17 +1,17 @@ -Build status as of Tue Feb 21 00:00:05 2006 +Build status as of Wed Feb 22 00:00:02 2006 Build counts: Tree Total Broken Panic -ccache 6 2 0 +ccache 7 2 0 distcc 8 2 0 -lorikeet-heimdal 14 14 0 -ppp 14 0 0 -rsync28 2 0 +lorikeet-heimdal 17 17 0 +ppp 15 0 0 +rsync29 2 0 samba2 0 0 samba-docs 0 0 0 -samba4 30 19 2 -samba_3_029 8 0 -smb-build20 3 0 -talloc 6 4 0 -tdb 4 1 0 +samba4 31 20 2 +samba_3_030 4 0 +smb-build21 3 0 +talloc 6 3 0 +tdb 5 1 0
svn commit: samba r13604 - in branches/SAMBA_3_0/source/smbd: .
Author: jra Date: 2006-02-21 23:21:28 + (Tue, 21 Feb 2006) New Revision: 13604 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13604 Log: Fix for bug #3512 "use spnego=no" and "server signing=auto" cause client to disconnect after negprot" We missed one case of ignoring "BSRSPYL ". Merge for 3.0.21c. Jeremy. Modified: branches/SAMBA_3_0/source/smbd/sesssetup.c Changeset: Modified: branches/SAMBA_3_0/source/smbd/sesssetup.c === --- branches/SAMBA_3_0/source/smbd/sesssetup.c 2006-02-21 23:21:26 UTC (rev 13603) +++ branches/SAMBA_3_0/source/smbd/sesssetup.c 2006-02-21 23:21:28 UTC (rev 13604) @@ -70,6 +70,23 @@ } / + Start the signing engine if needed. Don't fail signing here. +/ + +static void sessionsetup_start_signing_engine(const auth_serversupplied_info *server_info, char *inbuf) +{ + if (!server_info->guest && !srv_signing_started()) { + /* We need to start the signing engine +* here but a W2K client sends the old +* "BSRSPYL " signature instead of the +* correct one. Subsequent packets will +* be correct. +*/ + srv_check_sign_mac(inbuf, False); + } +} + +/ Send a security blob via a session setup reply. / @@ -355,15 +372,7 @@ SSVAL(outbuf, smb_uid, sess_vuid); - if (!server_info->guest && !srv_signing_started()) { - /* We need to start the signing engine -* here but a W2K client sends the old -* "BSRSPYL " signature instead of the -* correct one. Subsequent packets will -* be correct. -*/ - srv_check_sign_mac(inbuf, False); - } + sessionsetup_start_signing_engine(server_info, inbuf); } /* wrap that up in a nice GSS-API wrapping */ @@ -436,16 +445,7 @@ SSVAL(outbuf,smb_uid,sess_vuid); - if (!server_info->guest && !srv_signing_started()) { - /* We need to start the signing engine -* here but a W2K client sends the old -* "BSRSPYL " signature instead of the -* correct one. Subsequent packets will -* be correct. -*/ - - srv_check_sign_mac(inbuf, False); - } + sessionsetup_start_signing_engine(server_info, inbuf); } } @@ -1107,9 +1107,7 @@ /* current_user_info is changed on new vuid */ reload_services( True ); - if (!server_info->guest && !srv_signing_started() && !srv_check_sign_mac(inbuf, True)) { - exit_server("reply_sesssetup_and_X: bad smb signature"); - } + sessionsetup_start_signing_engine(server_info, inbuf); SSVAL(outbuf,smb_uid,sess_vuid); SSVAL(inbuf,smb_uid,sess_vuid);
svn commit: samba r13603 - in trunk/source/smbd: .
Author: jra Date: 2006-02-21 23:21:26 + (Tue, 21 Feb 2006) New Revision: 13603 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13603 Log: Fix for bug #3512 "use spnego=no" and "server signing=auto" cause client to disconnect after negprot" We missed one case of ignoring "BSRSPYL ". Merge for 3.0.21c. Jeremy. Modified: trunk/source/smbd/sesssetup.c Changeset: Modified: trunk/source/smbd/sesssetup.c === --- trunk/source/smbd/sesssetup.c 2006-02-21 21:03:06 UTC (rev 13602) +++ trunk/source/smbd/sesssetup.c 2006-02-21 23:21:26 UTC (rev 13603) @@ -70,6 +70,23 @@ } / + Start the signing engine if needed. Don't fail signing here. +/ + +static void sessionsetup_start_signing_engine(const auth_serversupplied_info *server_info, char *inbuf) +{ + if (!server_info->guest && !srv_signing_started()) { + /* We need to start the signing engine +* here but a W2K client sends the old +* "BSRSPYL " signature instead of the +* correct one. Subsequent packets will +* be correct. +*/ + srv_check_sign_mac(inbuf, False); + } +} + +/ Send a security blob via a session setup reply. / @@ -355,15 +372,7 @@ SSVAL(outbuf, smb_uid, sess_vuid); - if (!server_info->guest && !srv_signing_started()) { - /* We need to start the signing engine -* here but a W2K client sends the old -* "BSRSPYL " signature instead of the -* correct one. Subsequent packets will -* be correct. -*/ - srv_check_sign_mac(inbuf, False); - } + sessionsetup_start_signing_engine(server_info, inbuf); } /* wrap that up in a nice GSS-API wrapping */ @@ -436,16 +445,7 @@ SSVAL(outbuf,smb_uid,sess_vuid); - if (!server_info->guest && !srv_signing_started()) { - /* We need to start the signing engine -* here but a W2K client sends the old -* "BSRSPYL " signature instead of the -* correct one. Subsequent packets will -* be correct. -*/ - - srv_check_sign_mac(inbuf, False); - } + sessionsetup_start_signing_engine(server_info, inbuf); } } @@ -1107,9 +1107,7 @@ /* current_user_info is changed on new vuid */ reload_services( True ); - if (!server_info->guest && !srv_signing_started() && !srv_check_sign_mac(inbuf, True)) { - exit_server("reply_sesssetup_and_X: bad smb signature"); - } + sessionsetup_start_signing_engine(server_info, inbuf); SSVAL(outbuf,smb_uid,sess_vuid); SSVAL(inbuf,smb_uid,sess_vuid);
svn commit: samba r13602 - in branches/tmp/vl-posixacls/source/smbd: .
Author: vlendec Date: 2006-02-21 21:03:06 + (Tue, 21 Feb 2006) New Revision: 13602 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13602 Log: Weird -- there is no type checking here... Modified: branches/tmp/vl-posixacls/source/smbd/vfs.c Changeset: Modified: branches/tmp/vl-posixacls/source/smbd/vfs.c === --- branches/tmp/vl-posixacls/source/smbd/vfs.c 2006-02-21 19:22:49 UTC (rev 13601) +++ branches/tmp/vl-posixacls/source/smbd/vfs.c 2006-02-21 21:03:06 UTC (rev 13602) @@ -111,10 +111,10 @@ vfswrap_chmod_acl, vfswrap_fchmod_acl, + vfswrap_acl_get_file, vfswrap_acl_get_fd, - vfswrap_acl_get_file, + vfswrap_acl_set_file, vfswrap_acl_set_fd, - vfswrap_acl_set_file, vfswrap_sys_acl_delete_def_file,
svn commit: samba r13601 - branches/SAMBA_3_0/source/include branches/SAMBA_3_0/source/lib branches/SAMBA_3_0/source/passdb trunk/source/include trunk/source/lib trunk/source/passdb
Author: jerry Date: 2006-02-21 19:22:49 + (Tue, 21 Feb 2006) New Revision: 13601 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13601 Log: * Remove unused code from pdb_ldap.c * Add a 'struct passwd *' to the struct samu for later reference (I know this may be controversial but its easily reverted which is is why I'm checking this is as a seaparate patch before I get too deep). * Remove unix_homedir from struct samu {} and update the pdb wrapper functions associated with it. Modified: branches/SAMBA_3_0/source/include/passdb.h branches/SAMBA_3_0/source/lib/util_pw.c branches/SAMBA_3_0/source/passdb/passdb.c branches/SAMBA_3_0/source/passdb/pdb_get_set.c branches/SAMBA_3_0/source/passdb/pdb_ldap.c trunk/source/include/passdb.h trunk/source/lib/util_pw.c trunk/source/passdb/passdb.c trunk/source/passdb/pdb_get_set.c trunk/source/passdb/pdb_ldap.c Changeset: Sorry, the patch is too large (429 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13601
svn commit: samba r13600 - branches/SAMBA_3_0/source/passdb trunk/source/passdb
Author: jerry Date: 2006-02-21 19:02:22 + (Tue, 21 Feb 2006) New Revision: 13600 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13600 Log: Move functions local to tdbsam to pdb_tdb.c Modified: branches/SAMBA_3_0/source/passdb/passdb.c branches/SAMBA_3_0/source/passdb/pdb_tdb.c trunk/source/passdb/passdb.c trunk/source/passdb/pdb_tdb.c Changeset: Sorry, the patch is too large (1677 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13600
svn commit: samba r13599 - branches/SAMBA_3_0/source/libads trunk/source/libads
Author: lmuelle Date: 2006-02-21 17:48:20 + (Tue, 21 Feb 2006) New Revision: 13599 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13599 Log: krb5 error codes are defined as long. Also for the other direction. Modified: branches/SAMBA_3_0/source/libads/krb5_errs.c trunk/source/libads/krb5_errs.c Changeset: Modified: branches/SAMBA_3_0/source/libads/krb5_errs.c === --- branches/SAMBA_3_0/source/libads/krb5_errs.c2006-02-21 17:35:52 UTC (rev 13598) +++ branches/SAMBA_3_0/source/libads/krb5_errs.c2006-02-21 17:48:20 UTC (rev 13599) @@ -58,7 +58,7 @@ static const struct { NTSTATUS ntstatus; - int krb5_code; + long krb5_code; } nt_status_to_krb5_map[] = { {NT_STATUS_LOGON_FAILURE, KRB5KDC_ERR_PREAUTH_FAILED}, {NT_STATUS_NO_LOGON_SERVERS, KRB5_KDC_UNREACH}, Modified: trunk/source/libads/krb5_errs.c === --- trunk/source/libads/krb5_errs.c 2006-02-21 17:35:52 UTC (rev 13598) +++ trunk/source/libads/krb5_errs.c 2006-02-21 17:48:20 UTC (rev 13599) @@ -58,7 +58,7 @@ static const struct { NTSTATUS ntstatus; - int krb5_code; + long krb5_code; } nt_status_to_krb5_map[] = { {NT_STATUS_LOGON_FAILURE, KRB5KDC_ERR_PREAUTH_FAILED}, {NT_STATUS_NO_LOGON_SERVERS, KRB5_KDC_UNREACH},
svn commit: samba r13598 - branches/SAMBA_3_0/source/include trunk/source/include
Author: lmuelle Date: 2006-02-21 17:35:52 + (Tue, 21 Feb 2006) New Revision: 13598 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13598 Log: Defining KRB5KRB_ERR_RESPONSE_TOO_BIG if not defined which is the case for older krb5 implementations. Patch slightly modified from the version provided by Bj?\195?\182rn Jacke at the samba-technical list after discussion on the list and by IRC. Thanks Bj?\195?\182rn! Modified: branches/SAMBA_3_0/source/include/includes.h trunk/source/include/includes.h Changeset: Modified: branches/SAMBA_3_0/source/include/includes.h === --- branches/SAMBA_3_0/source/include/includes.h2006-02-21 17:19:20 UTC (rev 13597) +++ branches/SAMBA_3_0/source/include/includes.h2006-02-21 17:35:52 UTC (rev 13598) @@ -1453,6 +1453,10 @@ #if defined(HAVE_KRB5) +#ifndef KRB5KRB_ERR_RESPONSE_TOO_BIG +#define KRB5KRB_ERR_RESPONSE_TOO_BIG (-1765328332L) +#endif + #ifndef HAVE_KRB5_SET_REAL_TIME krb5_error_code krb5_set_real_time(krb5_context context, int32_t seconds, int32_t microseconds); #endif Modified: trunk/source/include/includes.h === --- trunk/source/include/includes.h 2006-02-21 17:19:20 UTC (rev 13597) +++ trunk/source/include/includes.h 2006-02-21 17:35:52 UTC (rev 13598) @@ -1454,6 +1454,10 @@ #if defined(HAVE_KRB5) +#ifndef KRB5KRB_ERR_RESPONSE_TOO_BIG +#define KRB5KRB_ERR_RESPONSE_TOO_BIG (-1765328332L) +#endif + #ifndef HAVE_KRB5_SET_REAL_TIME krb5_error_code krb5_set_real_time(krb5_context context, int32_t seconds, int32_t microseconds); #endif
svn commit: samba r13597 - branches/SAMBA_3_0/source/libads trunk/source/libads
Author: lmuelle Date: 2006-02-21 17:19:20 + (Tue, 21 Feb 2006) New Revision: 13597 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13597 Log: krb5 error codes are defined as long. Modified: branches/SAMBA_3_0/source/libads/krb5_errs.c trunk/source/libads/krb5_errs.c Changeset: Modified: branches/SAMBA_3_0/source/libads/krb5_errs.c === --- branches/SAMBA_3_0/source/libads/krb5_errs.c2006-02-21 17:17:50 UTC (rev 13596) +++ branches/SAMBA_3_0/source/libads/krb5_errs.c2006-02-21 17:19:20 UTC (rev 13597) @@ -23,7 +23,7 @@ #ifdef HAVE_KRB5 static const struct { - int krb5_code; + long krb5_code; NTSTATUS ntstatus; } krb5_to_nt_status_map[] = { {KRB5_CC_IO, NT_STATUS_UNEXPECTED_IO_ERROR}, Modified: trunk/source/libads/krb5_errs.c === --- trunk/source/libads/krb5_errs.c 2006-02-21 17:17:50 UTC (rev 13596) +++ trunk/source/libads/krb5_errs.c 2006-02-21 17:19:20 UTC (rev 13597) @@ -23,7 +23,7 @@ #ifdef HAVE_KRB5 static const struct { - int krb5_code; + long krb5_code; NTSTATUS ntstatus; } krb5_to_nt_status_map[] = { {KRB5_CC_IO, NT_STATUS_UNEXPECTED_IO_ERROR},
svn commit: samba r13596 - in branches/tmp/vl-posixacls/source/lib: .
Author: vlendec Date: 2006-02-21 17:17:50 + (Tue, 21 Feb 2006) New Revision: 13596 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13596 Log: Comment cleanup Modified: branches/tmp/vl-posixacls/source/lib/sysacls.c Changeset: Modified: branches/tmp/vl-posixacls/source/lib/sysacls.c === --- branches/tmp/vl-posixacls/source/lib/sysacls.c 2006-02-21 17:00:01 UTC (rev 13595) +++ branches/tmp/vl-posixacls/source/lib/sysacls.c 2006-02-21 17:17:50 UTC (rev 13596) @@ -1,7 +1,7 @@ /* Unix SMB/CIFS implementation. Samba system utilities for ACL support. - Copyright (C) Jeremy Allison 2000. + Copyright (C) Volker Lendecke 2006 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,48 +23,8 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_ACLS -/* - This file wraps all differing system ACL interfaces into a consistent - one based on the POSIX interface. It also returns the correct errors - for older UNIX systems that don't support ACLs. - - The interfaces that each ACL implementation must support are as follows : - - int sys_acl_get_entry( SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p) - void *sys_acl_get_qualifier( SMB_ACL_ENTRY_T entry_d) - SMB_ACL_T sys_acl_get_file( const char *path_p, SMB_ACL_TYPE_T type) - SMB_ACL_T sys_acl_get_fd(int fd) - char *sys_acl_to_text( SMB_ACL_T theacl, ssize_t *plen) - SMB_ACL_T sys_acl_init( int count) - int sys_acl_create_entry( SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry) - int sys_acl_set_qualifier( SMB_ACL_ENTRY_T entry, void *qual) - int sys_acl_valid( SMB_ACL_T theacl ) - int sys_acl_set_file( const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl) - int sys_acl_set_fd( int fd, SMB_ACL_T theacl) - int sys_acl_delete_def_file(const char *path) - - This next one is not POSIX complient - but we *have* to have it ! - More POSIX braindamage. - - int sys_acl_get_perm( SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm) - - The generic POSIX free is the following call. We split this into - several different free functions as we may need to add tag info - to structures when emulating the POSIX interface. - - int sys_acl_free( void *obj_p) - - The calls we actually use are : - - int sys_acl_free_text(char *text) - free acl_to_text - int sys_acl_free_acl(SMB_ACL_T posix_acl) - -*/ - #if defined(HAVE_POSIX_ACLS) -/* Identity mapping - easy. */ - int smb_acl_get_entry( const struct smb_acl *the_acl, int entry_id, struct smb_acl_entry *entry_p) {
svn commit: samba r13595 - in trunk/source/utils: .
Author: jra Date: 2006-02-21 17:00:01 + (Tue, 21 Feb 2006) New Revision: 13595 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13595 Log: Got sense of NTSTATUS check reversed. Jeremy. Modified: trunk/source/utils/net_usershare.c Changeset: Modified: trunk/source/utils/net_usershare.c === --- trunk/source/utils/net_usershare.c 2006-02-21 17:00:00 UTC (rev 13594) +++ trunk/source/utils/net_usershare.c 2006-02-21 17:00:01 UTC (rev 13595) @@ -368,8 +368,8 @@ ntstatus = net_lookup_name_from_sid(ctx, &psd->dacl->ace[num_aces].trustee, &domain, &name); - if (!NT_STATUS_IS_OK(ntstatus)) { - if (*domain) { + if (NT_STATUS_IS_OK(ntstatus)) { + if (domain && *domain) { pstrcat(acl_str, domain); pstrcat(acl_str, sep_str); }
svn commit: samba r13594 - in branches/SAMBA_3_0/source/utils: .
Author: jra Date: 2006-02-21 17:00:00 + (Tue, 21 Feb 2006) New Revision: 13594 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13594 Log: Got sense of NTSTATUS check reversed. Jeremy. Modified: branches/SAMBA_3_0/source/utils/net_usershare.c Changeset: Modified: branches/SAMBA_3_0/source/utils/net_usershare.c === --- branches/SAMBA_3_0/source/utils/net_usershare.c 2006-02-21 16:46:21 UTC (rev 13593) +++ branches/SAMBA_3_0/source/utils/net_usershare.c 2006-02-21 17:00:00 UTC (rev 13594) @@ -368,8 +368,8 @@ ntstatus = net_lookup_name_from_sid(ctx, &psd->dacl->ace[num_aces].trustee, &domain, &name); - if (!NT_STATUS_IS_OK(ntstatus)) { - if (*domain) { + if (NT_STATUS_IS_OK(ntstatus)) { + if (domain && *domain) { pstrcat(acl_str, domain); pstrcat(acl_str, sep_str); }
svn commit: samba r13593 - branches/SAMBA_3_0/source/passdb trunk/source/passdb
Author: jerry Date: 2006-02-21 16:46:21 + (Tue, 21 Feb 2006) New Revision: 13593 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13593 Log: consolidate pdb_set_sam_sids() into samu_set_unix() which was the only place it was called from. Modified: branches/SAMBA_3_0/source/passdb/passdb.c trunk/source/passdb/passdb.c Changeset: Sorry, the patch is too large (481 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13593
svn commit: samba r13592 - in branches/SAMBA_4_0/source/lib/replace: .
Author: idra Date: 2006-02-21 16:03:58 + (Tue, 21 Feb 2006) New Revision: 13592 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13592 Log: Incredible how bugs like this can sweep in even after peer review and testing ... Modified: branches/SAMBA_4_0/source/lib/replace/snprintf.c Changeset: Modified: branches/SAMBA_4_0/source/lib/replace/snprintf.c === --- branches/SAMBA_4_0/source/lib/replace/snprintf.c2006-02-21 15:47:19 UTC (rev 13591) +++ branches/SAMBA_4_0/source/lib/replace/snprintf.c2006-02-21 16:03:58 UTC (rev 13592) @@ -1112,25 +1112,28 @@ } static struct pr_chunk *new_chunk(void) { - struct pr_chunk *new = (struct pr_chunk *)malloc(sizeof(struct pr_chunk)); + struct pr_chunk *new_c = (struct pr_chunk *)malloc(sizeof(struct pr_chunk)); - if (!new) return NULL; + if (!new_c) + return NULL; - new->type = 0; - new->num = 0; - new->min = 0; - new->min_star = NULL; - new->max = -1; - new->max_star = NULL; - new->flags = 0; - new->cflags = 0; - new->start = 0; - new->len = 0; - new->value = 0; - new->fvalue = 0; - new->strvalue = NULL; - new->pnum = NULL; - new->next = NULL; + new_c->type = 0; + new_c->num = 0; + new_c->min = 0; + new_c->min_star = NULL; + new_c->max = -1; + new_c->max_star = NULL; + new_c->flags = 0; + new_c->cflags = 0; + new_c->start = 0; + new_c->len = 0; + new_c->value = 0; + new_c->fvalue = 0; + new_c->strvalue = NULL; + new_c->pnum = NULL; + new_c->next = NULL; + + return new_c; } static int add_cnk_list_entry(struct pr_chunk_x **list,
svn commit: samba r13591 - branches/SAMBA_3_0/source/lib trunk/source/lib
Author: jerry Date: 2006-02-21 15:47:19 + (Tue, 21 Feb 2006) New Revision: 13591 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13591 Log: I really have no idea how this code ever worked. And I have no idea why no one (including myself) caught this with a compiler warningMake sure new_chunk() actually returns a pointer to the allocated memory. SAMBA_3_0 now works again on Solaris. Modified: branches/SAMBA_3_0/source/lib/snprintf.c trunk/source/lib/snprintf.c Changeset: Modified: branches/SAMBA_3_0/source/lib/snprintf.c === --- branches/SAMBA_3_0/source/lib/snprintf.c2006-02-21 14:34:11 UTC (rev 13590) +++ branches/SAMBA_3_0/source/lib/snprintf.c2006-02-21 15:47:19 UTC (rev 13591) @@ -1112,25 +1112,28 @@ } static struct pr_chunk *new_chunk(void) { - struct pr_chunk *new = (struct pr_chunk *)malloc(sizeof(struct pr_chunk)); + struct pr_chunk *new_c = (struct pr_chunk *)malloc(sizeof(struct pr_chunk)); - if (!new) return NULL; + if ( !new_c ) + return NULL; - new->type = 0; - new->num = 0; - new->min = 0; - new->min_star = NULL; - new->max = -1; - new->max_star = NULL; - new->flags = 0; - new->cflags = 0; - new->start = 0; - new->len = 0; - new->value = 0; - new->fvalue = 0; - new->strvalue = NULL; - new->pnum = NULL; - new->next = NULL; + new_c->type = 0; + new_c->num = 0; + new_c->min = 0; + new_c->min_star = NULL; + new_c->max = -1; + new_c->max_star = NULL; + new_c->flags = 0; + new_c->cflags = 0; + new_c->start = 0; + new_c->len = 0; + new_c->value = 0; + new_c->fvalue = 0; + new_c->strvalue = NULL; + new_c->pnum = NULL; + new_c->next = NULL; + + return new_c; } static int add_cnk_list_entry(struct pr_chunk_x **list, Modified: trunk/source/lib/snprintf.c === --- trunk/source/lib/snprintf.c 2006-02-21 14:34:11 UTC (rev 13590) +++ trunk/source/lib/snprintf.c 2006-02-21 15:47:19 UTC (rev 13591) @@ -1112,25 +1112,28 @@ } static struct pr_chunk *new_chunk(void) { - struct pr_chunk *new = (struct pr_chunk *)malloc(sizeof(struct pr_chunk)); + struct pr_chunk *new_c = (struct pr_chunk *)malloc(sizeof(struct pr_chunk)); - if (!new) return NULL; + if ( !new_c ) + return NULL; - new->type = 0; - new->num = 0; - new->min = 0; - new->min_star = NULL; - new->max = -1; - new->max_star = NULL; - new->flags = 0; - new->cflags = 0; - new->start = 0; - new->len = 0; - new->value = 0; - new->fvalue = 0; - new->strvalue = NULL; - new->pnum = NULL; - new->next = NULL; + new_c->type = 0; + new_c->num = 0; + new_c->min = 0; + new_c->min_star = NULL; + new_c->max = -1; + new_c->max_star = NULL; + new_c->flags = 0; + new_c->cflags = 0; + new_c->start = 0; + new_c->len = 0; + new_c->value = 0; + new_c->fvalue = 0; + new_c->strvalue = NULL; + new_c->pnum = NULL; + new_c->next = NULL; + + return new_c; } static int add_cnk_list_entry(struct pr_chunk_x **list,
svn commit: samba r13590 - branches/SAMBA_3_0/source/auth branches/SAMBA_3_0/source/pam_smbpass branches/SAMBA_3_0/source/passdb branches/SAMBA_3_0/source/rpc_server branches/SAMBA_3_0/source/smbd bra
Author: jerry Date: 2006-02-21 14:34:11 + (Tue, 21 Feb 2006) New Revision: 13590 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13590 Log: * replace all pdb_init_sam[_talloc]() calls with samu_new() * replace all pdb_{init,fill}_sam_pw() calls with samu_set_unix() Modified: branches/SAMBA_3_0/source/auth/auth_rhosts.c branches/SAMBA_3_0/source/auth/auth_sam.c branches/SAMBA_3_0/source/auth/auth_unix.c branches/SAMBA_3_0/source/auth/auth_util.c branches/SAMBA_3_0/source/pam_smbpass/pam_smb_acct.c branches/SAMBA_3_0/source/pam_smbpass/pam_smb_auth.c branches/SAMBA_3_0/source/pam_smbpass/pam_smb_passwd.c branches/SAMBA_3_0/source/passdb/passdb.c branches/SAMBA_3_0/source/passdb/pdb_interface.c branches/SAMBA_3_0/source/passdb/pdb_smbpasswd.c branches/SAMBA_3_0/source/passdb/pdb_tdb.c branches/SAMBA_3_0/source/rpc_server/srv_netlog_nt.c branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c branches/SAMBA_3_0/source/smbd/chgpasswd.c branches/SAMBA_3_0/source/smbd/lanman.c branches/SAMBA_3_0/source/utils/net_rpc_samsync.c branches/SAMBA_3_0/source/utils/net_sam.c branches/SAMBA_3_0/source/utils/pdbedit.c branches/SAMBA_3_0/source/utils/smbpasswd.c trunk/source/auth/auth_rhosts.c trunk/source/auth/auth_sam.c trunk/source/auth/auth_unix.c trunk/source/auth/auth_util.c trunk/source/pam_smbpass/pam_smb_acct.c trunk/source/pam_smbpass/pam_smb_auth.c trunk/source/pam_smbpass/pam_smb_passwd.c trunk/source/passdb/passdb.c trunk/source/passdb/pdb_interface.c trunk/source/passdb/pdb_smbpasswd.c trunk/source/passdb/pdb_tdb.c trunk/source/rpc_server/srv_netlog_nt.c trunk/source/rpc_server/srv_samr_nt.c trunk/source/smbd/chgpasswd.c trunk/source/smbd/lanman.c trunk/source/utils/net_rpc_samsync.c trunk/source/utils/net_sam.c trunk/source/utils/pdbedit.c trunk/source/utils/smbpasswd.c Changeset: Sorry, the patch is too large (2329 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13590
svn commit: samba r13589 - branches/SAMBA_3_0/source/passdb trunk/source/passdb
Author: jerry Date: 2006-02-21 14:03:15 + (Tue, 21 Feb 2006) New Revision: 13589 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13589 Log: Make sure we only try to close the tdbsam file in endsampwent() when we have a valid pwent list from a setsampwent(). Fixes a bug with the reference count on the open tdb. Modified: branches/SAMBA_3_0/source/passdb/pdb_tdb.c trunk/source/passdb/pdb_tdb.c Changeset: Modified: branches/SAMBA_3_0/source/passdb/pdb_tdb.c === --- branches/SAMBA_3_0/source/passdb/pdb_tdb.c 2006-02-21 03:29:02 UTC (rev 13588) +++ branches/SAMBA_3_0/source/passdb/pdb_tdb.c 2006-02-21 14:03:15 UTC (rev 13589) @@ -50,6 +50,7 @@ TDB_DATA key; }; static struct pwent_list *tdbsam_pwent_list; +static BOOL pwent_initialized; /* GLOBAL TDB SAM CONTEXT */ @@ -292,6 +293,7 @@ } tdb_traverse( tdbsam, tdbsam_traverse_setpwent, NULL ); + pwent_initialized = True; return NT_STATUS_OK; } @@ -305,6 +307,13 @@ { struct pwent_list *ptr, *ptr_next; + /* close the tdb only if we have a valid pwent state */ + + if ( pwent_initialized ) { + DEBUG(7, ("endtdbpwent: closed sam database.\n")); + tdbsam_close(); + } + /* clear out any remaining entries in the list */ for ( ptr=tdbsam_pwent_list; ptr; ptr = ptr_next ) { @@ -312,11 +321,9 @@ DLIST_REMOVE( tdbsam_pwent_list, ptr ); SAFE_FREE( ptr->key.dptr); SAFE_FREE( ptr ); - } + } - DEBUG(7, ("endtdbpwent: closed sam database.\n")); - - tdbsam_close(); + pwent_initialized = False; } /* Modified: trunk/source/passdb/pdb_tdb.c === --- trunk/source/passdb/pdb_tdb.c 2006-02-21 03:29:02 UTC (rev 13588) +++ trunk/source/passdb/pdb_tdb.c 2006-02-21 14:03:15 UTC (rev 13589) @@ -50,6 +50,7 @@ TDB_DATA key; }; static struct pwent_list *tdbsam_pwent_list; +static BOOL pwent_initialized; /* GLOBAL TDB SAM CONTEXT */ @@ -292,6 +293,7 @@ } tdb_traverse( tdbsam, tdbsam_traverse_setpwent, NULL ); + pwent_initialized = True; return NT_STATUS_OK; } @@ -305,6 +307,13 @@ { struct pwent_list *ptr, *ptr_next; + /* close the tdb only if we have a valid pwent state */ + + if ( pwent_initialized ) { + DEBUG(7, ("endtdbpwent: closed sam database.\n")); + tdbsam_close(); + } + /* clear out any remaining entries in the list */ for ( ptr=tdbsam_pwent_list; ptr; ptr = ptr_next ) { @@ -312,11 +321,9 @@ DLIST_REMOVE( tdbsam_pwent_list, ptr ); SAFE_FREE( ptr->key.dptr); SAFE_FREE( ptr ); - } + } - DEBUG(7, ("endtdbpwent: closed sam database.\n")); - - tdbsam_close(); + pwent_initialized = False; } /*