summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
authorSteve French <sfrench@samba.org>2005-03-03 04:07:55 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:55:53 -0500
commit73d7fb0fd0d491d57e5422ce1ae36228b9f6a84a (patch)
treed36601a4e2cca5c2ce443788c8b0b642f433ab52 /source3/client
parent7f697e6da1c9d7c61ef3976d2868ccfe05b2fe2a (diff)
downloadsamba-73d7fb0fd0d491d57e5422ce1ae36228b9f6a84a.tar.gz
samba-73d7fb0fd0d491d57e5422ce1ae36228b9f6a84a.tar.bz2
samba-73d7fb0fd0d491d57e5422ce1ae36228b9f6a84a.zip
r5640: On failed mount (ENXIO) retry share name in uppercase (fix mount to FastConnect AIX SMB server)
(This used to be commit 8bd98b643d097cbd5e1650ec63a2f3176c3879d7)
Diffstat (limited to 'source3/client')
-rwxr-xr-xsource3/client/mount.cifs.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/source3/client/mount.cifs.c b/source3/client/mount.cifs.c
index d648629f9c..5aa6056fe8 100755
--- a/source3/client/mount.cifs.c
+++ b/source3/client/mount.cifs.c
@@ -24,6 +24,7 @@
#include <stdio.h>
#include <unistd.h>
#include <pwd.h>
+#include <ctype.h>
#include <sys/types.h>
#include <sys/mount.h>
#include <sys/stat.h>
@@ -38,7 +39,7 @@
#include <fcntl.h>
#define MOUNT_CIFS_VERSION_MAJOR "1"
-#define MOUNT_CIFS_VERSION_MINOR "5"
+#define MOUNT_CIFS_VERSION_MINOR "6"
#ifndef MOUNT_CIFS_VENDOR_SUFFIX
#define MOUNT_CIFS_VENDOR_SUFFIX ""
@@ -657,6 +658,7 @@ int main(int argc, char ** argv)
int gid = 0;
int optlen = 0;
int orgoptlen = 0;
+ int retry = 0; /* set when we have to retry mount with uppercase */
struct stat statbuf;
struct utsname sysinfo;
struct mntent mountent;
@@ -846,6 +848,7 @@ int main(int argc, char ** argv)
}
/* FIXME launch daemon (handles dfs name resolution and credential change)
remember to clear parms and overwrite password field before launching */
+mount_retry:
if(orgoptions) {
optlen = strlen(orgoptions);
orgoptlen = optlen;
@@ -897,6 +900,8 @@ int main(int argc, char ** argv)
printf("\nmount.cifs kernel mount options %s \n",options);
if(mount(share_name, mountpoint, "cifs", flags, options)) {
/* remember to kill daemon on error */
+ char * tmp;
+
switch (errno) {
case 0:
printf("mount failed but no error number set\n");
@@ -904,7 +909,21 @@ int main(int argc, char ** argv)
case ENODEV:
printf("mount error: cifs filesystem not supported by the system\n");
break;
+ case ENXIO:
+ if(retry == 0) {
+ retry = 1;
+ tmp = share_name;
+ while (*tmp && !(((unsigned char)tmp[0]) & 0x80)) {
+ *tmp = toupper((unsigned char)*tmp);
+ tmp++;
+ }
+ if(!*tmp) {
+ printf("retrying with upper case share name\n");
+ goto mount_retry;
+ }
+ }
default:
+
printf("mount error %d = %s\n",errno,strerror(errno));
}
printf("Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)\n");