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

60380 Commits

Author SHA1 Message Date
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
Michael Adam
c27c430b21 s3:smbcacls: also honour the "--sddl" flag when setting ACLs.
Michael
2010-03-16 00:12:25 +01:00
Volker Lendecke
3b73698715 s3: Fix an uninitialized variable read
Found by Laurent Gaffie <laurent.gaffie@gmail.com>

Thanks for that,

Volker
2010-03-15 16:01:48 -07: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
704a607e3c Fix bug #7188 - Logic error in check of total_data for call_trans2mkdir()
Make ea data checks identical for trans2open and trans2mkdir.

Jeremy.
2010-03-15 15:04:18 -07:00
Jeremy Allison
33bd9b4bb9 Remove reference to conn->admin_user in preparation for removal.
We use (uid_t)0 here not sec_initial_uid() as make test uses a single user context.
I will revisit this when all the uid check changes are complete.

Jeremy.
2010-03-15 14:49:26 -07:00
Jeremy Allison
b32ce075f8 Simplify processing of "admin user". If a user is an admin_user ensure their conn token is uid 0.
This simplifies change_to_user() and removes special processing of the assignments
we pass to set_sec_ctx().

Jeremy.
2010-03-15 14:49:20 -07:00
Jeremy Allison
984eee7e29 Switch over to using get_currect_XXX() accessor functions.
Jeremy.
2010-03-15 14:49:15 -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
5d6610a215 Add accessor functions for current uid, gid, unix token, NT token and vuid.
Jeremy.
2010-03-15 14:49:06 -07:00
Jeremy Allison
1332ce52b7 We don't need to treat the token differently in the conn->admin_user case, it should already be pointing to a token with uid == 0.
Jeremy.
2010-03-15 14:49:00 -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
Günther Deschner
83b9e12513 s4-smbtorture: add simple printer rename test to RPC-SPOOLSS-PRINTER.
Guenther
2010-03-15 18:35:19 +01:00
Günther Deschner
6f36e9d504 testprogs: add EnumPrinterData test to win32 spoolss test.
Guenther
2010-03-15 17:27:12 +01:00
Günther Deschner
08ec9b7e73 s4-smbtorture: fill PrinterDriverData with more values for consistency test.
Guenther
2010-03-15 17:27:12 +01:00
Stefan Metzmacher
386f15c62b s3:smbd: make sure we always have a valid talloc stackframe
metze
2010-03-15 15:08:24 +01:00
Stefan Metzmacher
d23581b4d7 talloc_stack: reset stackframe pointers to NULL
This makes it easier to debug the code in future.

metze
2010-03-15 15:08:24 +01:00
Stefan Metzmacher
10ed809a1a talloc_stack: make sure we never let talloc_tos() return ts->talloc_stack[-1]
In smbd there's a small gab between TALLOC_FREE(frame); before
be call smbd_parent_loop() where we don't have a valid talloc stackframe.

smbd_parent_loop() calls talloc_stackframe() only within the while(1) loop.
As DEBUG(2,("waiting for connections")) uses talloc_tos() to construct
the time header for the debug message we crash on some systems.

metze
2010-03-15 15:08:23 +01:00
Günther Deschner
1eb0fbe68d s4-smbtorture: cleanup data after enumdata{ex} consistency test.
Guenther
2010-03-15 14:55:25 +01:00
Günther Deschner
c9cc26ef62 s3-spoolss: Fix _spoolss_EnumPrinterData.
Guenther
2010-03-15 14:41:58 +01:00
Günther Deschner
06cbf05e8b s4-smbtorture: when cross checking enumdata{ex} make sure to have at least one entry.
Guenther
2010-03-15 14:16:03 +01:00