Skip to contentSkip to conversation

policycoreutils: share setfiles restore function with restorecond

PATCH In review Thomas Liu 1 participant 2 messages Aug 19, 2009 SELinux security module

lore
Share & tools
lore

Thomas Liu

author
#0 lore raw

PATCH 1/2 policycoreutils: share setfiles restore function with restorecond

This is the first of two patches.

This patch splits all of the restore functionality in setfiles into another two files, restore.c and restore.h.

The reason for this is shown in the next patch, which patches restorecond to share this code.

To use it, instantiate a restore_opts struct with the proper options and then pass a pointer to it into restore_init, and call restore_destroy later.

---
I've CC'd my other email address, [email protected] here because I will be returning to school soon and my red hat accounts will be disabled at the end of this week.

 policycoreutils/setfiles/Makefile   |    4 
 policycoreutils/setfiles/restore.c  |  531 ++++++++++++++++++++++++++++
 policycoreutils/setfiles/restore.h  |   50 +++
 policycoreutils/setfiles/setfiles.c |  672 ++++-------------------------------
 4 files changed, 661 insertions(+), 596 deletions(-)
 create mode 100644 policycoreutils/setfiles/restore.c
 create mode 100644 policycoreutils/setfiles/restore.h
policycoreutils/setfiles/Makefile +2 -2
index 8600f58..26a965f 100644
@@ -5,7 +5,7 @@ MANDIR = $(PREFIX)/share/man
 LIBDIR ?= $(PREFIX)/lib
 AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null)
 
-CFLAGS = -Werror -Wall -W
+CFLAGS = -g -Werror -Wall -W
 override CFLAGS += -I$(PREFIX)/include
 LDLIBS = -lselinux -lsepol -L$(LIBDIR)
 
@@ -16,7 +16,7 @@ endif
 
 all: setfiles restorecon
 
-setfiles:  setfiles.o 
+setfiles:  setfiles.o restore.o
 
 restorecon: setfiles
 	ln -sf setfiles restorecon
policycoreutils/setfiles/restore.c new file +531 -0

531 lines not on this page · raw message

policycoreutils/setfiles/restore.h new file +50 -0

50 lines not on this page · raw message

policycoreutils/setfiles/setfiles.c +78 -594

851 lines not on this page · raw message

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

author
#1 lore raw

Sorry about the duplicate email -- I'd just like to confirm that there is no difference. ----- Original Message -----
From: "Thomas Liu" <[email protected]>
To: [email protected]
Cc: [email protected]
Sent: Wednesday, August 19, 2009 3:51:44 PM GMT -05:00 US/Canada Eastern
Subject: [PATCH 1/2] policycoreutils: share setfiles restore function with restorecond

This is the first of two patches.

This patch splits all of the restore functionality in setfiles into another two files, restore.c and restore.h.

The reason for this is shown in the next patch, which patches restorecond to share this code.

To use it, instantiate a restore_opts struct with the proper options and then pass a pointer to it into restore_init, and call restore_destroy later.

---
I've CC'd my other email address, [email protected] here because I will be returning to school soon and my red hat accounts will be disabled at the end of this week.

 policycoreutils/setfiles/Makefile   |    4 
 policycoreutils/setfiles/restore.c  |  531 ++++++++++++++++++++++++++++
 policycoreutils/setfiles/restore.h  |   50 +++
 policycoreutils/setfiles/setfiles.c |  672 ++++-------------------------------
 4 files changed, 661 insertions(+), 596 deletions(-)
 create mode 100644 policycoreutils/setfiles/restore.c
 create mode 100644 policycoreutils/setfiles/restore.h
policycoreutils/setfiles/Makefile +2 -2
index 8600f58..26a965f 100644
@@ -5,7 +5,7 @@ MANDIR = $(PREFIX)/share/man
 LIBDIR ?= $(PREFIX)/lib
 AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null)
 
-CFLAGS = -Werror -Wall -W
+CFLAGS = -g -Werror -Wall -W
 override CFLAGS += -I$(PREFIX)/include
 LDLIBS = -lselinux -lsepol -L$(LIBDIR)
 
@@ -16,7 +16,7 @@ endif
 
 all: setfiles restorecon
 
-setfiles:  setfiles.o 
+setfiles:  setfiles.o restore.o
 
 restorecon: setfiles
 	ln -sf setfiles restorecon
policycoreutils/setfiles/restore.c new file +531 -0

531 lines not on this page · raw message

policycoreutils/setfiles/restore.h new file +50 -0

50 lines not on this page · raw message

policycoreutils/setfiles/setfiles.c +78 -594

851 lines not on this page · raw message

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.