2010-03-26 13:28:14

by andronicus.spiros

[permalink] [raw]
Subject: [refpolicy] [PATCH] adding fixfiles support for the Lustre filesystem

The Lustre filesystem support extended xattr and
currenty it is necessary to extend fixfiles for
every xattr capable filesystem.
---
policycoreutils/scripts/fixfiles | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/policycoreutils/scripts/fixfiles
b/policycoreutils/scripts/fixfiles
index ae519fc..0d5d3d6 100755
--- a/policycoreutils/scripts/fixfiles
+++ b/policycoreutils/scripts/fixfiles
@@ -35,8 +35,8 @@ SYSLOGFLAG="-l"
LOGGER=/usr/sbin/logger
SETFILES=/sbin/setfiles
RESTORECON=/sbin/restorecon
-FILESYSTEMSRW=`mount | grep -v "context=" | egrep -v '\((|.*,)bind(,.*|)\)'
| awk '/(ext[234]| ext4dev | gfs2 | xfs | jfs | btrfs ).*\(rw/{print $3}';`
-FILESYSTEMSRO=`mount | grep -v "context=" | egrep -v '\((|.*,)bind(,.*|)\)'
| awk '/(ext[234]| ext4dev | gfs2 | xfs | jfs | btrfs ).*\(ro/{print $3}';`
+FILESYSTEMSRW=`mount | grep -v "context=" | egrep -v '\((|.*,)bind(,.*|)\)'
| awk '/(ext[234]| ext4dev | gfs2 | xfs | jfs | btrfs | lustre
).*\(rw/{print $3}';`
+FILESYSTEMSRO=`mount | grep -v "context=" | egrep -v '\((|.*,)bind(,.*|)\)'
| awk '/(ext[234]| ext4dev | gfs2 | xfs | jfs | btrfs | lustre
).*\(ro/{print $3}';`
FILESYSTEMS="$FILESYSTEMSRW $FILESYSTEMSRO"
SELINUXTYPE="targeted"
if [ -e /etc/selinux/config ]; then
@@ -88,7 +88,7 @@ if [ -f ${PREFC} -a -x /usr/bin/diff ]; then
fi; \
done | \
while read pattern ; do sh -c "find $pattern \
- ! \( -fstype ext2 -o -fstype ext3 -o -fstype ext4 -o
-fstype ext4dev -o -fstype gfs2 -o -fstype jfs -o -fstype xfs -o -fstype
btrfs \) -prune -o \
+ ! \( -fstype ext2 -o -fstype ext3 -o -fstype ext4 -o
-fstype ext4dev -o -fstype gfs2 -o -fstype jfs -o -fstype xfs -o -fstype
btrfs -o fstype lustre \) -prune -o \
\( -wholename /home -o -wholename /root -o -wholename
/tmp -wholename /dev \) -prune -o -print0"; \
done 2> /dev/null | \
${RESTORECON} $* -0 -f -
@@ -128,7 +128,7 @@ fi
if [ ! -z "$FILEPATH" ]; then
if [ -x /usr/bin/find ]; then
/usr/bin/find "$FILEPATH" \
- ! \( -fstype ext2 -o -fstype ext3 -o -fstype ext4 -o -fstype
ext4dev -o -fstype gfs2 -o -fstype jfs -o -fstype xfs -o -fstype btrfs \)
-prune -o -print0 | \
+ ! \( -fstype ext2 -o -fstype ext3 -o -fstype ext4 -o -fstype
ext4dev -o -fstype gfs2 -o -fstype jfs -o -fstype xfs -o -fstype btrfs -o
-fstype lustre \) -prune -o -print0 | \
${RESTORECON} ${FORCEFLAG} $* -0 -f - 2>&1 >> $LOGFILE
else
${RESTORECON} ${FORCEFLAG} -R $* $FILEPATH 2>&1 >> $LOGFILE
--
1.6.6
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.tresys.com/pipermail/refpolicy/attachments/20100326/26a4a550/attachment.html


2010-03-26 13:36:47

by Daniel Walsh

[permalink] [raw]
Subject: [refpolicy] [PATCH] adding fixfiles support for the Lustre filesystem

On 03/26/2010 09:28 AM, Elia Pinto wrote:
>
> The Lustre filesystem support extended xattr and
> currenty it is necessary to extend fixfiles for
> every xattr capable filesystem.
> ---
> policycoreutils/scripts/fixfiles | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/policycoreutils/scripts/fixfiles
> b/policycoreutils/scripts/fixfiles
> index ae519fc..0d5d3d6 100755
> --- a/policycoreutils/scripts/fixfiles
> +++ b/policycoreutils/scripts/fixfiles
> @@ -35,8 +35,8 @@ SYSLOGFLAG="-l"
> LOGGER=/usr/sbin/logger
> SETFILES=/sbin/setfiles
> RESTORECON=/sbin/restorecon
> -FILESYSTEMSRW=`mount | grep -v "context=" | egrep -v
> '\((|.*,)bind(,.*|)\)' | awk '/(ext[234]| ext4dev | gfs2 | xfs | jfs |
> btrfs ).*\(rw/{print $3}';`
> -FILESYSTEMSRO=`mount | grep -v "context=" | egrep -v
> '\((|.*,)bind(,.*|)\)' | awk '/(ext[234]| ext4dev | gfs2 | xfs | jfs |
> btrfs ).*\(ro/{print $3}';`
> +FILESYSTEMSRW=`mount | grep -v "context=" | egrep -v
> '\((|.*,)bind(,.*|)\)' | awk '/(ext[234]| ext4dev | gfs2 | xfs | jfs |
> btrfs | lustre ).*\(rw/{print $3}';`
> +FILESYSTEMSRO=`mount | grep -v "context=" | egrep -v
> '\((|.*,)bind(,.*|)\)' | awk '/(ext[234]| ext4dev | gfs2 | xfs | jfs |
> btrfs | lustre ).*\(ro/{print $3}';`
> FILESYSTEMS="$FILESYSTEMSRW $FILESYSTEMSRO"
> SELINUXTYPE="targeted"
> if [ -e /etc/selinux/config ]; then
> @@ -88,7 +88,7 @@ if [ -f ${PREFC} -a -x /usr/bin/diff ]; then
> fi; \
> done | \
> while read pattern ; do sh -c "find $pattern \
> - ! \( -fstype ext2 -o -fstype ext3 -o -fstype
> ext4 -o -fstype ext4dev -o -fstype gfs2 -o -fstype jfs -o -fstype xfs
> -o -fstype btrfs \) -prune -o \
> + ! \( -fstype ext2 -o -fstype ext3 -o -fstype
> ext4 -o -fstype ext4dev -o -fstype gfs2 -o -fstype jfs -o -fstype xfs
> -o -fstype btrfs -o fstype lustre \) -prune -o \
> \( -wholename /home -o -wholename /root -o
> -wholename /tmp -wholename /dev \) -prune -o -print0"; \
> done 2> /dev/null | \
> ${RESTORECON} $* -0 -f -
> @@ -128,7 +128,7 @@ fi
> if [ ! -z "$FILEPATH" ]; then
> if [ -x /usr/bin/find ]; then
> /usr/bin/find "$FILEPATH" \
> - ! \( -fstype ext2 -o -fstype ext3 -o -fstype ext4 -o
> -fstype ext4dev -o -fstype gfs2 -o -fstype jfs -o -fstype xfs -o
> -fstype btrfs \) -prune -o -print0 | \
> + ! \( -fstype ext2 -o -fstype ext3 -o -fstype ext4 -o
> -fstype ext4dev -o -fstype gfs2 -o -fstype jfs -o -fstype xfs -o
> -fstype btrfs -o -fstype lustre \) -prune -o -print0 | \
> ${RESTORECON} ${FORCEFLAG} $* -0 -f - 2>&1 >> $LOGFILE
> else
> ${RESTORECON} ${FORCEFLAG} -R $* $FILEPATH 2>&1 >> $LOGFILE
> --
> 1.6.6
>
>
>
> _______________________________________________
> refpolicy mailing list
> refpolicy at oss.tresys.com
> http://oss.tresys.com/mailman/listinfo/refpolicy
>
The latest fixfiles patches remove the need to list file systems that
support labels. If they ever get upstreamed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.tresys.com/pipermail/refpolicy/attachments/20100326/72f58fad/attachment.html