From e4675ce8db436ac572fcc476b9bfb1116e997f9f Mon Sep 17 00:00:00 2001 From: Tim Prouty Date: Sun, 15 Feb 2009 23:45:28 -0800 Subject: s3: Add extid to the dev/inode pair This extends the file_id struct to add an additional generic uint64_t field: extid. For backwards compatibility with dev/inodes stored in xattr_tdbs and acl_tdbs, the ext id is ignored for these databases. This patch should cause no functional change on systems that don't use SMB_VFS_FILE_ID_CREATE to set the extid. Existing code that uses the smb_share_mode library will need to be updated to be compatibile with the new extid. --- source3/smbd/open.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/smbd/open.c') diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 9971ffa679..239d4ff0c4 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -2597,8 +2597,8 @@ void msg_file_was_renamed(struct messaging_context *msg, } /* Unpack the message. */ - pull_file_id_16(frm, &id); - sharepath = &frm[16]; + pull_file_id_24(frm, &id); + sharepath = &frm[24]; newname = sharepath + strlen(sharepath) + 1; sp_len = strlen(sharepath); -- cgit From d9a842b26f306a6328e0fb4f226ed8292a8c221a Mon Sep 17 00:00:00 2001 From: todd stecher Date: Thu, 19 Feb 2009 09:33:30 -0800 Subject: S3: Detect max_open_files from system - Attempt to use syscalls to determine max-open-files value. - Add in periodic logging when max file limit reached --- source3/smbd/open.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3/smbd/open.c') diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 239d4ff0c4..ac7c35c240 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -132,6 +132,18 @@ static NTSTATUS fd_open(struct connection_struct *conn, fsp->fh->fd = SMB_VFS_OPEN(conn,fname,fsp,flags,mode); if (fsp->fh->fd == -1) { status = map_nt_error_from_unix(errno); + if (errno == EMFILE) { + static time_t last_warned = 0L; + + if (time((time_t *) NULL) > last_warned) { + DEBUG(0,("Too many open files, unable " + "to open more! smbd's max " + "open files = %d\n", + lp_max_open_files())); + last_warned = time((time_t *) NULL); + } + } + } DEBUG(10,("fd_open: name %s, flags = 0%o mode = 0%o, fd = %d. %s\n", -- cgit From faa1100d229aef56da5d48f5c19ec901e520f8ef Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 23 Feb 2009 16:22:43 -0800 Subject: More warning fixes for Solaris. Jeremy. --- source3/smbd/open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/smbd/open.c') diff --git a/source3/smbd/open.c b/source3/smbd/open.c index ac7c35c240..a42705adb6 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -1440,7 +1440,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, "create_disposition = 0x%x create_options=0x%x " "unix mode=0%o oplock_request=%d\n", fname, new_dos_attributes, access_mask, share_access, - create_disposition, create_options, unx_mode, + create_disposition, create_options, (unsigned int)unx_mode, oplock_request)); if ((req == NULL) && ((oplock_request & INTERNAL_OPEN_ONLY) == 0)) { -- cgit From 7b9381fb4f0db661a32ab884fb621cb6806ecd32 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 28 Feb 2009 13:14:23 -0800 Subject: Fix bug #6082 - smbd_gpfs_getacl failed: Windows client can“t rename or delete file (directory fix). Jeremy. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source3/smbd/open.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'source3/smbd/open.c') diff --git a/source3/smbd/open.c b/source3/smbd/open.c index a42705adb6..569c260319 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -2457,6 +2457,25 @@ static NTSTATUS open_directory(connection_struct *conn, fname, access_mask, &access_granted); + + /* Were we trying to do a directory open + * for delete and didn't get DELETE + * access (only) ? Check if the + * directory allows DELETE_CHILD. + * See here: + * http://blogs.msdn.com/oldnewthing/archive/2004/06/04/148426.aspx + * for details. */ + + if ((NT_STATUS_EQUAL(status, NT_STATUS_ACCESS_DENIED) && + (access_mask & DELETE_ACCESS) && + (access_granted == DELETE_ACCESS) && + can_delete_file_in_directory(conn, fname))) { + DEBUG(10,("open_directory: overrode ACCESS_DENIED " + "on directory %s\n", + fname )); + status = NT_STATUS_OK; + } + if (!NT_STATUS_IS_OK(status)) { DEBUG(10, ("open_directory: check_open_rights on " "file %s failed with %s\n", -- cgit