All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] semanage-functionality 9/17
@ 2005-09-27 12:48 Karl MacMillan
  2005-09-27 16:58 ` Ivan Gyurdiev
  0 siblings, 1 reply; 2+ messages in thread
From: Karl MacMillan @ 2005-09-27 12:48 UTC (permalink / raw)
  To: selinux; +Cc: 'Joshua Brindle'

[-- Attachment #1: Type: text/plain, Size: 213 bytes --]

This patch adds the private portion of semanage.h for use by implementations
of the public api. In particular it adds the semanage_handle_t struct.

------
Karl MacMillan
Tresys Technology
http://www.tresys.com 


[-- Attachment #2: libsemanage_src_include_semanage_private.h.diff --]
[-- Type: application/octet-stream, Size: 3712 bytes --]

diff -purN -x .svn libsemanage/src/include/semanage_private.h libsemanage/src/include/semanage_private.h
--- libsemanage/src/include/semanage_private.h	1969-12-31 19:00:00.000000000 -0500
+++ libsemanage/src/include/semanage_private.h	2005-09-26 11:36:19.000000000 -0400
@@ -0,0 +1,119 @@
+/* Author: Joshua Brindle <jbrindle@tresys.com>
+ *	   Jason Tang	  <jtang@tresys.com>
+ *
+ * Copyright (C) 2005 Tresys Technology, LLC
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef SEMANAGE_PRIVATE_H
+#define SEMANAGE_PRIVATE_H
+
+#include <semanage/semanage.h>
+
+#include "semanage_conf.h"
+#include "dso.h"
+
+#include <stdlib.h>
+#include <sys/time.h> 
+
+struct semanage_module_conn {
+	int translock_file_fd;
+	int readlock_file_fd;
+};
+
+struct semanage_func_table {
+	void (*destroy)(semanage_handle_t *);
+	int (*disconnect)(semanage_handle_t *);
+	int (*begin_trans)(semanage_handle_t *); 
+	int (*commit)(semanage_handle_t *);
+	int (*install)(semanage_handle_t *, char *, size_t);
+	int (*upgrade)(semanage_handle_t *, char *, size_t);
+	int (*install_base)(semanage_handle_t *, char *, size_t);
+	int (*remove)(semanage_handle_t *, char *);
+	int (*list)(semanage_handle_t *, semanage_module_info_t **, int *);
+};
+
+#define SEMANAGE_ERRBUFSZ 1024
+
+struct semanage_handle {
+	int con_id;		/* Connection ID */
+	int policy_serial;	/* Policy serial number at connect time */
+	char err_buf[SEMANAGE_ERRBUFSZ];
+
+	/* one of these connections will actually be used while
+	 * working with the module store -- the particular one is
+	 * given by conf->store_type */
+	semanage_conf_t *conf;
+	union {
+		struct semanage_module_conn module;
+	} conn;
+	int is_connected;
+	int is_in_transaction;
+
+	/* these function pointers will point to the appropriate
+	 * routine given the connection type.  think of these as
+	 * simulating polymorphism for non-OO languages. */
+	struct semanage_func_table *funcs;
+
+	/* This timeout is used for transactions and waiting for locks 
+	   -1 means wait indefinetely
+	    0 means return immediately 
+	   >0 means wait that many seconds */
+	int timeout;
+};
+
+struct semanage_module_info {
+	char *name;		/* Key */
+	char *version;
+};
+
+struct semanage_role {
+	char *name;		/* Key */
+};
+
+struct semanage_mls {
+	char *level;
+	char *range;
+};
+
+struct semanage_user {
+	char *name;		/* Key */
+	struct semanage_role **roles;
+	int num_roles;
+	struct semanage_mls *mls;
+};
+
+struct semanage_homedir {
+	char *user;
+	char *path;		/* Key */
+};
+
+struct semanage_boolean {
+	char *name;		/* Key */
+	char default_state;
+};
+
+semanage_handle_t *semanage_handle_create(void);
+
+#ifdef __GNUC__
+__attribute__ ((format (printf, 2, 3)))
+#endif
+void semanage_write_error(semanage_handle_t *sh, char *fmt, ...);
+
+hidden_proto(semanage_handle_create)
+hidden_proto(semanage_write_error)
+
+#endif

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-09-27 16:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-27 12:48 [PATCH] semanage-functionality 9/17 Karl MacMillan
2005-09-27 16:58 ` Ivan Gyurdiev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.