diff options
author | rwatson <rwatson@FreeBSD.org> | 2001-10-27 04:58:28 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2001-10-27 04:58:28 +0000 |
commit | 25c2879cc93a72f323c7051170604fd38d4b8056 (patch) | |
tree | eae093fe1efbdbfbb21cc41c7afbe6ac670ceed0 /sys/ufs | |
parent | 6d1badce0157c4bdb5cc96b3e09a233ccaf0bd6f (diff) | |
download | FreeBSD-src-25c2879cc93a72f323c7051170604fd38d4b8056.zip FreeBSD-src-25c2879cc93a72f323c7051170604fd38d4b8056.tar.gz |
Since namespace support was added to the UFS extended attribute
implementation to replace single-character namespace prefixes, '$' is no
longer an invalid attribute name, and the namespace is relevant to
validity determination.
o Remove '$' case from ufs_extattr_valid_attrname()
o Add attrnamespace argument to ufs_extattr_valid_attrname(), and
fill out appropriately.
Currently no decisions are made based on the namespace argument, but
may be in the future.
Obtained from: TrustedBSD Project
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ufs/ufs_extattr.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sys/ufs/ufs/ufs_extattr.c b/sys/ufs/ufs/ufs_extattr.c index a1d523f..d1cfed7 100644 --- a/sys/ufs/ufs/ufs_extattr.c +++ b/sys/ufs/ufs/ufs_extattr.c @@ -64,7 +64,8 @@ static int ufs_extattr_sync = 0; SYSCTL_INT(_debug, OID_AUTO, ufs_extattr_sync, CTLFLAG_RW, &ufs_extattr_sync, 0, ""); -static int ufs_extattr_valid_attrname(const char *attrname); +static int ufs_extattr_valid_attrname(int attrnamespace, + const char *attrname); static int ufs_extattr_credcheck(struct vnode *vp, struct ufs_extattr_list_entry *uele, struct ucred *cred, struct thread *td, int access); @@ -109,18 +110,15 @@ ufs_extattr_uepm_unlock(struct ufsmount *ump, struct thread *td) * Invalid currently consists of: * NULL pointer for attrname * zero-length attrname (used to retrieve application attribute list) - * attrname consisting of "$" (used to treive system attribute list) */ static int -ufs_extattr_valid_attrname(const char *attrname) +ufs_extattr_valid_attrname(int attrnamespace, const char *attrname) { if (attrname == NULL) return (0); if (strlen(attrname) == 0) return (0); - if (strlen(attrname) == 1 && attrname[0] == '$') - return (0); return (1); } @@ -586,7 +584,7 @@ ufs_extattr_enable(struct ufsmount *ump, int attrnamespace, struct uio auio; int error = 0; - if (!ufs_extattr_valid_attrname(attrname)) + if (!ufs_extattr_valid_attrname(attrnamespace, attrname)) return (EINVAL); if (backing_vnode->v_type != VREG) return (EINVAL); @@ -671,7 +669,7 @@ ufs_extattr_disable(struct ufsmount *ump, int attrnamespace, struct ufs_extattr_list_entry *uele; int error = 0; - if (!ufs_extattr_valid_attrname(attrname)) + if (!ufs_extattr_valid_attrname(attrnamespace, attrname)) return (EINVAL); uele = ufs_extattr_find_attr(ump, attrnamespace, attrname); @@ -1031,7 +1029,7 @@ ufs_extattr_set(struct vnode *vp, int attrnamespace, const char *name, return (EROFS); if (!(ump->um_extattr.uepm_flags & UFS_EXTATTR_UEPM_STARTED)) return (EOPNOTSUPP); - if (!ufs_extattr_valid_attrname(name)) + if (!ufs_extattr_valid_attrname(attrnamespace, name)) return (EINVAL); attribute = ufs_extattr_find_attr(ump, attrnamespace, name); @@ -1142,7 +1140,7 @@ ufs_extattr_rm(struct vnode *vp, int attrnamespace, const char *name, return (EROFS); if (!(ump->um_extattr.uepm_flags & UFS_EXTATTR_UEPM_STARTED)) return (EOPNOTSUPP); - if (!ufs_extattr_valid_attrname(name)) + if (!ufs_extattr_valid_attrname(attrnamespace, name)) return (EINVAL); attribute = ufs_extattr_find_attr(ump, attrnamespace, name); |