From Andre.Albsmeier@siemens.com  Tue Oct 25 05:40:43 2005
Return-Path: <Andre.Albsmeier@siemens.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 0538916A41F
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 25 Oct 2005 05:40:43 +0000 (GMT)
	(envelope-from Andre.Albsmeier@siemens.com)
Received: from thoth.sbs.de (thoth.sbs.de [192.35.17.2])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 55FCD43D45
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 25 Oct 2005 05:40:41 +0000 (GMT)
	(envelope-from Andre.Albsmeier@siemens.com)
Received: from mail2.siemens.de (localhost [127.0.0.1])
	by thoth.sbs.de (8.12.6/8.12.6) with ESMTP id j9P5een4011064
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 25 Oct 2005 07:40:40 +0200
Received: from ims.mchp.siemens.de (ims.mchp.siemens.de [139.25.31.39])
	by mail2.siemens.de (8.12.6/8.12.6) with ESMTP id j9P5eep0009224
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 25 Oct 2005 07:40:40 +0200
Received: from mail-ct.mchp.siemens.de (mail-ct.mchp.siemens.de [139.25.31.51])
				by ims.mchp.siemens.de  with ESMTP id j9P5edJQ013583
				for <FreeBSD-gnats-submit@freebsd.org>; Tue, 25 Oct 2005 07:40:39 +0200 (MEST)
Received: from curry.mchp.siemens.de (curry [139.25.40.130])
	by mail-ct.mchp.siemens.de (8.12.11/8.12.11) with ESMTP id j9P5ed6v028517
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 25 Oct 2005 07:40:39 +0200 (MEST)
Received: (from localhost)
	by curry.mchp.siemens.de (8.13.4/8.13.4) id j9P5ed0N080628
	for FreeBSD-gnats-submit@freebsd.org; Tue, 25 Oct 2005 07:40:39 +0200 (CEST)
Message-Id: <200510250540.j9P5ed5F033936@curry.mchp.siemens.de>
Date: Tue, 25 Oct 2005 07:40:39 +0200 (CEST)
From: Andre Albsmeier <Andre.Albsmeier@siemens.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] introduce -A flag for newfs to enable ACLs
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         87966
>Category:       bin
>Synopsis:       [patch] newfs(8): introduce -A flag for newfs to enable ACLs
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-fs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 25 05:50:18 GMT 2005
>Closed-Date:    
>Last-Modified:  Fri Sep 24 20:48:09 UTC 2010
>Originator:     Andre Albsmeier
>Release:        FreeBSD 5.4-STABLE i386
>Organization:
>Environment:

FreeBSD 5.4-STABLE #0: Mon Oct 17 17:53:08 CEST 2005

>Description:

newfs lacks an option for creating ACL enabled filesystems
(similar to the -U option for soft-updates)

>How-To-Repeat:

Try it :-)
 
>Fix:

--- ./newfs.c.ORI	Tue Mar  1 09:57:07 2005
+++ ./newfs.c	Tue Oct 25 07:31:41 2005
@@ -111,6 +111,7 @@
  */
 #define	NFPI		4
 
+int	Aflag;			/* enable ACLs for file system */
 int	Lflag;			/* add a volume label */
 int	Nflag;			/* run without writing file system */
 int	Oflag = 2;		/* file system format (1 => UFS1, 2 => UFS2) */
@@ -156,8 +157,11 @@
 	off_t mediasize;
 
 	while ((ch = getopt(argc, argv,
-	    "EL:NO:RS:T:Ua:b:c:d:e:f:g:h:i:lm:no:s:")) != -1)
+	    "AEL:NO:RS:T:Ua:b:c:d:e:f:g:h:i:lm:no:s:")) != -1)
 		switch (ch) {
+		case 'A':
+			Aflag = 1;
+			break;
 		case 'E':
 			Eflag++;
 			break;
--- ./mkfs.c.ORI	Tue Mar  1 09:57:07 2005
+++ ./mkfs.c	Tue Oct 25 07:30:47 2005
@@ -131,6 +131,8 @@
 	}
 	sblock.fs_old_flags = FS_FLAGS_UPDATED;
 	sblock.fs_flags = 0;
+	if (Aflag)
+		sblock.fs_flags |= FS_ACLS;
 	if (Uflag)
 		sblock.fs_flags |= FS_DOSOFTDEP;
 	if (Lflag)
--- ./newfs.h.ORI	Tue Mar  1 09:57:07 2005
+++ ./newfs.h	Tue Oct 25 07:31:32 2005
@@ -43,6 +43,7 @@
 /*
  * variables set up by front end.
  */
+extern int	Aflag;		/* enable ACLs for file system */
 extern int	Lflag;		/* add a volume label */
 extern int	Nflag;		/* run mkfs without writing file system */
 extern int	Oflag;		/* build UFS1 format file system */
--- ./newfs.8.ORI	Tue Mar  1 09:57:07 2005
+++ ./newfs.8	Tue Oct 25 07:33:51 2005
@@ -36,7 +36,7 @@
 .Nd construct a new UFS1/UFS2 file system
 .Sh SYNOPSIS
 .Nm
-.Op Fl NUln
+.Op Fl ANUln
 .Op Fl L Ar volname
 .Op Fl O Ar filesystem-type
 .Op Fl S Ar sector-size
@@ -77,6 +77,8 @@
 .Pp
 The following options define the general layout policies:
 .Bl -tag -width indent
+.It Fl A
+Enable ACLs on the new file system.
 .It Fl L Ar volname
 Add a volume label to the new file system.
 .It Fl N

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-fs 
Responsible-Changed-By: brucec 
Responsible-Changed-When: Fri Sep 24 20:47:47 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=87966 
>Unformatted:
