[PATCH] small cleanups

Volker Lendecke Volker.Lendecke at SerNet.DE
Fri Sep 15 23:46:22 UTC 2017


Hi!

Review appreciated!

Thanks, Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From b7c72f652bc2fe7c5beeadf078c5187d88cf4492 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Wed, 6 Sep 2017 18:20:25 +0200
Subject: [PATCH 1/3] notifyd: Clarify a comment

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/smbd/notifyd/notifyd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source3/smbd/notifyd/notifyd.c b/source3/smbd/notifyd/notifyd.c
index 11059eca711..f645781afea 100644
--- a/source3/smbd/notifyd/notifyd.c
+++ b/source3/smbd/notifyd/notifyd.c
@@ -57,7 +57,7 @@ struct notifyd_state {
 	/*
 	 * Database of everything clients show interest in. Indexed by
 	 * absolute path. The database keys are not 0-terminated
-	 * because the criticial operation, notifyd_trigger, can walk
+	 * to allow the criticial operation, notifyd_trigger, to walk
 	 * the structure from the top without adding intermediate 0s.
 	 * The database records contain an array of
 	 *
-- 
2.11.0


From 7918618ded885a23f9789e8e9d67d897c21ef383 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Thu, 7 Sep 2017 12:34:03 +0200
Subject: [PATCH 2/3] libcli: Apply some const

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 libcli/auth/credentials.c | 5 +++--
 libcli/auth/proto.h       | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/libcli/auth/credentials.c b/libcli/auth/credentials.c
index ddff5e9d924..acf88c923aa 100644
--- a/libcli/auth/credentials.c
+++ b/libcli/auth/credentials.c
@@ -811,8 +811,9 @@ union netr_LogonLevel *netlogon_creds_shallow_copy_logon(TALLOC_CTX *mem_ctx,
   copy a netlogon_creds_CredentialState struct
 */
 
-struct netlogon_creds_CredentialState *netlogon_creds_copy(TALLOC_CTX *mem_ctx,
-							   struct netlogon_creds_CredentialState *creds_in)
+struct netlogon_creds_CredentialState *netlogon_creds_copy(
+	TALLOC_CTX *mem_ctx,
+	const struct netlogon_creds_CredentialState *creds_in)
 {
 	struct netlogon_creds_CredentialState *creds = talloc_zero(mem_ctx, struct netlogon_creds_CredentialState);
 
diff --git a/libcli/auth/proto.h b/libcli/auth/proto.h
index a03f45ed7f3..82febe74440 100644
--- a/libcli/auth/proto.h
+++ b/libcli/auth/proto.h
@@ -38,8 +38,9 @@ void netlogon_creds_client_authenticator(struct netlogon_creds_CredentialState *
 				struct netr_Authenticator *next);
 bool netlogon_creds_client_check(struct netlogon_creds_CredentialState *creds,
 			const struct netr_Credential *received_credentials);
-struct netlogon_creds_CredentialState *netlogon_creds_copy(TALLOC_CTX *mem_ctx,
-							   struct netlogon_creds_CredentialState *creds_in);
+struct netlogon_creds_CredentialState *netlogon_creds_copy(
+	TALLOC_CTX *mem_ctx,
+	const struct netlogon_creds_CredentialState *creds_in);
 
 /*****************************************************************
 The above functions are common to the client and server interface
-- 
2.11.0


From 6eb0702dd86c3bb8f764bb3fdc1e5f78da81a727 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Thu, 7 Sep 2017 12:34:34 +0200
Subject: [PATCH 3/3] cli_credentials: Apply some const

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 auth/credentials/credentials.c | 5 +++--
 auth/credentials/credentials.h | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/auth/credentials/credentials.c b/auth/credentials/credentials.c
index 1a4ec535b44..105c73c141b 100644
--- a/auth/credentials/credentials.c
+++ b/auth/credentials/credentials.c
@@ -959,8 +959,9 @@ _PUBLIC_ void cli_credentials_guess(struct cli_credentials *cred,
  * Attach NETLOGON credentials for use with SCHANNEL
  */
 
-_PUBLIC_ void cli_credentials_set_netlogon_creds(struct cli_credentials *cred, 
-						 struct netlogon_creds_CredentialState *netlogon_creds)
+_PUBLIC_ void cli_credentials_set_netlogon_creds(
+	struct cli_credentials *cred,
+	const struct netlogon_creds_CredentialState *netlogon_creds)
 {
 	TALLOC_FREE(cred->netlogon_creds);
 	if (netlogon_creds == NULL) {
diff --git a/auth/credentials/credentials.h b/auth/credentials/credentials.h
index e75694a4b16..9fe6a82b1ea 100644
--- a/auth/credentials/credentials.h
+++ b/auth/credentials/credentials.h
@@ -158,8 +158,9 @@ void cli_credentials_set_secure_channel_type(struct cli_credentials *cred,
 				     enum netr_SchannelType secure_channel_type);
 void cli_credentials_set_password_last_changed_time(struct cli_credentials *cred,
 							     time_t last_change_time);
-void cli_credentials_set_netlogon_creds(struct cli_credentials *cred, 
-					struct netlogon_creds_CredentialState *netlogon_creds);
+void cli_credentials_set_netlogon_creds(
+	struct cli_credentials *cred,
+	const struct netlogon_creds_CredentialState *netlogon_creds);
 NTSTATUS cli_credentials_set_krb5_context(struct cli_credentials *cred, 
 					  struct smb_krb5_context *smb_krb5_context);
 NTSTATUS cli_credentials_set_stored_principal(struct cli_credentials *cred,
-- 
2.11.0



More information about the samba-technical mailing list