[SCM] Samba Shared Repository - branch v3-0-test updated - release-3-0-32-148-ga894bd4

Jeff Layton jlayton at samba.org
Fri Feb 6 13:24:40 GMT 2009


The branch, v3-0-test has been updated
       via  a894bd4504f070233dd2785a62483090581f5bf3 (commit)
      from  45699a287d27cce24e883384a72441d310c8ee28 (commit)

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


- Log -----------------------------------------------------------------
commit a894bd4504f070233dd2785a62483090581f5bf3
Author: Shirish Pargaonkar <shirishpargaonkar at gmail.com>
Date:   Fri Feb 6 08:23:52 2009 -0500

    mount.cifs: add fakemount (-f) and nomtab (-n) flags to mount.cifs
    
    ...so that these options work correctly when passed in by mount(8).

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

Summary of changes:
 source/client/mount.cifs.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/client/mount.cifs.c b/source/client/mount.cifs.c
index 1ac1410..939db45 100644
--- a/source/client/mount.cifs.c
+++ b/source/client/mount.cifs.c
@@ -71,6 +71,7 @@
 
 const char *thisprogram;
 int verboseflag = 0;
+int fakemnt = 0;
 static int got_password = 0;
 static int got_user = 0;
 static int got_domain = 0;
@@ -1018,7 +1019,7 @@ int main(int argc, char ** argv)
 	char * resolved_path = NULL;
 	char * temp;
 	char * dev_name;
-	int rc;
+	int rc = 0;
 	int rsize = 0;
 	int wsize = 0;
 	int nomtab = 0;
@@ -1087,8 +1088,8 @@ int main(int argc, char ** argv)
 			mount_cifs_usage ();
 			exit(EX_USAGE);
 		case 'n':
-		    ++nomtab;
-		    break;
+			++nomtab;
+			break;
 		case 'b':
 #ifdef MS_BIND
 			flags |= MS_BIND;
@@ -1196,6 +1197,9 @@ int main(int argc, char ** argv)
 			break;
 		case 't':
 			break;
+		case 'f':
+			++fakemnt;
+			break;
 		default:
 			printf("unknown mount option %c\n",c);
 			mount_cifs_usage();
@@ -1376,8 +1380,7 @@ mount_retry:
 	/* convert all '\\' to '/' in share portion so that /proc/mounts looks pretty */
 	replace_char(dev_name, '\\', '/', strlen(share_name));
 
-	if(mount(dev_name, mountpoint, "cifs", flags, options)) {
-	/* remember to kill daemon on error */
+	if(!fakemnt && mount(dev_name, mountpoint, "cifs", flags, options)) {
 		switch (errno) {
 		case 0:
 			printf("mount failed but no error number set\n");
@@ -1401,6 +1404,8 @@ mount_retry:
 		printf("Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)\n");
 		rc = EX_FAIL;
 	} else {
+		if (nomtab)
+			goto mount_exit;
 		atexit(unlock_mtab);
 		rc = lock_mtab();
 		if (rc) {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list