1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-14 01:57:53 +03:00

53 Commits

Author SHA1 Message Date
Andrew Tridgell
2e8d154e7d r8535: no longer rely on seekdir working after a closedir. Instead, keep
directories open, but close search states based on an inactivity
timer, with a default of a 5 minute timeout
2007-10-10 13:29:36 -05:00
Andrew Tridgell
9adacb0d16 r7795: use a share specific allocation rounding 2007-10-10 13:18:37 -05:00
Andrew Tridgell
1f35642bed r7792: make the allocation size rounding in pvfs configurable 2007-10-10 13:18:36 -05:00
Andrew Tridgell
71e281ae2f r7557: trigger a probe at tconx time to see if xattrs are really supported by
the filesystem
2007-10-10 13:18:08 -05:00
Alexander Bokovoy
c623cc6054 r6599: Fix formating using 'linux' C style
Fix memory handling for blkid caches which need to be cleared when session is
done.
2007-10-10 13:16:29 -05:00
Stefan Metzmacher
9ec6c0e977 r5501: check the return of talloc with the NT_STATUS_HAVE_NO_MEMORY()
macro...

metze
2007-10-10 13:10:51 -05:00
Andrew Tridgell
6f79432fe6 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?
2007-10-10 13:09:38 -05:00
Andrew Tridgell
cf6a46c3cb 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
2007-10-10 13:09:22 -05:00
Andrew Tridgell
ec32b22ed5 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.
2007-10-10 13:09:15 -05:00
Stefan Metzmacher
d5fa02746c 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
2007-10-10 13:08:49 -05:00
Andrew Tridgell
0a29fb45c3 r4464: added pvfs backend support for the special CREATOR_OWNER and CREATOR_GROUP inheritance rules 2007-10-10 13:07:53 -05:00
Stefan Metzmacher
c44f4d44b5 r4423: give lp_parm_int() and lp_parm_ulong() default values
metze
2007-10-10 13:07:47 -05:00
Andrew Tridgell
0c927d912c 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
2007-10-10 13:07:28 -05:00
Andrew Tridgell
9ff6ecbdb6 r3990: take advantage of the uid->sid and gid->sid code to create a much
better default NT ACL in pvfs
2007-10-10 13:06:11 -05:00
Andrew Tridgell
052d91c59f r3983: posix:fakeoplocks should default to False, not True ! 2007-10-10 13:06:11 -05:00
Andrew Tridgell
4a52fae82d r3939: - added "posix:fakeoplocks" option for testing with oplocks forced on
- added support for sticky write times after a setfileinfo, by using a
  write_time field in the DosAttrib xattr structure.
2007-10-10 13:06:06 -05:00
Andrew Tridgell
3a1f20d874 r3832: added NT ACL query/set to the posix NTVFS backend. The default ACL is
based on the current nttoken, which is completely wrong, but works as a start.

The ACL is stored in the xattr system.DosAcl, using a NDR encoded IDL
union with a version number to allow for future expansion.

pvfs does not yet check the ACL for file access. At the moment the ACL
is just query/set.

We also need to do some RPC work to allow the windows ACL editor to be
used. At the moment is queries the ACL fine, but displays an error
when it fails to map the SIDs via rpc.
2007-10-10 13:05:57 -05:00
Andrew Tridgell
c1a48a7542 r3799: - added the bit for FS_ATTR_NAMED_STREAMS support into qfsinfo filesystem attribute reply
- pvfs passes the RAW-STREAMS test
2007-10-10 13:05:55 -05:00
Andrew Tridgell
e7afd4403c r3747: - added some of the infrastructure needed for streams support in pvfs
(the IDL, and the load/save meta-data logic)

- changed pvfs_resolve_name() to default to non-wildcard, needing
  PVFS_RESOLVE_WILDCARD to enable wildcards. Most callers don't want
  wildcards, so defaulting this way makes more sense.

- fixed deletion of EAs
2007-10-10 13:05:50 -05:00
Jelmer Vernooij
0d7bb2c40b r3737: - Get rid of the register_subsystem() and register_backend() functions.
- Re-disable tdbtool (it was building fine on my Debian box but other
					machines were having problems)
2007-10-10 13:05:48 -05:00
Andrew Tridgell
6e4fdf01d1 r3615: split out struct pvfs_file_handle from struct pvfs_file. This is in
preparation for adding code to pass the BASE-DENY1 and BASE-DENYDOS
tests, which require a shared filesystem handle for some specific
combinations of two DENY_DOS opens on the same connection.
2007-10-10 13:05:40 -05:00
Andrew Tridgell
c54253ed1b r3545: initial support for using extended attributes to hold extended dos attributes of files.
I decided to use IDL/NDR to encode the attribute, as it gives us a
simple way to describe and extend the saved attributes.

The xattr code needs to hook into quite a few more places in the pvfs
code, but this at least gets the basics done. I will start encoding
alternate data streams streams, DOS EAs etc soon using the same basic
mechanism.

I'll probably stick to "version 1" for the xattr.idl for quite a while
even though it will be changing, as I don't expect anyone to be
deploying this in production just yet. Once we have production users
we will need to keep compatibility by supporting all the old version
numbers in xattr.idl.
2007-10-10 13:05:30 -05:00
Andrew Tridgell
c475877649 r3532: make sharing violation delay in pvfs configurable with "posix:sharedelay = usecs" 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
1087ea830e r3461: another place where "open" was used as a structure element 2007-10-10 13:05:16 -05:00
Andrew Tridgell
32dccf91cf r3288: - updated the path processing in pvfs to pass the RAW-CHKPATH test. This
rather extensive test reveals some really bizarre error code
  handling in w2k3.

- extended and simplified the RAW-CHKPATH test, making it easier to
  read (note that Samba3 fails the new tests - jra may wish to look)

- marked RAW-CHKPATH as pass for pvfs
2007-10-10 13:04:50 -05:00
Andrew Tridgell
367f0c2af4 r3253: - added rudimentary support for ntioctl in pvfs
- catch the SIGXFSZ signal, which for some completely insane reason is
  generated in current Linux systems when you write before the maximum
  offset in a file (maximum is 2^41 on my box). Why wasn't errno good
  enough for this?

- give the right ntstatus code for large offset write failures
2007-10-10 13:04:46 -05:00
Andrew Tridgell
d84ade90ce r3227: added a per-share option "case insensitive filesystem", that tells the
backend that the underlying filesystem is case insensitive, so it can
bypass the directory search if the name is not found.
2007-10-10 13:04:43 -05:00
Andrew Tridgell
a953d4a42c r3161: pvfs now passes the RAW-SEEK test 2007-10-10 13:02:27 -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
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
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
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
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
dac00ef3b0 r2941: added pvfs_flush() implementation to the posix backend 2007-10-10 12:59:50 -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
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
Stefan Metzmacher
3ff03b5cb2 r2751: this is a new ntvfs design which tries to solve:
- the stacking of modules
- finding the modules private data
- hide the ntvfs details from the calling layer
- I set NTVFS_INTERFACE_VERSION 0 till we are closer to release
  (because we need to solve some async problems with the module stacking)

metze
2007-10-10 12:59:30 -05:00
Andrew Tridgell
c315d6ac1c r2660: - converted the libcli/raw/ library to use talloc_increase_ref_count()
rather than manual reference counts

- properly support SMBexit in the cifs and posix backends

- added a logoff method to all backends

With these changes the RAW-CONTEXT test now passes against the posix backend
2007-10-10 12:59:18 -05:00
Andrew Tridgell
2f1b788e09 r2654: fixed some more server memory leaks. We are now down to a single leak
of 16 bytes, caused by the 16 byte data_blob in the smb_signing
code.
2007-10-10 12:59:17 -05:00
Andrew Tridgell
f84c0af35c r2561: completely redid the ntvfs module chaining code, You can now do something like:
ntvfs handler = nbench posix

and the nbench pass-thru module will be called before the posix
module. The chaining logic is now much saner, and less racy, with each
level in the chain getting its own private pointer rather than relying
on save/restore logic in the pass-thru module.

The only pass-thru module we have at the moment is the nbench one
(which records all traffic in a nbench compatibe format), but I plan
on soon writing a "unixuid" pass-thru module that will implement the
setegid()/setgroups()/seteuid() logic for standard posix uid
handling. This separation of the posix backend from the uid handling
should simplify the code, and make development easier.

I also modified the nbench module so it can do multiple chaining, so
if you want to you can do:

   ntvfs module = nbench nbench posix

and it will save 2 copies of the log file in /tmp. This is really only
useful for testing at the moment until we have more than one pass-thru
module.
2007-10-10 12:59:06 -05:00
Andrew Tridgell
98c1c75076 r2524: a simple pvfs rename implementation to make testing easier 2007-10-10 12:59:02 -05:00
Andrew Tridgell
f2fa7fe565 r2436: the second big lump of posix vfs code.
this is still just a skeleton, and many of the functions are just
based on the simple vfs backend, they are there to allow me to run
smbtorture tests against the real parts of the posix backend.
2007-10-10 12:58:52 -05:00
Andrew Tridgell
40d5cae5eb r2404: the first large lump of posix vfs stuff.
this is still very much a skeleton (with many limbs missing too!). I
am committing this early to get some feedback on the approach taken.
2007-10-10 12:58:48 -05:00
Andrew Tridgell
fdb675bbad r2252: don't register the same name twice 2007-10-10 12:58:35 -05:00
Andrew Tridgell
efc8850b9a r2251: forgot to add vfs_posix.h in my last commit
note that this is just a skeleton so far. More to come soon.
2007-10-10 12:58:35 -05:00
Andrew Tridgell
21ef338cbb r2249: got rid of some more mem_ctx elements in structures 2007-10-10 12:58:34 -05:00
Stefan Metzmacher
a908f831cb r1916: return a more clear error, we are miss configure in this case
metze
2007-10-10 12:58:11 -05:00
Stefan Metzmacher
a6c0ca9de5 r1286: rename struct tcon_context to smbsrv_tcon
metze
2007-10-10 12:56:49 -05:00
Stefan Metzmacher
a85d2db582 r1280: rename struct request_context to smbsrv_request
metze
2007-10-10 12:56:48 -05:00