Parcourir la source

HBSD: Support listing extended attributes

The length of the name as a uint8_t comes before the name itself.

Signed-off-by:	Shawn Webb <shawn.webb@hardenedbsd.org>
remotes/github/hardened/current/tmpfs_extattr
Shawn Webb il y a 3 mois
Parent
révision
10886b1672
1 fichiers modifiés avec 8 ajouts et 3 suppressions
  1. +8
    -3
      sys/fs/tmpfs/tmpfs_vnops.c

+ 8
- 3
sys/fs/tmpfs/tmpfs_vnops.c Voir le fichier

@@ -1757,6 +1757,7 @@ tmpfs_extattr_list(struct vnode *vp, int attrnamespace, struct uio *uio,
struct tmpfs_extattr_list_entry *attr, *tattr;
struct tmpfs_node *node;
size_t namelen;
uint8_t namelen8;
int error;

error = 0;
@@ -1779,10 +1780,14 @@ tmpfs_extattr_list(struct vnode *vp, int attrnamespace, struct uio *uio,

namelen = strlen(attr->tele_attrname);
if (size) {
*size += namelen + 1;
*size += namelen + namelen8;
} else if (uio != NULL) {
error = uiomove(&(attr->tele_attrname), namelen + 1,
uio);
namelen8 = namelen;
error = uiomove(&namelen8, sizeof(namelen8), uio);
if (error) {
break;
}
error = uiomove(attr->tele_attrname, namelen, uio);
}

if (error) {


Chargement…
Annuler
Enregistrer