From e96a47d44ae7e9a70da90cd9749d508495547df1 Mon Sep 17 00:00:00 2001 From: rafan Date: Fri, 27 Jul 2007 15:14:31 +0000 Subject: - Fix From: header PR: ports/114375 Submitted by: G. Paul Ziemba --- news/nn/Makefile | 1 + news/nn/files/patch-an | 49 +++++++++++++++++++++++-------------------------- 2 files changed, 24 insertions(+), 26 deletions(-) (limited to 'news') diff --git a/news/nn/Makefile b/news/nn/Makefile index 9f402f8e0d64..492680b3b763 100644 --- a/news/nn/Makefile +++ b/news/nn/Makefile @@ -7,6 +7,7 @@ PORTNAME= nn PORTVERSION= 6.7.3 +PORTREVISION= 1 CATEGORIES= news MASTER_SITES= http://www.sourcefiles.org/Internet/News/Usenet_Clients/ \ http://www.wa.apana.org.au/~dean/sources/ diff --git a/news/nn/files/patch-an b/news/nn/files/patch-an index 07865ed6364f..bd5138c0d5dd 100644 --- a/news/nn/files/patch-an +++ b/news/nn/files/patch-an @@ -1,5 +1,5 @@ ---- nntp.c.orig Tue Apr 19 18:06:51 2005 -+++ nntp.c Sat Sep 3 14:34:49 2005 +--- nntp.c.orig Tue Apr 19 16:06:51 2005 ++++ nntp.c Sat Jul 7 00:30:15 2007 @@ -76,6 +76,7 @@ static int connect_server(void); static void debug_msg(char *prefix, char *str); @@ -59,31 +59,28 @@ /* * get_server_line: get a line from the server. * -@@ -1492,15 +1537,24 @@ - gen_frompath(void) - { - struct passwd *passwd; -+ char *domain; -+ const char *fromFormat = "From: <%s@%s>\r\n"; +@@ -848,6 +893,16 @@ - passwd = getpwuid(getuid()); + #else /* DOMAIN */ - fprintf(nntp_out, "From: "); - fprintf(nntp_out, "%s ", full_name()); - -- fprintf(nntp_out, "<%s@%s>\r\n", -- passwd->pw_name, -- domain); -+ domain = find_domain(DOMAIN_FILE); -+ if (domain == NULL) { -+ fprintf(nntp_out, fromFormat, -+ passwd->pw_name, -+ host_name); -+ } else { -+ fprintf(nntp_out, fromFormat, -+ passwd->pw_name, -+ domain); ++ /* ++ * if domain is defined in DOMAIN_FILE, use it ++ */ ++ cp = find_domain(DOMAIN_FILE); ++ if (cp) { ++ strncpy(domain, cp, MAXHOSTNAMELEN); ++ domain[MAXHOSTNAMELEN-1] = 0; /* ensure nul-terminated */ ++ return; + } ++ + domain[0] = '\0'; - #ifdef HIDDENNET - /* Only the login name - nntp server will add uucp name */ + cp = index(host_name, '.'); +@@ -882,6 +937,7 @@ + #endif + } + #endif /* DOMAIN */ ++ domain[MAXHOSTNAMELEN-1] = 0; /* ensure nul-terminated */ + } + + /* -- cgit