[Pkg-remote-team] [xrdp] 02/05: New upstream version 0.9.1~20161126+git589b29f
Dominik George
natureshadow-guest at moszumanska.debian.org
Sat Nov 26 11:36:59 UTC 2016
This is an automated email from the git hooks/post-receive script.
natureshadow-guest pushed a commit to branch master
in repository xrdp.
commit 48f2cefe4c102b7126314c716276f9072a19c778
Author: Dominik George <nik at naturalnet.de>
Date: Sat Nov 26 12:18:40 2016 +0100
New upstream version 0.9.1~20161126+git589b29f
---
common/os_calls.c | 149 ++++++++++++++++++-----
configure.ac | 3 +-
libxrdp/xrdp_jpeg_compress.c | 18 +--
m4/pkg.m4 | 275 ++++++++++++++++++++++++++++++++++++++++++
sesman/chansrv/chansrv_fuse.c | 149 +++++++++++------------
sesman/sesman.ini | 3 -
xorgxrdp/COPYING | 15 +++
xorgxrdp/tests/.gitignore | 4 +
8 files changed, 499 insertions(+), 117 deletions(-)
diff --git a/common/os_calls.c b/common/os_calls.c
index b418e76..d8e711b 100644
--- a/common/os_calls.c
+++ b/common/os_calls.c
@@ -416,11 +416,27 @@ g_tcp_socket(void)
#if defined(XRDP_ENABLE_IPV6)
rv = (int)socket(AF_INET6, SOCK_STREAM, 0);
+ if (rv < 0)
+ {
+ log_message(LOG_LEVEL_ERROR, "g_tcp_socket: %s", g_get_strerror());
+
+ switch (errno)
+ {
+ case EAFNOSUPPORT: /* if IPv6 not supported, retry IPv4 */
+ log_message(LOG_LEVEL_INFO, "IPv6 not supported, falling back to IPv4");
+ rv = (int)socket(AF_INET, SOCK_STREAM, 0);
+ break;
+
+ default:
+ return -1;
+ }
+ }
#else
rv = (int)socket(AF_INET, SOCK_STREAM, 0);
#endif
if (rv < 0)
{
+ log_message(LOG_LEVEL_ERROR, "g_tcp_socket: %s", g_get_strerror());
return -1;
}
#if defined(XRDP_ENABLE_IPV6)
@@ -1035,21 +1051,60 @@ g_sck_listen(int sck)
int APP_CC
g_tcp_accept(int sck)
{
- int ret ;
- char ipAddr[256] ;
- struct sockaddr_in s;
- socklen_t i;
+ int ret;
+ char msg[256];
+ union
+ {
+ struct sockaddr sock_addr;
+ struct sockaddr_in sock_addr_in;
+#if defined(XRDP_ENABLE_IPV6)
+ struct sockaddr_in6 sock_addr_in6;
+#endif
+ } sock_info;
+
+ socklen_t sock_len = sizeof(sock_info);
+ memset(&sock_info, 0, sock_len);
- i = sizeof(struct sockaddr_in);
- memset(&s, 0, i);
- ret = accept(sck, (struct sockaddr *)&s, &i);
- if(ret>0)
+ ret = accept(sck, (struct sockaddr *)&sock_info, &sock_len);
+
+ if (ret > 0)
{
- snprintf(ipAddr, 255, "A connection received from: %s port %d",
- inet_ntoa(s.sin_addr), ntohs(s.sin_port));
- log_message(LOG_LEVEL_INFO, "%s", ipAddr);
+ switch(sock_info.sock_addr.sa_family)
+ {
+ case AF_INET:
+ {
+ struct sockaddr_in *sock_addr_in = &sock_info.sock_addr_in;
+
+ snprintf(msg, sizeof(msg), "A connection received from %s port %d",
+ inet_ntoa(sock_addr_in->sin_addr),
+ ntohs(sock_addr_in->sin_port));
+ log_message(LOG_LEVEL_INFO, "%s", msg);
+
+ break;
+ }
+
+#if defined(XRDP_ENABLE_IPV6)
+
+ case AF_INET6:
+ {
+ struct sockaddr_in6 *sock_addr_in6 = &sock_info.sock_addr_in6;
+ char addr[256];
+
+ inet_ntop(sock_addr_in6->sin6_family,
+ &sock_addr_in6->sin6_addr, addr, sizeof(addr));
+ snprintf(msg, sizeof(msg), "A connection received from %s port %d",
+ addr, ntohs(sock_addr_in6->sin6_port));
+ log_message(LOG_LEVEL_INFO, "%s", msg);
+
+ break;
+
+ }
+
+#endif
+ }
}
- return ret ;
+
+ return ret;
}
/*****************************************************************************/
@@ -1057,29 +1112,65 @@ int APP_CC
g_sck_accept(int sck, char *addr, int addr_bytes, char *port, int port_bytes)
{
int ret;
- char ipAddr[256];
- struct sockaddr_in s;
- socklen_t i;
+ char msg[256];
+ union
+ {
+ struct sockaddr sock_addr;
+ struct sockaddr_in sock_addr_in;
+#if defined(XRDP_ENABLE_IPV6)
+ struct sockaddr_in6 sock_addr_in6;
+#endif
+ } sock_info;
+
+ socklen_t sock_len = sizeof(sock_info);
+ memset(&sock_info, 0, sock_len);
+
+ ret = accept(sck, (struct sockaddr *)&sock_info, &sock_len);
- i = sizeof(struct sockaddr_in);
- memset(&s, 0, i);
- ret = accept(sck, (struct sockaddr *)&s, &i);
if (ret > 0)
{
- g_snprintf(ipAddr, 255, "A connection received from: %s port %d",
- inet_ntoa(s.sin_addr), ntohs(s.sin_port));
- log_message(LOG_LEVEL_INFO, "%s", ipAddr);
- if (s.sin_family == AF_INET)
+ switch(sock_info.sock_addr.sa_family)
{
- g_snprintf(addr, addr_bytes, "%s", inet_ntoa(s.sin_addr));
- g_snprintf(port, port_bytes, "%d", ntohs(s.sin_port));
- }
- if (s.sin_family == AF_UNIX)
- {
- g_strncpy(addr, "", addr_bytes - 1);
- g_strncpy(port, "", port_bytes - 1);
+ case AF_INET:
+ {
+ struct sockaddr_in *sock_addr_in = &sock_info.sock_addr_in;
+
+ g_snprintf(addr, addr_bytes, "%s", inet_ntoa(sock_addr_in->sin_addr));
+ g_snprintf(port, port_bytes, "%d", ntohs(sock_addr_in->sin_port));
+
+ break;
+ }
+
+#if defined(XRDP_ENABLE_IPV6)
+
+ case AF_INET6:
+ {
+ struct sockaddr_in6 *sock_addr_in6 = &sock_info.sock_addr_in6;
+
+ inet_ntop(sock_addr_in6->sin6_family,
+ &sock_addr_in6->sin6_addr, addr, addr_bytes);
+ g_snprintf(port, port_bytes, "%d", ntohs(sock_addr_in6->sin6_port));
+ break;
+ }
+
+#endif
+
+ case AF_UNIX:
+ default:
+ {
+ g_strncpy(addr, "", addr_bytes - 1);
+ g_strncpy(port, "", port_bytes - 1);
+ break;
+ }
}
+
+
+ g_snprintf(msg, sizeof(msg), "A connection received from: %s port %s",
+ addr, port);
+ log_message(LOG_LEVEL_INFO, "%s", msg);
+
}
+
return ret;
}
diff --git a/configure.ac b/configure.ac
index c419811..94ba2e1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -255,8 +255,7 @@ sysconfdir="/etc";
localstatedir="/var";
fi
-pkgconfigdir=${libdir}/pkgconfig
-AC_SUBST(pkgconfigdir)
+PKG_INSTALLDIR
AC_CONFIG_FILES([
common/Makefile
diff --git a/libxrdp/xrdp_jpeg_compress.c b/libxrdp/xrdp_jpeg_compress.c
index 27c3163..385203a 100644
--- a/libxrdp/xrdp_jpeg_compress.c
+++ b/libxrdp/xrdp_jpeg_compress.c
@@ -160,12 +160,12 @@ xrdp_codec_jpeg_compress(void *handle,
* TJPF_ARGB no works, zero bytes */
error = tjCompress(tj_han, /* opaque handle */
- src_ptr, /* source buf */
+ (unsigned char *) src_ptr, /* source buf */
cx, /* width of area to compress */
stride, /* pitch */
cy, /* height of area to compress */
TJPF_XBGR, /* pixel size */
- out_data, /* dest buf */
+ (unsigned char *) out_data, /* dest buf */
&lio_len, /* inner_buf length & compressed_size */
TJSAMP_420, /* jpeg sub sample */
quality, /* jpeg quality */
@@ -213,7 +213,7 @@ xrdp_jpeg_deinit(void *handle)
struct mydata_comp
{
- char *cb;
+ JOCTET *cb;
int cb_bytes;
int total_done;
int overwrite;
@@ -265,8 +265,8 @@ my_term_destination(j_compress_ptr cinfo)
/*****************************************************************************/
static int APP_CC
-jp_do_compress(char *data, int width, int height, int bpp, int quality,
- char *comp_data, int *comp_data_bytes)
+jp_do_compress(JOCTET *data, int width, int height, int bpp, int quality,
+ JOCTET *comp_data, int *comp_data_bytes)
{
struct jpeg_compress_struct cinfo;
struct jpeg_error_mgr jerr;
@@ -336,9 +336,8 @@ jpeg_compress(char *in_data, int width, int height,
struct stream *s, struct stream *temp_s, int bpp,
int byte_limit, int e, int quality)
{
- char *data;
+ JOCTET *data;
tui32 *src32;
- tui16 *src16;
tui8 *dst8;
tui32 pixel;
int red;
@@ -348,7 +347,7 @@ jpeg_compress(char *in_data, int width, int height,
int i;
int cdata_bytes;
- data = temp_s->data;
+ data = (JOCTET *) temp_s->data;
dst8 = data;
if (bpp == 24)
@@ -380,7 +379,8 @@ jpeg_compress(char *in_data, int width, int height,
}
cdata_bytes = byte_limit;
- jp_do_compress(data, width + e, height, 24, quality, s->p, &cdata_bytes);
+ jp_do_compress(data, width + e, height, 24, quality, (JOCTET *) s->p,
+ &cdata_bytes);
s->p += cdata_bytes;
return cdata_bytes;
}
diff --git a/m4/pkg.m4 b/m4/pkg.m4
new file mode 100644
index 0000000..82bea96
--- /dev/null
+++ b/m4/pkg.m4
@@ -0,0 +1,275 @@
+dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+dnl serial 11 (pkg-config-0.29.1)
+dnl
+dnl Copyright © 2004 Scott James Remnant <scott at netsplit.com>.
+dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists at gmail.com>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+dnl 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a
+dnl configuration script generated by Autoconf, you may include it under
+dnl the same distribution terms that you use for the rest of that
+dnl program.
+
+dnl PKG_PREREQ(MIN-VERSION)
+dnl -----------------------
+dnl Since: 0.29
+dnl
+dnl Verify that the version of the pkg-config macros are at least
+dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
+dnl installed version of pkg-config, this checks the developer's version
+dnl of pkg.m4 when generating configure.
+dnl
+dnl To ensure that this macro is defined, also add:
+dnl m4_ifndef([PKG_PREREQ],
+dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
+dnl
+dnl See the "Since" comment for each macro you use to see what version
+dnl of the macros you require.
+m4_defun([PKG_PREREQ],
+[m4_define([PKG_MACROS_VERSION], [0.29.1])
+m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
+ [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
+])dnl PKG_PREREQ
+
+dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
+dnl ----------------------------------
+dnl Since: 0.16
+dnl
+dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
+dnl first found in the path. Checks that the version of pkg-config found
+dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
+dnl used since that's the first version where most current features of
+dnl pkg-config existed.
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=m4_default([$1], [0.9.0])
+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ PKG_CONFIG=""
+ fi
+fi[]dnl
+])dnl PKG_PROG_PKG_CONFIG
+
+dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------------------------------
+dnl Since: 0.18
+dnl
+dnl Check to see whether a particular set of modules exists. Similar to
+dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
+dnl
+dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+dnl only at the first occurence in configure.ac, so if the first place
+dnl it's called might be skipped (such as if it is within an "if", you
+dnl have to call PKG_CHECK_EXISTS manually
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+ m4_default([$2], [:])
+m4_ifvaln([$3], [else
+ $3])dnl
+fi])
+
+dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+dnl ---------------------------------------------
+dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
+dnl pkg_failed based on the result.
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+ pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+ PKG_CHECK_EXISTS([$3],
+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes ],
+ [pkg_failed=yes])
+ else
+ pkg_failed=untried
+fi[]dnl
+])dnl _PKG_CONFIG
+
+dnl _PKG_SHORT_ERRORS_SUPPORTED
+dnl ---------------------------
+dnl Internal check to see if pkg-config supports short errors.
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi[]dnl
+])dnl _PKG_SHORT_ERRORS_SUPPORTED
+
+
+dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])
+dnl --------------------------------------------------------------
+dnl Since: 0.4.0
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
+dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+ AC_MSG_RESULT([no])
+ _PKG_SHORT_ERRORS_SUPPORTED
+ if test $_pkg_short_errors_supported = yes; then
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
+ else
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+ m4_default([$4], [AC_MSG_ERROR(
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT])[]dnl
+ ])
+elif test $pkg_failed = untried; then
+ AC_MSG_RESULT([no])
+ m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+ ])
+else
+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+ AC_MSG_RESULT([yes])
+ $3
+fi[]dnl
+])dnl PKG_CHECK_MODULES
+
+
+dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])
+dnl ---------------------------------------------------------------------
+dnl Since: 0.29
+dnl
+dnl Checks for existence of MODULES and gathers its build flags with
+dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
+dnl and VARIABLE-PREFIX_LIBS from --libs.
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
+dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
+dnl configure.ac.
+AC_DEFUN([PKG_CHECK_MODULES_STATIC],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+_save_PKG_CONFIG=$PKG_CONFIG
+PKG_CONFIG="$PKG_CONFIG --static"
+PKG_CHECK_MODULES($@)
+PKG_CONFIG=$_save_PKG_CONFIG[]dnl
+])dnl PKG_CHECK_MODULES_STATIC
+
+
+dnl PKG_INSTALLDIR([DIRECTORY])
+dnl -------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable pkgconfigdir as the location where a module
+dnl should install pkg-config .pc files. By default the directory is
+dnl $libdir/pkgconfig, but the default can be changed by passing
+dnl DIRECTORY. The user can override through the --with-pkgconfigdir
+dnl parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+ [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+ [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_INSTALLDIR
+
+
+dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
+dnl --------------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable noarch_pkgconfigdir as the location where a
+dnl module should install arch-independent pkg-config .pc files. By
+dnl default the directory is $datadir/pkgconfig, but the default can be
+dnl changed by passing DIRECTORY. The user can override through the
+dnl --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+ [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+ [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_NOARCH_INSTALLDIR
+
+
+dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------
+dnl Since: 0.28
+dnl
+dnl Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])dnl PKG_CHECK_VAR
diff --git a/sesman/chansrv/chansrv_fuse.c b/sesman/chansrv/chansrv_fuse.c
index 5891c95..04209fd 100644
--- a/sesman/chansrv/chansrv_fuse.c
+++ b/sesman/chansrv/chansrv_fuse.c
@@ -649,7 +649,7 @@ int xfuse_create_share(tui32 device_id, char *dirname)
/* insert it in xrdp fs */
g_xrdp_fs.inode_table[xinode->inode] = xinode;
log_debug("created new share named %s at inode_table[%d]",
- dirname, (int) xinode->inode);
+ dirname, xinode->inode);
/* update nentries in parent inode */
xinode = g_xrdp_fs.inode_table[1];
@@ -995,12 +995,12 @@ static void xfuse_create_file(fuse_req_t req, fuse_ino_t parent,
struct xrdp_inode *xinode;
struct fuse_entry_param e;
- log_debug("parent=%d name=%s", (int) parent, name);
+ log_debug("parent=%ld name=%s", parent, name);
/* do we have a valid parent inode? */
if (!xfuse_is_inode_valid(parent))
{
- log_error("inode %d is not valid", parent);
+ log_error("inode %ld is not valid", parent);
fuse_reply_err(req, EBADF);
}
@@ -1027,11 +1027,11 @@ static void xfuse_create_file(fuse_req_t req, fuse_ino_t parent,
/* insert it in xrdp fs */
g_xrdp_fs.inode_table[xinode->inode] = xinode;
xfuse_update_xrdpfs_size();
- log_debug("inserted new dir at inode_table[%d]", (int) xinode->inode);
+ log_debug("inserted new dir at inode_table[%d]", xinode->inode);
xfuse_dump_fs();
- log_debug("new inode=%d", (int) xinode->inode);
+ log_debug("new inode=%d", xinode->inode);
/* setup return value */
memset(&e, 0, sizeof(e));
@@ -1071,11 +1071,11 @@ static void xfuse_dump_fs()
continue;
log_debug("pinode=%d inode=%d nentries=%d nopen=%d is_synced=%d name=%s",
- (int) xinode->parent_inode, (int) xinode->inode,
+ xinode->parent_inode, xinode->inode,
xinode->nentries, xinode->nopen, xinode->is_synced,
xinode->name);
}
- log_debug("");
+ log_debug("%s", "");
}
/**
@@ -1088,15 +1088,15 @@ static void xfuse_dump_xrdp_inode(struct xrdp_inode *xino)
{
log_debug("--- dumping struct xinode ---");
log_debug("name: %s", xino->name);
- log_debug("parent_inode: %ld", xino->parent_inode);
- log_debug("inode: %ld", xino->inode);
+ log_debug("parent_inode: %d", xino->parent_inode);
+ log_debug("inode: %d", xino->inode);
log_debug("mode: %o", xino->mode);
log_debug("nlink: %d", xino->nlink);
log_debug("uid: %d", xino->uid);
log_debug("gid: %d", xino->gid);
- log_debug("size: %ld", xino->size);
+ log_debug("size: %zd", xino->size);
log_debug("device_id: %d", xino->device_id);
- log_debug("");
+ log_debug("%s", "");
}
/**
@@ -1450,12 +1450,12 @@ int xfuse_devredir_cb_enum_dir(void *vp, struct xrdp_inode *xinode)
if (!xfuse_is_inode_valid(fip->inode))
{
- log_error("inode %d is not valid", fip->inode);
+ log_error("inode %ld is not valid", fip->inode);
g_free(xinode);
return -1;
}
- log_debug("parent_inode=%d name=%s", fip->inode, xinode->name);
+ log_debug("parent_inode=%ld name=%s", fip->inode, xinode->name);
/* if filename is . or .. don't add it */
if ((strcmp(xinode->name, ".") == 0) || (strcmp(xinode->name, "..") == 0))
@@ -1468,7 +1468,7 @@ int xfuse_devredir_cb_enum_dir(void *vp, struct xrdp_inode *xinode)
if ((xip = xfuse_get_inode_from_pinode_name(fip->inode, xinode->name)) != NULL)
{
- log_debug("inode=%d name=%s already exists in xrdp_fs; not adding it",
+ log_debug("inode=%ld name=%s already exists in xrdp_fs; not adding it",
fip->inode, xinode->name);
g_free(xinode);
xip->stale = 0;
@@ -1521,7 +1521,7 @@ void xfuse_devredir_cb_enum_dir_done(void *vp, tui32 IoStatus)
/* do we have a valid inode? */
if (!xfuse_is_inode_valid(fip->inode))
{
- log_error("inode %d is not valid", fip->inode);
+ log_error("inode %ld is not valid", fip->inode);
if (fip->invoke_fuse)
fuse_reply_err(fip->req, EBADF);
goto done;
@@ -1615,8 +1615,8 @@ void xfuse_devredir_cb_open_file(void *vp, tui32 IoStatus, tui32 DeviceId,
fh->FileId = FileId;
fip->fi->fh = (uint64_t) ((long) fh);
- log_debug("+++ XFUSE_INFO=%p XFUSE_INFO->fi=%p XFUSE_INFO->fi->fh=%p",
- fip, fip->fi, fip->fi->fh);
+ log_debug("+++ XFUSE_INFO=%p XFUSE_INFO->fi=%p XFUSE_INFO->fi->fh=0x%llx",
+ fip, fip->fi, (long long) fip->fi->fh);
}
if (fip->invoke_fuse)
@@ -1641,7 +1641,7 @@ void xfuse_devredir_cb_open_file(void *vp, tui32 IoStatus, tui32 DeviceId,
#if 0
if ((xinode = g_xrdp_fs.inode_table[fip->inode]) == NULL)
{
- log_error("inode at inode_table[%d] is NULL", fip->inode);
+ log_error("inode at inode_table[%ld] is NULL", fip->inode);
fuse_reply_err(fip->req, EBADF);
goto done;
}
@@ -1719,8 +1719,8 @@ void xfuse_devredir_cb_write_file(void *vp, char *buf, size_t length)
return;
}
- log_debug("+++ XFUSE_INFO=%p, XFUSE_INFO->fi=%p XFUSE_INFO->fi->fh=%p",
- fip, fip->fi, fip->fi->fh);
+ log_debug("+++ XFUSE_INFO=%p, XFUSE_INFO->fi=%p XFUSE_INFO->fi->fh=0x%llx",
+ fip, fip->fi, (long long) fip->fi->fh);
fuse_reply_write(fip->req, length);
@@ -1728,7 +1728,7 @@ void xfuse_devredir_cb_write_file(void *vp, char *buf, size_t length)
if ((xinode = g_xrdp_fs.inode_table[fip->inode]) != NULL)
xinode->size += length;
else
- log_error("inode at inode_table[%d] is NULL", fip->inode);
+ log_error("inode at inode_table[%ld] is NULL", fip->inode);
free(fip);
}
@@ -1849,12 +1849,12 @@ void xfuse_devredir_cb_file_close(void *vp)
return;
}
- log_debug("+++ XFUSE_INFO=%p XFUSE_INFO->fi=%p XFUSE_INFO->fi->fh=%p",
- fip, fip->fi, fip->fi->fh);
+ log_debug("+++ XFUSE_INFO=%p XFUSE_INFO->fi=%p XFUSE_INFO->fi->fh=0x%llx",
+ fip, fip->fi, (long long) fip->fi->fh);
if ((xinode = g_xrdp_fs.inode_table[fip->inode]) == NULL)
{
- log_debug("inode_table[%d] is NULL", fip->inode);
+ log_debug("inode_table[%ld] is NULL", fip->inode);
fuse_reply_err(fip->req, EBADF);
return;
}
@@ -1868,8 +1868,8 @@ void xfuse_devredir_cb_file_close(void *vp)
#if 0
if ((xinode->nopen == 0) && fip->fi && fip->fi->fh)
{
- printf("LK_TODO: ################################ fi=%p fi->fh=%p\n",
- fip->fi, fip->fi->fh);
+ printf("LK_TODO: ################################ fi=%p fi->fh=0x%llx\n",
+ fip->fi, (long long) fip->fi->fh);
free((char *) (tintptr) (fip->fi->fh));
fip->fi->fh = NULL;
@@ -1895,12 +1895,12 @@ static void xfuse_cb_lookup(fuse_req_t req, fuse_ino_t parent, const char *name)
XRDP_INODE *xinode;
struct fuse_entry_param e;
- log_debug("looking for parent=%d name=%s", (int) parent, name);
+ log_debug("looking for parent=%ld name=%s", parent, name);
xfuse_dump_fs();
if (!xfuse_is_inode_valid(parent))
{
- log_error("inode %d is not valid", parent);
+ log_error("inode %ld is not valid", parent);
fuse_reply_err(req, EBADF);
return;
}
@@ -1908,7 +1908,7 @@ static void xfuse_cb_lookup(fuse_req_t req, fuse_ino_t parent, const char *name)
xinode = xfuse_get_inode_from_pinode_name(parent, name);
if (xinode == NULL)
{
- log_debug("did not find entry for parent=%d name=%s", parent, name);
+ log_debug("did not find entry for parent=%ld name=%s", parent, name);
fuse_reply_err(req, ENOENT);
return;
}
@@ -1929,7 +1929,7 @@ static void xfuse_cb_lookup(fuse_req_t req, fuse_ino_t parent, const char *name)
e.generation = 1;
fuse_reply_entry(req, &e);
- log_debug("found entry for parent=%d name=%s uid=%d gid=%d",
+ log_debug("found entry for parent=%ld name=%s uid=%d gid=%d",
parent, name, xinode->uid, xinode->gid);
return;
}
@@ -1946,12 +1946,12 @@ static void xfuse_cb_getattr(fuse_req_t req, fuse_ino_t ino,
(void) fi;
- log_debug("req=%p ino=%d", req, (int) ino);
+ log_debug("req=%p ino=%ld", req, ino);
/* if ino is not valid, just return */
if (!xfuse_is_inode_valid(ino))
{
- log_error("inode %d is not valid", ino);
+ log_error("inode %ld is not valid", ino);
fuse_reply_err(req, EBADF);
return;
}
@@ -1959,7 +1959,7 @@ static void xfuse_cb_getattr(fuse_req_t req, fuse_ino_t ino,
xino = g_xrdp_fs.inode_table[ino];
if (!xino)
{
- log_debug("****** invalid ino=%d", (int) ino);
+ log_debug("****** invalid ino=%ld", ino);
fuse_reply_err(req, EBADF);
return;
}
@@ -1982,7 +1982,7 @@ static void xfuse_dirbuf_add(fuse_req_t req, struct dirbuf *b,
struct stat stbuf;
size_t oldsize = b->size;
- log_debug("adding ino=%d name=%s", (int) ino, name);
+ log_debug("adding ino=%ld name=%s", ino, name);
b->size += fuse_add_direntry(req, NULL, 0, name, NULL, 0);
b->p = (char *) realloc(b->p, b->size);
@@ -2035,12 +2035,12 @@ static void xfuse_cb_readdir(fuse_req_t req, fuse_ino_t ino, size_t size,
int i;
int first_time;
- log_debug("req=%p inode=%d size=%d offset=%d", req, ino, size, off);
+ log_debug("req=%p inode=%ld size=%zd offset=%lld", req, ino, size, (long long) off);
/* do we have a valid inode? */
if (!xfuse_is_inode_valid(ino))
{
- log_error("inode %d is not valid", ino);
+ log_error("inode %ld is not valid", ino);
fuse_reply_err(req, EBADF);
return;
}
@@ -2073,7 +2073,7 @@ static void xfuse_cb_readdir(fuse_req_t req, fuse_ino_t ino, size_t size,
ti = g_xrdp_fs.inode_table[ino];
if (!ti)
{
- log_debug("****** g_xrdp_fs.inode_table[%d] is NULL", ino);
+ log_debug("****** g_xrdp_fs.inode_table[%ld] is NULL", ino);
fuse_reply_buf(req, NULL, 0);
return;
}
@@ -2101,7 +2101,7 @@ static void xfuse_cb_mkdir(fuse_req_t req, fuse_ino_t parent,
XRDP_INODE *xinode;
struct fuse_entry_param e;
- log_debug("entered: parent_inode=%d name=%s", (int) parent, name);
+ log_debug("entered: parent_inode=%ld name=%s", parent, name);
if ((xinode = xfuse_get_inode_from_pinode_name(parent, name)) != NULL)
{
@@ -2161,19 +2161,19 @@ static void xfuse_remove_dir_or_file(fuse_req_t req, fuse_ino_t parent,
char full_path[4096];
tui32 device_id;
- log_debug("entered: parent=%d name=%s", parent, name);
+ log_debug("entered: parent=%ld name=%s", parent, name);
/* is parent inode valid? */
if (!xfuse_is_inode_valid(parent))
{
- log_error("inode %d is not valid", parent);
+ log_error("inode %ld is not valid", parent);
fuse_reply_err(req, EBADF);
return;
}
if ((xinode = xfuse_get_inode_from_pinode_name(parent, name)) == NULL)
{
- log_error("did not find file with pinode=%d name=%s", parent, name);
+ log_error("did not find file with pinode=%ld name=%s", parent, name);
fuse_reply_err(req, EBADF);
return;
}
@@ -2267,14 +2267,14 @@ static void xfuse_cb_rename(fuse_req_t req,
tui32 device_id;
- log_debug("entered: old_parent=%d old_name=%s new_parent=%d new_name=%s",
+ log_debug("entered: old_parent=%ld old_name=%s new_parent=%ld new_name=%s",
old_parent, old_name, new_parent, new_name);
xfuse_dump_fs();
/* is old_parent inode valid? */
if (!xfuse_is_inode_valid(old_parent))
{
- log_error("inode %d is not valid", old_parent);
+ log_error("inode %ld is not valid", old_parent);
fuse_reply_err(req, EINVAL);
return;
}
@@ -2282,7 +2282,7 @@ static void xfuse_cb_rename(fuse_req_t req,
/* is new_parent inode valid? */
if (!xfuse_is_inode_valid(new_parent))
{
- log_error("inode %d is not valid", new_parent);
+ log_error("inode %ld is not valid", new_parent);
fuse_reply_err(req, EINVAL);
return;
}
@@ -2302,7 +2302,7 @@ static void xfuse_cb_rename(fuse_req_t req,
old_xinode = xfuse_get_inode_from_pinode_name(old_parent, old_name);
if (old_xinode == NULL)
{
- log_error("did not find file with pinode=%d name=%s",
+ log_error("did not find file with pinode=%ld name=%s",
old_parent, old_name);
fuse_reply_err(req, EBADF);
return;
@@ -2411,8 +2411,8 @@ static void xfuse_create_dir_or_file(fuse_req_t req, fuse_ino_t parent,
full_path[0] = 0;
- log_debug("entered: parent_ino=%d name=%s type=%s",
- (int) parent, name, (type == S_IFDIR) ? "dir" : "file");
+ log_debug("entered: parent_ino=%ld name=%s type=%s",
+ parent, name, (type == S_IFDIR) ? "dir" : "file");
/* name must be valid */
if ((name == NULL) || (strlen(name) == 0))
@@ -2425,7 +2425,7 @@ static void xfuse_create_dir_or_file(fuse_req_t req, fuse_ino_t parent,
/* is parent inode valid? */
if ((parent == 1) || (!xfuse_is_inode_valid(parent)))
{
- log_error("inode %d is not valid", parent);
+ log_error("inode %ld is not valid", parent);
fuse_reply_err(req, EBADF);
return;
}
@@ -2503,11 +2503,11 @@ static void xfuse_cb_open(fuse_req_t req, fuse_ino_t ino,
char full_path[4096];
tui32 device_id;
- log_debug("entered: ino=%d", (int) ino);
+ log_debug("entered: ino=%ld", ino);
if (!xfuse_is_inode_valid(ino))
{
- log_error("inode %d is not valid", ino);
+ log_error("inode %ld is not valid", ino);
fuse_reply_err(req, EBADF);
return;
}
@@ -2516,7 +2516,7 @@ static void xfuse_cb_open(fuse_req_t req, fuse_ino_t ino,
xinode = g_xrdp_fs.inode_table[ino];
if (!xinode)
{
- log_debug("****** g_xrdp_fs.inode_table[%d] is NULL", ino);
+ log_debug("****** g_xrdp_fs.inode_table[%ld] is NULL", ino);
fuse_reply_err(req, EBADF);
return;
}
@@ -2589,11 +2589,12 @@ static void xfuse_cb_release(fuse_req_t req, fuse_ino_t ino, struct
XFUSE_HANDLE *handle = (XFUSE_HANDLE *) (tintptr) (fi->fh);
tui32 FileId;
- log_debug("entered: ino=%d fi=%p fi->fh=%p", (int) ino, fi, fi->fh);
+ log_debug("entered: ino=%ld fi=%p fi->fh=0x%llx", ino, fi,
+ (long long) fi->fh);
if (!xfuse_is_inode_valid(ino))
{
- log_error("inode %d is not valid", ino);
+ log_error("inode %ld is not valid", ino);
fuse_reply_err(req, EBADF);
return;
}
@@ -2601,7 +2602,7 @@ static void xfuse_cb_release(fuse_req_t req, fuse_ino_t ino, struct
XRDP_INODE *xinode = g_xrdp_fs.inode_table[ino];
if (!xinode)
{
- log_debug("****** g_xrdp_fs.inode_table[%d] is NULL", ino);
+ log_debug("****** g_xrdp_fs.inode_table[%ld] is NULL", ino);
fuse_reply_err(req, 0);
return;
}
@@ -2637,8 +2638,8 @@ static void xfuse_cb_release(fuse_req_t req, fuse_ino_t ino, struct
fip->device_id = handle->DeviceId;
fip->fi = fi;
- log_debug(" +++ created XFUSE_INFO=%p XFUSE_INFO->fi=%p XFUSE_INFO->fi->fh=%p",
- fip, fip->fi, fip->fi->fh);
+ log_debug(" +++ created XFUSE_INFO=%p XFUSE_INFO->fi=%p XFUSE_INFO->fi->fh=0x%llx",
+ fip, fip->fi, (long long) fip->fi->fh);
FileId = handle->FileId;
fip->fi->fh = 0;
@@ -2665,7 +2666,7 @@ static void xfuse_cb_read(fuse_req_t req, fuse_ino_t ino, size_t size,
struct req_list_item *rli;
long handle;
- log_debug("want_bytes %ld bytes at off %ld", size, off);
+ log_debug("want_bytes %zd bytes at off %lld", size, (long long) off);
if (fi->fh == 0)
{
@@ -2701,8 +2702,8 @@ static void xfuse_cb_read(fuse_req_t req, fuse_ino_t ino, size_t size,
if (g_req_list->count == 1)
{
- log_debug("requesting clipboard file data lindex = %d off = %d size = %d",
- rli->lindex, (int) off, (int) size);
+ log_debug("requesting clipboard file data lindex = %d off = %lld size = %zd",
+ rli->lindex, (long long) off, size);
clipboard_request_file_data(rli->stream_id, rli->lindex,
(int) off, (int) size);
@@ -2738,8 +2739,8 @@ static void xfuse_cb_write(fuse_req_t req, fuse_ino_t ino, const char *buf,
... 161 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-remote/packages/xrdp.git
More information about the Pkg-remote-team
mailing list