nfs4_getfacl error code when directory is not managed by nfs4 acl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I am trying to add a small test in a script to check if a directory is
managed by nfs4_setfacl or not. The system I work with use sometimes
nfs4_setfacl and sometimes setfacl. I wanted to try a quiet
`nfs4_getfacl .` to check it. But when I do 
    > if nfs4_getfacl . >/dev/null 2>&1; then echo "yep nfs4"; else
echo "no"; fi

I obtain
    yep nfs4

Without the 2>&1, I have
    > if nfs4_getfacl . >/dev/null; then echo "yep nfs4"; else echo
"no"; fi
    Operation to request attribute not supported: .
    yep nfs4

When I try to grep it, it does not work
    > nfs4_getfacl . >/dev/null | grep -q "not supported"
    Operation to request attribute not supported: .

The return code is always zero
    > nfs4_getfacl . ; echo $?
    Operation to request attribute not supported: .
    0

I want it to be quiet to avoid showing something in the terminal. I am
doing a script to easily set ACLs for none bash power user and I do not
want to scare them with error message.

Am I missing something about the return code? Would it be possible to
add a --test or --check option to test if nfs4-acl are actually used in
the directory?

I can do test if you want. Do you know which repo has the latest source
code if I want to try something myself?

Best regards,
Alan
-- 
Alan Burlot, PhD
CEA Paris-Saclay
/CEA/DES/ISAS/DM2S/STMF/LDEL




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux