Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

building with irssi 1.0 fails #18

Closed
darix opened this issue Jan 8, 2017 · 5 comments
Closed

building with irssi 1.0 fails #18

darix opened this issue Jan 8, 2017 · 5 comments

Comments

@darix
Copy link

darix commented Jan 8, 2017

+ cd irssi-xmpp-0.53~git0.bee578d
+ export IRSSI_INCLUDE=/usr/include/irssi
+ IRSSI_INCLUDE=/usr/include/irssi
+ /usr/bin/make -j4 CC=gcc 'OPTFLAGS=-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g' PREFIX=/usr IRSSI_INCLUDE=/usr/include/irssi IRSSI_LIB=/usr/lib64/irssi IRSSI_DOC=/usr/share/doc/packages/irssi-xmpp
make[1]: Entering directory '/home/abuild/rpmbuild/BUILD/irssi-xmpp-0.53~git0.bee578d/src'
core module:
make[2]: Entering directory '/home/abuild/rpmbuild/BUILD/irssi-xmpp-0.53~git0.bee578d/src/core'
gcc  -fPIC -DUOFF_T_LONG -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g  -I../../src/core -I/usr/include/irssi -I/usr/include/irssi/src -I/usr/include/irssi/src/core -I/usr/include/irssi/src/fe-common/core -I/usr/include/irssi/src/fe-text `pkg-config --cflags loudmouth-1.0` -o xmpp-commands.o -c xmpp-commands.c
gcc  -fPIC -DUOFF_T_LONG -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g  -I../../src/core -I/usr/include/irssi -I/usr/include/irssi/src -I/usr/include/irssi/src/core -I/usr/include/irssi/src/fe-common/core -I/usr/include/irssi/src/fe-text `pkg-config --cflags loudmouth-1.0` -o xmpp-core.o -c xmpp-core.c
gcc  -fPIC -DUOFF_T_LONG -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g  -I../../src/core -I/usr/include/irssi -I/usr/include/irssi/src -I/usr/include/irssi/src/core -I/usr/include/irssi/src/fe-common/core -I/usr/include/irssi/src/fe-text `pkg-config --cflags loudmouth-1.0` -o xmpp-queries.o -c xmpp-queries.c
gcc  -fPIC -DUOFF_T_LONG -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g  -I../../src/core -I/usr/include/irssi -I/usr/include/irssi/src -I/usr/include/irssi/src/core -I/usr/include/irssi/src/fe-common/core -I/usr/include/irssi/src/fe-text `pkg-config --cflags loudmouth-1.0` -o xmpp-servers.o -c xmpp-servers.c
gcc  -fPIC -DUOFF_T_LONG -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g  -I../../src/core -I/usr/include/irssi -I/usr/include/irssi/src -I/usr/include/irssi/src/core -I/usr/include/irssi/src/fe-common/core -I/usr/include/irssi/src/fe-text `pkg-config --cflags loudmouth-1.0` -o xmpp-servers-reconnect.o -c xmpp-servers-reconnect.c
xmpp-servers.c: In function 'xmpp_server_init_connect':
xmpp-servers.c:154:43: error: 'XMPP_SERVER_CONNECT_REC' has no member named 'use_ssl'
   server->connrec->port = (server->connrec->use_ssl) ?
                                           ^
xmpp-servers.c: In function 'lm_open_cb':
xmpp-servers.c:338:21: error: 'XMPP_SERVER_CONNECT_REC' has no member named 'use_ssl'
  if (server->connrec->use_ssl)
                     ^
xmpp-servers.c: In function 'xmpp_server_connect':
xmpp-servers.c:473:21: error: 'XMPP_SERVER_CONNECT_REC' has no member named 'use_ssl'
  if (server->connrec->use_ssl) {
                     ^
../rules.mk:10: recipe for target 'xmpp-servers.o' failed
make[2]: *** [xmpp-servers.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/irssi-xmpp-0.53~git0.bee578d/src/core'
Makefile:2: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/abuild/rpmbuild/BUILD/irssi-xmpp-0.53~git0.bee578d/src'
Makefile:4: recipe for target 'all' failed
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.EEUFwH (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.EEUFwH (%build)

tengu failed "build irssi-xmpp.spec" at Sun Jan  8 02:08:42 UTC 2017.
@darix
Copy link
Author

darix commented Jan 8, 2017

Patch to fix it:

diff --git a/src/core/xmpp-servers.c b/src/core/xmpp-servers.c
index 405ecd9..b6d9bd5 100644
--- a/src/core/xmpp-servers.c
+++ b/src/core/xmpp-servers.c
@@ -151,7 +151,7 @@ xmpp_server_init_connect(SERVER_CONNECT_REC *connrec)
        server->connect_pid = -1;
 
        if (server->connrec->port <= 0)
-               server->connrec->port = (server->connrec->use_ssl) ?
+               server->connrec->port = (server->connrec->use_tls) ?
                    LM_CONNECTION_DEFAULT_PORT_SSL : LM_CONNECTION_DEFAULT_PORT;
 
        if (conn->real_jid == NULL)
@@ -335,7 +335,7 @@ lm_open_cb(LmConnection *connection, gboolean success,
                g_free(host);
        } else
                signal_emit("server connecting", 1, server);
-       if (server->connrec->use_ssl)
+       if (server->connrec->use_tls)
                signal_emit("xmpp server status", 2, server, 
                    "Using SSL encryption.");
        else if (lm_ssl_get_use_starttls(lm_connection_get_ssl(server->lmconn)))
@@ -470,7 +470,7 @@ xmpp_server_connect(XMPP_SERVER_REC *server)
                return;
        error = NULL;
        err_msg = NULL;
-       if (server->connrec->use_ssl) {
+       if (server->connrec->use_tls) {
                if (!set_ssl(server->lmconn, &error, server, FALSE)) {
                        err_msg = "Cannot init ssl";
                        goto err;

@darix
Copy link
Author

darix commented Jan 9, 2017

Better patch which should allow building on older irssi versions

diff --git a/src/core/xmpp-servers.c b/src/core/xmpp-servers.c
index 405ecd9..edcaeaa 100644
--- a/src/core/xmpp-servers.c
+++ b/src/core/xmpp-servers.c
@@ -32,6 +32,11 @@
 #include "rosters-tools.h"
 #include "tools.h"
 
+// IRSSI_ABI_VERSION was introduced in 0.8.18
+#if !defined(IRSSI_ABI_VERSION) || IRSSI_ABI_VERSION < 6
+#  define use_tls use_ssl
+#endif
+
 static void
 channels_join(SERVER_REC *server, const char *data, int automatic)
 {
@@ -151,7 +156,7 @@ xmpp_server_init_connect(SERVER_CONNECT_REC *connrec)
        server->connect_pid = -1;
 
        if (server->connrec->port <= 0)
-               server->connrec->port = (server->connrec->use_ssl) ?
+               server->connrec->port = (server->connrec->use_tls) ?
                    LM_CONNECTION_DEFAULT_PORT_SSL : LM_CONNECTION_DEFAULT_PORT;
 
        if (conn->real_jid == NULL)
@@ -335,7 +340,7 @@ lm_open_cb(LmConnection *connection, gboolean success,
                g_free(host);
        } else
                signal_emit("server connecting", 1, server);
-       if (server->connrec->use_ssl)
+       if (server->connrec->use_tls)
                signal_emit("xmpp server status", 2, server, 
                    "Using SSL encryption.");
        else if (lm_ssl_get_use_starttls(lm_connection_get_ssl(server->lmconn)))
@@ -470,7 +475,7 @@ xmpp_server_connect(XMPP_SERVER_REC *server)
                return;
        error = NULL;
        err_msg = NULL;
-       if (server->connrec->use_ssl) {
+       if (server->connrec->use_tls) {
                if (!set_ssl(server->lmconn, &error, server, FALSE)) {
                        err_msg = "Cannot init ssl";
                        goto err;

@cdidier
Copy link
Owner

cdidier commented Jan 11, 2017

OK, can you make a pull request against the master branch?

@leitu
Copy link

leitu commented Jan 19, 2017

it works for me to change the ssl to tls, since irssi 1.0.0 use tls after vulnerabilities

benaryorg added a commit to benaryorg/irssi-xmpp that referenced this issue Jan 20, 2017
Signed-off-by: benaryorg <binary@benary.org>
benaryorg added a commit to benaryorg/irssi-xmpp that referenced this issue Feb 2, 2017
Signed-off-by: benaryorg <binary@benary.org>
@cdidier
Copy link
Owner

cdidier commented Mar 3, 2017

fixed by 0d9e5f7

@cdidier cdidier closed this as completed Mar 3, 2017
uqs pushed a commit to freebsd/freebsd-ports that referenced this issue Apr 20, 2017
 - Add patch from upstream

PR:		217916, 218328
Submitted by:	Thibault Jouan <tj+freebsd_ports@a13.fr>
Approved by:	maintainer timeout
Obtained from:	cdidier/irssi-xmpp#18


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@438990 35697150-7ecd-e111-bb59-0022644237b5
uqs pushed a commit to freebsd/freebsd-ports that referenced this issue Apr 20, 2017
 - Add patch from upstream

PR:		217916, 218328
Submitted by:	Thibault Jouan <tj+freebsd_ports@a13.fr>
Approved by:	maintainer timeout
Obtained from:	cdidier/irssi-xmpp#18
uqs pushed a commit to freebsd/freebsd-ports that referenced this issue Jun 6, 2017
Approved by: ports-secteam (blanket)

irc/irssi-xmpp: Fix build with irssi 1.0

 - Add patch from upstream

PR:		217916, 218328
Submitted by:	Thibault Jouan <tj+freebsd_ports@a13.fr>
Approved by:	maintainer timeout
Obtained from:	cdidier/irssi-xmpp#18

irc/irssi-xmpp: Improve regex conformance

PR:		218603
Submitted by:	Kyle Evans <bsdports@kyle-evans.net>
Approved by:	 jadwin (maintainer timeout), rene (mentor)
Differential Revision:	https://reviews.freebsd.org/D10524
uqs pushed a commit to freebsd/freebsd-ports that referenced this issue Apr 1, 2021
Approved by: ports-secteam (blanket)

irc/irssi-xmpp: Fix build with irssi 1.0

 - Add patch from upstream

PR:		217916, 218328
Submitted by:	Thibault Jouan <tj+freebsd_ports@a13.fr>
Approved by:	maintainer timeout
Obtained from:	cdidier/irssi-xmpp#18

irc/irssi-xmpp: Improve regex conformance

PR:		218603
Submitted by:	Kyle Evans <bsdports@kyle-evans.net>
Approved by:	 jadwin (maintainer timeout), rene (mentor)
Differential Revision:	https://reviews.freebsd.org/D10524
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants