1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-15 23:24:37 +03:00

218 Commits

Author SHA1 Message Date
Andrew Tridgell
01c0fa722f r4011: get rid of rpc_secdes.h and replace it with a single sane set of
definitions for security access masks, in security.idl

The previous definitions were inconsistently named, and contained many
duplicate and misleading entries. I kept finding myself tripping up
while using them.
2007-10-10 13:06:13 -05:00
Stefan Metzmacher
234166606d r3971: fix compiler warnings
metze
2007-10-10 13:06:09 -05:00
Andrew Tridgell
671a864d8f r3916: w2k3 does not check the max_setup count in nttrans requests 2007-10-10 13:06:05 -05:00
Andrew Tridgell
4468018cb6 r3836: - fixed the handling of NT_STATUS_BUFFER_TOO_SMALL in nttrans server
- fixed revision number on default DACL

- fixed DACL_PRESENT bit in acl query

with these fixes cacls.exe and the GUI ACL editor in w2k both work
against pvfs. The GUI editor is slow as it times out looking up the
SID -> name mappings.
2007-10-10 13:05:58 -05:00
Andrew Tridgell
f49c636e10 r3831: added nttrans server code for query/set security descriptor. This
means ACLs now can be set/fetched from the CIFS NTVFS backend.
2007-10-10 13:05:57 -05:00
Andrew Tridgell
f68a6b6b91 r3830: unified the query/set security descriptor code with the rest of the
queryfileinfo/setfileinfo logic, so querying/setting a security
descriptor is treated as just another file query/set operation.

This will allow NTVFS backends to see the query/set security
descriptor operations as RAW_FILEINFO_SEC_DESC and
RAW_SFILEINFO_SEC_DESC operations.
2007-10-10 13:05:57 -05:00
Andrew Tridgell
fcd0922407 r3826: - added testing of ea lists in NTTRANS CREATE
- fixed push/pull of chained ea lists

- fixed a bug in the nttrans wire encoding
2007-10-10 13:05:57 -05:00
Stefan Metzmacher
b620bdd672 r3810: create a LIB_SECURITY subsystem
- move dom_sid, security_descriptor, security_* funtions to one place
  and rename some of them

metze
2007-10-10 13:05:56 -05:00
Andrew Tridgell
8379ad14e3 r3806: added support to smb_server and pvfs for the NTTRANS Create call. This
call has an optional sec_desc and ea_list.
2007-10-10 13:05:56 -05:00
Volker Lendecke
614dbd8fec r3756: Fix netbios session request reply. The buffer should not be a stack-based
variable that is overwritten later.

Samba3 smbclient still does not like Samba4. In ntlmssp samba3 smbclient
expects an mechlistmic that 4 does not send.

Volker
2007-10-10 13:05:51 -05:00
Jelmer Vernooij
64826da834 r3733: More build system fixes/features:
- Use .mk files directly (no need for a SMB_*_MK() macro when adding a new SUBSYSTEM, MODULE or BINARY). This allows addition of new modules and subsystems without running configure
 - Add support for generating .dot files with the Samba4 dependency tree (as used by the graphviz and springgraph utilities)
2007-10-10 13:05:47 -05:00
Andrew Tridgell
a20cbca788 r3720: fixed the pulling of zero length ucs2 strings in smbd. I found this
bug using ifstest.exe, which is a IFS (Installable File System) test
suite. With this fix I was pleasantly surprised to find that Samba4
passes many (maybe even most?) of the tests in ifstest.
2007-10-10 13:05:46 -05:00
Andrew Tridgell
b8ba6793c1 r3593: fixed the trans2 t2open reply to initialise all bytes (bug found by valgrind) 2007-10-10 13:05:36 -05:00
Andrew Tridgell
07596d8721 r3591: to get a bit more useful info from valgrind I'm disabling the
deliberate over-allocation of request structures in smbd and
libcli/raw code for now.
2007-10-10 13:05:36 -05:00
Andrew Tridgell
ed844192d7 r3573: added trans2open support to smbd and pvfs, and fine-tuned the open->generic ntvfs mapping code. 2007-10-10 13:05:33 -05:00
Andrew Tridgell
eded2ad9c9 r3539: much nicer async open delay code.
The previous code didn't handle the case where the file got renamed or
deleted while waiting for the sharing violation delay. To handle this
we need to make the 2nd open a full open call, including the name
resolve call etc. Luckily this simplifies the logic.

I also expanded the RAW-MUX test to include the case where we do
open/open/open/close/close, with the 3rd open async, and that open
gets retried after both the first close and the 2nd close, with the
first retry failing and the 2nd retry working. The tests the "async
reply after a async reply" logic in pvfs_open().
2007-10-10 13:05:29 -05:00
Andrew Tridgell
1d2f0a55c1 r3531: add support for RAW_OPEN_MKNEW, RAW_OPEN_CREATE and RAW_OPEN_CTEMP in pvfs 2007-10-10 13:05:29 -05:00
Andrew Tridgell
201ff734d4 r3529: fixed signing support for SMBntcancel requests (no reply means seq
number rises by 1, not 2)
2007-10-10 13:05:29 -05:00
Andrew Tridgell
3423e2f414 r3528: added support for the SMBntcancel() operation, which cancels any
outstanding async operation (triggering an immediate timeout).

pvfs now passes the RAW-MUX test
2007-10-10 13:05:28 -05:00
Andrew Tridgell
0dc1deabd0 r3518: fixed some includes to be consistent.
- use #include <XXX.h> for operating system includes
 - use includes relative to include/ for things like system/wait.h

also fixed the thread backend to work somewhat. To fix it properly we need to do this:

 - add a configure test for support for thread local storage (the __thread keyword)
 - refuse to do pthreads if tls doesn't work
 - refuse to do pthreads if seteuid() affects process instead of thread
 - defined THREAD_LOCAL as __thread when WITH_PTHREADS
 - add THREAD_LOCAL to all the global data structures that should be
   thread local (there are quite a few)

right now the thread backend falls over when you hit it with several
connections at once, due to the lack of __thread on some critical
structures.
2007-10-10 13:05:27 -05:00
Andrew Tridgell
0d51511d40 r3507: - added deferred replies on sharing violation in pvfs open. The
deferred reply is short-circuited immediately when the file is
  closed by another user, allowing it to be opened by the waiting user.

- added a sane set of timeval manipulation routines

- converted all the events code and code that uses it to use struct
  timeval instead of time_t, which allows for microsecond resolution
  instead of 1 second resolution. This was needed for doing the pvfs
  deferred open code, and is why the patch is so big.
2007-10-10 13:05:23 -05:00
Andrew Tridgell
8fa456afc9 r3500: cleaned up the AS_USER/AS_GUEST stuff in the core smb packet processing 2007-10-10 13:05:22 -05:00
Andrew Tridgell
4aed1b7921 r3493: fixed a bug in readx reply where the client specifies an invalid high
part of the maxcnt. This caused an allocation failure and server exit.

Note: we need to go back over all the places in the core smb_server
that can cause allocation failures based on user input and fix them to
instead produce a SMB error.

Thanks to Susan for finding this bug.
2007-10-10 13:05:21 -05:00
Andrew Tridgell
c6f4865744 r3481: split out client.h and events.h 2007-10-10 13:05:20 -05:00
Andrew Tridgell
7c4e6ebf05 r3466: split out request.h, signing.h, and smb_server.h 2007-10-10 13:05:17 -05:00
Andrew Tridgell
b97e395c81 r3463: separated out some more headers (asn_1.h, messages.h, dlinklist.h and ioctl.h) 2007-10-10 13:05:17 -05:00
Andrew Tridgell
1087ea830e r3461: another place where "open" was used as a structure element 2007-10-10 13:05:16 -05:00
Andrew Tridgell
4e92e15c4e r3458: more solaris portability fixes, the main one being that we can't use a
structure element called "open" as its a macro on solaris.
2007-10-10 13:05:16 -05:00
Andrew Tridgell
4f33247f1c r3455: some more portability fixes. We nearly compile on solaris again now. 2007-10-10 13:05:15 -05:00
Andrew Tridgell
7b7477ac42 r3453: - split out the auth and popt includes
- tidied up some of the system includes

- moved a few more structures back from misc.idl to netlogon.idl and samr.idl now that pidl
  knows about inter-IDL dependencies
2007-10-10 13:05:13 -05:00
Andrew Tridgell
264ce91810 r3447: more include/system/XXX.h include files 2007-10-10 13:05:12 -05:00
Andrew Tridgell
2e25c71853 r3443: the next stage in the include files re-organisation.
I have created the include/system/ directory, which will contain the
wrappers for the system includes for logical subsystems. So far I have
created include/system/kerberos.h and include/system/network.h, which
contain all the system includes for kerberos code and networking code.
These are the included in subsystems that need kerberos or networking
respectively.

Note that this method avoids the mess of #ifdef HAVE_XXX_H in every C
file, instead each C module includes the include/system/XXX.h file for
the logical system support it needs, and the details are kept isolated
in include/system/

This patch also creates a "struct ipv4_addr" which replaces "struct
in_addr" in our code. That avoids every C file needing to import all
the system networking headers.
2007-10-10 13:05:11 -05:00
Andrew Tridgell
73ea8ee6c2 r3441: some include file cleanups and general housekeeping 2007-10-10 13:05:11 -05:00
Andrew Tridgell
3f902f8d85 r3425: got rid of a bunch of cruft from rewrite.h 2007-10-10 13:05:08 -05:00
Andrew Tridgell
e63edc8171 r3380: - changed the default behaviour of server signing. We now have a default
setting of "server signing = auto", which means to offer signing
  only if we have domain logons enabled (ie. we are a DC). This is a
  better match for what windows clients want, as unfortunately windows
  clients always use signing if it is offered, and when they use signing
  they not only go slower because of the signing itself, they also
  disable large readx/writex support, so they end up sending very small
  IOs for.

- changed the default max xmit again, this time matching longhorn,
  which uses 12288. That seems to be a fairly good compromise value.
2007-10-10 13:05:03 -05:00
Andrew Bartlett
c1b7303c1c r3361: Allow Samba4 (I'm interested in ntlm_auth in particular) to use
Samba3's winbind.  This is also the start of domain membership code in
Samba4, as we now (partially) parse the info3, and use it like Samba3
does.

Andrew Bartlett
2007-10-10 13:05:01 -05:00
Andrew Tridgell
84762a5976 r3355: fixed the old style search code in smb_server to correctly handle
searches that go beyond the negotiated max xmit size
2007-10-10 13:05:00 -05:00
Andrew Tridgell
2dbd2abc5f r3350: fixed a bug with sending multiple replies for the one request, as
happens with trans2, trans and echo. Now that smbd is async we queue
the multiples replies all at once, and now need a way to ensure each
reply gets it own smbsrv_request buffer. I have added
req_setup_secondary() to cope with this.
2007-10-10 13:04:58 -05:00
Andrew Tridgell
938fb44351 r3341: - don't zero the async structure (makes valgrind more useful)
- get rid of req->mid, as it isn't a safe value to use to match
  requests in the server (it is safe in the client code, as we choose
  the mid, but in the server we can't rely on other clients to choose
  the mid carefully)
2007-10-10 13:04:57 -05:00
Stefan Metzmacher
fde64c0dc1 r3336: use a struct ntvfs_async_state to be able to do async chaning of ntvfs modules
the idea is that a passthru module can use ntvfs_async_state_push() before
calling ntvfs_next_*() and in the _send function it calls
ntvfs_async_state_pop() and then call the upper layer send_fn itself

- ntvfs_nbench is now fully async

- the ntvfs_map_*() functions and the trans(2) mapping functions are not converted yet

metze
2007-10-10 13:04:57 -05:00
Andrew Tridgell
30acedb943 r3307: fixed the send side of the smb_server code to be non-blocking. This
means the whole of the SMB handling code is now non-blocking.
2007-10-10 13:04:52 -05:00
Andrew Tridgell
bda978cc2a r3306: the main smb server code now handles non-blocking socket receives. I
haven't marked the socket non-blocking yet as I haven't checked that
the send path is OK for non-blocking.
2007-10-10 13:04:52 -05:00
Andrew Tridgell
a16e4756cd r3304: changed the API to lib/socket/ a little.
The main change is to make socket_recv() take a pre-allocated buffer,
rather than allocating one itself. This allows non-blocking users of
this API to avoid a memcpy(). As a result our messaging code is now
about 10% faster, and the ncacn_ip_tcp and ncalrpc code is also
faster.

The second change was to remove the unused mem_ctx argument from
socket_send(). Having it there implied that memory could be allocated,
which meant the caller had to worry about freeing that memory (if for
example it is sending in a tight loop using the same memory
context). Removing that unused argument keeps life simpler for users.
2007-10-10 13:04:52 -05:00
Andrew Tridgell
7f2c771b0e r3278: - rewrote the client side rpc connection code to use lib/socket/
rather than doing everything itself. This greatly simplifies the
  code, although I really don't like the socket_recv() interface (it
  always allocates memory for you, which means an extra memcpy in this
  code)

- fixed several bugs in the socket_ipv4.c code, in particular client
  side code used a non-blocking connect but didn't handle EINPROGRESS,
  so it had no chance of working. Also fixed the error codes, using
  map_nt_error_from_unix()

- cleaned up and expanded map_nt_error_from_unix()

- changed interpret_addr2() to not take a mem_ctx. It makes absolutely
  no sense to allocate a fixed size 4 byte structure like this. Dozens
  of places in the code were also using interpret_addr2() incorrectly
  (precisely because the allocation made no sense)
2007-10-10 13:04:49 -05:00
Andrew Tridgell
f1c5be396b r3256: get rid of the unused session_claim() and session_yield() calls 2007-10-10 13:04:47 -05:00
Andrew Tridgell
86b5118c2a r3255: - fixed 2 uninitialised data errors found with valgrind
- fixed offset of setup words in nttrans reply
2007-10-10 13:04:47 -05:00
Andrew Tridgell
977bc87d18 r3243: read the high offset count in SMBreadx in the server 2007-10-10 13:04:45 -05:00
Andrew Tridgell
70be45de05 r3234: in SMBreadx, if the client asks for exactly 65535 bytes then don't try
to align the buffer, as that would make the read reply not fit
2007-10-10 13:04:43 -05:00
Andrew Tridgell
560300c002 r3202: return a old DOS error code ERRSRV:ERRbaduid for a bad vuid. This means we now pass the BASE-VUID test. 2007-10-10 13:04:40 -05:00
Andrew Bartlett
5bdf391b3b r3186: Use the properties of the new talloc() system to handle the auth
session info and server info structures.

Andrew Bartlett
2007-10-10 13:04:38 -05:00