1
0
mirror of https://github.com/samba-team/samba.git synced 2025-10-21 03:33:16 +03:00
Commit Graph

410 Commits

Author SHA1 Message Date
Andrew Tridgell
1c05147f71 r3160: recognise RAW_SFILEINFO_DISPOSITION_INFORMATION (fixes temporary files from excel) 2007-10-10 13:02:27 -05:00
Andrew Tridgell
5c16ed0254 r3159: use easy to recognise file handle numbers for new file, old file and directory
in pvfs_open, to make analysing sniffs easy
2007-10-10 13:02:27 -05:00
Andrew Tridgell
abbfca1401 r3154: pvfs now passes all of BASE-DELETE 2007-10-10 13:02:26 -05:00
Andrew Tridgell
f8041feaeb r3153: pvfs now passes the first 9 of the BASE-DELETE tests 2007-10-10 13:02:26 -05:00
Andrew Tridgell
b5a6dd3cbf r3147: added basic share modes support for pvfs (or more precisely, ntcreatex
share_access support).  This is enough for us to pass the BASE-DENY2
test, but is a long way from fully correct share modes.
2007-10-10 13:02:25 -05:00
Andrew Tridgell
18b471327b r3142: fill in all the ntcreatex response fields explicitly, rather than
zeroing. This makes it clearer what bits are not yet implemented (and
is more valgrind friendly)
2007-10-10 13:02:25 -05:00
Andrew Tridgell
395c3815b4 r3135: split the "create new" logic out from the "open existing" logic in
pvfs_open, and handle the various race conditions that are inherent in
cifs on unix, so we do the best we can when the race happens.

the ntcreatex code is really starting to take shape now
2007-10-10 13:02:25 -05:00
Andrew Tridgell
043361fed4 r3133: - more consistent error checking in rename and setfileinfo
- add paranoid checking of device/inode change during open to detect race conditions
2007-10-10 13:02:25 -05:00
Andrew Tridgell
c33cdd0d55 r3132: - fixed a type conflict found by talloc_array_p()
- use struct idr_context * in ipc code
2007-10-10 13:02:24 -05:00
Andrew Tridgell
375a9a1347 r3131: - make map_nt_error_from_unix() return NT_STATUS_UNSUCCESSFUL if errno is 0
- more consistent checking for system call return values in simple backend
2007-10-10 13:02:24 -05:00
Volker Lendecke
f9dfd5ff1f r3129: typo 2007-10-10 13:02:24 -05:00
Andrew Tridgell
ad1edabf95 r3127: added the initial code for the open files database. Doesn't do
anything yet, but will soon be the core of the shares modes code.
2007-10-10 13:02:24 -05:00
Andrew Tridgell
cb155c8ad8 r3126: in the brlock code I had used a void* for the brl context as I didn't
want to expose the brl context structure outside the brlock.c
code. Instead, I now use "struct brl_context *" and rely on C being
happy to pass around pointers to unknown structures as long as they
are not dereferenced. I will be interested to see how the build farm
likes this.
2007-10-10 13:02:24 -05:00
Jelmer Vernooij
2046e14cf8 r3118: Eliminate struct dcesrv_ep_description and replace it with
struct dcerpc_binding.
2007-10-10 13:02:23 -05:00
Jelmer Vernooij
ab110192e6 r3114: - More work on merging the various structs that describe endpoints
- Add protocol sequence to dcerpc transports (will be used later on)
- Add more transports to the list
2007-10-10 13:02:23 -05:00
Andrew Tridgell
88112b9677 r3107: slight tweak to the openx -> ntcreatex mapping routine. This mapping
can never be perfect, as openx can do things that ntcreatex can't, but
with this tweak we get close (the BASE-DENY1 test passes completely,
for example)
2007-10-10 13:02:22 -05:00
Andrew Tridgell
5882f7305f r3106: don't call a tree disconnect in the cifs backend, as during a smbd
server shutdown we don't want a synchronous operation which may block
to be called, thus delaying the shutdown.
2007-10-10 13:02:21 -05:00
Andrew Tridgell
3791b97694 r3087: fixed a typo 2007-10-10 13:01:58 -05:00
Andrew Tridgell
fbc6949e95 r3086: fixed smbpid handling in the cifs backend 2007-10-10 13:01:57 -05:00
Andrew Tridgell
76329798ff r3083: fixed a couple of generic mapping errors found with RAW-* and cifs:mapgeneric 2007-10-10 13:01:57 -05:00
Andrew Tridgell
c240c6bca5 r3082: added a "cifs:mapgeneric" option, which tells the cifs backend to use
the ntvfs_generic mapping functions rather than sending the exact
function asked for. This allows the generic mapping functions to be
tested by comparing the behaviour of smbtorture against two cifs
backend shares, one using "cifs:mapgeneric = true" and the other
"cifs:mapgeneric = False"
2007-10-10 13:01:57 -05:00
Andrew Tridgell
3457c1836c r3081: several updates to ntvfs and server side async request handling in
preparation for the full share modes and ntcreatex code that I am
working on.

highlights include:

 - changed the way a backend determines if it is allowed to process a
   request asynchronously. The previous method of looking at the
   send_fn caused problems when an intermediate ntvfs module disabled
   it, and the caller then wanted to finished processing using this
   function. The new method is a REQ_CONTROL_MAY_ASYNC flag in
   req->control_flags, which is also a bit easier to read

 - fixed 2 bugs in the readbraw server code. One related to trying to
   answer a readbraw with smb signing (which can't work, and crashed
   our signing code), the second related to error handling, which
   attempted to send a normal SMB error packet, when readbraw must
   send a 0 read reply (as it has no header)

 - added several more ntvfs_generic.c generic mapping functions. This
   means that backends no longer need to implement such esoteric
   functions as SMBwriteunlock() if they don't want to. The backend
   can just request the mapping layer turn it into a write followed by
   an unlock. This makes the backends considerably simpler as they
   only need to implement one style of each function for lock, read,
   write, open etc, rather than the full host of functions that SMB
   provides. A backend can still choose to implement them
   individually, of course, and the CIFS backend does that.

 - simplified the generic structures to make them identical to the
   principal call for several common SMB calls (such as
   RAW_WRITE_GENERIC now being an alias for RAW_WRITE_WRITEX).

 - started rewriting the pvfs_open() code in preparation for the full
   ntcreatex semantics.

 - in pvfs_open and ipc_open, initially allocate the open file
   structure as a child of the request, so on error we don't need to
   clean up. Then when we are going to succeed the open steal the
   pointer into the long term backend context. This makes for much
   simpler error handling (and fixes some bugs)

 - use a destructor in the ipc backend to make sure that everthing is
   cleaned up on receive error conditions.

 - switched the ipc backend to using idtree for fnum allocation

 - in the ntvfs_generic mapping routines, use a allocated secondary
   structure not a stack structure to ensure the request pointer
   remains valid even if the backend replies async.
2007-10-10 13:01:57 -05:00
Andrew Tridgell
834b09929b r3064: - use UINT8_MAX and UINT16_MAX instead of hex values for idr_get_new() limits
- change idr_get_new() to use > instead of >= in the limit check
2007-10-10 13:01:55 -05:00
Andrew Tridgell
4220914179 r3057: - moved the idtree.c code into lib/
- converted the tid handling to use a idtree instead of bitmaps
2007-10-10 13:01:54 -05:00
Andrew Tridgell
16835a0ef9 r3056: added a id -> pointer data structure (a type of radix tree). This is
an extremely efficient way of mapping from an integer handle (such as
an open file handle) to a pointer (such as the structure containing
the open file information). The code is taken from lib/idr.c in the
2.6 Linux kernel, and is very fast and space efficient. By using
talloc it even has auto cleanup.

This commit converts the handling of open file handles and open
directory search handles to use the idtree routines. In combination
with talloc destructors, this simplifies the structure handling in the
pvfs backend a lot. For example, we no longer need to keep a linked
list of open directory searches at all, and we no longer need to do
linear scans of the list of open files on most operations.

The end result is that the pvfs code is now extremely scalable. You
can have 10s of thousands of open files and open searches and the code
still runs very fast.

I have also added a small optimisation into the file close path, to
avoid looking in the byte range locking database if we know that there
are no locks outstanding.
2007-10-10 13:01:54 -05:00
Andrew Tridgell
7bea9afeed r3055: use talloc_zero_p() 2007-10-10 13:01:54 -05:00
Jelmer Vernooij
f6deb3d065 r3047: Always include a \ again before the pipe name we're opening. Without a
backslash works, but is not like Windows does it.
2007-10-10 13:01:53 -05:00
Jelmer Vernooij
7771b5d8fa r3046: \\PIPE\\ is internal (not actually included on the wire) 2007-10-10 13:01:53 -05:00
Jelmer Vernooij
f3da7c8b44 r3043: Use binding strings for specifying endpoints. The property for
specifying a endpoint is now also 'endpoint' instead of 'endpoints'. The
default endpoint (if none is specified) is still "ncacn_np:[\\pipe\\ifacename]",
where ifacename is the name of the interface.

Examples:

[
  uuid(60a15ec5-4de8-11d7-a637-005056a20182),
  endpoint("ncacn_np:[\\pipe\\rpcecho]", "ncacn_ip_tcp:")
]
interface rpcecho
{
	void dummy();
}

dcerpc_binding is now converted to ep_description in the server, but I hope to
completely eliminate ep_description later on.

The eventual goal of all these changes is to make it easier to add
 transports as I'm going to add support for
 ncalrpc (local RPC over named pipes) and ncacn_unix_stream (Unix sockets).
2007-10-10 13:01:53 -05:00
Andrew Tridgell
a256e71029 r3039: This solves the problem of async handlers in ntvfs backends not being
in the right state when called. For example, when we use the unixuid
handler in the chain of handlers, and a backend decides to continue a
call asynchronously then we need to ensure that the continuation
happens with the right security context.

The solution is to add a new ntvfs operation ntvfs_async_setup(),
which calls all the way down through the layers, setting up anything
that is required, and takes a private pointer. The backend wanting to
make a async calls can use ntvfs_async_setup() to ensure that the
modules above it are called when doing async processing.
2007-10-10 13:00:01 -05:00
Andrew Tridgell
2894dd0ac0 r3035: if the ntvfs layers prior to us have said that we can't perform an
operation asynchronously (such as the nbench module), then ignore lock
timeouts, as they would make no sense
2007-10-10 13:00:00 -05:00
Andrew Tridgell
5ef80f034d r3034: - fixed a bug in message dispatch, when the dispatch function called messaging_deregister()
- added a pvfs_lock_close_pending() hook to remove pending locks on file close

 - fixed the private ptr argument to messaging_deregister() in pvfs_wait

 - fixed a bug in continuing lock requests after a lock that is blocking a pending lock is removed

 - removed bogus brl_unlock() call in lock continue

 - corrected error code for LOCKING_ANDX_CHANGE_LOCKTYPE

 - expanded the lock cancel test suite to test lock cancel by unlock and by close

 - added a testsuite for LOCKING_ANDX_CHANGE_LOCKTYPE
2007-10-10 13:00:00 -05:00
Andrew Tridgell
d5bfc910b1 r3031: added support for lock cancelation, which effectively just triggers an early lock timeout
added support for more of the bizarre special lock offset semantics of w2k3
2007-10-10 13:00:00 -05:00
Andrew Tridgell
4395c0557a r3029: implemented byte range lock timeouts.
This adds a pvfs_wait_message() routine which uses the new messaging
system, event timers and talloc destructors to give a nice generic
async event handling system with a easy to use interface. The
extensions to pvfs_lock.c are based on calls to pvfs_wait_message()
routines.

We now pass all of our smbtorture locking tests, although while
writing this code I have thought of some additonal tests that should
be added, particularly for lock cancel operations. I'll work on that
soon.

This commit also extends the smbtorture lock tests to test the rather
weird 0xEEFFFFFF locking semantics that I have discovered in
win2003. Win2003 treats the 0xEEFFFFFF boundary as special, and will
give different error codes on either side of it. Locks on both sides
are allowed, the only difference is which error code is given when a
lock is denied. Anyone like to hazard a guess as to why? It has
me stumped.
2007-10-10 13:00:00 -05:00
Andrew Tridgell
54fd395025 r3024: run the *_connect() NTVFS initialisation operation as root, to allow
backends to open databases and perform any other privileged
operations that might be needed.
2007-10-10 12:59:59 -05:00
Andrew Tridgell
1cef44505e r3017: nicer memory handling for event_context_merge() 2007-10-10 12:59:58 -05:00
Andrew Tridgell
58a92abd88 r3012: added initial support for byte range locking in the posix vfs. This is
enough for us to pass locktest, but does not yet support lock timeouts
and some of the other esoteric features.
2007-10-10 12:59:57 -05:00
Andrew Tridgell
c6a922dbd8 r2984: fixed the error code for a non-terminal component of a path name not existing 2007-10-10 12:59:54 -05:00
Andrew Tridgell
dac00ef3b0 r2941: added pvfs_flush() implementation to the posix backend 2007-10-10 12:59:50 -05:00
Andrew Tridgell
1dff12fba8 r2934: - changed the unixuid module to use the nt_user_token instead of the server supplied info structure.
- added SID_WORLD and SID_NETWORK to the foreign sids in the
  provisioning, as these are auto-added to the nt_user_token (why is
  that done? Andrew?)
2007-10-10 12:59:49 -05:00
Andrew Tridgell
0acf95d84c r2931: use next_codepoint() to ensure we properly handle multi-byte characters in pvfs_unix_path() 2007-10-10 12:59:49 -05:00
Andrew Tridgell
da0481ac75 r2930: added a security context cache to the unixuid module. The module
doesn't actually leave us in the requested sec context between
requests yet, but it does prevent us from doing the samdb lookup on
every packet.

This change speeds up the BASE-MANGLE test against Samba4 with 5000
operations from 61 seconds to 16 seconds. For reference, Samba3 takes
27 seconds for the same test (the string and filename handling in
Samba4 is much more efficient than Samba3)
2007-10-10 12:59:49 -05:00
Andrew Tridgell
0a475175c5 r2928: - fixed the handling of reserved names (rejecting them with ACCESS_DENIED)
- don't check for '.' specially in checking for legal names. Longhorn
  doesn't do this any more, and its a real pain. Longhorn allows for
  filenames ending in '.', and with as many '.' elements as you like.
2007-10-10 12:59:49 -05:00
Andrew Tridgell
ed52d69e8a r2927: imported the hash2 name mangling code from Samba3 into Samba4, but
heavily modified to suit the Samba4 architecture.

Samba4 with posix backend now passes the BASE-MANGLE test
2007-10-10 12:59:49 -05:00
Andrew Tridgell
f85a0b725d r2926: name->dos.attrib is not valid unless name->exists is true 2007-10-10 12:59:48 -05:00
Andrew Tridgell
4a8b0302ef r2916: longhorn client doesn't bother setting the directory bit in ntcreatex
when opening directories. This change allows samba4 server to work
with longhorn client.
2007-10-10 12:59:48 -05:00
Andrew Tridgell
657103ec62 r2904: - fixed the old style SMBsearch to return the pvfs shortname, not a truncated long name.
- short name can be up to 12 bytes, not 11
2007-10-10 12:59:46 -05:00
Andrew Tridgell
749fa73544 r2893: added very primitive name mangling support to pvfs 2007-10-10 12:59:45 -05:00
Andrew Tridgell
f522728728 r2803: allow unixuid module to work with foreign security principles 2007-10-10 12:59:35 -05:00
Andrew Tridgell
e6ecd31be8 r2800: removed the warning about using the posix ntvfs handler, as it is now
considerably more complete than the simple handler
2007-10-10 12:59:35 -05:00