This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository libx2goclient. from 21aaac1 src/x2goclient-utils.c: truncation size in x2goclient_strbrk_dup () should not be further decremented. new ff43716 src/x2goclient-openssh-bugs.c: stderr closing was supposedly implemented in 8.4p1, but... new ca79015 src/x2goclient-utils.{c,h}: add new function x2goclient_bool_to_str (). new 624f6ba src/test/sshtest.c: rework completely, split into a lot of smaller subfunctions, handle errors more correctly, fix running the full suite of tests even if no location was specified. new 6c8a91e src/x2goclient-network.{c,h}: add basic disconnect support. new 36158f4 src/x2goclient-network-ssh.{c,h}: add x2goclient_network_ssh_disconnect (), which is more or less a copy of the old code in x2goclient_network_ssh_finalize (). new b36136d src/x2goclient-openssh-version.c: clarify "weird casting" comment a bit. new 76d299d src/x2goclient-network-ssh.c: fix return value for initial failures in x2goclient_network_ssh_parent_connect (). new 18f20df src/x2goclient-network-ssh.c: change "would" to "will" in debug message before actually spawning the master connection in x2goclient_network_ssh_parent_connect (). new 833b8a1 src/x2goclient-network-ssh.c: set return value to TRUE after initial checks in x2goclient_network_ssh_kill_subprocesses (). new 4477232 src/test/sshtest.c: split up connection testing and create connect-connect-disconnect-connect cycle. new 7e60ebd src/x2goclient-network.c: remove reference to SSH and replace it with a more generic "network" description. new e8677ac src/x2goclient-network.c: document API and a corresponding private function. new 68a8981 src/x2goclient-network.c: correctly initialize class variables. new 1adaa27 src/x2goclient-network-ssh.c: fix error message for port that is too big in x2goclient_network_ssh_parse_sockspec_port (). new bfa2b8a src/x2goclient-network-ssh.c: check parameter for validity and optimize code in x2goclient_network_ssh_sanitize_sockspec (). new 62663ec src/x2goclient-network-ssh.c: switch from inet_pton () to inet_addr () for IPv4 address validation in x2goclient_network_ssh_parse_sockspec_ip (). new e2699cf src/x2goclient-network-ssh.c: remove useless else block in x2goclient_network_ssh_parse_sockspec_ip (). new a08cf9b src/x2goclient-network-ssh.c: fix typo in error message. new af1df60 src/x2goclient-network-ssh.c: set AF_HOST to a high, randomly-determined value. new 93e7aa1 src/x2goclient-network-ssh.c: fix comment style. new 4f4931e src/x2goclient-network-ssh.c: add array validity check to x2goclient_network_ssh_gptrarray_print_debug (). new b59db11 src/x2goclient-network-ssh.c: "unreference" check thread pointer in x2goclient_network_ssh_check_timeout_thread_main (). new 132ad9e src/x2goclient-network-ssh.h: document error enum. new b3fa790 src/x2goclient-network-ssh.c: document full class. new 32ea7c4 src/x2goclient-network-ssh.h: rename anonymous error struct to X2GoClientNetworkSSHErrors. new 7aa6880 src/x2goclient-openssh-bugs.h: rename errors enum, like in previous commit. new 8d3db17 src/x2goclient-openssh-version.h: rename errors enum, like in previous commits. new 91978d9 src/x2goclient-openssh-bugs.h: document error enum. new ecd1311 src/x2goclient-openssh-bugs.c: document full class. new b4802ef src/x2goclient-openssh-version.c: fix negative version number error message. new 2f9d330 src/x2goclient-openssh-version.h: document error enum. new 83f6ebc autoconf.ac: switch to non-deprecated AC_HEADER_STDC macro. new 7554b5e autoconf.ac: use AC_C_TYPEOF macro for typeof support/detection. new a367c6e src/test/sshtest.c: fix compiler warning: %p accepts void * only. new 1dffde5 src/x2goclient-network-ssh.c: move (dis-)connect pointer types around. new 9e0fdd2 src/x2goclient-network-ssh.c: fix warnings due to unused variables. new a2f0a5f src/x2goclient-network{,-ssh}.c: fix G_DEFINE*_TYPE warnings. new 7d02835 src/x2goclient-openssh-version.c: fix warning for assignment-in-if-clause. new bfe1058 src/x2goclient-openssh-version.c: fix zero-length format string warning. new 021444b src/x2goclient-network{.{c,h},-ssh.c}: make connect-func and disconnect-func properties return and set via pointer to pointer to function, move typedefs into header file for global use. new cfe067f src/x2goclient-openssh-version.{c,h}: correctly check for the validity of version components. new c121165 src/x2goclient-utils.h: add type safety macros X2GOCLIENT_CHECK_TYPE{,_TYPEOF}. new 7f88b1d src/x2goclient-openssh-version.c: use type safety macros in macros that handle setting version components. new 8502e1b src/x2goclient-network{.{c,h},-ssh.c}: fix gobject-introspection warnings due to non-namespaced function pointer and reference types. new f4dd721 src/x2goclient-openssh-version.c: document full class. new 5b0580d src/x2goclient-utils.c: document all functions. new 64ffafd src/test/sshtest.c: run all tests twice - with concrete implementation and super class semantics. new 7ed999c docs/reference/libx2goclient: add Makefile.am - copied verbatim from upstream. new 30c078c docs/reference/libx2goclient/Makefile.am: basic adaptation to project. new 9f2e8a9 /: add autogen.sh - useful for regenerating configure. new 5a4d670 configure.ac: add gtk-doc integration. new fd18ecf configure.ac: whitespace only. new 14e3185 Makefile.am: build distcheck with gtk-doc support. new 1b10b40 Makefile.am: recurse into docs sub-directory. new bbb62e1 Makefile.am: package gtk-doc.make during dist target. new a5c3e88 docs/: add Makefile.am, recursing into reference sub-directory. new 6782f00 docs/reference: add Makefile.am, recursing into libx2goclient sub-directory. new fd13363 configure.ac: auto-generate Makefiles for gtk-doc generation. new e012ded .gitignore: add/ignore gtk-doc build-time files. new 2a7c4e7 docs/reference/libx2goclient/Makefile.am: add common NULL variable. new 98026eb configure.ac: move AC_PREREQ() up, it probably should be the first call. new 1f67ba2 configure.ac: rework versioning. new 006250a src/Makefile.am: rework versioning for shared library and gobject-introspection data. new 4799204 src/test/Makefile.am: use new, versioned libx2goclient library name. new 894c9af docs/reference/libx2goclient/: add version.xml.in file, containing AC_SUBSTituted version macro. new 001ff56 docs/reference/libx2goclient/Makefile.am: add version.xml{,.in} references. new 50cfbc8 configure.ac: rework library versioning system. new 2f95b99 src/x2goclient.pc.in: rework, add @LIBINTL@ for gettext/libintl linkage. new 71f7050 {configure.ac,debian/{copyright,libx2goclient-dev.install},src/{,Makefile.am}}: rename x2goclient.pc.in to libx2goclient.pc.in. new 09413dd src/{,test/}Makefile.am: rename library file back to unversioned variant. new 46a82b2 src/Makefile.am: sync gobject-introspection section with documentation. new 4f20dbe .gitignore: ignore more gtk-doc temporary stuff. new 14f8a7a docs/reference/libx2goclient/Makefile.am: ignore private gnativesocketaddress.h file. new 6347fce docs/reference/libx2goclient/Makefile.am: link against (hopefully built) libx2goclient.la. new cfa06a4 src/x2goclient-network-ssh.c: reference X2GoClientNetworkOptions as more concrete class, not itself. new fb25d36 src/x2goclient-utils.{c,h}: gtk-doc is unable to parse "const long long argument_name" correctly, rewrite as "const long long int argument_name". new ea36a93 src/x2goclient-openssh-bugs.h: reference X2GoClientOpenSSH{Bugs,Version} classes correctly. new 35e3b09 src/x2goclient-{network{.c,-network.{c,h}},{openssh-{bugs,version},utils}.{c,h}}: switch to current version 0.0.0. new 7f5a2a2 src/x2goclient-{network{,-ssh},openssh-{bugs,version}}.c: gtk-doc needs the section name to match the file name, so rename all sections. new b35a57d src/x2goclient-network{,-ssh}.{c,h}: split options classes out into src/x2goclient-network-options{,-ssh}.{c,h}. new b27bee7 po/POTFILES.in: add new options source files. new 92e7a3d src/Makefile.am: add new options header and source files. new 9187443 src/x2goclient-network-ssh.c: fix file name copy & paste left-overs. new 7c9c24c src/x2goclient-network-options{,-ssh}.c: fix compile warnings due to unused parameters. new 64d62b2 src/x2goclient-network-options.h: mark trailing padding in class structure as private. new 5608561 src/x2goclient-network-ssh.c: fix class name in documentation block. new 50014ee src/x2goclient-network-ssh.c: fix documentation block, whitespace-only. new a498517 src/x2goclient-network{,-ssh}.{c,h}: rework (dis-)connect hierarchy architecture. new ce0ad4c src/x2goclient-network{,-options-ssh}.c: unify comment style for instance pointer. new 04b26e6 src/x2goclient-openssh-bugs.{c,h}: move bugs documentation to implementation file to fix gtk-doc warning. new 18da07f src/x2goclient-{network{,-options}-ssh,openssh-{bugs,version},utils}.c: add title tags to final classes in order to generate the proper names. new 989fd27 src/x2goclient-utils.c: add basic section documentation. new cb1bf1c src/x2goclient-utils.c: change "long long" references to "long long int". new 932cdb5 src/x2goclient-utils.c: add emphasis to capital-type words. new 2b08269 src/x2goclient-utils.c: fix typos while referencing function parameters (percent character vs. at character). new 56bf1f9 src/x2goclient-network-ssh.c: fix compile warning by using universal zero initializer first and then overriding fields as necessary. new b086b8a src/x2goclient-utils.{c,h}: have x2goclient_bool_to_str () return const gchar *, since it's a static string. new 8e661a2 src/x2goclient-network-ssh.c: reference X2GoClientNetwork:options property in x2goclient_network_ssh_connect () documentation, since no X2GoClientNetworkSSH:options property exists, but also make clear that this class/function expects an X2GoClientNetworkOptionsSSH instance being bound to the property. new 0d158b8 src/x2goclient-network-ssh.c: add general SSH client options before those in X2GoClientNetworkOptionsSSH. new 19c7d1f src/x2goclient-{network-ssh,openssh-version}.h: switch more occurrences from "long long" to "long long int". new 65ef9ca src/x2goclient-network-ssh.h: use comment hack to "escape" whitespace and newline characters within tags in documentation. new 9aa99e6 src/x2goclient-network-ssh.h: mention the actually expected instance/object type in the documentation for the X2GOCLIENT_NETWORK_SSH_ERROR_CONNECT_OPTIONS_INVALID error. new e45c1ba src/x2goclient-network-ssh.h: link own class in documentation. new 3f68489 src/x2goclient-openssh-version.h: link own class in documentation. new e42ff1a src/x2goclient-openssh-version.h: link to X2GoClientOpenSSHVersion class in documentation of X2GOCLIENT_OPENSSH_VERSION_ERROR_INVALID_STRUCT error. new 4b9bdb0 src/: add x2goclient-network-stub.{c,h}. new db43631 src/Makefile.am: add x2goclient-network-stub.{c,h}. new 84a8309 po/POTFILES.in: add src/x2goclient-network-stub.c. new 7c1bb6e src/test/sshtest.c: sprinkle network stub class in. new 250e592 src/x2goclient-network-ssh.c: add debug statements to see when parent_{dis,}connect functions have been called. new a167cd5 docs/reference/libx2goclient/Makefile.am: force regeneration of sections.txt file as part of every gtkdoc-scan run. new 0b3c5e4 src/x2goclient-openssh-bugs.{c,h}: move structure documentation back to header file. new ce54caf src/x2goclient-openssh-bugs.c: add comment explaining that we will keep a bit of code selecting on the patch version as a how-to. new b915ebf src/x2goclient-openssh-version.h: make version component valid structure entries unsigned. new c3f208e src/x2goclient-network-options-ssh.c: fix type name in documentation comment. new d58a18c src/x2goclient-network-options{,-ssh}.c: add missing class structure documentation. new 317d9e7 src/x2goclient-network-options-ssh.c: add missing x2goclient_network_options_ssh_new () function. new f55528d src/x2goclient-utils.h: fix macro names in documentation comments. new 2432578 src/x2goclient-{network-options-ssh,openssh-version}.c: use more docbook tags where appropriate. new fd8be77 src/x2goclient-{network{-options,}-ssh.c,network.h}: add input tag to documentation where necessary. new 7a9d399 src/x2goclient-{network-{ssh,stub},openssh-{bugs,version}}.c: add missing documentation. new 318ccb8 src/x2goclient-{network-{ssh,stub},openssh-version}.c: remove (transfer full) annotation for basic data types/return by value. new aba666e src/x2goclient-{{network-ssh,openssh-version,utils}.c,utils.h}: change occurrences of "long long" to "long long int". new dc5ea65 src/x2goclient-network-ssh.c: documentation annotations cannot be split onto multiple lines, consolidate. new 0eaa64e src/x2goclient-{network-ssh.c,openssh-version.h}: fix typos in documentation. new 03c8082 src/x2goclient-network-ssh.c: use g_boxed_free () instead of free-standing function. new d62e766 src/x2goclient-network.c: note that the documentation will include a hard-coded prefix (home dir) in the session path default value, which really is a string determined at run time. new 69a80c8 src/x2goclient-utils.c: the style guide says to determinate parameter descriptions with a period, so do that. new 57b02cc src/x2goclient-utils.c: add missing transfer return annotation to x2goclient_strbrk_dup () documentation. new c0ea534 src/x2goclient-utils.c: add more parenthesis to x2goclient_strbrk_dup (). new a948f0f src/x2goclient-network-ssh.c: change session_path literal to link to session_path property. new 43aa373 src/x2goclient-{{network-ssh,openssh-version}.h,network.c}: work around spurious newlines in documentation by using HTML/XML comments. The 132 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: .gitignore | 20 + Makefile.am | 7 +- autogen.sh | 6 + configure.ac | 171 +++- debian/copyright | 2 +- debian/libx2goclient-dev.install | 2 +- docs/Makefile.am | 3 + docs/reference/Makefile.am | 3 + docs/reference/libx2goclient/Makefile.am | 121 +++ docs/reference/libx2goclient/version.xml.in | 1 + po/POTFILES.in | 3 + src/Makefile.am | 40 +- src/{x2goclient.pc.in => libx2goclient.pc.in} | 6 +- src/test/sshtest.c | 370 ++++++- src/x2goclient-network-options-ssh.c | 121 +++ ...t-object.h => x2goclient-network-options-ssh.h} | 22 +- src/x2goclient-network-options.c | 79 ++ ...lient-object.h => x2goclient-network-options.h} | 25 +- src/x2goclient-network-ssh.c | 1031 +++++++++++++++++--- src/x2goclient-network-ssh.h | 83 +- src/x2goclient-network-stub.c | 329 +++++++ ...goclient-object.h => x2goclient-network-stub.h} | 28 +- src/x2goclient-network.c | 252 ++++- src/x2goclient-network.h | 98 +- src/x2goclient-openssh-bugs.c | 73 +- src/x2goclient-openssh-bugs.h | 37 +- src/x2goclient-openssh-version.c | 341 ++++++- src/x2goclient-openssh-version.h | 114 ++- src/x2goclient-utils.c | 155 ++- src/x2goclient-utils.h | 87 +- 30 files changed, 3239 insertions(+), 391 deletions(-) create mode 100755 autogen.sh create mode 100644 docs/Makefile.am create mode 100644 docs/reference/Makefile.am create mode 100644 docs/reference/libx2goclient/Makefile.am create mode 100644 docs/reference/libx2goclient/version.xml.in rename src/{x2goclient.pc.in => libx2goclient.pc.in} (76%) create mode 100644 src/x2goclient-network-options-ssh.c copy src/{x2goclient-object.h => x2goclient-network-options-ssh.h} (58%) create mode 100644 src/x2goclient-network-options.c copy src/{x2goclient-object.h => x2goclient-network-options.h} (61%) create mode 100644 src/x2goclient-network-stub.c copy src/{x2goclient-object.h => x2goclient-network-stub.h} (55%) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 833b8a1ccf33f780ef9d20175d5fb2fb10da283c Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Oct 31 02:39:27 2020 +0100 src/x2goclient-network-ssh.c: set return value to TRUE after initial checks in x2goclient_network_ssh_kill_subprocesses (). Otherwise, calling that function without a running master connection (which should essentially be a no-op) returns a failure, which is not intended. --- src/x2goclient-network-ssh.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 6e1565a..6279e57 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -735,6 +735,12 @@ static gboolean x2goclient_network_ssh_kill_subprocesses (X2GoClientNetworkSSH * g_return_val_if_fail (X2GOCLIENT_IS_NETWORK_SSH (self), ret); + /* + * There's hardly anything that can fail and if it does we can update the + * return value directly. + */ + ret = TRUE; + g_mutex_lock (&(self->check_thread_mutex)); if (self->active_master_conn) { g_mutex_unlock (&(self->check_thread_mutex)); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 7e60ebd5f0cb526cd8e651da43bfa9a30cd56d21 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Oct 31 06:59:17 2020 +0100 src/x2goclient-network.c: remove reference to SSH and replace it with a more generic "network" description. --- src/x2goclient-network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/x2goclient-network.c b/src/x2goclient-network.c index d46f28f..1a4da7e 100644 --- a/src/x2goclient-network.c +++ b/src/x2goclient-network.c @@ -120,8 +120,8 @@ static void x2goclient_network_class_init (X2GoClientNetworkClass * const klass) g_string_append (default_session_path, "/.libx2goclient/"); net_obj_properties[X2GO_NET_PROP_SESSION_PATH] = g_param_spec_string ("session-path", _("Base path to session data"), _("The file system path that will be used as the " - "session data base path. SSH-related files will " - "land there."), + "session data base path. Connection-related files " + "will land there."), default_session_path->str, G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE); g_boxed_free (G_TYPE_GSTRING, default_session_path); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 1adaa27d81c21416b437de5bb26b0180f472d59d Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Feb 19 06:59:09 2021 +0100 src/x2goclient-network-ssh.c: fix error message for port that is too big in x2goclient_network_ssh_parse_sockspec_port (). --- src/x2goclient-network-ssh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 6279e57..c74dbb1 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -392,7 +392,7 @@ static guint16 x2goclient_network_ssh_parse_sockspec_port (const GString * const g_set_error_literal (gerr, X2GOCLIENT_NETWORK_SSH_ERROR, X2GOCLIENT_NETWORK_SSH_ERROR_PORT_CONV_NEGATIVE_ZERO, "Port specifier out of range: negative or zero."); } else if (max_err) { - g_set_error_literal (gerr, X2GOCLIENT_NETWORK_SSH_ERROR, X2GOCLIENT_NETWORK_SSH_ERROR_PORT_CONV_TOO_BIG, "Port specifier out of range: negative or zero."); + g_set_error_literal (gerr, X2GOCLIENT_NETWORK_SSH_ERROR, X2GOCLIENT_NETWORK_SSH_ERROR_PORT_CONV_TOO_BIG, "Port specifier out of range: too big."); } else { ret = conv; -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit ff437164d4444ba0b7af64be312bcdb63ed057ef Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Oct 29 02:10:14 2020 +0100 src/x2goclient-openssh-bugs.c: stderr closing was supposedly implemented in 8.4p1, but... It turns out that the implementation is buggy and ironically doesn't close stderr, but instead double-closes stdout. Tentatively update the version requirement to 8.4p2 since this will probably be fully fixed and included in 8.4p2 rather soon. Otherwise, we'll need to update the version requirement to 8.5(p1) at a later time. --- src/x2goclient-openssh-bugs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x2goclient-openssh-bugs.c b/src/x2goclient-openssh-bugs.c index da59144..9328f0e 100644 --- a/src/x2goclient-openssh-bugs.c +++ b/src/x2goclient-openssh-bugs.c @@ -73,7 +73,7 @@ gboolean x2goclient_openssh_bugs_update (X2GoClientOpenSSHBugs * const self, con *self = (const X2GoClientOpenSSHBugs) { 0 }; if (8 >= version->major) { - if (4 >= version->minor) { + if ((4 > version->minor) || ((4 == version->minor) && (2 > version->patch))) { self->backgrounding_keeps_stderr = TRUE; } } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 18f20df94032ca331c9c91c8124fc08a1b064741 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Oct 31 02:29:56 2020 +0100 src/x2goclient-network-ssh.c: change "would" to "will" in debug message before actually spawning the master connection in x2goclient_network_ssh_parent_connect (). We're really in for it and not just pretending. --- src/x2goclient-network-ssh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 6af22b1..6e1565a 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -929,7 +929,7 @@ static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork * const } if (ret) { - x2goclient_network_ssh_gptrarray_print_debug (ssh_cmd, "Would try to connect via:", "OpenSSH client command"); + x2goclient_network_ssh_gptrarray_print_debug (ssh_cmd, "Will try to connect via:", "OpenSSH client command"); g_log (NULL, G_LOG_LEVEL_DEBUG, "Launching!"); ret = x2goclient_network_ssh_start_sshcmd (self, ssh_cmd, gerr, TRUE); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 36158f4a194419f117d04708433d1f54663b9476 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Oct 31 02:43:55 2020 +0100 src/x2goclient-network-ssh.{c,h}: add x2goclient_network_ssh_disconnect (), which is more or less a copy of the old code in x2goclient_network_ssh_finalize (). Naturally, we're also using it in x2goclient_network_ssh_finalize (). --- src/x2goclient-network-ssh.c | 132 ++++++++++++++++++++++++++++--------------- src/x2goclient-network-ssh.h | 1 + 2 files changed, 89 insertions(+), 44 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index d130cac..e22c027 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -72,6 +72,7 @@ G_DEFINE_TYPE (X2GoClientNetworkOptionsSSH, x2goclient_network_options_ssh, X2GO * improve maintainability. */ typedef gboolean (*parent_connect_type) (void * const self, void * const gerr); +typedef gboolean (*parent_disconnect_type) (void * const self, void * const gerr); static void x2goclient_network_options_ssh_class_init (X2GoClientNetworkOptionsSSHClass * const klass) { @@ -153,6 +154,7 @@ static GSocketAddress* x2goclient_network_ssh_parse_sockspec_alias (const GStrin static GSocketAddress* x2goclient_network_ssh_parse_sockspec (X2GoClientNetwork * const parent, const GString * const sockspec); static gboolean x2goclient_network_ssh_kill_subprocesses (X2GoClientNetworkSSH * const self); static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork * const parent, GError ** const gerr); +static gboolean x2goclient_network_ssh_parent_disconnect (X2GoClientNetwork * const parent, GError ** const gerr); static gboolean x2goclient_network_ssh_fetch_openssh_version (X2GoClientNetworkSSH * const self, GError ** const gerr); static void x2goclient_network_ssh_log_std_str (const gchar * const str, const gsize str_size, const _Bool select_stderr); static gboolean x2goclient_network_ssh_gptrarray_to_string (GPtrArray * const arr, const gchar * const prelude, gchar ** const ret_str); @@ -194,6 +196,7 @@ static void x2goclient_network_ssh_class_init (X2GoClientNetworkSSHClass * const X2GoClientNetworkClass *parent_class = X2GOCLIENT_NETWORK_CLASS (klass); parent_class->connect = &x2goclient_network_ssh_parent_connect; + parent_class->disconnect = &x2goclient_network_ssh_parent_disconnect; parent_class->parse_sockspec = &x2goclient_network_ssh_parse_sockspec; } @@ -253,50 +256,8 @@ static void x2goclient_network_ssh_finalize (GObject * const object) { * connection, so make sure that the dependencies are set up correctly here. */ - /* Remove timeout source. */ - g_mutex_lock (&(self->check_thread_mutex)); - if (self->check_thread_loop) { - g_main_context_invoke_full (self->check_thread_context, G_PRIORITY_DEFAULT_IDLE, G_SOURCE_FUNC (&g_main_loop_quit), self->check_thread_loop, NULL); - } - - if (self->check_timeout_source) { - g_source_destroy (self->check_timeout_source); - g_source_unref (self->check_timeout_source); - self->check_timeout_source = NULL; - } - - /* Let last event run out and thread terminate. */ - if (self->check_thread) { - /* - * Keep the mutex clear while joining the thread. - * - * Otherwise, the thread's main function won't continue to execute (and - * finish) after its main loop (correctly) terminated. - */ - g_mutex_unlock (&(self->check_thread_mutex)); - - (void) g_thread_join (self->check_thread); - - g_mutex_lock (&(self->check_thread_mutex)); - self->check_thread = NULL; - } - - /* - * Context should be gone by now, implicitly through the thread's main - * method, so let's just get rid of the pointer. - */ - self->check_thread_context = NULL; - g_mutex_unlock (&(self->check_thread_mutex)); - - g_mutex_clear (&(self->check_thread_mutex)); - - if (!(x2goclient_network_ssh_kill_subprocesses (self))) { - g_log (NULL, G_LOG_LEVEL_CRITICAL, "Some subprocesses were not terminated correctly!"); - } - - g_free (self->control_path); - self->control_path = NULL; - + /* Disconnect from held connections and terminate the master connection. */ + x2goclient_network_ssh_disconnect (self, NULL); /* Properties. */ if (self->openssh_version) { @@ -984,6 +945,89 @@ static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork * const return (ret); } +gboolean x2goclient_network_ssh_disconnect (X2GoClientNetworkSSH * const self, GError ** const gerr) { + gboolean ret = FALSE; + + g_return_val_if_fail (X2GOCLIENT_IS_NETWORK_SSH (self), ret); + g_return_val_if_fail (((NULL == gerr) || (NULL == *gerr)), ret); + + X2GoClientNetwork *parent = X2GOCLIENT_NETWORK (self); + X2GoClientNetworkClass *parent_class = X2GOCLIENT_NETWORK_GET_CLASS (parent); + + /* Fetch parent's disconnect function. */ + parent_disconnect_type parent_disconnect = NULL; + g_object_get (G_OBJECT (self), "disconnect-function", &parent_disconnect, NULL); + g_assert (parent_disconnect); + + if (parent_disconnect) { + ret = parent_disconnect (parent, gerr); + } + + return (ret); +} + +static gboolean x2goclient_network_ssh_parent_disconnect (X2GoClientNetwork * const parent, GError ** const gerr) { + gboolean ret = FALSE; + + g_return_val_if_fail (X2GOCLIENT_IS_NETWORK_SSH (parent), ret); + g_return_val_if_fail (((NULL == gerr) || (NULL == *gerr)), ret); + + X2GoClientNetworkSSH *self = X2GOCLIENT_NETWORK_SSH (parent); + + /* Actual implementation here. */ + + /* Most things can't really fail, so prepare for success. */ + ret = TRUE; + + /* Remove timeout source. */ + g_mutex_lock (&(self->check_thread_mutex)); + if (self->check_thread_loop) { + g_main_context_invoke_full (self->check_thread_context, G_PRIORITY_DEFAULT_IDLE, G_SOURCE_FUNC (&g_main_loop_quit), self->check_thread_loop, NULL); + } + + if (self->check_timeout_source) { + g_source_destroy (self->check_timeout_source); + g_source_unref (self->check_timeout_source); + self->check_timeout_source = NULL; + } + + /* Let last event run out and thread terminate. */ + if (self->check_thread) { + /* + * Keep the mutex clear while joining the thread. + * + * Otherwise, the thread's main function won't continue to execute (and + * finish) after its main loop (correctly) terminated. + */ + g_mutex_unlock (&(self->check_thread_mutex)); + + (void) g_thread_join (self->check_thread); + + g_mutex_lock (&(self->check_thread_mutex)); + self->check_thread = NULL; + } + + /* + * Context should be gone by now, implicitly through the thread's main + * method, so let's just get rid of the pointer. + */ + self->check_thread_context = NULL; + g_mutex_unlock (&(self->check_thread_mutex)); + + g_mutex_clear (&(self->check_thread_mutex)); + + ret &= x2goclient_network_ssh_kill_subprocesses (self); + + if (!(ret)) { + g_log (NULL, G_LOG_LEVEL_CRITICAL, "Some subprocesses were not terminated correctly!"); + } + + g_free (self->control_path); + self->control_path = NULL; + + return (ret); +} + static gboolean x2goclient_network_ssh_fetch_openssh_version (X2GoClientNetworkSSH * const self, GError ** const gerr) { gboolean ret = FALSE; diff --git a/src/x2goclient-network-ssh.h b/src/x2goclient-network-ssh.h index 690d550..f3108cb 100644 --- a/src/x2goclient-network-ssh.h +++ b/src/x2goclient-network-ssh.h @@ -73,6 +73,7 @@ enum { gboolean x2goclient_network_ssh_connect (X2GoClientNetworkSSH * const self, GError ** const gerr); +gboolean x2goclient_network_ssh_disconnect (X2GoClientNetworkSSH * const self, GError ** const gerr); G_END_DECLS -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 68a898142755be87247a0f51d5ab3747281dd3e8 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Feb 13 00:46:48 2021 +0100 src/x2goclient-network.c: correctly initialize class variables. --- src/x2goclient-network.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/x2goclient-network.c b/src/x2goclient-network.c index a5cb1ad..e944d0c 100644 --- a/src/x2goclient-network.c +++ b/src/x2goclient-network.c @@ -132,6 +132,16 @@ static GSocketAddress* x2goclient_network_parse_sockspec (X2GoClientNetwork * co static void x2goclient_network_class_init (X2GoClientNetworkClass * const klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); + /* Initialize class members. */ + klass->connect = NULL; + klass->disconnect = NULL; + klass->parse_sockspec = NULL; + + /* + * N.B.: we won't initialize padding since it doesn't contain any useful + * data anyway. + */ + object_class->dispose = &x2goclient_network_dispose; object_class->finalize = &x2goclient_network_finalize; -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit e8677acb98bed7c1416a90bccbf615b610630745 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Oct 31 07:02:52 2020 +0100 src/x2goclient-network.c: document API and a corresponding private function. --- src/x2goclient-network.c | 179 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 179 insertions(+) diff --git a/src/x2goclient-network.c b/src/x2goclient-network.c index 1a4da7e..a5cb1ad 100644 --- a/src/x2goclient-network.c +++ b/src/x2goclient-network.c @@ -33,6 +33,23 @@ #include "x2goclient.h" #include "x2goclient-network.h" +/** + * SECTION:X2GoClientNetworkOptions + * @short_description: Abstract base class encapsulating network options + * @stability: Unstable + * @include: libx2goclient/x2goclient-network.h + * + * #X2GoClientNetworkOptions is an abstract base class used to encapsulate + * network options. + * + * Currently, there are no common options that could be used generically for + * all dependent classes, so it's essentially fully empty (yet providing the + * general skeleton). + * + * An example of a more concrete implementation is + * #X2GoClientNetworkOptionsSSH. + */ + /* Not sure if we need this, so comment out for now. */ /* typedef struct X2GoClientNetworkOptionsPrivate_ { @@ -49,6 +66,28 @@ static void x2goclient_network_options_init (X2GoClientNetworkOptions * const se } +/** + * SECTION:X2GoClientNetwork + * @short_description: Abstract base class representing network connections + * @stability: Unstable + * @include: libx2goclient/x2goclient-network.h + * + * #X2GoClientNetwork is an abstract base class providing a common interface + * for network connections. + * + * These are basic functions and behaviors that every dependent class must + * implement, rely upon and obey. + * + * An example of a more concrete implementation is #X2GoClientNetworkSSH. + */ + +/** + * X2GoClientNetwork: + * + * #X2GoClientNetwork is an opaque data structure and can only be accessed + * using the following functions. + */ + typedef struct X2GoClientNetworkPrivate_ { GString *socket_spec; GSocketAddress *socket; @@ -99,18 +138,62 @@ static void x2goclient_network_class_init (X2GoClientNetworkClass * const klass) object_class->set_property = &x2goclient_network_set_property; object_class->get_property = &x2goclient_network_get_property; + /** + * X2GoClientNetwork:socket-spec: + * + * A low-level socket specification as a string. + * + * It is write-only. + * + * It updates the #X2GoClientNetwork:socket property accordingly. + * + * Note that, if parsing the socket specification failed, + * #X2GoClientNetwork:socket will be %NULL. This is also the case if no + * parsing function has been set. + * + * See also x2goclient_network_parse_sockspec(). + * + * Since: 0.0.5 + */ net_obj_properties[X2GO_NET_PROP_SOCKET_SPEC] = g_param_spec_boxed ("socket-spec", _("Low-level socket string specification"), _("String specification for the low-level socket network " "connection. Updates the \"socket\" property."), G_TYPE_GSTRING, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE); + /** + * X2GoClientNetwork:socket: + * + * A low-level #GSocketAddress object, representing the parsed remote socket + * address. + * + * It is read-only. + * + * It can be %NULL if no socket specifier has been provided yet or parsing + * one failed. + * + * If a local part as been specified, it will be used as the socket's local + * (i.e., outgoing) binding address. + * + * FIXME: the "local part" as described here is not implemented. + * + * Since: 0.0.5 + */ net_obj_properties[X2GO_NET_PROP_SOCKET] = g_param_spec_object ("socket", _("Low-level socket"), _("Low-level socket for the network connection, the local " "part will be used for local binding if specified."), G_TYPE_SOCKET_ADDRESS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE); + /** + * X2GoClientNetwork:options: + * + * A mutable #X2GoClientNetworkOptions object encapsulating network options. + * + * Can be %NULL if not set previously. + * + * Since: 0.0.5 + */ net_obj_properties[X2GO_NET_PROP_OPTIONS] = g_param_spec_object ("options", _("Socket options"), _("Specific socket options."), X2GOCLIENT_TYPE_NETWORK_OPTIONS, @@ -118,6 +201,16 @@ static void x2goclient_network_class_init (X2GoClientNetworkClass * const klass) GString *default_session_path = g_string_new (g_get_home_dir ()); g_string_append (default_session_path, "/.libx2goclient/"); + /** + * X2GoClientNetwork:session-path: + * + * A string representing the base file system path to session data. + * + * It can only be set at the object's creation time and is immutable + * following the constructions. + * + * Since: 0.0.5 + */ net_obj_properties[X2GO_NET_PROP_SESSION_PATH] = g_param_spec_string ("session-path", _("Base path to session data"), _("The file system path that will be used as the " "session data base path. Connection-related files " @@ -127,17 +220,49 @@ static void x2goclient_network_class_init (X2GoClientNetworkClass * const klass) g_boxed_free (G_TYPE_GSTRING, default_session_path); default_session_path = NULL; + /** + * X2GoClientNetwork:connected: + * + * This boolean value denotes whether a connection has been established or + * not. + * + * It is read-only. + * + * Since: 0.0.5 + */ net_obj_properties[X2GO_NET_PROP_CONNECTED] = g_param_spec_boolean ("connected", _("Boolean for connected state"), _("Boolean value denoting whether a connection has " "been established or not."), FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE); + /** + * X2GoClientNetwork:connect-function: + * + * This property holds a pointer to the instance's connect function. + * + * It is read-only. + * + * Use it to fetch the parent's connect function in derived classes. + * + * Since: 0.0.5 + */ net_obj_properties[X2GO_NET_PROP_CONN_FUNC] = g_param_spec_pointer ("connect-function", _("Pointer to this instance's connect function"), _("A pointer to the instance's connect function. " "This is supposed to be immutable."), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE); + /** + * X2GoClientNetwork:disconnect-function: + * + * This property holds a pointer to the instance's disconnect function. + * + * It is read-only. + * + * Use it to fetch the parent's disconnect function in derived classes. + * + * Since: 0.0.5 + */ net_obj_properties[X2GO_NET_PROP_DISCONN_FUNC] = g_param_spec_pointer ("disconnect-function", _("Pointer to this instance's disconnect function"), _("A pointer to the instance's disconnect function. " "This is supposed to be immutable."), @@ -183,6 +308,21 @@ static void x2goclient_network_finalize (GObject * const object) { } +/* + * x2goclient_network_parse_sockspec: + * @self: (in) (not optional): an #X2GoClientNetwork. + * @sockspec: (in) (not optional): socket specification as a pointer to a + * #GString. + * + * Takes a socket specification and passes it down to the actual parsing + * function if one has been set. + * + * Returns: (transfer full): a pointer to the parsed result as a + * #GSocketAddress. %NULL on error or if no parsing + * function has been set. + * + * Since: 0.0.5 + */ static GSocketAddress* x2goclient_network_parse_sockspec (X2GoClientNetwork * const self, const GString * const sockspec) { GSocketAddress *ret = NULL; @@ -196,6 +336,25 @@ static GSocketAddress* x2goclient_network_parse_sockspec (X2GoClientNetwork * co return (ret); } +/** + * x2goclient_network_connect: + * @self: (in) (not optional): an #X2GoClientNetwork. + * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not + * interested. + * + * Connects to a remote location. + * + * This function uses the #X2GoClientNetworkClass::connect virtual method to + * actually connect. By default, this virtual method is unset (or rather, set + * to %NULL). Make sure to probably initialize it in your derived class. + * + * This function is idempotent. + * + * Returns: %TRUE if the connection was established successful or it is + * already running, %FALSE on error. + * + * Since: 0.0.5 + */ gboolean x2goclient_network_connect (X2GoClientNetwork * const self, GError ** const gerr) { gboolean ret = FALSE; @@ -217,6 +376,26 @@ gboolean x2goclient_network_connect (X2GoClientNetwork * const self, GError ** c return (ret); } +/** + * x2goclient_network_disconnect: + * @self: (in) (not optional): an #X2GoClientNetwork. + * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not + * interested. + * + * Disconnects from a remote location. + * + * This function uses the #X2GoClientNetworkClass::disconnect virtual method + * to actually disconnect. By default, this virtual method is unset (or + * rather, set to %NULL). Make sure to probably initialize it in your derived + * class. + * + * This function is idempotent. + * + * Returns: %TRUE if the connection was successfully destroyed or there was + * none to begin with, %FALSE on error. + * + * Since: 0.0.5 + */ gboolean x2goclient_network_disconnect (X2GoClientNetwork * const self, GError ** const gerr) { gboolean ret = FALSE; -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 76d299df02afd928235293349c15b4449d352ca2 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Oct 31 02:28:11 2020 +0100 src/x2goclient-network-ssh.c: fix return value for initial failures in x2goclient_network_ssh_parent_connect (). We should return FALSE for failures. --- src/x2goclient-network-ssh.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index e22c027..6af22b1 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -800,7 +800,7 @@ gboolean x2goclient_network_ssh_connect (X2GoClientNetworkSSH * const self, GErr } static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork * const parent, GError ** const gerr) { - gboolean ret = TRUE; + gboolean ret = FALSE; g_return_val_if_fail (X2GOCLIENT_IS_NETWORK_SSH (parent), ret); g_return_val_if_fail (((NULL == gerr) || (NULL == *gerr)), ret); @@ -809,6 +809,12 @@ static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork * const /* Actual implementation here. */ + /* + * We'll hang down through ret to run or skip steps depending on previous + * failures, so make sure it's initialized to no error. + */ + ret = TRUE; + /* "Calculate" socket path. */ gchar *session_path = NULL; g_object_get (G_OBJECT (self), "session-path", &session_path, NULL); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 6c8a91e84f73458c08df9b7989150034fadb78e3 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 06:54:37 2020 +0100 src/x2goclient-network.{c,h}: add basic disconnect support. Mirrors the connect feature. Needs further implementation in more concrete classes. --- src/x2goclient-network.c | 36 ++++++++++++++++++++++++++++++++++++ src/x2goclient-network.h | 2 ++ 2 files changed, 38 insertions(+) diff --git a/src/x2goclient-network.c b/src/x2goclient-network.c index 6ba5b24..d46f28f 100644 --- a/src/x2goclient-network.c +++ b/src/x2goclient-network.c @@ -56,6 +56,7 @@ typedef struct X2GoClientNetworkPrivate_ { gchar *session_path; /* Will eventually be replaced with a session object, probably. */ gboolean connected; gboolean (*connect_func) (X2GoClientNetwork * const self, GError ** const gerr); + gboolean (*disconnect_func) (X2GoClientNetwork * const self, GError ** const gerr); } X2GoClientNetworkPrivate; G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (X2GoClientNetwork, x2goclient_network, G_TYPE_OBJECT); @@ -75,6 +76,7 @@ enum { X2GO_NET_PROP_SESSION_PATH, X2GO_NET_PROP_CONNECTED, X2GO_NET_PROP_CONN_FUNC, + X2GO_NET_PROP_DISCONN_FUNC, X2GO_NET_N_PROPERTIES }; @@ -136,6 +138,11 @@ static void x2goclient_network_class_init (X2GoClientNetworkClass * const klass) "This is supposed to be immutable."), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE); + net_obj_properties[X2GO_NET_PROP_DISCONN_FUNC] = g_param_spec_pointer ("disconnect-function", _("Pointer to this instance's disconnect function"), + _("A pointer to the instance's disconnect function. " + "This is supposed to be immutable."), + G_PARAM_STATIC_STRINGS | G_PARAM_READABLE); + g_object_class_install_properties (object_class, X2GO_NET_N_PROPERTIES, net_obj_properties); } @@ -147,6 +154,7 @@ static void x2goclient_network_init (X2GoClientNetwork * const self) { priv->session_path = NULL; priv->connected = FALSE; priv->connect_func = &x2goclient_network_connect; + priv->disconnect_func = &x2goclient_network_disconnect; } static void x2goclient_network_dispose (GObject * const object) { @@ -169,6 +177,7 @@ static void x2goclient_network_finalize (GObject * const object) { priv->session_path = NULL; priv->connect_func = NULL; + priv->disconnect_func = NULL; (G_OBJECT_CLASS (x2goclient_network_parent_class))->finalize (object); } @@ -208,6 +217,27 @@ gboolean x2goclient_network_connect (X2GoClientNetwork * const self, GError ** c return (ret); } +gboolean x2goclient_network_disconnect (X2GoClientNetwork * const self, GError ** const gerr) { + gboolean ret = FALSE; + + X2GoClientNetworkClass *class = X2GOCLIENT_NETWORK_GET_CLASS (self); + X2GoClientNetworkPrivate *priv = x2goclient_network_get_instance_private (self); + + g_return_val_if_fail (X2GOCLIENT_IS_NETWORK (self), ret); + g_return_val_if_fail (((NULL == gerr) || (NULL == *gerr)), ret); + g_return_val_if_fail (class->disconnect, ret); + + ret = (!(priv->connected)); + + if (!(ret)) { + ret = class->disconnect (self, gerr); + + priv->connected = (!(ret)); + } + + return (ret); +} + static void x2goclient_network_set_property (GObject * const object, guint prop_id, const GValue * const value, GParamSpec * const param_spec) { X2GoClientNetwork *self = X2GOCLIENT_NETWORK (object); X2GoClientNetworkPrivate *priv = x2goclient_network_get_instance_private (self); @@ -239,6 +269,9 @@ static void x2goclient_network_set_property (GObject * const object, guint prop_ case (X2GO_NET_PROP_CONN_FUNC): priv->connect_func = g_value_get_pointer (value); break; + case (X2GO_NET_PROP_DISCONN_FUNC): + priv->disconnect_func = g_value_get_pointer (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, param_spec); break; @@ -268,6 +301,9 @@ static void x2goclient_network_get_property (GObject * const object, const guint case (X2GO_NET_PROP_CONN_FUNC): g_value_set_pointer (value, priv->connect_func); break; + case (X2GO_NET_PROP_DISCONN_FUNC): + g_value_set_pointer (value, priv->disconnect_func); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, param_spec); break; diff --git a/src/x2goclient-network.h b/src/x2goclient-network.h index cf96c35..54cd44d 100644 --- a/src/x2goclient-network.h +++ b/src/x2goclient-network.h @@ -56,6 +56,7 @@ struct _X2GoClientNetworkClass { GObjectClass parent_class; gboolean (*connect) (X2GoClientNetwork * const self, GError ** const gerr); + gboolean (*disconnect) (X2GoClientNetwork * const self, GError ** const gerr); /*< private >*/ GSocketAddress* (*parse_sockspec) (X2GoClientNetwork * const self, const GString * const sockspec); @@ -65,6 +66,7 @@ struct _X2GoClientNetworkClass { }; gboolean x2goclient_network_connect (X2GoClientNetwork * const self, GError ** const gerr); +gboolean x2goclient_network_disconnect (X2GoClientNetwork * const self, GError ** const gerr); G_END_DECLS -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit b36136ddd5d702e602417b461aa8d9cde6453b30 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Oct 31 01:25:27 2020 +0100 src/x2goclient-openssh-version.c: clarify "weird casting" comment a bit. --- src/x2goclient-openssh-version.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/x2goclient-openssh-version.c b/src/x2goclient-openssh-version.c index 3911989..79eb318 100644 --- a/src/x2goclient-openssh-version.c +++ b/src/x2goclient-openssh-version.c @@ -492,9 +492,11 @@ X2GoClientOpenSSHVersion* x2goclient_openssh_version_fetch_openssh_version (GErr * The reason is quite simple: we *know* that the called * function WILL NOT modify the input string, not even call * free () on it, if we explicitly disable that feature via - * its boolean parameter. We could make the input string - * parameter const instead, but this would require a cast when - * calling g_free (), which seems to be frowned upon. Thus, + * its boolean parameter. We could make + * x2goclient_setbrk_dup's input string parameter const + * instead, but this would require a cast when calling + * g_free () (i.e., if freeing data was requested via the + * boolean parameter), which seems to be frowned upon. Thus, * we'll keep it taking a non-const pointer for the time being * and cast data passed to it if necessary. * -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 4477232a05841f048a3d7cbfd5e6e577ecefbf16 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Oct 31 03:42:12 2020 +0100 src/test/sshtest.c: split up connection testing and create connect-connect-disconnect-connect cycle. --- src/test/sshtest.c | 70 ++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 55 insertions(+), 15 deletions(-) diff --git a/src/test/sshtest.c b/src/test/sshtest.c index 200ebc9..710b6a1 100644 --- a/src/test/sshtest.c +++ b/src/test/sshtest.c @@ -220,15 +220,17 @@ static _Bool test_x2goclient_network_ssh_connect_after_connect (X2GoClientNetwor return (ret); } -static _Bool test_x2goclient_network_ssh_connect (X2GoClientNetworkSSH *net_ssh) { - _Bool ret = TRUE; +static _Bool test_x2goclient_network_ssh_connect (X2GoClientNetworkSSH *net_ssh, gboolean * const conn_ret) { + _Bool ret = (!(!(conn_ret))); - /* Actually connect. */ - g_printf ("Trying to connect...\n"); - gboolean conn_ret = x2goclient_network_ssh_connect (net_ssh, NULL); - g_printf ("Connection status: %s.\n", x2goclient_bool_to_str (conn_ret)); + if (ret) { + /* Actually connect. */ + g_printf ("Trying to connect...\n"); + (*conn_ret) = x2goclient_network_ssh_connect (net_ssh, NULL); + g_printf ("Connection status: %s.\n", x2goclient_bool_to_str (*conn_ret)); + } - ret &= conn_ret; + ret &= (*conn_ret); if (ret) { /* Check connection status getter sync. */ @@ -236,15 +238,29 @@ static _Bool test_x2goclient_network_ssh_connect (X2GoClientNetworkSSH *net_ssh) g_object_get (G_OBJECT (net_ssh), "connected", &conn_ret_new, NULL); g_printf ("Current connection status (via getter): %s\n", x2goclient_bool_to_str (conn_ret_new)); - ret &= (conn_ret == conn_ret_new); + ret &= ((*conn_ret) == conn_ret_new); } - /* - * Cannot move this to test_x2goclient_network_ssh because we need conn_ret. - * Bummer, but likely not too bad. - */ + return (ret); +} + +static _Bool test_x2goclient_network_ssh_disconnect (X2GoClientNetworkSSH *net_ssh) { + _Bool ret = TRUE; + + /* Actually disconnect. */ + g_printf ("Trying to disconnect...\n"); + gboolean disconn_ret = x2goclient_network_ssh_disconnect (net_ssh, NULL); + g_printf ("Disconnection status: %s.\n", x2goclient_bool_to_str (disconn_ret)); + + ret &= disconn_ret; + if (ret) { - ret &= test_x2goclient_network_ssh_connect_after_connect (net_ssh, conn_ret); + /* Check connection status getter sync. */ + gboolean conn_ret_new = FALSE; + g_object_get (G_OBJECT (net_ssh), "connected", &conn_ret_new, NULL); + g_printf ("Current connection status (via getter): %s\n", x2goclient_bool_to_str (conn_ret_new)); + + ret &= (disconn_ret == (!(conn_ret_new))); } return (ret); @@ -276,13 +292,37 @@ static _Bool test_x2goclient_network_ssh (const GString * const ssh_uri) { ret &= test_x2goclient_network_ssh_set_conn_ret (net_ssh); } + /* We'll use that for the connect-after-connect test. */ + gboolean conn_ret = FALSE; + if (ret) { - ret &= test_x2goclient_network_ssh_connect (net_ssh); + ret &= test_x2goclient_network_ssh_connect (net_ssh, &conn_ret); + } + + if (ret) { + ret &= test_x2goclient_network_ssh_connect_after_connect (net_ssh, conn_ret); + } + + if (ret) { + /* Let ssh connection live for a few seconds, give or take. */ + sleep (15); + } + + if (ret) { + ret &= test_x2goclient_network_ssh_disconnect (net_ssh); + } + + if (ret) { + /* + * Connect again, checking whether a connect-disconnect-connect cycle works + * correctly. + */ + ret &= test_x2goclient_network_ssh_connect (net_ssh, &conn_ret); } if (ret) { /* Let ssh connection live for a few seconds, give or take. */ - sleep (30); + sleep (15); } g_clear_object (&net_ssh); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit ca7901552ac78b8243cb20ac014c925141f3a3f6 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 05:16:36 2020 +0100 src/x2goclient-utils.{c,h}: add new function x2goclient_bool_to_str (). Does pretty much what is written on the box. --- src/x2goclient-utils.c | 18 ++++++++++++++++++ src/x2goclient-utils.h | 1 + 2 files changed, 19 insertions(+) diff --git a/src/x2goclient-utils.c b/src/x2goclient-utils.c index 6ef4c1e..456dc41 100644 --- a/src/x2goclient-utils.c +++ b/src/x2goclient-utils.c @@ -229,3 +229,21 @@ gchar* x2goclient_strbrk_dup (gchar * restrict * const haystack, const char need return (ret); } + +/** + * x2goclient_bool_to_str: + * @in: (in): input boolean + * + * Takes a boolean and converts it to a (static) string. + * + * Returns: (transfer none): the converted value as a string + */ +gchar* x2goclient_bool_to_str (const gboolean in) { + gchar *ret = "false"; + + if (in) { + ret = "true"; + } + + return (ret); +} diff --git a/src/x2goclient-utils.h b/src/x2goclient-utils.h index a626cbf..6ea340b 100644 --- a/src/x2goclient-utils.h +++ b/src/x2goclient-utils.h @@ -53,6 +53,7 @@ void x2goclient_clear_strings (gpointer const data); long long x2goclient_str_to_int (const gchar * const restrict str, const _Bool min, const long long limit_min, const _Bool max, const long long limit_max, const gchar ** const restrict end, _Bool * const restrict conv_err, _Bool * const restrict min_err, _Bool * const restrict max_err); gchar* x2goclient_strbrk_dup (gchar * restrict * const haystack, const char needle, const _Bool free_orig, gsize * const new_size); +gchar* x2goclient_bool_to_str (const gboolean in); G_END_DECLS -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 624f6baf3d520afa345047bdd08db00c7700a8eb Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 06:29:41 2020 +0100 src/test/sshtest.c: rework completely, split into a lot of smaller subfunctions, handle errors more correctly, fix running the full suite of tests even if no location was specified. --- src/test/sshtest.c | 287 +++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 243 insertions(+), 44 deletions(-) diff --git a/src/test/sshtest.c b/src/test/sshtest.c index 1a3294f..200ebc9 100644 --- a/src/test/sshtest.c +++ b/src/test/sshtest.c @@ -26,6 +26,7 @@ #include <stdlib.h> #include <locale.h> #include <unistd.h> +#include <stdbool.h> #include <libintl.h> @@ -43,77 +44,243 @@ #define _(String) gettext (String) -int main (const int argc, const char * const * const argv) { - int ret = EXIT_FAILURE; - - setlocale (LC_MESSAGES, ""); - bindtextdomain (PACKAGE, LOCALEDIR); - textdomain (PACKAGE); +static _Bool test_x2goclient_network_ssh_properties_session_path (X2GoClientNetworkSSH *net_ssh) { + _Bool ret = TRUE; - g_printf (_("SSH testing utility for %s version %s\n\n"), _(PACKAGE_NAME), _(PACKAGE_VERSION)); + gchar *session_path = NULL; + g_object_get (G_OBJECT (net_ssh), "session-path", &session_path, NULL); - GString *ssh_uri = NULL; - if (argc != 2) { - g_fprintf (stderr, _("Error. Program needs exactly one argument: an SSH location specifier.\n")); + g_printf ("session-path: "); + if (session_path) { + g_printf ("%s", session_path); } else { - ssh_uri = g_string_new (argv[1]); + g_printf ("not available"); + + ret = FALSE; } + g_printf ("\n"); - X2GoClientNetworkSSH *net_ssh = x2goclient_network_ssh_new (NULL); - gchar *session_path = NULL; - g_object_get (G_OBJECT (net_ssh), "session-path", &session_path, NULL); - g_printf ("session-path: %s\n", session_path); g_free (session_path); session_path = NULL; + + return (ret); +} + +static _Bool test_x2goclient_network_ssh_properties_socket (const GString * const ssh_uri, X2GoClientNetworkSSH *net_ssh) { + _Bool ret = TRUE; + + /* + * Set socket specification. + * + * This can't return any error status per se, but if the parsing fails, the + * corresponding read-only socket property will be invalid. + */ g_object_set (G_OBJECT (net_ssh), "socket-spec", ssh_uri, NULL); + GSocketAddress *sock_addr = NULL; g_object_get (G_OBJECT (net_ssh), "socket", &sock_addr, NULL); + g_printf ("sock_addr: %p\n", sock_addr); + + ret = (!(!(sock_addr))); + g_clear_object (&sock_addr); - /* - * Provoke error. - * - * This should not work/change the initial state. - */ - g_object_set (G_OBJECT (net_ssh), "session-path", "/i/don't/exist", NULL); - g_object_get (G_OBJECT (net_ssh), "session-path", &session_path, NULL); - g_printf ("new session-path: %s\n", session_path); - g_free (session_path); - session_path = NULL; + return (ret); +} + +static _Bool test_x2goclient_network_ssh_properties_session_path_reset (X2GoClientNetworkSSH *net_ssh) { + _Bool ret = TRUE; + + g_printf ("Testing session path reset (supposed to fail) ...\n"); + + gchar *session_path_orig = NULL; + g_object_get (G_OBJECT (net_ssh), "session-path", &session_path_orig, NULL); + + g_printf ("original session-path: "); + if (session_path_orig) { + g_printf ("%s", session_path_orig); + } + else { + g_printf ("not available"); + } + g_printf ("\n"); + + ret &= (!(!(session_path_orig))); + + if (ret) { + /* + * Provoke error. + * + * This should not work/change the initial state. + */ + g_object_set (G_OBJECT (net_ssh), "session-path", "/i/don't/exist", NULL); + + gchar *session_path_new = NULL; + g_object_get (G_OBJECT (net_ssh), "session-path", &session_path_new, NULL); + + g_printf ("new session-path: "); + if (session_path_new) { + g_printf ("%s", session_path_new); + } + else { + g_printf ("not available"); + } + g_printf ("\n"); + + ret &= (!(strcmp (session_path_orig, session_path_new))); + + if (!(ret)) { + g_printf ("Session paths don't match.\n"); + } + + g_free (session_path_orig); + g_free (session_path_new); + session_path_orig = session_path_new = NULL; + } + + return (ret); +} + +static _Bool test_x2goclient_network_ssh_properties (const GString * const ssh_uri, X2GoClientNetworkSSH *net_ssh) { + _Bool ret = TRUE; + + ret &= test_x2goclient_network_ssh_properties_session_path (net_ssh); + + /* Check for valid ssh location. */ + ret &= (!(!(ssh_uri))); + + if (!(ret)) { + g_printf ("SSH location invalid.\n"); + } + + if (ret) { + ret &= test_x2goclient_network_ssh_properties_socket (ssh_uri, net_ssh); + } + + if (ret) { + ret &= test_x2goclient_network_ssh_properties_session_path_reset (net_ssh); + } + + return (ret); +} + +static _Bool test_x2goclient_network_ssh_get_conn_ret (X2GoClientNetworkSSH *net_ssh) { + _Bool ret = TRUE; - /* - * Check connection status fetching and setting. - * - * The latter should fail. - */ g_printf ("Trying to get connection status...\n"); gboolean conn_ret = TRUE; g_object_get (G_OBJECT (net_ssh), "connected", &conn_ret, NULL); - g_printf ("Current connection status: %d\n", (int) (conn_ret)); + g_printf ("Current connection status: %s\n", x2goclient_bool_to_str (conn_ret)); + + ret = (!(conn_ret)); + + return (ret); +} + +static _Bool test_x2goclient_network_ssh_set_conn_ret (X2GoClientNetworkSSH *net_ssh) { + _Bool ret = TRUE; + + gboolean conn_ret_orig = TRUE; + g_object_get (G_OBJECT (net_ssh), "connected", &conn_ret_orig, NULL); g_printf ("Trying to set connection status (should fail)...\n"); - conn_ret = TRUE; - g_object_set (G_OBJECT (net_ssh), "connected", &conn_ret, NULL); + gboolean conn_ret_new = TRUE; + g_object_set (G_OBJECT (net_ssh), "connected", &conn_ret_new, NULL); g_printf ("Trying to get connection status again...\n"); - g_object_get (G_OBJECT (net_ssh), "connected", &conn_ret, NULL); - g_printf ("Current connection status (again): %d\n", (int) (conn_ret)); + g_object_get (G_OBJECT (net_ssh), "connected", &conn_ret_new, NULL); + g_printf ("Current connection status (again): %s\n", x2goclient_bool_to_str (conn_ret_new)); + + ret = (conn_ret_orig == conn_ret_new); + + if (!(ret)) { + g_printf ("Connection statuses don't match.\n"); + } + + return (ret); +} + +static _Bool test_x2goclient_network_ssh_connect_after_connect (X2GoClientNetworkSSH *net_ssh, const gboolean conn_ret) { + _Bool ret = TRUE; + + /* Connect again, shouldn't cause anything to change. */ + gboolean conn_ret_new = FALSE; + g_printf ("Trying to connect again...\n"); + conn_ret_new = x2goclient_network_ssh_connect (net_ssh, NULL); + g_printf ("Connection status: %s.\n", x2goclient_bool_to_str (conn_ret_new)); + + ret &= (conn_ret == conn_ret_new); + + if (!(ret)) { + g_printf ("Connection statuses don't match.\n"); + } + + return (ret); +} + +static _Bool test_x2goclient_network_ssh_connect (X2GoClientNetworkSSH *net_ssh) { + _Bool ret = TRUE; /* Actually connect. */ g_printf ("Trying to connect...\n"); - conn_ret = x2goclient_network_ssh_connect (net_ssh, NULL); - g_printf ("Connection status: %s.\n", (conn_ret) ? "true" : "false"); - g_object_get (G_OBJECT (net_ssh), "connected", &conn_ret, NULL); - g_printf ("Current connection status (via getter): %d\n", (int) (conn_ret)); + gboolean conn_ret = x2goclient_network_ssh_connect (net_ssh, NULL); + g_printf ("Connection status: %s.\n", x2goclient_bool_to_str (conn_ret)); + + ret &= conn_ret; + + if (ret) { + /* Check connection status getter sync. */ + gboolean conn_ret_new = FALSE; + g_object_get (G_OBJECT (net_ssh), "connected", &conn_ret_new, NULL); + g_printf ("Current connection status (via getter): %s\n", x2goclient_bool_to_str (conn_ret_new)); + + ret &= (conn_ret == conn_ret_new); + } + + /* + * Cannot move this to test_x2goclient_network_ssh because we need conn_ret. + * Bummer, but likely not too bad. + */ + if (ret) { + ret &= test_x2goclient_network_ssh_connect_after_connect (net_ssh, conn_ret); + } + + return (ret); +} - if (conn_ret) { - /* Connect again, shouldn't cause anything to change. */ - g_printf ("Trying to connect again...\n"); - conn_ret = x2goclient_network_ssh_connect (net_ssh, NULL); - g_printf ("Connection status: %s.\n", (conn_ret) ? "true" : "false"); +static _Bool test_x2goclient_network_ssh (const GString * const ssh_uri) { + _Bool ret = TRUE; + /* Create object. */ + X2GoClientNetworkSSH *net_ssh = x2goclient_network_ssh_new (NULL); + + ret = (!(!(net_ssh))); + + if (ret) { + ret &= test_x2goclient_network_ssh_properties (ssh_uri, net_ssh); + } + + if (ret) { + /* Check connection status fetching. */ + ret &= test_x2goclient_network_ssh_get_conn_ret (net_ssh); + } + + if (ret) { + /* + * Check connection status setting. + * + * This should fail. + */ + ret &= test_x2goclient_network_ssh_set_conn_ret (net_ssh); + } + + if (ret) { + ret &= test_x2goclient_network_ssh_connect (net_ssh); + } + + if (ret) { /* Let ssh connection live for a few seconds, give or take. */ sleep (30); } @@ -122,3 +289,35 @@ int main (const int argc, const char * const * const argv) { return (ret); } + +int main (const int argc, const char * const * const argv) { + int ret = EXIT_SUCCESS; + + setlocale (LC_MESSAGES, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + g_printf (_("SSH testing utility for %s version %s\n\n"), _(PACKAGE_NAME), _(PACKAGE_VERSION)); + + GString *ssh_uri = NULL; + if (argc != 2) { + g_fprintf (stderr, _("Error. Program needs exactly one argument: an SSH location specifier.\n")); + + ret = EXIT_FAILURE; + } + else { + ssh_uri = g_string_new (argv[1]); + } + + if (EXIT_SUCCESS == ret) { + /* Initialize ret to failure. */ + ret = EXIT_FAILURE; + + if (test_x2goclient_network_ssh (ssh_uri)) { + /* We'll only not fail if all tests succeded. */ + ret = EXIT_SUCCESS; + } + } + + return (ret); +} -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit ecd13118cd23b05285950fc208d17c298fab9dfe Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 15 23:20:21 2021 +0100 src/x2goclient-openssh-bugs.c: document full class. --- src/x2goclient-openssh-bugs.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/x2goclient-openssh-bugs.c b/src/x2goclient-openssh-bugs.c index 9328f0e..73b289f 100644 --- a/src/x2goclient-openssh-bugs.c +++ b/src/x2goclient-openssh-bugs.c @@ -31,6 +31,22 @@ #include "x2goclient-openssh-bugs.h" #include "x2goclient-openssh-version.h" +/** + * SECTION:X2GoClientOpenSSHBugs + * @short_description: Class encapsulating OpenSSH client bug definitions + * @stability: Unstable + * @include: libx2goclient/x2goclient-openssh-bugs.h + * + * #X2GoClientOpenSSHBugs is a class used to handle OpenSSH client bug + * definitions. + * + * It provides a general structure for known OpenSSH client bugs that might + * influence the behavior of this library (and, if needed, can also be + * extended to other known bugs influencing applications using this library). + * + * Since: 0.0.5 + */ + X2GoClientOpenSSHBugs* x2goclient_openssh_bugs_new (void) { return (g_slice_new0 (X2GoClientOpenSSHBugs)); } @@ -53,6 +69,22 @@ static X2GoClientOpenSSHBugs* x2goclient_openssh_bugs_copy (const X2GoClientOpen G_DEFINE_BOXED_TYPE (X2GoClientOpenSSHBugs, x2goclient_openssh_bugs, &x2goclient_openssh_bugs_copy, &x2goclient_openssh_bugs_free) +/** + * x2goclient_openssh_bugs_update: + * @self: (in) (not optional): pointer to the #X2GoClientOpenSSHBugs instance. + * @version: (in) (not optional): pointer to an #X2GoClientOpenSSHVersion + * structure acting as the base to extract bug + * information from. + * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not + * interested. + * + * Updates the bugs structure passed as @self according to the OpenSSH client + * version passed as @version. + * + * Returns: a #gboolean value indicating success (%TRUE) or failure (%FALSE). + * + * Since: 0.0.5 + */ gboolean x2goclient_openssh_bugs_update (X2GoClientOpenSSHBugs * const self, const X2GoClientOpenSSHVersion * const version, GError ** const gerr) { gboolean ret = FALSE; -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 32ea7c468a977a1e49ab1c63ba0638b93218298e Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 15 20:33:51 2021 +0100 src/x2goclient-network-ssh.h: rename anonymous error struct to X2GoClientNetworkSSHErrors. --- src/x2goclient-network-ssh.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x2goclient-network-ssh.h b/src/x2goclient-network-ssh.h index fc1f7db..7100883 100644 --- a/src/x2goclient-network-ssh.h +++ b/src/x2goclient-network-ssh.h @@ -116,7 +116,7 @@ X2GoClientNetworkSSH* x2goclient_network_ssh_new (const gchar * const session_pa * * Since: 0.0.5 */ -enum { +enum X2GoClientNetworkSSHErrors { X2GOCLIENT_NETWORK_SSH_ERROR_PORT_CONV_NOT_NUMERIC = 0, X2GOCLIENT_NETWORK_SSH_ERROR_PORT_CONV_UNDERFLOW, X2GOCLIENT_NETWORK_SSH_ERROR_PORT_CONV_OVERFLOW, -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit af1df601d1abd1ae1bb4f3123f395ee47ff35cde Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Feb 25 07:21:16 2021 +0100 src/x2goclient-network-ssh.c: set AF_HOST to a high, randomly-determined value. That should leave enough space to make it unique (for now). --- src/x2goclient-network-ssh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 7781550..3a7d372 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -104,7 +104,7 @@ typedef struct sockaddr_ho_ { char sho_addr[256]; } sockaddr_ho; -#define AF_HOST 33 +#define AF_HOST 10417 struct _X2GoClientNetworkSSH { -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 7aa6880922bfb125436cad35ea9bbbdd933d9173 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 15 20:39:39 2021 +0100 src/x2goclient-openssh-bugs.h: rename errors enum, like in previous commit. --- src/x2goclient-openssh-bugs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x2goclient-openssh-bugs.h b/src/x2goclient-openssh-bugs.h index 440d5f6..c0931cb 100644 --- a/src/x2goclient-openssh-bugs.h +++ b/src/x2goclient-openssh-bugs.h @@ -70,7 +70,7 @@ gboolean x2goclient_openssh_bugs_update (X2GoClientOpenSSHBugs * const self, con */ #define X2GOCLIENT_OPENSSH_BUGS_ERROR g_quark_from_static_string ("x2goclient-openssh-bugs") -enum { +enum X2GoClientOpenSSHBugsErrors { X2GOCLIENT_OPENSSH_BUGS_ERROR_INVALID_STRUCT = 0, X2GOCLIENT_OPENSSH_BUGS_ERROR_INVALID_VERSION_STRUCT, }; -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 91978d91b9da0f79882f9c54adb049fc262ed3a7 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 15 23:17:30 2021 +0100 src/x2goclient-openssh-bugs.h: document error enum. --- src/x2goclient-openssh-bugs.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/x2goclient-openssh-bugs.h b/src/x2goclient-openssh-bugs.h index c0931cb..c777994 100644 --- a/src/x2goclient-openssh-bugs.h +++ b/src/x2goclient-openssh-bugs.h @@ -70,6 +70,19 @@ gboolean x2goclient_openssh_bugs_update (X2GoClientOpenSSHBugs * const self, con */ #define X2GOCLIENT_OPENSSH_BUGS_ERROR g_quark_from_static_string ("x2goclient-openssh-bugs") +/** + * X2GoClientOpenSSHBugsErrors: + * @X2GOCLIENT_OPENSSH_BUGS_ERROR_INVALID_STRUCT: no X2GoClientOpenSSHBugs + * structure passed. + * @X2GOCLIENT_OPENSSH_BUGS_ERROR_INVALID_VERSION_STRUCT: + * no X2GoClientOpenSSHVersion + * structure passed. + * + * Error message types as used within X2GoClientOpenSSHBugs. May be passed out + * via #GError instances. + * + * Since: 0.0.5 + */ enum X2GoClientOpenSSHBugsErrors { X2GOCLIENT_OPENSSH_BUGS_ERROR_INVALID_STRUCT = 0, X2GOCLIENT_OPENSSH_BUGS_ERROR_INVALID_VERSION_STRUCT, -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit e2699cfd0f0f387d57f3f4c29928f25f8710efc4 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Feb 19 07:04:35 2021 +0100 src/x2goclient-network-ssh.c: remove useless else block in x2goclient_network_ssh_parse_sockspec_ip (). --- src/x2goclient-network-ssh.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index b28dd9d..c16cf26 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -575,9 +575,6 @@ static GSocketAddress* x2goclient_network_ssh_parse_sockspec_ip (const GString * } } } - else { - int_err = TRUE; - } if (!(int_err)) { /* -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit bfa2b8a183ff86a2e3ff9515971d15c471fc670f Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Feb 19 07:01:15 2021 +0100 src/x2goclient-network-ssh.c: check parameter for validity and optimize code in x2goclient_network_ssh_sanitize_sockspec (). --- src/x2goclient-network-ssh.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index c74dbb1..31cfa5c 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -410,11 +410,21 @@ static guint16 x2goclient_network_ssh_parse_sockspec_port (const GString * const static GString* x2goclient_network_ssh_sanitize_sockspec (const GString * const sockspec) { GString *ret = NULL; - gchar *sanitize_sockspec = g_strdup (sockspec->str); - g_strstrip (sanitize_sockspec); - ret = g_string_new (g_strstrip (sanitize_sockspec)); - g_free (sanitize_sockspec); - sanitize_sockspec = NULL; + if ((sockspec) && (sockspec->str)) { + /* + * We can't really optimize this. g_strstrip () works in-place, so we'll + * have to create a copy of the original data anyway. + * + * It would be nice to avoid the third iteration updating the size, but + * that doesn't seem to be feasible without writing our private + * g_strstrip () implementation. + * + * Just don't over-optimize. + */ + ret = g_string_new (sockspec->str); + (void) g_strstrip (ret->str); + (void) g_string_set_size (ret, strlen (ret->str)); + } return (ret); } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 4f4931e256c4f8e9e7b71e906667cbb545675925 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Feb 25 10:03:56 2021 +0100 src/x2goclient-network-ssh.c: add array validity check to x2goclient_network_ssh_gptrarray_print_debug (). Though redundant, because a later function will check for its validity again, we can still break out early and reduce the needed work. --- src/x2goclient-network-ssh.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 6b2044e..348f712 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -1268,11 +1268,31 @@ static gboolean x2goclient_network_ssh_gptrarray_to_string (GPtrArray * const ar #undef SIZE_LOW_WRAP } +/* + * x2goclient_network_ssh_gptrarray_print_debug: + * @arr: (in) (not optional) (array) + * (element-type (type utf8)): pointer to the #GPtrArray to print. + * @prelude: (in) (nullable): initial string to prepend to the resulting + * output. + * @desc: (in) (nullable): description of the array to be printed, used in + * case of errors. + * + * Prints a #GPtrArray passed as @arr to the debug log level, optionally + * prefixing it with @prelude. + * + * This function internally calls + * x2goclient_network_ssh_gptrarray_to_string(), refer to that function to + * determine acceptable parameters for @arr. + * + * Since: 0.0.5 + */ static void x2goclient_network_ssh_gptrarray_print_debug (GPtrArray * const arr, const gchar * const prelude, const gchar * const desc) { gchar *arr_str = NULL; const gchar *def_desc = "unspecified pointer array"; const gchar *real_desc = def_desc; + g_return_if_fail (arr); + if (desc) { real_desc = desc; } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 93e7aa1ca714987fd8fcaac7d2372b396bbd85b6 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Feb 25 10:02:20 2021 +0100 src/x2goclient-network-ssh.c: fix comment style. --- src/x2goclient-network-ssh.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 3a7d372..6b2044e 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -1468,7 +1468,8 @@ static gboolean x2goclient_network_ssh_start_sshcmd (X2GoClientNetworkSSH * cons g_bytes_unref (proc_stdout); g_bytes_unref (proc_stderr); - /* This should be true, but I guess it doesn't hurt to check. + /* + * This should be true, but I guess it doesn't hurt to check. * * Also, this should really be something like gassert (), but that * doesn't exist and the existing warning and assertion -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 8d3db176212228bafed3c01cfde614a94b9ae219 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 15 20:39:55 2021 +0100 src/x2goclient-openssh-version.h: rename errors enum, like in previous commits. --- src/x2goclient-openssh-version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x2goclient-openssh-version.h b/src/x2goclient-openssh-version.h index a22309d..21b23ee 100644 --- a/src/x2goclient-openssh-version.h +++ b/src/x2goclient-openssh-version.h @@ -52,7 +52,7 @@ void x2goclient_openssh_version_free (X2GoClientOpenSSHVersion * const openssh_v */ #define X2GOCLIENT_OPENSSH_VERSION_ERROR g_quark_from_static_string ("x2goclient-openssh-version") -enum { +enum X2GoClientOpenSSHVersionErrors { X2GOCLIENT_OPENSSH_VERSION_ERROR_INVALID_STRUCT = 0, X2GOCLIENT_OPENSSH_VERSION_ERROR_INVALID_VERSION_STRING, X2GOCLIENT_OPENSSH_VERSION_ERROR_INVALID_PREAMBLE, -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit a08cf9b9cfb8f1ed1251b4a6f14c7fa05c2ed967 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Feb 20 22:46:38 2021 +0100 src/x2goclient-network-ssh.c: fix typo in error message. --- src/x2goclient-network-ssh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index c16cf26..7781550 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -892,7 +892,7 @@ static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork * const GPtrArray *options_arr = x2goclient_network_options_ssh_to_array (options); if (!(options_arr)) { - g_set_error_literal (gerr, X2GOCLIENT_NETWORK_SSH_ERROR, X2GOCLIENT_NETWORK_SSH_ERROR_CONNECT_OPTIONS_INVALID, "Unable to convert options stucture to an array, can't connect."); + g_set_error_literal (gerr, X2GOCLIENT_NETWORK_SSH_ERROR, X2GOCLIENT_NETWORK_SSH_ERROR_CONNECT_OPTIONS_INVALID, "Unable to convert options structure to an array, can't connect."); ret = FALSE; } else { -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit b4802ef423b0f5f5a231bc5a47eaca2aa68a47c6 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Mar 17 21:30:44 2021 +0100 src/x2goclient-openssh-version.c: fix negative version number error message. --- src/x2goclient-openssh-version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x2goclient-openssh-version.c b/src/x2goclient-openssh-version.c index 79eb318..e383e48 100644 --- a/src/x2goclient-openssh-version.c +++ b/src/x2goclient-openssh-version.c @@ -295,7 +295,7 @@ _Bool x2goclient_openssh_version_parse (X2GoClientOpenSSHVersion * const openssh else { if (min_err) { GENERATE_ERROR_CODE (err_code, num_i, NEGATIVE); - GENERATE_ERROR_MSG (err_msg, num_i, "version number is not numeric."); + GENERATE_ERROR_MSG (err_msg, num_i, "version number is negative."); g_set_error_literal (gerr, ERROR_QUARK, err_code, err_msg); } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit b3fa7908b5331e00ef0453f8248fcb121b683b82 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Feb 27 11:21:39 2021 +0100 src/x2goclient-network-ssh.c: document full class. --- src/x2goclient-network-ssh.c | 711 +++++++++++++++++++++++++++++++++++++++++++ src/x2goclient-network.c | 6 + 2 files changed, 717 insertions(+) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 024e728..b057124 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -52,6 +52,22 @@ #include "x2goclient-openssh-bugs.h" +/** + * SECTION:X2GoClientNetworkOptionsSSH + * @short_description: Class encapsulating OpenSSH options + * @see_also: #X2GoClientNetworkOptions + * @stability: Unstable + * @include: libx2goclient/x2goclient-network-ssh.h + * + * #X2GoClientNetworkOptions is a class used to encapsulate OpenSSH options. + * + * Currently, there are no common options that could be used generically for + * all dependent classes, so it's essentially fully empty (yet providing the + * general skeleton). + * + * An example of a more abstract implementation is + * #X2GoClientNetworkSSHOptions. + */ struct _X2GoClientNetworkOptionsSSH { X2GoClientNetworkOptions parent_instance; @@ -81,6 +97,19 @@ static void x2goclient_network_options_ssh_class_init (X2GoClientNetworkOptionsS static void x2goclient_network_options_ssh_init (X2GoClientNetworkOptionsSSH * const self) { } +/** + * x2goclient_network_options_ssh_to_array: + * @self: (not optional): an #X2GoClientNetworkOptionsSSH. + * + * Converts the internal state to an #GPtrArray of SSH client options that can + * be passed by prefixing "-o" to each entry when calling the SSH client. + * + * Returns: (transfer full) (element-type utf8): a pointer to the converted + * result as a #GPtrArray. %NULL + * on error. + * + * Since: 0.0.5 + */ GPtrArray* x2goclient_network_options_ssh_to_array (X2GoClientNetworkOptionsSSH * const self) { GPtrArray *ret = NULL; @@ -95,8 +124,24 @@ GPtrArray* x2goclient_network_options_ssh_to_array (X2GoClientNetworkOptionsSSH /* + * sockaddr_ho: + * @sho_family: address family entry, typed #sa_family_t. Should always be set + * to #AF_HOST for objects of this type. + * @sho_port: higher level port the socket is supposed to be bound to, typed + * #in_port_t. + * @sho_addr: fixed-size address buffer as a C-style, null-terminated string. + * * Custom sockaddr structure used to represent socket endpoints based on a FQDN * or ssh_config-specific host alias. + * + * Unlike other implementations, we explicitly require @sho_addr to be null- + * byte terminated. That also means that the total length is one character + * less than defined here. + * + * This type should be private to our implementation and not be used in outer + * code. + * + * Since: 0.0.5 */ typedef struct sockaddr_ho_ { sa_family_t sho_family; @@ -104,9 +149,53 @@ typedef struct sockaddr_ho_ { char sho_addr[256]; } sockaddr_ho; +/* + * AF_HOST: + * + * Address family identifier for our custom FQDN/ssh_config-specific host + * alias sockaddr type. + * + * Determined by fair dice roll. Should be high enough above any other defined + * system value. + * + * Setting this correctly is pretty important so that the address family is + * not inadvertently misinterpreted as a different, defined address family. We + * could use something like (AF_MAX + 1) here, but that would assume that + * AF_MAX does not reach UINT16_MAX (beware of wraps) and that the library is + * rebuilt after each network API update (on Linux systems, that mostly means + * kernel updates, but on other operating systems, other components might + * influence this.) + * + * Since: 0.0.5 + */ #define AF_HOST 10417 +/** + * SECTION:X2GoClientNetworkSSH + * @short_description: Class encapsulating an OpenSSH (client) network + * connection + * @see_also: #X2GoClientNetwork + * @stability: Unstable + * @include: libx2goclient/x2goclient-network.h + * + * #X2GoClientNetwork is a class implementing network connections via the + * OpenSSH client. + * + * In addition to the base functions defined in #X2GoClientNetwork, it opens + * up a master connection, from which additional data connections can be + * spawned. The master connection is constantly monitored and, in case of + * disconnects or errors, all dependent connections cleaned up. + * + * An example of a more abstract implementation is #X2GoClientNetwork. +*/ + +/** + * X2GoClientNetworkSSH: + * + * #X2GoClientNetworkSSH is an opaque data structure and can only be accessed + * using the following functions. + */ struct _X2GoClientNetworkSSH { X2GoClientNetwork parent_instance; @@ -126,6 +215,16 @@ struct _X2GoClientNetworkSSH { G_DEFINE_TYPE (X2GoClientNetworkSSH, x2goclient_network_ssh, X2GOCLIENT_TYPE_NETWORK); +/* + * x2goclient_network_ssh_check_timeout_data: + * @self: (not nullable): pointer to the #X2GoClientNetworkSSH instance. + * @gerr: (nullable): pointer to a #GError location, set to %NULL if not + * interested in precise errors. + * + * Data structure used to pass common data to the timeout checking thread. + * + * Since: 0.0.5 + */ struct x2goclient_network_ssh_check_timeout_data { X2GoClientNetworkSSH *self; GError **gerr; @@ -179,12 +278,34 @@ static void x2goclient_network_ssh_class_init (X2GoClientNetworkSSHClass * const object_class->set_property = &x2goclient_network_ssh_set_property; object_class->get_property = &x2goclient_network_ssh_get_property; + /** + * X2GoClientNetworkSSH:openssh-version: + * + * The parsed OpenSSH client version number, put into a custom structure. + * + * It is read-only. + * + * See also x2goclient_network_ssh_fetch_openssh_version(). + * + * Since: 0.0.5 + */ net_ssh_obj_properties[X2GO_NET_SSH_PROP_OPENSSH_VERSION] = g_param_spec_boxed ("openssh-version", _("Parsed OpenSSH version number"), _("The OpenSSH client version number, parsed in a custom " "structure."), X2GOCLIENT_TYPE_OPENSSH_VERSION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE); + /** + * X2GoClientNetworkSSH:openssh-bugs: + * + * Contains the quirk bits for known OpenSSH client bugs. + * + * It is read-only. + * + * See also x2goclient_openssh_bugs_update(). + * + * Since: 0.0.5 + */ net_ssh_obj_properties[X2GO_NET_SSH_PROP_OPENSSH_BUGS] = g_param_spec_boxed ("openssh-bugs", _("Bug quirks structure for OpenSSH Client"), _("A structure containing quirks bits for known OpenSSH Client " "bugs."), @@ -316,6 +437,37 @@ static void x2goclient_network_ssh_get_property (GObject * const object, const g } } +/* + * x2goclient_network_ssh_parse_sockspec_unix_socket: + * @sockspec: (in) (not optional): socket specification as a pointer to a + * #GString. + * + * Takes a socket specification and tries to parse it as UNIX socket path. + * + * Both abstract and non-abstract (i.e., "normal") UNIX sockets are supported. + * + * Note that abstract UNIX sockets start with a null byte and can contain + * other null bytes that are part of the socket address, but not handled in + * a special way. Since abstract UNIX sockets don't have a corresponding file + * system path, no check is done to ensure that the socket actually exists. + * Since abstract UNIX sockets are difficult to pass in shell contexts, this + * functionality was not extensively tested and might be buggy. + * + * For pathname-based, "normal" UNIX sockets, the existence and its type is + * checked for. A non-existent path, or one that doesn't point to a UNIX- + * socket-type file will be treated as an error. + * + * Unnamed UNIX sockets, i.e., stream sockets that have been not passed to + * bind(2) or which have been created via socketpair(2), are currently + * <emphasis role='strong'>not supported</emphasis>. A special syntax will + * have to be created to support those types of UNIX sockets. + * + * Returns: (transfer full): a pointer to the parsed result as a + * #GSocketAddress. %NULL if the function believes + * that the passed @socketspec is not a UNIX socket. + * + * Since: 0.0.5 + */ static GSocketAddress* x2goclient_network_ssh_parse_sockspec_unix_socket (const GString * const sockspec) { GSocketAddress *ret = NULL; @@ -359,6 +511,26 @@ static GSocketAddress* x2goclient_network_ssh_parse_sockspec_unix_socket (const return (ret); } +/* + * x2goclient_network_ssh_parse_sockspec_port: + * @portspec: (in) (not optional): port specification as a pointer to a + * #GString. + * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not + * interested. + * + * Use this function to parse a port specification into a port value. + * + * A valid port specification <emphasis role='strong'>must</emphasis> start + * with a colon character (<literal>:</literal>). + * + * A parsing error will be mapped to the default value, 0. It is up to the + * application to decide what this default value actually maps to. + * + * Returns: (transfer full): the #guint16 value corresponding to the parsed + * port. On parsing errors, returns 0. + * + * Since: 0.0.5 + */ static guint16 x2goclient_network_ssh_parse_sockspec_port (const GString * const portspec, GError ** const gerr) { guint16 ret = 0; @@ -407,6 +579,23 @@ static guint16 x2goclient_network_ssh_parse_sockspec_port (const GString * const return (ret); } +/* + * x2goclient_network_ssh_sanitize_sockspec: + * @sockspec: (in) (not optional): socket specification as a pointer to a + * #GString. + * + * "Sanitizes" a socket specification. + * + * This currently means stripping whitespace from the socket specification, if + * the input looks like a string. + * + * Returns: (transfer full): a pointer to a #GString containing the sanitized + * result if successful, %NULL on error. On success, + * the returned data will always be a copy of the + * input data. + * + * Since: 0.0.5 + */ static GString* x2goclient_network_ssh_sanitize_sockspec (const GString * const sockspec) { GString *ret = NULL; @@ -429,6 +618,54 @@ static GString* x2goclient_network_ssh_sanitize_sockspec (const GString * const return (ret); } +/* + * x2goclient_network_ssh_parse_sockspec_ip: + * @sockspec: (in) (not optional): socket specification as a pointer to a + * #GString. + * @want_v6: (in): %TRUE is IPv6-based parsing is requested, %FALSE for the + * IPv4-based parsing. + * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not + * interested. + * + * Tries to parse a socket specification as an IPv4 or IPv6 address. + * + * There is no automatic detection or fallback mechanism. The address family + * (either IPv4 or IPv6) must be explicitly set via the @want_v6 parameter. If + * @want_v6 is set to %TRUE, the given address will be parsed as an IPv6 + * address, otherwise as an IPv4 address. + * + * The socket specification for both address types can optionally include a + * port specifier. Port specifiers must be separated from the address with a + * colon character (<literal>:</literal>) and are parsed via + * x2goclient_network_ssh_parse_sockspec_port() after parsing the address. + * + * IPv4 addresses can be provided in any IPv4 dotted decimal notation. + * + * IPv6 address criteria are more complicated: + * - If a port specification is provided, the address + * <emphasis role='strong'>must</emphasis> be wrapped in square brackets + * (<literal>[]</literal>). + * - An optional scope ID is supported and can be provided by appending a + * percent character (<literal>%</literal>) and the actual scope ID to the + * address. No validation is done one scope IDs. Network interface names + * are often not constraint in allowed characters or length. Note, that, + * while this function might support parsing scope IDs, the underlying + * glib implementation might not and either refuse to create such an + * #GSocketAddress or remove scope IDs. + * - The actual validation should follow the rules established in + * [RFC 2373](https://tools.ietf.org/html/rfc2373) (and, possibly, later + * versions). + * + * Only basic syntax-based "validation" is done. No connection is attempted + * and even private or reserved addresses, according to IANA, are supported + * and accepted. + * + * Returns: (transfer full): a pointer to a #GSocketAddress containing the + * parsed result if successful, %NULL on error, + * potentially with @gerr populated if provided. + * + * Since: 0.0.5 + */ static GSocketAddress* x2goclient_network_ssh_parse_sockspec_ip (const GString * const sockspec, const gboolean want_v6, GError ** const gerr) { GSocketAddress *ret = NULL; @@ -593,6 +830,42 @@ static GSocketAddress* x2goclient_network_ssh_parse_sockspec_ip (const GString * return (ret); } +/* + * x2goclient_network_ssh_parse_sockspec_alias: + * @sockspec: (in) (not optional): socket specification as a pointer to a + * #GString. + * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not + * interested. + * + * Tries to parse a socket specification as a FQDN or ssh_config-based + * aliases. + * + * The socket specification can optionally include a port specifier. Port + * specifiers must be separated from the address with a colon character + * (<literal>:</literal>) and are parsed via + * x2goclient_network_ssh_parse_sockspec_port() after parsing the address. + * + * No actual validation is currently carried out. Currently, almost any + * characters, with the exception of null characters, are allowed. This is + * mostly a consequence of ssh_config-based aliases, which are not explicitly + * constraint. This behavior is unlikely to change in future versions, but if + * you aim for maximal compatibility, make sure to keep your input aligned + * with [RFC 1123](https://tools.ietf.org/html/rfc1123) (and, possibly, later + * editions). + * + * The socket specification @sockspec experiences whitespace-removal on its + * front and back end before parsing. + * + * The address length is limited by the size of the #sockaddr_ho.sho_addr + * field, including the mandatory terminating null byte. Socket specifications + * with addresses longer than that will be regarded as erroneous. + * + * Returns: (transfer full): a pointer to a #GSocketAddress containing the + * parsed result if successful, %NULL on error, + * potentially with @gerr populated if provided. + * + * Since: 0.0.5 + */ static GSocketAddress* x2goclient_network_ssh_parse_sockspec_alias (const GString * const sockspec, GError ** const gerr) { GSocketAddress *ret = NULL; @@ -676,6 +949,44 @@ static GSocketAddress* x2goclient_network_ssh_parse_sockspec_alias (const GStrin return (ret); } +/* + * x2goclient_network_ssh_parse_sockspec: + * @parent: (in) (not optional): pointer to the #X2GoClientNetwork parent + * instance. + * @sockspec: (in) (not optional): socket specification as a pointer to a + * #GString. + * + * Tries to parse a socket specification. + * + * This function is actually, more or less, just a wrapper that calls other + * functions to parse the input socket specification, in the following order: + * - parse as UNIX socket via + * x2goclient_network_ssh_parse_sockspec_unix_socket() + * - if that failed, parse as IPv6 address via + * x2goclient_network_ssh_parse_sockspec_ip() with its + * <code>want_v6</code> parameter set to %TRUE + * - if that failed, parse as IPv4 address via + * x2goclient_network_ssh_parse_sockspec_ip() with its + * <code>want_v4</code> parameter set to %FALSE + * - if that failed, parse as FQDN or ssh_config-based alias via + * x2goclient_network_ssh_parse_sockspec_alias(). + * + * Please consult the listed function's documentation for valid input + * references and their behavior. + * + * There currently is no way to modify the outlined fallback behavior, e.g., + * to skip specific parsing steps or request a specific one. + * + * The general idea is that socket specifications are unique enough that only + * one parsing function can match them (or, more specifically, all but the + * last one, which will essentially accept any input as long as it is not too + * long). + * + * Returns: (transfer full): a pointer to a #GSocketAddress containing the + * parsed result if successful, %NULL on error. + * + * Since: 0.0.5 + */ static GSocketAddress* x2goclient_network_ssh_parse_sockspec (X2GoClientNetwork * const parent, const GString * const sockspec) { GSocketAddress *ret = NULL; @@ -737,6 +1048,31 @@ static GSocketAddress* x2goclient_network_ssh_parse_sockspec (X2GoClientNetwork return ret; } +/* + * x2goclient_network_ssh_kill_subprocesses: + * @self: (in) (not optional): pointer to the #X2GoClientNetworkSSH instance. + * + * Terminates all subprocesses associated with the master connection. + * + * This also entails terminating the master connection itself. + * + * <note> + * <title> + * Current implementation notice + * </title> + * <para> + * Right now, no additional processes but the master connection itself are + * terminated. This function will need to be extended to match the + * intention and documentation, but, as of right now, no additional + * processes are being created, so there is nothing to clean up. + * </para> + * </note> + * + * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or + * failure (%FALSE). + * + * Since: 0.0.5 + */ static gboolean x2goclient_network_ssh_kill_subprocesses (X2GoClientNetworkSSH * const self) { gboolean ret = FALSE; @@ -791,6 +1127,67 @@ static gboolean x2goclient_network_ssh_kill_subprocesses (X2GoClientNetworkSSH * return (ret); } +/** + * x2goclient_network_ssh_connect: + * @self: (in) (not optional): pointer to the #X2GoClientNetworkSSH instance. + * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not + * interested. + * + * Wraps the SSH connect function. + * + * This function can be called on #X2GoClientNetworkSSH objects and redirects + * to the actual connection function, x2goclient_network_ssh_parent_connect(). + * + * x2goclient_network_ssh_parent_connect() opens an SSH connection to the + * remote location and registers the corresponding master connection + * internally. + * + * Additionally, if connecting was successful, it starts a new check thread, + * which periodically checks if this master connection is still alive and + * tears it down on connection losses, also updating the + * #X2GoClientNetwork:connected property. + * + * The connection parameters are looked up from the + * #X2GoClientNetwork:socket, #X2GoClientNetworkSSH:options and + * #X2GoClientNetwork:session-path properties. + * + * Currently, the control socket path is hardcoded to + * <filename><varname>session-path</varname>/ssh/control</filename>. + * + * Each connection attempt will also re-fetch the OpenSSH client version and + * re-apply quirks as necessary, (hopefully) making it resilient to system + * upgrades. + * + * This function is idempotent. + * + * Calling this function should be functionally equivalent to calling the + * parent's connect function: + * + * <informalexample> + * <programlisting language='C'> + * // Assume that this variable is pointing to a fully setup + * // #X2GoClientNetworkSSH instance. + * X2GoClientNetworkSSH *net_ssh = magic_ssh_object; + * + * // This part should be equivalent to the later one. + * gboolean conn_ret = x2goclient_network_ssh_connect (net_ssh, NULL); + * if (conn_ret) { + * x2goclient_network_ssh_disconnect (net_ssh, NULL); + * } + * + * // To this one. + * conn_ret = x2goclient_network_connect ((X2GoClientNetwork*) (net_ssh), + * NULL); + * if (conn_ret) { + * x2goclient_network_disconnect ((X2GoClientNetwork*) (net_ssh), NULL); + * } + * </programlisting> + * </informalexample> + * + * Returns: a #gboolean value indicating success (%TRUE) or failure (%FALSE). + * + * Since: 0.0.5 + */ gboolean x2goclient_network_ssh_connect (X2GoClientNetworkSSH * const self, GError ** const gerr) { gboolean ret = FALSE; @@ -812,6 +1209,37 @@ gboolean x2goclient_network_ssh_connect (X2GoClientNetworkSSH * const self, GErr return (ret); } +/* + * x2goclient_network_ssh_parent_connect: + * @parent: (in) (not optional): pointer to the #X2GoClientNetwork parent + * instance. + * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not + * interested. + * + * Opens an SSH connection to the remote location and registers this master + * connection internally. + * + * For documentation of its internal behavior, refer to the public function + * x2goclient_network_ssh_connect(). + * + * This function is <emphasis role='strong'>not</emphasis> idempotent. + * + * This function should not be called by user code. It's meant to be the + * private connect function of this class, also showcased by the fact that it + * is not idempotent. + * + * User code should call the public functions x2goclient_network_ssh_connect() + * on #X2GoClientNetworkSSH objects, or x2goclient_network_connect() on + * #X2GoClientNetwork objects. The latter function redirects to/automatically + * calls the more specific connection function of the derived class, which, + * for #X2GoClientNetworkSSH objects, should be functionally equivalent to + * calling x2goclient_network_ssh_connect() directly. + * + * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or + * failure (%FALSE). + * + * Since: 0.0.5 + */ static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork * const parent, GError ** const gerr) { gboolean ret = FALSE; @@ -964,6 +1392,35 @@ static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork * const return (ret); } +/** + * x2goclient_network_ssh_disconnect: + * @self: (in) (not optional): pointer to the #X2GoClientNetworkSSH instance. + * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not + * interested. + * + * Wraps the SSH disconnect function. + * + * This function can be called on #X2GoClientNetworkSSH objects and redirects + * to the actual disconnection function, + * x2goclient_network_ssh_parent_disconnect(). + * + * x2goclient_network_ssh_parent_disconnect() terminates the registered master + * connection to the remote location (if it exists), clears the connected + * state and also terminates all processes that have been spawned as part of + * this connection. + * + * Additionally, if disconnecting was successful, the check thread is + * terminated. + * + * For more information, see also x2goclient_network_ssh_connect(), which + * documents the connection parameters and example usage. + * + * This function is idempotent. + * + * Returns: a #gboolean value indicating success (%TRUE) or failure (%FALSE). + * + * Since: 0.0.5 + */ gboolean x2goclient_network_ssh_disconnect (X2GoClientNetworkSSH * const self, GError ** const gerr) { gboolean ret = FALSE; @@ -985,6 +1442,38 @@ gboolean x2goclient_network_ssh_disconnect (X2GoClientNetworkSSH * const self, G return (ret); } +/* + * x2goclient_network_ssh_parent_disconnect: + * @parent: (in) (not optional): pointer to the #X2GoClientNetwork parent + * instance. + * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not + * interested. + * + * Terminates the master SSH connection to the remote location and all + * associated processes. + * + * For documentation of its internal behavior, refer to the public + * x2goclient_network_ssh_disconnect() function. + * + * This function is <emphasis role='strong'>not</emphasis> idempotent. + * + * This function should not be called by user code. It's meant to be the + * private disconnect function of this class, also showcased by the fact that + * it is not idempotent. + * + * User code should call the public functions + * x2goclient_network_ssh_disconnect() on #X2GoClientNetworkSSH objects, or + * x2goclient_network_disconnect() on #X2GoClientNetwork objects. The latter + * function redirects to/automatically calls the more specific disconnection + * function of the derived class, which, for #X2GoClientNetworkSSH objects, + * should be functionally equivalent to calling + * x2goclient_network_ssh_disconnect() directly. + * + * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or + * failure (%FALSE). + * + * Since: 0.0.5 + */ static gboolean x2goclient_network_ssh_parent_disconnect (X2GoClientNetwork * const parent, GError ** const gerr) { gboolean ret = FALSE; @@ -1047,6 +1536,20 @@ static gboolean x2goclient_network_ssh_parent_disconnect (X2GoClientNetwork * co return (ret); } +/* + * x2goclient_network_ssh_fetch_openssh_version: + * @self: (in) (not optional): pointer to the #X2GoClientNetworkSSH instance. + * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not + * interested. + * + * Fetches the OpenSSH client version and updates the read-only + * #X2GoClientNetworkSSH:openssh-version property. + * + * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or + * failure (%FALSE). + * + * Since: 0.0.5 + */ static gboolean x2goclient_network_ssh_fetch_openssh_version (X2GoClientNetworkSSH * const self, GError ** const gerr) { gboolean ret = FALSE; @@ -1075,6 +1578,29 @@ static gboolean x2goclient_network_ssh_fetch_openssh_version (X2GoClientNetworkS return (ret); } +/* + * x2goclient_network_ssh_log_std_str: + * @str: (in) (optional): string to print. + * @str_size: (in): the total size of @str. + * @select_stderr: (in): indicates whether the string was printed to stderr + * (%TRUE) or stdout (%FALSE). + * + * Prints the whole string passed via @str to the debug log level, indicating + * whether the string originally came from stderr or stdout. + * + * @str is allowed to be %NULL iff its size @str_size is zero. Other + * combinations are invalid and will lead to the function terminating without + * processing any data. + * + * This function exists because the #printf formatter specifier + * <code>%.*s</code>, which limits the size of the string to be printed, is + * limited to the size that can be passed via an #int. To work around that, + * it splits up the string into %INT_MAX increments (if needed) and prints + * each additional part prepended with a <literal>(continuation)</literal> + * message. + * + * Since: 0.0.5 + */ static void x2goclient_network_ssh_log_std_str (const gchar * const str, const gsize str_size, const _Bool select_stderr) { /* * For a size bigger than zero, the bytes object must be non-NULL, @@ -1126,6 +1652,27 @@ static void x2goclient_network_ssh_log_std_str (const gchar * const str, const g } } +/* + * x2goclient_network_ssh_gptrarray_to_string: + * @arr: (in) (not optional) (array) + * (element-type (type utf8)): pointer to the #GPtrArray to convert to a + * string. + * @prelude: (in) (nullable): initial string to prepend to the resulting + * output string. + * @ret_str: (out) (not optional) (transfer full): output location of the + * converted string. + * + * Converts a #GPtrArray passed as @arr to a flat string, optionally prefixing + * it with @prelude and returns it via @ret_str. + * + * Elements in @arr must be strings. %NULL elements are explicitly allowed and + * will be mapped to an internal representation: <literal>(NULL)</literal>. + * + * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or + * failure (%FALSE). + * + * Since: 0.0.5 + */ static gboolean x2goclient_network_ssh_gptrarray_to_string (GPtrArray * const arr, const gchar * const prelude, gchar ** const ret_str) { #define SIZE_LOW_WRAP(buffer_size, elem_size) ((G_MAXSIZE - (buffer_size)) < ((elem_size))) gboolean ret = FALSE; @@ -1313,6 +1860,27 @@ static void x2goclient_network_ssh_gptrarray_print_debug (GPtrArray * const arr, } } +/* + * x2goclient_network_ssh_sshcmd_add_host_port: + * @self: (in) (not optional): pointer to the #X2GoClientNetworkSSH instance. + * @ssh_cmd: (in) (not optional): a #GPtrArray to be modified. + * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not + * interested. + * + * Adds a host and port specification to the OpenSSH client command passed in + * as @ssh_cmd. + * + * These parameters are determined from the #X2GoNetworkSSH:socket property. + * + * Some socket types, like UNIX sockets, do not have semantics of a port. + * Likewise, a port may have not been explicitly provided, indicated by the + * port number 0 internally. In such cases, no port option is added. + * + * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or + * failure (%FALSE). + * + * Since: 0.0.5 + */ static gboolean x2goclient_network_ssh_sshcmd_add_host_port (X2GoClientNetworkSSH * const self, GPtrArray * const ssh_cmd, GError ** const gerr) { gboolean ret = FALSE; @@ -1409,6 +1977,30 @@ static gboolean x2goclient_network_ssh_sshcmd_add_host_port (X2GoClientNetworkSS return (ret); } +/* + * x2goclient_network_ssh_start_sshcmd: + * @self: (in) (not optional): pointer to the #X2GoClientNetworkSSH instance. + * @ssh_cmd: (in) (not optional): a #GPtrArray to be used as argv. + * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not + * interested. + * @master: (in): a boolean value indicating, whether the process to spawn is + * the master connection (%TRUE) or a control connection + * (%FALSE). + * + * Starts a new SSH process. Use @master to select between a master or control + * connection. + * + * This function blocks until the command finished execution. + * + * After process execution, the accumulated data on stdout and stderr are + * queried (as buffered by glib) and subsequently printed to the debug log + * level. + * + * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or + * failure (%FALSE). + * + * Since: 0.0.5 + */ static gboolean x2goclient_network_ssh_start_sshcmd (X2GoClientNetworkSSH * const self, const GPtrArray * const ssh_cmd, GError ** const gerr, const gboolean master) { gboolean ret = FALSE; @@ -1536,11 +2128,48 @@ static gboolean x2goclient_network_ssh_start_sshcmd (X2GoClientNetworkSSH * cons return (ret); } +/* + * x2goclient_network_ssh_check_timeout_data_free: + * @data: (in) (nullable): pointer to an + * #x2goclient_network_ssh_check_timeout_data + * instance. + * + * Frees elements in the data structure used by timeout check threads and + * afterwards the instance itself. + * + * While a %NULL input is supported, avoid that, since it will essentially + * degrade into a no-op with additional overhead. + * + * Since: 0.0.5 + */ static void x2goclient_network_ssh_check_timeout_data_free (struct x2goclient_network_ssh_check_timeout_data * const data) { /* No need to clear any data within the structure. */ g_free (data); } +/* + * x2goclient_network_ssh_check_timeout_thread_main: + * @user_data: (in) (not optional): pointer to the #X2GoClientNetworkSSH + * instance (actually, something like + * "self"). + * + * Implements the check thread's main function. + * + * This means setting up the main context (as used by glib), executing the + * main loop (as set up and registered in the #X2GoClientNetworkSSH instance + * previously) and eventually tears down the main loop and context data. + * + * Importantly, this function will execute in the actual check thread. + * + * Also, this function does not encapsulate any checking functionality. The + * actual checking is done in a timeout callback, but this one relies on the + * glib main loop started here. + * + * Returns: (transfer full): a #gpointer to... something. Currently always + * %NULL. + * + * Since: 0.0.5 + */ static gpointer x2goclient_network_ssh_check_timeout_thread_main (const gpointer user_data) { gpointer ret = NULL; @@ -1586,6 +2215,21 @@ static gpointer x2goclient_network_ssh_check_timeout_thread_main (const gpointer return (ret); } +/* + * x2goclient_network_ssh_start_check_timeout: + * @self: (in) (not optional): pointer to the #X2GoClientNetworkSSH instance. + * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not + * interested. + * + * Set ups and starts the check thread and executes the actual check timeout. + * + * This function will execute in the main thread. + * + * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or + * failure (%FALSE). + * + * Since: 0.0.5 + */ static gboolean x2goclient_network_ssh_start_check_timeout (X2GoClientNetworkSSH * const self, GError ** const gerr) { gboolean ret = FALSE; @@ -1610,6 +2254,18 @@ static gboolean x2goclient_network_ssh_start_check_timeout (X2GoClientNetworkSSH return (ret); } +/* + * x2goclient_network_ssh_start_check_timeout_invoke: + * @self: (in) (not optional): pointer to the #X2GoClientNetworkSSH instance. + * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not + * interested. + * + * Invokes the check timeout in the check thread context. + * + * This function will execute in the main thread. + * + * Since: 0.0.5 + */ static void x2goclient_network_ssh_start_check_timeout_invoke (X2GoClientNetworkSSH * const self, GError ** const gerr) { g_return_if_fail (X2GOCLIENT_IS_NETWORK_SSH (self)); g_return_if_fail (((NULL == gerr) || (NULL == *gerr))); @@ -1623,6 +2279,21 @@ static void x2goclient_network_ssh_start_check_timeout_invoke (X2GoClientNetwork data, (GDestroyNotify) (&x2goclient_network_ssh_check_timeout_data_free)); } +/* + * x2goclient_network_ssh_start_check_timeout_unwrap: + * @user_data: (in) (not optional): pointer to an + * #x2goclient_network_ssh_check_timeout_data + * instance. + * + * Unwraps the provided check thread data and starts the actual check timeout. + * + * This function will execute in the check thread. + * + * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or + * failure (%FALSE). + * + * Since: 0.0.5 + */ static gboolean x2goclient_network_ssh_start_check_timeout_unwrap (const gpointer user_data) { gboolean ret = G_SOURCE_CONTINUE; @@ -1638,6 +2309,21 @@ static gboolean x2goclient_network_ssh_start_check_timeout_unwrap (const gpointe return (ret); } +/* + * x2goclient_network_ssh_start_check_timeout_real: + * @self: (in) (not optional): pointer to the #X2GoClientNetworkSSH instance. + * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not + * interested. + * + * Unwraps the provided check thread data and starts the actual check timeout. + * + * This function will execute in the check thread. + * + * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or + * failure (%FALSE). + * + * Since: 0.0.5 + */ static gboolean x2goclient_network_ssh_start_check_timeout_real (X2GoClientNetworkSSH * const self, GError ** const gerr) { gboolean ret = FALSE; @@ -1677,6 +2363,31 @@ static gboolean x2goclient_network_ssh_start_check_timeout_real (X2GoClientNetwo return (ret); } +/* + * x2goclient_network_ssh_start_check_timeout: + * @data: (in) (not optional): pointer to the #X2GoClientNetworkSSH instance + * (actually, something like "self"). + * + * Checks if the master connection is still alive. + * + * The actual checking is done through spawning an OpenSSH client process with + * the control path and the <constant>check</constant> command set. + * + * The return value of the OpenSSH client process will be used as an indicator + * for failure or success. + * + * Importantly, if the OpenSSH client process fails, the timeout source is + * deleted, the glib main loop terminated and the active master connection + * flag #X2GoClientNetworkSSH:active_master_conn is set to %FALSE. This means + * that the check thread will terminate. + * + * This function will execute in the check thread. + * + * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or + * failure (%FALSE). + * + * Since: 0.0.5 + */ static gboolean x2goclient_network_ssh_check_timeout (const gpointer data) { gboolean ret = FALSE; diff --git a/src/x2goclient-network.c b/src/x2goclient-network.c index e944d0c..3580429 100644 --- a/src/x2goclient-network.c +++ b/src/x2goclient-network.c @@ -48,6 +48,8 @@ * * An example of a more concrete implementation is * #X2GoClientNetworkOptionsSSH. + * + * Since: 0.0.5 */ /* Not sure if we need this, so comment out for now. */ @@ -79,6 +81,8 @@ static void x2goclient_network_options_init (X2GoClientNetworkOptions * const se * implement, rely upon and obey. * * An example of a more concrete implementation is #X2GoClientNetworkSSH. + * + * Since: 0.0.5 */ /** @@ -86,6 +90,8 @@ static void x2goclient_network_options_init (X2GoClientNetworkOptions * const se * * #X2GoClientNetwork is an opaque data structure and can only be accessed * using the following functions. + * + * Since: 0.0.5 */ typedef struct X2GoClientNetworkPrivate_ { -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit b59db11fb259eafb3fe58070577e9d48de6bf761 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Feb 27 09:23:51 2021 +0100 src/x2goclient-network-ssh.c: "unreference" check thread pointer in x2goclient_network_ssh_check_timeout_thread_main (). We want to invalidate the instance variable if the thread finishes and if this function terminates, it means that the check thread will terminate right after the fact. --- src/x2goclient-network-ssh.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 348f712..024e728 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -1570,6 +1570,15 @@ static gpointer x2goclient_network_ssh_check_timeout_thread_main (const gpointer /* Destroy context. */ g_main_context_unref (self->check_thread_context); self->check_thread_context = NULL; + + /* + * "Un-reference" the thread pointer. + * + * FIXME: is that safe here? The general idea is that, if this function + * terminates, the thread will be torn down as well, so it should be + * pretty safe. + */ + self->check_thread = NULL; g_mutex_unlock (&(self->check_thread_mutex)); g_log (NULL, G_LOG_LEVEL_DEBUG, "Terminating main function of check timeout thread."); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 132ad9e01c0bdd0752a3706ae755e15c2ba2f3bd Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Feb 27 11:17:00 2021 +0100 src/x2goclient-network-ssh.h: document error enum. --- src/x2goclient-network-ssh.h | 64 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/src/x2goclient-network-ssh.h b/src/x2goclient-network-ssh.h index f3108cb..fc1f7db 100644 --- a/src/x2goclient-network-ssh.h +++ b/src/x2goclient-network-ssh.h @@ -52,6 +52,70 @@ X2GoClientNetworkSSH* x2goclient_network_ssh_new (const gchar * const session_pa */ #define X2GOCLIENT_NETWORK_SSH_ERROR g_quark_from_static_string ("x2goclient-network-ssh") +/** + * X2GoClientNetworkSSHErrors: + * @X2GOCLIENT_NETWORK_SSH_ERROR_PORT_CONV_NOT_NUMERIC: port value to parse + * was not numeric. + * @X2GOCLIENT_NETWORK_SSH_ERROR_PORT_CONV_UNDERFLOW: port value to parse too + * small to fit into + * #long long type. + * @X2GOCLIENT_NETWORK_SSH_ERROR_PORT_CONV_OVERFLOW: port value to parse too + * big to fit into + * #long long type. + * @X2GOCLIENT_NETWORK_SSH_ERROR_PORT_CONV_TOO_BIG: port value to parse was + * bigger than allowed by + * common port specifications + * <constant> + * 65535 + * </constant>. + * @X2GOCLIENT_NETWORK_SSH_ERROR_PORT_CONV_NEGATIVE_ZERO: port value to parse + * was either negative, + * which is not allowed + * by common port + * specifications, + * or zero, which we + * explicitly disallow. + * @X2GOCLIENT_NETWORK_SSH_ERROR_IPV6_CONV: error while parsing socket + * specification as an IPv6 address. + * @X2GOCLIENT_NETWORK_SSH_ERROR_IPV4_CONV: error while parsing socket + * specification as an IPv4 address. + * @X2GOCLIENT_NETWORK_SSH_ERROR_ALIAS_CONV: error while parsing socket + * specification as a FQDN or + * OpenSSH client config alias. + * @X2GOCLIENT_NETWORK_SSH_ERROR_CONNECT_DIR_CREATE: error while creating + * parent directory for + * control socket. + * @X2GOCLIENT_NETWORK_SSH_ERROR_CONNECT_SOCK_ADDR_NULL: socket endpoint + * undefined in connect + * function. + * @X2GOCLIENT_NETWORK_SSH_ERROR_CONNECT_INET_ADDR_NULL: IP address undefined + * in connect function. + * @X2GOCLIENT_NETWORK_SSH_ERROR_CONNECT_NATIVE_FETCH: error converting data + * from + * #GNativeSocketAddress + * to sockaddr struct in + * connect function. + * @X2GOCLIENT_NETWORK_SSH_ERROR_CONNECT_SOCK_ADDR_UNKNOWN: unknown socket + * address type in + * connect function. + * @X2GOCLIENT_NETWORK_SSH_ERROR_CONNECT_OPTIONS_INVALID: options structure + * could not be parsed + * into string array in + * connect function. + * @X2GOCLIENT_NETWORK_SSH_ERROR_PROC_COMMUNICATE_TRUE_RETVAL_UNAVAILABLE: + * SSH process spawned + * successfully, but + * exit status is not + * available. + * @X2GOCLIENT_NETWORK_SSH_ERROR_PROC_RETVAL_NONZERO: SSH process spawned did + * not execute + * successfully. + * + * Error message types as used within X2GoClientNetworkSSH. May be passed out + * via #GError instances. + * + * Since: 0.0.5 + */ enum { X2GOCLIENT_NETWORK_SSH_ERROR_PORT_CONV_NOT_NUMERIC = 0, X2GOCLIENT_NETWORK_SSH_ERROR_PORT_CONV_UNDERFLOW, -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 62663ecd8ebd23ceda01558016a3a7f533c1fc77 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Feb 19 07:02:13 2021 +0100 src/x2goclient-network-ssh.c: switch from inet_pton () to inet_addr () for IPv4 address validation in x2goclient_network_ssh_parse_sockspec_ip (). This allows us to actually support arbitrary IPv4 dotted decimal notation (i.e., also the "a.b.c", "a.b" and "a" forms in addition to the "a.b.c.d" form), including (ironically), non-decimal notations. --- src/x2goclient-network-ssh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 31cfa5c..b28dd9d 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -502,7 +502,6 @@ static GSocketAddress* x2goclient_network_ssh_parse_sockspec_ip (const GString * if (!(int_err)) { gboolean is_v6 = FALSE, is_v4 = FALSE; - char binary_rep[128] = { 0 }; if (want_v6) { /* * Check for an IPv6 address. @@ -523,6 +522,7 @@ static GSocketAddress* x2goclient_network_ssh_parse_sockspec_ip (const GString * filter_work = g_string_new (filter_start); } + char binary_rep[128] = { 0 }; is_v6 = (1 == inet_pton (AF_INET6, filter_work->str, &binary_rep)); g_string_free (filter_work, TRUE); @@ -530,7 +530,7 @@ static GSocketAddress* x2goclient_network_ssh_parse_sockspec_ip (const GString * } else { /* Check for an IPv4 address. */ - is_v4 = (1 == inet_pton (AF_INET, address->str, &binary_rep)); + is_v4 = ((in_addr_t)(-1) != inet_addr (address->str)); } if (((is_v6) && (want_v6)) || ((is_v4) && (!(want_v6)))) { -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit a367c6ede6d1d38e98349c096301b557999707ae Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Mar 20 06:44:47 2021 +0100 src/test/sshtest.c: fix compiler warning: %p accepts void * only. --- src/test/sshtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/sshtest.c b/src/test/sshtest.c index 710b6a1..b1c827e 100644 --- a/src/test/sshtest.c +++ b/src/test/sshtest.c @@ -81,7 +81,7 @@ static _Bool test_x2goclient_network_ssh_properties_socket (const GString * cons GSocketAddress *sock_addr = NULL; g_object_get (G_OBJECT (net_ssh), "socket", &sock_addr, NULL); - g_printf ("sock_addr: %p\n", sock_addr); + g_printf ("sock_addr: %p\n", (void*) (sock_addr)); ret = (!(!(sock_addr))); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 7ed999c867e07c3e083b8a9236a76bec8bbf7a25 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Apr 30 13:15:06 2021 +0200 docs/reference/libx2goclient: add Makefile.am - copied verbatim from upstream. --- docs/reference/libx2goclient/Makefile.am | 111 +++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) diff --git a/docs/reference/libx2goclient/Makefile.am b/docs/reference/libx2goclient/Makefile.am new file mode 100644 index 0000000..1c0d907 --- /dev/null +++ b/docs/reference/libx2goclient/Makefile.am @@ -0,0 +1,111 @@ +# -*- mode: makefile -*- +# +# Makefile.am - template makefile for gtk-doc module +# Copyright (C) 2007-2017 Stefan Sauer +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the above copyright owner gives unlimited +# permission to copy, distribute and modify this Makefile.am template. +# You need not follow the terms of the GNU General Public License when +# using or distributing such Makefile.am files, even though portions of +# the text of the Makefile.am appear in them. The GNU General Public +# License (GPL) does govern all other use of the material that constitutes +# the Makefile.am template. + +# This is a blank Makefile.am for using gtk-doc. +# Copy this to your project's API docs directory and modify the variables to +# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples +# of using the various options. + +# The name of the module, e.g. 'glib'. +DOC_MODULE= + +# Uncomment for versioned docs and specify the version of the module, e.g. '2'. +#DOC_MODULE_VERSION=2 + +# The top-level XML file. +DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml + +# Directories containing the source code. +# gtk-doc will search all .c and .h files beneath these paths +# for inline comments documenting functions and macros. +# e.g. DOC_SOURCE_DIR=$(top_srcdir)/gtk $(top_srcdir)/gdk +DOC_SOURCE_DIR= + +# Extra options to pass to gtkdoc-scangobj. Normally not needed. +SCANGOBJ_OPTIONS= + +# Extra options to supply to gtkdoc-scan. +# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" +SCAN_OPTIONS= + +# Extra options to supply to gtkdoc-mkdb +# e.g. MKDB_OPTIONS=--xml-mode --output-format=xml +MKDB_OPTIONS=--xml-mode --output-format=xml + +# Extra options to supply to gtkdoc-mkhtml +MKHTML_OPTIONS= + +# Extra options to supply to gtkdoc-fixref. Normally not needed. +# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html +FIXXREF_OPTIONS= + +# Used for dependencies. The docs will be rebuilt if any of these change. +# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h +# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c +HFILE_GLOB= +CFILE_GLOB= + +# Extra header to include when scanning, which are not under DOC_SOURCE_DIR +# e.g. EXTRA_HFILES=$(top_srcdir}/contrib/extra.h +EXTRA_HFILES= + +# Header files or dirs to ignore when scanning. Use base file/dir names +# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h private_code +IGNORE_HFILES= + +# Images to copy into HTML directory. +# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png +HTML_IMAGES= + +# Extra files that are included by $(DOC_MAIN_SGML_FILE). +# e.g. content_files=running.xml building.xml changes-2.0.xml +content_files= + +# Files where gtk-doc abbreviations (#GtkWidget) are expanded +# e.g. expand_content_files=running.xml +expand_content_files= + +# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. +# Only needed if you are using gtkdoc-scangobj to dynamically query widget +# signals and properties. +# e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) +# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) +GTKDOC_CFLAGS= +GTKDOC_LIBS= + +# This includes the standard gtk-doc make rules, copied by gtkdocize. +include $(top_srcdir)/gtk-doc.make + +# Comment this out if you don't want 'make check' to test you doc status +# and run some sanity checks +if ENABLE_GTK_DOC +TESTS_ENVIRONMENT = \ + DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \ + SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir) +TESTS = $(GTKDOC_CHECK) +endif + +-include $(top_srcdir)/git.mk -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit a2f0a5f3ef50b7c6e5b0c4ce8687acecf5f36ce8 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Mar 20 06:48:14 2021 +0100 src/x2goclient-network{,-ssh}.c: fix G_DEFINE*_TYPE warnings. --- src/x2goclient-network-ssh.c | 4 ++-- src/x2goclient-network.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index bcb1ea5..5f65076 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -77,7 +77,7 @@ struct _X2GoClientNetworkOptionsSSH { */ }; -G_DEFINE_TYPE (X2GoClientNetworkOptionsSSH, x2goclient_network_options_ssh, X2GOCLIENT_TYPE_NETWORK_OPTIONS); +G_DEFINE_TYPE (X2GoClientNetworkOptionsSSH, x2goclient_network_options_ssh, X2GOCLIENT_TYPE_NETWORK_OPTIONS) static void x2goclient_network_options_ssh_class_init (X2GoClientNetworkOptionsSSHClass * const klass) { } @@ -210,7 +210,7 @@ struct _X2GoClientNetworkSSH { GMainLoop *check_thread_loop; }; -G_DEFINE_TYPE (X2GoClientNetworkSSH, x2goclient_network_ssh, X2GOCLIENT_TYPE_NETWORK); +G_DEFINE_TYPE (X2GoClientNetworkSSH, x2goclient_network_ssh, X2GOCLIENT_TYPE_NETWORK) /* diff --git a/src/x2goclient-network.c b/src/x2goclient-network.c index 3580429..d3212f7 100644 --- a/src/x2goclient-network.c +++ b/src/x2goclient-network.c @@ -58,8 +58,8 @@ typedef struct X2GoClientNetworkOptionsPrivate_ { } X2GoClientNetworkOptionsPrivate; */ -/* G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (X2GoClientNetworkOptions, x2goclient_network_options, G_TYPE_OBJECT); */ -G_DEFINE_ABSTRACT_TYPE (X2GoClientNetworkOptions, x2goclient_network_options, G_TYPE_OBJECT); +/* G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (X2GoClientNetworkOptions, x2goclient_network_options, G_TYPE_OBJECT) */ +G_DEFINE_ABSTRACT_TYPE (X2GoClientNetworkOptions, x2goclient_network_options, G_TYPE_OBJECT) static void x2goclient_network_options_class_init (X2GoClientNetworkOptionsClass * const klass) { } @@ -104,8 +104,8 @@ typedef struct X2GoClientNetworkPrivate_ { gboolean (*disconnect_func) (X2GoClientNetwork * const self, GError ** const gerr); } X2GoClientNetworkPrivate; -G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (X2GoClientNetwork, x2goclient_network, G_TYPE_OBJECT); -/* G_DEFINE_ABSTRACT_TYPE (X2GoClientNetwork, x2goclient_network, G_TYPE_OBJECT); */ +G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (X2GoClientNetwork, x2goclient_network, G_TYPE_OBJECT) +/* G_DEFINE_ABSTRACT_TYPE (X2GoClientNetwork, x2goclient_network, G_TYPE_OBJECT) */ /* * Caution: NEVER abbreviate names in public (API) space. -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 9e0fdd21199a45cc230764090c8007e55c0e69f6 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Mar 20 06:46:43 2021 +0100 src/x2goclient-network-ssh.c: fix warnings due to unused variables. --- src/x2goclient-network-ssh.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 5fe7d02..bcb1ea5 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -1194,6 +1194,7 @@ gboolean x2goclient_network_ssh_connect (X2GoClientNetworkSSH * const self, GErr X2GoClientNetwork *parent = X2GOCLIENT_NETWORK (self); X2GoClientNetworkClass *parent_class = X2GOCLIENT_NETWORK_GET_CLASS (parent); + (void) parent_class; /* Fetch parent's connect function. */ parent_connect_type parent_connect = NULL; @@ -1427,6 +1428,7 @@ gboolean x2goclient_network_ssh_disconnect (X2GoClientNetworkSSH * const self, G X2GoClientNetwork *parent = X2GOCLIENT_NETWORK (self); X2GoClientNetworkClass *parent_class = X2GOCLIENT_NETWORK_GET_CLASS (parent); + (void) parent_class; /* Fetch parent's disconnect function. */ parent_disconnect_type parent_disconnect = NULL; @@ -1935,6 +1937,7 @@ static gboolean x2goclient_network_ssh_sshcmd_add_host_port (X2GoClientNetworkSS } else if (G_IS_NATIVE_SOCKET_ADDRESS (sock_addr)) { GNativeSocketAddress *native_sock_addr = G_NATIVE_SOCKET_ADDRESS (sock_addr); + (void) native_sock_addr; g_assert (sizeof (sockaddr_ho) == g_socket_address_get_native_size (sock_addr)); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 7f88b1d106c8e99cc8a424e165e4ba1f5bd63605 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Apr 26 07:57:16 2021 +0200 src/x2goclient-openssh-version.c: use type safety macros in macros that handle setting version components. This has actually bitten me before, so make sure that it doesn't happen again. --- src/x2goclient-openssh-version.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/x2goclient-openssh-version.c b/src/x2goclient-openssh-version.c index b2dcf0f..a2c4c5d 100644 --- a/src/x2goclient-openssh-version.c +++ b/src/x2goclient-openssh-version.c @@ -62,6 +62,7 @@ G_DEFINE_BOXED_TYPE (X2GoClientOpenSSHVersion, x2goclient_openssh_version, &x2go #define GENERATE_ERROR_MSG_(component, msg) #component " " msg #define GENERATE_ERROR_MSG(out_var, idx_var, msg) \ do {\ + X2GOCLIENT_CHECK_TYPE (char *, out_var);\ if (0 == idx_var) {\ out_var = GENERATE_ERROR_MSG_ ("Major", msg);\ }\ @@ -87,11 +88,13 @@ G_DEFINE_BOXED_TYPE (X2GoClientOpenSSHVersion, x2goclient_openssh_version, &x2go #define SET_VER_COMPONENT(ver_struct, idx_var, value, init) \ do {\ + X2GOCLIENT_CHECK_TYPE (X2GoClientOpenSSHVersion *, (ver_struct));\ _Bool valid = TRUE;\ if ((init)) {\ valid = FALSE;\ }\ if (0 == (idx_var)) {\ + X2GOCLIENT_CHECK_TYPE_TYPEOF ((ver_struct)->major, (value));\ if ((init)) {\ (ver_struct)->major = 0;\ }\ @@ -101,6 +104,7 @@ G_DEFINE_BOXED_TYPE (X2GoClientOpenSSHVersion, x2goclient_openssh_version, &x2go (ver_struct)->major_valid = valid;\ }\ else if (1 == (idx_var)) {\ + X2GOCLIENT_CHECK_TYPE_TYPEOF ((ver_struct)->minor, (value));\ if ((init)) {\ (ver_struct)->minor = 0;\ }\ @@ -110,6 +114,7 @@ G_DEFINE_BOXED_TYPE (X2GoClientOpenSSHVersion, x2goclient_openssh_version, &x2go (ver_struct)->minor_valid = valid;\ }\ else {\ + X2GOCLIENT_CHECK_TYPE_TYPEOF ((ver_struct)->patch, (value));\ if ((init)) {\ (ver_struct)->patch = 0;\ }\ @@ -124,6 +129,7 @@ G_DEFINE_BOXED_TYPE (X2GoClientOpenSSHVersion, x2goclient_openssh_version, &x2go #define CHECK_VER_COMPONENT(ver_struct, idx_var, err) \ do {\ + X2GOCLIENT_CHECK_TYPE (X2GoClientOpenSSHVersion *, (ver_struct));\ _Bool new_err = (err);\ if (0 == (idx_var)) {\ new_err = (!((ver_struct)->major_valid));\ -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 2f9d33067903b9b4f617ba4cf148c4a58abed16a Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Mar 17 21:32:22 2021 +0100 src/x2goclient-openssh-version.h: document error enum. --- src/x2goclient-openssh-version.h | 100 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/src/x2goclient-openssh-version.h b/src/x2goclient-openssh-version.h index 21b23ee..9e21cf2 100644 --- a/src/x2goclient-openssh-version.h +++ b/src/x2goclient-openssh-version.h @@ -52,6 +52,106 @@ void x2goclient_openssh_version_free (X2GoClientOpenSSHVersion * const openssh_v */ #define X2GOCLIENT_OPENSSH_VERSION_ERROR g_quark_from_static_string ("x2goclient-openssh-version") +/** + * X2GoClientOpenSSHVersionErrors: + * @X2GOCLIENT_OPENSSH_VERSION_ERROR_INVALID_STRUCT: no + * X2GoClientOpenSSHVersion + * structure passed. + * @X2GOCLIENT_OPENSSH_VERSION_ERROR_INVALID_VERSION_STRING: no version string + * to extract + * information from + * passed. + * @X2GOCLIENT_OPENSSH_VERSION_ERROR_INVALID_PREAMBLE: version string does not + * begin with "OpenSSH_". + * @X2GOCLIENT_OPENSSH_VERSION_ERROR_NO_MAJOR_SEPARATOR: no dot found + * separating the major + * version number from + * the minor version + * number. + * @X2GOCLIENT_OPENSSH_VERSION_ERROR_NO_MINOR_SEPARATOR: no dot found + * separating the minor + * version number from + * the patch version + * number. + * @X2GOCLIENT_OPENSSH_VERSION_ERROR_NOT_AT_MAJOR_SEPARATOR: version parsing + * stopped after + * major version at + * a non-dot-non, + * non-numeric + * character. + * @X2GOCLIENT_OPENSSH_VERSION_ERROR_NOT_AT_MINOR_SEPARATOR: version parsing + * stopped after + * minor version at + * a non-dot-non, + * non-numeric + * character. + * @X2GOCLIENT_OPENSSH_VERSION_ERROR_MAJOR_NOT_NUMERIC: major version number + * to parse was not + * numeric. + * @X2GOCLIENT_OPENSSH_VERSION_ERROR_MAJOR_UNDERFLOW: major version number to + * parse too small to fit + * into #long long + * type. + * @X2GOCLIENT_OPENSSH_VERSION_ERROR_MAJOR_OVERFLOW: major version number to + * parse too big to fit + * into #long long + * type. + * @X2GOCLIENT_OPENSSH_VERSION_ERROR_MAJOR_TOO_BIG: major version number to + * parse was bigger than + * the maximum 32-bit + * unsigned integer value. + * @X2GOCLIENT_OPENSSH_VERSION_ERROR_MAJOR_NEGATIVE: major version number to + * parse was negative. + * @X2GOCLIENT_OPENSSH_VERSION_ERROR_MINOR_NOT_NUMERIC: minor version number + * to parse was not + * numeric. + * @X2GOCLIENT_OPENSSH_VERSION_ERROR_MINOR_UNDERFLOW: minor version number to + * parse too small to fit + * into #long long + * type. + * @X2GOCLIENT_OPENSSH_VERSION_ERROR_MINOR_OVERFLOW: minor version number to + * parse too big to fit + * into #long long + * type. + * @X2GOCLIENT_OPENSSH_VERSION_ERROR_MINOR_TOO_BIG: minor version number to + * parse was bigger than + * the maximum 32-bit + * unsigned integer value. + * @X2GOCLIENT_OPENSSH_VERSION_ERROR_MINOR_NEGATIVE: minor version number to + * parse was negative. + * @X2GOCLIENT_OPENSSH_VERSION_ERROR_PATCH_NOT_NUMERIC: patch version number + * to parse was not + * numeric. + * @X2GOCLIENT_OPENSSH_VERSION_ERROR_PATCH_UNDERFLOW: patch version number to + * parse too small to fit + * into #long long + * type. + * @X2GOCLIENT_OPENSSH_VERSION_ERROR_PATCH_OVERFLOW: patch version number to + * parse too big to fit + * into #long long + * type. + * @X2GOCLIENT_OPENSSH_VERSION_ERROR_PATCH_TOO_BIG: patch version number to + * parse was bigger than + * the maximum 32-bit + * unsigned integer value. + * @X2GOCLIENT_OPENSSH_VERSION_ERROR_PATCH_NEGATIVE: patch version number to + * parse was negative. + * @X2GOCLIENT_OPENSSH_VERSION_ERROR_OPENSSH_VERSION_NO_STDERR: OpenSSH client + * did not write + * its version + * number to + * stderr. + * @X2GOCLIENT_OPENSSH_VERSION_ERROR_OPENSSH_VERSION_ALLOCATE: buffer for + * OpenSSH version + * structure could + * not be + * allocated. + * + * Error message types as used within X2GoClientOpenSSHVersion. May be passed + * out via #GError instances. + * + * Since: 0.0.5 + */ enum X2GoClientOpenSSHVersionErrors { X2GOCLIENT_OPENSSH_VERSION_ERROR_INVALID_STRUCT = 0, X2GOCLIENT_OPENSSH_VERSION_ERROR_INVALID_VERSION_STRING, -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit c1211652bcef93b25fc52033bcb6adf661ef75c1 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Apr 26 07:25:29 2021 +0200 src/x2goclient-utils.h: add type safety macros X2GOCLIENT_CHECK_TYPE{,_TYPEOF}. These are supposed to check if a variable or storage location has a specific type or matches a reference type. X2GOCLIENT_CHECK_TYPE () checks a variable/storage location against a specific, provided type, while X2GOCLIENT_CHECK_TYPE_TYPEOF () checks if a variable/storage location matches a reference variable/storage location's type. For distinct types, that works pretty well, but aliased and integer-based types are more tricky. For the latter, a size-based approach is taken to make sure that storage sizes of source and destination are equal. Since the typeof () function is not part of the C standard, but often provided as an extension, two versions of X2GOCLIENT_CHECK_TYPE_TYPEOF () are made available: one relying on typeof (), which will also work with rvalues and is more safe (since it will only evaluate its input parameters once), and one that will not work with rvalues and doesn't create explicit sequence points for its arguments, making it unsafe when used with the same location and postfix/prefix operators multiple times. These macros will usually not terminate compilation, but rather generate diagnostic messages. Manual inspection of the compiler's output is necessary. We'll eventually use them to make sure that data we assign is not suddenly reinterpreted or truncated. --- src/x2goclient-utils.h | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/src/x2goclient-utils.h b/src/x2goclient-utils.h index 6ea340b..a4141a0 100644 --- a/src/x2goclient-utils.h +++ b/src/x2goclient-utils.h @@ -49,6 +49,90 @@ G_BEGIN_DECLS #endif /* !defined (__GI_SCANNER__) */ #endif /* !defined (__GTK_DOC_IGNORE__) */ +/** + * X2GOCLIENT_CHECK_TYPE: + * @type: (in) (not optional): target type. + * @var: (in) (not optional): variable to check against @type. + * + * Checks if the type of @var matches @type. + * + * This check relies on function argument magic. + * + * Implicit promotion for integer-based types is attempted to be caught by + * checking the size of @type against the size of @var, which should match. + * + * Note that this check by itself will not automatically reject code with + * mismatching types. Instead, most often, a diagnostic message will be + * printed, which has to be interpreted and fixed by developers. + * + * Since: 0.0.5 + */ +#define X2GOCLIENT_CHECK_TYPE(type, var) \ + do {\ + typedef void (*tmp_type) (const type);\ + tmp_type tmp = (tmp_type)(NULL);\ + typedef char sizes[((sizeof (type) == sizeof (var)) * 2) - 1];\ + if (0) {\ + const sizes tmp2;\ + (void) tmp2;\ + tmp (var);\ + }\ + } while (0) + +#ifdef HAVE_TYPEOF + /** + * CHECK_TYPE_TYPEOF: + * @target: (in) (not optional): target variable, often a struct field. + * @value: (in) (not optional): variable to check against @target. + * + * Checks if the type of @value matches the type of @target. + * + * This check relies on diagnostic messages being printed if two + * incompatible pointers are compared. + * + * This version of the macro uses the <code>typeof</code> compiler feature, + * which should make it relatively safe to use it even with rvalues + * (although the actual benefit of that is doubtful). + * + * Note that this check by itself will not automatically reject code with + * mismatching types. Instead, most often, a diagnostic message will be + * printed, which has to be interpreted and fixed by developers. + * + * Since: 0.0.5 + */ + #define X2GOCLIENT_CHECK_TYPE_TYPEOF(target, value) \ + do {\ + typeof (target) _target = (target);\ + typeof (value) _value = (value);\ + (void)(&(_target) == &(_value));\ + } while (0) +#else + /** + * CHECK_TYPE_TYPEOF: + * @target: (in) (not optional): target variable, often a struct field. + * @value: (in) (not optional): variable to check against @target. + * + * Checks if the type of @value matches the type of @target. + * + * This check relies on diagnostic messages being printed if two + * incompatible pointers are compared. + * + * This version of the macro does not use the <code>typeof</code> compiler + * feature and hence will fail if rvalues are provided for either @target or + * @value. + * + * Note that this check by itself will not automatically reject code with + * mismatching types. Instead, most often, a diagnostic message will be + * printed, which has to be interpreted and fixed by developers. + * + * Since: 0.0.5 + */ + #define X2GOCLIENT_CHECK_TYPE_TYPEOF(target, value) \ + do {\ + (void)(&(target) == &(value));\ + } while (0) +#endif + void x2goclient_clear_strings (gpointer const data); long long x2goclient_str_to_int (const gchar * const restrict str, const _Bool min, const long long limit_min, const _Bool max, const long long limit_max, const gchar ** const restrict end, _Bool * const restrict conv_err, _Bool * const restrict min_err, _Bool * const restrict max_err); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 7d02835364723e8c106d3ca9cdb45c930394b24e Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Mar 20 06:49:12 2021 +0100 src/x2goclient-openssh-version.c: fix warning for assignment-in-if-clause. --- src/x2goclient-openssh-version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x2goclient-openssh-version.c b/src/x2goclient-openssh-version.c index e383e48..fd8b785 100644 --- a/src/x2goclient-openssh-version.c +++ b/src/x2goclient-openssh-version.c @@ -138,7 +138,7 @@ _Bool x2goclient_openssh_version_parse (X2GoClientOpenSSHVersion * const openssh const gchar *newline = NULL; gchar *version_string_work = NULL; - if (newline = g_strstr_len (version_string, -1, "\n")) { + if ((newline = g_strstr_len (version_string, -1, "\n"))) { g_log (NULL, G_LOG_LEVEL_INFO, "Passed version string contains at least one newline, truncating string to first line."); version_string_work = g_strndup (version_string, (newline - version_string)); } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 021444b16ae34b0f8876b4ea06a8bfeb0a930820 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 29 10:13:55 2021 +0200 src/x2goclient-network{.{c,h},-ssh.c}: make connect-func and disconnect-func properties return and set via pointer to pointer to function, move typedefs into header file for global use. Function pointers are special in that they cannot be used as object pointers, since their size might not match sizeof (void*). In order to pass them around, we'll need to store them into a data object first and then pass around a pointer to this data object. --- src/x2goclient-network-ssh.c | 40 ++++++++++----------- src/x2goclient-network.c | 82 +++++++++++++++++++++++++++++++++++++------- src/x2goclient-network.h | 23 +++++++++++-- 3 files changed, 110 insertions(+), 35 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 5f65076..7e7aae0 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -178,16 +178,6 @@ typedef struct sockaddr_ho_ { * An example of a more abstract implementation is #X2GoClientNetwork. */ -/* - * This is a bit unsafe and odd, but we need a function pointer (proto)type - * for later use. - * - * It probably makes sense to keep it as generic as possible, though, to - * improve maintainability. - */ -typedef gboolean (*parent_connect_type) (void * const self, void * const gerr); -typedef gboolean (*parent_disconnect_type) (void * const self, void * const gerr); - /** * X2GoClientNetworkSSH: * @@ -1197,12 +1187,17 @@ gboolean x2goclient_network_ssh_connect (X2GoClientNetworkSSH * const self, GErr (void) parent_class; /* Fetch parent's connect function. */ - parent_connect_type parent_connect = NULL; - g_object_get (G_OBJECT (self), "connect-function", &parent_connect, NULL); - g_assert (parent_connect); + connect_type parent_connect = NULL; + connect_ref_type parent_connect_ref = NULL; + g_object_get (G_OBJECT (self), "connect-function", &parent_connect_ref, NULL); + g_assert (parent_connect_ref); - if (parent_connect) { - ret = parent_connect (parent, gerr); + if (parent_connect_ref) { + parent_connect = *(parent_connect_ref); + + if (parent_connect) { + ret = parent_connect (parent, gerr); + } } return (ret); @@ -1431,12 +1426,17 @@ gboolean x2goclient_network_ssh_disconnect (X2GoClientNetworkSSH * const self, G (void) parent_class; /* Fetch parent's disconnect function. */ - parent_disconnect_type parent_disconnect = NULL; - g_object_get (G_OBJECT (self), "disconnect-function", &parent_disconnect, NULL); - g_assert (parent_disconnect); + disconnect_type parent_disconnect = NULL; + disconnect_ref_type parent_disconnect_ref = NULL; + g_object_get (G_OBJECT (self), "disconnect-function", &parent_disconnect_ref, NULL); + g_assert (parent_disconnect_ref); - if (parent_disconnect) { - ret = parent_disconnect (parent, gerr); + if (parent_disconnect_ref) { + parent_disconnect = *(parent_disconnect_ref); + + if (parent_disconnect) { + ret = parent_disconnect (parent, gerr); + } } return (ret); diff --git a/src/x2goclient-network.c b/src/x2goclient-network.c index d3212f7..164cfc2 100644 --- a/src/x2goclient-network.c +++ b/src/x2goclient-network.c @@ -100,8 +100,8 @@ typedef struct X2GoClientNetworkPrivate_ { X2GoClientNetworkOptions *options; gchar *session_path; /* Will eventually be replaced with a session object, probably. */ gboolean connected; - gboolean (*connect_func) (X2GoClientNetwork * const self, GError ** const gerr); - gboolean (*disconnect_func) (X2GoClientNetwork * const self, GError ** const gerr); + connect_type connect_func; + disconnect_type disconnect_func; } X2GoClientNetworkPrivate; G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (X2GoClientNetwork, x2goclient_network, G_TYPE_OBJECT) @@ -255,33 +255,49 @@ static void x2goclient_network_class_init (X2GoClientNetworkClass * const klass) /** * X2GoClientNetwork:connect-function: * - * This property holds a pointer to the instance's connect function. + * This property holds a pointer to a pointer to the instance's connect + * function. * * It is read-only. * * Use it to fetch the parent's connect function in derived classes. * + * This property transfers ownership of the wrapping pointer - i.e., the + * data returned by it - to the caller, who is responsible for freeing it. + * * Since: 0.0.5 */ - net_obj_properties[X2GO_NET_PROP_CONN_FUNC] = g_param_spec_pointer ("connect-function", _("Pointer to this instance's connect function"), - _("A pointer to the instance's connect function. " - "This is supposed to be immutable."), + net_obj_properties[X2GO_NET_PROP_CONN_FUNC] = g_param_spec_pointer ("connect-function", + _("Pointer to a pointer to this instance's connect function; " + "the ownership of the wrapping pointer is transferred to the caller"), + _("A pointer to a pointer to the instance's connect function. " + "This is supposed to be immutable. " + "The caller is responsible for freeing the wrapping pointer - i.e., " + "the data returned by this property."), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE); /** * X2GoClientNetwork:disconnect-function: * - * This property holds a pointer to the instance's disconnect function. + * This property holds a pointer to a pointer to the instance's disconnect + * function. * * It is read-only. * * Use it to fetch the parent's disconnect function in derived classes. * + * This property transfers ownership of the wrapping pointer - i.e., the + * data returned by it - to the caller, who is responsible for freeing it. + * * Since: 0.0.5 */ - net_obj_properties[X2GO_NET_PROP_DISCONN_FUNC] = g_param_spec_pointer ("disconnect-function", _("Pointer to this instance's disconnect function"), + net_obj_properties[X2GO_NET_PROP_DISCONN_FUNC] = g_param_spec_pointer ("disconnect-function", + _("Pointer to a pointer to this instance's disconnect function; " + "the ownership of the wrapping pointer is transferred to the caller"), _("A pointer to the instance's disconnect function. " - "This is supposed to be immutable."), + "This is supposed to be immutable. " + "The caller is responsible for freeing the wrapping pointer - i.e., " + "the data returned by this property."), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE); g_object_class_install_properties (object_class, X2GO_NET_N_PROPERTIES, net_obj_properties); @@ -437,6 +453,8 @@ static void x2goclient_network_set_property (GObject * const object, guint prop_ X2GoClientNetwork *self = X2GOCLIENT_NETWORK (object); X2GoClientNetworkPrivate *priv = x2goclient_network_get_instance_private (self); + connect_ref_type conn_ref = NULL; + disconnect_ref_type disconn_ref = NULL; switch (prop_id) { case (X2GO_NET_PROP_SOCKET_SPEC): if (priv->socket_spec) { @@ -462,10 +480,30 @@ static void x2goclient_network_set_property (GObject * const object, guint prop_ priv->connected = g_value_get_boolean (value); break; case (X2GO_NET_PROP_CONN_FUNC): - priv->connect_func = g_value_get_pointer (value); + /* Fetch data pointer. */ + conn_ref = g_value_get_pointer (value); + + /* Set function pointer based on this data. */ + priv->connect_func = *(conn_ref); + + /* + * And, importantly, get rid of the data. + * + * Note that this is strictly speaking a + * violation of g_value_get_pointer ()'s + * contract (being transfer_none), but we + * explicitly transfer ownership, so it + * should be fine in this case. + */ + g_free (conn_ref); + conn_ref = NULL; break; case (X2GO_NET_PROP_DISCONN_FUNC): - priv->disconnect_func = g_value_get_pointer (value); + /* Same as for CONN_FUNC. */ + disconn_ref = g_value_get_pointer (value); + priv->disconnect_func = *(disconn_ref); + g_free (disconn_ref); + disconn_ref = NULL; break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, param_spec); @@ -477,6 +515,8 @@ static void x2goclient_network_get_property (GObject * const object, const guint X2GoClientNetwork *self = X2GOCLIENT_NETWORK (object); X2GoClientNetworkPrivate *priv = x2goclient_network_get_instance_private (self); + connect_ref_type conn_ref = NULL; + disconnect_ref_type disconn_ref = NULL; switch (prop_id) { case (X2GO_NET_PROP_SOCKET_SPEC): g_value_set_boxed (value, priv->socket_spec); @@ -494,10 +534,26 @@ static void x2goclient_network_get_property (GObject * const object, const guint g_value_set_boolean (value, priv->connected); break; case (X2GO_NET_PROP_CONN_FUNC): - g_value_set_pointer (value, priv->connect_func); + /* + * Create and pass function pointer as + * data. + */ + conn_ref = g_new0 (connect_type, 1); + *(conn_ref) = priv->connect_func; + g_value_set_pointer (value, conn_ref); + + /* + * Never free conn_ref here! It's the + * caller's responsibility. + */ + conn_ref = NULL; break; case (X2GO_NET_PROP_DISCONN_FUNC): - g_value_set_pointer (value, priv->disconnect_func); + /* Same as for CONN_FUNC. */ + disconn_ref = g_new0 (disconnect_type, 1); + *(disconn_ref) = priv->disconnect_func; + g_value_set_pointer (value, disconn_ref); + disconn_ref = NULL; break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, param_spec); diff --git a/src/x2goclient-network.h b/src/x2goclient-network.h index 54cd44d..2680197 100644 --- a/src/x2goclient-network.h +++ b/src/x2goclient-network.h @@ -52,11 +52,30 @@ struct _X2GoClientNetworkOptionsClass { #define X2GOCLIENT_TYPE_NETWORK (x2goclient_network_get_type ()) G_DECLARE_DERIVABLE_TYPE (X2GoClientNetwork, x2goclient_network, X2GOCLIENT, NETWORK, GObject) +/* + * Function (pointer) prototypes. + * + * We need the reference type because casting function pointers to object + * pointers is illegal in ISO C. This isn't just an oversight in the standard, + * but actually intended to keep developers from shooting themselves in the + * foot. + * + * Function pointers and object pointers are not interchangeable. There are + * platforms on which both have different sizes. + * + * Due to this, the only way to pass them around is through indirection - + * i.e., the address of an object pointer. + */ +typedef gboolean (*connect_type) (X2GoClientNetwork * const self, GError ** const gerr); +typedef connect_type *connect_ref_type; +typedef gboolean (*disconnect_type) (X2GoClientNetwork * const self, GError ** const gerr); +typedef disconnect_type *disconnect_ref_type; + struct _X2GoClientNetworkClass { GObjectClass parent_class; - gboolean (*connect) (X2GoClientNetwork * const self, GError ** const gerr); - gboolean (*disconnect) (X2GoClientNetwork * const self, GError ** const gerr); + connect_type connect; + disconnect_type disconnect; /*< private >*/ GSocketAddress* (*parse_sockspec) (X2GoClientNetwork * const self, const GString * const sockspec); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 8502e1bd2c29c05bba2405a228bac951db6c38ff Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Apr 26 10:10:41 2021 +0200 src/x2goclient-network{.{c,h},-ssh.c}: fix gobject-introspection warnings due to non-namespaced function pointer and reference types. This has two consequences: - it's ugly, because gir treats the function pointer itself as a symbol (hence needing a symbol_prefix), while the function pointer reference type is interpreted as an identifier (hence needing an IdentifierPrefix). - it makes gir generate a faulty .gir file and leads to a build failure. Reported as https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/385 , but until this is resolved, we will have to work around the issue by hiding the reference type from gir. --- src/x2goclient-network-ssh.c | 8 ++++---- src/x2goclient-network.c | 16 ++++++++-------- src/x2goclient-network.h | 19 +++++++++++++------ 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 7e7aae0..c9e1221 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -1187,8 +1187,8 @@ gboolean x2goclient_network_ssh_connect (X2GoClientNetworkSSH * const self, GErr (void) parent_class; /* Fetch parent's connect function. */ - connect_type parent_connect = NULL; - connect_ref_type parent_connect_ref = NULL; + x2goclient_network_connect_type parent_connect = NULL; + X2GoClientNetwork_connect_ref_type parent_connect_ref = NULL; g_object_get (G_OBJECT (self), "connect-function", &parent_connect_ref, NULL); g_assert (parent_connect_ref); @@ -1426,8 +1426,8 @@ gboolean x2goclient_network_ssh_disconnect (X2GoClientNetworkSSH * const self, G (void) parent_class; /* Fetch parent's disconnect function. */ - disconnect_type parent_disconnect = NULL; - disconnect_ref_type parent_disconnect_ref = NULL; + x2goclient_network_disconnect_type parent_disconnect = NULL; + X2GoClientNetwork_disconnect_ref_type parent_disconnect_ref = NULL; g_object_get (G_OBJECT (self), "disconnect-function", &parent_disconnect_ref, NULL); g_assert (parent_disconnect_ref); diff --git a/src/x2goclient-network.c b/src/x2goclient-network.c index 164cfc2..67d1d8a 100644 --- a/src/x2goclient-network.c +++ b/src/x2goclient-network.c @@ -100,8 +100,8 @@ typedef struct X2GoClientNetworkPrivate_ { X2GoClientNetworkOptions *options; gchar *session_path; /* Will eventually be replaced with a session object, probably. */ gboolean connected; - connect_type connect_func; - disconnect_type disconnect_func; + x2goclient_network_connect_type connect_func; + x2goclient_network_disconnect_type disconnect_func; } X2GoClientNetworkPrivate; G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (X2GoClientNetwork, x2goclient_network, G_TYPE_OBJECT) @@ -453,8 +453,8 @@ static void x2goclient_network_set_property (GObject * const object, guint prop_ X2GoClientNetwork *self = X2GOCLIENT_NETWORK (object); X2GoClientNetworkPrivate *priv = x2goclient_network_get_instance_private (self); - connect_ref_type conn_ref = NULL; - disconnect_ref_type disconn_ref = NULL; + X2GoClientNetwork_connect_ref_type conn_ref = NULL; + X2GoClientNetwork_disconnect_ref_type disconn_ref = NULL; switch (prop_id) { case (X2GO_NET_PROP_SOCKET_SPEC): if (priv->socket_spec) { @@ -515,8 +515,8 @@ static void x2goclient_network_get_property (GObject * const object, const guint X2GoClientNetwork *self = X2GOCLIENT_NETWORK (object); X2GoClientNetworkPrivate *priv = x2goclient_network_get_instance_private (self); - connect_ref_type conn_ref = NULL; - disconnect_ref_type disconn_ref = NULL; + X2GoClientNetwork_connect_ref_type conn_ref = NULL; + X2GoClientNetwork_disconnect_ref_type disconn_ref = NULL; switch (prop_id) { case (X2GO_NET_PROP_SOCKET_SPEC): g_value_set_boxed (value, priv->socket_spec); @@ -538,7 +538,7 @@ static void x2goclient_network_get_property (GObject * const object, const guint * Create and pass function pointer as * data. */ - conn_ref = g_new0 (connect_type, 1); + conn_ref = g_new0 (x2goclient_network_connect_type, 1); *(conn_ref) = priv->connect_func; g_value_set_pointer (value, conn_ref); @@ -550,7 +550,7 @@ static void x2goclient_network_get_property (GObject * const object, const guint break; case (X2GO_NET_PROP_DISCONN_FUNC): /* Same as for CONN_FUNC. */ - disconn_ref = g_new0 (disconnect_type, 1); + disconn_ref = g_new0 (x2goclient_network_disconnect_type, 1); *(disconn_ref) = priv->disconnect_func; g_value_set_pointer (value, disconn_ref); disconn_ref = NULL; diff --git a/src/x2goclient-network.h b/src/x2goclient-network.h index 2680197..689d083 100644 --- a/src/x2goclient-network.h +++ b/src/x2goclient-network.h @@ -66,16 +66,23 @@ G_DECLARE_DERIVABLE_TYPE (X2GoClientNetwork, x2goclient_network, X2GOCLIENT, NET * Due to this, the only way to pass them around is through indirection - * i.e., the address of an object pointer. */ -typedef gboolean (*connect_type) (X2GoClientNetwork * const self, GError ** const gerr); -typedef connect_type *connect_ref_type; -typedef gboolean (*disconnect_type) (X2GoClientNetwork * const self, GError ** const gerr); -typedef disconnect_type *disconnect_ref_type; +typedef gboolean (*x2goclient_network_connect_type) (X2GoClientNetwork * const self, GError ** const gerr); +typedef gboolean (*x2goclient_network_disconnect_type) (X2GoClientNetwork * const self, GError ** const gerr); +#ifndef __GI_SCANNER__ +/* + * We have to hide this until + * https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/385 is + * resolved. + */ +typedef x2goclient_network_connect_type *X2GoClientNetwork_connect_ref_type; +typedef x2goclient_network_disconnect_type *X2GoClientNetwork_disconnect_ref_type; +#endif struct _X2GoClientNetworkClass { GObjectClass parent_class; - connect_type connect; - disconnect_type disconnect; + x2goclient_network_connect_type connect; + x2goclient_network_disconnect_type disconnect; /*< private >*/ GSocketAddress* (*parse_sockspec) (X2GoClientNetwork * const self, const GString * const sockspec); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit bfe1058082f1a2cb68e6c32bb759bb5764ba65c8 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Mar 20 06:49:32 2021 +0100 src/x2goclient-openssh-version.c: fix zero-length format string warning. --- src/x2goclient-openssh-version.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/x2goclient-openssh-version.c b/src/x2goclient-openssh-version.c index fd8b785..109184a 100644 --- a/src/x2goclient-openssh-version.c +++ b/src/x2goclient-openssh-version.c @@ -573,7 +573,8 @@ X2GoClientOpenSSHVersion* x2goclient_openssh_version_fetch_openssh_version (GErr * output more readable. */ if (((sizeof (ssh_std_strs) / sizeof (*ssh_std_strs)) - 1) != i) { - g_log (NULL, G_LOG_LEVEL_DEBUG, ""); + /* Also, silence warning about zero-length format. Meh. */ + g_log (NULL, G_LOG_LEVEL_DEBUG, "%s", ""); } } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 83f6ebc74b1cd7e89da74b3ece8dfe2da6342365 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Mar 20 01:31:19 2021 +0100 autoconf.ac: switch to non-deprecated AC_HEADER_STDC macro. No functional change. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 6da9081..7056ce8 100644 --- a/configure.ac +++ b/configure.ac @@ -39,7 +39,7 @@ if test "x$ac_cv_prog_cc_c99" = "xno"; then AC_MSG_ERROR([your C compiler does not support C99]) fi -AC_STDC_HEADERS +AC_HEADER_STDC AC_PROG_LIBTOOL PKG_PROG_PKG_CONFIG -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit cfe067f618c39de132e5ed560d98f29ebfb639cb Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Apr 24 09:12:05 2021 +0200 src/x2goclient-openssh-version.{c,h}: correctly check for the validity of version components. The previous code took a shortcut and checked if the component was positive or zero, but since the backing type is unsigned, this was a tautology. Instead, rework this portion to use bit flags indicating whether each component is valid or not, initialize them correctly (to the invalid state) and only set them to valid if a valid value has been provided. --- src/x2goclient-openssh-version.c | 69 ++++++++++++++++++++++++++-------------- src/x2goclient-openssh-version.h | 3 ++ 2 files changed, 49 insertions(+), 23 deletions(-) diff --git a/src/x2goclient-openssh-version.c b/src/x2goclient-openssh-version.c index 109184a..b2dcf0f 100644 --- a/src/x2goclient-openssh-version.c +++ b/src/x2goclient-openssh-version.c @@ -84,37 +84,59 @@ G_DEFINE_BOXED_TYPE (X2GoClientOpenSSHVersion, x2goclient_openssh_version, &x2go out_var = GENERATE_ERROR (PATCH, error);\ }\ } while (0) -#define SET_VER_COMPONENT(out_struct, idx_var, value) \ + +#define SET_VER_COMPONENT(ver_struct, idx_var, value, init) \ do {\ - if (0 == idx_var) {\ - out_struct->major = value;\ + _Bool valid = TRUE;\ + if ((init)) {\ + valid = FALSE;\ }\ - else if (1 == idx_var) {\ - out_struct->minor = value;\ + if (0 == (idx_var)) {\ + if ((init)) {\ + (ver_struct)->major = 0;\ + }\ + else {\ + (ver_struct)->major = (value);\ + }\ + (ver_struct)->major_valid = valid;\ + }\ + else if (1 == (idx_var)) {\ + if ((init)) {\ + (ver_struct)->minor = 0;\ + }\ + else {\ + (ver_struct)->minor = (value);\ + }\ + (ver_struct)->minor_valid = valid;\ }\ else {\ - out_struct->patch = value;\ + if ((init)) {\ + (ver_struct)->patch = 0;\ + }\ + else {\ + (ver_struct)->patch = (value);\ + }\ + (ver_struct)->patch_valid = valid;\ }\ } while (0) -#define CHECK_VER_COMPONENT(out_struct, idx_var, err) \ + +#define INIT_VER_COMPONENT(ver_struct, idx_var) SET_VER_COMPONENT ((ver_struct), (idx_var), (guint32)(0), TRUE) + +#define CHECK_VER_COMPONENT(ver_struct, idx_var, err) \ do {\ - if (0 == idx_var) {\ - if (0 > out_struct->major) {\ - err = TRUE;\ - break;\ - }\ + _Bool new_err = (err);\ + if (0 == (idx_var)) {\ + new_err = (!((ver_struct)->major_valid));\ }\ - else if (1 == idx_var) {\ - if (0 > out_struct->minor) {\ - err = TRUE;\ - break;\ - }\ + else if (1 == (idx_var)) {\ + new_err = (!((ver_struct)->minor_valid));\ }\ else {\ - if (0 > out_struct->patch) {\ - err = TRUE;\ - break;\ - }\ + new_err = (!((ver_struct)->patch_valid));\ + }\ + if (new_err) {\ + (err) = TRUE;\ + break;\ }\ } while (0) @@ -264,7 +286,7 @@ _Bool x2goclient_openssh_version_parse (X2GoClientOpenSSHVersion * const openssh /* Copy and convert version number. */ gchar *tmp_copy = g_strndup (tmp, (end_search - tmp)); - SET_VER_COMPONENT (struct_work_copy, num_i, -1); + INIT_VER_COMPONENT (struct_work_copy, num_i); _Bool conv_err = TRUE, min_err = TRUE, @@ -306,7 +328,8 @@ _Bool x2goclient_openssh_version_parse (X2GoClientOpenSSHVersion * const openssh g_set_error_literal (gerr, ERROR_QUARK, err_code, err_msg); } else { - SET_VER_COMPONENT (struct_work_copy, num_i, conv); + /* The cast here is safe since we already checked bounds. */ + SET_VER_COMPONENT (struct_work_copy, num_i, (guint32)(conv), FALSE); } } diff --git a/src/x2goclient-openssh-version.h b/src/x2goclient-openssh-version.h index 9e21cf2..1b07d40 100644 --- a/src/x2goclient-openssh-version.h +++ b/src/x2goclient-openssh-version.h @@ -32,6 +32,9 @@ G_BEGIN_DECLS typedef struct X2GoClientOpenSSHVersion_ { + int minor_valid:1; + int major_valid:1; + int patch_valid:1; guint32 major; guint32 minor; guint32 patch; -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit f4dd721fae7c6d91e6d538824da260077f644d1a Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Apr 29 13:19:18 2021 +0200 src/x2goclient-openssh-version.c: document full class. --- src/x2goclient-openssh-version.c | 210 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 210 insertions(+) diff --git a/src/x2goclient-openssh-version.c b/src/x2goclient-openssh-version.c index a2c4c5d..447d60c 100644 --- a/src/x2goclient-openssh-version.c +++ b/src/x2goclient-openssh-version.c @@ -35,6 +35,22 @@ #include "x2goclient-openssh-version.h" #include "x2goclient-utils.h" +/** + * SECTION:X2GoClientOpenSSHVersion + * @short_description: Class encapsulating and parsing OpenSSH client versions + * @stability: Unstable + * @include: libx2goclient/x2goclient-openssh-version.h + * + * #X2GoClientOpenSSHVersion is a class used to handle OpenSSH client + * versions. + * + * It provides a general structure for OpenSSH client versions and the + * necessary functions to parse an OpenSSH client version string as printed by + * the OpenSSH client when calling it with the <option>-V</option> option. + * + * Since: 0.0.5 + */ + X2GoClientOpenSSHVersion* x2goclient_openssh_version_new (void) { return (g_slice_new0 (X2GoClientOpenSSHVersion)); } @@ -56,10 +72,78 @@ static X2GoClientOpenSSHVersion* x2goclient_openssh_version_copy (const X2GoClie G_DEFINE_BOXED_TYPE (X2GoClientOpenSSHVersion, x2goclient_openssh_version, &x2goclient_openssh_version_copy, &x2goclient_openssh_version_free) +/* + * ERROR_QUARK: + * + * Expands into the error quark of this class. + * + * Since: 0.0.5 + */ #define ERROR_QUARK EXPAND(X2GOCLIENT_OPENSSH_VERSION_ERROR) + +/* + * GENERATE_ERROR_: + * @preamble: (in) (not optional): class-common preamble. + * @component: (in) (not optional): component that is being handled, e.g., + * <literal>MAJOR</literal>. + * @error: (in) (not optional): actual error part, e.g., + * <literal>UNDERFLOW</literal>. + * + * Expands to a error macro produced by concatenating the + * three arguments with underscores as separators. + * + * Since: 0.0.5 + */ #define GENERATE_ERROR_(preamble, component, error) preamble ## _ ## component ## _ ## error + +/* + * GENERATE_ERROR: + * @component: (in) (not optional): component that is being handled, e.g., + * <literal>MAJOR</literal>. + * @error: (in) (not optional): actual error part, e.g., + * <literal>UNDERFLOW</literal>. + * + * Wrapper hard-coding the preamble and passing the other arguments to + * GENERATE_ERROR(). + * + * Since: 0.0.5 + */ #define GENERATE_ERROR(component, error) GENERATE_ERROR_ (X2GOCLIENT_OPENSSH_VERSION_ERROR, component, error) + +/* + * GENERATE_ERROR_MSG_: + * @component: (in) (not optional): component that is being handled, e.g., + * <literal>MAJOR</literal>. + * @msg: (in) (not optional): error message. + * + * Generates an error message by stringifying the @component and prepending it + * to the actual error message @msg, set apart by a space. + * + * Since: 0.0.5 + */ #define GENERATE_ERROR_MSG_(component, msg) #component " " msg + +/* + * GENERATE_ERROR_MSG: + * @out_var: (out) (not optional): variable that will hold the generated error + * message. + * @idx_var: (in) (not optional): integer-based variable selecting the + * component. + * @msg: (in) (not optional): actual error message. + * + * Generates an error message and assigns the result to @out_var, which, + * obviously, should better be a string. + * + * The actual component is determined via @idx_var, an integer-based variable + * selecting a specific component. This mapping is currently hard-coded and + * "magical", so make sure that all code parts agree on which value maps to + * what component. + * + * The actual error message is generated by passing the mapped component and + * error message down to GENERATE_ERROR_MSG_(). + * + * Since: 0.0.5 + */ #define GENERATE_ERROR_MSG(out_var, idx_var, msg) \ do {\ X2GOCLIENT_CHECK_TYPE (char *, out_var);\ @@ -73,6 +157,31 @@ G_DEFINE_BOXED_TYPE (X2GoClientOpenSSHVersion, x2goclient_openssh_version, &x2go out_var = GENERATE_ERROR_MSG_ ("Patch", msg);\ }\ } while (0) + +/* + * GENERATE_ERROR_CODE: + * @out_var: (out) (not optional): variable that will hold the generated error + * code/constant. + * @idx_var: (in) (not optional): integer-based variable selecting the + * component. + * @error: (in) (not optional): actual error code/constant. + * + * Generates an error code/constant and assigns the result to @out_var, which, + * obviously, should better be integer-based. + * + * This macro does not check for the validity of @out_var and its + * compatibility to hold an error code/constant. + * + * The actual component is determined via @idx_var, an integer-based variable + * selecting a specific component. This mapping is currently hard-coded and + * "magical", so make sure that all code parts agree on which value maps to + * what component. + * + * The actual error code/constant is generated by passing the mapped component + * and error code/constant down to GENERATE_ERROR(). + * + * Since: 0.0.5 + */ #define GENERATE_ERROR_CODE(out_var, idx_var, error) \ do {\ if (0 == idx_var) {\ @@ -86,6 +195,35 @@ G_DEFINE_BOXED_TYPE (X2GoClientOpenSSHVersion, x2goclient_openssh_version, &x2go }\ } while (0) +/* + * SET_VER_COMPONENT: + * @ver_struct: (out) (not optional): a pointer to the + * #X2GoClientOpenSSHVersion structure to + * modify. + * @idx_var: (in) (not optional): integer-based variable selecting the + * component. + * @value: (in) (not optional): new component value. + * @init: (in) (not optional): boolean value indicating initialization + * + * Updates the selected component on @ver_struct. + * + * If @init is set to %TRUE, @value is ignored and the corresponding component + * is set to <literal>0</literal> and marked as invalid. Otherwise, the + * component is set to @value and marked as valid. + * + * The actual component is determined via @idx_var, an integer-based variable + * selecting a specific component. This mapping is currently hard-coded and + * "magical", so make sure that all code parts agree on which value maps to + * what component. + * + * The type of @ver_struct is checked to make sure it matches what we expect + * using X2GOCLIENT_CHECK_TYPE(). The type of the actual component that is + * going to be updated is checked against the type of the provided value using + * X2GOCLIENT_CHECK_TYPE_TYPEOF(). The caveats described for the other macros + * apply here as well. + * + * Since: 0.0.5 + */ #define SET_VER_COMPONENT(ver_struct, idx_var, value, init) \ do {\ X2GOCLIENT_CHECK_TYPE (X2GoClientOpenSSHVersion *, (ver_struct));\ @@ -125,8 +263,47 @@ G_DEFINE_BOXED_TYPE (X2GoClientOpenSSHVersion, x2goclient_openssh_version, &x2go }\ } while (0) +/* + * INIT_VER_COMPONENT: + * @ver_struct: (out) (not optional): a pointer to the + * #X2GoClientOpenSSHVersion structure to + * modify. + * @idx_var: (in) (not optional): integer-based variable selecting the + * component. + * + * Initializes the selected component on @ver_struct. + * + * This is just a convenience wrapper using SET_VER_COMPONENT(). + * + * Since: 0.0.5 + */ #define INIT_VER_COMPONENT(ver_struct, idx_var) SET_VER_COMPONENT ((ver_struct), (idx_var), (guint32)(0), TRUE) +/* + * CHECK_VER_COMPONENT: + * @ver_struct: (in) (not optional): a pointer to the + * #X2GoClientOpenSSHVersion structure to + * check. + * @idx_var: (in) (not optional): integer-based variable selecting the + * component. + * @err: (out) (not optional): error variable, set if the component is + * invalid. + * + * Checks the selected component on @ver_struct by setting it to @value. + * + * The actual component is determined via @idx_var, an integer-based variable + * selecting a specific component. This mapping is currently hard-coded and + * "magical", so make sure that all code parts agree on which value maps to + * what component. + * + * The type of @ver_struct is checked to make sure it matches what we expect + * using X2GOCLIENT_CHECK_TYPE(). The type of the actual component that is + * going to be updated is checked against the type of the provided value using + * X2GOCLIENT_CHECK_TYPE_TYPEOF(). The caveats described for the other macros + * apply here as well. + * + * Since: 0.0.5 + */ #define CHECK_VER_COMPONENT(ver_struct, idx_var, err) \ do {\ X2GOCLIENT_CHECK_TYPE (X2GoClientOpenSSHVersion *, (ver_struct));\ @@ -146,6 +323,26 @@ G_DEFINE_BOXED_TYPE (X2GoClientOpenSSHVersion, x2goclient_openssh_version, &x2go }\ } while (0) +/** + * x2goclient_openssh_version_parse: + * @openssh_version: (in) (not optional): a pointer to the + * #X2GoClientOpenSSHVersion structure + * to populate. + * @version_string: (in) (not optional): output of ssh -V to parse as a + * string. + * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not + * interested. + * + * Parses the version output given as @version_string and populates the + * version structure passed as @openssh_version with the parsed data on + * success. + * + * On error, doesn't touch @openssh_version. + * + * Returns: a #_Bool value indicating success (%TRUE) or failure (%FALSE). + * + * Since: 0.0.5 + */ _Bool x2goclient_openssh_version_parse (X2GoClientOpenSSHVersion * const openssh_version, const gchar * const version_string, GError ** const gerr) { _Bool ret = FALSE; @@ -397,6 +594,19 @@ _Bool x2goclient_openssh_version_parse (X2GoClientOpenSSHVersion * const openssh return (ret); } +/** + * x2goclient_openssh_version_fetch_openssh_version: + * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not + * interested. + * + * Fetches the OpenSSH version string as returned by "ssh -V" and parses this + * output into an #X2GoClientOpenSSHVersion structure. + * + * Returns: the populated #X2GoClientOpenSSHVersion structure on success or + * %NULL on error. + * + * Since: 0.0.5 + */ X2GoClientOpenSSHVersion* x2goclient_openssh_version_fetch_openssh_version (GError ** const gerr) { X2GoClientOpenSSHVersion *ret = NULL; gboolean cont = FALSE; -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 64ffafde6de0a1604b44909071863083e54a58d1 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Apr 30 12:49:09 2021 +0200 src/test/sshtest.c: run all tests twice - with concrete implementation and super class semantics. This should test if all functions work well and can be used interchangeably - which should be the case. --- src/test/sshtest.c | 58 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 44 insertions(+), 14 deletions(-) diff --git a/src/test/sshtest.c b/src/test/sshtest.c index b1c827e..93c9444 100644 --- a/src/test/sshtest.c +++ b/src/test/sshtest.c @@ -202,13 +202,18 @@ static _Bool test_x2goclient_network_ssh_set_conn_ret (X2GoClientNetworkSSH *net return (ret); } -static _Bool test_x2goclient_network_ssh_connect_after_connect (X2GoClientNetworkSSH *net_ssh, const gboolean conn_ret) { +static _Bool test_x2goclient_network_ssh_connect_after_connect (X2GoClientNetworkSSH *net_ssh, const gboolean conn_ret, const _Bool use_super) { _Bool ret = TRUE; /* Connect again, shouldn't cause anything to change. */ gboolean conn_ret_new = FALSE; g_printf ("Trying to connect again...\n"); - conn_ret_new = x2goclient_network_ssh_connect (net_ssh, NULL); + if (use_super) { + conn_ret_new = x2goclient_network_connect ((X2GoClientNetwork*) (net_ssh), NULL); + } + else { + conn_ret_new = x2goclient_network_ssh_connect (net_ssh, NULL); + } g_printf ("Connection status: %s.\n", x2goclient_bool_to_str (conn_ret_new)); ret &= (conn_ret == conn_ret_new); @@ -220,13 +225,18 @@ static _Bool test_x2goclient_network_ssh_connect_after_connect (X2GoClientNetwor return (ret); } -static _Bool test_x2goclient_network_ssh_connect (X2GoClientNetworkSSH *net_ssh, gboolean * const conn_ret) { +static _Bool test_x2goclient_network_ssh_connect (X2GoClientNetworkSSH *net_ssh, gboolean * const conn_ret, const _Bool use_super) { _Bool ret = (!(!(conn_ret))); if (ret) { /* Actually connect. */ g_printf ("Trying to connect...\n"); - (*conn_ret) = x2goclient_network_ssh_connect (net_ssh, NULL); + if (use_super) { + (*conn_ret) = x2goclient_network_connect ((X2GoClientNetwork*) (net_ssh), NULL); + } + else { + (*conn_ret) = x2goclient_network_ssh_connect (net_ssh, NULL); + } g_printf ("Connection status: %s.\n", x2goclient_bool_to_str (*conn_ret)); } @@ -244,12 +254,18 @@ static _Bool test_x2goclient_network_ssh_connect (X2GoClientNetworkSSH *net_ssh, return (ret); } -static _Bool test_x2goclient_network_ssh_disconnect (X2GoClientNetworkSSH *net_ssh) { +static _Bool test_x2goclient_network_ssh_disconnect (X2GoClientNetworkSSH *net_ssh, const _Bool use_super) { _Bool ret = TRUE; /* Actually disconnect. */ g_printf ("Trying to disconnect...\n"); - gboolean disconn_ret = x2goclient_network_ssh_disconnect (net_ssh, NULL); + gboolean disconn_ret = FALSE; + if (use_super) { + disconn_ret = x2goclient_network_disconnect ((X2GoClientNetwork*) (net_ssh), NULL); + } + else { + disconn_ret = x2goclient_network_ssh_disconnect (net_ssh, NULL); + } g_printf ("Disconnection status: %s.\n", x2goclient_bool_to_str (disconn_ret)); ret &= disconn_ret; @@ -266,9 +282,18 @@ static _Bool test_x2goclient_network_ssh_disconnect (X2GoClientNetworkSSH *net_s return (ret); } -static _Bool test_x2goclient_network_ssh (const GString * const ssh_uri) { +static _Bool test_x2goclient_network_ssh (const GString * const ssh_uri, const _Bool use_super) { _Bool ret = TRUE; + g_printf ("Testing X2GoClientNetworkSSH with "); + if (use_super) { + g_printf ("super class (X2GoClientNetwork)"); + } + else { + g_printf ("actual class"); + } + g_printf (" interactions.\n"); + /* Create object. */ X2GoClientNetworkSSH *net_ssh = x2goclient_network_ssh_new (NULL); @@ -296,11 +321,11 @@ static _Bool test_x2goclient_network_ssh (const GString * const ssh_uri) { gboolean conn_ret = FALSE; if (ret) { - ret &= test_x2goclient_network_ssh_connect (net_ssh, &conn_ret); + ret &= test_x2goclient_network_ssh_connect (net_ssh, &conn_ret, use_super); } if (ret) { - ret &= test_x2goclient_network_ssh_connect_after_connect (net_ssh, conn_ret); + ret &= test_x2goclient_network_ssh_connect_after_connect (net_ssh, conn_ret, use_super); } if (ret) { @@ -309,7 +334,7 @@ static _Bool test_x2goclient_network_ssh (const GString * const ssh_uri) { } if (ret) { - ret &= test_x2goclient_network_ssh_disconnect (net_ssh); + ret &= test_x2goclient_network_ssh_disconnect (net_ssh, use_super); } if (ret) { @@ -317,7 +342,7 @@ static _Bool test_x2goclient_network_ssh (const GString * const ssh_uri) { * Connect again, checking whether a connect-disconnect-connect cycle works * correctly. */ - ret &= test_x2goclient_network_ssh_connect (net_ssh, &conn_ret); + ret &= test_x2goclient_network_ssh_connect (net_ssh, &conn_ret, use_super); } if (ret) { @@ -353,9 +378,14 @@ int main (const int argc, const char * const * const argv) { /* Initialize ret to failure. */ ret = EXIT_FAILURE; - if (test_x2goclient_network_ssh (ssh_uri)) { - /* We'll only not fail if all tests succeded. */ - ret = EXIT_SUCCESS; + + /* First, do the test with concrete classes. */ + if (test_x2goclient_network_ssh (ssh_uri, FALSE)) { + /* Then, with super classes. */ + if (test_x2goclient_network_ssh (ssh_uri, TRUE)) { + /* We'll only not fail if all tests succeeded. */ + ret = EXIT_SUCCESS; + } } } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 7554b5e4714393ad9e10e28e53d94f7cb531c6a3 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Mar 20 01:31:42 2021 +0100 autoconf.ac: use AC_C_TYPEOF macro for typeof support/detection. --- configure.ac | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.ac b/configure.ac index 7056ce8..3cab1c7 100644 --- a/configure.ac +++ b/configure.ac @@ -39,6 +39,8 @@ if test "x$ac_cv_prog_cc_c99" = "xno"; then AC_MSG_ERROR([your C compiler does not support C99]) fi +AC_C_TYPEOF + AC_HEADER_STDC AC_PROG_LIBTOOL PKG_PROG_PKG_CONFIG -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 5b0580d1e9375e863532213ed73ce2d42c6f7209 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Apr 29 14:16:45 2021 +0200 src/x2goclient-utils.c: document all functions. --- src/x2goclient-utils.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/x2goclient-utils.c b/src/x2goclient-utils.c index 456dc41..5113c66 100644 --- a/src/x2goclient-utils.c +++ b/src/x2goclient-utils.c @@ -31,6 +31,14 @@ #include "x2goclient-utils.h" +/** + * x2goclient_clear_strings: + * @data: (in) (nullable): input string + * + * Frees the string passed as @data. It's safe to pass %NULL. + * + * Since: 0.0.5 + */ void x2goclient_clear_strings (gpointer data) { g_free (data); } @@ -100,6 +108,8 @@ void x2goclient_clear_strings (gpointer data) { * use or rely on it. * * Returns: the converted value as a #long long, unless an error occurred + * + * Since: 0.0.5 */ long long x2goclient_str_to_int (const gchar * const restrict str, const _Bool min, const long long limit_min, const _Bool max, const long long limit_max, const gchar ** const restrict end, _Bool * const restrict conv_err, _Bool * const restrict min_err, _Bool * const restrict max_err) { long long ret = 42; @@ -192,6 +202,8 @@ long long x2goclient_str_to_int (const gchar * const restrict str, const _Bool m * of @needle or the value pointed to by @haystack (i.e., the * original string) if @needle was not found, unless an error * occurred + * + * Since: 0.0.5 */ gchar* x2goclient_strbrk_dup (gchar * restrict * const haystack, const char needle, const _Bool free_orig, gsize * const new_size) { gchar *ret = NULL; @@ -237,6 +249,8 @@ gchar* x2goclient_strbrk_dup (gchar * restrict * const haystack, const char need * Takes a boolean and converts it to a (static) string. * * Returns: (transfer none): the converted value as a string + * + * Since: 0.0.5 */ gchar* x2goclient_bool_to_str (const gboolean in) { gchar *ret = "false"; -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 1dffde5ca34c0abcfc222cf676f2f3c1f83696e0 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Mar 20 06:46:15 2021 +0100 src/x2goclient-network-ssh.c: move (dis-)connect pointer types around. No actual code change. --- src/x2goclient-network-ssh.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index b057124..5fe7d02 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -79,18 +79,6 @@ struct _X2GoClientNetworkOptionsSSH { G_DEFINE_TYPE (X2GoClientNetworkOptionsSSH, x2goclient_network_options_ssh, X2GOCLIENT_TYPE_NETWORK_OPTIONS); - -/* - * This is a bit unsafe and odd, but we need a function pointer (proto)type - * for later use. - * - * It probably makes sense to keep it as generic as possible, though, to - * improve maintainability. - */ -typedef gboolean (*parent_connect_type) (void * const self, void * const gerr); -typedef gboolean (*parent_disconnect_type) (void * const self, void * const gerr); - - static void x2goclient_network_options_ssh_class_init (X2GoClientNetworkOptionsSSHClass * const klass) { } @@ -190,6 +178,16 @@ typedef struct sockaddr_ho_ { * An example of a more abstract implementation is #X2GoClientNetwork. */ +/* + * This is a bit unsafe and odd, but we need a function pointer (proto)type + * for later use. + * + * It probably makes sense to keep it as generic as possible, though, to + * improve maintainability. + */ +typedef gboolean (*parent_connect_type) (void * const self, void * const gerr); +typedef gboolean (*parent_disconnect_type) (void * const self, void * const gerr); + /** * X2GoClientNetworkSSH: * -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 30c078c2a699723ab2386d03981aebdb3611d36a Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Apr 30 13:35:06 2021 +0200 docs/reference/libx2goclient/Makefile.am: basic adaptation to project. --- docs/reference/libx2goclient/Makefile.am | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/reference/libx2goclient/Makefile.am b/docs/reference/libx2goclient/Makefile.am index 1c0d907..90b4df0 100644 --- a/docs/reference/libx2goclient/Makefile.am +++ b/docs/reference/libx2goclient/Makefile.am @@ -2,6 +2,7 @@ # # Makefile.am - template makefile for gtk-doc module # Copyright (C) 2007-2017 Stefan Sauer +# Copyright (C) 2021 Mihai Moldovan # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -30,7 +31,7 @@ # of using the various options. # The name of the module, e.g. 'glib'. -DOC_MODULE= +DOC_MODULE=libx2goclient # Uncomment for versioned docs and specify the version of the module, e.g. '2'. #DOC_MODULE_VERSION=2 @@ -42,7 +43,7 @@ DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml # gtk-doc will search all .c and .h files beneath these paths # for inline comments documenting functions and macros. # e.g. DOC_SOURCE_DIR=$(top_srcdir)/gtk $(top_srcdir)/gdk -DOC_SOURCE_DIR= +DOC_SOURCE_DIR=$(top_srcdir)/src # Extra options to pass to gtkdoc-scangobj. Normally not needed. SCANGOBJ_OPTIONS= @@ -65,8 +66,8 @@ FIXXREF_OPTIONS= # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c -HFILE_GLOB= -CFILE_GLOB= +HFILE_GLOB=$(top_srcdir)/src/*.h +CFILE_GLOB=$(top_srcdir)/src/*.c # Extra header to include when scanning, which are not under DOC_SOURCE_DIR # e.g. EXTRA_HFILES=$(top_srcdir}/contrib/extra.h -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit bbb62e1bf3bdb5125a27a87b93c73119f233921d Author: Mihai Moldovan <ionic@ionic.de> Date: Thu May 27 01:18:12 2021 +0200 Makefile.am: package gtk-doc.make during dist target. --- Makefile.am | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile.am b/Makefile.am index ab70d37..5b84af4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,6 +4,10 @@ SUBDIRS = src po docs ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} +EXTRA_DIST = \ + gtk-doc.make \ + $(NULL) + DISTCHECK_CONFIGURE_FLAGS = \ --disable-silent-rules \ --enable-introspection \ -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit fd18ecfd9d384c872b3a1befe3d62309a5ec475b Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Apr 30 14:10:30 2021 +0200 configure.ac: whitespace only. --- configure.ac | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/configure.ac b/configure.ac index bd3237c..4fa5980 100644 --- a/configure.ac +++ b/configure.ac @@ -104,20 +104,20 @@ echo " ${P} ${P//?/=} - prefix: ${prefix} - exec_prefix: ${exec_prefix} - libdir: ${libdir} - bindir: ${bindir} - sbindir: ${sbindir} - sysconfdir: ${sysconfdir} - localstatedir: ${localstatedir} - datadir: ${datadir} - source code location: ${srcdir} - compiler: ${CC} - cflags: ${CFLAGS} - Use *_DISABLE_DEPRECATED: ${enable_deprecation_flags} - - Build introspection support: ${found_introspection} + prefix: ${prefix} + exec_prefix: ${exec_prefix} + libdir: ${libdir} + bindir: ${bindir} + sbindir: ${sbindir} + sysconfdir: ${sysconfdir} + localstatedir: ${localstatedir} + datadir: ${datadir} + source code location: ${srcdir} + compiler: ${CC} + cflags: ${CFLAGS} + Use *_DISABLE_DEPRECATED: ${enable_deprecation_flags} + + Build introspection support: ${found_introspection} Enable gtk-doc support: ${enable_gtk_doc} Generate HTML documentation: ${enable_gtk_doc_html} -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 71f70509b998d36d69ec96fc13769a080afb4640 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat May 29 06:50:53 2021 +0200 {configure.ac,debian/{copyright,libx2goclient-dev.install},src/{,Makefile.am}}: rename x2goclient.pc.in to libx2goclient.pc.in. That name is much more appropriate. --- configure.ac | 2 +- debian/copyright | 2 +- debian/libx2goclient-dev.install | 2 +- src/Makefile.am | 2 +- src/{x2goclient.pc.in => libx2goclient.pc.in} | 0 5 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 00c36a6..44b23f6 100644 --- a/configure.ac +++ b/configure.ac @@ -184,9 +184,9 @@ GTK_DOC_CHECK([1.14], [--flavour no-tmpl]) AC_CONFIG_FILES([ Makefile po/Makefile.in +src/libx2goclient.pc src/Makefile src/test/Makefile -src/x2goclient.pc docs/Makefile docs/reference/Makefile docs/reference/libx2goclient/Makefile diff --git a/debian/copyright b/debian/copyright index aedaa07..7fa0cd6 100644 --- a/debian/copyright +++ b/debian/copyright @@ -10,8 +10,8 @@ Files: ChangeLog po/LINGUAS po/Makefile.in.in po/POTFILES.in + src/libx2goclient.pc.in src/Makefile.am - src/x2goclient.pc.in Copyright: 2019-2020, Mike Gabriel <mike.gabriel@das-netzwerkteam.de> 2019-2020, Mihai Moldovan <ionic@ionic.de> License: GPL-2+ diff --git a/debian/libx2goclient-dev.install b/debian/libx2goclient-dev.install index 3610e17..8c7266a 100644 --- a/debian/libx2goclient-dev.install +++ b/debian/libx2goclient-dev.install @@ -1,5 +1,5 @@ usr/include -usr/lib/*/pkgconfig/x2goclient.pc +usr/lib/*/pkgconfig/libx2goclient.pc usr/lib/*/libx2goclient.a usr/lib/*/libx2goclient.so usr/share/gir-1.0/ diff --git a/src/Makefile.am b/src/Makefile.am index 093183e..6bec2a7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -73,7 +73,7 @@ libx2goclient_@LIBX2GOCLIENT_MAJOR_VERSION@_0_la_LDFLAGS = \ $(NULL) -pkgconfig_DATA = x2goclient.pc +pkgconfig_DATA = libx2goclient.pc pkgconfigdir = $(libdir)/pkgconfig -include $(INTROSPECTION_MAKEFILE) diff --git a/src/x2goclient.pc.in b/src/libx2goclient.pc.in similarity index 100% rename from src/x2goclient.pc.in rename to src/libx2goclient.pc.in -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 479920484666a2af2e1997f62770e6d3d604413f Author: Mihai Moldovan <ionic@ionic.de> Date: Thu May 27 06:24:01 2021 +0200 src/test/Makefile.am: use new, versioned libx2goclient library name. --- src/test/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/Makefile.am b/src/test/Makefile.am index 8240b15..d059e04 100644 --- a/src/test/Makefile.am +++ b/src/test/Makefile.am @@ -15,5 +15,5 @@ sshtest_CFLAGS = \ $(NULL) sshtest_LDADD = \ - ../libx2goclient.la \ + ../libx2goclient-@LIBX2GOCLIENT_MAJOR_VERSION@.0.la \ $(NULL) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit e012ded80b1f671c0fabd03f85cae99086f695f0 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu May 27 01:34:26 2021 +0200 .gitignore: add/ignore gtk-doc build-time files. --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 0e96fc0..2fd7c75 100644 --- a/.gitignore +++ b/.gitignore @@ -59,6 +59,10 @@ po/*.gmo *.gir *.typelib +# gtk-doc stuff. +gtk-doc.make +m4/gtk-doc.m4 + # Generated binaries. src/test/sshtest -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 50cfbc8fa4d458decc4ccdd644a25364d79ec4fc Author: Mihai Moldovan <ionic@ionic.de> Date: Sat May 29 05:57:17 2021 +0200 configure.ac: rework library versioning system. Further investigation revealed that glib's library versioning system really isn't as good as I initially thought and, additionally, it was changed later on when switching from autotools to meson. The actual rationale has been given in the long comment already, but here comes a more in-depth explanation: libtool explicitly mentions that coupling package version and libtool version numbers is a mistake. The libtool version triplet should be updated according to specific rules, which do not match a steadily increasing package version number. For instance, if the actual interface didn't change at all, only the revision is to be increased, but within the glib scheme, current would also be increased regardless. A better inspiration for handling this is the libnl project, which correctly decouples both version structures and copies a bit of documentation from libtool explaining the updating rules. We'll follow the same path, which is a bit less convenient, since it requires to update the libtool version triplet manually, but more correct. --- configure.ac | 103 +++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 61 insertions(+), 42 deletions(-) diff --git a/configure.ac b/configure.ac index eae65e3..00c36a6 100644 --- a/configure.ac +++ b/configure.ac @@ -1,51 +1,78 @@ AC_PREREQ([2.64]) -# We'll mostly adopt the glib versioning scheme here, because it generally -# makes sense. -# In contrast to glib's scheme, we'll not differentiate between stable and -# unstable versions, though. +# Originally, I thought about using the old glib versioning scheme here, which +# was used with the previous autotools setup. + +# However, while this scheme is convenient to use, because it updates the +# libtool version triplet automatically based upon the package version, it's +# not actually semantically correct, since the libtool version triplet update +# rules are complicated and tied to the actual changes in the interface. + +# Thus, we'll go for a scheme in which package and libtool versions are +# completely decoupled. There are other projects doing the same thing, and the +# project that I'd like to highlight as an inspiration for this is libnl. + +# Regarding the libtool version triplet, the following information is copied +# from libtool's documentation: +# +# libtool library versions are described by three integers: +# - current: The most recent interface number that this library implements. +# - revision: The implementation number of the current interface. +# - age: The difference between the newest and oldest interfaces that this +# library implements. In other words, the library implements all the +# interface numbers in the range from number current - age to +# current. +# If two libraries have identical current and age numbers, then the dynamic +# linker chooses the library with the greater revision number. # -# Making releases: -# either -# libx2goclient_minor_version += 1; -# libx2goclient_micro_version = 0; -# libx2goclient_interface_age += 1; -# or -# libx2goclient_micro_version += 1; -# libx2goclient_interface_age += 1; -# libx2goclient_binary_age += 1; -# if any functions have been added, set libx2goclient_interface_age to 0. -# if backwards compatibility has been broken, -# set libx2goclient_binary_age _and_ libx2goclient_interface_age to 0, while -# increasing libx2goclient_major_version and resetting -# libx2goclient_minor_version and libx2goclient_micro_version to 0. +# If either revision or age are omitted, they default to 0. Also note that age +# must be less than or equal to the current interface number. # -# remember to add a LIBX2GOCLIENT_VERSION_xxx macro every time the minor -# version is bumped, as well as the LIBX2GOCLIENT_DEPRECATED_IN and -# LIBX2GOCLIENT_AVAILABLE_IN macros for that version - see FIXMEversion.h for -# further information. +# Here are a set of rules to help you update your library version information: +# (1) Start with version information of '0:0:0' for each libtool library. +# (2) Update the version information only immediately before a public +# release of your software. More frequent updates are unnecessary, and +# only guarantee that the current interface number gets larger faster. +# (3) If the library source code has changed at all since the last update, +# then increment revision ('c:r:a' becomes 'c:r+1:a'). +# (4) If any interfaces have been added, removed, or changed since the last +# update, increment current, and set revision to 0. +# (5) If any interfaces have been added since the last public release, then +# increment age. +# (6) If any interfaces have been removed or changed since the last public +# release, then set age to 0. # -# in easier to understand terms: +# The following explanation may help to understand the above rules a bit +# better: consider that there are three possible kinds of reactions from users +# of your library to changes in a shared library: # -# <mclasen> on the stable branch, interface age == micro -# [for libx2goclient] on minor releases, reset -# interface age = micro version = 0 +# (1) Programs using the previous version may use the new version as drop-in +# replacement, and programs using the new version can also work with the +# previous one. In other words, no recompiling nor relinking is needed. +# In this case, bump revision only, don’t touch current nor age. +# (2) Programs using the previous version may use the new version as drop-in +# replacement, but programs using the new version may use APIs not +# present in the previous one. In other words, a program linking against +# the new version may fail with "unresolved symbols" if linking against +# the old version at runtime: set revision to 0, bump current and age. +# (3) Programs may need to be changed, recompiled, and relinked in order to +# use the new version. Bump current, set revision and age to 0. m4_define([libx2goclient_major_version], [0]) m4_define([libx2goclient_minor_version], [0]) m4_define([libx2goclient_micro_version], [0]) -m4_define([libx2goclient_interface_age], [0]) -m4_define([libx2goclient_binary_age], - [m4_eval(100 * libx2goclient_minor_version + libx2goclient_micro_version)]) m4_define([libx2goclient_version], [libx2goclient_major_version.libx2goclient_minor_version.libx2goclient_micro_version]) -# libtool version related macros +# Libtool version related macros. +# See above for an explanation of how to handle these values. +# Note that we won't use libx2goclient_lt_release at all, since it makes any +# new release binary incompatible to previous ones, but we'll keep it for +# reference. m4_define([libx2goclient_lt_release], [libx2goclient_major_version.libx2goclient_minor_version]) -m4_define([libx2goclient_lt_current], - [m4_eval(100 * libx2goclient_minor_version + libx2goclient_micro_version - libx2goclient_interface_age)]) -m4_define([libx2goclient_lt_revision], [libx2goclient_interface_age]) -m4_define([libx2goclient_lt_age], [m4_eval(libx2goclient_binary_age - libx2goclient_interface_age)]) +m4_define([libx2goclient_lt_current], [0]) +m4_define([libx2goclient_lt_revision], [0]) +m4_define([libx2goclient_lt_age], [0]) m4_define([libx2goclient_lt_current_minus_age], [m4_eval(libx2goclient_lt_current - libx2goclient_lt_age)]) @@ -74,16 +101,12 @@ AC_SUBST(ACLOCAL_AMFLAGS, "\${ACLOCAL_FLAGS}") LIBX2GOCLIENT_MAJOR_VERSION=libx2goclient_major_version LIBX2GOCLIENT_MINOR_VERSION=libx2goclient_minor_version LIBX2GOCLIENT_MICRO_VERSION=libx2goclient_micro_version -LIBX2GOCLIENT_INTERFACE_AGE=libx2goclient_interface_age -LIBX2GOCLIENT_BINARY_AGE=libx2goclient_binary_age LIBX2GOCLIENT_VERSION=libx2goclient_version AC_SUBST(LIBX2GOCLIENT_MAJOR_VERSION) AC_SUBST(LIBX2GOCLIENT_MINOR_VERSION) AC_SUBST(LIBX2GOCLIENT_MICRO_VERSION) AC_SUBST(LIBX2GOCLIENT_VERSION) -AC_SUBST(LIBX2GOCLIENT_INTERFACE_AGE) -AC_SUBST(LIBX2GOCLIENT_BINARY_AGE) AC_DEFINE(LIBX2GOCLIENT_MAJOR_VERSION, [libx2goclient_major_version], [Define to the major libx2goclient version]) @@ -91,10 +114,6 @@ AC_DEFINE(LIBX2GOCLIENT_MINOR_VERSION, [libx2goclient_minor_version], [Define to the minor libx2goclient version]) AC_DEFINE(LIBX2GOCLIENT_MICRO_VERSION, [libx2goclient_micro_version], [Define to the micro libx2goclient version]) -AC_DEFINE(LIBX2GOCLIENT_INTERFACE_AGE, [libx2goclient_interface_age], - [Define to the libx2goclient interface age]) -AC_DEFINE(LIBX2GOCLIENT_BINARY_AGE, [libx2goclient_binary_age], - [Define to the libx2goclient binary age]) # libtool versioning LT_RELEASE=libx2goclient_lt_release -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 9f2e8a949c97669e984804bdc3001cc405f2606b Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Apr 30 13:36:43 2021 +0200 /: add autogen.sh - useful for regenerating configure. --- autogen.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..892d0b0 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +set -e + +gtkdocize +autoreconf -fvi -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 5a4d670dab270d048ad271022b9c0b1a90a29f56 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Apr 30 13:07:13 2021 +0200 configure.ac: add gtk-doc integration. --- configure.ac | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/configure.ac b/configure.ac index 3cab1c7..bd3237c 100644 --- a/configure.ac +++ b/configure.ac @@ -74,12 +74,23 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", AC_SUBST(GETTEXT_PACKAGE) AM_GLIB_GNU_GETTEXT +dnl gtk-doc support. +dnl Make sure that "GTK_DOC_CHECK" appears at the very start of a line - +dnl I don't like this, but gtkdocize requires it. +m4_ifdef([GTK_DOC_CHECK], + [ +GTK_DOC_CHECK([1.14], [--flavour no-tmpl]) + ], + [AM_CONDITIONAL([ENABLE_GTK_DOC], false)]) + AC_CONFIG_FILES([ Makefile po/Makefile.in src/Makefile src/test/Makefile src/x2goclient.pc +docs/reference/libx2goclient/Makefile +docs/reference/libx2goclient/version.xml ]) AC_OUTPUT @@ -107,4 +118,8 @@ ${P//?/=} Use *_DISABLE_DEPRECATED: ${enable_deprecation_flags} Build introspection support: ${found_introspection} + + Enable gtk-doc support: ${enable_gtk_doc} + Generate HTML documentation: ${enable_gtk_doc_html} + Generate PDF documentation: ${enable_gtk_doc_pdf} " -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 2f95b991d9722380bb82294129280742c336a7ef Author: Mihai Moldovan <ionic@ionic.de> Date: Sat May 29 06:43:26 2021 +0200 src/x2goclient.pc.in: rework, add @LIBINTL@ for gettext/libintl linkage. --- src/x2goclient.pc.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/x2goclient.pc.in b/src/x2goclient.pc.in index 7bf759b..6826e3d 100644 --- a/src/x2goclient.pc.in +++ b/src/x2goclient.pc.in @@ -4,9 +4,9 @@ libdir=@libdir@ bindir=@bindir@ includedir=@includedir@ -Cflags: -I${includedir}/x2goclient -Libs: -lx2goclient - Name: libx2goclient Description: X2Go Client Shared Library Version: @VERSION@ +Libs: @LIBINTL@ -L${libdir} -lx2goclient +Libs.private: @LIBINTL@ +Cflags: -I${includedir}/x2goclient -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit fd1336380fb6234501890ad4a105287f82d6c789 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu May 27 01:29:37 2021 +0200 configure.ac: auto-generate Makefiles for gtk-doc generation. --- configure.ac | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.ac b/configure.ac index 4fa5980..92e6351 100644 --- a/configure.ac +++ b/configure.ac @@ -89,6 +89,8 @@ po/Makefile.in src/Makefile src/test/Makefile src/x2goclient.pc +docs/Makefile +docs/reference/Makefile docs/reference/libx2goclient/Makefile docs/reference/libx2goclient/version.xml ]) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 1b10b40b9cc9b06148b528cfb3b3282b2f39d4f1 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu May 27 01:17:06 2021 +0200 Makefile.am: recurse into docs sub-directory. --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index aef536d..ab70d37 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ NULL = -SUBDIRS = src po +SUBDIRS = src po docs ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 006250aeff41878c0348f04a7e9374415010b9d0 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu May 27 05:41:39 2021 +0200 src/Makefile.am: rework versioning for shared library and gobject-introspection data. --- src/Makefile.am | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 794af5f..093183e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -9,13 +9,20 @@ LDADD = \ @LTLIBINTL@ \ $(NULL) -lib_LTLIBRARIES = libx2goclient.la +lib_LTLIBRARIES = libx2goclient-@LIBX2GOCLIENT_MAJOR_VERSION@.0.la CLEANFILES = DISTCLEANFILES = EXTRA_DIST = BUILT_SOURCES = +# We'll probably want to have Windows support at some point, so keep that +# around. +#if PLATFORM_WIN32 +#no_undefined = -no-undefined +no_undefined = +#endif + libx2goclientincludedir = $(includedir)/x2goclient libx2goclientinclude_HEADERS = \ x2goclient-agent-start-kdrive.h \ @@ -35,7 +42,7 @@ libx2goclientinclude_HEADERS = \ x2goclient-utils.h \ $(NULL) -libx2goclient_la_SOURCES = \ +libx2goclient_@LIBX2GOCLIENT_MAJOR_VERSION@_0_la_SOURCES = \ x2goclient-agent-start-kdrive.c \ x2goclient-agent-start-nx.c \ x2goclient-network.c \ @@ -52,19 +59,25 @@ libx2goclient_la_SOURCES = \ x2goclient-utils.c \ $(NULL) -libx2goclient_la_CFLAGS = \ +libx2goclient_@LIBX2GOCLIENT_MAJOR_VERSION@_0_la_CFLAGS = \ $(LIBX2GOCLIENT_CFLAGS) \ $(NULL) -libx2goclient_la_LIBADD = \ +libx2goclient_@LIBX2GOCLIENT_MAJOR_VERSION@_0_la_LIBADD = \ $(LIBX2GOCLIENT_LIBS) \ $(NULL) +libx2goclient_@LIBX2GOCLIENT_MAJOR_VERSION@_0_la_LDFLAGS = \ + -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ + -export-dynamic $(no_undefined) \ + $(NULL) + + pkgconfig_DATA = x2goclient.pc pkgconfigdir = $(libdir)/pkgconfig -include $(INTROSPECTION_MAKEFILE) -INTROSPECTION_GIRS = X2GoClient-1.0.gir +INTROSPECTION_GIRS = X2GoClient-@LIBX2GOCLIENT_MAJOR_VERSION@.0.gir INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) --warn-all INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) @@ -74,12 +87,12 @@ introspection_sources = \ $(libx2goclient_la_SOURCES) \ $(NULL) -X2GoClient-1.0.gir: libx2goclient.la -X2GoClient_1_0_gir_INCLUDES = GObject-2.0 GLib-2.0 Gio-2.0 -X2GoClient_1_0_gir_CFLAGS = $(libx2goclient_la_CFLAGS) -I$(srcdir) -X2GoClient_1_0_gir_LIBS = libx2goclient.la -X2GoClient_1_0_gir_FILES = $(introspection_sources) -X2GoClient_1_0_gir_SCANNERFLAGS = --symbol-prefix="x2goclient" +X2GoClient-@LIBX2GOCLIENT_MAJOR_VERSION@.0.gir: libx2goclient.la +X2GoClient_@LIBX2GOCLIENT_MAJOR_VERSION@_0_gir_INCLUDES = GObject-2.0 GLib-2.0 Gio-2.0 +X2GoClient_@LIBX2GOCLIENT_MAJOR_VERSION@_0_gir_CFLAGS = $(libx2goclient_la_CFLAGS) -I$(srcdir) +X2GoClient_@LIBX2GOCLIENT_MAJOR_VERSION@_0_gir_LIBS = libx2goclient.la +X2GoClient_@LIBX2GOCLIENT_MAJOR_VERSION@_0_gir_FILES = $(introspection_sources) +X2GoClient_@LIBX2GOCLIENT_MAJOR_VERSION@_0_gir_SCANNERFLAGS = --symbol-prefix="x2goclient" girdir = $(datadir)/gir-1.0 gir_DATA = $(INTROSPECTION_GIRS) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 98026ebcd8868bbbd2d2726dd0333bfece9bca74 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu May 27 02:45:09 2021 +0200 configure.ac: move AC_PREREQ() up, it probably should be the first call. --- configure.ac | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 92e6351..604604e 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,11 @@ +AC_PREREQ([2.64]) + AC_INIT([libx2goclient], [0.0.5], [https://github.com/ArcticaProject/libx2goclient/issues], [libx2goclient], [https://github.com/ArcticaProject/libx2goclient]) -AC_PREREQ([2.64]) AC_CONFIG_SRCDIR([src]) AC_CONFIG_AUX_DIR([build-aux]) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 2a7c4e7bd48f7e666678dedc0a1100dd659821af Author: Mihai Moldovan <ionic@ionic.de> Date: Thu May 27 02:10:07 2021 +0200 docs/reference/libx2goclient/Makefile.am: add common NULL variable. --- docs/reference/libx2goclient/Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/reference/libx2goclient/Makefile.am b/docs/reference/libx2goclient/Makefile.am index 90b4df0..7034a87 100644 --- a/docs/reference/libx2goclient/Makefile.am +++ b/docs/reference/libx2goclient/Makefile.am @@ -30,6 +30,9 @@ # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples # of using the various options. +# This is supposed to be empty. Keep it as-is. +NULL = + # The name of the module, e.g. 'glib'. DOC_MODULE=libx2goclient -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 001ff562c523258e77569133ba77156e2a524618 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri May 28 00:27:34 2021 +0200 docs/reference/libx2goclient/Makefile.am: add version.xml{,.in} references. --- docs/reference/libx2goclient/Makefile.am | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/reference/libx2goclient/Makefile.am b/docs/reference/libx2goclient/Makefile.am index 7034a87..d588f3e 100644 --- a/docs/reference/libx2goclient/Makefile.am +++ b/docs/reference/libx2goclient/Makefile.am @@ -86,7 +86,9 @@ HTML_IMAGES= # Extra files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.xml building.xml changes-2.0.xml -content_files= +content_files= \ + version.xml \ + $(NULL) # Files where gtk-doc abbreviations (#GtkWidget) are expanded # e.g. expand_content_files=running.xml @@ -113,3 +115,7 @@ TESTS = $(GTKDOC_CHECK) endif -include $(top_srcdir)/git.mk + +# Distribute files that gtk-doc normally wouldn't. +EXTRA_DIST += \ + version.xml.in -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit a5c3e88fbcf0120bdaa9b6041bc1c7ff5d0c28b9 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu May 27 01:25:18 2021 +0200 docs/: add Makefile.am, recursing into reference sub-directory. --- docs/Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/Makefile.am b/docs/Makefile.am new file mode 100644 index 0000000..a3b223e --- /dev/null +++ b/docs/Makefile.am @@ -0,0 +1,3 @@ +NULL = + +SUBDIRS = reference -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 894c9af0524b5b73ce83eb3e9d031dbed20e9500 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri May 28 00:25:20 2021 +0200 docs/reference/libx2goclient/: add version.xml.in file, containing AC_SUBSTituted version macro. --- docs/reference/libx2goclient/version.xml.in | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/reference/libx2goclient/version.xml.in b/docs/reference/libx2goclient/version.xml.in new file mode 100644 index 0000000..8c5bc8c --- /dev/null +++ b/docs/reference/libx2goclient/version.xml.in @@ -0,0 +1 @@ +@LIBX2GOCLIENT_VERSION@ -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 09413dd631bed399a15de251a08ac94cf98e0cb3 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat May 29 07:20:10 2021 +0200 src/{,test/}Makefile.am: rename library file back to unversioned variant. We probably will never want to have multiple versions co-installable and on UNIX-based operating systems, the libtool version will define the soversion, which is also directly visible in the file name. On non-UNIX systems, like Windows, things are a bit different, and we probably WILL want the resulting binaries to include some version number, but we can also comfortably do that at install time there. --- src/Makefile.am | 14 +++++++++----- src/test/Makefile.am | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 6bec2a7..e4f0794 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -9,7 +9,11 @@ LDADD = \ @LTLIBINTL@ \ $(NULL) -lib_LTLIBRARIES = libx2goclient-@LIBX2GOCLIENT_MAJOR_VERSION@.0.la +# For Windows, we'll want to rename the libraries into something like +# libx2goclient-@LIBX2GOCLIENT_MAJOR_VERSION@.0.la (and other respective +# files), but we should be able to do so at install time, so don't +# overcomplicate things at build time. +lib_LTLIBRARIES = libx2goclient.la CLEANFILES = DISTCLEANFILES = @@ -42,7 +46,7 @@ libx2goclientinclude_HEADERS = \ x2goclient-utils.h \ $(NULL) -libx2goclient_@LIBX2GOCLIENT_MAJOR_VERSION@_0_la_SOURCES = \ +libx2goclient_la_SOURCES = \ x2goclient-agent-start-kdrive.c \ x2goclient-agent-start-nx.c \ x2goclient-network.c \ @@ -59,15 +63,15 @@ libx2goclient_@LIBX2GOCLIENT_MAJOR_VERSION@_0_la_SOURCES = \ x2goclient-utils.c \ $(NULL) -libx2goclient_@LIBX2GOCLIENT_MAJOR_VERSION@_0_la_CFLAGS = \ +libx2goclient_la_CFLAGS = \ $(LIBX2GOCLIENT_CFLAGS) \ $(NULL) -libx2goclient_@LIBX2GOCLIENT_MAJOR_VERSION@_0_la_LIBADD = \ +libx2goclient_la_LIBADD = \ $(LIBX2GOCLIENT_LIBS) \ $(NULL) -libx2goclient_@LIBX2GOCLIENT_MAJOR_VERSION@_0_la_LDFLAGS = \ +libx2goclient_la_LDFLAGS = \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ -export-dynamic $(no_undefined) \ $(NULL) diff --git a/src/test/Makefile.am b/src/test/Makefile.am index d059e04..8240b15 100644 --- a/src/test/Makefile.am +++ b/src/test/Makefile.am @@ -15,5 +15,5 @@ sshtest_CFLAGS = \ $(NULL) sshtest_LDADD = \ - ../libx2goclient-@LIBX2GOCLIENT_MAJOR_VERSION@.0.la \ + ../libx2goclient.la \ $(NULL) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 1f67ba232527939d2b0ddd9352ce78edc293d3a8 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu May 27 05:27:19 2021 +0200 configure.ac: rework versioning. We'll use a versioning scheme adopted from glib and slightly modified to not differentiate between stable and unstable/development releases. --- configure.ac | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 88 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 604604e..eae65e3 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,57 @@ AC_PREREQ([2.64]) +# We'll mostly adopt the glib versioning scheme here, because it generally +# makes sense. +# In contrast to glib's scheme, we'll not differentiate between stable and +# unstable versions, though. +# +# Making releases: +# either +# libx2goclient_minor_version += 1; +# libx2goclient_micro_version = 0; +# libx2goclient_interface_age += 1; +# or +# libx2goclient_micro_version += 1; +# libx2goclient_interface_age += 1; +# libx2goclient_binary_age += 1; +# if any functions have been added, set libx2goclient_interface_age to 0. +# if backwards compatibility has been broken, +# set libx2goclient_binary_age _and_ libx2goclient_interface_age to 0, while +# increasing libx2goclient_major_version and resetting +# libx2goclient_minor_version and libx2goclient_micro_version to 0. +# +# remember to add a LIBX2GOCLIENT_VERSION_xxx macro every time the minor +# version is bumped, as well as the LIBX2GOCLIENT_DEPRECATED_IN and +# LIBX2GOCLIENT_AVAILABLE_IN macros for that version - see FIXMEversion.h for +# further information. +# +# in easier to understand terms: +# +# <mclasen> on the stable branch, interface age == micro +# [for libx2goclient] on minor releases, reset +# interface age = micro version = 0 + +m4_define([libx2goclient_major_version], [0]) +m4_define([libx2goclient_minor_version], [0]) +m4_define([libx2goclient_micro_version], [0]) +m4_define([libx2goclient_interface_age], [0]) +m4_define([libx2goclient_binary_age], + [m4_eval(100 * libx2goclient_minor_version + libx2goclient_micro_version)]) +m4_define([libx2goclient_version], + [libx2goclient_major_version.libx2goclient_minor_version.libx2goclient_micro_version]) + +# libtool version related macros +m4_define([libx2goclient_lt_release], [libx2goclient_major_version.libx2goclient_minor_version]) +m4_define([libx2goclient_lt_current], + [m4_eval(100 * libx2goclient_minor_version + libx2goclient_micro_version - libx2goclient_interface_age)]) +m4_define([libx2goclient_lt_revision], [libx2goclient_interface_age]) +m4_define([libx2goclient_lt_age], [m4_eval(libx2goclient_binary_age - libx2goclient_interface_age)]) +m4_define([libx2goclient_lt_current_minus_age], + [m4_eval(libx2goclient_lt_current - libx2goclient_lt_age)]) + + AC_INIT([libx2goclient], - [0.0.5], + [libx2goclient_version], [https://github.com/ArcticaProject/libx2goclient/issues], [libx2goclient], [https://github.com/ArcticaProject/libx2goclient]) @@ -20,16 +70,44 @@ AC_CONFIG_MACRO_DIR([m4]) dnl make sure we keep ACLOCAL_FLAGS around for maintainer builds to work AC_SUBST(ACLOCAL_AMFLAGS, "\${ACLOCAL_FLAGS}") -# Before making a release, the LT_VERSION string should be modified. -# The string is of the form C:R:A. -# - If interfaces have been changed or added, but binary compatibility has -# been preserved, change to C+1:0:A+1 -# - If binary compatibility has been broken (eg removed or changed interfaces) -# change to C+1:0:0 -# - If the interface is the same as the previous version, change to C:R+1:A -LT_VERSION=18:4:1 -AC_SUBST(LT_VERSION) +LIBX2GOCLIENT_MAJOR_VERSION=libx2goclient_major_version +LIBX2GOCLIENT_MINOR_VERSION=libx2goclient_minor_version +LIBX2GOCLIENT_MICRO_VERSION=libx2goclient_micro_version +LIBX2GOCLIENT_INTERFACE_AGE=libx2goclient_interface_age +LIBX2GOCLIENT_BINARY_AGE=libx2goclient_binary_age +LIBX2GOCLIENT_VERSION=libx2goclient_version + +AC_SUBST(LIBX2GOCLIENT_MAJOR_VERSION) +AC_SUBST(LIBX2GOCLIENT_MINOR_VERSION) +AC_SUBST(LIBX2GOCLIENT_MICRO_VERSION) +AC_SUBST(LIBX2GOCLIENT_VERSION) +AC_SUBST(LIBX2GOCLIENT_INTERFACE_AGE) +AC_SUBST(LIBX2GOCLIENT_BINARY_AGE) + +AC_DEFINE(LIBX2GOCLIENT_MAJOR_VERSION, [libx2goclient_major_version], + [Define to the major libx2goclient version]) +AC_DEFINE(LIBX2GOCLIENT_MINOR_VERSION, [libx2goclient_minor_version], + [Define to the minor libx2goclient version]) +AC_DEFINE(LIBX2GOCLIENT_MICRO_VERSION, [libx2goclient_micro_version], + [Define to the micro libx2goclient version]) +AC_DEFINE(LIBX2GOCLIENT_INTERFACE_AGE, [libx2goclient_interface_age], + [Define to the libx2goclient interface age]) +AC_DEFINE(LIBX2GOCLIENT_BINARY_AGE, [libx2goclient_binary_age], + [Define to the libx2goclient binary age]) + +# libtool versioning +LT_RELEASE=libx2goclient_lt_release +LT_CURRENT=libx2goclient_lt_current +LT_REVISION=libx2goclient_lt_revision +LT_AGE=libx2goclient_lt_age +LT_CURRENT_MINUS_AGE=libx2goclient_lt_current_minus_age +AC_SUBST(LT_RELEASE) +AC_SUBST(LT_CURRENT) +AC_SUBST(LT_REVISION) +AC_SUBST(LT_AGE) +AC_SUBST(LT_CURRENT_MINUS_AGE) + AM_MAINTAINER_MODE -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 6782f001bb2abd0aa0c0dd8c0f6fe9c165f4d43b Author: Mihai Moldovan <ionic@ionic.de> Date: Thu May 27 01:26:11 2021 +0200 docs/reference: add Makefile.am, recursing into libx2goclient sub-directory. --- docs/reference/Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am new file mode 100644 index 0000000..eee624e --- /dev/null +++ b/docs/reference/Makefile.am @@ -0,0 +1,3 @@ +NULL = + +SUBDIRS = libx2goclient -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 14e3185758e8393265464f56b0623b8b7c14663c Author: Mihai Moldovan <ionic@ionic.de> Date: Thu May 27 01:16:42 2021 +0200 Makefile.am: build distcheck with gtk-doc support. --- Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.am b/Makefile.am index 297c85d..aef536d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,6 +7,7 @@ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} DISTCHECK_CONFIGURE_FLAGS = \ --disable-silent-rules \ --enable-introspection \ + --enable-gtk-doc \ $(NULL) MAINTAINERCLEANFILES = \ -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 35e3b09e1868a1410e322beea0af9aaeed1d27d9 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jun 17 13:16:58 2021 +0200 src/x2goclient-{network{.c,-network.{c,h}},{openssh-{bugs,version},utils}.{c,h}}: switch to current version 0.0.0. --- src/x2goclient-network-ssh.c | 60 ++++++++++++++++++++-------------------- src/x2goclient-network-ssh.h | 2 +- src/x2goclient-network.c | 26 ++++++++--------- src/x2goclient-openssh-bugs.c | 4 +-- src/x2goclient-openssh-bugs.h | 2 +- src/x2goclient-openssh-version.c | 24 ++++++++-------- src/x2goclient-openssh-version.h | 2 +- src/x2goclient-utils.c | 8 +++--- src/x2goclient-utils.h | 6 ++-- 9 files changed, 67 insertions(+), 67 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 73f1caa..7d88969 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -95,7 +95,7 @@ static void x2goclient_network_options_ssh_init (X2GoClientNetworkOptionsSSH * c * result as a #GPtrArray. %NULL * on error. * - * Since: 0.0.5 + * Since: 0.0.0 */ GPtrArray* x2goclient_network_options_ssh_to_array (X2GoClientNetworkOptionsSSH * const self) { GPtrArray *ret = NULL; @@ -128,7 +128,7 @@ GPtrArray* x2goclient_network_options_ssh_to_array (X2GoClientNetworkOptionsSSH * This type should be private to our implementation and not be used in outer * code. * - * Since: 0.0.5 + * Since: 0.0.0 */ typedef struct sockaddr_ho_ { sa_family_t sho_family; @@ -153,7 +153,7 @@ typedef struct sockaddr_ho_ { * kernel updates, but on other operating systems, other components might * influence this.) * - * Since: 0.0.5 + * Since: 0.0.0 */ #define AF_HOST 10417 @@ -210,7 +210,7 @@ G_DEFINE_TYPE (X2GoClientNetworkSSH, x2goclient_network_ssh, X2GOCLIENT_TYPE_NET * * Data structure used to pass common data to the timeout checking thread. * - * Since: 0.0.5 + * Since: 0.0.0 */ struct x2goclient_network_ssh_check_timeout_data { X2GoClientNetworkSSH *self; @@ -274,7 +274,7 @@ static void x2goclient_network_ssh_class_init (X2GoClientNetworkSSHClass * const * * See also x2goclient_network_ssh_fetch_openssh_version(). * - * Since: 0.0.5 + * Since: 0.0.0 */ net_ssh_obj_properties[X2GO_NET_SSH_PROP_OPENSSH_VERSION] = g_param_spec_boxed ("openssh-version", _("Parsed OpenSSH version number"), _("The OpenSSH client version number, parsed in a custom " @@ -291,7 +291,7 @@ static void x2goclient_network_ssh_class_init (X2GoClientNetworkSSHClass * const * * See also x2goclient_openssh_bugs_update(). * - * Since: 0.0.5 + * Since: 0.0.0 */ net_ssh_obj_properties[X2GO_NET_SSH_PROP_OPENSSH_BUGS] = g_param_spec_boxed ("openssh-bugs", _("Bug quirks structure for OpenSSH Client"), _("A structure containing quirks bits for known OpenSSH Client " @@ -453,7 +453,7 @@ static void x2goclient_network_ssh_get_property (GObject * const object, const g * #GSocketAddress. %NULL if the function believes * that the passed @socketspec is not a UNIX socket. * - * Since: 0.0.5 + * Since: 0.0.0 */ static GSocketAddress* x2goclient_network_ssh_parse_sockspec_unix_socket (const GString * const sockspec) { GSocketAddress *ret = NULL; @@ -516,7 +516,7 @@ static GSocketAddress* x2goclient_network_ssh_parse_sockspec_unix_socket (const * Returns: (transfer full): the #guint16 value corresponding to the parsed * port. On parsing errors, returns 0. * - * Since: 0.0.5 + * Since: 0.0.0 */ static guint16 x2goclient_network_ssh_parse_sockspec_port (const GString * const portspec, GError ** const gerr) { guint16 ret = 0; @@ -581,7 +581,7 @@ static guint16 x2goclient_network_ssh_parse_sockspec_port (const GString * const * the returned data will always be a copy of the * input data. * - * Since: 0.0.5 + * Since: 0.0.0 */ static GString* x2goclient_network_ssh_sanitize_sockspec (const GString * const sockspec) { GString *ret = NULL; @@ -651,7 +651,7 @@ static GString* x2goclient_network_ssh_sanitize_sockspec (const GString * const * parsed result if successful, %NULL on error, * potentially with @gerr populated if provided. * - * Since: 0.0.5 + * Since: 0.0.0 */ static GSocketAddress* x2goclient_network_ssh_parse_sockspec_ip (const GString * const sockspec, const gboolean want_v6, GError ** const gerr) { GSocketAddress *ret = NULL; @@ -851,7 +851,7 @@ static GSocketAddress* x2goclient_network_ssh_parse_sockspec_ip (const GString * * parsed result if successful, %NULL on error, * potentially with @gerr populated if provided. * - * Since: 0.0.5 + * Since: 0.0.0 */ static GSocketAddress* x2goclient_network_ssh_parse_sockspec_alias (const GString * const sockspec, GError ** const gerr) { GSocketAddress *ret = NULL; @@ -972,7 +972,7 @@ static GSocketAddress* x2goclient_network_ssh_parse_sockspec_alias (const GStrin * Returns: (transfer full): a pointer to a #GSocketAddress containing the * parsed result if successful, %NULL on error. * - * Since: 0.0.5 + * Since: 0.0.0 */ static GSocketAddress* x2goclient_network_ssh_parse_sockspec (X2GoClientNetwork * const parent, const GString * const sockspec) { GSocketAddress *ret = NULL; @@ -1058,7 +1058,7 @@ static GSocketAddress* x2goclient_network_ssh_parse_sockspec (X2GoClientNetwork * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or * failure (%FALSE). * - * Since: 0.0.5 + * Since: 0.0.0 */ static gboolean x2goclient_network_ssh_kill_subprocesses (X2GoClientNetworkSSH * const self) { gboolean ret = FALSE; @@ -1173,7 +1173,7 @@ static gboolean x2goclient_network_ssh_kill_subprocesses (X2GoClientNetworkSSH * * * Returns: a #gboolean value indicating success (%TRUE) or failure (%FALSE). * - * Since: 0.0.5 + * Since: 0.0.0 */ gboolean x2goclient_network_ssh_connect (X2GoClientNetworkSSH * const self, GError ** const gerr) { gboolean ret = FALSE; @@ -1231,7 +1231,7 @@ gboolean x2goclient_network_ssh_connect (X2GoClientNetworkSSH * const self, GErr * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or * failure (%FALSE). * - * Since: 0.0.5 + * Since: 0.0.0 */ static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork * const parent, GError ** const gerr) { gboolean ret = FALSE; @@ -1412,7 +1412,7 @@ static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork * const * * Returns: a #gboolean value indicating success (%TRUE) or failure (%FALSE). * - * Since: 0.0.5 + * Since: 0.0.0 */ gboolean x2goclient_network_ssh_disconnect (X2GoClientNetworkSSH * const self, GError ** const gerr) { gboolean ret = FALSE; @@ -1471,7 +1471,7 @@ gboolean x2goclient_network_ssh_disconnect (X2GoClientNetworkSSH * const self, G * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or * failure (%FALSE). * - * Since: 0.0.5 + * Since: 0.0.0 */ static gboolean x2goclient_network_ssh_parent_disconnect (X2GoClientNetwork * const parent, GError ** const gerr) { gboolean ret = FALSE; @@ -1547,7 +1547,7 @@ static gboolean x2goclient_network_ssh_parent_disconnect (X2GoClientNetwork * co * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or * failure (%FALSE). * - * Since: 0.0.5 + * Since: 0.0.0 */ static gboolean x2goclient_network_ssh_fetch_openssh_version (X2GoClientNetworkSSH * const self, GError ** const gerr) { gboolean ret = FALSE; @@ -1598,7 +1598,7 @@ static gboolean x2goclient_network_ssh_fetch_openssh_version (X2GoClientNetworkS * each additional part prepended with a <literal>(continuation)</literal> * message. * - * Since: 0.0.5 + * Since: 0.0.0 */ static void x2goclient_network_ssh_log_std_str (const gchar * const str, const gsize str_size, const _Bool select_stderr) { /* @@ -1670,7 +1670,7 @@ static void x2goclient_network_ssh_log_std_str (const gchar * const str, const g * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or * failure (%FALSE). * - * Since: 0.0.5 + * Since: 0.0.0 */ static gboolean x2goclient_network_ssh_gptrarray_to_string (GPtrArray * const arr, const gchar * const prelude, gchar ** const ret_str) { #define SIZE_LOW_WRAP(buffer_size, elem_size) ((G_MAXSIZE - (buffer_size)) < ((elem_size))) @@ -1830,7 +1830,7 @@ static gboolean x2goclient_network_ssh_gptrarray_to_string (GPtrArray * const ar * x2goclient_network_ssh_gptrarray_to_string(), refer to that function to * determine acceptable parameters for @arr. * - * Since: 0.0.5 + * Since: 0.0.0 */ static void x2goclient_network_ssh_gptrarray_print_debug (GPtrArray * const arr, const gchar * const prelude, const gchar * const desc) { gchar *arr_str = NULL; @@ -1878,7 +1878,7 @@ static void x2goclient_network_ssh_gptrarray_print_debug (GPtrArray * const arr, * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or * failure (%FALSE). * - * Since: 0.0.5 + * Since: 0.0.0 */ static gboolean x2goclient_network_ssh_sshcmd_add_host_port (X2GoClientNetworkSSH * const self, GPtrArray * const ssh_cmd, GError ** const gerr) { gboolean ret = FALSE; @@ -1999,7 +1999,7 @@ static gboolean x2goclient_network_ssh_sshcmd_add_host_port (X2GoClientNetworkSS * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or * failure (%FALSE). * - * Since: 0.0.5 + * Since: 0.0.0 */ static gboolean x2goclient_network_ssh_start_sshcmd (X2GoClientNetworkSSH * const self, const GPtrArray * const ssh_cmd, GError ** const gerr, const gboolean master) { gboolean ret = FALSE; @@ -2140,7 +2140,7 @@ static gboolean x2goclient_network_ssh_start_sshcmd (X2GoClientNetworkSSH * cons * While a %NULL input is supported, avoid that, since it will essentially * degrade into a no-op with additional overhead. * - * Since: 0.0.5 + * Since: 0.0.0 */ static void x2goclient_network_ssh_check_timeout_data_free (struct x2goclient_network_ssh_check_timeout_data * const data) { /* No need to clear any data within the structure. */ @@ -2168,7 +2168,7 @@ static void x2goclient_network_ssh_check_timeout_data_free (struct x2goclient_ne * Returns: (transfer full): a #gpointer to... something. Currently always * %NULL. * - * Since: 0.0.5 + * Since: 0.0.0 */ static gpointer x2goclient_network_ssh_check_timeout_thread_main (const gpointer user_data) { gpointer ret = NULL; @@ -2228,7 +2228,7 @@ static gpointer x2goclient_network_ssh_check_timeout_thread_main (const gpointer * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or * failure (%FALSE). * - * Since: 0.0.5 + * Since: 0.0.0 */ static gboolean x2goclient_network_ssh_start_check_timeout (X2GoClientNetworkSSH * const self, GError ** const gerr) { gboolean ret = FALSE; @@ -2264,7 +2264,7 @@ static gboolean x2goclient_network_ssh_start_check_timeout (X2GoClientNetworkSSH * * This function will execute in the main thread. * - * Since: 0.0.5 + * Since: 0.0.0 */ static void x2goclient_network_ssh_start_check_timeout_invoke (X2GoClientNetworkSSH * const self, GError ** const gerr) { g_return_if_fail (X2GOCLIENT_IS_NETWORK_SSH (self)); @@ -2292,7 +2292,7 @@ static void x2goclient_network_ssh_start_check_timeout_invoke (X2GoClientNetwork * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or * failure (%FALSE). * - * Since: 0.0.5 + * Since: 0.0.0 */ static gboolean x2goclient_network_ssh_start_check_timeout_unwrap (const gpointer user_data) { gboolean ret = G_SOURCE_CONTINUE; @@ -2322,7 +2322,7 @@ static gboolean x2goclient_network_ssh_start_check_timeout_unwrap (const gpointe * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or * failure (%FALSE). * - * Since: 0.0.5 + * Since: 0.0.0 */ static gboolean x2goclient_network_ssh_start_check_timeout_real (X2GoClientNetworkSSH * const self, GError ** const gerr) { gboolean ret = FALSE; @@ -2386,7 +2386,7 @@ static gboolean x2goclient_network_ssh_start_check_timeout_real (X2GoClientNetwo * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or * failure (%FALSE). * - * Since: 0.0.5 + * Since: 0.0.0 */ static gboolean x2goclient_network_ssh_check_timeout (const gpointer data) { gboolean ret = FALSE; diff --git a/src/x2goclient-network-ssh.h b/src/x2goclient-network-ssh.h index 7100883..cdec7ba 100644 --- a/src/x2goclient-network-ssh.h +++ b/src/x2goclient-network-ssh.h @@ -114,7 +114,7 @@ X2GoClientNetworkSSH* x2goclient_network_ssh_new (const gchar * const session_pa * Error message types as used within X2GoClientNetworkSSH. May be passed out * via #GError instances. * - * Since: 0.0.5 + * Since: 0.0.0 */ enum X2GoClientNetworkSSHErrors { X2GOCLIENT_NETWORK_SSH_ERROR_PORT_CONV_NOT_NUMERIC = 0, diff --git a/src/x2goclient-network.c b/src/x2goclient-network.c index 67d1d8a..7330090 100644 --- a/src/x2goclient-network.c +++ b/src/x2goclient-network.c @@ -49,7 +49,7 @@ * An example of a more concrete implementation is * #X2GoClientNetworkOptionsSSH. * - * Since: 0.0.5 + * Since: 0.0.0 */ /* Not sure if we need this, so comment out for now. */ @@ -82,7 +82,7 @@ static void x2goclient_network_options_init (X2GoClientNetworkOptions * const se * * An example of a more concrete implementation is #X2GoClientNetworkSSH. * - * Since: 0.0.5 + * Since: 0.0.0 */ /** @@ -91,7 +91,7 @@ static void x2goclient_network_options_init (X2GoClientNetworkOptions * const se * #X2GoClientNetwork is an opaque data structure and can only be accessed * using the following functions. * - * Since: 0.0.5 + * Since: 0.0.0 */ typedef struct X2GoClientNetworkPrivate_ { @@ -169,7 +169,7 @@ static void x2goclient_network_class_init (X2GoClientNetworkClass * const klass) * * See also x2goclient_network_parse_sockspec(). * - * Since: 0.0.5 + * Since: 0.0.0 */ net_obj_properties[X2GO_NET_PROP_SOCKET_SPEC] = g_param_spec_boxed ("socket-spec", _("Low-level socket string specification"), _("String specification for the low-level socket network " @@ -193,7 +193,7 @@ static void x2goclient_network_class_init (X2GoClientNetworkClass * const klass) * * FIXME: the "local part" as described here is not implemented. * - * Since: 0.0.5 + * Since: 0.0.0 */ net_obj_properties[X2GO_NET_PROP_SOCKET] = g_param_spec_object ("socket", _("Low-level socket"), _("Low-level socket for the network connection, the local " @@ -208,7 +208,7 @@ static void x2goclient_network_class_init (X2GoClientNetworkClass * const klass) * * Can be %NULL if not set previously. * - * Since: 0.0.5 + * Since: 0.0.0 */ net_obj_properties[X2GO_NET_PROP_OPTIONS] = g_param_spec_object ("options", _("Socket options"), _("Specific socket options."), @@ -225,7 +225,7 @@ static void x2goclient_network_class_init (X2GoClientNetworkClass * const klass) * It can only be set at the object's creation time and is immutable * following the constructions. * - * Since: 0.0.5 + * Since: 0.0.0 */ net_obj_properties[X2GO_NET_PROP_SESSION_PATH] = g_param_spec_string ("session-path", _("Base path to session data"), _("The file system path that will be used as the " @@ -244,7 +244,7 @@ static void x2goclient_network_class_init (X2GoClientNetworkClass * const klass) * * It is read-only. * - * Since: 0.0.5 + * Since: 0.0.0 */ net_obj_properties[X2GO_NET_PROP_CONNECTED] = g_param_spec_boolean ("connected", _("Boolean for connected state"), _("Boolean value denoting whether a connection has " @@ -265,7 +265,7 @@ static void x2goclient_network_class_init (X2GoClientNetworkClass * const klass) * This property transfers ownership of the wrapping pointer - i.e., the * data returned by it - to the caller, who is responsible for freeing it. * - * Since: 0.0.5 + * Since: 0.0.0 */ net_obj_properties[X2GO_NET_PROP_CONN_FUNC] = g_param_spec_pointer ("connect-function", _("Pointer to a pointer to this instance's connect function; " @@ -289,7 +289,7 @@ static void x2goclient_network_class_init (X2GoClientNetworkClass * const klass) * This property transfers ownership of the wrapping pointer - i.e., the * data returned by it - to the caller, who is responsible for freeing it. * - * Since: 0.0.5 + * Since: 0.0.0 */ net_obj_properties[X2GO_NET_PROP_DISCONN_FUNC] = g_param_spec_pointer ("disconnect-function", _("Pointer to a pointer to this instance's disconnect function; " @@ -353,7 +353,7 @@ static void x2goclient_network_finalize (GObject * const object) { * #GSocketAddress. %NULL on error or if no parsing * function has been set. * - * Since: 0.0.5 + * Since: 0.0.0 */ static GSocketAddress* x2goclient_network_parse_sockspec (X2GoClientNetwork * const self, const GString * const sockspec) { GSocketAddress *ret = NULL; @@ -385,7 +385,7 @@ static GSocketAddress* x2goclient_network_parse_sockspec (X2GoClientNetwork * co * Returns: %TRUE if the connection was established successful or it is * already running, %FALSE on error. * - * Since: 0.0.5 + * Since: 0.0.0 */ gboolean x2goclient_network_connect (X2GoClientNetwork * const self, GError ** const gerr) { gboolean ret = FALSE; @@ -426,7 +426,7 @@ gboolean x2goclient_network_connect (X2GoClientNetwork * const self, GError ** c * Returns: %TRUE if the connection was successfully destroyed or there was * none to begin with, %FALSE on error. * - * Since: 0.0.5 + * Since: 0.0.0 */ gboolean x2goclient_network_disconnect (X2GoClientNetwork * const self, GError ** const gerr) { gboolean ret = FALSE; diff --git a/src/x2goclient-openssh-bugs.c b/src/x2goclient-openssh-bugs.c index 73b289f..a16f6f6 100644 --- a/src/x2goclient-openssh-bugs.c +++ b/src/x2goclient-openssh-bugs.c @@ -44,7 +44,7 @@ * influence the behavior of this library (and, if needed, can also be * extended to other known bugs influencing applications using this library). * - * Since: 0.0.5 + * Since: 0.0.0 */ X2GoClientOpenSSHBugs* x2goclient_openssh_bugs_new (void) { @@ -83,7 +83,7 @@ G_DEFINE_BOXED_TYPE (X2GoClientOpenSSHBugs, x2goclient_openssh_bugs, &x2goclient * * Returns: a #gboolean value indicating success (%TRUE) or failure (%FALSE). * - * Since: 0.0.5 + * Since: 0.0.0 */ gboolean x2goclient_openssh_bugs_update (X2GoClientOpenSSHBugs * const self, const X2GoClientOpenSSHVersion * const version, GError ** const gerr) { gboolean ret = FALSE; diff --git a/src/x2goclient-openssh-bugs.h b/src/x2goclient-openssh-bugs.h index 488b854..c26ce25 100644 --- a/src/x2goclient-openssh-bugs.h +++ b/src/x2goclient-openssh-bugs.h @@ -81,7 +81,7 @@ gboolean x2goclient_openssh_bugs_update (X2GoClientOpenSSHBugs * const self, con * Error message types as used within #X2GoClientOpenSSHBugs. May be passed * out via #GError instances. * - * Since: 0.0.5 + * Since: 0.0.0 */ enum X2GoClientOpenSSHBugsErrors { X2GOCLIENT_OPENSSH_BUGS_ERROR_INVALID_STRUCT = 0, diff --git a/src/x2goclient-openssh-version.c b/src/x2goclient-openssh-version.c index 447d60c..ce23373 100644 --- a/src/x2goclient-openssh-version.c +++ b/src/x2goclient-openssh-version.c @@ -48,7 +48,7 @@ * necessary functions to parse an OpenSSH client version string as printed by * the OpenSSH client when calling it with the <option>-V</option> option. * - * Since: 0.0.5 + * Since: 0.0.0 */ X2GoClientOpenSSHVersion* x2goclient_openssh_version_new (void) { @@ -77,7 +77,7 @@ G_DEFINE_BOXED_TYPE (X2GoClientOpenSSHVersion, x2goclient_openssh_version, &x2go * * Expands into the error quark of this class. * - * Since: 0.0.5 + * Since: 0.0.0 */ #define ERROR_QUARK EXPAND(X2GOCLIENT_OPENSSH_VERSION_ERROR) @@ -92,7 +92,7 @@ G_DEFINE_BOXED_TYPE (X2GoClientOpenSSHVersion, x2goclient_openssh_version, &x2go * Expands to a error macro produced by concatenating the * three arguments with underscores as separators. * - * Since: 0.0.5 + * Since: 0.0.0 */ #define GENERATE_ERROR_(preamble, component, error) preamble ## _ ## component ## _ ## error @@ -106,7 +106,7 @@ G_DEFINE_BOXED_TYPE (X2GoClientOpenSSHVersion, x2goclient_openssh_version, &x2go * Wrapper hard-coding the preamble and passing the other arguments to * GENERATE_ERROR(). * - * Since: 0.0.5 + * Since: 0.0.0 */ #define GENERATE_ERROR(component, error) GENERATE_ERROR_ (X2GOCLIENT_OPENSSH_VERSION_ERROR, component, error) @@ -119,7 +119,7 @@ G_DEFINE_BOXED_TYPE (X2GoClientOpenSSHVersion, x2goclient_openssh_version, &x2go * Generates an error message by stringifying the @component and prepending it * to the actual error message @msg, set apart by a space. * - * Since: 0.0.5 + * Since: 0.0.0 */ #define GENERATE_ERROR_MSG_(component, msg) #component " " msg @@ -142,7 +142,7 @@ G_DEFINE_BOXED_TYPE (X2GoClientOpenSSHVersion, x2goclient_openssh_version, &x2go * The actual error message is generated by passing the mapped component and * error message down to GENERATE_ERROR_MSG_(). * - * Since: 0.0.5 + * Since: 0.0.0 */ #define GENERATE_ERROR_MSG(out_var, idx_var, msg) \ do {\ @@ -180,7 +180,7 @@ G_DEFINE_BOXED_TYPE (X2GoClientOpenSSHVersion, x2goclient_openssh_version, &x2go * The actual error code/constant is generated by passing the mapped component * and error code/constant down to GENERATE_ERROR(). * - * Since: 0.0.5 + * Since: 0.0.0 */ #define GENERATE_ERROR_CODE(out_var, idx_var, error) \ do {\ @@ -222,7 +222,7 @@ G_DEFINE_BOXED_TYPE (X2GoClientOpenSSHVersion, x2goclient_openssh_version, &x2go * X2GOCLIENT_CHECK_TYPE_TYPEOF(). The caveats described for the other macros * apply here as well. * - * Since: 0.0.5 + * Since: 0.0.0 */ #define SET_VER_COMPONENT(ver_struct, idx_var, value, init) \ do {\ @@ -275,7 +275,7 @@ G_DEFINE_BOXED_TYPE (X2GoClientOpenSSHVersion, x2goclient_openssh_version, &x2go * * This is just a convenience wrapper using SET_VER_COMPONENT(). * - * Since: 0.0.5 + * Since: 0.0.0 */ #define INIT_VER_COMPONENT(ver_struct, idx_var) SET_VER_COMPONENT ((ver_struct), (idx_var), (guint32)(0), TRUE) @@ -302,7 +302,7 @@ G_DEFINE_BOXED_TYPE (X2GoClientOpenSSHVersion, x2goclient_openssh_version, &x2go * X2GOCLIENT_CHECK_TYPE_TYPEOF(). The caveats described for the other macros * apply here as well. * - * Since: 0.0.5 + * Since: 0.0.0 */ #define CHECK_VER_COMPONENT(ver_struct, idx_var, err) \ do {\ @@ -341,7 +341,7 @@ G_DEFINE_BOXED_TYPE (X2GoClientOpenSSHVersion, x2goclient_openssh_version, &x2go * * Returns: a #_Bool value indicating success (%TRUE) or failure (%FALSE). * - * Since: 0.0.5 + * Since: 0.0.0 */ _Bool x2goclient_openssh_version_parse (X2GoClientOpenSSHVersion * const openssh_version, const gchar * const version_string, GError ** const gerr) { _Bool ret = FALSE; @@ -605,7 +605,7 @@ _Bool x2goclient_openssh_version_parse (X2GoClientOpenSSHVersion * const openssh * Returns: the populated #X2GoClientOpenSSHVersion structure on success or * %NULL on error. * - * Since: 0.0.5 + * Since: 0.0.0 */ X2GoClientOpenSSHVersion* x2goclient_openssh_version_fetch_openssh_version (GError ** const gerr) { X2GoClientOpenSSHVersion *ret = NULL; diff --git a/src/x2goclient-openssh-version.h b/src/x2goclient-openssh-version.h index 1b07d40..5acb731 100644 --- a/src/x2goclient-openssh-version.h +++ b/src/x2goclient-openssh-version.h @@ -153,7 +153,7 @@ void x2goclient_openssh_version_free (X2GoClientOpenSSHVersion * const openssh_v * Error message types as used within X2GoClientOpenSSHVersion. May be passed * out via #GError instances. * - * Since: 0.0.5 + * Since: 0.0.0 */ enum X2GoClientOpenSSHVersionErrors { X2GOCLIENT_OPENSSH_VERSION_ERROR_INVALID_STRUCT = 0, diff --git a/src/x2goclient-utils.c b/src/x2goclient-utils.c index f5d0265..01e0fb1 100644 --- a/src/x2goclient-utils.c +++ b/src/x2goclient-utils.c @@ -37,7 +37,7 @@ * * Frees the string passed as @data. It's safe to pass %NULL. * - * Since: 0.0.5 + * Since: 0.0.0 */ void x2goclient_clear_strings (gpointer data) { g_free (data); @@ -109,7 +109,7 @@ void x2goclient_clear_strings (gpointer data) { * * Returns: the converted value as a #long long, unless an error occurred * - * Since: 0.0.5 + * Since: 0.0.0 */ long long x2goclient_str_to_int (const gchar * const restrict str, const _Bool min, const long long int limit_min, const _Bool max, const long long int limit_max, const gchar ** const restrict end, _Bool * const restrict conv_err, _Bool * const restrict min_err, _Bool * const restrict max_err) { long long ret = 42; @@ -203,7 +203,7 @@ long long x2goclient_str_to_int (const gchar * const restrict str, const _Bool m * original string) if @needle was not found, unless an error * occurred * - * Since: 0.0.5 + * Since: 0.0.0 */ gchar* x2goclient_strbrk_dup (gchar * restrict * const haystack, const char needle, const _Bool free_orig, gsize * const new_size) { gchar *ret = NULL; @@ -250,7 +250,7 @@ gchar* x2goclient_strbrk_dup (gchar * restrict * const haystack, const char need * * Returns: (transfer none): the converted value as a string * - * Since: 0.0.5 + * Since: 0.0.0 */ gchar* x2goclient_bool_to_str (const gboolean in) { gchar *ret = "false"; diff --git a/src/x2goclient-utils.h b/src/x2goclient-utils.h index 270bed8..dad8037 100644 --- a/src/x2goclient-utils.h +++ b/src/x2goclient-utils.h @@ -65,7 +65,7 @@ G_BEGIN_DECLS * mismatching types. Instead, most often, a diagnostic message will be * printed, which has to be interpreted and fixed by developers. * - * Since: 0.0.5 + * Since: 0.0.0 */ #define X2GOCLIENT_CHECK_TYPE(type, var) \ do {\ @@ -98,7 +98,7 @@ G_BEGIN_DECLS * mismatching types. Instead, most often, a diagnostic message will be * printed, which has to be interpreted and fixed by developers. * - * Since: 0.0.5 + * Since: 0.0.0 */ #define X2GOCLIENT_CHECK_TYPE_TYPEOF(target, value) \ do {\ @@ -125,7 +125,7 @@ G_BEGIN_DECLS * mismatching types. Instead, most often, a diagnostic message will be * printed, which has to be interpreted and fixed by developers. * - * Since: 0.0.5 + * Since: 0.0.0 */ #define X2GOCLIENT_CHECK_TYPE_TYPEOF(target, value) \ do {\ -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 7f5a2a2c123a26b504e2082121b975a01243c826 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Jun 26 12:38:08 2021 +0200 src/x2goclient-{network{,-ssh},openssh-{bugs,version}}.c: gtk-doc needs the section name to match the file name, so rename all sections. --- src/x2goclient-network-ssh.c | 4 ++-- src/x2goclient-network.c | 4 ++-- src/x2goclient-openssh-bugs.c | 2 +- src/x2goclient-openssh-version.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 7d88969..a356521 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -53,7 +53,7 @@ /** - * SECTION:X2GoClientNetworkOptionsSSH + * SECTION:x2goclient-network-options-ssh * @short_description: Class encapsulating OpenSSH options * @see_also: #X2GoClientNetworkOptions * @stability: Unstable @@ -159,7 +159,7 @@ typedef struct sockaddr_ho_ { /** - * SECTION:X2GoClientNetworkSSH + * SECTION:x2goclient-network-ssh * @short_description: Class encapsulating an OpenSSH (client) network * connection * @see_also: #X2GoClientNetwork diff --git a/src/x2goclient-network.c b/src/x2goclient-network.c index 7330090..4e9e7f9 100644 --- a/src/x2goclient-network.c +++ b/src/x2goclient-network.c @@ -34,7 +34,7 @@ #include "x2goclient-network.h" /** - * SECTION:X2GoClientNetworkOptions + * SECTION:x2goclient-network-options * @short_description: Abstract base class encapsulating network options * @stability: Unstable * @include: libx2goclient/x2goclient-network.h @@ -69,7 +69,7 @@ static void x2goclient_network_options_init (X2GoClientNetworkOptions * const se /** - * SECTION:X2GoClientNetwork + * SECTION:x2goclient-network * @short_description: Abstract base class representing network connections * @stability: Unstable * @include: libx2goclient/x2goclient-network.h diff --git a/src/x2goclient-openssh-bugs.c b/src/x2goclient-openssh-bugs.c index a16f6f6..5c4aa08 100644 --- a/src/x2goclient-openssh-bugs.c +++ b/src/x2goclient-openssh-bugs.c @@ -32,7 +32,7 @@ #include "x2goclient-openssh-version.h" /** - * SECTION:X2GoClientOpenSSHBugs + * SECTION:x2goclient-openssh-bugs * @short_description: Class encapsulating OpenSSH client bug definitions * @stability: Unstable * @include: libx2goclient/x2goclient-openssh-bugs.h diff --git a/src/x2goclient-openssh-version.c b/src/x2goclient-openssh-version.c index ce23373..52acdbc 100644 --- a/src/x2goclient-openssh-version.c +++ b/src/x2goclient-openssh-version.c @@ -36,7 +36,7 @@ #include "x2goclient-utils.h" /** - * SECTION:X2GoClientOpenSSHVersion + * SECTION:x2goclient-openssh-version * @short_description: Class encapsulating and parsing OpenSSH client versions * @stability: Unstable * @include: libx2goclient/x2goclient-openssh-version.h -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 46a82b2df8c96dd8ac030b098b7ca2774694f759 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat May 29 07:24:06 2021 +0200 src/Makefile.am: sync gobject-introspection section with documentation. --- src/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index e4f0794..d320024 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -81,7 +81,7 @@ pkgconfig_DATA = libx2goclient.pc pkgconfigdir = $(libdir)/pkgconfig -include $(INTROSPECTION_MAKEFILE) -INTROSPECTION_GIRS = X2GoClient-@LIBX2GOCLIENT_MAJOR_VERSION@.0.gir +INTROSPECTION_GIRS = INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) --warn-all INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) @@ -97,6 +97,7 @@ X2GoClient_@LIBX2GOCLIENT_MAJOR_VERSION@_0_gir_CFLAGS = $(libx2goclient_la_CFLAG X2GoClient_@LIBX2GOCLIENT_MAJOR_VERSION@_0_gir_LIBS = libx2goclient.la X2GoClient_@LIBX2GOCLIENT_MAJOR_VERSION@_0_gir_FILES = $(introspection_sources) X2GoClient_@LIBX2GOCLIENT_MAJOR_VERSION@_0_gir_SCANNERFLAGS = --symbol-prefix="x2goclient" +INTROSPECTION_GIRS += X2GoClient-@LIBX2GOCLIENT_MAJOR_VERSION@.0.gir girdir = $(datadir)/gir-1.0 gir_DATA = $(INTROSPECTION_GIRS) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 7c9c24c39deb9894dcce02bd297e5be230983f68 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Jul 30 14:15:33 2021 +0200 src/x2goclient-network-options{,-ssh}.c: fix compile warnings due to unused parameters. --- src/x2goclient-network-options-ssh.c | 2 ++ src/x2goclient-network-options.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/x2goclient-network-options-ssh.c b/src/x2goclient-network-options-ssh.c index 49b9883..85ff621 100644 --- a/src/x2goclient-network-options-ssh.c +++ b/src/x2goclient-network-options-ssh.c @@ -64,9 +64,11 @@ struct _X2GoClientNetworkOptionsSSH { G_DEFINE_TYPE (X2GoClientNetworkOptionsSSH, x2goclient_network_options_ssh, X2GOCLIENT_TYPE_NETWORK_OPTIONS) static void x2goclient_network_options_ssh_class_init (X2GoClientNetworkOptionsSSHClass * const klass) { + (void) klass; } static void x2goclient_network_options_ssh_init (X2GoClientNetworkOptionsSSH * const self) { + (void) self; } /** diff --git a/src/x2goclient-network-options.c b/src/x2goclient-network-options.c index 8dd0116..3b38474 100644 --- a/src/x2goclient-network-options.c +++ b/src/x2goclient-network-options.c @@ -64,7 +64,9 @@ typedef struct X2GoClientNetworkOptionsPrivate_ { G_DEFINE_ABSTRACT_TYPE (X2GoClientNetworkOptions, x2goclient_network_options, G_TYPE_OBJECT) static void x2goclient_network_options_class_init (X2GoClientNetworkOptionsClass * const klass) { + (void) klass; } static void x2goclient_network_options_init (X2GoClientNetworkOptions * const self) { + (void) self; } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit ea36a93e64bba6181b3cf7dd93fdab8dbfac71a7 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jun 17 12:43:30 2021 +0200 src/x2goclient-openssh-bugs.h: reference X2GoClientOpenSSH{Bugs,Version} classes correctly. --- src/x2goclient-openssh-bugs.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/x2goclient-openssh-bugs.h b/src/x2goclient-openssh-bugs.h index c777994..488b854 100644 --- a/src/x2goclient-openssh-bugs.h +++ b/src/x2goclient-openssh-bugs.h @@ -72,14 +72,14 @@ gboolean x2goclient_openssh_bugs_update (X2GoClientOpenSSHBugs * const self, con /** * X2GoClientOpenSSHBugsErrors: - * @X2GOCLIENT_OPENSSH_BUGS_ERROR_INVALID_STRUCT: no X2GoClientOpenSSHBugs + * @X2GOCLIENT_OPENSSH_BUGS_ERROR_INVALID_STRUCT: no #X2GoClientOpenSSHBugs * structure passed. * @X2GOCLIENT_OPENSSH_BUGS_ERROR_INVALID_VERSION_STRUCT: - * no X2GoClientOpenSSHVersion + * no #X2GoClientOpenSSHVersion * structure passed. * - * Error message types as used within X2GoClientOpenSSHBugs. May be passed out - * via #GError instances. + * Error message types as used within #X2GoClientOpenSSHBugs. May be passed + * out via #GError instances. * * Since: 0.0.5 */ -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 4f20dbec7eb4ad01b0bb05d0b4c3a24d5ac77f12 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat May 29 07:47:06 2021 +0200 .gitignore: ignore more gtk-doc temporary stuff. --- .gitignore | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.gitignore b/.gitignore index 2fd7c75..411c345 100644 --- a/.gitignore +++ b/.gitignore @@ -62,6 +62,22 @@ po/*.gmo # gtk-doc stuff. gtk-doc.make m4/gtk-doc.m4 +/docs/reference/**/*.1 +/docs/reference/**/*.args +/docs/reference/**/*.bak +/docs/reference/**/*-decl-list.txt +/docs/reference/**/*-decl.txt +/docs/reference/**/*.hierarchy +/docs/reference/**/html +/docs/reference/**/*.interfaces +/docs/reference/**/*.prerequisites +/docs/reference/**/*.signals +/docs/reference/**/*.stamp +/docs/reference/**/*-undeclared.txt +/docs/reference/**/*-undocumented.txt +/docs/reference/**/*-unused.txt +/docs/reference/**/version.xml +/docs/reference/**/xml # Generated binaries. src/test/sshtest -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 50014eeb09e3421504fe36890957a847a02f37dc Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Jul 30 14:26:55 2021 +0200 src/x2goclient-network-ssh.c: fix documentation block, whitespace-only. --- src/x2goclient-network-ssh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 156e586..89378b6 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -117,7 +117,7 @@ typedef struct sockaddr_ho_ { * disconnects or errors, all dependent connections cleaned up. * * An example of a more abstract implementation is #X2GoClientNetwork. -*/ + */ /** * X2GoClientNetworkSSH: -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 14f8a7a3c69b80b290e6c772f242e0c35fa1c4c8 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat May 29 08:56:50 2021 +0200 docs/reference/libx2goclient/Makefile.am: ignore private gnativesocketaddress.h file. --- docs/reference/libx2goclient/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/libx2goclient/Makefile.am b/docs/reference/libx2goclient/Makefile.am index d588f3e..4f6a096 100644 --- a/docs/reference/libx2goclient/Makefile.am +++ b/docs/reference/libx2goclient/Makefile.am @@ -78,7 +78,7 @@ EXTRA_HFILES= # Header files or dirs to ignore when scanning. Use base file/dir names # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h private_code -IGNORE_HFILES= +IGNORE_HFILES=gnativesocketaddress.h # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 9187443c123de1f14fbb86fccc9560a56f88a1f5 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Jun 26 13:56:29 2021 +0200 src/x2goclient-network-ssh.c: fix file name copy & paste left-overs. --- src/x2goclient-network-ssh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 03c5885..6ae55e9 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-set-style: linux indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 8 -*- */ -/* x2goclient-network.c - X2Go Client SSH network handling +/* x2goclient-network-ssh.c - X2Go Client SSH network handling Copyright (C) 2019-2020 Mike Gabriel Copyright (C) 2019-2020 Mihai Moldovan @@ -106,7 +106,7 @@ typedef struct sockaddr_ho_ { * connection * @see_also: #X2GoClientNetwork * @stability: Unstable - * @include: libx2goclient/x2goclient-network.h + * @include: libx2goclient/x2goclient-network-ssh.h * * #X2GoClientNetwork is a class implementing network connections via the * OpenSSH client. -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit cfa06a4c36f35088b0642a3c1045eb08567c8cbb Author: Mihai Moldovan <ionic@ionic.de> Date: Sat May 29 23:38:11 2021 +0200 src/x2goclient-network-ssh.c: reference X2GoClientNetworkOptions as more concrete class, not itself. --- src/x2goclient-network-ssh.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index c9e1221..73f1caa 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -65,8 +65,7 @@ * all dependent classes, so it's essentially fully empty (yet providing the * general skeleton). * - * An example of a more abstract implementation is - * #X2GoClientNetworkSSHOptions. + * An example of a more abstract implementation is #X2GoClientNetworkOptions. */ struct _X2GoClientNetworkOptionsSSH { X2GoClientNetworkOptions parent_instance; -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit fb25d369b1c214c6daf976a4652618371b7d11bc Author: Mihai Moldovan <ionic@ionic.de> Date: Mon May 31 23:44:47 2021 +0200 src/x2goclient-utils.{c,h}: gtk-doc is unable to parse "const long long argument_name" correctly, rewrite as "const long long int argument_name". The former version is incorrectly parsed into modifiers "const long long" and type "argument_name". --- src/x2goclient-utils.c | 2 +- src/x2goclient-utils.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/x2goclient-utils.c b/src/x2goclient-utils.c index 5113c66..f5d0265 100644 --- a/src/x2goclient-utils.c +++ b/src/x2goclient-utils.c @@ -111,7 +111,7 @@ void x2goclient_clear_strings (gpointer data) { * * Since: 0.0.5 */ -long long x2goclient_str_to_int (const gchar * const restrict str, const _Bool min, const long long limit_min, const _Bool max, const long long limit_max, const gchar ** const restrict end, _Bool * const restrict conv_err, _Bool * const restrict min_err, _Bool * const restrict max_err) { +long long x2goclient_str_to_int (const gchar * const restrict str, const _Bool min, const long long int limit_min, const _Bool max, const long long int limit_max, const gchar ** const restrict end, _Bool * const restrict conv_err, _Bool * const restrict min_err, _Bool * const restrict max_err) { long long ret = 42; *min_err = *max_err = FALSE; diff --git a/src/x2goclient-utils.h b/src/x2goclient-utils.h index a4141a0..270bed8 100644 --- a/src/x2goclient-utils.h +++ b/src/x2goclient-utils.h @@ -135,7 +135,7 @@ G_BEGIN_DECLS void x2goclient_clear_strings (gpointer const data); -long long x2goclient_str_to_int (const gchar * const restrict str, const _Bool min, const long long limit_min, const _Bool max, const long long limit_max, const gchar ** const restrict end, _Bool * const restrict conv_err, _Bool * const restrict min_err, _Bool * const restrict max_err); +long long x2goclient_str_to_int (const gchar * const restrict str, const _Bool min, const long long int limit_min, const _Bool max, const long long int limit_max, const gchar ** const restrict end, _Bool * const restrict conv_err, _Bool * const restrict min_err, _Bool * const restrict max_err); gchar* x2goclient_strbrk_dup (gchar * restrict * const haystack, const char needle, const _Bool free_orig, gsize * const new_size); gchar* x2goclient_bool_to_str (const gboolean in); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit a498517f64b3bd3adcf894d033e55ef093c6fafa Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Jul 31 11:19:53 2021 +0200 src/x2goclient-network{,-ssh}.{c,h}: rework (dis-)connect hierarchy architecture. The previous approach used a virtual function in the parent class structure, which was supposed to be set to the correct function in derived classes, which was then used to call the derived class's function in the parent's (dis-)connect function and properties on the parent class exposing its (dis-)connect functions via indirection (function pointer to object pointer), which could be used in derived classes to effectively chain up. This had multiple shortcomings: - chaining wasn't really possible or implemented due to a single property for each parent function. - the code needed ugly typedefs for these function pointers and reference types to these function pointers as part of the indirection, which wasn't even compatible with gobject-introspection. - a slightly more complex class hierarchy such as A -> B -> C would have worked by accident/chance, if the properties would have been available and set on A, and derived implementations would have chained down, since in that case, chaining up would only be necessary to go to the top class, but this wouldn't have been elegant. Instead, we'll switch to using multiple virtual functions in the class structures and get rid of the properties. Implemented carefully, this allows us to fully chain up to the top level and then chain down via derived class virtual functions that each chain to the next one. The upside of that is that no matter which function you call, the whole chain will always be executed in a predictable manner. Example (connect-side only, disconnect is symmetrical) for a hierarchy such as A -> B -> C -> D: - D_class_init () sets CClass::derived_connect () to D_parent_connect () (the actual implementation) - D_connect () chains up to CClass::connect () (and does nothing else) - D_parent_connect () implements D's connect functionality and does not chain down (since it's at the bottom of the hierarchy) - C_class_init () sets BClass::derived_connect () to C_parent_connect () and CClass::connect () to C_connect () - C_connect () chains up to BClass::connect () (and does nothing else) - C_parent_connect () implements C's connect functionality and chains down by calling CClass::derived_connect () - B_class_init () sets AClass::derived_connect () to B_parent_connect () and BClass::connect () to B_connect () - B_connect () chains up to AClass::connect () (and does nothing else) - B_parent_connect () implements B's connect functionality and chains down by calling BClass::derived_connect () - A_class_init () sets AClass::connect () to A_connect () - A_connect () checks the A:connected property and, if false, implements A's connect functionality (if any) and chains down by calling AClass::derived_connect () --- src/x2goclient-network-ssh.c | 69 +++++++---------- src/x2goclient-network.c | 178 +++++++++++++------------------------------ src/x2goclient-network.h | 113 ++++++++++++++++++++------- 3 files changed, 162 insertions(+), 198 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 89378b6..cb246a6 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -181,8 +181,8 @@ static GSocketAddress* x2goclient_network_ssh_parse_sockspec_ip (const GString * static GSocketAddress* x2goclient_network_ssh_parse_sockspec_alias (const GString * const sockspec, GError ** const gerr); static GSocketAddress* x2goclient_network_ssh_parse_sockspec (X2GoClientNetwork * const parent, const GString * const sockspec); static gboolean x2goclient_network_ssh_kill_subprocesses (X2GoClientNetworkSSH * const self); -static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork * const parent, GError ** const gerr); -static gboolean x2goclient_network_ssh_parent_disconnect (X2GoClientNetwork * const parent, GError ** const gerr); +static gboolean x2goclient_network_ssh_parent_connect (const gpointer ptr, GError ** const gerr); +static gboolean x2goclient_network_ssh_parent_disconnect (const gpointer ptr, GError ** const gerr); static gboolean x2goclient_network_ssh_fetch_openssh_version (X2GoClientNetworkSSH * const self, GError ** const gerr); static void x2goclient_network_ssh_log_std_str (const gchar * const str, const gsize str_size, const _Bool select_stderr); static gboolean x2goclient_network_ssh_gptrarray_to_string (GPtrArray * const arr, const gchar * const prelude, gchar ** const ret_str); @@ -245,8 +245,8 @@ static void x2goclient_network_ssh_class_init (X2GoClientNetworkSSHClass * const X2GoClientNetworkClass *parent_class = X2GOCLIENT_NETWORK_CLASS (klass); - parent_class->connect = &x2goclient_network_ssh_parent_connect; - parent_class->disconnect = &x2goclient_network_ssh_parent_disconnect; + parent_class->derived_connect = &x2goclient_network_ssh_parent_connect; + parent_class->derived_disconnect = &x2goclient_network_ssh_parent_disconnect; parent_class->parse_sockspec = &x2goclient_network_ssh_parse_sockspec; } @@ -1064,8 +1064,9 @@ static gboolean x2goclient_network_ssh_kill_subprocesses (X2GoClientNetworkSSH * * * Wraps the SSH connect function. * - * This function can be called on #X2GoClientNetworkSSH objects and redirects - * to the actual connection function, x2goclient_network_ssh_parent_connect(). + * This function can be called on #X2GoClientNetworkSSH objects and chains up + * through the inheritance chain, eventually calling the actual connection + * function, x2goclient_network_ssh_parent_connect(). * * x2goclient_network_ssh_parent_connect() opens an SSH connection to the * remote location and registers the corresponding master connection @@ -1125,20 +1126,12 @@ gboolean x2goclient_network_ssh_connect (X2GoClientNetworkSSH * const self, GErr X2GoClientNetwork *parent = X2GOCLIENT_NETWORK (self); X2GoClientNetworkClass *parent_class = X2GOCLIENT_NETWORK_GET_CLASS (parent); - (void) parent_class; - /* Fetch parent's connect function. */ - x2goclient_network_connect_type parent_connect = NULL; - X2GoClientNetwork_connect_ref_type parent_connect_ref = NULL; - g_object_get (G_OBJECT (self), "connect-function", &parent_connect_ref, NULL); - g_assert (parent_connect_ref); + /* Just chain up here. */ + g_assert (parent_class->connect); - if (parent_connect_ref) { - parent_connect = *(parent_connect_ref); - - if (parent_connect) { - ret = parent_connect (parent, gerr); - } + if (parent_class->connect) { + ret = parent_class->connect (parent, gerr); } return (ret); @@ -1146,8 +1139,7 @@ gboolean x2goclient_network_ssh_connect (X2GoClientNetworkSSH * const self, GErr /* * x2goclient_network_ssh_parent_connect: - * @parent: (in) (not optional): pointer to the #X2GoClientNetwork parent - * instance. + * @ptr: (in) (not optional): pointer to the #X2GoClientNetworkSSH instance. * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not * interested. * @@ -1175,13 +1167,13 @@ gboolean x2goclient_network_ssh_connect (X2GoClientNetworkSSH * const self, GErr * * Since: 0.0.0 */ -static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork * const parent, GError ** const gerr) { +static gboolean x2goclient_network_ssh_parent_connect (const gpointer ptr, GError ** const gerr) { gboolean ret = FALSE; - g_return_val_if_fail (X2GOCLIENT_IS_NETWORK_SSH (parent), ret); + g_return_val_if_fail (X2GOCLIENT_IS_NETWORK_SSH (ptr), ret); g_return_val_if_fail (((NULL == gerr) || (NULL == *gerr)), ret); - X2GoClientNetworkSSH *self = X2GOCLIENT_NETWORK_SSH (parent); + X2GoClientNetworkSSH *self = X2GOCLIENT_NETWORK_SSH (ptr); /* Actual implementation here. */ @@ -1335,9 +1327,9 @@ static gboolean x2goclient_network_ssh_parent_connect (X2GoClientNetwork * const * * Wraps the SSH disconnect function. * - * This function can be called on #X2GoClientNetworkSSH objects and redirects - * to the actual disconnection function, - * x2goclient_network_ssh_parent_disconnect(). + * This function can be called on #X2GoClientNetworkSSH objects and chains up + * through the inheritance chain, eventually calling the actual disconnection + * function, x2goclient_network_ssh_parent_disconnect(). * * x2goclient_network_ssh_parent_disconnect() terminates the registered master * connection to the remote location (if it exists), clears the connected @@ -1364,20 +1356,12 @@ gboolean x2goclient_network_ssh_disconnect (X2GoClientNetworkSSH * const self, G X2GoClientNetwork *parent = X2GOCLIENT_NETWORK (self); X2GoClientNetworkClass *parent_class = X2GOCLIENT_NETWORK_GET_CLASS (parent); - (void) parent_class; - /* Fetch parent's disconnect function. */ - x2goclient_network_disconnect_type parent_disconnect = NULL; - X2GoClientNetwork_disconnect_ref_type parent_disconnect_ref = NULL; - g_object_get (G_OBJECT (self), "disconnect-function", &parent_disconnect_ref, NULL); - g_assert (parent_disconnect_ref); + /* Just chain up here. */ + g_assert (parent_class->disconnect); - if (parent_disconnect_ref) { - parent_disconnect = *(parent_disconnect_ref); - - if (parent_disconnect) { - ret = parent_disconnect (parent, gerr); - } + if (parent_class->disconnect) { + ret = parent_class->disconnect (parent, gerr); } return (ret); @@ -1385,8 +1369,7 @@ gboolean x2goclient_network_ssh_disconnect (X2GoClientNetworkSSH * const self, G /* * x2goclient_network_ssh_parent_disconnect: - * @parent: (in) (not optional): pointer to the #X2GoClientNetwork parent - * instance. + * @ptr: (in) (not optional): pointer to the #X2GoClientNetworkSSH instance. * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not * interested. * @@ -1415,13 +1398,13 @@ gboolean x2goclient_network_ssh_disconnect (X2GoClientNetworkSSH * const self, G * * Since: 0.0.0 */ -static gboolean x2goclient_network_ssh_parent_disconnect (X2GoClientNetwork * const parent, GError ** const gerr) { +static gboolean x2goclient_network_ssh_parent_disconnect (const gpointer ptr, GError ** const gerr) { gboolean ret = FALSE; - g_return_val_if_fail (X2GOCLIENT_IS_NETWORK_SSH (parent), ret); + g_return_val_if_fail (X2GOCLIENT_IS_NETWORK_SSH (ptr), ret); g_return_val_if_fail (((NULL == gerr) || (NULL == *gerr)), ret); - X2GoClientNetworkSSH *self = X2GOCLIENT_NETWORK_SSH (parent); + X2GoClientNetworkSSH *self = X2GOCLIENT_NETWORK_SSH (ptr); /* Actual implementation here. */ diff --git a/src/x2goclient-network.c b/src/x2goclient-network.c index 27cc6b2..64849b5 100644 --- a/src/x2goclient-network.c +++ b/src/x2goclient-network.c @@ -60,14 +60,36 @@ * Since: 0.0.0 */ +/** + * X2GoClientNetworkClass: + * @connect: pointer to the current class's connect function, useful for + * derived classes. Check the in-line documentation within the class + * structure for further information. + * @derived_connect: pointer to the derived class's connect function, must be + * set manually by the derived class in its + * <code>class_init</code> function. Check the in-line + * documentation within the class structure for further + * information. + * @disconnect: pointer to the current class's disconnect function, useful for + * derived classes. Check the in-line documentation within the + * class structure for further information. + * @derived_disconnect: pointer to the derived class's disconnect function, + * must be set manually by the derived class in its + * <code>class_init</code> function. Check the in-line + * documentation within the class structure for further + * information. + * + * Virtual function table for #X2GoClientNetwork. + * + * Since: 0.0.0 + */ + typedef struct X2GoClientNetworkPrivate_ { GString *socket_spec; GSocketAddress *socket; X2GoClientNetworkOptions *options; gchar *session_path; /* Will eventually be replaced with a session object, probably. */ gboolean connected; - x2goclient_network_connect_type connect_func; - x2goclient_network_disconnect_type disconnect_func; } X2GoClientNetworkPrivate; G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (X2GoClientNetwork, x2goclient_network, G_TYPE_OBJECT) @@ -86,8 +108,6 @@ enum { X2GO_NET_PROP_OPTIONS, X2GO_NET_PROP_SESSION_PATH, X2GO_NET_PROP_CONNECTED, - X2GO_NET_PROP_CONN_FUNC, - X2GO_NET_PROP_DISCONN_FUNC, X2GO_NET_N_PROPERTIES }; @@ -105,8 +125,10 @@ static void x2goclient_network_class_init (X2GoClientNetworkClass * const klass) GObjectClass *object_class = G_OBJECT_CLASS (klass); /* Initialize class members. */ - klass->connect = NULL; - klass->disconnect = NULL; + klass->connect = &x2goclient_network_connect; + klass->derived_connect = NULL; + klass->disconnect = &x2goclient_network_disconnect; + klass->derived_disconnect = NULL; klass->parse_sockspec = NULL; /* @@ -218,54 +240,6 @@ static void x2goclient_network_class_init (X2GoClientNetworkClass * const klass) FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE); - /** - * X2GoClientNetwork:connect-function: - * - * This property holds a pointer to a pointer to the instance's connect - * function. - * - * It is read-only. - * - * Use it to fetch the parent's connect function in derived classes. - * - * This property transfers ownership of the wrapping pointer - i.e., the - * data returned by it - to the caller, who is responsible for freeing it. - * - * Since: 0.0.0 - */ - net_obj_properties[X2GO_NET_PROP_CONN_FUNC] = g_param_spec_pointer ("connect-function", - _("Pointer to a pointer to this instance's connect function; " - "the ownership of the wrapping pointer is transferred to the caller"), - _("A pointer to a pointer to the instance's connect function. " - "This is supposed to be immutable. " - "The caller is responsible for freeing the wrapping pointer - i.e., " - "the data returned by this property."), - G_PARAM_STATIC_STRINGS | G_PARAM_READABLE); - - /** - * X2GoClientNetwork:disconnect-function: - * - * This property holds a pointer to a pointer to the instance's disconnect - * function. - * - * It is read-only. - * - * Use it to fetch the parent's disconnect function in derived classes. - * - * This property transfers ownership of the wrapping pointer - i.e., the - * data returned by it - to the caller, who is responsible for freeing it. - * - * Since: 0.0.0 - */ - net_obj_properties[X2GO_NET_PROP_DISCONN_FUNC] = g_param_spec_pointer ("disconnect-function", - _("Pointer to a pointer to this instance's disconnect function; " - "the ownership of the wrapping pointer is transferred to the caller"), - _("A pointer to the instance's disconnect function. " - "This is supposed to be immutable. " - "The caller is responsible for freeing the wrapping pointer - i.e., " - "the data returned by this property."), - G_PARAM_STATIC_STRINGS | G_PARAM_READABLE); - g_object_class_install_properties (object_class, X2GO_NET_N_PROPERTIES, net_obj_properties); } @@ -276,8 +250,6 @@ static void x2goclient_network_init (X2GoClientNetwork * const self) { priv->options = NULL; priv->session_path = NULL; priv->connected = FALSE; - priv->connect_func = &x2goclient_network_connect; - priv->disconnect_func = &x2goclient_network_disconnect; } static void x2goclient_network_dispose (GObject * const object) { @@ -299,9 +271,6 @@ static void x2goclient_network_finalize (GObject * const object) { g_free (priv->session_path); priv->session_path = NULL; - priv->connect_func = NULL; - priv->disconnect_func = NULL; - (G_OBJECT_CLASS (x2goclient_network_parent_class))->finalize (object); } @@ -336,19 +305,22 @@ static GSocketAddress* x2goclient_network_parse_sockspec (X2GoClientNetwork * co /** * x2goclient_network_connect: - * @self: (in) (not optional): an #X2GoClientNetwork. + * @self: (in) (not optional): pointer to an #X2GoClientNetwork instance. * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not * interested. * * Connects to a remote location. * - * This function uses the #X2GoClientNetworkClass::connect virtual method to - * actually connect. By default, this virtual method is unset (or rather, set - * to %NULL). Make sure to probably initialize it in your derived class. + * This function uses the #X2GoClientNetworkClass::derived_connect virtual + * method to call down the inheritance chain. By default, this virtual method + * is unset (or rather, set to %NULL). Make sure to properly initialize it in + * your derived class. + * Derived classes are also supposed to move down the inheritance chain after + * running their implementation. * * This function is idempotent. * - * Returns: %TRUE if the connection was established successful or it is + * Returns: %TRUE if the connection was established successfully or it is * already running, %FALSE on error. * * Since: 0.0.0 @@ -361,14 +333,15 @@ gboolean x2goclient_network_connect (X2GoClientNetwork * const self, GError ** c g_return_val_if_fail (X2GOCLIENT_IS_NETWORK (self), ret); g_return_val_if_fail (((NULL == gerr) || (NULL == *gerr)), ret); - g_return_val_if_fail (class->connect, ret); ret = priv->connected; if (!(ret)) { - ret = class->connect (self, gerr); + if (class->derived_connect) { + ret = class->derived_connect (self, gerr); - priv->connected = ret; + priv->connected = ret; + } } return (ret); @@ -376,16 +349,18 @@ gboolean x2goclient_network_connect (X2GoClientNetwork * const self, GError ** c /** * x2goclient_network_disconnect: - * @self: (in) (not optional): an #X2GoClientNetwork. + * @self: (in) (not optional): pointer to an #X2GoClientNetwork instance. * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not * interested. * * Disconnects from a remote location. * - * This function uses the #X2GoClientNetworkClass::disconnect virtual method - * to actually disconnect. By default, this virtual method is unset (or - * rather, set to %NULL). Make sure to probably initialize it in your derived - * class. + * This function uses the #X2GoClientNetworkClass::derived_disconnect virtual + * method to call down the inheritance chain. By default, this virtual method + * is unset (or rather, set to %NULL). Make sure to properly initialize it in + * your derived class. + * Derived classes are also supposed to move down the inheritance chain after + * running their implementation. * * This function is idempotent. * @@ -402,14 +377,15 @@ gboolean x2goclient_network_disconnect (X2GoClientNetwork * const self, GError * g_return_val_if_fail (X2GOCLIENT_IS_NETWORK (self), ret); g_return_val_if_fail (((NULL == gerr) || (NULL == *gerr)), ret); - g_return_val_if_fail (class->disconnect, ret); ret = (!(priv->connected)); if (!(ret)) { - ret = class->disconnect (self, gerr); + if (class->derived_disconnect) { + ret = class->derived_disconnect (self, gerr); - priv->connected = (!(ret)); + priv->connected = (!(ret)); + } } return (ret); @@ -419,8 +395,6 @@ static void x2goclient_network_set_property (GObject * const object, guint prop_ X2GoClientNetwork *self = X2GOCLIENT_NETWORK (object); X2GoClientNetworkPrivate *priv = x2goclient_network_get_instance_private (self); - X2GoClientNetwork_connect_ref_type conn_ref = NULL; - X2GoClientNetwork_disconnect_ref_type disconn_ref = NULL; switch (prop_id) { case (X2GO_NET_PROP_SOCKET_SPEC): if (priv->socket_spec) { @@ -445,32 +419,6 @@ static void x2goclient_network_set_property (GObject * const object, guint prop_ case (X2GO_NET_PROP_CONNECTED): priv->connected = g_value_get_boolean (value); break; - case (X2GO_NET_PROP_CONN_FUNC): - /* Fetch data pointer. */ - conn_ref = g_value_get_pointer (value); - - /* Set function pointer based on this data. */ - priv->connect_func = *(conn_ref); - - /* - * And, importantly, get rid of the data. - * - * Note that this is strictly speaking a - * violation of g_value_get_pointer ()'s - * contract (being transfer_none), but we - * explicitly transfer ownership, so it - * should be fine in this case. - */ - g_free (conn_ref); - conn_ref = NULL; - break; - case (X2GO_NET_PROP_DISCONN_FUNC): - /* Same as for CONN_FUNC. */ - disconn_ref = g_value_get_pointer (value); - priv->disconnect_func = *(disconn_ref); - g_free (disconn_ref); - disconn_ref = NULL; - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, param_spec); break; @@ -481,8 +429,6 @@ static void x2goclient_network_get_property (GObject * const object, const guint X2GoClientNetwork *self = X2GOCLIENT_NETWORK (object); X2GoClientNetworkPrivate *priv = x2goclient_network_get_instance_private (self); - X2GoClientNetwork_connect_ref_type conn_ref = NULL; - X2GoClientNetwork_disconnect_ref_type disconn_ref = NULL; switch (prop_id) { case (X2GO_NET_PROP_SOCKET_SPEC): g_value_set_boxed (value, priv->socket_spec); @@ -499,28 +445,6 @@ static void x2goclient_network_get_property (GObject * const object, const guint case (X2GO_NET_PROP_CONNECTED): g_value_set_boolean (value, priv->connected); break; - case (X2GO_NET_PROP_CONN_FUNC): - /* - * Create and pass function pointer as - * data. - */ - conn_ref = g_new0 (x2goclient_network_connect_type, 1); - *(conn_ref) = priv->connect_func; - g_value_set_pointer (value, conn_ref); - - /* - * Never free conn_ref here! It's the - * caller's responsibility. - */ - conn_ref = NULL; - break; - case (X2GO_NET_PROP_DISCONN_FUNC): - /* Same as for CONN_FUNC. */ - disconn_ref = g_new0 (x2goclient_network_disconnect_type, 1); - *(disconn_ref) = priv->disconnect_func; - g_value_set_pointer (value, disconn_ref); - disconn_ref = NULL; - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, param_spec); break; diff --git a/src/x2goclient-network.h b/src/x2goclient-network.h index ea854cf..2660879 100644 --- a/src/x2goclient-network.h +++ b/src/x2goclient-network.h @@ -44,37 +44,94 @@ G_BEGIN_DECLS #define X2GOCLIENT_TYPE_NETWORK (x2goclient_network_get_type ()) G_DECLARE_DERIVABLE_TYPE (X2GoClientNetwork, x2goclient_network, X2GOCLIENT, NETWORK, GObject) -/* - * Function (pointer) prototypes. - * - * We need the reference type because casting function pointers to object - * pointers is illegal in ISO C. This isn't just an oversight in the standard, - * but actually intended to keep developers from shooting themselves in the - * foot. - * - * Function pointers and object pointers are not interchangeable. There are - * platforms on which both have different sizes. - * - * Due to this, the only way to pass them around is through indirection - - * i.e., the address of an object pointer. - */ -typedef gboolean (*x2goclient_network_connect_type) (X2GoClientNetwork * const self, GError ** const gerr); -typedef gboolean (*x2goclient_network_disconnect_type) (X2GoClientNetwork * const self, GError ** const gerr); -#ifndef __GI_SCANNER__ -/* - * We have to hide this until - * https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/385 is - * resolved. - */ -typedef x2goclient_network_connect_type *X2GoClientNetwork_connect_ref_type; -typedef x2goclient_network_disconnect_type *X2GoClientNetwork_disconnect_ref_type; -#endif - struct _X2GoClientNetworkClass { GObjectClass parent_class; - x2goclient_network_connect_type connect; - x2goclient_network_disconnect_type disconnect; + /** + * X2GoClientNetworkClass::connect: + * @self: (not optional): pointer to an #X2GoClientNetwork instance. + * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if + * not interested. + * + * This is a pointer to the current class's connect function. + * + * Derived classes can use it to fetch their parent class's connect function + * for chaining up. + * + * In the top-level class, this function must implement its specifics and + * then chain down, while in lower-level classes, it must only chain up, + * without implementing any specifics or chaining down. + * + * Returns: %TRUE if the connection was established successfully or it is + * already running, %FALSE on error. + * + * Since: 0.0.0 + */ + gboolean (*connect) (X2GoClientNetwork * const self, GError ** const gerr); + + /** + * X2GoClientNetworkClass::derived_connect: + * @ptr: (not optional): pointer to a derived instance. + * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if + * not interested. + * + * This is a pointer to the derived class's connect function. + * + * Derived classes should set it to their actual public connect + * implementation in their <code>class_init</code> function. + * + * This function must implement its specifics and then chain down, unless it + * is at the bottom of its hierarchy. + * + * Returns: %TRUE if the connection was established successfully or it is + * already running, %FALSE on error. + * + * Since: 0.0.0 + */ + gboolean (*derived_connect) (const gpointer ptr, GError ** const gerr); + + /** + * X2GoClientNetworkClass::disconnect: + * @self: (not optional): pointer to an #X2GoClientNetwork instance. + * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if + * not interested. + * + * This is a pointer to the current class's disconnect function. + * + * Derived classes can use it to fetch their parent class's disconnect + * function for chaining up. + * + * In the top-level class, this function must implement its specifics and + * then chain down, while in lower-level classes, it must only chain up, + * without implementing any specifics or chaining down. + * + * Returns: %TRUE if the connection was successfully destroyed or there was + * none to begin with, %FALSE on error. + * + * Since: 0.0.0 + */ + gboolean (*disconnect) (X2GoClientNetwork * const self, GError ** const gerr); + + /** + * X2GoClientNetworkClass::derived_disconnect: + * @ptr: (not optional): pointer to a derived instance. + * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if + * not interested. + * + * This is a pointer to the derived class's disconnect function. + * + * Derived classes should set it to their actual public disconnect + * implementation in their <code>class_init</code> function. + * + * This function must implement its specifics and then chain down, unless it + * is at the bottom of its hierarchy. + * + * Returns: %TRUE if the connection was successfully destroyed or there was + * none to begin with, %FALSE on error. + * + * Since: 0.0.0 + */ + gboolean (*derived_disconnect) (const gpointer ptr, GError ** const gerr); /*< private >*/ GSocketAddress* (*parse_sockspec) (X2GoClientNetwork * const self, const GString * const sockspec); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit b27bee7776cffd08cf222099e262d48468a547ef Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Jun 26 13:54:18 2021 +0200 po/POTFILES.in: add new options source files. --- po/POTFILES.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/po/POTFILES.in b/po/POTFILES.in index da14428..1946e71 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -2,6 +2,8 @@ src/test/sshtest.c src/x2goclient-agent-start-kdrive.c src/x2goclient-agent-start-nx.c src/x2goclient-network.c +src/x2goclient-network-options.c +src/x2goclient-network-options-ssh.c src/x2goclient-network-ssh.c src/x2goclient-proxy-start-nx.c src/x2goclient-object.c -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 92e7a3d647d1ac83ef31276d94bb1c1696a61829 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Jun 26 13:54:41 2021 +0200 src/Makefile.am: add new options header and source files. --- src/Makefile.am | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Makefile.am b/src/Makefile.am index d320024..c01496a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -33,6 +33,8 @@ libx2goclientinclude_HEADERS = \ x2goclient-agent-start-nx.h \ x2goclient.h \ x2goclient-network.h \ + x2goclient-network-options.h \ + x2goclient-network-options-ssh.h \ x2goclient-network-ssh.h \ x2goclient-proxy-start-nx.h \ x2goclient-renderer-start-kdrive.h \ @@ -50,6 +52,8 @@ libx2goclient_la_SOURCES = \ x2goclient-agent-start-kdrive.c \ x2goclient-agent-start-nx.c \ x2goclient-network.c \ + x2goclient-network-options.c \ + x2goclient-network-options-ssh.c \ x2goclient-network-ssh.c \ x2goclient-proxy-start-nx.c \ x2goclient-renderer-start-kdrive.c \ -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 5608561f21d3687ae5cd22550f008af579244f71 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Jul 30 14:26:04 2021 +0200 src/x2goclient-network-ssh.c: fix class name in documentation block. --- src/x2goclient-network-ssh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 6ae55e9..156e586 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -108,7 +108,7 @@ typedef struct sockaddr_ho_ { * @stability: Unstable * @include: libx2goclient/x2goclient-network-ssh.h * - * #X2GoClientNetwork is a class implementing network connections via the + * #X2GoClientNetworkSSH is a class implementing network connections via the * OpenSSH client. * * In addition to the base functions defined in #X2GoClientNetwork, it opens -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 6347fce77a5de9049d83f1a55059064b840e6b32 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat May 29 08:57:51 2021 +0200 docs/reference/libx2goclient/Makefile.am: link against (hopefully built) libx2goclient.la. --- docs/reference/libx2goclient/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/libx2goclient/Makefile.am b/docs/reference/libx2goclient/Makefile.am index 4f6a096..b25dd6a 100644 --- a/docs/reference/libx2goclient/Makefile.am +++ b/docs/reference/libx2goclient/Makefile.am @@ -100,7 +100,7 @@ expand_content_files= # e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) GTKDOC_CFLAGS= -GTKDOC_LIBS= +GTKDOC_LIBS=$(top_builddir)/src/libx2goclient.la # This includes the standard gtk-doc make rules, copied by gtkdocize. include $(top_srcdir)/gtk-doc.make -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit b35a57d32a6850685ea5c1a93db16cc90258b41f Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Jun 26 13:50:19 2021 +0200 src/x2goclient-network{,-ssh}.{c,h}: split options classes out into src/x2goclient-network-options{,-ssh}.{c,h}. This is a consequence of not being able to define multiple sections per file. Since gtk-doc requires file and section names to match (which, honestly, is totally redundant), we need to split up each class into separate files. --- src/x2goclient-network-options-ssh.c | 95 ++++++++++++++++++++++++++++++++++++ src/x2goclient-network-options-ssh.h | 46 +++++++++++++++++ src/x2goclient-network-options.c | 70 ++++++++++++++++++++++++++ src/x2goclient-network-options.h | 47 ++++++++++++++++++ src/x2goclient-network-ssh.c | 58 ---------------------- src/x2goclient-network-ssh.h | 10 +--- src/x2goclient-network.c | 34 ------------- src/x2goclient-network.h | 12 +---- 8 files changed, 261 insertions(+), 111 deletions(-) diff --git a/src/x2goclient-network-options-ssh.c b/src/x2goclient-network-options-ssh.c new file mode 100644 index 0000000..49b9883 --- /dev/null +++ b/src/x2goclient-network-options-ssh.c @@ -0,0 +1,95 @@ +/* -*- Mode: C; c-set-style: linux indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 8 -*- */ + +/* x2goclient-network-options-ssh.c - X2Go Client options for SSH network + handling + + Copyright (C) 2019-2020 Mike Gabriel + Copyright (C) 2019-2020 Mihai Moldovan + All rights reserved. + + The libx2goclient library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The libx2goclient library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the Mate Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301, USA. + */ + +#include <glib.h> +#include <glib/gi18n.h> +#include <gmodule.h> +#include <gio/gio.h> + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "x2goclient.h" +#include "x2goclient-network-options-ssh.h" +#include "x2goclient-utils.h" + + +/** + * SECTION:x2goclient-network-options-ssh + * @short_description: Class encapsulating OpenSSH options + * @see_also: #X2GoClientNetworkOptions + * @stability: Unstable + * @include: libx2goclient/x2goclient-network-options-ssh.h + * + * #X2GoClientNetworkOptions is a class used to encapsulate OpenSSH options. + * + * Currently, there are no common options that could be used generically for + * all dependent classes, so it's essentially fully empty (yet providing the + * general skeleton). + * + * An example of a more abstract implementation is #X2GoClientNetworkOptions. + */ +struct _X2GoClientNetworkOptionsSSH { + X2GoClientNetworkOptions parent_instance; + + /* + * Eventually, this class should encapsulate/handle every ssh_config option, + * but for now it's a stub. + */ +}; + +G_DEFINE_TYPE (X2GoClientNetworkOptionsSSH, x2goclient_network_options_ssh, X2GOCLIENT_TYPE_NETWORK_OPTIONS) + +static void x2goclient_network_options_ssh_class_init (X2GoClientNetworkOptionsSSHClass * const klass) { +} + +static void x2goclient_network_options_ssh_init (X2GoClientNetworkOptionsSSH * const self) { +} + +/** + * x2goclient_network_options_ssh_to_array: + * @self: (not optional): an #X2GoClientNetworkOptionsSSH. + * + * Converts the internal state to an #GPtrArray of SSH client options that can + * be passed by prefixing "-o" to each entry when calling the SSH client. + * + * Returns: (transfer full) (element-type utf8): a pointer to the converted + * result as a #GPtrArray. %NULL + * on error. + * + * Since: 0.0.0 + */ +GPtrArray* x2goclient_network_options_ssh_to_array (X2GoClientNetworkOptionsSSH * const self) { + GPtrArray *ret = NULL; + + g_return_val_if_fail (X2GOCLIENT_IS_NETWORK_OPTIONS_SSH (self), ret); + + g_ptr_array_new_with_free_func (&x2goclient_clear_strings); + + /* Implement actual options fetching here. */ + + return (ret); +} diff --git a/src/x2goclient-network-options-ssh.h b/src/x2goclient-network-options-ssh.h new file mode 100644 index 0000000..1d467eb --- /dev/null +++ b/src/x2goclient-network-options-ssh.h @@ -0,0 +1,46 @@ +/* -*- Mode: C; c-set-style: linux indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 8 -*- */ + +/* x2goclient-network-options-ssh.h - X2Go Client options for SSH network + handling + + Copyright (C) 2019-2020 Mike Gabriel + Copyright (C) 2019-2020 Mihai Moldovan + All rights reserved. + + The libx2goclient library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The libx2goclient library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the Mate Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301, USA. + */ + +#ifndef x2goclient_network_options_ssh_h +#define x2goclient_network_options_ssh_h + +#include <glib-object.h> +#include <gmodule.h> + +#include "x2goclient-network-options.h" + +G_BEGIN_DECLS + +#define X2GOCLIENT_TYPE_NETWORK_OPTIONS_SSH (x2goclient_network_options_ssh_get_type ()) +G_DECLARE_FINAL_TYPE (X2GoClientNetworkOptionsSSH, x2goclient_network_options_ssh, X2GOCLIENT, NETWORK_OPTIONS_SSH, X2GoClientNetworkOptions) + +X2GoClientNetworkOptionsSSH* x2goclient_network_options_ssh_new (void); + + +GPtrArray* x2goclient_network_options_ssh_to_array (X2GoClientNetworkOptionsSSH * const self); + +G_END_DECLS + +#endif /* x2goclient_network_options_ssh_h */ diff --git a/src/x2goclient-network-options.c b/src/x2goclient-network-options.c new file mode 100644 index 0000000..8dd0116 --- /dev/null +++ b/src/x2goclient-network-options.c @@ -0,0 +1,70 @@ +/* -*- Mode: C; c-set-style: linux indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 8 -*- */ + +/* x2goclient-network-options.c - X2Go Client options for high-level network + handling + + Copyright (C) 2019-2020 Mike Gabriel + Copyright (C) 2019-2020 Mihai Moldovan + All rights reserved. + + The libx2goclient library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The libx2goclient library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the Mate Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301, USA. + */ + +#include <glib.h> +#include <glib/gi18n.h> +#include <gio/gio.h> + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "x2goclient.h" +#include "x2goclient-network-options.h" + + +/** + * SECTION:x2goclient-network-options + * @short_description: Abstract base class encapsulating network options + * @stability: Unstable + * @include: libx2goclient/x2goclient-network-options.h + * + * #X2GoClientNetworkOptions is an abstract base class used to encapsulate + * network options. + * + * Currently, there are no common options that could be used generically for + * all dependent classes, so it's essentially fully empty (yet providing the + * general skeleton). + * + * An example of a more concrete implementation is + * #X2GoClientNetworkOptionsSSH. + * + * Since: 0.0.0 + */ + +/* Not sure if we need this, so comment out for now. */ +/* +typedef struct X2GoClientNetworkOptionsPrivate_ { +} X2GoClientNetworkOptionsPrivate; +*/ + +/* G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (X2GoClientNetworkOptions, x2goclient_network_options, G_TYPE_OBJECT) */ +G_DEFINE_ABSTRACT_TYPE (X2GoClientNetworkOptions, x2goclient_network_options, G_TYPE_OBJECT) + +static void x2goclient_network_options_class_init (X2GoClientNetworkOptionsClass * const klass) { +} + +static void x2goclient_network_options_init (X2GoClientNetworkOptions * const self) { +} diff --git a/src/x2goclient-network-options.h b/src/x2goclient-network-options.h new file mode 100644 index 0000000..c1653ef --- /dev/null +++ b/src/x2goclient-network-options.h @@ -0,0 +1,47 @@ +/* -*- Mode: C; c-set-style: linux indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 8 -*- */ + +/* x2goclient-network-options.h - X2Go Client options for high-level network + handling + + Copyright (C) 2019-2020 Mike Gabriel + Copyright (C) 2019-2020 Mihai Moldovan + All rights reserved. + + The libx2goclient library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The libx2goclient library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the Mate Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301, USA. + */ + +#ifndef x2goclient_network_options_h +#define x2goclient_network_options_h + +#include <glib-object.h> +#include <gio/gio.h> + + +G_BEGIN_DECLS + +#define X2GOCLIENT_TYPE_NETWORK_OPTIONS (x2goclient_network_options_get_type ()) +G_DECLARE_DERIVABLE_TYPE (X2GoClientNetworkOptions, x2goclient_network_options, X2GOCLIENT, NETWORK_OPTIONS, GObject) + +struct _X2GoClientNetworkOptionsClass { + GObjectClass parent_class; + + /* Reserved space for future functions... */ + gpointer padding[100]; +}; + +G_END_DECLS + +#endif /* x2goclient_network_options_h */ diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index a356521..03c5885 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -52,64 +52,6 @@ #include "x2goclient-openssh-bugs.h" -/** - * SECTION:x2goclient-network-options-ssh - * @short_description: Class encapsulating OpenSSH options - * @see_also: #X2GoClientNetworkOptions - * @stability: Unstable - * @include: libx2goclient/x2goclient-network-ssh.h - * - * #X2GoClientNetworkOptions is a class used to encapsulate OpenSSH options. - * - * Currently, there are no common options that could be used generically for - * all dependent classes, so it's essentially fully empty (yet providing the - * general skeleton). - * - * An example of a more abstract implementation is #X2GoClientNetworkOptions. - */ -struct _X2GoClientNetworkOptionsSSH { - X2GoClientNetworkOptions parent_instance; - - /* - * Eventually, this class should encapsulate/handle every ssh_config option, - * but for now it's a stub. - */ -}; - -G_DEFINE_TYPE (X2GoClientNetworkOptionsSSH, x2goclient_network_options_ssh, X2GOCLIENT_TYPE_NETWORK_OPTIONS) - -static void x2goclient_network_options_ssh_class_init (X2GoClientNetworkOptionsSSHClass * const klass) { -} - -static void x2goclient_network_options_ssh_init (X2GoClientNetworkOptionsSSH * const self) { -} - -/** - * x2goclient_network_options_ssh_to_array: - * @self: (not optional): an #X2GoClientNetworkOptionsSSH. - * - * Converts the internal state to an #GPtrArray of SSH client options that can - * be passed by prefixing "-o" to each entry when calling the SSH client. - * - * Returns: (transfer full) (element-type utf8): a pointer to the converted - * result as a #GPtrArray. %NULL - * on error. - * - * Since: 0.0.0 - */ -GPtrArray* x2goclient_network_options_ssh_to_array (X2GoClientNetworkOptionsSSH * const self) { - GPtrArray *ret = NULL; - - g_return_val_if_fail (X2GOCLIENT_IS_NETWORK_OPTIONS_SSH (self), ret); - - g_ptr_array_new_with_free_func (&x2goclient_clear_strings); - - /* Implement actual options fetching here. */ - - return (ret); -} - - /* * sockaddr_ho: * @sho_family: address family entry, typed #sa_family_t. Should always be set diff --git a/src/x2goclient-network-ssh.h b/src/x2goclient-network-ssh.h index cdec7ba..05150ca 100644 --- a/src/x2goclient-network-ssh.h +++ b/src/x2goclient-network-ssh.h @@ -29,18 +29,10 @@ #include <gmodule.h> #include "x2goclient-network.h" +#include "x2goclient-network-options-ssh.h" G_BEGIN_DECLS -#define X2GOCLIENT_TYPE_NETWORK_OPTIONS_SSH (x2goclient_network_options_ssh_get_type ()) -G_DECLARE_FINAL_TYPE (X2GoClientNetworkOptionsSSH, x2goclient_network_options_ssh, X2GOCLIENT, NETWORK_OPTIONS_SSH, X2GoClientNetworkOptions) - -X2GoClientNetworkOptionsSSH* x2goclient_network_options_ssh_new (void); - - -GPtrArray* x2goclient_network_options_ssh_to_array (X2GoClientNetworkOptionsSSH * const self); - - #define X2GOCLIENT_TYPE_NETWORK_SSH (x2goclient_network_ssh_get_type ()) G_DECLARE_FINAL_TYPE (X2GoClientNetworkSSH, x2goclient_network_ssh, X2GOCLIENT, NETWORK_SSH, X2GoClientNetwork) diff --git a/src/x2goclient-network.c b/src/x2goclient-network.c index 4e9e7f9..27cc6b2 100644 --- a/src/x2goclient-network.c +++ b/src/x2goclient-network.c @@ -33,40 +33,6 @@ #include "x2goclient.h" #include "x2goclient-network.h" -/** - * SECTION:x2goclient-network-options - * @short_description: Abstract base class encapsulating network options - * @stability: Unstable - * @include: libx2goclient/x2goclient-network.h - * - * #X2GoClientNetworkOptions is an abstract base class used to encapsulate - * network options. - * - * Currently, there are no common options that could be used generically for - * all dependent classes, so it's essentially fully empty (yet providing the - * general skeleton). - * - * An example of a more concrete implementation is - * #X2GoClientNetworkOptionsSSH. - * - * Since: 0.0.0 - */ - -/* Not sure if we need this, so comment out for now. */ -/* -typedef struct X2GoClientNetworkOptionsPrivate_ { -} X2GoClientNetworkOptionsPrivate; -*/ - -/* G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (X2GoClientNetworkOptions, x2goclient_network_options, G_TYPE_OBJECT) */ -G_DEFINE_ABSTRACT_TYPE (X2GoClientNetworkOptions, x2goclient_network_options, G_TYPE_OBJECT) - -static void x2goclient_network_options_class_init (X2GoClientNetworkOptionsClass * const klass) { -} - -static void x2goclient_network_options_init (X2GoClientNetworkOptions * const self) { -} - /** * SECTION:x2goclient-network diff --git a/src/x2goclient-network.h b/src/x2goclient-network.h index 689d083..ea854cf 100644 --- a/src/x2goclient-network.h +++ b/src/x2goclient-network.h @@ -28,6 +28,8 @@ #include <glib-object.h> #include <gio/gio.h> +#include "x2goclient-network-options.h" + /* * We need this due to a bug in glib/gio. * @@ -39,16 +41,6 @@ G_BEGIN_DECLS -#define X2GOCLIENT_TYPE_NETWORK_OPTIONS (x2goclient_network_options_get_type ()) -G_DECLARE_DERIVABLE_TYPE (X2GoClientNetworkOptions, x2goclient_network_options, X2GOCLIENT, NETWORK_OPTIONS, GObject) - -struct _X2GoClientNetworkOptionsClass { - GObjectClass parent_class; - - /* Reserved space for future functions... */ - gpointer padding[100]; -}; - #define X2GOCLIENT_TYPE_NETWORK (x2goclient_network_get_type ()) G_DECLARE_DERIVABLE_TYPE (X2GoClientNetwork, x2goclient_network, X2GOCLIENT, NETWORK, GObject) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 64d62b245f944b319acf0c6d2b4ee0bbe445d99e Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Jul 30 14:18:49 2021 +0200 src/x2goclient-network-options.h: mark trailing padding in class structure as private. --- src/x2goclient-network-options.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/x2goclient-network-options.h b/src/x2goclient-network-options.h index c1653ef..8b27a65 100644 --- a/src/x2goclient-network-options.h +++ b/src/x2goclient-network-options.h @@ -38,6 +38,8 @@ G_DECLARE_DERIVABLE_TYPE (X2GoClientNetworkOptions, x2goclient_network_options, struct _X2GoClientNetworkOptionsClass { GObjectClass parent_class; + /*< private >*/ + /* Reserved space for future functions... */ gpointer padding[100]; }; -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 19c7d1fc513f70e8c5cb8d9e2998ac14752d1c16 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 30 04:33:35 2021 +0200 src/x2goclient-{network-ssh,openssh-version}.h: switch more occurrences from "long long" to "long long int". --- src/x2goclient-network-ssh.h | 6 ++++-- src/x2goclient-openssh-version.h | 18 ++++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/x2goclient-network-ssh.h b/src/x2goclient-network-ssh.h index 2650a95..0c86060 100644 --- a/src/x2goclient-network-ssh.h +++ b/src/x2goclient-network-ssh.h @@ -50,10 +50,12 @@ X2GoClientNetworkSSH* x2goclient_network_ssh_new (const gchar * const session_pa * was not numeric. * @X2GOCLIENT_NETWORK_SSH_ERROR_PORT_CONV_UNDERFLOW: port value to parse too * small to fit into - * #long long type. + * #long long int + * type. * @X2GOCLIENT_NETWORK_SSH_ERROR_PORT_CONV_OVERFLOW: port value to parse too * big to fit into - * #long long type. + * #long long int + * type. * @X2GOCLIENT_NETWORK_SSH_ERROR_PORT_CONV_TOO_BIG: port value to parse was * bigger than allowed by * common port specifications diff --git a/src/x2goclient-openssh-version.h b/src/x2goclient-openssh-version.h index 5acb731..1c60a9d 100644 --- a/src/x2goclient-openssh-version.h +++ b/src/x2goclient-openssh-version.h @@ -93,11 +93,13 @@ void x2goclient_openssh_version_free (X2GoClientOpenSSHVersion * const openssh_v * numeric. * @X2GOCLIENT_OPENSSH_VERSION_ERROR_MAJOR_UNDERFLOW: major version number to * parse too small to fit - * into #long long + * into + * #long long int * type. * @X2GOCLIENT_OPENSSH_VERSION_ERROR_MAJOR_OVERFLOW: major version number to * parse too big to fit - * into #long long + * into + * #long long int * type. * @X2GOCLIENT_OPENSSH_VERSION_ERROR_MAJOR_TOO_BIG: major version number to * parse was bigger than @@ -110,11 +112,13 @@ void x2goclient_openssh_version_free (X2GoClientOpenSSHVersion * const openssh_v * numeric. * @X2GOCLIENT_OPENSSH_VERSION_ERROR_MINOR_UNDERFLOW: minor version number to * parse too small to fit - * into #long long + * into + * #long long int * type. * @X2GOCLIENT_OPENSSH_VERSION_ERROR_MINOR_OVERFLOW: minor version number to * parse too big to fit - * into #long long + * into + * #long long int * type. * @X2GOCLIENT_OPENSSH_VERSION_ERROR_MINOR_TOO_BIG: minor version number to * parse was bigger than @@ -127,11 +131,13 @@ void x2goclient_openssh_version_free (X2GoClientOpenSSHVersion * const openssh_v * numeric. * @X2GOCLIENT_OPENSSH_VERSION_ERROR_PATCH_UNDERFLOW: patch version number to * parse too small to fit - * into #long long + * into + * #long long int * type. * @X2GOCLIENT_OPENSSH_VERSION_ERROR_PATCH_OVERFLOW: patch version number to * parse too big to fit - * into #long long + * into + * #long long int * type. * @X2GOCLIENT_OPENSSH_VERSION_ERROR_PATCH_TOO_BIG: patch version number to * parse was bigger than -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 989fd2709647da71c281134e0194c6b7b9561dbb Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Aug 2 16:48:09 2021 +0200 src/x2goclient-utils.c: add basic section documentation. --- src/x2goclient-utils.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/x2goclient-utils.c b/src/x2goclient-utils.c index 9247fa4..2f8590a 100644 --- a/src/x2goclient-utils.c +++ b/src/x2goclient-utils.c @@ -34,6 +34,16 @@ /** * SECTION:x2goclient-utils * @title: X2GoClientUtils + * @short_description: Miscellaneous utility and helper functions + * @stability: Unstable + * @include: libx2goclient/x2goclient-utils.h + * + * <literal>X2GoClientUtils</literal> provides miscellaneous utility and + * helper functions, intended to be used throughout the code base. + * + * The functions provided here should be free-standing. + * + * This file does not implement a specific class. * * Since: 0.0.0 */ -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit e42ff1ab2a07e5c950f433e2020f39584602e04f Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 30 04:42:37 2021 +0200 src/x2goclient-openssh-version.h: link to X2GoClientOpenSSHVersion class in documentation of X2GOCLIENT_OPENSSH_VERSION_ERROR_INVALID_STRUCT error. --- src/x2goclient-openssh-version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x2goclient-openssh-version.h b/src/x2goclient-openssh-version.h index dd74736..9a37881 100644 --- a/src/x2goclient-openssh-version.h +++ b/src/x2goclient-openssh-version.h @@ -58,7 +58,7 @@ void x2goclient_openssh_version_free (X2GoClientOpenSSHVersion * const openssh_v /** * X2GoClientOpenSSHVersionErrors: * @X2GOCLIENT_OPENSSH_VERSION_ERROR_INVALID_STRUCT: no - * X2GoClientOpenSSHVersion + * #X2GoClientOpenSSHVersion * structure passed. * @X2GOCLIENT_OPENSSH_VERSION_ERROR_INVALID_VERSION_STRING: no version string * to extract -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 04b26e6c70989ac107cec6609a536988181805eb Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Jul 31 12:58:06 2021 +0200 src/x2goclient-openssh-bugs.{c,h}: move bugs documentation to implementation file to fix gtk-doc warning. --- src/x2goclient-openssh-bugs.c | 15 +++++++++++++++ src/x2goclient-openssh-bugs.h | 11 ++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/x2goclient-openssh-bugs.c b/src/x2goclient-openssh-bugs.c index 5c4aa08..cfcc798 100644 --- a/src/x2goclient-openssh-bugs.c +++ b/src/x2goclient-openssh-bugs.c @@ -47,6 +47,21 @@ * Since: 0.0.0 */ +/** + * X2GoClientOpenSSHBugs: + * @backgrounding_keeps_stderr: Normally, child processes should fully detach + * from the controlling terminal. OpenSSH is + * buggy in some cases and doesn't always do that. + * See + * <ulink + * url="https://bugzilla.mindrot.org/show_bug.cgi?id=3137"> + * OpenSSH Bug 3137</ulink>. + * + * Bugs in OpenSSH. + * + * Since: 0.0.0 + */ + X2GoClientOpenSSHBugs* x2goclient_openssh_bugs_new (void) { return (g_slice_new0 (X2GoClientOpenSSHBugs)); } diff --git a/src/x2goclient-openssh-bugs.h b/src/x2goclient-openssh-bugs.h index c26ce25..97bc483 100644 --- a/src/x2goclient-openssh-bugs.h +++ b/src/x2goclient-openssh-bugs.h @@ -34,21 +34,14 @@ G_BEGIN_DECLS /* - * Bugs in OpenSSH. - * - * Please document each entry. + * Please document each entry in the implementation file + * (x2goclient-openssh-bugs.c). * * OpenSSH doesn't do that internally, which is a pain because bug semantics * must be inferred from the code locations the constants are used in. We don't * want this to happen as well. */ typedef struct X2GoClientOpenSSHBugs_ { - /* - * Normally, child processes should fully detach from the controlling - * terminal. OpenSSH is buggy in some cases and doesn't always do that. - * - * C.f., https://bugzilla.mindrot.org/show_bug.cgi?id=3137 - */ _Bool backgrounding_keeps_stderr : 1; } X2GoClientOpenSSHBugs; -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 9aa99e69d172579a6aaa8cabdc0fa06517c82809 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 30 04:39:25 2021 +0200 src/x2goclient-network-ssh.h: mention the actually expected instance/object type in the documentation for the X2GOCLIENT_NETWORK_SSH_ERROR_CONNECT_OPTIONS_INVALID error. --- src/x2goclient-network-ssh.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/x2goclient-network-ssh.h b/src/x2goclient-network-ssh.h index f7da951..03bd51b 100644 --- a/src/x2goclient-network-ssh.h +++ b/src/x2goclient-network-ssh.h @@ -92,12 +92,13 @@ X2GoClientNetworkSSH* x2goclient_network_ssh_new (const gchar * const session_pa * @X2GOCLIENT_NETWORK_SSH_ERROR_CONNECT_SOCK_ADDR_UNKNOWN: unknown socket * address type in * connect function. - * @X2GOCLIENT_NETWORK_SSH_ERROR_CONNECT_OPTIONS_INVALID: options structure - * was not of the - * expected type or - * could not be parsed - * into string array in - * connect function. + * @X2GOCLIENT_NETWORK_SSH_ERROR_CONNECT_OPTIONS_INVALID: + * options structure was not of + * the expected type + * #X2GoClientNetworkOptionsSSH + * or could not be parsed into + * string array in connect + * function. * @X2GOCLIENT_NETWORK_SSH_ERROR_PROC_COMMUNICATE_TRUE_RETVAL_UNAVAILABLE: * SSH process spawned * successfully, but -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit e45c1bab5962e8a32d19c2e43bceac7fdb964873 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 30 04:41:44 2021 +0200 src/x2goclient-network-ssh.h: link own class in documentation. --- src/x2goclient-network-ssh.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x2goclient-network-ssh.h b/src/x2goclient-network-ssh.h index 03bd51b..f47bcea 100644 --- a/src/x2goclient-network-ssh.h +++ b/src/x2goclient-network-ssh.h @@ -108,7 +108,7 @@ X2GoClientNetworkSSH* x2goclient_network_ssh_new (const gchar * const session_pa * not execute * successfully. * - * Error message types as used within X2GoClientNetworkSSH. May be passed out + * Error message types as used within #X2GoClientNetworkSSH. May be passed out * via #GError instances. * * Since: 0.0.0 -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit ce0ad4c2196d4b4cb32bba652680459f2e491e83 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Jul 31 12:26:17 2021 +0200 src/x2goclient-network{,-options-ssh}.c: unify comment style for instance pointer. --- src/x2goclient-network-options-ssh.c | 2 +- src/x2goclient-network.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/x2goclient-network-options-ssh.c b/src/x2goclient-network-options-ssh.c index 85ff621..8722a29 100644 --- a/src/x2goclient-network-options-ssh.c +++ b/src/x2goclient-network-options-ssh.c @@ -73,7 +73,7 @@ static void x2goclient_network_options_ssh_init (X2GoClientNetworkOptionsSSH * c /** * x2goclient_network_options_ssh_to_array: - * @self: (not optional): an #X2GoClientNetworkOptionsSSH. + * @self: (not optional): pointer to an #X2GoClientNetworkOptionsSSH instance. * * Converts the internal state to an #GPtrArray of SSH client options that can * be passed by prefixing "-o" to each entry when calling the SSH client. diff --git a/src/x2goclient-network.c b/src/x2goclient-network.c index 64849b5..2c181b8 100644 --- a/src/x2goclient-network.c +++ b/src/x2goclient-network.c @@ -277,7 +277,7 @@ static void x2goclient_network_finalize (GObject * const object) { /* * x2goclient_network_parse_sockspec: - * @self: (in) (not optional): an #X2GoClientNetwork. + * @self: (in) (not optional): pointer to an #X2GoClientNetwork instance. * @sockspec: (in) (not optional): socket specification as a pointer to a * #GString. * -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 0d158b862dbffc3e94d1bf9d36799d9c35b47cde Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 30 04:01:36 2021 +0200 src/x2goclient-network-ssh.c: add general SSH client options before those in X2GoClientNetworkOptionsSSH. --- src/x2goclient-network-ssh.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 24ebd26..aa0a0e1 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -1242,6 +1242,27 @@ static gboolean x2goclient_network_ssh_parent_connect (const gpointer ptr, GErro } if (ret) { + /* Add control path options. */ + g_ptr_array_add (ssh_cmd, g_strdup ("-o")); + g_ptr_array_add (ssh_cmd, g_strdup ("ControlMaster=\"yes\"")); + g_ptr_array_add (ssh_cmd, g_strdup ("-o")); + g_ptr_array_add (ssh_cmd, g_strdup ("ControlPersist=\"yes\"")); + g_ptr_array_add (ssh_cmd, g_strdup ("-o")); + g_ptr_array_add (ssh_cmd, g_strdup_printf ("ControlPath=\"%s\"", self->control_path)); + + /* Force ssh process to background. */ + g_ptr_array_add (ssh_cmd, g_strdup ("-f")); + + /* Do not execute commands, we just want to have a master connection. */ + g_ptr_array_add (ssh_cmd, g_strdup ("-N")); + + /* We do not need a pseudo terminal. */ + g_ptr_array_add (ssh_cmd, g_strdup ("-T")); + + /* Let process terminate if it wasn't able to connect or set up sockets. */ + g_ptr_array_add (ssh_cmd, g_strdup ("-o")); + g_ptr_array_add (ssh_cmd, g_strdup ("ExitOnForwardFailure=\"yes\"")); + /* Fetch options object. */ X2GoClientNetworkOptionsSSH *options = NULL; g_object_get (G_OBJECT (self), "options", &options, NULL); @@ -1275,27 +1296,6 @@ static gboolean x2goclient_network_ssh_parent_connect (const gpointer ptr, GErro } } - /* Add control path options. */ - g_ptr_array_add (ssh_cmd, g_strdup ("-o")); - g_ptr_array_add (ssh_cmd, g_strdup ("ControlMaster=\"yes\"")); - g_ptr_array_add (ssh_cmd, g_strdup ("-o")); - g_ptr_array_add (ssh_cmd, g_strdup ("ControlPersist=\"yes\"")); - g_ptr_array_add (ssh_cmd, g_strdup ("-o")); - g_ptr_array_add (ssh_cmd, g_strdup_printf ("ControlPath=\"%s\"", self->control_path)); - - /* Force ssh process to background. */ - g_ptr_array_add (ssh_cmd, g_strdup ("-f")); - - /* Do not execute commands, we just want to have a master connection. */ - g_ptr_array_add (ssh_cmd, g_strdup ("-N")); - - /* We do not need a pseudo terminal. */ - g_ptr_array_add (ssh_cmd, g_strdup ("-T")); - - /* Let process terminate if it wasn't able to connect or set up sockets. */ - g_ptr_array_add (ssh_cmd, g_strdup ("-o")); - g_ptr_array_add (ssh_cmd, g_strdup ("ExitOnForwardFailure=\"yes\"")); - /* Try to call uptime. */ g_ptr_array_add (ssh_cmd, g_strdup ("uptime")); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 65ef9caa88a0a07249ba78bb9ae4713cf0bc55bc Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 30 04:36:28 2021 +0200 src/x2goclient-network-ssh.h: use comment hack to "escape" whitespace and newline characters within tags in documentation. --- src/x2goclient-network-ssh.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/x2goclient-network-ssh.h b/src/x2goclient-network-ssh.h index 0c86060..f7da951 100644 --- a/src/x2goclient-network-ssh.h +++ b/src/x2goclient-network-ssh.h @@ -59,9 +59,9 @@ X2GoClientNetworkSSH* x2goclient_network_ssh_new (const gchar * const session_pa * @X2GOCLIENT_NETWORK_SSH_ERROR_PORT_CONV_TOO_BIG: port value to parse was * bigger than allowed by * common port specifications - * <constant> - * 65535 - * </constant>. + * <constant><!-- + * -->65535<!-- + * --></constant>. * @X2GOCLIENT_NETWORK_SSH_ERROR_PORT_CONV_NEGATIVE_ZERO: port value to parse * was either negative, * which is not allowed -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 2b082697b097a34002a5f6a9e663a4c9042d17e2 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Aug 2 17:02:35 2021 +0200 src/x2goclient-utils.c: fix typos while referencing function parameters (percent character vs. at character). --- src/x2goclient-utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/x2goclient-utils.c b/src/x2goclient-utils.c index 9c7eeb5..59e7c6c 100644 --- a/src/x2goclient-utils.c +++ b/src/x2goclient-utils.c @@ -119,9 +119,9 @@ void x2goclient_clear_strings (gpointer data) { * If the pointer passed as @end is not %NULL its value will be set to the * first character after the parsed integer value like strtoll() does under * the following circumstances: - * - If %conv_err is %FALSE. - * - If %conv_err is %TRUE and %min_err is %TRUE. - * - If %conv_err is %TRUE and %max_err is %TRUE. + * - If @conv_err is %FALSE. + * - If @conv_err is %TRUE and @min_err is %TRUE. + * - If @conv_err is %TRUE and @max_err is %TRUE. * Otherwise, the pointer value will not be a meaningful one and you should not * use or rely on it. * -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 56bf1f99de5605a889a541e740a3c781e20ea015 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 30 01:53:21 2021 +0200 src/x2goclient-network-ssh.c: fix compile warning by using universal zero initializer first and then overriding fields as necessary. --- src/x2goclient-network-ssh.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 982f92f..2c34dba 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -864,7 +864,8 @@ static GSocketAddress* x2goclient_network_ssh_parse_sockspec_alias (const GStrin * Parsed everything successfully so far, so create native socket address * object. */ - sockaddr_ho tmp_sockaddr = { AF_HOST, }; + sockaddr_ho tmp_sockaddr = { 0 }; + tmp_sockaddr.sho_family = AF_HOST; g_strlcpy (tmp_sockaddr.sho_addr, address->str, (max_len + 1)); tmp_sockaddr.sho_port = port; ret = g_native_socket_address_new (&tmp_sockaddr, sizeof (sockaddr_ho)); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit b086b8a4841b7da07238d86e59fd74947e528a5d Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 30 01:58:13 2021 +0200 src/x2goclient-utils.{c,h}: have x2goclient_bool_to_str () return const gchar *, since it's a static string. --- src/x2goclient-utils.c | 6 +++--- src/x2goclient-utils.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/x2goclient-utils.c b/src/x2goclient-utils.c index 59e7c6c..5f61dad 100644 --- a/src/x2goclient-utils.c +++ b/src/x2goclient-utils.c @@ -270,12 +270,12 @@ gchar* x2goclient_strbrk_dup (gchar * restrict * const haystack, const char need * * Takes a boolean and converts it to a (static) string. * - * Returns: (transfer none): the converted value as a string + * Returns: (transfer none): the converted value as a static string * * Since: 0.0.0 */ -gchar* x2goclient_bool_to_str (const gboolean in) { - gchar *ret = "false"; +const gchar* x2goclient_bool_to_str (const gboolean in) { + const gchar *ret = "false"; if (in) { ret = "true"; diff --git a/src/x2goclient-utils.h b/src/x2goclient-utils.h index dad8037..5295495 100644 --- a/src/x2goclient-utils.h +++ b/src/x2goclient-utils.h @@ -137,7 +137,7 @@ void x2goclient_clear_strings (gpointer const data); long long x2goclient_str_to_int (const gchar * const restrict str, const _Bool min, const long long int limit_min, const _Bool max, const long long int limit_max, const gchar ** const restrict end, _Bool * const restrict conv_err, _Bool * const restrict min_err, _Bool * const restrict max_err); gchar* x2goclient_strbrk_dup (gchar * restrict * const haystack, const char needle, const _Bool free_orig, gsize * const new_size); -gchar* x2goclient_bool_to_str (const gboolean in); +const gchar* x2goclient_bool_to_str (const gboolean in); G_END_DECLS -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 3f68489a1ee193679ff1f7ab922f6c4fe71f0f9e Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 30 04:42:06 2021 +0200 src/x2goclient-openssh-version.h: link own class in documentation. --- src/x2goclient-openssh-version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x2goclient-openssh-version.h b/src/x2goclient-openssh-version.h index 1c60a9d..dd74736 100644 --- a/src/x2goclient-openssh-version.h +++ b/src/x2goclient-openssh-version.h @@ -156,7 +156,7 @@ void x2goclient_openssh_version_free (X2GoClientOpenSSHVersion * const openssh_v * not be * allocated. * - * Error message types as used within X2GoClientOpenSSHVersion. May be passed + * Error message types as used within #X2GoClientOpenSSHVersion. May be passed * out via #GError instances. * * Since: 0.0.0 -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 8e661a22516685a399512dd975a88df4bafed331 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 30 03:54:17 2021 +0200 src/x2goclient-network-ssh.c: reference X2GoClientNetwork:options property in x2goclient_network_ssh_connect () documentation, since no X2GoClientNetworkSSH:options property exists, but also make clear that this class/function expects an X2GoClientNetworkOptionsSSH instance being bound to the property. Make sure to check for that in x2goclient_network_ssh_parent_connect (). --- src/x2goclient-network-ssh.c | 36 ++++++++++++++++++++++++------------ src/x2goclient-network-ssh.h | 2 ++ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 2c34dba..24ebd26 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -1080,8 +1080,10 @@ static gboolean x2goclient_network_ssh_kill_subprocesses (X2GoClientNetworkSSH * * #X2GoClientNetwork:connected property. * * The connection parameters are looked up from the - * #X2GoClientNetwork:socket, #X2GoClientNetworkSSH:options and - * #X2GoClientNetwork:session-path properties. + * #X2GoClientNetwork:socket, #X2GoClientNetwork:options and + * #X2GoClientNetwork:session-path properties. It is expected (and checked) + * that a #X2GoClientNetworkOptionsSSH instance is bound to the + * #X2GoClientNetwork:options property. * * Currently, the control socket path is hardcoded to * <filename><varname>session-path</varname>/ssh/control</filename>. @@ -1245,21 +1247,31 @@ static gboolean x2goclient_network_ssh_parent_connect (const gpointer ptr, GErro g_object_get (G_OBJECT (self), "options", &options, NULL); if (options) { - /* Get string-array representation. */ - GPtrArray *options_arr = x2goclient_network_options_ssh_to_array (options); - - if (!(options_arr)) { - g_set_error_literal (gerr, X2GOCLIENT_NETWORK_SSH_ERROR, X2GOCLIENT_NETWORK_SSH_ERROR_CONNECT_OPTIONS_INVALID, "Unable to convert options structure to an array, can't connect."); + /* + * Check if it's actually an X2GoClientOptionsSSH instance - it might not + * be. + */ + if (!(X2GOCLIENT_IS_NETWORK_OPTIONS_SSH (options))) { + g_set_error_literal (gerr, X2GOCLIENT_NETWORK_SSH_ERROR, X2GOCLIENT_NETWORK_SSH_ERROR_CONNECT_OPTIONS_INVALID, "Options structure is not of expected type X2GoClientNetworkOptionsSSH."); ret = FALSE; } else { - /* Add each element to command. */ - for (size_t i = 0; i < options_arr->len; ++i) { - g_ptr_array_add (ssh_cmd, g_strdup ("-o")); - g_ptr_array_add (ssh_cmd, g_strdup ((gchar *)g_ptr_array_index (options_arr, i))); + /* Get string-array representation. */ + GPtrArray *options_arr = x2goclient_network_options_ssh_to_array (options); + + if (!(options_arr)) { + g_set_error_literal (gerr, X2GOCLIENT_NETWORK_SSH_ERROR, X2GOCLIENT_NETWORK_SSH_ERROR_CONNECT_OPTIONS_INVALID, "Unable to convert options structure to an array, can't connect."); + ret = FALSE; } + else { + /* Add each element to command. */ + for (size_t i = 0; i < options_arr->len; ++i) { + g_ptr_array_add (ssh_cmd, g_strdup ("-o")); + g_ptr_array_add (ssh_cmd, g_strdup ((gchar *)g_ptr_array_index (options_arr, i))); + } - g_ptr_array_unref (options_arr); + g_ptr_array_unref (options_arr); + } } } diff --git a/src/x2goclient-network-ssh.h b/src/x2goclient-network-ssh.h index 05150ca..2650a95 100644 --- a/src/x2goclient-network-ssh.h +++ b/src/x2goclient-network-ssh.h @@ -91,6 +91,8 @@ X2GoClientNetworkSSH* x2goclient_network_ssh_new (const gchar * const session_pa * address type in * connect function. * @X2GOCLIENT_NETWORK_SSH_ERROR_CONNECT_OPTIONS_INVALID: options structure + * was not of the + * expected type or * could not be parsed * into string array in * connect function. -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 932cdb5a19d727c4278921193672603f4fea2bc5 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Aug 2 16:56:32 2021 +0200 src/x2goclient-utils.c: add emphasis to capital-type words. --- src/x2goclient-utils.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/x2goclient-utils.c b/src/x2goclient-utils.c index f274e24..9c7eeb5 100644 --- a/src/x2goclient-utils.c +++ b/src/x2goclient-utils.c @@ -81,8 +81,8 @@ void x2goclient_clear_strings (gpointer data) { * * Takes a string and converts it into a #long long int. * - * The error output parameters @conv_err, @min_err and @max_err MUST NOT be - * %NULL at any time. + * The error output parameters @conv_err, @min_err and @max_err + * <emphasis role='strong'>MUST NOT</emphasis> be %NULL at any time. * * Multiple error conditions exist: * - If the value pointed to by @conv_err is %TRUE and the values pointed to @@ -108,8 +108,9 @@ void x2goclient_clear_strings (gpointer data) { * check. The returned value will still contain the originally converted * number. * - * The values pointed to by @conv_err, @min_err and @max_err SHOULD never be - * all set to %TRUE by this function at the same time. Otherwise, that's a bug. + * The values pointed to by @conv_err, @min_err and @max_err <emphasis + * role='strong'>SHOULD</emphasis> never be all set to %TRUE by this function + * at the same time. Otherwise, that's a bug. * * If the value pointed to by @min is %FALSE, @limit_min will not be touched * and has no meaning to the function. The same logic applies to @max and @@ -193,18 +194,21 @@ long long x2goclient_str_to_int (const gchar * const restrict str, const _Bool m * string's (iff truncated) size is returned via @new_size, unless an error * occurred. * - * The input parameter @haystack MUST NOT be %NULL at any time. - * The input parameter @needle CAN be %NULL, but that's hardly useful, since it - * effectively degrades the function to (a probably slower implementation of) - * strdup(). - * The output parameter @new_size CAN be %NULL. + * The input parameter @haystack <emphasis role='strong'>MUST NOT</emphasis> + * be %NULL at any time. + * The input parameter @needle <emphasis role='strong'>CAN</emphasis> be + * %NULL, but that's hardly useful, since it effectively degrades the function + * to (a probably slower implementation of) strdup(). + * The output parameter @new_size <emphasis role='strong'>CAN</emphasis> be + * %NULL. * * Errors are indicated by returning %NULL: * - If the value of @haystack is %NULL, no work will be done. * - If the value pointed to by @haystack is %NULL, no work will be done. - * - If memory allocation failed, the value pointed to by @haystack WILL - * NOT be changed and NOT be g_free()'d. The caller will have to clean - * up. @new_size will not be touched. + * - If memory allocation failed, the value pointed to by @haystack + * <emphasis role='strong'>WILL NOT</emphasis> be changed and <emphasis + * role='strong'>NOT</emphasis> be g_free()'d. The caller will have to + * clean up. @new_size will not be touched. * * Otherwise, the return value will be non-%NULL: * - If the value pointed to by @haystack does not contain @needle, a copy -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit cb1bf1c49b19f193ab0dd504cbb9cb9df865fb31 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Aug 2 16:51:35 2021 +0200 src/x2goclient-utils.c: change "long long" references to "long long int". --- src/x2goclient-utils.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/x2goclient-utils.c b/src/x2goclient-utils.c index 2f8590a..f274e24 100644 --- a/src/x2goclient-utils.c +++ b/src/x2goclient-utils.c @@ -79,7 +79,7 @@ void x2goclient_clear_strings (gpointer data) { * value exceeds maximum limit * and on overflows * - * Takes a string and converts it into a #long long integer. + * Takes a string and converts it into a #long long int. * * The error output parameters @conv_err, @min_err and @max_err MUST NOT be * %NULL at any time. @@ -91,12 +91,12 @@ void x2goclient_clear_strings (gpointer data) { * contain a meaningful value. * - If the values pointed to by @conv_err and @min_err are both %TRUE, an * underflow occurred and the scanned input value was smaller than the - * minimum representable value by #long long. The return value will - * not contain a meaningful value. + * minimum representable value by #long long int. The return + * value will not contain a meaningful value. * - If the values pointed to by @conv_err and @max_err are both %TRUE, an * overflow occurred and the scanned input value was higher than the - * maximum representable value by #long long. The return value will - * not contain a meaningful value. + * maximum representable value by #long long int. The return + * value will not contain a meaningful value. * - If the value pointed to by @conv_err is %FALSE and the value pointed to * by @min_err is %TRUE, the value was converted successfully but was * lower than the value passed via @limit_min and failed the minimum @@ -124,7 +124,8 @@ void x2goclient_clear_strings (gpointer data) { * Otherwise, the pointer value will not be a meaningful one and you should not * use or rely on it. * - * Returns: the converted value as a #long long, unless an error occurred + * Returns: the converted value as a #long long int, unless an error + * occurred * * Since: 0.0.0 */ -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 18da07f787ff9f7f9acfb61ff9e3433513c8bcfe Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Aug 2 16:47:20 2021 +0200 src/x2goclient-{network{,-options}-ssh,openssh-{bugs,version},utils}.c: add title tags to final classes in order to generate the proper names. A different workaround would be to declare useless ...Class structures for final classes, since that seems to make gtk-doc auto-generate the correct name (as extracted from the ...Class structure name). However, such structures are useless for final classes, since the general idea for them is to put everything into the instance structure. We do not want that. --- src/x2goclient-network-options-ssh.c | 1 + src/x2goclient-network-ssh.c | 1 + src/x2goclient-openssh-bugs.c | 1 + src/x2goclient-openssh-version.c | 1 + src/x2goclient-utils.c | 7 +++++++ 5 files changed, 11 insertions(+) diff --git a/src/x2goclient-network-options-ssh.c b/src/x2goclient-network-options-ssh.c index 8722a29..40666b1 100644 --- a/src/x2goclient-network-options-ssh.c +++ b/src/x2goclient-network-options-ssh.c @@ -39,6 +39,7 @@ /** * SECTION:x2goclient-network-options-ssh + * @title: X2GoClientNetworkOptionsSSH * @short_description: Class encapsulating OpenSSH options * @see_also: #X2GoClientNetworkOptions * @stability: Unstable diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index cb246a6..982f92f 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -102,6 +102,7 @@ typedef struct sockaddr_ho_ { /** * SECTION:x2goclient-network-ssh + * @title: X2GoClientNetworkSSH * @short_description: Class encapsulating an OpenSSH (client) network * connection * @see_also: #X2GoClientNetwork diff --git a/src/x2goclient-openssh-bugs.c b/src/x2goclient-openssh-bugs.c index cfcc798..9456137 100644 --- a/src/x2goclient-openssh-bugs.c +++ b/src/x2goclient-openssh-bugs.c @@ -33,6 +33,7 @@ /** * SECTION:x2goclient-openssh-bugs + * @title: X2GoClientOpenSSHBugs * @short_description: Class encapsulating OpenSSH client bug definitions * @stability: Unstable * @include: libx2goclient/x2goclient-openssh-bugs.h diff --git a/src/x2goclient-openssh-version.c b/src/x2goclient-openssh-version.c index 52acdbc..470e147 100644 --- a/src/x2goclient-openssh-version.c +++ b/src/x2goclient-openssh-version.c @@ -37,6 +37,7 @@ /** * SECTION:x2goclient-openssh-version + * @title: X2GoClientOpenSSHVersion * @short_description: Class encapsulating and parsing OpenSSH client versions * @stability: Unstable * @include: libx2goclient/x2goclient-openssh-version.h diff --git a/src/x2goclient-utils.c b/src/x2goclient-utils.c index 01e0fb1..9247fa4 100644 --- a/src/x2goclient-utils.c +++ b/src/x2goclient-utils.c @@ -31,6 +31,13 @@ #include "x2goclient-utils.h" +/** + * SECTION:x2goclient-utils + * @title: X2GoClientUtils + * + * Since: 0.0.0 + */ + /** * x2goclient_clear_strings: * @data: (in) (nullable): input string -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit db43631b86e5ed5c7abab23221557c979a7baf77 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 30 19:14:26 2021 +0200 src/Makefile.am: add x2goclient-network-stub.{c,h}. --- src/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Makefile.am b/src/Makefile.am index c01496a..04b04d3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -36,6 +36,7 @@ libx2goclientinclude_HEADERS = \ x2goclient-network-options.h \ x2goclient-network-options-ssh.h \ x2goclient-network-ssh.h \ + x2goclient-network-stub.h \ x2goclient-proxy-start-nx.h \ x2goclient-renderer-start-kdrive.h \ x2goclient-object.h \ @@ -55,6 +56,7 @@ libx2goclient_la_SOURCES = \ x2goclient-network-options.c \ x2goclient-network-options-ssh.c \ x2goclient-network-ssh.c \ + x2goclient-network-stub.c \ x2goclient-proxy-start-nx.c \ x2goclient-renderer-start-kdrive.c \ x2goclient-object.c \ -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 4b9bdb04e4a4ccf8e73d101e86c1f4cfc293f72c Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 30 19:07:22 2021 +0200 src/: add x2goclient-network-stub.{c,h}. This is a final class inheriting from X2GoClientNetwork that does nothing. We'll use this explicitly for testing purposes only. --- src/x2goclient-network-stub.c | 318 ++++++++++++++++++++++++++++++++++++++++++ src/x2goclient-network-stub.h | 52 +++++++ 2 files changed, 370 insertions(+) diff --git a/src/x2goclient-network-stub.c b/src/x2goclient-network-stub.c new file mode 100644 index 0000000..b947df4 --- /dev/null +++ b/src/x2goclient-network-stub.c @@ -0,0 +1,318 @@ +/* -*- Mode: C; c-set-style: linux indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 8 -*- */ + +/* x2goclient-network-stub.c - X2Go Client stub network handling + + Copyright (C) 2019-2020 Mike Gabriel + Copyright (C) 2019-2020 Mihai Moldovan + All rights reserved. + + The libx2goclient library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The libx2goclient library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the Mate Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301, USA. + */ + +#include <stdbool.h> + +#include <glib.h> +#include <glib/gi18n.h> +#include <gmodule.h> +#include <gio/gio.h> + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "x2goclient.h" +#include "x2goclient-network-stub.h" + + +/** + * SECTION:x2goclient-network-stub + * @title: X2GoClientNetworkStub + * @short_description: Class faking a network connection + * @see_also: #X2GoClientNetwork + * @stability: Unstable + * @include: libx2goclient/x2goclient-network-stub.h + * + * #X2GoClientNetworkStub is a class faking network connections. + * + * It's only meant for testing purposes. + * + * An example of a more abstract implementation is #X2GoClientNetwork. + */ + +/** + * X2GoClientNetworkStub: + * + * #X2GoClientNetworkStub is an opaque data structure and can only be accessed + * using the following functions. + */ +struct _X2GoClientNetworkStub { + X2GoClientNetwork parent_instance; +}; + +G_DEFINE_TYPE (X2GoClientNetworkStub, x2goclient_network_stub, X2GOCLIENT_TYPE_NETWORK) + + +static void x2goclient_network_stub_dispose (GObject * const object); +static void x2goclient_network_stub_finalize (GObject * const object); +static gboolean x2goclient_network_stub_parent_connect (const gpointer parent, GError ** const gerr); +static gboolean x2goclient_network_stub_parent_disconnect (const gpointer parent, GError ** const gerr); + + +static void x2goclient_network_stub_class_init (X2GoClientNetworkStubClass * const klass) { + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->dispose = &x2goclient_network_stub_dispose; + object_class->dispose = &x2goclient_network_stub_finalize; + + X2GoClientNetworkClass *parent_class = X2GOCLIENT_NETWORK_CLASS (klass); + + parent_class->derived_connect = &x2goclient_network_stub_parent_connect; + parent_class->derived_disconnect = &x2goclient_network_stub_parent_disconnect; + parent_class->parse_sockspec = NULL; +} + +static void x2goclient_network_stub_init (X2GoClientNetworkStub * const self) { + (void) self; +} + +X2GoClientNetworkStub* x2goclient_network_stub_new (void) { + X2GoClientNetworkStub *ret = NULL; + + ret = (X2GoClientNetworkStub*)(g_object_new (X2GOCLIENT_TYPE_NETWORK_STUB, NULL)); + + return (ret); +} + +static void x2goclient_network_stub_dispose (GObject * const object) { + (G_OBJECT_CLASS (x2goclient_network_stub_parent_class))->dispose (object); +} + +static void x2goclient_network_stub_finalize (GObject * const object) { + X2GoClientNetworkStub *self = X2GOCLIENT_NETWORK_STUB (object); + (void) self; + + (G_OBJECT_CLASS (x2goclient_network_stub_parent_class))->finalize (object); +} + +/** + * x2goclient_network_stub_connect: + * @self: (in) (not optional): pointer to the #X2GoClientNetworkStub instance. + * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not + * interested. + * + * Wraps the stub connect function. + * + * This function can be called on #X2GoClientNetworkStub objects and chains up + * through the inheritance chain, eventually calling the actual connection + * function, x2goclient_network_stub_parent_connect(). + * + * x2goclient_network_stub_parent_connect() does nothing other than printing a + * message and updating the #X2GoClientNetwork:connected property. + * + * This function is idempotent. + * + * Calling this function should be functionally equivalent to calling the + * parent's connect function: + * + * <informalexample> + * <programlisting language='C'> + * // Assume that this variable is pointing to a fully setup + * // #X2GoClientNetworkStub instance. + * X2GoClientNetworkStub *net_stub = magic_stub_object; + * + * // This part should be equivalent to the later one. + * gboolean conn_ret = x2goclient_network_stub_connect (net_stub, NULL); + * if (conn_ret) { + * x2goclient_network_stub_disconnect (net_stub, NULL); + * } + * + * // To this one. + * conn_ret = x2goclient_network_connect ((X2GoClientNetwork*) (net_stub), + * NULL); + * if (conn_ret) { + * x2goclient_network_disconnect ((X2GoClientNetwork*) (net_stub), NULL); + * } + * </programlisting> + * </informalexample> + * + * Returns: a #gboolean value indicating success (%TRUE) or failure (%FALSE). + * + * Since: 0.0.0 + */ +gboolean x2goclient_network_stub_connect (X2GoClientNetworkStub * const self, GError ** const gerr) { + gboolean ret = FALSE; + + g_return_val_if_fail (X2GOCLIENT_IS_NETWORK_STUB (self), ret); + g_return_val_if_fail (((NULL == gerr) || (NULL == *gerr)), ret); + + X2GoClientNetwork *parent = X2GOCLIENT_NETWORK (self); + X2GoClientNetworkClass *parent_class = X2GOCLIENT_NETWORK_GET_CLASS (parent); + + /* Just chain up here. */ + g_assert (parent_class->connect); + + if (parent_class->connect) { + ret = parent_class->connect (parent, gerr); + } + + return (ret); +} + +/* + * x2goclient_network_stub_parent_connect: + * @ptr: (in) (not optional): pointer to the #X2GoClientNetwork parent + * instance. + * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not + * interested. + * + * Prints a message and does nothing else. + * + * For documentation of its internal behavior, refer to the public function + * x2goclient_network_stub_connect(). + * + * This function is <emphasis role='strong'>not</emphasis> idempotent. + * + * This function should not be called by user code. It's meant to be the + * private connect function of this class, also showcased by the fact that it + * is not idempotent. + * + * User code should call the public functions + * x2goclient_network_stub_connect() on #X2GoClientNetworkStub objects, or + * x2goclient_network_connect() on #X2GoClientNetwork objects. The latter + * function redirects to/automatically calls the more specific connection + * function of the derived class, which, for #X2GoClientNetworkStub objects, + * should be functionally equivalent to calling + * x2goclient_network_stub_connect() directly. + * + * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or + * failure (%FALSE). + * + * Since: 0.0.0 + */ +static gboolean x2goclient_network_stub_parent_connect (const gpointer ptr, GError ** const gerr) { + gboolean ret = FALSE; + + g_return_val_if_fail (X2GOCLIENT_IS_NETWORK_STUB (ptr), ret); + g_return_val_if_fail (((NULL == gerr) || (NULL == *gerr)), ret); + + X2GoClientNetworkStub *self = X2GOCLIENT_NETWORK_STUB (ptr); + (void) self; + + /* Actual implementation here. */ + + /* + * We'll hang down through ret to run or skip steps depending on previous + * failures, so make sure it's initialized to no error. + */ + ret = TRUE; + + g_log (NULL, G_LOG_LEVEL_DEBUG, "Called x2goclient_network_stub_parent_connect"); + + return (ret); +} + +/** + * x2goclient_network_stub_disconnect: + * @self: (in) (not optional): pointer to the #X2GoClientNetworkStub instance. + * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not + * interested. + * + * Wraps the stub disconnect function. + * + * This function can be called on #X2GoClientNetworkStub objects and chains up + * through the inheritance chain, eventually calling the actual disconnection + * function, x2goclient_network_stub_parent_disconnect(). + * + * x2goclient_network_stub_parent_disconnect() does nothing useful other than + * to print a message. + * + * For more information, see also x2goclient_network_stub_connect(), which + * documents the connection parameters and example usage. + * + * This function is idempotent. + * + * Returns: a #gboolean value indicating success (%TRUE) or failure (%FALSE). + * + * Since: 0.0.0 + */ +gboolean x2goclient_network_stub_disconnect (X2GoClientNetworkStub * const self, GError ** const gerr) { + gboolean ret = FALSE; + + g_return_val_if_fail (X2GOCLIENT_IS_NETWORK_STUB (self), ret); + g_return_val_if_fail (((NULL == gerr) || (NULL == *gerr)), ret); + + X2GoClientNetwork *parent = X2GOCLIENT_NETWORK (self); + X2GoClientNetworkClass *parent_class = X2GOCLIENT_NETWORK_GET_CLASS (parent); + + /* Just chain up here. */ + g_assert (parent_class->disconnect); + + if (parent_class->disconnect) { + ret = parent_class->disconnect (parent, gerr); + } + + return (ret); +} + +/* + * x2goclient_network_stub_parent_disconnect: + * @ptr: (in) (not optional): pointer to the #X2GoClientNetwork parent + * instance. + * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not + * interested. + * + * Prints a message and does nothing else. + * + * For documentation of its internal behavior, refer to the public + * x2goclient_network_stub_disconnect() function. + * + * This function is <emphasis role='strong'>not</emphasis> idempotent. + * + * This function should not be called by user code. It's meant to be the + * private disconnect function of this class, also showcased by the fact that + * it is not idempotent. + * + * User code should call the public functions + * x2goclient_network_stub_disconnect() on #X2GoClientNetworkStub objects, or + * x2goclient_network_disconnect() on #X2GoClientNetwork objects. The latter + * function redirects to/automatically calls the more specific disconnection + * function of the derived class, which, for #X2GoClientNetworkStub objects, + * should be functionally equivalent to calling + * x2goclient_network_stub_disconnect() directly. + * + * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or + * failure (%FALSE). + * + * Since: 0.0.0 + */ +static gboolean x2goclient_network_stub_parent_disconnect (const gpointer ptr, GError ** const gerr) { + gboolean ret = FALSE; + + g_return_val_if_fail (X2GOCLIENT_IS_NETWORK_STUB (ptr), ret); + g_return_val_if_fail (((NULL == gerr) || (NULL == *gerr)), ret); + + X2GoClientNetworkStub *self = X2GOCLIENT_NETWORK_STUB (ptr); + (void) self; + + /* Actual implementation here. */ + + /* Most things can't really fail, so prepare for success. */ + ret = TRUE; + + g_log (NULL, G_LOG_LEVEL_DEBUG, "Called x2goclient_network_stub_parent_disconnect"); + + return (ret); +} diff --git a/src/x2goclient-network-stub.h b/src/x2goclient-network-stub.h new file mode 100644 index 0000000..37089dd --- /dev/null +++ b/src/x2goclient-network-stub.h @@ -0,0 +1,52 @@ +/* -*- Mode: C; c-set-style: linux indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 8 -*- */ + +/* x2goclient-network-stub.h - X2Go Client stub network handling + + Copyright (C) 2019-2020 Mike Gabriel + Copyright (C) 2019-2020 Mihai Moldovan + All rights reserved. + + The libx2goclient library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The libx2goclient library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the Mate Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301, USA. + */ + +#ifndef x2goclient_network_stub_h +#define x2goclient_network_stub_h + +#include <glib-object.h> +#include <gmodule.h> + +#include "x2goclient-network.h" + +G_BEGIN_DECLS + +#define X2GOCLIENT_TYPE_NETWORK_STUB (x2goclient_network_stub_get_type ()) +G_DECLARE_FINAL_TYPE (X2GoClientNetworkStub, x2goclient_network_stub, X2GOCLIENT, NETWORK_STUB, X2GoClientNetwork) + +X2GoClientNetworkStub* x2goclient_network_stub_new (void); + + +/* + * Error handling helpers. + */ +#define X2GOCLIENT_NETWORK_STUB_ERROR g_quark_from_static_string ("x2goclient-network-stub") + + +gboolean x2goclient_network_stub_connect (X2GoClientNetworkStub * const self, GError ** const gerr); +gboolean x2goclient_network_stub_disconnect (X2GoClientNetworkStub * const self, GError ** const gerr); + +G_END_DECLS + +#endif /* x2goclient_network_stub_h */ -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 84a83092be46f3b491572bc948a68018375ae110 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 30 19:15:26 2021 +0200 po/POTFILES.in: add src/x2goclient-network-stub.c. --- po/POTFILES.in | 1 + 1 file changed, 1 insertion(+) diff --git a/po/POTFILES.in b/po/POTFILES.in index 1946e71..45b7a93 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -5,6 +5,7 @@ src/x2goclient-network.c src/x2goclient-network-options.c src/x2goclient-network-options-ssh.c src/x2goclient-network-ssh.c +src/x2goclient-network-stub.c src/x2goclient-proxy-start-nx.c src/x2goclient-object.c src/x2goclient-openssh-bugs.c -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit a167cd52a4edde3562143ff44cdfcc0e8c5d1ea2 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Oct 30 18:18:49 2021 +0200 docs/reference/libx2goclient/Makefile.am: force regeneration of sections.txt file as part of every gtkdoc-scan run. By default, gtk-doc doesn't update the sections.txt file, which means that changes to classes like added or removed symbols won't be applied to the generated documentation. This might generally make sense, since the file is supposed to be auto-generated if it does not exist and later on modified manually. Regenerating the file every time would overwrite manual changes. We, however, do not intend to modify this file manually (yet, anyway). Due to this, we can just force updates. --- docs/reference/libx2goclient/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/libx2goclient/Makefile.am b/docs/reference/libx2goclient/Makefile.am index b25dd6a..3eb5c64 100644 --- a/docs/reference/libx2goclient/Makefile.am +++ b/docs/reference/libx2goclient/Makefile.am @@ -53,7 +53,7 @@ SCANGOBJ_OPTIONS= # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" -SCAN_OPTIONS= +SCAN_OPTIONS=--rebuild-sections # Extra options to supply to gtkdoc-mkdb # e.g. MKDB_OPTIONS=--xml-mode --output-format=xml -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 7c1bb6e9641546df33a8d6ca0d7c9967ef9ac84f Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 30 19:34:18 2021 +0200 src/test/sshtest.c: sprinkle network stub class in. --- src/test/sshtest.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/sshtest.c b/src/test/sshtest.c index 93c9444..7e741aa 100644 --- a/src/test/sshtest.c +++ b/src/test/sshtest.c @@ -41,6 +41,7 @@ #include "x2goclient.h" #include "x2goclient-network-ssh.h" +#include "x2goclient-network-stub.h" #define _(String) gettext (String) @@ -228,13 +229,17 @@ static _Bool test_x2goclient_network_ssh_connect_after_connect (X2GoClientNetwor static _Bool test_x2goclient_network_ssh_connect (X2GoClientNetworkSSH *net_ssh, gboolean * const conn_ret, const _Bool use_super) { _Bool ret = (!(!(conn_ret))); + X2GoClientNetworkStub *net_stub = x2goclient_network_stub_new (); + if (ret) { /* Actually connect. */ g_printf ("Trying to connect...\n"); if (use_super) { + (void) x2goclient_network_connect ((X2GoClientNetwork*) (net_stub), NULL); (*conn_ret) = x2goclient_network_connect ((X2GoClientNetwork*) (net_ssh), NULL); } else { + (void) x2goclient_network_stub_connect (net_stub, NULL); (*conn_ret) = x2goclient_network_ssh_connect (net_ssh, NULL); } g_printf ("Connection status: %s.\n", x2goclient_bool_to_str (*conn_ret)); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 250e592c5d3a9916ea70b33bacf9c83146445408 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 30 19:35:03 2021 +0200 src/x2goclient-network-ssh.c: add debug statements to see when parent_{dis,}connect functions have been called. --- src/x2goclient-network-ssh.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index aa0a0e1..5619862 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -1187,6 +1187,8 @@ static gboolean x2goclient_network_ssh_parent_connect (const gpointer ptr, GErro */ ret = TRUE; + g_log (NULL, G_LOG_LEVEL_DEBUG, "Called x2goclient_network_ssh_parent_connect"); + /* "Calculate" socket path. */ gchar *session_path = NULL; g_object_get (G_OBJECT (self), "session-path", &session_path, NULL); @@ -1425,6 +1427,8 @@ static gboolean x2goclient_network_ssh_parent_disconnect (const gpointer ptr, GE /* Most things can't really fail, so prepare for success. */ ret = TRUE; + g_log (NULL, G_LOG_LEVEL_DEBUG, "Called x2goclient_network_ssh_parent_disconnect"); + /* Remove timeout source. */ g_mutex_lock (&(self->check_thread_mutex)); if (self->check_thread_loop) { -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 318ccb8bb2f0b3f6bd379e0d39b4d52cf5e1278b Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Dec 3 13:10:18 2021 +0100 src/x2goclient-{network-{ssh,stub},openssh-version}.c: remove (transfer full) annotation for basic data types/return by value. --- src/x2goclient-network-ssh.c | 30 ++++++++++-------------------- src/x2goclient-network-stub.c | 6 ++---- src/x2goclient-openssh-version.c | 4 ++-- 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 8c11e7f..0484135 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -1181,8 +1181,7 @@ gboolean x2goclient_network_ssh_connect (X2GoClientNetworkSSH * const self, GErr * for #X2GoClientNetworkSSH objects, should be functionally equivalent to * calling x2goclient_network_ssh_connect() directly. * - * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or - * failure (%FALSE). + * Returns: a #gboolean value indicating success (%TRUE) or failure (%FALSE). * * Since: 0.0.0 */ @@ -1424,8 +1423,7 @@ gboolean x2goclient_network_ssh_disconnect (X2GoClientNetworkSSH * const self, G * should be functionally equivalent to calling * x2goclient_network_ssh_disconnect() directly. * - * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or - * failure (%FALSE). + * Returns: a #gboolean value indicating success (%TRUE) or failure (%FALSE). * * Since: 0.0.0 */ @@ -1502,8 +1500,7 @@ static gboolean x2goclient_network_ssh_parent_disconnect (const gpointer ptr, GE * Fetches the OpenSSH client version and updates the read-only * #X2GoClientNetworkSSH:openssh-version property. * - * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or - * failure (%FALSE). + * Returns: a #gboolean value indicating success (%TRUE) or failure (%FALSE). * * Since: 0.0.0 */ @@ -1625,8 +1622,7 @@ static void x2goclient_network_ssh_log_std_str (const gchar * const str, const g * Elements in @arr must be strings. %NULL elements are explicitly allowed and * will be mapped to an internal representation: <literal>(NULL)</literal>. * - * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or - * failure (%FALSE). + * Returns: a #gboolean value indicating success (%TRUE) or failure (%FALSE). * * Since: 0.0.0 */ @@ -1833,8 +1829,7 @@ static void x2goclient_network_ssh_gptrarray_print_debug (GPtrArray * const arr, * Likewise, a port may have not been explicitly provided, indicated by the * port number 0 internally. In such cases, no port option is added. * - * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or - * failure (%FALSE). + * Returns: a #gboolean value indicating success (%TRUE) or failure (%FALSE). * * Since: 0.0.0 */ @@ -1954,8 +1949,7 @@ static gboolean x2goclient_network_ssh_sshcmd_add_host_port (X2GoClientNetworkSS * queried (as buffered by glib) and subsequently printed to the debug log * level. * - * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or - * failure (%FALSE). + * Returns: a #gboolean value indicating success (%TRUE) or failure (%FALSE). * * Since: 0.0.0 */ @@ -2183,8 +2177,7 @@ static gpointer x2goclient_network_ssh_check_timeout_thread_main (const gpointer * * This function will execute in the main thread. * - * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or - * failure (%FALSE). + * Returns: a #gboolean value indicating success (%TRUE) or failure (%FALSE). * * Since: 0.0.0 */ @@ -2247,8 +2240,7 @@ static void x2goclient_network_ssh_start_check_timeout_invoke (X2GoClientNetwork * * This function will execute in the check thread. * - * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or - * failure (%FALSE). + * Returns: a #gboolean value indicating success (%TRUE) or failure (%FALSE). * * Since: 0.0.0 */ @@ -2277,8 +2269,7 @@ static gboolean x2goclient_network_ssh_start_check_timeout_unwrap (const gpointe * * This function will execute in the check thread. * - * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or - * failure (%FALSE). + * Returns: a #gboolean value indicating success (%TRUE) or failure (%FALSE). * * Since: 0.0.0 */ @@ -2341,8 +2332,7 @@ static gboolean x2goclient_network_ssh_start_check_timeout_real (X2GoClientNetwo * * This function will execute in the check thread. * - * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or - * failure (%FALSE). + * Returns: a #gboolean value indicating success (%TRUE) or failure (%FALSE). * * Since: 0.0.0 */ diff --git a/src/x2goclient-network-stub.c b/src/x2goclient-network-stub.c index 5e35eed..5b3ac41 100644 --- a/src/x2goclient-network-stub.c +++ b/src/x2goclient-network-stub.c @@ -210,8 +210,7 @@ gboolean x2goclient_network_stub_connect (X2GoClientNetworkStub * const self, GE * should be functionally equivalent to calling * x2goclient_network_stub_connect() directly. * - * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or - * failure (%FALSE). + * Returns: a #gboolean value indicating success (%TRUE) or failure (%FALSE). * * Since: 0.0.0 */ @@ -306,8 +305,7 @@ gboolean x2goclient_network_stub_disconnect (X2GoClientNetworkStub * const self, * should be functionally equivalent to calling * x2goclient_network_stub_disconnect() directly. * - * Returns: (transfer full): a #gboolean value indicating success (%TRUE) or - * failure (%FALSE). + * Returns: a #gboolean value indicating success (%TRUE) or failure (%FALSE). * * Since: 0.0.0 */ diff --git a/src/x2goclient-openssh-version.c b/src/x2goclient-openssh-version.c index 5d94413..0bf343b 100644 --- a/src/x2goclient-openssh-version.c +++ b/src/x2goclient-openssh-version.c @@ -637,8 +637,8 @@ _Bool x2goclient_openssh_version_parse (X2GoClientOpenSSHVersion * const openssh * Fetches the OpenSSH version string as returned by <command>ssh -V</command> * and parses this output into an #X2GoClientOpenSSHVersion structure. * - * Returns: the populated #X2GoClientOpenSSHVersion structure on success or - * %NULL on error. + * Returns: (transfer full): the populated #X2GoClientOpenSSHVersion structure + * on success or %NULL on error. * * Since: 0.0.0 */ -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit c3f208e7dd3f0278f83c2bf4cb8bf5e00967297c Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Nov 5 03:59:55 2021 +0100 src/x2goclient-network-options-ssh.c: fix type name in documentation comment. --- src/x2goclient-network-options-ssh.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/x2goclient-network-options-ssh.c b/src/x2goclient-network-options-ssh.c index 40666b1..dc41e54 100644 --- a/src/x2goclient-network-options-ssh.c +++ b/src/x2goclient-network-options-ssh.c @@ -45,7 +45,8 @@ * @stability: Unstable * @include: libx2goclient/x2goclient-network-options-ssh.h * - * #X2GoClientNetworkOptions is a class used to encapsulate OpenSSH options. + * #X2GoClientNetworkOptionsSSH is a class used to encapsulate OpenSSH + * options. * * Currently, there are no common options that could be used generically for * all dependent classes, so it's essentially fully empty (yet providing the -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit d58a18c3045b5aa10fe0fe5934f3b19095f37327 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Nov 5 04:02:47 2021 +0100 src/x2goclient-network-options{,-ssh}.c: add missing class structure documentation. --- src/x2goclient-network-options-ssh.c | 6 ++++++ src/x2goclient-network-options.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/src/x2goclient-network-options-ssh.c b/src/x2goclient-network-options-ssh.c index dc41e54..7e3b3b4 100644 --- a/src/x2goclient-network-options-ssh.c +++ b/src/x2goclient-network-options-ssh.c @@ -54,6 +54,12 @@ * * An example of a more abstract implementation is #X2GoClientNetworkOptions. */ +/** + * X2GoClientNetworkOptionsSSH: + * + * #X2GoClientNetworkOptionsSSH is an opaque data structure and can only be + * accessed using the following functions. + */ struct _X2GoClientNetworkOptionsSSH { X2GoClientNetworkOptions parent_instance; diff --git a/src/x2goclient-network-options.c b/src/x2goclient-network-options.c index 3b38474..6c7a428 100644 --- a/src/x2goclient-network-options.c +++ b/src/x2goclient-network-options.c @@ -54,6 +54,13 @@ * Since: 0.0.0 */ +/** + * X2GoClientNetworkOptions: + * + * #X2GoClientNetworkOptions is an opaque data structure and can only be + * accessed using the following functions. + */ + /* Not sure if we need this, so comment out for now. */ /* typedef struct X2GoClientNetworkOptionsPrivate_ { -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit fd8be778e76e85019e7ce8eaa5247d4be358f637 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Dec 3 12:55:46 2021 +0100 src/x2goclient-{network{-options,}-ssh.c,network.h}: add input tag to documentation where necessary. --- src/x2goclient-network-options-ssh.c | 3 ++- src/x2goclient-network-ssh.c | 6 +++--- src/x2goclient-network.h | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/x2goclient-network-options-ssh.c b/src/x2goclient-network-options-ssh.c index 5d2fc08..816c337 100644 --- a/src/x2goclient-network-options-ssh.c +++ b/src/x2goclient-network-options-ssh.c @@ -95,7 +95,8 @@ X2GoClientNetworkOptionsSSH* x2goclient_network_options_ssh_new (void) { /** * x2goclient_network_options_ssh_to_array: - * @self: (not optional): pointer to an #X2GoClientNetworkOptionsSSH instance. + * @self: (in) (not optional): pointer to an #X2GoClientNetworkOptionsSSH + * instance. * * Converts the internal state to an #GPtrArray of SSH client options that can * be passed by prefixing <literal>-o</literal> to each entry when calling the diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 5619862..badb642 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -147,9 +147,9 @@ G_DEFINE_TYPE (X2GoClientNetworkSSH, x2goclient_network_ssh, X2GOCLIENT_TYPE_NET /* * x2goclient_network_ssh_check_timeout_data: - * @self: (not nullable): pointer to the #X2GoClientNetworkSSH instance. - * @gerr: (nullable): pointer to a #GError location, set to %NULL if not - * interested in precise errors. + * @self: (in) (not nullable): pointer to the #X2GoClientNetworkSSH instance. + * @gerr: (out) (nullable): pointer to a #GError location, set to %NULL if not + * interested in precise errors. * * Data structure used to pass common data to the timeout checking thread. * diff --git a/src/x2goclient-network.h b/src/x2goclient-network.h index 2660879..543a860 100644 --- a/src/x2goclient-network.h +++ b/src/x2goclient-network.h @@ -49,7 +49,8 @@ struct _X2GoClientNetworkClass { /** * X2GoClientNetworkClass::connect: - * @self: (not optional): pointer to an #X2GoClientNetwork instance. + * @self: (in) (not optional) (transfer none): pointer to an + * #X2GoClientNetwork instance. * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if * not interested. * -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit b915ebf510929b033742123e1ecb1e65a42b16a4 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Oct 30 19:11:11 2021 +0200 src/x2goclient-openssh-version.h: make version component valid structure entries unsigned. They are only supposed to be one bit in size, but semantically it makes sense to call them unsigned. --- src/x2goclient-openssh-version.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/x2goclient-openssh-version.h b/src/x2goclient-openssh-version.h index 9a37881..082171b 100644 --- a/src/x2goclient-openssh-version.h +++ b/src/x2goclient-openssh-version.h @@ -32,9 +32,9 @@ G_BEGIN_DECLS typedef struct X2GoClientOpenSSHVersion_ { - int minor_valid:1; - int major_valid:1; - int patch_valid:1; + unsigned int minor_valid:1; + unsigned int major_valid:1; + unsigned int patch_valid:1; guint32 major; guint32 minor; guint32 patch; -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit f55528d3d9bf4bb5efc7ab7274c97dfd1b8ca213 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Nov 5 04:10:56 2021 +0100 src/x2goclient-utils.h: fix macro names in documentation comments. --- src/x2goclient-utils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/x2goclient-utils.h b/src/x2goclient-utils.h index 5295495..54132b2 100644 --- a/src/x2goclient-utils.h +++ b/src/x2goclient-utils.h @@ -81,7 +81,7 @@ G_BEGIN_DECLS #ifdef HAVE_TYPEOF /** - * CHECK_TYPE_TYPEOF: + * X2GOCLIENT_CHECK_TYPE_TYPEOF: * @target: (in) (not optional): target variable, often a struct field. * @value: (in) (not optional): variable to check against @target. * @@ -108,7 +108,7 @@ G_BEGIN_DECLS } while (0) #else /** - * CHECK_TYPE_TYPEOF: + * X2GOCLIENT_CHECK_TYPE_TYPEOF: * @target: (in) (not optional): target variable, often a struct field. * @value: (in) (not optional): variable to check against @target. * -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 0b3c5e4aeb8106e9230937f34ba3f01b192d1290 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Oct 30 18:35:31 2021 +0200 src/x2goclient-openssh-bugs.{c,h}: move structure documentation back to header file. The structure will only be listed in the documentation if the documentation is part of header files, since structures are shown or hidden as part of running gtkdoc-scan and this program only looks at such files. Importantly, a structure with the same name as the class (i.e., an instance structure) is hidden by default, unless documentation for it exists. Documentation within source/implementation files are only parsed by gtkdoc-mkdb, though, which is executed at a later stage. --- src/x2goclient-openssh-bugs.c | 15 --------------- src/x2goclient-openssh-bugs.h | 15 +++++++++++++-- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/x2goclient-openssh-bugs.c b/src/x2goclient-openssh-bugs.c index 9456137..17b858b 100644 --- a/src/x2goclient-openssh-bugs.c +++ b/src/x2goclient-openssh-bugs.c @@ -48,21 +48,6 @@ * Since: 0.0.0 */ -/** - * X2GoClientOpenSSHBugs: - * @backgrounding_keeps_stderr: Normally, child processes should fully detach - * from the controlling terminal. OpenSSH is - * buggy in some cases and doesn't always do that. - * See - * <ulink - * url="https://bugzilla.mindrot.org/show_bug.cgi?id=3137"> - * OpenSSH Bug 3137</ulink>. - * - * Bugs in OpenSSH. - * - * Since: 0.0.0 - */ - X2GoClientOpenSSHBugs* x2goclient_openssh_bugs_new (void) { return (g_slice_new0 (X2GoClientOpenSSHBugs)); } diff --git a/src/x2goclient-openssh-bugs.h b/src/x2goclient-openssh-bugs.h index 97bc483..ad4c50a 100644 --- a/src/x2goclient-openssh-bugs.h +++ b/src/x2goclient-openssh-bugs.h @@ -33,9 +33,20 @@ G_BEGIN_DECLS +/** + * X2GoClientOpenSSHBugs: + * @backgrounding_keeps_stderr: Normally, child processes should fully detach + * from the controlling terminal. OpenSSH is + * buggy in some cases and doesn't always do that. + * See + * <ulink + * url="https://bugzilla.mindrot.org/show_bug.cgi?id=3137"> + * OpenSSH Bug 3137</ulink>. + * + * Since: 0.0.0 + */ /* - * Please document each entry in the implementation file - * (x2goclient-openssh-bugs.c). + * Please document each entry here. * * OpenSSH doesn't do that internally, which is a pain because bug semantics * must be inferred from the code locations the constants are used in. We don't -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 317d9e7c57872fa11317f5b69770bfd9d7be4e5e Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Nov 5 04:09:26 2021 +0100 src/x2goclient-network-options-ssh.c: add missing x2goclient_network_options_ssh_new () function. --- src/x2goclient-network-options-ssh.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/x2goclient-network-options-ssh.c b/src/x2goclient-network-options-ssh.c index 7e3b3b4..16981c1 100644 --- a/src/x2goclient-network-options-ssh.c +++ b/src/x2goclient-network-options-ssh.c @@ -79,6 +79,20 @@ static void x2goclient_network_options_ssh_init (X2GoClientNetworkOptionsSSH * c (void) self; } +/** + * x2goclient_network_options_ssh_new: + * + * Creates a new #X2GoClientNetworkOptionsSSH instance with all options + * disabled by default. + * + * Returns: (transfer full): the new #X2GoClientNetworkOptionsSSH instance + * + * Since: 0.0.0 + */ +X2GoClientNetworkOptionsSSH* x2goclient_network_options_ssh_new (void) { + return (g_object_new (X2GOCLIENT_TYPE_NETWORK_OPTIONS_SSH, NULL)); +} + /** * x2goclient_network_options_ssh_to_array: * @self: (not optional): pointer to an #X2GoClientNetworkOptionsSSH instance. -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit ce54cafa2c7e63d696b8a67b7d36fe1072e84e2c Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Oct 30 19:08:39 2021 +0200 src/x2goclient-openssh-bugs.c: add comment explaining that we will keep a bit of code selecting on the patch version as a how-to. --- src/x2goclient-openssh-bugs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/x2goclient-openssh-bugs.c b/src/x2goclient-openssh-bugs.c index 17b858b..a0e9df3 100644 --- a/src/x2goclient-openssh-bugs.c +++ b/src/x2goclient-openssh-bugs.c @@ -106,6 +106,10 @@ gboolean x2goclient_openssh_bugs_update (X2GoClientOpenSSHBugs * const self, con *self = (const X2GoClientOpenSSHBugs) { 0 }; if (8 >= version->major) { + /* + * Strictly speaking, there has been no 8.4p2 release, but we're keeping + * this as a means to show how to select on the patch version number. + */ if ((4 > version->minor) || ((4 == version->minor) && (2 > version->patch))) { self->backgrounding_keeps_stderr = TRUE; } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 7a9d3995edd5cd5bfdfb8b86f0c99d5035ceb21b Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Dec 3 13:03:37 2021 +0100 src/x2goclient-{network-{ssh,stub},openssh-{bugs,version}}.c: add missing documentation. --- src/x2goclient-network-ssh.c | 15 +++++++++++++++ src/x2goclient-network-stub.c | 13 +++++++++++++ src/x2goclient-openssh-bugs.c | 34 ++++++++++++++++++++++++++++++++++ src/x2goclient-openssh-version.c | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 96 insertions(+) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index badb642..8c11e7f 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -265,6 +265,21 @@ static void x2goclient_network_ssh_init (X2GoClientNetworkSSH * const self) { self->check_thread_loop = NULL; } +/** + * x2goclient_network_ssh_new: + * @session_path: (in) (transfer none): the session path root to be used for + * temporary session data. + * + * Creates a new #X2GoClientNetworkSSH instance, rooted at the path indicated + * by @session_path. + * + * No connection is being established by just creating such an object, which + * is also showcased by it not taking a remote location. + * + * Returns: (transfer full): the new #X2GoClientNetworkSSH instance + * + * Since: 0.0.0 + */ X2GoClientNetworkSSH* x2goclient_network_ssh_new (const char * const session_path) { X2GoClientNetworkSSH *ret = NULL; diff --git a/src/x2goclient-network-stub.c b/src/x2goclient-network-stub.c index b947df4..5e35eed 100644 --- a/src/x2goclient-network-stub.c +++ b/src/x2goclient-network-stub.c @@ -88,6 +88,19 @@ static void x2goclient_network_stub_init (X2GoClientNetworkStub * const self) { (void) self; } +/** + * x2goclient_network_stub_new: + * + * Creates a new #X2GoClientNetworkStub instance, with everything initialized + * to the default value. + * + * No connection is being established by just creating such an object, which + * is also showcased by it not taking a remote location. + * + * Returns: (transfer full): the new #X2GoClientNetworkStub instance + * + * Since: 0.0.0 + */ X2GoClientNetworkStub* x2goclient_network_stub_new (void) { X2GoClientNetworkStub *ret = NULL; diff --git a/src/x2goclient-openssh-bugs.c b/src/x2goclient-openssh-bugs.c index a0e9df3..9b722d0 100644 --- a/src/x2goclient-openssh-bugs.c +++ b/src/x2goclient-openssh-bugs.c @@ -48,14 +48,48 @@ * Since: 0.0.0 */ +/** + * x2goclient_openssh_bugs_new: + * + * Creates a new #X2GoClientOpenSSHBugs instance with all quirks + * disabled by default. + * + * Returns: (transfer full): the new #X2GoClientOpenSSHBugs instance + * + * Since: 0.0.0 + */ X2GoClientOpenSSHBugs* x2goclient_openssh_bugs_new (void) { return (g_slice_new0 (X2GoClientOpenSSHBugs)); } +/** + * x2goclient_openssh_bugs_free: + * @openssh_bugs: (in) (nullable) (transfer full): + * a pointer to an #X2GoClientOpenSSHBugs instance. + * + * Deletes memory allocated for the #X2GoClientOpenSSHBugs instance. + * + * While a %NULL input is supported, avoid that, since it will essentially + * degrade into a no-op with additional overhead. + * + * Since: 0.0.0 + */ void x2goclient_openssh_bugs_free (X2GoClientOpenSSHBugs * const openssh_bugs) { g_slice_free (X2GoClientOpenSSHBugs, openssh_bugs); } +/** + * x2goclient_openssh_bugs_copy: + * @openssh_bugs: (in) (not nullable) (transfer none): + * a pointer to an #X2GoClientOpenSSHBugs instance. + * + * Copies an #X2GoClientOpenSSHBugs instance. + * + * Returns: (transfer full): a new #X2GoClientOpenSSHBugs instance with the + * same internal data on success, %NULL on error + * + * Since: 0.0.0 + */ static X2GoClientOpenSSHBugs* x2goclient_openssh_bugs_copy (const X2GoClientOpenSSHBugs * const src) { X2GoClientOpenSSHBugs *dst = NULL; diff --git a/src/x2goclient-openssh-version.c b/src/x2goclient-openssh-version.c index c25636e..5d94413 100644 --- a/src/x2goclient-openssh-version.c +++ b/src/x2goclient-openssh-version.c @@ -52,14 +52,48 @@ * Since: 0.0.0 */ +/** + * x2goclient_openssh_version_new: + * + * Creates a new #X2GoClientOpenSSHVersion instance with every member + * initialized to the default value. + * + * Returns: (transfer full): the new #X2GoClientOpenSSHVersion instance + * + * Since: 0.0.0 + */ X2GoClientOpenSSHVersion* x2goclient_openssh_version_new (void) { return (g_slice_new0 (X2GoClientOpenSSHVersion)); } +/** + * x2goclient_openssh_version_free: + * @openssh_version: (in) (nullable) (transfer full): + * a pointer to an #X2GoClientOpenSSHVersion instance. + * + * Deletes memory allocated for the #X2GoClientOpenSSHVersion instance. + * + * While a %NULL input is supported, avoid that, since it will essentially + * degrade into a no-op with additional overhead. + * + * Since: 0.0.0 + */ void x2goclient_openssh_version_free (X2GoClientOpenSSHVersion * const openssh_version) { g_slice_free (X2GoClientOpenSSHVersion, openssh_version); } +/** + * x2goclient_openssh_version_copy: + * @openssh_version: (in) (not nullable) (transfer none): + * a pointer to an #X2GoClientOpenSSHVersion instance. + * + * Copies an #X2GoClientOpenSSHVersion instance. + * + * Returns: (transfer full): a new #X2GoClientOpenSSHVersion instance with the + * same internal data on success, %NULL on error + * + * Since: 0.0.0 + */ static X2GoClientOpenSSHVersion* x2goclient_openssh_version_copy (const X2GoClientOpenSSHVersion * const src) { X2GoClientOpenSSHVersion *dst = NULL; -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 2432578c2ab511db0d207c936b1337faf03d88ce Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Nov 5 04:21:13 2021 +0100 src/x2goclient-{network-options-ssh,openssh-version}.c: use more docbook tags where appropriate. --- src/x2goclient-network-options-ssh.c | 3 ++- src/x2goclient-openssh-version.c | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/x2goclient-network-options-ssh.c b/src/x2goclient-network-options-ssh.c index 16981c1..5d2fc08 100644 --- a/src/x2goclient-network-options-ssh.c +++ b/src/x2goclient-network-options-ssh.c @@ -98,7 +98,8 @@ X2GoClientNetworkOptionsSSH* x2goclient_network_options_ssh_new (void) { * @self: (not optional): pointer to an #X2GoClientNetworkOptionsSSH instance. * * Converts the internal state to an #GPtrArray of SSH client options that can - * be passed by prefixing "-o" to each entry when calling the SSH client. + * be passed by prefixing <literal>-o</literal> to each entry when calling the + * SSH client. * * Returns: (transfer full) (element-type utf8): a pointer to the converted * result as a #GPtrArray. %NULL diff --git a/src/x2goclient-openssh-version.c b/src/x2goclient-openssh-version.c index 470e147..c25636e 100644 --- a/src/x2goclient-openssh-version.c +++ b/src/x2goclient-openssh-version.c @@ -329,8 +329,8 @@ G_DEFINE_BOXED_TYPE (X2GoClientOpenSSHVersion, x2goclient_openssh_version, &x2go * @openssh_version: (in) (not optional): a pointer to the * #X2GoClientOpenSSHVersion structure * to populate. - * @version_string: (in) (not optional): output of ssh -V to parse as a - * string. + * @version_string: (in) (not optional): output of <command>ssh -V</command> + * to parse as a string. * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not * interested. * @@ -600,8 +600,8 @@ _Bool x2goclient_openssh_version_parse (X2GoClientOpenSSHVersion * const openssh * @gerr: (out) (nullable): a return location for a #GError, pass %NULL if not * interested. * - * Fetches the OpenSSH version string as returned by "ssh -V" and parses this - * output into an #X2GoClientOpenSSHVersion structure. + * Fetches the OpenSSH version string as returned by <command>ssh -V</command> + * and parses this output into an #X2GoClientOpenSSHVersion structure. * * Returns: the populated #X2GoClientOpenSSHVersion structure on success or * %NULL on error. -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 57b02cc7c9991fed96a66eadd8f0635759067999 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Dec 3 13:43:54 2021 +0100 src/x2goclient-utils.c: add missing transfer return annotation to x2goclient_strbrk_dup () documentation. --- src/x2goclient-utils.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/x2goclient-utils.c b/src/x2goclient-utils.c index dce7288..78859b9 100644 --- a/src/x2goclient-utils.c +++ b/src/x2goclient-utils.c @@ -221,10 +221,10 @@ long long int x2goclient_str_to_int (const gchar * const restrict str, const _Bo * occurrence of @needle returned. @new_size will be set to the truncated * size iff it is not %NULL. * - * Returns: either a copy of the original string up until the first occurrence - * of @needle or the value pointed to by @haystack (i.e., the - * original string) if @needle was not found, unless an error - * occurred + * Returns: (transfer full): either a copy of the original string up until the + * first occurrence of @needle or the value pointed + * to by @haystack (i.e., the original string) if + * @needle was not found, unless an error occurred * * Since: 0.0.0 */ -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 03c8082cbad80448c7a3757470395970150d0386 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Dec 3 13:27:54 2021 +0100 src/x2goclient-network-ssh.c: use g_boxed_free () instead of free-standing function. --- src/x2goclient-network-ssh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 69bc7d0..8395760 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -1522,7 +1522,7 @@ static gboolean x2goclient_network_ssh_fetch_openssh_version (X2GoClientNetworkS * GObject property setter directly. */ g_mutex_lock (&(self->check_thread_mutex)); - x2goclient_openssh_version_free (self->openssh_version); + g_boxed_free (X2GOCLIENT_TYPE_OPENSSH_VERSION, self->openssh_version); self->openssh_version = version; g_mutex_unlock (&(self->check_thread_mutex)); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit c0ea534411049fd6977081926e75742ed93c7b6b Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Dec 3 13:44:26 2021 +0100 src/x2goclient-utils.c: add more parenthesis to x2goclient_strbrk_dup (). --- src/x2goclient-utils.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/x2goclient-utils.c b/src/x2goclient-utils.c index 78859b9..29da213 100644 --- a/src/x2goclient-utils.c +++ b/src/x2goclient-utils.c @@ -231,33 +231,33 @@ long long int x2goclient_str_to_int (const gchar * const restrict str, const _Bo gchar* x2goclient_strbrk_dup (gchar * restrict * const haystack, const char needle, const _Bool free_orig, gsize * const new_size) { gchar *ret = NULL; - g_return_val_if_fail (((NULL != haystack) && (NULL != *haystack)), ret); + g_return_val_if_fail (((NULL != haystack) && (NULL != (*(haystack)))), ret); - const gchar *needle_pos = strchr (*haystack, needle); + const gchar *needle_pos = strchr (*(haystack), needle); if (!(needle_pos)) { /* Optimization: don't copy. */ - ret = *haystack; - *haystack = NULL; + ret = (*(haystack)); + (*(haystack)) = NULL; } else { /* Since needle was found, the difference must be at least one. */ - g_assert (needle_pos - *haystack); + g_assert (needle_pos - (*(haystack))); - gsize truncate_size = (needle_pos - *haystack); + gsize truncate_size = (needle_pos - (*(haystack))); /* Don't copy the needle. */ - ret = g_strndup (*haystack, truncate_size); + ret = g_strndup (*(haystack), truncate_size); if (ret) { if (free_orig) { /* Get rid of the original string. */ - g_free (*haystack); - *haystack = NULL; + g_free (*(haystack)); + (*(haystack)) = NULL; } if (new_size) { - *new_size = truncate_size; + (*(new_size)) = truncate_size; } } } -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit d62e766bfe2db176ef39043466ba60b4b51f9e57 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Dec 3 13:29:44 2021 +0100 src/x2goclient-network.c: note that the documentation will include a hard-coded prefix (home dir) in the session path default value, which really is a string determined at run time. --- src/x2goclient-network.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/x2goclient-network.c b/src/x2goclient-network.c index 2c181b8..42191d8 100644 --- a/src/x2goclient-network.c +++ b/src/x2goclient-network.c @@ -218,7 +218,12 @@ static void x2goclient_network_class_init (X2GoClientNetworkClass * const klass) net_obj_properties[X2GO_NET_PROP_SESSION_PATH] = g_param_spec_string ("session-path", _("Base path to session data"), _("The file system path that will be used as the " "session data base path. Connection-related files " - "will land there."), + "will land there. Note that the default session " + "path listed in the documentation includes the " + "home directory of the system user that built " + "the documentation. The former part will be " + "replaced with the home directory of the user " + "using the class at run time."), default_session_path->str, G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE); g_boxed_free (G_TYPE_GSTRING, default_session_path); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit aba666e25179041c1c6ab559b06580b87ab7c9d8 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Dec 3 13:16:32 2021 +0100 src/x2goclient-{{network-ssh,openssh-version,utils}.c,utils.h}: change occurrences of "long long" to "long long int". --- src/x2goclient-network-ssh.c | 6 +++--- src/x2goclient-openssh-version.c | 6 +++--- src/x2goclient-utils.c | 4 ++-- src/x2goclient-utils.h | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 0484135..6144bda 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -491,14 +491,14 @@ static guint16 x2goclient_network_ssh_parse_sockspec_port (const GString * const _Bool conv_err = TRUE, min_err = TRUE, max_err = TRUE; - long long conv = x2goclient_str_to_int (portspec->str + 1, TRUE, 1, TRUE, ((1 << 16) - 1), NULL, &conv_err, &min_err, &max_err); + long long int conv = x2goclient_str_to_int (portspec->str + 1, TRUE, 1, TRUE, ((1 << 16) - 1), NULL, &conv_err, &min_err, &max_err); if (conv_err) { if (min_err) { - g_set_error_literal (gerr, X2GOCLIENT_NETWORK_SSH_ERROR, X2GOCLIENT_NETWORK_SSH_ERROR_PORT_CONV_UNDERFLOW, "Port specifier too small to fit into long long type."); + g_set_error_literal (gerr, X2GOCLIENT_NETWORK_SSH_ERROR, X2GOCLIENT_NETWORK_SSH_ERROR_PORT_CONV_UNDERFLOW, "Port specifier too small to fit into long long int type."); } else if (max_err) { - g_set_error_literal (gerr, X2GOCLIENT_NETWORK_SSH_ERROR, X2GOCLIENT_NETWORK_SSH_ERROR_PORT_CONV_OVERFLOW, "Port specifier too big to fit into long long type."); + g_set_error_literal (gerr, X2GOCLIENT_NETWORK_SSH_ERROR, X2GOCLIENT_NETWORK_SSH_ERROR_PORT_CONV_OVERFLOW, "Port specifier too big to fit into long long int type."); } else { g_set_error_literal (gerr, X2GOCLIENT_NETWORK_SSH_ERROR, X2GOCLIENT_NETWORK_SSH_ERROR_PORT_CONV_NOT_NUMERIC, "Port specifier is not numeric."); diff --git a/src/x2goclient-openssh-version.c b/src/x2goclient-openssh-version.c index 0bf343b..83f17f0 100644 --- a/src/x2goclient-openssh-version.c +++ b/src/x2goclient-openssh-version.c @@ -532,16 +532,16 @@ _Bool x2goclient_openssh_version_parse (X2GoClientOpenSSHVersion * const openssh const gchar *end = NULL; const gchar *err_msg = NULL; gint err_code = -1; - long long conv = x2goclient_str_to_int (tmp_copy, TRUE, 0, TRUE, G_MAXUINT32, &end, &conv_err, &min_err, &max_err); + long long int conv = x2goclient_str_to_int (tmp_copy, TRUE, 0, TRUE, G_MAXUINT32, &end, &conv_err, &min_err, &max_err); if (conv_err) { if (min_err) { GENERATE_ERROR_CODE (err_code, num_i, UNDERFLOW); - GENERATE_ERROR_MSG (err_msg, num_i, "version number is too small to fit into long long type."); + GENERATE_ERROR_MSG (err_msg, num_i, "version number is too small to fit into long long int type."); } else if (max_err) { GENERATE_ERROR_CODE (err_code, num_i, OVERFLOW); - GENERATE_ERROR_MSG (err_msg, num_i, "version number is too big to fit into long long type."); + GENERATE_ERROR_MSG (err_msg, num_i, "version number is too big to fit into long long int type."); } else { GENERATE_ERROR_CODE (err_code, num_i, NOT_NUMERIC); diff --git a/src/x2goclient-utils.c b/src/x2goclient-utils.c index 5f61dad..ac1a16c 100644 --- a/src/x2goclient-utils.c +++ b/src/x2goclient-utils.c @@ -130,8 +130,8 @@ void x2goclient_clear_strings (gpointer data) { * * Since: 0.0.0 */ -long long x2goclient_str_to_int (const gchar * const restrict str, const _Bool min, const long long int limit_min, const _Bool max, const long long int limit_max, const gchar ** const restrict end, _Bool * const restrict conv_err, _Bool * const restrict min_err, _Bool * const restrict max_err) { - long long ret = 42; +long long int x2goclient_str_to_int (const gchar * const restrict str, const _Bool min, const long long int limit_min, const _Bool max, const long long int limit_max, const gchar ** const restrict end, _Bool * const restrict conv_err, _Bool * const restrict min_err, _Bool * const restrict max_err) { + long long int ret = 42; *min_err = *max_err = FALSE; diff --git a/src/x2goclient-utils.h b/src/x2goclient-utils.h index 54132b2..be9bd5d 100644 --- a/src/x2goclient-utils.h +++ b/src/x2goclient-utils.h @@ -135,7 +135,7 @@ G_BEGIN_DECLS void x2goclient_clear_strings (gpointer const data); -long long x2goclient_str_to_int (const gchar * const restrict str, const _Bool min, const long long int limit_min, const _Bool max, const long long int limit_max, const gchar ** const restrict end, _Bool * const restrict conv_err, _Bool * const restrict min_err, _Bool * const restrict max_err); +long long int x2goclient_str_to_int (const gchar * const restrict str, const _Bool min, const long long int limit_min, const _Bool max, const long long int limit_max, const gchar ** const restrict end, _Bool * const restrict conv_err, _Bool * const restrict min_err, _Bool * const restrict max_err); gchar* x2goclient_strbrk_dup (gchar * restrict * const haystack, const char needle, const _Bool free_orig, gsize * const new_size); const gchar* x2goclient_bool_to_str (const gboolean in); -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 0eaa64ee9fcc6c9fd2a27e54d773f15637fca904 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Dec 3 13:25:41 2021 +0100 src/x2goclient-{network-ssh.c,openssh-version.h}: fix typos in documentation. --- src/x2goclient-network-ssh.c | 2 +- src/x2goclient-openssh-version.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 3bea957..69bc7d0 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -1546,7 +1546,7 @@ static gboolean x2goclient_network_ssh_fetch_openssh_version (X2GoClientNetworkS * combinations are invalid and will lead to the function terminating without * processing any data. * - * This function exists because the #printf formatter specifier + * This function exists because the #printf format specifier * <code>%.*s</code>, which limits the size of the string to be printed, is * limited to the size that can be passed via an #int. To work around that, * it splits up the string into %INT_MAX increments (if needed) and prints diff --git a/src/x2goclient-openssh-version.h b/src/x2goclient-openssh-version.h index 082171b..f906936 100644 --- a/src/x2goclient-openssh-version.h +++ b/src/x2goclient-openssh-version.h @@ -79,13 +79,13 @@ void x2goclient_openssh_version_free (X2GoClientOpenSSHVersion * const openssh_v * @X2GOCLIENT_OPENSSH_VERSION_ERROR_NOT_AT_MAJOR_SEPARATOR: version parsing * stopped after * major version at - * a non-dot-non, + * a non-dot, * non-numeric * character. * @X2GOCLIENT_OPENSSH_VERSION_ERROR_NOT_AT_MINOR_SEPARATOR: version parsing * stopped after * minor version at - * a non-dot-non, + * a non-dot, * non-numeric * character. * @X2GOCLIENT_OPENSSH_VERSION_ERROR_MAJOR_NOT_NUMERIC: major version number -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 69a80c8b20fa2ac1f0ea9fc491c8ac32c0cd29e3 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Dec 3 13:40:31 2021 +0100 src/x2goclient-utils.c: the style guide says to determinate parameter descriptions with a period, so do that. --- src/x2goclient-utils.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/x2goclient-utils.c b/src/x2goclient-utils.c index ac1a16c..dce7288 100644 --- a/src/x2goclient-utils.c +++ b/src/x2goclient-utils.c @@ -50,7 +50,7 @@ /** * x2goclient_clear_strings: - * @data: (in) (nullable): input string + * @data: (in) (nullable): input string. * * Frees the string passed as @data. It's safe to pass %NULL. * @@ -62,22 +62,22 @@ void x2goclient_clear_strings (gpointer data) { /** * x2goclient_str_to_int: - * @str: (in) (not nullable): input string - * @min: (in): true if a minimum limit should be checked for - * @limit_min: (in): the minimum limit to check for - * @max: (in): true if a maximum limit should be checked for - * @limit_max: (in): the maximum limit to check for + * @str: (in) (not nullable): input string. + * @min: (in): true if a minimum limit should be checked for. + * @limit_min: (in): the minimum limit to check for. + * @max: (in): true if a maximum limit should be checked for. + * @limit_max: (in): the maximum limit to check for. * @end: (out) (optional) (nullable): pointer to final string after the scanned - * value + * value. * @conv_err: (out) (not nullable) (type gboolean*): will be set to true on - * conversion errors + * conversion errors. * @min_err: (out) (not nullable) (type gboolean*): will be set to true if * value falls short of * minimum limit and on - * underflows + * underflows. * @max_err: (out) (not nullable) (type gboolean*): will be set to true if * value exceeds maximum limit - * and on overflows + * and on overflows. * * Takes a string and converts it into a #long long int. * @@ -182,11 +182,12 @@ long long int x2goclient_str_to_int (const gchar * const restrict str, const _Bo /** * x2goclient_strbrk_dup: - * @haystack: (inout) (not nullable) (transfer none): pointer to input string - * @needle: (in): character to split/break at - * @free_orig: (in): request that the original string be g_free()'d at the end + * @haystack: (inout) (not nullable) (transfer none): pointer to input string. + * @needle: (in): character to split/break at. + * @free_orig: (in): request that the original string be g_free()'d at the + * end. * @new_size: (out) (nullable): will be set to the copied string's size if a - * copy was created + * copy was created. * * Searches for the first occurrence of a specific character in a string and * returns a copy of the string up to that location, potentially freeing the @@ -266,7 +267,7 @@ gchar* x2goclient_strbrk_dup (gchar * restrict * const haystack, const char need /** * x2goclient_bool_to_str: - * @in: (in): input boolean + * @in: (in): input boolean. * * Takes a boolean and converts it to a (static) string. * -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit dc5ea65dc9239481a9c2ff2d9fa4cedf2bb254ac Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Dec 3 13:22:08 2021 +0100 src/x2goclient-network-ssh.c: documentation annotations cannot be split onto multiple lines, consolidate. --- src/x2goclient-network-ssh.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 6144bda..3bea957 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -1608,9 +1608,8 @@ static void x2goclient_network_ssh_log_std_str (const gchar * const str, const g /* * x2goclient_network_ssh_gptrarray_to_string: - * @arr: (in) (not optional) (array) - * (element-type (type utf8)): pointer to the #GPtrArray to convert to a - * string. + * @arr: (in) (not optional) (array) (element-type (type utf8)): + * pointer to the #GPtrArray to convert to a string. * @prelude: (in) (nullable): initial string to prepend to the resulting * output string. * @ret_str: (out) (not optional) (transfer full): output location of the @@ -1770,8 +1769,8 @@ static gboolean x2goclient_network_ssh_gptrarray_to_string (GPtrArray * const ar /* * x2goclient_network_ssh_gptrarray_print_debug: - * @arr: (in) (not optional) (array) - * (element-type (type utf8)): pointer to the #GPtrArray to print. + * @arr: (in) (not optional) (array) (element-type (type utf8)): + * pointer to the #GPtrArray to print. * @prelude: (in) (nullable): initial string to prepend to the resulting * output. * @desc: (in) (nullable): description of the array to be printed, used in -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit a948f0f7f3e1e7dd109ef3c93c905173ec09af97 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Dec 3 13:46:59 2021 +0100 src/x2goclient-network-ssh.c: change session_path literal to link to session_path property. --- src/x2goclient-network-ssh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x2goclient-network-ssh.c b/src/x2goclient-network-ssh.c index 8395760..2e71c76 100644 --- a/src/x2goclient-network-ssh.c +++ b/src/x2goclient-network-ssh.c @@ -1101,7 +1101,7 @@ static gboolean x2goclient_network_ssh_kill_subprocesses (X2GoClientNetworkSSH * * #X2GoClientNetwork:options property. * * Currently, the control socket path is hardcoded to - * <filename><varname>session-path</varname>/ssh/control</filename>. + * <filename>#X2GoClientNetwork:session-path<!-- -->/ssh/control</filename>. * * Each connection attempt will also re-fetch the OpenSSH client version and * re-apply quirks as necessary, (hopefully) making it resilient to system -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository libx2goclient. commit 43aa373d0793f004a0a19655bd3eda555b6fc50c Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Dec 3 13:51:20 2021 +0100 src/x2goclient-{{network-ssh,openssh-version}.h,network.c}: work around spurious newlines in documentation by using HTML/XML comments. --- src/x2goclient-network-ssh.h | 5 +++-- src/x2goclient-network.c | 8 ++++---- src/x2goclient-openssh-version.h | 5 ++++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/x2goclient-network-ssh.h b/src/x2goclient-network-ssh.h index f47bcea..75db63a 100644 --- a/src/x2goclient-network-ssh.h +++ b/src/x2goclient-network-ssh.h @@ -58,8 +58,9 @@ X2GoClientNetworkSSH* x2goclient_network_ssh_new (const gchar * const session_pa * type. * @X2GOCLIENT_NETWORK_SSH_ERROR_PORT_CONV_TOO_BIG: port value to parse was * bigger than allowed by - * common port specifications - * <constant><!-- + * common port + * specifications <!-- + * --><constant><!-- * -->65535<!-- * --></constant>. * @X2GOCLIENT_NETWORK_SSH_ERROR_PORT_CONV_NEGATIVE_ZERO: port value to parse diff --git a/src/x2goclient-network.c b/src/x2goclient-network.c index 42191d8..e7b2c86 100644 --- a/src/x2goclient-network.c +++ b/src/x2goclient-network.c @@ -66,16 +66,16 @@ * derived classes. Check the in-line documentation within the class * structure for further information. * @derived_connect: pointer to the derived class's connect function, must be - * set manually by the derived class in its - * <code>class_init</code> function. Check the in-line + * set manually by the derived class in its <!-- + * --><code>class_init</code> function. Check the in-line * documentation within the class structure for further * information. * @disconnect: pointer to the current class's disconnect function, useful for * derived classes. Check the in-line documentation within the * class structure for further information. * @derived_disconnect: pointer to the derived class's disconnect function, - * must be set manually by the derived class in its - * <code>class_init</code> function. Check the in-line + * must be set manually by the derived class in its <!-- + * --><code>class_init</code> function. Check the in-line * documentation within the class structure for further * information. * diff --git a/src/x2goclient-openssh-version.h b/src/x2goclient-openssh-version.h index f906936..1fec910 100644 --- a/src/x2goclient-openssh-version.h +++ b/src/x2goclient-openssh-version.h @@ -65,7 +65,10 @@ void x2goclient_openssh_version_free (X2GoClientOpenSSHVersion * const openssh_v * information from * passed. * @X2GOCLIENT_OPENSSH_VERSION_ERROR_INVALID_PREAMBLE: version string does not - * begin with "OpenSSH_". + * begin with + * <literal><!-- + * -->OpenSSH_<!-- + * --></literal>. * @X2GOCLIENT_OPENSSH_VERSION_ERROR_NO_MAJOR_SEPARATOR: no dot found * separating the major * version number from -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git