Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

For God's sake, stop researching for a while and begin to think!


computers / news.software.nntp / INN 2.7.1 Compile warning in cnfs.c

SubjectAuthor
* INN 2.7.1 Compile warning in cnfs.cJesse Rehmer
`- Re: INN 2.7.1 Compile warning in cnfs.cJulien ÉLIE

1
INN 2.7.1 Compile warning in cnfs.c

<u3mifn$1mpp$1@nnrp.usenet.blueworldhosting.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=1722&group=news.software.nntp#1722

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!nnrp.usenet.blueworldhosting.com!.POSTED!not-for-mail
From: jesse.rehmer@blueworldhosting.com (Jesse Rehmer)
Newsgroups: news.software.nntp
Subject: INN 2.7.1 Compile warning in cnfs.c
Date: Fri, 12 May 2023 23:35:19 -0000 (UTC)
Organization: BlueWorld Hosting Usenet (https://usenet.blueworldhosting.com)
Message-ID: <u3mifn$1mpp$1@nnrp.usenet.blueworldhosting.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=fixed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 12 May 2023 23:35:19 -0000 (UTC)
Injection-Info: nnrp.usenet.blueworldhosting.com;
logging-data="56121"; mail-complaints-to="usenet@blueworldhosting.com"
User-Agent: Usenapp for MacOS
Cancel-Lock: sha1:vsGZPkxN0ZBR8NUvaHdwuVSnLzs= sha256:qTcv+eKdldn2Hq0fE0weRGktK6KFlWB6qXFIcvTpefA=
sha1:MdisqJQvUtIH5b1sPrWrKIWyCxA= sha256:SvsZij6fywqxtJjmp9HOYmrOBPYEpOKgQxLNYADdrqc=
X-Usenapp: v1.26.6/d - Full License
 by: Jesse Rehmer - Fri, 12 May 2023 23:35 UTC

Spinning up a new server to convert tradspool to CNFS and notice the following
compile time warning when building INN 2.7.1. I do not recall seeing this when
building 2.7.0 (but it's been awhile). Running "make tests" results in all
tests successfully passing.

Build environment:

[news@gatekeeper ~/src/inn-2.7.1]$ uname -ar
FreeBSD gatekeeper 13.2-RELEASE FreeBSD 13.2-RELEASE
releng/13.2-n254617-525ecfdad597 GENERIC amd64

[news@gatekeeper ~/src/inn-2.7.1]$ gcc --version
gcc (FreeBSD Ports Collection) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Configure command:

../configure --mandir=/usr/local/man --prefix=/usr/local/news
--with-spool-dir=/usr/local/news/spool --with-log-dir=/var/log/news
--with-tmp-dir=/usr/local/news/tmp --sysconfdir=/usr/local/news/etc
--with-run-dir=/usr/local/news/run --with-db-dir=/usr/local/news/db
--datarootdir=/usr/local/news/share --with-perl --with-blacklist
--with-sqlite3=/usr/local --with-bdb --with-bdb-lib=/usr/local/lib/db18
--with-bdb-include=/usr/local/include/db18 --without-krb5 --enable-keywords
--enable-largefiles --with-python --with-openssl=/usr

Warning exhibited:

.../libtool --mode=compile gcc -g -O2 -fPIE -D_FORTIFY_SOURCE=2
-fstack-protector-strong -I../include -I. -I/usr/local/include/db18
-I/usr/local/include -c -o cnfs/cnfs.o cnfs/cnfs.c
libtool: compile: gcc -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong
-I../include -I. -I/usr/local/include/db18 -I/usr/local/include -c cnfs/cnfs.c
-fPIC -DPIC -o cnfs/.libs/cnfs.o
In function 'CNFS_setcurrent',
inlined from 'cnfs_init' at cnfs/cnfs.c:1211:17:
cnfs/cnfs.c:814:13: warning: 'strncpy' specified bound 16 equals destination
size [-Wstringop-truncation]
814 | strncpy(cycbuff->metaname, metacycbuff->name, CNFSNASIZ);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Re: INN 2.7.1 Compile warning in cnfs.c

<u3rdnh$ji7a$2@news.trigofacile.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=1726&group=news.software.nntp#1726

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.trigofacile.com!.POSTED.176.143-2-105.abo.bbox.fr!not-for-mail
From: iulius@nom-de-mon-site.com.invalid (Julien ÉLIE)
Newsgroups: news.software.nntp
Subject: Re: INN 2.7.1 Compile warning in cnfs.c
Date: Sun, 14 May 2023 21:44:49 +0200
Organization: Groupes francophones par TrigoFACILE
Message-ID: <u3rdnh$ji7a$2@news.trigofacile.com>
References: <u3mifn$1mpp$1@nnrp.usenet.blueworldhosting.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 14 May 2023 19:44:49 -0000 (UTC)
Injection-Info: news.trigofacile.com; posting-account="julien"; posting-host="176.143-2-105.abo.bbox.fr:176.143.2.105";
logging-data="641258"; mail-complaints-to="abuse@trigofacile.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.10.1
Cancel-Lock: sha1:TRoT4k/zUMPJrFUYnYkeY8WyQnU= sha256:vde78ax9OfW8plq2sH263m4XBcgBYFdMiOXj9VzHHKM=
sha1:VuWGRo/YMr8KYoO3+OctnrR4Ick= sha256:ONksfdKaNf9Q3oi6sTpaNvtEXcDPxZO6pWMQN0bjlYU=
In-Reply-To: <u3mifn$1mpp$1@nnrp.usenet.blueworldhosting.com>
 by: Julien ÉLIE - Sun, 14 May 2023 19:44 UTC

Hi Jesse,

> Spinning up a new server to convert tradspool to CNFS and notice the following
> compile time warning when building INN 2.7.1. I do not recall seeing this when
> building 2.7.0 (but it's been awhile).
>
> Warning exhibited:
>
> cnfs/cnfs.c:814:13: warning: 'strncpy' specified bound 16 equals destination
> size [-Wstringop-truncation]
> 814 | strncpy(cycbuff->metaname, metacycbuff->name, CNFSNASIZ);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This specific warning should have been ignored, and not triggered by
your gcc 12.2.0. At least, there is no reason why it was not seen in
INN 2.7.0, which similarly has it ignored. (Unless of course __GNUC__
is no longer set in this version from FreeBSD.)

#if __GNUC__ > 7
# pragma GCC diagnostic ignored "-Wstringop-truncation"
#endif
/* Don't use sprintf() or strlcat() directly...
* The terminating '\0' causes grief. */
strncpy(cycbuff->metaname, metacycbuff->name, CNFSNASIZ);

The code works fine so you should not worry about it.

There are some diagnostics ignored sometimes in the source code, but
that's OK. (A rewrite of such parts of code is welcome of course to get
rid of the warning. In this case, probably switching to use memcpy().)

--
Julien ÉLIE

« Il n'y a que le premier pas qui coûte. » (Mme du Deffand)

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor