projects
/
pdns-recursor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9c9500f
)
hostname-4.1.15
author
pdns-recursor packagers
<pdns-recursor@packages.debian.org>
Mon, 18 Mar 2024 22:34:27 +0000
(23:34 +0100)
committer
Daniel Leidert
<dleidert@debian.org>
Mon, 18 Mar 2024 22:34:27 +0000
(23:34 +0100)
===================================================================
Gbp-Pq: Name hostname-4.1.15.diff
rec-carbon.cc
patch
|
blob
|
history
diff --git
a/rec-carbon.cc
b/rec-carbon.cc
index f8098edc746da840031333dee48ba6b492063068..3ffde289659caf0fcf3d307702c6f0263561da86 100644
(file)
--- a/
rec-carbon.cc
+++ b/
rec-carbon.cc
@@
-26,9
+26,11
@@
try
return;
if(hostname.empty()) {
- char tmp[
80
];
+ char tmp[
HOST_NAME_MAX+1
];
memset(tmp, 0, sizeof(tmp));
- gethostname(tmp, sizeof(tmp));
+ if (gethostname(tmp, sizeof(tmp)) != 0) {
+ throw std::runtime_error("The 'carbon-ourname' setting has not been set and we are unable to determine the system's hostname: " + stringerror());
+ }
char *p = strchr(tmp, '.');
if(p) *p=0;