summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
authorSteve French <sfrench@samba.org>2005-04-09 05:01:00 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:33 -0500
commit16167208cfb5d8f995126a4af98911240d58e007 (patch)
treedcf110b2fa02d5165d6cce2299abad3b85807ec2 /source3/client
parent9fda3ecda4b88fa5fbe9ba23a1acc149b9a9a73f (diff)
downloadsamba-16167208cfb5d8f995126a4af98911240d58e007.tar.gz
samba-16167208cfb5d8f995126a4af98911240d58e007.tar.bz2
samba-16167208cfb5d8f995126a4af98911240d58e007.zip
r6262: Minor updates to cifs umount helper
(This used to be commit cd8b93edc6d488ab6f6652ef533ce13e885b265b)
Diffstat (limited to 'source3/client')
-rw-r--r--source3/client/umount.cifs.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source3/client/umount.cifs.c b/source3/client/umount.cifs.c
index 0210de85a0..18dbc3b1cf 100644
--- a/source3/client/umount.cifs.c
+++ b/source3/client/umount.cifs.c
@@ -49,7 +49,7 @@
#define MNT_EXPIRE 0x04
#endif
-#define CIFS_IOC_CHECKUMOUNT _IOR('u', 2, int)
+#define CIFS_IOC_CHECKUMOUNT _IO('c', 2)
static struct option longopts[] = {
{ "all", 0, NULL, 'a' },
@@ -93,14 +93,21 @@ static int umount_check_perm(char * dir)
/* presumably can not chdir into the target as we do on mount */
fileid = open(dir, O_RDONLY | O_DIRECTORY | O_NOFOLLOW, 0);
-
- /* check if fileid valid if fileid == -1 BB FIXME */
+ if(fileid == -1) {
+ if(verboseflg)
+ printf("error opening mountpoint %d %s",errno,strerror(errno));
+ return errno;
+ }
rc = ioctl(fileid, CIFS_IOC_CHECKUMOUNT, NULL);
if(verboseflg)
- printf("ioctl returned %d with errno %d\n",rc,errno);
+ printf("ioctl returned %d with errno %d %s\n",rc,errno,strerror(errno));
+ if(rc == ENOTTY)
+ printf("user unmounting via %s is an optional feature of the cifs filesystem driver (cifs.ko)\n\tand requires cifs.ko version 1.32 or later\n",thisprogram);
+ else if (rc > 0)
+ printf("user unmount of %s failed with %d %s",dir,errno,strerror(errno));
close(fileid);
return rc;