fix source so that '-Wformat -Werror=format-security' doesn't stop us from compiling
authorWilfried Goesgens <dothebart@citadel.org>
Thu, 12 May 2011 20:18:03 +0000 (20:18 +0000)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 4 Sep 2011 20:32:11 +0000 (20:32 +0000)
citadel/debian/rules
citadel/modules/extnotify/funambol65.c
citadel/modules/managesieve/serv_managesieve.c
citadel/modules/network/serv_network.c
citadel/serv_extensions.c
citadel/utillib/citadel_ipc.c
citadel/utils/sendcommand.c
libcitadel/debian/rules
webcit/debian/po/templates.pot
webcit/debian/rules
webcit/subst.c

index 85489575c077f88c549fd83a25edcea05b6816db..9217bc55a3f3822680cafb65be6340f22748450b 100755 (executable)
@@ -11,7 +11,7 @@ export DH_OPTIONS
 
 DEB_DESTDIR = $(CURDIR)/debian/tmp
 
-CFLAGS = -Wall -g
+CFLAGS = -Wall -g -Werror=format-security 
 
 COMPILER=
 EXTRA_ARGS=
index 5cd7c4d9eda718e990749ee7fc05bce28d89451f..1d3e7e4dbe6bdc4478d6ff8c179e5281019a6621 100644 (file)
@@ -90,7 +90,7 @@ int notify_http_server(char *remoteurl,
                        snprintf(buf, SIZ, 
                                 "Cannot load template file %s [%s]won't send notification\r\n", 
                                 file_funambol_msg, strerror(errno));
-                       syslog(LOG_ERR, buf);
+                       syslog(LOG_ERR, "%s", buf);
 
                        CtdlAideMessage(buf, "External notifier unable to find message template!");
                        goto abort;
@@ -113,7 +113,7 @@ int notify_http_server(char *remoteurl,
                        snprintf(buf, SIZ, 
                                 "Cannot load template file %s; won't send notification\r\n", 
                                 file_funambol_msg);
-                       syslog(LOG_ERR, buf);
+                       syslog(LOG_ERR, "%s", buf);
 
                        CtdlAideMessage(buf, "External notifier unable to load message template!");
                        goto abort;
index 965cff9648d71169db9c7a0f862f091365d4f991..680f26d89fdf802d6f9b4ab53620427573f9e80e 100644 (file)
@@ -464,7 +464,7 @@ void cmd_mgsve_getscript(int num_parms, char **parms, struct sdm_userdata *u)
                        slen = strlen(script_content);
                        outbuf = malloc (slen + 64);
                        snprintf(outbuf, slen + 64, "{%ld+}\r\n%s\r\nOK\r\n",slen, script_content);
-                       cprintf(outbuf);
+                       cprintf("%s", outbuf);
                }
                else
                        cprintf("No \"there is no script by that name %s \"\r\n", parms[1]);
index 4518740bf1ac9d00754940659cfbe3070abb6f5b..1187cfe58a9909ffbd669b41d93cd86ef13daad4 100644 (file)
@@ -2436,7 +2436,7 @@ void cmd_netp(char *cmdbuf)
                        "An unknown Citadel server called \"%s\" attempted to connect from %s [%s].\n",
                        node, CC->cs_host, CC->cs_addr
                );
-               syslog(LOG_WARNING, err_buf);
+               syslog(LOG_WARNING, "%s", err_buf);
                cprintf("%d authentication failed\n", ERROR + PASSWORD_REQUIRED);
                CtdlAideMessage(err_buf, "IGNet Networking.");
                return;
@@ -2447,7 +2447,7 @@ void cmd_netp(char *cmdbuf)
                        "A Citadel server at %s [%s] failed to authenticate as network node \"%s\".\n",
                        CC->cs_host, CC->cs_addr, node
                );
-               syslog(LOG_WARNING, err_buf);
+               syslog(LOG_WARNING, "%s", err_buf);
                cprintf("%d authentication failed\n", ERROR + PASSWORD_REQUIRED);
                CtdlAideMessage(err_buf, "IGNet Networking.");
                return;
index a94239573bb64c44585c768e16eae976a24510f2..33c83f73887f9003c19a288aa036daf88884e5a1 100644 (file)
@@ -126,8 +126,8 @@ void LogPrintMessages(long err)
 
        snprintf(Message, n * SIZ, ErrGeneral, Short, Where, List, Hint, DetailList);
 
-       syslog(LOG_EMERG,Message);
-       syslog(LOG_EMERG,ErrSubject);
+       syslog(LOG_EMERG, "%s", Message);
+       syslog(LOG_EMERG, "%s", ErrSubject);
        quickie_message("Citadel", NULL, NULL, AIDEROOM, Message, FMT_FIXED, ErrSubject);
        if (errormessages!=NULL) free (errormessages);
        errormessages = NULL;
index fb90f33d0c80f69966e62c8c2efc3588ba2c67a5..52da9167e10a1d34860421f3fc05247e0b5a9b14 100644 (file)
@@ -3251,7 +3251,7 @@ CtdlIPC* CtdlIPC_new(int argc, char **argv, char *hostbuf, char *portbuf)
        /* If we're using a unix domain socket we can do a bunch of stuff */
        if (!strcmp(cithost, UDS)) {
                if (!strcasecmp(citport, DEFAULT_PORT)) {
-                       snprintf(sockpath, sizeof sockpath, file_citadel_socket);
+                       snprintf(sockpath, sizeof sockpath, "%s", file_citadel_socket);
                }
                else {
                        snprintf(sockpath, sizeof sockpath, "%s/%s", citport, "citadel.socket");
index c259a5b685e44d7eb327bee0aa19eeda85c3a400..52d05258da58e69da24eb60a8f285ea842e9d2e6 100644 (file)
@@ -289,7 +289,7 @@ int main(int argc, char **argv)
                                n = read(ipc->sock, rbuf, SIZ);
                                if (n>0) {
                                        rbuf[n]='\0';
-                                       fprintf(stderr, rbuf);
+                                       fprintf(stderr, "%s", rbuf);
                                        fflush (stdout);
                                }
                        }
index a0cddd79e2c434491d70e6a668eb5599ddcd31c7..7bfdf7efc795ceff9b717f896824b6363e772b1a 100755 (executable)
@@ -9,7 +9,7 @@ export DH_COMPAT = 5
 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
-CFLAGS = -Wall -g 
+CFLAGS = -Wall -g  -Wformat -Werror=format-security
 #-finline-functions
 LDFALGS =
 # -finline-functions
index 28a4d829dccb0756d78403006c6ea47f43159c1f..bca6d4290592307348b275db5777408529b6c4f0 100644 (file)
@@ -8,10 +8,11 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: webcit@packages.debian.org\n"
-"POT-Creation-Date: 2009-02-28 11:20+0100\n"
+"POT-Creation-Date: 2011-05-12 20:13+0000\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=CHARSET\n"
 "Content-Transfer-Encoding: 8bit\n"
@@ -62,8 +63,8 @@ msgstr ""
 #. Description
 #: ../citadel-webcit.templates:3001
 msgid ""
-"Select the port which the SSL HTTP Webcit server should listen on or enter -"
-"1 to disable it."
+"Select the port which the SSL HTTP Webcit server should listen on or enter "
+"-1 to disable it."
 msgstr ""
 
 #. Type: select
index f97e5d04ebb25b4f843cd43fe856a8315b67aec4..2631d682c5347b9b8d8a0869b5f3c088d7d87f6e 100755 (executable)
@@ -18,6 +18,7 @@ DESTDIR=$(CURDIR)/debian/citadel-webcit
 EXTRA_ARGS=
 PROFILE_ARGS=
 COMPILER=
+CFLAGS= 
 #to enable debugging: export DEB_BUILD_OPTIONS="debug profiling compression urldebug iodbg clang"
 
 ifneq (,$(findstring clang,$(DEB_BUILD_OPTIONS)))
@@ -51,7 +52,7 @@ endif
 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
        cp -f /usr/share/misc/config.guess config.guess
 endif
-       CC=$(COMPILER) CFLAGS="$(CFLAGS)" ./configure \
+       CC=$(COMPILER) CFLAGS=" -Wformat -Werror=format-security $(CFLAGS)" ./configure \
                --host=$(DEB_HOST_GNU_TYPE) \
                --build=$(DEB_BUILD_GNU_TYPE) \
                --prefix=/usr/sbin/ \
index dce5de89671ca107231b52381851085c20dd71a6..8f906076950f20b3ced933f30a498a4855b6e19f 100644 (file)
@@ -256,7 +256,7 @@ void LogError (StrBuf *Target, const char *Type, const char *Format, ...)
        StrBufVAppendPrintf(Error, Format, arg_ptr);
        va_end(arg_ptr);
 
-       syslog(1, ChrPtr(Error));
+       syslog(1, "%s", ChrPtr(Error));
 
        WCC = WC;
        if (WCC->WFBuf == NULL) WCC->WFBuf = NewStrBuf();
@@ -2629,7 +2629,7 @@ void dbg_print_longvector(long *LongVector)
                        StrBufAppendPrintf(Buf, "%d: %ld]\n", i, LongVector[i]);
 
        }
-       syslog(1, ChrPtr(Buf));
+       syslog(1, "%s", ChrPtr(Buf));
        FreeStrBuf(&Buf);
 }