svn commit: samba r11363 - in branches/SAMBA_4_0/source/scripting/libjs: .
Author: tridge Date: 2005-10-28 07:00:52 + (Fri, 28 Oct 2005) New Revision: 11363 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11363 Log: fixed a problem with provisioning when hklm already exists (the problem is really caused by hklm not having objectclass attributes on its records, but this is a workaround) Modified: branches/SAMBA_4_0/source/scripting/libjs/provision.js Changeset: Modified: branches/SAMBA_4_0/source/scripting/libjs/provision.js === --- branches/SAMBA_4_0/source/scripting/libjs/provision.js 2005-10-28 06:51:44 UTC (rev 11362) +++ branches/SAMBA_4_0/source/scripting/libjs/provision.js 2005-10-28 07:00:52 UTC (rev 11363) @@ -157,7 +157,7 @@ for (i=0;i
svn commit: samba r11364 - in branches/SAMBA_4_0/source/lib/ldb: common include ldb_tdb
Author: tridge Date: 2005-10-28 07:05:32 + (Fri, 28 Oct 2005) New Revision: 11364 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11364 Log: added a ldb_attr_dn() function for testing if an attribute name is "dn" or "distinguishedName". This makes us a bit more consistent Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb_match.c branches/SAMBA_4_0/source/lib/ldb/common/ldb_utf8.c branches/SAMBA_4_0/source/lib/ldb/include/ldb.h branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_index.c Changeset: Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb_match.c === --- branches/SAMBA_4_0/source/lib/ldb/common/ldb_match.c2005-10-28 07:00:52 UTC (rev 11363) +++ branches/SAMBA_4_0/source/lib/ldb/common/ldb_match.c2005-10-28 07:05:32 UTC (rev 11364) @@ -87,8 +87,7 @@ struct ldb_parse_tree *tree, enum ldb_scope scope) { - - if (ldb_attr_cmp(tree->u.present.attr, "distinguishedName") == 0) { + if (ldb_attr_dn(tree->u.present.attr) == 0) { return 1; } @@ -151,8 +150,7 @@ struct ldb_dn *valuedn; int ret; - if (ldb_attr_cmp(tree->u.equality.attr, "dn") == 0 || - ldb_attr_cmp(tree->u.equality.attr, "distinguishedName") == 0) { + if (ldb_attr_dn(tree->u.equality.attr) == 0) { valuedn = ldb_dn_explode_casefold(ldb, (char *)tree->u.equality.value.data); if (valuedn == NULL) { Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb_utf8.c === --- branches/SAMBA_4_0/source/lib/ldb/common/ldb_utf8.c 2005-10-28 07:00:52 UTC (rev 11363) +++ branches/SAMBA_4_0/source/lib/ldb/common/ldb_utf8.c 2005-10-28 07:05:32 UTC (rev 11364) @@ -80,3 +80,15 @@ { return ldb_caseless_cmp(attr1, attr2); } + +/* + we accept either 'dn' or 'distinguishedName' for a distinguishedName +*/ +int ldb_attr_dn(const char *attr) +{ + if (ldb_attr_cmp(attr, "dn") == 0 || + ldb_attr_cmp(attr, "distinguishedName") == 0) { + return 0; + } + return -1; +} Modified: branches/SAMBA_4_0/source/lib/ldb/include/ldb.h === --- branches/SAMBA_4_0/source/lib/ldb/include/ldb.h 2005-10-28 07:00:52 UTC (rev 11363) +++ branches/SAMBA_4_0/source/lib/ldb/include/ldb.h 2005-10-28 07:05:32 UTC (rev 11364) @@ -391,7 +391,8 @@ /* useful functions for ldb_message structure manipulation */ int ldb_dn_cmp(struct ldb_context *ldb, const char *dn1, const char *dn2); -int ldb_attr_cmp(const char *dn1, const char *dn2); +int ldb_attr_cmp(const char *attr1, const char *attr2); +int ldb_attr_dn(const char *attr); char *ldb_dn_escape_value(void *mem_ctx, struct ldb_val value); /* create an empty message */ Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_index.c === --- branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_index.c 2005-10-28 07:00:52 UTC (rev 11363) +++ branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_index.c 2005-10-28 07:05:32 UTC (rev 11364) @@ -321,8 +321,7 @@ if (ldb_attr_cmp(tree->u.equality.attr, LTDB_OBJECTCLASS) == 0) { return ltdb_index_dn_objectclass(module, tree, index_list, list); } - if (ldb_attr_cmp(tree->u.equality.attr, "distinguishedName") == 0 || - ldb_attr_cmp(tree->u.equality.attr, "dn") == 0) { + if (ldb_attr_dn(tree->u.equality.attr) == 0) { list->dn = talloc_array(list, char *, 1); if (list->dn == NULL) { ldb_oom(module->ldb);
svn commit: samba r11365 - in branches/SAMBA_4_0/source/scripting/ejs: .
Author: tridge Date: 2005-10-28 07:05:56 + (Fri, 28 Oct 2005) New Revision: 11365 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11365 Log: fixed a comment typo Modified: branches/SAMBA_4_0/source/scripting/ejs/smbcalls_string.c Changeset: Modified: branches/SAMBA_4_0/source/scripting/ejs/smbcalls_string.c === --- branches/SAMBA_4_0/source/scripting/ejs/smbcalls_string.c 2005-10-28 07:05:32 UTC (rev 11364) +++ branches/SAMBA_4_0/source/scripting/ejs/smbcalls_string.c 2005-10-28 07:05:56 UTC (rev 11365) @@ -93,7 +93,7 @@ usage: list = split(".", "a.foo.bar"); - NOTE: does not take a regular expression, unlink perl split() + NOTE: does not take a regular expression, unlike perl split() */ static int ejs_split(MprVarHandle eid, int argc, char **argv) {
svn commit: samba r11366 - in branches/SAMBA_4_0/source: auth auth/ntlmssp rpc_server/netlogon
Author: abartlet Date: 2005-10-28 08:54:37 + (Fri, 28 Oct 2005) New Revision: 11366 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11366 Log: Pass around the flags which indicate if we should support plaintext logins and NTLM machine account logins. Andrew Bartlett Modified: branches/SAMBA_4_0/source/auth/auth.h branches/SAMBA_4_0/source/auth/auth_sam.c branches/SAMBA_4_0/source/auth/ntlm_check.c branches/SAMBA_4_0/source/auth/ntlmssp/ntlmssp_server.c branches/SAMBA_4_0/source/rpc_server/netlogon/dcerpc_netlogon.c Changeset: Modified: branches/SAMBA_4_0/source/auth/auth.h === --- branches/SAMBA_4_0/source/auth/auth.h 2005-10-28 07:05:56 UTC (rev 11365) +++ branches/SAMBA_4_0/source/auth/auth.h 2005-10-28 08:54:37 UTC (rev 11366) @@ -51,6 +51,8 @@ const char *workstation_name; const char *remote_host; + uint32_t logon_parameters; + BOOL mapped_state; /* the values the client gives us */ struct { Modified: branches/SAMBA_4_0/source/auth/auth_sam.c === --- branches/SAMBA_4_0/source/auth/auth_sam.c 2005-10-28 07:05:56 UTC (rev 11365) +++ branches/SAMBA_4_0/source/auth/auth_sam.c 2005-10-28 08:54:37 UTC (rev 11366) @@ -105,7 +105,8 @@ break; case AUTH_PASSWORD_RESPONSE: - status = ntlm_password_check(mem_ctx, &auth_context->challenge.data, + status = ntlm_password_check(mem_ctx, user_info->logon_parameters, +&auth_context->challenge.data, &user_info->password.response.lanman, &user_info->password.response.nt, user_info->mapped.account_name, @@ -133,6 +134,7 @@ (ie not disabled, expired and the like). / static NTSTATUS authsam_account_ok(TALLOC_CTX *mem_ctx, + uint32_t logon_parameters, uint16_t acct_flags, NTTIME acct_expiry, NTTIME must_change_time, @@ -204,20 +206,23 @@ return NT_STATUS_INVALID_WORKSTATION; } } - + if (acct_flags & ACB_DOMTRUST) { DEBUG(2,("sam_account_ok: Domain trust account %s denied by server\n", user_info->mapped.account_name)); return NT_STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT; } - - if (acct_flags & ACB_SVRTRUST) { - DEBUG(2,("sam_account_ok: Server trust account %s denied by server\n", user_info->mapped.account_name)); - return NT_STATUS_NOLOGON_SERVER_TRUST_ACCOUNT; + + if (!(logon_parameters & MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT)) { + if (acct_flags & ACB_SVRTRUST) { + DEBUG(2,("sam_account_ok: Server trust account %s denied by server\n", user_info->mapped.account_name)); + return NT_STATUS_NOLOGON_SERVER_TRUST_ACCOUNT; + } } - - if (acct_flags & ACB_WSTRUST) { - DEBUG(4,("sam_account_ok: Wksta trust account %s denied by server\n", user_info->mapped.account_name)); - return NT_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT; + if (!(logon_parameters & MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT)) { + if (acct_flags & ACB_WSTRUST) { + DEBUG(4,("sam_account_ok: Wksta trust account %s denied by server\n", user_info->mapped.account_name)); + return NT_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT; + } } return NT_STATUS_OK; @@ -381,7 +386,9 @@ workstation_list = samdb_result_string(msgs[0], "userWorkstations", NULL); - nt_status = authsam_account_ok(mem_ctx, acct_flags, + nt_status = authsam_account_ok(mem_ctx, + user_info->logon_parameters, + acct_flags, acct_expiry, must_change_time, last_set_time, Modified: branches/SAMBA_4_0/source/auth/ntlm_check.c === --- branches/SAMBA_4_0/source/auth/ntlm_check.c 2005-10-28 07:05:56 UTC (rev 11365) +++ branches/SAMBA_4_0/source/auth/ntlm_check.c 2005-10-28 08:54:37 UTC (rev 11366) @@ -23,6 +23,7 @@ #include "includes.h" #include "lib/crypto/crypto.h" #include "librpc/gen_ndr/ndr_samr.h" +#include "librpc/gen_ndr/ndr_netlogon.h" /
svn commit: samba r11367 - in branches/SAMBA_4_0/source/smb_server: .
Author: abartlet Date: 2005-10-28 09:14:16 + (Fri, 28 Oct 2005) New Revision: 11367 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11367 Log: Ensure to intialise the new logon_parameters (0 for session setups). Andrew Bartlett Modified: branches/SAMBA_4_0/source/smb_server/sesssetup.c Changeset: Modified: branches/SAMBA_4_0/source/smb_server/sesssetup.c === --- branches/SAMBA_4_0/source/smb_server/sesssetup.c2005-10-28 08:54:37 UTC (rev 11366) +++ branches/SAMBA_4_0/source/smb_server/sesssetup.c2005-10-28 09:14:16 UTC (rev 11367) @@ -78,6 +78,7 @@ } user_info->mapped_state = False; + user_info->logon_parameters = 0; user_info->flags = 0; user_info->client.account_name = sess->old.in.user; user_info->client.domain_name = sess->old.in.domain; @@ -187,6 +188,7 @@ } user_info->mapped_state = False; + user_info->logon_parameters = 0; user_info->flags = 0; user_info->client.account_name = sess->nt1.in.user; user_info->client.domain_name = sess->nt1.in.domain;
svn commit: samba r11368 - branches/SAMBA_3_0/source/nsswitch trunk/source/nsswitch
Author: vlendec Date: 2005-10-28 09:15:27 + (Fri, 28 Oct 2005) New Revision: 11368 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11368 Log: Remove a memleak that just cost me half an hour: If we terminate inside a message handler, the list of messages from retrieve_all_messages is not properly freed. Not important, just confusing :-) Volker Modified: branches/SAMBA_3_0/source/nsswitch/winbindd.c trunk/source/nsswitch/winbindd.c Changeset: Modified: branches/SAMBA_3_0/source/nsswitch/winbindd.c === --- branches/SAMBA_3_0/source/nsswitch/winbindd.c 2005-10-28 09:14:16 UTC (rev 11367) +++ branches/SAMBA_3_0/source/nsswitch/winbindd.c 2005-10-28 09:15:27 UTC (rev 11368) @@ -213,7 +213,7 @@ /* React on 'smbcontrol winbindd shutdown' in the same way as on SIGTERM*/ static void msg_shutdown(int msg_type, struct process_id src, void *buf, size_t len) { - terminate(); + do_sigterm = True; } static struct winbindd_dispatch_table { Modified: trunk/source/nsswitch/winbindd.c === --- trunk/source/nsswitch/winbindd.c2005-10-28 09:14:16 UTC (rev 11367) +++ trunk/source/nsswitch/winbindd.c2005-10-28 09:15:27 UTC (rev 11368) @@ -213,7 +213,7 @@ /* React on 'smbcontrol winbindd shutdown' in the same way as on SIGTERM*/ static void msg_shutdown(int msg_type, struct process_id src, void *buf, size_t len) { - terminate(); + do_sigterm = True; } static struct winbindd_dispatch_table {
svn commit: samba r11369 - in branches/SAMBA_4_0/source: include lib/socket libcli libcli/ldap libcli/raw libcli/smb_composite
Author: vlendec Date: 2005-10-28 11:02:42 + (Fri, 28 Oct 2005) New Revision: 11369 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11369 Log: Implement socket_connect_multi: Connect to multiple ipv4 tcp ports in sequence, with a 2-millisecond timeout between firing the syn packets. Build smbcli_sock_connect_send upon that. Volker Added: branches/SAMBA_4_0/source/lib/socket/connect_multi.c Removed: branches/SAMBA_4_0/source/libcli/smb_composite/connect_multi.c Modified: branches/SAMBA_4_0/source/include/structs.h branches/SAMBA_4_0/source/lib/socket/config.mk branches/SAMBA_4_0/source/lib/socket/socket.h branches/SAMBA_4_0/source/libcli/cliconnect.c branches/SAMBA_4_0/source/libcli/config.mk branches/SAMBA_4_0/source/libcli/ldap/ldap_client.c branches/SAMBA_4_0/source/libcli/raw/clisocket.c branches/SAMBA_4_0/source/libcli/smb_composite/connect.c Changeset: Sorry, the patch is too large (1091 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11369
svn commit: samba r11370 - in branches/SAMBA_4_0/source: auth rpc_server/netlogon torture/rpc
Author: abartlet Date: 2005-10-28 11:20:48 + (Fri, 28 Oct 2005) New Revision: 11370 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11370 Log: Samba4 now passes it's own RPC-SAMLOGON test again. This avoids the nasty [EMAIL PROTECTED] test for now, as it has very odd semantics with NTLMv2. Allow only user accounts to do an interactive login. Andrew Bartlett Modified: branches/SAMBA_4_0/source/auth/auth.h branches/SAMBA_4_0/source/auth/auth_sam.c branches/SAMBA_4_0/source/auth/ntlm_check.c branches/SAMBA_4_0/source/rpc_server/netlogon/dcerpc_netlogon.c branches/SAMBA_4_0/source/torture/rpc/samlogon.c Changeset: Modified: branches/SAMBA_4_0/source/auth/auth.h === --- branches/SAMBA_4_0/source/auth/auth.h 2005-10-28 11:02:42 UTC (rev 11369) +++ branches/SAMBA_4_0/source/auth/auth.h 2005-10-28 11:20:48 UTC (rev 11370) @@ -39,6 +39,7 @@ #define USER_INFO_CASE_INSENSITIVE_USERNAME 0x01 /* username may be in any case */ #define USER_INFO_CASE_INSENSITIVE_PASSWORD 0x02 /* password may be in any case */ #define USER_INFO_DONT_CHECK_UNIX_ACCOUNT 0x04 /* dont check unix account status */ +#define USER_INFO_INTERACTIVE_LOGON 0x08 /* dont check unix account status */ enum auth_password_state { AUTH_PASSWORD_RESPONSE, Modified: branches/SAMBA_4_0/source/auth/auth_sam.c === --- branches/SAMBA_4_0/source/auth/auth_sam.c 2005-10-28 11:02:42 UTC (rev 11369) +++ branches/SAMBA_4_0/source/auth/auth_sam.c 2005-10-28 11:20:48 UTC (rev 11370) @@ -370,6 +370,13 @@ return NT_STATUS_ACCOUNT_LOCKED_OUT; } + /* You can only do an interactive login to normal accounts */ + if (user_info->flags & USER_INFO_INTERACTIVE_LOGON) { + if (!(acct_flags & ACB_NORMAL)) { + return NT_STATUS_NO_SUCH_USER; + } + } + nt_status = samdb_result_passwords(mem_ctx, msgs[0], &lm_pwd, &nt_pwd); NT_STATUS_NOT_OK_RETURN(nt_status); Modified: branches/SAMBA_4_0/source/auth/ntlm_check.c === --- branches/SAMBA_4_0/source/auth/ntlm_check.c 2005-10-28 11:02:42 UTC (rev 11369) +++ branches/SAMBA_4_0/source/auth/ntlm_check.c 2005-10-28 11:20:48 UTC (rev 11370) @@ -245,6 +245,9 @@ username)); return NT_STATUS_WRONG_PASSWORD; } + if (strchr_m(username, '@')) { + return NT_STATUS_NOT_FOUND; + } if (memcmp(client_lanman->hash, stored_lanman->hash, sizeof(stored_lanman->hash)) == 0) { return NT_STATUS_OK; @@ -254,6 +257,9 @@ return NT_STATUS_WRONG_PASSWORD; } } + if (strchr_m(username, '@')) { + return NT_STATUS_NOT_FOUND; + } return NT_STATUS_WRONG_PASSWORD; } @@ -304,20 +310,27 @@ && (memcmp(challenge->data, zeros, challenge->length) == 0 )) { struct samr_Password client_nt; struct samr_Password client_lm; - uint8_t dospwd[14]; + uint8_t dospwd[15]; + char *unix_pw; DEBUG(4,("ntlm_password_check: checking plaintext passwords for user %s\n", username)); mdfour(client_nt.hash, nt_response->data, nt_response->length); ZERO_STRUCT(dospwd); - memcpy(dospwd, lm_response->data, MIN(lm_response->length, sizeof(dospwd))); + convert_string_talloc(mem_ctx, CH_DOS, CH_UNIX, + lm_response->data, lm_response->length, + (void **)&unix_pw); + /* Only the fisrt 14 chars are considered, password need not be null terminated. */ + push_ascii(dospwd, unix_pw, sizeof(dospwd), STR_UPPER); /* we *might* need to upper-case the string here */ E_P16((const uint8_t *)dospwd, client_lm.hash); - return hash_password_check(mem_ctx, &client_lm, &client_nt, + return hash_password_check(mem_ctx, + lm_response->length ? &client_lm : NULL, + nt_response->length ? &client_nt : NULL, username, stored_lanman, stored_nt); } @@ -424,6 +437,9 @@ } else if (!stored_lanman) { DEBUG(3,("ntlm_password_check: NO LanMan password set for user %s (and no NT password supplied)\n", username)); + } else if (strchr_m(username, '@'))
svn commit: samba r11371 - in branches/SAMBA_4_0/source/utils: .
Author: abartlet Date: 2005-10-28 11:21:33 + (Fri, 28 Oct 2005) New Revision: 11371 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11371 Log: Fix the ntlm_auth build. Andrew Bartlett Modified: branches/SAMBA_4_0/source/utils/ntlm_auth.c Changeset: Modified: branches/SAMBA_4_0/source/utils/ntlm_auth.c === --- branches/SAMBA_4_0/source/utils/ntlm_auth.c 2005-10-28 11:20:48 UTC (rev 11370) +++ branches/SAMBA_4_0/source/utils/ntlm_auth.c 2005-10-28 11:21:33 UTC (rev 11371) @@ -167,6 +167,8 @@ nt_status = ntlm_password_check(mem_ctx, + MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT | + MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT, challenge, lm_response, nt_response,
svn commit: samba r11372 - in branches/SAMBA_4_0/source/script/tests: .
Author: abartlet Date: 2005-10-28 12:08:03 + (Fri, 28 Oct 2005) New Revision: 11372 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11372 Log: Now RPC-SAMLOGON works, place it into the default 'make test'. Andrew Bartlett Modified: branches/SAMBA_4_0/source/script/tests/test_rpc.sh Changeset: Modified: branches/SAMBA_4_0/source/script/tests/test_rpc.sh === --- branches/SAMBA_4_0/source/script/tests/test_rpc.sh 2005-10-28 11:21:33 UTC (rev 11371) +++ branches/SAMBA_4_0/source/script/tests/test_rpc.sh 2005-10-28 12:08:03 UTC (rev 11372) @@ -40,19 +40,19 @@ done done +for bindoptions in connect validate ; do + for transport in ncalrpc; do + case $transport in +ncalrpc) tests=$slow_ncalrpc_tests ;; +ncacn_np) tests=$slow_ncacn_np_tests ;; +ncacn_ip_tcp) tests=$slow_ncacn_ip_tcp_tests ;; + esac + for t in $tests; do +name="$t on $transport with $bindoptions" +testit "$name" $VALGRIND bin/smbtorture $TORTURE_OPTIONS $transport:"$server[$bindoptions]" -U"$username"%"$password" -W $domain $t "$*" || failed=`expr $failed + 1` + done + done +done + testok $0 $failed -#for bindoptions in connect validate padcheck bigendian bigendian,seal; do -# for transport in ncalrpc ncacn_np ncacn_ip_tcp; do -# case $transport in -# ncalrpc) tests=$slow_ncalrpc_tests ;; -# ncacn_np) tests=$slow_ncacn_np_tests ;; -# ncacn_ip_tcp) tests=$slow_ncacn_ip_tcp_tests ;; -# esac -# for t in $tests; do -#name="$t on $transport with $bindoptions" -#testit "$name" $VALGRIND bin/smbtorture $TORTURE_OPTIONS $transport:"$server[$bindoptions]" -U"$username"%"$password" -W $domain $t "$*" || failed=`expr $failed + 1` -# done -# done -#done -
svn commit: samba r11373 - in branches/SAMBA_4_0/source: librpc/idl nbt_server
Author: abartlet Date: 2005-10-28 13:22:09 + (Fri, 28 Oct 2005) New Revision: 11373 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11373 Log: Handle an apparent alias in NBT ntlogin replies. Andrew Bartlett Modified: branches/SAMBA_4_0/source/librpc/idl/nbt.idl branches/SAMBA_4_0/source/nbt_server/irpc.c Changeset: Modified: branches/SAMBA_4_0/source/librpc/idl/nbt.idl === --- branches/SAMBA_4_0/source/librpc/idl/nbt.idl2005-10-28 12:08:03 UTC (rev 11372) +++ branches/SAMBA_4_0/source/librpc/idl/nbt.idl2005-10-28 13:22:09 UTC (rev 11373) @@ -536,8 +536,9 @@ /***/ /* \MAILSLOT\NET\NTLOGON mailslot requests */ typedef enum { - NTLOGON_SAM_LOGON = 0x12, - NTLOGON_SAM_LOGON_REPLY = 0x13 + NTLOGON_SAM_LOGON = 0x12, + NTLOGON_SAM_LOGON_REPLY = 0x13, + NTLOGON_SAM_LOGON_REPLY15 = 0x15 } nbt_ntlogon_command; typedef struct { @@ -566,6 +567,7 @@ typedef [nodiscriminant] union { [case(NTLOGON_SAM_LOGON)] nbt_ntlogon_sam_logon logon; [case(NTLOGON_SAM_LOGON_REPLY)] nbt_ntlogon_sam_logon_reply reply; + [case(NTLOGON_SAM_LOGON_REPLY15)] nbt_ntlogon_sam_logon_reply reply; } nbt_ntlogon_request; typedef [flag(NDR_NOALIGN),public] struct { Modified: branches/SAMBA_4_0/source/nbt_server/irpc.c === --- branches/SAMBA_4_0/source/nbt_server/irpc.c 2005-10-28 12:08:03 UTC (rev 11372) +++ branches/SAMBA_4_0/source/nbt_server/irpc.c 2005-10-28 13:22:09 UTC (rev 11373) @@ -81,7 +81,8 @@ case NTLOGON_SAM_LOGON: DEBUG(0, ("Huh -- got NTLOGON_SAM_LOGON as reply\n")); break; - case NTLOGON_SAM_LOGON_REPLY: { + case NTLOGON_SAM_LOGON_REPLY: + case NTLOGON_SAM_LOGON_REPLY15: { const char *p = ntlogon.req.reply.server; DEBUG(10, ("NTLOGON_SAM_LOGON_REPLY: server: %s, user: %s, "
svn commit: samba r11374 - in branches/SAMBA_4_0/source/winbind: .
Author: abartlet Date: 2005-10-28 13:42:00 + (Fri, 28 Oct 2005) New Revision: 11374 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11374 Log: On request from VL, put the plaintext auth patch in. I still have some gremlins that get in the my way in testing this. Andrew Bartlett Modified: branches/SAMBA_4_0/source/winbind/wb_pam_auth.c branches/SAMBA_4_0/source/winbind/wb_samba3_cmd.c Changeset: Sorry, the patch is too large (283 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11374
svn commit: samba r11375 - in branches/SAMBA_3_0/source: .
Author: paulg Date: 2005-10-28 16:17:46 + (Fri, 28 Oct 2005) New Revision: 11375 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11375 Log: Update to the latest config.guess and config.sub files. Modified: branches/SAMBA_3_0/source/config.guess branches/SAMBA_3_0/source/config.sub Changeset: Sorry, the patch is too large (1593 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11375
svn commit: samba r11376 - in trunk/source: .
Author: jra Date: 2005-10-28 16:54:18 + (Fri, 28 Oct 2005) New Revision: 11376 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11376 Log: Janitor for paulg - ensure the HEAD versions are updated also. Jeremy. Modified: trunk/source/config.guess trunk/source/config.sub Changeset: Sorry, the patch is too large (1593 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11376
svn commit: samba r11377 - in branches/SAMBA_4_0/source: . auth auth/gensec build/smb_build gtk gtk/common heimdal_build lib lib/samba3 lib/socket_wrapper lib/talloc libcli libnet librpc nsswitch
Author: jelmer Date: 2005-10-28 18:26:26 + (Fri, 28 Oct 2005) New Revision: 11377 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11377 Log: Add support for building LIBRARY elements as shared libraries: - Adds -rpath bin/ so you don't have to install Samba in order to use compiled binaries. - Writes out pkg-config files when building shared libs - Supports automatic fallback to MERGEDOBJ (which is the default) or OBJ_LIST (if ld -r is not supported) Building with shared libs reduces the size of the Samba binaries from 197 Mb to 60 Mb (including libraries) on my system (GCC4, with debugging). To build with shared libraries support enabled, run: LIBRARY_OUTPUT_TYPE=SHARED_LIBRARY ./config.status init functions don't get called correctly yet when using shared libs, so you won't be able to actually run anything with success :-) Once init functions are done, I'll look at support for loading shared modules once again. Based on a patch by Peter Novodvorsky (nidd on IRC). Modified: branches/SAMBA_4_0/source/auth/config.mk branches/SAMBA_4_0/source/auth/gensec/config.mk branches/SAMBA_4_0/source/build/smb_build/config_mk.pm branches/SAMBA_4_0/source/build/smb_build/env.pm branches/SAMBA_4_0/source/build/smb_build/input.pm branches/SAMBA_4_0/source/build/smb_build/main.pl branches/SAMBA_4_0/source/build/smb_build/makefile.pm branches/SAMBA_4_0/source/build/smb_build/output.pm branches/SAMBA_4_0/source/gtk/common/gtk-smb.h branches/SAMBA_4_0/source/gtk/config.mk branches/SAMBA_4_0/source/heimdal_build/config.mk branches/SAMBA_4_0/source/lib/basic.mk branches/SAMBA_4_0/source/lib/samba3/config.mk branches/SAMBA_4_0/source/lib/socket_wrapper/config.mk branches/SAMBA_4_0/source/lib/talloc/config.mk branches/SAMBA_4_0/source/libcli/config.mk branches/SAMBA_4_0/source/libnet/config.mk branches/SAMBA_4_0/source/librpc/config.mk branches/SAMBA_4_0/source/main.mk branches/SAMBA_4_0/source/nsswitch/config.mk Changeset: Sorry, the patch is too large (618 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11377
svn commit: samba r11378 - in branches/SAMBA_4_0/source/lib/ldb/common: .
Author: vlendec Date: 2005-10-28 19:14:46 + (Fri, 28 Oct 2005) New Revision: 11378 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11378 Log: Fix an uninitialized variable warning. Tridge, I'm 99.999% sure this was a simple cut&paste error, but you might recheck this. Volker Modified: branches/SAMBA_4_0/source/lib/ldb/common/attrib_handlers.c Changeset: Modified: branches/SAMBA_4_0/source/lib/ldb/common/attrib_handlers.c === --- branches/SAMBA_4_0/source/lib/ldb/common/attrib_handlers.c 2005-10-28 18:26:26 UTC (rev 11377) +++ branches/SAMBA_4_0/source/lib/ldb/common/attrib_handlers.c 2005-10-28 19:14:46 UTC (rev 11378) @@ -232,7 +232,7 @@ { time_t t1, t2; t1 = ldb_string_to_time((char *)v1->data); - t1 = ldb_string_to_time((char *)v1->data); + t2 = ldb_string_to_time((char *)v2->data); return (int)t2 - (int)t1; }
RE: svn commit: samba r11376 - in trunk/source: .
Ooops. Thanks. Will try not to forget this in the future. PG > -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of [EMAIL PROTECTED] > Sent: Friday, October 28, 2005 12:54 PM > To: [EMAIL PROTECTED] > Subject: svn commit: samba r11376 - in trunk/source: . > > Author: jra > Date: 2005-10-28 16:54:18 + (Fri, 28 Oct 2005) > New Revision: 11376 > > WebSVN: > http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samb > a&rev=11376 > > Log: > Janitor for paulg - ensure the HEAD versions are updated also. > Jeremy. > > Modified: >trunk/source/config.guess >trunk/source/config.sub > > > Changeset: > Sorry, the patch is too large (1593 lines) to include; please > use WebSVN to see it! > WebSVN: > http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samb > a&rev=11376 >
svn commit: samba r11379 - in branches/SAMBA_3_0/source/libsmb: .
Author: jra Date: 2005-10-28 20:36:21 + (Fri, 28 Oct 2005) New Revision: 11379 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11379 Log: Remove external dependencies from sharemodes library. Jeremy. Modified: branches/SAMBA_3_0/source/libsmb/smb_share_modes.c Changeset: Modified: branches/SAMBA_3_0/source/libsmb/smb_share_modes.c === --- branches/SAMBA_3_0/source/libsmb/smb_share_modes.c 2005-10-28 19:14:46 UTC (rev 11378) +++ branches/SAMBA_3_0/source/libsmb/smb_share_modes.c 2005-10-28 20:36:21 UTC (rev 11379) @@ -3,6 +3,12 @@ Used by non-Samba products needing access to the Samba share mode db. Copyright (C) Jeremy Allison 2005. + + sharemodes_procid functions (C) Copyright (C) Volker Lendecke 2005 + + ** NOTE! The following LGPL license applies to this module only. + ** This does NOT imply that all of Samba is released + ** under the LGPL This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -27,6 +33,16 @@ #undef malloc #endif +static BOOL sharemodes_procid_equal(const struct process_id *p1, const struct process_id *p2) +{ + return (p1->pid == p2->pid); +} + +static pid_t sharemodes_procid_to_pid(const struct process_id *proc) +{ + return proc->pid; +} + /* * open/close sharemode database. */ @@ -122,7 +138,7 @@ static int share_mode_entry_equal(const struct smb_share_mode_entry *e_entry, const struct share_mode_entry *entry) { - return (procid_equal(&e_entry->pid, &entry->pid) && + return (sharemodes_procid_equal(&e_entry->pid, &entry->pid) && e_entry->file_id == (uint32_t)entry->share_file_id && e_entry->open_time.tv_sec == entry->time.tv_sec && e_entry->open_time.tv_usec == entry->time.tv_usec && @@ -202,7 +218,7 @@ struct process_id pid = share->pid; /* Check this process really exists. */ - if (kill(procid_to_pid(&pid), 0) == -1 && (errno == ESRCH)) { + if (kill(sharemodes_procid_to_pid(&pid), 0) == -1 && (errno == ESRCH)) { continue; /* No longer exists. */ } @@ -372,7 +388,7 @@ struct process_id pid = share->pid; /* Check this process really exists. */ - if (kill(procid_to_pid(&pid), 0) == -1 && (errno == ESRCH)) { + if (kill(sharemodes_procid_to_pid(&pid), 0) == -1 && (errno == ESRCH)) { continue; /* No longer exists. */ } @@ -447,7 +463,7 @@ struct process_id pid = share->pid; /* Check this process really exists. */ - if (kill(procid_to_pid(&pid), 0) == -1 && (errno == ESRCH)) { + if (kill(sharemodes_procid_to_pid(&pid), 0) == -1 && (errno == ESRCH)) { continue; /* No longer exists. */ }
svn commit: samba r11380 - in trunk/source/libsmb: .
Author: jra Date: 2005-10-28 20:36:27 + (Fri, 28 Oct 2005) New Revision: 11380 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11380 Log: Remove external dependencies from sharemodes library. Jeremy. Modified: trunk/source/libsmb/smb_share_modes.c Changeset: Modified: trunk/source/libsmb/smb_share_modes.c === --- trunk/source/libsmb/smb_share_modes.c 2005-10-28 20:36:21 UTC (rev 11379) +++ trunk/source/libsmb/smb_share_modes.c 2005-10-28 20:36:27 UTC (rev 11380) @@ -3,6 +3,12 @@ Used by non-Samba products needing access to the Samba share mode db. Copyright (C) Jeremy Allison 2005. + + sharemodes_procid functions (C) Copyright (C) Volker Lendecke 2005 + + ** NOTE! The following LGPL license applies to this module only. + ** This does NOT imply that all of Samba is released + ** under the LGPL This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -27,6 +33,16 @@ #undef malloc #endif +static BOOL sharemodes_procid_equal(const struct process_id *p1, const struct process_id *p2) +{ + return (p1->pid == p2->pid); +} + +static pid_t sharemodes_procid_to_pid(const struct process_id *proc) +{ + return proc->pid; +} + /* * open/close sharemode database. */ @@ -122,7 +138,7 @@ static int share_mode_entry_equal(const struct smb_share_mode_entry *e_entry, const struct share_mode_entry *entry) { - return (procid_equal(&e_entry->pid, &entry->pid) && + return (sharemodes_procid_equal(&e_entry->pid, &entry->pid) && e_entry->file_id == (uint32_t)entry->share_file_id && e_entry->open_time.tv_sec == entry->time.tv_sec && e_entry->open_time.tv_usec == entry->time.tv_usec && @@ -202,7 +218,7 @@ struct process_id pid = share->pid; /* Check this process really exists. */ - if (kill(procid_to_pid(&pid), 0) == -1 && (errno == ESRCH)) { + if (kill(sharemodes_procid_to_pid(&pid), 0) == -1 && (errno == ESRCH)) { continue; /* No longer exists. */ } @@ -372,7 +388,7 @@ struct process_id pid = share->pid; /* Check this process really exists. */ - if (kill(procid_to_pid(&pid), 0) == -1 && (errno == ESRCH)) { + if (kill(sharemodes_procid_to_pid(&pid), 0) == -1 && (errno == ESRCH)) { continue; /* No longer exists. */ } @@ -447,7 +463,7 @@ struct process_id pid = share->pid; /* Check this process really exists. */ - if (kill(procid_to_pid(&pid), 0) == -1 && (errno == ESRCH)) { + if (kill(sharemodes_procid_to_pid(&pid), 0) == -1 && (errno == ESRCH)) { continue; /* No longer exists. */ }
svn commit: samba r11381 - branches/SAMBA_3_0/source/nsswitch trunk/source/nsswitch
Author: vlendec Date: 2005-10-28 21:08:31 + (Fri, 28 Oct 2005) New Revision: 11381 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11381 Log: Correctly connect to 445 and 139 after a successful getdcname. Volker Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_cm.c trunk/source/nsswitch/winbindd_cm.c Changeset: Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_cm.c === --- branches/SAMBA_3_0/source/nsswitch/winbindd_cm.c2005-10-28 20:36:27 UTC (rev 11380) +++ branches/SAMBA_3_0/source/nsswitch/winbindd_cm.c2005-10-28 21:08:31 UTC (rev 11381) @@ -766,10 +766,17 @@ result = NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND; if ((strlen(domain->dcname) > 0) && - NT_STATUS_IS_OK(check_negative_conn_cache(domain->name, - domain->dcname))) { + NT_STATUS_IS_OK(check_negative_conn_cache( + domain->name, domain->dcname)) && + (resolve_name(domain->dcname, &domain->dcaddr.sin_addr, + 0x20))) { int dummy; - if (!open_any_socket_out(&domain->dcaddr, 1, 1, + struct sockaddr_in addrs[2]; + addrs[0] = domain->dcaddr; + addrs[0].sin_port = htons(445); + addrs[1] = domain->dcaddr; + addrs[1].sin_port = htons(139); + if (!open_any_socket_out(addrs, 2, 1, &dummy, &fd)) { fd = -1; } Modified: trunk/source/nsswitch/winbindd_cm.c === --- trunk/source/nsswitch/winbindd_cm.c 2005-10-28 20:36:27 UTC (rev 11380) +++ trunk/source/nsswitch/winbindd_cm.c 2005-10-28 21:08:31 UTC (rev 11381) @@ -766,10 +766,17 @@ result = NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND; if ((strlen(domain->dcname) > 0) && - NT_STATUS_IS_OK(check_negative_conn_cache(domain->name, - domain->dcname))) { + NT_STATUS_IS_OK(check_negative_conn_cache( + domain->name, domain->dcname)) && + (resolve_name(domain->dcname, &domain->dcaddr.sin_addr, + 0x20))) { int dummy; - if (!open_any_socket_out(&domain->dcaddr, 1, 1, + struct sockaddr_in addrs[2]; + addrs[0] = domain->dcaddr; + addrs[0].sin_port = htons(445); + addrs[1] = domain->dcaddr; + addrs[1].sin_port = htons(139); + if (!open_any_socket_out(addrs, 2, 1, &dummy, &fd)) { fd = -1; }
svn commit: samba r11382 - in branches/SAMBA_4_0/source: auth/gensec build/m4 build/smb_build gtk gtk/tools heimdal_build kdc lib lib/ldb lib/registry lib/replace/repdir lib/samba3 lib/socket libnet s
Author: jelmer Date: 2005-10-28 21:13:30 + (Fri, 28 Oct 2005) New Revision: 11382 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11382 Log: Require number of required M4 macros Make MODULE handling a bit more like BINARY, LIBRARY and SUBSYSTEM Add some more PUBLIC_HEADERS Modified: branches/SAMBA_4_0/source/auth/gensec/config.m4 branches/SAMBA_4_0/source/auth/gensec/config.mk branches/SAMBA_4_0/source/build/m4/public.m4 branches/SAMBA_4_0/source/build/smb_build/input.pm branches/SAMBA_4_0/source/build/smb_build/main.pl branches/SAMBA_4_0/source/build/smb_build/output.pm branches/SAMBA_4_0/source/gtk/config.m4 branches/SAMBA_4_0/source/gtk/config.mk branches/SAMBA_4_0/source/gtk/tools/gregedit.c branches/SAMBA_4_0/source/heimdal_build/config.m4 branches/SAMBA_4_0/source/kdc/config.m4 branches/SAMBA_4_0/source/lib/basic.mk branches/SAMBA_4_0/source/lib/ldb/config.m4 branches/SAMBA_4_0/source/lib/registry/config.m4 branches/SAMBA_4_0/source/lib/replace/repdir/config.m4 branches/SAMBA_4_0/source/lib/samba3/config.mk branches/SAMBA_4_0/source/lib/socket/config.m4 branches/SAMBA_4_0/source/libnet/config.mk branches/SAMBA_4_0/source/smbd/process_model.m4 Changeset: Sorry, the patch is too large (499 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11382
svn commit: samba r11383 - in branches/SAMBA_3_0/source/lib: .
Author: jra Date: 2005-10-28 22:22:23 + (Fri, 28 Oct 2005) New Revision: 11383 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11383 Log: Patch from Alex Masterov <[EMAIL PROTECTED]> to fix XATTR calls on *BSD systems (bug #3218). Jeremy. Modified: branches/SAMBA_3_0/source/lib/system.c Changeset: Modified: branches/SAMBA_3_0/source/lib/system.c === --- branches/SAMBA_3_0/source/lib/system.c 2005-10-28 21:13:30 UTC (rev 11382) +++ branches/SAMBA_3_0/source/lib/system.c 2005-10-28 22:22:23 UTC (rev 11383) @@ -1367,7 +1367,7 @@ /** Wrappers for extented attribute calls. Based on the Linux package with - support for IRIX also. Expand as other systems have them. + support for IRIX and (Net|Free)BSD also. Expand as other systems have them. / ssize_t sys_getxattr (const char *path, const char *name, void *value, size_t size) @@ -1376,10 +1376,22 @@ return getxattr(path, name, value, size); #elif defined(HAVE_EXTATTR_GET_FILE) char *s; + ssize_t retval; int attrnamespace = (strncmp(name, "system", 6) == 0) ? EXTATTR_NAMESPACE_SYSTEM : EXTATTR_NAMESPACE_USER; const char *attrname = ((s=strchr_m(name, '.')) == NULL) ? name : s + 1; + /* +* The BSD implementation has a nasty habit of silently truncating +* the returned value to the size of the buffer, so we have to check +* that the buffer is large enough to fit the returned value. +*/ + retval = extattr_get_file(path, attrnamespace, attrname, NULL, 0); + if(retval > size) { + errno = ERANGE; + return -1; + } + return extattr_get_file(path, attrnamespace, attrname, value, size); #elif defined(HAVE_ATTR_GET) int retval, flags = 0; @@ -1403,10 +1415,18 @@ return lgetxattr(path, name, value, size); #elif defined(HAVE_EXTATTR_GET_LINK) char *s; + ssize_t retval; int attrnamespace = (strncmp(name, "system", 6) == 0) ? EXTATTR_NAMESPACE_SYSTEM : EXTATTR_NAMESPACE_USER; const char *attrname = ((s=strchr_m(name, '.')) == NULL) ? name : s + 1; + retval = extattr_get_link(path, attrnamespace, attrname, NULL, 0); + + if(retval > size) { + errno = ERANGE; + return -1; + } + return extattr_get_link(path, attrnamespace, attrname, value, size); #elif defined(HAVE_ATTR_GET) int retval, flags = ATTR_DONTFOLLOW; @@ -1430,10 +1450,18 @@ return fgetxattr(filedes, name, value, size); #elif defined(HAVE_EXTATTR_GET_FD) char *s; + ssize_t retval; int attrnamespace = (strncmp(name, "system", 6) == 0) ? EXTATTR_NAMESPACE_SYSTEM : EXTATTR_NAMESPACE_USER; const char *attrname = ((s=strchr_m(name, '.')) == NULL) ? name : s + 1; + retval = extattr_get_fd(filedes, attrnamespace, attrname, NULL, 0); + + if(retval > size) { + errno = ERANGE; + return -1; + } + return extattr_get_fd(filedes, attrnamespace, attrname, value, size); #elif defined(HAVE_ATTR_GETF) int retval, flags = 0; @@ -1747,7 +1775,24 @@ int attrnamespace = (strncmp(name, "system", 6) == 0) ? EXTATTR_NAMESPACE_SYSTEM : EXTATTR_NAMESPACE_USER; const char *attrname = ((s=strchr_m(name, '.')) == NULL) ? name : s + 1; - + if (flags) { + /* Check attribute existence */ + retval = extattr_get_file(path, attrnamespace, attrname, NULL, 0); + if (retval < 0) { + /* REPLACE attribute, that doesn't exist */ + if (flags & XATTR_REPLACE && errno == ENOATTR) { + errno = ENOATTR; + return -1; + } + } + else { + /* CREATE attribute, that already exists */ + if (flags & XATTR_CREATE) { + errno = EEXIST; + return -1; + } + } + } retval = extattr_set_file(path, attrnamespace, attrname, value, size); return (retval < 0) ? -1 : 0; #elif defined(HAVE_ATTR_SET) @@ -1775,6 +1820,24 @@ int attrnamespace = (strncmp(name, "system", 6) == 0) ? EXTATTR_NAMESPACE_SYSTEM : EXTATTR_NAMESPACE_USER; const char *attrname = ((s=strchr_m(name, '.')) == NULL) ? name : s + 1; + if (flags) { + /* Check attribute existence */ + retval = extattr_get_link(path, attrnamespace, attrname, NULL, 0); + if (retval < 0) { +
svn commit: samba r11384 - in trunk/source/lib: .
Author: jra Date: 2005-10-28 22:22:30 + (Fri, 28 Oct 2005) New Revision: 11384 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11384 Log: Patch from Alex Masterov <[EMAIL PROTECTED]> to fix XATTR calls on *BSD systems (bug #3218). Jeremy. Modified: trunk/source/lib/system.c Changeset: Modified: trunk/source/lib/system.c === --- trunk/source/lib/system.c 2005-10-28 22:22:23 UTC (rev 11383) +++ trunk/source/lib/system.c 2005-10-28 22:22:30 UTC (rev 11384) @@ -1367,7 +1367,7 @@ /** Wrappers for extented attribute calls. Based on the Linux package with - support for IRIX also. Expand as other systems have them. + support for IRIX and (Net|Free)BSD also. Expand as other systems have them. / ssize_t sys_getxattr (const char *path, const char *name, void *value, size_t size) @@ -1376,10 +1376,22 @@ return getxattr(path, name, value, size); #elif defined(HAVE_EXTATTR_GET_FILE) char *s; + ssize_t retval; int attrnamespace = (strncmp(name, "system", 6) == 0) ? EXTATTR_NAMESPACE_SYSTEM : EXTATTR_NAMESPACE_USER; const char *attrname = ((s=strchr_m(name, '.')) == NULL) ? name : s + 1; + /* +* The BSD implementation has a nasty habit of silently truncating +* the returned value to the size of the buffer, so we have to check +* that the buffer is large enough to fit the returned value. +*/ + retval = extattr_get_file(path, attrnamespace, attrname, NULL, 0); + if(retval > size) { + errno = ERANGE; + return -1; + } + return extattr_get_file(path, attrnamespace, attrname, value, size); #elif defined(HAVE_ATTR_GET) int retval, flags = 0; @@ -1403,10 +1415,18 @@ return lgetxattr(path, name, value, size); #elif defined(HAVE_EXTATTR_GET_LINK) char *s; + ssize_t retval; int attrnamespace = (strncmp(name, "system", 6) == 0) ? EXTATTR_NAMESPACE_SYSTEM : EXTATTR_NAMESPACE_USER; const char *attrname = ((s=strchr_m(name, '.')) == NULL) ? name : s + 1; + retval = extattr_get_link(path, attrnamespace, attrname, NULL, 0); + + if(retval > size) { + errno = ERANGE; + return -1; + } + return extattr_get_link(path, attrnamespace, attrname, value, size); #elif defined(HAVE_ATTR_GET) int retval, flags = ATTR_DONTFOLLOW; @@ -1430,10 +1450,18 @@ return fgetxattr(filedes, name, value, size); #elif defined(HAVE_EXTATTR_GET_FD) char *s; + ssize_t retval; int attrnamespace = (strncmp(name, "system", 6) == 0) ? EXTATTR_NAMESPACE_SYSTEM : EXTATTR_NAMESPACE_USER; const char *attrname = ((s=strchr_m(name, '.')) == NULL) ? name : s + 1; + retval = extattr_get_fd(filedes, attrnamespace, attrname, NULL, 0); + + if(retval > size) { + errno = ERANGE; + return -1; + } + return extattr_get_fd(filedes, attrnamespace, attrname, value, size); #elif defined(HAVE_ATTR_GETF) int retval, flags = 0; @@ -1747,7 +1775,24 @@ int attrnamespace = (strncmp(name, "system", 6) == 0) ? EXTATTR_NAMESPACE_SYSTEM : EXTATTR_NAMESPACE_USER; const char *attrname = ((s=strchr_m(name, '.')) == NULL) ? name : s + 1; - + if (flags) { + /* Check attribute existence */ + retval = extattr_get_file(path, attrnamespace, attrname, NULL, 0); + if (retval < 0) { + /* REPLACE attribute, that doesn't exist */ + if (flags & XATTR_REPLACE && errno == ENOATTR) { + errno = ENOATTR; + return -1; + } + } + else { + /* CREATE attribute, that already exists */ + if (flags & XATTR_CREATE) { + errno = EEXIST; + return -1; + } + } + } retval = extattr_set_file(path, attrnamespace, attrname, value, size); return (retval < 0) ? -1 : 0; #elif defined(HAVE_ATTR_SET) @@ -1775,6 +1820,24 @@ int attrnamespace = (strncmp(name, "system", 6) == 0) ? EXTATTR_NAMESPACE_SYSTEM : EXTATTR_NAMESPACE_USER; const char *attrname = ((s=strchr_m(name, '.')) == NULL) ? name : s + 1; + if (flags) { + /* Check attribute existence */ + retval = extattr_get_link(path, attrnamespace, attrname, NULL, 0); + if (retval < 0) { + /* REPLACE attribute, that doesn't exist */ +
svn commit: samba r11385 - in branches/SAMBA_4_0/source/lib: .
Author: jelmer Date: 2005-10-28 22:32:22 + (Fri, 28 Oct 2005) New Revision: 11385 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11385 Log: Fix issues in module.c. Calling function should pass in path to directory rather then subsystem name now. Modified: branches/SAMBA_4_0/source/lib/basic.mk branches/SAMBA_4_0/source/lib/module.c Changeset: Modified: branches/SAMBA_4_0/source/lib/basic.mk === --- branches/SAMBA_4_0/source/lib/basic.mk 2005-10-28 22:22:30 UTC (rev 11384) +++ branches/SAMBA_4_0/source/lib/basic.mk 2005-10-28 22:32:22 UTC (rev 11385) @@ -59,9 +59,6 @@ OBJ_FILES = \ gencache.o \ -[SUBSYSTEM::MODULE] -OBJ_FILES = module.o - ## # Start SUBSYSTEM LIBBASIC [SUBSYSTEM::LIBBASIC] @@ -89,7 +86,8 @@ mutex.o \ idtree.o \ db_wrap.o \ - gendb.o + gendb.o \ + module.o REQUIRED_SUBSYSTEMS = \ LIBLDB CHARSET LIBREPLACE LIBNETIF LIBCRYPTO EXT_LIB_DL LIBTALLOC \ SOCKET_WRAPPER CONFIG Modified: branches/SAMBA_4_0/source/lib/module.c === --- branches/SAMBA_4_0/source/lib/module.c 2005-10-28 22:22:30 UTC (rev 11384) +++ branches/SAMBA_4_0/source/lib/module.c 2005-10-28 22:32:22 UTC (rev 11385) @@ -19,7 +19,6 @@ */ #include "includes.h" -#include "dynconfig.h" #include "system/dir.h" static BOOL load_module(TALLOC_CTX *mem_ctx, const char *dir, const char *name) @@ -31,7 +30,7 @@ path = talloc_asprintf(mem_ctx, "%s/%s", dir, name); - handle = dlopen(path, 0); + handle = dlopen(path, RTLD_NOW); if (handle == NULL) { DEBUG(0, ("Unable to open %s: %s\n", path, dlerror())); return False; @@ -56,23 +55,16 @@ return ret; } -BOOL load_modules(const char *subsystem) +BOOL load_modules(const char *path) { DIR *dir; struct dirent *entry; - char *dir_path; BOOL ret; TALLOC_CTX *mem_ctx; mem_ctx = talloc_init(NULL); - dir_path = talloc_asprintf(mem_ctx, "%s/%s", dyn_LIBDIR, subsystem); - if (!dir_path) { - talloc_free(mem_ctx); - return False; - } - - dir = opendir(subsystem); + dir = opendir(path); if (dir == NULL) { talloc_free(mem_ctx); return False; @@ -82,7 +74,7 @@ if (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, "..")) continue; - ret &= load_module(mem_ctx, dir_path, entry->d_name); + ret &= load_module(mem_ctx, path, entry->d_name); } closedir(dir);
svn commit: samba r11386 - in branches/SAMBA_4_0/source: . pidl
Author: jelmer Date: 2005-10-28 22:40:31 + (Fri, 28 Oct 2005) New Revision: 11386 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11386 Log: Add install rule for pidl Modified: branches/SAMBA_4_0/source/main.mk branches/SAMBA_4_0/source/pidl/TODO Changeset: Modified: branches/SAMBA_4_0/source/main.mk === --- branches/SAMBA_4_0/source/main.mk 2005-10-28 22:32:22 UTC (rev 11385) +++ branches/SAMBA_4_0/source/main.mk 2005-10-28 22:40:31 UTC (rev 11386) @@ -75,7 +75,7 @@ -DSWATDIR=\"$(SWATDIR)\" -DPRIVATE_DIR=\"$(PRIVATEDIR)\" install: showlayout installbin installdat installswat installmisc installlib \ - installheader + installheader installpidl # DESTDIR is used here to prevent packagers wasting their time # duplicating the Makefile. Remove it and you will have the privilege @@ -139,6 +139,12 @@ ctags: ctags `find $(srcdir) -name "*.[ch]"` +pidl/Makefile: pidl/Makefile.PL + cd pidl && $(PERL) Makefile.PL + +installpidl: pidl/Makefile + cd pidl && $(MAKE) install + idl_full: pidl/lib/Parse/Pidl/IDL.pm @CPP="$(CPP)" PERL="$(PERL)" script/build_idl.sh FULL $(PIDL_ARGS) Modified: branches/SAMBA_4_0/source/pidl/TODO === --- branches/SAMBA_4_0/source/pidl/TODO 2005-10-28 22:32:22 UTC (rev 11385) +++ branches/SAMBA_4_0/source/pidl/TODO 2005-10-28 22:40:31 UTC (rev 11386) @@ -10,7 +10,7 @@ - auto-alloc [ref] pointers for Samba4 during pull if they were NULL -- better replacement for subcontext() +- replace subcontext() with represent_as() - --explain-ndr option that dumps out parse tree
svn commit: samba r11387 - in branches/SAMBA_4_0/source: .
Author: jelmer Date: 2005-10-28 23:16:27 + (Fri, 28 Oct 2005) New Revision: 11387 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11387 Log: Remove pidl from the default 'install' target as it doesn't obey the user specified install paths. Modified: branches/SAMBA_4_0/source/main.mk Changeset: Modified: branches/SAMBA_4_0/source/main.mk === --- branches/SAMBA_4_0/source/main.mk 2005-10-28 22:40:31 UTC (rev 11386) +++ branches/SAMBA_4_0/source/main.mk 2005-10-28 23:16:27 UTC (rev 11387) @@ -75,7 +75,7 @@ -DSWATDIR=\"$(SWATDIR)\" -DPRIVATE_DIR=\"$(PRIVATEDIR)\" install: showlayout installbin installdat installswat installmisc installlib \ - installheader installpidl + installheader # DESTDIR is used here to prevent packagers wasting their time # duplicating the Makefile. Remove it and you will have the privilege
svn commit: samba r11388 - in branches/SAMBA_4_0/source/build/smb_build: .
Author: jelmer Date: 2005-10-28 23:28:37 + (Fri, 28 Oct 2005) New Revision: 11388 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11388 Log: Move dot-generating to a seperate perl executable Added: branches/SAMBA_4_0/source/build/smb_build/dot.pl Removed: branches/SAMBA_4_0/source/build/smb_build/dot.pm Modified: branches/SAMBA_4_0/source/build/smb_build/main.pl Changeset: Copied: branches/SAMBA_4_0/source/build/smb_build/dot.pl (from rev 11376, branches/SAMBA_4_0/source/build/smb_build/dot.pm) === --- branches/SAMBA_4_0/source/build/smb_build/dot.pm2005-10-28 16:54:18 UTC (rev 11376) +++ branches/SAMBA_4_0/source/build/smb_build/dot.pl2005-10-28 23:28:37 UTC (rev 11388) @@ -0,0 +1,32 @@ +#!/usr/bin/perl +# Samba4 Dependency Graph Generator +# (C) 2004-2005 Jelmer Vernooij <[EMAIL PROTECTED]> +# Published under the GNU GPL + +use strict; +use lib 'build'; +use smb_build::config_mk; + +sub generate($) +{ + my $depend = shift; + my $res = "digraph samba4 {\n"; + + foreach my $part (values %{$depend}) { + foreach my $elem (@{$part->{REQUIRED_SUBSYSTEMS}}) { + $res .= "\t\"$part->{NAME}\" -> \"$elem\";\n"; + } + } + + return $res . "}\n"; +} + +my $INPUT = {}; +smb_build::config_mk::run_config_mk($INPUT, "main.mk"); + +print __FILE__.": creating samba4-deps.dot"; +open DOTTY, ">samba4-deps.dot"; +print DOTTY generate($INPUT); +close DOTTY; + +1; Property changes on: branches/SAMBA_4_0/source/build/smb_build/dot.pl ___ Name: svn:executable + * Deleted: branches/SAMBA_4_0/source/build/smb_build/dot.pm === --- branches/SAMBA_4_0/source/build/smb_build/dot.pm2005-10-28 23:16:27 UTC (rev 11387) +++ branches/SAMBA_4_0/source/build/smb_build/dot.pm2005-10-28 23:28:37 UTC (rev 11388) @@ -1,23 +0,0 @@ -# Samba4 Dependency Graph Generator -# (C) 2004 Jelmer Vernooij <[EMAIL PROTECTED]> -# Published under the GNU GPL - -package dot; -use strict; - -sub generate($) -{ - my $depend = shift; - my $res = "digraph samba4 {\n"; - - foreach my $part (values %{$depend}) { - foreach my $elem (@{$part->{DEPENDENCIES}}) { - next if $part == $elem; - $res .= "\t\"$part->{NAME}\" -> \"$$elem->{NAME}\";\n"; - } - } - - return $res . "}\n"; -} - -1; Modified: branches/SAMBA_4_0/source/build/smb_build/main.pl === --- branches/SAMBA_4_0/source/build/smb_build/main.pl 2005-10-28 23:16:27 UTC (rev 11387) +++ branches/SAMBA_4_0/source/build/smb_build/main.pl 2005-10-28 23:28:37 UTC (rev 11388) @@ -12,7 +12,6 @@ use smb_build::input; use smb_build::config_mk; use smb_build::output; -use smb_build::dot; use smb_build::env; use config; use strict; @@ -72,8 +71,4 @@ $mkenv->write("Makefile"); smb_build_h::create_smb_build_h($OUTPUT, "include/smb_build.h"); -open DOTTY, ">samba4-deps.dot"; -print DOTTY dot::generate($DEPEND); -close DOTTY; - 1;
Build status as of Sat Oct 29 00:00:02 2005
URL: http://build.samba.org/ --- /home/build/master/cache/broken_results.txt.old 2005-10-28 00:00:31.0 + +++ /home/build/master/cache/broken_results.txt 2005-10-29 00:00:32.0 + @@ -1,16 +1,16 @@ -Build status as of Fri Oct 28 00:00:01 2005 +Build status as of Sat Oct 29 00:00:02 2005 Build counts: Tree Total Broken Panic ccache 8 2 0 -distcc 10 2 0 +distcc 9 2 0 lorikeet-heimdal 34 34 0 ppp 17 0 0 rsync36 2 0 samba3 0 0 samba-docs 0 0 0 -samba4 34 25 2 -samba_3_037 6 0 +samba4 34 31 5 +samba_3_037 8 0 smb-build24 2 0 talloc 35 14 0 tdb 35 5 0
svn commit: samba r11389 - in branches/SAMBA_3_0/source/smbd: .
Author: jra Date: 2005-10-29 00:27:16 + (Sat, 29 Oct 2005) New Revision: 11389 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11389 Log: Attempt to fix bug #3212 - ignore bogus OS/2 EA set values on trans2_mkdir/trans2_open/trans2_setfilepathingo. Jeremy. Modified: branches/SAMBA_3_0/source/smbd/trans2.c Changeset: Modified: branches/SAMBA_3_0/source/smbd/trans2.c === --- branches/SAMBA_3_0/source/smbd/trans2.c 2005-10-28 23:28:37 UTC (rev 11388) +++ branches/SAMBA_3_0/source/smbd/trans2.c 2005-10-29 00:27:16 UTC (rev 11389) @@ -804,11 +804,11 @@ } /* Any data in this call is an EA list. */ - if (total_data && !lp_ea_support(SNUM(conn))) { + if (total_data && (total_data != 4) && !lp_ea_support(SNUM(conn))) { return ERROR_NT(NT_STATUS_EAS_NOT_SUPPORTED); } - if (total_data) { + if (total_data != 4) { if (total_data < 10) { return ERROR_NT(NT_STATUS_INVALID_PARAMETER); } @@ -828,6 +828,8 @@ talloc_destroy(ctx); return ERROR_NT(NT_STATUS_INVALID_PARAMETER); } + } else if (IVAL(pdata,0) != 4) { + return ERROR_NT(NT_STATUS_INVALID_PARAMETER); } fsp = open_file_ntcreate(conn,fname,&sbuf, @@ -3736,6 +3738,17 @@ TALLOC_CTX *ctx = NULL; if (total_data < 10) { + + /* OS/2 workplace shell seems to send SET_EA requests of "null" + length. They seem to have no effect. Bug #3212. JRA */ + + if ((total_data == 4) && (IVAL(pdata,0) == 4)) { + /* We're done. We only get EA info in this call. */ + SSVAL(params,0,0); + send_trans2_replies(outbuf, bufsize, params, 2, *ppdata, 0); + return(-1); + } + return ERROR_NT(NT_STATUS_INVALID_PARAMETER); } @@ -4489,11 +4502,17 @@ } /* Any data in this call is an EA list. */ - if (total_data && !lp_ea_support(SNUM(conn))) { + if (total_data && (total_data != 4) && !lp_ea_support(SNUM(conn))) { return ERROR_NT(NT_STATUS_EAS_NOT_SUPPORTED); } - if (total_data) { + /* +* OS/2 workplace shell seems to send SET_EA requests of "null" +* length (4 bytes containing IVAL 4). +* They seem to have no effect. Bug #3212. JRA. +*/ + + if (total_data != 4) { if (total_data < 10) { return ERROR_NT(NT_STATUS_INVALID_PARAMETER); } @@ -4513,6 +4532,8 @@ talloc_destroy(ctx); return ERROR_NT(NT_STATUS_INVALID_PARAMETER); } + } else if (IVAL(pdata,0) != 4) { + return ERROR_NT(NT_STATUS_INVALID_PARAMETER); } if (check_name(directory,conn)) {
svn commit: samba r11390 - in trunk/source/smbd: .
Author: jra Date: 2005-10-29 00:27:17 + (Sat, 29 Oct 2005) New Revision: 11390 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11390 Log: Attempt to fix bug #3212 - ignore bogus OS/2 EA set values on trans2_mkdir/trans2_open/trans2_setfilepathingo. Jeremy. Modified: trunk/source/smbd/trans2.c Changeset: Modified: trunk/source/smbd/trans2.c === --- trunk/source/smbd/trans2.c 2005-10-29 00:27:16 UTC (rev 11389) +++ trunk/source/smbd/trans2.c 2005-10-29 00:27:17 UTC (rev 11390) @@ -804,11 +804,11 @@ } /* Any data in this call is an EA list. */ - if (total_data && !lp_ea_support(SNUM(conn))) { + if (total_data && (total_data != 4) && !lp_ea_support(SNUM(conn))) { return ERROR_NT(NT_STATUS_EAS_NOT_SUPPORTED); } - if (total_data) { + if (total_data != 4) { if (total_data < 10) { return ERROR_NT(NT_STATUS_INVALID_PARAMETER); } @@ -828,6 +828,8 @@ talloc_destroy(ctx); return ERROR_NT(NT_STATUS_INVALID_PARAMETER); } + } else if (IVAL(pdata,0) != 4) { + return ERROR_NT(NT_STATUS_INVALID_PARAMETER); } fsp = open_file_ntcreate(conn,fname,&sbuf, @@ -3736,6 +3738,17 @@ TALLOC_CTX *ctx = NULL; if (total_data < 10) { + + /* OS/2 workplace shell seems to send SET_EA requests of "null" + length. They seem to have no effect. Bug #3212. JRA */ + + if ((total_data == 4) && (IVAL(pdata,0) == 4)) { + /* We're done. We only get EA info in this call. */ + SSVAL(params,0,0); + send_trans2_replies(outbuf, bufsize, params, 2, *ppdata, 0); + return(-1); + } + return ERROR_NT(NT_STATUS_INVALID_PARAMETER); } @@ -4489,11 +4502,17 @@ } /* Any data in this call is an EA list. */ - if (total_data && !lp_ea_support(SNUM(conn))) { + if (total_data && (total_data != 4) && !lp_ea_support(SNUM(conn))) { return ERROR_NT(NT_STATUS_EAS_NOT_SUPPORTED); } - if (total_data) { + /* +* OS/2 workplace shell seems to send SET_EA requests of "null" +* length (4 bytes containing IVAL 4). +* They seem to have no effect. Bug #3212. JRA. +*/ + + if (total_data != 4) { if (total_data < 10) { return ERROR_NT(NT_STATUS_INVALID_PARAMETER); } @@ -4513,6 +4532,8 @@ talloc_destroy(ctx); return ERROR_NT(NT_STATUS_INVALID_PARAMETER); } + } else if (IVAL(pdata,0) != 4) { + return ERROR_NT(NT_STATUS_INVALID_PARAMETER); } if (check_name(directory,conn)) {
svn commit: samba r11391 - in branches/SAMBA_4_0/source: .
Author: jelmer Date: 2005-10-29 00:45:40 + (Sat, 29 Oct 2005) New Revision: 11391 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11391 Log: Add includedir to the list of directories to create Modified: branches/SAMBA_4_0/source/main.mk Changeset: Modified: branches/SAMBA_4_0/source/main.mk === --- branches/SAMBA_4_0/source/main.mk 2005-10-29 00:27:17 UTC (rev 11390) +++ branches/SAMBA_4_0/source/main.mk 2005-10-29 00:45:40 UTC (rev 11391) @@ -86,7 +86,7 @@ # is not used. installdirs: - @$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(PRIVATEDIR) $(DESTDIR)$(PIDDIR) $(DESTDIR)$(LOCKDIR) $(DESTDIR)$(PRIVATEDIR)/tls + @$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(PRIVATEDIR) $(DESTDIR)$(PIDDIR) $(DESTDIR)$(LOCKDIR) $(DESTDIR)$(PRIVATEDIR)/tls $(DESTDIR)$(INCLUDEDIR) installbin: binaries installdirs @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(SBIN_PROGS)