> -               # If we're still here, setcaps failed.
> +               # If we're still here, setcaps failed or filecaps are 
> disabled.
> +               if [[ -n ${owner} || -n ${group} ]]; then
> +                       debug-print "${FUNCNAME}: setting owner on '${file}'"
> +                       chown "${owner}:${group}" "${file}" || die
> +               fi

if owner is a number but no group, chown will fail w/ "chown: invalid
spec: '2000:'", how about:

local spec=${owner}
[[ -n ${group} ]] && spec+=":${group}"

chown "${spec}" "${file}" || die

>                 if [[ -n ${mode} ]]; then
> -                       if [[ -n ${owner} || -n ${group} ]]; then
> -                               debug-print "${FUNCNAME}: setting owner on 
> '${file}'"
> -                               chown "${owner}:${group}" "${file}" || die
> -                       fi
>                         debug-print "${FUNCNAME}: setting mode on '${file}'"
>                         chmod ${mode} "${file}" || die
>                 fi
> --
> 2.52.0
>
>


-- 
Z. Liu

Reply via email to