Bug#1050600: pdns-server: pdns_control list-zones (no filters) segfaults pdns?

2023-08-26 Thread наб
Control: tags -1 + fixed-upstream

Broken upstream by f115fbc97b9760bdfbff307e4de72a9cb3df0990, fixed
upstream by 0928e129fbd21c17a2f2e6e6066a58dad8102943.

$ git tag --contains 0928e129fbd21c17a2f2e6e6066a58dad8102943  | grep auth
auth-4.8.0-alpha1
auth-4.8.0-beta1
auth-4.8.0
auth-4.8.1

And what's worse, packages.d.o says
  sid (unstable) (net): extremely powerful and versatile nameserver
  4.8.1-2: amd64 arm64 ia64 mips64el ppc64 ppc64el riscv64 s390x sparc64
  4.8.1-1 [debports]: alpha
  4.7.1-1 [debports]: x32
  4.4.1-4 [debports]: hppa m68k sh4 
so release arches and alpha
(and hppa m68k sh4,
 since f115fbc97b9760bdfbff307e4de72a9cb3df0990 appears in 4.7)
have a working version but x32 doesn't?

https://buildd.debian.org/status/package.php?p=pdns for 4.8.1-2 for x32
says "BD-Uninstallable", with
  Dependency installability problem for pdns on x32:
  pdns build-depends on missing:
  - architecture-is-64-bit:x32
?!?

d/changelog says
  pdns (4.7.3-2) unstable; urgency=medium
  
* Build-Depend on architecture-is-64-bit (for time_t) (Closes: #1011259)
  
   -- Chris Hofstaedtler   Sun, 25 Dec 2022 10:43:16 +
which. idk bro. x32 has a 64-bit time_t. Hell. x32 /only/ has 64-bit time_t!

Quoth /usr/include/x86_64-linux-gnux32/bits/timesize.h:
-- >8 --
/* Bit size of the time_t type at glibc build time, x86-64 and x32 case.
   Copyright (C) 2018-2023 Free Software Foundation, Inc.
   This file is part of the GNU C Library.

   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; if not, see
   .  */

#include 

#if defined __x86_64__ && defined __ILP32__
/* For x32, time is 64-bit even though word size is 32-bit.  */
# define __TIMESIZE 64
#else
/* For others, time size is word size.  */
# define __TIMESIZE __WORDSIZE
#endif
/* Bit size of the time_t type at glibc build time, x86-64 and x32 case.
   Copyright (C) 2018-2023 Free Software Foundation, Inc.
   This file is part of the GNU C Library.

   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; if not, see
   .  */

#include 

#if defined __x86_64__ && defined __ILP32__
/* For x32, time is 64-bit even though word size is 32-bit.  */
# define __TIMESIZE 64
#else
/* For others, time size is word size.  */
# define __TIMESIZE __WORDSIZE
#endif
-- >8 --

I'm hoping this is an "i forgor " moment.

Attaching patch against current Salsa HEAD
(e993d4ff18ff126c43aa9a4d8dd79f301d8db055),
also opened
  https://salsa.debian.org/dns-team/pdns/-/merge_requests/2

Best,


signature.asc
Description: PGP signature


Bug#1050600: pdns-server: pdns_control list-zones (no filters) segfaults pdns?

2023-08-26 Thread наб
From 543748746e1d1db41e43a5d0bd45de3f1992d303 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= 
Date: Sun, 27 Aug 2023 01:57:40 +0200
Subject: [PATCH] Fix architecture-has-64-bit-time_t check by allowing builds
 on x32 (Closes: #1050600)
X-Mutt-PGP: OS

---
 debian/control | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/debian/control b/debian/control
index 9b6c4f934..3c1859cf8 100644
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,8 @@ Standards-Version: 4.5.1
 Maintainer: pdns packagers 
 Uploaders: Chris Hofstaedtler ,
Marc Haber 
-Build-Depends: architecture-is-64-bit,
+# "architecture-has-64-bit-time_t"
+Build-Depends: architecture-is-64-bit [!x32],
bison,
curl,
debhelper-compat (= 13),
-- 
2.39.2



signature.asc
Description: PGP signature


Bug#1050600: pdns-server: pdns_control list-zones (no filters) segfaults pdns?

2023-08-26 Thread наб
Control: tags -1 + patch

On Sat, Aug 26, 2023 at 11:50:52PM +0200, наб wrote:
> GDB says
> │  402if (kind == DomainInfo::All) {  
>│
> │  >   403  ret<│
> │  404}   
>│
> │  405else {  
>│
> │  406  ret<<"All zonecount:"<│
> │  407}   
>│
> 
> 
> But the function starts with
> │  378  string DLListZones(const vector, Utility::pid_t 
> ppid)  │
> │  379  { 
>│
> │  380UeberBackend B; 
>│
> │  381g_log<│
> ...
> │  386if (parts.size() > 1) { 
>│
> │  387  kind = DomainInfo::stringToKind(parts[1]);
>│
> │  388}   
>│
> │  389else {  
>│
> │  390  kind = DomainInfo::All;   
>│
> │  391}   
>│
> 
> So... (kind == DomainInfo::All) <=> (parts.size() == 0)
"(kind == DomainInfo::All) <=> (parts.size() == 1)" of course.

Confirmed and fixed by 403s/1/0/
  # pdns_control list-zones master
  All zonecount:0
  # pdns_control list-zones slave
  All zonecount:0
  # pdns_control list-zones native
  ws.co.ls.
  All zonecount:1
  # pdns_control list-zones
  ws.co.ls.
  LIST-ZONES zonecount:1

Patch attached.

Best,
--- pdns-4.7.1.orig/pdns/dynhandler.cc
+++ pdns-4.7.1/pdns/dynhandler.cc
@@ -400,7 +400,7 @@ string DLListZones(const vector&
   }
 
   if (kind == DomainInfo::All) {
-ret<

signature.asc
Description: PGP signature


Bug#1050600: pdns-server: pdns_control list-zones (no filters) segfaults pdns?

2023-08-26 Thread наб
GDB says
│  402if (kind == DomainInfo::All) {
 │
│  >   403  ret<, Utility::pid_t ppid) 
 │
│  379  {   
 │
│  380UeberBackend B;   
 │
│  381g_log< 1) {   
 │
│  387  kind = DomainInfo::stringToKind(parts[1]);  
 │
│  388} 
 │
│  389else {
 │
│  390  kind = DomainInfo::All; 
 │
│  391} 
 │

So... (kind == DomainInfo::All) <=> (parts.size() == 0)
but it'sreading parts[1]?

Reeks of a lua momento :v

Best,


signature.asc
Description: PGP signature