[packages/srp] - added format patch (fixes build with -Werror=format-security) - added bison patch (fixes yacc synt
qboosh
qboosh at pld-linux.org
Sun Feb 16 12:08:06 CET 2014
commit 4029f1f1ef2cd5748e2d9633004238a5ba3060fc
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sun Feb 16 12:10:13 2014 +0100
- added format patch (fixes build with -Werror=format-security)
- added bison patch (fixes yacc syntax to be compatible with recent bison)
srp-bison.patch | 542 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
srp-format.patch | 106 +++++++++++
srp.spec | 5 +
3 files changed, 653 insertions(+)
---
diff --git a/srp.spec b/srp.spec
index 59ba966..85abaf6 100644
--- a/srp.spec
+++ b/srp.spec
@@ -15,9 +15,12 @@ Patch0: %{name}-shared.patch
Patch1: %{name}-paths.patch
Patch2: %{name}-cflags.patch
Patch3: %{name}-getline.patch
+Patch4: %{name}-format.patch
+Patch5: %{name}-bison.patch
URL: http://srp.stanford.edu/
BuildRequires: autoconf
BuildRequires: automake
+BuildRequires: bison
BuildRequires: libtool
BuildRequires: ncurses-devel
BuildRequires: openssl-devel >= 0.9.7
@@ -133,6 +136,8 @@ Serwer FTP ze wsparciem dla protokołu Secure Remote Password.
%patch1 -p1
%patch2 -p1
%patch3 -p1
+%patch4 -p1
+%patch5 -p1
%build
cd libsrp
diff --git a/srp-bison.patch b/srp-bison.patch
new file mode 100644
index 0000000..f35f78c
--- /dev/null
+++ b/srp-bison.patch
@@ -0,0 +1,542 @@
+--- srp-2.1.2/ftp/ftpd/ftpcmd.y.orig 2014-02-16 09:47:44.418860427 +0100
++++ srp-2.1.2/ftp/ftpd/ftpcmd.y 2014-02-16 12:00:00.621860710 +0100
+@@ -197,7 +197,7 @@
+
+ cmd_list: /* empty */
+ | cmd_list cmd
+- = {
++ {
+ fromname = (char *) 0;
+ restart_point = (off_t) 0;
+ }
+@@ -205,17 +205,17 @@
+ ;
+
+ cmd: USER SP username CRLF
+- = {
++ {
+ user((char *) $3);
+ free((char *) $3);
+ }
+ | PASS SP password CRLF
+- = {
++ {
+ pass((char *) $3);
+ free((char *) $3);
+ }
+ | PORT SP host_port CRLF
+- = {
++ {
+ usedefault = 0;
+ if (pdata >= 0) {
+ (void) close(pdata);
+@@ -224,23 +224,23 @@
+ reply(200, "PORT command successful.");
+ }
+ | PASV check_login CRLF
+- = {
++ {
+ if ($2)
+ passive();
+ }
+ | PROT SP prot_code CRLF
+- = {
++ {
+ if (maxbuf)
+ setlevel ($3);
+ else
+ reply(503, "Must first set PBSZ");
+ }
+ | CCC CRLF
+- = {
++ {
+ reply(534, "CCC not supported");
+ }
+ | PBSZ SP STRING CRLF
+- = {
++ {
+ /* Others may want to do something more fancy here */
+ if (!auth_type)
+ reply(503, "Must first perform authentication");
+@@ -266,7 +266,7 @@
+ }
+ }
+ | TYPE SP type_code CRLF
+- = {
++ {
+ switch (cmd_type) {
+
+ case TYPE_A:
+@@ -301,7 +301,7 @@
+ }
+ }
+ | STRU SP struct_code CRLF
+- = {
++ {
+ switch ($3) {
+
+ case STRU_F:
+@@ -313,7 +313,7 @@
+ }
+ }
+ | MODE SP mode_code CRLF
+- = {
++ {
+ switch ($3) {
+
+ case MODE_S:
+@@ -325,78 +325,78 @@
+ }
+ }
+ | ALLO SP NUMBER CRLF
+- = {
++ {
+ reply(202, "ALLO command ignored.");
+ }
+ | ALLO SP NUMBER SP R SP NUMBER CRLF
+- = {
++ {
+ reply(202, "ALLO command ignored.");
+ }
+ | RETR check_login SP pathname CRLF
+- = {
++ {
+ if ($2 && $4 != NULL)
+ retrieve((char *) 0, (char *) $4);
+ if ($4 != NULL)
+ free((char *) $4);
+ }
+ | STOR check_login SP pathname CRLF
+- = {
++ {
+ if ($2 && $4 != NULL)
+ store_file((char *) $4, "w", 0);
+ if ($4 != NULL)
+ free((char *) $4);
+ }
+ | APPE check_login SP pathname CRLF
+- = {
++ {
+ if ($2 && $4 != NULL)
+ store_file((char *) $4, "a", 0);
+ if ($4 != NULL)
+ free((char *) $4);
+ }
+ | NLST check_login CRLF
+- = {
++ {
+ if ($2)
+ send_file_list(".");
+ }
+ | NLST check_login SP STRING CRLF
+- = {
++ {
+ if ($2 && $4 != NULL)
+ send_file_list((char *) $4);
+ if ($4 != NULL)
+ free((char *) $4);
+ }
+ | LIST check_login CRLF
+- = {
++ {
+ if ($2)
+ retrieve("/bin/ls -lgA", "");
+ }
+ | LIST check_login SP STRING CRLF
+- = {
++ {
+ if ($2 && $4 != NULL)
+ retrieve("/bin/ls -lgA %s", (char *) $4);
+ if ($4 != NULL)
+ free((char *) $4);
+ }
+ | STAT check_login SP pathname CRLF
+- = {
++ {
+ if ($2 && $4 != NULL)
+ statfilecmd((char *) $4);
+ if ($4 != NULL)
+ free((char *) $4);
+ }
+ | STAT CRLF
+- = {
++ {
+ statcmd();
+ }
+ | DELE check_login SP pathname CRLF
+- = {
++ {
+ if ($2 && $4 != NULL)
+ delete_file((char *) $4);
+ if ($4 != NULL)
+ free((char *) $4);
+ }
+ | RNTO SP pathname CRLF
+- = {
++ {
+ if (fromname) {
+ renamecmd(fromname, (char *) $3);
+ free(fromname);
+@@ -407,27 +407,27 @@
+ free((char *) $3);
+ }
+ | ABOR CRLF
+- = {
++ {
+ reply(225, "ABOR command successful.");
+ }
+ | CWD check_login CRLF
+- = {
++ {
+ if ($2)
+ cwd(pw->pw_dir);
+ }
+ | CWD check_login SP pathname CRLF
+- = {
++ {
+ if ($2 && $4 != NULL)
+ cwd((char *) $4);
+ if ($4 != NULL)
+ free((char *) $4);
+ }
+ | HELP CRLF
+- = {
++ {
+ help(cmdtab, (char *) 0);
+ }
+ | HELP SP STRING CRLF
+- = {
++ {
+ register char *cp = (char *)$3;
+
+ if (strncasecmp(cp, "SITE", 4) == 0) {
+@@ -442,43 +442,43 @@
+ help(cmdtab, (char *) $3);
+ }
+ | NOOP CRLF
+- = {
++ {
+ reply(200, "NOOP command successful.");
+ }
+ | MKD check_login SP pathname CRLF
+- = {
++ {
+ if ($2 && $4 != NULL)
+ makedir((char *) $4);
+ if ($4 != NULL)
+ free((char *) $4);
+ }
+ | RMD check_login SP pathname CRLF
+- = {
++ {
+ if ($2 && $4 != NULL)
+ removedir((char *) $4);
+ if ($4 != NULL)
+ free((char *) $4);
+ }
+ | PWD check_login CRLF
+- = {
++ {
+ if ($2)
+ pwd();
+ }
+ | CDUP check_login CRLF
+- = {
++ {
+ if ($2)
+ cwd("..");
+ }
+ | SITE SP HELP CRLF
+- = {
++ {
+ help(sitetab, (char *) 0);
+ }
+ | SITE SP HELP SP STRING CRLF
+- = {
++ {
+ help(sitetab, (char *) $5);
+ }
+ | SITE SP UMASK check_login CRLF
+- = {
++ {
+ int oldmask;
+
+ if ($4) {
+@@ -488,7 +488,7 @@
+ }
+ }
+ | SITE SP UMASK check_login SP octal_number CRLF
+- = {
++ {
+ int oldmask;
+
+ if ($4) {
+@@ -503,7 +503,7 @@
+ }
+ }
+ | SITE SP CHMOD check_login SP octal_number SP pathname CRLF
+- = {
++ {
+ if ($4 && ($8 != NULL)) {
+ if ($6 > 0777)
+ reply(501,
+@@ -517,13 +517,13 @@
+ free((char *) $8);
+ }
+ | SITE SP IDLE CRLF
+- = {
++ {
+ reply(200,
+ "Current IDLE time limit is %d seconds; max %d",
+ timeout, maxtimeout);
+ }
+ | SITE SP IDLE SP NUMBER CRLF
+- = {
++ {
+ if ($5 < 30 || $5 > maxtimeout) {
+ reply(501,
+ "Maximum IDLE time must be between 30 and %d seconds",
+@@ -537,14 +537,14 @@
+ }
+ }
+ | STOU check_login SP pathname CRLF
+- = {
++ {
+ if ($2 && $4 != NULL)
+ store_file((char *) $4, "w", 1);
+ if ($4 != NULL)
+ free((char *) $4);
+ }
+ | SYST CRLF
+- = {
++ {
+ #ifdef unix
+ #ifdef __svr4__
+ #undef BSD
+@@ -568,7 +568,7 @@
+ * using with RESTART (we just count bytes).
+ */
+ | SIZE check_login SP pathname CRLF
+- = {
++ {
+ if ($2 && $4 != NULL)
+ sizecmd((char *) $4);
+ if ($4 != NULL)
+@@ -585,7 +585,7 @@
+ * not necessarily 3 digits)
+ */
+ | MDTM check_login SP pathname CRLF
+- = {
++ {
+ if ($2 && $4 != NULL) {
+ struct stat stbuf;
+ if (stat((char *) $4, &stbuf) < 0)
+@@ -607,26 +607,26 @@
+ free((char *) $4);
+ }
+ | AUTH SP STRING CRLF
+- = {
++ {
+ auth((char *) $3);
+ }
+ | ADAT SP STRING CRLF
+- = {
++ {
+ auth_data((char *) $3);
+ free((char *) $3);
+ }
+ | QUIT CRLF
+- = {
++ {
+ reply(221, "Goodbye.");
+ dologout(0);
+ }
+ | error CRLF
+- = {
++ {
+ yyerrok;
+ }
+ ;
+ rcmd: RNFR check_login SP pathname CRLF
+- = {
++ {
+ char *renamefrom();
+
+ restart_point = (off_t) 0;
+@@ -638,7 +638,7 @@
+ }
+ }
+ | REST SP byte_size CRLF
+- = {
++ {
+ fromname = (char *) 0;
+ restart_point = $3;
+ reply(350, "Restarting at %ld. %s", restart_point,
+@@ -650,7 +650,7 @@
+ ;
+
+ password: /* empty */
+- = {
++ {
+ *(char **)&($$) = (char *)calloc(1, sizeof(char));
+ }
+ | STRING
+@@ -661,7 +661,7 @@
+
+ host_port: NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA
+ NUMBER COMMA NUMBER
+- = {
++ {
+ register char *a, *p;
+
+ a = (char *)&data_dest.sin_addr;
+@@ -673,109 +673,109 @@
+ ;
+
+ form_code: N
+- = {
++ {
+ $$ = FORM_N;
+ }
+ | T
+- = {
++ {
+ $$ = FORM_T;
+ }
+ | C
+- = {
++ {
+ $$ = FORM_C;
+ }
+ ;
+
+ prot_code: C
+- = {
++ {
+ $$ = PROT_C;
+ }
+ | S
+- = {
++ {
+ $$ = PROT_S;
+ }
+ | P
+- = {
++ {
+ $$ = PROT_P;
+ }
+ | E
+- = {
++ {
+ $$ = PROT_E;
+ }
+ ;
+
+ type_code: A
+- = {
++ {
+ cmd_type = TYPE_A;
+ cmd_form = FORM_N;
+ }
+ | A SP form_code
+- = {
++ {
+ cmd_type = TYPE_A;
+ cmd_form = $3;
+ }
+ | E
+- = {
++ {
+ cmd_type = TYPE_E;
+ cmd_form = FORM_N;
+ }
+ | E SP form_code
+- = {
++ {
+ cmd_type = TYPE_E;
+ cmd_form = $3;
+ }
+ | I
+- = {
++ {
+ cmd_type = TYPE_I;
+ }
+ | L
+- = {
++ {
+ cmd_type = TYPE_L;
+ cmd_bytesz = NBBY;
+ }
+ | L SP byte_size
+- = {
++ {
+ cmd_type = TYPE_L;
+ cmd_bytesz = $3;
+ }
+ /* this is for a bug in the BBN ftp */
+ | L byte_size
+- = {
++ {
+ cmd_type = TYPE_L;
+ cmd_bytesz = $2;
+ }
+ ;
+
+ struct_code: F
+- = {
++ {
+ $$ = STRU_F;
+ }
+ | R
+- = {
++ {
+ $$ = STRU_R;
+ }
+ | P
+- = {
++ {
+ $$ = STRU_P;
+ }
+ ;
+
+ mode_code: S
+- = {
++ {
+ $$ = MODE_S;
+ }
+ | B
+- = {
++ {
+ $$ = MODE_B;
+ }
+ | C
+- = {
++ {
+ $$ = MODE_C;
+ }
+ ;
+
+ pathname: pathstring
+- = {
++ {
+ /*
+ * Problem: this production is used for all pathname
+ * processing, but only gives a 550 error reply.
+@@ -817,7 +817,7 @@
+ ;
+
+ octal_number: NUMBER
+- = {
++ {
+ register int ret, dec, multby, digit;
+
+ /*
+@@ -842,7 +842,7 @@
+ ;
+
+ check_login: /* empty */
+- = {
++ {
+ if (logged_in)
+ $$ = 1;
+ else {
diff --git a/srp-format.patch b/srp-format.patch
new file mode 100644
index 0000000..fc4196c
--- /dev/null
+++ b/srp-format.patch
@@ -0,0 +1,106 @@
+--- srp-2.1.2/telnet/libtelnet/read_password.c.orig 2001-04-03 13:35:14.000000000 +0200
++++ srp-2.1.2/telnet/libtelnet/read_password.c 2014-02-16 10:55:00.938691031 +0100
+@@ -57,6 +57,7 @@
+ #if defined(RSA_ENCPWD) || defined(KRB4_ENCPWD) || defined(HAVE_SRP) || defined(TLS)
+
+ #include <stdio.h>
++#include <string.h>
+ #include <strings.h>
+ #include <sys/ioctl.h>
+ #include <signal.h>
+@@ -156,7 +157,7 @@
+ if(old_fflags & O_NDELAY)
+ fcntl(0, F_SETFL, old_fflags & ~O_NDELAY);
+ while (!ok) {
+- (void) printf(prompt);
++ (void) fputs(prompt, stdout);
+ (void) fflush(stdout);
+ while (!fgets(s, max, stdin));
+
+@@ -272,7 +273,7 @@
+ if(old_fflags & O_NDELAY)
+ fcntl(0, F_SETFL, old_fflags & ~O_NDELAY);
+ while (!ok) {
+- (void) printf(prompt);
++ (void) fputs(prompt, stdout);
+ (void) fflush(stdout);
+ while (!fgets(s, max, stdin));
+
+--- srp-2.1.2/telnet/telnet/utilities.c.orig 2000-12-07 09:18:40.000000000 +0100
++++ srp-2.1.2/telnet/telnet/utilities.c 2014-02-16 11:10:48.898651250 +0100
+@@ -47,6 +47,7 @@
+ #include <sys/time.h>
+
+ #include <ctype.h>
++#include <stdlib.h>
+
+ #include "general.h"
+
+@@ -867,13 +868,13 @@
+ if (pointer[0] == TELOPT_OLD_ENVIRON) {
+ # ifdef ENV_HACK
+ if (old_env_var == OLD_ENV_VALUE)
+- fprintf(NetTrace, "\" (VALUE) " + noquote);
++ fputs("\" (VALUE) " + noquote, NetTrace);
+ else
+ # endif
+- fprintf(NetTrace, "\" VAR " + noquote);
++ fputs("\" VAR " + noquote, NetTrace);
+ } else
+ #endif /* OLD_ENVIRON */
+- fprintf(NetTrace, "\" VALUE " + noquote);
++ fputs("\" VALUE " + noquote, NetTrace);
+ noquote = 2;
+ break;
+
+@@ -883,23 +884,23 @@
+ if (pointer[0] == TELOPT_OLD_ENVIRON) {
+ # ifdef ENV_HACK
+ if (old_env_value == OLD_ENV_VAR)
+- fprintf(NetTrace, "\" (VAR) " + noquote);
++ fputs("\" (VAR) " + noquote, NetTrace);
+ else
+ # endif
+- fprintf(NetTrace, "\" VALUE " + noquote);
++ fputs("\" VALUE " + noquote, NetTrace);
+ } else
+ #endif /* OLD_ENVIRON */
+- fprintf(NetTrace, "\" VAR " + noquote);
++ fputs("\" VAR " + noquote, NetTrace);
+ noquote = 2;
+ break;
+
+ case ENV_ESC:
+- fprintf(NetTrace, "\" ESC " + noquote);
++ fputs("\" ESC " + noquote, NetTrace);
+ noquote = 2;
+ break;
+
+ case ENV_USERVAR:
+- fprintf(NetTrace, "\" USERVAR " + noquote);
++ fputs("\" USERVAR " + noquote, NetTrace);
+ noquote = 2;
+ break;
+
+--- srp-2.1.2/telnet/telnetd/telnetd.c.orig 2003-04-04 13:35:25.000000000 +0200
++++ srp-2.1.2/telnet/telnetd/telnetd.c 2014-02-16 11:12:59.528645765 +0100
+@@ -842,7 +842,7 @@
+ char *error_message =
+ "Encryption was not successfully negotiated. Goodbye.\r\n\r\n";
+
+- fprintf(stderr,error_message);
++ fputs(error_message, stderr);
+ writenet(error_message, strlen(error_message));
+ netflush();
+ exit(1);
+--- srp-2.1.2/base/src/login.c.orig 2002-11-04 08:20:35.000000000 +0100
++++ srp-2.1.2/base/src/login.c 2014-02-16 12:01:06.741857933 +0100
+@@ -262,7 +262,7 @@
+ fclose(mfp);
+ } else
+ #endif
+- printf(mesg);
++ fputs(mesg, stdout);
+ fflush(stdout);
+ }
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/srp.git/commitdiff/4029f1f1ef2cd5748e2d9633004238a5ba3060fc
More information about the pld-cvs-commit
mailing list