- Upgrade to 3.03
This commit is contained in:
parent
4e3f7fa0a2
commit
aa2fb695d9
@ -1 +1 @@
|
|||||||
hostname_3.01.tar.gz
|
hostname_3.03.tar.gz
|
||||||
|
104
hostname-initial.patch → hostname-rh.patch
Normal file → Executable file
104
hostname-initial.patch → hostname-rh.patch
Normal file → Executable file
@ -1,9 +1,9 @@
|
|||||||
diff -up hostname/hostname.1.initial hostname/hostname.1
|
diff -up hostname/hostname.1.rh hostname/hostname.1
|
||||||
--- hostname/hostname.1.initial 2009-09-22 14:21:50.000000000 +0200
|
--- hostname/hostname.1.rh 2010-01-15 13:05:22.000000000 +0100
|
||||||
+++ hostname/hostname.1 2009-11-06 16:30:20.000000000 +0100
|
+++ hostname/hostname.1 2010-02-01 21:52:35.000000000 +0100
|
||||||
@@ -91,6 +91,33 @@ will print the domain part of the FQDN (
|
@@ -98,6 +98,33 @@ complete FQDN of the system is returned
|
||||||
complete FQDN of the system is returned with
|
.B "THE FQDN"
|
||||||
.BR "hostname \-\-fqdn" .
|
below).
|
||||||
|
|
||||||
+.LP
|
+.LP
|
||||||
+The function
|
+The function
|
||||||
@ -35,16 +35,16 @@ diff -up hostname/hostname.1.initial hostname/hostname.1
|
|||||||
.SS "SET NAME"
|
.SS "SET NAME"
|
||||||
When called with one argument or with the
|
When called with one argument or with the
|
||||||
.B \-\-file
|
.B \-\-file
|
||||||
@@ -106,7 +133,7 @@ and
|
@@ -113,7 +140,7 @@ and
|
||||||
use the
|
use
|
||||||
.BR setdomainname (2).
|
.BR setdomainname (2).
|
||||||
Note that this is effective only until the next reboot.
|
Note, that this is effective only until the next reboot.
|
||||||
-Edit /etc/hostname for permanent change.
|
-Edit /etc/hostname for permanent change.
|
||||||
+After reboot original names from \fI/etc/hosts\fR are used again.
|
+After reboot original names from \fI/etc/hosts\fR are used again.
|
||||||
.LP
|
.LP
|
||||||
Note, that only the super-user can change the names.
|
Note, that only the super-user can change the names.
|
||||||
.LP
|
.LP
|
||||||
@@ -117,10 +144,10 @@ command (see
|
@@ -124,10 +151,10 @@ command (see
|
||||||
below).
|
below).
|
||||||
.LP
|
.LP
|
||||||
The host name is usually set once at system startup in
|
The host name is usually set once at system startup in
|
||||||
@ -57,7 +57,7 @@ diff -up hostname/hostname.1.initial hostname/hostname.1
|
|||||||
|
|
||||||
.SS THE FQDN
|
.SS THE FQDN
|
||||||
You can't change the FQDN (as returned by
|
You can't change the FQDN (as returned by
|
||||||
@@ -185,7 +212,7 @@ Display the short host name. This is the
|
@@ -227,7 +254,7 @@ Display the short host name. This is the
|
||||||
Print version information on standard output and exit successfully.
|
Print version information on standard output and exit successfully.
|
||||||
.TP
|
.TP
|
||||||
.I "\-v, \-\-verbose"
|
.I "\-v, \-\-verbose"
|
||||||
@ -66,91 +66,19 @@ diff -up hostname/hostname.1.initial hostname/hostname.1
|
|||||||
.TP
|
.TP
|
||||||
.I "\-y, \-\-yp, \-\-nis"
|
.I "\-y, \-\-yp, \-\-nis"
|
||||||
Display the NIS domain name. If a parameter is given (or
|
Display the NIS domain name. If a parameter is given (or
|
||||||
@@ -203,9 +230,7 @@ option in
|
@@ -246,8 +273,7 @@ option in
|
||||||
.BR /etc/resolv.conf .
|
|
||||||
.SH FILES
|
.SH FILES
|
||||||
.B /etc/hosts
|
.B /etc/hosts
|
||||||
-
|
|
||||||
-.B /etc/hostname
|
-.B /etc/hostname
|
||||||
-This file should only contain the hostname and not the full FQDN.
|
-This file should only contain the hostname and not the full FQDN.
|
||||||
+.B /etc/sysconfig/network
|
+.B /etc/sysconfig/network
|
||||||
.SH AUTHORS
|
.SH AUTHORS
|
||||||
Peter Tobias, <tobias@et-inf.fho-emden.de>
|
Peter Tobias, <tobias@et-inf.fho-emden.de>
|
||||||
.br
|
.br
|
||||||
diff -up hostname/hostname.c.initial hostname/hostname.c
|
diff -up hostname/Makefile.rh hostname/Makefile
|
||||||
--- hostname/hostname.c.initial 2009-10-27 13:19:28.000000000 +0100
|
--- hostname/Makefile.rh 2010-01-15 13:05:16.000000000 +0100
|
||||||
+++ hostname/hostname.c 2009-11-06 16:14:23.000000000 +0100
|
+++ hostname/Makefile 2010-02-01 21:47:25.000000000 +0100
|
||||||
@@ -43,7 +43,7 @@
|
|
||||||
#include <err.h>
|
|
||||||
#include <rpcsvc/ypclnt.h>
|
|
||||||
|
|
||||||
-#define VERSION "3.00"
|
|
||||||
+#define VERSION "3.01"
|
|
||||||
|
|
||||||
enum type_t { DEFAULT, DNS, FQDN, SHORT, ALIAS, IP, NIS, NIS_DEF };
|
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ localdomain()
|
|
||||||
* If something goes wrong, program exits.
|
|
||||||
*/
|
|
||||||
char *
|
|
||||||
-localhost()
|
|
||||||
+localhost(enum type_t type)
|
|
||||||
{
|
|
||||||
char *buf = 0;
|
|
||||||
size_t buf_len = 0;
|
|
||||||
@@ -134,10 +134,11 @@ localhost()
|
|
||||||
|| errno == ENAMETOOLONG);
|
|
||||||
|
|
||||||
/*
|
|
||||||
- * a hostname must not contain a dot, so if we find one,
|
|
||||||
+ * short hostname must not contain a dot, so if we find one,
|
|
||||||
* we also have a domain in here, which we better remove
|
|
||||||
*/
|
|
||||||
- *(strchrnul(buf, '.')) = '\0';
|
|
||||||
+ if (type == SHORT)
|
|
||||||
+ *(strchrnul(buf, '.')) = '\0';
|
|
||||||
|
|
||||||
/* gethostname failed, abort. */
|
|
||||||
if (myerror)
|
|
||||||
@@ -257,7 +258,7 @@ show_name(enum type_t type)
|
|
||||||
{
|
|
||||||
case DEFAULT:
|
|
||||||
case SHORT:
|
|
||||||
- printf("%s\n", localhost());
|
|
||||||
+ printf("%s\n", localhost(type));
|
|
||||||
break;
|
|
||||||
case NIS:
|
|
||||||
printf("%s\n", localdomain());
|
|
||||||
@@ -270,7 +271,7 @@ show_name(enum type_t type)
|
|
||||||
hints.ai_socktype = SOCK_DGRAM;
|
|
||||||
hints.ai_flags = AI_CANONNAME;
|
|
||||||
|
|
||||||
- if ((ret = getaddrinfo(localhost(), NULL, &hints, &res)) != 0)
|
|
||||||
+ if ((ret = getaddrinfo(localhost(type), NULL, &hints, &res)) != 0)
|
|
||||||
errx(1, "%s", gai_strerror(ret));
|
|
||||||
|
|
||||||
switch (type) {
|
|
||||||
@@ -278,7 +279,7 @@ show_name(enum type_t type)
|
|
||||||
struct hostent *hp;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
- if ((hp = gethostbyname(localhost())) == NULL)
|
|
||||||
+ if ((hp = gethostbyname(localhost(type))) == NULL)
|
|
||||||
errx(1, "%s", hstrerror(h_errno));
|
|
||||||
|
|
||||||
for (i = 0; hp->h_aliases[i]; i++) {
|
|
||||||
@@ -449,7 +450,7 @@ main(int argc, char **argv)
|
|
||||||
if (boot && (name == NULL || name[0] == '\0')) {
|
|
||||||
free(name);
|
|
||||||
|
|
||||||
- name = localhost();
|
|
||||||
+ name = localhost(type);
|
|
||||||
if (name[0] == '\0' || !strcmp(name,"(none)"))
|
|
||||||
strcpy(name, "localhost");
|
|
||||||
}
|
|
||||||
diff -up hostname/Makefile.initial hostname/Makefile
|
|
||||||
--- hostname/Makefile.initial 2009-09-22 14:21:50.000000000 +0200
|
|
||||||
+++ hostname/Makefile 2009-11-06 16:14:23.000000000 +0100
|
|
||||||
@@ -7,26 +7,28 @@ OBJS=hostname.o
|
@@ -7,26 +7,28 @@ OBJS=hostname.o
|
||||||
|
|
||||||
hostname: $(OBJS)
|
hostname: $(OBJS)
|
@ -1,6 +1,6 @@
|
|||||||
Summary: Utility to set/show the host name or domain name
|
Summary: Utility to set/show the host name or domain name
|
||||||
Name: hostname
|
Name: hostname
|
||||||
Version: 3.01
|
Version: 3.03
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
Group: System Environment/Base
|
Group: System Environment/Base
|
||||||
@ -10,7 +10,7 @@ Source1: hostname.1.pt
|
|||||||
Source2: hostname.1.de
|
Source2: hostname.1.de
|
||||||
|
|
||||||
# Initial changes
|
# Initial changes
|
||||||
Patch1: hostname-initial.patch
|
Patch1: hostname-rh.patch
|
||||||
|
|
||||||
#net-tools < 1.60-100 includes hostname
|
#net-tools < 1.60-100 includes hostname
|
||||||
Conflicts: net-tools < 1.60-100
|
Conflicts: net-tools < 1.60-100
|
||||||
@ -21,7 +21,7 @@ DNS name, and to display or set its hostname or NIS domain name.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n hostname
|
%setup -q -n hostname
|
||||||
%patch1 -p1 -b .initial
|
%patch1 -p1 -b .rh
|
||||||
|
|
||||||
#man pages conversion
|
#man pages conversion
|
||||||
#french
|
#french
|
||||||
@ -62,6 +62,8 @@ rm -rf %{buildroot}
|
|||||||
%{_mandir}/de/man1/*
|
%{_mandir}/de/man1/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Feb 02 2010 Jiri Popelka <jpopelka@redhat.com> - 3.03-1
|
||||||
|
- Upgrade to 3.03
|
||||||
|
|
||||||
* Tue Nov 10 2009 Jiri Popelka <jpopelka@redhat.com> - 3.01-1
|
* Tue Nov 10 2009 Jiri Popelka <jpopelka@redhat.com> - 3.01-1
|
||||||
- Initial package. Up to now hostname has been part of net-tools package.
|
- Initial package. Up to now hostname has been part of net-tools package.
|
||||||
|
Loading…
Reference in New Issue
Block a user