Regarding problems I've described at this thread, http://forums.freebsd.org/showthread.php?t=21381, I've deinstalled the non-functioning Jabber v1.6 code, and elected to pursue the installation of v2.2.11 (as I probably should have in the first place).
The only selected make config options were support for MySQL, DEBUG and IPV6. The make build resulted in the following fatal errors and warnings:
I resolved the fatal error as follows:
The compiler apparently doesn't understand the uint syntax for unsigned integer; therefore, I changed uint to unsigned int as follows, and solved that problem. (I'm using the compiler that installed with FreeBSD v7.2.)
Digging deeper regarding the warnings:
Regarding the Make build warnings:
The username and realm are declared as character pointers (line 52), as are the character arrays, iuser[ ] and irealm[ ] (line 55) . . .so why the warning regarding lines 64, 183, 234 and 263? It's happy with identical syntax at for example, line 65. Is the snprintf function not capable of handling the size of the 1024+1 length of the username?
Once again, I'm at a loss for what to do. Although the make build completed normally(?), I'd like to resolve this before I try the make install.
The only selected make config options were support for MySQL, DEBUG and IPV6. The make build resulted in the following fatal errors and warnings:
Code:
checking for mysql_config... /usr/local/bin/mysql_config
checking MySQL libraries... "-L/usr/local/lib/mysql -lmysqlclient -lz -lcrypt -lm"
checking mysql includes... "-I/usr/local/include/mysql -fno-strict-aliasing -pipe"
In file included from /usr/local/include/mysql/[B][color="SeaGreen"]mysql.h[/color][/B]:134,
from [B][color="SeaGreen"]authreg_mysql.c[/color][/B]:25:
/usr/local/include/mysql/[color="SeaGreen"][B]typelib.h[/B][/color]:39: error: expected declaration specifiers or '...' before '[color="SeaGreen"][B]uint[/B][/color]'
/usr/local/include/mysql/typelib.h:41: error: expected declaration specifiers or '...' before 'uint'
/usr/local/include/mysql/typelib.h:42: error: expected declaration specifiers or '...' before 'uint'
[B][color="SeaGreen"]
authreg_mysql.c[/color][/B]: In function '_ar_mysql_get_user_tuple':
[color="Red"]authreg_mysql.c:64: warning: incompatible implicit declaration of built-in function 'snprintf'[/color]
authreg_mysql.c: In function '_ar_mysql_set_password':
authreg_mysql.c:183: warning: incompatible implicit declaration of built-in function 'snprintf'
authreg_mysql.c: In function '_ar_mysql_create_user':
authreg_mysql.c:234: warning: incompatible implicit declaration of built-in function 'snprintf'
authreg_mysql.c: In function '_ar_mysql_delete_user':
authreg_mysql.c:263: warning: incompatible implicit declaration of built-in function 'snprintf'
*** Error code 1
mv -f .deps/storage_mysql_la-storage_mysql.Tpo .deps/storage_mysql_la-storage_mysql.Plo
1 error
*** Error code 1
1 error
*** Error code 2
*** Error code 1
Stop in /usr/ports/net-im/jabberd.
*** Error code 1
Stop in /usr/ports/net-im/jabberd.
I resolved the fatal error as follows:
Code:
/usr/local/include/mysql/[B][color="SeaGreen"]typelib.h[/color][/B]
39 my_ulonglong find_set_from_flags(const TYPELIB *lib, [B][color="Red"]uint[/color][/B] default_name,
40 my_ulonglong cur_set, my_ulonglong default_set,
41 const char *str, [B][color="Red"]uint[/color][/B] length,
42 char **err_pos, [B][color="Red"]uint[/color][/B] *err_len);
The compiler apparently doesn't understand the uint syntax for unsigned integer; therefore, I changed uint to unsigned int as follows, and solved that problem. (I'm using the compiler that installed with FreeBSD v7.2.)
Code:
39 my_ulonglong find_set_from_flags(const TYPELIB *lib, [color="SeaGreen"][B]unsigned int[/B][/color] default_name,
40 my_ulonglong cur_set, my_ulonglong default_set,
41 const char *str, [color="SeaGreen"][B]unsigned int[/B][/color] length,
42 char **err_pos, [color="SeaGreen"][B]unsigned int[/B][/color] *err_len);
Digging deeper regarding the warnings:
Code:
/usr/local/include/mysql/[B][color="SeaGreen"]mysql.h[/color][/B]
133
134 #include "[B][color="SeaGreen"]typelib.h[/color][/B]"
135
/usr/ports/net-im/jabberd/work/jabberd-2.2.11/storage/[B]authreg_mysql.c[/B]
25 #include <[B][color="SeaGreen"]mysql.h[/color][/B]>
34 #define MYSQL_LU 1024 /* maximum length of username - should correspond to field length */
35 #define MYSQL_LR 256 /* maximum length of realm - should correspond to field length */
36 #define MYSQL_LP 256 /* maximum length of password - should correspond to field length */
52 static MYSQL_RES *_ar_mysql_get_user_tuple(authreg_t ar, char [color="SeaGreen"][B]*username[/B][/color], char [B][color="SeaGreen"]*realm[/color][/B]) {
53 mysqlcontext_t ctx = (mysqlcontext_t) ar->private;
54 MYSQL *conn = ctx->conn;
55 char [B][color="SeaGreen"]iuser[/color][/B][MYSQL_LU+1], [color="SeaGreen"][B]irealm[/B][/color][MYSQL_LR+1];
56 char euser[MYSQL_LU*2+1], erealm[MYSQL_LR*2+1], sql[1024 + MYSQL_LU*2 + MYSQL_LR*2 + 1]; /* query(1024) + euser + erealm + \0(1) */
57 MYSQL_RES *res;
58
59 if(mysql_ping(conn) != 0) {
60 log_write(ar->c2s->log, LOG_ERR, "mysql: connection to database lost");
61 return NULL;
62 }
63
Regarding the Make build warnings:
Code:
[color="Red"]authreg_mysql.c:64: warning: incompatible implicit declaration of built-in function 'snprintf'[/color]
The username and realm are declared as character pointers (line 52), as are the character arrays, iuser[ ] and irealm[ ] (line 55) . . .so why the warning regarding lines 64, 183, 234 and 263? It's happy with identical syntax at for example, line 65. Is the snprintf function not capable of handling the size of the 1024+1 length of the username?
Code:
64 [color="Red"]snprintf(iuser, MYSQL_LU+1, "%s", username);[/color]
65 snprintf(irealm, MYSQL_LR+1, "%s", realm);
183 snprintf(iuser, MYSQL_LU+1, "%s", username);
234 snprintf(iuser, MYSQL_LU+1, "%s", username);
263 snprintf(iuser, MYSQL_LU+1, "%s", username);
Once again, I'm at a loss for what to do. Although the make build completed normally(?), I'd like to resolve this before I try the make install.