1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-14 19:24:43 +03:00

265 Commits

Author SHA1 Message Date
Andrew Tridgell
d9c15b0f28 r6342: fixed a bad union assumption that caused ACLs to fail on 64 bit machines
Thanks to lars and agruen for finding this
(This used to be commit 2acc06918574b1178eecf3d61026f84f85bb40e1)
2007-10-10 13:11:33 -05:00
Richard Sharpe
c46c6e23ba r6229: Back out these changes ...
(This used to be commit 321fbae51267153102e47845736f2c3a5abfe0be)
2007-10-10 13:11:28 -05:00
Richard Sharpe
66a3750b14 r6219: This change allows us to fall back to authenticating without
DCERPC_SCHANNEL_128 if we fail. Thus, it allows us to work with Windows
NT DCs ...
(This used to be commit 3034b226705c4736d57c9bf4e9470c4d44c72e8e)
2007-10-10 13:11:27 -05:00
Andrew Tridgell
a52a6f1c42 r5666: winxp will use a NTTIME of -1 to mean "don't change" in setfileinfo
basic_info. Add null_nttime() as the equivalent of the existing
null_time() call for cheecking for valid NTTIME values
(This used to be commit 439ce2efbf7d2ba9b17d6b4bfaf651e781140715)
2007-10-10 13:10:58 -05:00
Stefan Metzmacher
218f289ed7 r5501: check the return of talloc with the NT_STATUS_HAVE_NO_MEMORY()
macro...

metze
(This used to be commit 9ec6c0e97765e60ef195296f17d6a27b5d0dcca9)
2007-10-10 13:10:51 -05:00
Andrew Tridgell
a5bd1ccada r5307: removed db_wrap.h from includes.h
(This used to be commit 826baec7b348814a7bbdcdbec8c8526514f25da1)
2007-10-10 13:09:40 -05:00
Andrew Tridgell
e82aad1ce3 r5298: - got rid of pstring.h from includes.h. This at least makes it a bit
less likely that anyone will use pstring for new code

 - got rid of winbind_client.h from includes.h. This one triggered a
   huge change, as winbind_client.h was including system/filesys.h and
   defining the old uint32 and uint16 types, as well as its own
   pstring and fstring.
(This used to be commit 9db6c79e902ec538108d6b7d3324039aabe1704f)
2007-10-10 13:09:38 -05:00
Andrew Tridgell
fedf0b0d91 r5296: - only include the tdb headers where they are needed
- removed the u32 hack in events.c as I think this was only needed as
  tdb.h defines u32. Metze, can you check that this hack is indeed no
  longer needed on your suse system?
(This used to be commit 6f79432fe656164d4770dbce114a30dda5e7bf9a)
2007-10-10 13:09:38 -05:00
Andrew Tridgell
131dc76d56 r5197: moved events code to lib/events/ (suggestion from metze)
(This used to be commit 7f54c8a339f36aa43c9340be70ab7f0067593ef2)
2007-10-10 13:09:30 -05:00
Andrew Tridgell
66170ef8b3 r5185: make all the events data structures private to events.c. This will
make it possible to add optimisations to the events code such as
keeping the next timed event in a sorted list, and using epoll for
file descriptor events.

I also removed the loop events code, as it wasn't being used anywhere,
and changed timed events to always be one-shot (as adding a new timed
event in the event handler is so easy to do if needed)
(This used to be commit d7b4b6de51342a65bf46fce772d313f92f8d73d3)
2007-10-10 13:09:29 -05:00
Stefan Metzmacher
d8d3a5ffe3 r5137: fix types
metze
(This used to be commit add1c579375d08040f722946da31ee3862f9e7ac)
2007-10-10 13:09:26 -05:00
Andrew Tridgell
55d4d36993 r5102: This is a major simplification of the logic for controlling top level
servers in smbd. The old code still contained a fairly bit of legacy
from the time when smbd was only handling SMB connection. The new code
gets rid of all of the smb_server specific code in smbd/, and creates
a much simpler infrastructures for new server code.

Major changes include:

 - simplified the process model code a lot.

 - got rid of the top level server and service structures
   completely. The top level context is now the event_context. This
   got rid of service.h and server.h completely (they were the most
   confusing parts of the old code)

 - added service_stream.[ch] for the helper functions that are
   specific to stream type services (services that handle streams, and
   use a logically separate process per connection)

 - got rid of the builtin idle_handler code in the service logic, as
   none of the servers were using it, and it can easily be handled by
   a server in future by adding its own timed_event to the event
   context.

 - fixed some major memory leaks in the rpc server code.

 - added registration of servers, rather than hard coding our list of
   possible servers. This allows for servers as modules in the future.

 - temporarily disabled the winbind code until I add the helper
   functions for that type of server

 - added error checking on service startup. If a configured server
   fails to startup then smbd doesn't startup.

 - cleaned up the command line handling in smbd, removing unused options
(This used to be commit cf6a46c3cbde7b1eb1b86bd3882b953a2de3a42e)
2007-10-10 13:09:22 -05:00
Andrew Tridgell
cc869963e8 r5050: make sure we translate the generic to the specific bits before doing a
pvfs_access_check_unix().

Fixes a problem with the cifsfs filesystem
(This used to be commit 8ebc61a2297176515d767ef0f67ec912293ab905)
2007-10-10 13:09:17 -05:00
Andrew Tridgell
759da3b915 r5037: got rid of all of the TALLOC_DEPRECATED stuff. My apologies for the
large commit. I thought this was worthwhile to get done for
consistency.
(This used to be commit ec32b22ed5ec224f6324f5e069d15e92e38e15c0)
2007-10-10 13:09:15 -05:00
Andrew Tridgell
bdbd32d3ff r4956: - moved the definition of the mangle context structure into a pvfs_shortname
- made the mangle cache size configurable
(This used to be commit 4adbd01812a53395f175bd6d8e402ad5451f7561)
2007-10-10 13:09:09 -05:00
Andrew Tridgell
6c14b0133d r4944: every event_add_*() caller was having to call talloc_steal() to take
control of the event, so instead build that into the function. If you
pass NULL as mem_ctx then it leaves it as a child of the events
structure.
(This used to be commit 7f981b9ed96f39027cbfd500f41e0c2be64cbb50)
2007-10-10 13:09:08 -05:00
Andrew Tridgell
fd62df6418 r4943: Smplified the events handling code a lot. The first source of
complexity was that events didn't automatically cleanup
themselves. This was because the events code was written before we had
talloc destructors, so you needed to call event_remove_XX() to clean
the event out of the event lists from every piece of code that used
events. I have now added automatic event destructors, which in turn
allowed me to simplify a lot of the calling code.

The 2nd source of complexity was caused by the ref_count, which was
needed to cope with event handlers destroying events while handling
them, which meant the linked lists became invalid, so the ref_count ws
used to mark events for later destruction.

The new system is much simpler. I now have a ev->destruction_count,
which is incremented in all event destructors. The event dispatch code
checks for changes to this and handles it.
(This used to be commit a3c7417cfeab429ffb22d5546b205818f531a7b4)
2007-10-10 13:09:08 -05:00
Andrew Tridgell
4ce2cf2199 r4887: removed a bogus cast
(This used to be commit a034556faa5d15fee44a58be3aea8aee8ffae3c8)
2007-10-10 13:09:03 -05:00
Stefan Metzmacher
9327ec51d1 r4728: split up server_services into:
- stream_socket services
  the smb, ldap and rpc service which sets up a srtam socket end then
  waits for connections
and
- task services
  which this you can create a seperate task that do something
  (this is also going through the process_model subsystem
  so with -M standard a new process for this created
  with -M thread a new thread ...

I'll add datagram services later when we whave support for datagram sockets in lib/socket/

see the next commit as an example for service_task's

metze
(This used to be commit d5fa02746c6569b09b6e05785642da2fad3ba3e0)
2007-10-10 13:08:49 -05:00
Andrew Tridgell
3feb4423f3 r4615: added acl checking on directory search in pvfs
(This used to be commit 0e61a422bd9a1596a284c176f033e958bbeaa8ce)
2007-10-10 13:08:33 -05:00
Andrew Tridgell
c012669b55 r4595: on create check access against parent not child ...
(This used to be commit 5a1a17d3fc771b1e1c61297067f38c87901891d3)
2007-10-10 13:08:31 -05:00
Andrew Tridgell
11ce2cfd70 r4591: - converted the other _p talloc functions to not need _p
- added #if TALLOC_DEPRECATED around the _p functions

- fixes the code that broke from the above

while doing this I fixed quite a number of places that were
incorrectly using the non type-safe talloc functions to use the type
safe ones. Some were even doing multiplies for array allocation, which
is potentially unsafe.
(This used to be commit 6e7754abd0c225527fb38363996a6e241b87b37e)
2007-10-10 13:08:30 -05:00
Andrew Tridgell
ad7da47948 r4584: fix pvfs backend to pass the new enhanced RAW-ACLS test. Easy once I really the
strange behaviour I saw was a w2k3 bug :-)
(This used to be commit e729061bcde25d0565a72222e4720ca8074ef23f)
2007-10-10 13:08:29 -05:00
Andrew Tridgell
ddc10d4d37 r4549: got rid of a lot more uses of plain talloc(), instead using
talloc_size() or talloc_array_p() where appropriate.

also fixed a memory leak in pvfs_copy_file() (failed to free a memory
context)
(This used to be commit 89b74b53546e1570b11b3702f40bee58aed8c503)
2007-10-10 13:08:25 -05:00
Andrew Tridgell
cc55aef7c1 r4547: - added talloc_new(ctx) macro that is a neater form of the common talloc(ctx, 0) call.
- cleaned up some talloc usage in various files

I'd like to get to the point that we have no calls to talloc(), at
which point we will rename talloc_p() to talloc(), to encourage
everyone to use the typesafe functions.
(This used to be commit e6c81d7c9f8a6938947d3c1c8a971a0d6d50b67a)
2007-10-10 13:08:20 -05:00
Andrew Tridgell
5869493626 r4501: when copying files it is common for clients to copy the ACL. When the
ACL is the default ACL this menas the copied file would have an xattr
but the original would not. Avoid this by checking if the ACL being
set is the original ACL, and avoid the copy.
(This used to be commit 1df985a49b200a41eed39023aa668afb233f2e53)
2007-10-10 13:08:15 -05:00
Andrew Tridgell
d4b1657396 r4464: added pvfs backend support for the special CREATOR_OWNER and CREATOR_GROUP inheritance rules
(This used to be commit 0a29fb45c310b4b8c348d187b8ff1833deaac6c3)
2007-10-10 13:07:53 -05:00
Andrew Tridgell
291b02a639 r4448: - fixed access_mask checking on acl set
- honor the change ownership requests of acl set, changing the underlying
  unix owner/group

- fix the access mask on file create with SEC_FLAG_MAXIMUM_ALLOWED
(This used to be commit 5761fa35ab727b51ef1b52459911bafbdd788755)
2007-10-10 13:07:51 -05:00
Stefan Metzmacher
0128bd6d3f r4423: give lp_parm_int() and lp_parm_ulong() default values
metze
(This used to be commit c44f4d44b51789916e50c9da93046d0a15245edc)
2007-10-10 13:07:47 -05:00
Andrew Tridgell
ef179fddb3 r4412: SEC_FILE_READ_ATTRIBUTE is always granted, even if not requested. This was being done
in the full ACL code, but not in the unix access check code, which meant that qfileinfo
was failing for some parameters
(This used to be commit 96d017e521f5a996a7a274682838855d077834bc)
2007-10-10 13:07:45 -05:00
Andrew Tridgell
373bca5bcd r4411: when checking for create permissions, we need to check the parent, not the child!
(This used to be commit 30b4c20b1c9aea94dd2a0611b58860797d244e5a)
2007-10-10 13:07:45 -05:00
Andrew Tridgell
4f16988ead r4410: pvfs_rename_one() should not check for create permissions, as the rename
is always in the same directory
(This used to be commit babf3480a4c29ce28d9a4525c4174a3d765dcbab)
2007-10-10 13:07:44 -05:00
Andrew Tridgell
91190fdad8 r4409: fixed handling of zero access masks for the POSITION_INFORMATION query/set levels
(This used to be commit 75e7229476e1af6ab78fa5b41a7bb67df8e3d2dd)
2007-10-10 13:07:44 -05:00
Andrew Tridgell
e913a48ded r4408: added the remaining access check hooks into pvfs. All calls should now have acl checking,
and obey the various inheritance rules.
(This used to be commit 5fe51807d6b97e68b65f152c0f405e5c5a025d21)
2007-10-10 13:07:44 -05:00
Andrew Tridgell
1c092c5ba6 r4406: - don't call the xattr unlink hook on unlink unless the link count is 1, otherwise
the xattrs of the remaining link are removed

- fix the handling of attribute set on directories
(This used to be commit fa44e3cce00b75656c85378c7825960540d2f282)
2007-10-10 13:07:44 -05:00
Andrew Tridgell
1e4a4c4d6e r4405: added acl inheritance to the mkdir and t2mkdir backends.
(This used to be commit b44d4d17df8af4941740e5d5e0842ca01d8f403c)
2007-10-10 13:07:44 -05:00
Andrew Tridgell
abe22d0351 r4403: - added ACL inheritance in the pvfs backend. ACLs are now inherited on
file and directory creation via ntcreatex. pvfs now passes the
  inheritance test in RAW-ACLS

- cleaned up the error handling a bit in pvfs_open()
(This used to be commit f4dfb63d5395a365961a21388639809fcd3112d0)
2007-10-10 13:07:43 -05:00
Andrew Tridgell
359cf872df r4391: bring the default ACL inline with what w2k3 uses
(This used to be commit 16967f7502ea6d2efa0fc08decc955a1516c3a02)
2007-10-10 13:07:42 -05:00
Andrew Tridgell
a66a985cde r4314: added ACL checking on unlink
(This used to be commit f25c469693517ed993e0379d8b07cd7eb235a669)
2007-10-10 13:07:33 -05:00
Andrew Tridgell
de2ccc5ca9 r4313: fixed a bug in handling new xattrs in the tdb xattr backend
(This used to be commit c66b5a100c1b83adf034087fe2ce49fc77d84161)
2007-10-10 13:07:33 -05:00
Andrew Tridgell
114bcfe837 r4264: fix acl handling on systems without xattr support
(This used to be commit 89845388ea82d9bfbdc6ca8da40f47437a270400)
2007-10-10 13:07:30 -05:00
Andrew Tridgell
ed42a64901 r4263: added support for the trans2 RAW_SEARCH_EA_LIST information
level. This is quite a strange level that we've never seen before, but
is used by the os2 workplace shell.

note w2k screws up this level when unicode is negotiated, so it only
passes the RAW-SEARCH test when you force non-unicode
(This used to be commit 25189b8fbf6515d573e3398dc9fca56505dc37b9)
2007-10-10 13:07:29 -05:00
Andrew Tridgell
b02c5abfb4 r4262: a sniff from kukks showed that the FILE_ATTRIBUTE_NORMAL handling in
pvfs was not correct. This should fix a xcopy bug on OS/2.
(This used to be commit 7251f1fcdd8980e9c49a58e665374025e07bb8d0)
2007-10-10 13:07:29 -05:00
Andrew Tridgell
b706555b3a r4261: added the RAW_FILEINFO_EA_LIST trans2 qfileinfo and qpathinfo
level. Interestingly, this level did now show up on our trans2 scanner
previously as we didn't have the FLAGS2_EXTENDED_ATTRIBUTES bit set in
the client code. Now that we set that bit, new levels appear in
windows servers.
(This used to be commit 0b76d405a73e924dc2706f28bbf1084a59c9b393)
2007-10-10 13:07:29 -05:00
Andrew Tridgell
daae3bbb29 r4247: two more places that need the unlink hook
(This used to be commit 795897b64f3c63baaf53a36eb1611293c2fd8974)
2007-10-10 13:07:29 -05:00
Andrew Tridgell
d5d0651bb9 r4244: add more calls to pvfs_xattr_unlink_hook() on file/dir create, to try to beat race
conditions in the tdb xattr backend
(This used to be commit 3ac840159881ce6eeac27ff0dc324e4d6ac0a70a)
2007-10-10 13:07:28 -05:00
Andrew Tridgell
3b8e83a8c8 r4243: a sniff from kukks showed that the ea_set interface in trans2 setfileinfo allows
for multiple EAs to be set at once. This fixes all the ea code to allow for that.
(This used to be commit b26828bef5d55e5eef0e34a164e76292df45e207)
2007-10-10 13:07:28 -05:00
Andrew Tridgell
50005129ab r4242: added support for storing xattrs in a tdb. This allows all advanced NT
attributes (streams, EAs, NT ACLs, timestamps etc) to be used on
filesystems that don't support xattrs. It also allows for large
streams, although they are very inefficient.

I won't enable this by default, as I really wrote it as a way of
testing large stream support while still using ext3, but perhaps with
a bit more work this could be generally usable.

To enable this use:

   posix:eadb = /home/test/myeas.tdb
(This used to be commit 0c927d912cb65754351189d3a0442004a14aa5c6)
2007-10-10 13:07:28 -05:00
Andrew Tridgell
145702b756 r4230: now that we set the FLAGS2_EXTENDED_ATTRIBUTES flag, we should mark
empty EAs as being of size 4, not size 0
(This used to be commit 76bd6476785e4145437768caa702c01a7801590e)
2007-10-10 13:07:28 -05:00
Andrew Tridgell
d21a55dda7 r4205: fixed the default acl mapping from posix permissions to use the mapped
uid->sid and gid->sid
(This used to be commit 590e1a91bfc719c2d84a9a066fb4e0308b6d9803)
2007-10-10 13:07:26 -05:00