Commit Graph

36 Commits

Author SHA1 Message Date
Konstantin Belousov
d485c77f20 Remove #define _KERNEL hacks from libprocstat
Make sys/buf.h, sys/pipe.h, sys/fs/devfs/devfs*.h headers usable in
userspace, assuming that the consumer has an idea what it is for.
Unhide more material from sys/mount.h and sys/ufs/ufs/inode.h,
sys/ufs/ufs/ufsmount.h for consumption of userspace tools, with the
same caveat.

Remove unacceptable hack from usr.sbin/makefs which relied on sys/buf.h
being unusable in userspace, where it override struct buf with its own
definition.  Instead, provide struct m_buf and struct m_vnode and adapt
code to use local variants.

Reviewed by:	mckusick
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D28679
2021-02-21 11:38:21 +02:00
Ryan Moeller
245bfd34da Deduplicate fsid comparisons
Comparing fsid_t objects requires internal knowledge of the fsid structure
and yet this is duplicated across a number of places in the code.

Simplify by creating a fsidcmp function (macro).

Reviewed by:	mjg, rmacklem
Approved by:	mav (mentor)
MFC after:	1 week
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D24749
2020-05-21 01:55:35 +00:00
Pedro F. Giffuni
1de7b4b805 various: general adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

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.

No functional change intended.
2017-11-27 15:37:16 +00:00
Bryan Drewery
ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Maxim Sobolev
bf43319445 Fix an issue in the rev.316718 causing variable to be unsed uninitialized.
Reported by:    Coverity
Nudged by:      cem
MFC after:	2 weeks
2017-04-12 19:23:41 +00:00
Maxim Sobolev
591e89c89b Work around an issue with mksnap_ffs not working in chroot'ed environment.
The problem is that the statfs(2) system call used to determine the relevant
mount point returns path within real root in the f_mntonname, causing
nmount(2) system call to fail with ENOENT.

Use a bit of heuristics to skip over few starting path elements when it
happens until we hit an actual mount point.

For this to work properly the whole mount should be accessible within the
chroot, it's going to still fail if chroot only has access to a part of the
mounted fs.

Reviewed by:	mckusick
Approved by:	mckusick
MFC after:	2 weeks
2017-04-11 21:55:39 +00:00
Enji Cooper
22289a8c3d sbin: normalize paths using SRCTOP-relative paths or :H when possible
This simplifies make logic/output

MFC after:	1 month
Sponsored by:	Dell EMC Isilon
2017-03-04 11:33:01 +00:00
Sevan Janiyan
b78bd5ec30 mksnap_ffs appeared in FreeBSD 5.1.
PR:		212510
Approved by:	bcr (mentor)
MFC after:	4 days
Differential Revision:	https://reviews.freebsd.org/D8105
2016-10-02 23:59:31 +00:00
Glen Barber
406d87b1c3 Explicitly add more files to the 'runtime' package.
Sponsored by:	The FreeBSD Foundation
2016-02-09 20:19:31 +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
Simon J. Gerraty
9268022b74 Merge from head@274682 2014-11-19 01:07:58 +00:00
Neel Natu
f518456fdb Change file permissions for some setuid executables so they are "o+r".
The executable itself doesn't contain any privileged information.

An example of where this is useful is when makefs(8) is creating an image
that includes /sbin/shutdown. This can now be done without root privileges.

Reviewed by:	delphij
Discussed with:	delphij, des
CR:		https://reviews.freebsd.org/D662
2014-08-21 19:04:15 +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
Giorgos Keramidas
c43728a230 Note that a UFS filesystem can have up to 20 active snapshots.
PR:		docs/151104
Submitted by:	Aldis Berjoza <aldis@bsdroot.lv>
MFC after:	3 days
2011-02-15 07:25:54 +00:00
Jaakko Heinonen
7f79e870d2 - Print the nmount(2) provided error message only when it is set.
- Ensure that the error message is NUL-terminated before printing it.

PR:		bin/147482
MFC after:	2 weeks
2010-10-10 09:24:19 +00:00
Ulrich Spörlein
0afc94c17a mdoc: move CAVEATS, BUGS and SECURITY CONSIDERATIONS sections to the
bottom of the manpages and order them consistently.

GNU groff doesn't care about the ordering, and doesn't even mention
CAVEATS and SECURITY CONSIDERATIONS as common sections and where to put
them.

Found by:	mdocml lint run
Reviewed by:	ru
2010-05-13 12:07:55 +00:00
Ruslan Ermilov
106d839190 Switch the default WARNS level for sbin/ to 6.
Submitted by:	Ulrich Spörlein
2009-10-19 16:00:24 +00:00
Christian Brueffer
9d9cf6adf5 Fix an xref.
PR:		138833
Submitted by:	Alex Keda <admin@lissyara.su>
MFC after:	3 days
2009-09-17 13:09:08 +00:00
Pawel Jakub Dawidek
923f9901b4 Initialize iov and iovlen before use.
Reported by:	Lucius Windschuh <lwindschuh@googlemail.com>
2009-06-02 18:30:09 +00:00
Pawel Jakub Dawidek
c8cf3f3d0e - Move from mount(2) to nmount(2). This should allow to convert MNT_SNAPSHOT
flag from a mount flag to FS-specific flag.
- Simplify usage. Instead of 'mksnap_ffs /mnt/foo /mnt/foo/snap' allow to
  give only one argument: 'mksnap_ffs /mnt/foo/snap'. Old usage is also
  accepted for now.
- Add an example of how to mount a snapshot.
2009-05-29 19:18:41 +00:00
Konstantin Belousov
89aa52d4db Note that snapshots may cause a panic on the full UFS filesystem.
Submitted by:	pho
MFC after:	3 days
2008-07-26 13:18:33 +00:00
Poul-Henning Kamp
b697270ad8 Make sure we don't pass garbage to the kernel.
The filesystem is named "ufs" not "ffs".
2004-12-08 11:54:50 +00:00
Dag-Erling Smørgrav
a1b99708d0 Style nit in previous commit. 2004-01-27 19:28:13 +00:00
Kirk McKusick
cea1849767 Preserve acls option on mounts when taking a snapshot.
Submitted by:	Wiktor Niesiobedzki <freebsd-lists@w.evip.pl>
2004-01-27 18:28:11 +00:00
Kirk McKusick
d62e006473 Check that the user running mksnap_ffs has permission to create and
remove a snapshot file from the directory in which they have requested
to have it made. If they do not have write permission in the directory
or the directory is sticky and not owned by the user, then they
will not be able to remove the snapshot when they are done with it.
2003-11-04 07:04:01 +00:00
Tom Rhodes
201747dffc style(9): sort functions. 2003-10-29 21:23:44 +00:00
Tom Rhodes
91b6ac7c44 Properly prototype C function usage().
Sync usage() with the manual page: s/file/snapshot_name/g.
2003-10-29 21:21:09 +00:00
Philippe Charnier
4b8487d130 Replace a reference to non existant mount_ffs(8) by a reference to mount(8). 2003-09-07 14:11:02 +00:00
Ruslan Ermilov
734ac3b543 mdoc(7) fixes.
Approved by:	re (blanket)
2003-05-24 19:53:08 +00:00
Kirk McKusick
6d540f8137 Close out a possible race where anybody in group operator could
chown an arbitrary file to operator.

Reported by:	Ian Dowse <iedowse@maths.tcd.ie>
Sponsored by:   DARPA & NAI Labs.
2003-03-02 08:07:57 +00:00
Kirk McKusick
d35ae777f2 Add the mksnap_ffs command to the sbin directory. This setuid root
program allows users in the operator group to take filesystem
snapshots. Its first use will be in support of `dump -L'.

Approved by:	Technical Review Board <trb@FreeBSD.org>
Sponsored by:   DARPA & NAI Labs.
2003-03-02 01:50:33 +00:00