summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2007-02-05 14:46:36 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:17:42 -0500
commitc622130a7dd52c6d22e546c955fda5ec9cedd363 (patch)
tree42d22d18acd300e8845f53eb6e89e65a26a9bffb /source3/nsswitch
parent0b2bbb2704aa10a52b6fb111bd3549b1a36ad680 (diff)
downloadsamba-c622130a7dd52c6d22e546c955fda5ec9cedd363.tar.gz
samba-c622130a7dd52c6d22e546c955fda5ec9cedd363.tar.bz2
samba-c622130a7dd52c6d22e546c955fda5ec9cedd363.zip
r21145: Convert some int to BOOL in pam_winbind (only in 3_0).
Guenther (This used to be commit 1b82c5fa0e363942947453a8e1b74aa2b95d8733)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/pam_winbind.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/source3/nsswitch/pam_winbind.c b/source3/nsswitch/pam_winbind.c
index a8344db338..6929c3f3db 100644
--- a/source3/nsswitch/pam_winbind.c
+++ b/source3/nsswitch/pam_winbind.c
@@ -601,7 +601,7 @@ static void _pam_warn_password_expires_in_future(pam_handle_t *pamh, struct winb
#define IS_SID_STRING(name) (strncmp("S-", name, 2) == 0)
-int safe_append_string(char *dest,
+static BOOL safe_append_string(char *dest,
const char *src,
int dest_buffer_size)
/**
@@ -612,21 +612,21 @@ int safe_append_string(char *dest,
* @param src Source string buffer.
* @param dest_buffer_size Size of dest buffer in bytes.
*
- * @return 0 if dest buffer is not big enough (no bytes copied), non-zero on success.
+ * @return False if dest buffer is not big enough (no bytes copied), True on success.
*/
{
int dest_length = strlen(dest);
int src_length = strlen(src);
if ( dest_length + src_length + 1 > dest_buffer_size ) {
- return 0;
+ return False;
}
memcpy(dest + dest_length, src, src_length + 1);
- return 1;
+ return True;
}
-static int winbind_name_to_sid_string(pam_handle_t *pamh,
+static BOOL winbind_name_to_sid_string(pam_handle_t *pamh,
int ctrl,
const char *user,
const char *name,
@@ -642,7 +642,7 @@ static int winbind_name_to_sid_string(pam_handle_t *pamh,
* @param sid_list_buffer Where to append the string sid.
* @param sid_list_buffer Size of sid_list_buffer (in bytes).
*
- * @return 0 on failure, non-zero on success.
+ * @return False on failure, True on success.
*/
{
const char* sid_string;
@@ -665,20 +665,20 @@ static int winbind_name_to_sid_string(pam_handle_t *pamh,
if (pam_winbind_request_log(pamh, ctrl, WINBINDD_LOOKUPNAME, &sid_request, &sid_response, user)) {
_pam_log(pamh, ctrl, LOG_INFO, "could not lookup name: %s\n", name);
- return 0;
+ return False;
}
sid_string = sid_response.data.sid.sid;
}
if (!safe_append_string(sid_list_buffer, sid_string, sid_list_buffer_size)) {
- return 0;
+ return False;
}
- return 1;
+ return True;
}
-static int winbind_name_list_to_sid_string_list(pam_handle_t *pamh,
+static BOOL winbind_name_list_to_sid_string_list(pam_handle_t *pamh,
int ctrl,
const char *user,
const char *name_list,
@@ -694,10 +694,10 @@ static int winbind_name_list_to_sid_string_list(pam_handle_t *pamh,
* @param sid_list_buffer Where to put the list of string sids.
* @param sid_list_buffer Size of sid_list_buffer (in bytes).
*
- * @return 0 on failure, non-zero on success.
+ * @return False on failure, True on success.
*/
{
- int result = 0;
+ BOOL result = False;
char *current_name = NULL;
const char *search_location;
const char *comma;
@@ -730,7 +730,7 @@ static int winbind_name_list_to_sid_string_list(pam_handle_t *pamh,
goto out;
}
- result = 1;
+ result = True;
out:
SAFE_FREE(current_name);