Commit Graph

95 Commits

Author SHA1 Message Date
Pedro F. Giffuni
8a16b7a18f General further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.
2017-11-20 19:49:47 +00:00
Bryan Drewery
ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Bryan Drewery
3806950135 DIRDEPS_BUILD: Connect new directories.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:04:07 +00:00
Enji Cooper
188e46ab03 Add supporting changes for Add limited sandbox capability to "make check"
Non-tests/... changes:
- Add HAS_TESTS= to Makefiles with libraries and programs to enable iteration
  and propagate the appropriate environment down to *.test.mk.

tests/... changes:
- Add appropriate support Makefile.inc's to set HAS_TESTS in a minimal manner,
  since tests/... is a special subdirectory tree compared to the others.

MFC after:	2 months
MFC with:	r322511
Reviewed by:	arch (silence), testing (silence)
Differential Revision:	D12014
2017-08-14 19:21:37 +00:00
Enji Cooper
3783c851d7 Don't check result of chflags in f_flag_cleanup()
This will prevent false positives from occurring if the test is run on
ZFS since ZFS doesn't support fflags throbbing like UFS.

PR:	221189
MFC after:	4 days
MFC with:	r321949
2017-08-05 16:58:02 +00:00
Enji Cooper
86cc58dc96 MFhead@r321960 2017-08-02 22:28:12 +00:00
Enji Cooper
3e46b70f38 Always use first parameter passed to get_filesystem(..) instead of discarding it
and using `.` instead.

MFC after:	1 week
MFC with:	r321949
PR:	221189 [1], 221188 [2]
2017-08-02 21:20:49 +00:00
Enji Cooper
2d3e9c25f1 Add expected failures for ZFS
- :f_flag fails on ZFS because UF_IMMUTABLE isn't supported [1].
- :v_flag fails on ZFS because the mode for foo is [always] updated
  unnecessarily.

get_filesystem(..) (supporting function that was added to the test script)
is based on equivalent logic in usr.bin/extattr/tests/extattr_test.sh .

MFC after:	1 week
PR:	221189 [1], 221188 [2]
2017-08-02 21:18:54 +00:00
Enji Cooper
8c09935728 Add HAS_TESTS to all Makefiles that use the SUBDIR.${MK_TESTS}+= tests idiom 2017-08-02 08:14:06 +00:00
Enji Cooper
245e210cc6 Add some basic tests for chmod(1)
MFC after:	1 month
Sponsored by:	Dell EMC Isilon
2017-06-07 05:33:56 +00:00
Warner Losh
fbbd9655e5 Renumber copyright clause 4
Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by:	Jan Schaumann <jschauma@stevens.edu>
Pull Request:	https://github.com/freebsd/freebsd/pull/96
2017-02-28 23:42:47 +00:00
Conrad Meyer
a758566cb8 chmod: Add SIGINFO handler
PR:		191884
Submitted by:	Dan McGregor <dan.mcgregor at usask.ca>
Reviewed by:	mjg@ (earlier version)
2017-01-08 06:50:53 +00:00
Sevan Janiyan
66d39fc6c7 "POSIX doesn't specify -h." - r1.27 from NetBSD
http://man.openbsd.org/?query=chmod&apropos=0&sec=0&arch=default&manpath=POSIX-2013

PR:		212337
Approved by:	bcr (mentor)
Obtained from:	NetBSD
MFC after:	5 days
Differential Revision:	https://reviews.freebsd.org/D8118
2016-10-02 14:27:18 +00:00
Glen Barber
ac2875fa16 Explicitly add unmarked bin/ binaries to the runtime package.
Note: tcsh(1) has a MK_TCSH=no test, so this should be a separate
package, which requires pre-install/post-install scripts, to be
added later.

Sponsored by:	The FreeBSD Foundation
2016-02-09 16:58:50 +00:00
Simon J. Gerraty
ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty
44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Sergey Kandaurov
db1a93d4fe Change directory permissions in pre-order.
In this order, it won't try to recurse into a directory for which
it doesn't have permission, before changing that permission.
This follows an existing behavior in other BSDs, linux, OS X.

Obtained from:	NetBSD
2015-06-04 19:18:58 +00:00
Simon J. Gerraty
98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Steven Hartland
ad34cace15 Standardise chmod, chflags, chown and chgrp recursive symlink processing
chmod, chflags, chgrp, chmod and chown now affect symlinks in -R mode as
defined in symlink(7); previously symlinks were silently ignored.

Differential Revision:	https://reviews.freebsd.org/D2316
Reviewed by:	jilles
MFC after:	1 month
Relnotes:	yes
Sponsored by:	Multiplay
2015-04-29 00:49:00 +00:00
Simon J. Gerraty
fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty
76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty
7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty
f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
Marcel Moolenaar
7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Sergey Kandaurov
e2ea39cbdb Update sticky(7) cross references.
PR:		docs/124468
X-MFC with:	r218998
2011-05-13 16:29:57 +00:00
Edward Tomasz Napierala
f0246686c6 - Don't include both <sys/types.h> and <sys/param.h>
- Keep variables sorted

- Fix logic error with -f and -v options - don't print
  the usual -v output if there was an error, whether or not
  we were passed -f

- Don't call free(3) just before exit(2)

- Whitespace fixes

Submitted by:	bde
2009-09-02 05:26:59 +00:00
Edward Tomasz Napierala
c5cb1e51b4 Make the code more readable and fix chmod(1) on symlinks with
NFSv4 enabled.
2009-08-31 20:42:07 +00:00
Edward Tomasz Napierala
deda5987bc With NFSv4 ACLs, it is possible that applying a mode to an ACL which
is identical to the mode computed from that ACL will modify the ACL.
For example, mode computed from the following ACL is 0600:

   user:kamila:rwx--------C--:------:allow
        owner@:--x-----------:------:deny
        owner@:rw-p---A-W-Co-:------:allow
        group@:rwxp----------:------:deny
        group@:--------------:------:allow
     everyone@:rwxp---A-W-Co-:------:deny
     everyone@:------a-R-c--s:------:allow

However, applying that mode (chmod 0600) changes the ACL into this:

   user:kamila:rwx-----------:------:deny
   user:kamila:rwx--------C--:------:allow
        owner@:--x-----------:------:deny
        owner@:rw-p---A-W-Co-:------:allow
        group@:rwxp----------:------:deny
        group@:--------------:------:allow
     everyone@:rwxp---A-W-Co-:------:deny
     everyone@:------a-R-c--s:------:allow

In chmod(1) utility, there is an optimisation, which makes it not
call chmod(2) if the mode of the file is the same as the new mode.
Disable that optimisation for files which may have NFSv4 ACLs.

Reviewed by:	rwatson
Approved by:	re (kib)
2009-07-01 15:52:19 +00:00
Xin LI
431586a895 Staticify internal routines. 2009-06-23 23:30:56 +00:00
Tom Rhodes
1b1785d44c Make the Monty Python quote more google friendly instead of
hacking it apart.

Discussed with:	Christoph Mallon <christoph.mallon@gmx.de>
2009-01-26 18:14:21 +00:00
Tom Rhodes
cb30dc5538 Note the implication of setting the 'w' permission on directories,
while here, expand the 'naughty bits' comment in BUGS.

PR:		84265 and 84268
Reviewed by:	keramida
Obtained from:	hints from ceri, keramida
2009-01-23 11:39:00 +00:00
Ruslan Ermilov
dd8f42dc83 - Mention umask(2) when first referring to it.
- Add missing markup.

Submitted by:	Eugene Grosbein <eugen@grosbein.pp.ru>
2006-12-22 07:28:38 +00:00
Ruslan Ermilov
36a142c455 Expand contractions. 2005-02-13 23:45:54 +00:00
Ruslan Ermilov
6fca4c7c3f Add the new standard EXIT STATUS section where appropriate.
Sort standard sections in the (documented) preferred order.
2005-01-16 16:41:59 +00:00
Warner Losh
9ddb49cbe4 /*- or .\"- or #- to begin license clauses. 2005-01-10 08:39:26 +00:00
Mark Murray
6195fb4102 Remove clause 3 from the UCB licenses.
OK'ed by:	imp, core
2004-04-06 20:06:54 +00:00
Ruslan Ermilov
887cb17fac Print unambiguous paths with -R -v. 2003-12-16 15:17:30 +00:00
Anton Berezin
ad6a34de1d Remove the code for parsing octal modes, since setmode(3) already
handles them.

Reviewed by:	audit
MFC after:	2 weeks
2003-10-31 13:20:09 +00:00
David E. O'Brien
09a80d4867 Quiet warnings about copyright[]. 2003-05-01 16:58:57 +00:00
Maxime Henrion
572417c7e4 Remove now unnecessary main() prototype. 2003-01-29 21:46:12 +00:00
Ruslan Ermilov
2267d53b43 mdoc(7) police: In DESCRIPTION, list the options in pure alphabetical
order, as required by style(9).  Document the effect of the -f option
on exit status.  Fixed some spacing.

Submitted by:	bde
Approved by:	re
2002-11-25 14:18:42 +00:00
Tim J. Robbins
745d94fc5f Cross-reference setfacl(1). 2002-11-04 06:46:53 +00:00
Tom Rhodes
0237755d1a Return the ``u'' 2002-10-01 20:32:59 +00:00
Tom Rhodes
ca4a28f770 s/behaviour/behavior/ in the chmod(1) manual 2002-09-28 23:05:58 +00:00
Ruslan Ermilov
154f47dd8d mdoc(7) police: kill hard sentence breaks and one double space. 2002-08-09 10:34:57 +00:00
David E. O'Brien
30d90946d1 Allow "-v -v" to mean very verbose.
Reviewed by:	freebsd-standards
PR:		40709
Submitted by:	Edward Brocklesby <nighthawk@unrealircd.com>, johan
2002-08-04 05:29:13 +00:00
Sheldon Hearn
ced4deb156 Revert previous delta, which is not required with rev 1.5 of
src/contrib/gcc/c-format.c .
2002-07-15 12:08:21 +00:00
Giorgos Keramidas
b11b570d7b Don't duplicate the description of the sticky bit that is already
part of chmod(2) and sticky(8), but refer to those manpages instead.

PR:		docs/35605
Submitted by:	Gary W. Swearingen <swear@blarg.net>
2002-07-12 01:57:44 +00:00
Sheldon Hearn
a3ee32f3f7 Set WFORMAT=0, because our compiler currently complains about NULL
arg 2 to err() and friends, and warnings are promoted to errors.

This allows the following revisions to be reverted:

	rev 1.39	src/bin/cp/cp.c
	rev 1.26	src/bin/chmod/chmod.c
	rev 1.40	src/bin/rm/rm.c

The following revisions can already be reverted, because they were
already covered by WFORMAT=0:

	rev 1.8		src/bin/ls/lomac.c
	rev 1.63	src/bin/ls/ls.c
	rev 1.8		src/bin/ps/lomac.c
	rev 1.34	src/bin/rcp/rcp.c
2002-07-11 08:45:38 +00:00
Matthew Dillon
3951e2ab28 err() is documented as allowing NULL for the format string but GCC isn't
happy about it any more so change the useage so buildworld works again.
2002-07-10 20:36:25 +00:00