nfs2acl.c (8be98d2f2a0a262f8bf8a0bc1fdf522b3c7aab17) nfs2acl.c (16c663642c7ec03cd4cee5fec520bb69e97babe4)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Process version 2 NFSACL requests.
4 *
5 * Copyright (C) 2002-2003 Andreas Gruenbacher <agruen@suse.de>
6 */
7
8#include "nfsd.h"

--- 174 unchanged lines hidden (view full) ---

183out:
184 return rpc_success;
185}
186
187/*
188 * XDR decode functions
189 */
190
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Process version 2 NFSACL requests.
4 *
5 * Copyright (C) 2002-2003 Andreas Gruenbacher <agruen@suse.de>
6 */
7
8#include "nfsd.h"

--- 174 unchanged lines hidden (view full) ---

183out:
184 return rpc_success;
185}
186
187/*
188 * XDR decode functions
189 */
190
191static int nfsaclsvc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p)
191static int
192nfsaclsvc_decode_getaclargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
192{
193{
193 struct xdr_stream *xdr = &rqstp->rq_arg_stream;
194 struct nfsd3_getaclargs *argp = rqstp->rq_argp;
195
196 if (!svcxdr_decode_fhandle(xdr, &argp->fh))
197 return 0;
198 if (xdr_stream_decode_u32(xdr, &argp->mask) < 0)
199 return 0;
200
201 return 1;
202}
203
194 struct nfsd3_getaclargs *argp = rqstp->rq_argp;
195
196 if (!svcxdr_decode_fhandle(xdr, &argp->fh))
197 return 0;
198 if (xdr_stream_decode_u32(xdr, &argp->mask) < 0)
199 return 0;
200
201 return 1;
202}
203
204static int nfsaclsvc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p)
204static int
205nfsaclsvc_decode_setaclargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
205{
206{
206 struct xdr_stream *xdr = &rqstp->rq_arg_stream;
207 struct nfsd3_setaclargs *argp = rqstp->rq_argp;
208
209 if (!svcxdr_decode_fhandle(xdr, &argp->fh))
210 return 0;
211 if (xdr_stream_decode_u32(xdr, &argp->mask) < 0)
212 return 0;
213 if (argp->mask & ~NFS_ACL_MASK)
214 return 0;
215 if (!nfs_stream_decode_acl(xdr, NULL, (argp->mask & NFS_ACL) ?
216 &argp->acl_access : NULL))
217 return 0;
218 if (!nfs_stream_decode_acl(xdr, NULL, (argp->mask & NFS_DFACL) ?
219 &argp->acl_default : NULL))
220 return 0;
221
222 return 1;
223}
224
207 struct nfsd3_setaclargs *argp = rqstp->rq_argp;
208
209 if (!svcxdr_decode_fhandle(xdr, &argp->fh))
210 return 0;
211 if (xdr_stream_decode_u32(xdr, &argp->mask) < 0)
212 return 0;
213 if (argp->mask & ~NFS_ACL_MASK)
214 return 0;
215 if (!nfs_stream_decode_acl(xdr, NULL, (argp->mask & NFS_ACL) ?
216 &argp->acl_access : NULL))
217 return 0;
218 if (!nfs_stream_decode_acl(xdr, NULL, (argp->mask & NFS_DFACL) ?
219 &argp->acl_default : NULL))
220 return 0;
221
222 return 1;
223}
224
225static int nfsaclsvc_decode_accessargs(struct svc_rqst *rqstp, __be32 *p)
225static int
226nfsaclsvc_decode_accessargs(struct svc_rqst *rqstp, struct xdr_stream *xdr)
226{
227{
227 struct xdr_stream *xdr = &rqstp->rq_arg_stream;
228 struct nfsd3_accessargs *args = rqstp->rq_argp;
229
230 if (!svcxdr_decode_fhandle(xdr, &args->fh))
231 return 0;
232 if (xdr_stream_decode_u32(xdr, &args->access) < 0)
233 return 0;
234
235 return 1;

--- 158 unchanged lines hidden ---
228 struct nfsd3_accessargs *args = rqstp->rq_argp;
229
230 if (!svcxdr_decode_fhandle(xdr, &args->fh))
231 return 0;
232 if (xdr_stream_decode_u32(xdr, &args->access) < 0)
233 return 0;
234
235 return 1;

--- 158 unchanged lines hidden ---