Am Sonntag, den 25.03.2012, 12:43 +0200 schrieb Noël Köthe:

> When trying to build lftp the linking fails with the following error:
> 
> /bin/bash ../libtool --silent --tag=CXX   --mode=compile gcc -DHAVE_CONFIG_H 
> -I. -I../lib -I../lib -I../trio  -I/usr/include/p11-kit-1    
> -D_FORTIFY_SOURCE=2  -g -O2 -fstack-protector --param=ssp-buffer-size=4 
> -Wformat -Wformat-security -Werror=format-security -g -Wall -Wall 
> -Wwrite-strings -Woverloaded-virtual -fno-exceptions -fno-rtti 
> -fno-implement-inlines -MT LocalAccess.lo -MD -MP -MF .deps/LocalAccess.Tpo 
> -c -o LocalAccess.lo LocalAccess.cc
> mv -f .deps/LocalAccess.Tpo .deps/LocalAccess.Plo
> /bin/bash ../libtool --silent --tag=CXX   --mode=link gcc  -g -O2 
> -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security 
> -Werror=format-security -g -Wall -Wall -Wwrite-strings -Woverloaded-virtual 
> -fno-exceptions -fno-rtti -fno-implement-inlines -module -avoid-version 
> -rpath /usr/lib/lftp/4.3.5 -Wl,-z,relro -o proto-file.la  LocalAccess.lo  
> -lutil -ltinfo -ldl -lsupc++ 
> /bin/bash ../libtool --silent --tag=CXX   --mode=compile gcc -DHAVE_CONFIG_H 
> -I. -I../lib -I../lib -I../trio  -I/usr/include/p11-kit-1    
> -D_FORTIFY_SOURCE=2  -g -O2 -fstack-protector --param=ssp-buffer-size=4 
> -Wformat -Wformat-security -Werror=format-security -g -Wall -Wall 
> -Wwrite-strings -Woverloaded-virtual -fno-exceptions -fno-rtti 
> -fno-implement-inlines -MT Fish.lo -MD -MP -MF .deps/Fish.Tpo -c -o Fish.lo 
> Fish.cc
> Fish.cc: In member function 'int Fish::HandleReplies()':
> Fish.cc:567:18: error: format not a string literal and no format arguments 
> [-Werror=format-security]
> cc1plus: some warnings being treated as errors
> make[2]: *** [Fish.lo] Error 1
> make[2]: Leaving directory `/tmp/buildd/lftp-4.3.5/src'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/tmp/buildd/lftp-4.3.5'
> make: *** [build-stamp] Error 2

attached is a patch for the problem from Simon Ruderich
<si...@ruderich.org>:

"The attached bug fixes those. I'm not sure if the first
fix (Fish.cc) is correct though, please have a look."

Maybe you want to include the patch in the next lftp release.

thx.

-- 
Noël Köthe <noel debian.org>
Debian GNU/Linux, www.debian.org
Description: Fix errors reported by -Werror=format-security.
Author: Simon Ruderich <si...@ruderich.org>
Last-Update: 2012-03-13

Index: lftp-4.3.5/src/Fish.cc
===================================================================
--- lftp-4.3.5.orig/src/Fish.cc 2012-03-13 23:23:55.709806633 +0100
+++ lftp-4.3.5/src/Fish.cc      2012-03-13 23:24:31.593807999 +0100
@@ -564,7 +564,7 @@
         const char *eol=strchr(err,'\n');
         if(eol) {
            xstring &e=xstring::get_tmp(err,eol-err);
-           LogError(0,e);
+           LogError(0,"%s",e.tmp_buf(eol-err));
            SetError(NO_FILE,e);
            if(pty_recv_buf)
               pty_recv_buf->Skip(eol-err+1);
Index: lftp-4.3.5/src/Job.h
===================================================================
--- lftp-4.3.5.orig/src/Job.h   2012-03-13 23:23:55.677806632 +0100
+++ lftp-4.3.5/src/Job.h        2012-03-13 23:24:31.597807999 +0100
@@ -77,7 +77,7 @@
    void ClearStatus()
       {
         const char *empty="";
-        eprintf(empty);
+        eprintf("%s",empty); /* just "" causes a -Wformat-zero-length" warning, not sure what this line does though */
       }
    virtual void          SayFinal() {}; // final phrase of fg job
    virtual int   Done()=0;
Index: lftp-4.3.5/src/SleepJob.cc
===================================================================
--- lftp-4.3.5.orig/src/SleepJob.cc     2012-03-13 23:23:55.625806630 +0100
+++ lftp-4.3.5/src/SleepJob.cc  2012-03-13 23:24:31.597807999 +0100
@@ -119,7 +119,7 @@
       Job::ShowRunStatus(s);
    else
    {
-      s->Show(Status());
+      s->Show("%s",Status());
       current->TimeoutS(1);
    }
 }
Index: lftp-4.3.5/src/mgetJob.cc
===================================================================
--- lftp-4.3.5.orig/src/mgetJob.cc      2012-03-13 23:23:55.625806630 +0100
+++ lftp-4.3.5/src/mgetJob.cc   2012-03-13 23:24:31.597807999 +0100
@@ -36,7 +36,7 @@
 {
    if(rg)
    {
-      s->Show(rg->Status());
+      s->Show("%s",rg->Status());
       return;
    }
    GetJob::ShowRunStatus(s);

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
lftp mailing list
lftp@uniyar.ac.ru
http://univ.uniyar.ac.ru/mailman/listinfo/lftp

Reply via email to