[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via eb55338 Looking into printer driver issues, I ran across some peculiarities in copy_file(): - Firstly, if the source file is zero bytes, NT_STATUS_DISK_FULL is returned. - Secondly, the conditional lseek is confusing. It fires when OPENX_FILE_EXISTS_OPEN is set and I can't see why the lseek is necessary in this case. - Finally, the lseek error path also results in NT_STATUS_DISK_FULL. from efde1d8 s3-utils: Fixed a resource leak in net_afs. http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit eb55338ccdc000feac92118553c5ce59bed87fa8 Author: David Disseldorp Date: Wed Jan 26 14:32:01 2011 -0800 Looking into printer driver issues, I ran across some peculiarities in copy_file(): - Firstly, if the source file is zero bytes, NT_STATUS_DISK_FULL is returned. - Secondly, the conditional lseek is confusing. It fires when OPENX_FILE_EXISTS_OPEN is set and I can't see why the lseek is necessary in this case. - Finally, the lseek error path also results in NT_STATUS_DISK_FULL. Proposed fix for first and third point below. Autobuild-User: Jeremy Allison Autobuild-Date: Thu Jan 27 00:59:56 CET 2011 on sn-devel-104 --- Summary of changes: source3/smbd/reply.c | 19 +++ 1 files changed, 11 insertions(+), 8 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 4d3be85..f7265e0 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -6789,20 +6789,23 @@ NTSTATUS copy_file(TALLOC_CTX *ctx, goto out; } - if ((ofun&3) == 1) { - if(SMB_VFS_LSEEK(fsp2,0,SEEK_END) == -1) { - DEBUG(0,("copy_file: error - vfs lseek returned error %s\n", strerror(errno) )); - /* -* Stop the copy from occurring. -*/ - ret = -1; - smb_fname_src->st.st_ex_size = 0; + if (ofun & OPENX_FILE_EXISTS_OPEN) { + ret = SMB_VFS_LSEEK(fsp2, 0, SEEK_END); + if (ret == -1) { + DEBUG(0, ("error - vfs lseek returned error %s\n", + strerror(errno))); + status = map_nt_error_from_unix(errno); + close_file(NULL, fsp1, ERROR_CLOSE); + close_file(NULL, fsp2, ERROR_CLOSE); + goto out; } } /* Do the actual copy. */ if (smb_fname_src->st.st_ex_size) { ret = vfs_transfer_file(fsp1, fsp2, smb_fname_src->st.st_ex_size); + } else { + ret = 0; } close_file(NULL, fsp1, NORMAL_CLOSE); -- Samba Shared Repository
[SCM] Samba Shared Repository - branch v3-6-test updated
The branch, v3-6-test has been updated via f22ff13 Looking into printer driver issues, I ran across some peculiarities in copy_file(): - Firstly, if the source file is zero bytes, NT_STATUS_DISK_FULL is returned. - Secondly, the conditional lseek is confusing. It fires when OPENX_FILE_EXISTS_OPEN is set and I can't see why the lseek is necessary in this case. - Finally, the lseek error path also results in NT_STATUS_DISK_FULL. from e396ae0 s3-utils: Fixed a resource leak in net_afs. http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test - Log - commit f22ff13a6c46bb716049ff2250b29c670e555052 Author: David Disseldorp Date: Wed Jan 26 14:32:01 2011 -0800 Looking into printer driver issues, I ran across some peculiarities in copy_file(): - Firstly, if the source file is zero bytes, NT_STATUS_DISK_FULL is returned. - Secondly, the conditional lseek is confusing. It fires when OPENX_FILE_EXISTS_OPEN is set and I can't see why the lseek is necessary in this case. - Finally, the lseek error path also results in NT_STATUS_DISK_FULL. Proposed fix for first and third point below. (cherry picked from commit aa3bba8d778862c82e48a7c6f7bd51f5c78c7d90) --- Summary of changes: source3/smbd/reply.c | 19 +++ 1 files changed, 11 insertions(+), 8 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 4d3be85..f7265e0 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -6789,20 +6789,23 @@ NTSTATUS copy_file(TALLOC_CTX *ctx, goto out; } - if ((ofun&3) == 1) { - if(SMB_VFS_LSEEK(fsp2,0,SEEK_END) == -1) { - DEBUG(0,("copy_file: error - vfs lseek returned error %s\n", strerror(errno) )); - /* -* Stop the copy from occurring. -*/ - ret = -1; - smb_fname_src->st.st_ex_size = 0; + if (ofun & OPENX_FILE_EXISTS_OPEN) { + ret = SMB_VFS_LSEEK(fsp2, 0, SEEK_END); + if (ret == -1) { + DEBUG(0, ("error - vfs lseek returned error %s\n", + strerror(errno))); + status = map_nt_error_from_unix(errno); + close_file(NULL, fsp1, ERROR_CLOSE); + close_file(NULL, fsp2, ERROR_CLOSE); + goto out; } } /* Do the actual copy. */ if (smb_fname_src->st.st_ex_size) { ret = vfs_transfer_file(fsp1, fsp2, smb_fname_src->st.st_ex_size); + } else { + ret = 0; } close_file(NULL, fsp1, NORMAL_CLOSE); -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via efde1d8 s3-utils: Fixed a resource leak in net_afs. via 4fc75c7 s3-utils: Fixed a resource leak in smbta-util. via f419c2b s3-utils: Fixed possible resource leak in net_usershare. via de4ef10 s3-utils: Fixed possible resource leak in smbget. via 08dc51d s3-utils: Fixed possible resource leak in smbfilter. via f6f0dac s3-modules: Fixed the for-loop code block. via 2c47368 s3-lib: Fixed a missing return value in tldap. from 278c6f8 errormap: Add unix_to_werror() function http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit efde1d870b6a8c2d5461d9ae6cab5d3f2cbffb83 Author: Andreas Schneider Date: Wed Jan 19 23:15:21 2011 +0100 s3-utils: Fixed a resource leak in net_afs. s3-utils: Fixed a resource leak in net_afs. Autobuild-User: Jeremy Allison Autobuild-Date: Thu Jan 27 00:12:47 CET 2011 on sn-devel-104 commit 4fc75c755d0b20ba4f4e1c42471a0355fd85990d Author: Andreas Schneider Date: Wed Jan 19 23:13:47 2011 +0100 s3-utils: Fixed a resource leak in smbta-util. s3-utils: Fixed a resource leak in smbta-util. commit f419c2b0911788cdd0474bd543ebdbfa52954889 Author: Andreas Schneider Date: Wed Jan 19 23:07:33 2011 +0100 s3-utils: Fixed possible resource leak in net_usershare. s3-utils: Fixed possible resource leak in net_usershare. commit de4ef101c165cf735938f914f7da620daea91762 Author: Andreas Schneider Date: Wed Jan 19 15:18:10 2011 +0100 s3-utils: Fixed possible resource leak in smbget. s3-utils: Fixed possible resource leak in smbget. commit 08dc51d3caabcebf9cc2dc02aac74632831c09b7 Author: Andreas Schneider Date: Wed Jan 19 15:20:34 2011 +0100 s3-utils: Fixed possible resource leak in smbfilter. s3-utils: Fixed possible resource leak in smbfilter. commit f6f0dac4271b2bd1304c2b592c4d2dcbc795afaf Author: Andreas Schneider Date: Wed Jan 19 23:11:32 2011 +0100 s3-modules: Fixed the for-loop code block. s3-modules: Fixed the for-loop code block. commit 2c47368d682ee908e79bc43d5c865049397440e1 Author: Andreas Schneider Date: Wed Jan 19 23:04:13 2011 +0100 s3-lib: Fixed a missing return value in tldap. s3-lib: Fixed a missing return value in tldap. --- Summary of changes: source3/lib/tldap.c |1 + source3/modules/onefs_cbrl.c |1 + source3/utils/net_afs.c |2 ++ source3/utils/net_usershare.c |5 + source3/utils/smbfilter.c |1 + source3/utils/smbget.c|1 + source3/utils/smbta-util.c|1 + 7 files changed, 12 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/lib/tldap.c b/source3/lib/tldap.c index 56cd870..f97dc7c 100644 --- a/source3/lib/tldap.c +++ b/source3/lib/tldap.c @@ -2371,6 +2371,7 @@ void tldap_msg_sctrls(struct tldap_message *msg, int *num_sctrls, if (msg == NULL) { *sctrls = NULL; *num_sctrls = 0; + return; } *sctrls = msg->res_sctrls; *num_sctrls = talloc_array_length(msg->res_sctrls); diff --git a/source3/modules/onefs_cbrl.c b/source3/modules/onefs_cbrl.c index 33f35a7..203710e 100644 --- a/source3/modules/onefs_cbrl.c +++ b/source3/modules/onefs_cbrl.c @@ -128,6 +128,7 @@ static struct blocking_lock_record *onefs_cbrl_find_blr(uint64_t id) onefs_cbrl_blr_state_str(blr))); break; } + } } else { for (blr = sconn->smb1.locks.blocking_lock_queue; blr; blr = blr->next) { bs = (struct onefs_cbrl_blr_state *)blr->blr_private; diff --git a/source3/utils/net_afs.c b/source3/utils/net_afs.c index 26259c1..f6b2b2d 100644 --- a/source3/utils/net_afs.c +++ b/source3/utils/net_afs.c @@ -51,8 +51,10 @@ int net_afs_key(struct net_context *c, int argc, const char **argv) if (read(fd, &keyfile, sizeof(keyfile)) != sizeof(keyfile)) { d_fprintf(stderr, _("Could not read keyfile\n")); + close(fd); return -1; } + close(fd); if (!secrets_store_afs_keyfile(argv[1], &keyfile)) { d_fprintf(stderr, _("Could not write keyfile to secrets.tdb\n")); diff --git a/source3/utils/net_usershare.c b/source3/utils/net_usershare.c index 61b2caa..f0ee682 100644 --- a/source3/utils/net_usershare.c +++ b/source3/utils/net_usershare.c @@ -907,6 +907,7 @@ static int net_usershare_add(struct net_context *c, int argc, const char **argv) _("net usershare add: cannot lstat tmp file %s\n"), full_path_tmp ); TALLOC_FREE(ctx); + close(tmpfd);
[SCM] Samba Shared Repository - branch v3-6-test updated
The branch, v3-6-test has been updated via e396ae0 s3-utils: Fixed a resource leak in net_afs. via 948ceb0 s3-utils: Fixed a resource leak in smbta-util. via 702549a s3-utils: Fixed possible resource leak in net_usershare. via 096679c s3-utils: Fixed possible resource leak in smbget. via 6b3d0d8 s3-utils: Fixed possible resource leak in smbfilter. via 22b0b80 s3-modules: Fixed the for-loop code block. via 7e7d283 s3-lib: Fixed a missing return value in tldap. via 795516f errormap: Add unix_to_werror() function from 7bc0737 Allow "security = share" with SMB2. We already handle this in smb2/smb2_server.c (cherry picked from commit de53c1e30ddbc640fd0755cf38a40e9e0acac309) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test - Log - commit e396ae005e36e2af8b1d8c22a8295b6be1e49521 Author: Andreas Schneider Date: Wed Jan 19 23:15:21 2011 +0100 s3-utils: Fixed a resource leak in net_afs. s3-utils: Fixed a resource leak in net_afs. (cherry picked from commit 92f8a5747bf74adedc97ea3a63819d6e58f010c3) commit 948ceb0dcf10578a8276ad75778384ae755c2f4c Author: Andreas Schneider Date: Wed Jan 19 23:13:47 2011 +0100 s3-utils: Fixed a resource leak in smbta-util. s3-utils: Fixed a resource leak in smbta-util. (cherry picked from commit 4fc75c755d0b20ba4f4e1c42471a0355fd85990d) commit 702549a4ec668a51ec4cea5096ef6af493e50aed Author: Andreas Schneider Date: Wed Jan 19 23:07:33 2011 +0100 s3-utils: Fixed possible resource leak in net_usershare. s3-utils: Fixed possible resource leak in net_usershare. (cherry picked from commit f419c2b0911788cdd0474bd543ebdbfa52954889) commit 096679cff55808a1484d627ee3e0c8a25a169a24 Author: Andreas Schneider Date: Wed Jan 19 15:18:10 2011 +0100 s3-utils: Fixed possible resource leak in smbget. s3-utils: Fixed possible resource leak in smbget. (cherry picked from commit de4ef101c165cf735938f914f7da620daea91762) commit 6b3d0d8f3524f35240624e17eff68cbf6d248f34 Author: Andreas Schneider Date: Wed Jan 19 15:20:34 2011 +0100 s3-utils: Fixed possible resource leak in smbfilter. s3-utils: Fixed possible resource leak in smbfilter. (cherry picked from commit 08dc51d3caabcebf9cc2dc02aac74632831c09b7) commit 22b0b8069d7b1e1900ef3be60a8e4734a88eeefb Author: Andreas Schneider Date: Wed Jan 19 23:11:32 2011 +0100 s3-modules: Fixed the for-loop code block. s3-modules: Fixed the for-loop code block. (cherry picked from commit f6f0dac4271b2bd1304c2b592c4d2dcbc795afaf) commit 7e7d28369eabfca59ab21f1541c78f9fd76a66be Author: Andreas Schneider Date: Wed Jan 19 23:04:13 2011 +0100 s3-lib: Fixed a missing return value in tldap. s3-lib: Fixed a missing return value in tldap. (cherry picked from commit 2c47368d682ee908e79bc43d5c865049397440e1) commit 795516f550e84f60e956b2673093017849eb985d Author: Kai Blin Date: Wed Jan 26 22:17:43 2011 +0100 errormap: Add unix_to_werror() function While this function technically is closest to the map_nt_status_from_unix() function, I think it is better to keep the new function in line with our usual fooerror_to_barerror() naming scheme. Signed-off-by: Kai Blin Autobuild-User: Kai Blin Autobuild-Date: Wed Jan 26 23:07:24 CET 2011 on sn-devel-104 (cherry picked from commit 278c6f8fc538ad8ee069f0682229fad34abb3513) --- Summary of changes: libcli/util/error.h|5 + source3/lib/errmap_unix.c |6 ++ source3/lib/tldap.c|1 + source3/modules/onefs_cbrl.c |1 + source3/utils/net_afs.c|2 ++ source3/utils/net_usershare.c |5 + source3/utils/smbfilter.c |1 + source3/utils/smbget.c |1 + source3/utils/smbta-util.c |1 + source4/libcli/util/errormap.c |6 ++ 10 files changed, 29 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/libcli/util/error.h b/libcli/util/error.h index 5a7cc1b..77a2f5a 100644 --- a/libcli/util/error.h +++ b/libcli/util/error.h @@ -46,4 +46,9 @@ WERROR ntstatus_to_werror(NTSTATUS error); */ NTSTATUS map_nt_error_from_unix(int unix_error); +/* +convert a Unix error code to a WERROR +*/ +WERROR unix_to_werror(int unix_error); + #endif /* _SAMBA_ERROR_H */ diff --git a/source3/lib/errmap_unix.c b/source3/lib/errmap_unix.c index 91a620e..b4a98f9 100644 --- a/source3/lib/errmap_unix.c +++ b/source3/lib/errmap_unix.c @@ -141,6 +141,12 @@ NTSTATUS map_nt_error_from_unix(int unix_error) return NT_STATUS_ACCESS
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 278c6f8 errormap: Add unix_to_werror() function from 67e578a Allow "security = share" with SMB2. We already handle this in smb2/smb2_server.c http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 278c6f8fc538ad8ee069f0682229fad34abb3513 Author: Kai Blin Date: Wed Jan 26 22:17:43 2011 +0100 errormap: Add unix_to_werror() function While this function technically is closest to the map_nt_status_from_unix() function, I think it is better to keep the new function in line with our usual fooerror_to_barerror() naming scheme. Signed-off-by: Kai Blin Autobuild-User: Kai Blin Autobuild-Date: Wed Jan 26 23:07:24 CET 2011 on sn-devel-104 --- Summary of changes: libcli/util/error.h|5 + source3/lib/errmap_unix.c |6 ++ source4/libcli/util/errormap.c |6 ++ 3 files changed, 17 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/libcli/util/error.h b/libcli/util/error.h index 5a7cc1b..77a2f5a 100644 --- a/libcli/util/error.h +++ b/libcli/util/error.h @@ -46,4 +46,9 @@ WERROR ntstatus_to_werror(NTSTATUS error); */ NTSTATUS map_nt_error_from_unix(int unix_error); +/* +convert a Unix error code to a WERROR +*/ +WERROR unix_to_werror(int unix_error); + #endif /* _SAMBA_ERROR_H */ diff --git a/source3/lib/errmap_unix.c b/source3/lib/errmap_unix.c index 91a620e..b4a98f9 100644 --- a/source3/lib/errmap_unix.c +++ b/source3/lib/errmap_unix.c @@ -141,6 +141,12 @@ NTSTATUS map_nt_error_from_unix(int unix_error) return NT_STATUS_ACCESS_DENIED; } +/* Convert a Unix error code to a WERROR. */ +WERROR unix_to_werror(int unix_error) +{ + return ntstatus_to_werror(map_nt_error_from_unix(unix_error)); +} + /* Return a UNIX errno from a NT status code */ static const struct { NTSTATUS status; diff --git a/source4/libcli/util/errormap.c b/source4/libcli/util/errormap.c index 8fcf60b..29f2331 100644 --- a/source4/libcli/util/errormap.c +++ b/source4/libcli/util/errormap.c @@ -1383,6 +1383,12 @@ NTSTATUS map_nt_error_from_unix(int unix_error) return NT_STATUS_UNSUCCESSFUL; } +/* Convert a Unix error code to WERROR */ +WERROR unix_to_werror(int unix_error) +{ + return ntstatus_to_werror(map_nt_error_from_unix(unix_error)); +} + NTSTATUS ndr_map_error2ntstatus(enum ndr_err_code ndr_err) { switch (ndr_err) { -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 67e578a Allow "security = share" with SMB2. We already handle this in smb2/smb2_server.c from bb358ec From Metze - make sure we're using the same string length for the hash. http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 67e578ab5aa604cc409480479c2f2b3bc9a969da Author: Jeremy Allison Date: Wed Jan 26 10:50:44 2011 -0800 Allow "security = share" with SMB2. We already handle this in smb2/smb2_server.c Autobuild-User: Jeremy Allison Autobuild-Date: Wed Jan 26 20:37:29 CET 2011 on sn-devel-104 --- Summary of changes: source3/smbd/process.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 4a93e7f..12ea28a 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -2915,7 +2915,6 @@ void smbd_process(struct smbd_server_connection *sconn) int ret; if (lp_maxprotocol() == PROTOCOL_SMB2 && - lp_security() != SEC_SHARE && !lp_async_smb_echo_handler()) { /* * We're not making the desion here, -- Samba Shared Repository
[SCM] Samba Shared Repository - branch v3-6-test updated
The branch, v3-6-test has been updated via 7bc0737 Allow "security = share" with SMB2. We already handle this in smb2/smb2_server.c (cherry picked from commit de53c1e30ddbc640fd0755cf38a40e9e0acac309) from fd74ee5 pidl:Typelist: fix perl warnings about recursiv function calls http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test - Log - commit 7bc073743c9c9d892ab00ed236af3ab8c074e75d Author: Jeremy Allison Date: Wed Jan 26 10:50:44 2011 -0800 Allow "security = share" with SMB2. We already handle this in smb2/smb2_server.c (cherry picked from commit de53c1e30ddbc640fd0755cf38a40e9e0acac309) --- Summary of changes: source3/smbd/process.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 4a93e7f..12ea28a 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -2915,7 +2915,6 @@ void smbd_process(struct smbd_server_connection *sconn) int ret; if (lp_maxprotocol() == PROTOCOL_SMB2 && - lp_security() != SEC_SHARE && !lp_async_smb_echo_handler()) { /* * We're not making the desion here, -- Samba Shared Repository
Re: file_name_hash vs. smb_name_hash
On Wed, Jan 26, 2011 at 10:07:21AM +0100, Stefan (metze) Metzmacher wrote: > > These function don't calculate the same hash! > string_term_tdb_data() uses strlen()+1. Fixed in master and v3-6-test - thanks !
[SCM] Samba Shared Repository - branch v3-6-test updated
The branch, v3-6-test has been updated via fd74ee5 pidl:Typelist: fix perl warnings about recursiv function calls via c10a24d pidl:Samba3/ServerNDR: correctly initialise ndr_push struct via b271a9f From Metze - make sure we're using the same string length for the hash. (cherry picked from commit 30065ac02e825bd0202294202069a0bc890cbdf1) from 7819c94 s3-winbind: share a common winbind_samlogon_retry_loop(). http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test - Log - commit fd74ee5f3e480407cd543d547cdf441a6641a853 Author: Stefan Metzmacher Date: Wed Jan 26 08:48:34 2011 +0100 pidl:Typelist: fix perl warnings about recursiv function calls metze Autobuild-User: Stefan Metzmacher Autobuild-Date: Wed Jan 26 10:59:04 CET 2011 on sn-devel-104 (cherry picked from commit 34664338f3c0bd9acbb2ada3d92d482e30cbdf1c) commit c10a24dc199963b9ca726c735266582dd46d287c Author: Stefan Metzmacher Date: Tue Jan 25 19:46:18 2011 +0100 pidl:Samba3/ServerNDR: correctly initialise ndr_push struct We need to copy the ptr_count from the ndr_pull struct to the ndr_push struct, otherwise we'll reuse full pointer ids, which will cause the client to fail in the ndr unmarshalling. metze (cherry picked from commit 4b068bb91994a0fc3a76abd45bff4e2fe53e9a34) commit b271a9fdfcc4b5c465fd644f211658f07a8bad21 Author: Jeremy Allison Date: Wed Jan 26 08:43:43 2011 -0800 From Metze - make sure we're using the same string length for the hash. (cherry picked from commit 30065ac02e825bd0202294202069a0bc890cbdf1) --- Summary of changes: pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm |6 ++ pidl/lib/Parse/Pidl/Typelist.pm |1 + source3/libsmb/smb_share_modes.c|2 +- 3 files changed, 8 insertions(+), 1 deletions(-) Changeset truncated at 500 lines: diff --git a/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm b/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm index 0ebccf5..64a4ec5 100644 --- a/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm +++ b/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm @@ -199,6 +199,12 @@ sub ParseFunction($$) pidl "\treturn false;"; pidl "}"; pidl ""; + pidl "/*"; + pidl " * carry over the pointer count to the reply in case we are"; + pidl " * using full pointer. See NDR specification for full pointers"; + pidl " */"; + pidl "push->ptr_count = pull->ptr_count;"; + pidl ""; pidl "ndr_err = call->ndr_push(push, NDR_OUT, r);"; pidl "if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {"; pidl "\ttalloc_free(r);"; diff --git a/pidl/lib/Parse/Pidl/Typelist.pm b/pidl/lib/Parse/Pidl/Typelist.pm index 4733f91..a89b1a7 100644 --- a/pidl/lib/Parse/Pidl/Typelist.pm +++ b/pidl/lib/Parse/Pidl/Typelist.pm @@ -128,6 +128,7 @@ sub getType($) return $types{$t}; } +sub typeIs($$); sub typeIs($$) { my ($t,$tt) = @_; diff --git a/source3/libsmb/smb_share_modes.c b/source3/libsmb/smb_share_modes.c index 9392349..fd5f0ea 100644 --- a/source3/libsmb/smb_share_modes.c +++ b/source3/libsmb/smb_share_modes.c @@ -277,7 +277,7 @@ static uint32_t smb_name_hash(const char *sharepath, const char *filename, int * return 0; } key.dptr = (uint8_t *)fullpath; - key.dsize = strlen(fullpath); + key.dsize = strlen(fullpath) + 1; name_hash = tdb_jenkins_hash(&key); free(fullpath); return name_hash; -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via bb358ec From Metze - make sure we're using the same string length for the hash. from abb7c07 s3-winbind: share a common winbind_samlogon_retry_loop(). http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit bb358ecd5aade909b892f002d498d4cb7b23789a Author: Jeremy Allison Date: Wed Jan 26 08:43:43 2011 -0800 From Metze - make sure we're using the same string length for the hash. Autobuild-User: Jeremy Allison Autobuild-Date: Wed Jan 26 18:32:15 CET 2011 on sn-devel-104 --- Summary of changes: source3/libsmb/smb_share_modes.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/libsmb/smb_share_modes.c b/source3/libsmb/smb_share_modes.c index 9392349..fd5f0ea 100644 --- a/source3/libsmb/smb_share_modes.c +++ b/source3/libsmb/smb_share_modes.c @@ -277,7 +277,7 @@ static uint32_t smb_name_hash(const char *sharepath, const char *filename, int * return 0; } key.dptr = (uint8_t *)fullpath; - key.dsize = strlen(fullpath); + key.dsize = strlen(fullpath) + 1; name_hash = tdb_jenkins_hash(&key); free(fullpath); return name_hash; -- Samba Shared Repository
Re: file_name_hash vs. smb_name_hash
On Wed, Jan 26, 2011 at 10:07:21AM +0100, Stefan (metze) Metzmacher wrote: > Hi Jeremy, > > > The branch, master has been updated > >via 3272e16 Missed one debug printf of name_hash. Ensure always use > > %x. > >via 4473273 Fix bug #7863 - Unlink may unlink wrong file when > > hardlinks are involved. > >via a65bce4 Add uint32_t name_hash argument (currently unused) to > > get_file_infos(). > >via b97f1ce Add name_hash into the share mode entry struct (as yet > > only use for renames to identify a specific path). > >via 76418e2 Add name_hash to files_struct. Set within > > fsp_set_smb_fname(). > > from 6e22637 s4-test/delete_object: Remove global ldb connections > > > > http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master > > > +static uint32_t smb_name_hash(const char *sharepath, const char *filename, > > int *err) > > +{ > > + TDB_DATA key; > > + char *fullpath = NULL; > > + int ret; > > + uint32_t name_hash; > > + > > + *err = 0; > > + ret = asprintf(&fullpath, "%s/%s", sharepath, filename); > > + if (ret == -1 || fullpath == NULL) { > > + *err = 1; > > + return 0; > > + } > > + key.dptr = (uint8_t *)fullpath; > > + key.dsize = strlen(fullpath); > > + name_hash = tdb_jenkins_hash(&key); > > + free(fullpath); > > + return name_hash; > > +} > > + > > > +NTSTATUS file_name_hash(connection_struct *conn, > > + const char *name, uint32_t *p_name_hash) > > +{ > > + TDB_DATA key; > > + char *fullpath = NULL; > > + > > + /* Set the hash of the full pathname. */ > > + fullpath = talloc_asprintf(talloc_tos(), > > + "%s/%s", > > + conn->connectpath, > > + name); > > + if (!fullpath) { > > + return NT_STATUS_NO_MEMORY; > > + } > > + key = string_term_tdb_data(fullpath); > > + *p_name_hash = tdb_jenkins_hash(&key); > > + > > + DEBUG(10,("file_name_hash: %s hash 0x%x\n", > > + fullpath, > > + (unsigned int)*p_name_hash )); > > + > > + TALLOC_FREE(fullpath); > > + return NT_STATUS_OK; > > +} > > These function don't calculate the same hash! > string_term_tdb_data() uses strlen()+1. Got it - thanks ! I'll fix asap ! Jeremy
[SCM] Samba Shared Repository - branch v3-6-test updated
The branch, v3-6-test has been updated via 7819c94 s3-winbind: share a common winbind_samlogon_retry_loop(). via 47ef6e4 Revert "s3: These assignments are overwritten immediately" via c43b6c3 Revert "s3-winbind: fix winbindd_dual_pam_auth_samlogon() for NT4 domains." from 21ebf5f Missed one debug printf of name_hash. Ensure always use %x. (cherry picked from commit 9e67184d0f5cc151091faa8e5db24d5569a3fead) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test - Log - commit 7819c94193c314d891fae58ae01a28b2b53ee223 Author: Günther Deschner Date: Mon Jan 24 20:52:24 2011 +0100 s3-winbind: share a common winbind_samlogon_retry_loop(). Guenther Autobuild-User: Günther Deschner Autobuild-Date: Wed Jan 26 12:41:14 CET 2011 on sn-devel-104 (cherry picked from commit abb7c07de5d07d5378dafbfdf0d0213a2b0e0b05) commit 47ef6e44c119da378d3113e16d6be07e1e3a2fdb Author: Günther Deschner Date: Mon Jan 24 20:45:35 2011 +0100 Revert "s3: These assignments are overwritten immediately" This reverts commit 18962ea3852d0d0fc7371e99813bebd54fae0a19. (cherry picked from commit 035a0d2fb36af2be655a19103bc3e01e036375a4) commit c43b6c3af6957f78bee4f6629aca05501c920a9f Author: Günther Deschner Date: Mon Jan 24 20:43:56 2011 +0100 Revert "s3-winbind: fix winbindd_dual_pam_auth_samlogon() for NT4 domains." This reverts commit cea36aeacf8778493463f31e6afc3f58384639e2. (cherry picked from commit 36cfa1792ed1d13268de792cb4df20d6743d1e55) --- Summary of changes: source3/winbindd/winbindd_pam.c | 312 ++- 1 files changed, 147 insertions(+), 165 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c index 0c0250e..bd3adc0 100644 --- a/source3/winbindd/winbindd_pam.c +++ b/source3/winbindd/winbindd_pam.c @@ -1123,31 +1123,135 @@ static NTSTATUS winbindd_dual_auth_passdb(TALLOC_CTX *mem_ctx, return status; } -typedefNTSTATUS (*netlogon_fn_t)(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32 logon_parameters, - const char *server, - const char *username, - const char *domain, - const char *workstation, - const uint8 chal[8], - DATA_BLOB lm_response, - DATA_BLOB nt_response, - struct netr_SamInfo3 **info3); +static NTSTATUS winbind_samlogon_retry_loop(struct winbindd_domain *domain, + TALLOC_CTX *mem_ctx, + uint32_t logon_parameters, + const char *server, + const char *username, + const char *domainname, + const char *workstation, + const uint8_t chal[8], + DATA_BLOB lm_response, + DATA_BLOB nt_response, + struct netr_SamInfo3 **info3) +{ + int attempts = 0; + bool retry = false; + NTSTATUS result; + + do { + struct rpc_pipe_client *netlogon_pipe; + + ZERO_STRUCTP(info3); + retry = false; + + result = cm_connect_netlogon(domain, &netlogon_pipe); + + if (!NT_STATUS_IS_OK(result)) { + DEBUG(3,("could not open handle to NETLOGON pipe (error: %s)\n", + nt_errstr(result))); + return result; + } + + /* It is really important to try SamLogonEx here, +* because in a clustered environment, we want to use +* one machine account from multiple physical +* computers. +* +* With a normal SamLogon call, we must keep the +* credentials chain updated and intact between all +* users of the machine account (which would imply +* cross-node communication for every NTLM logon). +* +* (The credentials chain is not per NETLOGON pipe +* connection, but globally on the server/client pair +* by machine name). +* +* When using SamLogonEx, the credentials are not +* supplied, but the session key is implied by the +
[SCM] Samba Website Repository - branch master updated
The branch, master has been updated via d8b1eb6 Added entry for BRLink - Brazil. from 6327ca0 Announce Samba 3.4.11. http://gitweb.samba.org/?p=samba-web.git;a=shortlog;h=master - Log - commit d8b1eb68bd47f6772e8a499933d29878d91eea0d Author: John H Terpstra Date: Wed Jan 26 06:36:52 2011 -0600 Added entry for BRLink - Brazil. --- Summary of changes: support/brazil.html | 16 1 files changed, 16 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/support/brazil.html b/support/brazil.html index 2c452b6..46765f4 100644 --- a/support/brazil.html +++ b/support/brazil.html @@ -5,6 +5,22 @@ Commercial Support - BRAZIL + + +BRLink + +BRLink â Solucoes em TI +Praca Barao de Anhambai, +04 â Sao Paulo â SP â Brazil + +http://www.brlink.com.br";>http://www.brlink.com.br ++55 11 2068-6199 +mailto:cont...@brlink.com.br";>cont...@brlink.com.br + + +Brazilian company with more than 10 years experience, working with Samba projects and consulting. Professionals with LPIC3 Samba certification and a lot of experience with high availability projects with Samba, including LDAP, CTDB and Cluster. + + -- Samba Website Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via abb7c07 s3-winbind: share a common winbind_samlogon_retry_loop(). via 035a0d2 Revert "s3: These assignments are overwritten immediately" via 36cfa17 Revert "s3-winbind: fix winbindd_dual_pam_auth_samlogon() for NT4 domains." from 3466433 pidl:Typelist: fix perl warnings about recursiv function calls http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit abb7c07de5d07d5378dafbfdf0d0213a2b0e0b05 Author: Günther Deschner Date: Mon Jan 24 20:52:24 2011 +0100 s3-winbind: share a common winbind_samlogon_retry_loop(). Guenther Autobuild-User: Günther Deschner Autobuild-Date: Wed Jan 26 12:41:14 CET 2011 on sn-devel-104 commit 035a0d2fb36af2be655a19103bc3e01e036375a4 Author: Günther Deschner Date: Mon Jan 24 20:45:35 2011 +0100 Revert "s3: These assignments are overwritten immediately" This reverts commit 18962ea3852d0d0fc7371e99813bebd54fae0a19. commit 36cfa1792ed1d13268de792cb4df20d6743d1e55 Author: Günther Deschner Date: Mon Jan 24 20:43:56 2011 +0100 Revert "s3-winbind: fix winbindd_dual_pam_auth_samlogon() for NT4 domains." This reverts commit cea36aeacf8778493463f31e6afc3f58384639e2. --- Summary of changes: source3/winbindd/winbindd_pam.c | 312 ++- 1 files changed, 147 insertions(+), 165 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c index 0c0250e..bd3adc0 100644 --- a/source3/winbindd/winbindd_pam.c +++ b/source3/winbindd/winbindd_pam.c @@ -1123,31 +1123,135 @@ static NTSTATUS winbindd_dual_auth_passdb(TALLOC_CTX *mem_ctx, return status; } -typedefNTSTATUS (*netlogon_fn_t)(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - uint32 logon_parameters, - const char *server, - const char *username, - const char *domain, - const char *workstation, - const uint8 chal[8], - DATA_BLOB lm_response, - DATA_BLOB nt_response, - struct netr_SamInfo3 **info3); +static NTSTATUS winbind_samlogon_retry_loop(struct winbindd_domain *domain, + TALLOC_CTX *mem_ctx, + uint32_t logon_parameters, + const char *server, + const char *username, + const char *domainname, + const char *workstation, + const uint8_t chal[8], + DATA_BLOB lm_response, + DATA_BLOB nt_response, + struct netr_SamInfo3 **info3) +{ + int attempts = 0; + bool retry = false; + NTSTATUS result; + + do { + struct rpc_pipe_client *netlogon_pipe; + + ZERO_STRUCTP(info3); + retry = false; + + result = cm_connect_netlogon(domain, &netlogon_pipe); + + if (!NT_STATUS_IS_OK(result)) { + DEBUG(3,("could not open handle to NETLOGON pipe (error: %s)\n", + nt_errstr(result))); + return result; + } + + /* It is really important to try SamLogonEx here, +* because in a clustered environment, we want to use +* one machine account from multiple physical +* computers. +* +* With a normal SamLogon call, we must keep the +* credentials chain updated and intact between all +* users of the machine account (which would imply +* cross-node communication for every NTLM logon). +* +* (The credentials chain is not per NETLOGON pipe +* connection, but globally on the server/client pair +* by machine name). +* +* When using SamLogonEx, the credentials are not +* supplied, but the session key is implied by the +* wrapping SamLogon context. +* +* -- abartlet 21 April 2008 +*/ + + if (domain->can_do_samlogon_ex) { + result = rpccli_netlogon_sam_network_logon_ex( + netlogo
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 3466433 pidl:Typelist: fix perl warnings about recursiv function calls via 4b068bb pidl:Samba3/ServerNDR: correctly initialise ndr_push struct from 3272e16 Missed one debug printf of name_hash. Ensure always use %x. http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 34664338f3c0bd9acbb2ada3d92d482e30cbdf1c Author: Stefan Metzmacher Date: Wed Jan 26 08:48:34 2011 +0100 pidl:Typelist: fix perl warnings about recursiv function calls metze Autobuild-User: Stefan Metzmacher Autobuild-Date: Wed Jan 26 10:59:04 CET 2011 on sn-devel-104 commit 4b068bb91994a0fc3a76abd45bff4e2fe53e9a34 Author: Stefan Metzmacher Date: Tue Jan 25 19:46:18 2011 +0100 pidl:Samba3/ServerNDR: correctly initialise ndr_push struct We need to copy the ptr_count from the ndr_pull struct to the ndr_push struct, otherwise we'll reuse full pointer ids, which will cause the client to fail in the ndr unmarshalling. metze --- Summary of changes: pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm |6 ++ pidl/lib/Parse/Pidl/Typelist.pm |1 + 2 files changed, 7 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm b/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm index 0ebccf5..64a4ec5 100644 --- a/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm +++ b/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm @@ -199,6 +199,12 @@ sub ParseFunction($$) pidl "\treturn false;"; pidl "}"; pidl ""; + pidl "/*"; + pidl " * carry over the pointer count to the reply in case we are"; + pidl " * using full pointer. See NDR specification for full pointers"; + pidl " */"; + pidl "push->ptr_count = pull->ptr_count;"; + pidl ""; pidl "ndr_err = call->ndr_push(push, NDR_OUT, r);"; pidl "if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {"; pidl "\ttalloc_free(r);"; diff --git a/pidl/lib/Parse/Pidl/Typelist.pm b/pidl/lib/Parse/Pidl/Typelist.pm index 4733f91..a89b1a7 100644 --- a/pidl/lib/Parse/Pidl/Typelist.pm +++ b/pidl/lib/Parse/Pidl/Typelist.pm @@ -128,6 +128,7 @@ sub getType($) return $types{$t}; } +sub typeIs($$); sub typeIs($$) { my ($t,$tt) = @_; -- Samba Shared Repository
file_name_hash vs. smb_name_hash
Hi Jeremy, > The branch, master has been updated >via 3272e16 Missed one debug printf of name_hash. Ensure always use > %x. >via 4473273 Fix bug #7863 - Unlink may unlink wrong file when > hardlinks are involved. >via a65bce4 Add uint32_t name_hash argument (currently unused) to > get_file_infos(). >via b97f1ce Add name_hash into the share mode entry struct (as yet > only use for renames to identify a specific path). >via 76418e2 Add name_hash to files_struct. Set within > fsp_set_smb_fname(). > from 6e22637 s4-test/delete_object: Remove global ldb connections > > http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master > +static uint32_t smb_name_hash(const char *sharepath, const char *filename, > int *err) > +{ > + TDB_DATA key; > + char *fullpath = NULL; > + int ret; > + uint32_t name_hash; > + > + *err = 0; > + ret = asprintf(&fullpath, "%s/%s", sharepath, filename); > + if (ret == -1 || fullpath == NULL) { > + *err = 1; > + return 0; > + } > + key.dptr = (uint8_t *)fullpath; > + key.dsize = strlen(fullpath); > + name_hash = tdb_jenkins_hash(&key); > + free(fullpath); > + return name_hash; > +} > + > +NTSTATUS file_name_hash(connection_struct *conn, > + const char *name, uint32_t *p_name_hash) > +{ > + TDB_DATA key; > + char *fullpath = NULL; > + > + /* Set the hash of the full pathname. */ > + fullpath = talloc_asprintf(talloc_tos(), > + "%s/%s", > + conn->connectpath, > + name); > + if (!fullpath) { > + return NT_STATUS_NO_MEMORY; > + } > + key = string_term_tdb_data(fullpath); > + *p_name_hash = tdb_jenkins_hash(&key); > + > + DEBUG(10,("file_name_hash: %s hash 0x%x\n", > + fullpath, > + (unsigned int)*p_name_hash )); > + > + TALLOC_FREE(fullpath); > + return NT_STATUS_OK; > +} These function don't calculate the same hash! string_term_tdb_data() uses strlen()+1. metze signature.asc Description: OpenPGP digital signature