Skip to contentSkip to conversation

policycoreutils: fixfiles: failure to create /.autorelabel is fatal

PATCH Applied Alan Jenkins 2 participants 2 messages May 12, 2018 – May 15, 2018 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 policycoreutils: fixfiles: failure to create /.autorelabel is fatal

Fix the following ambiguous output (from booting with init=/bin/sh):

    # /usr/sbin/fixfiles onboot
    /usr/sbin/fixfiles: line 313: /.autorelabel: Read-only file system
    /usr/sbin/fixfiles: line 317: /.autorelabel: Read-only file system
    System will relabel on next boot

System will not relabel on next boot if we couldn't create ./autorelabel

(In case anyone reading this description is still confused: To run fixfiles onboot after booting with init=/bin/sh, you must first run mount / -oremount,rw).

---
 policycoreutils/scripts/fixfiles | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
policycoreutils/scripts/fixfiles +1 -1
index 0eeeea46..69bd8488 100755
@@ -309,7 +309,7 @@ case "$1" in
 	    usage
 	    exit 1
 	fi
-	> /.autorelabel
+	> /.autorelabel || exit $?
 	[ -z "$FORCEFLAG" ] || echo -n "$FORCEFLAG " >> /.autorelabel
 	[ -z "$BOOTTIME" ] || echo -N $BOOTTIME >> /.autorelabel
 	# Force full relabel if / does not have a label on it
Signature · 1 line
2.17.0
#1 lore raw
Quoted 7 lines · Alan Jenkins

Fix the following ambiguous output (from booting with init=/bin/sh):

    # /usr/sbin/fixfiles onboot
    /usr/sbin/fixfiles: line 313: /.autorelabel: Read-only file system
    /usr/sbin/fixfiles: line 317: /.autorelabel: Read-only file system
    System will relabel on next boot
Quoted 5 lines

System will not relabel on next boot if we couldn't create ./autorelabel

(In case anyone reading this description is still confused: To run fixfiles onboot after booting with init=/bin/sh, you must first run mount / -oremount,rw).

Thanks, applied.

Quoted 18 lines
---
 policycoreutils/scripts/fixfiles | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
policycoreutils/scripts/fixfiles +1 -1
index 0eeeea46..69bd8488 100755
@@ -309,7 +309,7 @@ case "$1" in
 	    usage
 	    exit 1
 	fi
-	> /.autorelabel
+	> /.autorelabel || exit $?
 	[ -z "$FORCEFLAG" ] || echo -n "$FORCEFLAG " >> /.autorelabel
 	[ -z "$BOOTTIME" ] || echo -N $BOOTTIME >> /.autorelabel
 	# Force full relabel if / does not have a label on it