Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Sep 2008 14:51:52 GMT
From:      Ed Schouten <ed@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 149319 for review
Message-ID:  <200809061451.m86EpqeF057437@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=149319

Change 149319 by ed@ed_flippo on 2008/09/06 14:50:58

	IFC my TIOCCONS changes.

Affected files ...

.. //depot/projects/mpsafetty/bin/setfacl/setfacl.c#2 integrate
.. //depot/projects/mpsafetty/release/Makefile.inc.docports#2 integrate
.. //depot/projects/mpsafetty/share/misc/committers-ports.dot#4 integrate
.. //depot/projects/mpsafetty/sys/kern/tty.c#38 edit

Differences ...

==== //depot/projects/mpsafetty/bin/setfacl/setfacl.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/bin/setfacl/setfacl.c,v 1.13 2007/02/26 00:42:17 mckusick Exp $");
+__FBSDID("$FreeBSD: src/bin/setfacl/setfacl.c,v 1.14 2008/09/06 13:17:35 trasz Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -245,10 +245,13 @@
 			continue;
 		}
 
-		if (acl_type == ACL_TYPE_ACCESS)
+		if (acl_type == ACL_TYPE_ACCESS) {
 			final_acl = acl[ACCESS_ACL];
-		else
+			acl_free(acl[DEFAULT_ACL]);
+		} else {
 			final_acl = acl[DEFAULT_ACL];
+			acl_free(acl[ACCESS_ACL]);
+		}
 
 		if (need_mask && (set_acl_mask(&final_acl) == -1)) {
 			warnx("failed to set ACL mask on %s", file->filename);
@@ -269,8 +272,7 @@
 			}
 		}
 
-		acl_free(acl[ACCESS_ACL]);
-		acl_free(acl[DEFAULT_ACL]);
+		acl_free(final_acl);
 		free(acl);
 	}
 

==== //depot/projects/mpsafetty/release/Makefile.inc.docports#2 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/release/Makefile.inc.docports,v 1.27 2007/04/11 15:24:58 ru Exp $
+# $FreeBSD: src/release/Makefile.inc.docports,v 1.28 2008/09/06 10:12:52 jhay Exp $
 #
 # List of (dependent) ports that are minimally required to be
 # checked out from CVS in order to get ${DOCPORTS} built and
@@ -38,8 +38,8 @@
 	ports/graphics/scr2png \
 	ports/graphics/tiff \
 	ports/print/freetype2 \
-	ports/print/ghostscript-gpl \
-	ports/print/ghostscript-gpl-nox11 \
+	ports/print/ghostscript8 \
+	ports/print/ghostscript8-nox11 \
 	ports/print/gsfonts \
 	ports/textproc/docbook-410 \
 	ports/textproc/docbook-xml \

==== //depot/projects/mpsafetty/share/misc/committers-ports.dot#4 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/share/misc/committers-ports.dot,v 1.73 2008/07/30 01:05:13 rnoland Exp $
+# $FreeBSD: src/share/misc/committers-ports.dot,v 1.74 2008/09/06 14:10:31 jpaetzel Exp $
 
 # This file is meant to list all FreeBSD ports committers and describe the
 # mentor-mentee relationships between them.
@@ -88,6 +88,7 @@
 joerg [label="Joerg Wunsch\njoerg@FreeBSD.org\n1994/08/22"]
 johans [label="Johan Selst\njohans@FreeBSD.org\n2006/04/01"]
 josef [label="Josef El-Rayes\njosef@FreeBSD.org\n2004/12/20"]
+jpaetzel [label="Josh Paetzel\njpaetzel@FreeBSD.org\n2008/09/05"]
 jylefort [label="Jean-Yves Lefort\njylefort@FreeBSD.org\n2005/04/12"]
 kevlo [label="Kevin Lo\nkevlo@FreeBSD.org\n2003/02/21"]
 knu [label="Akinori Musha\nknu@FreeBSD.org\n2000/03/22"]
@@ -157,6 +158,8 @@
 adamw -> mezz
 adamw -> pav
 
+ade -> jpaetzel
+
 ahze -> shaun
 ahze -> tmclaugh
 

==== //depot/projects/mpsafetty/sys/kern/tty.c#38 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/tty.c,v 1.287 2008/09/04 16:39:02 ed Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/tty.c,v 1.288 2008/09/06 14:43:32 ed Exp $");
 
 #include "opt_compat.h"
 
@@ -45,7 +45,6 @@
 #include <sys/limits.h>
 #include <sys/malloc.h>
 #include <sys/mount.h>
-#include <sys/namei.h>
 #include <sys/poll.h>
 #include <sys/priv.h>
 #include <sys/proc.h>
@@ -1514,46 +1513,21 @@
 	case TIOCCONS:
 		/* Set terminal as console TTY. */
 		if (*(int *)data) {
-			struct nameidata nd;
-			int vfslocked;
+			error = priv_check(td, PRIV_TTY_CONSOLE);
+			if (error)
+				return (error);
 
 			/*
-			 * XXX: TTY won't slip away, but constty would
-			 * really need to be locked!
+			 * XXX: constty should really need to be locked!
+			 * XXX: allow disconnected constty's to be stolen!
 			 */
-			tty_unlock(tp);
 
-			if (constty == tp) {
-				tty_lock(tp);
+			if (constty == tp)
 				return (0);
-			}
-			if (constty != NULL) {
-				tty_lock(tp);
+			if (constty != NULL)
 				return (EBUSY);
-			}
-			/* XXX: allow disconnected constty's to be stolen! */
 
-			/*
-			 * Only allow this to work when the user can
-			 * open /dev/console.
-			 */
-			NDINIT(&nd, LOOKUP, FOLLOW|LOCKLEAF|MPSAFE,
-			    UIO_SYSSPACE, "/dev/console", td);
-			if ((error = namei(&nd)) != 0) {
-				tty_lock(tp);
-				return (error);
-			}
-			vfslocked = NDHASGIANT(&nd);
-			NDFREE(&nd, NDF_ONLY_PNBUF);
-
-			error = VOP_ACCESS(nd.ni_vp, VREAD, td->td_ucred, td);
-			vput(nd.ni_vp);
-			VFS_UNLOCK_GIANT(vfslocked);
-			if (error) {
-				tty_lock(tp);
-				return (error);
-			}
-
+			tty_unlock(tp);
 			constty_set(tp);
 			tty_lock(tp);
 		} else if (constty == tp) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200809061451.m86EpqeF057437>