db: Modify the strncat() in __db_conn()
db: Modify the strncat() in __db_conn()

Compiling with GCC 9.1.0 produced the following warning

  CC    db.o
In file included from /usr/include/string.h:638,
                 from common.h:17,
                 from db.c:21:
In function ‘strncat’,
    inlined from ‘__db_conn’ at db.c:49:3:
/usr/include/bits/string3.h:150:10: warning: ‘__builtin___strncat_chk’
output may be truncated copying 64 bytes from a string of length 64
[-Wstringop-truncation]
  150 |   return __builtin___strncat_chk (__dest, __src, __len, __bos
(__dest));
      |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

That 64 bytes is TENANT_MAX and that was used as the size argument to
strncat().

It seems GCC is now stricter about what it considers safe for the size
argument[0]

    "... GCC assumes the size argument refers to the remaining space in
     the destination buffer ..."

So it now checks strncat() calls follow the below pattern

    strncat(dest, src, dest_size - strlen(dest) - 1);

So that's what we do. Even though in this case TENANT_MAX == dest_size -
strlen(dest) - 1.

[0]:
https://developers.redhat.com/blog/2018/05/24/detecting-string-truncation-with-gcc-8/ (see the "Forming Truncated Strings with strncat" section)

Signed-off-by: Andrew Clayton <02e0a999c50b1f88df7a8f5a04e1b76b35ea6a88@digital-domain.net>

ac000/fcgi_app_core,ac000/fcgi_app_core