1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-04 17:47:26 +03:00

mount.cifs: add fakemount (-f) and nomtab (-n) flags to mount.cifs

...so that these options work correctly when passed in by mount(8).
This commit is contained in:
Shirish Pargaonkar 2009-02-06 08:13:38 -05:00 committed by Jeff Layton
parent 2170a810ed
commit ea8bd81b6e

View File

@ -85,6 +85,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;
@ -1103,8 +1104,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;
@ -1209,6 +1210,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();
@ -1410,7 +1414,7 @@ mount_retry:
}
}
if (mount(dev_name, mountpoint, "cifs", flags, options)) {
if (!fakemnt && mount(dev_name, mountpoint, "cifs", flags, options)) {
switch (errno) {
case ECONNREFUSED:
case EHOSTUNREACH:
@ -1440,6 +1444,8 @@ mount_retry:
goto mount_exit;
}
if (nomtab)
goto mount_exit;
atexit(unlock_mtab);
rc = lock_mtab();
if (rc) {