From owner-svn-src-all@freebsd.org Mon Mar 5 01:56:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EF94F487A2; Mon, 5 Mar 2018 01:56:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 012D17C01C; Mon, 5 Mar 2018 01:56:08 +0000 (UTC) (envelope-from bdrewery@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 F02921D84C; Mon, 5 Mar 2018 01:56:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w251u7l9020944; Mon, 5 Mar 2018 01:56:07 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w251u7Y8020941; Mon, 5 Mar 2018 01:56:07 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201803050156.w251u7Y8020941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 5 Mar 2018 01:56:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330436 - head/bin/chflags X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/bin/chflags X-SVN-Commit-Revision: 330436 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Mar 2018 01:56:08 -0000 Author: bdrewery Date: Mon Mar 5 01:56:07 2018 New Revision: 330436 URL: https://svnweb.freebsd.org/changeset/base/330436 Log: chflags: Add -x option to not traverse mount points. MFC after: 2 weeks Modified: head/bin/chflags/chflags.1 head/bin/chflags/chflags.c Modified: head/bin/chflags/chflags.1 ============================================================================== --- head/bin/chflags/chflags.1 Mon Mar 5 01:18:32 2018 (r330435) +++ head/bin/chflags/chflags.1 Mon Mar 5 01:56:07 2018 (r330436) @@ -32,7 +32,7 @@ .\" @(#)chflags.1 8.4 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd April 20, 2015 +.Dd March 4, 2018 .Dt CHFLAGS 1 .Os .Sh NAME @@ -40,7 +40,7 @@ .Nd change file flags .Sh SYNOPSIS .Nm -.Op Fl fhv +.Op Fl fhvx .Oo .Fl R .Op Fl H | Fl L | Fl P @@ -98,6 +98,8 @@ If the .Fl v option is specified more than once, the old and new flags of the file will also be printed, in octal notation. +.It Fl x +Do not cross mount points. .El .Pp The flags are specified as an octal number or a comma separated list Modified: head/bin/chflags/chflags.c ============================================================================== --- head/bin/chflags/chflags.c Mon Mar 5 01:18:32 2018 (r330435) +++ head/bin/chflags/chflags.c Mon Mar 5 01:56:07 2018 (r330436) @@ -65,12 +65,12 @@ main(int argc, char *argv[]) FTSENT *p; u_long clear, newflags, set; long val; - int Hflag, Lflag, Rflag, fflag, hflag, vflag; + int Hflag, Lflag, Rflag, fflag, hflag, vflag, xflag; int ch, fts_options, oct, rval; char *flags, *ep; - Hflag = Lflag = Rflag = fflag = hflag = vflag = 0; - while ((ch = getopt(argc, argv, "HLPRfhv")) != -1) + Hflag = Lflag = Rflag = fflag = hflag = vflag = xflag = 0; + while ((ch = getopt(argc, argv, "HLPRfhvx")) != -1) switch (ch) { case 'H': Hflag = 1; @@ -95,6 +95,9 @@ main(int argc, char *argv[]) case 'v': vflag++; break; + case 'x': + xflag = 1; + break; case '?': default: usage(); @@ -123,6 +126,8 @@ main(int argc, char *argv[]) } else { fts_options = FTS_LOGICAL; } + if (xflag) + fts_options |= FTS_XDEV; flags = *argv; if (*flags >= '0' && *flags <= '7') { @@ -201,6 +206,6 @@ static void usage(void) { (void)fprintf(stderr, - "usage: chflags [-fhv] [-R [-H | -L | -P]] flags file ...\n"); + "usage: chflags [-fhvx] [-R [-H | -L | -P]] flags file ...\n"); exit(1); }