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

45 Commits

Author SHA1 Message Date
Volker Lendecke
6d36577715 nsswitch: Align integer types
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2022-12-12 21:16:33 +00:00
Stefan Metzmacher
62d05a8108 nsswitch/libwbclient: explicitly mark all wbc* symbols as _PUBLIC_
Some private functions from wbclient_internal.h already
leaked into the ABI. With hide_symbols=True we make sure
this doesn't happen again.

Having wbcRequestResponse[Priv]() as part of the ABI helps us
in order to hide winbindd_[priv_]request_response() soon.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14780

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2021-11-30 15:53:34 +00:00
Stefan Metzmacher
600ebefa5a libwbclient: fix strict-overflow warning in wbcSidToString()
../../nsswitch/libwbclient/wbc_sid.c:83:5: error: assuming signed overflow does not occur when simplifying conditional [-Werror=strict-overflow]
  if (len+1 > sizeof(buf)) {
     ^

Even this would fail:
../../nsswitch/libwbclient/wbc_sid.c:83:5: error: assuming signed overflow does not occur when simplifying conditional [-Werror=strict-overflow]
  if (len >= sizeof(buf)) {
     ^

Note that this only seems to happen with gcc 7 and when -O3 and
-fvisibility=hidden are used together. E.g. in the opensuse151-samba-o3
builds.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14780

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2021-11-30 15:53:34 +00:00
Ralph Boehme
2327471756 lib: relicense smb_strtoul(l) under LGPLv3
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Aug  3 22:21:04 UTC 2020 on sn-devel-184
2020-08-03 22:21:02 +00:00
Noel Power
c19f1c9a3e nsswitch/libwbclient: clang Fix Potential leak of memory
Fixes:

nsswitch/libwbclient/wbc_sid.c:848:2: warning: Potential leak of memory pointed to by 'extra_data'
        free(extra_data);
        ^
1 warning generated.
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-07-11 04:08:13 +00:00
Swen Schillig
bf020a8c8d nsswitch: Update all consumers of strtoul_err(), strtoull_err() to new API
Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2019-06-30 11:32:18 +00:00
Swen Schillig
ea7231dcc0 libwbclient: Use wrapper for string to integer conversion
In order to detect an value overflow error during
the string to integer conversion with strtoul/strtoull,
the errno variable must be set to zero before the execution and
checked after the conversion is performed. This is achieved by
using the wrapper function strtoul_err and strtoull_err.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Ralph Böhme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-03-01 00:32:11 +00:00
Volker Lendecke
bebf90f7a1 libwbclient: Fix CID 1414781 Dereference null return value
Basically a cut&paste error from somewhere else

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

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Jul 12 22:12:22 CEST 2017 on sn-devel-144
2017-07-12 22:12:21 +02:00
Stefan Metzmacher
1e0df575bc libwbclient: add WBC_SID_NAME_LABEL
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Mar 23 12:55:26 CET 2017 on sn-devel-144
2017-03-23 12:55:26 +01:00
Matthew Newton
063c56dba5 Add context versions of wbclient functions
To make the libwbclient library thread-safe, all functions
that call through to wb_common winbindd_request_response need
to have context that they can use. This commit adds all the
necessary functions.

Signed-off-by: Matthew Newton <matthew-git@newtoncomputing.co.uk>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-10 00:50:10 +01:00
Jeremy Allison
b0ba4a5621 CVE-2013-4408:s3:Ensure LookupSids replies arrays are range checked.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>
2013-12-09 07:05:46 +01:00
Jeff Layton
ba9d8612e3 wbclient: fix conversion logic in wbcSidToStringBuf
Might as well fix it to handle large authority values properly. Also
correct some of the formatting.

Signed-off-by: Jeff Layton <jlayton@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-07-31 15:16:04 -07:00
Jeff Layton
1a4ec0b885 wbclient: fix conversion logic in wbcStringToSid
Signed-off-by: Jeff Layton <jlayton@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-07-31 15:15:47 -07:00
Volker Lendecke
18e2e86c08 libwbclient: Fix an invalid free()
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Wed May 16 00:00:00 CEST 2012 on sn-devel-104
2012-05-16 00:00:00 +02:00
Volker Lendecke
cfe30df98e libwbclient: Add wbcLookupSids
Signed-off-by: Jeremy Allison <jra@samba.org>
2011-04-13 14:13:25 -07:00
Volker Lendecke
0fea80c1d6 s3: Fix Coverity ID 2217: RESOURCE_LEAK
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Mar 30 10:45:44 CEST 2011 on sn-devel-104
2011-03-30 10:45:44 +02:00
Volker Lendecke
c22151ea3a libwbclient: Remove a pointless check 2011-03-10 10:25:19 +01:00
Volker Lendecke
7ffa7e4bca libwbclient: Use wbcSidToStringBuf 2011-03-05 14:29:32 +01:00
Volker Lendecke
afb6752fa7 libwbclient: Add wbcSidToStringBuf 2011-03-05 14:29:32 +01:00
Volker Lendecke
ba537079cf libwbclient: wbcFreeMemory deals fine with a NULL pointer 2010-04-19 16:31:03 +02:00
Volker Lendecke
89bbc41d02 libwbclient: Fix wbcListGroups against too small num_entries
Thanks for the s4 winbind sending 0 here and Tridge to point it out to me :-)
2010-04-19 16:31:02 +02:00
Volker Lendecke
6d898b45a3 libwbclient: Fix wbcListUsers against too small num_entries
Thanks for the s4 winbind sending 0 here and Tridge to point it out to me :-)
2010-04-19 16:31:02 +02:00
Volker Lendecke
df831df666 libwbclient: Make wbcLookupUserSids not use talloc 2010-04-19 14:27:20 +02:00
Volker Lendecke
b828985aa1 libwbclient: Make wbcGetDisplayName not use talloc 2010-04-19 14:27:18 +02:00
Volker Lendecke
8f3ab439f3 libwbclient: Make wbcListGroups not use talloc 2010-04-19 14:27:18 +02:00
Volker Lendecke
1152cba5d2 libwbclient: Make wbcListUsers not use talloc 2010-04-19 14:27:18 +02:00
Volker Lendecke
e80d0ecf8b libwbclient: Make wbcGetSidAliases not use talloc 2010-04-19 14:27:18 +02:00
Volker Lendecke
679e7ef6e6 libwbclient: Fix some pointless macro calls 2010-04-19 14:27:17 +02:00
Volker Lendecke
3d3b84bdec libwbclient: Take -21 into account in length guessing 2010-04-19 14:27:17 +02:00
Volker Lendecke
d29a5e69f4 libwbclient: Fix some pointless macro calls 2010-04-19 14:27:17 +02:00
Volker Lendecke
4f88b7015d libwbclient: Make wbcLookupRids not use talloc 2010-04-19 14:27:17 +02:00
Volker Lendecke
0a966980f4 libwbclient: Make wbcLookupSid not use talloc 2010-04-19 14:27:16 +02:00
Volker Lendecke
ed1981db05 libwbclient: Convert wbcSidToString to not use talloc 2010-04-19 14:27:16 +02:00
Volker Lendecke
1038a134ed libwbclient: Fix a memleak in wbcGetDisplayName 2010-04-10 17:05:38 +02:00
Volker Lendecke
27d3bdd36b libwbclient: Ensure correct 0-termination in wbcGetSidAliases 2010-04-10 17:05:38 +02:00
Volker Lendecke
bbe07972e6 libwbclient: Both talloc_free and wbcFreeMemory deal with NULL
This is in line with the ANSI C standard definition of free(NULL)
2010-04-03 22:12:23 +02:00
Kai Blin
b99d9f86e4 libwbclient: Separate out the async functions 2010-02-13 14:30:36 +01:00
Kai Blin
cf968371ef libwbclient: Implement wbcLookupName_send/recv 2010-02-11 23:56:35 +01:00
Kai Blin
749fb03971 libwbclient: Implement wbcLookupSid_send/recv 2010-02-11 23:56:34 +01:00
Volker Lendecke
96b12e0d59 libwbclient: Use winbindd_free_response() 2010-01-24 14:52:33 +01:00
Volker Lendecke
5aeb954ba9 s3: Fix a memleak reported by dmarkey 2009-10-09 23:00:08 +02:00
Kai Blin
a7128709d2 libwbclient: Add wbcSidTypeString function. 2009-08-18 19:53:41 +02:00
Kai Blin
5e67aa92f6 libwbclient: Attempt to fix build on AIX 2009-06-04 22:32:50 +02:00
Dan Sledz
3b8a57e064 s3: Implement wbcGetSidAliases
* Adds wbcGetSidAliases that calls the lookup_useraliases function.
* Updates wbinfo and winbind_util.c to call the new function.
* Also added winbind_get_groups helper function.
2009-02-11 19:39:18 -08:00
Kai Blin
6821d898d7 nsswitch: Move source3 files to top level dir.
Don't move source4 files yet to not confuse git's rename tracking too much.
2008-12-16 13:02:45 +01:00