🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #21097

Slrn 0.8.8 domain name recognition patch

#21097
From: Felix von Leitner
Date: Tue, 30 Apr 1996 00:00
129 lines
4237 bytes
-----BEGIN PGP SIGNED MESSAGE-----

Hi folks,

when installing slrn under Solaris with NIS, I always have the problem
that slrn bails out with:

  Unable to find a fully qualified hostname.  You will have to specify a
  hostname in your .slrnrc file (slrn.rc on VMS).

Clearly, this is not the Right Thing.  This patch should correct this
problem.  It makes configure look into /etc/resolv.conf to get the DNS
domain name and hard codes it into slrn.  I've submitted this patch to
John Davis, but you might be interested in it, too.

Felix [slrn rules!]


diff -u --recursive --new-file slrn/configure slrn.new/configure
- --- slrn/configure	Mon Apr 29 05:59:25 1996
+++ slrn.new/configure	Tue Apr 30 19:22:28 1996
@@ -1265,7 +1265,7 @@
   echo "$ac_t""no" 1>&6
 fi
 
- -    if test "$ac_cv_lib_dnet" = no; then
+    if test $ac_cv_lib_dnet = no; then
       echo $ac_n "checking for -ldnet_stub""... $ac_c" 1>&6
 ac_lib_var=`echo dnet_stub_dnet_ntoa | tr '.-/+' '___p'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
@@ -1713,6 +1713,29 @@
 fi
 done
 
+
+echo $ac_n "checking for domain in /etc/resolv.conf""... $ac_c" 1>&6
+if eval "test \"`echo '$''{'slrn_cv_domain'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -f /etc/resolv.conf; then
+	slrn_cv_domain=`grep domain /etc/resolv.conf | sed 's/^domain *//'`
+else
+	slrn_cv_domain=no
+fi
+fi
+
+echo "$ac_t""$slrn_cv_domain" 1>&6
+if test $slrn_cv_domain != no; then
+	cat >> confdefs.h <<\EOF
+#define USE_DOMAIN 1
+EOF
+
+	cat >> confdefs.h <<EOF
+#define DOMAIN "${mutt_cv_domain}"
+EOF
+
+fi
 
 
 #---------------------------------------------------------------------------
diff -u --recursive --new-file slrn/configure.in slrn.new/configure.in
- --- slrn/configure.in	Mon Apr 29 05:59:25 1996
+++ slrn.new/configure.in	Tue Apr 30 19:22:14 1996
@@ -39,6 +39,17 @@
 getdomainname
 )
 
+AC_CACHE_CHECK(for domain in /etc/resolv.conf, slrn_cv_domain,
+[if test -f /etc/resolv.conf; then
+	slrn_cv_domain=`grep domain /etc/resolv.conf | sed 's/^domain *//'`
+else
+	slrn_cv_domain=no
+fi])
+if test $slrn_cv_domain != no; then
+	AC_DEFINE(USE_DOMAIN)
+	AC_DEFINE_UNQUOTED(DOMAIN, "${mutt_cv_domain}")
+fi
+
 JD_SET_OBJ_SRC_DIR
 JD_TERMCAP
 JD_FIND_SLANG
diff -u --recursive --new-file slrn/src/config.hin slrn.new/src/config.hin
- --- slrn/src/config.hin	Mon Apr 29 05:59:27 1996
+++ slrn.new/src/config.hin	Tue Apr 30 19:24:21 1996
@@ -62,7 +62,13 @@
 /* define if you have <arpa/inet.h> */
 #undef HAVE_ARPA_INET_H
 
+/* define if you want to hard-code the domain */
+#undef USE_DOMAIN
 
+/* set your domain here */
+#undef DOMAIN
+
+/* define if you have getdomainname() */
 #undef HAVE_GETDOMAINNAME
 
 #undef mode_t
diff -u --recursive --new-file slrn/src/slrn.c slrn.new/src/slrn.c
- --- slrn/src/slrn.c	Mon Apr 29 05:59:26 1996
+++ slrn.new/src/slrn.c	Tue Apr 30 19:26:03 1996
@@ -630,6 +630,12 @@
     * has a username and a usable hostname.  Without those, we are not
     * starting up.
     */
+#ifdef USE_DOMAIN
+   if (0 == slrn_is_fqdn (Slrn_User_Info.host))
+     {
+       strcat(Slrn_User_Info.host,DOMAIN);
+     }
+#endif
    if (0 == slrn_is_fqdn (Slrn_User_Info.host))
      {
 	slrn_exit_error ("\

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: latin1

iQCVAwUBMYZhjh/Da1Yoy+f1AQE8TAP/QAjC5j7DOkIeOCrcvaZUZejGiT5yg4El
nLZtF6Zx3HZ8VwF0QtwC9eWAqnObzT56SQw9PReGyKmYP2AiuDRjGoCIchdc2hVC
E6OX+9MoQxGSHTWjTn6s08Zer8OwtPntAoLv17v7LUPZCVcGpzM2PuCIOOR75P2v
suT1DFCsJfc=
=RFnZ
-----END PGP SIGNATURE-----


Technical Details
Message-ID: <slrn4ococl.91u.leitner@xorn.prz.tu-berlin.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <slrn4ococl.91u.leitner@xorn.prz.tu-berlin.de>
Subject: Slrn 0.8.8 domain name recognition patch
Date: Tue, 30 Apr 1996 00:00:00 +0000
From: leitner@xorn.prz.tu-berlin.de (Felix von Leitner)
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
X-Deja-AN: 152295440
Organization: PRZ/TU-Berlin
Reply-to: leitner@prz.tu-berlin.de
Newsgroups: news.software.readers