mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 04:43:53 +00:00
Even better move: suppose that server is able to handle SEEK_END,
so check arguments for all but not SEEK_END case, leaving SEEK_END handling for server
This commit is contained in:
parent
e018907ed4
commit
6c3f4fef64
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=82194
|
@ -104,12 +104,12 @@ nfs_dolock(ap)
|
|||
*/
|
||||
if (fl->l_len < 0)
|
||||
return (EINVAL);
|
||||
if (fl->l_whence == SEEK_END)
|
||||
return (EOPNOTSUPP);
|
||||
if (fl->l_start < 0)
|
||||
return (EINVAL);
|
||||
if (fl->l_len != 0 && (fl->l_len - 1 > OFF_MAX - fl->l_start))
|
||||
return (EOVERFLOW);
|
||||
if (fl->l_whence != SEEK_END) {
|
||||
if (fl->l_start < 0)
|
||||
return (EINVAL);
|
||||
if (fl->l_len != 0 && (fl->l_len - 1 > OFF_MAX - fl->l_start))
|
||||
return (EOVERFLOW);
|
||||
}
|
||||
|
||||
/*
|
||||
* Fill in the information structure.
|
||||
|
|
|
@ -104,12 +104,12 @@ nfs_dolock(ap)
|
|||
*/
|
||||
if (fl->l_len < 0)
|
||||
return (EINVAL);
|
||||
if (fl->l_whence == SEEK_END)
|
||||
return (EOPNOTSUPP);
|
||||
if (fl->l_start < 0)
|
||||
return (EINVAL);
|
||||
if (fl->l_len != 0 && (fl->l_len - 1 > OFF_MAX - fl->l_start))
|
||||
return (EOVERFLOW);
|
||||
if (fl->l_whence != SEEK_END) {
|
||||
if (fl->l_start < 0)
|
||||
return (EINVAL);
|
||||
if (fl->l_len != 0 && (fl->l_len - 1 > OFF_MAX - fl->l_start))
|
||||
return (EOVERFLOW);
|
||||
}
|
||||
|
||||
/*
|
||||
* Fill in the information structure.
|
||||
|
|
Loading…
Reference in a new issue