3.0 toolchain: upgrade bash, cpio, chkconfig (#6832)
This commit is contained in:
Родитель
c97b84ac48
Коммит
9098573c41
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"Signatures": {
|
||||
"bash-5.1.8.tar.gz": "0cfb5c9bb1a29f800a97bd242d19511c997a1013815b805e0fdd32214113d6be",
|
||||
"bash-5.2.15.tar.gz": "13720965b5f4fc3a0d4b61dd37e7565c741da9a5be24edc2ae00182fc1b3588c",
|
||||
"bash_completion": "2243e372a314c975595bf22f0ea330533ff0242c7e5d17525d7c061e25ea5ae4"
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
Summary: Bourne-Again SHell
|
||||
Name: bash
|
||||
Version: 5.1.8
|
||||
Release: 4%{?dist}
|
||||
Version: 5.2.15
|
||||
Release: 1%{?dist}
|
||||
License: GPLv3
|
||||
Vendor: Microsoft Corporation
|
||||
Distribution: Mariner
|
||||
|
@ -328,6 +328,9 @@ fi
|
|||
%defattr(-,root,root)
|
||||
|
||||
%changelog
|
||||
* Tue Nov 21 2023 Andrew Phelps <anphel@microsoft.com> - 5.2.15-1
|
||||
- Upgrade to version 5.2.15
|
||||
|
||||
* Wed Sep 20 2023 Jon Slobodzian <joslobo@microsoft.com> - 5.1.8-4
|
||||
- Recompile with stack-protection fixed gcc version (CVE-2023-4039)
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"Signatures": {
|
||||
"chkconfig-1.20.tar.gz": "ae652c799290b9f158f410a1ef567fa11e6f729a1bd2a65b7410a6d49eb50d15"
|
||||
"chkconfig-1.25.tar.gz": "e9816d31634cc67c68ff7dfbeb8bca301722c03529648d4556b74b4fabe6f435"
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
Summary: A system tool for maintaining the %{_sysconfdir}/rc*.d hierarchy
|
||||
Name: chkconfig
|
||||
Version: 1.20
|
||||
Release: 4%{?dist}
|
||||
Version: 1.25
|
||||
Release: 1%{?dist}
|
||||
License: GPLv2
|
||||
Vendor: Microsoft Corporation
|
||||
Distribution: Mariner
|
||||
|
@ -108,6 +108,9 @@ mkdir -p %{buildroot}%{_sysconfdir}/chkconfig.d
|
|||
%defattr(-,root,root)
|
||||
|
||||
%changelog
|
||||
* Tue Nov 21 2023 Andrew Phelps <anphel@microsoft.com> - 1.25-1
|
||||
- Upgrade to version 1.25
|
||||
|
||||
* Wed Sep 20 2023 Jon Slobodzian <joslobo@microsoft.com> - 1.20-4
|
||||
- Recompile with stack-protection fixed gcc version (CVE-2023-4039)
|
||||
|
||||
|
|
|
@ -1,583 +0,0 @@
|
|||
This patch is a combination of the following commits:
|
||||
|
||||
https://git.savannah.gnu.org/cgit/cpio.git/commit/?id=dd96882877721703e19272fe25034560b794061b
|
||||
https://git.savannah.gnu.org/cgit/cpio.git/commit/?id=dfc801c44a93bed7b3951905b188823d6a0432c8
|
||||
https://git.savannah.gnu.org/cgit/cpio.git/commit/?id=236684f6deb3178043fe72a8e2faca538fa2aae1
|
||||
|
||||
---------------
|
||||
|
||||
https://git.savannah.gnu.org/cgit/cpio.git/commit/?id=dd96882877721703e19272fe25034560b794061b
|
||||
|
||||
author Sergey Poznyakoff <gray@gnu.org> 2021-08-07 12:52:21 +0300
|
||||
committer Sergey Poznyakoff <gray@gnu.org> 2021-08-07 12:52:21 +0300
|
||||
commit dd96882877721703e19272fe25034560b794061b (patch)
|
||||
tree 2d81f2521f55cf3d82e7305d1475be9c8c1e0812
|
||||
parent 269d2040a62e45a35d7f5eef3e868813d44213c0 (diff)
|
||||
download cpio-dd96882877721703e19272fe25034560b794061b.tar.gz
|
||||
|
||||
Rewrite dynamic string support.
|
||||
|
||||
* src/dstring.c (ds_init): Take a single argument.
|
||||
(ds_free): New function.
|
||||
(ds_resize): Take a single argument. Use x2nrealloc to expand
|
||||
the storage.
|
||||
(ds_reset,ds_append,ds_concat,ds_endswith): New function.
|
||||
(ds_fgetstr): Rewrite. In particular, this fixes integer overflow.
|
||||
* src/dstring.h (dynamic_string): Keep both the allocated length
|
||||
(ds_size) and index of the next free byte in the string (ds_idx).
|
||||
(ds_init,ds_resize): Change signature.
|
||||
(ds_len): New macro.
|
||||
(ds_free,ds_reset,ds_append,ds_concat,ds_endswith): New protos.
|
||||
* src/copyin.c: Use new ds_ functions.
|
||||
* src/copyout.c: Likewise.
|
||||
* src/copypass.c: Likewise.
|
||||
* src/util.c: Likewise.
|
||||
|
||||
|
||||
diff --git a/src/copyin.c b/src/copyin.c
|
||||
index a096048..4fb14af 100644
|
||||
--- a/src/copyin.c
|
||||
+++ b/src/copyin.c
|
||||
@@ -55,11 +55,12 @@ query_rename(struct cpio_file_stat* file_hdr, FILE *tty_in, FILE *tty_out,
|
||||
char *str_res; /* Result for string function. */
|
||||
static dynamic_string new_name; /* New file name for rename option. */
|
||||
static int initialized_new_name = false;
|
||||
+
|
||||
if (!initialized_new_name)
|
||||
- {
|
||||
- ds_init (&new_name, 128);
|
||||
- initialized_new_name = true;
|
||||
- }
|
||||
+ {
|
||||
+ ds_init (&new_name);
|
||||
+ initialized_new_name = true;
|
||||
+ }
|
||||
|
||||
if (rename_flag)
|
||||
{
|
||||
@@ -779,37 +780,36 @@ long_format (struct cpio_file_stat *file_hdr, char const *link_name)
|
||||
already in `save_patterns' (from the command line) are preserved. */
|
||||
|
||||
static void
|
||||
-read_pattern_file ()
|
||||
+read_pattern_file (void)
|
||||
{
|
||||
- int max_new_patterns;
|
||||
- char **new_save_patterns;
|
||||
- int new_num_patterns;
|
||||
+ char **new_save_patterns = NULL;
|
||||
+ size_t max_new_patterns;
|
||||
+ size_t new_num_patterns;
|
||||
int i;
|
||||
- dynamic_string pattern_name;
|
||||
+ dynamic_string pattern_name = DYNAMIC_STRING_INITIALIZER;
|
||||
FILE *pattern_fp;
|
||||
|
||||
if (num_patterns < 0)
|
||||
num_patterns = 0;
|
||||
- max_new_patterns = 1 + num_patterns;
|
||||
- new_save_patterns = (char **) xmalloc (max_new_patterns * sizeof (char *));
|
||||
new_num_patterns = num_patterns;
|
||||
- ds_init (&pattern_name, 128);
|
||||
+ max_new_patterns = num_patterns;
|
||||
+ new_save_patterns = xcalloc (max_new_patterns, sizeof (new_save_patterns[0]));
|
||||
|
||||
pattern_fp = fopen (pattern_file_name, "r");
|
||||
if (pattern_fp == NULL)
|
||||
open_fatal (pattern_file_name);
|
||||
while (ds_fgetstr (pattern_fp, &pattern_name, '\n') != NULL)
|
||||
{
|
||||
- if (new_num_patterns >= max_new_patterns)
|
||||
- {
|
||||
- max_new_patterns += 1;
|
||||
- new_save_patterns = (char **)
|
||||
- xrealloc ((char *) new_save_patterns,
|
||||
- max_new_patterns * sizeof (char *));
|
||||
- }
|
||||
+ if (new_num_patterns == max_new_patterns)
|
||||
+ new_save_patterns = x2nrealloc (new_save_patterns,
|
||||
+ &max_new_patterns,
|
||||
+ sizeof (new_save_patterns[0]));
|
||||
new_save_patterns[new_num_patterns] = xstrdup (pattern_name.ds_string);
|
||||
++new_num_patterns;
|
||||
}
|
||||
+
|
||||
+ ds_free (&pattern_name);
|
||||
+
|
||||
if (ferror (pattern_fp) || fclose (pattern_fp) == EOF)
|
||||
close_error (pattern_file_name);
|
||||
|
||||
@@ -1196,7 +1196,7 @@ swab_array (char *ptr, int count)
|
||||
in the file system. */
|
||||
|
||||
void
|
||||
-process_copy_in ()
|
||||
+process_copy_in (void)
|
||||
{
|
||||
char done = false; /* True if trailer reached. */
|
||||
FILE *tty_in = NULL; /* Interactive file for rename option. */
|
||||
diff --git a/src/copyout.c b/src/copyout.c
|
||||
index 5ca587f..ca6798c 100644
|
||||
--- a/src/copyout.c
|
||||
+++ b/src/copyout.c
|
||||
@@ -594,9 +594,10 @@ assign_string (char **pvar, char *value)
|
||||
The format of the header depends on the compatibility (-c) flag. */
|
||||
|
||||
void
|
||||
-process_copy_out ()
|
||||
+process_copy_out (void)
|
||||
{
|
||||
- dynamic_string input_name; /* Name of file read from stdin. */
|
||||
+ dynamic_string input_name = DYNAMIC_STRING_INITIALIZER;
|
||||
+ /* Name of file read from stdin. */
|
||||
struct stat file_stat; /* Stat record for file. */
|
||||
struct cpio_file_stat file_hdr = CPIO_FILE_STAT_INITIALIZER;
|
||||
/* Output header information. */
|
||||
@@ -605,7 +606,6 @@ process_copy_out ()
|
||||
char *orig_file_name = NULL;
|
||||
|
||||
/* Initialize the copy out. */
|
||||
- ds_init (&input_name, 128);
|
||||
file_hdr.c_magic = 070707;
|
||||
|
||||
/* Check whether the output file might be a tape. */
|
||||
@@ -657,14 +657,9 @@ process_copy_out ()
|
||||
{
|
||||
if (file_hdr.c_mode & CP_IFDIR)
|
||||
{
|
||||
- int len = strlen (input_name.ds_string);
|
||||
/* Make sure the name ends with a slash */
|
||||
- if (input_name.ds_string[len-1] != '/')
|
||||
- {
|
||||
- ds_resize (&input_name, len + 2);
|
||||
- input_name.ds_string[len] = '/';
|
||||
- input_name.ds_string[len+1] = 0;
|
||||
- }
|
||||
+ if (!ds_endswith (&input_name, '/'))
|
||||
+ ds_append (&input_name, '/');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -875,6 +870,7 @@ process_copy_out ()
|
||||
(unsigned long) blocks), (unsigned long) blocks);
|
||||
}
|
||||
cpio_file_stat_free (&file_hdr);
|
||||
+ ds_free (&input_name);
|
||||
}
|
||||
|
||||
|
||||
diff --git a/src/copypass.c b/src/copypass.c
|
||||
index 5d5e939..23ee687 100644
|
||||
--- a/src/copypass.c
|
||||
+++ b/src/copypass.c
|
||||
@@ -48,10 +48,12 @@ set_copypass_perms (int fd, const char *name, struct stat *st)
|
||||
If `link_flag', link instead of copying. */
|
||||
|
||||
void
|
||||
-process_copy_pass ()
|
||||
+process_copy_pass (void)
|
||||
{
|
||||
- dynamic_string input_name; /* Name of file from stdin. */
|
||||
- dynamic_string output_name; /* Name of new file. */
|
||||
+ dynamic_string input_name = DYNAMIC_STRING_INITIALIZER;
|
||||
+ /* Name of file from stdin. */
|
||||
+ dynamic_string output_name = DYNAMIC_STRING_INITIALIZER;
|
||||
+ /* Name of new file. */
|
||||
size_t dirname_len; /* Length of `directory_name'. */
|
||||
int res; /* Result of functions. */
|
||||
char *slash; /* For moving past slashes in input name. */
|
||||
@@ -65,25 +67,18 @@ process_copy_pass ()
|
||||
created files */
|
||||
|
||||
/* Initialize the copy pass. */
|
||||
- ds_init (&input_name, 128);
|
||||
|
||||
dirname_len = strlen (directory_name);
|
||||
if (change_directory_option && !ISSLASH (directory_name[0]))
|
||||
{
|
||||
char *pwd = xgetcwd ();
|
||||
-
|
||||
- dirname_len += strlen (pwd) + 1;
|
||||
- ds_init (&output_name, dirname_len + 2);
|
||||
- strcpy (output_name.ds_string, pwd);
|
||||
- strcat (output_name.ds_string, "/");
|
||||
- strcat (output_name.ds_string, directory_name);
|
||||
+
|
||||
+ ds_concat (&output_name, pwd);
|
||||
+ ds_append (&output_name, '/');
|
||||
}
|
||||
- else
|
||||
- {
|
||||
- ds_init (&output_name, dirname_len + 2);
|
||||
- strcpy (output_name.ds_string, directory_name);
|
||||
- }
|
||||
- output_name.ds_string[dirname_len] = '/';
|
||||
+ ds_concat (&output_name, directory_name);
|
||||
+ ds_append (&output_name, '/');
|
||||
+ dirname_len = ds_len (&output_name);
|
||||
output_is_seekable = true;
|
||||
|
||||
change_dir ();
|
||||
@@ -116,8 +111,8 @@ process_copy_pass ()
|
||||
/* Make the name of the new file. */
|
||||
for (slash = input_name.ds_string; *slash == '/'; ++slash)
|
||||
;
|
||||
- ds_resize (&output_name, dirname_len + strlen (slash) + 2);
|
||||
- strcpy (output_name.ds_string + dirname_len + 1, slash);
|
||||
+ ds_reset (&output_name, dirname_len);
|
||||
+ ds_concat (&output_name, slash);
|
||||
|
||||
existing_dir = false;
|
||||
if (lstat (output_name.ds_string, &out_file_stat) == 0)
|
||||
@@ -333,6 +328,9 @@ process_copy_pass ()
|
||||
(unsigned long) blocks),
|
||||
(unsigned long) blocks);
|
||||
}
|
||||
+
|
||||
+ ds_free (&input_name);
|
||||
+ ds_free (&output_name);
|
||||
}
|
||||
|
||||
/* Try and create a hard link from FILE_NAME to another file
|
||||
diff --git a/src/dstring.c b/src/dstring.c
|
||||
index b261d5a..692d3e7 100644
|
||||
--- a/src/dstring.c
|
||||
+++ b/src/dstring.c
|
||||
@@ -20,8 +20,8 @@
|
||||
#if defined(HAVE_CONFIG_H)
|
||||
# include <config.h>
|
||||
#endif
|
||||
-
|
||||
#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
#if defined(HAVE_STRING_H) || defined(STDC_HEADERS)
|
||||
#include <string.h>
|
||||
#else
|
||||
@@ -33,24 +33,41 @@
|
||||
/* Initialiaze dynamic string STRING with space for SIZE characters. */
|
||||
|
||||
void
|
||||
-ds_init (dynamic_string *string, int size)
|
||||
+ds_init (dynamic_string *string)
|
||||
+{
|
||||
+ memset (string, 0, sizeof *string);
|
||||
+}
|
||||
+
|
||||
+/* Free the dynamic string storage. */
|
||||
+
|
||||
+void
|
||||
+ds_free (dynamic_string *string)
|
||||
{
|
||||
- string->ds_length = size;
|
||||
- string->ds_string = (char *) xmalloc (size);
|
||||
+ free (string->ds_string);
|
||||
}
|
||||
|
||||
-/* Expand dynamic string STRING, if necessary, to hold SIZE characters. */
|
||||
+/* Expand dynamic string STRING, if necessary. */
|
||||
|
||||
void
|
||||
-ds_resize (dynamic_string *string, int size)
|
||||
+ds_resize (dynamic_string *string)
|
||||
{
|
||||
- if (size > string->ds_length)
|
||||
+ if (string->ds_idx == string->ds_size)
|
||||
{
|
||||
- string->ds_length = size;
|
||||
- string->ds_string = (char *) xrealloc ((char *) string->ds_string, size);
|
||||
+ string->ds_string = x2nrealloc (string->ds_string, &string->ds_size,
|
||||
+ 1);
|
||||
}
|
||||
}
|
||||
|
||||
+/* Reset the index of the dynamic string S to LEN. */
|
||||
+
|
||||
+void
|
||||
+ds_reset (dynamic_string *s, size_t len)
|
||||
+{
|
||||
+ while (len > s->ds_size)
|
||||
+ ds_resize (s);
|
||||
+ s->ds_idx = len;
|
||||
+}
|
||||
+
|
||||
/* Dynamic string S gets a string terminated by the EOS character
|
||||
(which is removed) from file F. S will increase
|
||||
in size during the function if the string from F is longer than
|
||||
@@ -61,34 +78,50 @@ ds_resize (dynamic_string *string, int size)
|
||||
char *
|
||||
ds_fgetstr (FILE *f, dynamic_string *s, char eos)
|
||||
{
|
||||
- int insize; /* Amount needed for line. */
|
||||
- int strsize; /* Amount allocated for S. */
|
||||
int next_ch;
|
||||
|
||||
/* Initialize. */
|
||||
- insize = 0;
|
||||
- strsize = s->ds_length;
|
||||
+ s->ds_idx = 0;
|
||||
|
||||
/* Read the input string. */
|
||||
- next_ch = getc (f);
|
||||
- while (next_ch != eos && next_ch != EOF)
|
||||
+ while ((next_ch = getc (f)) != eos && next_ch != EOF)
|
||||
{
|
||||
- if (insize >= strsize - 1)
|
||||
- {
|
||||
- ds_resize (s, strsize * 2 + 2);
|
||||
- strsize = s->ds_length;
|
||||
- }
|
||||
- s->ds_string[insize++] = next_ch;
|
||||
- next_ch = getc (f);
|
||||
+ ds_resize (s);
|
||||
+ s->ds_string[s->ds_idx++] = next_ch;
|
||||
}
|
||||
- s->ds_string[insize++] = '\0';
|
||||
+ ds_resize (s);
|
||||
+ s->ds_string[s->ds_idx] = '\0';
|
||||
|
||||
- if (insize == 1 && next_ch == EOF)
|
||||
+ if (s->ds_idx == 0 && next_ch == EOF)
|
||||
return NULL;
|
||||
else
|
||||
return s->ds_string;
|
||||
}
|
||||
|
||||
+void
|
||||
+ds_append (dynamic_string *s, int c)
|
||||
+{
|
||||
+ ds_resize (s);
|
||||
+ s->ds_string[s->ds_idx] = c;
|
||||
+ if (c)
|
||||
+ {
|
||||
+ s->ds_idx++;
|
||||
+ ds_resize (s);
|
||||
+ s->ds_string[s->ds_idx] = 0;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+ds_concat (dynamic_string *s, char const *str)
|
||||
+{
|
||||
+ size_t len = strlen (str);
|
||||
+ while (len + 1 > s->ds_size)
|
||||
+ ds_resize (s);
|
||||
+ memcpy (s->ds_string + s->ds_idx, str, len);
|
||||
+ s->ds_idx += len;
|
||||
+ s->ds_string[s->ds_idx] = 0;
|
||||
+}
|
||||
+
|
||||
char *
|
||||
ds_fgets (FILE *f, dynamic_string *s)
|
||||
{
|
||||
@@ -100,3 +133,10 @@ ds_fgetname (FILE *f, dynamic_string *s)
|
||||
{
|
||||
return ds_fgetstr (f, s, '\0');
|
||||
}
|
||||
+
|
||||
+/* Return true if the dynamic string S ends with character C. */
|
||||
+int
|
||||
+ds_endswith (dynamic_string *s, int c)
|
||||
+{
|
||||
+ return (s->ds_idx > 0 && s->ds_string[s->ds_idx - 1] == c);
|
||||
+}
|
||||
diff --git a/src/dstring.h b/src/dstring.h
|
||||
index 5d24181..ca7a5f1 100644
|
||||
--- a/src/dstring.h
|
||||
+++ b/src/dstring.h
|
||||
@@ -17,10 +17,6 @@
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301 USA. */
|
||||
|
||||
-#ifndef NULL
|
||||
-#define NULL 0
|
||||
-#endif
|
||||
-
|
||||
/* A dynamic string consists of record that records the size of an
|
||||
allocated string and the pointer to that string. The actual string
|
||||
is a normal zero byte terminated string that can be used with the
|
||||
@@ -30,22 +26,25 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
- int ds_length; /* Actual amount of storage allocated. */
|
||||
- char *ds_string; /* String. */
|
||||
+ size_t ds_size; /* Actual amount of storage allocated. */
|
||||
+ size_t ds_idx; /* Index of the next free byte in the string. */
|
||||
+ char *ds_string; /* String storage. */
|
||||
} dynamic_string;
|
||||
|
||||
+#define DYNAMIC_STRING_INITIALIZER { 0, 0, NULL }
|
||||
|
||||
-/* Macros that look similar to the original string functions.
|
||||
- WARNING: These macros work only on pointers to dynamic string records.
|
||||
- If used with a real record, an "&" must be used to get the pointer. */
|
||||
-#define ds_strlen(s) strlen ((s)->ds_string)
|
||||
-#define ds_strcmp(s1, s2) strcmp ((s1)->ds_string, (s2)->ds_string)
|
||||
-#define ds_strncmp(s1, s2, n) strncmp ((s1)->ds_string, (s2)->ds_string, n)
|
||||
-#define ds_index(s, c) index ((s)->ds_string, c)
|
||||
-#define ds_rindex(s, c) rindex ((s)->ds_string, c)
|
||||
+void ds_init (dynamic_string *string);
|
||||
+void ds_free (dynamic_string *string);
|
||||
+void ds_reset (dynamic_string *s, size_t len);
|
||||
|
||||
-void ds_init (dynamic_string *string, int size);
|
||||
-void ds_resize (dynamic_string *string, int size);
|
||||
+/* All functions below guarantee that s->ds_string[s->ds_idx] == '\0' */
|
||||
char *ds_fgetname (FILE *f, dynamic_string *s);
|
||||
char *ds_fgets (FILE *f, dynamic_string *s);
|
||||
char *ds_fgetstr (FILE *f, dynamic_string *s, char eos);
|
||||
+void ds_append (dynamic_string *s, int c);
|
||||
+void ds_concat (dynamic_string *s, char const *str);
|
||||
+
|
||||
+#define ds_len(s) ((s)->ds_idx)
|
||||
+
|
||||
+int ds_endswith (dynamic_string *s, int c);
|
||||
+
|
||||
diff --git a/src/util.c b/src/util.c
|
||||
index 996d4fa..ff2746d 100644
|
||||
--- a/src/util.c
|
||||
+++ b/src/util.c
|
||||
@@ -846,11 +846,9 @@ get_next_reel (int tape_des)
|
||||
FILE *tty_out; /* File for interacting with user. */
|
||||
int old_tape_des;
|
||||
char *next_archive_name;
|
||||
- dynamic_string new_name;
|
||||
+ dynamic_string new_name = DYNAMIC_STRING_INITIALIZER;
|
||||
char *str_res;
|
||||
|
||||
- ds_init (&new_name, 128);
|
||||
-
|
||||
/* Open files for interactive communication. */
|
||||
tty_in = fopen (TTY_NAME, "r");
|
||||
if (tty_in == NULL)
|
||||
@@ -925,7 +923,7 @@ get_next_reel (int tape_des)
|
||||
error (PAXEXIT_FAILURE, 0, _("internal error: tape descriptor changed from %d to %d"),
|
||||
old_tape_des, tape_des);
|
||||
|
||||
- free (new_name.ds_string);
|
||||
+ ds_free (&new_name);
|
||||
fclose (tty_in);
|
||||
fclose (tty_out);
|
||||
}
|
||||
--
|
||||
cgit v1.2.1
|
||||
|
||||
|
||||
https://git.savannah.gnu.org/cgit/cpio.git/commit/?id=dfc801c44a93bed7b3951905b188823d6a0432c8
|
||||
|
||||
author Sergey Poznyakoff <gray@gnu.org> 2021-08-11 18:10:38 +0300
|
||||
committer Sergey Poznyakoff <gray@gnu.org> 2021-08-11 18:10:38 +0300
|
||||
commit dfc801c44a93bed7b3951905b188823d6a0432c8 (patch)
|
||||
tree 3819af8593dc8beb29cb419e98691850947e425d
|
||||
parent dd96882877721703e19272fe25034560b794061b (diff)
|
||||
download cpio-dfc801c44a93bed7b3951905b188823d6a0432c8.tar.gz
|
||||
|
||||
Fix previous commit
|
||||
|
||||
* src/dstring.c (ds_reset,ds_concat): Don't call ds_resize in a
|
||||
loop.
|
||||
|
||||
diff --git a/src/dstring.c b/src/dstring.c
|
||||
index 692d3e7..b7e0bb5 100644
|
||||
--- a/src/dstring.c
|
||||
+++ b/src/dstring.c
|
||||
@@ -64,7 +64,7 @@ void
|
||||
ds_reset (dynamic_string *s, size_t len)
|
||||
{
|
||||
while (len > s->ds_size)
|
||||
- ds_resize (s);
|
||||
+ s->ds_string = x2nrealloc (s->ds_string, &s->ds_size, 1);
|
||||
s->ds_idx = len;
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ ds_concat (dynamic_string *s, char const *str)
|
||||
{
|
||||
size_t len = strlen (str);
|
||||
while (len + 1 > s->ds_size)
|
||||
- ds_resize (s);
|
||||
+ s->ds_string = x2nrealloc (s->ds_string, &s->ds_size, 1);
|
||||
memcpy (s->ds_string + s->ds_idx, str, len);
|
||||
s->ds_idx += len;
|
||||
s->ds_string[s->ds_idx] = 0;
|
||||
|
||||
|
||||
https://git.savannah.gnu.org/cgit/cpio.git/commit/?id=236684f6deb3178043fe72a8e2faca538fa2aae1
|
||||
|
||||
author Sergey Poznyakoff <gray@gnu.org> 2021-08-18 09:41:39 +0300
|
||||
committer Sergey Poznyakoff <gray@gnu.org> 2021-08-18 09:41:39 +0300
|
||||
commit 236684f6deb3178043fe72a8e2faca538fa2aae1 (patch)
|
||||
tree 55a49d2a190db2c4d0239cb66fa5d679962da0c5
|
||||
parent dfc801c44a93bed7b3951905b188823d6a0432c8 (diff)
|
||||
download cpio-236684f6deb3178043fe72a8e2faca538fa2aae1.tar.gz
|
||||
|
||||
Fix dynamic string reallocations
|
||||
|
||||
* src/dstring.c (ds_resize): Take additional argument: number of
|
||||
bytes to leave available after ds_idx. All uses changed.
|
||||
|
||||
|
||||
|
||||
diff --git a/src/dstring.c b/src/dstring.c
|
||||
index b7e0bb5..fd4e030 100644
|
||||
--- a/src/dstring.c
|
||||
+++ b/src/dstring.c
|
||||
@@ -49,9 +49,9 @@ ds_free (dynamic_string *string)
|
||||
/* Expand dynamic string STRING, if necessary. */
|
||||
|
||||
void
|
||||
-ds_resize (dynamic_string *string)
|
||||
+ds_resize (dynamic_string *string, size_t len)
|
||||
{
|
||||
- if (string->ds_idx == string->ds_size)
|
||||
+ while (len + string->ds_idx >= string->ds_size)
|
||||
{
|
||||
string->ds_string = x2nrealloc (string->ds_string, &string->ds_size,
|
||||
1);
|
||||
@@ -63,8 +63,7 @@ ds_resize (dynamic_string *string)
|
||||
void
|
||||
ds_reset (dynamic_string *s, size_t len)
|
||||
{
|
||||
- while (len > s->ds_size)
|
||||
- s->ds_string = x2nrealloc (s->ds_string, &s->ds_size, 1);
|
||||
+ ds_resize (s, len);
|
||||
s->ds_idx = len;
|
||||
}
|
||||
|
||||
@@ -86,10 +85,10 @@ ds_fgetstr (FILE *f, dynamic_string *s, char eos)
|
||||
/* Read the input string. */
|
||||
while ((next_ch = getc (f)) != eos && next_ch != EOF)
|
||||
{
|
||||
- ds_resize (s);
|
||||
+ ds_resize (s, 0);
|
||||
s->ds_string[s->ds_idx++] = next_ch;
|
||||
}
|
||||
- ds_resize (s);
|
||||
+ ds_resize (s, 0);
|
||||
s->ds_string[s->ds_idx] = '\0';
|
||||
|
||||
if (s->ds_idx == 0 && next_ch == EOF)
|
||||
@@ -101,12 +100,12 @@ ds_fgetstr (FILE *f, dynamic_string *s, char eos)
|
||||
void
|
||||
ds_append (dynamic_string *s, int c)
|
||||
{
|
||||
- ds_resize (s);
|
||||
+ ds_resize (s, 0);
|
||||
s->ds_string[s->ds_idx] = c;
|
||||
if (c)
|
||||
{
|
||||
s->ds_idx++;
|
||||
- ds_resize (s);
|
||||
+ ds_resize (s, 0);
|
||||
s->ds_string[s->ds_idx] = 0;
|
||||
}
|
||||
}
|
||||
@@ -115,8 +114,7 @@ void
|
||||
ds_concat (dynamic_string *s, char const *str)
|
||||
{
|
||||
size_t len = strlen (str);
|
||||
- while (len + 1 > s->ds_size)
|
||||
- s->ds_string = x2nrealloc (s->ds_string, &s->ds_size, 1);
|
||||
+ ds_resize (s, len);
|
||||
memcpy (s->ds_string + s->ds_idx, str, len);
|
||||
s->ds_idx += len;
|
||||
s->ds_string[s->ds_idx] = 0;
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"Signatures": {
|
||||
"cpio-2.13.tar.bz2": "eab5bdc5ae1df285c59f2a4f140a98fc33678a0bf61bdba67d9436ae26b46f6d"
|
||||
"cpio-2.14.tar.bz2": "fcdc15d60f7267a6fc7efcd6b9db7b6c8966c4f2fbbb964c24d41336fd3f2c12"
|
||||
}
|
||||
}
|
|
@ -1,15 +1,13 @@
|
|||
Summary: cpio-2.13
|
||||
Name: cpio
|
||||
Version: 2.13
|
||||
Release: 5%{?dist}
|
||||
Version: 2.14
|
||||
Release: 1%{?dist}
|
||||
License: GPLv3+
|
||||
Vendor: Microsoft Corporation
|
||||
Distribution: Mariner
|
||||
Group: System Environment/System utilities
|
||||
URL: https://www.gnu.org/software/cpio/
|
||||
Source0: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.bz2
|
||||
Patch0: cpio_extern_nocommon.patch
|
||||
Patch1: CVE-2021-38185.patch
|
||||
Conflicts: toybox
|
||||
|
||||
%description
|
||||
|
@ -60,6 +58,9 @@ make %{?_smp_mflags} check
|
|||
%defattr(-,root,root)
|
||||
|
||||
%changelog
|
||||
* Tue Nov 21 2023 Andrew Phelps <anphel@microsoft.com> - 2.14-1
|
||||
- Upgrade to version 2.14
|
||||
|
||||
* Wed Sep 20 2023 Jon Slobodzian <joslobo@microsoft.com> - 2.13-5
|
||||
- Recompile with stack-protection fixed gcc version (CVE-2023-4039)
|
||||
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
diff -ruN a/gnu/progname.c b/gnu/progname.c
|
||||
--- a/gnu/progname.c 2021-10-23 20:25:46.082351123 +0000
|
||||
+++ b/gnu/progname.c 2021-10-23 20:26:25.494246017 +0000
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
/* String containing name the program is called with.
|
||||
To be initialized by main(). */
|
||||
-const char *program_name = NULL;
|
||||
+extern const char *program_name = NULL;
|
||||
|
||||
/* Set program_name, based on argv[0].
|
||||
argv0 must be a string allocated with indefinite extent, and must not be
|
||||
diff -ruN a/src/global.c b/src/global.c
|
||||
--- a/src/global.c 2021-10-23 20:25:29.370395585 +0000
|
||||
+++ b/src/global.c 2021-10-23 20:26:10.494286060 +0000
|
||||
@@ -185,7 +185,7 @@
|
||||
bool to_stdout_option = false;
|
||||
|
||||
/* The name this program was run with. */
|
||||
-char *program_name;
|
||||
+extern char *program_name;
|
||||
|
||||
/* A pointer to either lstat or stat, depending on whether
|
||||
dereferencing of symlinks is done for input files. */
|
|
@ -955,8 +955,8 @@
|
|||
"type": "other",
|
||||
"other": {
|
||||
"name": "bash",
|
||||
"version": "5.2",
|
||||
"downloadUrl": "https://ftp.gnu.org/gnu/bash/bash-5.2.tar.gz"
|
||||
"version": "5.2.15",
|
||||
"downloadUrl": "https://ftp.gnu.org/gnu/bash/bash-5.2.15.tar.gz"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -1687,8 +1687,8 @@
|
|||
"type": "other",
|
||||
"other": {
|
||||
"name": "chkconfig",
|
||||
"version": "1.20",
|
||||
"downloadUrl": "https://github.com/fedora-sysv/chkconfig/archive/refs/tags/1.20.tar.gz"
|
||||
"version": "1.25",
|
||||
"downloadUrl": "https://github.com/fedora-sysv/chkconfig/archive/refs/tags/1.25.tar.gz"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -42,9 +42,9 @@ readline-8.2-1.cm2.aarch64.rpm
|
|||
readline-devel-8.2-1.cm2.aarch64.rpm
|
||||
coreutils-8.32-7.cm2.aarch64.rpm
|
||||
coreutils-lang-8.32-7.cm2.aarch64.rpm
|
||||
bash-5.1.8-4.cm2.aarch64.rpm
|
||||
bash-devel-5.1.8-4.cm2.aarch64.rpm
|
||||
bash-lang-5.1.8-4.cm2.aarch64.rpm
|
||||
bash-5.2.15-1.cm2.aarch64.rpm
|
||||
bash-devel-5.2.15-1.cm2.aarch64.rpm
|
||||
bash-lang-5.2.15-1.cm2.aarch64.rpm
|
||||
bzip2-1.0.8-1.cm2.aarch64.rpm
|
||||
bzip2-devel-1.0.8-1.cm2.aarch64.rpm
|
||||
bzip2-libs-1.0.8-1.cm2.aarch64.rpm
|
||||
|
@ -181,8 +181,8 @@ rpm-build-libs-4.18.0-4.cm2.aarch64.rpm
|
|||
rpm-devel-4.18.0-4.cm2.aarch64.rpm
|
||||
rpm-lang-4.18.0-4.cm2.aarch64.rpm
|
||||
rpm-libs-4.18.0-4.cm2.aarch64.rpm
|
||||
cpio-2.13-5.cm2.aarch64.rpm
|
||||
cpio-lang-2.13-5.cm2.aarch64.rpm
|
||||
cpio-2.14-1.cm2.aarch64.rpm
|
||||
cpio-lang-2.14-1.cm2.aarch64.rpm
|
||||
e2fsprogs-libs-1.46.5-3.cm2.aarch64.rpm
|
||||
libsolv-0.7.24-1.cm2.aarch64.rpm
|
||||
libsolv-devel-0.7.24-1.cm2.aarch64.rpm
|
||||
|
@ -247,8 +247,8 @@ libselinux-3.2-1.cm2.aarch64.rpm
|
|||
slang-2.3.2-4.cm2.aarch64.rpm
|
||||
newt-0.52.21-5.cm2.aarch64.rpm
|
||||
newt-lang-0.52.21-5.cm2.aarch64.rpm
|
||||
chkconfig-1.20-4.cm2.aarch64.rpm
|
||||
chkconfig-lang-1.20-4.cm2.aarch64.rpm
|
||||
chkconfig-1.25-1.cm2.aarch64.rpm
|
||||
chkconfig-lang-1.25-1.cm2.aarch64.rpm
|
||||
msopenjdk-11-11.0.20.1-1.aarch64.rpm
|
||||
pyproject-rpm-macros-1.0.0~rc1-4.cm2.noarch.rpm
|
||||
audit-3.1.2-1.cm2.aarch64.rpm
|
||||
|
|
|
@ -42,9 +42,9 @@ readline-8.2-1.cm2.x86_64.rpm
|
|||
readline-devel-8.2-1.cm2.x86_64.rpm
|
||||
coreutils-8.32-7.cm2.x86_64.rpm
|
||||
coreutils-lang-8.32-7.cm2.x86_64.rpm
|
||||
bash-5.1.8-4.cm2.x86_64.rpm
|
||||
bash-devel-5.1.8-4.cm2.x86_64.rpm
|
||||
bash-lang-5.1.8-4.cm2.x86_64.rpm
|
||||
bash-5.2.15-1.cm2.x86_64.rpm
|
||||
bash-devel-5.2.15-1.cm2.x86_64.rpm
|
||||
bash-lang-5.2.15-1.cm2.x86_64.rpm
|
||||
bzip2-1.0.8-1.cm2.x86_64.rpm
|
||||
bzip2-devel-1.0.8-1.cm2.x86_64.rpm
|
||||
bzip2-libs-1.0.8-1.cm2.x86_64.rpm
|
||||
|
@ -181,8 +181,8 @@ rpm-build-libs-4.18.0-4.cm2.x86_64.rpm
|
|||
rpm-devel-4.18.0-4.cm2.x86_64.rpm
|
||||
rpm-lang-4.18.0-4.cm2.x86_64.rpm
|
||||
rpm-libs-4.18.0-4.cm2.x86_64.rpm
|
||||
cpio-2.13-5.cm2.x86_64.rpm
|
||||
cpio-lang-2.13-5.cm2.x86_64.rpm
|
||||
cpio-2.14-1.cm2.x86_64.rpm
|
||||
cpio-lang-2.14-1.cm2.x86_64.rpm
|
||||
e2fsprogs-libs-1.46.5-3.cm2.x86_64.rpm
|
||||
libsolv-0.7.24-1.cm2.x86_64.rpm
|
||||
libsolv-devel-0.7.24-1.cm2.x86_64.rpm
|
||||
|
@ -247,8 +247,8 @@ libselinux-3.2-1.cm2.x86_64.rpm
|
|||
slang-2.3.2-4.cm2.x86_64.rpm
|
||||
newt-0.52.21-5.cm2.x86_64.rpm
|
||||
newt-lang-0.52.21-5.cm2.x86_64.rpm
|
||||
chkconfig-1.20-4.cm2.x86_64.rpm
|
||||
chkconfig-lang-1.20-4.cm2.x86_64.rpm
|
||||
chkconfig-1.25-1.cm2.x86_64.rpm
|
||||
chkconfig-lang-1.25-1.cm2.x86_64.rpm
|
||||
msopenjdk-11-11.0.20.1-1.x86_64.rpm
|
||||
pyproject-rpm-macros-1.0.0~rc1-4.cm2.noarch.rpm
|
||||
audit-3.1.2-1.cm2.x86_64.rpm
|
||||
|
|
|
@ -5,10 +5,10 @@ audit-devel-3.1.2-1.cm2.aarch64.rpm
|
|||
audit-libs-3.1.2-1.cm2.aarch64.rpm
|
||||
autoconf-2.71-3.cm2.noarch.rpm
|
||||
automake-1.16.5-1.cm2.noarch.rpm
|
||||
bash-5.1.8-4.cm2.aarch64.rpm
|
||||
bash-debuginfo-5.1.8-4.cm2.aarch64.rpm
|
||||
bash-devel-5.1.8-4.cm2.aarch64.rpm
|
||||
bash-lang-5.1.8-4.cm2.aarch64.rpm
|
||||
bash-5.2.15-1.cm2.aarch64.rpm
|
||||
bash-debuginfo-5.2.15-1.cm2.aarch64.rpm
|
||||
bash-devel-5.2.15-1.cm2.aarch64.rpm
|
||||
bash-lang-5.2.15-1.cm2.aarch64.rpm
|
||||
binutils-2.41-1.cm2.aarch64.rpm
|
||||
binutils-debuginfo-2.41-1.cm2.aarch64.rpm
|
||||
binutils-devel-2.41-1.cm2.aarch64.rpm
|
||||
|
@ -27,17 +27,17 @@ ccache-4.8.3-1.cm2.aarch64.rpm
|
|||
ccache-debuginfo-4.8.3-1.cm2.aarch64.rpm
|
||||
check-0.15.2-1.cm2.aarch64.rpm
|
||||
check-debuginfo-0.15.2-1.cm2.aarch64.rpm
|
||||
chkconfig-1.20-4.cm2.aarch64.rpm
|
||||
chkconfig-debuginfo-1.20-4.cm2.aarch64.rpm
|
||||
chkconfig-lang-1.20-4.cm2.aarch64.rpm
|
||||
chkconfig-1.25-1.cm2.aarch64.rpm
|
||||
chkconfig-debuginfo-1.25-1.cm2.aarch64.rpm
|
||||
chkconfig-lang-1.25-1.cm2.aarch64.rpm
|
||||
cmake-3.21.4-10.cm2.aarch64.rpm
|
||||
cmake-debuginfo-3.21.4-10.cm2.aarch64.rpm
|
||||
coreutils-8.32-7.cm2.aarch64.rpm
|
||||
coreutils-debuginfo-8.32-7.cm2.aarch64.rpm
|
||||
coreutils-lang-8.32-7.cm2.aarch64.rpm
|
||||
cpio-2.13-5.cm2.aarch64.rpm
|
||||
cpio-debuginfo-2.13-5.cm2.aarch64.rpm
|
||||
cpio-lang-2.13-5.cm2.aarch64.rpm
|
||||
cpio-2.14-1.cm2.aarch64.rpm
|
||||
cpio-debuginfo-2.14-1.cm2.aarch64.rpm
|
||||
cpio-lang-2.14-1.cm2.aarch64.rpm
|
||||
cracklib-2.9.7-5.cm2.aarch64.rpm
|
||||
cracklib-debuginfo-2.9.7-5.cm2.aarch64.rpm
|
||||
cracklib-devel-2.9.7-5.cm2.aarch64.rpm
|
||||
|
@ -270,7 +270,7 @@ ninja-build-debuginfo-1.10.2-2.cm2.aarch64.rpm
|
|||
npth-1.6-4.cm2.aarch64.rpm
|
||||
npth-debuginfo-1.6-4.cm2.aarch64.rpm
|
||||
npth-devel-1.6-4.cm2.aarch64.rpm
|
||||
ntsysv-1.20-4.cm2.aarch64.rpm
|
||||
ntsysv-1.25-1.cm2.aarch64.rpm
|
||||
openssl-1.1.1k-27.cm2.aarch64.rpm
|
||||
openssl-debuginfo-1.1.1k-27.cm2.aarch64.rpm
|
||||
openssl-devel-1.1.1k-27.cm2.aarch64.rpm
|
||||
|
|
|
@ -5,10 +5,10 @@ audit-devel-3.1.2-1.cm2.x86_64.rpm
|
|||
audit-libs-3.1.2-1.cm2.x86_64.rpm
|
||||
autoconf-2.71-3.cm2.noarch.rpm
|
||||
automake-1.16.5-1.cm2.noarch.rpm
|
||||
bash-5.1.8-4.cm2.x86_64.rpm
|
||||
bash-debuginfo-5.1.8-4.cm2.x86_64.rpm
|
||||
bash-devel-5.1.8-4.cm2.x86_64.rpm
|
||||
bash-lang-5.1.8-4.cm2.x86_64.rpm
|
||||
bash-5.2.15-1.cm2.x86_64.rpm
|
||||
bash-debuginfo-5.2.15-1.cm2.x86_64.rpm
|
||||
bash-devel-5.2.15-1.cm2.x86_64.rpm
|
||||
bash-lang-5.2.15-1.cm2.x86_64.rpm
|
||||
binutils-2.41-1.cm2.x86_64.rpm
|
||||
binutils-debuginfo-2.41-1.cm2.x86_64.rpm
|
||||
binutils-devel-2.41-1.cm2.x86_64.rpm
|
||||
|
@ -27,17 +27,17 @@ ccache-4.8.3-1.cm2.x86_64.rpm
|
|||
ccache-debuginfo-4.8.3-1.cm2.x86_64.rpm
|
||||
check-0.15.2-1.cm2.x86_64.rpm
|
||||
check-debuginfo-0.15.2-1.cm2.x86_64.rpm
|
||||
chkconfig-1.20-4.cm2.x86_64.rpm
|
||||
chkconfig-debuginfo-1.20-4.cm2.x86_64.rpm
|
||||
chkconfig-lang-1.20-4.cm2.x86_64.rpm
|
||||
chkconfig-1.25-1.cm2.x86_64.rpm
|
||||
chkconfig-debuginfo-1.25-1.cm2.x86_64.rpm
|
||||
chkconfig-lang-1.25-1.cm2.x86_64.rpm
|
||||
cmake-3.21.4-10.cm2.x86_64.rpm
|
||||
cmake-debuginfo-3.21.4-10.cm2.x86_64.rpm
|
||||
coreutils-8.32-7.cm2.x86_64.rpm
|
||||
coreutils-debuginfo-8.32-7.cm2.x86_64.rpm
|
||||
coreutils-lang-8.32-7.cm2.x86_64.rpm
|
||||
cpio-2.13-5.cm2.x86_64.rpm
|
||||
cpio-debuginfo-2.13-5.cm2.x86_64.rpm
|
||||
cpio-lang-2.13-5.cm2.x86_64.rpm
|
||||
cpio-2.14-1.cm2.x86_64.rpm
|
||||
cpio-debuginfo-2.14-1.cm2.x86_64.rpm
|
||||
cpio-lang-2.14-1.cm2.x86_64.rpm
|
||||
cracklib-2.9.7-5.cm2.x86_64.rpm
|
||||
cracklib-debuginfo-2.9.7-5.cm2.x86_64.rpm
|
||||
cracklib-devel-2.9.7-5.cm2.x86_64.rpm
|
||||
|
@ -270,7 +270,7 @@ ninja-build-debuginfo-1.10.2-2.cm2.x86_64.rpm
|
|||
npth-1.6-4.cm2.x86_64.rpm
|
||||
npth-debuginfo-1.6-4.cm2.x86_64.rpm
|
||||
npth-devel-1.6-4.cm2.x86_64.rpm
|
||||
ntsysv-1.20-4.cm2.x86_64.rpm
|
||||
ntsysv-1.25-1.cm2.x86_64.rpm
|
||||
openssl-1.1.1k-27.cm2.x86_64.rpm
|
||||
openssl-debuginfo-1.1.1k-27.cm2.x86_64.rpm
|
||||
openssl-devel-1.1.1k-27.cm2.x86_64.rpm
|
||||
|
|
Загрузка…
Ссылка в новой задаче