Skip to contentSkip to conversation

mount.cifs fails when the share name must be converted to uppercase - e.g. for OS/2

PATCH Günter Kukkukk 1 participant 1 message Jun 10, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

As discussed in this thread
https://lists.samba.org/archive/samba/2014-June/182107.html
recent mount.cifs does not allow mounting of OS/2 shares, when the share name has not been specified in uppercase.

After the first failing mount attempt, mount.cifs then converts
- host
- share name
- prefix
to uppercase and retries the mount.
This worked in former versions - but is failing now.

Using "strace" and looking at the source of mount.cifs.c

      rc = mount(orig_dev, ".", cifs_fstype, parsed_info->flags, options);

i noticed that the passed "orig_dev" parameter (e.g. //server/share) was not converted to uppercase.

I also converted orig_dev to uppercase and it was working again:

mount.cifs.c +2 -1
index 497665d..3535096 100644
@@ -2097,7 +2097,8 @@ mount_retry:
                        if (!already_uppercased &&
                            uppercase_string(parsed_info->host) &&
                            uppercase_string(parsed_info->share) &&
-                           uppercase_string(parsed_info->prefix)) {
+                           uppercase_string(parsed_info->prefix) &&
+                           uppercase_string(orig_dev)) {
                                fprintf(stderr,
                                        "Retrying with upper case share name\n");
                                already_uppercased = 1;

I'm not a mount expert and only had a short look at the source, but probably this is the culprit.

Should i open a bug report for this?

Cheers, Günter