summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2007-01-25 15:05:23 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:17:28 -0500
commitb979bf5686e35e5da299b8429686e90cca6fc852 (patch)
tree21f3cfbce0bfedc7998faaaf370becf7d1932ff2 /source3
parent74f38589b3f47715fd4bdc20ad97e425e091f9d9 (diff)
downloadsamba-b979bf5686e35e5da299b8429686e90cca6fc852.tar.gz
samba-b979bf5686e35e5da299b8429686e90cca6fc852.tar.bz2
samba-b979bf5686e35e5da299b8429686e90cca6fc852.zip
r21020: Some pam_winbind fixes:
* make debug_state also configurable from the config file * minor code cleanup Guenther (This used to be commit c562095953df55c91e3dad8f5c29c0b66664b62b)
Diffstat (limited to 'source3')
-rw-r--r--source3/nsswitch/pam_winbind.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/source3/nsswitch/pam_winbind.c b/source3/nsswitch/pam_winbind.c
index 8dc5f65f4b..e8c0988923 100644
--- a/source3/nsswitch/pam_winbind.c
+++ b/source3/nsswitch/pam_winbind.c
@@ -73,9 +73,9 @@ static void _pam_log_int(const pam_handle_t *pamh, int err, const char *format,
}
#endif /* HAVE_PAM_VSYSLOG */
-static int _pam_log_is_silent(int ctrl)
+static BOOL _pam_log_is_silent(int ctrl)
{
- return (ctrl & WINBIND_SILENT) ? 1 : 0;
+ return on(ctrl, WINBIND_SILENT);
}
static void _pam_log(const pam_handle_t *pamh, int ctrl, int err, const char *format, ...)
@@ -91,27 +91,27 @@ static void _pam_log(const pam_handle_t *pamh, int ctrl, int err, const char *fo
va_end(args);
}
-static int _pam_log_is_debug_enabled(int ctrl)
+static BOOL _pam_log_is_debug_enabled(int ctrl)
{
if (ctrl == -1) {
- return 0;
+ return False;
}
if (_pam_log_is_silent(ctrl)) {
- return 0;
+ return False;
}
if (!(ctrl & WINBIND_DEBUG_ARG)) {
- return 0;
+ return False;
}
- return 1;
+ return True;
}
-static int _pam_log_is_debug_state_enabled(int ctrl)
+static BOOL _pam_log_is_debug_state_enabled(int ctrl)
{
if (!(ctrl & WINBIND_DEBUG_STATE)) {
- return 0;
+ return False;
}
return _pam_log_is_debug_enabled(ctrl);
@@ -267,6 +267,8 @@ config_from_pam:
/* generic options */
if (!strcmp(*v,"debug"))
ctrl |= WINBIND_DEBUG_ARG;
+ else if (!strcasecmp(*v, "debug_state"))
+ ctrl |= WINBIND_DEBUG_STATE;
else if (!strcasecmp(*v, "use_authtok"))
ctrl |= WINBIND_USE_AUTHTOK_ARG;
else if (!strcasecmp(*v, "use_first_pass"))
@@ -702,8 +704,7 @@ static int winbind_name_list_to_sid_string_list(pam_handle_t *pamh,
goto out;
}
- free(current_name);
- current_name = NULL;
+ SAFE_FREE(current_name);
if (!safe_append_string(sid_list_buffer, ",", sid_list_buffer_size)) {
goto out;
@@ -719,9 +720,7 @@ static int winbind_name_list_to_sid_string_list(pam_handle_t *pamh,
result = 1;
out:
- if (current_name != NULL) {
- free(current_name);
- }
+ SAFE_FREE(current_name);
return result;
}