Accepting request 396203 from home:pwieczorkiewicz:branches:network:utilities

- Add net-tools-1.60-hostname-s.patch:
  This changes the hostname behavior to match other systems and its
  own documentation. Namely, that -s just parses the result of the
  active gethostname() and does not attempt any network/DNS traffic.
  upstream: https://sourceforge.net/p/net-tools/bugs/14/
  commit#452f8e (boo#872264).

OBS-URL: https://build.opensuse.org/request/show/396203
OBS-URL: https://build.opensuse.org/package/show/network:utilities/net-tools?expand=0&rev=48
This commit is contained in:
OBS User mrdocs 2016-05-19 23:50:17 +00:00 committed by Git OBS Bridge
parent ec6edb17c6
commit 95971535d8
3 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,30 @@
Index: net-tools-1.60/hostname.c
===================================================================
--- net-tools-1.60.orig/hostname.c
+++ net-tools-1.60/hostname.c
@@ -300,11 +300,6 @@ static void showhname(char *hname, int c
case 'f':
printf("%s\n", res->ai_canonname);
break;
- case 's':
- if (p != NULL)
- *p = '\0';
- printf("%s\n", res->ai_canonname);
- break;
default:
break;
}
@@ -494,7 +489,12 @@ int main(int argc, char **argv)
fprintf(stderr, _("gethostname()=`%s'\n"), myname);
if (!type)
printf("%s\n", myname);
- else
+ else if (type == 's') {
+ char *p = strchr(myname, '.');
+ if (p)
+ *p = '\0';
+ printf("%s\n", myname);
+ } else
showhname(myname, type);
break;
case 3:

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Tue May 17 11:36:17 UTC 2016 - pwieczorkiewicz@suse.com
- Add net-tools-1.60-hostname-s.patch:
This changes the hostname behavior to match other systems and its
own documentation. Namely, that -s just parses the result of the
active gethostname() and does not attempt any network/DNS traffic.
upstream: https://sourceforge.net/p/net-tools/bugs/14/
commit#452f8e (boo#872264).
-------------------------------------------------------------------
Wed Jun 10 12:57:09 UTC 2015 - gber@opensuse.org

View File

@ -1,7 +1,7 @@
#
# spec file for package net-tools
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -83,6 +83,8 @@ Patch49: net-tools-1.60-cs_CZ.bnc715580.diff
Patch50: net-tools-1.60-plipconfig-usage.patch
Patch51: net-tools-1.60-plipconfig-manpage.patch
Patch52: net-tools-1.60-plipconfig-ecode.patch
# PATCH-FIX-UPSTREAM net-tools-1.60-hostname-s.patch boo#872264 ticket#14 commit#452f8e
Patch53: net-tools-1.60-hostname-s.patch
%description
This package contains essential programs for network administration and
@ -161,6 +163,7 @@ cp %{S:3} lib/
%patch50 -p1
%patch51 -p1
%patch52 -p1
%patch53 -p1
cp %{S:4} .
cp %{S:5} ./man/en_US