As reported by one of our users in Debian (see the above mentioned URL), it would be good if mount.cifs supported the "fake" mount option which is common to many mount utilities. It is for instance used in Debian and Ubuntu by the /etc/init.d/mtab.sh script that updates /etc/mtab with entries for filesystems that were mounted before that file was writable.
Created attachment 3907 [details]
add -f (fake mount option) to mount.cifs utility
Added -f option to mount.cifs.c.
Is this kind of functionality is what intended?
Well, I'm not clever enough to actually read the whole code and understand what it exactly does.
What's (imho) needed for a "fake mount" option is that it actually does "as if" it would mount the resources....without really mounting it.
So, mount should fail in case something wrong happens (non-existing resource, not enough rights and all other failure cases) AND exit with zero return code but *without* mounting the resource in case the mount would succeed.
hope this is clearer.;:-)
PS: please note that the new option should also be documented in the manpage...
Christian Perrier <firstname.lastname@example.org> on behalf of Debian maintainers
(In reply to comment #2)
This is what -f option does
Fake mount. Go through the motions of checking the device and directory, but do not actually mount the filesystem
That is what this fix does.
(In reply to comment #3)
Seems fine by me and exactly what we would need. I haven't checked the patch but I believe it's OK to commit it...
Created attachment 3927 [details]
add flag -f handling as well as -n flag handling in mount.cifs
This patch is commited in samba (source3) git tree.
As 3.3.1 fixes this bug, I think it should be marked as such