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

60400 Commits

Author SHA1 Message Date
Simo Sorce
cfa2b7b6bf s4:idl add lsaRSetForestTrustInformation
Signed-off-by: Günther Deschner <gd@samba.org>
2010-03-16 15:12:18 +01:00
Stefan Metzmacher
8c5df22ffa Revert "Revert "s4-smbtorture: skip extended SetValue test against Samba (both dont survive).""
This reverts commit 508c218eb2.

This lets make test fail.

Matthias: please make sure make test still passes when you change things like
this...(maybe add something to knownfail or so)

metze
2010-03-16 15:09:41 +01:00
Stefan Metzmacher
7e859be26a s4:torture/rpc/dsgetinfo.c: fix name resolving for ldap_url
metze
2010-03-16 15:09:41 +01:00
Jim McDonough
287304e59e Update copyright 2010-03-16 10:05:38 -04:00
Matthias Dieter Wallnöfer
c91afe9596 security.idl - push generated code diff 2010-03-16 15:01:46 +01:00
Matthias Dieter Wallnöfer
c3509d88a4 s4:resolve_oids LDB module - not really a change but a nicer method to call "talloc_reference" 2010-03-16 15:01:45 +01:00
Jim McDonough
9447f863d2 Don't exit(0) on error 2010-03-16 09:58:34 -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
56dfc0915c Update the manpage of vfs_smb_traffic_analyzer and add smbta-util. 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
Simo Sorce
8353aa39b6 s4:idl change level to type in lsa_ForestTrustRecord. 2010-03-16 14:48:40 +01:00
Günther Deschner
745f6f2574 s4-smbtorture: avoid printf calls in RPC-WINREG test.
Guenther
2010-03-16 13:11:14 +01:00
Nadezhda Ivanova
a212c1dedb Added a net acl ds command for modification of ACLs on directory objects
At present the command supports only addition of control access rigts, done
so DRS access checks can be tested. It will be expanded to deal with most
ways to modify and view a DS ACL.
Shifted commands a bit. What used to be net acl is now "net acl nt" as apposed
to this, which is "net acl ds"

./bin/net acl ds set --help
Usage: set --objectdn=objectdn --car=control right --action=[deny|allow] --trusteedn=trustee-dn

Options:
  -h, --help            show this help message and exit
  --host=HOST           LDB URL for database or target server
  --car=CAR              The access control right to allow or deny
  --action=ACTION       Deny or allow access
  --objectdn=OBJECTDN   DN of the object whose SD to modify
  --trusteedn=TRUSTEEDN
                        DN of the entity that gets access

  Samba Common Options:
    -s FILE, --configfile=FILE
                        Configuration file

  Credentials Options:
    --simple-bind-dn=DN
                        DN to use for a simple bind
    --password=PASSWORD
                        Password
    -U USERNAME, --username=USERNAME
                        Username
    -W WORKGROUP, --workgroup=WORKGROUP
                        Workgroup
    -N, --no-pass       Don't ask for a password
    -k KERBEROS, --kerberos=KERBEROS
                        Use Kerberos
2010-03-16 13:37:48 +02:00
Günther Deschner
4379b082b8 s3-spoolss: be very strict on OpenPrinter{Ex} failures for bad names.
Guenther
2010-03-16 10:43:57 +01:00
Matthias Dieter Wallnöfer
d7de3fa799 s4:dsdb - fix up warnings 2010-03-16 09:50:39 +01:00
Matthias Dieter Wallnöfer
abe75a5c8c s4:registry - use a macro for reverse byte order 2010-03-16 09:41:03 +01:00
Andrew Bartlett
e3cb626c61 s4:dsdb Show more detail in failure to compute the aggregate DN.
Andrew Bartlett
2010-03-16 19:26:09 +11:00
Andrew Bartlett
2de07761e0 s4:dsdb Change dsdb_get_schema() callers to use new talloc argument
This choses an appropriate talloc context to attach the schema too,
long enough lived to ensure it does not go away before the operation
compleates.

Andrew Bartlett
2010-03-16 19:26:03 +11:00
Andrew Bartlett
bf0b4d7ee3 s4:dsdb Fix warnings in DEBUG() by casting to unsigned long int 2010-03-16 19:26:02 +11:00
Andrew Bartlett
a7ec946ced s4:dsdb/acl Reduce calls to dsdb_get_schema() and add memory context
dsdb_get_schema() isn't a very cheap call, due to the use of LDB
opaque pointers.  We need to call it less, and instead pass it as a
parameter where possible.

This also changes to the new API with a talloc context.

Andrew Bartlett
2010-03-16 19:25:55 +11:00
Andrew Bartlett
1e6fee4185 s4:dsdb Add a memory context for dsdb_get_schema()
When specified, we talloc_reference onto this context to ensure that
pointers found in it are valid for the life of the objects they are
placed into.  (Such as the string form of LDAP attributes).

Andrew Bartlett
2010-03-16 19:25:14 +11:00
Andrew Bartlett
c874b9f42e s4:dsdb Don't error out if we can't get the Aggregate schema DN yet
It's easier to just set it up when we can, then to deal with the
ordering issues in ldb startup.  As long as we have it ready if a real
client ever asks for it, then we should be happy.

Andrew Bartlett
2010-03-16 19:25:14 +11:00
Matthias Dieter Wallnöfer
19aa075642 s4:registry - check also for other registry value types in the generic test 2010-03-16 08:58:32 +01:00
Matthias Dieter Wallnöfer
b7c1444683 s4:registry - add a test for the "REG_DWORD_BIG_ENDIAN" datatype 2010-03-16 08:58:31 +01:00
Matthias Dieter Wallnöfer
2f686d8523 s4:registry - introduce the "REG_DWORD_BIG_ENDIAN" datatype
It's like the normal REG_DWORD type but the byte order swapped
2010-03-16 08:58:31 +01:00
Matthias Dieter Wallnöfer
559575fe40 s4:dsdb/kcc/*.c - fix up wrong typed counters 2010-03-16 08:49:22 +01:00
Erick Nogueira do Nascimento
2a04aa08c6 s4-drs: Torture testcase for DS_REPL_INFO_METADATA_2_FOR_OBJ infoType of DsGetReplInfo()
This torture testcase considers both cases for this infoType: when the flag
DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE is enabled and when not.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-03-16 13:31:08 +11:00
Erick Nogueira do Nascimento
81932f9148 s4-drs: DsGetReplInfo(), infoType = DS_REPL_INFO_METADATA_2_FOR_OBJ
Implementation of the DS_REPL_INFO_METADATA_2_FOR_OBJ infoType for DsGetReplInfo()

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-03-16 13:31:08 +11:00
Craig Miskell
f2cbc9fbb1 Fix bug #7191 - WINS doesn't respond after > 86 #1c registrations. 2010-03-15 16:20:44 -07:00
Michael Adam
9a825dc770 s3:registry-legacy: use talloc_stackframe() instead of NULL in regkey_open_internal()
Michael
2010-03-16 00:12:25 +01:00