VirtualBox

source: vbox/trunk/src/VBox/HostServices/SharedFolders/shfl.h@ 105745

Last change on this file since 105745 was 105087, checked in by vboxsync, 8 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: 3.5 KB
Line 
1/** @file
2 * Shared Folders: Main header - Common data and function prototypes definitions.
3 */
4
5/*
6 * Copyright (C) 2006-2023 Oracle and/or its affiliates.
7 *
8 * This file is part of VirtualBox base platform packages, as
9 * available from https://www.virtualbox.org.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation, in version 3 of the
14 * License.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, see <https://www.gnu.org/licenses>.
23 *
24 * SPDX-License-Identifier: GPL-3.0-only
25 */
26
27#ifndef VBOX_INCLUDED_SRC_SharedFolders_shfl_h
28#define VBOX_INCLUDED_SRC_SharedFolders_shfl_h
29#ifndef RT_WITHOUT_PRAGMA_ONCE
30# pragma once
31#endif
32
33#include <VBox/err.h>
34#include <VBox/hgcmsvc.h>
35#include <VBox/shflsvc.h>
36
37#include <VBox/log.h>
38
39/** Shared Folders client flags.
40 * @{
41 */
42/** Client has queried mappings at least once and, therefore, the service can
43 * process its other requests too. */
44#define SHFL_CF_MAPPINGS_QUERIED (0x00000001)
45/** Mappings have been changed since last query. */
46#define SHFL_CF_MAPPINGS_CHANGED (0x00000002)
47/** Client uses UTF8 encoding, if not set then unicode 16 bit (UCS2) is used. */
48#define SHFL_CF_UTF8 (0x00000004)
49/** Client both supports and wants to use symlinks. */
50#define SHFL_CF_SYMLINKS (0x00000008)
51/** The call to SHFL_FN_WAIT_FOR_MAPPINGS_CHANGES will return immediately
52 * because of a SHFL_FN_CANCEL_MAPPINGS_CHANGES_WAITS call. */
53#define SHFL_CF_CANCEL_NEXT_WAIT (0x00000010)
54/** @} */
55
56/**
57 * @note This structure is dumped directly into the saved state, so care must be
58 * taken when extending it!
59 */
60typedef struct SHFLCLIENTDATA
61{
62 /** Client flags */
63 uint32_t fu32Flags;
64 /** Path delimiter. */
65 RTUTF16 PathDelimiter;
66 /** The error style, SHFLERRORSTYLE. */
67 uint8_t enmErrorStyle;
68 /** Set if the client has mapping usage counts.
69 * This is for helping with saved state. */
70 uint8_t fHasMappingCounts;
71 /** Mapping counts for each root ID so we can unmap the folders when the
72 * session disconnects or the VM resets. */
73 uint16_t acMappings[SHFL_MAX_MAPPINGS];
74} SHFLCLIENTDATA;
75/** Pointer to a SHFLCLIENTDATA structure. */
76typedef SHFLCLIENTDATA *PSHFLCLIENTDATA;
77
78/** This enum is included here to avoid a build dependency on the VirtualBox
79 * COM definitions pulled in by VBox/com/VirtualBox.h. */
80typedef enum SymlinkPolicy_T {
81 SymlinkPolicy_None,
82 SymlinkPolicy_Forbidden,
83 SymlinkPolicy_AllowedInShareSubtree,
84 SymlinkPolicy_AllowedToRelativeTargets,
85 SymlinkPolicy_AllowedToAnyTarget,
86#ifdef VBOX_WITH_XPCOM_CPP_ENUM_HACK
87 SymlinkPolicy_32BitHack = 0x7fffffff
88#endif /* VBOX_WITH_XPCOM_CPP_ENUM_HACK */
89} SymlinkPolicy_T;
90
91/** @def SHFL_CLIENT_NEED_WINDOWS_ERROR_STYLE_ADJUST_ON_POSIX
92 * Whether to make windows error style adjustments on a posix host.
93 * This always returns false on windows hosts. */
94#ifdef RT_OS_WINDOWS
95# define SHFL_CLIENT_NEED_WINDOWS_ERROR_STYLE_ADJUST_ON_POSIX(a_pClient) (false)
96#else
97# define SHFL_CLIENT_NEED_WINDOWS_ERROR_STYLE_ADJUST_ON_POSIX(a_pClient) ((a_pClient)->enmErrorStyle == kShflErrorStyle_Windows)
98#endif
99
100#endif /* !VBOX_INCLUDED_SRC_SharedFolders_shfl_h */
101
Note: See TracBrowser for help on using the repository browser.

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