[Midnightbsd-cvs] src [11182] trunk/bin/setfacl: sync with freebsd 10-stable
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sat Jun 30 19:38:05 EDT 2018
Revision: 11182
http://svnweb.midnightbsd.org/src/?rev=11182
Author: laffer1
Date: 2018-06-30 19:38:04 -0400 (Sat, 30 Jun 2018)
Log Message:
-----------
sync with freebsd 10-stable
Modified Paths:
--------------
trunk/bin/setfacl/file.c
trunk/bin/setfacl/mask.c
trunk/bin/setfacl/merge.c
trunk/bin/setfacl/setfacl.1
trunk/bin/setfacl/setfacl.c
trunk/bin/setfacl/setfacl.h
Property Changed:
----------------
trunk/bin/setfacl/setfacl.1
Modified: trunk/bin/setfacl/file.c
===================================================================
--- trunk/bin/setfacl/file.c 2018-06-30 23:36:25 UTC (rev 11181)
+++ trunk/bin/setfacl/file.c 2018-06-30 23:38:04 UTC (rev 11182)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 2001 Chris D. Faulhaber
* All rights reserved.
@@ -25,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/bin/setfacl/file.c,v 1.5 2005/01/10 08:39:25 imp Exp $");
+__FBSDID("$FreeBSD: stable/10/bin/setfacl/file.c 301919 2016-06-15 06:33:40Z truckman $");
#include <sys/types.h>
#include <sys/acl.h>
@@ -43,13 +44,12 @@
get_acl_from_file(const char *filename)
{
FILE *file;
- char buf[BUFSIZ];
+ size_t len;
+ char buf[BUFSIZ+1];
if (filename == NULL)
err(1, "(null) filename in get_acl_from_file()");
- bzero(&buf, sizeof(buf));
-
if (strcmp(filename, "-") == 0) {
if (have_stdin != 0)
err(1, "cannot specify more than one stdin");
@@ -61,7 +61,8 @@
err(1, "fopen() %s failed", filename);
}
- fread(buf, sizeof(buf), (size_t)1, file);
+ len = fread(buf, (size_t)1, sizeof(buf) - 1, file);
+ buf[len] = '\0';
if (ferror(file) != 0) {
fclose(file);
err(1, "error reading from %s", filename);
Modified: trunk/bin/setfacl/mask.c
===================================================================
--- trunk/bin/setfacl/mask.c 2018-06-30 23:36:25 UTC (rev 11181)
+++ trunk/bin/setfacl/mask.c 2018-06-30 23:38:04 UTC (rev 11182)
@@ -1,4 +1,4 @@
-/* $MidnightBSD: src/bin/setfacl/mask.c,v 1.2 2007/07/26 20:13:01 laffer1 Exp $ */
+/* $MidnightBSD$ */
/*-
* Copyright (c) 2001-2002 Chris D. Faulhaber
* All rights reserved.
@@ -15,18 +15,18 @@
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/bin/setfacl/mask.c,v 1.8 2005/01/10 08:39:25 imp Exp $");
+__FBSDID("$FreeBSD: stable/10/bin/setfacl/mask.c 204819 2010-03-07 07:59:05Z joel $");
#include <sys/types.h>
#include <sys/acl.h>
Modified: trunk/bin/setfacl/merge.c
===================================================================
--- trunk/bin/setfacl/merge.c 2018-06-30 23:36:25 UTC (rev 11181)
+++ trunk/bin/setfacl/merge.c 2018-06-30 23:38:04 UTC (rev 11182)
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/bin/setfacl/merge.c,v 1.8 2005/01/10 08:39:25 imp Exp $");
+__FBSDID("$FreeBSD: stable/10/bin/setfacl/merge.c 240087 2012-09-04 12:19:34Z trasz $");
#include <sys/types.h>
#include <sys/acl.h>
Modified: trunk/bin/setfacl/setfacl.1
===================================================================
--- trunk/bin/setfacl/setfacl.1 2018-06-30 23:36:25 UTC (rev 11181)
+++ trunk/bin/setfacl/setfacl.1 2018-06-30 23:38:04 UTC (rev 11182)
@@ -1,3 +1,4 @@
+.\" $MidnightBSD$
.\"-
.\" Copyright (c) 2001 Chris D. Faulhaber
.\" Copyright (c) 2011 Edward Tomasz Napierała
@@ -24,9 +25,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/bin/setfacl/setfacl.1,v 1.13 2005/02/09 17:37:39 ru Exp $
+.\" $FreeBSD: stable/10/bin/setfacl/setfacl.1 307403 2016-10-16 22:02:50Z sevan $
.\"
-.Dd April 1, 2013
+.Dd September 4, 2015
.Dt SETFACL 1
.Os
.Sh NAME
@@ -378,9 +379,11 @@
inherit_only
.It n
no_propagate
+.It I
+inherited
.El
.Pp
-Inheritance flags may be only set on directories.
+Other than the "inherited" flag, inheritance flags may be only set on directories.
.It Ar "ACL type"
The ACL type field is either
.Dq Li allow
@@ -485,6 +488,6 @@
The
.Nm
utility was written by
-.An Chris D. Faulhaber Aq jedgar at fxp.org .
+.An Chris D. Faulhaber Aq Mt jedgar at fxp.org .
NFSv4 ACL support was implemented by
-.An Edward Tomasz Napierala Aq trasz at FreeBSD.org .
+.An Edward Tomasz Napierala Aq Mt trasz at FreeBSD.org .
Property changes on: trunk/bin/setfacl/setfacl.1
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/bin/setfacl/setfacl.c
===================================================================
--- trunk/bin/setfacl/setfacl.c 2018-06-30 23:36:25 UTC (rev 11181)
+++ trunk/bin/setfacl/setfacl.c 2018-06-30 23:38:04 UTC (rev 11182)
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/bin/setfacl/setfacl.c,v 1.11 2005/02/09 17:37:39 ru Exp $");
+__FBSDID("$FreeBSD: stable/10/bin/setfacl/setfacl.c 241720 2012-10-19 05:43:38Z ed $");
#include <sys/types.h>
#include <sys/param.h>
@@ -43,6 +43,35 @@
#include "setfacl.h"
+/* file operations */
+#define OP_MERGE_ACL 0x00 /* merge acl's (-mM) */
+#define OP_REMOVE_DEF 0x01 /* remove default acl's (-k) */
+#define OP_REMOVE_EXT 0x02 /* remove extended acl's (-b) */
+#define OP_REMOVE_ACL 0x03 /* remove acl's (-xX) */
+#define OP_REMOVE_BY_NUMBER 0x04 /* remove acl's (-xX) by acl entry number */
+#define OP_ADD_ACL 0x05 /* add acls entries at a given position */
+
+/* TAILQ entry for acl operations */
+struct sf_entry {
+ uint op;
+ acl_t acl;
+ uint entry_number;
+ TAILQ_ENTRY(sf_entry) next;
+};
+static TAILQ_HEAD(, sf_entry) entrylist;
+
+/* TAILQ entry for files */
+struct sf_file {
+ const char *filename;
+ TAILQ_ENTRY(sf_file) next;
+};
+static TAILQ_HEAD(, sf_file) filelist;
+
+uint have_mask;
+uint need_mask;
+uint have_stdin;
+uint n_flag;
+
static void add_filename(const char *filename);
static void usage(void);
Modified: trunk/bin/setfacl/setfacl.h
===================================================================
--- trunk/bin/setfacl/setfacl.h 2018-06-30 23:36:25 UTC (rev 11181)
+++ trunk/bin/setfacl/setfacl.h 2018-06-30 23:38:04 UTC (rev 11182)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 2001 Chris D. Faulhaber
* All rights reserved.
@@ -23,8 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $MidnightBSD: src/bin/setfacl/setfacl.h,v 1.2 2007/07/26 20:13:01 laffer1 Exp $
- * $FreeBSD: src/bin/setfacl/setfacl.h,v 1.5 2005/01/10 08:39:25 imp Exp $
+ * $FreeBSD: stable/10/bin/setfacl/setfacl.h 241720 2012-10-19 05:43:38Z ed $
*/
#ifndef _SETFACL_H
@@ -34,30 +34,6 @@
#include <sys/acl.h>
#include <sys/queue.h>
-/* file operations */
-#define OP_MERGE_ACL 0x00 /* merge acl's (-mM) */
-#define OP_REMOVE_DEF 0x01 /* remove default acl's (-k) */
-#define OP_REMOVE_EXT 0x02 /* remove extended acl's (-b) */
-#define OP_REMOVE_ACL 0x03 /* remove acl's (-xX) */
-#define OP_REMOVE_BY_NUMBER 0x04 /* remove acl's (-xX) by acl entry number */
-#define OP_ADD_ACL 0x05 /* add acls entries at a given position */
-
-/* TAILQ entry for acl operations */
-struct sf_entry {
- uint op;
- acl_t acl;
- uint entry_number;
- TAILQ_ENTRY(sf_entry) next;
-};
-TAILQ_HEAD(, sf_entry) entrylist;
-
-/* TAILQ entry for files */
-struct sf_file {
- const char *filename;
- TAILQ_ENTRY(sf_file) next;
-};
-TAILQ_HEAD(, sf_file) filelist;
-
/* files.c */
acl_t get_acl_from_file(const char *filename);
/* merge.c */
@@ -75,9 +51,9 @@
const char *brand_name(int brand);
int branding_mismatch(int brand1, int brand2);
-uint have_mask;
-uint need_mask;
-uint have_stdin;
-uint n_flag;
+extern uint have_mask;
+extern uint need_mask;
+extern uint have_stdin;
+extern uint n_flag;
#endif /* _SETFACL_H */
More information about the Midnightbsd-cvs
mailing list