diff options
-rw-r--r-- | lib/libc/gen/errlist.c | 3 | ||||
-rw-r--r-- | lib/libc/sys/extattr_get_file.2 | 4 | ||||
-rw-r--r-- | lib/libc/sys/intro.2 | 4 | ||||
-rw-r--r-- | sys/sys/errno.h | 5 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_extattr.c | 48 |
5 files changed, 31 insertions, 33 deletions
diff --git a/lib/libc/gen/errlist.c b/lib/libc/gen/errlist.c index 2e1f1b7df87..31867b1b33a 100644 --- a/lib/libc/gen/errlist.c +++ b/lib/libc/gen/errlist.c @@ -32,7 +32,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: errlist.c,v 1.4 2002/04/30 16:32:58 drahn Exp $"; +static char *rcsid = "$OpenBSD: errlist.c,v 1.5 2002/05/01 13:36:18 drahn Exp $"; #endif /* LIBC_SCCS and not lint */ #ifdef lint @@ -142,5 +142,6 @@ const char *const "Authentication error", /* 80 - EAUTH */ "Need authenticator", /* 81 - ENEEDAUTH */ "IPsec processing failure", /* 82 - EIPSEC */ + "Attribute not found", /* 83 - ENOATTR */ }; int _sys_nerr = { sizeof _sys_errlist/sizeof _sys_errlist[0] }; diff --git a/lib/libc/sys/extattr_get_file.2 b/lib/libc/sys/extattr_get_file.2 index fa7a91f70be..2d825dcef77 100644 --- a/lib/libc/sys/extattr_get_file.2 +++ b/lib/libc/sys/extattr_get_file.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: extattr_get_file.2,v 1.4 2002/04/30 16:31:42 mpech Exp $ +.\" $OpenBSD: extattr_get_file.2,v 1.5 2002/05/01 13:36:18 drahn Exp $ .\" .\" Copyright (c) 2001 Dima Dorfman <dima@unixfreak.org> .\" All rights reserved. @@ -201,6 +201,8 @@ or an entire path name exceeded 1023 characters. A component of the path name that must exist does not exist. .It Bq Er EACCES Search permission is denied for a component of the path prefix. +.It Bq Er ENOATTR +An attribute does not exist for the specified existing path. .\" XXX are any missing? .El .Sh SEE ALSO diff --git a/lib/libc/sys/intro.2 b/lib/libc/sys/intro.2 index 0d3c0ea25d7..9a0377e0e06 100644 --- a/lib/libc/sys/intro.2 +++ b/lib/libc/sys/intro.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: intro.2,v 1.22 2002/04/30 16:32:58 drahn Exp $ +.\" $OpenBSD: intro.2,v 1.23 2002/05/01 13:36:18 drahn Exp $ .\" $NetBSD: intro.2,v 1.6 1995/02/27 12:33:41 cgd Exp $ .\" .\" Copyright (c) 1980, 1983, 1986, 1991, 1993 @@ -400,6 +400,8 @@ filesystem may be mounted. IPsec subsystem error, Not used in .Ox . +.It Er 83 ENOATTR Em "Attribute not found" . +A UFS Extended Attribute is not found for the specified pathname. .El .Sh DEFINITIONS .Bl -tag -width Ds diff --git a/sys/sys/errno.h b/sys/sys/errno.h index 0fc65ddb87e..8faa53765cf 100644 --- a/sys/sys/errno.h +++ b/sys/sys/errno.h @@ -1,4 +1,4 @@ -/* $OpenBSD: errno.h,v 1.8 1999/01/07 05:34:29 deraadt Exp $ */ +/* $OpenBSD: errno.h,v 1.9 2002/05/01 13:36:18 drahn Exp $ */ /* $NetBSD: errno.h,v 1.10 1996/01/20 01:33:53 jtc Exp $ */ /* @@ -164,7 +164,8 @@ extern char *sys_errlist[]; #define EAUTH 80 /* Authentication error */ #define ENEEDAUTH 81 /* Need authenticator */ #define EIPSEC 82 /* IPsec processing failure */ -#define ELAST 82 /* Must be equal largest errno */ +#define ENOATTR 83 /* Attribute not found */ +#define ELAST 83 /* Must be equal largest errno */ #endif /* _POSIX_SOURCE */ #ifdef _KERNEL diff --git a/sys/ufs/ufs/ufs_extattr.c b/sys/ufs/ufs/ufs_extattr.c index c665d2cc4a0..f48e6b5d179 100644 --- a/sys/ufs/ufs/ufs_extattr.c +++ b/sys/ufs/ufs/ufs_extattr.c @@ -1,7 +1,7 @@ -/* $OpenBSD: ufs_extattr.c,v 1.2 2002/03/31 22:00:11 drahn Exp $ */ +/* $OpenBSD: ufs_extattr.c,v 1.3 2002/05/01 13:36:18 drahn Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2002 Robert N. M. Watson - * Copyright (c) 2002 Networks Associates Technologies, Inc. + * Copyright (c) 2002 Networks Associates Technology, Inc. * All rights reserved. * * This software was developed by Robert Watson for the TrustedBSD Project. @@ -35,7 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: ufs_extattr.c,v 1.44 2002/02/10 04:57:08 rwatson Exp $ + * $FreeBSD: ufs_extattr.c,v 1.49 2002/04/01 21:31:12 jhb Exp $ */ /* * Developed by the TrustedBSD Project. @@ -56,6 +56,7 @@ #include <sys/dirent.h> #include <sys/extattr.h> #include <sys/sysctl.h> +#include <sys/device.h> #include <ufs/ufs/dir.h> #include <ufs/ufs/extattr.h> @@ -462,12 +463,6 @@ ufs_extattr_iterate_directory(struct ufsmount *ump, struct vnode *dvp, } else if (attr_vp == dvp) { vrele(attr_vp); } else if (attr_vp->v_type != VREG) { -/* - * Eventually, this will be uncommented, but in the mean time, the ".." - * entry causes unnecessary console warnings. - printf("ufs_extattr_iterate_directory: " - "%s not VREG\n", dp->d_name); -*/ vput(attr_vp); } else { error = ufs_extattr_enable_with_open(ump, @@ -477,14 +472,17 @@ ufs_extattr_iterate_directory(struct ufsmount *ump, struct vnode *dvp, printf("ufs_extattr_iterate_directory: " "enable %s %d\n", dp->d_name, error); - } else { + } /* * While it's nice to have some visual output here, skip for the time-being. * Probably should be enabled by -v at boot. - printf("Autostarted %s\n", dp->d_name); - */ -printf("Autostarted %s\n", dp->d_name); /* XXX - debug*/ + * NOT yet - XXX + + else if (autoconf_verbose) { + printf("UFS autostarted EA %s\n", + dp->d_name); } +*/ } dp = (struct dirent *) ((char *)dp + dp->d_reclen); if (dp >= edp) @@ -720,7 +718,7 @@ ufs_extattr_disable(struct ufsmount *ump, int attrnamespace, uele = ufs_extattr_find_attr(ump, attrnamespace, attrname); if (!uele) - return (ENOENT); + return (ENOATTR); LIST_REMOVE(uele, uele_entries); @@ -846,6 +844,7 @@ ufs_extattr_credcheck(struct vnode *vp, struct ufs_extattr_list_entry *uele, */ switch (uele->uele_attrnamespace) { case EXTATTR_NAMESPACE_SYSTEM: + /* Potentially should be: return (EPERM); */ return (suser(cred, &p->p_acflag)); case EXTATTR_NAMESPACE_USER: return (VOP_ACCESS(vp, access, cred, p)); @@ -913,8 +912,7 @@ ufs_extattr_get(struct vnode *vp, int attrnamespace, const char *name, attribute = ufs_extattr_find_attr(ump, attrnamespace, name); if (!attribute) - /* XXX: ENOENT here will eventually be ENOATTR. */ - return (ENOENT); + return (ENOATTR); if ((error = ufs_extattr_credcheck(vp, attribute, cred, p, IREAD))) return (error); @@ -969,8 +967,7 @@ ufs_extattr_get(struct vnode *vp, int attrnamespace, const char *name, /* Defined? */ if ((ueh.ueh_flags & UFS_EXTATTR_ATTR_FLAG_INUSE) == 0) { - /* XXX: ENOENT here will eventually be ENOATTR. */ - error = ENOENT; + error = ENOATTR; goto vopunlock_exit; } @@ -984,8 +981,7 @@ ufs_extattr_get(struct vnode *vp, int attrnamespace, const char *name, */ printf("ufs_extattr_get: inode number inconsistency (%d, %d)\n", ueh.ueh_i_gen, ip->i_ffs_gen); - /* XXX: ENOENT here will eventually be ENOATTR. */ - error = ENOENT; + error = ENOATTR; goto vopunlock_exit; } @@ -1092,8 +1088,7 @@ ufs_extattr_set(struct vnode *vp, int attrnamespace, const char *name, attribute = ufs_extattr_find_attr(ump, attrnamespace, name); if (!attribute) - /* XXX: ENOENT here will eventually be ENOATTR. */ - return (ENOENT); + return (ENOATTR); if ((error = ufs_extattr_credcheck(vp, attribute, cred, p, IWRITE))) return (error); @@ -1204,8 +1199,7 @@ ufs_extattr_rm(struct vnode *vp, int attrnamespace, const char *name, attribute = ufs_extattr_find_attr(ump, attrnamespace, name); if (!attribute) - /* XXX: ENOENT here will eventually be ENOATTR. */ - return (ENOENT); + return (ENOATTR); if ((error = ufs_extattr_credcheck(vp, attribute, cred, p, IWRITE))) return (error); @@ -1250,8 +1244,7 @@ ufs_extattr_rm(struct vnode *vp, int attrnamespace, const char *name, /* Defined? */ if ((ueh.ueh_flags & UFS_EXTATTR_ATTR_FLAG_INUSE) == 0) { - /* XXX: ENOENT here will eventually be ENOATTR. */ - error = ENOENT; + error = ENOATTR; goto vopunlock_exit; } @@ -1265,8 +1258,7 @@ ufs_extattr_rm(struct vnode *vp, int attrnamespace, const char *name, */ printf("ufs_extattr_rm: inode number inconsistency (%d, %d)\n", ueh.ueh_i_gen, ip->i_ffs_gen); - /* XXX: ENOENT here will eventually be ENOATTR. */ - error = ENOENT; + error = ENOATTR; goto vopunlock_exit; } |