rpms/net-tools/F-11 net-tools-1.60-hostname-short.patch, NONE, 1.1 net-tools-1.60-hostname_man.patch, 1.2, 1.3 net-tools.spec, 1.99, 1.100

Jiří Popelka jpopelka at fedoraproject.org
Thu Oct 29 11:29:42 UTC 2009


Author: jpopelka

Update of /cvs/pkgs/rpms/net-tools/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv22407

Modified Files:
	net-tools-1.60-hostname_man.patch net-tools.spec 
Added Files:
	net-tools-1.60-hostname-short.patch 
Log Message:
* Thu Oct 29 2009  Jiri Popelka <jpopelka at redhat.com> - 1.60-94
- Make "hostname -s" display host name cut at the first dot (no
  matter if the host name resolves or not) (bug #531702)


net-tools-1.60-hostname-short.patch:
 hostname.c |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

--- NEW FILE net-tools-1.60-hostname-short.patch ---
diff -up net-tools-1.60/hostname.c.hostname-short net-tools-1.60/hostname.c
--- net-tools-1.60/hostname.c.hostname-short	2009-09-30 17:44:21.000000000 +0200
+++ net-tools-1.60/hostname.c	2009-09-08 11:55:03.000000000 +0200
@@ -176,11 +176,6 @@ static void showhname(char *hname, int c
     case 'f':
 	printf("%s\n", hp->h_name);
 	break;
-    case 's':
-	if (p != NULL)
-	    *p = '\0';
-	printf("%s\n", hp->h_name);
-	break;
     default:
     ;
     }
@@ -270,6 +265,7 @@ int main(int argc, char **argv)
     char myname[MAXHOSTNAMELEN + 1] =
     {0};
     char *file = NULL;
+    char *p;
 
     static const struct option long_options[] =
     {
@@ -370,7 +366,13 @@ int main(int argc, char **argv)
 	if (!type)
 	    printf("%s\n", myname);
 	else
-	    showhname(myname, type);
+		if (type == 's') {
+			if (p = strchr(myname, '.'))
+				*p = '\0';
+			printf("%s\n", myname);
+		}
+		else
+			showhname(myname, type);
 	break;
     case 3:
 	if (file) {

net-tools-1.60-hostname_man.patch:
 hostname.1 |   27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

Index: net-tools-1.60-hostname_man.patch
===================================================================
RCS file: /cvs/pkgs/rpms/net-tools/F-11/net-tools-1.60-hostname_man.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- net-tools-1.60-hostname_man.patch	2 Jan 2006 10:00:42 -0000	1.2
+++ net-tools-1.60-hostname_man.patch	29 Oct 2009 11:29:42 -0000	1.3
@@ -1,14 +1,14 @@
 --- net-tools-1.60/man/en_US/hostname.1.gethostbyname	2005-10-14 11:33:41.000000000 +0200
 +++ net-tools-1.60/man/en_US/hostname.1	2005-10-15 11:46:14.646697600 +0200
-@@ -99,6 +99,32 @@
+@@ -99,6 +99,33 @@
  complete FQDN of the system is returned with
  .BR "hostname \-\-fqdn" .
  
 +.LP
 +The function 
 +.BR gethostname(2)
-+is used to get the hostname.  Only when the 
-+.BR "hostname \-s" 
++is used to get the hostname.  When the 
++.BR "hostname \-a, \-d, \-f or \-i" 
 +is called will 
 +.BR gethostbyname(3)
 +be called.  The difference in 
@@ -25,7 +25,8 @@
 +.IR /etc/sysconfig/network
 +or
 +.IR /etc/hosts
-+. To add another dimension to this,
++
++To add another dimension to this,
 +the 
 +.B hostname 
 +is also set when the network interface is brought up.


Index: net-tools.spec
===================================================================
RCS file: /cvs/pkgs/rpms/net-tools/F-11/net-tools.spec,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -p -r1.99 -r1.100
--- net-tools.spec	16 Jul 2009 08:31:44 -0000	1.99
+++ net-tools.spec	29 Oct 2009 11:29:42 -0000	1.100
@@ -3,7 +3,7 @@
 Summary: Basic networking tools
 Name: net-tools
 Version: 1.60
-Release: 93%{?dist}
+Release: 94%{?dist}
 License: GPL+
 Group: System Environment/Base
 URL: http://net-tools.berlios.de/
@@ -83,6 +83,7 @@ Patch69: net-tools-1.60-clear-flag.patch
 Patch70: net-tools-1.60-metric-tunnel-man.patch
 Patch71: net-tools-1.60-netstat-probe.patch
 Patch72: net-tools-1.60-scanf-format.patch
+Patch73: net-tools-1.60-hostname-short.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Requires(post): /sbin/chkconfig
@@ -166,6 +167,7 @@ ifconfig, netstat, route, and others.
 %patch70 -p1 -b .metric-tunnel-man
 %patch71 -p1 -b .probe
 %patch72 -p1 -b .scanf-format
+%patch73 -p1 -b .hostname-short
 
 cp %SOURCE2 ./config.h
 cp %SOURCE3 ./config.make
@@ -281,6 +283,10 @@ exit 0
 %{_sysconfdir}/rc.d/init.d/netplugd
 
 %changelog
+* Thu Oct 29 2009  Jiri Popelka <jpopelka at redhat.com> - 1.60-94
+- Make "hostname -s" display host name cut at the first dot (no
+  matter if the host name resolves or not) (bug #531702)
+
 * Wed Jul  8 2009  Jiri Popelka <jpopelka at redhat.com> - 1.60-93
 - scanf format length fix (non exploitable?) from Fabian Hugelshofer <hugelshofer2006 at gmx.ch>
 - URL tag changed to http://net-tools.berlios.de/




More information about the fedora-extras-commits mailing list