o The move to using VADMIN under vaccess() resulted in some system

calls returning EACCES instead of EPERM.  This patch modifies vaccess()
  to return EPERM instead of EACCES if VADMIN is among the requested
  rights.  This affects functions normally limited to the owners of
  a file, such as chmod(), as EPERM is the error indicating that
  privilege would allow the operation, rather than a chance in mandatory
  or discretionary rights.

Reported by:	bde
This commit is contained in:
Robert Watson 2001-01-23 04:15:19 +00:00
parent 64d9f3b982
commit 02b65ffb64
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=71411
2 changed files with 2 additions and 2 deletions

View file

@ -3128,5 +3128,5 @@ vaccess(type, file_mode, file_uid, file_gid, acc_mode, cred, privused)
}
#endif
return (EACCES);
return ((acc_mode & VADMIN) ? EPERM : EACCES);
}

View file

@ -3128,5 +3128,5 @@ vaccess(type, file_mode, file_uid, file_gid, acc_mode, cred, privused)
}
#endif
return (EACCES);
return ((acc_mode & VADMIN) ? EPERM : EACCES);
}