1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

816 Commits

Author SHA1 Message Date
Jeremy Allison
572e5dec1b Implement missing info level SMB_FILE_LINK_INFORMATION.
Fix bug #7435 - SMB2 hardlink fails (invalid level).
Found at the Microsoft plugsharing plugfest.

Jeremy.
2010-05-18 18:34:54 -07:00
Jelmer Vernooij
b8268cf7b0 s3: Remove use of iconv_convenience. 2010-05-18 11:45:31 +02:00
Jeremy Allison
056f24ce24 Fix bug 7399 - SMB2: QUERY_DIRECTORY is returning invalid values.
The end_data argument to smbd_dirptr_lanman2_entry() must include
the safety margin, as internally it's actually used to allow detection
of string name pushes that were truncated. Ensure space_remaining can
never go negative due to padding.

Jeremy.
2010-05-13 15:59:09 -07:00
Jeremy Allison
4955ccfff5 Fix more SMB2-OPLOCK bugs. Only 3 more issues to address then we're good to go on this test.
Jeremy.
2010-05-11 14:00:38 -07:00
Jeremy Allison
adf4833792 This patch looks bigger than it is. It does 2 things. 1). Renames smbpid -> smblctx in our locking code. 2). Widens smblctx to 64-bits internally. Preparing to use the SMB2 handle as the locking context.
Jeremy.
2010-05-07 06:20:50 -07:00
Günther Deschner
c6ebab846d s3: only include gen_ndr headers where needed.
This shrinks include/includes.h.gch by the size of 7 MB and reduces build time
as follows:

ccache build w/o patch
real    4m21.529s
ccache build with patch
real    3m6.402s

pch build w/o patch
real    4m26.318s
pch build with patch
real    3m6.932s

Guenther
2010-05-06 00:22:59 +02:00
Jeremy Allison
e90444319c Carefully label SMB1-specific locking calls.
Jeremy.
2010-04-29 17:08:12 -07:00
Jeremy Allison
1f69a7a80e Attempt to fix bug #7399 - SMB2: QUERY_DIRECTORY is returning invalid values.
Based on an initial patch from Ira Cooper <samba@ira.wakeful.net>.

Jeremy.
2010-04-29 13:40:25 -07:00
Simo Sorce
168b86c384 s3-smbd: group print relate data in own structure 2010-04-23 14:26:33 -07:00
Jeremy Allison
3491f6d119 Simplify call_trans2qfilepathinfo() and smbd_do_qfilepathinfo()
Remove the bool ms_dfs_link parameter from smbd_do_qfilepathinfo.
It is not possible for this to be a DFS link. Remove the check_msdfs_link()
call from call_trans2qfilepathinfo() - the call to filename_convert()
above with a ucf_flags of zero *MUST* catch a DFS link and return
NT_STATUS_PATH_NOT_COVERED in this case, so the code below checking
for msdfs links is redundent. Don't add this to 3.5.x, as it's an
optimization but not needed to fix bug #7339 - MSDFS is non-functional in 3.5.x.

Jeremy.
2010-04-08 21:24:23 -07:00
Jeremy Allison
3587815595 Fix bug #7339 - MSDFS is non-functional in 3.5.x
In the refactoring around filename_convert, the split between the functions
resolve_dfspath() and resolve_dfspath_wcard() was lost, leaving us only with
resolve_dfspath_wcard().

Internally resolve_dfspath_wcard() calls dfs_redirect() only with a
"allow_wcards" flag of true, wheras the old resolve_dfspath() would call with a
value of false. The loss of this case causes dfs_redirect to always masquerade
DFS links as directories, even when they are being queried directly by a trans2
QPATHINFO call. We should only masquerade DFS links as directories when called
from a SMBsearch or trans2 findfirst/findnext - which was the intent of the
"allow_wcards" flag.

This patch adds back an allow_wcards bool parameter to
resolve_dfspath_wcard(). This bool is set from the state of the ucf_flags when
filename_convert() is called.

I will follow this up with a new smbclient-based torture test that will prevent
us from ever regressing our DFS support again.

Jeremy.
2010-04-08 20:32:36 -07:00
Stefan Metzmacher
5a069f7209 s3:smbd: disable SMB encryption when the echo handler is active
metze
2010-03-22 17:15:13 +01:00
Jeremy Allison
704a607e3c Fix bug #7188 - Logic error in check of total_data for call_trans2mkdir()
Make ea data checks identical for trans2open and trans2mkdir.

Jeremy.
2010-03-15 15:04:18 -07:00
Jeremy Allison
c61c9c3a4c Fix for bug #7189 - Open txt files with notepad on samba shares creates problem.
Ensure we don't use any of the create_options for Samba private
use. Add a new parameter to the VFS_CREATE call (private_flags)
which is only used internally. Renumber NTCREATEX_OPTIONS_PRIVATE_DENY_DOS
and NTCREATEX_OPTIONS_PRIVATE_DENY_FCB to match the S4 code).
Rev. the VFS interface to version 28.

Jeremy.
2010-03-05 15:13:37 -08:00
Jeremy Allison
314a926179 Fix up debug info on smb2_rename code.
Jeremy.
2010-02-25 11:57:54 -08:00
Jeremy Allison
3551eb7cbf Implement rename/move in SMB2 from Windows7.
Jeremy.
2010-02-25 11:15:16 -08:00
Jeremy Allison
fac6d5212b Remove now unused variable.
Jeremy.
2010-02-05 16:20:34 -08:00
Jeremy Allison
bd269443e3 Fix bug 7104 - "wide links" and "unix extensions" are incompatible.
Change parameter "wide links" to default to "no".
Ensure "wide links = no" if "unix extensions = yes" on a share.
Fix man pages to refect this.

Remove "within share" checks for a UNIX symlink set - even if
widelinks = no. The server will not follow that link anyway.

Correct DEBUG message in check_reduced_name() to add missing "\n"
so it's really clear when a path is being denied as it's outside
the enclosing share path.

Jeremy.
2010-02-05 15:20:18 -08:00
Jeremy Allison
74deee3cc9 Rename reply_doserror() -> reply_force_doserror().
Rewrite all calls to reply_nterror(NT_STATUS_DOS()) to
reply_force_doserror() and update the comment in smbd/error.c

Jeremy.
2009-12-21 11:16:38 -08:00
Jeremy Allison
642101ac23 Remove all calls to reply_doserror - turn them into
correct reply_nterror calls. Next rename reply_doserror ->
reply_force_doserror and plumb in when NT_STATUS_DOS is
used.
Jeremy.
2009-12-21 11:05:25 -08:00
Jeremy Allison
e831e3ee32 Ensure dos_mode can return FILE_ATTRIBUTE_NORMAL, then filter the returned attributes by protocol level.
This makes us consistant in returning DOS attrs across all replies. Tested on OS/2 by Günter Kukkukk.
Jeremy.
2009-12-15 18:03:47 -08:00
Jeremy Allison
dfcc4115dd Remove unneeded argument from can_set_delete_on_close(). Ensure
can_set_delete_on_close() is correctly called before any setting
of the disposition bit (clean up the do_unlink() call).
Jeremy.
2009-12-02 18:06:40 -08:00
Jeremy Allison
8dda4cea66 Ensure we don't see the xattr used to store NT security (visible when xattr_tdb
is used). Allows make test to pass with acl_xattr.so prepended to the vfs modules.
Jeremy.
2009-12-01 14:08:16 -08:00
Tim Prouty
ae649782df s3: Fix smbd to correctly return INVALID_LEVEL on set_file_end_of_file_info for paths
This allows smbd to pass the freshly updated RAW-SFILEINFO-END-OF-FILE
torture test.
2009-12-01 11:12:51 -08:00
Tim Prouty
af610a6f26 s3 setfileinfo: Open with FILE_WRITE_DATA when setting the file size
This matches what is outlined here:
http://msdn.microsoft.com/en-us/library/ms804363.aspx

This is also inline with how winXP/win7 handle this.  See
RAW-SFILEINFO-END-OF-FILE* in smbtorture4.
2009-11-25 08:45:58 -08:00
Volker Lendecke
a1a81ef785 Revert "s3: Make the implicit reference to Protocol in mask_match() explicit"
This reverts commit e23d8a3d1f.
2009-11-23 16:35:00 +01:00
Volker Lendecke
0f8e2a6ebb Revert "s3: Move the global variable Protocol to struct smbd_server_connection"
This reverts commit c85a4c9ba4.
2009-11-23 16:34:59 +01:00
Volker Lendecke
c85a4c9ba4 s3: Move the global variable Protocol to struct smbd_server_connection 2009-11-21 20:49:17 +01:00
Volker Lendecke
e23d8a3d1f s3: Make the implicit reference to Protocol in mask_match() explicit 2009-11-21 20:49:16 +01:00
Volker Lendecke
d1c34d4054 s3: Replace some create_synthetic_smb_fname() calls
In very hot codepaths like the statcache copy_smb_filename and the subsequent
recursive talloc_free is noticable in the CPU load.
2009-11-18 23:16:13 +01:00
Jeremy Allison
a770caed0f Remove "store create time" code, cause create time to be stored
in the "user.DOSATTRIB" EA. From the docs:
In Samba 3.5.0 and above the "user.DOSATTRIB" extended attribute has been extended to store
the create time for a file as well as the DOS attributes. This is done in a backwards compatible
way so files created by Samba 3.5.0 and above can still have the DOS attribute read from this
extended attribute by earlier versions of Samba, but they will not be able to read the create
time stored there. Storing the create time separately from the normal filesystem meta-data
allows Samba to faithfully reproduce NTFS semantics on top of a POSIX filesystem.
Passes make test but will need more testing.
Jeremy.
2009-11-17 14:55:02 -08:00
Jeremy Allison
cbafe17bb3 Remove "Protocol" as an extern, and add accessor functions.
Jeremy.
2009-11-04 15:15:50 -08:00
Jeremy Allison
31ce8eeb44 Fix debug statements to use correct function name.
Jeremy.
2009-11-03 11:22:19 -08:00
Jeremy Allison
7ae10fb892 requires_resume_key is a bool not int.
Jeremy.
2009-11-03 11:21:02 -08:00
Jeremy Allison
6a61befe37 Fix more of the RAW-SEARCH test. Older info levels are
not 4 byte aligned (levels 1 - 3).
Jeremy.
2009-11-03 11:19:24 -08:00
Jeremy Allison
494d8271d4 Fix bug 6867 - trans2findnext returns reply_nterror(req, ntstatus) In a directory with a lot of files.
Jeremy.
2009-11-02 12:15:25 -08:00
Jeremy Allison
921aa99b37 Start fixing the RAW-STREAMS test - ensure that the xattr
used to store the stream info in streams_depot.so is not
seen in when enumerating EAs.
Jeremy.
2009-10-29 16:14:12 -07:00
Günther Deschner
700df9b27a s3-smbd: fix get_ea_names_from_file() and check for pnames pointer.
This fixes smbd from crashing all the time.

Jeremy, Volker, please check.

Guenther
2009-09-18 21:31:37 +02:00
Jeremy Allison
16836f9e9e We now pass the Microsoft SMB2 fileio test with EA's and streams...
Jeremy.
2009-09-17 09:29:07 -07:00
Jeremy Allison
ca2c93b9e5 Fix bug 6494 - Incorrect FileStatus returned in NT_CREATE_ANDX.
Lookup the EA and Stream status on CreateX.
Jeremy.
2009-09-14 15:30:05 -07:00
Volker Lendecke
a5cace128d s3:smbd: Add a "hidden" parameter "share:fake_fscaps"
This is needed to support some special app I've just come across where I had to
set the SPARSE_FILES bit (0x40) to make it work against Samba at all. There
might be others to fake. This is definitely a "Don't touch if you don't know
what you're doing" thing, so I decided to make this an undocumented parametric
parameter.

I know this sucks, so feel free to beat me up on this. But I don't think it
will hurt.
2009-09-09 22:03:22 +02:00
Jeremy Allison
c69f92d16d Second attempt at fix for bug 6529 - Offline files conflict with Vista and Office 2003.
Confirmation from reporter that this fixes the issue in master on ext3/ext4.
Back-ports to follow.
Jeremy.
2009-08-24 20:57:37 -07:00
Jeremy Allison
87d30a1968 Second part of fix for 6529 - Offline files conflict with Vista and Office 2003.
ext4 may be able to store ns timestamps, but the only API to *set* timestamps
takes usec, not nsec. Round to usec on set requests.
Jeremy.
2009-08-24 12:30:05 -07:00
Jeremy Allison
1af0aa92b3 Fix bug 6529 - Offline files conflict with Vista and Office 2003
On filesystems that can't store less than one second timestamps,
round the incoming timestamp set requests so the client can't discover
that a time set request has been truncated by the filesystem.
Needs backporting to 3.4, 3.3, 3.2 and (even) 3.0.
Jeremy
2009-08-21 21:44:21 -07:00
Stefan Metzmacher
e621b7a52e s3:smbd: add a generic smbd_dirptr_lanman2_entry() function
This can we used by SMB2, the key difference between
SMB1 and SMB2 is that with SMB2 entries are aligned
to 8 bytes and there's no padding at the end of the last entry.

metze
2009-08-19 22:12:42 +02:00
Jeremy Allison
6a0c2946be Fix BASE-DELAYWRITE test by removing const from struct smb_filename
in smbd_do_qfilepathinfo(). update_stat_ex_mtime() modifies the
stat struct inside the smb_fname so don't make a copy of that
stat struct, use it directly - it's meant to be updated and
represent the state of the file we're returning.
Jeremy.
2009-08-12 15:08:23 -07:00
Jeremy Allison
d6270df748 Add "store create time" parameter (docs to follow)
that stores the create time in the user.DosTimestamps EA.
Jeremy.
2009-08-12 13:00:54 -07:00
Jeremy Allison
c9dca82ed7 Refactor the use of create_time and change time to go
through functions. Will aid in making us pass RAW-SETFILEINFO.
Jeremy.
2009-08-10 15:07:53 -07:00
Jeremy Allison
d296c774c5 Move the checks for null timestamps down below the VFS_NTIMES
layer (as it's done in onefs). This simplifies greatly the
code in smb_set_file_time() w.r.t. changenotify messages.
Jeremy.
2009-08-07 12:38:31 -07:00
Jeremy Allison
ea6819ae75 Correctly send out notify messages for timestamp changes.
"change time" has no notify message, so don't send anything
out when we change it. Use FILE_NOTIFY_CHANGE_CREATION correctly
when changing the create time.
Jeremy.
2009-08-07 10:19:20 -07:00