Remove ": No smack property found" from smack_label.txt 41/159541/2
authorKonrad Kuchciak <k.kuchciak@samsung.com>
Thu, 9 Nov 2017 12:53:15 +0000 (13:53 +0100)
committerMyoungJune Park <mj2004.park@samsung.com>
Mon, 27 Nov 2017 22:44:57 +0000 (07:44 +0900)
List of smack labels is generated by chsmack and the output is stored in
smack_label.txt. When ex. /opt/etc/shadow doesn't have any smack labels
during image creation chsmack produces output like:

opt/etc/shadow: No smack property found

, which is then interpreted by rstsmack as one long filename. And
instead of setting default smack label "_" to the file it does nothing.
Finally, after the factory reset, the file has "System::Privileged"
label which was set during unzipping opt and it causes the whole User
session to fail at system startup.

This is a workaround patch.

Change-Id: I67c3884cdbaec912a08d8979488681931b1e2513
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
script/build-backup-data.sh

index bb8d58ef12275069e4dcb66a120881437df8f7bf..da67765baf721ebf6f6fadefa0e482e9ad0c17e9 100755 (executable)
@@ -62,6 +62,9 @@ create_archive() {
                bash -c "find $i $xpath -exec /usr/bin/chsmack {} \; >> $rdir/smack_label.txt"
        done
 
+       # workaround for the files with empty smack properies
+       sed -i -e "s/: No smack property found//g" $rdir/smack_label.txt
+
        chmod go-rwx $rdir/* $rdir $rdir/..
 }