Skip to contentSkip to conversation

policycoreutils -- Only run setfiles if we found read-write filesystems to run it on

PATCH In review Laurent Bigonville 2 participants 4 messages Mar 26, 2012 – Mar 27, 2012 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 policycoreutils -- Only run setfiles if we found read-write filesystems to run it on

Hi,

Only run setfiles if we have a R/W filesystem

Laurent

From: Manoj Srivastava <[email protected]>
Date: Thu, 5 Jun 2008 22:07:22 -0500
Subject: Only run setfiles if we found read-write filesystems to run it on

---
 scripts/fixfiles |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
policycoreutils/scripts/fixfiles +6 -1
index 310fccf..0db4558 100755
@@ -234,7 +234,12 @@ then
 	done
 FC=$TEMPFCFILE
 fi
-${SETFILES} -q ${SYSLOGFLAG} ${FORCEFLAG} $* ${FC} ${FILESYSTEMSRW} 2>&1 | cat >> $LOGFILE
+if [  -n "${FILESYSTEMSRW}" ]; then
+    echo "Relabeling `echo ${FILESYSTEMSRW}`"
+    ${SETFILES} -q ${SYSLOGFLAG} ${FORCEFLAG} $* ${FC} ${FILESYSTEMSRW} 2>&1 | cat >> $LOGFILE
+else
+    echo >&2 "fixfiles: No suitable file systems found"
+fi
 rm -rf /tmp/gconfd-* /tmp/pulse-* /tmp/orbit-* $TEMPFCFILE
 
 UNDEFINED=`get_undefined_type` || exit $?

--
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.

#1 lore raw
Quoted 33 lines · Laurent Bigonville

Hi,

Only run setfiles if we have a R/W filesystem

Laurent

From: Manoj Srivastava <[email protected]>
Date: Thu, 5 Jun 2008 22:07:22 -0500
Subject: Only run setfiles if we found read-write filesystems to run it on

---
 scripts/fixfiles |    7 ++++++-

 1 files changed, 6 insertions(+), 1 deletions(-)
policycoreutils/scripts/fixfiles +0 -0
index 310fccf..0db4558 100755
@@ -234,7 +234,12 @@ then

       done
 FC=$TEMPFCFILE
 fi
-${SETFILES} -q ${SYSLOGFLAG} ${FORCEFLAG} $* ${FC} ${FILESYSTEMSRW} 2>&1 | cat >> $LOGFILE

policycoreutils/scripts/fixfiles +6 -0
+if [  -n "${FILESYSTEMSRW}" ]; then
+    echo "Relabeling `echo ${FILESYSTEMSRW}`"
+    ${SETFILES} -q ${SYSLOGFLAG} ${FORCEFLAG} $* ${FC} ${FILESYSTEMSRW} 2>&1 | cat >> $LOGFILE
+else
+    echo >&2 "fixfiles: No suitable file systems found"
+fi

 rm -rf /tmp/gconfd-* /tmp/pulse-* /tmp/orbit-* $TEMPFCFILE

Quoted 1 line

 UNDEFINED=get_undefined_type || exit $?

This patch doesn't apply. I don't see a "SYSLOGFLAG" in the upstream tree. Is that something debian specific?

--
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.

#2 lore raw
Quoted 2 lines · Eric Paris

This patch doesn't apply. I don't see a "SYSLOGFLAG" in the upstream tree. Is that something debian specific?

This is weird, it applies fine here on git master HEAD

[git: master]$ git grep SYSLOGFLAG
scripts/fixfiles:SYSLOGFLAG="-l"
scripts/fixfiles:${SETFILES} -q ${SYSLOGFLAG} ${FORCEFLAG} $* ${FC} ${FILESYSTEMSRW} 2>&1 | cat >> $LOGFILE

Cheers

Laurent Bigonville

--
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.

#3 lore raw
Quoted 11 lines · Laurent Bigonville
Quoted 2 lines · Eric Paris

This patch doesn't apply.  I don't see a "SYSLOGFLAG" in the upstream tree.  Is that something debian specific?

This is weird, it applies fine here on git master HEAD

[git: master]$ git grep SYSLOGFLAG
scripts/fixfiles:SYSLOGFLAG="-l"
scripts/fixfiles:${SETFILES} -q ${SYSLOGFLAG} ${FORCEFLAG} $* ${FC} ${FILESYSTEMSRW} 2>&1 | cat >> $LOGFILE

You are absolutely right. It is a Fedora-ism that removes SYSLOGFLAG.
My fault.

--
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.