diff options
author | rafan <rafan@FreeBSD.org> | 2007-07-27 23:14:31 +0800 |
---|---|---|
committer | rafan <rafan@FreeBSD.org> | 2007-07-27 23:14:31 +0800 |
commit | e96a47d44ae7e9a70da90cd9749d508495547df1 (patch) | |
tree | 659529f1d77ef668cda29153602775e36a5aa244 /news | |
parent | dc2ed81ecaf897b50fc17f1c11d38154226ecf34 (diff) | |
download | freebsd-ports-graphics-e96a47d44ae7e9a70da90cd9749d508495547df1.tar.gz freebsd-ports-graphics-e96a47d44ae7e9a70da90cd9749d508495547df1.tar.zst freebsd-ports-graphics-e96a47d44ae7e9a70da90cd9749d508495547df1.zip |
- Fix From: header
PR: ports/114375
Submitted by: G. Paul Ziemba <p-fbsd-bugs at treehouse.napa.ca.us>
Diffstat (limited to 'news')
-rw-r--r-- | news/nn/Makefile | 1 | ||||
-rw-r--r-- | news/nn/files/patch-an | 49 |
2 files changed, 24 insertions, 26 deletions
diff --git a/news/nn/Makefile b/news/nn/Makefile index 9f402f8e0d6..492680b3b76 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 07865ed6364..bd5138c0d5d 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 */ + } + + /* |