vonloxley / sqsh

Clone of the original project https://sourceforge.net/projects/sqsh/
GNU General Public License v2.0
10 stars 8 forks source link

Fails to compile with FreeTDS 1.3.3 #2

Closed boekhold closed 11 months ago

boekhold commented 1 year ago

SQSH (either this one or the latest sourceforge version) fails to compile with recent versions of FreeTDS, see below for compilation errors.

Note that this is also the reason why SQSH was removed from the Debian distribution: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=971136

$ make
make[1]: Entering directory '/home/user/src/sqsh-rel_3_0_b/src/sqsh_parser'
gcc -c -g -O2  -o sqsh_parser.o sqsh_parser.c
gcc -c -g -O2  -o tsql.o tsql.c
gcc -c -g -O2  -o tsql.yy.o tsql.yy.c
ar -rcsv  sqsh_parser.a sqsh_parser.o tsql.o tsql.yy.o
a - sqsh_parser.o
a - tsql.o
a - tsql.yy.o
make[1]: Leaving directory '/home/user/src/sqsh-rel_3_0_b/src/sqsh_parser'
make[1]: Entering directory '/home/user/src/sqsh-rel_3_0_b/src'
gcc -g -O2 -DSQSH_RC='"/usr/local/etc/sqshrc:${HOME}/.sqshrc"' -DUSE_READLINE           -I/usr/include  -DSYB_LP64   -c -o cmd_alias.o cmd_alias.c
gcc -g -O2 -DSQSH_RC='"/usr/local/etc/sqshrc:${HOME}/.sqshrc"' -DUSE_READLINE           -I/usr/include  -DSYB_LP64   -c -o cmd_bcp.o cmd_bcp.c
gcc -g -O2 -DSQSH_RC='"/usr/local/etc/sqshrc:${HOME}/.sqshrc"' -DUSE_READLINE           -I/usr/include  -DSYB_LP64   -c -o cmd_buf.o cmd_buf.c
gcc -g -O2 -DSQSH_RC='"/usr/local/etc/sqshrc:${HOME}/.sqshrc"' -DUSE_READLINE           -I/usr/include  -DSYB_LP64   -c -o cmd_connect.o cmd_connect.c
cmd_connect.c:54: warning: "CS_TDS_71" redefined
 #define CS_TDS_71 7366

In file included from /usr/include/ctpublic.h:23,
                 from cmd_connect.c:28:
/usr/include/cspublic.h:289: note: this is the location of the previous definition
 #define CS_TDS_71 CS_TDS_71

cmd_connect.c:55: warning: "CS_TDS_72" redefined
 #define CS_TDS_72 7367

In file included from /usr/include/ctpublic.h:23,
                 from cmd_connect.c:28:
/usr/include/cspublic.h:291: note: this is the location of the previous definition
 #define CS_TDS_72 CS_TDS_72

cmd_connect.c:56: warning: "CS_TDS_73" redefined
 #define CS_TDS_73 7368

In file included from /usr/include/ctpublic.h:23,
                 from cmd_connect.c:28:
/usr/include/cspublic.h:293: note: this is the location of the previous definition
 #define CS_TDS_73 CS_TDS_73

cmd_connect.c:57: warning: "CS_TDS_74" redefined
 #define CS_TDS_74 7369

In file included from /usr/include/ctpublic.h:23,
                 from cmd_connect.c:28:
/usr/include/cspublic.h:295: note: this is the location of the previous definition
 #define CS_TDS_74 CS_TDS_74

cmd_connect.c: In function ‘SetNetAuth’:
cmd_connect.c:1906:17: error: ‘CS_MAX_CHAR’ undeclared (first use in this function); did you mean ‘CS_VARCHAR’?
     CS_CHAR buf[CS_MAX_CHAR+1];
                 ^~~~~~~~~~~
                 CS_VARCHAR
cmd_connect.c:1906:17: note: each undeclared identifier is reported only once for each function it appears in
cmd_connect.c:1916:7: error: ‘CS_SEC_CHANBIND’ undeclared (first use in this function); did you mean ‘CS_SEC_CHALLENGE’?
     { CS_SEC_CHANBIND,       'b', "Channel binding" },
       ^~~~~~~~~~~~~~~
       CS_SEC_CHALLENGE
cmd_connect.c:1917:7: error: ‘CS_SEC_CONFIDENTIALITY’ undeclared (first use in this function); did you mean ‘CS_SEC_NEGOTIATE’?
     { CS_SEC_CONFIDENTIALITY,'c', "Data confidentiality" },
       ^~~~~~~~~~~~~~~~~~~~~~
       CS_SEC_NEGOTIATE
cmd_connect.c:1919:7: error: ‘CS_SEC_INTEGRITY’ undeclared (first use in this function); did you mean ‘CS_SEC_NEGOTIATE’?
     { CS_SEC_INTEGRITY,      'i', "Data integrity" },
       ^~~~~~~~~~~~~~~~
       CS_SEC_NEGOTIATE
cmd_connect.c:1921:7: error: ‘CS_SEC_DATAORIGIN’ undeclared (first use in this function); did you mean ‘CS_SEC_DELEGATION’?
     { CS_SEC_DATAORIGIN,     'o', "Data origin stamping" },
       ^~~~~~~~~~~~~~~~~
       CS_SEC_DELEGATION
cmd_connect.c:1922:7: error: ‘CS_SEC_DETECTSEQ’ undeclared (first use in this function); did you mean ‘CS_SEC_DELEGATION’?
     { CS_SEC_DETECTSEQ,      'q', "Data out-of-sequence detection" },
       ^~~~~~~~~~~~~~~~
       CS_SEC_DELEGATION
cmd_connect.c:1923:7: error: ‘CS_SEC_DETECTREPLAY’ undeclared (first use in this function); did you mean ‘CS_SEC_DELEGATION’?
     { CS_SEC_DETECTREPLAY,   'r', "Data replay detection" },
       ^~~~~~~~~~~~~~~~~~~
       CS_SEC_DELEGATION
cmd_connect.c:1959:27: error: ‘CS_SEC_KEYTAB’ undeclared (first use in this function); did you mean ‘CS_SEC_NEGOTIATE’?
                           CS_SEC_KEYTAB,          /* Property */
                           ^~~~~~~~~~~~~
                           CS_SEC_NEGOTIATE
cmd_connect.c:1980:27: error: ‘CS_SEC_MECHANISM’ undeclared (first use in this function); did you mean ‘CS_SEC_DELEGATION’?
                           CS_SEC_MECHANISM,       /* Property */
                           ^~~~~~~~~~~~~~~~
                           CS_SEC_DELEGATION
cmd_connect.c: In function ‘ShowNetAuthCredExp’:
cmd_connect.c:2111:23: error: ‘CS_SEC_CREDTIMEOUT’ undeclared (first use in this function); did you mean ‘CS_SEC_ENCRYPTION’?
                       CS_SEC_CREDTIMEOUT,     /* Property */
                       ^~~~~~~~~~~~~~~~~~
                       CS_SEC_ENCRYPTION
cmd_connect.c:2127:18: error: ‘CS_UNEXPIRED’ undeclared (first use in this function); did you mean ‘EKEYEXPIRED’?
             case CS_UNEXPIRED:
                  ^~~~~~~~~~~~
                  EKEYEXPIRED
make[1]: *** [<builtin>: cmd_connect.o] Error 1
make[1]: Leaving directory '/home/user/src/sqsh-rel_3_0_b/src'
vonloxley commented 1 year ago

Thanks for the head-up. I don’t use freetds, so this will have to wait until I have lots of free time at hand. Patches are welcome, though.

Have a nice weekend!

boekhold commented 1 year ago

@freddy77 from the FreeTDS team has done the work in the following fork: https://github.com/freddy77/sqsh/tree/freetds_compatibility

Also see https://github.com/FreeTDS/freetds/issues/500

vonloxley commented 11 months ago

Merged. Thank you!