mirror of
https://github.com/samba-team/samba.git
synced 2025-03-27 22:50:26 +03:00
wbclient: Add wbcSetClientProcessName()
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
f49b62b44d
commit
1834513ebe
133
nsswitch/libwbclient/ABI/wbclient-0.15.sigs
Normal file
133
nsswitch/libwbclient/ABI/wbclient-0.15.sigs
Normal file
@ -0,0 +1,133 @@
|
||||
wbcAddNamedBlob: wbcErr (size_t *, struct wbcNamedBlob **, const char *, uint32_t, uint8_t *, size_t)
|
||||
wbcAllocateGid: wbcErr (gid_t *)
|
||||
wbcAllocateMemory: void *(size_t, size_t, void (*)(void *))
|
||||
wbcAllocateStringArray: const char **(int)
|
||||
wbcAllocateUid: wbcErr (uid_t *)
|
||||
wbcAuthenticateUser: wbcErr (const char *, const char *)
|
||||
wbcAuthenticateUserEx: wbcErr (const struct wbcAuthUserParams *, struct wbcAuthUserInfo **, struct wbcAuthErrorInfo **)
|
||||
wbcChangeTrustCredentials: wbcErr (const char *, struct wbcAuthErrorInfo **)
|
||||
wbcChangeUserPassword: wbcErr (const char *, const char *, const char *)
|
||||
wbcChangeUserPasswordEx: wbcErr (const struct wbcChangePasswordParams *, struct wbcAuthErrorInfo **, enum wbcPasswordChangeRejectReason *, struct wbcUserPasswordPolicyInfo **)
|
||||
wbcCheckTrustCredentials: wbcErr (const char *, struct wbcAuthErrorInfo **)
|
||||
wbcCredentialCache: wbcErr (struct wbcCredentialCacheParams *, struct wbcCredentialCacheInfo **, struct wbcAuthErrorInfo **)
|
||||
wbcCredentialSave: wbcErr (const char *, const char *)
|
||||
wbcCtxAllocateGid: wbcErr (struct wbcContext *, gid_t *)
|
||||
wbcCtxAllocateUid: wbcErr (struct wbcContext *, uid_t *)
|
||||
wbcCtxAuthenticateUser: wbcErr (struct wbcContext *, const char *, const char *)
|
||||
wbcCtxAuthenticateUserEx: wbcErr (struct wbcContext *, const struct wbcAuthUserParams *, struct wbcAuthUserInfo **, struct wbcAuthErrorInfo **)
|
||||
wbcCtxChangeTrustCredentials: wbcErr (struct wbcContext *, const char *, struct wbcAuthErrorInfo **)
|
||||
wbcCtxChangeUserPassword: wbcErr (struct wbcContext *, const char *, const char *, const char *)
|
||||
wbcCtxChangeUserPasswordEx: wbcErr (struct wbcContext *, const struct wbcChangePasswordParams *, struct wbcAuthErrorInfo **, enum wbcPasswordChangeRejectReason *, struct wbcUserPasswordPolicyInfo **)
|
||||
wbcCtxCheckTrustCredentials: wbcErr (struct wbcContext *, const char *, struct wbcAuthErrorInfo **)
|
||||
wbcCtxCreate: struct wbcContext *(void)
|
||||
wbcCtxCredentialCache: wbcErr (struct wbcContext *, struct wbcCredentialCacheParams *, struct wbcCredentialCacheInfo **, struct wbcAuthErrorInfo **)
|
||||
wbcCtxCredentialSave: wbcErr (struct wbcContext *, const char *, const char *)
|
||||
wbcCtxDcInfo: wbcErr (struct wbcContext *, const char *, size_t *, const char ***, const char ***)
|
||||
wbcCtxDomainInfo: wbcErr (struct wbcContext *, const char *, struct wbcDomainInfo **)
|
||||
wbcCtxEndgrent: wbcErr (struct wbcContext *)
|
||||
wbcCtxEndpwent: wbcErr (struct wbcContext *)
|
||||
wbcCtxFree: void (struct wbcContext *)
|
||||
wbcCtxGetDisplayName: wbcErr (struct wbcContext *, const struct wbcDomainSid *, char **, char **, enum wbcSidType *)
|
||||
wbcCtxGetGroups: wbcErr (struct wbcContext *, const char *, uint32_t *, gid_t **)
|
||||
wbcCtxGetSidAliases: wbcErr (struct wbcContext *, const struct wbcDomainSid *, struct wbcDomainSid *, uint32_t, uint32_t **, uint32_t *)
|
||||
wbcCtxGetgrent: wbcErr (struct wbcContext *, struct group **)
|
||||
wbcCtxGetgrgid: wbcErr (struct wbcContext *, gid_t, struct group **)
|
||||
wbcCtxGetgrlist: wbcErr (struct wbcContext *, struct group **)
|
||||
wbcCtxGetgrnam: wbcErr (struct wbcContext *, const char *, struct group **)
|
||||
wbcCtxGetpwent: wbcErr (struct wbcContext *, struct passwd **)
|
||||
wbcCtxGetpwnam: wbcErr (struct wbcContext *, const char *, struct passwd **)
|
||||
wbcCtxGetpwsid: wbcErr (struct wbcContext *, struct wbcDomainSid *, struct passwd **)
|
||||
wbcCtxGetpwuid: wbcErr (struct wbcContext *, uid_t, struct passwd **)
|
||||
wbcCtxGidToSid: wbcErr (struct wbcContext *, gid_t, struct wbcDomainSid *)
|
||||
wbcCtxInterfaceDetails: wbcErr (struct wbcContext *, struct wbcInterfaceDetails **)
|
||||
wbcCtxListGroups: wbcErr (struct wbcContext *, const char *, uint32_t *, const char ***)
|
||||
wbcCtxListTrusts: wbcErr (struct wbcContext *, struct wbcDomainInfo **, size_t *)
|
||||
wbcCtxListUsers: wbcErr (struct wbcContext *, const char *, uint32_t *, const char ***)
|
||||
wbcCtxLogoffUser: wbcErr (struct wbcContext *, const char *, uid_t, const char *)
|
||||
wbcCtxLogoffUserEx: wbcErr (struct wbcContext *, const struct wbcLogoffUserParams *, struct wbcAuthErrorInfo **)
|
||||
wbcCtxLogonUser: wbcErr (struct wbcContext *, const struct wbcLogonUserParams *, struct wbcLogonUserInfo **, struct wbcAuthErrorInfo **, struct wbcUserPasswordPolicyInfo **)
|
||||
wbcCtxLookupDomainController: wbcErr (struct wbcContext *, const char *, uint32_t, struct wbcDomainControllerInfo **)
|
||||
wbcCtxLookupDomainControllerEx: wbcErr (struct wbcContext *, const char *, struct wbcGuid *, const char *, uint32_t, struct wbcDomainControllerInfoEx **)
|
||||
wbcCtxLookupName: wbcErr (struct wbcContext *, const char *, const char *, struct wbcDomainSid *, enum wbcSidType *)
|
||||
wbcCtxLookupRids: wbcErr (struct wbcContext *, struct wbcDomainSid *, int, uint32_t *, const char **, const char ***, enum wbcSidType **)
|
||||
wbcCtxLookupSid: wbcErr (struct wbcContext *, const struct wbcDomainSid *, char **, char **, enum wbcSidType *)
|
||||
wbcCtxLookupSids: wbcErr (struct wbcContext *, const struct wbcDomainSid *, int, struct wbcDomainInfo **, int *, struct wbcTranslatedName **)
|
||||
wbcCtxLookupUserSids: wbcErr (struct wbcContext *, const struct wbcDomainSid *, bool, uint32_t *, struct wbcDomainSid **)
|
||||
wbcCtxPing: wbcErr (struct wbcContext *)
|
||||
wbcCtxPingDc: wbcErr (struct wbcContext *, const char *, struct wbcAuthErrorInfo **)
|
||||
wbcCtxPingDc2: wbcErr (struct wbcContext *, const char *, struct wbcAuthErrorInfo **, char **)
|
||||
wbcCtxResolveWinsByIP: wbcErr (struct wbcContext *, const char *, char **)
|
||||
wbcCtxResolveWinsByName: wbcErr (struct wbcContext *, const char *, char **)
|
||||
wbcCtxSetgrent: wbcErr (struct wbcContext *)
|
||||
wbcCtxSetpwent: wbcErr (struct wbcContext *)
|
||||
wbcCtxSidToGid: wbcErr (struct wbcContext *, const struct wbcDomainSid *, gid_t *)
|
||||
wbcCtxSidToUid: wbcErr (struct wbcContext *, const struct wbcDomainSid *, uid_t *)
|
||||
wbcCtxSidsToUnixIds: wbcErr (struct wbcContext *, const struct wbcDomainSid *, uint32_t, struct wbcUnixId *)
|
||||
wbcCtxUidToSid: wbcErr (struct wbcContext *, uid_t, struct wbcDomainSid *)
|
||||
wbcCtxUnixIdsToSids: wbcErr (struct wbcContext *, const struct wbcUnixId *, uint32_t, struct wbcDomainSid *)
|
||||
wbcDcInfo: wbcErr (const char *, size_t *, const char ***, const char ***)
|
||||
wbcDomainInfo: wbcErr (const char *, struct wbcDomainInfo **)
|
||||
wbcEndgrent: wbcErr (void)
|
||||
wbcEndpwent: wbcErr (void)
|
||||
wbcErrorString: const char *(wbcErr)
|
||||
wbcFreeMemory: void (void *)
|
||||
wbcGetDisplayName: wbcErr (const struct wbcDomainSid *, char **, char **, enum wbcSidType *)
|
||||
wbcGetGlobalCtx: struct wbcContext *(void)
|
||||
wbcGetGroups: wbcErr (const char *, uint32_t *, gid_t **)
|
||||
wbcGetSidAliases: wbcErr (const struct wbcDomainSid *, struct wbcDomainSid *, uint32_t, uint32_t **, uint32_t *)
|
||||
wbcGetgrent: wbcErr (struct group **)
|
||||
wbcGetgrgid: wbcErr (gid_t, struct group **)
|
||||
wbcGetgrlist: wbcErr (struct group **)
|
||||
wbcGetgrnam: wbcErr (const char *, struct group **)
|
||||
wbcGetpwent: wbcErr (struct passwd **)
|
||||
wbcGetpwnam: wbcErr (const char *, struct passwd **)
|
||||
wbcGetpwsid: wbcErr (struct wbcDomainSid *, struct passwd **)
|
||||
wbcGetpwuid: wbcErr (uid_t, struct passwd **)
|
||||
wbcGidToSid: wbcErr (gid_t, struct wbcDomainSid *)
|
||||
wbcGuidToString: wbcErr (const struct wbcGuid *, char **)
|
||||
wbcInterfaceDetails: wbcErr (struct wbcInterfaceDetails **)
|
||||
wbcLibraryDetails: wbcErr (struct wbcLibraryDetails **)
|
||||
wbcListGroups: wbcErr (const char *, uint32_t *, const char ***)
|
||||
wbcListTrusts: wbcErr (struct wbcDomainInfo **, size_t *)
|
||||
wbcListUsers: wbcErr (const char *, uint32_t *, const char ***)
|
||||
wbcLogoffUser: wbcErr (const char *, uid_t, const char *)
|
||||
wbcLogoffUserEx: wbcErr (const struct wbcLogoffUserParams *, struct wbcAuthErrorInfo **)
|
||||
wbcLogonUser: wbcErr (const struct wbcLogonUserParams *, struct wbcLogonUserInfo **, struct wbcAuthErrorInfo **, struct wbcUserPasswordPolicyInfo **)
|
||||
wbcLookupDomainController: wbcErr (const char *, uint32_t, struct wbcDomainControllerInfo **)
|
||||
wbcLookupDomainControllerEx: wbcErr (const char *, struct wbcGuid *, const char *, uint32_t, struct wbcDomainControllerInfoEx **)
|
||||
wbcLookupName: wbcErr (const char *, const char *, struct wbcDomainSid *, enum wbcSidType *)
|
||||
wbcLookupRids: wbcErr (struct wbcDomainSid *, int, uint32_t *, const char **, const char ***, enum wbcSidType **)
|
||||
wbcLookupSid: wbcErr (const struct wbcDomainSid *, char **, char **, enum wbcSidType *)
|
||||
wbcLookupSids: wbcErr (const struct wbcDomainSid *, int, struct wbcDomainInfo **, int *, struct wbcTranslatedName **)
|
||||
wbcLookupUserSids: wbcErr (const struct wbcDomainSid *, bool, uint32_t *, struct wbcDomainSid **)
|
||||
wbcPing: wbcErr (void)
|
||||
wbcPingDc: wbcErr (const char *, struct wbcAuthErrorInfo **)
|
||||
wbcPingDc2: wbcErr (const char *, struct wbcAuthErrorInfo **, char **)
|
||||
wbcQueryGidToSid: wbcErr (gid_t, struct wbcDomainSid *)
|
||||
wbcQuerySidToGid: wbcErr (const struct wbcDomainSid *, gid_t *)
|
||||
wbcQuerySidToUid: wbcErr (const struct wbcDomainSid *, uid_t *)
|
||||
wbcQueryUidToSid: wbcErr (uid_t, struct wbcDomainSid *)
|
||||
wbcRemoveGidMapping: wbcErr (gid_t, const struct wbcDomainSid *)
|
||||
wbcRemoveUidMapping: wbcErr (uid_t, const struct wbcDomainSid *)
|
||||
wbcRequestResponse: wbcErr (struct wbcContext *, int, struct winbindd_request *, struct winbindd_response *)
|
||||
wbcRequestResponsePriv: wbcErr (struct wbcContext *, int, struct winbindd_request *, struct winbindd_response *)
|
||||
wbcResolveWinsByIP: wbcErr (const char *, char **)
|
||||
wbcResolveWinsByName: wbcErr (const char *, char **)
|
||||
wbcSetClientProcessName: void (const char *)
|
||||
wbcSetGidHwm: wbcErr (gid_t)
|
||||
wbcSetGidMapping: wbcErr (gid_t, const struct wbcDomainSid *)
|
||||
wbcSetUidHwm: wbcErr (uid_t)
|
||||
wbcSetUidMapping: wbcErr (uid_t, const struct wbcDomainSid *)
|
||||
wbcSetgrent: wbcErr (void)
|
||||
wbcSetpwent: wbcErr (void)
|
||||
wbcSidToGid: wbcErr (const struct wbcDomainSid *, gid_t *)
|
||||
wbcSidToString: wbcErr (const struct wbcDomainSid *, char **)
|
||||
wbcSidToStringBuf: int (const struct wbcDomainSid *, char *, int)
|
||||
wbcSidToUid: wbcErr (const struct wbcDomainSid *, uid_t *)
|
||||
wbcSidTypeString: const char *(enum wbcSidType)
|
||||
wbcSidsToUnixIds: wbcErr (const struct wbcDomainSid *, uint32_t, struct wbcUnixId *)
|
||||
wbcStrDup: char *(const char *)
|
||||
wbcStringToGuid: wbcErr (const char *, struct wbcGuid *)
|
||||
wbcStringToSid: wbcErr (const char *, struct wbcDomainSid *)
|
||||
wbcUidToSid: wbcErr (uid_t, struct wbcDomainSid *)
|
||||
wbcUnixIdsToSids: wbcErr (const struct wbcUnixId *, uint32_t, struct wbcDomainSid *)
|
@ -894,3 +894,8 @@ done:
|
||||
wbcFreeMemory(blobs);
|
||||
return wbc_status;
|
||||
}
|
||||
|
||||
void wbcSetClientProcessName(const char *name)
|
||||
{
|
||||
winbind_set_client_name(name);
|
||||
}
|
||||
|
@ -76,9 +76,10 @@ const char *wbcErrorString(wbcErr error);
|
||||
* 0.13: Added wbcCtxUnixIdsToSids and wbcUnixIdsToSids
|
||||
* 0.14: Added "authoritative" to wbcAuthErrorInfo
|
||||
* Added WBC_SID_NAME_LABEL
|
||||
* 0.15: Added wbcSetClientProcessName()
|
||||
**/
|
||||
#define WBCLIENT_MAJOR_VERSION 0
|
||||
#define WBCLIENT_MINOR_VERSION 14
|
||||
#define WBCLIENT_MINOR_VERSION 15
|
||||
#define WBCLIENT_VENDOR_VERSION "Samba libwbclient"
|
||||
struct wbcLibraryDetails {
|
||||
uint16_t major_version;
|
||||
@ -2051,4 +2052,17 @@ wbcErr wbcAddNamedBlob(size_t *num_blobs,
|
||||
uint8_t *data,
|
||||
size_t length);
|
||||
|
||||
/**
|
||||
* @brief Set the name of the process which call wbclient.
|
||||
*
|
||||
* By default wbclient will figure out the process name. This should just be
|
||||
* used in special cases like pam modules or similar. Only alpha numeric
|
||||
* chars in ASCII are allowed.
|
||||
*
|
||||
* This function should only be called once!
|
||||
*
|
||||
* @param[in] name The process name to set.
|
||||
*/
|
||||
void wbcSetClientProcessName(const char *name);
|
||||
|
||||
#endif /* _WBCLIENT_H */
|
||||
|
@ -3,7 +3,7 @@
|
||||
from waflib import Options, Logs
|
||||
|
||||
# Remember to also update wbclient.h
|
||||
VERSION="0.14"
|
||||
VERSION="0.15"
|
||||
|
||||
# It may be useful at some point to allow Samba to build against a
|
||||
# system libwbclient, such as the one provided by Likewise. To to
|
||||
|
@ -77,6 +77,15 @@ void winbindd_free_response(struct winbindd_response *response)
|
||||
SAFE_FREE(response->extra_data.data);
|
||||
}
|
||||
|
||||
void winbind_set_client_name(const char *name)
|
||||
{
|
||||
if (name == NULL || strlen(name) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
(void)snprintf(client_name, sizeof(client_name), "%s", name);
|
||||
}
|
||||
|
||||
static const char *winbind_get_client_name(void)
|
||||
{
|
||||
if (client_name[0] == '\0') {
|
||||
|
@ -44,6 +44,8 @@ NSS_STATUS winbindd_priv_request_response(struct winbindd_context *ctx,
|
||||
struct winbindd_request *request,
|
||||
struct winbindd_response *response);
|
||||
|
||||
void winbind_set_client_name(const char *name);
|
||||
|
||||
#define winbind_env_set() \
|
||||
(strcmp(getenv(WINBINDD_DONT_ENV)?getenv(WINBINDD_DONT_ENV):"0","1") == 0)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user