aboutsummaryrefslogtreecommitdiff
path: root/sbin/mount_nullfs/mount_nullfs.c
diff options
context:
space:
mode:
authorEdward Tomasz Napierala <trasz@FreeBSD.org>2020-10-25 14:09:00 +0000
committerEdward Tomasz Napierala <trasz@FreeBSD.org>2020-10-25 14:09:00 +0000
commit5a13da9b0b5baa5c9b830c56a002a625d137c501 (patch)
treee44f0c0c7c88f41324fbbe994ed7280d4feebe97 /sbin/mount_nullfs/mount_nullfs.c
parentba196aec7dad1b73a9a3b86a06259d5e81f16fad (diff)
downloadsrc-5a13da9b0b5baa5c9b830c56a002a625d137c501.tar.gz
src-5a13da9b0b5baa5c9b830c56a002a625d137c501.zip
Remove the check that prevents creating "loops" from mount_nullfs(8).
Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26921
Notes
Notes: svn path=/head/; revision=367038
Diffstat (limited to 'sbin/mount_nullfs/mount_nullfs.c')
-rw-r--r--sbin/mount_nullfs/mount_nullfs.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/sbin/mount_nullfs/mount_nullfs.c b/sbin/mount_nullfs/mount_nullfs.c
index e62f60bd022d..1fb44eb864af 100644
--- a/sbin/mount_nullfs/mount_nullfs.c
+++ b/sbin/mount_nullfs/mount_nullfs.c
@@ -59,7 +59,6 @@ static const char rcsid[] =
#include "mntopts.h"
-int subdir(const char *, const char *);
static void usage(void) __dead2;
int
@@ -104,10 +103,6 @@ main(int argc, char *argv[])
if (checkpath(argv[1], source) != 0)
err(EX_USAGE, "%s", source);
- if (subdir(target, source) || subdir(source, target))
- errx(EX_USAGE, "%s (%s) and %s are not distinct paths",
- argv[0], target, argv[1]);
-
build_iovec(&iov, &iovlen, "fstype", nullfs, (size_t)-1);
build_iovec(&iov, &iovlen, "fspath", source, (size_t)-1);
build_iovec(&iov, &iovlen, "target", target, (size_t)-1);
@@ -121,21 +116,6 @@ main(int argc, char *argv[])
exit(0);
}
-int
-subdir(const char *p, const char *dir)
-{
- int l;
-
- l = strlen(dir);
- if (l <= 1)
- return (1);
-
- if ((strncmp(p, dir, l) == 0) && (p[l] == '/' || p[l] == '\0'))
- return (1);
-
- return (0);
-}
-
static void
usage(void)
{