From owner-p4-projects@FreeBSD.ORG Tue Jan 18 14:48:15 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2953916A4D0; Tue, 18 Jan 2005 14:48:15 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D1B8C16A4CE for ; Tue, 18 Jan 2005 14:48:14 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B52BB43D46 for ; Tue, 18 Jan 2005 14:48:14 +0000 (GMT) (envelope-from areisse@nailabs.com) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j0IEmEjW054770 for ; Tue, 18 Jan 2005 14:48:14 GMT (envelope-from areisse@nailabs.com) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j0IEmEA5054767 for perforce@freebsd.org; Tue, 18 Jan 2005 14:48:14 GMT (envelope-from areisse@nailabs.com) Date: Tue, 18 Jan 2005 14:48:14 GMT Message-Id: <200501181448.j0IEmEA5054767@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to areisse@nailabs.com using -f From: Andrew Reisse To: Perforce Change Reviews Subject: PERFORCE change 69211 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2005 14:48:15 -0000 http://perforce.freebsd.org/chv.cgi?CH=69211 Change 69211 by areisse@areisse_tislabs on 2005/01/18 14:47:49 Add the getfilecon/setfilecon interfaces to libsebsd, to provide compatability with libselinux. Affected files ... .. //depot/projects/trustedbsd/sebsd/lib/libsebsd/Makefile#5 edit .. //depot/projects/trustedbsd/sebsd/lib/libsebsd/filecon.c#1 add .. //depot/projects/trustedbsd/sebsd/lib/libsebsd/sebsd.h#5 edit Differences ... ==== //depot/projects/trustedbsd/sebsd/lib/libsebsd/Makefile#5 (text+ko) ==== @@ -6,6 +6,7 @@ MAINTAINER= cboss@nai.com LIB= sebsd +LINKS= selinux CFLAGS+= -I${.CURDIR}/../../sys/security/sebsd CFLAGS+=-I${.CURDIR}/../../sys LDADD+= -L${.OBJDIR}/../libpam/libpam ${MINUSLPAM} @@ -15,7 +16,7 @@ SRCS= system.c security_get_user_contexts.c get_ordered_context_list.c \ getseccontext.c query_user_context.c security_change_context.c \ string_to_security_class.c security_compute_av.c context.c \ - get_default_type.c + get_default_type.c filecon.c INCS= sebsd_context.h sebsd_ss.h sebsd_proc.h sebsd_fs.h sebsd.h \ sebsd_syscalls.h flask_types.h ==== //depot/projects/trustedbsd/sebsd/lib/libsebsd/sebsd.h#5 (text+ko) ==== @@ -71,6 +71,16 @@ struct security_response *response); +/* Get file context, and set *con to refer to it. + Caller must free via freecon. */ +int getfilecon(const char *path, security_context_t *con); +int lgetfilecon(const char *path, security_context_t *con); +int fgetfilecon(int fd, security_context_t *con); + +/* Set file context */ +int setfilecon(const char *path, security_context_t con); +int lsetfilecon(const char *path, security_context_t con); +int fsetfilecon(int fd, security_context_t con); /* * Get the default type (domain) for 'role' and set 'type' to refer to it.