"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/inews.c" between
tin-2.4.4.tar.xz and tin-2.4.5.tar.xz

About: TIN is a threaded NNTP and spool based UseNet newsreader.

inews.c  (tin-2.4.4.tar.xz):inews.c  (tin-2.4.5.tar.xz)
/* /*
* Project : tin - a Usenet reader * Project : tin - a Usenet reader
* Module : inews.c * Module : inews.c
* Author : I. Lea * Author : I. Lea
* Created : 1992-03-17 * Created : 1992-03-17
* Updated : 2019-02-18 * Updated : 2020-06-27
* Notes : NNTP built in version of inews * Notes : NNTP built in version of inews
* *
* Copyright (c) 1991-2020 Iain Lea <iain@bricbrac.de> * Copyright (c) 1991-2021 Iain Lea <iain@bricbrac.de>
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright * 2. Redistributions in binary form must reproduce the above copyright
skipping to change at line 153 skipping to change at line 153
/* /*
* we should only skip the gnksa_check_from() test if we are going to * we should only skip the gnksa_check_from() test if we are going to
* post a forged cancel, but inews.c doesn't know anything about the * post a forged cancel, but inews.c doesn't know anything about the
* message type, so we skip the test if FORGERY is set. * message type, so we skip the test if FORGERY is set.
* *
* TODO: check at least the local- and domainpart if post_8bit_header * TODO: check at least the local- and domainpart if post_8bit_header
* is set * is set
* *
* check for valid From: line * check for valid From: line
*/ */
if (!(group ? group->attribute->post_8bit_header : tinrc.post_8bit_header respcode = gnksa_check_from(from_name + 6);
) && GNKSA_OK != gnksa_check_from(from_name + 6)) { /* error in address */ if (!(group ? group->attribute->post_8bit_header : tinrc.post_8bit_header
error_message(2, _(txt_invalid_from), from_name + 6); ) && respcode > GNKSA_OK && respcode < GNKSA_MISSING_REALNAME) { /* error in add
ress */
error_message(2, "inews158%s", _(txt_invalid_from), from_name + 6
);
fclose(fp); fclose(fp);
return ret_code; return ret_code;
} }
# endif /* !FORGERY */ # endif /* !FORGERY */
do { do {
rewind(fp); rewind(fp);
# ifndef FORGERY # ifndef FORGERY
if (!disable_sender && (ptr = build_sender())) { if (!disable_sender && (ptr = build_sender())) {
skipping to change at line 455 skipping to change at line 456
const char *charset) const char *charset)
{ {
char *from_at_pos; char *from_at_pos;
char *sender_at_pos; char *sender_at_pos;
char *sender_dot_pos; char *sender_dot_pos;
char *p; char *p;
char from_addr[HEADER_LEN]; char from_addr[HEADER_LEN];
char sender_addr[HEADER_LEN]; char sender_addr[HEADER_LEN];
char sender_line[HEADER_LEN]; char sender_line[HEADER_LEN];
char sender_name[HEADER_LEN]; char sender_name[HEADER_LEN];
int r;
# ifdef DEBUG # ifdef DEBUG
if (debug & DEBUG_MISC) { if (debug & DEBUG_MISC) {
wait_message(3, "sender_needed From:=[%s]", from); wait_message(3, "sender_needed From:=[%s]", from);
wait_message(3, "sender_needed Sender:=[%s]", sender); wait_message(3, "sender_needed Sender:=[%s]", sender);
} }
# endif /* DEBUG */ # endif /* DEBUG */
/* extract address */ /* extract address */
strip_name(from, from_addr); strip_name(from, from_addr);
snprintf(sender_line, sizeof(sender_line), "Sender: %s", sender); snprintf(sender_line, sizeof(sender_line), "Sender: %s", sender);
p = rfc1522_encode(sender_line, charset, FALSE); p = rfc1522_encode(sender_line, charset, FALSE);
if (GNKSA_OK != gnksa_do_check_from(p + 8, sender_addr, sender_name)) { r = gnksa_do_check_from(p + 8, sender_addr, sender_name);
if (r > GNKSA_OK && r < GNKSA_MISSING_REALNAME) {
free(p); free(p);
return -2; return -2;
} }
free(p); free(p);
from_at_pos = strchr(from_addr, '@'); from_at_pos = strchr(from_addr, '@');
if ((sender_at_pos = strchr(sender_addr, '@'))) if ((sender_at_pos = strchr(sender_addr, '@')))
sender_dot_pos = strchr(sender_at_pos, '.'); sender_dot_pos = strchr(sender_at_pos, '.');
else /* this case is caught by the gnksa_do_check_from() code above; anyw ay ... */ else /* this case is caught by the gnksa_do_check_from() code above; anyw ay ... */
return -2; return -2;
 End of changes. 5 change blocks. 
6 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)