summaryrefslogtreecommitdiff
path: root/news
diff options
context:
space:
mode:
authorRong-En Fan <rafan@FreeBSD.org>2007-07-27 15:14:31 +0000
committerRong-En Fan <rafan@FreeBSD.org>2007-07-27 15:14:31 +0000
commit801b1826fba7f6bdd4369f3a7afea85e1705353d (patch)
treec58c62c8dfb5e279bea55c06b9133120259bb80f /news
parent. Fix the description of the link for the policy files. (diff)
- Fix From: header
PR: ports/114375 Submitted by: G. Paul Ziemba <p-fbsd-bugs at treehouse.napa.ca.us>
Notes
Notes: svn path=/head/; revision=196417
Diffstat (limited to 'news')
-rw-r--r--news/nn/Makefile1
-rw-r--r--news/nn/files/patch-an49
2 files changed, 24 insertions, 26 deletions
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 */
+ }
+
+ /*