1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00
Commit Graph

1364 Commits

Author SHA1 Message Date
Rusty Russell
1078eb21c4 tdb_delete: check returns for 0, not -1.
TDB2 returns a negative error number on failure.  This is compatible
if we always check for != 0 instead of == -1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
058c4f8492 tdb_fetch_compat: use instead of tdb_fetch.
This is a noop for tdb1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
0e4c358e27 tdb_compat.h: divert every tdb build and includes to tdb_compat
We change all the headers and wscript files to use tdb_compat; this
means we have one place to decide whether to use TDB1 or TDB2.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:34 +02:00
Andrew Bartlett
a1f04e8abc libcli/util Rename common map_nt_error_from_unix to avoid duplicate symbol
The two error tables need to be combined, but for now seperate the names.

(As the common parts of the tree now use the _common function,
errmap_unix.c must be included in the s3 autoconf build).

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Mon Jun 20 08:12:03 CEST 2011 on sn-devel-104
2011-06-20 08:12:03 +02:00
Matthias Dieter Wallnöfer
75e77f9fa0 s4:ntvfs subsystems - rework it using concrete enum values
This changes commit 260bc987b0 to comply
with metze's plans.
2011-06-16 09:05:31 +02:00
Matthias Dieter Wallnöfer
62a1e13b29 s4:ntvfs/smb2/vfs_smb2.c - remove unused variable
Reviewed-by: Jelmer
2011-06-11 16:26:13 +02:00
Andrew Bartlett
a772797a38 librpc/idr Use the Samba3 notify.idl in common.
The extra fields in the structure that Samba4 does not use should not
bother it.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-06-09 12:40:08 +02:00
Andrew Bartlett
d057116cc2 server_id.idl: Bring server_id.idl in common
Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-06-09 12:40:08 +02:00
Matthias Dieter Wallnöfer
260bc987b0 s4:ntvfs subsystem - quiet enum warnings
Simply return "NT_STATUS_INVALID_LEVEL" for unknown types of requests.

Reviewed-by: Tridge
2011-06-09 10:53:36 +02:00
Andrew Bartlett
907cdb5de7 s4-modules Remove lp_ctx from init functions that no longer need it
Now that we don't allow the smb.conf to change the modules dir, many
functions that simply load modules or initialise a subsytem that may
load modules no longer need an lp_ctx.

Andrew Bartlett
2011-06-06 17:37:51 +10:00
Rusty Russell
0204ae6229 lib/util/time.c: timeval_current_ofs_usec
Several places want "microseconds from current time", and several were
simply handing "usecs" values which could be over a million.

Using a helper to do this is safer and more readable.

I didn't replace any obviously correct callers (ie. constants).

I also renamed wait_nsec in source3/lib/util_sock.c; it's actually
microseconds not nanoseconds (introduced with this code in Volker's
19b783cc Async wrapper for open_socket_out_send/recv).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-01 10:38:47 +02:00
Rusty Russell
56e72337b0 lib/util/time.c: timeval_current_ofs_msec
Several places want "milliseconds from current time", and several were
simply doing "msec * 1000" which can (and does in one place) result in
a usec value over 1 a million.

Using a helper to do this is safer and more readable.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-01 10:38:47 +02:00
Stefan Metzmacher
902b1d9a19 s4:ntvfs/cifs: return NT_STATUS_INTERNAL_ERROR if no credentials are available
This is a configuration problem on the server, no invalid parameter
from the client.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed May 18 08:49:00 CEST 2011 on sn-devel-104
2011-05-18 08:49:00 +02:00
Andrew Bartlett
1969aa8eac s4-ntvfs: Rename brl_*() -> brlock_*() to avoid conflict with brlock_init in s3 2011-05-08 10:56:26 +02:00
Andrew Bartlett
3892112e7b lib/util Rename ms_fnmatch() to ms_fnmatch_protocol() to avoid dup symbol
This verison of the function takes a protcol as argument to determine
matching rules.

Andrew Bartlett
2011-05-06 07:51:24 +02:00
Andrew Bartlett
344eb08ee4 nterr: Add mem_ctx for return string from get_nt_error_c_code()
It is clearer to avoid the implicit return on talloc_tos()

Andrew Bartlett
2011-05-06 07:51:24 +02:00
Andrew Bartlett
1475013963 lib/util Move source3 tdb_wrap_open() into the common code.
This #if _SAMBA_BUILD == 3 is very unfortunate, as it means that in
the top level build, these options are not available for these
databases.  However, having two different tdb_wrap lists is a worse
fate, so this will do for now.

Andrew Bartlett
2011-05-06 07:51:24 +02:00
Andrew Bartlett
2742ec0e34 Remove strlower_m() and strupper_m() from source4 and common code.
This function is problematic because a string may expand in size when
changed into upper or lower case.  This will then push characters off
the end of the string in the s3 implementation, or panic in the former
s4 implementation.

Andrew Bartlett
2011-05-03 07:37:07 +02:00
Andrew Bartlett
cdd802af83 s4-messaging Rename messaging -> imessaging
This avoid symbol and structure conflicts between Samba3 and Samba4,
and chooses a less generic name.

Andrew Bartlett
2011-05-03 07:37:07 +02:00
Stefan Metzmacher
2bb637d1cf s4:ntvfs/smb2: use sync version of smb2_connect()
We don't use it in an async fashion anyway.

metze
2011-04-28 20:35:47 +02:00
Andrew Tridgell
5adf85e6af tstream: make npa_tstream a private library
this prevents symbol duplication of the npa_tstream symbols

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-04-06 08:12:19 +02:00
Stefan Metzmacher
b8d0994627 s4:ntvfs/posix: name->dos.attrib isn't initialized in pvfs_access_check_create()
That's why we have the 'container' parameter to indicate
the caller wants to create a directory.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Mar 22 17:39:11 CET 2011 on sn-devel-104
2011-03-22 17:39:11 +01:00
Stefan Metzmacher
3dc999e38b s4:ntvfs/posix: grant SEC_STD_DELETE if the parent grants SEC_DIR_DELETE_CHILD
metze
2011-03-21 22:35:17 +01:00
Jelmer Vernooij
f5c3742a4c source4/ntvfs: Fix prototypes for all functions. 2011-03-19 03:20:05 +01:00
Jelmer Vernooij
e02f1cd9b1 source4/ntvfs/posix: Fix prototypes for all functions. 2011-03-19 03:20:04 +01:00
Jelmer Vernooij
b077ccccfb ntvfs: Add some missing dependencies on tevent/events.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Mon Feb 28 21:57:16 CET 2011 on sn-devel-104
2011-02-28 21:57:16 +01:00
Jelmer Vernooij
136c160064 Use <tdb.h> to include tdb, so the system include file gets used when building against
system tdb.
2011-02-28 21:11:21 +01:00
Jelmer Vernooij
21d926f0ef Use <tevent.h> so the system tevent gets included, if enabled. 2011-02-28 21:11:21 +01:00
Andrew Tridgell
bed374215f s4-idl: rename s4 server_id.idl to server_id4.idl
this avoids a conflict with the new s3 server_id.idl

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-02-18 18:41:00 +11:00
Pavel Shilovsky
738b2abe78 s4: Don't grant level II oplock to a file with byte-range locks.
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Matthias Dieter Wallnöfer <mdw@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Tue Feb 15 11:09:17 CET 2011 on sn-devel-104
2011-02-15 11:09:17 +01:00
Andrew Bartlett
d66150c14d libcli/named_pipe_auth Change from 'info3' to auth_session_info_transport
This changes the structure being used to convey the current user state
from the netlogon-derived 'netr_SamInfo3' structure to a purpose-built
structure that matches the internals of the Samba auth subsystem and
contains the final group list, as well as the final privilege set and
session key.

These previously had to be re-created on the server side of the pipe
each time.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-02-10 06:51:06 +01:00
Andrew Bartlett
a2ce53c1f5 s4-auth Rework auth subsystem to remove struct auth_serversupplied_info
This changes auth_serversupplied_info into the IDL-defined struct
auth_user_info_dc.  This then in turn contains a struct
auth_user_info, which is the only part of the structure that is
mainted into the struct session_info.

The idea here is to avoid keeping the incomplete results of the
authentication (such as session keys, lists of SID memberships etc) in
a namespace where it may be confused for the finalised results.

Andrew Barltett
2011-02-09 01:11:06 +01:00
Matthieu Patou
504be0ac54 s4: make pipes with underscore works also
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sun Jan  9 15:47:01 CET 2011 on sn-devel-104
2011-01-09 15:47:01 +01:00
Andrew Tridgell
ed8ea4ed18 s4-server: move the creation of the IPC$ share into ntvfs
the IPC$ share is only used by the ntvfs backends, and doesn't need to
be created on every load of smb.conf. This fixes a problem with
testparm showing the ipc$ share when it isn't defined in smb.conf.

This also removes the admin$ share, which really shouldn't be on by
default. The admin$ share is used for remote software installation,
and normally exposes the c:\windows directory on a windows
server. That makes no sense on Samba. If for some reason a admin$
share is needed, then the admin can create one as usual. Exposing /tmp
via admin$ by default seems like a bad idea.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-11-11 02:57:04 +00:00
Jelmer Vernooij
4217734a51 credentials: Lowercase library name,
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sun Nov  7 01:48:44 UTC 2010 on sn-devel-104
2010-11-07 01:48:44 +00:00
Jelmer Vernooij
0878399bd5 samdb: Lowercase library name. 2010-11-07 01:52:13 +01:00
Philip M. White
cb9d048f90 s4:waf - fix the build on Gentoo platforms
Signed-off-by: Matthias Dieter Wallnöfer <mdw@samba.org>
2010-11-03 08:22:54 +01:00
Andrew Tridgell
28c1e4d3eb s4-modules: get rid of the remaining static prototypes for modules
the waf build now generates the prototype declarations for us
2010-11-01 18:55:19 +11:00
Jelmer Vernooij
3deece5591 s4: Remove the old perl/m4/make/mk-based build system.
The new waf-based build system now has all the same functionality, and
the old build system has been broken for quite some time.

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sun Oct 31 02:01:44 UTC 2010 on sn-devel-104
2010-10-31 02:01:44 +00:00
Andrew Tridgell
0563c5bacf s4-rpc: split the dcesrv reply code out of dcerpc_server
this allows us to remove a dependency on the dcerpc_server from code
that uses rpc forwarding

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-10-30 23:49:01 +11:00
Jelmer Vernooij
8cf61377aa waf: Remove lib prefix from libraries manually. 2010-10-26 10:17:17 -07:00
Jelmer Vernooij
d9cbcdd410 s4: Drop duplicate 'lib' prefix for private libraries. 2010-10-26 10:17:16 -07:00
Jelmer Vernooij
2933fac7c7 s4: Rename NSS_WRAPPER to nss_wrapper.
Only link to nss_wrapper when it is enabled.

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Oct 23 23:05:44 UTC 2010 on sn-devel-104
2010-10-23 23:05:43 +00:00
Jelmer Vernooij
9757a0c54c s4: Rename UID_WRAPPER to uid_wrapper.
Only link to uid_wrapper when it is enabled.
2010-10-23 22:24:06 +00:00
Jelmer Vernooij
7b8549348a s4: Rename WRAP_XATTR to wrap_xattr. 2010-10-23 22:24:06 +00:00
Jelmer Vernooij
cf26d8a958 s4: Rename LIBEVENTS to libevents. 2010-10-23 22:24:06 +00:00
Andrew Tridgell
56640a8501 s4-rpc_server: split out DCERPC_SHARE as a separate subsystem
this avoids a problem with -Wl,-no-undefined in the ntvfs layer

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-10-21 19:03:27 +11:00
Andrew Tridgell
cef53b289b s4-waf: removed the dependency loop between ntvfs and dcerpc_server
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-10-21 19:03:26 +11:00
Andrew Tridgell
b4dd1accc8 s4-waf: don't depend directly on python modules
build rules should not list dependencies on python modules. Instead,
if code needs the module it should use the python API import calls to
access the module.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-10-21 19:03:26 +11:00
Andrew Tridgell
2dcb596e83 s4-waf: removed dependencies on missing subsystems
these were left over from the old config.mk system
2010-10-21 19:03:24 +11:00
Andrew Bartlett
353d9bc3e4 s4-acl Merge sec_access_check() with se_access_check() from source3/
Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-10-14 02:35:05 +00:00
Jelmer Vernooij
41e55d7894 ntvfs_ipc: add missing dependency on dcerpc_common. 2010-10-11 01:06:35 +02:00
Jelmer Vernooij
9b18d48d51 heimdal: Fix library name of gssapi. 2010-10-05 00:38:34 +02:00
Björn Jacke
3eda2815f6 s4/pvfs: use monotonic time for this timeout 2010-09-10 23:10:26 +02:00
Matthias Dieter Wallnöfer
4def6775b5 s4:ntvfs/posix/pvfs_*.c - quiet Solaris warnings
Fix the function argument of "pvfs_xattr_ndr_load/save".
2010-08-27 19:11:44 +02:00
Andrew Bartlett
6cf29b3e4f s4:security Change struct security_token->sids from struct dom_sid * to struct dom_sid
This makes the structure much more like NT_USER_TOKEN in the source3/
code.  (The remaining changes are that privilages still need to be merged)

Andrew Bartlett
2010-08-23 08:50:55 +10:00
Andrew Bartlett
60086dcf9a s4:ntvfs Don't treat the user SID and primary group SID special for idmap
This simply askes IDMAP about all the user SIDs, rather than the user
and group sid, followed by all but the first two sids from the token.

Andrew Bartlett
2010-08-18 09:30:08 +10:00
Andrew Tridgell
6b266b85cf s4-loadparm: 2nd half of lp_ to lpcfg_ conversion
this converts all callers that use the Samba4 loadparm lp_ calling
convention to use the lpcfg_ prefix.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-16 18:24:27 +10:00
Matthias Dieter Wallnöfer
f6f21202eb s4:ntvfs/ipc/vfs_ipc.c - remove unused code
Spotted by the Solaris 10 compiler
2010-06-29 22:36:03 +02:00
Matthias Dieter Wallnöfer
146dad103b s4:ntvfs/ipc/vfs_ipc.c - add casts to suppress warnings on Solaris 10 2010-06-29 22:35:20 +02:00
Matthias Dieter Wallnöfer
7a3a1cb5a7 s4:ntvfs/simple/svfs_util.c - change an "asprintf" into a "talloc_asprintf" 2010-05-28 10:04:47 +02:00
Matthias Dieter Wallnöfer
69166d3ebb s4:ntvfs/nbench/vfs_bench.c - change a "asprintf" into a "talloc_asprintf" 2010-05-28 10:04:46 +02:00
Andrew Bartlett
285647664c s4:idmap Adjust code to new idmap structure names and layout.
Andrew Bartlett
2010-05-24 23:08:56 +10:00
Andrew Bartlett
6c726745a4 s4:ntvfs rename notify.idl to s4_notify.idl until we can merge this IDL
This IDL is almost common, but the source3 version has a
hand-marshalled server_id.  The s3compat build has problems with two
different idl files of the same name.

Andrew Bartlett
2010-05-24 23:08:11 +10:00
Matthias Dieter Wallnöfer
a05ac3039b s4:ntvfs/ipc/vfs_ipc.c - add more "const" in order to fix warnings 2010-05-21 23:35:57 +02:00
Matthias Dieter Wallnöfer
6836304957 s4:ntvfs/posix/pvfs_wait.c - fix a "calculated value unused" warning
The calculated value is "req" (!= NULL) if "talloc_reference" did work correctly
or it is NULL if we ran out of memory.
2010-05-21 23:35:57 +02:00
Jelmer Vernooij
b8268cf7b0 s3: Remove use of iconv_convenience. 2010-05-18 11:45:31 +02:00
Jelmer Vernooij
f9ca9e46ad Finish removal of iconv_convenience in public API's. 2010-05-18 11:45:30 +02:00
Andrew Bartlett
415bd62764 s4:ntvfs Prepare for a possible future sharing of notify.idl
I would love for notify.idl to be shared between Samba4 and Samba3
some day, and this seems to be the point at which the structure is
initialised.

Andrew Bartlett
2010-05-18 13:21:09 +10:00
Andrew Bartlett
81407b1bff s4:ntvfs Prepare for a possible future sharing of notify.idl
I would love for notify.idl to be shared between Samba4 and Samba3
some day, and this seems to be the point at which the structure is
initialised.

Andrew Bartlett
2010-05-14 23:25:45 +10:00
Stefan Metzmacher
7c4d9fa0e9 s4:ntvfs/ipc: remote // debug comments
metze
2010-04-27 15:11:09 +02:00
Stefan Metzmacher
d94c94fcb9 s4:ntvfs: remove socket_address based functions
metze
2010-04-27 13:02:26 +02:00
Stefan Metzmacher
bb04e90259 s4:ntvfs/ipc: pass the already given tsocket_address structures to the named_pipe_auth code
metze
2010-04-27 13:01:59 +02:00
Stefan Metzmacher
c04d809ba0 s4:ntvfs: add tsocket based addresses to ntvfs_context
metze
2010-04-27 13:01:57 +02:00
Günther Deschner
aae716d044 s4: fix some build warnings.
Guenther
2010-04-26 22:53:00 +02:00
Günther Deschner
1983d0dde7 s4: use generated rap header.
Guenther
2010-04-26 22:52:59 +02:00
Günther Deschner
1ede2a0577 s4: rename RAP share_enum_info to share_info.
Guenther
2010-04-26 22:52:45 +02:00
Andrew Tridgell
553324bc10 s4-waf: move to a universal method of recursing into subdirs
This works with both standalone lib builds and bundled builds
2010-04-06 20:27:25 +10:00
Andrew Tridgell
b690fedef5 s4-waf: removed the AUTOGENERATED markers
we won't be using the mk -> wscript generator again
2010-04-06 20:27:16 +10:00
Andrew Tridgell
d8b91f1120 s4-waf: sys_lease depends on talloc 2010-04-06 20:27:14 +10:00
Andrew Tridgell
b0fb567f04 s4-waf: more dependencies on talloc
these are needed so we can support a system talloc without using the
bundled talloc.h
2010-04-06 20:27:13 +10:00
Andrew Tridgell
208d92a259 s4-waf: cleaned up tevent dependency 2010-04-06 20:27:13 +10:00
Andrew Tridgell
f9eae32f4b s4-waf: mark the wscript files as python so vim/emacs knows how to highlight them 2010-04-06 20:27:11 +10:00
Andrew Tridgell
04fed1f2b6 build: sys_lease_linux needs to be conditionally enabled 2010-04-06 20:27:01 +10:00
Andrew Tridgell
344621cb0f build: conditionally enable inotify 2010-04-06 20:26:55 +10:00
Andrew Tridgell
844acb2260 build: waf quicktest nearly works
Rewrote wafsamba using a new dependency handling system, and started
adding the waf test code
2010-04-06 20:26:48 +10:00
Andrew Tridgell
845e0cbe6f build: commit all the waf build files in the tree 2010-04-06 20:26:48 +10:00
Andrew Tridgell
dd05b6512a build: improve autoconf macros
- enable headers to be specified
- enable both forms of DECL check
- more libreplace checks
- more heimdal checks
- more sysdep checks
2010-04-06 20:26:42 +10:00
Andrew Tridgell
d87ea524d8 build: ntvfs/sysdep configure checks 2010-04-06 20:26:42 +10:00
Andrew Tridgell
e8788808da s4-pvfs_sys: build on systems without O_NOFOLLOW or O_DIRECTORY 2010-03-05 23:07:32 +11:00
Andrew Tridgell
568f0851f0 s4-pvfs_sys: talloc_free should be before errno restore
talloc can potentially change the errno
2010-03-05 23:07:32 +11:00
Andrew Tridgell
2c2156ea95 s4-pvfs: use pvfs_sys_fchmod() 2010-03-05 23:07:32 +11:00
Andrew Tridgell
dae9d20e14 s4-pvfs: set default for perm override based on system features
If the system has O_NOFOLLOW and O_DIRECTORY then we allow for
overrides by default. If not, then we disable by default, as we will
be more vulnerable to symlink attacks
2010-03-05 23:07:32 +11:00
Andrew Tridgell
f7c97c8597 s4-pvfs: use O_FOLLOW one level at a time for security overrides
To prevent symlink attacks we need to use O_NOFOLLOW one level at a
time when processing a root security override
2010-03-05 23:07:32 +11:00
Andrew Tridgell
ace6d75ae6 s4-pvfs: use pvfs_sys_*() functions to wrap posix calls
This allows for root override, which fixes many problems with
mismatches between NT ACL permissions and unix permissions.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-03-05 23:07:31 +11:00
Andrew Tridgell
034bcaf14d s4-pvfs: new pvfs_sys module
The pvfs_sys_*() calls provide wrapper functions for posix file
functions which use root privileges to override EACCES failures if
PVFS_FLAG_PERM_OVERRIDE is set

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-03-05 23:07:31 +11:00
Andrew Tridgell
edd5a572d8 s4-pvfs: added new pvfs flag PVFS_FLAG_PERM_OVERRIDE
This flag indicates that we should use root privileges to override 
unix permissions when the NT ACLs indicate that access should be
granted

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-03-05 23:07:31 +11:00
Andrew Tridgell
2e1637833b s4-pvfs: log more error conditions in NTVFS backend
This should make is easier to track down some bug reports

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-03-05 16:12:06 +11:00
Andrew Tridgell
80a37beb53 s4-pvfs: move the private ntcreatex flags to private_flags
Re-using two of the create_options bits was bound to eventually
cause problems, and indeed, Windows7 now uses one of those bits
when opening text files.

Fixes bug 7189
2010-03-05 16:12:05 +11:00
Andrew Tridgell
8fe783edaf s4-posix: allow change ownership of files if the user has the right privileges
When a user has SEC_PRIV_TAKE_OWNERSHIP or SEC_PRIV_RESTORE they have
permission to change the ownership of a file.

This should fix bug 6987

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-03-03 23:05:23 +11:00
Andrew Tridgell
781ad038c9 s4-krb5: propogate errors from a lot more kerberos functions
We need to be able to give sensible error messages when a kerberos
calls fails. This propogates the kerberos error up the stack to the
caller.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-02-26 13:59:16 +11:00
Andrew Tridgell
e5c83e1adb s4-ntvfs: use TYPESAFE_QSORT() in notify code 2010-02-13 22:36:12 +11:00
Kai Blin
ea055e8c79 s4: Switch to S3-style id mapping data types. 2010-02-11 23:56:35 +01:00
Matthias Dieter Wallnöfer
e34637b2a6 s4:Remove "Py_RETURN_NONE" compatibility code
This was needed only by Python 2.3 which we no longer support.
2010-02-09 17:53:09 +01:00
Matthias Dieter Wallnöfer
16aa0744c6 s4:UID wrapper - Fix includes
The includes of the UID wrapper headers werent't really efficient according
to metze's post on the technical mailing list (http://lists.samba.org/archive/samba-technical/2010-February/069165.html).
To achieve this move the "uid_wrapper.h" includes into "lib/util/unix_privs.c",
 "lib/util/util.c", "ntvfs/posix/pvfs_acl.c" and "ntvfs/unixuid/vfs_unixuid.c".
2010-02-05 19:47:26 +01:00
Matt Kraai
d8071e7ed7 Change uint_t to unsigned int in source4
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-02-02 07:18:18 +01:00
Jelmer Vernooij
8562bbdce5 pyxattr: Move to the same directory as the xattr code. 2010-01-25 15:18:01 +01:00
Matthieu Patou
c442b2534f s4: ntvfs, create push_xattr_blob_tdb_raw and pull_xattr_blob_tdb_raw that do not depend on pvfs objects
Following a talk with tridge on IRC, this patch allow (pull|push)_xattr_blob to be called without
  having a pvfs object. It's handy for programs that wants to manipulate xattr directly.
2010-01-21 07:11:15 +13:00
brendan powers
0708b2a0c9 s4-ntvfs: check if pvfs is NULL in pvfs_logoff
pvfs can be NULL if the directory a share points to does not exist. In
this case, there would be no open files, so it is safe to just return
from the function.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-12-17 11:48:39 +11:00
Andrew Tridgell
d31b6360d6 s4-ntvfs: try to fix bug 6989
bug 6989 is a rare crash that has occurred in production. My best
guess as to the cause is the talloc_free() not being specific enough
as to which parent needs to be freed.
2009-12-16 20:56:20 +11:00
Kamen Mazdrashki
f1d9382b18 s4/smbstreams: Fix memory use after free.
The bug is that sometimes 'streams' is parent for 'new_name'.
With this said, 'new_name' must be dupped before 'streams'
pointer is freed.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-12-08 12:39:11 +11:00
Matthias Dieter Wallnöfer
fed6ac05d0 s4:ntvfs/posix/pvfs_streams - Fix "discard const" warning
I removed one "const" in front of a string declaration to achieve this.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-12-03 21:46:31 +11:00
Matthias Dieter Wallnöfer
1a855eb741 s4:ntvfs/posix/pvfs_resolve - Fix "discard const" warning
I removed two "const"s in front of string declarations to achieve this.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-12-03 21:46:31 +11:00
Andrew Tridgell
b3115f5cdc s4-ntvfs: win7 does not check for the NONE smb2 lock flag on unlock 2009-11-27 19:42:10 +11:00
Andrew Tridgell
186ea099c5 s4-ntvfs: move valid lock range test from smb2 layer to generic code
win7 also fails invalid lock ranges on SMB
2009-11-27 19:42:10 +11:00
Andrew Tridgell
d78921d78c s4-pvfs: fixed access check failure in SFILEINFO test
matching windows behaviour is not always the right thing to do!
2009-11-27 16:05:06 +11:00
Andrew Tridgell
d3d7ca8eea s4-smb2: SMB2 uses NT_STATUS_CANCELLED for cancelled locks 2009-11-27 16:05:06 +11:00
Andrew Tridgell
04f235a9eb s4-smb2: check for invalid SMB2 lock ranges 2009-11-27 16:05:05 +11:00
Andrew Tridgell
aa4c516023 s4-smb2: check for an invalid lock flags combination
UNLOCK with FAIL_IMMEDIATELY is not allowed
2009-11-27 16:05:05 +11:00
Matthias Dieter Wallnöfer
07e971f1c1 s4:ntvfs/posix/pvfs_acl - Remove unused variable "token" 2009-11-20 12:18:45 +01:00
Stefan Metzmacher
77f335042b s4:ntvfs_generic: check for valid SMB2_LOCK flags
metze
2009-11-18 08:24:13 +01:00
Matthias Dieter Wallnöfer
427a22d946 s4:vfs_ipc - fix "ipc_open" for NTTRANS create requests 2009-11-07 20:53:28 +01:00
Andrew Tridgell
4828f92754 s4-pvfs: fill in alignment_requirement (valgrind error) 2009-10-19 20:03:12 +11:00
Andrew Tridgell
e5b36c6eae s4-pvfs: another uninitialised variable
thanks to valgrind for this one
2009-10-19 13:51:17 +11:00
Andrew Tridgell
1219dac5ae s4-pvfs: fixed uninitialised variable
This caused havoc on the build farm. Interestingly, it only affected
gcc 4.3.3, not gcc 4.4.1
2009-10-19 11:59:57 +11:00
Andrew Tridgell
764c09e6bc s4-streams: fixed handling of stream rename and overwrite 2009-10-18 15:06:13 +11:00
Andrew Tridgell
44612c74a6 s4-pvfs: rename with full name gives SHARING_VIOLATION 2009-10-18 15:06:12 +11:00
Andrew Tridgell
83db71e9a7 s4-pvfs: when reporting the file name, don't include the :$DATA suffix 2009-10-18 15:06:12 +11:00
Andrew Tridgell
2d4ad4f504 s4-pvfs: the STREAM_INFORMATION calls don't need any access flags 2009-10-18 15:06:11 +11:00
Andrew Tridgell
edd0ea5225 s4-pvfs: fixed update of stream sizes
The data_blob_free() was changing the size we set the stream to
2009-10-18 15:06:11 +11:00
Andrew Tridgell
a2aa13da32 s4-pvfs: more fixes for ACLs on file creation
The passed in SD is not used to limit the access mask allowed on file
create.
2009-10-18 10:32:06 +11:00
Andrew Tridgell
bae8c93d9b s4-smb2: fixed SMB2 find commands
The change to check for invalid \ prefix on SMB2 paths broke the
internal SMB2 code.
2009-10-18 10:30:10 +11:00
Andrew Tridgell
0463d69883 s4-pvfs: change the handling of access checking on create
Previously when a file was created, we produces the resulting access
mask based on an ACL check against the parent. This change means we
now calculate the inherited ACL much earlier, and produce the
resulting access mask from that ACL, or the user supplied ACL.
2009-10-18 07:13:47 +11:00
Andrew Tridgell
bf6fcc6121 s4-pvfs: when uwrap is enabled, ignore chown errors
chown is expected to fail under uwrap
2009-10-17 13:01:04 +11:00
Andrew Tridgell
6b1ab9cd47 s4-pvfs: don't auto-apply privilege bits in unix acl handling either 2009-10-17 13:01:03 +11:00
Andrew Tridgell
5d5d951311 s4-pvfs: use privileges rather than "uid == 0" in unix access check
This makes the unix access check much closer to the full ACL check
2009-10-17 13:01:03 +11:00
Andrew Tridgell
70b020ca76 s4-pvfs: fixed mask handling for SEC_FLAG_MAXIMUM_ALLOWED
This matches the sec_access_check() code
2009-10-16 10:12:18 +11:00
Andrew Tridgell
c5cfda9e8a s4-pvfs: implement root_fid support in posix backend
Construct the filename from the old handle and the new name.
2009-10-15 20:03:00 +11:00
Andrew Tridgell
3c028ff88b s4-smb: declare root_fid as a file handle
In order to implement root_fid in the s4 SMB server we need to declare
it as a handle type, just as for other fnum values in SMB. This
required some extensive (but simple) changes in many bits of code.
2009-10-15 20:03:00 +11:00
Andrew Tridgell
c73ba89112 s4-pvfs: fixed handling of SEC_FLAG_MAXIMUM_ALLOWED
The CREATEX_ACCESS test shows that this is used as a bit test, not a
equality test
2009-10-15 20:02:59 +11:00
Matthias Dieter Wallnöfer
44df2488e3 s4: fix various warnings (not "const" related ones) 2009-10-02 15:33:48 +02:00
Andrew Bartlett
ba0eba9e09 s4:ntvfs Don't attempt to follow NULL in unixuid_setup_security()
This segfault occoured in cases where we rejected (or never attempted)
the tree connect, so had an invalid private pointer for the logoff
codepath.

Andrew Bartlett
2009-10-02 12:44:58 +02:00
Andrew Tridgell
7c542406b1 s4-pipes: convert pipe names to lowercase and validate
clients may provide arbitrary names, but we only want lowercase alnum
names
2009-09-18 22:58:03 -07:00
Stefan Metzmacher
cda0849ebc s4:ntvfs_ipc: add real named pipe support
We now open a named via the named_pipe_auth
code and process IO via the tstream interface.

This means we support byte mode and message mode
named pipes.

We also correctly issue NT_STATUS_PIPE_BUSY
when a smb_trans request comes in and a read or smb_trans
is already pending.

We also have support for async dcerpc over ncacn_np now,
and we now can remove the ncacn_np specific hacks from the
rpc_server/ code.

metze
2009-09-18 20:34:43 +02:00
Andrew Tridgell
50b16891c4 s4: fixed some shadowed variable warnings 2009-09-08 11:52:44 +10:00
Andrew Tridgell
3b5c6bc971 no need to shout about getting an oplock 2009-08-12 15:20:02 +10:00
Andrew Tridgell
00a8ff5fe9 fixed a problem with group policy writes causing policy corruption
This bug was caused by two things:

  1) in the unix ACL mapping, we were not taking into account group
  write permssions for the SEC_STD_DELETE flag

  2) when a file is created using OVERWRITE mode, a fchmod() would
  fail if the user is not the file owner. We resolve that by only
  doing the fchmod() if the mapped file attribute does not match the
  desired file attribute
2009-08-05 17:51:58 +10:00
Andrew Tridgell
15a6a93d35 fixed the sense of the pvfs_acl uwrap check 2009-08-05 12:08:30 +10:00
Andrew Tridgell
58e5e1ea8d make the UID_WRAPPER skip checks at runtime
This fixes two issues pointed out by Andrew. It adds a runtime
uwrap_enabled() call that wraps the skips needed for uid emulation. It
also makes the skip in the directory_create_or_exist() function only
change the uid checking code, not the permissions code
2009-08-05 11:21:06 +10:00
Andrew Tridgell
fd43e0ee09 added a uid_wrapper library
This library intercepts seteuid and related calls, and simulates them
in a manner similar to the nss_wrapper and socket_wrapper
libraries. This allows us to enable the vfs_unixuid NTVFS module in
the build farm, which means we are more likely to catch errors in the
token manipulation.

The simulation is not complete, but it is enough for Samba4 for
now. The major areas of incompleteness are:

 - no emulation of setreuid, setresuid or saved uids. These would be
   needed for use in Samba3

 - no emulation of ruid changing. That would also be needed for Samba3

 - no attempt to emulate file ownership changing, so code that (for
   example) tests whether st.st_uid matches geteuid() needs special
   handling
2009-08-05 10:51:00 +10:00
Andrew Tridgell
ff388611f4 fixed support for readx greater than 64k
This fixes bug 6547, where smbclient in S3 reads more than 64k at a
time with readx.
2009-08-04 16:01:11 +10:00
Matthias Dieter Wallnöfer
5b4cb31ef1 Cosmetic correction
Changes the order of two commands. First set up the "priv" structure, then
assign it to the "ntvfs" structure.
2009-07-19 15:58:45 +02:00
Stefan Metzmacher
64ee4458cf s4:ntvfs/ipc: replace unnesessary talloc_reference() by a simple talloc_strdup()
metze
2009-07-15 19:58:34 +02:00
Stefan Metzmacher
5240b10eaa s3:ntvfs/posix: avoid unnesessary talloc_reference()
This caused the panics on the RAW-SETFILEINFO.RENAME test,
because we returned an empty strings.

The problem was:

ERROR: talloc_steal with references at ntvfs/posix/pvfs_setfileinfo.c:215
       reference at ntvfs/posix/pvfs_resolve.c:799

metze
2009-07-15 19:24:35 +02:00
Sam Liddicott
131c95edda Upgrade ntvfs_map_*info to ntvfs_map_async_setup/ntvfs_map_async_finish
ntvfs_map_fsinfo, ntvfs_map_qpathinfo, ntvfs_map_qfileinfo used an
old synchronous mapping technique, acceptable on the grounds that
they were only used by the simple vfs which was synchronous.

Other vfs may/do use these functions, and by upgrading them to use the
ntvfs_map_async_setup/ntvfs_map_async_finish framework, they can now be
used asynchronously.

Signed-off-by: Sam Liddicott <sam@liddicott.com>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-06-26 14:39:44 +02:00
Andrew Tridgell
fcc7372975 fixed handling of change notify buffer overruns
When the notify buffer overruns and there are no pending notify
requests, the notify buffer doesn't actually get destroyed, it just
gets put in a state where new notifies are discarded and the next
notify change request will return 0 changes.
2009-06-05 16:25:44 +10:00
Kai Blin
57ea909b32 libwbclient: Add async call framework. 2009-05-30 09:17:37 +02:00
Sam Liddicott
4b21ad9db7 Have ntvfs_connect() accept union smb_tcon *tcon instead of char* sharename
This change brings ntvfs_connect into compliance with other ntvfs functions
which take an ntvfs module, an ntvfs request and an smb io union.

It now becomes the responsibility of ntvfs modules to examine
tcon->generic.level themselves and derive the share name and any other
options
directly; e.g.

	const char *sharename;

	switch (tcon->generic.level) {
	case RAW_TCON_TCON:
		sharename = tcon->tcon.in.service;
		break;
	case RAW_TCON_TCONX:
		sharename = tcon->tconx.in.path;
		break;
	case RAW_TCON_SMB2:
	default:
		return NT_STATUS_INVALID_LEVEL;
	}

	if (strncmp(sharename, "\\\\", 2) == 0) {
		char *p = strchr(sharename+2, '\\');
		if (p) {
			sharename = p + 1;
		}
	}

service.c smbsrv_tcon_backend() is called before ntvfs_connect and fills in
some of the tcon->..out values.
For the case of RAW_TCON_TCONX, it filles out tcon->tconx.out.tid and
tcon->tconx.out.options

For the case of RAW_TCON_TCON it fills out tcon->tcon.out.tid and
tcon->tcon.out.max_xmit

Thus the ntvfs_connect function for vfs modules may override these values
if desired, but are not required to.

ntvfs_connect functions are required to fill in the tcon->tconx.out.*_type
fields, for RAW_TCON_TCONX, perhaps something like:

	if (tcon->generic.level == RAW_TCON_TCONX) {
		tcon->tconx.out.fs_type = ntvfs->ctx->fs_type;
		tcon->tconx.out.dev_type = ntvfs->ctx->dev_type;
	}

Signed-off-by: Sam Liddicott <sam@liddicott.com>

(I fixed the ntvfs_connect() in the smb_server/smb2/
 and the RAW_TCON_SMB2 switch case in the modules)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-05-20 13:32:27 +02:00
Jelmer Vernooij
80420745ff Add a new non-convenience version of push_codepoint. 2009-04-23 17:50:18 +02:00
Andrew Tridgell
d380c49791 use the tevent nesting code to avoid the uid problem in the VFS
backend

The vfs_unixuid module changes the uid of the process when executing
operations on behalf of the user. Within the VFS backend we may rely
on semi-async calls, such as winbind calls, which will call the event
loop again. To cope with this we need to ensure that while inside
those calls we revert the uid to root, then revert back to the
connected user when we have finished with the semi-async calls.
2009-03-19 11:23:49 +11:00
Stefan Metzmacher
66b2604ef1 s4:ntvfs_generic: use talloc_get_type() to remote compiler warnings
metze
2009-02-13 13:44:36 +01:00
Stefan Metzmacher
d25a3c749f s4:pvfs_aio: fix compiler warning
metze
2009-02-05 17:48:09 +01:00
Stefan Metzmacher
fdd6c106cf s4:pvfs: remove compiler warning
metze
2009-02-05 17:48:08 +01:00
Stefan Metzmacher
3d6587c777 s4:pvfs: use talloc_get_type() to cast from void *
metze
2009-02-05 17:48:07 +01:00
Stefan Metzmacher
5fbbddec35 s4:pvfs: fix some talloc related compiler warnings
metze
2009-02-05 17:48:06 +01:00
Stefan Metzmacher
0ac7792e02 s4:libcliraw: s/private/private_data
metze
2009-02-02 13:08:51 +01:00
Stefan Metzmacher
5e9ee54060 s4:ntvfs/unixuid: s/private/priv
metze
2009-02-02 13:08:34 +01:00
Stefan Metzmacher
7bb4461644 s4:ntvfs/smb2: s/private/p
metze
2009-02-02 13:08:34 +01:00
Stefan Metzmacher
42f92109d2 s4:ntvfs/simple: s/private/p
metze
2009-02-02 13:08:33 +01:00
Stefan Metzmacher
2110ef3c5d s4:ntvfs/posix: s/private/private_data
metze
2009-02-02 13:08:33 +01:00
Stefan Metzmacher
7ee87c339b s4:ntvfs/nbench: s/private/nprivates
metze
2009-02-02 13:08:33 +01:00
Stefan Metzmacher
8a95f4d2d6 s4:ntvfs/ipc: s/private/ipriv
metze
2009-02-02 13:08:32 +01:00
Stefan Metzmacher
33e8f47725 s4:ntvfs/common: s/private/private_data
metze
2009-02-02 13:08:32 +01:00
Stefan Metzmacher
0c64c213e8 s4:ntvfs/cifs_posix_cli: s/private/p
metze
2009-02-02 13:08:31 +01:00
Stefan Metzmacher
24fb16f1f6 s4:ntvfs/cifs/: s/private/p
metze
2009-02-02 13:08:31 +01:00
Stefan Metzmacher
50ad5239fd s4:ntvfs: s/private/private_data
metze
2009-02-02 13:08:30 +01:00
Simo Sorce
380874ef86 Fix the mess with ldb includes.
Separate again the public from the private headers.

Add a new header specific for modules.
Also add service function for modules as now ldb_context and ldb_module are
opaque structures for them.
2009-01-30 01:02:03 -05:00
Andrew Tridgell
c81863e868 added support for stream renames in Samba4
This allows the RAW-STREAMS test to work again. We still have some
limitations though:

  - renames of a stream to the default stream doesn't work
  - delete on close handling between streams and the main file 
    is still broken
2009-01-07 16:46:34 +11:00
Stefan Metzmacher
033428d7da tevent: move samba4 stuff from libtevent.m4 to samba.m4
metze
2009-01-04 18:57:18 +01:00
Stefan Metzmacher
b1be241ca5 s4:sysdep/inotify: use tevent_fd_set_auto_close()
metze
2009-01-03 19:58:52 +01:00
Stefan Metzmacher
183c379fe5 s4:lib/tevent: rename structs
list=""
list="$list event_context:tevent_context"
list="$list fd_event:tevent_fd"
list="$list timed_event:tevent_timer"

for s in $list; do
	o=`echo $s | cut -d ':' -f1`
	n=`echo $s | cut -d ':' -f2`
	r=`git grep "struct $o" |cut -d ':' -f1 |sort -u`
	files=`echo "$r" | grep -v source3 | grep -v nsswitch | grep -v packaging4`
	for f in $files; do
		cat $f | sed -e "s/struct $o/struct $n/g" > $f.tmp
		mv $f.tmp $f
	done
done

metze
2008-12-29 20:46:40 +01:00
Stefan Metzmacher
af29b82536 s4:pvfs_aio: use tevent
metze
2008-12-29 19:57:07 +01:00
Stefan Metzmacher
635a973be5 s4:sys_lease_linux: use tevent
metze
2008-12-29 19:57:00 +01:00
Stefan Metzmacher
e36d64728f s4:cluster: remove old/broken ctdb code
We don't need a full copy of ctdb...
If we want to readd cluster support,
we should just use a ctdb client library.

metze
2008-12-29 14:46:09 +01:00
Stefan Metzmacher
a7036d2bd0 s4: Revert "r24284: change brlock_tdb.c to use the dbwrap API. This actually makes the"
This reverts commit 4792285282.

Conflicts:

	source4/ntvfs/common/brlock_tdb.c
	source4/ntvfs/common/config.mk
2008-12-29 14:46:06 +01:00
Jelmer Vernooij
dcc4081f75 Fix more compiler warnings. 2008-12-23 23:22:57 +01:00
Jelmer Vernooij
8df6af213a Use 32-bit smbpid in interface as required by SMB2, in line with
1bdd08227e.
2008-12-23 23:02:54 +01:00
Jelmer Vernooij
bd64688c6a Fix more compiler warnings in various places. 2008-12-23 22:57:11 +01:00
Tim Prouty
d031472227 s4: Fix include path to work with tevent 2008-12-18 15:03:37 -08:00
Stefan Metzmacher
71b3582fe4 s4:ntvfs_generic: pass RAW-OPEN again
This is the samba4 version of commit
9391dad85d

metze
2008-12-18 13:32:49 +01:00
Stefan Metzmacher
081f8883ba s4: fix LIBEVENTS dependencies and use more forward declarations
We should only include events.h where we really need it
and prefer forward declarations of 'struct event_context'

metze
2008-12-17 11:04:45 +01:00
Jelmer Vernooij
0f04beff33 Rename dom_sid.idl -> server_id.idl (since it no longer actually contains the dom_sid). No longer include it from security.idl. 2008-12-16 15:36:18 +01:00
Sam Liddicott
39e468f558 vfs_cifs - Use ntvfs request transport close to close downstream session
When upstream session closes, close the downstream session

Signed-off-by: Sam Liddicott <sam@liddicott.com>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-12-05 12:52:19 +01:00
Sam Liddicott
7d8f3cdbfc Let ntvfs request transport close via ntvfs_request state
[I can't swear that this covers all the smb2 cases, there are some reply
functions that I can't trace properly]

Add NTVFS_ASYNC_STATE_CLOSE bit to ntvfs_request->async_states->state
so that the ntvfs layer can signify that the client transport should
be closed, most useful for proxy servies, and most likely due to a
forwarding transport having been closed.

Signed-off-by: Sam Liddicott <sam@liddicott.com>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2008-12-05 12:52:13 +01:00
Stefan Metzmacher
84b2db8d51 s4:pvfs: correctly check stream names
metze
2008-12-01 14:41:29 -08:00
Stefan Metzmacher
7c07be9cab s4:pvfs: return the correct error code for invalid names
metze
2008-12-01 14:40:51 -08:00
Jelmer Vernooij
a9dbd73b2f Remove last instance of global_loadparm. 2008-11-02 19:32:50 +01:00
Jelmer Vernooij
29a20af75f Remove use of global_loadparm for SMB2 client connections. 2008-11-02 16:20:00 +01:00
Jelmer Vernooij
ff36c52d8c Remove another use of global_loadparm.
Eventually, we should move some of these parameters into a separate
struct (perhaps into smb_transport_options?), to avoid the long lists of
parameters.
2008-11-02 16:07:28 +01:00
Jelmer Vernooij
7a6190e9a7 Remove another use of global_loadparm. 2008-11-02 01:03:26 +01:00
Jelmer Vernooij
d9cbf2b0d9 Remove another use of global_loadparm. 2008-11-01 23:26:36 +01:00
Jelmer Vernooij
7942333712 Remove another use of global_loadparm. 2008-11-01 23:09:18 +01:00
Andrew Tridgell
b1b58a1dcf use glibc sys/inotify.h header
when we first added the inotify code glibc didn't have the inotify
functions yet. Now that it does we can use the official header and
avoid the asm/unistd.h syscall workaround
2008-10-30 15:53:46 +11:00
Stefan Metzmacher
b99926ca5e s4: ntvfs/posix: to set a DACL at open time SEC_DESC_DACL_PRESENT must be set
metze
2008-10-28 17:13:21 +01:00
Jelmer Vernooij
23302413b3 Remove unused include param/param.h. 2008-10-24 16:37:56 +02:00
Jelmer Vernooij
c3415b3e57 Add version of next_codepoint without iconv_convenience. 2008-10-24 16:00:43 +02:00
Jelmer Vernooij
284f523ec7 Remove a few more usages of global_loadparm. 2008-10-24 13:22:12 +02:00
Jelmer Vernooij
8b06312f7e Eliminate another instance of global_loadparm. 2008-10-24 13:13:27 +02:00
Jelmer Vernooij
922a29992e Remove iconv_convenience parameter from simple string push/pull
functions.
2008-10-24 03:40:09 +02:00
Jelmer Vernooij
7ec58471df Split up codepoints code, use consistent _m suffix. 2008-10-24 02:51:03 +02:00
Jelmer Vernooij
87ec1d2532 Make sure prototypes are always included, make some functions static and
remove some unused functions.
2008-10-20 18:59:51 +02:00
Jelmer Vernooij
aaa3e0425d Fix includes. 2008-10-15 02:52:10 +02:00
Jelmer Vernooij
0d99e58f27 Fix include paths for files that aren't compiled - breaks dependency
file generation.
2008-10-12 04:41:53 +02:00
Jelmer Vernooij
9565999755 Fix include paths to new location of libutil. 2008-10-11 21:31:42 +02:00
Jelmer Vernooij
181ee01da6 Pass session options around; saves another use of global_loadparm. 2008-09-30 02:47:19 +02:00
Andrew Tridgell
d2bdb8fb16 empty access mask is only denied on SMB2 2008-09-24 18:10:23 -07:00
Andrew Tridgell
d3c6c71ff2 zero access mask should give ACCESS_DENIED 2008-09-24 18:10:23 -07:00
Andrew Tridgell
f4e212323f added some debug code 2008-09-23 12:09:56 +10:00
Jelmer Vernooij
8ec93160d5 Fix last few includes to use new tdb location. 2008-09-16 16:09:50 +02:00
Stefan Metzmacher
548ed8d958 ntvfs_generic: fix handling of create_options for SMB2
metze
(This used to be commit cbd585d2a1)
2008-08-14 13:13:51 +02:00
Stefan Metzmacher
cc60d5a032 pvfs: fix handling of create_option flags
metze
(This used to be commit 3c6cadf768)
2008-08-14 13:13:51 +02:00
Andrew Tridgell
2ecda9fde4 we can't query the ACL on a new file till it exists!
(This used to be commit 4f6646f069)
2008-07-24 14:21:52 +10:00
Andrew Tridgell
1d12c64066 fixed spelling error
(This used to be commit 341f64834e)
2008-07-24 14:19:49 +10:00
Andrew Bartlett
853194c308 More 'must be ignored' options from the MS-SMB doc.
Also in particular the 'sync' flags (which Samba has traditionally
ignored).

Thanks to Olivier Salamin <olivier.salamin@gmail.com> for pointing out
more flags that needed to be handled.

Andrew Bartlett
(This used to be commit 370bb39cd7)
2008-07-18 18:40:19 +10:00
Andrew Bartlett
e92125e631 Ignore and handle more NT Create & X options.
The MS-SMB document explains that some of these options should be
ignored.  The test proves it.

/* Must be ignored by the server, per MS-SMB 2.2.8 */
/* Must be ignored by the server, per MS-SMB 2.2.8 */

If we implement HSM in samba4 (likely) we should honour this bit.
/* Don't pull this file off tape in a HSM system */

Andrew Bartlett
(This used to be commit 502739ff90)
2008-07-16 14:00:18 +10:00
Stefan Metzmacher
98014c5668 pvfs: create a pvfs_acl subsystem
That means that the pvfs_acl implementations no longer register
as ntvfs modules (which was wrong)

metze
(This used to be commit 89e90556ec)
2008-06-28 10:30:25 +02:00
Stefan Metzmacher
c9d2570ce3 pvfs: pvfs_aio should be a subsystem instead of an extra ntvfs module
metze
(This used to be commit c904e28bef)
2008-06-28 10:30:18 +02:00
Andrew Tridgell
70219bee13 Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-test
(This used to be commit 9d74201e46)
2008-06-03 15:11:42 -07:00
Stefan Metzmacher
b800af662c pvfs: use utimes() instead of utime() to get better timestamp resolution
Note: that libreplace always provides utimes()

metze
(This used to be commit 61bad69e2d)
2008-06-03 14:05:04 +02:00
Stefan Metzmacher
6e52c4feb8 pvfs_close: correctly handle the write time updates passed by close()
metze
(This used to be commit 7f033ce4fb)
2008-06-03 14:03:52 +02:00
Stefan Metzmacher
60759b64a7 pvfs: correctly set the write time in the handle destructor
metze
(This used to be commit 58c118ab4d)
2008-06-03 14:03:51 +02:00
Stefan Metzmacher
d1bb49a2ab pvfs_setfileinfo: update the write time in the opendb
metze
(This used to be commit 418e2592b4)
2008-06-03 14:03:51 +02:00
Stefan Metzmacher
ad19d5455e pvfs: trigger a write time update 2 seconds after the first write
metze
(This used to be commit c8e15d4c18)
2008-06-03 14:03:50 +02:00
Stefan Metzmacher
47b54c7680 pvfs: add posix:writetimeupdatedelay option
metze
(This used to be commit c3ba19ca62)
2008-06-03 14:03:50 +02:00
Stefan Metzmacher
c43591c216 pvfs: add PVFS_RESOLVE_NO_OPENDB flag and get the write time from the opendb
By default get the current write time from the opendb,
but allow callers to pass PVFS_RESOLVE_NO_OPENDB
for performance reasons, if they don't need to the write time.

metze
(This used to be commit def52cc098)
2008-06-03 14:03:50 +02:00
Stefan Metzmacher
0827b08a43 opendb: add write time handling
metze
(This used to be commit 3868d8ce63)
2008-06-03 14:03:49 +02:00
Andrew Tridgell
538f624fe0 it is not valid to set a UNLOCK flag on a lock request
(This used to be commit 63f3155729)
2008-06-03 09:36:02 +10:00
Andrew Tridgell
405e64c437 more updates for new info levels
(This used to be commit 85d1873ee9)
2008-06-02 11:05:06 +10:00
Andrew Tridgell
8da3217d1b smbpid is 32 bit, and update SMB2 locking per MS-SMB2
The UNLOCK bit is only used from the first lock structure
(This used to be commit 9483b7c137)
2008-06-02 11:04:13 +10:00
Andrew Tridgell
1bdd08227e smbpid needs to be 32 bit now to cope with SMB2
(This used to be commit a2854fd6ea)
2008-06-02 11:03:19 +10:00
Andrew Tridgell
beaa01e403 implemented client side SMB2 signing
This doessn't work against Windows yet, and I've submitted a WSPP
request for clarification of the docs to try and find out
why. Meanwhile this is no worse than what we had, as it only gets used
when the server demands signing, and we didn't work then anyway.
(This used to be commit b788096add)
2008-05-30 17:03:54 +10:00
Andrew Tridgell
b33dba845e don't emulate broken SMB2 locking behaviour from windows
(This used to be commit c50e7a15f9)
2008-05-30 07:28:29 +10:00
Andrew Tridgell
f0bc7c07fe don't mask out SEC_FILE_READ_ATTRIBUTE on SMB2
(This used to be commit 1dfa50a480)
2008-05-29 22:22:42 +10:00
Andrew Tridgell
383d10577c fixed the error code for bad SMB2 ioctls
(This used to be commit b1d2d388ec)
2008-05-29 20:46:18 +10:00
Andrew Tridgell
c86dc11be6 added support for returning the maximal access MXAC tag in SMB2 create
(This used to be commit 4eb49335d5)
2008-05-29 19:16:26 +10:00
Andrew Tridgell
21d770a02c querying the ACCESS_INFORMATION is always allowed
(This used to be commit 25d5b94d6a)
2008-05-29 18:23:33 +10:00
Andrew Tridgell
e42ded24a0 SEC_FILE_READ_ATTRIBUTE is only automatically granted on SMB, not SMB2
(This used to be commit 7bff069142)
2008-05-29 18:23:20 +10:00
Andrew Tridgell
67226f054b fixed create_action for truncated files
(This used to be commit 884c32fcef)
2008-05-28 22:44:20 +10:00
Andrew Tridgell
86d69fd4b6 SMB2 doesn't have NAME_INFORMATION level
(This used to be commit a431d51b11)
2008-05-28 21:48:40 +10:00
Andrew Tridgell
fa0bc441e3 don't allow a file to be changed to a directory with setfileinfo
(This used to be commit ad7acbf8bf)
2008-05-28 20:06:04 +10:00