| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Return a ENOSPC to notify that not enough space is here after the
xattr entry instead of returning an EIO.
Message-Id: <20220123041715.19402-15-etienne.brateau@gmail.com>
|
|
|
|
|
| |
* xattr: introduce xattr_header_valid method
Message-Id: <20220123041715.19402-14-etienne.brateau@gmail.com>
|
|
|
|
|
|
| |
In ext2 data are stored in little endian to ensure portability. So
enforce little endian when manipulating these bytes.
Message-Id: <20220123041715.19402-8-etienne.brateau@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3980bd3b406addb327d858aebd19e229ea340b9a
This supports setting (and reading) of passive trasnlators from
GNU/Linux, e.g.
dd if=/dev/zero of=file bs=1k count=1000
losetup /dev/loop0 file
mke2fs -t ext2 -o hurd -O ext_attr /dev/loop0
mount -t ext2 -o x-xattr-translator-records /dev/loop0 /mnt
mkdir -p /mnt/servers/socket
touch /mnt/servers/socket/1
setfattr --name=gnu.translator --value='"/hurd/pflocal\0"' /mnt/servers/socket/1
getfattr --name=gnu.translator /mnt/servers/socket/1
# file: 1
gnu.translator="/hurd/pflocal"
* ext2fs/xattr.c (xattr_prefixes): For "gnu.*", use index for
the Hurd (10).
|
|
|
|
| |
* ext2fs/xattr.c (ext2_set_xattr): Initialize 'block'.
|
|
|
|
|
| |
Our variants print stack traces on failures. This will make locating
errors much easier.
|
|
|
|
|
| |
* ext2fs/xattr.c (ext2_free_xattr_block): Only warn about missing ext2fs
support in debugging mode.
|
|
|
|
|
| |
* ext2fs/xattr.c (ext2_list_xattr, ext2_get_xattr): Only warn about
missing ext2fs support in debugging mode.
|
|
|
|
|
| |
* ext2fs/xattr.c (ext2_get_xattr): Reset buffer size before each call
to xattr_entry_get.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix some typos, types, add a few checks against integer overflows.
ext2fs/inode.c (diskfs_user_read_node): Initialize datalen to 0.
(diskfs_set_translator): Fix typo.
(diskfs_get_translator): Change datalen type to size_t.
* ext2fs/xattr.c (xattr_entry_get): Change type of block parameter
to void *.
(xattr_entry_create): Guard against integer overflows.
(xattr_entry_replace): Likewise.
(ext2_set_xattr): Fix typo.
|
|
|
|
|
| |
ext2fs/xattr.c (ext2_get_xattr): Keep the inode reference until the
block reference is done.
|
|
|
|
|
|
| |
* ext2fs/xattr.c (ext2_set_xattr): We allocate a block, but only
register it as the inodes acl block on success. Make sure to
deallocate the block otherwise.
|
|
|
|
|
| |
* ext2fs/xattr.c (ext2_set_xattr): Check returned block number before
mapping it.
|
|
|
|
|
|
| |
* ext2fs/xattr.c (ext2_set_xattr): Avoid allocating and leaking a
block if the caller tries to delete an extended attribute from a node
that has no extended attribute in the first place.
|
|
|
|
|
|
|
| |
* ext2fs/ext2fs.h (ext2_{list,get,set}_xattr): Use 'size_t'.
* ext2fs/xattr.c (xattr_entry_{list,get,create): Use 'size_t' where
appropriate.
(ext2_{list,get,set}_xattr): Likewise.
|
|
* ext2fs/Makefile (SRCS): Add xattr.c.
* ext2fs/ext2_fs.h: Define EXT2_FEATURE_COMPAT_EXT_ATTR.
* ext2fs/ext2fs.h: Add xattr functions.
* ext2fs/ialloc.c (diskfs_free_node): Free xattr block.
* ext2fs/xattr.c: xattr implement.
* ext2fs/xattr.h: Likewise.
|