From fd3714d0cf068f3c782c1fff32105fc51cc97a0e Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Fri, 6 Jan 2012 16:47:50 -0500 Subject: NSS: Add sss_readrep_copy_string There were many places in the client code where we were duplicating a loop to copy data in from the response buffer. This patch turns those loops into a function for easier maintenance and easier-to-read *readrep() routines. --- src/sss_client/sss_cli.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/sss_client/sss_cli.h') diff --git a/src/sss_client/sss_cli.h b/src/sss_client/sss_cli.h index dc15ac13b..c6e53e60a 100644 --- a/src/sss_client/sss_cli.h +++ b/src/sss_client/sss_cli.h @@ -36,6 +36,11 @@ typedef int errno_t; #endif + +#ifndef EOK +#define EOK 0 +#endif + #define SSS_NSS_PROTOCOL_VERSION 1 #define SSS_PAM_PROTOCOL_VERSION 3 #define SSS_SUDO_PROTOCOL_VERSION 0 @@ -508,4 +513,11 @@ void sss_nss_unlock(void); void sss_pam_lock(void); void sss_pam_unlock(void); +errno_t sss_readrep_copy_string(const char *in, + size_t *offset, + size_t *slen, + size_t *dlen, + char **out, + size_t *size); + #endif /* _SSSCLI_H */ -- cgit