1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-31 17:18:04 +03:00
Commit Graph

21332 Commits

Author SHA1 Message Date
Simo Sorce
376fa0d66e s4:lsa avoid confusing ourselves over sam_ldb
Do not use policy_state->sam_ldb and trusted_domain_state->policy->sam_ldb
interchangeably all over the place. Just use sam_ldb everywhere and make the
code slightly more readable.
2010-02-24 18:35:48 -05:00
Simo Sorce
4930de5cd9 s4:lsa cleanup trailing spaces and tabs 2010-02-24 18:35:47 -05:00
Simo Sorce
71c20f703b Revert "s4-smb: Migrate named_pipe_server to tsocket."
This reverts commit 69d5cea2e5.

This commit causes issues with the RPC server, revert it until we find the
exact issue and possibly have a torture test to avoid it happening again.
Found playing with w2k8r2 and forest trusts.
2010-02-24 18:35:47 -05:00
Andrew Bartlett
8d03b5e224 s4:install Fix bug #7149 reported by JHT.
We need to install named.conf.update for provision to succeed from the
installed setup file.

Andrew Bartlett
2010-02-25 09:50:03 +11:00
Andrew Bartlett
612eec4aa7 s4:scripting/devel Allow tmpfs script to be re-run
By doing the unmount, we can avoid double-mounting st and bin
2010-02-25 08:26:09 +11:00
Matthias Dieter Wallnöfer
fc4c839bc8 s4:DNS update - change "i" to be unsigned
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-02-25 08:17:12 +11:00
Matthias Dieter Wallnöfer
ec536a0121 s4:ldap_server - make it "signed-safe"
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-02-25 08:17:12 +11:00
Matthias Dieter Wallnöfer
e912d50709 s4:auth - make some parts "signed-safe"
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-02-25 08:17:11 +11:00
Matthias Dieter Wallnöfer
f10fc7c16e s4:cldap_server - make it "signed-safe"
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-02-25 08:17:11 +11:00
Matthias Dieter Wallnöfer
68caf90606 s4:torture/ldap/basic.c - add a basic test for referral return
I implemented this referral test in C since the LDB python API isn't capable
to extract referrals from search result sets (there the result sets are simple
lists which contain only the matching entries).

First I enhanced the RootDSE test to return all partition base DNs in a new
null-terminated list "partitions". Then I used this in my referrals test which
I've implemented in the LDB api since I needed some certain DN functions.
2010-02-25 08:17:11 +11:00
Matthias Dieter Wallnöfer
0be57c7478 s4:partition DSDB module - Generate basic referrals
This is a first, very basic implementation of the referrals (more informations
at MS-ADTS 3.1.1.4.6 and 3.1.1.3.4.1.12).

To have the full referral support (and to always point to the right host) the
full implementation using DNS will be needed (at the moment we always point to
the main DC which is referenceable through the DNS domainname).

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-02-25 08:17:06 +11:00
Matthias Dieter Wallnöfer
cd5b542878 s4:partition DSDB module - change the search and domain scope control handling
The domain scope control is always removed, from the search one only the two
interesting flags (which are handled) and it is marked as non-critical.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-02-25 08:17:00 +11:00
Matthias Dieter Wallnöfer
545889a048 s4:LDAP server - Enable support for returning referrals through it
This is needed for my work regarding the referrals when the domain scope control
isn't specified.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-02-25 08:16:54 +11:00
Matthias Dieter Wallnöfer
0efa8f4fbb s4:SAMLDB module - ignore referrals
They don't cause any harm to our functionality - so ignore them were not needed.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-02-25 08:16:46 +11:00
Simo Sorce
f09802cfc8 s4:netlogon remove wrong ZERO_STRUCT of output
This was causing marshalling faults when we returned errors.
2010-02-24 11:04:09 -05:00
Matthieu Patou
8b4b602e1a python: ntacls, fix a leftover that is not in the try/except branch
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-24 14:50:30 +01:00
Matthieu Patou
00aeca7d7f dsdb: Add a more explicit error message for constructed attributes
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-24 14:50:30 +01:00
Kamen Mazdrashki
8416570ea3 s4/drs_util: 'net drs showrepl' command implementation 2010-02-24 14:14:09 +02:00
Kamen Mazdrashki
83007e06c1 s4/drs: Propagate drsuapi_DsReplicaGetInfoRequest2 changes in source code 2010-02-24 14:14:09 +02:00
Kamen Mazdrashki
30ac3caade s4/drs: Propagate drsuapi_DsReplicaGetInfoRequest... changes into source code 2010-02-24 14:14:08 +02:00
Kamen Mazdrashki
3f5e9e9974 s4/drs_util: 'net drs replicate' command implementation 2010-02-24 14:14:08 +02:00
Kamen Mazdrashki
ff94094dfa s4/drs_util: Add public function for binding to a DC 2010-02-24 14:14:08 +02:00
Kamen Mazdrashki
394746285e s4/drs_util: Refactor code to use net_drs_connection object for DRSUAPI connecitons 2010-02-24 14:14:08 +02:00
Kamen Mazdrashki
9ddb10869c s4/drs_util: Move DRSUAPI connection data into separate object
We need this so we can create independent DRS connections to
different DCs.
2010-02-24 14:14:07 +02:00
Kamen Mazdrashki
e5aae24b3f s4/net_drs: Utility macros for conditions checking 2010-02-24 14:14:07 +02:00
Kamen Mazdrashki
99db858b15 s4/drs: Propagate drsuapi_DsReplicaSync changes in source base 2010-02-24 14:14:07 +02:00
Kamen Mazdrashki
8747e695fe s4/drs: Propagate drsuapi_DsReplicaSyncRequest1 changes in source base 2010-02-24 14:14:07 +02:00
Günther Deschner
1b78573c2d s4-smbtorture: verify that the client cpu architecture has no influence on the
calculated buffer size in RPC-SPOOLSS.

Guenther
2010-02-24 11:43:20 +01:00
Kamen Mazdrashki
fffdce62fc s4/schema: Move msDS-IntId implementation to samldb.c module
msDS-IntId attribute should be replicated, so it must be
implemented in a module that is before repl_meta_data module
(thanks abartlet for pointing this out).

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-02-24 12:01:51 +11:00
Steven Danneman
2523b20349 s4/torture/smb2: Add two new SMB2 compound tests
These tests server behavior when a client compounds both synchronous
and asynchronous requests.
2010-02-23 13:15:45 -08:00
Simo Sorce
805f7507e2 s4:cleanup remove unused schannel ldb code 2010-02-23 12:46:51 -05:00
Simo Sorce
1203de99b1 s4:schannel merge code with s3
After looking at the s4 side of the (s)channel :) I found out that it makes
more sense to simply make it use the tdb based code than redo the same changes
done to s3 to simplify the interface.

Ldb is slow, to the point it needs haks to pre-open the db to speed it up, yet
that does not solve the lookup speed, with ldb it is always going to be slower.

Looking through the history it is evident that the schannel database doesn't
really need greate expanadability. And lookups are always done with a single
Key. This seem a perfet fit for tdb while ldb looks unnecessarily complicated.

The schannel database is not really a persistent one. It can be discared during
an upgrade without causing any real issue. all it contains is temproary session
data.
2010-02-23 12:46:50 -05:00
Simo Sorce
8e2f5fe7c5 s4:schannel more readable check logic
Make the initial schannel check logic more understandable.
Make it easy to define different policies depending on the caller's
security requirements (Integrity/Privacy/Both/None)

This is the same change applied to s3
2010-02-23 12:46:50 -05:00
Andreas Schneider
69d5cea2e5 s4-smb: Migrate named_pipe_server to tsocket. 2010-02-23 13:48:21 +01:00
Andrew Tridgell
7593b6d03b s4-dns: improved logging, and run name check at startup 2010-02-23 13:48:21 +01:00
Andrew Tridgell
cb7ab80ee8 s4-pyglue: added interface_ips() call
This allows a python script to query the internal network interface
lists from Samba
2010-02-23 13:48:20 +01:00
Andrew Tridgell
61af327e5d s4-dns: call out to the dns update command every 10 minutes
This periodically calls samba_dnsupdate to update our DNS entries if
needed
2010-02-23 13:48:20 +01:00
Andrew Tridgell
ae209d488e s4-param: added "dns update command" smb.conf option
defaults to SBINDIR/samba_dnsupdate

This command will do periodic dynamic DNS updates using TSIG-GSS
2010-02-23 13:48:20 +01:00
Andrew Tridgell
95ee01bb30 s4-config: add dyn_SBINDIR 2010-02-23 13:48:19 +01:00
Andreas Schneider
95a0ab5f11 s4-smbd: Remove obsolete singal type cast from the thread process model. 2010-02-23 12:23:44 +01:00
Matthias Dieter Wallnöfer
4ef82accfe s4:netlogon RPC - fix the indentation
Simo, I'm not really sure that those checks are valid. I read MS-NRPC section
3.5.4.1 about LOGONSRV_HANDLEs ("server_name" is of this type). There isn't
stated that the server name has necessarily to be in the DNS form and should
also be valid when it's NULL (if DCE server and client are the same - I don't
know if me make use of it in s4).
2010-02-23 09:53:17 +01:00
Simo Sorce
d4b8be513c s4:netlogon GetTrustedDomainInformation
start implementing calls related to trusted domain information
2010-02-22 18:49:16 -05:00
Simo Sorce
dbcc7ad7e4 s4:netlogon fix segfault 2010-02-22 18:48:36 -05:00
Simo Sorce
6c0cd488e5 ldb:web Fix typo 2010-02-22 18:48:36 -05:00
Matthias Dieter Wallnöfer
91bf841c2e s4:registry/regf.c - specify the context when freeing the "regf" variable
Otherwise we get a "talloc_free with references" warning.
2010-02-22 22:15:03 +01:00
Brad Hards
1e986c1cb3 More spelling fixes across source4/
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:38 +01:00
Brad Hards
7a23b9769b Various source4 spelling fixes.
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:37 +01:00
Brad Hards
4b024683ac Spelling fixes for source4/auth.
The comment for USER_INFO_INTERACTIVE_LOGON looks like a cut-n-paste from the line above.

Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:37 +01:00
Brad Hards
3eacc83b35 Spelling fixes for source4/lib/registry.
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:37 +01:00
Brad Hards
7def87cb17 Typo fix.
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:36 +01:00
Brad Hards
1683d090cc LDB related spelling fixes.
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:36 +01:00
Matthias Dieter Wallnöfer
6de98ba10b s4:torture/ldap/basic.c - add some "const"
In addition I removed a "talloc_free(req)" since we never free elsewhere the
requests explicitly and do it only indirectly with freeing the "conn" object
when the testsuite terminates.
2010-02-22 21:19:27 +01:00
Simo Sorce
73bfd9de5d s4:netlogon enhance DsrEnumerateDomainTrusts
Actually return trust relationships by searching the appropriate
entries in the SAM database.
Add checks and return the correct flags, type and attributes.
2010-02-21 17:00:23 -05:00
Matthias Dieter Wallnöfer
280a8a70fd s4:operational LDB module - enable support for passing referrals through it 2010-02-21 21:44:39 +01:00
Matthias Dieter Wallnöfer
c16d4fb76d s4:partition DSDB module - Cosmetic fixups 2010-02-21 21:44:24 +01:00
Matthias Dieter Wallnöfer
461987bc26 s4:password_hash - Fix up request message pointers
For add requests we need the add request messages, for modify requests we need
the modify request messages.
2010-02-21 21:43:48 +01:00
Matthias Dieter Wallnöfer
eca8697d61 s4:dsdb/util.c - Use LDB result constants in some more helper functions
Always better to rely on the standards rather than on custom results.
2010-02-21 21:43:47 +01:00
Matthias Dieter Wallnöfer
f2eac3b6ea s4:provision.py - try to use other addresses than "127.0.0.x" and "::1"
On production systems a user for sure strongly disagrees to use local IP
addresses (how should the server be accessible?). Therefore if the user didn't
specify an IP as provision option and in the "/etc/hosts" file we have at
least one not-local IP which resolves to our hostname use this or one of them.

Notice: if a host has more public IP addresses with the same name assigned the
behaviour is non-deterministic (well, okay - by the entries order it is). But
then the user is invited to specify the host IP manually.

This should address bug #5484.
2010-02-21 21:39:47 +01:00
Matthias Dieter Wallnöfer
017e401ded s4:AD content - Implement the new password settings container 2010-02-21 21:19:57 +01:00
Matthias Dieter Wallnöfer
973ea19867 s4:AD content - adequate some revision levels to match Windows Server 2008 2010-02-21 21:19:56 +01:00
Matthias Dieter Wallnöfer
e592deeb1a s4:AD content - Add the DFSR objects which exist on Windows Server >= 2008
Those replace the FRS ones.
2010-02-21 21:19:56 +01:00
Simo Sorce
0679c77469 cleanup
remove trailing spaces, tabs and blank lines
2010-02-21 11:59:04 -05:00
Andrew Bartlett
a9d9447d5a s4:credentials Add hooks to extract a named Kerberos credentials cache
This allows the integration of external tools that can't be linked
into C or python, but need to authenticate as the local machine
account.

The machineaccountccache script demonstrates this, and debugging has
been improved in cli_credentials_set_secrets() by passing back and
error string.

Andrew Bartlett
2010-02-20 17:58:07 +11:00
Simo Sorce
da1970c0ff s4:lsa open trusted domain also with dns name
When searching for a trusted domain object to open, search also the DNS Name
attributes for a match. W2K8R2 uses the DNS domain if available.
2010-02-19 18:31:45 -05:00
Simo Sorce
c8a3c01585 remove trailing tabs and spaces 2010-02-19 18:31:45 -05:00
Simo Sorce
fff7750618 readability reformatting
stop this function from maiking my eyes bleed
2010-02-19 17:20:09 -05:00
Andrew Bartlett
f74ce57cb5 s4:rpc_server Add a 'if_version' parameter to the bind operation.
This allows the interface version to be forwarded to the remote server
in the RPC proxy, both in the endpoint lookup and the subsequent bind.

Andrew Bartlett
2010-02-20 02:55:29 +11:00
Günther Deschner
ec0aa8a5c9 s4-smbtorture: more work on devicemode tests.
Guenther
2010-02-19 15:25:42 +01:00
Günther Deschner
0e95a6a09c s4-smbtorture: explain failure conditions in printer device mode tests a little more.
Guenther
2010-02-19 14:27:31 +01:00
Günther Deschner
f2ecec3dcd s4-smbtorture: add --option=torture:spoolss_check_size=yes.
This disables the size calculation comparison by default.

Guenther
2010-02-19 14:25:19 +01:00
Günther Deschner
299e5bc2ba s4-smbtorture: print more comments while running SD and DM tests in RPC-SPOOLSS-PRINTER.
Guenther
2010-02-19 14:24:18 +01:00
Andrew Bartlett
809dd8c413 s4:selftest Add test for the RPC proxy 2010-02-19 16:32:49 +11:00
Andrew Bartlett
10fed057cd s4:rpc_server Record the remote connections association group ID
By recording the association group the remote server assigned to our
proxied RPC connection, we can ensure we use the same value when the
client wishes to use it.

This isn't stored in a private pointer, as mapiproxy will want to use
this feature too.

Andrew Bartlett
2010-02-19 16:32:49 +11:00
Andrew Bartlett
af4a7c0f4b s4:winbind Make the 'no SID found' message even more detailed
Now we give the user a clue as to what may be wrong, and the file path
that we could not find the domain SID in.

Andrew Bartlett
2010-02-19 11:18:27 +11:00
Jeremy Allison
9abce9f7c9 Revert "Got back to 16-byte padding on auth RPC. S3 clients and servers now cope with this. Jeremy"
This reverts commit 38c50c7027.

As tridge requested, we need this to work with older S3
servers, not just for smbtorture4.

Jeremy.
2010-02-17 19:42:49 -08:00
Günther Deschner
998a7b4e3f s4-smbtorture: skip printer info cross tests against samba 3 for now.
Not even w2k8r2 passes them atm.

Guenther
2010-02-18 01:49:02 +01:00
Günther Deschner
97d36377d3 s4-smbtorture: try more combinations to find printers in test_EnumPrinters_findname().
Also take a note of servers returning full UNC printer paths although we did not
set the servername.

Guenther
2010-02-18 01:48:52 +01:00
Günther Deschner
a1ba72f84c s4-smbtorture: simplify test_PrinterInfo_DevMode a bit.
Guenther
2010-02-18 01:48:45 +01:00
Günther Deschner
57847c2fee s4-smbtorture: avoid potential loop while adding a new printer in RPC-SPOOLSS-PRINTER.
Guenther
2010-02-18 01:48:36 +01:00
Jeremy Allison
38c50c7027 Got back to 16-byte padding on auth RPC. S3 clients and servers now cope with this. Jeremy 2010-02-17 16:43:11 -08:00
Andrew Bartlett
7202dcdcc0 s4:param Modify secrets_get_domain_sid to give more useful errors
This also moves the calls to secrets_get_domain_sid back into
winbind_task_init(), so that we can terminate with a much more
detailed error message.  (The previous message was simply
NT_STATUS_CANT_ACCESS_DOMAIN_INFO).

Andrew Bartlett
2010-02-18 10:58:24 +11:00
Anatoliy Atanasov
968bd16b49 s4/rodc: change the libnet_become_dc code to do RODC join 2010-02-17 18:03:32 +02:00
Anatoliy Atanasov
0e8fe821c9 s4/drs:kccdrs_replica_get_info_obj_metadata implementation
Fix the names of the drsuapi_DsReplicaInfoType enum and rebuild the .idl
The get_info_obj_metadata implementation is ported from implementation
i developed and tested at the samba io lab 2009
2010-02-17 18:03:31 +02:00
Kamen Mazdrashki
8078614814 s4/ldap: Refactor the fix for ldap nested searches
Current implementation synchronizes processing for
all types of LDAP request, not only LDAP_Search ones.

Synchronization for ldap replies processing is done
locally in ldb_ildap module as this concerns only
ildb_callback() function.

Signed-off-by: Anatoliy Atanasov <anatoliy.atanasov@postpath.com>
2010-02-17 18:03:31 +02:00
Günther Deschner
3a9dc490b4 s4-smbtorture: unify test list to run against single created printers in RPC-SPOOLSS-PRINTER.
This is to make sure we run the same tests for printers created via AddPrinter
and via AddPrinterEx.

Guenther
2010-02-17 11:29:37 +01:00
Günther Deschner
b32c1e2975 s4-smbtorture: also test level 2 sets for devicemodes and see if they persist.
Guenther
2010-02-17 11:29:37 +01:00
Günther Deschner
ff5bfb9708 s4-smbtorture: refactor setprinter devicemode calls in RPC-SPOOLSS-PRINTER.
Guenther
2010-02-17 11:29:36 +01:00
Andrew Tridgell
986627cd67 s4-provision: freeze the DNS zone before creating the zone file
This prevents bind from getting confused if it has a journal for the
zone.
2010-02-17 19:43:33 +11:00
Andrew Tridgell
fd2556317f s4-dnsupdate: use samba_runcmd() in the dns update task
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-02-17 19:43:32 +11:00
Andrew Tridgell
8633d8126b s4-param: added "rndc command" smb.conf option 2010-02-17 19:43:32 +11:00
Andrew Tridgell
72c0cd75e4 s4-provision: fix permissions on generated DNS zone file
The zone file needs to be writeable by bind to allow for it to flush
its journal on dynamic updates

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-02-17 19:43:32 +11:00
Andrew Tridgell
eb8800e611 s4-rpc: paranoid check for auth_length
This is not strictly needed as the ndr_pull_advance() checks it a few
lines further down, but I want to save Jeremy getting more grey hairs :-)
2010-02-17 10:54:05 +11:00
Andrew Tridgell
eda16f2410 s4-kcc: remove a qsort() that snuck into the new topology code 2010-02-16 22:42:59 +11:00
Andrew Tridgell
e3a272c3f2 s4-rpc: don't use auth padding in rpc bind requests as it breaks s3
The s3 RPC server returns a bind_nak if it gets a rpc bind with auth
padding. This change forces a padding length of zero to maximimise
compatibility with s3 servers. 

I've left the padding code in as a #if 0 to make it easier for us to
test/fix the s3 server code, which should be changed to correctly
handle arbitrary auth padding in all rpc requests with auth trailers.
2010-02-16 22:42:59 +11:00
Andrew Tridgell
1e13d3fb07 s4-dcerpc: fixed auth padding to be relative to the stub, not packet
The recent dcerpc padding changes made our padding relative to the
packet header, instead of the start of the stub. Surprisingly, this
broke w2k8r2 doing a dcpromo join to a s4 server. It seems that w2k8r2
is very fussy about the padding it gets in some circumstances.
2010-02-16 21:10:52 +11:00
Andrew Tridgell
018fb2d1ae s4-dsdb: return LDB_ERR_CONSTRAINT_VIOLATION on num_recs != 1
In a single record search, LDB_ERR_CONSTRAINT_VIOLATION is more useful
than the generic LDB_ERR_OPERATIONS_ERROR

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-02-16 21:10:52 +11:00
Andrew Tridgell
86f8ddf754 s4-samdb: use dsdb_search() in cracknames
greatly simplifies some of the cracknames code

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-02-16 21:10:52 +11:00
Andrew Tridgell
6d65f4c647 s4-kcc: remove search_onelevel_with_deleted() in kcc
Use dsdb_search() instead

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-02-16 21:10:51 +11:00
Andrew Tridgell
0bedb9cf5e s4-dsdb: removed gendb_search_single_extended_dn()
Use dsdb_search_one() instead, which allows for arbitrary controls

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-02-16 21:10:51 +11:00
Andrew Tridgell
b630530730 s4-dsdb: added dsdb_search_one() and cleanup dsdb_find_dn_by_guid()
dsdb_find_dn_by_guid() now takes a struct GUID instead of a
guid_string. All the callers in fact wanted a struct GUID, so we now
avoid the extra conversion.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-02-16 21:10:51 +11:00