summaryrefslogtreecommitdiff
path: root/nsswitch
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2021-10-12 14:30:09 +0200
committerStefan Metzmacher <metze@samba.org>2021-11-30 15:53:34 +0000
commit62d05a81087029d93ba0cf81c11e5b244d788aef (patch)
treeaab2dd897bff71f7887d7604a1f12198e69778d1 /nsswitch
parentfa98a44cb4d94c6a290deb931b260e411364314d (diff)
downloadsamba-62d05a81087029d93ba0cf81c11e5b244d788aef.tar.gz
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>
Diffstat (limited to 'nsswitch')
-rw-r--r--nsswitch/libwbclient/wbc_guid.c2
-rw-r--r--nsswitch/libwbclient/wbc_idmap.c26
-rw-r--r--nsswitch/libwbclient/wbc_pam.c26
-rw-r--r--nsswitch/libwbclient/wbc_pwd.c26
-rw-r--r--nsswitch/libwbclient/wbc_sid.c22
-rw-r--r--nsswitch/libwbclient/wbc_util.c20
-rw-r--r--nsswitch/libwbclient/wbclient.c11
-rw-r--r--nsswitch/libwbclient/wscript1
8 files changed, 134 insertions, 0 deletions
diff --git a/nsswitch/libwbclient/wbc_guid.c b/nsswitch/libwbclient/wbc_guid.c
index 631d7ecb751..72701c8c574 100644
--- a/nsswitch/libwbclient/wbc_guid.c
+++ b/nsswitch/libwbclient/wbc_guid.c
@@ -26,6 +26,7 @@
#include "libwbclient.h"
/* Convert a binary GUID to a character string */
+_PUBLIC_
wbcErr wbcGuidToString(const struct wbcGuid *guid,
char **guid_string)
{
@@ -50,6 +51,7 @@ wbcErr wbcGuidToString(const struct wbcGuid *guid,
}
/* @brief Convert a character string to a binary GUID */
+_PUBLIC_
wbcErr wbcStringToGuid(const char *str,
struct wbcGuid *guid)
{
diff --git a/nsswitch/libwbclient/wbc_idmap.c b/nsswitch/libwbclient/wbc_idmap.c
index 05ac60853a5..c3accedc248 100644
--- a/nsswitch/libwbclient/wbc_idmap.c
+++ b/nsswitch/libwbclient/wbc_idmap.c
@@ -27,6 +27,7 @@
#include "lib/util/smb_strtox.h"
/* Convert a Windows SID to a Unix uid, allocating an uid if needed */
+_PUBLIC_
wbcErr wbcCtxSidToUid(struct wbcContext *ctx, const struct wbcDomainSid *sid,
uid_t *puid)
{
@@ -54,12 +55,14 @@ wbcErr wbcCtxSidToUid(struct wbcContext *ctx, const struct wbcDomainSid *sid,
return wbc_status;
}
+_PUBLIC_
wbcErr wbcSidToUid(const struct wbcDomainSid *sid, uid_t *puid)
{
return wbcCtxSidToUid(NULL, sid, puid);
}
/* Convert a Windows SID to a Unix uid if there already is a mapping */
+_PUBLIC_
wbcErr wbcQuerySidToUid(const struct wbcDomainSid *sid,
uid_t *puid)
{
@@ -67,6 +70,7 @@ wbcErr wbcQuerySidToUid(const struct wbcDomainSid *sid,
}
/* Convert a Unix uid to a Windows SID, allocating a SID if needed */
+_PUBLIC_
wbcErr wbcCtxUidToSid(struct wbcContext *ctx, uid_t uid,
struct wbcDomainSid *psid)
{
@@ -97,12 +101,14 @@ done:
return wbc_status;
}
+_PUBLIC_
wbcErr wbcUidToSid(uid_t uid, struct wbcDomainSid *sid)
{
return wbcCtxUidToSid(NULL, uid, sid);
}
/* Convert a Unix uid to a Windows SID if there already is a mapping */
+_PUBLIC_
wbcErr wbcQueryUidToSid(uid_t uid,
struct wbcDomainSid *sid)
{
@@ -118,6 +124,7 @@ wbcErr wbcQueryUidToSid(uid_t uid,
*
**/
+_PUBLIC_
wbcErr wbcCtxSidToGid(struct wbcContext *ctx, const struct wbcDomainSid *sid,
gid_t *pgid)
{
@@ -145,6 +152,7 @@ wbcErr wbcCtxSidToGid(struct wbcContext *ctx, const struct wbcDomainSid *sid,
return wbc_status;
}
+_PUBLIC_
wbcErr wbcSidToGid(const struct wbcDomainSid *sid, gid_t *pgid)
{
return wbcCtxSidToGid(NULL, sid, pgid);
@@ -152,6 +160,7 @@ wbcErr wbcSidToGid(const struct wbcDomainSid *sid, gid_t *pgid)
/* Convert a Windows SID to a Unix gid if there already is a mapping */
+_PUBLIC_
wbcErr wbcQuerySidToGid(const struct wbcDomainSid *sid,
gid_t *pgid)
{
@@ -160,6 +169,7 @@ wbcErr wbcQuerySidToGid(const struct wbcDomainSid *sid,
/* Convert a Unix gid to a Windows SID, allocating a SID if needed */
+_PUBLIC_
wbcErr wbcCtxGidToSid(struct wbcContext *ctx, gid_t gid,
struct wbcDomainSid *psid)
{
@@ -190,12 +200,14 @@ done:
return wbc_status;
}
+_PUBLIC_
wbcErr wbcGidToSid(gid_t gid, struct wbcDomainSid *sid)
{
return wbcCtxGidToSid(NULL, gid, sid);
}
/* Convert a Unix gid to a Windows SID if there already is a mapping */
+_PUBLIC_
wbcErr wbcQueryGidToSid(gid_t gid,
struct wbcDomainSid *sid)
{
@@ -203,6 +215,7 @@ wbcErr wbcQueryGidToSid(gid_t gid,
}
/* Obtain a new uid from Winbind */
+_PUBLIC_
wbcErr wbcCtxAllocateUid(struct wbcContext *ctx, uid_t *puid)
{
struct winbindd_request request;
@@ -232,12 +245,14 @@ wbcErr wbcCtxAllocateUid(struct wbcContext *ctx, uid_t *puid)
return wbc_status;
}
+_PUBLIC_
wbcErr wbcAllocateUid(uid_t *puid)
{
return wbcCtxAllocateUid(NULL, puid);
}
/* Obtain a new gid from Winbind */
+_PUBLIC_
wbcErr wbcCtxAllocateGid(struct wbcContext *ctx, gid_t *pgid)
{
struct winbindd_request request;
@@ -267,6 +282,7 @@ wbcErr wbcCtxAllocateGid(struct wbcContext *ctx, gid_t *pgid)
return wbc_status;
}
+_PUBLIC_
wbcErr wbcAllocateGid(gid_t *pgid)
{
return wbcCtxAllocateGid(NULL, pgid);
@@ -277,42 +293,49 @@ wbcErr wbcAllocateGid(gid_t *pgid)
#define _ID_TYPE_GID 2
/* Set an user id mapping - not implemented any more */
+_PUBLIC_
wbcErr wbcSetUidMapping(uid_t uid, const struct wbcDomainSid *sid)
{
return WBC_ERR_NOT_IMPLEMENTED;
}
/* Set a group id mapping - not implemented any more */
+_PUBLIC_
wbcErr wbcSetGidMapping(gid_t gid, const struct wbcDomainSid *sid)
{
return WBC_ERR_NOT_IMPLEMENTED;
}
/* Remove a user id mapping - not implemented any more */
+_PUBLIC_
wbcErr wbcRemoveUidMapping(uid_t uid, const struct wbcDomainSid *sid)
{
return WBC_ERR_NOT_IMPLEMENTED;
}
/* Remove a group id mapping - not implemented any more */
+_PUBLIC_
wbcErr wbcRemoveGidMapping(gid_t gid, const struct wbcDomainSid *sid)
{
return WBC_ERR_NOT_IMPLEMENTED;
}
/* Set the highwater mark for allocated uids - not implemented any more */
+_PUBLIC_
wbcErr wbcSetUidHwm(uid_t uid_hwm)
{
return WBC_ERR_NOT_IMPLEMENTED;
}
/* Set the highwater mark for allocated gids - not implemented any more */
+_PUBLIC_
wbcErr wbcSetGidHwm(gid_t gid_hwm)
{
return WBC_ERR_NOT_IMPLEMENTED;
}
/* Convert a list of SIDs */
+_PUBLIC_
wbcErr wbcCtxSidsToUnixIds(struct wbcContext *ctx,
const struct wbcDomainSid *sids,
uint32_t num_sids, struct wbcUnixId *ids)
@@ -422,12 +445,14 @@ done:
return wbc_status;
}
+_PUBLIC_
wbcErr wbcSidsToUnixIds(const struct wbcDomainSid *sids, uint32_t num_sids,
struct wbcUnixId *ids)
{
return wbcCtxSidsToUnixIds(NULL, sids, num_sids, ids);
}
+_PUBLIC_
wbcErr wbcCtxUnixIdsToSids(struct wbcContext *ctx,
const struct wbcUnixId *ids, uint32_t num_ids,
struct wbcDomainSid *sids)
@@ -517,6 +542,7 @@ fail:
return wbc_status;
}
+_PUBLIC_
wbcErr wbcUnixIdsToSids(const struct wbcUnixId *ids, uint32_t num_ids,
struct wbcDomainSid *sids)
{
diff --git a/nsswitch/libwbclient/wbc_pam.c b/nsswitch/libwbclient/wbc_pam.c
index e4cd2963012..b4bb2678ad0 100644
--- a/nsswitch/libwbclient/wbc_pam.c
+++ b/nsswitch/libwbclient/wbc_pam.c
@@ -28,6 +28,7 @@
#include "../winbind_client.h"
/* Authenticate a username/password pair */
+_PUBLIC_
wbcErr wbcCtxAuthenticateUser(struct wbcContext *ctx,
const char *username, const char *password)
{
@@ -47,6 +48,7 @@ done:
return wbc_status;
}
+_PUBLIC_
wbcErr wbcAuthenticateUser(const char *username, const char *password)
{
return wbcCtxAuthenticateUser(NULL, username, password);
@@ -358,6 +360,7 @@ done:
/* Authenticate with more detailed information */
+_PUBLIC_
wbcErr wbcCtxAuthenticateUserEx(struct wbcContext *ctx,
const struct wbcAuthUserParams *params,
struct wbcAuthUserInfo **info,
@@ -566,6 +569,7 @@ done:
return wbc_status;
}
+_PUBLIC_
wbcErr wbcAuthenticateUserEx(const struct wbcAuthUserParams *params,
struct wbcAuthUserInfo **info,
struct wbcAuthErrorInfo **error)
@@ -574,6 +578,7 @@ wbcErr wbcAuthenticateUserEx(const struct wbcAuthUserParams *params,
}
/* Trigger a verification of the trust credentials of a specific domain */
+_PUBLIC_
wbcErr wbcCtxCheckTrustCredentials(struct wbcContext *ctx, const char *domain,
struct wbcAuthErrorInfo **error)
{
@@ -609,6 +614,7 @@ wbcErr wbcCtxCheckTrustCredentials(struct wbcContext *ctx, const char *domain,
return wbc_status;
}
+_PUBLIC_
wbcErr wbcCheckTrustCredentials(const char *domain,
struct wbcAuthErrorInfo **error)
{
@@ -616,6 +622,7 @@ wbcErr wbcCheckTrustCredentials(const char *domain,
}
/* Trigger a change of the trust credentials for a specific domain */
+_PUBLIC_
wbcErr wbcCtxChangeTrustCredentials(struct wbcContext *ctx, const char *domain,
struct wbcAuthErrorInfo **error)
{
@@ -651,6 +658,7 @@ wbcErr wbcCtxChangeTrustCredentials(struct wbcContext *ctx, const char *domain,
return wbc_status;
}
+_PUBLIC_
wbcErr wbcChangeTrustCredentials(const char *domain,
struct wbcAuthErrorInfo **error)
{
@@ -661,12 +669,14 @@ wbcErr wbcChangeTrustCredentials(const char *domain,
* Trigger a no-op NETLOGON call. Lightweight version of
* wbcCheckTrustCredentials
*/
+_PUBLIC_
wbcErr wbcCtxPingDc(struct wbcContext *ctx, const char *domain,
struct wbcAuthErrorInfo **error)
{
return wbcCtxPingDc2(ctx, domain, error, NULL);
}
+_PUBLIC_
wbcErr wbcPingDc(const char *domain, struct wbcAuthErrorInfo **error)
{
return wbcPingDc2(domain, error, NULL);
@@ -676,6 +686,7 @@ wbcErr wbcPingDc(const char *domain, struct wbcAuthErrorInfo **error)
* Trigger a no-op NETLOGON call. Lightweight version of
* wbcCheckTrustCredentials, optionally return attempted DC
*/
+_PUBLIC_
wbcErr wbcCtxPingDc2(struct wbcContext *ctx, const char *domain,
struct wbcAuthErrorInfo **error, char **dcname)
{
@@ -723,6 +734,7 @@ wbcErr wbcCtxPingDc2(struct wbcContext *ctx, const char *domain,
return wbc_status;
}
+_PUBLIC_
wbcErr wbcPingDc2(const char *domain, struct wbcAuthErrorInfo **error,
char **dcname)
{
@@ -730,6 +742,7 @@ wbcErr wbcPingDc2(const char *domain, struct wbcAuthErrorInfo **error,
}
/* Trigger an extended logoff notification to Winbind for a specific user */
+_PUBLIC_
wbcErr wbcCtxLogoffUserEx(struct wbcContext *ctx,
const struct wbcLogoffUserParams *params,
struct wbcAuthErrorInfo **error)
@@ -816,6 +829,7 @@ wbcErr wbcCtxLogoffUserEx(struct wbcContext *ctx,
return wbc_status;
}
+_PUBLIC_
wbcErr wbcLogoffUserEx(const struct wbcLogoffUserParams *params,
struct wbcAuthErrorInfo **error)
{
@@ -823,6 +837,7 @@ wbcErr wbcLogoffUserEx(const struct wbcLogoffUserParams *params,
}
/* Trigger a logoff notification to Winbind for a specific user */
+_PUBLIC_
wbcErr wbcCtxLogoffUser(struct wbcContext *ctx,
const char *username, uid_t uid,
const char *ccfilename)
@@ -862,6 +877,7 @@ wbcErr wbcCtxLogoffUser(struct wbcContext *ctx,
return wbc_status;
}
+_PUBLIC_
wbcErr wbcLogoffUser(const char *username,
uid_t uid,
const char *ccfilename)
@@ -870,6 +886,7 @@ wbcErr wbcLogoffUser(const char *username,
}
/* Change a password for a user with more detailed information upon failure */
+_PUBLIC_
wbcErr wbcCtxChangeUserPasswordEx(struct wbcContext *ctx,
const struct wbcChangePasswordParams *params,
struct wbcAuthErrorInfo **error,
@@ -1068,6 +1085,7 @@ wbcErr wbcCtxChangeUserPasswordEx(struct wbcContext *ctx,
return wbc_status;
}
+_PUBLIC_
wbcErr wbcChangeUserPasswordEx(const struct wbcChangePasswordParams *params,
struct wbcAuthErrorInfo **error,
enum wbcPasswordChangeRejectReason *reject_reason,
@@ -1078,6 +1096,7 @@ wbcErr wbcChangeUserPasswordEx(const struct wbcChangePasswordParams *params,
}
/* Change a password for a user */
+_PUBLIC_
wbcErr wbcCtxChangeUserPassword(struct wbcContext *ctx,
const char *username,
const char *old_password,
@@ -1103,6 +1122,7 @@ done:
return wbc_status;
}
+_PUBLIC_
wbcErr wbcChangeUserPassword(const char *username,
const char *old_password,
const char *new_password)
@@ -1112,6 +1132,7 @@ wbcErr wbcChangeUserPassword(const char *username,
}
/* Logon a User */
+_PUBLIC_
wbcErr wbcCtxLogonUser(struct wbcContext *ctx,
const struct wbcLogonUserParams *params,
struct wbcLogonUserInfo **info,
@@ -1252,6 +1273,7 @@ done:
return wbc_status;
}
+_PUBLIC_
wbcErr wbcLogonUser(const struct wbcLogonUserParams *params,
struct wbcLogonUserInfo **info,
struct wbcAuthErrorInfo **error,
@@ -1268,6 +1290,7 @@ static void wbcCredentialCacheInfoDestructor(void *ptr)
}
/* Authenticate a user with cached credentials */
+_PUBLIC_
wbcErr wbcCtxCredentialCache(struct wbcContext *ctx,
struct wbcCredentialCacheParams *params,
struct wbcCredentialCacheInfo **info,
@@ -1425,6 +1448,7 @@ fail:
return status;
}
+_PUBLIC_
wbcErr wbcCredentialCache(struct wbcCredentialCacheParams *params,
struct wbcCredentialCacheInfo **info,
struct wbcAuthErrorInfo **error)
@@ -1433,6 +1457,7 @@ wbcErr wbcCredentialCache(struct wbcCredentialCacheParams *params,
}
/* Authenticate a user with cached credentials */
+_PUBLIC_
wbcErr wbcCtxCredentialSave(struct wbcContext *ctx,
const char *user, const char *password)
{
@@ -1451,6 +1476,7 @@ wbcErr wbcCtxCredentialSave(struct wbcContext *ctx,
return wbcRequestResponse(ctx, WINBINDD_CCACHE_SAVE, &request, &response);
}
+_PUBLIC_
wbcErr wbcCredentialSave(const char *user, const char *password)
{
return wbcCtxCredentialSave(NULL, user, password);
diff --git a/nsswitch/libwbclient/wbc_pwd.c b/nsswitch/libwbclient/wbc_pwd.c
index 805ab63e42c..4e83fbf073f 100644
--- a/nsswitch/libwbclient/wbc_pwd.c
+++ b/nsswitch/libwbclient/wbc_pwd.c
@@ -168,6 +168,7 @@ fail:
}
/* Fill in a struct passwd* for a domain user based on username */
+_PUBLIC_
wbcErr wbcCtxGetpwnam(struct wbcContext *ctx,
const char *name, struct passwd **pwd)
{
@@ -201,12 +202,14 @@ wbcErr wbcCtxGetpwnam(struct wbcContext *ctx,
return wbc_status;
}
+_PUBLIC_
wbcErr wbcGetpwnam(const char *name, struct passwd **pwd)
{
return wbcCtxGetpwnam(NULL, name, pwd);
}
/* Fill in a struct passwd* for a domain user based on uid */
+_PUBLIC_
wbcErr wbcCtxGetpwuid(struct wbcContext *ctx, uid_t uid, struct passwd **pwd)
{
wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
@@ -237,12 +240,14 @@ wbcErr wbcCtxGetpwuid(struct wbcContext *ctx, uid_t uid, struct passwd **pwd)
return wbc_status;
}
+_PUBLIC_
wbcErr wbcGetpwuid(uid_t uid, struct passwd **pwd)
{
return wbcCtxGetpwuid(NULL, uid, pwd);
}
/* Fill in a struct passwd* for a domain user based on sid */
+_PUBLIC_
wbcErr wbcCtxGetpwsid(struct wbcContext *ctx,
struct wbcDomainSid *sid, struct passwd **pwd)
{
@@ -274,12 +279,14 @@ wbcErr wbcCtxGetpwsid(struct wbcContext *ctx,
return wbc_status;
}
+_PUBLIC_
wbcErr wbcGetpwsid(struct wbcDomainSid *sid, struct passwd **pwd)
{
return wbcCtxGetpwsid(NULL, sid, pwd);
}
/* Fill in a struct passwd* for a domain user based on username */
+_PUBLIC_
wbcErr wbcCtxGetgrnam(struct wbcContext *ctx,
const char *name, struct group **grp)
{
@@ -316,12 +323,14 @@ wbcErr wbcCtxGetgrnam(struct wbcContext *ctx,
return wbc_status;
}
+_PUBLIC_
wbcErr wbcGetgrnam(const char *name, struct group **grp)
{
return wbcCtxGetgrnam(NULL, name, grp);
}
/* Fill in a struct passwd* for a domain user based on uid */
+_PUBLIC_
wbcErr wbcCtxGetgrgid(struct wbcContext *ctx, gid_t gid, struct group **grp)
{
wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
@@ -355,6 +364,7 @@ wbcErr wbcCtxGetgrgid(struct wbcContext *ctx, gid_t gid, struct group **grp)
return wbc_status;
}
+_PUBLIC_
wbcErr wbcGetgrgid(gid_t gid, struct group **grp)
{
return wbcCtxGetgrgid(NULL, gid, grp);
@@ -366,6 +376,7 @@ wbcErr wbcGetgrgid(gid_t gid, struct group **grp)
static struct winbindd_response pw_response;
/* Reset the passwd iterator */
+_PUBLIC_
wbcErr wbcCtxSetpwent(struct wbcContext *ctx)
{
wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
@@ -389,12 +400,14 @@ wbcErr wbcCtxSetpwent(struct wbcContext *ctx)
return wbc_status;
}
+_PUBLIC_
wbcErr wbcSetpwent(void)
{
return wbcCtxSetpwent(NULL);
}
/* Close the passwd iterator */
+_PUBLIC_
wbcErr wbcCtxEndpwent(struct wbcContext *ctx)
{
wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
@@ -416,12 +429,14 @@ wbcErr wbcCtxEndpwent(struct wbcContext *ctx)
return wbc_status;
}
+_PUBLIC_
wbcErr wbcEndpwent(void)
{
return wbcCtxEndpwent(NULL);
}
/* Return the next struct passwd* entry from the pwent iterator */
+_PUBLIC_
wbcErr wbcCtxGetpwent(struct wbcContext *ctx, struct passwd **pwd)
{
wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
@@ -467,6 +482,7 @@ done:
return wbc_status;
}
+_PUBLIC_
wbcErr wbcGetpwent(struct passwd **pwd)
{
return wbcCtxGetpwent(NULL, pwd);
@@ -478,6 +494,7 @@ wbcErr wbcGetpwent(struct passwd **pwd)
static struct winbindd_response gr_response;
/* Reset the group iterator */
+_PUBLIC_
wbcErr wbcCtxSetgrent(struct wbcContext *ctx)
{
wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
@@ -501,12 +518,14 @@ wbcErr wbcCtxSetgrent(struct wbcContext *ctx)
return wbc_status;
}
+_PUBLIC_
wbcErr wbcSetgrent(void)
{
return wbcCtxSetgrent(NULL);
}
/* Close the group iterator */
+_PUBLIC_
wbcErr wbcCtxEndgrent(struct wbcContext *ctx)
{
wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
@@ -528,12 +547,14 @@ wbcErr wbcCtxEndgrent(struct wbcContext *ctx)
return wbc_status;
}
+_PUBLIC_
wbcErr wbcEndgrent(void)
{
return wbcCtxEndgrent(NULL);
}
/* Return the next struct group* entry from the pwent iterator */
+_PUBLIC_
wbcErr wbcCtxGetgrent(struct wbcContext *ctx, struct group **grp)
{
wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
@@ -584,12 +605,14 @@ done:
return wbc_status;
}
+_PUBLIC_
wbcErr wbcGetgrent(struct group **grp)
{
return wbcCtxGetgrent(NULL, grp);
}
/* Return the next struct group* entry from the pwent iterator */
+_PUBLIC_
wbcErr wbcCtxGetgrlist(struct wbcContext *ctx, struct group **grp)
{
wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
@@ -636,12 +659,14 @@ done:
return wbc_status;
}
+_PUBLIC_
wbcErr wbcGetgrlist(struct group **grp)
{
return wbcCtxGetgrlist(NULL, grp);
}
/* Return the unix group array belonging to the given user */
+_PUBLIC_
wbcErr wbcCtxGetGroups(struct wbcContext *ctx, const char *account,
uint32_t *num_groups, gid_t **_groups)
{
@@ -690,6 +715,7 @@ wbcErr wbcCtxGetGroups(struct wbcContext *ctx, const char *account,
return wbc_status;
}
+_PUBLIC_
wbcErr wbcGetGroups(const char *account, uint32_t *num_groups, gid_t **_groups)
{
return wbcCtxGetGroups(NULL, account, num_groups, _groups);
diff --git a/nsswitch/libwbclient/wbc_sid.c b/nsswitch/libwbclient/wbc_sid.c
index 3dfc0805767..e4b6376adf3 100644
--- a/nsswitch/libwbclient/wbc_sid.c
+++ b/nsswitch/libwbclient/wbc_sid.c
@@ -31,6 +31,7 @@
/* Convert a sid to a string into a buffer. Return the string
* length. If buflen is too small, return the string length that would
* result if it was long enough. */
+_PUBLIC_
int wbcSidToStringBuf(const struct wbcDomainSid *sid, char *buf, int buflen)
{
uint64_t id_auth;
@@ -65,6 +66,7 @@ int wbcSidToStringBuf(const struct wbcDomainSid *sid, char *buf, int buflen)
}
/* Convert a binary SID to a character string */
+_PUBLIC_
wbcErr wbcSidToString(const struct wbcDomainSid *sid,
char **sid_string)
{
@@ -95,6 +97,7 @@ wbcErr wbcSidToString(const struct wbcDomainSid *sid,
#define AUTHORITY_MASK (~(0xffffffffffffULL))
/* Convert a character string to a binary SID */
+_PUBLIC_
wbcErr wbcStringToSid(const char *str,
struct wbcDomainSid *sid)
{
@@ -182,6 +185,7 @@ done:
/* Convert a domain and name to SID */
+_PUBLIC_
wbcErr wbcCtxLookupName(struct wbcContext *ctx,
const char *domain,
const char *name,
@@ -225,6 +229,7 @@ wbcErr wbcCtxLookupName(struct wbcContext *ctx,
return wbc_status;
}
+_PUBLIC_
wbcErr wbcLookupName(const char *domain,
const char *name,
struct wbcDomainSid *sid,
@@ -235,6 +240,7 @@ wbcErr wbcLookupName(const char *domain,
/* Convert a SID to a domain and name */
+_PUBLIC_
wbcErr wbcCtxLookupSid(struct wbcContext *ctx,
const struct wbcDomainSid *sid,
char **pdomain,
@@ -298,6 +304,7 @@ done:
return wbc_status;
}
+_PUBLIC_
wbcErr wbcLookupSid(const struct wbcDomainSid *sid,
char **pdomain,
char **pname,
@@ -327,6 +334,7 @@ static void wbcTranslatedNamesDestructor(void *ptr)
}
}
+_PUBLIC_
wbcErr wbcCtxLookupSids(struct wbcContext *ctx,
const struct wbcDomainSid *sids, int num_sids,
struct wbcDomainInfo **pdomains, int *pnum_domains,
@@ -502,6 +510,7 @@ fail:
return wbc_status;
}
+_PUBLIC_
wbcErr wbcLookupSids(const struct wbcDomainSid *sids, int num_sids,
struct wbcDomainInfo **pdomains, int *pnum_domains,
struct wbcTranslatedName **pnames)
@@ -512,6 +521,7 @@ wbcErr wbcLookupSids(const struct wbcDomainSid *sids, int num_sids,
/* Translate a collection of RIDs within a domain to names */
+_PUBLIC_
wbcErr wbcCtxLookupRids(struct wbcContext *ctx, struct wbcDomainSid *dom_sid,
int num_rids,
uint32_t *rids,
@@ -639,6 +649,7 @@ wbcErr wbcCtxLookupRids(struct wbcContext *ctx, struct wbcDomainSid *dom_sid,
return wbc_status;
}
+_PUBLIC_
wbcErr wbcLookupRids(struct wbcDomainSid *dom_sid,
int num_rids,
uint32_t *rids,
@@ -651,6 +662,7 @@ wbcErr wbcLookupRids(struct wbcDomainSid *dom_sid,
}
/* Get the groups a user belongs to */
+_PUBLIC_
wbcErr wbcCtxLookupUserSids(struct wbcContext *ctx,
const struct wbcDomainSid *user_sid,
bool domain_groups_only,
@@ -724,6 +736,7 @@ wbcErr wbcCtxLookupUserSids(struct wbcContext *ctx,
return wbc_status;
}
+_PUBLIC_
wbcErr wbcLookupUserSids(const struct wbcDomainSid *user_sid,
bool domain_groups_only,
uint32_t *num_sids,
@@ -745,6 +758,7 @@ wbcErr _sid_to_rid(struct wbcDomainSid *sid, uint32_t *rid)
}
/* Get alias membership for sids */
+_PUBLIC_
wbcErr wbcCtxGetSidAliases(struct wbcContext *ctx,
const struct wbcDomainSid *dom_sid,
struct wbcDomainSid *sids,
@@ -853,6 +867,7 @@ wbcErr wbcCtxGetSidAliases(struct wbcContext *ctx,
return wbc_status;
}
+_PUBLIC_
wbcErr wbcGetSidAliases(const struct wbcDomainSid *dom_sid,
struct wbcDomainSid *sids,
uint32_t num_sids,
@@ -865,6 +880,7 @@ wbcErr wbcGetSidAliases(const struct wbcDomainSid *dom_sid,
/* Lists Users */
+_PUBLIC_
wbcErr wbcCtxListUsers(struct wbcContext *ctx,
const char *domain_name,
uint32_t *_num_users,
@@ -939,6 +955,7 @@ wbcErr wbcCtxListUsers(struct wbcContext *ctx,
return wbc_status;
}
+_PUBLIC_
wbcErr wbcListUsers(const char *domain_name,
uint32_t *_num_users,
const char ***_users)
@@ -947,6 +964,7 @@ wbcErr wbcListUsers(const char *domain_name,
}
/* Lists Groups */
+_PUBLIC_
wbcErr wbcCtxListGroups(struct wbcContext *ctx,
const char *domain_name,
uint32_t *_num_groups,
@@ -1021,6 +1039,7 @@ wbcErr wbcCtxListGroups(struct wbcContext *ctx,
return wbc_status;
}
+_PUBLIC_
wbcErr wbcListGroups(const char *domain_name,
uint32_t *_num_groups,
const char ***_groups)
@@ -1028,6 +1047,7 @@ wbcErr wbcListGroups(const char *domain_name,
return wbcCtxListGroups(NULL, domain_name, _num_groups, _groups);
}
+_PUBLIC_
wbcErr wbcCtxGetDisplayName(struct wbcContext *ctx,
const struct wbcDomainSid *sid,
char **pdomain,
@@ -1074,6 +1094,7 @@ wbcErr wbcCtxGetDisplayName(struct wbcContext *ctx,
return wbc_status;
}
+_PUBLIC_
wbcErr wbcGetDisplayName(const struct wbcDomainSid *sid,
char **pdomain,
char **pfullname,
@@ -1082,6 +1103,7 @@ wbcErr wbcGetDisplayName(const struct wbcDomainSid *sid,
return wbcCtxGetDisplayName(NULL, sid, pdomain, pfullname, pname_type);
}
+_PUBLIC_
const char* wbcSidTypeString(enum wbcSidType type)
{
switch (type) {
diff --git a/nsswitch/libwbclient/wbc_util.c b/nsswitch/libwbclient/wbc_util.c
index bd2d0f8b399..9e54baf54d7 100644
--- a/nsswitch/libwbclient/wbc_util.c
+++ b/nsswitch/libwbclient/wbc_util.c
@@ -32,6 +32,7 @@
*
* @return #wbcErr
**/
+_PUBLIC_
wbcErr wbcCtxPing(struct wbcContext *ctx)
{
struct winbindd_request request;
@@ -45,6 +46,7 @@ wbcErr wbcCtxPing(struct wbcContext *ctx)
return wbcRequestResponse(ctx, WINBINDD_PING, &request, &response);
}
+_PUBLIC_
wbcErr wbcPing(void)
{
return wbcCtxPing(NULL);
@@ -67,6 +69,7 @@ static void wbcInterfaceDetailsDestructor(void *ptr)
* @return #wbcErr
*/
+_PUBLIC_
wbcErr wbcCtxInterfaceDetails(struct wbcContext *ctx,
struct wbcInterfaceDetails **_details)
{
@@ -142,6 +145,7 @@ done:
return wbc_status;
}
+_PUBLIC_
wbcErr wbcInterfaceDetails(struct wbcInterfaceDetails **_details)
{
return wbcCtxInterfaceDetails(NULL, _details);
@@ -162,6 +166,7 @@ static void wbcDomainInfoDestructor(void *ptr)
* @return #wbcErr
*/
+_PUBLIC_
wbcErr wbcCtxDomainInfo(struct wbcContext *ctx,
const char *domain,
struct wbcDomainInfo **dinfo)
@@ -220,12 +225,14 @@ wbcErr wbcCtxDomainInfo(struct wbcContext *ctx,
return wbc_status;
}
+_PUBLIC_
wbcErr wbcDomainInfo(const char *domain, struct wbcDomainInfo **dinfo)
{
return wbcCtxDomainInfo(NULL, domain, dinfo);
}
/* Get the list of current DCs */
+_PUBLIC_
wbcErr wbcCtxDcInfo(struct wbcContext *ctx,
const char *domain, size_t *num_dcs,
const char ***dc_names, const char ***dc_ips)
@@ -313,6 +320,7 @@ done:
return wbc_status;
}
+_PUBLIC_
wbcErr wbcDcInfo(const char *domain, size_t *num_dcs,
const char ***dc_names, const char ***dc_ips)
{
@@ -320,6 +328,7 @@ wbcErr wbcDcInfo(const char *domain, size_t *num_dcs,
}
/* Resolve a NetbiosName via WINS */
+_PUBLIC_
wbcErr wbcCtxResolveWinsByName(struct wbcContext *ctx,
const char *name, char **ip)
{
@@ -353,12 +362,14 @@ wbcErr wbcCtxResolveWinsByName(struct wbcContext *ctx,
return wbc_status;
}
+_PUBLIC_
wbcErr wbcResolveWinsByName(const char *name, char **ip)
{
return wbcCtxResolveWinsByName(NULL, name, ip);
}
/* Resolve an IP address via WINS into a NetbiosName */
+_PUBLIC_
wbcErr wbcCtxResolveWinsByIP(struct wbcContext *ctx,
const char *ip, char **name)
{
@@ -392,6 +403,7 @@ wbcErr wbcCtxResolveWinsByIP(struct wbcContext *ctx,
return wbc_status;
}
+_PUBLIC_
wbcErr wbcResolveWinsByIP(const char *ip, char **name)
{
return wbcCtxResolveWinsByIP(NULL, ip, name);
@@ -542,6 +554,7 @@ static void wbcDomainInfoListDestructor(void *ptr)
}
/* Enumerate the domain trusts known by Winbind */
+_PUBLIC_
wbcErr wbcCtxListTrusts(struct wbcContext *ctx,
struct wbcDomainInfo **domains, size_t *num_domains)
{
@@ -613,6 +626,7 @@ wbcErr wbcCtxListTrusts(struct wbcContext *ctx,
return wbc_status;
}
+_PUBLIC_
wbcErr wbcListTrusts(struct wbcDomainInfo **domains, size_t *num_domains)
{
return wbcCtxListTrusts(NULL, domains, num_domains);
@@ -626,6 +640,7 @@ static void wbcDomainControllerInfoDestructor(void *ptr)
}
/* Enumerate the domain trusts known by Winbind */
+_PUBLIC_
wbcErr wbcCtxLookupDomainController(struct wbcContext *ctx,
const char *domain, uint32_t flags,
struct wbcDomainControllerInfo **dc_info)
@@ -673,6 +688,7 @@ done:
return wbc_status;
}
+_PUBLIC_
wbcErr wbcLookupDomainController(const char *domain, uint32_t flags,
struct wbcDomainControllerInfo **dc_info)
{
@@ -753,6 +769,7 @@ done:
}
/* Get extended domain controller information */
+_PUBLIC_
wbcErr wbcCtxLookupDomainControllerEx(struct wbcContext *ctx,
const char *domain,
struct wbcGuid *guid,
@@ -814,6 +831,7 @@ done:
return wbc_status;
}
+_PUBLIC_
wbcErr wbcLookupDomainControllerEx(const char *domain,
struct wbcGuid *guid,
const char *site,
@@ -836,6 +854,7 @@ static void wbcNamedBlobDestructor(void *ptr)
}
/* Initialize a named blob and add to list of blobs */
+_PUBLIC_
wbcErr wbcAddNamedBlob(size_t *num_blobs,
struct wbcNamedBlob **pblobs,
const char *name,
@@ -894,6 +913,7 @@ done:
return wbc_status;
}
+_PUBLIC_
void wbcSetClientProcessName(const char *name)
{
winbind_set_client_name(name);
diff --git a/nsswitch/libwbclient/wbclient.c b/nsswitch/libwbclient/wbclient.c
index 5444e823ddf..4562046a9fe 100644
--- a/nsswitch/libwbclient/wbclient.c
+++ b/nsswitch/libwbclient/wbclient.c
@@ -108,6 +108,7 @@ static wbcErr wbcRequestResponseInt(
*
* @return #wbcErr
*/
+_PUBLIC_ /* this is internal to wbclient_internal.h, but part of the ABI */
wbcErr wbcRequestResponse(struct wbcContext *ctx, int cmd,
struct winbindd_request *request,
struct winbindd_response *response)
@@ -122,6 +123,7 @@ wbcErr wbcRequestResponse(struct wbcContext *ctx, int cmd,
winbindd_request_response);
}
+_PUBLIC_ /* this is internal to wbclient_internal.h, but part of the ABI */
wbcErr wbcRequestResponsePriv(struct wbcContext *ctx, int cmd,
struct winbindd_request *request,
struct winbindd_response *response)
@@ -142,6 +144,7 @@ wbcErr wbcRequestResponsePriv(struct wbcContext *ctx, int cmd,
*
* @return a pointer to a static string
**/
+_PUBLIC_
const char *wbcErrorString(wbcErr error)
{
switch (error) {
@@ -197,6 +200,7 @@ static struct wbcMemPrefix *wbcMemToPrefix(void *ptr)
return (struct wbcMemPrefix *)(((char *)ptr) - wbcPrefixLen());
}
+_PUBLIC_ /* this is internal to wbclient_internal.h, but part of the ABI */
void *wbcAllocateMemory(size_t nelem, size_t elsize,
void (*destructor)(void *ptr))
{
@@ -218,6 +222,7 @@ void *wbcAllocateMemory(size_t nelem, size_t elsize,
}
/* Free library allocated memory */
+_PUBLIC_
void wbcFreeMemory(void *p)
{
struct wbcMemPrefix *wbcMem;
@@ -240,6 +245,7 @@ void wbcFreeMemory(void *p)
return;
}
+_PUBLIC_ /* this is internal to wbclient_internal.h, but part of the ABI */
char *wbcStrDup(const char *str)
{
char *result;
@@ -263,6 +269,7 @@ static void wbcStringArrayDestructor(void *ptr)
}
}
+_PUBLIC_ /* this is internal to wbclient_internal.h, but part of the ABI */
const char **wbcAllocateStringArray(int num_strings)
{
return (const char **)wbcAllocateMemory(
@@ -270,6 +277,7 @@ const char **wbcAllocateStringArray(int num_strings)
wbcStringArrayDestructor);
}
+_PUBLIC_
wbcErr wbcLibraryDetails(struct wbcLibraryDetails **_details)
{
struct wbcLibraryDetails *info;
@@ -298,6 +306,7 @@ static void wbcContextDestructor(void *ptr)
winbindd_ctx_free(ctx->winbindd_ctx);
}
+_PUBLIC_
struct wbcContext *wbcCtxCreate(void)
{
struct wbcContext *ctx;
@@ -322,11 +331,13 @@ struct wbcContext *wbcCtxCreate(void)
return ctx;
}
+_PUBLIC_
void wbcCtxFree(struct wbcContext *ctx)
{
wbcFreeMemory(ctx);
}
+_PUBLIC_ /* this is internal to wbclient_internal.h, but part of the ABI */
struct wbcContext *wbcGetGlobalCtx(void)
{
return &wbcGlobalCtx;
diff --git a/nsswitch/libwbclient/wscript b/nsswitch/libwbclient/wscript
index 17150a2036b..317c0913a93 100644
--- a/nsswitch/libwbclient/wscript
+++ b/nsswitch/libwbclient/wscript
@@ -37,6 +37,7 @@ def build(bld):
wbc_pwd.c
wbc_sid.c
wbc_util.c''',
+ hide_symbols=True,
deps='winbind-client smb_strtox',
pc_files='wbclient.pc',
public_headers='wbclient.h',