Steve Kondik | 2111ad7 | 2013-07-07 12:07:44 -0700 | [diff] [blame] | 1 | /* |
| 2 | * xattrs.h : definitions related to system extended attributes |
| 3 | * |
| 4 | * Copyright (c) 2010 Jean-Pierre Andre |
| 5 | * |
| 6 | * This program/include file is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License as published |
| 8 | * by the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program/include file is distributed in the hope that it will be |
| 12 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty |
| 13 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program (in the main directory of the NTFS-3G |
| 18 | * distribution in the file COPYING); if not, write to the Free Software |
| 19 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 20 | */ |
| 21 | |
| 22 | #ifndef _NTFS_XATTR_H_ |
| 23 | #define _NTFS_XATTR_H_ |
| 24 | |
| 25 | /* |
| 26 | * Identification of data mapped to the system name space |
| 27 | */ |
| 28 | |
| 29 | enum SYSTEMXATTRS { |
| 30 | XATTR_UNMAPPED, |
| 31 | XATTR_NTFS_ACL, |
| 32 | XATTR_NTFS_ATTRIB, |
| 33 | XATTR_NTFS_ATTRIB_BE, |
| 34 | XATTR_NTFS_EFSINFO, |
| 35 | XATTR_NTFS_REPARSE_DATA, |
| 36 | XATTR_NTFS_OBJECT_ID, |
| 37 | XATTR_NTFS_DOS_NAME, |
| 38 | XATTR_NTFS_TIMES, |
| 39 | XATTR_NTFS_TIMES_BE, |
| 40 | XATTR_NTFS_CRTIME, |
| 41 | XATTR_NTFS_CRTIME_BE, |
Steve Kondik | 79165c3 | 2015-11-09 19:43:00 -0800 | [diff] [blame] | 42 | XATTR_NTFS_EA, |
Steve Kondik | 2111ad7 | 2013-07-07 12:07:44 -0700 | [diff] [blame] | 43 | XATTR_POSIX_ACC, |
| 44 | XATTR_POSIX_DEF |
| 45 | } ; |
| 46 | |
| 47 | struct XATTRMAPPING { |
| 48 | struct XATTRMAPPING *next; |
| 49 | enum SYSTEMXATTRS xattr; |
| 50 | char name[1]; /* variable length */ |
| 51 | } ; |
| 52 | |
| 53 | #ifdef XATTR_MAPPINGS |
| 54 | |
| 55 | struct XATTRMAPPING *ntfs_xattr_build_mapping(ntfs_volume *vol, |
| 56 | const char *path); |
| 57 | void ntfs_xattr_free_mapping(struct XATTRMAPPING*); |
| 58 | |
| 59 | #endif /* XATTR_MAPPINGS */ |
| 60 | |
| 61 | enum SYSTEMXATTRS ntfs_xattr_system_type(const char *name, |
| 62 | ntfs_volume *vol); |
| 63 | |
| 64 | int ntfs_xattr_system_getxattr(struct SECURITY_CONTEXT *scx, |
| 65 | enum SYSTEMXATTRS attr, |
| 66 | ntfs_inode *ni, ntfs_inode *dir_ni, |
| 67 | char *value, size_t size); |
| 68 | int ntfs_xattr_system_setxattr(struct SECURITY_CONTEXT *scx, |
| 69 | enum SYSTEMXATTRS attr, |
| 70 | ntfs_inode *ni, ntfs_inode *dir_ni, |
| 71 | const char *value, size_t size, int flags); |
| 72 | int ntfs_xattr_system_removexattr(struct SECURITY_CONTEXT *scx, |
| 73 | enum SYSTEMXATTRS attr, |
| 74 | ntfs_inode *ni, ntfs_inode *dir_ni); |
| 75 | |
| 76 | #endif /* _NTFS_XATTR_H_ */ |