|
|
8597553 |
commit 6da48ca0b2cf328d9ef43c510e74a858c77a1e96
|
|
|
8597553 |
Author: Florian Weimer <fweimer@redhat.com>
|
|
|
8597553 |
Date: Fri Jun 30 11:32:04 2017 +0200
|
|
|
8597553 |
|
|
|
8597553 |
resolv: Reformat resolv/res_data.c to GNU style
|
|
|
8597553 |
|
|
|
8597553 |
diff --git a/resolv/res_data.c b/resolv/res_data.c
|
|
|
8597553 |
index 5e7688c706bf8e99..2cafd3805548d8e4 100644
|
|
|
8597553 |
--- a/resolv/res_data.c
|
|
|
8597553 |
+++ b/resolv/res_data.c
|
|
|
8597553 |
@@ -1,3 +1,21 @@
|
|
|
8597553 |
+/* Miscellaneous definitions for libresolv.
|
|
|
8597553 |
+ Copyright (C) 1995-2017 Free Software Foundation, Inc.
|
|
|
8597553 |
+ This file is part of the GNU C Library.
|
|
|
8597553 |
+
|
|
|
8597553 |
+ The GNU C Library is free software; you can redistribute it and/or
|
|
|
8597553 |
+ modify it under the terms of the GNU Lesser General Public
|
|
|
8597553 |
+ License as published by the Free Software Foundation; either
|
|
|
8597553 |
+ version 2.1 of the License, or (at your option) any later version.
|
|
|
8597553 |
+
|
|
|
8597553 |
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
|
8597553 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
8597553 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
8597553 |
+ Lesser General Public License for more details.
|
|
|
8597553 |
+
|
|
|
8597553 |
+ You should have received a copy of the GNU Lesser General Public
|
|
|
8597553 |
+ License along with the GNU C Library; if not, see
|
|
|
8597553 |
+ <http://www.gnu.org/licenses/>. */
|
|
|
8597553 |
+
|
|
|
8597553 |
/*
|
|
|
8597553 |
* Copyright (c) 1995-1999 by Internet Software Consortium.
|
|
|
8597553 |
*
|
|
|
8597553 |
@@ -17,18 +35,20 @@
|
|
|
8597553 |
|
|
|
8597553 |
#include <resolv.h>
|
|
|
8597553 |
|
|
|
8597553 |
+/* This function belongs to libresolv, which is why it is not included
|
|
|
8597553 |
+ in res-close.c. */
|
|
|
8597553 |
void
|
|
|
8597553 |
-res_close(void) {
|
|
|
8597553 |
- /*
|
|
|
8597553 |
- * Some stupid programs out there call res_close() before res_init().
|
|
|
8597553 |
- * Since _res._vcsock isn't explicitly initialized, these means that
|
|
|
8597553 |
- * we could do a close(0), which might lead to some security problems.
|
|
|
8597553 |
- * Therefore we check if res_init() was called before by looking at
|
|
|
8597553 |
- * the RES_INIT bit in _res.options. If it hasn't been set we bail out
|
|
|
8597553 |
- * early. */
|
|
|
8597553 |
- if ((_res.options & RES_INIT) == 0)
|
|
|
8597553 |
- return;
|
|
|
8597553 |
- /* We don't free the name server addresses because we never
|
|
|
8597553 |
- did it and it would be done implicitly on shutdown. */
|
|
|
8597553 |
- __res_iclose(&_res, false);
|
|
|
8597553 |
+__res_close (void)
|
|
|
8597553 |
+{
|
|
|
8597553 |
+ /* Some programs call res_close before res_init. Since _res._vcsock
|
|
|
8597553 |
+ isn't explicitly initialized, these means that we could call
|
|
|
8597553 |
+ close (0), which might lead to some security problems. Therefore
|
|
|
8597553 |
+ we check if res_init was called before by looking at the RES_INIT
|
|
|
8597553 |
+ bit in _res.options. If it hasn't been set we bail out
|
|
|
8597553 |
+ early. */
|
|
|
8597553 |
+ if ((_res.options & RES_INIT) == 0)
|
|
|
8597553 |
+ return;
|
|
|
8597553 |
+ /* We don't free the name server addresses because we never did it
|
|
|
8597553 |
+ and it would be done implicitly on shutdown. */
|
|
|
8597553 |
+ __res_iclose (&_res, false);
|
|
|
8597553 |
}
|