From owner-svn-src-head@freebsd.org Sun Oct 25 14:09:01 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E0B344FE16; Sun, 25 Oct 2020 14:09:01 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CK0FT2lMlz45Hs; Sun, 25 Oct 2020 14:09:01 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 41A77ADE1; Sun, 25 Oct 2020 14:09:01 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09PE91X5001782; Sun, 25 Oct 2020 14:09:01 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09PE91aS001781; Sun, 25 Oct 2020 14:09:01 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202010251409.09PE91aS001781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 25 Oct 2020 14:09:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367038 - head/sbin/mount_nullfs X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sbin/mount_nullfs X-SVN-Commit-Revision: 367038 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Oct 2020 14:09:01 -0000 Author: trasz Date: Sun Oct 25 14:09:00 2020 New Revision: 367038 URL: https://svnweb.freebsd.org/changeset/base/367038 Log: 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 Modified: head/sbin/mount_nullfs/mount_nullfs.c Modified: head/sbin/mount_nullfs/mount_nullfs.c ============================================================================== --- head/sbin/mount_nullfs/mount_nullfs.c Sun Oct 25 10:08:46 2020 (r367037) +++ head/sbin/mount_nullfs/mount_nullfs.c Sun Oct 25 14:09:00 2020 (r367038) @@ -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); @@ -119,21 +114,6 @@ main(int argc, char *argv[]) err(1, "%s", source); } 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