Codebase list xrdp / 80b6b7c
Merge tag 'upstream/0.9.1_20161126+git589b29f' Upstream version 0.9.1~20161126+git589b29f Dominik George 7 years ago
8 changed file(s) with 506 addition(s) and 124 deletion(s). Raw diff Collapse all Expand all
415415
416416 #if defined(XRDP_ENABLE_IPV6)
417417 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 }
418433 #else
419434 rv = (int)socket(AF_INET, SOCK_STREAM, 0);
420435 #endif
421436 if (rv < 0)
422437 {
438 log_message(LOG_LEVEL_ERROR, "g_tcp_socket: %s", g_get_strerror());
423439 return -1;
424440 }
425441 #if defined(XRDP_ENABLE_IPV6)
10341050 int APP_CC
10351051 g_tcp_accept(int sck)
10361052 {
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;
10521107 }
10531108
10541109 /*****************************************************************************/
10561111 g_sck_accept(int sck, char *addr, int addr_bytes, char *port, int port_bytes)
10571112 {
10581113 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
10661129 if (ret > 0)
10671130 {
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
10821173 return ret;
10831174 }
10841175
254254 localstatedir="/var";
255255 fi
256256
257 pkgconfigdir=${libdir}/pkgconfig
258 AC_SUBST(pkgconfigdir)
257 PKG_INSTALLDIR
259258
260259 AC_CONFIG_FILES([
261260 common/Makefile
159159 * TJPF_ARGB no works, zero bytes */
160160
161161 error = tjCompress(tj_han, /* opaque handle */
162 src_ptr, /* source buf */
162 (unsigned char *) src_ptr, /* source buf */
163163 cx, /* width of area to compress */
164164 stride, /* pitch */
165165 cy, /* height of area to compress */
166166 TJPF_XBGR, /* pixel size */
167 out_data, /* dest buf */
167 (unsigned char *) out_data, /* dest buf */
168168 &lio_len, /* inner_buf length & compressed_size */
169169 TJSAMP_420, /* jpeg sub sample */
170170 quality, /* jpeg quality */
212212
213213 struct mydata_comp
214214 {
215 char *cb;
215 JOCTET *cb;
216216 int cb_bytes;
217217 int total_done;
218218 int overwrite;
264264
265265 /*****************************************************************************/
266266 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)
269269 {
270270 struct jpeg_compress_struct cinfo;
271271 struct jpeg_error_mgr jerr;
335335 struct stream *s, struct stream *temp_s, int bpp,
336336 int byte_limit, int e, int quality)
337337 {
338 char *data;
338 JOCTET *data;
339339 tui32 *src32;
340 tui16 *src16;
341340 tui8 *dst8;
342341 tui32 pixel;
343342 int red;
347346 int i;
348347 int cdata_bytes;
349348
350 data = temp_s->data;
349 data = (JOCTET *) temp_s->data;
351350 dst8 = data;
352351
353352 if (bpp == 24)
379378 }
380379
381380 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);
383383 s->p += cdata_bytes;
384384 return cdata_bytes;
385385 }
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
648648 /* insert it in xrdp fs */
649649 g_xrdp_fs.inode_table[xinode->inode] = xinode;
650650 log_debug("created new share named %s at inode_table[%d]",
651 dirname, (int) xinode->inode);
651 dirname, xinode->inode);
652652
653653 /* update nentries in parent inode */
654654 xinode = g_xrdp_fs.inode_table[1];
994994 struct xrdp_inode *xinode;
995995 struct fuse_entry_param e;
996996
997 log_debug("parent=%d name=%s", (int) parent, name);
997 log_debug("parent=%ld name=%s", parent, name);
998998
999999 /* do we have a valid parent inode? */
10001000 if (!xfuse_is_inode_valid(parent))
10011001 {
1002 log_error("inode %d is not valid", parent);
1002 log_error("inode %ld is not valid", parent);
10031003 fuse_reply_err(req, EBADF);
10041004 }
10051005
10261026 /* insert it in xrdp fs */
10271027 g_xrdp_fs.inode_table[xinode->inode] = xinode;
10281028 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);
10301030
10311031 xfuse_dump_fs();
10321032
1033 log_debug("new inode=%d", (int) xinode->inode);
1033 log_debug("new inode=%d", xinode->inode);
10341034
10351035 /* setup return value */
10361036 memset(&e, 0, sizeof(e));
10701070 continue;
10711071
10721072 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,
10741074 xinode->nentries, xinode->nopen, xinode->is_synced,
10751075 xinode->name);
10761076 }
1077 log_debug("");
1077 log_debug("%s", "");
10781078 }
10791079
10801080 /**
10871087 {
10881088 log_debug("--- dumping struct xinode ---");
10891089 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);
10921092 log_debug("mode: %o", xino->mode);
10931093 log_debug("nlink: %d", xino->nlink);
10941094 log_debug("uid: %d", xino->uid);
10951095 log_debug("gid: %d", xino->gid);
1096 log_debug("size: %ld", xino->size);
1096 log_debug("size: %zd", xino->size);
10971097 log_debug("device_id: %d", xino->device_id);
1098 log_debug("");
1098 log_debug("%s", "");
10991099 }
11001100
11011101 /**
14491449
14501450 if (!xfuse_is_inode_valid(fip->inode))
14511451 {
1452 log_error("inode %d is not valid", fip->inode);
1452 log_error("inode %ld is not valid", fip->inode);
14531453 g_free(xinode);
14541454 return -1;
14551455 }
14561456
1457 log_debug("parent_inode=%d name=%s", fip->inode, xinode->name);
1457 log_debug("parent_inode=%ld name=%s", fip->inode, xinode->name);
14581458
14591459 /* if filename is . or .. don't add it */
14601460 if ((strcmp(xinode->name, ".") == 0) || (strcmp(xinode->name, "..") == 0))
14671467
14681468 if ((xip = xfuse_get_inode_from_pinode_name(fip->inode, xinode->name)) != NULL)
14691469 {
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",
14711471 fip->inode, xinode->name);
14721472 g_free(xinode);
14731473 xip->stale = 0;
15201520 /* do we have a valid inode? */
15211521 if (!xfuse_is_inode_valid(fip->inode))
15221522 {
1523 log_error("inode %d is not valid", fip->inode);
1523 log_error("inode %ld is not valid", fip->inode);
15241524 if (fip->invoke_fuse)
15251525 fuse_reply_err(fip->req, EBADF);
15261526 goto done;
16141614 fh->FileId = FileId;
16151615
16161616 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);
16191619 }
16201620
16211621 if (fip->invoke_fuse)
16401640 #if 0
16411641 if ((xinode = g_xrdp_fs.inode_table[fip->inode]) == NULL)
16421642 {
1643 log_error("inode at inode_table[%d] is NULL", fip->inode);
1643 log_error("inode at inode_table[%ld] is NULL", fip->inode);
16441644 fuse_reply_err(fip->req, EBADF);
16451645 goto done;
16461646 }
17181718 return;
17191719 }
17201720
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);
17231723
17241724 fuse_reply_write(fip->req, length);
17251725
17271727 if ((xinode = g_xrdp_fs.inode_table[fip->inode]) != NULL)
17281728 xinode->size += length;
17291729 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);
17311731
17321732 free(fip);
17331733 }
18481848 return;
18491849 }
18501850
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);
18531853
18541854 if ((xinode = g_xrdp_fs.inode_table[fip->inode]) == NULL)
18551855 {
1856 log_debug("inode_table[%d] is NULL", fip->inode);
1856 log_debug("inode_table[%ld] is NULL", fip->inode);
18571857 fuse_reply_err(fip->req, EBADF);
18581858 return;
18591859 }
18671867 #if 0
18681868 if ((xinode->nopen == 0) && fip->fi && fip->fi->fh)
18691869 {
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);
18721872
18731873 free((char *) (tintptr) (fip->fi->fh));
18741874 fip->fi->fh = NULL;
18941894 XRDP_INODE *xinode;
18951895 struct fuse_entry_param e;
18961896
1897 log_debug("looking for parent=%d name=%s", (int) parent, name);
1897 log_debug("looking for parent=%ld name=%s", parent, name);
18981898 xfuse_dump_fs();
18991899
19001900 if (!xfuse_is_inode_valid(parent))
19011901 {
1902 log_error("inode %d is not valid", parent);
1902 log_error("inode %ld is not valid", parent);
19031903 fuse_reply_err(req, EBADF);
19041904 return;
19051905 }
19071907 xinode = xfuse_get_inode_from_pinode_name(parent, name);
19081908 if (xinode == NULL)
19091909 {
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);
19111911 fuse_reply_err(req, ENOENT);
19121912 return;
19131913 }
19281928 e.generation = 1;
19291929
19301930 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",
19321932 parent, name, xinode->uid, xinode->gid);
19331933 return;
19341934 }
19451945
19461946 (void) fi;
19471947
1948 log_debug("req=%p ino=%d", req, (int) ino);
1948 log_debug("req=%p ino=%ld", req, ino);
19491949
19501950 /* if ino is not valid, just return */
19511951 if (!xfuse_is_inode_valid(ino))
19521952 {
1953 log_error("inode %d is not valid", ino);
1953 log_error("inode %ld is not valid", ino);
19541954 fuse_reply_err(req, EBADF);
19551955 return;
19561956 }
19581958 xino = g_xrdp_fs.inode_table[ino];
19591959 if (!xino)
19601960 {
1961 log_debug("****** invalid ino=%d", (int) ino);
1961 log_debug("****** invalid ino=%ld", ino);
19621962 fuse_reply_err(req, EBADF);
19631963 return;
19641964 }
19811981 struct stat stbuf;
19821982 size_t oldsize = b->size;
19831983
1984 log_debug("adding ino=%d name=%s", (int) ino, name);
1984 log_debug("adding ino=%ld name=%s", ino, name);
19851985
19861986 b->size += fuse_add_direntry(req, NULL, 0, name, NULL, 0);
19871987 b->p = (char *) realloc(b->p, b->size);
20342034 int i;
20352035 int first_time;
20362036
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);
20382038
20392039 /* do we have a valid inode? */
20402040 if (!xfuse_is_inode_valid(ino))
20412041 {
2042 log_error("inode %d is not valid", ino);
2042 log_error("inode %ld is not valid", ino);
20432043 fuse_reply_err(req, EBADF);
20442044 return;
20452045 }
20722072 ti = g_xrdp_fs.inode_table[ino];
20732073 if (!ti)
20742074 {
2075 log_debug("****** g_xrdp_fs.inode_table[%d] is NULL", ino);
2075 log_debug("****** g_xrdp_fs.inode_table[%ld] is NULL", ino);
20762076 fuse_reply_buf(req, NULL, 0);
20772077 return;
20782078 }
21002100 XRDP_INODE *xinode;
21012101 struct fuse_entry_param e;
21022102
2103 log_debug("entered: parent_inode=%d name=%s", (int) parent, name);
2103 log_debug("entered: parent_inode=%ld name=%s", parent, name);
21042104
21052105 if ((xinode = xfuse_get_inode_from_pinode_name(parent, name)) != NULL)
21062106 {
21602160 char full_path[4096];
21612161 tui32 device_id;
21622162
2163 log_debug("entered: parent=%d name=%s", parent, name);
2163 log_debug("entered: parent=%ld name=%s", parent, name);
21642164
21652165 /* is parent inode valid? */
21662166 if (!xfuse_is_inode_valid(parent))
21672167 {
2168 log_error("inode %d is not valid", parent);
2168 log_error("inode %ld is not valid", parent);
21692169 fuse_reply_err(req, EBADF);
21702170 return;
21712171 }
21722172
21732173 if ((xinode = xfuse_get_inode_from_pinode_name(parent, name)) == NULL)
21742174 {
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);
21762176 fuse_reply_err(req, EBADF);
21772177 return;
21782178 }
22662266
22672267 tui32 device_id;
22682268
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",
22702270 old_parent, old_name, new_parent, new_name);
22712271 xfuse_dump_fs();
22722272
22732273 /* is old_parent inode valid? */
22742274 if (!xfuse_is_inode_valid(old_parent))
22752275 {
2276 log_error("inode %d is not valid", old_parent);
2276 log_error("inode %ld is not valid", old_parent);
22772277 fuse_reply_err(req, EINVAL);
22782278 return;
22792279 }
22812281 /* is new_parent inode valid? */
22822282 if (!xfuse_is_inode_valid(new_parent))
22832283 {
2284 log_error("inode %d is not valid", new_parent);
2284 log_error("inode %ld is not valid", new_parent);
22852285 fuse_reply_err(req, EINVAL);
22862286 return;
22872287 }
23012301 old_xinode = xfuse_get_inode_from_pinode_name(old_parent, old_name);
23022302 if (old_xinode == NULL)
23032303 {
2304 log_error("did not find file with pinode=%d name=%s",
2304 log_error("did not find file with pinode=%ld name=%s",
23052305 old_parent, old_name);
23062306 fuse_reply_err(req, EBADF);
23072307 return;
24102410
24112411 full_path[0] = 0;
24122412
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");
24152415
24162416 /* name must be valid */
24172417 if ((name == NULL) || (strlen(name) == 0))
24242424 /* is parent inode valid? */
24252425 if ((parent == 1) || (!xfuse_is_inode_valid(parent)))
24262426 {
2427 log_error("inode %d is not valid", parent);
2427 log_error("inode %ld is not valid", parent);
24282428 fuse_reply_err(req, EBADF);
24292429 return;
24302430 }
25022502 char full_path[4096];
25032503 tui32 device_id;
25042504
2505 log_debug("entered: ino=%d", (int) ino);
2505 log_debug("entered: ino=%ld", ino);
25062506
25072507 if (!xfuse_is_inode_valid(ino))
25082508 {
2509 log_error("inode %d is not valid", ino);
2509 log_error("inode %ld is not valid", ino);
25102510 fuse_reply_err(req, EBADF);
25112511 return;
25122512 }
25152515 xinode = g_xrdp_fs.inode_table[ino];
25162516 if (!xinode)
25172517 {
2518 log_debug("****** g_xrdp_fs.inode_table[%d] is NULL", ino);
2518 log_debug("****** g_xrdp_fs.inode_table[%ld] is NULL", ino);
25192519 fuse_reply_err(req, EBADF);
25202520 return;
25212521 }
25882588 XFUSE_HANDLE *handle = (XFUSE_HANDLE *) (tintptr) (fi->fh);
25892589 tui32 FileId;
25902590
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);
25922593
25932594 if (!xfuse_is_inode_valid(ino))
25942595 {
2595 log_error("inode %d is not valid", ino);
2596 log_error("inode %ld is not valid", ino);
25962597 fuse_reply_err(req, EBADF);
25972598 return;
25982599 }
26002601 XRDP_INODE *xinode = g_xrdp_fs.inode_table[ino];
26012602 if (!xinode)
26022603 {
2603 log_debug("****** g_xrdp_fs.inode_table[%d] is NULL", ino);
2604 log_debug("****** g_xrdp_fs.inode_table[%ld] is NULL", ino);
26042605 fuse_reply_err(req, 0);
26052606 return;
26062607 }
26362637 fip->device_id = handle->DeviceId;
26372638 fip->fi = fi;
26382639
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);
26412642
26422643 FileId = handle->FileId;
26432644 fip->fi->fh = 0;
26642665 struct req_list_item *rli;
26652666 long handle;
26662667
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);
26682669
26692670 if (fi->fh == 0)
26702671 {
27002701
27012702 if (g_req_list->count == 1)
27022703 {
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);
27052706
27062707 clipboard_request_file_data(rli->stream_id, rli->lindex,
27072708 (int) off, (int) size);
27372738 XFUSE_INFO *fusep;
27382739 long handle;
27392740
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);
27422743
27432744 if (fi->fh == 0)
27442745 {
27722773 fusep->device_id = fh->DeviceId;
27732774 fusep->fi = fi;
27742775
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);
27772778
27782779 dev_redir_file_write(fusep, fh->DeviceId, fh->FileId, buf, size, off);
27792780 log_debug("exiting");
27862787 const char *name, mode_t mode,
27872788 struct fuse_file_info *fi)
27882789 {
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);
27912792
27922793 xfuse_create_dir_or_file(req, parent, name, mode, fi, S_IFREG);
27932794 }
27982799 static void xfuse_cb_fsync(fuse_req_t req, fuse_ino_t ino, int datasync,
27992800 struct fuse_file_info *fi)
28002801 {
2801 log_debug("#################### entered: ino=%d datasync=%d", (int) ino, datasync);
2802 log_debug("#################### entered: ino=%ld datasync=%d", ino, datasync);
28022803 log_debug("function not required");
28032804 fuse_reply_err(req, EINVAL);
28042805 }
28162817
28172818 if (!xfuse_is_inode_valid(ino))
28182819 {
2819 log_error("inode %d is not valid", ino);
2820 log_error("inode %ld is not valid", ino);
28202821 fuse_reply_err(req, EBADF);
28212822 return;
28222823 }
28232824
28242825 if ((xinode = g_xrdp_fs.inode_table[ino]) == NULL)
28252826 {
2826 log_debug("g_xrdp_fs.inode_table[%d] is NULL", ino);
2827 log_debug("g_xrdp_fs.inode_table[%ld] is NULL", ino);
28272828 fuse_reply_err(req, EBADF);
28282829 return;
28292830 }
28492850
28502851 if (to_set & FUSE_SET_ATTR_SIZE)
28512852 {
2852 log_debug("previous file size: %d", attr->st_size);
2853 log_debug("previous file size: %lld", (long long) attr->st_size);
28532854 xinode->size = attr->st_size;
2854 log_debug("returning file size: %d", xinode->size);
2855 log_debug("returning file size: %zd", xinode->size);
28552856 }
28562857
28572858 if (to_set & FUSE_SET_ATTR_ATIME)
29322933 char full_path[4096];
29332934 char *cptr;
29342935
2935 log_debug("inode=%d", ino);
2936 log_debug("inode=%ld", ino);
29362937
29372938 if (!xfuse_is_inode_valid(ino))
29382939 {
2939 log_error("inode %d is not valid", ino);
2940 log_error("inode %ld is not valid", ino);
29402941 fuse_reply_err(req, EBADF);
29412942 g_free(fifo_remove(&g_fifo_opendir));
29422943 return -1;
29472948
29482949 if ((xinode = g_xrdp_fs.inode_table[ino]) == NULL)
29492950 {
2950 log_debug("g_xrdp_fs.inode_table[%d] is NULL", ino);
2951 log_debug("g_xrdp_fs.inode_table[%ld] is NULL", ino);
29512952 fuse_reply_err(req, EBADF);
29522953 g_free(fifo_remove(&g_fifo_opendir));
29532954 return -1;
29782979 log_debug("did not find entry; redirecting call to dev_redir");
29792980 device_id = xfuse_get_device_id_for_inode((tui32) ino, full_path);
29802981
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);
29822983
29832984 if ((fip = calloc(1, sizeof(XFUSE_INFO))) == NULL)
29842985 {
6363 [X11rdp]
6464 param=X11rdp
6565 param=-bs
66 param=-ac
6766 param=-nolisten
6867 param=tcp
6968 param=-uds
7170 [Xvnc]
7271 param=Xvnc
7372 param=-bs
74 param=-ac
7573 param=-nolisten
7674 param=tcp
7775 param=-localhost
8381 param=-config
8482 param=xrdp/xorg.conf
8583 param=-noreset
86 param=-ac
8784 param=-nolisten
8885 param=tcp
8986 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.
0 *.log
1 *.log.old
2 *.trs
3 Xorg.no-setuid