Subject: RE: Out-of-range data

From: "Noveck, Dave" <[email-masked]>
Date: Wed, 17 Oct 2001 07:51:54 -0700

Calling it incorrect seems a bit strong, but I think it is better
to return an error in this case.  That's what I'm trying to do
in such cases in  my server implementation.

Having said that, I just looked at my current code, and, in the 
specific case you mentioned, I don't check either :-(  I'll fix
it, but it's not at the top of my list right now.

There is some question about what the proper error to return in 
some of these cases is.

In the case of access, we have an int rather than a enum argument.
I think NFS4ERR_INVAL is the right thing to return for something
that has undefined flags set.

In the case of something that is defined as an enum within the .x
file, I'm currently normally returning NFS4ERR_INVAL as well.  
However, since the .x file specifies that is an enum, I'm wondering
if perhaps, NFS4ERR_BADXDR would be more correct in the case that
something that is outside what the .x file specifies is sent.

In the case of a discriminated union (without default) however, 
I think NFS4ERR_BADXDR should be returned if the value is one 
that has no associated case.  In that case you've reached a point 
where the rest of the XDR stream can't be decoded.

-----Original Message-----
From: Peter Åstrand [mailto:[email-masked]]
Sent: Wednesday, October 17, 2001 10:04 AM
To: [email-masked]
Subject: Out-of-range data

How should a NFSv4 server respond upon a request with enum arguments, with
an invalid integer? For example, calling ACCESS with accessreq=0x00000040.

The CITI implementation accepts this and returns OK. Is this correct
behavior?

-- 
Peter Åstrand                Telephone: +46-13-29 08 61
Cendio Systems               E-mail: [email-masked]
Teknikringen 3
583 30 Linköping

---

From: Spencer Shepler <[email-masked]>
Date: Fri, 19 Oct 2001 00:35:04 -0500

Dave is correct.  For enums, the error should either be NFS4ERR_BADXDR
or an RPC error for decoding the arguments.  For bit fields that
contain values that are not defined, the failure should be
NFS4ERR_INVAL.

-- 

- Spencer -