X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=nfs%2Fnfsacl.c;h=4561589d1ca9e9f1a8fb616be8f8b131d3c8f35e;hb=fa3c25beeeb4c533089a2af8454ef50e21e7b8f5;hp=e48db02fc7f601edf4371347c02026a6a1461cf1;hpb=370ae18137f7db4234538f3a9f1c7dc22b9ded1d;p=deb_libnfs.git diff --git a/nfs/nfsacl.c b/nfs/nfsacl.c index e48db02..4561589 100644 --- a/nfs/nfsacl.c +++ b/nfs/nfsacl.c @@ -80,3 +80,28 @@ int rpc_nfsacl_getacl_async(struct rpc_context *rpc, rpc_cb cb, struct nfs_fh3 * return 0; } + +int rpc_nfsacl_setacl_async(struct rpc_context *rpc, rpc_cb cb, struct SETACL3args *args, void *private_data) +{ + struct rpc_pdu *pdu; + + pdu = rpc_allocate_pdu(rpc, NFSACL_PROGRAM, NFSACL_V3, NFSACL3_SETACL, cb, private_data, (xdrproc_t)xdr_SETACL3res, sizeof(SETACL3res)); + if (pdu == NULL) { + rpc_set_error(rpc, "Out of memory. Failed to allocate pdu for nfsacl/setacl call"); + return -1; + } + + if (xdr_SETACL3args(&pdu->xdr, args) == 0) { + rpc_set_error(rpc, "XDR error: Failed to encode SETACL3args"); + rpc_free_pdu(rpc, pdu); + return -2; + } + + if (rpc_queue_pdu(rpc, pdu) != 0) { + rpc_set_error(rpc, "Out of memory. Failed to queue pdu for nfsacl/setacl call"); + rpc_free_pdu(rpc, pdu); + return -2; + } + + return 0; +}