[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via c604388 s3:winbindd: remove useless ';' from 7ea7ba6 WHATSNEW: fix indentation http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit c604388ec3daa69184f9c45d48599353ddb54240 Author: Stefan Metzmacher me...@samba.org Date: Tue Dec 28 11:57:04 2010 +0100 s3:winbindd: remove useless ';' metze Autobuild-User: Stefan Metzmacher me...@samba.org Autobuild-Date: Tue Dec 28 12:45:20 CET 2010 on sn-devel-104 --- Summary of changes: source3/winbindd/winbindd_cm.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c index 3f21db5..f3eba90 100644 --- a/source3/winbindd/winbindd_cm.c +++ b/source3/winbindd/winbindd_cm.c @@ -2026,7 +2026,7 @@ static NTSTATUS cm_get_schannel_creds(struct winbindd_domain *domain, struct rpc_pipe_client *netlogon_pipe; if (lp_client_schannel() == False) { - return NT_STATUS_CANT_ACCESS_DOMAIN_INFO;; + return NT_STATUS_CANT_ACCESS_DOMAIN_INFO; } result = cm_connect_netlogon(domain, netlogon_pipe); -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 5717114 s3: Make node_status_query return NTSTATUS via e1ab3c3 s3: Remove an ancient typedef via b0ff97d s3: Fix some typos via c4b18bd async_send-sendto, async_recv-recvfrom from c604388 s3:winbindd: remove useless ';' http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 571711431885e8e556822c14b3d117025860bf81 Author: Volker Lendecke v...@samba.org Date: Tue Dec 28 12:53:12 2010 +0100 s3: Make node_status_query return NTSTATUS Also make the result talloc'ed Autobuild-User: Volker Lendecke vlen...@samba.org Autobuild-Date: Tue Dec 28 13:46:59 CET 2010 on sn-devel-104 commit e1ab3c3470a7f1159d52ed0c1eacf4a5a7b6bc2b Author: Volker Lendecke v...@samba.org Date: Tue Dec 28 11:55:47 2010 +0100 s3: Remove an ancient typedef commit b0ff97d8d37957fc34861214b6cbab513072bef1 Author: Volker Lendecke v...@samba.org Date: Tue Dec 28 11:48:43 2010 +0100 s3: Fix some typos commit c4b18bd860bc18529249a8c54c7db6aba2347591 Author: Volker Lendecke v...@samba.org Date: Sun Dec 26 16:03:58 2010 +0100 async_send-sendto, async_recv-recvfrom --- Summary of changes: lib/async_req/async_sock.c | 74 + lib/async_req/async_sock.h | 21 ++- nsswitch/wins.c |6 ++-- source3/include/proto.h | 12 --- source3/include/smb.h|4 +- source3/libsmb/namequery.c | 60 ++ source3/utils/nmblookup.c| 16 + source3/winbindd/winbindd_wins.c | 26 - 8 files changed, 126 insertions(+), 93 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/async_req/async_sock.c b/lib/async_req/async_sock.c index 18adb42..9b2a625 100644 --- a/lib/async_req/async_sock.c +++ b/lib/async_req/async_sock.c @@ -36,28 +36,30 @@ #define TALLOC_FREE(ctx) do { talloc_free(ctx); ctx=NULL; } while(0) #endif -struct async_send_state { +struct sendto_state { int fd; const void *buf; size_t len; int flags; + const struct sockaddr *addr; + socklen_t addr_len; ssize_t sent; }; -static void async_send_handler(struct tevent_context *ev, +static void sendto_handler(struct tevent_context *ev, struct tevent_fd *fde, uint16_t flags, void *private_data); -struct tevent_req *async_send_send(TALLOC_CTX *mem_ctx, - struct tevent_context *ev, - int fd, const void *buf, size_t len, - int flags) +struct tevent_req *sendto_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, + int fd, const void *buf, size_t len, int flags, + const struct sockaddr *addr, + socklen_t addr_len) { struct tevent_req *result; - struct async_send_state *state; + struct sendto_state *state; struct tevent_fd *fde; - result = tevent_req_create(mem_ctx, state, struct async_send_state); + result = tevent_req_create(mem_ctx, state, struct sendto_state); if (result == NULL) { return result; } @@ -65,8 +67,10 @@ struct tevent_req *async_send_send(TALLOC_CTX *mem_ctx, state-buf = buf; state-len = len; state-flags = flags; + state-addr = addr; + state-addr_len = addr_len; - fde = tevent_add_fd(ev, state, fd, TEVENT_FD_WRITE, async_send_handler, + fde = tevent_add_fd(ev, state, fd, TEVENT_FD_WRITE, sendto_handler, result); if (fde == NULL) { TALLOC_FREE(result); @@ -75,16 +79,17 @@ struct tevent_req *async_send_send(TALLOC_CTX *mem_ctx, return result; } -static void async_send_handler(struct tevent_context *ev, +static void sendto_handler(struct tevent_context *ev, struct tevent_fd *fde, uint16_t flags, void *private_data) { struct tevent_req *req = talloc_get_type_abort( private_data, struct tevent_req); - struct async_send_state *state = - tevent_req_data(req, struct async_send_state); + struct sendto_state *state = + tevent_req_data(req, struct sendto_state); - state-sent = send(state-fd, state-buf, state-len, state-flags); + state-sent = sendto(state-fd, state-buf, state-len, state-flags, +state-addr, state-addr_len); if ((state-sent == -1) (errno == EINTR)) { /* retry */ return; @@ -96,10 +101,10 @@ static void async_send_handler(struct tevent_context *ev,
[SCM] Samba Shared Repository - branch v3-6-test updated
The branch, v3-6-test has been updated via 02f21dc s3:winbindd: remove useless ';' from 896d58b WHATSNEW: fix indentation http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test - Log - commit 02f21dc060fcec9cd9dd68edc645902f54f9 Author: Stefan Metzmacher me...@samba.org Date: Tue Dec 28 11:57:04 2010 +0100 s3:winbindd: remove useless ';' metze Autobuild-User: Stefan Metzmacher me...@samba.org Autobuild-Date: Tue Dec 28 12:45:20 CET 2010 on sn-devel-104 (cherry picked from commit c604388ec3daa69184f9c45d48599353ddb54240) --- Summary of changes: source3/winbindd/winbindd_cm.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c index 3f21db5..f3eba90 100644 --- a/source3/winbindd/winbindd_cm.c +++ b/source3/winbindd/winbindd_cm.c @@ -2026,7 +2026,7 @@ static NTSTATUS cm_get_schannel_creds(struct winbindd_domain *domain, struct rpc_pipe_client *netlogon_pipe; if (lp_client_schannel() == False) { - return NT_STATUS_CANT_ACCESS_DOMAIN_INFO;; + return NT_STATUS_CANT_ACCESS_DOMAIN_INFO; } result = cm_connect_netlogon(domain, netlogon_pipe); -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 4622812 s3: Make name_query return NTSTATUS via 28d997a s3: AllowDebugChange is gone via 5f79588 Fix a memleak in nss_wins via 181cd32 Fix a crash in libnss_wins from 5717114 s3: Make node_status_query return NTSTATUS http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 4622812a41eb5ce07dd8f74534217e858743883f Author: Volker Lendecke v...@samba.org Date: Tue Dec 28 13:47:35 2010 +0100 s3: Make name_query return NTSTATUS Also use talloc for the result Autobuild-User: Volker Lendecke vlen...@samba.org Autobuild-Date: Tue Dec 28 18:21:05 CET 2010 on sn-devel-104 commit 28d997a89056f144de6a7b95af0e54a044c5e5b3 Author: Volker Lendecke v...@samba.org Date: Tue Dec 28 17:17:04 2010 +0100 s3: AllowDebugChange is gone commit 5f79588de07754ef112abac33535a34624b3b078 Author: Volker Lendecke v...@samba.org Date: Tue Dec 28 17:08:57 2010 +0100 Fix a memleak in nss_wins commit 181cd3281c4f2c53dc507f59d281a2517579cfe1 Author: Volker Lendecke v...@samba.org Date: Tue Dec 28 17:05:18 2010 +0100 Fix a crash in libnss_wins lp_set_parm accesses the case tables --- Summary of changes: nsswitch/wins.c | 10 +--- source3/client/client.c |1 - source3/include/proto.h |4 ++- source3/libsmb/namequery.c | 46 + source3/utils/nmblookup.c| 23 ++ source3/web/diagnose.c | 10 +--- source3/winbindd/winbindd_wins.c | 25 +--- 7 files changed, 70 insertions(+), 49 deletions(-) Changeset truncated at 500 lines: diff --git a/nsswitch/wins.c b/nsswitch/wins.c index 731efcb..ac062fe 100644 --- a/nsswitch/wins.c +++ b/nsswitch/wins.c @@ -40,8 +40,6 @@ static pthread_mutex_t wins_nss_mutex = PTHREAD_MUTEX_INITIALIZER; static int initialised; -extern bool AllowDebugChange; - NSS_STATUS _nss_wins_gethostbyname_r(const char *hostname, struct hostent *he, char *buffer, size_t buflen, int *h_errnop); NSS_STATUS _nss_wins_gethostbyname2_r(const char *name, int af, struct hostent *he, @@ -94,11 +92,11 @@ static int wins_lookup_open_socket_in(void) static void nss_wins_init(void) { initialised = 1; + load_case_tables(); lp_set_cmdline(log level, 0); TimeInit(); setup_logging(nss_wins,False); - load_case_tables(); lp_load(get_dyn_CONFIGFILE(),True,False,False,True); load_interfaces(); } @@ -142,16 +140,20 @@ static struct in_addr *lookup_byname_backend(const char *name, int *count) const struct in_addr *bcast = iface_n_bcast_v4(j); struct sockaddr_storage ss; struct sockaddr_storage *pss; + NTSTATUS status; + if (!bcast) { continue; } in_addr_to_sockaddr_storage(ss, *bcast); - pss = name_query(fd,name,0x00,True,True,ss,count, flags, NULL); + status = name_query(fd, name, 0x00, True, True, ss, + NULL, pss, count, flags, NULL); if (pss) { if ((ret = SMB_MALLOC_P(struct in_addr)) == NULL) { return NULL; } *ret = ((struct sockaddr_in *)pss)-sin_addr; + TALLOC_FREE(pss); break; } } diff --git a/source3/client/client.c b/source3/client/client.c index b3bbcf5..8486bb2 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -36,7 +36,6 @@ extern int do_smb_browse(void); /* mDNS browsing */ -extern bool AllowDebugChange; extern bool override_logfile; extern char tar_type; diff --git a/source3/include/proto.h b/source3/include/proto.h index 8278ffb..9b391ae 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2712,12 +2712,14 @@ bool name_status_find(const char *q_name, const struct sockaddr_storage *to_ss, fstring name); int ip_service_compare(struct ip_service *ss1, struct ip_service *ss2); -struct sockaddr_storage *name_query(int fd, +NTSTATUS name_query(int fd, const char *name, int name_type, bool bcast, bool recurse, const struct sockaddr_storage *to_ss, + TALLOC_CTX *mem_ctx, + struct sockaddr_storage **addrs, int *count, int *flags, bool *timed_out); diff --git a/source3/libsmb/namequery.c
autobuild: intermittent test failure detected
The autobuild test system has detected an intermittent failing test in the current master tree. The autobuild log of the failure is available here: http://git.samba.org/autobuild.flakey/2010-12-28-1823/flakey.log The source3 build logs are available here: http://git.samba.org/autobuild.flakey/2010-12-28-1823/source3.stderr http://git.samba.org/autobuild.flakey/2010-12-28-1823/source3.stdout The source4 build logs are available here: http://git.samba.org/autobuild.flakey/2010-12-28-1823/source4.stderr http://git.samba.org/autobuild.flakey/2010-12-28-1823/source4.stdout The top commit at the time of the failure was: commit 571711431885e8e556822c14b3d117025860bf81 Author: Volker Lendecke v...@samba.org Date: Tue Dec 28 12:53:12 2010 +0100 s3: Make node_status_query return NTSTATUS Also make the result talloc'ed Autobuild-User: Volker Lendecke vlen...@samba.org Autobuild-Date: Tue Dec 28 13:46:59 CET 2010 on sn-devel-104
[SCM] Samba Shared Repository - branch v3-6-test updated
The branch, v3-6-test has been updated via cef866a Fix a memleak in nss_wins from 02f21dc s3:winbindd: remove useless ';' http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test - Log - commit cef866ad8021f85a9c89d1749d47fb2178930244 Author: Volker Lendecke v...@samba.org Date: Tue Dec 28 17:08:57 2010 +0100 Fix a memleak in nss_wins --- Summary of changes: nsswitch/wins.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/nsswitch/wins.c b/nsswitch/wins.c index aa02f32..913e833 100644 --- a/nsswitch/wins.c +++ b/nsswitch/wins.c @@ -152,6 +152,7 @@ static struct in_addr *lookup_byname_backend(const char *name, int *count) return NULL; } *ret = ((struct sockaddr_in *)pss)-sin_addr; + SAFE_FREE(pss); break; } } -- Samba Shared Repository
[SCM] Samba Shared Repository - branch v3-6-test updated
The branch, v3-6-test has been updated via 9eb0084 s3:selftest: mark samba3.posix_s3.smb2.lock (dc).rw-exclusive as known to fail via c86299b tevent: More doc fixes via 86772b9 tevent: Some documentation fixes via d288159 tevent: Fix a typo from cef866a Fix a memleak in nss_wins http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test - Log - commit 9eb0084726c18a43e581388032dd59c31525adb3 Author: Stefan Metzmacher me...@samba.org Date: Mon Dec 27 11:18:44 2010 +0100 s3:selftest: mark samba3.posix_s3.smb2.lock (dc).rw-exclusive as known to fail This sometimes fails like this: [218/271 in 22m22s] samba3.posix_s3.smb2.lock (dc) UNEXPECTED(failure): samba3.posix_s3.smb2.lock (dc).rw-exclusive REASON: _StringException: _StringException: ../torture/smb2/lock.c:406: status was NT_STATUS_END_OF_FILE, expected NT_STATUS_OK: (../torture/smb2/lock.c:406) command: LD_LIBRARY_PATH=/memdisk/tridge/flakey/b18675/source3/source3/bin/shared:/memdisk/tridge/flakey/b18675/source3/source3/bin: bin/smbtorture4 --configfile=$SMB_CONF_PATH --maximum-runtime=1200 --target=samba3 --basedir=/memdisk/tridge/flakey/b18675/source3/source3/st --option=torture:winbindd_netbios_name=$SERVER --option=torture:winbindd_netbios_domain=$DOMAIN --option=torture:localdir=/memdisk/tridge/flakey/b18675/source3/source3/st/dc/share --option=torture:sharedelay=10 //$SERVER_IP/tmp -U$USERNAME%$PASSWORD smb2.lock 21 | ../selftest/filter-subunit --prefix samba3.posix_s3.smb2.lock (dc). expanded command: LD_LIBRARY_PATH=/memdisk/tridge/flakey/b18675/source3/source3/bin/shared:/memdisk/tridge/flakey/b18675/source3/source3/bin: bin/smbtorture4 --configfile=/memdisk/tridge/flakey/b18675/source3/source3/st/client/client.conf --maximum-runtime=1200 --target=samba3 --basedir=/memdisk/tridge/flakey/b18675/source3/source3/st --option=torture:winbindd_netbios_name=LOCALDC2 --option=torture:winbindd_netbios_domain=SAMBA-TEST --option=torture:localdir=/memdisk/tridge/flakey/b18675/source3/source3/st/dc/share --option=torture:sharedelay=10 //127.0.0.2/tmp -Utridge%localdc2pass smb2.lock 21 | ../selftest/filter-subunit --prefix samba3.posix_s3.smb2.lock (dc). ERROR: Testsuite[samba3.posix_s3.smb2.lock (dc)] REASON: Exit code was 1 metze Autobuild-User: Stefan Metzmacher me...@samba.org Autobuild-Date: Mon Dec 27 12:08:51 CET 2010 on sn-devel-104 (cherry picked from commit e1de884eaa28d8ac67d4060e76e146e0216447ff) commit c86299b76a05746f12d2c5b576ec01d27c759ce6 Author: Volker Lendecke v...@samba.org Date: Sat Dec 25 23:45:30 2010 +0100 tevent: More doc fixes Autobuild-User: Volker Lendecke vlen...@samba.org Autobuild-Date: Sun Dec 26 10:20:51 CET 2010 on sn-devel-104 (cherry picked from commit d2de01f95bc55529281e2860222330d5021d3d69) commit 86772b9a7a0a6c30203c84b2a9cd28fa8217e417 Author: Volker Lendecke v...@samba.org Date: Sat Dec 25 23:09:19 2010 +0100 tevent: Some documentation fixes Autobuild-User: Volker Lendecke vlen...@samba.org Autobuild-Date: Sat Dec 25 23:58:20 CET 2010 on sn-devel-104 (cherry picked from commit f16740a408a7a5f648a4cb4b5bef098cf3aec458) commit d2881592fd0bfc9f25e863a608c032fdb24bfb54 Author: Volker Lendecke v...@samba.org Date: Sat Dec 25 15:19:16 2010 +0100 tevent: Fix a typo Autobuild-User: Volker Lendecke vlen...@samba.org Autobuild-Date: Sat Dec 25 22:56:18 CET 2010 on sn-devel-104 (cherry picked from commit 5353eaea33f34752a27ed47fee26426227f5a752) --- Summary of changes: lib/tevent/doc/mainpage.dox |2 +- lib/tevent/tevent.h | 119 +++--- source3/selftest/knownfail |1 + 3 files changed, 90 insertions(+), 32 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/tevent/doc/mainpage.dox b/lib/tevent/doc/mainpage.dox index 5cd3969..e2f986e 100644 --- a/lib/tevent/doc/mainpage.dox +++ b/lib/tevent/doc/mainpage.dox @@ -8,7 +8,7 @@ * signals, and the classic file descriptor events. * * Tevent also provide helpers to deal with asynchronous code providing the - * tevent_req (tevent tequest) functions. + * tevent_req (tevent request) functions. * * @section tevent_download Download * diff --git a/lib/tevent/tevent.h b/lib/tevent/tevent.h index 82c1483..1c01a63 100644 --- a/lib/tevent/tevent.h +++ b/lib/tevent/tevent.h @@ -509,50 +509,65 @@ int tevent_set_debug_stderr(struct tevent_context *ev); * @defgroup tevent_request The tevent request functions. * @ingroup tevent * - * This represents an async request being processed by callbacks via an event - * context. A user can issue for example a write request to a socket, giving - * an implementation function the fd, the buffer and the number of bytes
[SCM] Samba Shared Repository - branch v3-6-test updated
The branch, v3-6-test has been updated via 6def684 Fix bug #7892 - open_file_fchmod() leaves a stale lock. (cherry picked from commit 079da9a83d12945e8e7bc86ef27abd0bd1599fa4) from 9eb0084 s3:selftest: mark samba3.posix_s3.smb2.lock (dc).rw-exclusive as known to fail http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test - Log - commit 6def6847f770e828286c37c456de8423ddcc4e46 Author: Jeremy Allison j...@samba.org Date: Tue Dec 28 16:25:16 2010 -0800 Fix bug #7892 - open_file_fchmod() leaves a stale lock. (cherry picked from commit 079da9a83d12945e8e7bc86ef27abd0bd1599fa4) --- Summary of changes: source3/include/proto.h |3 +-- source3/smbd/dosmode.c| 11 --- source3/smbd/open.c | 40 source3/smbd/posix_acls.c |4 ++-- 4 files changed, 11 insertions(+), 47 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/include/proto.h b/source3/include/proto.h index f9bf72f..ef08dd7 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5013,10 +5013,9 @@ bool map_open_params_to_ntcreate(const struct smb_filename *smb_fname, uint32_t *pprivate_flags); void remove_deferred_open_entry(struct file_id id, uint64_t mid, struct server_id pid); -NTSTATUS open_file_fchmod(struct smb_request *req, connection_struct *conn, +NTSTATUS open_file_fchmod(connection_struct *conn, struct smb_filename *smb_fname, files_struct **result); -NTSTATUS close_file_fchmod(struct smb_request *req, files_struct *fsp); NTSTATUS create_directory(connection_struct *conn, struct smb_request *req, struct smb_filename *smb_dname); void msg_file_was_renamed(struct messaging_context *msg, diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c index cf95348..838dec0 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -415,7 +415,7 @@ static bool set_ea_dos_attribute(connection_struct *conn, * are not violating security in doing the setxattr. */ - if (!NT_STATUS_IS_OK(open_file_fchmod(NULL, conn, smb_fname, + if (!NT_STATUS_IS_OK(open_file_fchmod(conn, smb_fname, fsp))) return ret; become_root(); @@ -425,7 +425,7 @@ static bool set_ea_dos_attribute(connection_struct *conn, ret = true; } unbecome_root(); - close_file_fchmod(NULL, fsp); + close_file(NULL, fsp, NORMAL_CLOSE); return ret; } DEBUG(10,(set_ea_dos_attribute: set EA 0x%x on file %s\n, @@ -823,18 +823,15 @@ int file_set_dosmode(connection_struct *conn, struct smb_filename *smb_fname, * We need to open the file with write access whilst * still in our current user context. This ensures we * are not violating security in doing the fchmod. -* This file open does *not* break any oplocks we are -* holding. We need to review this may need to -* break batch oplocks open by others. JRA. */ files_struct *fsp; - if (!NT_STATUS_IS_OK(open_file_fchmod(NULL, conn, smb_fname, + if (!NT_STATUS_IS_OK(open_file_fchmod(conn, smb_fname, fsp))) return -1; become_root(); ret = SMB_VFS_FCHMOD(fsp, unixmode); unbecome_root(); - close_file_fchmod(NULL, fsp); + close_file(NULL, fsp, NORMAL_CLOSE); if (!newfile) { notify_fname(conn, NOTIFY_ACTION_MODIFIED, FILE_NOTIFY_CHANGE_ATTRIBUTES, diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 32a08b5..722e461 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -2291,23 +2291,15 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, Open a file for for write to ensure that we can fchmod it. / -NTSTATUS open_file_fchmod(struct smb_request *req, connection_struct *conn, +NTSTATUS open_file_fchmod(connection_struct *conn, struct smb_filename *smb_fname, files_struct **result) { - files_struct *fsp = NULL; - NTSTATUS status; - if (!VALID_STAT(smb_fname-st)) { return NT_STATUS_INVALID_PARAMETER; } - status = file_new(req, conn, fsp); - if(!NT_STATUS_IS_OK(status)) { - return
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 9b31f6ab Fix bug #7892 - open_file_fchmod() leaves a stale lock. from 4622812 s3: Make name_query return NTSTATUS http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 9b31f6ab6cce55824f3e62f59061085abc1240db Author: Jeremy Allison j...@samba.org Date: Tue Dec 28 16:25:16 2010 -0800 Fix bug #7892 - open_file_fchmod() leaves a stale lock. Autobuild-User: Jeremy Allison j...@samba.org Autobuild-Date: Wed Dec 29 02:15:23 CET 2010 on sn-devel-104 --- Summary of changes: source3/include/proto.h |3 +-- source3/smbd/dosmode.c| 11 --- source3/smbd/open.c | 40 source3/smbd/posix_acls.c |4 ++-- 4 files changed, 11 insertions(+), 47 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/include/proto.h b/source3/include/proto.h index 9b391ae..c469888 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5017,10 +5017,9 @@ bool map_open_params_to_ntcreate(const struct smb_filename *smb_fname, uint32_t *pprivate_flags); void remove_deferred_open_entry(struct file_id id, uint64_t mid, struct server_id pid); -NTSTATUS open_file_fchmod(struct smb_request *req, connection_struct *conn, +NTSTATUS open_file_fchmod(connection_struct *conn, struct smb_filename *smb_fname, files_struct **result); -NTSTATUS close_file_fchmod(struct smb_request *req, files_struct *fsp); NTSTATUS create_directory(connection_struct *conn, struct smb_request *req, struct smb_filename *smb_dname); void msg_file_was_renamed(struct messaging_context *msg, diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c index cf95348..838dec0 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -415,7 +415,7 @@ static bool set_ea_dos_attribute(connection_struct *conn, * are not violating security in doing the setxattr. */ - if (!NT_STATUS_IS_OK(open_file_fchmod(NULL, conn, smb_fname, + if (!NT_STATUS_IS_OK(open_file_fchmod(conn, smb_fname, fsp))) return ret; become_root(); @@ -425,7 +425,7 @@ static bool set_ea_dos_attribute(connection_struct *conn, ret = true; } unbecome_root(); - close_file_fchmod(NULL, fsp); + close_file(NULL, fsp, NORMAL_CLOSE); return ret; } DEBUG(10,(set_ea_dos_attribute: set EA 0x%x on file %s\n, @@ -823,18 +823,15 @@ int file_set_dosmode(connection_struct *conn, struct smb_filename *smb_fname, * We need to open the file with write access whilst * still in our current user context. This ensures we * are not violating security in doing the fchmod. -* This file open does *not* break any oplocks we are -* holding. We need to review this may need to -* break batch oplocks open by others. JRA. */ files_struct *fsp; - if (!NT_STATUS_IS_OK(open_file_fchmod(NULL, conn, smb_fname, + if (!NT_STATUS_IS_OK(open_file_fchmod(conn, smb_fname, fsp))) return -1; become_root(); ret = SMB_VFS_FCHMOD(fsp, unixmode); unbecome_root(); - close_file_fchmod(NULL, fsp); + close_file(NULL, fsp, NORMAL_CLOSE); if (!newfile) { notify_fname(conn, NOTIFY_ACTION_MODIFIED, FILE_NOTIFY_CHANGE_ATTRIBUTES, diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 32a08b5..722e461 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -2291,23 +2291,15 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, Open a file for for write to ensure that we can fchmod it. / -NTSTATUS open_file_fchmod(struct smb_request *req, connection_struct *conn, +NTSTATUS open_file_fchmod(connection_struct *conn, struct smb_filename *smb_fname, files_struct **result) { - files_struct *fsp = NULL; - NTSTATUS status; - if (!VALID_STAT(smb_fname-st)) { return NT_STATUS_INVALID_PARAMETER; } - status = file_new(req, conn, fsp); - if(!NT_STATUS_IS_OK(status)) { - return status; - } - -status = SMB_VFS_CREATE_FILE( +