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

139 Commits

Author SHA1 Message Date
Jeremy Allison
9efea96d16 More const compiler warning fixes. 2011-05-05 11:29:01 -07:00
Volker Lendecke
a4d7b3a1df s3: "hex_encode" does the same as "binary_string" 2011-03-15 09:15:35 +01:00
Volker Lendecke
16b007c223 Quite some callers of sid_split_rid do not care about the rid 2011-03-10 18:48:34 +01:00
Volker Lendecke
7b139a49dc s3: Use dom_sid_string_buf in sid_to_fstring
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Thu Mar  3 22:56:57 CET 2011 on sn-devel-104
2011-03-03 22:56:56 +01:00
Andrew Bartlett
a879a4610d libcli/auth Merge source4/libcli/security and util_sid.c into the common code
This should ensure we only have one copy of these core functions
in the tree.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-10-14 02:35:05 +00:00
Andrew Bartlett
deb7c02436 s3 Replace is_sid_in_token() with security_token_has_sid() from common code
The two routines are identical, so there is no need to keep both.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-10-14 02:35:04 +00:00
Andrew Bartlett
d7bc452a89 s3: Replace sid_binstring and sid_guidstring with PIDL-based alternatives
This reduces the manual marshalling of these structures by removing
the duplication here.

Andrew Bartlett

Signed-off-by: Günther Deschner <gd@samba.org>
2010-09-20 16:15:03 -07:00
Günther Deschner
102a70e809 s3-util: use shared dom_sid_dup.
Guenther
2010-09-20 14:05:07 -07: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
Andrew Bartlett
1892df6ca8 s3-util_sid Use the NDR parser to parse struct dom_sid
The manual parser failed to constrain the maximum number of
sub-authorities to 15, allowing an overflow of the array.

Andrew Bartlett
2010-09-14 14:48:49 -07:00
Andrew Bartlett
51ecf79654 libcli/security Merge source3/ string_to_sid() to common code
The source3 code repsects the limit of a maximum of 15 subauths,
while the source4 code does not, creating a security issue as
we parse string-form SIDs from clients.

Andrew Bartlett
2010-09-14 14:48:49 -07:00
Andrew Bartlett
72a8ea4d15 s3-util_sid use ARRAY_SIZE() to ensure we never overflow the dom_sid
This ensures that this, unlike the MAXSUBAUTHS macro, can't get
out of sync with the structure.

Andrew Bartlett
2010-09-14 14:48:49 -07:00
Andrew Bartlett
9d44688681 s3-util_sid Accept S-1-5 as a SID 2010-09-14 14:48:48 -07:00
Andrew Bartlett
ce1e273a47 s3-dom_sid Use C99 types in dom_sid handling
Andrew Bartlett
2010-09-14 14:48:48 -07:00
Andrew Bartlett
aefe60da8c s3-util_sid Tidy up global struct security_token
This no longer needs to be global, and should be const.  We now also
init it with the C99 style initialisers.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:12 +10:00
Andrew Bartlett
d1bb21b0d5 s3:auth Remove NT_USER_TOKEN
The all UPPER case typedef is no longer the preferred Samba style
and this makes it easier to see that this is the IDL-derivied structure

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:06 +10:00
Andrew Bartlett
4bf783d4d6 s3-auth Change type of num_sids to uint32_t
size_t is overkill here, and in struct security_token in the num_sids
is uint32_t.

This includes a change to the prototype of add_sid_to_array()
and add_sid_to_array_unique(), which has had a number of
consequnetial changes as I try to sort out all the callers using
a pointer to the number of sids.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:05 +10: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
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
Michael Adam
e78f2b2e1e s3:fix an outdated comment. 2010-06-21 12:38:25 +02:00
Günther Deschner
bcd4077be6 s3: remove unused librpc/ndr/sid.c.
Guenther
2010-06-03 01:07:17 +02:00
Günther Deschner
f9f8007361 s3-build: only use ndr_security.h where needed.
Guenther
2010-05-31 11:32:37 +02:00
Andrew Bartlett
d266f8fdf1 s3:lib s3:lib move get_global_sam_name to util_names.c
This doesn't really belong in util_sid.c, and has much more in common
with the other functions in util_names.c

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-05-28 18:08:28 +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
Jelmer Vernooij
b8268cf7b0 s3: Remove use of iconv_convenience. 2010-05-18 11:45:31 +02:00
Volker Lendecke
18078ec445 s3: Use IS_DC macro in get_global_sam_name()
Much as I dislike macros, this one is there. So why not use it...
2010-04-10 22:55:06 +02:00
Volker Lendecke
77dd1b29bb s3: Make string_to_sid survive the LOCAL-string_to_sid test 2010-02-20 21:35:03 +01:00
Volker Lendecke
2024d4fb27 Revert "s3: Make string_to_sid a wrapper around dom_sid_parse"
This reverts commit dff03b61fd.
2010-01-25 12:41:48 +01:00
Volker Lendecke
dff03b61fd s3: Make string_to_sid a wrapper around dom_sid_parse 2010-01-23 16:28:12 +01:00
Volker Lendecke
dbf9017a80 s3: Remove string_sid_talloc
All but one call were pointless, so I think this API should go
2010-01-23 14:35:37 +01:00
Volker Lendecke
8905b599b4 s3: Fix some nonempty blank lines 2010-01-23 14:35:37 +01:00
Volker Lendecke
583d192e47 s3: Adapt sid_dup_talloc to README.Coding 2010-01-02 12:09:05 +01:00
Volker Lendecke
b067a5e4e8 s3: Remove debug_ctx()
smbd just crashed on me: In a debug message I called a routine preparing a
string that itself used debug_ctx. The outer routine also used it after the
inner routine had returned. It was still referencing the talloc context
that the outer debug_ctx() had given us, which the inner DEBUG had already
freed.
2009-11-03 11:30:00 +01:00
Volker Lendecke
0dbecbbee5 Make sid_binstring & friends take a talloc context 2009-05-28 11:33:21 +02:00
Jelmer Vernooij
08259c1c52 Add iconv_convenience argument to size functions. 2009-01-01 04:45:33 +01:00
Jeremy Allison
4e9db0b100 Cope with MAXIMUM_ALLOWED_ACCESS requests when opening handles.
Jeremy.
2008-10-21 18:05:48 -07:00
Herb Lewis
63ff9e0081 I think the problem with these functions is that lookup_usergroups
should never include the user SID.
The comment for the function in winbindd/winbindd_ads.c says
/* Lookup groups a user is a member of. */
The following patch makes the wbinfo calls return the correct data
before and after a login.
wbinfo --user-domgroups and --user-sids
(This used to be commit 7849938906)
2008-08-15 15:28:23 -07:00
Günther Deschner
bea4541e11 Use sid_array_from_info3 in lookup_usergroups_cached().
Guenther
(This used to be commit 65b4cb20ea)
2008-04-04 02:53:40 +02:00
Günther Deschner
b1d09a82f4 Use netr_SamInfo3 in sid_array_from_info3.
Guenther
(This used to be commit 06095e8c70)
2008-02-17 02:11:58 +01:00
Michael Adam
f3603d5a5a Convert add_sid_to_array() add_sid_to_array_unique() to return NTSTATUS.
Michael
(This used to be commit 6b2b9a60ef)
2008-01-09 01:47:10 +01:00
Volker Lendecke
a59280792c Remove tiny code duplication
sid_size did the same as ndr_size_dom_sid
(This used to be commit 8aec5d09ba)
2007-12-29 23:12:51 +01:00
Volker Lendecke
2e07c2ade8 s/sid_to_string/sid_to_fstring/
least surprise for callers
(This used to be commit eb523ba776)
2007-12-15 22:47:30 +01:00
Volker Lendecke
79cd97cc3f Use dom_sid_string for sid_string_talloc
Remove some code duplication, but introduce one more dependency on librpc/ndr.
Easily turned around so that librpc/ndr depends on lib/util_sid if necessary
(This used to be commit 3a0b1b2060)
2007-12-15 22:33:52 +01:00
Volker Lendecke
4312ad8b98 sid_string_static is no more :-)
We now have four ways to do sid_to_string:

sid_to_string: Convert it into an existing fstring, when you have one

sid_string_talloc: The obvious thing

sid_string_tos: For the lazy, use only with care

sid_string_dbg: The one to use in DEBUG statements
(This used to be commit 7b8276aaa4)
2007-12-15 22:09:37 +01:00
Volker Lendecke
900288a2b8 Replace sid_string_static by sid_string_dbg in DEBUGs
(This used to be commit bb35e794ec)
2007-12-15 22:09:36 +01:00
Volker Lendecke
f498f661bc Add sid_string_dbg
This makes use of the just added debug_ctx and will kill many
sid_string_static() calls
(This used to be commit 3e4148c280)
2007-12-15 22:09:35 +01:00
Volker Lendecke
2cb7f5f632 add sid_string_talloc
(This used to be commit 9e3ef0923d)
2007-12-15 22:09:35 +01:00
Jeremy Allison
30191d1a57 RIP BOOL. Convert BOOL -> bool. I found a few interesting
bugs in various places whilst doing this (places that assumed
BOOL == int). I also need to fix the Samba4 pidl generation
(next checkin).
Jeremy.
(This used to be commit f35a266b3c)
2007-10-18 17:40:25 -07:00
Günther Deschner
52ef68ad4b r25575: Document S-1-5-12 (restriced code sid).
Guenther
(This used to be commit 109b09edef)
2007-10-10 12:31:16 -05:00
Volker Lendecke
54d3c7f61d r25040: Add "net sam rights"
Not strictly in the SAM, but close enough. This command acts directly on
the local tdb, no running smbd required

This also changes the root-only check to a warning
(This used to be commit 0c5657b5ef)
2007-10-10 12:30:36 -05:00