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

212 Commits

Author SHA1 Message Date
Matthias Dieter Wallnöfer
d0b3932447 s4:lsa RPC server - always initialise "info" structures
This should help to fix bug #7769
2010-12-03 22:47:21 +01:00
Matthias Dieter Wallnöfer
aebc90f974 s4:lsa RPC server - "dcesrv_lsa_CreateSecret" - a bit of rework
- Added 'out of memory' checks
- Added checks regarding return values
- Switch to "ldb_msg_add_string" where possible

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Fri Dec  3 21:41:39 CET 2010 on sn-devel-104
2010-12-03 21:41:39 +01:00
Matthias Dieter Wallnöfer
ae61408e2f s4:lsa RPC server / objectclass LDB module - fix the creation of trusted domain objects
Tridge pointed out that it is to dangerous to allow them to be created
with SYSTEM permissions. The solution using the "untrusted" flag should
be much more viable.

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Thu Nov 25 13:05:56 CET 2010 on sn-devel-104
2010-11-25 13:05:56 +01:00
Matthias Dieter Wallnöfer
1352a9406f s4:objectclass LDB module - LSA objects - allow them if the SYSTEM control is specified
This fits better than the RELAX one.

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Wed Nov 24 18:23:01 CET 2010 on sn-devel-104
2010-11-24 18:23:01 +01:00
Matthias Dieter Wallnöfer
c291858199 s4:dsdb - fix unsigned integer save problems using the "%u" specifier
The issue here is that we have not yet first cast to int32_t explicitly,
before we cast to an signed int to printf() into the %d or cast to a
int64_t before we then cast to a long long to printf into a %lld.

There are *no* unsigned integers in Active Directory LDAP, even the RID
allocations and ms-DS-Secondary-KrbTgt-Number are *signed* quantities.
(See the schema, and the syntax definitions in schema_syntax.c).

The failure has been detected by Matthieu Patou on the buildfarm host "tridge"
due to a malformed "groupType" attribute.

The solution is to use the "%d" specifier. Either to use it directly - or better
(when possible) use the call "samdb_msg_add_uint" (which encapsulates it).

This patch changes such problematic situations.
2010-10-16 10:54:46 +02:00
Matthias Dieter Wallnöfer
ace4378de1 s4:lsa RPC server - use LDB result constant 2010-10-15 08:45:14 +02:00
Matthias Dieter Wallnöfer
9bc57e19e6 s4:dsdb - remove "samdb_msg_add_value"
This can be substituted by "ldb_msg_add_value".

Signed-off-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri Oct 15 00:21:53 UTC 2010 on sn-devel-104
2010-10-15 00:21:53 +00:00
Matthias Dieter Wallnöfer
a0e9814c0d s4:dsdb - remove "samdb_result_uint", "samdb_result_int64", "samdb_result_uint64" and "samdb_result_string"
We have ldb_msg_find_attr_as_* calls which do exactly the same. Therefore this
reduces only code redundancies.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-10-15 08:36:01 +11:00
Andrew Bartlett
8beaa29242 s4-libcli/security Use seperate subsystem for session related functions
The merged I plan in this area require spliting security.h into
two header files, a common header and a session.h for the
remaining source4-specific code.

Andrew Bartlett
2010-10-12 02:54:16 +00:00
Andrew Bartlett
5cd9495fb3 s4-param Refactor secrets code to not require an event context.
A new event context is constructed by LDB when required for secrets.ldb
This will be essentially unused, as LDB on TDB will only trigger 'fake'
events, and blocks on transactions and lock operations anyway.

Andrew Bartlett
2010-10-11 13:02:15 +00:00
Jelmer Vernooij
93126b3315 samdb: Add flags argument to samdb_connect(). 2010-10-10 23:08:49 +02:00
Matthias Dieter Wallnöfer
0e5b77bec4 s4:kdc - use "userAccountControl" always unsigned
It doesn't change much but it's nicer to have it consistent.
2010-10-05 08:43:19 +00:00
Andrew Bartlett
e84ab1b35f s4-privs Fix enum privileges in LSARPC server
We were returning the index, not the LUID value

Andrew Bartlett
2010-09-11 22:32:43 +10:00
Andrew Bartlett
0eea8ecfe2 s4-privs Seperate rights and privileges
These are related, but slightly different concepts.  The biggest difference
is that rights are not enumerated as a system-wide list.

This moves the rights to security.idl due to dependencies.

Andrew Bartlett
2010-09-11 18:46:13 +10:00
Andrew Tridgell
45aecc2833 s4-lsa: privilege IDs should use the enum, not an int
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-09-11 18:46:12 +10:00
Andrew Bartlett
a32cdadb7c libcli/security Make sec_privilege_from_index() return SEC_PRIV_INVALID on failure
This is clearer and more consistent than using a magic -1 return

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:11 +10:00
Andrew Bartlett
6d78e11e17 libcli/security make sec_privilege_id() return SEC_PRIV_INVALID on failure.
Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:10 +10:00
Andrew Bartlett
9abfd8fe3b s4-privs Add a lookup by index of privilages
Now that privileges are no longer given luid values sequentially,
we need another way to look them up for enumeration.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:05 +10:00
Günther Deschner
e2f15d2a25 s4-trusts: fix trustDomainPasswords drsblobs IDL and server side support.
Also remove bogus trustCurrentPasswords struct which we just had because our IDL
was incorrect.

Guenther
2010-08-25 13:27:50 +02:00
Andrew Bartlett
6cf29b3e4f s4:security Change struct security_token->sids from struct dom_sid * to struct dom_sid
This makes the structure much more like NT_USER_TOKEN in the source3/
code.  (The remaining changes are that privilages still need to be merged)

Andrew Bartlett
2010-08-23 08:50:55 +10:00
Andrew Bartlett
7c6ca95bec s4:security Remove use of user_sid and group_sid from struct security_token
This makes the structure more like Samba3's NT_USER_TOKEN
2010-08-18 09:50:38 +10:00
Andrew Tridgell
6baa834ebe s4-ldb: use LDB_FLAG_MOD_TYPE() to extract element type from messages
The flags field of message elements is part of a set of flags. We had
LDB_FLAG_MOD_MASK for extracting the type, but it was only rarely
being used (only 1 call used it correctly). This adds
LDB_FLAG_MOD_MASK() to make it more obvious what is going on.

This will allow us to use some of the other flags bits for internal
markers on elements

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-08-17 21:21:50 +10:00
Stefan Metzmacher
6598d6dc41 s4:rpc_server/lsa: better include a .h file don't include a .c file
This fixes the build with --nonshared-binary=smbtorture,
as use by the source3/ make test.

metze
2010-08-07 18:16:29 +02:00
Matthias Dieter Wallnöfer
67b1e1b8f3 s3:dcesrv_lsa.c - use the RELAX control in order to create LSA objects 2010-08-07 14:22:42 +02:00
Andrew Tridgell
6b266b85cf s4-loadparm: 2nd half of lp_ to lpcfg_ conversion
this converts all callers that use the Samba4 loadparm lp_ calling
convention to use the lpcfg_ prefix.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-16 18:24:27 +10:00
Sumit Bose
4efa1081aa s4:rpc_server/lsa/dcesrv_lsa.c - fix typo
Signed-off-by: Günther Deschner <gd@samba.org>
2010-07-06 17:22:42 +02:00
Matthias Dieter Wallnöfer
4826fdf95f s4:lsa RPC server - Fix up "dcesrv_lsa_DeleteObject"
- Return always "NT_STATUS_OK" on success
- Remove "talloc_free"s on handles since the frees are automatically performed by
  the DCE/RPC server code
2010-06-28 14:51:08 +02:00
Matthias Dieter Wallnöfer
3c3ecf40e5 s4:rpc_server/lsa/dcesrv_lsa.c - remove unreachable code 2010-06-26 20:08:46 +02:00
Jelmer Vernooij
f9ca9e46ad Finish removal of iconv_convenience in public API's. 2010-05-18 11:45:30 +02:00
Andrew Tridgell
bb1ba4ff76 s4-drs: added new SECURITY_RO_DOMAIN_CONTROLLER level
This is used for allowing operations by RODCs, and denying them
operations that should only be allowed for a full DC

This required a new domain_sid argument to
security_session_user_level()

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Rusty Russell <rusty@samba.org>
2010-04-22 19:36:16 +10:00
Fernando J V da Silva
73513fb7e7 s4-drs: Use new samdb_rodc() function in s4 code
This patch fits the calling to the new samdb_rodc() function and
fix a little bug in this function.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-04-22 19:36:15 +10:00
Fernando J V da Silva
57bcdf008f s4-drs: samdb_is_rodc() function and new samdb_rodc() function
This patch creates the samdb_is_rodc() function, which looks for
the NTDSDSA object for a DC that has a specific invocationId
and if msDS-isRODC is present on such object and it is TRUE, then
consider the DC as a RODC.
The new samdb_rodc() function uses the samdb_is_rodc() function
for the local server.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-04-22 19:36:15 +10:00
Simo Sorce
4b249a616b s4:lsa implement lsaRSetForestTrustInformation 2010-03-30 17:46:52 -04:00
Simo Sorce
d9e311ddce s4:lsa Functions to set Domain Trust Information 2010-03-22 21:49:40 -04:00
Simo Sorce
668e7db9d6 s4:lsa move code to add trusted domain user into its own function 2010-03-22 21:49:40 -04:00
Simo Sorce
650a62d1cb s4:lsa Abstract crypto (un)wrapping in separate functions 2010-03-22 21:49:39 -04:00
Günther Deschner
a5ad510fc4 s4-lsa: fix dcesrv_lsa_lsaRSetForestTrustInformation server stub.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
2010-03-16 15:12:19 +01:00
Matthias Dieter Wallnöfer
24049e8fc5 s4:lsa RPC - fix up "gendb_*" result codes
Make the resultcodes consistent: that means:
result < 0  -> NT_STATUS_INTERNAL_DB_CORRUPTION since our DB had a critical
               error
result >= 0 -> depends on the function usage. I tried to let the logic always as
               it was before.
2010-03-06 11:19:04 +01:00
Matthias Dieter Wallnöfer
a6cf89228f s4:lsa RPC - Change some counters to be "unsigned" where needed
The "count" size specifiers I typed "uint32_t" since they're often returned as
an "uint32_t" (consider the IDL file). LDB counters need to be "signed" if they
count till a limit of a "gendb*" call or "unsigned" if they count directly the
number of objects.
2010-03-06 11:04:35 +01:00
Simo Sorce
a7057e69c7 s4:lsa use the correct way to store a domain sid
Converting the sid to a string and then storing a string does not save the sid
in the right format. Causing following retrievals to fail to read back a sid
with samdb_result_dom_sid().
2010-02-24 18:35:48 -05:00
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
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
Andrew Tridgell
90203f87e7 s4-dsdb: change samdb_replace() to dsdb_replace() and allow for dsdb_flags
This allows for controls to be added easily where they are needed.
2010-02-16 21:10:50 +11:00
Matthias Dieter Wallnöfer
05b6e3f4f4 s4:dcesrv_lsa.c - remove a superfluous empty line
One empty line is enough for code part divisions.
2010-02-14 10:48:13 +01:00
Andrew Tridgell
f954f522a4 s4-rpcserver: use TYPESAFE_QSORT() in rpc servers 2010-02-13 22:36:12 +11:00
Matthias Dieter Wallnöfer
e8e76eb83a s4:lsa RPC - Use more LDB constants
And fix an obvious bug (call of "samdb_msg_add_delete")
2009-11-21 19:53:29 +01:00
Andrew Tridgell
98e4393df9 s4-dsdb: create a static system_session context
This patch adds a system_session cache, preventing us from having to
recreate it on every ldb open, and allowing us to detect when the same
session is being used in ldb_wrap
2009-10-23 14:52:17 +11:00
Günther Deschner
4b6cfbb6d2 s4-lsa: Fix dcesrv_lsa_EnumTrustDom() and avoid infite windows client loop.
Found by RPC-LSA-TRUSTED-DOMAIN torture test.

Guenther
2009-10-21 03:14:00 +02:00