Read SMACK capability only once
authorKichan Kwon <k_c.kwon@samsung.com>
Thu, 2 Jul 2020 03:35:36 +0000 (12:35 +0900)
committerKichan Kwon <k_c.kwon@samsung.com>
Thu, 2 Jul 2020 03:59:35 +0000 (12:59 +0900)
- chsmack_attr tries to read all capabilities
  though some capabilities aren't SMACK attribute
- security.capability is raw binary having NULL byte,
  so attr prints warning message
  - warning: command substitution: ignored null byte in input
- It doesn't cause the problem on making delta,
  but chsmack_attr will read only SMACK capability
  to remove meaningless message

Change-Id: Ibb06ad73cfe4d04c26d84e6669f5bdfc1559ec43
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
mk_delta/common/bin/extended_attr.sh

index a1747fd..709bcd2 100755 (executable)
@@ -15,8 +15,6 @@ chsmack_attr() {
        CHSMACK_STR="${TARGET}"
        for attrname in ${ATTRS}
        do
-               value=`attr -Sq -g ${attrname} "${TARGET}"`
-
                case "${attrname}" in
                SMACK64)
                        chsmack_attrname="access"
@@ -35,6 +33,7 @@ chsmack_attr() {
                ;;
                esac
 
+               value=`attr -Sq -g ${attrname} "${TARGET}"`
                CHSMACK_STR="${CHSMACK_STR} ${chsmack_attrname}=\"${value}\""
 
        done