diff options
Diffstat (limited to 'news/nn/files/patch-an')
-rw-r--r-- | news/nn/files/patch-an | 74 |
1 files changed, 29 insertions, 45 deletions
diff --git a/news/nn/files/patch-an b/news/nn/files/patch-an index ebb161199ffa..e2de96cb87b7 100644 --- a/news/nn/files/patch-an +++ b/news/nn/files/patch-an @@ -1,6 +1,6 @@ ---- nntp.c.orig Tue Oct 9 11:39:11 2001 -+++ nntp.c Mon Jun 10 10:15:02 2002 -@@ -37,6 +37,7 @@ +--- nntp.c.orig Sat Jan 25 00:10:39 2003 ++++ nntp.c Wed Apr 28 17:47:59 2004 +@@ -39,6 +39,7 @@ #include <errno.h> #include <pwd.h> #include <ctype.h> @@ -8,18 +8,20 @@ #ifdef NOV #include "hash.h" -@@ -88,6 +89,7 @@ +@@ -63,6 +64,7 @@ + static int connect_server(void); static void debug_msg __APROTO((char *prefix, char *str)); - static void io_error __APROTO((void)); static void find_server __APROTO((void)); -+char * find_domain(char *domainFile); ++char *find_domain __APROTO((char *domainFile)); static int get_server_line __APROTO((char *string, int size)); static int get_server __APROTO((char *string, int size)); static int get_socket __APROTO((void)); -@@ -319,6 +321,49 @@ +@@ -212,6 +214,50 @@ + sys_error("Failed to find name of NNTP server!"); } - /* ++ ++/* + * find_domain Get the domain name for posting from a named file. + * Handle blank lines and comments. + * @@ -33,8 +35,7 @@ + */ + +char * -+find_domain(domainFile) -+char *domainFile; ++find_domain(char *domainFile) +{ + register FILE *fp; + register char *cp; @@ -62,52 +63,35 @@ + return (NULL); +} + -+/* ++ + /* * get_server_line: get a line from the server. * - * Expects to be connected to the server. -@@ -634,7 +679,7 @@ - can_post = 0; - break; - default: -- nn_exitmsg(1, line); -+ nn_exitmsg(1, "%s", line); - /* NOTREACHED */ - } - } -@@ -1726,7 +1771,7 @@ - * Phil Lapsley <phil@ucbvax.berkeley.edu> - */ - --static char host_name[256]; -+static char host_name[MAXHOSTNAMELEN]; - - /* - * gen_frompath -- generate From: and Path: lines, in the form -@@ -1745,6 +1790,7 @@ - #ifndef HIDDENNET - char *cp; - #endif +@@ -1415,15 +1461,24 @@ + gen_frompath() + { + struct passwd *passwd; + char *domain; ++ char *fromFormat = "From: <%s@%s>\r\n"; - fprintf(nntp_out, "From: "); passwd = getpwuid(getuid()); -@@ -1772,9 +1818,15 @@ - DOMAIN); - #endif /* HIDDENNET */ - #else + + fprintf(nntp_out, "From: "); + fprintf(nntp_out, "%s ", full_name()); + - fprintf(nntp_out, "<%s@%s>\r\n", - passwd->pw_name, -- host_name); +- domain); + domain = find_domain(DOMAIN_FILE); -+ if (domain == NULL) -+ fprintf(nntp_out, "From: <%s@%s>\r\n", ++ if (domain == NULL) { ++ fprintf(nntp_out, fromFormat, + passwd->pw_name, + host_name); -+ else -+ fprintf(nntp_out, "From: <%s@%s>\r\n", ++ } else { ++ fprintf(nntp_out, fromFormat, + passwd->pw_name, + domain); - #endif ++ } #ifdef HIDDENNET + /* Only the login name - nntp server will add uucp name */ |