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