From urs at tin.org Fri Apr 5 04:51:21 2024 From: urs at tin.org (Urs =?UTF-8?Q?Jan=C3=9Fen?=) Date: Fri, 05 Apr 2024 04:51:21 +0200 Subject: [tin-dev] [tin 2.6.4] snapshots References: Message-ID: In on Thu, 28 Mar 2024 17:30:31, Urs Jan?en wrote: > NOT well tested the last snapshot has two unsightly errors that are really annoying: - sort may not work on big endian systems where sizeof(long) is not sizeof(t_artnum) (e.g. 32 bit) - and even worse: interactive passwords were truncated (~/.newsauth still worked). sorry for in the issues === modified file 'src/art.c' --- old/src/art.c 2024-04-01 23:01:11 +0000 +++ new/src/art.c 2024-04-03 14:41:23 +0000 @@ -89,7 +89,7 @@ static t_artnum setup_hard_base(struct t_group *group); static t_bool parse_headers(FILE *fp, struct t_article *h); static t_compfunc eval_sort_arts_func(unsigned int sort_art_type); -static time_t get_last_posting_date(long n); +static time_t get_last_posting_date(int n); static void sort_base(unsigned int sort_threads_type); static void thread_by_multipart(void); static void thread_by_percentage(unsigned int percentage); @@ -3164,15 +3164,15 @@ t_comptype p1, t_comptype p2) { - int a = get_score_of_thread((int) *(const long *) p1); - int b = get_score_of_thread((int) *(const long *) p2); + int a = get_score_of_thread((int) *(const t_artnum *) p1); + int b = get_score_of_thread((int) *(const t_artnum *) p2); /* If scores are equal, compare using the article sort order. * This determines the order in a group of equally scored threads. */ if (a == b) { - t_comptype s1 = &arts[*(const long *) p1]; - t_comptype s2 = &arts[*(const long *) p2]; + t_comptype s1 = &arts[*(const t_artnum *) p1]; + t_comptype s2 = &arts[*(const t_artnum *) p2]; t_compfunc comp_func = eval_sort_arts_func(CURR_GROUP.attribute->sort_article_type); if (comp_func) @@ -3197,8 +3197,8 @@ t_comptype p1, t_comptype p2) { - time_t s1_last = get_last_posting_date(*(const long *) p1); - time_t s2_last = get_last_posting_date(*(const long *) p2); + time_t s1_last = get_last_posting_date(*(const t_artnum *) p1); + time_t s2_last = get_last_posting_date(*(const t_artnum *) p2); if (s2_last < s1_last) return -1; @@ -3215,8 +3215,8 @@ t_comptype p1, t_comptype p2) { - time_t s1_last = get_last_posting_date(*(const long *) p1); - time_t s2_last = get_last_posting_date(*(const long *) p2); + time_t s1_last = get_last_posting_date(*(const t_artnum *) p1); + time_t s2_last = get_last_posting_date(*(const t_artnum *) p2); if (s2_last > s1_last) return -1; @@ -3230,9 +3230,9 @@ static time_t get_last_posting_date( - long n) + int n) { - long i; + int i; time_t last = (time_t) 0; for (i = n; i >= 0; i = arts[i].thread) { === modified file 'src/auth.c' --- old/src/auth.c 2024-03-13 02:55:36 +0000 +++ new/src/auth.c 2024-04-05 02:39:57 +0000 @@ -752,16 +752,16 @@ prompt_for_authid( char *authuser ) { - char *authid = my_malloc(128); + char *authid; + size_t maxlen = 255; # ifdef USE_CURSES int state = RawState(); -# endif /* USE_CURSES */ -# ifdef USE_CURSES Raw(TRUE); # endif /* USE_CURSES */ - if (!prompt_default_string(_(txt_auth_user), authid, sizeof(authid) - 1, authuser, HIST_NONE)) { + authid = my_malloc(maxlen--); + if (!prompt_default_string(_(txt_auth_user), authid, maxlen, authuser, HIST_NONE)) { # ifdef DEBUG if ((debug & DEBUG_NNTP) && verbose > 1) debug_print_file("NNTP", "authorization failed: no username"); @@ -786,18 +786,20 @@ prompt_for_password( void ) { - char *pass = my_malloc(128); + char *pass; + size_t maxlen = 255; # ifdef USE_CURSES + pass = my_malloc(maxlen--); my_printf("%s", _(txt_auth_pass)); - wgetnstr(stdscr, pass, sizeof(pass) - 1); - pass[sizeof(pass) - 1] = '\0'; + wgetnstr(stdscr, pass, maxlen); + pass[maxlen] = '\0'; # else /* * on some systems (i.e. Solaris) getpass(3) is limited * to 8 chars -> we use tin_getline() */ - STRCPY(pass, tin_getline(_(txt_auth_pass), 0, NULL, sizeof(pass) - 1, TRUE, HIST_NONE)); + pass = my_strdup(tin_getline(_(txt_auth_pass), 0, NULL, maxlen, TRUE, HIST_NONE)); # endif /* USE_CURSES */ return pass; From urs at tin.org Tue Apr 30 20:14:43 2024 From: urs at tin.org (Urs =?UTF-8?Q?Jan=C3=9Fen?=) Date: Tue, 30 Apr 2024 20:14:43 +0200 Subject: [tin-dev] [tin 2.6.4] snapshots References: Message-ID: New snapshots available. We no longer ship (the outdaed) intl-fallback. If you want NLS support and your system lacks the required functions (unlikely these days) you need to grab/install libintl on your own. The MOTD will only displayed at startup if it changed on the server (it can be seen anytime via 'J'). Changes since 2.6.3: 023) Thomas E. Dickey REM. bundled-intl stuff FIX. intl/*, aclocal.m4, configure[.in], autoconf.hin, nntplib.h tcurses.h, Makefile[.in] 022) Enrik Berkhan ADD. avoid implicit conversion FIX. curses.c, misc.c, nntplib.c, rfc2047.c 021) Matt Anton ADD. updated French translation FIX. fr.po 020) Dennis Preiser ADD. always cast arg to is*()-functions to unsigned char ADD. avoid implicit conversion ADD. formatted output for -vZ and large article counts BUG. txt_help_config_search_opt_forwards, txt_help_config_search_opt_forwards and txt_help_attrib_search_opt_backwards, txt_help_attrib_search_opt_forwards were mixed up BUG. memleak when using bsd-sockets without getservbyname() BUG. possible memleak on quit in version.c:upgrade_prompt_quit() FIX. art.c, config.c, cook.c, filter.c, getline.c, group.c, header.c keymap.c, lang.c, main.c, makecfg.c, misc.c, nntplib.c, page.c post.c, regex.c, rfc2046.c, rfc2047.c, save.c, search.c, select.c string.c, tags.c, version.c, xref.c, parsdate.y, newsrc.h, proto.h tin.h 019) Urs Janssen ADD. silence some unused parameter warnings ADD. avoid sscanf(3) in check_upgrade() ADD. avoid fixed length buffer in my_mktmp() ADD. configure check for buggy snprintf(3) ADD. changed snprintf(3) fallback implementation from Patrick Powell to the one by Mark Martinec ADD. use snprintf(3) in STRCPY macro ADD. config.guess, config.sub update ADD. avoid tmpfile(3) usage ADD. configure check for blockable signal-type (POSIX, BSD, SYSV, NONE) ADD. configure check for tiuser.h (TLI; SVR3, SVR4) ADD. configure check for lrand48(3) and random(3), prefer over rand(3) ADD. configure check for dirfd(3) ADD. configure check for tcflag_t ADD. configure check for PRIdLEAST64 and SCNdLEAST64 ADD. simplify _Noreturn check, just note the C11 standard ADD. removed fixed buffer from copy_body() ADD. SASL info to connection-info ('J') ADD. -L cmd.line switch ADD. create missing newsrc-dir ADD. -g "[ipv6::address]"[:port] also in .newsauth and newsrctable ADD. check that a recipient is present in mailgroups ADD. mention location of files being read on startup ADD. only display MOTD on startup if it did change since the last connect (use 'J' to see it anyway). REM. tmpfile.c BUG. AUTHINFO SASL * didn't check possible 283 return code (as we do not support anything but SASL PLAIN yet, not an issue) BUG. -t not mentioned in -h BUG. malloc(3)- and fopen(3)-leaks on error exits BUG. didn't remove '.' from normalized charset when looking for a keymap-file BUG. socket(3)-leak on early exit due to TLS-errors BUG. possible NULL-pointer dereference in connection-info ('J') if CAPABILITIES does not return IMPLEMENTATION BUG. wrong sign for shown default kill-score value in kill-menu BUG. art_mark_xref_read() didn't allow '\t' between locations BUG. a From longer than > cCOLS wasn't properly truncated before appending organitazion in the pager FIX. active.c, art.c, attrib.c, auth.c, config.c, cook.c, debug.c, feed.c filter.c, group.c, header.c, help.c, inews.c, init.c, keymap.c lang.c, lock.c, mail.c, main.c, misc.c, my_tmpfile.c, newsrc.c nntplib.c, nntps.c, nrctbl.c, options_menu.c, page.c, pgp.c, post.c prompt.c, read.c, rfc1524.c, rfc2046.c, rfc2047.c, save.c, search.c select.c, sigfile.c, snprintf.c, string.c, tcurses.c, thread.c version.c, xface.c, xref.c, debug.h, extern.h, nntplib.h, proto.h snprintf.h, tin.h, tnntp.h, autoconf.h[in], configure[.in] Makefile[.in], config.guess, config.sub, tin.1, tin.5