Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ed for openSUSE:Factory checked in at 2025-08-25 20:36:02 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ed (Old) and /work/SRC/openSUSE:Factory/.ed.new.30751 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ed" Mon Aug 25 20:36:02 2025 rev:41 rq:1300998 version:1.22.2 Changes: -------- --- /work/SRC/openSUSE:Factory/ed/ed.changes 2025-08-09 19:57:19.443998282 +0200 +++ /work/SRC/openSUSE:Factory/.ed.new.30751/ed.changes 2025-08-25 20:36:03.494963564 +0200 @@ -1,0 +2,9 @@ +Mon Aug 18 18:37:30 UTC 2025 - Andreas Stieger <[email protected]> + +- GNU ed 1.22.2: + * Newline characters are no longer allowed in file names even if + '--unsafe-names' is specified. + * The file name is now printed escaped also when replaced into a + shell command. + +------------------------------------------------------------------- Old: ---- ed-1.22.1.tar.xz New: ---- ed-1.22.2.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ed.spec ++++++ --- /var/tmp/diff_new_pack.9DJzbD/_old 2025-08-25 20:36:04.262995739 +0200 +++ /var/tmp/diff_new_pack.9DJzbD/_new 2025-08-25 20:36:04.266995907 +0200 @@ -18,7 +18,7 @@ Name: ed -Version: 1.22.1 +Version: 1.22.2 Release: 0 Summary: A line-oriented text editor License: GPL-3.0-or-later AND LGPL-2.1-or-later ++++++ ed-1.22.1.tar.xz -> ed-1.22.2.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ed-1.22.1/ChangeLog new/ed-1.22.2/ChangeLog --- old/ed-1.22.1/ChangeLog 2025-08-05 13:21:40.000000000 +0200 +++ new/ed-1.22.2/ChangeLog 2025-08-18 18:31:54.000000000 +0200 @@ -1,3 +1,11 @@ +2025-08-18 Antonio Diaz Diaz <[email protected]> + + * Version 1.22.2 released. + * main.c: (may_access_filename): Reject file names with newlines. + (print_filename): Rename to 'print_escaped'. + (print_escaped): Always check file name for control chars. + * main_loop.c (get_shell_command): Use 'print_escaped'. + 2025-08-05 Antonio Diaz Diaz <[email protected]> * Version 1.22.1 released. @@ -83,13 +91,12 @@ * New option '--strip-trailing-cr'. * main_loop.c (get_shell_command): Flush stdout after printing cmd. (Reported by S�ren Tempel). + Remove backslash from escaped '%'. (Reported by Martin Thomsen). * signal.c (sighup_handler): Fix a memory leak just before exiting. * carg_parser.c (ap_init): Likewise. (Both reported by Xos� V�zquez P�rez). * io.c (read_file, write_file): Check ptr returned by strip_escapes. * main_loop.c (get_shell_command, exec_command): Likewise. - * main_loop.c (get_shell_command): Remove backslash from escaped '%'. - (Reported by Martin Thomsen). * main_loop.c, regex.c: Implement case-insensitive REs. * regex.c (compile_regex): Don't overwrite previous regex if error. * buffer.c (push_undo_atom): Fail if stack grows larger than INT_MAX. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ed-1.22.1/NEWS new/ed-1.22.2/NEWS --- old/ed-1.22.1/NEWS 2025-08-05 10:42:34.000000000 +0200 +++ new/ed-1.22.2/NEWS 2025-08-18 17:55:59.000000000 +0200 @@ -1,3 +1,9 @@ +Changes in version 1.22.2: +Newline characters are no longer allowed in file names even if +'--unsafe-names' is specified. + +The file name is now printed escaped also when replaced into a shell command. + Changes in version 1.22.1: Ed now departs from POSIX and ignores SIGPIPE to prevent commands like diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ed-1.22.1/configure new/ed-1.22.2/configure --- old/ed-1.22.1/configure 2025-08-05 10:42:34.000000000 +0200 +++ new/ed-1.22.2/configure 2025-08-07 12:25:39.000000000 +0200 @@ -6,7 +6,7 @@ # to copy, distribute, and modify it. pkgname=ed -pkgversion=1.22.1 +pkgversion=1.22.2 progname=ed srctrigger=doc/${pkgname}.texi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ed-1.22.1/doc/ed.1 new/ed-1.22.2/doc/ed.1 --- old/ed-1.22.1/doc/ed.1 2025-08-05 14:01:57.000000000 +0200 +++ new/ed-1.22.2/doc/ed.1 2025-08-18 18:32:16.000000000 +0200 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2. -.TH ED "1" "August 2025" "GNU ed 1.22.1" "User Commands" +.TH ED "1" "August 2025" "GNU ed 1.22.2" "User Commands" .SH NAME ed \- line-oriented text editor .SH SYNOPSIS @@ -55,7 +55,7 @@ strip carriage returns at end of text lines .TP \fB\-\-unsafe\-names\fR -allow control characters 1\-31 in file names +allow control characters in file names .PP Start edit by reading in 'file' if given. If 'file' begins with a '!', read output of shell command. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ed-1.22.1/doc/ed.info new/ed-1.22.2/doc/ed.info --- old/ed-1.22.1/doc/ed.info 2025-08-05 13:59:37.000000000 +0200 +++ new/ed-1.22.2/doc/ed.info 2025-08-18 18:18:00.000000000 +0200 @@ -18,7 +18,7 @@ The GNU ed line editor ********************** -This manual is for GNU ed (version 1.22.1, 5 August 2025). +This manual is for GNU ed (version 1.22.2, 18 August 2025). * Menu: @@ -398,8 +398,9 @@ restored when saving the buffer to a file. '--unsafe-names' - 'ed' rejects file names containing control characters 1 to 31 unless - they are allowed with this option. + 'ed' rejects file names containing control characters unless they are + allowed with this option. Newline characters in file names are rejected + even if this option is specified. Exit status: 0 for a normal exit, 1 for environmental problems (invalid @@ -1603,20 +1604,20 @@ Tag Table: Node: Top529 -Node: Overview1898 -Node: Introduction to line editing4746 -Node: Invoking ed11959 -Node: Argument syntax15874 -Node: Line addressing17636 -Node: Regular expressions21652 -Node: Commands27822 -Ref: print suffixes28157 -Ref: shell escape command40670 -Node: The 's' Command42248 -Node: Limitations45142 -Node: Diagnostics46159 -Node: Problems46988 -Node: GNU Free Documentation License47520 +Node: Overview1899 +Node: Introduction to line editing4747 +Node: Invoking ed11960 +Node: Argument syntax15952 +Node: Line addressing17714 +Node: Regular expressions21730 +Node: Commands27900 +Ref: print suffixes28235 +Ref: shell escape command40748 +Node: The 's' Command42326 +Node: Limitations45220 +Node: Diagnostics46237 +Node: Problems47066 +Node: GNU Free Documentation License47598 End Tag Table diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ed-1.22.1/doc/ed.texi new/ed-1.22.2/doc/ed.texi --- old/ed-1.22.1/doc/ed.texi 2025-08-05 13:59:33.000000000 +0200 +++ new/ed-1.22.2/doc/ed.texi 2025-08-18 18:17:57.000000000 +0200 @@ -6,8 +6,8 @@ @finalout @c %**end of header -@set UPDATED 5 August 2025 -@set VERSION 1.22.1 +@set UPDATED 18 August 2025 +@set VERSION 1.22.2 @dircategory Basics @direntry @@ -455,8 +455,9 @@ buffer to a file. @item --unsafe-names -@command{ed} rejects file names containing control characters 1 to 31 unless -they are allowed with this option. +@command{ed} rejects file names containing control characters unless they +are allowed with this option. Newline characters in file names are rejected +even if this option is specified. @end table @@ -675,12 +676,12 @@ Matches any single character. @item [@var{char-class}] -Matches any single character in @var{char-class}. To include a @samp{]} -in @var{char-class}, it must be the first character. A range of -characters may be specified by separating the end characters of the -range with a @samp{-}, e.g., @samp{a-z} specifies the lower case -characters. The following literal expressions can also be used in -@var{char-class} to specify sets of characters: +Matches any single character in @var{char-class}. To include a @samp{]} in +@var{char-class}, it must be the first character. A range of characters may +be specified by separating the end characters of the range with a @samp{-}, +e.g., @samp{a-z} specifies the lower case characters. The following literal +expressions can also be used in @var{char-class} to specify sets of +characters: @example [:alnum:] [:cntrl:] [:lower:] [:space:] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ed-1.22.1/ed.h new/ed-1.22.2/ed.h --- old/ed-1.22.1/ed.h 2025-07-19 10:20:17.000000000 +0200 +++ new/ed-1.22.2/ed.h 2025-08-18 17:33:07.000000000 +0200 @@ -98,6 +98,7 @@ void unset_active_nodes( const line_node * bp, const line_node * const ep ); /* defined in io.c */ +unsigned char escchar( const unsigned char ch ); bool get_extended_line( const char ** const ibufpp, int * const lenp, const bool strip_escaped_newlines ); const char * get_stdin_line( int * const sizep ); @@ -114,7 +115,7 @@ bool extended_regexp( void ); bool interactive(); bool may_access_filename( const char * const name ); -void print_filename( const char * const filename, const bool to_stdout ); +void print_escaped( const char * p, const bool to_stdout ); bool restricted( void ); bool scripted( void ); void show_strerror( const char * const filename, const int errcode ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ed-1.22.1/io.c new/ed-1.22.2/io.c --- old/ed-1.22.1/io.c 2025-07-19 12:40:39.000000000 +0200 +++ new/ed-1.22.2/io.c 2025-08-18 17:07:56.000000000 +0200 @@ -39,11 +39,17 @@ unterminated_line == search_line_node( last_addr() ); } +unsigned char escchar( const unsigned char ch ) + { + const char * const escapes = "\a\b\f\n\r\t\v"; + const char * const escchars = "abfnrtv"; + const char * const p = strchr( escapes, ch ); + return ( ch && p ) ? escchars[p-escapes] : 0; + } + /* print text to stdout */ static void print_line( const char * p, int len, const int pflags ) { - const char escapes[] = "\a\b\f\n\r\t\v"; - const char escchars[] = "abfnrtv"; int col = 0; if( pflags & pf_n ) { printf( "%d\t", current_addr() ); col = 8; } @@ -59,9 +65,9 @@ putchar( ch ); } else { - const char * const p = strchr( escapes, ch ); ++col; putchar('\\'); - if( ch && p ) putchar( escchars[p-escapes] ); + const char e = escchar( ch ); + if( e ) putchar( e ); else { col += 2; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ed-1.22.1/main.c new/ed-1.22.2/main.c --- old/ed-1.22.1/main.c 2025-08-05 13:59:33.000000000 +0200 +++ new/ed-1.22.2/main.c 2025-08-18 17:33:07.000000000 +0200 @@ -53,7 +53,7 @@ static bool extended_regexp_ = false; /* use EREs */ static bool quiet = false; /* suppress diagnostics */ static bool restricted_ = false; /* run in restricted mode */ -static bool safe_names = true; /* reject chars 1-31 in file names */ +static bool safe_names = true; /* reject control chars in file names */ static bool scripted_ = false; /* suppress byte counts and ! prompt */ static bool strip_cr_ = false; /* strip trailing CRs */ static bool traditional_ = false; /* be backwards compatible */ @@ -92,7 +92,7 @@ " -s, --script suppress byte counts and '!' prompt\n" " -v, --verbose be verbose; equivalent to the 'H' command\n" " --strip-trailing-cr strip carriage returns at end of text lines\n" - " --unsafe-names allow control characters 1-31 in file names\n" + " --unsafe-names allow control characters in file names\n" "\nStart edit by reading in 'file' if given.\n" "If 'file' begins with a '!', read output of shell command.\n" "\nExit status: 0 for a normal exit, 1 for environmental problems\n" @@ -117,17 +117,16 @@ } -void print_filename( const char * const filename, const bool to_stdout ) +void print_escaped( const char * p, const bool to_stdout ) { FILE * const fp = to_stdout ? stdout : stderr; - if( safe_names ) { fputs( filename, fp ); return; } - const char * p; - for( p = filename; *p; ++p ) + for( ; *p; ++p ) { const unsigned char ch = *p; if( ch == '\\' ) { putc( ch, fp ); putc( ch, fp ); continue; } - if( ch >= 32 ) { putc( ch, fp ); continue; } + if( ch >= 32 && ch <= 126 ) { putc( ch, fp ); continue; } putc( '\\', fp ); + const char e = escchar( ch ); if( e ) { putc( e, fp ); continue; } putc( ( ( ch >> 6 ) & 7 ) + '0', fp ); putc( ( ( ch >> 3 ) & 7 ) + '0', fp ); putc( ( ch & 7 ) + '0', fp ); @@ -140,7 +139,7 @@ if( !quiet ) { if( filename && filename[0] ) - { print_filename( filename, false ); fputs( ": ", stderr ); } + { print_escaped( filename, false ); fputs( ": ", stderr ); } fprintf( stderr, "%s\n", msg ); } } @@ -151,7 +150,7 @@ if( !quiet ) { if( filename && filename[0] ) - { print_filename( filename, false ); fputs( ": ", stderr ); } + { print_escaped( filename, false ); fputs( ": ", stderr ); } fprintf( stderr, "%s\n", strerror( errcode ) ); } } @@ -203,13 +202,15 @@ if( strcmp( name, ".." ) == 0 || strchr( name, '/' ) ) { set_error_msg( "Directory access restricted" ); return false; } } + const char * p; + for( p = name; *p; ++p ) + if( *p == '\n' ) + { set_error_msg( "Newline character not allowed in file names" ); + return false; } if( safe_names ) - { - const char * p; - for( p = name; *p; ++p ) if( *p <= 31 && *p >= 1 ) - { set_error_msg( "Control characters 1-31 not allowed in file names" ); + for( p = name; *p; ++p ) if( ( *p <= 31 && *p >= 1 ) || *p == 127 ) + { set_error_msg( "Control characters not allowed in file names" ); return false; } - } return true; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ed-1.22.1/main_loop.c new/ed-1.22.2/main_loop.c --- old/ed-1.22.1/main_loop.c 2025-07-23 19:26:01.000000000 +0200 +++ new/ed-1.22.2/main_loop.c 2025-08-18 17:47:04.000000000 +0200 @@ -161,7 +161,8 @@ if( !resize_buffer( &shcmd, &shcmdsz, i + 1 ) ) return 0; memcpy( shcmd, buf, i ); shcmd[i] = 0; shcmdlen = i; - if( replacement ) { printf( "%s\n", shcmd + 1 ); fflush( stdout ); } + if( replacement ) + { print_escaped( shcmd + 1, true ); putchar('\n'); fflush( stdout ); } return shcmd; } @@ -603,7 +604,7 @@ if( fnp[0] == '!' ) { set_error_msg( "Invalid redirection" ); return ERR; } if( fnp[0] && !set_def_filename( fnp ) ) return ERR; - print_filename( def_filename, true ); putchar('\n'); + print_escaped( def_filename, true ); putchar('\n'); break; case 'g': case 'v': diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ed-1.22.1/regex.c new/ed-1.22.2/regex.c --- old/ed-1.22.1/regex.c 2025-03-27 22:25:08.000000000 +0100 +++ new/ed-1.22.2/regex.c 2025-08-15 11:57:18.000000000 +0200 @@ -318,7 +318,7 @@ { int i; - for( i = 0 ; i < rlen; ++i ) + for( i = 0; i < rlen; ++i ) { int n; if( rbuf[i] == '&' )
