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

911 Commits

Author SHA1 Message Date
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
Holger Hetterich
654cff4cc3 Additionally send the vfs function id with the protocol. 2010-03-16 09:52:09 -04:00
Holger Hetterich
27f4f51d56 According to the linux kernel coding styleguide, it's better to
align the switch and it's case statements in the same column.
This saves us one indentation level.
2010-03-16 09:52:09 -04:00
Holger Hetterich
cdd1906728 Don't use typedefs on the VFS function data structures as
typedefs are evil according to the linux kernel coding
styleguide.
2010-03-16 09:52:09 -04:00
Holger Hetterich
8cb5bac9ee Add read,pread,write,pwrite support to the V2 protocol. 2010-03-16 09:52:09 -04:00
Holger Hetterich
541fb436cc Enable AES encryption of the data if a key was found in secrets.tdb. 2010-03-16 09:52:09 -04:00
Holger Hetterich
7bff1eabe5 Add rmdir, chdir, and rename as supported VFS functions 2010-03-16 09:52:09 -04:00
Holger Hetterich
e959bdcca4 The format of data we are sending over the network will be flexible when sending over the network in protocol v2. To be able to do this, we create a new va-list function that is creating the buffer to send. Also it makes it easier for the receiver to parse the data; it sends an initial header containing the full length of the buffer to be send. For the individual strings, it sends sub headers containing the length of the upcoming substring to be send. With the header-data-header-data [..] structure we don't need to quote the sub strings finally enabling having all possible character sets in filenames etc..
In the sending function, implement mkdir to actually send it's data
for testing.
2010-03-16 09:52:08 -04:00
Holger Hetterich
dcff7d3672 Create structs carrying the data of individual VFS functions, and hand those over to the send function, which then casts the void pointer to the struct required by looking at the id. This allows us to return different result data depending on the VFS function that is running. Make the protocol v1 sender compatible to this. Adapt the existing VFS functions to use the new data structures. Make use of the new functionality and extend the mkdir VFS logger function to return the creation mode additionally. 2010-03-16 09:52:08 -04:00
Holger Hetterich
2a643ef10c Introduce smb_traffic_analyzer protocol v2.
From Holger:
Make smb_traffic_analyzer differ the protocol versions to enable the development of version 2 of the protocol. To do this, a new parameter "protocol_version" has been introduced, which can be set to "V1", "V2", or nothing. If protocol_version is not set, V1 will be chosen automatically.

Created an enum for identifying VFS functions in the upcoming protocol v2. Converted the existing VFS functions to use the identifier, and set the read/write bool used in protocol v1 accordingly, also ignore any other VFS functions except read/write/pread/pwrite in v1. Added a first new VFS function for mkdir, which I use for testing and implementing both the sender and receiver for v2.
2010-03-16 09:52:08 -04:00
Jeremy Allison
c35c38075c Remove the bool admin_user from conn struct. We no longer look at this to make access decisions.
Jeremy.
2010-03-15 15:39:41 -07:00
Jeremy Allison
6b2358e15e Pass "connection_struct *conn" into functions that currently use "current_user.XXX"
Will allow me to replace them with accessor functions.

Jeremy.
2010-03-15 14:49:11 -07:00
Jeremy Allison
4b85a0ea7f Rever e80ceb1d73 "Remove more uses of "extern struct current_user current_user;"."
As requested by Volker, split this into smaller commits.

Jeremy.
2010-03-15 14:48:54 -07:00
Jeremy Allison
a2be29dfa3 Missed a couple more uses of conn->server_info->ptok that need to be get_current_nttok(conn)
Centralize the root check into smb1_file_se_access_check()
so this is used by modules/vfs_acl_common.c also.

Jeremy.
2010-03-12 14:31:47 -08:00
Jeremy Allison
e80ceb1d73 Remove more uses of "extern struct current_user current_user;".
Use accessor functions to get to this value. Tidies up much of
the user context code. Volker, please look at the changes in smbd/uid.c
to familiarize yourself with these changes as I think they make the
logic in there cleaner.

Cause smbd/posix_acls.c code to look at current user context, not
stored context on the conn struct - allows correct use of these
function calls under a become_root()/unbecome_root() pair.

Jeremy.
2010-03-12 13:56:51 -08:00
SATOH Fumiyasu
c1fb657afc vfs_netatalk: Segfault if hide files or veto files has no ".AppleDouble" 2010-03-10 16:11:26 -08:00
Björn Jacke
0769a1833a s3: add vfs_crossrename
this module adds optional server-side support for limited rename operations
beyond filesystem boundaries, which was the previously the default.
2010-03-08 17:17:58 +01:00
Björn Jacke
583de7b582 s3: remove cross-device rename support from vfs_default
cross-device rename support has some major limitations:

- on huge files clients will timeout or hang
- ACLs and EA information is not retained

Usually a client will have to handle this. A Windows Server with a reparse
point will also just return NT_STATUS_NOT_SAME_DEVICE. We will now by default
do the same.

I will add a vfs module which will restore the old cross-device renames.
2010-03-08 17:17:52 +01:00