Merge tag 'upstream/0.9.1_20161126+git589b29f'
Upstream version 0.9.1~20161126+git589b29f
Dominik George
7 years ago
415 | 415 | |
416 | 416 | #if defined(XRDP_ENABLE_IPV6) |
417 | 417 | rv = (int)socket(AF_INET6, SOCK_STREAM, 0); |
418 | if (rv < 0) | |
419 | { | |
420 | log_message(LOG_LEVEL_ERROR, "g_tcp_socket: %s", g_get_strerror()); | |
421 | ||
422 | switch (errno) | |
423 | { | |
424 | case EAFNOSUPPORT: /* if IPv6 not supported, retry IPv4 */ | |
425 | log_message(LOG_LEVEL_INFO, "IPv6 not supported, falling back to IPv4"); | |
426 | rv = (int)socket(AF_INET, SOCK_STREAM, 0); | |
427 | break; | |
428 | ||
429 | default: | |
430 | return -1; | |
431 | } | |
432 | } | |
418 | 433 | #else |
419 | 434 | rv = (int)socket(AF_INET, SOCK_STREAM, 0); |
420 | 435 | #endif |
421 | 436 | if (rv < 0) |
422 | 437 | { |
438 | log_message(LOG_LEVEL_ERROR, "g_tcp_socket: %s", g_get_strerror()); | |
423 | 439 | return -1; |
424 | 440 | } |
425 | 441 | #if defined(XRDP_ENABLE_IPV6) |
1034 | 1050 | int APP_CC |
1035 | 1051 | g_tcp_accept(int sck) |
1036 | 1052 | { |
1037 | int ret ; | |
1038 | char ipAddr[256] ; | |
1039 | struct sockaddr_in s; | |
1040 | socklen_t i; | |
1041 | ||
1042 | i = sizeof(struct sockaddr_in); | |
1043 | memset(&s, 0, i); | |
1044 | ret = accept(sck, (struct sockaddr *)&s, &i); | |
1045 | if(ret>0) | |
1046 | { | |
1047 | snprintf(ipAddr, 255, "A connection received from: %s port %d", | |
1048 | inet_ntoa(s.sin_addr), ntohs(s.sin_port)); | |
1049 | log_message(LOG_LEVEL_INFO, "%s", ipAddr); | |
1050 | } | |
1051 | return ret ; | |
1053 | int ret; | |
1054 | char msg[256]; | |
1055 | union | |
1056 | { | |
1057 | struct sockaddr sock_addr; | |
1058 | struct sockaddr_in sock_addr_in; | |
1059 | #if defined(XRDP_ENABLE_IPV6) | |
1060 | struct sockaddr_in6 sock_addr_in6; | |
1061 | #endif | |
1062 | } sock_info; | |
1063 | ||
1064 | socklen_t sock_len = sizeof(sock_info); | |
1065 | memset(&sock_info, 0, sock_len); | |
1066 | ||
1067 | ret = accept(sck, (struct sockaddr *)&sock_info, &sock_len); | |
1068 | ||
1069 | if (ret > 0) | |
1070 | { | |
1071 | switch(sock_info.sock_addr.sa_family) | |
1072 | { | |
1073 | case AF_INET: | |
1074 | { | |
1075 | struct sockaddr_in *sock_addr_in = &sock_info.sock_addr_in; | |
1076 | ||
1077 | snprintf(msg, sizeof(msg), "A connection received from %s port %d", | |
1078 | inet_ntoa(sock_addr_in->sin_addr), | |
1079 | ntohs(sock_addr_in->sin_port)); | |
1080 | log_message(LOG_LEVEL_INFO, "%s", msg); | |
1081 | ||
1082 | break; | |
1083 | } | |
1084 | ||
1085 | #if defined(XRDP_ENABLE_IPV6) | |
1086 | ||
1087 | case AF_INET6: | |
1088 | { | |
1089 | struct sockaddr_in6 *sock_addr_in6 = &sock_info.sock_addr_in6; | |
1090 | char addr[256]; | |
1091 | ||
1092 | inet_ntop(sock_addr_in6->sin6_family, | |
1093 | &sock_addr_in6->sin6_addr, addr, sizeof(addr)); | |
1094 | snprintf(msg, sizeof(msg), "A connection received from %s port %d", | |
1095 | addr, ntohs(sock_addr_in6->sin6_port)); | |
1096 | log_message(LOG_LEVEL_INFO, "%s", msg); | |
1097 | ||
1098 | break; | |
1099 | ||
1100 | } | |
1101 | ||
1102 | #endif | |
1103 | } | |
1104 | } | |
1105 | ||
1106 | return ret; | |
1052 | 1107 | } |
1053 | 1108 | |
1054 | 1109 | /*****************************************************************************/ |
1056 | 1111 | g_sck_accept(int sck, char *addr, int addr_bytes, char *port, int port_bytes) |
1057 | 1112 | { |
1058 | 1113 | int ret; |
1059 | char ipAddr[256]; | |
1060 | struct sockaddr_in s; | |
1061 | socklen_t i; | |
1062 | ||
1063 | i = sizeof(struct sockaddr_in); | |
1064 | memset(&s, 0, i); | |
1065 | ret = accept(sck, (struct sockaddr *)&s, &i); | |
1114 | char msg[256]; | |
1115 | union | |
1116 | { | |
1117 | struct sockaddr sock_addr; | |
1118 | struct sockaddr_in sock_addr_in; | |
1119 | #if defined(XRDP_ENABLE_IPV6) | |
1120 | struct sockaddr_in6 sock_addr_in6; | |
1121 | #endif | |
1122 | } sock_info; | |
1123 | ||
1124 | socklen_t sock_len = sizeof(sock_info); | |
1125 | memset(&sock_info, 0, sock_len); | |
1126 | ||
1127 | ret = accept(sck, (struct sockaddr *)&sock_info, &sock_len); | |
1128 | ||
1066 | 1129 | if (ret > 0) |
1067 | 1130 | { |
1068 | g_snprintf(ipAddr, 255, "A connection received from: %s port %d", | |
1069 | inet_ntoa(s.sin_addr), ntohs(s.sin_port)); | |
1070 | log_message(LOG_LEVEL_INFO, "%s", ipAddr); | |
1071 | if (s.sin_family == AF_INET) | |
1072 | { | |
1073 | g_snprintf(addr, addr_bytes, "%s", inet_ntoa(s.sin_addr)); | |
1074 | g_snprintf(port, port_bytes, "%d", ntohs(s.sin_port)); | |
1075 | } | |
1076 | if (s.sin_family == AF_UNIX) | |
1077 | { | |
1078 | g_strncpy(addr, "", addr_bytes - 1); | |
1079 | g_strncpy(port, "", port_bytes - 1); | |
1080 | } | |
1081 | } | |
1131 | switch(sock_info.sock_addr.sa_family) | |
1132 | { | |
1133 | case AF_INET: | |
1134 | { | |
1135 | struct sockaddr_in *sock_addr_in = &sock_info.sock_addr_in; | |
1136 | ||
1137 | g_snprintf(addr, addr_bytes, "%s", inet_ntoa(sock_addr_in->sin_addr)); | |
1138 | g_snprintf(port, port_bytes, "%d", ntohs(sock_addr_in->sin_port)); | |
1139 | ||
1140 | break; | |
1141 | } | |
1142 | ||
1143 | #if defined(XRDP_ENABLE_IPV6) | |
1144 | ||
1145 | case AF_INET6: | |
1146 | { | |
1147 | struct sockaddr_in6 *sock_addr_in6 = &sock_info.sock_addr_in6; | |
1148 | ||
1149 | inet_ntop(sock_addr_in6->sin6_family, | |
1150 | &sock_addr_in6->sin6_addr, addr, addr_bytes); | |
1151 | g_snprintf(port, port_bytes, "%d", ntohs(sock_addr_in6->sin6_port)); | |
1152 | break; | |
1153 | } | |
1154 | ||
1155 | #endif | |
1156 | ||
1157 | case AF_UNIX: | |
1158 | default: | |
1159 | { | |
1160 | g_strncpy(addr, "", addr_bytes - 1); | |
1161 | g_strncpy(port, "", port_bytes - 1); | |
1162 | break; | |
1163 | } | |
1164 | } | |
1165 | ||
1166 | ||
1167 | g_snprintf(msg, sizeof(msg), "A connection received from: %s port %s", | |
1168 | addr, port); | |
1169 | log_message(LOG_LEVEL_INFO, "%s", msg); | |
1170 | ||
1171 | } | |
1172 | ||
1082 | 1173 | return ret; |
1083 | 1174 | } |
1084 | 1175 |
254 | 254 | localstatedir="/var"; |
255 | 255 | fi |
256 | 256 | |
257 | pkgconfigdir=${libdir}/pkgconfig | |
258 | AC_SUBST(pkgconfigdir) | |
257 | PKG_INSTALLDIR | |
259 | 258 | |
260 | 259 | AC_CONFIG_FILES([ |
261 | 260 | common/Makefile |
159 | 159 | * TJPF_ARGB no works, zero bytes */ |
160 | 160 | |
161 | 161 | error = tjCompress(tj_han, /* opaque handle */ |
162 | src_ptr, /* source buf */ | |
162 | (unsigned char *) src_ptr, /* source buf */ | |
163 | 163 | cx, /* width of area to compress */ |
164 | 164 | stride, /* pitch */ |
165 | 165 | cy, /* height of area to compress */ |
166 | 166 | TJPF_XBGR, /* pixel size */ |
167 | out_data, /* dest buf */ | |
167 | (unsigned char *) out_data, /* dest buf */ | |
168 | 168 | &lio_len, /* inner_buf length & compressed_size */ |
169 | 169 | TJSAMP_420, /* jpeg sub sample */ |
170 | 170 | quality, /* jpeg quality */ |
212 | 212 | |
213 | 213 | struct mydata_comp |
214 | 214 | { |
215 | char *cb; | |
215 | JOCTET *cb; | |
216 | 216 | int cb_bytes; |
217 | 217 | int total_done; |
218 | 218 | int overwrite; |
264 | 264 | |
265 | 265 | /*****************************************************************************/ |
266 | 266 | static int APP_CC |
267 | jp_do_compress(char *data, int width, int height, int bpp, int quality, | |
268 | char *comp_data, int *comp_data_bytes) | |
267 | jp_do_compress(JOCTET *data, int width, int height, int bpp, int quality, | |
268 | JOCTET *comp_data, int *comp_data_bytes) | |
269 | 269 | { |
270 | 270 | struct jpeg_compress_struct cinfo; |
271 | 271 | struct jpeg_error_mgr jerr; |
335 | 335 | struct stream *s, struct stream *temp_s, int bpp, |
336 | 336 | int byte_limit, int e, int quality) |
337 | 337 | { |
338 | char *data; | |
338 | JOCTET *data; | |
339 | 339 | tui32 *src32; |
340 | tui16 *src16; | |
341 | 340 | tui8 *dst8; |
342 | 341 | tui32 pixel; |
343 | 342 | int red; |
347 | 346 | int i; |
348 | 347 | int cdata_bytes; |
349 | 348 | |
350 | data = temp_s->data; | |
349 | data = (JOCTET *) temp_s->data; | |
351 | 350 | dst8 = data; |
352 | 351 | |
353 | 352 | if (bpp == 24) |
379 | 378 | } |
380 | 379 | |
381 | 380 | cdata_bytes = byte_limit; |
382 | jp_do_compress(data, width + e, height, 24, quality, s->p, &cdata_bytes); | |
381 | jp_do_compress(data, width + e, height, 24, quality, (JOCTET *) s->p, | |
382 | &cdata_bytes); | |
383 | 383 | s->p += cdata_bytes; |
384 | 384 | return cdata_bytes; |
385 | 385 | } |
0 | dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- | |
1 | dnl serial 11 (pkg-config-0.29.1) | |
2 | dnl | |
3 | dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>. | |
4 | dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com> | |
5 | dnl | |
6 | dnl This program is free software; you can redistribute it and/or modify | |
7 | dnl it under the terms of the GNU General Public License as published by | |
8 | dnl the Free Software Foundation; either version 2 of the License, or | |
9 | dnl (at your option) any later version. | |
10 | dnl | |
11 | dnl This program is distributed in the hope that it will be useful, but | |
12 | dnl WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | dnl General Public License for more details. | |
15 | dnl | |
16 | dnl You should have received a copy of the GNU General Public License | |
17 | dnl along with this program; if not, write to the Free Software | |
18 | dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | |
19 | dnl 02111-1307, USA. | |
20 | dnl | |
21 | dnl As a special exception to the GNU General Public License, if you | |
22 | dnl distribute this file as part of a program that contains a | |
23 | dnl configuration script generated by Autoconf, you may include it under | |
24 | dnl the same distribution terms that you use for the rest of that | |
25 | dnl program. | |
26 | ||
27 | dnl PKG_PREREQ(MIN-VERSION) | |
28 | dnl ----------------------- | |
29 | dnl Since: 0.29 | |
30 | dnl | |
31 | dnl Verify that the version of the pkg-config macros are at least | |
32 | dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's | |
33 | dnl installed version of pkg-config, this checks the developer's version | |
34 | dnl of pkg.m4 when generating configure. | |
35 | dnl | |
36 | dnl To ensure that this macro is defined, also add: | |
37 | dnl m4_ifndef([PKG_PREREQ], | |
38 | dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) | |
39 | dnl | |
40 | dnl See the "Since" comment for each macro you use to see what version | |
41 | dnl of the macros you require. | |
42 | m4_defun([PKG_PREREQ], | |
43 | [m4_define([PKG_MACROS_VERSION], [0.29.1]) | |
44 | m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, | |
45 | [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) | |
46 | ])dnl PKG_PREREQ | |
47 | ||
48 | dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) | |
49 | dnl ---------------------------------- | |
50 | dnl Since: 0.16 | |
51 | dnl | |
52 | dnl Search for the pkg-config tool and set the PKG_CONFIG variable to | |
53 | dnl first found in the path. Checks that the version of pkg-config found | |
54 | dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is | |
55 | dnl used since that's the first version where most current features of | |
56 | dnl pkg-config existed. | |
57 | AC_DEFUN([PKG_PROG_PKG_CONFIG], | |
58 | [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) | |
59 | m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) | |
60 | m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) | |
61 | AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) | |
62 | AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) | |
63 | AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) | |
64 | ||
65 | if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then | |
66 | AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) | |
67 | fi | |
68 | if test -n "$PKG_CONFIG"; then | |
69 | _pkg_min_version=m4_default([$1], [0.9.0]) | |
70 | AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) | |
71 | if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then | |
72 | AC_MSG_RESULT([yes]) | |
73 | else | |
74 | AC_MSG_RESULT([no]) | |
75 | PKG_CONFIG="" | |
76 | fi | |
77 | fi[]dnl | |
78 | ])dnl PKG_PROG_PKG_CONFIG | |
79 | ||
80 | dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) | |
81 | dnl ------------------------------------------------------------------- | |
82 | dnl Since: 0.18 | |
83 | dnl | |
84 | dnl Check to see whether a particular set of modules exists. Similar to | |
85 | dnl PKG_CHECK_MODULES(), but does not set variables or print errors. | |
86 | dnl | |
87 | dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) | |
88 | dnl only at the first occurence in configure.ac, so if the first place | |
89 | dnl it's called might be skipped (such as if it is within an "if", you | |
90 | dnl have to call PKG_CHECK_EXISTS manually | |
91 | AC_DEFUN([PKG_CHECK_EXISTS], | |
92 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl | |
93 | if test -n "$PKG_CONFIG" && \ | |
94 | AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then | |
95 | m4_default([$2], [:]) | |
96 | m4_ifvaln([$3], [else | |
97 | $3])dnl | |
98 | fi]) | |
99 | ||
100 | dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) | |
101 | dnl --------------------------------------------- | |
102 | dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting | |
103 | dnl pkg_failed based on the result. | |
104 | m4_define([_PKG_CONFIG], | |
105 | [if test -n "$$1"; then | |
106 | pkg_cv_[]$1="$$1" | |
107 | elif test -n "$PKG_CONFIG"; then | |
108 | PKG_CHECK_EXISTS([$3], | |
109 | [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` | |
110 | test "x$?" != "x0" && pkg_failed=yes ], | |
111 | [pkg_failed=yes]) | |
112 | else | |
113 | pkg_failed=untried | |
114 | fi[]dnl | |
115 | ])dnl _PKG_CONFIG | |
116 | ||
117 | dnl _PKG_SHORT_ERRORS_SUPPORTED | |
118 | dnl --------------------------- | |
119 | dnl Internal check to see if pkg-config supports short errors. | |
120 | AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], | |
121 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) | |
122 | if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then | |
123 | _pkg_short_errors_supported=yes | |
124 | else | |
125 | _pkg_short_errors_supported=no | |
126 | fi[]dnl | |
127 | ])dnl _PKG_SHORT_ERRORS_SUPPORTED | |
128 | ||
129 | ||
130 | dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], | |
131 | dnl [ACTION-IF-NOT-FOUND]) | |
132 | dnl -------------------------------------------------------------- | |
133 | dnl Since: 0.4.0 | |
134 | dnl | |
135 | dnl Note that if there is a possibility the first call to | |
136 | dnl PKG_CHECK_MODULES might not happen, you should be sure to include an | |
137 | dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac | |
138 | AC_DEFUN([PKG_CHECK_MODULES], | |
139 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl | |
140 | AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl | |
141 | AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl | |
142 | ||
143 | pkg_failed=no | |
144 | AC_MSG_CHECKING([for $1]) | |
145 | ||
146 | _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) | |
147 | _PKG_CONFIG([$1][_LIBS], [libs], [$2]) | |
148 | ||
149 | m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS | |
150 | and $1[]_LIBS to avoid the need to call pkg-config. | |
151 | See the pkg-config man page for more details.]) | |
152 | ||
153 | if test $pkg_failed = yes; then | |
154 | AC_MSG_RESULT([no]) | |
155 | _PKG_SHORT_ERRORS_SUPPORTED | |
156 | if test $_pkg_short_errors_supported = yes; then | |
157 | $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` | |
158 | else | |
159 | $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` | |
160 | fi | |
161 | # Put the nasty error message in config.log where it belongs | |
162 | echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD | |
163 | ||
164 | m4_default([$4], [AC_MSG_ERROR( | |
165 | [Package requirements ($2) were not met: | |
166 | ||
167 | $$1_PKG_ERRORS | |
168 | ||
169 | Consider adjusting the PKG_CONFIG_PATH environment variable if you | |
170 | installed software in a non-standard prefix. | |
171 | ||
172 | _PKG_TEXT])[]dnl | |
173 | ]) | |
174 | elif test $pkg_failed = untried; then | |
175 | AC_MSG_RESULT([no]) | |
176 | m4_default([$4], [AC_MSG_FAILURE( | |
177 | [The pkg-config script could not be found or is too old. Make sure it | |
178 | is in your PATH or set the PKG_CONFIG environment variable to the full | |
179 | path to pkg-config. | |
180 | ||
181 | _PKG_TEXT | |
182 | ||
183 | To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl | |
184 | ]) | |
185 | else | |
186 | $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS | |
187 | $1[]_LIBS=$pkg_cv_[]$1[]_LIBS | |
188 | AC_MSG_RESULT([yes]) | |
189 | $3 | |
190 | fi[]dnl | |
191 | ])dnl PKG_CHECK_MODULES | |
192 | ||
193 | ||
194 | dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], | |
195 | dnl [ACTION-IF-NOT-FOUND]) | |
196 | dnl --------------------------------------------------------------------- | |
197 | dnl Since: 0.29 | |
198 | dnl | |
199 | dnl Checks for existence of MODULES and gathers its build flags with | |
200 | dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags | |
201 | dnl and VARIABLE-PREFIX_LIBS from --libs. | |
202 | dnl | |
203 | dnl Note that if there is a possibility the first call to | |
204 | dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to | |
205 | dnl include an explicit call to PKG_PROG_PKG_CONFIG in your | |
206 | dnl configure.ac. | |
207 | AC_DEFUN([PKG_CHECK_MODULES_STATIC], | |
208 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl | |
209 | _save_PKG_CONFIG=$PKG_CONFIG | |
210 | PKG_CONFIG="$PKG_CONFIG --static" | |
211 | PKG_CHECK_MODULES($@) | |
212 | PKG_CONFIG=$_save_PKG_CONFIG[]dnl | |
213 | ])dnl PKG_CHECK_MODULES_STATIC | |
214 | ||
215 | ||
216 | dnl PKG_INSTALLDIR([DIRECTORY]) | |
217 | dnl ------------------------- | |
218 | dnl Since: 0.27 | |
219 | dnl | |
220 | dnl Substitutes the variable pkgconfigdir as the location where a module | |
221 | dnl should install pkg-config .pc files. By default the directory is | |
222 | dnl $libdir/pkgconfig, but the default can be changed by passing | |
223 | dnl DIRECTORY. The user can override through the --with-pkgconfigdir | |
224 | dnl parameter. | |
225 | AC_DEFUN([PKG_INSTALLDIR], | |
226 | [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) | |
227 | m4_pushdef([pkg_description], | |
228 | [pkg-config installation directory @<:@]pkg_default[@:>@]) | |
229 | AC_ARG_WITH([pkgconfigdir], | |
230 | [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, | |
231 | [with_pkgconfigdir=]pkg_default) | |
232 | AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) | |
233 | m4_popdef([pkg_default]) | |
234 | m4_popdef([pkg_description]) | |
235 | ])dnl PKG_INSTALLDIR | |
236 | ||
237 | ||
238 | dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) | |
239 | dnl -------------------------------- | |
240 | dnl Since: 0.27 | |
241 | dnl | |
242 | dnl Substitutes the variable noarch_pkgconfigdir as the location where a | |
243 | dnl module should install arch-independent pkg-config .pc files. By | |
244 | dnl default the directory is $datadir/pkgconfig, but the default can be | |
245 | dnl changed by passing DIRECTORY. The user can override through the | |
246 | dnl --with-noarch-pkgconfigdir parameter. | |
247 | AC_DEFUN([PKG_NOARCH_INSTALLDIR], | |
248 | [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) | |
249 | m4_pushdef([pkg_description], | |
250 | [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) | |
251 | AC_ARG_WITH([noarch-pkgconfigdir], | |
252 | [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, | |
253 | [with_noarch_pkgconfigdir=]pkg_default) | |
254 | AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) | |
255 | m4_popdef([pkg_default]) | |
256 | m4_popdef([pkg_description]) | |
257 | ])dnl PKG_NOARCH_INSTALLDIR | |
258 | ||
259 | ||
260 | dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, | |
261 | dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) | |
262 | dnl ------------------------------------------- | |
263 | dnl Since: 0.28 | |
264 | dnl | |
265 | dnl Retrieves the value of the pkg-config variable for the given module. | |
266 | AC_DEFUN([PKG_CHECK_VAR], | |
267 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl | |
268 | AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl | |
269 | ||
270 | _PKG_CONFIG([$1], [variable="][$3]["], [$2]) | |
271 | AS_VAR_COPY([$1], [pkg_cv_][$1]) | |
272 | ||
273 | AS_VAR_IF([$1], [""], [$5], [$4])dnl | |
274 | ])dnl PKG_CHECK_VAR |
648 | 648 | /* insert it in xrdp fs */ |
649 | 649 | g_xrdp_fs.inode_table[xinode->inode] = xinode; |
650 | 650 | log_debug("created new share named %s at inode_table[%d]", |
651 | dirname, (int) xinode->inode); | |
651 | dirname, xinode->inode); | |
652 | 652 | |
653 | 653 | /* update nentries in parent inode */ |
654 | 654 | xinode = g_xrdp_fs.inode_table[1]; |
994 | 994 | struct xrdp_inode *xinode; |
995 | 995 | struct fuse_entry_param e; |
996 | 996 | |
997 | log_debug("parent=%d name=%s", (int) parent, name); | |
997 | log_debug("parent=%ld name=%s", parent, name); | |
998 | 998 | |
999 | 999 | /* do we have a valid parent inode? */ |
1000 | 1000 | if (!xfuse_is_inode_valid(parent)) |
1001 | 1001 | { |
1002 | log_error("inode %d is not valid", parent); | |
1002 | log_error("inode %ld is not valid", parent); | |
1003 | 1003 | fuse_reply_err(req, EBADF); |
1004 | 1004 | } |
1005 | 1005 | |
1026 | 1026 | /* insert it in xrdp fs */ |
1027 | 1027 | g_xrdp_fs.inode_table[xinode->inode] = xinode; |
1028 | 1028 | xfuse_update_xrdpfs_size(); |
1029 | log_debug("inserted new dir at inode_table[%d]", (int) xinode->inode); | |
1029 | log_debug("inserted new dir at inode_table[%d]", xinode->inode); | |
1030 | 1030 | |
1031 | 1031 | xfuse_dump_fs(); |
1032 | 1032 | |
1033 | log_debug("new inode=%d", (int) xinode->inode); | |
1033 | log_debug("new inode=%d", xinode->inode); | |
1034 | 1034 | |
1035 | 1035 | /* setup return value */ |
1036 | 1036 | memset(&e, 0, sizeof(e)); |
1070 | 1070 | continue; |
1071 | 1071 | |
1072 | 1072 | log_debug("pinode=%d inode=%d nentries=%d nopen=%d is_synced=%d name=%s", |
1073 | (int) xinode->parent_inode, (int) xinode->inode, | |
1073 | xinode->parent_inode, xinode->inode, | |
1074 | 1074 | xinode->nentries, xinode->nopen, xinode->is_synced, |
1075 | 1075 | xinode->name); |
1076 | 1076 | } |
1077 | log_debug(""); | |
1077 | log_debug("%s", ""); | |
1078 | 1078 | } |
1079 | 1079 | |
1080 | 1080 | /** |
1087 | 1087 | { |
1088 | 1088 | log_debug("--- dumping struct xinode ---"); |
1089 | 1089 | log_debug("name: %s", xino->name); |
1090 | log_debug("parent_inode: %ld", xino->parent_inode); | |
1091 | log_debug("inode: %ld", xino->inode); | |
1090 | log_debug("parent_inode: %d", xino->parent_inode); | |
1091 | log_debug("inode: %d", xino->inode); | |
1092 | 1092 | log_debug("mode: %o", xino->mode); |
1093 | 1093 | log_debug("nlink: %d", xino->nlink); |
1094 | 1094 | log_debug("uid: %d", xino->uid); |
1095 | 1095 | log_debug("gid: %d", xino->gid); |
1096 | log_debug("size: %ld", xino->size); | |
1096 | log_debug("size: %zd", xino->size); | |
1097 | 1097 | log_debug("device_id: %d", xino->device_id); |
1098 | log_debug(""); | |
1098 | log_debug("%s", ""); | |
1099 | 1099 | } |
1100 | 1100 | |
1101 | 1101 | /** |
1449 | 1449 | |
1450 | 1450 | if (!xfuse_is_inode_valid(fip->inode)) |
1451 | 1451 | { |
1452 | log_error("inode %d is not valid", fip->inode); | |
1452 | log_error("inode %ld is not valid", fip->inode); | |
1453 | 1453 | g_free(xinode); |
1454 | 1454 | return -1; |
1455 | 1455 | } |
1456 | 1456 | |
1457 | log_debug("parent_inode=%d name=%s", fip->inode, xinode->name); | |
1457 | log_debug("parent_inode=%ld name=%s", fip->inode, xinode->name); | |
1458 | 1458 | |
1459 | 1459 | /* if filename is . or .. don't add it */ |
1460 | 1460 | if ((strcmp(xinode->name, ".") == 0) || (strcmp(xinode->name, "..") == 0)) |
1467 | 1467 | |
1468 | 1468 | if ((xip = xfuse_get_inode_from_pinode_name(fip->inode, xinode->name)) != NULL) |
1469 | 1469 | { |
1470 | log_debug("inode=%d name=%s already exists in xrdp_fs; not adding it", | |
1470 | log_debug("inode=%ld name=%s already exists in xrdp_fs; not adding it", | |
1471 | 1471 | fip->inode, xinode->name); |
1472 | 1472 | g_free(xinode); |
1473 | 1473 | xip->stale = 0; |
1520 | 1520 | /* do we have a valid inode? */ |
1521 | 1521 | if (!xfuse_is_inode_valid(fip->inode)) |
1522 | 1522 | { |
1523 | log_error("inode %d is not valid", fip->inode); | |
1523 | log_error("inode %ld is not valid", fip->inode); | |
1524 | 1524 | if (fip->invoke_fuse) |
1525 | 1525 | fuse_reply_err(fip->req, EBADF); |
1526 | 1526 | goto done; |
1614 | 1614 | fh->FileId = FileId; |
1615 | 1615 | |
1616 | 1616 | fip->fi->fh = (uint64_t) ((long) fh); |
1617 | log_debug("+++ XFUSE_INFO=%p XFUSE_INFO->fi=%p XFUSE_INFO->fi->fh=%p", | |
1618 | fip, fip->fi, fip->fi->fh); | |
1617 | log_debug("+++ XFUSE_INFO=%p XFUSE_INFO->fi=%p XFUSE_INFO->fi->fh=0x%llx", | |
1618 | fip, fip->fi, (long long) fip->fi->fh); | |
1619 | 1619 | } |
1620 | 1620 | |
1621 | 1621 | if (fip->invoke_fuse) |
1640 | 1640 | #if 0 |
1641 | 1641 | if ((xinode = g_xrdp_fs.inode_table[fip->inode]) == NULL) |
1642 | 1642 | { |
1643 | log_error("inode at inode_table[%d] is NULL", fip->inode); | |
1643 | log_error("inode at inode_table[%ld] is NULL", fip->inode); | |
1644 | 1644 | fuse_reply_err(fip->req, EBADF); |
1645 | 1645 | goto done; |
1646 | 1646 | } |
1718 | 1718 | return; |
1719 | 1719 | } |
1720 | 1720 | |
1721 | log_debug("+++ XFUSE_INFO=%p, XFUSE_INFO->fi=%p XFUSE_INFO->fi->fh=%p", | |
1722 | fip, fip->fi, fip->fi->fh); | |
1721 | log_debug("+++ XFUSE_INFO=%p, XFUSE_INFO->fi=%p XFUSE_INFO->fi->fh=0x%llx", | |
1722 | fip, fip->fi, (long long) fip->fi->fh); | |
1723 | 1723 | |
1724 | 1724 | fuse_reply_write(fip->req, length); |
1725 | 1725 | |
1727 | 1727 | if ((xinode = g_xrdp_fs.inode_table[fip->inode]) != NULL) |
1728 | 1728 | xinode->size += length; |
1729 | 1729 | else |
1730 | log_error("inode at inode_table[%d] is NULL", fip->inode); | |
1730 | log_error("inode at inode_table[%ld] is NULL", fip->inode); | |
1731 | 1731 | |
1732 | 1732 | free(fip); |
1733 | 1733 | } |
1848 | 1848 | return; |
1849 | 1849 | } |
1850 | 1850 | |
1851 | log_debug("+++ XFUSE_INFO=%p XFUSE_INFO->fi=%p XFUSE_INFO->fi->fh=%p", | |
1852 | fip, fip->fi, fip->fi->fh); | |
1851 | log_debug("+++ XFUSE_INFO=%p XFUSE_INFO->fi=%p XFUSE_INFO->fi->fh=0x%llx", | |
1852 | fip, fip->fi, (long long) fip->fi->fh); | |
1853 | 1853 | |
1854 | 1854 | if ((xinode = g_xrdp_fs.inode_table[fip->inode]) == NULL) |
1855 | 1855 | { |
1856 | log_debug("inode_table[%d] is NULL", fip->inode); | |
1856 | log_debug("inode_table[%ld] is NULL", fip->inode); | |
1857 | 1857 | fuse_reply_err(fip->req, EBADF); |
1858 | 1858 | return; |
1859 | 1859 | } |
1867 | 1867 | #if 0 |
1868 | 1868 | if ((xinode->nopen == 0) && fip->fi && fip->fi->fh) |
1869 | 1869 | { |
1870 | printf("LK_TODO: ################################ fi=%p fi->fh=%p\n", | |
1871 | fip->fi, fip->fi->fh); | |
1870 | printf("LK_TODO: ################################ fi=%p fi->fh=0x%llx\n", | |
1871 | fip->fi, (long long) fip->fi->fh); | |
1872 | 1872 | |
1873 | 1873 | free((char *) (tintptr) (fip->fi->fh)); |
1874 | 1874 | fip->fi->fh = NULL; |
1894 | 1894 | XRDP_INODE *xinode; |
1895 | 1895 | struct fuse_entry_param e; |
1896 | 1896 | |
1897 | log_debug("looking for parent=%d name=%s", (int) parent, name); | |
1897 | log_debug("looking for parent=%ld name=%s", parent, name); | |
1898 | 1898 | xfuse_dump_fs(); |
1899 | 1899 | |
1900 | 1900 | if (!xfuse_is_inode_valid(parent)) |
1901 | 1901 | { |
1902 | log_error("inode %d is not valid", parent); | |
1902 | log_error("inode %ld is not valid", parent); | |
1903 | 1903 | fuse_reply_err(req, EBADF); |
1904 | 1904 | return; |
1905 | 1905 | } |
1907 | 1907 | xinode = xfuse_get_inode_from_pinode_name(parent, name); |
1908 | 1908 | if (xinode == NULL) |
1909 | 1909 | { |
1910 | log_debug("did not find entry for parent=%d name=%s", parent, name); | |
1910 | log_debug("did not find entry for parent=%ld name=%s", parent, name); | |
1911 | 1911 | fuse_reply_err(req, ENOENT); |
1912 | 1912 | return; |
1913 | 1913 | } |
1928 | 1928 | e.generation = 1; |
1929 | 1929 | |
1930 | 1930 | fuse_reply_entry(req, &e); |
1931 | log_debug("found entry for parent=%d name=%s uid=%d gid=%d", | |
1931 | log_debug("found entry for parent=%ld name=%s uid=%d gid=%d", | |
1932 | 1932 | parent, name, xinode->uid, xinode->gid); |
1933 | 1933 | return; |
1934 | 1934 | } |
1945 | 1945 | |
1946 | 1946 | (void) fi; |
1947 | 1947 | |
1948 | log_debug("req=%p ino=%d", req, (int) ino); | |
1948 | log_debug("req=%p ino=%ld", req, ino); | |
1949 | 1949 | |
1950 | 1950 | /* if ino is not valid, just return */ |
1951 | 1951 | if (!xfuse_is_inode_valid(ino)) |
1952 | 1952 | { |
1953 | log_error("inode %d is not valid", ino); | |
1953 | log_error("inode %ld is not valid", ino); | |
1954 | 1954 | fuse_reply_err(req, EBADF); |
1955 | 1955 | return; |
1956 | 1956 | } |
1958 | 1958 | xino = g_xrdp_fs.inode_table[ino]; |
1959 | 1959 | if (!xino) |
1960 | 1960 | { |
1961 | log_debug("****** invalid ino=%d", (int) ino); | |
1961 | log_debug("****** invalid ino=%ld", ino); | |
1962 | 1962 | fuse_reply_err(req, EBADF); |
1963 | 1963 | return; |
1964 | 1964 | } |
1981 | 1981 | struct stat stbuf; |
1982 | 1982 | size_t oldsize = b->size; |
1983 | 1983 | |
1984 | log_debug("adding ino=%d name=%s", (int) ino, name); | |
1984 | log_debug("adding ino=%ld name=%s", ino, name); | |
1985 | 1985 | |
1986 | 1986 | b->size += fuse_add_direntry(req, NULL, 0, name, NULL, 0); |
1987 | 1987 | b->p = (char *) realloc(b->p, b->size); |
2034 | 2034 | int i; |
2035 | 2035 | int first_time; |
2036 | 2036 | |
2037 | log_debug("req=%p inode=%d size=%d offset=%d", req, ino, size, off); | |
2037 | log_debug("req=%p inode=%ld size=%zd offset=%lld", req, ino, size, (long long) off); | |
2038 | 2038 | |
2039 | 2039 | /* do we have a valid inode? */ |
2040 | 2040 | if (!xfuse_is_inode_valid(ino)) |
2041 | 2041 | { |
2042 | log_error("inode %d is not valid", ino); | |
2042 | log_error("inode %ld is not valid", ino); | |
2043 | 2043 | fuse_reply_err(req, EBADF); |
2044 | 2044 | return; |
2045 | 2045 | } |
2072 | 2072 | ti = g_xrdp_fs.inode_table[ino]; |
2073 | 2073 | if (!ti) |
2074 | 2074 | { |
2075 | log_debug("****** g_xrdp_fs.inode_table[%d] is NULL", ino); | |
2075 | log_debug("****** g_xrdp_fs.inode_table[%ld] is NULL", ino); | |
2076 | 2076 | fuse_reply_buf(req, NULL, 0); |
2077 | 2077 | return; |
2078 | 2078 | } |
2100 | 2100 | XRDP_INODE *xinode; |
2101 | 2101 | struct fuse_entry_param e; |
2102 | 2102 | |
2103 | log_debug("entered: parent_inode=%d name=%s", (int) parent, name); | |
2103 | log_debug("entered: parent_inode=%ld name=%s", parent, name); | |
2104 | 2104 | |
2105 | 2105 | if ((xinode = xfuse_get_inode_from_pinode_name(parent, name)) != NULL) |
2106 | 2106 | { |
2160 | 2160 | char full_path[4096]; |
2161 | 2161 | tui32 device_id; |
2162 | 2162 | |
2163 | log_debug("entered: parent=%d name=%s", parent, name); | |
2163 | log_debug("entered: parent=%ld name=%s", parent, name); | |
2164 | 2164 | |
2165 | 2165 | /* is parent inode valid? */ |
2166 | 2166 | if (!xfuse_is_inode_valid(parent)) |
2167 | 2167 | { |
2168 | log_error("inode %d is not valid", parent); | |
2168 | log_error("inode %ld is not valid", parent); | |
2169 | 2169 | fuse_reply_err(req, EBADF); |
2170 | 2170 | return; |
2171 | 2171 | } |
2172 | 2172 | |
2173 | 2173 | if ((xinode = xfuse_get_inode_from_pinode_name(parent, name)) == NULL) |
2174 | 2174 | { |
2175 | log_error("did not find file with pinode=%d name=%s", parent, name); | |
2175 | log_error("did not find file with pinode=%ld name=%s", parent, name); | |
2176 | 2176 | fuse_reply_err(req, EBADF); |
2177 | 2177 | return; |
2178 | 2178 | } |
2266 | 2266 | |
2267 | 2267 | tui32 device_id; |
2268 | 2268 | |
2269 | log_debug("entered: old_parent=%d old_name=%s new_parent=%d new_name=%s", | |
2269 | log_debug("entered: old_parent=%ld old_name=%s new_parent=%ld new_name=%s", | |
2270 | 2270 | old_parent, old_name, new_parent, new_name); |
2271 | 2271 | xfuse_dump_fs(); |
2272 | 2272 | |
2273 | 2273 | /* is old_parent inode valid? */ |
2274 | 2274 | if (!xfuse_is_inode_valid(old_parent)) |
2275 | 2275 | { |
2276 | log_error("inode %d is not valid", old_parent); | |
2276 | log_error("inode %ld is not valid", old_parent); | |
2277 | 2277 | fuse_reply_err(req, EINVAL); |
2278 | 2278 | return; |
2279 | 2279 | } |
2281 | 2281 | /* is new_parent inode valid? */ |
2282 | 2282 | if (!xfuse_is_inode_valid(new_parent)) |
2283 | 2283 | { |
2284 | log_error("inode %d is not valid", new_parent); | |
2284 | log_error("inode %ld is not valid", new_parent); | |
2285 | 2285 | fuse_reply_err(req, EINVAL); |
2286 | 2286 | return; |
2287 | 2287 | } |
2301 | 2301 | old_xinode = xfuse_get_inode_from_pinode_name(old_parent, old_name); |
2302 | 2302 | if (old_xinode == NULL) |
2303 | 2303 | { |
2304 | log_error("did not find file with pinode=%d name=%s", | |
2304 | log_error("did not find file with pinode=%ld name=%s", | |
2305 | 2305 | old_parent, old_name); |
2306 | 2306 | fuse_reply_err(req, EBADF); |
2307 | 2307 | return; |
2410 | 2410 | |
2411 | 2411 | full_path[0] = 0; |
2412 | 2412 | |
2413 | log_debug("entered: parent_ino=%d name=%s type=%s", | |
2414 | (int) parent, name, (type == S_IFDIR) ? "dir" : "file"); | |
2413 | log_debug("entered: parent_ino=%ld name=%s type=%s", | |
2414 | parent, name, (type == S_IFDIR) ? "dir" : "file"); | |
2415 | 2415 | |
2416 | 2416 | /* name must be valid */ |
2417 | 2417 | if ((name == NULL) || (strlen(name) == 0)) |
2424 | 2424 | /* is parent inode valid? */ |
2425 | 2425 | if ((parent == 1) || (!xfuse_is_inode_valid(parent))) |
2426 | 2426 | { |
2427 | log_error("inode %d is not valid", parent); | |
2427 | log_error("inode %ld is not valid", parent); | |
2428 | 2428 | fuse_reply_err(req, EBADF); |
2429 | 2429 | return; |
2430 | 2430 | } |
2502 | 2502 | char full_path[4096]; |
2503 | 2503 | tui32 device_id; |
2504 | 2504 | |
2505 | log_debug("entered: ino=%d", (int) ino); | |
2505 | log_debug("entered: ino=%ld", ino); | |
2506 | 2506 | |
2507 | 2507 | if (!xfuse_is_inode_valid(ino)) |
2508 | 2508 | { |
2509 | log_error("inode %d is not valid", ino); | |
2509 | log_error("inode %ld is not valid", ino); | |
2510 | 2510 | fuse_reply_err(req, EBADF); |
2511 | 2511 | return; |
2512 | 2512 | } |
2515 | 2515 | xinode = g_xrdp_fs.inode_table[ino]; |
2516 | 2516 | if (!xinode) |
2517 | 2517 | { |
2518 | log_debug("****** g_xrdp_fs.inode_table[%d] is NULL", ino); | |
2518 | log_debug("****** g_xrdp_fs.inode_table[%ld] is NULL", ino); | |
2519 | 2519 | fuse_reply_err(req, EBADF); |
2520 | 2520 | return; |
2521 | 2521 | } |
2588 | 2588 | XFUSE_HANDLE *handle = (XFUSE_HANDLE *) (tintptr) (fi->fh); |
2589 | 2589 | tui32 FileId; |
2590 | 2590 | |
2591 | log_debug("entered: ino=%d fi=%p fi->fh=%p", (int) ino, fi, fi->fh); | |
2591 | log_debug("entered: ino=%ld fi=%p fi->fh=0x%llx", ino, fi, | |
2592 | (long long) fi->fh); | |
2592 | 2593 | |
2593 | 2594 | if (!xfuse_is_inode_valid(ino)) |
2594 | 2595 | { |
2595 | log_error("inode %d is not valid", ino); | |
2596 | log_error("inode %ld is not valid", ino); | |
2596 | 2597 | fuse_reply_err(req, EBADF); |
2597 | 2598 | return; |
2598 | 2599 | } |
2600 | 2601 | XRDP_INODE *xinode = g_xrdp_fs.inode_table[ino]; |
2601 | 2602 | if (!xinode) |
2602 | 2603 | { |
2603 | log_debug("****** g_xrdp_fs.inode_table[%d] is NULL", ino); | |
2604 | log_debug("****** g_xrdp_fs.inode_table[%ld] is NULL", ino); | |
2604 | 2605 | fuse_reply_err(req, 0); |
2605 | 2606 | return; |
2606 | 2607 | } |
2636 | 2637 | fip->device_id = handle->DeviceId; |
2637 | 2638 | fip->fi = fi; |
2638 | 2639 | |
2639 | log_debug(" +++ created XFUSE_INFO=%p XFUSE_INFO->fi=%p XFUSE_INFO->fi->fh=%p", | |
2640 | fip, fip->fi, fip->fi->fh); | |
2640 | log_debug(" +++ created XFUSE_INFO=%p XFUSE_INFO->fi=%p XFUSE_INFO->fi->fh=0x%llx", | |
2641 | fip, fip->fi, (long long) fip->fi->fh); | |
2641 | 2642 | |
2642 | 2643 | FileId = handle->FileId; |
2643 | 2644 | fip->fi->fh = 0; |
2664 | 2665 | struct req_list_item *rli; |
2665 | 2666 | long handle; |
2666 | 2667 | |
2667 | log_debug("want_bytes %ld bytes at off %ld", size, off); | |
2668 | log_debug("want_bytes %zd bytes at off %lld", size, (long long) off); | |
2668 | 2669 | |
2669 | 2670 | if (fi->fh == 0) |
2670 | 2671 | { |
2700 | 2701 | |
2701 | 2702 | if (g_req_list->count == 1) |
2702 | 2703 | { |
2703 | log_debug("requesting clipboard file data lindex = %d off = %d size = %d", | |
2704 | rli->lindex, (int) off, (int) size); | |
2704 | log_debug("requesting clipboard file data lindex = %d off = %lld size = %zd", | |
2705 | rli->lindex, (long long) off, size); | |
2705 | 2706 | |
2706 | 2707 | clipboard_request_file_data(rli->stream_id, rli->lindex, |
2707 | 2708 | (int) off, (int) size); |
2737 | 2738 | XFUSE_INFO *fusep; |
2738 | 2739 | long handle; |
2739 | 2740 | |
2740 | log_debug("write %d bytes at off %d to inode=%d", | |
2741 | (int) size, (int) off, (int) ino); | |
2741 | log_debug("write %zd bytes at off %lld to inode=%ld", | |
2742 | size, (long long) off, ino); | |
2742 | 2743 | |
2743 | 2744 | if (fi->fh == 0) |
2744 | 2745 | { |
2772 | 2773 | fusep->device_id = fh->DeviceId; |
2773 | 2774 | fusep->fi = fi; |
2774 | 2775 | |
2775 | log_debug("+++ created XFUSE_INFO=%p XFUSE_INFO->fi=%p XFUSE_INFO->fi->fh=%p", | |
2776 | fusep, fusep->fi, fusep->fi->fh); | |
2776 | log_debug("+++ created XFUSE_INFO=%p XFUSE_INFO->fi=%p XFUSE_INFO->fi->fh=0x%llx", | |
2777 | fusep, fusep->fi, (long long) fusep->fi->fh); | |
2777 | 2778 | |
2778 | 2779 | dev_redir_file_write(fusep, fh->DeviceId, fh->FileId, buf, size, off); |
2779 | 2780 | log_debug("exiting"); |
2786 | 2787 | const char *name, mode_t mode, |
2787 | 2788 | struct fuse_file_info *fi) |
2788 | 2789 | { |
2789 | log_debug("entered: parent_inode=%d, name=%s fi=%p", | |
2790 | (int) parent, name, fi); | |
2790 | log_debug("entered: parent_inode=%ld, name=%s fi=%p", | |
2791 | parent, name, fi); | |
2791 | 2792 | |
2792 | 2793 | xfuse_create_dir_or_file(req, parent, name, mode, fi, S_IFREG); |
2793 | 2794 | } |
2798 | 2799 | static void xfuse_cb_fsync(fuse_req_t req, fuse_ino_t ino, int datasync, |
2799 | 2800 | struct fuse_file_info *fi) |
2800 | 2801 | { |
2801 | log_debug("#################### entered: ino=%d datasync=%d", (int) ino, datasync); | |
2802 | log_debug("#################### entered: ino=%ld datasync=%d", ino, datasync); | |
2802 | 2803 | log_debug("function not required"); |
2803 | 2804 | fuse_reply_err(req, EINVAL); |
2804 | 2805 | } |
2816 | 2817 | |
2817 | 2818 | if (!xfuse_is_inode_valid(ino)) |
2818 | 2819 | { |
2819 | log_error("inode %d is not valid", ino); | |
2820 | log_error("inode %ld is not valid", ino); | |
2820 | 2821 | fuse_reply_err(req, EBADF); |
2821 | 2822 | return; |
2822 | 2823 | } |
2823 | 2824 | |
2824 | 2825 | if ((xinode = g_xrdp_fs.inode_table[ino]) == NULL) |
2825 | 2826 | { |
2826 | log_debug("g_xrdp_fs.inode_table[%d] is NULL", ino); | |
2827 | log_debug("g_xrdp_fs.inode_table[%ld] is NULL", ino); | |
2827 | 2828 | fuse_reply_err(req, EBADF); |
2828 | 2829 | return; |
2829 | 2830 | } |
2849 | 2850 | |
2850 | 2851 | if (to_set & FUSE_SET_ATTR_SIZE) |
2851 | 2852 | { |
2852 | log_debug("previous file size: %d", attr->st_size); | |
2853 | log_debug("previous file size: %lld", (long long) attr->st_size); | |
2853 | 2854 | xinode->size = attr->st_size; |
2854 | log_debug("returning file size: %d", xinode->size); | |
2855 | log_debug("returning file size: %zd", xinode->size); | |
2855 | 2856 | } |
2856 | 2857 | |
2857 | 2858 | if (to_set & FUSE_SET_ATTR_ATIME) |
2932 | 2933 | char full_path[4096]; |
2933 | 2934 | char *cptr; |
2934 | 2935 | |
2935 | log_debug("inode=%d", ino); | |
2936 | log_debug("inode=%ld", ino); | |
2936 | 2937 | |
2937 | 2938 | if (!xfuse_is_inode_valid(ino)) |
2938 | 2939 | { |
2939 | log_error("inode %d is not valid", ino); | |
2940 | log_error("inode %ld is not valid", ino); | |
2940 | 2941 | fuse_reply_err(req, EBADF); |
2941 | 2942 | g_free(fifo_remove(&g_fifo_opendir)); |
2942 | 2943 | return -1; |
2947 | 2948 | |
2948 | 2949 | if ((xinode = g_xrdp_fs.inode_table[ino]) == NULL) |
2949 | 2950 | { |
2950 | log_debug("g_xrdp_fs.inode_table[%d] is NULL", ino); | |
2951 | log_debug("g_xrdp_fs.inode_table[%ld] is NULL", ino); | |
2951 | 2952 | fuse_reply_err(req, EBADF); |
2952 | 2953 | g_free(fifo_remove(&g_fifo_opendir)); |
2953 | 2954 | return -1; |
2978 | 2979 | log_debug("did not find entry; redirecting call to dev_redir"); |
2979 | 2980 | device_id = xfuse_get_device_id_for_inode((tui32) ino, full_path); |
2980 | 2981 | |
2981 | log_debug("dev_id=%d ino=%d full_path=%s", device_id, ino, full_path); | |
2982 | log_debug("dev_id=%d ino=%ld full_path=%s", device_id, ino, full_path); | |
2982 | 2983 | |
2983 | 2984 | if ((fip = calloc(1, sizeof(XFUSE_INFO))) == NULL) |
2984 | 2985 | { |
63 | 63 | [X11rdp] |
64 | 64 | param=X11rdp |
65 | 65 | param=-bs |
66 | param=-ac | |
67 | 66 | param=-nolisten |
68 | 67 | param=tcp |
69 | 68 | param=-uds |
71 | 70 | [Xvnc] |
72 | 71 | param=Xvnc |
73 | 72 | param=-bs |
74 | param=-ac | |
75 | 73 | param=-nolisten |
76 | 74 | param=tcp |
77 | 75 | param=-localhost |
83 | 81 | param=-config |
84 | 82 | param=xrdp/xorg.conf |
85 | 83 | param=-noreset |
86 | param=-ac | |
87 | 84 | param=-nolisten |
88 | 85 | param=tcp |
89 | 86 | param=-logfile |
0 | Permission to use, copy, modify, distribute, and sell this software and its | |
1 | documentation for any purpose is hereby granted without fee, provided that | |
2 | the above copyright notice appear in all copies and that both that | |
3 | copyright notice and this permission notice appear in supporting | |
4 | documentation. | |
5 | ||
6 | The above copyright notice and this permission notice shall be included in | |
7 | all copies or substantial portions of the Software. | |
8 | ||
9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
10 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
11 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
12 | OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN | |
13 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |
14 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |