aboutsummaryrefslogtreecommitdiff
path: root/sbin/mksnap_ffs
Commit message (Collapse)AuthorAgeFilesLines
* Remove #define _KERNEL hacks from libprocstatKonstantin Belousov2021-02-211-0/+4
| | | | | | | | | | | | | | | | | | 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
* Deduplicate fsid comparisonsRyan Moeller2020-05-211-2/+1
| | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=361313
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-1/+3
| | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=326276
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Fix an issue in the rev.316718 causing variable to be unsed uninitialized.Maxim Sobolev2017-04-121-6/+6
| | | | | | | | | Reported by: Coverity Nudged by: cem MFC after: 2 weeks Notes: svn path=/head/; revision=316738
* Work around an issue with mksnap_ffs not working in chroot'ed environment.Maxim Sobolev2017-04-111-2/+46
| | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=316718
* sbin: normalize paths using SRCTOP-relative paths or :H when possibleEnji Cooper2017-03-041-2/+2
| | | | | | | | | | This simplifies make logic/output MFC after: 1 month Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=314656
* mksnap_ffs appeared in FreeBSD 5.1.Sevan Janiyan2016-10-021-2/+2
| | | | | | | | | | PR: 212510 Approved by: bcr (mentor) MFC after: 4 days Differential Revision: https://reviews.freebsd.org/D8105 Notes: svn path=/head/; revision=306607
* Explicitly add more files to the 'runtime' package.Glen Barber2016-02-091-0/+1
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295450
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge from head@274682Simon J. Gerraty2014-11-191-2/+2
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=274683
| * Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+19
| | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | Change file permissions for some setuid executables so they are "o+r".Neel Natu2014-08-211-2/+2
|/ | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=270289
* Note that a UFS filesystem can have up to 20 active snapshots.Giorgos Keramidas2011-02-151-1/+10
| | | | | | | | | PR: docs/151104 Submitted by: Aldis Berjoza <aldis@bsdroot.lv> MFC after: 3 days Notes: svn path=/head/; revision=218700
* - Print the nmount(2) provided error message only when it is set.Jaakko Heinonen2010-10-101-2/+6
| | | | | | | | | | - Ensure that the error message is NUL-terminated before printing it. PR: bin/147482 MFC after: 2 weeks Notes: svn path=/head/; revision=213668
* mdoc: move CAVEATS, BUGS and SECURITY CONSIDERATIONS sections to theUlrich Spörlein2010-05-131-3/+3
| | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=208027
* Switch the default WARNS level for sbin/ to 6.Ruslan Ermilov2009-10-191-0/+1
| | | | | | | Submitted by: Ulrich Spörlein Notes: svn path=/head/; revision=198236
* Fix an xref.Christian Brueffer2009-09-171-1/+1
| | | | | | | | | PR: 138833 Submitted by: Alex Keda <admin@lissyara.su> MFC after: 3 days Notes: svn path=/head/; revision=197275
* Initialize iov and iovlen before use.Pawel Jakub Dawidek2009-06-021-0/+2
| | | | | | | Reported by: Lucius Windschuh <lwindschuh@googlemail.com> Notes: svn path=/head/; revision=193333
* - Move from mount(2) to nmount(2). This should allow to convert MNT_SNAPSHOTPawel Jakub Dawidek2009-05-293-40/+54
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=193051
* Note that snapshots may cause a panic on the full UFS filesystem.Konstantin Belousov2008-07-261-0/+3
| | | | | | | | Submitted by: pho MFC after: 3 days Notes: svn path=/head/; revision=180822
* Make sure we don't pass garbage to the kernel.Poul-Henning Kamp2004-12-081-1/+2
| | | | | | | The filesystem is named "ufs" not "ffs". Notes: svn path=/head/; revision=138559
* Style nit in previous commit.Dag-Erling Smørgrav2004-01-271-1/+1
| | | | Notes: svn path=/head/; revision=125107
* Preserve acls option on mounts when taking a snapshot.Kirk McKusick2004-01-271-1/+5
| | | | | | | Submitted by: Wiktor Niesiobedzki <freebsd-lists@w.evip.pl> Notes: svn path=/head/; revision=125103
* Check that the user running mksnap_ffs has permission to create andKirk McKusick2003-11-041-1/+33
| | | | | | | | | | 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. Notes: svn path=/head/; revision=122035
* style(9): sort functions.Tom Rhodes2003-10-291-8/+8
| | | | Notes: svn path=/head/; revision=121707
* Properly prototype C function usage().Tom Rhodes2003-10-291-1/+3
| | | | | | | Sync usage() with the manual page: s/file/snapshot_name/g. Notes: svn path=/head/; revision=121706
* Replace a reference to non existant mount_ffs(8) by a reference to mount(8).Philippe Charnier2003-09-071-1/+1
| | | | Notes: svn path=/head/; revision=119845
* mdoc(7) fixes.Ruslan Ermilov2003-05-241-9/+9
| | | | | | | Approved by: re (blanket) Notes: svn path=/head/; revision=115288
* Close out a possible race where anybody in group operator couldKirk McKusick2003-03-021-2/+11
| | | | | | | | | | chown an arbitrary file to operator. Reported by: Ian Dowse <iedowse@maths.tcd.ie> Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=111725
* Add the mksnap_ffs command to the sbin directory. This setuid rootKirk McKusick2003-03-023-0/+171
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. Notes: svn path=/head/; revision=111716