...so that these options work correctly when passed in by mount(8).
const char *thisprogram;
int verboseflag = 0;
const char *thisprogram;
int verboseflag = 0;
static int got_password = 0;
static int got_user = 0;
static int got_domain = 0;
static int got_password = 0;
static int got_user = 0;
static int got_domain = 0;
char * resolved_path = NULL;
char * temp;
char * dev_name;
char * resolved_path = NULL;
char * temp;
char * dev_name;
int rsize = 0;
int wsize = 0;
int nomtab = 0;
int rsize = 0;
int wsize = 0;
int nomtab = 0;
mount_cifs_usage ();
exit(EX_USAGE);
case 'n':
mount_cifs_usage ();
exit(EX_USAGE);
case 'n':
case 'b':
#ifdef MS_BIND
flags |= MS_BIND;
case 'b':
#ifdef MS_BIND
flags |= MS_BIND;
+ case 'f':
+ ++fakemnt;
+ break;
default:
printf("unknown mount option %c\n",c);
mount_cifs_usage();
default:
printf("unknown mount option %c\n",c);
mount_cifs_usage();
/* convert all '\\' to '/' in share portion so that /proc/mounts looks pretty */
replace_char(dev_name, '\\', '/', strlen(share_name));
/* 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");
switch (errno) {
case 0:
printf("mount failed but no error number set\n");
printf("Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)\n");
rc = EX_FAIL;
} else {
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) {
atexit(unlock_mtab);
rc = lock_mtab();
if (rc) {