VirtualBox

source: vbox/trunk/src/VBox/HostServices/SharedFolders/mappings.h@ 105016

Last change on this file since 105016 was 105016, checked in by vboxsync, 5 months ago

doc/manual,include/VBox,Frontends/VBoxManage,HostServices/SharedFolders,
Main/{include,SharedFolder,Console,Machine,VirtualBox.xidl}: Add a
new attribute to ISharedFolder for specifying a symbolic link creation
policy to restrict the source pathname when creating symbolic links
within a guest. The symbolic link policies are represented by a new
enumeration of type SymlinkPolicy_T which includes values for no
restrictions ('any'), symlink sources only within the subtree of the
share ('subtree'), symlink sources as any relative path ('relative'),
and no symlinks allowed ('forbidden'). The symlink policy can only be
applied to permanent shared folders at this stage. bugref:10619

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.6 KB
Line 
1/* $Id: mappings.h 105016 2024-06-25 10:28:21Z vboxsync $ */
2/** @file
3 * Shared folders service - Mappings header.
4 */
5
6/*
7 * Copyright (C) 2006-2023 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef VBOX_INCLUDED_SRC_SharedFolders_mappings_h
29#define VBOX_INCLUDED_SRC_SharedFolders_mappings_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34#include "shfl.h"
35#include <VBox/shflsvc.h>
36
37typedef struct
38{
39 char *pszFolderName; /**< Directory at the host to share with the guest. */
40 PSHFLSTRING pMapName; /**< Share name for the guest. */
41 uint32_t cMappings; /**< Number of mappings. */
42 bool fValid; /**< Mapping entry is used/valid. */
43 bool fHostCaseSensitive; /**< Host file name space is case-sensitive. */
44 bool fGuestCaseSensitive; /**< Guest file name space is case-sensitive. */
45 bool fWritable; /**< Folder is writable for the guest. */
46 PSHFLSTRING pAutoMountPoint; /**< Where the guest should try auto-mount the folder. */
47 bool fAutoMount; /**< Folder will be auto-mounted by the guest. */
48 bool fSymlinksCreate; /**< Guest is able to create symlinks. */
49 bool fMissing; /**< Mapping not invalid but host path does not exist.
50 Any guest operation on such a folder fails! */
51 bool fPlaceholder; /**< Mapping does not exist in the VM settings but the guest
52 still has. fMissing is always true for this mapping. */
53 bool fLoadedRootId; /**< Set if vbsfMappingLoaded has found this mapping already. */
54 SymlinkPolicy_T enmSymlinkPolicy; /**< Symbolic link creation policy within the guest. */
55} MAPPING;
56/** Pointer to a MAPPING structure. */
57typedef MAPPING *PMAPPING;
58
59void vbsfMappingInit(void);
60
61bool vbsfMappingQuery(uint32_t iMapping, PMAPPING *pMapping);
62
63int vbsfMappingsAdd(const char *pszFolderName, PSHFLSTRING pMapName, bool fWritable,
64 bool fAutoMount, PSHFLSTRING pAutoMountPoint, bool fCreateSymlinks, bool fMissing, bool fPlaceholder,
65 SymlinkPolicy_T enmSymlinkPolicy);
66int vbsfMappingsRemove(PSHFLSTRING pMapName);
67
68int vbsfMappingsQuery(PSHFLCLIENTDATA pClient, bool fOnlyAutoMounts, PSHFLMAPPING pMappings, uint32_t *pcMappings);
69int vbsfMappingsQueryName(PSHFLCLIENTDATA pClient, SHFLROOT root, SHFLSTRING *pString);
70int vbsfMappingsQueryWritable(PSHFLCLIENTDATA pClient, SHFLROOT root, bool *fWritable);
71int vbsfMappingsQueryAutoMount(PSHFLCLIENTDATA pClient, SHFLROOT root, bool *fAutoMount);
72int vbsfMappingsQuerySymlinksCreate(PSHFLCLIENTDATA pClient, SHFLROOT root, bool *fSymlinksCreate);
73int vbsfMappingsQuerySymlinkPolicy(PSHFLCLIENTDATA pClient, SHFLROOT root, SymlinkPolicy_T *enmSymlinkPolicy);
74int vbsfMappingsQueryInfo(PSHFLCLIENTDATA pClient, SHFLROOT root, PSHFLSTRING pNameBuf, PSHFLSTRING pMntPtBuf,
75 uint64_t *pfFlags, uint32_t *puVersion);
76
77int vbsfMapFolder(PSHFLCLIENTDATA pClient, PSHFLSTRING pszMapName, RTUTF16 delimiter,
78 bool fCaseSensitive, SHFLROOT *pRoot);
79int vbsfUnmapFolder(PSHFLCLIENTDATA pClient, SHFLROOT root);
80
81int vbsfMappingsWaitForChanges(PSHFLCLIENTDATA pClient, VBOXHGCMCALLHANDLE hCall, PVBOXHGCMSVCPARM pParm, bool fRestored);
82int vbsfMappingsCancelChangesWaits(PSHFLCLIENTDATA pClient);
83
84const char* vbsfMappingsQueryHostRoot(SHFLROOT root);
85int vbsfMappingsQueryHostRootEx(SHFLROOT hRoot, const char **ppszRoot, uint32_t *pcbRootLen);
86bool vbsfIsGuestMappingCaseSensitive(SHFLROOT root);
87bool vbsfIsHostMappingCaseSensitive(SHFLROOT root);
88
89void vbsfMappingLoadingStart(void);
90int vbsfMappingLoaded(MAPPING const *pLoadedMapping, SHFLROOT root);
91void vbsfMappingLoadingDone(void);
92PMAPPING vbsfMappingGetByRoot(SHFLROOT root);
93
94#endif /* !VBOX_INCLUDED_SRC_SharedFolders_mappings_h */
95
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette