From 3c778923ef84d5b822e91a0e347ecd619a4022d1 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 18 Apr 2013 17:40:07 -0700 Subject: [PATCH] Fix bug #9794 - opening/editing or copying MS files causes a core dump with invalid lock order. open_file_fchmod() uses INTERNAL_OPEN_ONLY which doesn't conflict with oplocks or deny modes, so it doesn't need to allocate any global state either. We detect this as all INTERNAL_OPEN_ONLY calls have no associated struct smb_request * pointer (file_new() already has code to cope with this). Signed-off-by: Jeremy Allison --- source3/smbd/files.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source3/smbd/files.c b/source3/smbd/files.c index d94ee11..37493f2 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -93,7 +93,11 @@ NTSTATUS file_new(struct smb_request *req, connection_struct *conn, GetTimeOfDay(&fsp->open_time); - if (sconn->conn) { + if (sconn->conn && req != NULL) { + /* + * We only do this on non-internal opens + * which have a valid req struct. + */ struct smbXsrv_open *op = NULL; NTTIME now = timeval_to_nttime(&fsp->open_time); -- 1.7.10.4