[BusyBox] Issue with 'mount -a' when using NFS mounts

Wilco van Hoogstraeten wilco at equator.com
Fri Apr 16 17:33:57 UTC 2004


All,

There is an issue when using 'mount -a' when one or more NFS mounts are
specified in the /etc/fstab.

In util-linux/mount.c, '&string_flags' is passed into 'nfsmount()',
where it is replaced with a pointer to a local static. For the next
mount entry, it then fails when that pointer is passed to 'xrealloc()'.

One solution is to use a temporary to hold the string_flags value:

          singlemount:
            extra_opts = string_flags;
            tmp_string_flags = string_flags;
            rc = EXIT_SUCCESS;
#ifdef CONFIG_NFSMOUNT
            if (strchr(device, ':') != NULL) {
                filesystemType = "nfs";
                if (nfsmount
                    (device, directory, &flags, &extra_opts, &tmp_string_flags,
                     1)) {
                    bb_perror_msg("nfsmount failed");
                    rc = EXIT_FAILURE;
                }
            }
#endif
            if (!mount_one
                (device, directory, filesystemType, flags, tmp_string_flags,
                 useMtab, fakeIt, extra_opts, TRUE, all)) {
                rc = EXIT_FAILURE;
            }


This issue was found in 1.0.0-pre9, but the changelog for 1.0.0-pre10
does not mention it to be fixed.

Best regards,

Wilco.



More information about the busybox mailing list