Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

getextattr(1) [netbsd man page]

GETEXTATTR(1)						    BSD General Commands Manual 					     GETEXTATTR(1)

NAME
getextattr, lsextattr, rmextattr, setextattr -- manipulate extended attributes SYNOPSIS
getextattr [-fhq] [-s | -x | -v style] [namespace] attrname filename ... lsextattr [-fhq] namespace filename ... rmextattr [-fhq] [namespace] attrname filename ... setextattr [-fhnq] [namespace] attrname attrvalue filename ... setextattr [-fhnq] -i valuefile [namespace] attrname filename ... DESCRIPTION
These utilities are user tools to manipulate the named extended attributes on files and directories. The namespace argument should be the namespace of the attribute to retrieve: legal values are user and system. For all operations except lsextattr, the namespace argument may be omitted if the attribute name is namespace prefixed, like in user.test. In that later case, the user namespace prefix obviously selects user namespace. system, security, and trusted namespace prefixes select the system namespace. The attrname argument should be the name of the attribute, filename the name of the target file or directory, attrvalue a string to store in the attribute. The following options are available: -f (Force.) Ignore errors on individual filenames and continue with the remaining arguments. -h (No follow.) If the file is a symbolic link, perform the operation on the link itself rather than the file that the link points to. -i valuefile (Input file.) Read the attribute value from file valuefile. Use this flag in order to set a binary value for an attribute. -n (NUL-terminate.) NUL-terminate the extent content written out. -q (Quiet.) Do not print out the pathname and suppress error messages. -s (Stringify.) Escape nonprinting characters and put quotes around the output. -v style (Visual.) Process the attribute value through vis(3), using style. Valid values for style are: default Use default vis(3) encoding. c Use C-style backslash sequences, like in vis -c. http Use URI encoding from RFC 1808, like in vis -h. octal Display in octal, like in vis -o. vis Alias for default. cstyle Alias for c. httpstyle Alias for http. -x (Hex.) Print the output in hexadecimal. EXAMPLES
setextattr system md5 `md5 -q /boot/kernel/kernel` /boot/kernel/kernel getextattr system md5 /boot/kernel/kernel lsextattr system /boot/kernel/kernel rmextattr system md5 /boot/kernel/kernel Examples omitting namespace (and attribute value) argument: setextattr -i valuefile trusted.gfid /export/wd3a getextattr -x trusted.gfid /export/wd3a SEE ALSO
extattr(3), extattrctl(8), extattr(9) HISTORY
Extended attribute support was developed as part of the TrustedBSD Project, and introduced in FreeBSD 5.0 and NetBSD 3.0. It was developed to support security extensions requiring additional labels to be associated with each file or directory. Extended attribute support was resurrected and made more usable in NetBSD 5.2. AUTHORS
Robert N M Watson Poul-Henning Kamp Emmanuel Dreyfus BSD
January 2, 2005 BSD

Check Out this Related Man Page

EXTATTRCTL(8)						    BSD System Manager's Manual 					     EXTATTRCTL(8)

NAME
extattrctl -- manage UFS1 extended attributes SYNOPSIS
extattrctl start path extattrctl stop path extattrctl initattr [-f] [-p path] attrsize attrfile extattrctl showattr attrfile extattrctl enable path attrnamespace attrname attrfile extattrctl disable path attrnamespace attrname DESCRIPTION
The extattrctl utility is the management utility for extended attributes over the UFS1 file system. It allows the starting and stopping of extended attributes on a file system, as well as initialization of attribute backing files, and enabling and disabling of specific extended attributes on a file system. The first argument on the command line indicates the operation to be performed. Operation must be one of the following: start path Start extended attribute support on the file system named using path. The file system must be a UFS1 file system, and the UFS_EXTATTR kernel option must have been enabled. If .attribute/user and .attribute/system exist at the filesystem root, extended attributes backed by files in these directories will be automatically enabled. Note that extended attributes can be automatically started at mount time by using the -o extattr option to mount(8). stop path Stop extended attribute support on the file system named using path. Extended attribute support must previously have been started. initattr [-f] [-p path] attrsize attrfile Create and initialize a file to use as an attribute backing file. You must specify a maximum per-inode size for the attribute in bytes in attrsize, as well as the file where the attribute will be stored, using attrfile. The -f argument may be used to indicate that it is alright to overwrite an existing attribute backing file; otherwise, if the target file exists, an error will be returned. The -p path argument may be used to preallocate space for all attributes rather than relying on sparse files to conserve space. This has the advantage of guaranteeing that space will be available for attributes when they are written, preventing low disk space condi- tions from denying attribute service. This file should not exist before running initattr. When a user attempts to set a ``user'' or ``system'' extended attribute that lacks a backing file, the kernel will attempt to auto- matically create it, provided .attribute/user or .attribute/system exist and are writable by the requesting user. showattr attrfile Show the attribute header values in the attribute file named by attrfile. enable path attrnamespace attrname attrfile Enable an attribute named attrname in the namespace attrnamespace on the file system identified using path, and backed by initialized attribute file attrfile. Available namespaces are ``user'' and ``system''. The backing file must have been initialized using initattr before its first use. Attributes must have been started on the file system prior to the enabling of any attributes. disable path attrnamespace attrname Disable the attributed named attrname in namespace attrnamespace on the file system identified by path. Available namespaces are ``user'' and ``system''. The file system must have attributes started on it, and the attribute most have been enabled using enable. EXAMPLES
extattrctl start / Start extended attributes on the root file system. extattrctl initattr 17 /.attribute/system/md5 Create an attribute backing file in /.attribute/system/md5, and set the maximum size of each attribute to 17 bytes, with a sparse file used for storing the attributes. extattrctl enable / system md5 /.attribute/system/md5 Enable an attribute named md5 on the root file system, backed from the file /.attribute/system/md5. extattrctl disable / md5 Disable the attribute named md5 on the root file system. extattrctl stop / Stop extended attributes on the root file system. SEE ALSO
getextattr(1), extattr_get_file(2), extattr(9) HISTORY
Extended attribute support was developed as part of the TrustedBSD Project, and introduced in FreeBSD 5.0 and NetBSD 4.0. It was developed to support security extensions requiring additional labels to be associated with each file or directory. Backing file autocreation was added in NetBSD 6.0. AUTHORS
Robert N M Watson BUGS
extattrctl works only on UFS1 file systems. The kernel support for extended attribute backing files and this control program should be gen- eralized for any file system that lacks native extended attribute support. BSD
June 17, 2011 BSD
Man Page