Extended file attributes

Extended file attributes are file system features that enable users to associate computer files with metadata not interpreted by the filesystem, whereas regular attributes have a purpose strictly defined by the filesystem (such as permissions or records of creation and modification times). Unlike forks, which can usually be as large as the maximum file size, extended attributes are usually limited in size to a value significantly smaller than the maximum file size. Typical uses include storing the author of a document, the character encoding of a plain-text document, or a checksum, cryptographic hash or digital certificate, and discretionary access control information.

In Unix-like systems, extended attributes are usually abbreviated as xattr.[1]

Implementations

AIX

In AIX, the JFS2 v2 filesystem supports extended attributes, which are accessible using the getea command.[2] The getea,[3] setea,[4] listea,[5] statea,[6] and removeea[7] APIs support fetching, setting, listing, getting information about, and removing extended attributes.

BeOS/Haiku

In the now-defunct BeOS and successors like Haiku, extended file attributes are widely used in base and third-party programs. The Be File System allows the indexing and querying of attributes, essentially giving the filesystem database-like characteristics. The uses of extended attributes in Be-like systems are varied: For example, Tracker and OpenTracker, the file-managers of BeOS and Haiku respectively, both store the locations of file icons in attributes,[8] Haiku's "Mail" service stores all message content and metadata in extended file attributes,[9] and the MIME types of files are stored in their attributes. Extended file attributes can be viewed and edited in Be-like systems' GUI through the file-manager, often Tracker or derivatives thereof.

FreeBSD

In FreeBSD 5.0 and later, the UFS1, UFS2, and ZFS filesystems support extended attributes, using the extattr_[10] family of system calls. Any regular file may have a list of extended attributes. Each attribute consists of a name and the associated data. The name must be a null-terminated string, and exists in a namespace identified by a small-integer namespace identifier. Currently, two namespaces exist: user and system. The user namespace has no restrictions with regard to naming or contents. The system namespace is primarily used by the kernel for access control lists and mandatory access control.

Linux

In Linux, the ext2, ext3, ext4, JFS, Squashfs, UBIFS, Yaffs2, ReiserFS, Reiser4, XFS, Btrfs, OrangeFS, Lustre, OCFS2 1.6, ZFS, and F2FS[11] filesystems support extended attributes (abbreviated xattr) when enabled in the kernel configuration. Any regular file or directory may have extended attributes consisting of a name and associated data. The name must be a null-terminated string prefixed by a namespace identifier and a dot character. Currently, four namespaces exist: user, trusted, security and system. The user namespace has no restrictions with regard to naming or contents. The system namespace is primarily used by the kernel for access control lists. The security namespace is used by SELinux, for example.

Support for the extended attribute concept from a POSIX.1e draft[citation needed] that had been withdrawn[12] in 1997 was added to Linux around 2002.[13][14] As of 2016, they are not yet in widespread use by user-space Linux programs, but are used by Beagle, OpenStack Swift, Dropbox, KDE's semantic metadata framework (Baloo), Chromium, Wget, cURL, and Snapcraft.

The Linux kernel allows extended attribute to have names of up to 255 bytes and values of up to 64 KiB,[15] as do XFS and ReiserFS, but ext2/3/4 and btrfs impose much smaller limits, requiring all the attributes (names and values) of one file to fit in one "filesystem block" (usually 4 KiB). Per POSIX.1e,[citation needed] the names are required to start with one of security, system, trusted, and user plus a period. This defines the four namespaces of extended attributes.[16]

Extended attributes can be accessed and modified using the getfattr and setfattr commands from the attr package on most distributions.[17] The APIs are called getxattr and setxattr.

macOS

Mac OS X 10.4 and later support extended attributes by making use of the HFS+ filesystem Attributes File B*-tree feature which allows for named forks. Although the named forks in HFS+ support arbitrarily large amounts of data through extents, the OS support for extended attributes only supports inline attributes, limiting their size to that which can fit within a single B*-tree node.[citation needed] Any regular file may have a list of extended attributes. HFS+ supports an arbitrary number of named forks, and it is unknown if macOS imposes any limit on the number of extended attributes.

Each attribute consists of a name and the associated data. The name is a null-terminated Unicode string. No namespace restrictions are present (making this an open xattr system) and the convention is to use a reverse DNS string (similar to Uniform Type Identifiers) as the attribute name.

macOS supports listing,[18] getting,[19] setting,[20] and removing[21] extended attributes from files or directories using a Linux-like API. From the command line, these abilities are exposed through the xattr utility.[22]

Since macOS 10.5, files originating from the web are marked with com.apple.quarantine via extended file attributes.[23] In some older versions of macOS (such as Mac OS X 10.6), user space extended attributes were not preserved on save in common Cocoa applications (TextEdit, Preview etc.).[citation needed]

OpenBSD

Support for extended file attributes was removed from the OpenBSD source code in 2005 due to a lack of interest in Access Control Lists.[24]

OS/2

In OS/2 version 1.2 and later, the High Performance File System was designed with extended attributes in mind, but support for them was also retro-fitted on the FAT filesystem of DOS. For compatibility with other operating systems using a FAT partition, OS/2 attributes are stored inside a single file "EA DATA. SF" located in the root directory. This file is normally inaccessible when an operating system supporting extended attributes manages the disk, but can be freely manipulated under, for example, DOS. Files and directories having extended attributes use one or more clusters inside this file. The logical cluster number of the first used cluster is stored inside the owning file's or directory's directory entry.[25] These two bytes are used for other purposes on the FAT32 filesystem, and hence OS/2 extended attributes cannot be stored on this filesystem.

Parts of OS/2 version 2.0 and later such as the Workplace Shell uses several standardized extended attributes (also called EAs) for purposes like identifying the filetype, comments, computer icons and keywords about the file. Programs written in the interpreted language Rexx store an already parsed version of the code as an extended attribute, to allow faster execution.

Solaris

Solaris version 9 and later allows files to have "extended attributes", which are actually forks; the maximum size of an "extended attribute" is the same as the maximum size of a file, and they are read and written in the same fashion as files. Internally, they are actually stored and accessed like normal files, so their names cannot contain "/" characters[26] and their ownership and permissions can differ from those of the parent file.

Version 4 of the Network File System supports extended attributes in much the same way as Solaris.

Windows NT

On Windows NT, limited-length extended attributes are supported by FAT,[25] HPFS, and NTFS. This was implemented as part of the OS/2 subsystem. They are notably used by the NFS server of the Interix POSIX subsystem in order to implement Unix-like permissions. The Windows Subsystem for Linux added in the Windows 10 Anniversary Update uses them for similar purposes, storing the Linux file mode, owner, device ID (if applicable), and file times in the extended attributes.[27]

Additionally, NTFS can store arbitrary-length extended attributes in the form of alternate data streams (ADS), a type of resource fork. Plugins for the file manager Total Commander, like NTFS Descriptions and QuickSearch eXtended support filtering the file list by or searching for metadata contained in ADS.[28][29] NTFS-3G supports mapping ADS to extended attributes in FUSE; it also maps file attributes that way.[30]

See also

References

  1. ^ xattr(7) – Linux Programmer's Manual – Overview, Conventions and Miscellanea
  2. ^ "getea Command". IBM AIX V7.2 documentation. IBM. Retrieved 2017-07-11.
  3. ^ "getea Subroutine". IBM AIX V7.2 documentation: Base Operating System and Extensions, Volume 1. IBM. Retrieved 2017-07-11.
  4. ^ "setea Subroutine". IBM AIX V7.2 documentation: Base Operating System and Extensions, Volume 2. IBM. Retrieved 2017-07-11.
  5. ^ "listea Subroutine". IBM AIX V7.2 documentation: Base Operating System and Extensions, Volume 1. IBM. Retrieved 2017-07-11.
  6. ^ "statea Subroutine". IBM AIX V7.2 documentation: Base Operating System and Extensions, Volume 2. IBM. Retrieved 2017-07-11.
  7. ^ "removeea Subroutine". IBM AIX V7.2 documentation: Base Operating System and Extensions, Volume 2. IBM. Retrieved 2017-07-11.
  8. ^ "Attributes". Haiku User Guide. Haiku, Inc. Retrieved 28 January 2021.
  9. ^ "Workshop: Managing Emails". Haiku User Guide. Haiku, Inc. Retrieved 28 January 2021.
  10. ^ extattr(2) – FreeBSD System Calls Manual
  11. ^ Kim, Jaegeuk (2012-10-05). "[PATCH 13/16] f2fs: add xattr and acl functionalities". Retrieved 2017-07-11.
  12. ^ Schaufler, Casey (2002-04-30). "Posix.1e?". Newsgroupcomp.security.unix.
  13. ^ "v2.5.3 git commit log". 2002-02-05. Retrieved 2017-07-11.
  14. ^ "Red Hat Enterprise Linux AS 3 Release Notes (x86 Edition)". Red Hat. 2003. Archived from the original on 2017-07-09. Retrieved 2017-07-11. EA (Extended Attributes) and ACL (Access Control Lists) functionality is now available for ext3 file systems. In addition, ACL functionality is available for NFS.
  15. ^ "linux/include/uapi/linux/limits.h". 2012-10-13. Retrieved 2017-07-11.
  16. ^ xattr(7) – Linux Programmer's Manual – Overview, Conventions and Miscellanea
  17. ^ "Commands for Manipulating Filesystem Extended Attributes". GNU Savannah. Retrieved 2017-07-11.
  18. ^ listxattr(2) – Darwin and macOS System Calls Manual
  19. ^ getxattr(2) – Darwin and macOS System Calls Manual
  20. ^ setxattr(2) – Darwin and macOS System Calls Manual
  21. ^ removexattr(2) – Darwin and macOS System Calls Manual
  22. ^ xattr(1) – Darwin and macOS General Commands Manual
  23. ^ "Launch Services Release Notes". developer.apple.com.
  24. ^ Dale Rahn (2005-07-03). "CVS log for src/sys/ufs/ufs/Attic/extattr.h".
  25. ^ a b Eager, Bob (2000-10-28). "Implementation of extended attributes on the FAT file system". Retrieved 2017-07-11.
  26. ^ fsattr(7) – Solaris 11.4 Standards, Environments, Macros, Character Sets, and Miscellany Reference Manual
  27. ^ Hammons, Jack (2016-06-15). "WSL File System Support". MSDN. Retrieved 2017-07-11.
  28. ^ "NTFS Descriptions 1.2.1". TotalCmd.net. Retrieved 16 April 2018.
  29. ^ "QuickSearch eXtended". TotalCmd.net. Retrieved 16 April 2018.
  30. ^ "Extended Attributes". Tuxera. Archived from the original on 2020-08-14.

Read other articles:

Baudouin V, Comte HainautBaudouin V, Comte HainautPasanganMarguerite IKeluarga bangsawanWangsa FlandriaBapakBaudouin IV dari HainautIbuAlice dari NamurLahir1150Meninggal17 Desember 1195 (usia 45) Baudouin V dari Hainaut (1150 – 17 Desember 1195) merupakan seorang Comte Hainaut (1171–1195), Comte Flandria sebagai Baudouin VIII (1191–1195) dan bupati Namur sebagai Baudouin I (1189–1195). Sejarah Ia merupakan putra Baudouin IV dari Hainaut. Flandria didapatkan dari hasil pernikahannya de...

 

Sinterklas dan Knecht Ruprecht (di kiri). Knecht Ruprecht (dalam Jerman berarti Ksatria Ruprecht) adalah tokoh dalam cerita rakyat Sinterklas di Eropa Barat. Knecht Ruprecht sering ditemukan di negara-negara berbahasa Jerman. Sebagai asisten Santa Claus, Knecht Ruprecht akan menakut-nakuti anak kecil yang nakal dan mereka yang tidak menurut akan diculik dan dibawa pergi. Knecht Ruprecht wujudnya adalah orang hitam berjanggut. Di Belanda dan Belgia, Knecht Ruprecht dikenal dengan sebutan Piet ...

 

Содержание 1 Общая информация 2 Сотрудники 3 Одноимённые издания 4 Ссылки 5 См. также 6 Примечания Оде́сский листо́к — популярная газета либерального направления, выходившая на русском языке в городе Одесса (Украина) с 30 ноября 1880 до февраля 1920 года. В конце 1890-х годов тираж ...

2006 single by GodsmackThe EnemySingle by Godsmackfrom the album IV ReleasedOctober 31, 2006Recorded2005Genre Heavy metal alternative metal Length4:07LabelRepublic/UniversalSongwriter(s)Sully ErnaProducer(s)Sully Erna, Andy JohnsGodsmack singles chronology Shine Down (2006) The Enemy (2006) Good Times Bad Times (2007) The Enemy is a song by American rock band Godsmack and the last single from their album IV. After its release in October 2006, the song landed at number four on the Mainstream R...

 

Lunar lander used for Apollo 11 EaglePart of Apollo 11Eagle at Tranquility Base, July 20, 1969.Neil Armstrong photographs Buzz Aldrin.TypeLunar moduleClassApollo Lunar ModuleManufacturerGrummanSpecificationsLaunch mass33,294.5 lb (15,102.1 kg)[1]HistoryFateAscent stage: Abandoned in lunar orbit; impact location unknownDescent stage: Landed at Tranquility Base; still there Part of a series onApollo 11 Crew Neil Armstrong · Buzz Aldrin · Michael Collins Spacecraft CM-107 Col...

 

Relief pada Angkor Wat yang menggambarkan arwah orang mati tengah dibakar di Naraka. Naraka (Sanskerta: नरक) adalah alam neraka dalam agama India. Menurut beberapa aliran Hindu, Sikh, Jainisme, dan Budha, Naraka adalah tempat penyiksaan. Kata Neraka (modifikasi dari Naraka) dalam bahasa Indonesia dan Malaysia juga telah digunakan untuk menjelaskan konsep tentang Naraka dalam Islam.[1] Lalu, makhluk yang konon tinggal di dunia ini sering disebut sebagai Narakas. Makhluk-makhl...

Sony Xperia EPembuatSony Mobile CommunicationsSeriXperia NXTJaringanGSM 850 / 900 / 1800 / 1900HSDPA 900 / 2100 - C1505HSDPA 850 / 1900 / 2100 - C1504TerkaitSony Xperia tipo, Sony Xperia E dualTipeSmartphoneDimensi113,5 mm (4,47 in) H 61,8 mm (2,43 in) W 11 mm (0,43 in) DBerat115,7 g (4,08 oz)Sistem OperasiAndroid v4.1CPU1 GHz Cortex-A5GPUAdreno 200Memori512 MB RAMPenyimpanan512 MB RAM 4 GB (2 GB user available)Kartu ExternalmicroSD, up to 32 GBBateraiS...

 

The Daily NewsBatavia Daily News, December 16, 1880TypeDaily newspaper, except Sunday, MondayFormatBroadsheetOwner(s)Johnson Newspaper CorporationPublisherMichael MesserlyEditorBen BeagleFoundedJune 25, 1878LanguageAmerican EnglishHeadquartersBatavia, New YorkCountryUnited StatesCirculation7,758 (as of 2017)[1]ISSN1536-6901OCLC number9659012 Websitethedailynewsonline.comMedia of the United StatesList of newspapers The Daily News is an American, English language newspaper serving B...

 

Questa voce sull'argomento afrosoricidi è solo un abbozzo. Contribuisci a migliorarla secondo le convenzioni di Wikipedia. Come leggere il tassoboxTalpa dorata del CongoStato di conservazioneDati insufficienti[1] Classificazione scientificaDominioEukaryota RegnoAnimalia PhylumChordata ClasseMammalia SottoclasseTheria InfraclasseEutheria SuperordineAfrotheria OrdineAfrosoricida SottordineChrysochloridea FamigliaChrysochloridae GenereHuetia SpecieH. leucorhina Nomenclatura binomi...

Королевская корона Испании и скипетр Геральдический символ испанской короны Королевская корона Испании (исп. Corona real de España) — атрибут власти монархов Испании, относится к двум понятиям:геральдическая корона, которая является символом королевской власти, но не имее...

 

У этого термина существуют и другие значения, см. Славянка. Усть-Славянка 59°49′20″ с. ш. 30°32′30″ в. д.HGЯO Город Санкт-Петербург Административный район города Невский Первое упоминание XIV Прежний статус мыза, деревня, село, посёлок Год включения в черту города 1963 Пр...

 

Development strategy for Greater London Not to be confused with the historical County of London Plan or Greater London Plan. This article needs to be updated. The reason given is: the Infobox, #Objectives section and #Policies section do not fully include the 2021 London Plan. Please help update this article to reflect recent events or newly available information. (September 2023) The London Plan Cover of the 2016 London PlanAuthorMayor of LondonCountryEngland and United KingdomLanguageEnglis...

High speed rail in Uzbekistan currently consists of 600 km of track and services using Talgo 250 equipment, branded Afrosiyob by operator Uzbekistan Railways, on upgraded conventional lines. All HSR lines have been built using upgraded lines on Russian gauge. Other regional railways exist.[1][2] The country currently has two interoperated lines: Tashkent–Samarkand high-speed rail line, opened 2011 using HSR capable trains while upgrading taking over 2.5 hours, in 2013 ...

 

Part of a series on theMilitary history of Canada History of... Canadian Armed Forces Army Navy Air Force Crown and Forces Militia Colonial New France Acadia Nova Scotia Peacekeeping Conflicts Beaver Wars Anglo-French War) Acadian Civil War Anglo-Dutch Wars King William's War Queen Anne's War Father Rale's War King George's War Father Le Loutre's War Seven Years' War American Revolutionary War French Revolutionary Wars War of 1812 Pemmican War Rebellions of 1837–1838 Fraser Canyon War Chil...

 

American journalist David BarbozaNationalityAmericanEducationBoston University (BA)OccupationJournalistEmployerThe Wire ChinaAwardsPulitzer Prize for Explanatory Reporting This biography of a living person needs additional citations for verification. Please help by adding reliable sources. Contentious material about living persons that is unsourced or poorly sourced must be removed immediately from the article and its talk page, especially if potentially libelous.Find sources: David Barb...

Yukimi MatsuoLahirYukimi Matsuo20 Oktober 1987 (umur 36)Prefektur Mie, JepangTinggi173 m (567 ft 7 in)GelarMiss Universe Japan 2013Pemenang kontes kecantikanWarna rambutHitamKompetisiutamaMiss Universe Japan 2013(Pemenang)Miss Universe 2013(Tak meraih peringkat) Yukimi Matsuo (松尾 幸実code: ja is deprecated , Matsuo Yukimi, lahir 20 Oktober 1987) adalah seorang pemeran, peraga busana dan pemegang gelar kontes kecantikan. Ia dimahkotai menjadi Miss Universe Japan 2013...

 

Triumphal arch in Berlin, Germany This article is about the gate in Berlin. For other uses, see Brandenburg Gate (disambiguation). Brandenburg GateBrandenburger TorView from the Pariser Platz on the east sideGeneral informationTypeCity gateArchitectural styleNeoclassicalLocationBerlin, GermanyCoordinates52°30′59″N 13°22′40″E / 52.5163°N 13.3777°E / 52.5163; 13.3777Construction started1788Completed1791Design and constructionArchitect(s)Carl Gotthard Langhans...

 

يو-371 الجنسية  ألمانيا النازية الشركة الصانعة أتش دي دبليو  المالك  كريغسمارينه المشغل كريغسمارينه[1][2]  المشغلون الحاليون وسيط property غير متوفر. المشغلون السابقون وسيط property غير متوفر. التكلفة وسيط property غير متوفر. منظومة التعاريف الاَلية للسفينة وسيط property �...

District municipality in Limpopo, South AfricaSekhukhuneDistrict municipality Coat of armsLocation in South AfricaCountrySouth AfricaProvinceLimpopoSeatGroblersdalLocal municipalities List Fetakgomo/TubatseEphraim MogaleElias MotsoalediMakhuduthamaga Government[1] • TypeMunicipal council • MayorCllr Maleke MokganyetjiArea • Total13,528 km2 (5,223 sq mi)Population (2011)[2] • Total1,076,840 • Densi...

 

English footballer and manager (born 1975) Graham Potter Potter with Brighton & Hove Albion in 2022Personal informationFull name Graham Stephen Potter[1]Date of birth (1975-05-20) 20 May 1975 (age 49)[1]Place of birth Solihull, EnglandHeight 6 ft 1 in (1.85 m)[2]Position(s) Left-back[1]Senior career*Years Team Apps (Gls)1992–1993 Birmingham City 25 (2)1993 → Wycombe Wanderers (loan) 3 (0)1993–1996 Stoke City 45 (1)1996–1997 South...