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

29 Commits

Author SHA1 Message Date
Matthew DeVore
c2ac923c6a s3: safe_string: do not include string_wrappers.h
Rather than have safe_string.h #include string_wrappers.h, make users of
string_wrappers.h include it explicitly.

includes.h now no longer includes string_wrappers.h transitively. Still
allow includes.h to #include safe_string.h for now so that as many
modules as possible get the safety checks in it.

Signed-off-by: Matthew DeVore <matvore@google.com>
Reviewed-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-08-28 00:56:34 +00:00
Volker Lendecke
c906153cc7 lib: Remove some unused code
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Feb 28 13:53:41 UTC 2019 on sn-devel-144
2019-02-28 13:53:40 +00:00
Volker Lendecke
bb8122dd8c idmap_cache: Introduce idmap_cache_find_xid2sid
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13813
2019-02-28 12:57:24 +00:00
Volker Lendecke
4faf3e9f6d idmap_cache: Only touch "sid" on success in find_xid_to_sid
Why? This makes the negative mapping condition (is_null_sid) more
explicit in the code.

The callers in lookup_sid initialized "psid" anyway before, and the ones
in wb_xids2sids now do as well. This is more in line with other APIs we
have: Only touch output parameters if you have something to say.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13813
2019-02-28 12:57:23 +00:00
Volker Lendecke
d9303e8eb9 lib: Make idmap_cache return negative mappings
Without this we'd query non-existent mappings over and over
again.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13813
2019-02-28 12:57:23 +00:00
Volker Lendecke
8be87034d4 idmap_cache: Use dom_sid_str_buf
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-11-27 07:13:14 +01:00
Volker Lendecke
1e484da792 idmap: Use dom_sid_str_buf
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-11-09 22:42:29 +01:00
Volker Lendecke
5b2c3f2f42 lib: Remove gencache.h from proto.h
It's a pain to recompile the world if gencache.h changes

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Oct 19 18:52:50 CEST 2018 on sn-devel-144
2018-10-19 18:52:50 +02:00
Volker Lendecke
2557ae53ed lib: Move the "expired" for gencache_parse calculation into gencache.c
Make it more robust

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Oct 16 21:20:19 CEST 2018 on sn-devel-144
2018-10-16 21:20:19 +02:00
Volker Lendecke
055650ecb6 lib: Fix a comment in idmap_cache.c
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2016-12-27 14:21:27 +01:00
Stefan Metzmacher
816751a3a8 s3:idmap_cache: remove unused idmap_cache_set_sid2[u|g]id()
Change-Id: I40bcfacb812b0dac7917533c9baf82a79f598efd
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>

Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Wed Dec  3 06:44:29 CET 2014 on sn-devel-104
2014-12-03 06:44:29 +01:00
Volker Lendecke
97e8b56250 idmap_cache: Use gencache_parse
This avoids a few tallocs and brings down user CPU a bit more

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Dec  5 03:06:10 CET 2013 on sn-devel-104
2013-12-05 03:06:10 +01:00
Volker Lendecke
89013af15a idmap_cache: Use an fstring instead of talloc_asprintf
In a test doing one million uid2sid calls this brings down user CPU from
1.3 seconds to 0.9 seconds. And it saves a few code lines.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-12-05 01:10:25 +01:00
Volker Lendecke
d3c689fc5c lib: Use "mem_ctx" arg in gencache_get
Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep  5 20:09:21 CEST 2013 on sn-devel-104
2013-09-05 20:09:21 +02:00
Volker Lendecke
8a7246ac2c lib: Add a "mem_ctx" arg to gencache_get (unused so far)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-09-05 09:16:23 -07:00
Stefan Metzmacher
3c74117e2e s3:idmap_cache: also store negative entries for unknown sids
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jun 21 18:04:05 CEST 2012 on sn-devel-104
2012-06-21 18:04:05 +02:00
Michael Adam
7db637483b s3:idmap_cache: improve checks for format of value string in idmap_cache_find_sid2unixid()
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Fri May 18 16:34:27 CEST 2012 on sn-devel-104
2012-05-18 16:34:27 +02:00
Michael Adam
0c3137c2e1 s3:idmap_cache: add common exit point to idmap_cache_find_sid2unixid() 2012-05-18 14:44:15 +02:00
Michael Adam
ecb24fd459 s3:idmap_cache: improve debug messages in idmap_cache_find_sid2unixid() 2012-05-18 14:44:15 +02:00
Stefan Metzmacher
3e9b760406 s3:idmap_cache: change DEBUG message to level 10
metze
2012-05-06 14:50:38 +02:00
Andrew Bartlett
bb1d541da1 s3-idmap: remove (now) unused function idmap_cache_set_sid2both()
Signed-off-by: Michael Adam <obnox@samba.org>
2012-05-02 13:18:05 +02:00
Andrew Bartlett
583b104d4b s3-idmap: Rework idmap_cache to store ID_TYPE_BOTH values
This required that the lower level cache store a UID/GID and a type, and that
we operate on struct unixid rather than just uid/gid.

The ID_TYPE_BOTH is then handled as being a positive mapping for both
a UID and GID value.  Wrapper functions are provided so that callers are not
changed in this patch.

Andrew Bartlett

Signed-off-by: Michael Adam <obnox@samba.org>
2012-05-02 13:18:02 +02:00
Andrew Tridgell
f236c539ad s3-winbindd: add support for idmap type WBC_ID_TYPE_BOTH
this allows the s3 code to understand and cache responses from the s4
winbindd which may include a single SID mapped to both a uid and a gid

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Signed-off-by: Michael Adam <obnox@samba.org>

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Fri Sep 23 01:47:54 CEST 2011 on sn-devel-104
2011-09-23 01:47:54 +02:00
Michael Adam
d9945e9369 s3:idmap_cache: remove an leftover wip comment
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Wed Mar  2 14:55:20 CET 2011 on sn-devel-104
2011-03-02 14:55:20 +01:00
Gregor Beck
8aa69c1f81 s3: adjust loglevel for idmap_cache
Signed-off-by: Michael Adam <obnox@samba.org>
2011-03-02 14:10:22 +01:00
Gregor Beck
42a4a9cbc3 s3: add functions to remove entries from idmap cache 2011-02-28 12:58:43 +01:00
Andrew Bartlett
f768b32e37 libcli/security Provide a common, top level libcli/security/security.h
This will reduce the noise from merges of the rest of the
libcli/security code, without this commit changing what code
is actually used.

This includes (along with other security headers) dom_sid.h and
security_token.h

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Oct 12 05:54:10 UTC 2010 on sn-devel-104
2010-10-12 05:54:10 +00:00
Günther Deschner
2b41f421fd s3-idmap: only include idmap headers where needed.
Guenther
2010-08-26 00:20:29 +02:00
Volker Lendecke
13c66c8eb1 Move idmap_cache.c from winbindd/ to lib/
(This used to be commit fe70dcc1b6)
2008-08-26 12:56:47 -07:00