[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Tue Jan 12 22:20:04 MST 2010


The branch, master has been updated
       via  ed457e0... Fix two uses of strncat -> strlcat. Ensure proper use of strncpy when setting socket name.
      from  33ee8b5... Make file access control decisions a lot easier to debug (at level 10).

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


- Log -----------------------------------------------------------------
commit ed457e07b9bdc0acda9dc52307d8bc2118f32f06
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Jan 12 21:18:36 2010 -0800

    Fix two uses of strncat -> strlcat. Ensure proper use of strncpy when setting socket name.
    
    Jeremy.

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

Summary of changes:
 source3/modules/vfs_scannedonly.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_scannedonly.c b/source3/modules/vfs_scannedonly.c
index 6995898..ff16d78 100644
--- a/source3/modules/vfs_scannedonly.c
+++ b/source3/modules/vfs_scannedonly.c
@@ -200,7 +200,7 @@ static int connect_to_scanner(vfs_handle_struct * handle)
 		}
 		saun.sun_family = AF_UNIX;
 		strncpy(saun.sun_path, so->socketname,
-			strlen(so->socketname) + 1);
+			sizeof(saun.sun_path) - 1);
 		if (connect(so->socket, (struct sockaddr *)(void *)&saun,
 			    SUN_LEN(&saun)) < 0) {
 			DEBUG(2, ("failed to connect to socket %s\n",
@@ -323,8 +323,8 @@ static void notify_scanner(vfs_handle_struct * handle, const char *scanfile)
 	if (gsendlen + tmplen >= SENDBUFFERSIZE) {
 		flush_sendbuffer(handle);
 	}
-	strncat(so->gsendbuffer, tmp, tmplen);
-	strncat(so->gsendbuffer, "\n", 1);
+	strlcat(so->gsendbuffer, tmp, SENDBUFFERSIZE + 1);
+	strlcat(so->gsendbuffer, "\n", SENDBUFFERSIZE + 1);
 }
 
 static bool is_scannedonly_file(struct Tscannedonly *so, const char *shortname)


-- 
Samba Shared Repository


More information about the samba-cvs mailing list