summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/syscall/chown.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/common/syscall/chown.c')
-rw-r--r--usr/src/uts/common/syscall/chown.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr/src/uts/common/syscall/chown.c b/usr/src/uts/common/syscall/chown.c
index 7dc7fc663e..d32e16b5c5 100644
--- a/usr/src/uts/common/syscall/chown.c
+++ b/usr/src/uts/common/syscall/chown.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -71,8 +70,10 @@ cfchownat(int fd, char *name, int nmflag, uid_t uid, gid_t gid, int flags)
int error = 0;
char startchar;
- if (uid < -1 || uid > MAXUID || gid < -1 || gid > MAXUID)
+ if (uid != (uid_t)-1 && !VALID_UID(uid) ||
+ gid != (gid_t)-1 && !VALID_GID(gid)) {
return (set_errno(EINVAL));
+ }
vattr.va_uid = uid;
vattr.va_gid = gid;
vattr.va_mask = 0;