aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2001-01-30 21:21:59 +0000
committerBill Nottingham <notting@redhat.com>2001-01-30 21:21:59 +0000
commit513953f9cca632e75f9e8f5b99b77a4e0758b411 (patch)
treebe8884bf0e8a5714eda5f6382ff6a30c8d279275
parent936a7cef8f3e40a02cad78c0992b4afd00b539a2 (diff)
downloadinitscripts-513953f9cca632e75f9e8f5b99b77a4e0758b411.tar
initscripts-513953f9cca632e75f9e8f5b99b77a4e0758b411.tar.gz
initscripts-513953f9cca632e75f9e8f5b99b77a4e0758b411.tar.bz2
initscripts-513953f9cca632e75f9e8f5b99b77a4e0758b411.tar.xz
initscripts-513953f9cca632e75f9e8f5b99b77a4e0758b411.zip
change hostnames to all lowercase (#9579)
-rw-r--r--src/ipcalc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ipcalc.c b/src/ipcalc.c
index b85f103e..922d2cc5 100644
--- a/src/ipcalc.c
+++ b/src/ipcalc.c
@@ -1,3 +1,4 @@
+#include <ctype.h>
#include <popt.h>
#include <stdio.h>
#include <sys/socket.h>
@@ -98,6 +99,7 @@ int main(int argc, char ** argv) {
}
if (showHostname) {
+ int x;
hostinfo = gethostbyaddr((char *) &ip, sizeof(ip), AF_INET);
if (!hostinfo) {
if (!beSilent) {
@@ -107,6 +109,9 @@ int main(int argc, char ** argv) {
return 1;
}
+ for (x=0; hostinfo->h_name[x]; x++) {
+ hostinfo->h_name[x] = tolower(hostinfo->h_name[x]);
+ }
printf("HOSTNAME=%s\n", hostinfo->h_name);
}