diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2009-04-12 12:16:21 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2009-04-12 12:16:21 +0000 |
commit | 5c3299300905698c45d1ace64a61a431312993a4 (patch) | |
tree | f89cb98e77ed897e29dd7993693c5cf0433ccb82 /util-linux | |
parent | f8de411e2428b9c8878a8be3602f022812a3ab70 (diff) | |
download | busybox-w32-5c3299300905698c45d1ace64a61a431312993a4.tar.gz busybox-w32-5c3299300905698c45d1ace64a61a431312993a4.tar.bz2 busybox-w32-5c3299300905698c45d1ace64a61a431312993a4.zip |
mount: users report that CIFS support is breaking things,
mostly remove it.
Diffstat (limited to 'util-linux')
-rw-r--r-- | util-linux/mount.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c index d647c71b1..694057bbe 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c | |||
@@ -419,12 +419,12 @@ static int mount_it_now(struct mntent *mp, long vfsflags, char *filteropts) | |||
419 | int errno_save = errno; | 419 | int errno_save = errno; |
420 | args[0] = xasprintf("mount.%s", mp->mnt_type); | 420 | args[0] = xasprintf("mount.%s", mp->mnt_type); |
421 | rc = 1; | 421 | rc = 1; |
422 | args[rc++] = mp->mnt_fsname; | ||
423 | args[rc++] = mp->mnt_dir; | ||
422 | if (filteropts) { | 424 | if (filteropts) { |
423 | args[rc++] = (char *)"-o"; | 425 | args[rc++] = (char *)"-o"; |
424 | args[rc++] = filteropts; | 426 | args[rc++] = filteropts; |
425 | } | 427 | } |
426 | args[rc++] = mp->mnt_fsname; | ||
427 | args[rc++] = mp->mnt_dir; | ||
428 | args[rc] = NULL; | 428 | args[rc] = NULL; |
429 | rc = wait4pid(spawn(args)); | 429 | rc = wait4pid(spawn(args)); |
430 | free(args[0]); | 430 | free(args[0]); |
@@ -1605,22 +1605,24 @@ static int singlemount(struct mntent *mp, int ignore_busy) | |||
1605 | && (mp->mnt_fsname[0] == '/' || mp->mnt_fsname[0] == '\\') | 1605 | && (mp->mnt_fsname[0] == '/' || mp->mnt_fsname[0] == '\\') |
1606 | && mp->mnt_fsname[0] == mp->mnt_fsname[1] | 1606 | && mp->mnt_fsname[0] == mp->mnt_fsname[1] |
1607 | ) { | 1607 | ) { |
1608 | #if 0 /* reported to break things */ | ||
1608 | len_and_sockaddr *lsa; | 1609 | len_and_sockaddr *lsa; |
1609 | char *ip, *dotted; | 1610 | char *ip, *dotted; |
1610 | char *s; | 1611 | char *s; |
1611 | 1612 | ||
1612 | rc = 1; | ||
1613 | // Replace '/' with '\' and verify that unc points to "//server/share". | 1613 | // Replace '/' with '\' and verify that unc points to "//server/share". |
1614 | for (s = mp->mnt_fsname; *s; ++s) | 1614 | for (s = mp->mnt_fsname; *s; ++s) |
1615 | if (*s == '/') *s = '\\'; | 1615 | if (*s == '/') *s = '\\'; |
1616 | 1616 | ||
1617 | // Get server IP | 1617 | // Get server IP |
1618 | s = strrchr(mp->mnt_fsname, '\\'); | 1618 | s = strrchr(mp->mnt_fsname, '\\'); |
1619 | if (s <= mp->mnt_fsname+1) goto report_error; | 1619 | if (s <= mp->mnt_fsname+1) |
1620 | goto report_error; | ||
1620 | *s = '\0'; | 1621 | *s = '\0'; |
1621 | lsa = host2sockaddr(mp->mnt_fsname+2, 0); | 1622 | lsa = host2sockaddr(mp->mnt_fsname+2, 0); |
1622 | *s = '\\'; | 1623 | *s = '\\'; |
1623 | if (!lsa) goto report_error; | 1624 | if (!lsa) |
1625 | goto report_error; | ||
1624 | 1626 | ||
1625 | // Insert ip=... option into string flags. | 1627 | // Insert ip=... option into string flags. |
1626 | dotted = xmalloc_sockaddr2dotted_noport(&lsa->u.sa); | 1628 | dotted = xmalloc_sockaddr2dotted_noport(&lsa->u.sa); |
@@ -1630,18 +1632,19 @@ static int singlemount(struct mntent *mp, int ignore_busy) | |||
1630 | // Compose new unc '\\server-ip\share' | 1632 | // Compose new unc '\\server-ip\share' |
1631 | // (s => slash after hostname) | 1633 | // (s => slash after hostname) |
1632 | mp->mnt_fsname = xasprintf("\\\\%s%s", dotted, s); | 1634 | mp->mnt_fsname = xasprintf("\\\\%s%s", dotted, s); |
1633 | 1635 | #endif | |
1634 | // Lock is required | 1636 | // Lock is required [why?] |
1635 | vfsflags |= MS_MANDLOCK; | 1637 | vfsflags |= MS_MANDLOCK; |
1636 | |||
1637 | mp->mnt_type = (char*)"cifs"; | 1638 | mp->mnt_type = (char*)"cifs"; |
1638 | rc = mount_it_now(mp, vfsflags, filteropts); | 1639 | rc = mount_it_now(mp, vfsflags, filteropts); |
1640 | #if 0 | ||
1639 | if (ENABLE_FEATURE_CLEAN_UP) { | 1641 | if (ENABLE_FEATURE_CLEAN_UP) { |
1640 | free(mp->mnt_fsname); | 1642 | free(mp->mnt_fsname); |
1641 | free(ip); | 1643 | free(ip); |
1642 | free(dotted); | 1644 | free(dotted); |
1643 | free(lsa); | 1645 | free(lsa); |
1644 | } | 1646 | } |
1647 | #endif | ||
1645 | goto report_error; | 1648 | goto report_error; |
1646 | } | 1649 | } |
1647 | 1650 | ||