[PATCH] some O3 developer build fixes

Volker Lendecke Volker.Lendecke at SerNet.DE
Wed May 6 07:45:10 MDT 2015


Hi!

This contains the controversial heimdal fix along with a
heimdal O3 developer build fix on Solaris. I've pushed the
rest from that former patchset with Ira's R-B.

If we decide to not touch heimdal at all anymore, we need to
excempt it from all build errors that come from warnings.

waf gurus: Where would I apply such an excemption?

Review&push 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 b3aeffd204ae92e06288cd6fca10fe28d82bc922 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Sun, 3 May 2015 09:29:51 +0000
Subject: [PATCH 1/4] heimdal: Fix CID 240793 Uninitialized scalar variable

tmp.data is uninitialized in the fwrite call

Hopefully I don't create a problem here: If tmp.data is supposed to be randomly
set, I think the right fix would have been to explicitly call a random function
initializing it.

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source4/heimdal/lib/krb5/replay.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/source4/heimdal/lib/krb5/replay.c b/source4/heimdal/lib/krb5/replay.c
index 965dd44..d85424d 100644
--- a/source4/heimdal/lib/krb5/replay.c
+++ b/source4/heimdal/lib/krb5/replay.c
@@ -129,7 +129,7 @@ krb5_rc_initialize(krb5_context context,
 		   krb5_deltat auth_lifespan)
 {
     FILE *f = fopen(id->name, "w");
-    struct rc_entry tmp;
+    struct rc_entry tmp = { .stamp = auth_lifespan };
     int ret;
 
     if(f == NULL) {
@@ -139,7 +139,6 @@ krb5_rc_initialize(krb5_context context,
 	krb5_set_error_message(context, ret, "open(%s): %s", id->name, buf);
 	return ret;
     }
-    tmp.stamp = auth_lifespan;
     fwrite(&tmp, 1, sizeof(tmp), f);
     fclose(f);
     return 0;
-- 
1.9.1


From 6a98e8f209d2bc5fcf799f7a3ec7339ac9676d7d Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Wed, 6 May 2015 16:19:12 +0200
Subject: [PATCH 2/4] heimdal: Fix the O3 developer build

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source4/heimdal/lib/krb5/fcache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source4/heimdal/lib/krb5/fcache.c b/source4/heimdal/lib/krb5/fcache.c
index a9e8327..cb720c0 100644
--- a/source4/heimdal/lib/krb5/fcache.c
+++ b/source4/heimdal/lib/krb5/fcache.c
@@ -1051,7 +1051,7 @@ fcc_lastchange(krb5_context context, krb5_ccache id, krb5_timestamp *mtime)
 {
     krb5_error_code ret;
     struct stat sb;
-    int fd;
+    int fd = 0;
 
     ret = fcc_open(context, id, &fd, O_RDONLY | O_BINARY | O_CLOEXEC, 0);
     if(ret)
-- 
1.9.1


From f174908c05248eb0c2e1f27f953f70e18118e2bf Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Wed, 6 May 2015 16:25:51 +0200
Subject: [PATCH 3/4] Fix a few printf format errors

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 lib/util/util_runcmd.c          | 2 +-
 source3/modules/vfs_aio_fork.c  | 4 ++--
 source3/modules/vfs_fruit.c     | 5 +++--
 source3/rpc_server/fssd.c       | 3 ++-
 source4/smbd/process_standard.c | 9 +++++----
 5 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/lib/util/util_runcmd.c b/lib/util/util_runcmd.c
index 46c455d..f18e37b 100644
--- a/lib/util/util_runcmd.c
+++ b/lib/util/util_runcmd.c
@@ -291,7 +291,7 @@ static void samba_runcmd_io_handler(struct tevent_context *ev,
 					DEBUG(0, ("Error in waitpid() unexpectedly got ECHILD "
 						  "for %s child %d - %s, "
 						  "someone has set SIGCHLD to SIG_IGN!\n",
-					  state->arg0, state->pid, strerror(errno)));
+					state->arg0, (int)state->pid, strerror(errno)));
 					tevent_req_error(req, errno);
 					return;
 				}
diff --git a/source3/modules/vfs_aio_fork.c b/source3/modules/vfs_aio_fork.c
index dea8107..b15cf9d 100644
--- a/source3/modules/vfs_aio_fork.c
+++ b/source3/modules/vfs_aio_fork.c
@@ -398,7 +398,7 @@ static int aio_child_destructor(struct aio_child *child)
 	SMB_ASSERT(!child->busy);
 
 	DEBUG(10, ("aio_child_destructor: removing child %d on fd %d\n",
-			child->pid, child->sockfd));
+		   (int)child->pid, child->sockfd));
 
 	/*
 	 * closing the sockfd makes the child not return from recvmsg() on RHEL
@@ -471,7 +471,7 @@ static int create_aio_child(struct smbd_server_connection *sconn,
 	}
 
 	DEBUG(10, ("Child %d created with sockfd %d\n",
-			result->pid, fdpair[0]));
+		   (int)result->pid, fdpair[0]));
 
 	result->sockfd = fdpair[0];
 	close(fdpair[1]);
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index dffb260..8a5588d 100644
--- a/source3/modules/vfs_fruit.c
+++ b/source3/modules/vfs_fruit.c
@@ -1982,7 +1982,7 @@ static NTSTATUS check_ms_nfs(vfs_handle_struct *handle,
 			*pdo_chmod = true;
 
 			DEBUG(10, ("MS NFS chmod request %s, %04o\n",
-				   fsp_str_dbg(fsp), *pmode));
+				   fsp_str_dbg(fsp), (unsigned)(*pmode)));
 			break;
 		}
 	}
@@ -3439,7 +3439,8 @@ static NTSTATUS fruit_fset_nt_acl(vfs_handle_struct *handle,
 
 		if (result != 0) {
 			DEBUG(1, ("chmod: %s, result: %d, %04o error %s\n", fsp_str_dbg(fsp),
-				  result, ms_nfs_mode, strerror(errno)));
+				  result, (unsigned)ms_nfs_mode,
+				  strerror(errno)));
 			status = map_nt_error_from_unix(errno);
 			return status;
 		}
diff --git a/source3/rpc_server/fssd.c b/source3/rpc_server/fssd.c
index fc1f630..0f8b02e 100644
--- a/source3/rpc_server/fssd.c
+++ b/source3/rpc_server/fssd.c
@@ -209,7 +209,8 @@ void start_fssd(struct tevent_context *ev_ctx,
 		exit(1);
 	}
 
-	DEBUG(1, ("File Server Shadow-copy Daemon Started (%d)\n", getpid()));
+	DEBUG(1, ("File Server Shadow-copy Daemon Started (%d)\n",
+		  (int)getpid()));
 
 	/* loop forever */
 	rc = tevent_loop_wait(ev_ctx);
diff --git a/source4/smbd/process_standard.c b/source4/smbd/process_standard.c
index e2b9f13..b55a1a7 100644
--- a/source4/smbd/process_standard.c
+++ b/source4/smbd/process_standard.c
@@ -104,12 +104,13 @@ static void standard_child_pipe_handler(struct tevent_context *ev,
 			DEBUG(0, ("Error in waitpid() unexpectedly got ECHILD "
 				  "for child %d (%s) - %s, someone has set SIGCHLD "
 				  "to SIG_IGN!\n",
-				  state->pid, state->name, strerror(errno)));
+				  (int)state->pid, state->name,
+				  strerror(errno)));
 			TALLOC_FREE(state);
 			return;
 		}
 		DEBUG(0, ("Error in waitpid() for child %d (%s) - %s \n",
-			  state->pid, state->name, strerror(errno)));
+			  (int)state->pid, state->name, strerror(errno)));
 		if (errno == 0) {
 			errno = ECHILD;
 		}
@@ -119,11 +120,11 @@ static void standard_child_pipe_handler(struct tevent_context *ev,
 	if (WIFEXITED(status)) {
 		status = WEXITSTATUS(status);
 		DEBUG(2, ("Child %d (%s) exited with status %d\n",
-			  state->pid, state->name, status));
+			  (int)state->pid, state->name, status));
 	} else if (WIFSIGNALED(status)) {
 		status = WTERMSIG(status);
 		DEBUG(0, ("Child %d (%s) terminated with signal %d\n",
-			  state->pid, state->name, status));
+			  (int)state->pid, state->name, status));
 	}
 	TALLOC_FREE(state);
 	return;
-- 
1.9.1


From 653b49b767d1e6ff0fe33124551e07295149952f Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Wed, 6 May 2015 16:29:04 +0200
Subject: [PATCH 4/4] vfs: Fix the O3 developer build

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

diff --git a/source3/modules/vfs_solarisacl.c b/source3/modules/vfs_solarisacl.c
index efd2d75..cf25abc 100644
--- a/source3/modules/vfs_solarisacl.c
+++ b/source3/modules/vfs_solarisacl.c
@@ -172,7 +172,7 @@ int solarisacl_sys_acl_set_file(vfs_handle_struct *handle,
 		goto done;
 	}
 	if (S_ISDIR(s.st_ex_mode)) {
-		SOLARIS_ACL_T other_acl; 
+		SOLARIS_ACL_T other_acl = NULL;
 		int other_count;
 		SMB_ACL_TYPE_T other_type;
 
-- 
1.9.1



More information about the samba-technical mailing list