[SCM] Samba Shared Repository - branch v3-2-stable updated - release-3-2-0pre3-4-gffe50b9

Karolin Seeger kseeger at samba.org
Mon Apr 28 08:36:42 GMT 2008


The branch, v3-2-stable has been updated
       via  ffe50b90b04b204e985ee62a0795c9bffd446a54 (commit)
      from  ec6306db8f82f237ab3ebb9f1a4098dbc1cb05de (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-stable


- Log -----------------------------------------------------------------
commit ffe50b90b04b204e985ee62a0795c9bffd446a54
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Apr 25 17:04:44 2008 +0200

    Revert "mount.cifs: Zero mountpassword content before freeing."
    
    This reverts commit d99a31848bd2172c15500dd61ce30fef963c1ac6.
    (cherry picked from commit 46614ca3eca67aee4c1ab699e85493f9832e4b37)

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

Summary of changes:
 source/client/mount.cifs.c |   27 +++------------------------
 1 files changed, 3 insertions(+), 24 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/client/mount.cifs.c b/source/client/mount.cifs.c
index 7432dac..1b67a5e 100644
--- a/source/client/mount.cifs.c
+++ b/source/client/mount.cifs.c
@@ -160,9 +160,6 @@ static void mount_cifs_usage(void)
 	printf("\nTo display the version number of the mount helper:");
 	printf("\n\t%s -V\n",thisprogram);
 
-	if(mountpassword) {
-		memset(mountpassword,0,MOUNT_PASSWD_SIZE);
-	}
 	SAFE_FREE(mountpassword);
 	exit(1);
 }
@@ -222,9 +219,6 @@ static int open_cred_file(char * file_name)
 				if(length > 4086) {
 					printf("mount.cifs failed due to malformed username in credentials file");
 					memset(line_buf,0,4096);
-					if(mountpassword) {
-						memset(mountpassword,0,MOUNT_PASSWD_SIZE);
-					}
 					exit(1);
 				} else {
 					got_user = 1;
@@ -291,9 +285,6 @@ static int open_cred_file(char * file_name)
 
 	}
 	fclose(fs);
-	if(line_buf) {
-		memset(line_buf,0,4096);
-	}
 	SAFE_FREE(line_buf);
 	return 0;
 }
@@ -328,7 +319,6 @@ static int get_password_from_file(int file_descript, char * filename)
 		rc = read(file_descript,&c,1);
 		if(rc < 0) {
 			printf("mount.cifs failed. Error %s reading password file\n",strerror(errno));
-			memset(mountpassword,0,MOUNT_PASSWD_SIZE);
 			if(filename != NULL)
 				close(file_descript);
 			exit(1);
@@ -1119,9 +1109,6 @@ int main(int argc, char ** argv)
 			MOUNT_CIFS_VERSION_MAJOR,
 			MOUNT_CIFS_VERSION_MINOR,
 			MOUNT_CIFS_VENDOR_SUFFIX);
-			if(mountpassword) {
-				memset(mountpassword,0,MOUNT_PASSWD_SIZE);
-			}
 			exit (0);
 		case 'w':
 			flags &= ~MS_RDONLY;
@@ -1207,7 +1194,7 @@ int main(int argc, char ** argv)
 
 	if (getenv("PASSWD")) {
 		if(mountpassword == NULL)
-			mountpassword = (char *)calloc(MOUNT_PASSWD_SIZE+1,1);
+			mountpassword = (char *)calloc(65,1);
 		if(mountpassword) {
 			strlcpy(mountpassword,getenv("PASSWD"),MOUNT_PASSWD_SIZE);
 			got_password = 1;
@@ -1442,16 +1429,8 @@ mount_exit:
 		SAFE_FREE(mountpassword);
 	}
 
-	if(options) {
-		memset(options,0,optlen);
-		SAFE_FREE(options);
-	}
-
-	if(orgoptions) {
-		memset(orgoptions,0,orgoptlen);
-		SAFE_FREE(orgoptions);
-	}
-
+	SAFE_FREE(options);
+	SAFE_FREE(orgoptions);
 	SAFE_FREE(resolved_path);
 	SAFE_FREE(share_name);
 	return rc;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list