[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Wed Jun 10 20:35:06 MDT 2015


The branch, master has been updated
       via  b51ad15 smbd: Use new debug macros in kill-client-ip
       via  70b10f8 debug: Change syslog priority mapping to match new log level macros
       via  50dc465 debug: Add definitions and macros for log levels
       via  affa21f wbinfo: Dump user info for pam-logon -v
      from  a5fd4ca s3:wscript: remove signal related configure checks

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit b51ad15618f77b9552a2e23f7d28c4c39a65f6b1
Author: Christof Schmitt <cs at samba.org>
Date:   Tue Jun 9 13:10:27 2015 -0700

    smbd: Use new debug macros in kill-client-ip
    
    Mainly to have the new macros actually used in the code.
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu Jun 11 04:34:50 CEST 2015 on sn-devel-104

commit 70b10f8f202ed81bf0a0a90e71faa61b8ed2c2b5
Author: Christof Schmitt <cs at samba.org>
Date:   Fri Jun 5 15:09:34 2015 -0700

    debug: Change syslog priority mapping to match new log level macros
    
    This changes the mapping of internal log levels to syslog priorities to
    match the previously defined helper macros. The idea is that this better
    maps to the actual use of log levels in the Samba code.
    
    unchanged
     log level     | priority
     0             | ERROR
     1             | WARNING
     2             | NOTICE
    
    before
     log level     | priority
     3             | INFO
     4 and higher  | DEBUG
    
    after
     log level     | priority
     3 to 5        | NOTICE
     6 to 9        | INFO
     10 and higher | DEBUG
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 50dc46506544b8a4ab2e64732c1998541a69f473
Author: Christof Schmitt <cs at samba.org>
Date:   Fri Jun 5 14:45:22 2015 -0700

    debug: Add definitions and macros for log levels
    
    This provides some convenience macros to use consistent log levels for
    messages with different severities.
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit affa21f713df211a9aa2269d55432850a3a20edb
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Apr 8 11:17:51 2015 +0200

    wbinfo: Dump user info for pam-logon -v
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 lib/util/debug.c       | 13 +++++++++----
 lib/util/debug.h       | 15 +++++++++++++++
 nsswitch/wbinfo.c      | 45 ++++++++++++++++++++++++++++++++++++++++++---
 source3/smbd/process.c |  6 +++---
 4 files changed, 69 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/debug.c b/lib/util/debug.c
index 44338c5..dce3292 100644
--- a/lib/util/debug.c
+++ b/lib/util/debug.c
@@ -106,14 +106,19 @@ static struct {
 static int debug_level_to_priority(int level)
 {
 	/*
-	 * map debug levels to syslog() priorities note that not all
-	 * DEBUG(0, ...) calls are necessarily errors
+	 * map debug levels to syslog() priorities
 	 */
-	static const int priority_map[4] = {
+	static const int priority_map[] = {
 		LOG_ERR,     /* 0 */
 		LOG_WARNING, /* 1 */
 		LOG_NOTICE,  /* 2 */
-		LOG_INFO,    /* 3 */
+		LOG_NOTICE,  /* 3 */
+		LOG_NOTICE,  /* 4 */
+		LOG_NOTICE,  /* 5 */
+		LOG_INFO,    /* 6 */
+		LOG_INFO,    /* 7 */
+		LOG_INFO,    /* 8 */
+		LOG_INFO,    /* 9 */
 	};
 	int priority;
 
diff --git a/lib/util/debug.h b/lib/util/debug.h
index 379572f..8d8f43d 100644
--- a/lib/util/debug.h
+++ b/lib/util/debug.h
@@ -206,6 +206,21 @@ extern int  *DEBUGLEVEL_CLASS;
 #define DEBUGSEP(level)\
 	DEBUG((level),("===============================================================\n"))
 
+/*
+ * Debug levels matching RFC 3164
+ */
+#define DBGLVL_ERR	 0	/* error conditions */
+#define DBGLVL_WARNING	 1	/* warning conditions */
+#define DBGLVL_NOTICE	 3	/* normal, but significant, condition */
+#define DBGLVL_INFO	 5	/* informational message */
+#define DBGLVL_DEBUG	10	/* debug-level message */
+
+#define DBG_ERR(...)		DEBUG(DBGLVL_ERR,	(__VA_ARGS__))
+#define DBG_WARNING(...)	DEBUG(DBGLVL_WARNING,	(__VA_ARGS__))
+#define DBG_NOTICE(...)	DEBUG(DBGLVL_NOTICE,	(__VA_ARGS__))
+#define DBG_INFO(...)		DEBUG(DBGLVL_INFO,	(__VA_ARGS__))
+#define DBG_DEBUG(...)		DEBUG(DBGLVL_DEBUG,	(__VA_ARGS__))
+
 /* The following definitions come from lib/debug.c  */
 
 /** Possible destinations for the debug log (in order of precedence -
diff --git a/nsswitch/wbinfo.c b/nsswitch/wbinfo.c
index bde0d43..f45d7b5 100644
--- a/nsswitch/wbinfo.c
+++ b/nsswitch/wbinfo.c
@@ -1778,10 +1778,11 @@ static bool wbinfo_auth_crap(char *username, bool use_ntlmv2, bool use_lanman)
 
 /* Authenticate a user with a plaintext password */
 
-static bool wbinfo_pam_logon(char *username)
+static bool wbinfo_pam_logon(char *username, bool verbose)
 {
 	wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
 	struct wbcLogonUserParams params;
+	struct wbcLogonUserInfo *info = NULL;
 	struct wbcAuthErrorInfo *error = NULL;
 	char *s = NULL;
 	char *p = NULL;
@@ -1826,7 +1827,45 @@ static bool wbinfo_pam_logon(char *username)
 		return false;
 	}
 
-	wbc_status = wbcLogonUser(&params, NULL, &error, NULL);
+	wbc_status = wbcLogonUser(&params, &info, &error, NULL);
+
+	if (verbose && (info != NULL)) {
+		struct wbcAuthUserInfo *i = info->info;
+
+		if (i->account_name != NULL) {
+			d_printf("account_name: %s\n", i->account_name);
+		}
+		if (i->user_principal != NULL) {
+			d_printf("user_principal: %s\n", i->user_principal);
+		}
+		if (i->full_name != NULL) {
+			d_printf("full_name: %s\n", i->full_name);
+		}
+		if (i->domain_name != NULL) {
+			d_printf("domain_name: %s\n", i->domain_name);
+		}
+		if (i->dns_domain_name != NULL) {
+			d_printf("dns_domain_name: %s\n", i->dns_domain_name);
+		}
+		if (i->logon_server != NULL) {
+			d_printf("logon_server: %s\n", i->logon_server);
+		}
+		if (i->logon_script != NULL) {
+			d_printf("logon_script: %s\n", i->logon_script);
+		}
+		if (i->profile_path != NULL) {
+			d_printf("profile_path: %s\n", i->profile_path);
+		}
+		if (i->home_directory != NULL) {
+			d_printf("home_directory: %s\n", i->home_directory);
+		}
+		if (i->home_drive != NULL) {
+			d_printf("home_drive: %s\n", i->home_drive);
+		}
+
+		wbcFreeMemory(info);
+		info = NULL;
+	}
 
 	wbcFreeMemory(params.blobs);
 
@@ -2566,7 +2605,7 @@ int main(int argc, const char **argv, char **envp)
 				break;
 			}
 		case OPT_PAM_LOGON:
-			if (!wbinfo_pam_logon(string_arg)) {
+			if (!wbinfo_pam_logon(string_arg, verbose)) {
 				d_fprintf(stderr, "pam_logon failed for %s\n",
 					  string_arg);
 				goto done;
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 72135a2..958c82b 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -2711,7 +2711,7 @@ static void msg_kill_client_ip(struct messaging_context *msg_ctx,
 	const char *ip = (char *) data->data;
 	char *client_ip;
 
-	DEBUG(10, ("Got kill request for client IP %s\n", ip));
+	DBG_DEBUG("Got kill request for client IP %s\n", ip);
 
 	client_ip = tsocket_address_inet_addr_string(sconn->remote_address,
 						     talloc_tos());
@@ -2720,8 +2720,8 @@ static void msg_kill_client_ip(struct messaging_context *msg_ctx,
 	}
 
 	if (strequal(ip, client_ip)) {
-		DEBUG(1, ("Got kill client message for %s - "
-			  "exiting immediately\n", ip));
+		DBG_WARNING("Got kill client message for %s - "
+			    "exiting immediately\n", ip);
 		exit_server_cleanly("Forced disconnect for client");
 	}
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list