178
178
#define HGFS_PERM_WRITE 2
179
179
#define HGFS_PERM_EXEC 1
184
* Different operating systems have different set of file access mode.
185
* Here are constants that are rich enough to describe all access modes in an OS
189
typedef uint32 HgfsAccessMode;
191
* Generic access rights control coarse grain access for the file.
192
* A particular generic rigth can be expanded into different set of specific rights
197
* HGFS_MODE_GENERIC_READ means ability to read file data and read various file
198
* attributes and properties.
200
#define HGFS_MODE_GENERIC_READ (1 << 0)
202
* HGFS_MODE_GENERIC_WRITE means ability to write file data and updaate various file
203
* attributes and properties.
205
#define HGFS_MODE_GENERIC_WRITE (1 << 1)
207
* HGFS_MODE_GENERIC_EXECUE means ability to execute file. For network redirectors
208
* ability to execute usualy implies ability to read data; for local file systems
209
* HGFS_MODE_GENERIC_EXECUTE does not imply ability to read data.
211
#define HGFS_MODE_GENERIC_EXECUTE (1 << 2)
213
/* Specific rights define fine grain access modes. */
214
#define HGFS_MODE_READ_DATA (1 << 3) // Ability to read file data
215
#define HGFS_MODE_WRITE_DATA (1 << 4) // Ability to writge file data
216
#define HGFS_MODE_APPEND_DATA (1 << 5) // Appending data to the end of file
217
#define HGFS_MODE_DELETE (1 << 6) // Ability to delete the file
218
#define HGFS_MODE_TRAVERSE_DIRECTORY (1 << 7) // Ability to access files in a directory
219
#define HGFS_MODE_LIST_DIRECTORY (1 << 8) // Ability to list file names
220
#define HGFS_MODE_ADD_SUBDIRECTORY (1 << 9) // Ability to create a new subdirectory
221
#define HGFS_MODE_ADD_FILE (1 << 10) // Ability to create a new file
222
#define HGFS_MODE_DELETE_CHILD (1 << 11) // Ability to delete file/subdirectory
223
#define HGFS_MODE_READ_ATTRIBUTES (1 << 12) // Ability to read attributes
224
#define HGFS_MODE_WRITE_ATTRIBUTES (1 << 13) // Ability to write attributes
225
#define HGFS_MODE_READ_EXTATTRIBUTES (1 << 14) // Ability to read extended attributes
226
#define HGFS_MODE_WRITE_EXTATTRIBUTES (1 << 15) // Ability to write extended attributes
227
#define HGFS_MODE_READ_SECURITY (1 << 16) // Ability to read permissions/ACLs/owner
228
#define HGFS_MODE_WRITE_SECURITY (1 << 17) // Ability to change permissions/ACLs
229
#define HGFS_MODE_TAKE_OWNERSHIP (1 << 18) // Ability to change file owner/group
183
232
* Server-side locking (oplocks and leases).
356
405
* only to determine if the ID is valid.
358
407
#define HGFS_ATTR_VALID_NON_STATIC_FILEID (1 << 16)
409
* File permissions that are in effect for the user which runs HGFS server.
410
* Client needs to know effective permissions in order to implement access(2).
411
* Client can't derive it from group/owner/other permissions because of two resaons:
412
* 1. It does not know user/group id of the user which runs HGFS server
413
* 2. Effective permissions account for additional restrictions that may be imposed
414
* by host file system, for example by ACL.
416
#define HGFS_ATTR_VALID_EFFECTIVE_PERMS (1 << 17)
400
458
uint32 groupId; /* group identifier, ignored by Windows */
401
459
uint64 hostFileId; /* File Id of the file on host: inode_t on Linux */
402
460
uint32 volumeId; /* volume identifier, non-zero is valid. */
403
uint32 reserved1; /* Reserved for future use */
461
uint32 effectivePerms; /* Permissions in effect for the user on the host. */
404
462
uint64 reserved2; /* Reserved for future use */
406
464
#include "vmware_pack_end.h"