1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

928 Commits

Author SHA1 Message Date
Jeremy Allison
8cad5e23b6 Fix bug #7734 - When creating files with "inherit ACLs" set to true, we neglect to apply appropriate create masks.
Jeremy.
2010-10-15 17:38:21 -07:00
Christian Ambach
beb5afea54 s3:gpfs: Add support for the gpfs_ftruncate call
ported from the v3-4-ctdb branch to master
This used to be commit 1f138cc9f4a

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Oct 13 13:34:25 UTC 2010 on sn-devel-104
2010-10-13 13:34:25 +00:00
Christian Ambach
22018b8b88 s3:vfs:gpfs convert sharemodes/leases parameter
convert gpfs:sharemodes and gpfs:leases parameters from a global setting
to a per share setting
2010-10-13 12:53:16 +00:00
Christian Ambach
9e4a386d67 s3:vfs:syncops add option to disable module per share
add an option to disable the syncops module completely for a
share with
  syncops:disable = true
2010-10-13 12:53:16 +00:00
Christian Ambach
c1dad16ede s3:vfs:syncops make it possible to specify syncops:onclose per share
convert the onclose option of the vfs_syncops module from a
global option to a service-specific one

as preparation for further flags, use a struct to store in the VFS handle
instead of just the onclose flag
2010-10-13 12:53:16 +00:00
Andrew Bartlett
f768b32e37 libcli/security Provide a common, top level libcli/security/security.h
This will reduce the noise from merges of the rest of the
libcli/security code, without this commit changing what code
is actually used.

This includes (along with other security headers) dom_sid.h and
security_token.h

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Oct 12 05:54:10 UTC 2010 on sn-devel-104
2010-10-12 05:54:10 +00:00
Jeremy Allison
6f6094076f Make the vfs_acl_xattr and other modules work with NULL SD's. Fix
the "protected" inheritance problem (bleeding up from the POSIX
layer).

Jeremy

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Oct 12 00:57:41 UTC 2010 on sn-devel-104
2010-10-12 00:57:41 +00:00
Günther Deschner
4e9508172d s3-waf: slowly getting modules to match how they look like in old build.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Fri Oct  8 09:31:01 UTC 2010 on sn-devel-104
2010-10-08 09:31:01 +00:00
Günther Deschner
2a1891a9d6 s3-waf: fix dependencies in most of our module subsystems.
Guenther
2010-09-28 09:41:54 +02:00
Volker Lendecke
eadc4b5b78 s3: Lift smbd_server_conn from file_find_fd 2010-09-28 07:36:18 +02:00
Volker Lendecke
75c6e0e5c7 s3: Lift smbd_server_conn from file_find_di_first 2010-09-28 07:36:17 +02:00
Volker Lendecke
fb8686962a s3: Remove smbd_server_conn from files_forall 2010-09-28 07:36:16 +02:00
Günther Deschner
ff95491925 s3-waf: fix dependencies to NDR_XATTR.
Guenther
2010-09-27 07:46:52 +02:00
Günther Deschner
a742e0065a s3-waf: move perfcount subsystem to modules/wscript_build.
Guenther
2010-09-27 00:39:38 +02:00
Günther Deschner
3e35cc42b5 s3-waf: move charset subsystem to modules/wscript_build.
Guenther
2010-09-27 00:39:38 +02:00
Günther Deschner
2839c8f0b2 s3-waf: support --with-acl-support, at least for posix acls.
Guenther
2010-09-27 00:39:37 +02:00
Günther Deschner
89e151167c s3-waf: move VFS subsystem to modules/wscript_build.
Guenther
2010-09-27 00:39:37 +02:00
Günther Deschner
51ea39c5c8 s3-vfs: fix the build of nfs4_acls.c
Guenther
2010-09-26 21:30:02 +02:00
Günther Deschner
4dbd743e46 s3-util_sid: use shared dom_sid_compare_auth and dom_sid_equal_X functions.
Guenther
2010-09-20 14:04:37 -07:00
Björn Jacke
ec643df212 s3/vfs_scannedonly: use smb_msleep instead of nanosleep
Thanks to Joachim Schmitz. This fixes bug #7478
2010-09-16 21:38:19 +02:00
Jeremy Allison
e850958928 Check all SMB_MALLOC returns correctly. Found by Andreas Moroder <andreas.moroder@gmx.net>.
Jeremy
2010-09-10 11:56:26 -07:00
Andrew Bartlett
8c15cf54ae s3-auth Rename NT_USER_TOKEN user_sids -> sids
This is closer to the struct security_token from security.idl
2010-08-31 10:20:14 +10:00
Björn Jacke
a8d8cf00ea vfs_smb_traffic_analyzer: fix off by a second bug
convert_timespec_to_time_t is rounding but here we keep track of milliseconds
here - so we should use plain the tv_sec.
2010-08-30 19:52:10 +02:00
Volker Lendecke
4ccf3a05af s3: Fix the build of the nfs4_acl module 2010-08-30 15:38:12 +02:00
Volker Lendecke
e466bb4af4 s3: Remove smbd_server_fd()
This breaks the perfcol_onefs() build.

Tim, Steve, this use of smbd_server_fd is replacable by calls into
substitute.c. I don't have a onefs environment around to build a fix, so I've
decided to insert an #error, making it not compile. The fix should be pretty
obvious, you can get the socket data via "%I" and "%i" substitutions.
2010-08-29 21:55:25 +02:00
Volker Lendecke
e1055701ff s3: Remove smbd_server_fd from expand_msdfs_target 2010-08-26 22:35:52 +02:00
Günther Deschner
7a05ca2c9c s3-build: use dbwrap.h only where needed.
Guenther
2010-08-26 00:25:55 +02:00
Volker Lendecke
17150dfa9a s3: Lift smbd_server_fd() from read_target_host 2010-08-16 21:33:22 +02:00
Volker Lendecke
96ae457023 s3: Remove get_client_fd() 2010-08-16 13:13:10 +02:00
Günther Deschner
0f8e032628 s3-netlogon: remove global include of netlogon.h.
This reduces precompiled headers by another 4 MB and also slightly speeds up the
build.

Guenther
2010-08-06 15:46:16 +02:00
Günther Deschner
c136b84f0d s3-secrets: only include secrets.h when needed.
Guenther
2010-08-05 10:12:25 +02:00
Christian Ambach
f4e60b42d3 small optimizations for shadowcopy2 module
- remove a compiler warning
- replace strlen usage

Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
2010-08-04 13:56:12 +02:00
Christian Ambach
b77f241b28 fix snapshot content display with hide unreadable
With the hide unreadable option set, snapshots are be displayed
as empty with shadow_copy2 and a NFSv4 ACL module.

To prevent multiple conversions of the paths when the acl call
does a VFS_STAT (as the nfs4acl code does), a check was added
to convert_shadow2_name() so it will not touch paths any more
that look like they have already been converted.

Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
2010-08-04 13:56:11 +02:00
Volker Lendecke
cc2aa855a3 s3: Fix shadow copies after the change for in-path @GMT-
Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
2010-08-04 13:56:11 +02:00
Volker Lendecke
68c6e07591 s3: Fix in-path shadowcopy2 module
Signed-off-by: Christian Ambach <christian.ambach@de.ibm.com>
2010-08-04 13:56:11 +02:00
olivier
72cd5bcd58 make scannedonly notify the scanner if no .scanned: file was found during rename 2010-08-03 17:07:56 +02:00
Volker Lendecke
c59ab01e33 s3: Fix an uninitialized variable 2010-08-01 18:16:19 +02:00
Simo Sorce
849cc65654 s3-smbd: Migrated to new spoolss functions for printing.
Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27 10:27:13 -04:00
Volker Lendecke
27aece7200 s3: Actually use the usecs in aio_fork_suspend
Jeremy, please check!
2010-07-18 21:22:41 +02:00
Volker Lendecke
1946beb679 s3: Fix an uninitialized variable 2010-07-18 21:22:41 +02:00
Andreas Schneider
d11e184ed2 s3-vfs: Make sure that retval isn't used uninitialized.
Found by clang-analyzer.
2010-06-28 12:56:13 +02:00
Volker Lendecke
330a64c72b s3: Explicitly pass sconn to process_blocking_lock_queue 2010-06-12 15:42:56 +02:00
Jeremy Allison
d28fa8faab Rename "allow_smb2" -> "using_smb2" and make the usage clearer. 2010-06-09 19:12:02 -07:00
Björn Jacke
6a6bb768c6 s3: fix calculation of st_blocks in streams_xattr
Thanks to Joachim Schmitz for finding that miscalculation.
2010-06-09 15:27:38 +02:00
Jeremy Allison
62e0a744e2 Fix a long-standing bug with async io that would only be triggered by SMB2.
On normal or shutdown close, ensure we wait for any pending IO to
complete before returning. Implement a blocking aio_suspend inside
vfs_aio_fork.c. These changes pass make test when the aio_fork module
is used by default on the test shares.

Jeremy.
2010-06-04 21:00:24 -07:00
Jeremy Allison
fb79a8d7f0 Oops. Forgot to re-initialize the aio_ex pointer from sival_ptr. 2010-06-04 13:49:38 -07:00
Jeremy Allison
e0acee4919 Change smbd_aio_complete_mid() -> smbd_aio_complete_aio_ex(). Simplifies
the code and eliminates find_aio_ex().

Jeremy.
2010-06-04 11:30:46 -07:00
Volker Lendecke
12d1a3b0a5 s3: Fix the build of the nfsv4 acl code 2010-06-03 16:10:47 +02:00
Günther Deschner
b6a2cea74d s3-security: use shared "Standard access rights.".
Guenther
2010-06-03 11:00:26 +02:00
Günther Deschner
b5c2af9447 s3-security: use shared "File Object specific access rights".
Guenther
2010-06-03 11:00:25 +02:00
Günther Deschner
37b978c343 s3-security: use shared "Generic access rights".
Guenther
2010-06-03 11:00:25 +02:00
Günther Deschner
a75436e3ee s3-security: use shared SECINFO_DACL define.
Guenther
2010-06-03 11:00:12 +02:00
Günther Deschner
e24a59f932 s3-security: use shared SECINFO_SACL define.
Guenther
2010-06-03 10:59:54 +02:00
Günther Deschner
630c27bdad s3-security: use shared SECINFO_GROUP define.
Guenther
2010-06-03 10:59:38 +02:00
Günther Deschner
415d3d5fe7 s3-security: use shared SECINFO_OWNER define.
Guenther
2010-06-03 10:59:15 +02:00
Günther Deschner
bcd4077be6 s3: remove unused librpc/ndr/sid.c.
Guenther
2010-06-03 01:07:17 +02:00
Volker Lendecke
95863bfb5e s3: Add vfs_linux_xfs_sgid
http://oss.sgi.com/bugzilla/show_bug.cgi?id=280 shows an old Linux XFS bug that
still exists: Under certain circumstances the SGID bit is not inherited.
2010-06-02 12:30:51 +02:00
Holger Hetterich
b81f8b131c s3-vfs: Send the share name instead of the path in smb_traffic_analyzer.
In protocol v2, the name of the service should be sent instead of the
path.

Signed-off-by: Andreas Schneider <asn@samba.org>
2010-06-01 22:10:52 +02:00
Günther Deschner
f9f8007361 s3-build: only use ndr_security.h where needed.
Guenther
2010-05-31 11:32:37 +02:00
Simo Sorce
d9cffc01be s3:auth use info3 in auth_serversupplied_info
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-28 00:55:53 +02:00
Holger Hetterich
dd895e526c vfs_smb_traffic_analyzer.c: set the len variable when running protocol v1.
Signed-off-by: Andreas Schneider <asn@samba.org>
2010-05-27 10:27:07 +02:00
Andrew Bartlett
cba7f8b827 s3:dom_sid Global replace of DOM_SID with struct dom_sid
This matches the structure that new code is being written to,
and removes one more of the old-style named structures, and
the need to know that is is just an alias for struct dom_sid.

Andrew Bartlett

Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-21 10:39:59 +02:00
Günther Deschner
d4474ba470 s3-secdesc: use SD_REVISION from security.idl.
Guenther
2010-05-18 12:52:18 +02:00
Günther Deschner
7f6bb48bdf s3-secdesc: remove "typedef struct security_descriptor SEC_DESC".
Guenther
2010-05-18 12:30:12 +02:00
Günther Deschner
8951c8301a s3-secdesc: remove "typedef struct security_acl SEC_ACL".
Guenther
2010-05-18 12:30:12 +02:00
Günther Deschner
a8b01d1f3b s3-secdesc: remove "typedef struct security_ace SEC_ACE".
Guenther
2010-05-18 12:30:11 +02:00
Jelmer Vernooij
b8268cf7b0 s3: Remove use of iconv_convenience. 2010-05-18 11:45:31 +02:00
Günther Deschner
1d2dd47d31 s3-crypto: only include crypto headers when crypto is done.
Guenther
2010-05-18 00:44:27 +02:00
Jeremy Allison
895b99fd6b Be more forgiving on client oplock break failure (as Windows does). Remove a global.
Jeremy.
2010-05-13 11:33:02 -07:00
Jeremy Allison
ed6fa379ef Treat an open of stream ::$DATA as an open of the base file.
This fixes a class of SMB_ASSERT failures when doing stream tests.

Jeremy.
2010-05-13 10:54:15 -07:00
Günther Deschner
24b2dddae4 s3-build: fix the build of vfs_notify_fam.
Guenther
2010-05-06 10:28:31 +02:00
Jeremy Allison
f4092ecec7 Plumb the SMB2 front end into the blocking lock backend.
Metze, you'll probably be happier with this work as it
doesn't abuse tevent in the way you dislike. This is a
first cut at the code, which will need lots of testing
but I'm hoping this will give people an idea of where I'm
going with this.

Jeremy.
2010-04-30 21:03:20 -07:00
Jeremy Allison
ebf6340bb5 Move the global blocking lock records into the smb1 state.
Jeremy
2010-04-29 16:50:15 -07:00
Simo Sorce
168b86c384 s3-smbd: group print relate data in own structure 2010-04-23 14:26:33 -07:00
Jeremy Allison
2bbb8c917e Allow smb2 create requests to be cancelled.
Jeremy.
2010-04-23 13:10:15 -07:00
Jeremy Allison
8f67f873ac Make deferred opens (NT_STATUS_SHARING_VIOLATION) work over SMB2.
Makes SMB2Create call re-entrant internally.
Now this infrastructure is in place, oplocks will follow shortly.
Tested with Win7 client and with W2K8R2.

Jeremy.
2010-04-22 23:52:19 -07:00
Ira Cooper
e1ca451794 s3: Improved support for GAMIN.
Support the FAMNoExists API for gamin to reduce cpu use and problems when
using GAMIN as FAM for vfs_notify_fam.
2010-04-18 15:12:41 +02:00
Jeremy Allison
7984243768 Move to using 64-bit mid values in our internal open file database.
This will allow us to share logic much easier between SMB1 and SMB2
servers.

Jeremy
2010-04-12 21:40:28 -07:00
Jeremy Allison
e15939b456 Plumb SMB2 stubs into all the places we defer SMB1 operations.
Rename functions to be internally consistent. Next step is
to cope queueing single (non-compounded) SMB2 requests to
put some code inside the stubs.

Jeremy.
2010-04-09 19:26:34 -07:00
Volker Lendecke
2754a8e2b6 Fix related to bug #7326 - can't read/write any files with full_audit 2010-04-05 13:50:59 -07:00
Volker Lendecke
59d09cbed8 s3: Use bitmap_talloc in vfs_full_audit.c
This also simplifies the calling convention for init_bitmap() slightly
2010-03-28 15:25:17 +02:00
Volker Lendecke
e541013e20 s3: Fix some nonempty blank lines 2010-03-28 15:25:15 +02:00
Holger Hetterich
462322f6e8 s3: vfs_smb_traffic_analyzer.c: remove warnings from developer build
This patch should remove all warnings coming up when compiling
traffic analyzer with configure.developer.

Re-activate the smb_traffic_analyzer_rmdir function by adding it's
vfs_fn_pointer to vfs_smb_traffic_analyzer_fns.

Copy the mode_t used in smb_traffic_analyzer_open to the corresponding
data structure.
2010-03-25 15:12:30 -07:00
Jeremy Allison
eb8e18476c Fix bug #7283 - vfs_acl_tdb does not work as expected.
both vfs_acl_common.c and vfs_acl_tdb.c were using the connection
handle, thus conflicted. Fix this.

Jeremy.
2010-03-24 10:33:14 -07:00
Volker Lendecke
8195832c6c s3: file_walk_table -> files_forall
This is more in line with the rest of the Samba code, like connections_forall
etc.
2010-03-22 09:30:51 +01:00
Günther Deschner
f48fb0d908 s3-vfs: fix some buildwarnings in traffic analyzer, there are many more.
Holger, please check.

Guenther
2010-03-16 23:03:51 +01:00
Jim McDonough
287304e59e Update copyright 2010-03-16 10:05:38 -04:00
Holger Hetterich
a0e2632e11 s3: vfs_smb_traffic_analyzer.c: add VFS functions for file open and close 2010-03-16 09:52:10 -04:00
Holger Hetterich
f6ae16e318 smb_traffic_analyzer.c: optimize marshalling function and document
Collect all data that is needed, and use only one talloc_asprintf
operation to create the string of common data. This simplifies
the code a bit and is most probably faster than the old method.

Also, #define SMBTA_COMMON_DATA_COUNT as a complete string,
speeding things up because we know the value at compile time.
2010-03-16 09:52:10 -04:00
Holger Hetterich
002193d34b vfs_smb_traffic_analyzer.c: added function
static char *smb_traffic_analyzer_anonymize

This takes a lot of code out of the main functions,
and makes it a bit simpler. Do the anonymization in a function.
Since we already anonymized the username we don't need to do
this a second time in the v2 marshalling function.
2010-03-16 09:52:10 -04:00
Holger Hetterich
c1fb55caa5 Simplify the code a bit by creating the functions:
smb_traffic_analyzer_encrypt - doing the encryption of a data block,
smb_traffic_analyzer_create_header - create the protocol header,
smb_traffic_analyzer_write_data - actually write the data to the
socket.
2010-03-16 09:52:10 -04:00
Holger Hetterich
69d7d6c01a Add the number of common data blocks to the protocol.
Always send the number of common data blocks first. This way, we
can make the protocol backwards compatible. A receiver running with
an older subprotocol can just ignore if a newer sender sends more
common data.

Add a few remarks to the marshalling function. Add two #define lines
defining the protocol subrelease number and the number of common
data blocks to the header file.
2010-03-16 09:52:10 -04:00
Holger Hetterich
4940da2e99 Put all the protocol stuff into a separate header file.
All the structures and the vfs function identifier list is required
by the receiver. It's therefore very handy to have this in an extra
header file.
2010-03-16 09:52:10 -04:00
Holger Hetterich
5b7179d2a3 Add smbta-util to manage the encryption key.
This program allows the administrator to enable or disable AES
encryption when using vfs_smb_traffic_analyzer. It also generates new
keys, stores them to a file, so that the file can be reused on another
client or server.
2010-03-16 09:52:10 -04:00
Holger Hetterich
6437df7d2c Implement AES encryption of the data block.
First try. This runs on 16 bytes long AES block size, and enlarges the
data block with 16 bytes, to make sure all bytes are in. The added
bytes are filled with '.'. It then creates a header featuring the new
length to be send, and finally sends the data block, then returns.

This code is untested, as creating the receiver will be my next step.

To simplify traffic_analyzer's code, this code should run as a function.
It's on the do-to-list.
2010-03-16 09:52:10 -04:00
Holger Hetterich
3f5f2d82bd Implement anonymization for protocol v2.
Since we need to care for the SID too, do the anonymization in the
marshalling function and anonymize both the username and the SID.

Remove the 'A' status flag from the header definition. A listener
could see from the unencrypted header if the module is anonymizing
or not, which is certainly not wanted.
2010-03-16 09:52:09 -04:00
Holger Hetterich
b745730161 Make all remarks compatible to the linux kernel coding styleguide. 2010-03-16 09:52:09 -04:00
Holger Hetterich
81c6b878b1 Added an exact description of the V2 protocol.
I don't think it should have it's place the man page, because this is
developer information.
2010-03-16 09:52:09 -04:00
Holger Hetterich
a45db59480 Move the creation of the header.
Since the header block of the protocol contains the number of bytes to
come, we always send the header itself unmodified.
If we compress or crypt the data we are about to send, the length of the
data to send may change. Therefore, we no longer create the header in
smb_traffic_analyzer_create_string, but shortly before we send the data.
For both cases, encryption and normal, we create our own header, and
send it before the actual data.

In case of protocol v1, we don't need to create an extra header.
Just send the data, and return from the function.
Change a debug message to say that the header for crypted data has
been created.

Add a status flags consisting of 6 bytes to the header. Their function
will be descriped in one of the next patches, which is descriping
the header in a longer comment.
When anonymization and/or encryption is used, set the flags accordingly.
2010-03-16 09:52:09 -04:00
Holger Hetterich
9702dcfa91 Fetch the SID of the user we are running as and send with the common
data.
2010-03-16 09:52:09 -04:00