coreutils: bump version

This commit is contained in:
Jérôme Duval
2025-01-18 14:46:42 +01:00
parent 67d6080f33
commit c4158a2002
2 changed files with 107 additions and 137 deletions

View File

@@ -17,10 +17,10 @@ uptime users vdir wc who whoami yes"
HOMEPAGE="https://www.gnu.org/software/coreutils/"
COPYRIGHT="1994-2017 Free Software Foundation, Inc."
LICENSE="GNU GPL v3"
REVISION="3"
REVISION="1"
SOURCE_URI="https://ftpmirror.gnu.org/coreutils/coreutils-$portVersion.tar.xz
https://ftp.gnu.org/gnu/coreutils/coreutils-$portVersion.tar.xz"
CHECKSUM_SHA256="adbcfcfe899235b71e8768dcf07cd532520b7f54f9a8064843f8d199a904bbaa"
CHECKSUM_SHA256="7a0124327b398fd9eb1a6abde583389821422c744ffa10734b24f557610d3283"
PATCHES="coreutils-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"

View File

@@ -1,11 +1,11 @@
From 8c27218d12e50d29143ee4478a649ab49ead6149 Mon Sep 17 00:00:00 2001
From fc5ef7ecc71c18aaa1da346409ebf53c91c756b7 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Tue, 13 May 2014 17:18:52 +0000
Subject: define __USE_GNU for wempcpy
diff --git a/lib/fnmatch.c b/lib/fnmatch.c
index 32cfb48..50ddd73 100644
index 0270bfd..36438dc 100644
--- a/lib/fnmatch.c
+++ b/lib/fnmatch.c
@@ -23,6 +23,9 @@
@@ -19,20 +19,20 @@ index 32cfb48..50ddd73 100644
#include <fnmatch.h>
--
2.37.3
2.45.2
From 85c5da8a71d0e1257bbb4f035172ddfb94ffb1e3 Mon Sep 17 00:00:00 2001
From f6c057508406f3c9b4328a001b4da19883597701 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Tue, 13 May 2014 17:22:10 +0000
Subject: force declaration of rpl_inet_ntop
diff --git a/lib/arpa_inet.in.h b/lib/arpa_inet.in.h
index 80e6713..3b47607 100644
index d7417bf..0a56cfe 100644
--- a/lib/arpa_inet.in.h
+++ b/lib/arpa_inet.in.h
@@ -78,7 +78,7 @@
@@ -130,7 +130,7 @@ ntohl (uint32_t value)
For more details, see the POSIX:2008 specification
<https://pubs.opengroup.org/onlinepubs/9699919799/functions/inet_ntop.html>. */
@@ -42,17 +42,17 @@ index 80e6713..3b47607 100644
# undef inet_ntop
# define inet_ntop rpl_inet_ntop
--
2.37.3
2.45.2
From 1474c5e6e8dfce8e7e9970b9c57d87e065d0ec49 Mon Sep 17 00:00:00 2001
From e903b1e42ee803c3a631ca37f5f580977675b341 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Tue, 13 May 2014 17:32:36 +0000
Subject: Haiku defines mknod in unistd.h
diff --git a/lib/mknod.c b/lib/mknod.c
index 688f0fb..e007e73 100644
index cc2dfe5..28a2c8c 100644
--- a/lib/mknod.c
+++ b/lib/mknod.c
@@ -18,6 +18,7 @@
@@ -64,20 +64,20 @@ index 688f0fb..e007e73 100644
#include <errno.h>
--
2.37.3
2.45.2
From 93de6ff9a879ab474397e516b04f3688864c44e7 Mon Sep 17 00:00:00 2001
From 99d0930da42fe64bd361ce81b9d86336b0e97eeb Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Tue, 13 May 2014 17:35:25 +0000
Subject: protect the label, not used on Haiku
diff --git a/lib/mountlist.c b/lib/mountlist.c
index 6d38481..80648a1 100644
index 3376b73..adcf779 100644
--- a/lib/mountlist.c
+++ b/lib/mountlist.c
@@ -1089,7 +1089,8 @@ read_file_system_list (bool need_fs_type)
@@ -1096,7 +1096,8 @@ read_file_system_list (bool need_fs_type)
return mount_list;
@@ -87,7 +87,7 @@ index 6d38481..80648a1 100644
{
int saved_errno = errno;
*mtail = NULL;
@@ -1104,6 +1105,7 @@ read_file_system_list (bool need_fs_type)
@@ -1111,6 +1112,7 @@ read_file_system_list (bool need_fs_type)
errno = saved_errno;
return NULL;
}
@@ -96,17 +96,17 @@ index 6d38481..80648a1 100644
/* Free a mount entry as returned from read_file_system_list (). */
--
2.37.3
2.45.2
From f77b2c1593a5845be6c584200405c0dd40b10f81 Mon Sep 17 00:00:00 2001
From 482ff403cd056190491d88b854d64da1f72afd60 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Thu, 15 May 2014 15:40:32 +0000
Subject: strchrnul needs __USE_GNU on Haiku
diff --git a/lib/regex.h b/lib/regex.h
index 9ef0252..6c453cf 100644
index 67a3aa7..079a3ce 100644
--- a/lib/regex.h
+++ b/lib/regex.h
@@ -30,8 +30,10 @@ extern "C" {
@@ -121,11 +121,11 @@ index 9ef0252..6c453cf 100644
#ifdef _REGEX_LARGE_OFFSETS
diff --git a/lib/string.in.h b/lib/string.in.h
index b6bf432..123822f 100644
index ce48829..241e4c7 100644
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -37,6 +37,9 @@
#define _GL_ALREADY_INCLUDING_STRING_H
#define _@GUARD_PREFIX@_ALREADY_INCLUDING_STRING_H
/* The include_next requires a split double-inclusion guard. */
+#ifndef __USE_GNU
@@ -133,22 +133,22 @@ index b6bf432..123822f 100644
+#endif
#@INCLUDE_NEXT@ @NEXT_STRING_H@
#undef _GL_ALREADY_INCLUDING_STRING_H
#undef _@GUARD_PREFIX@_ALREADY_INCLUDING_STRING_H
--
2.37.3
2.45.2
From 9c008dffc70a06fd44a8b02a699c07268f7dc45e Mon Sep 17 00:00:00 2001
From 80ba1951f510da7b2369df9c14ffdbdfa287459d Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Thu, 15 May 2014 20:13:58 +0000
Subject: don't build hostid, nice, users, who
diff --git a/Makefile.in b/Makefile.in
index f26504c..63091a2 100644
index 6a4294a..738b32b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1158,8 +1158,8 @@ CONFIG_CLEAN_FILES =
@@ -1206,8 +1206,8 @@ CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__EXEEXT_1 = src/arch$(EXEEXT) src/coreutils$(EXEEXT) \
src/hostname$(EXEEXT)
@@ -157,46 +157,29 @@ index f26504c..63091a2 100644
+am__EXEEXT_2 = src/chroot$(EXEEXT) src/df$(EXEEXT) \
+ src/libstdbuf.so$(EXEEXT) \
src/stdbuf$(EXEEXT) src/stty$(EXEEXT) src/timeout$(EXEEXT) \
src/uptime$(EXEEXT) src/users$(EXEEXT) src/who$(EXEEXT)
src/users$(EXEEXT) src/who$(EXEEXT)
am__EXEEXT_3 = src/[$(EXEEXT) src/b2sum$(EXEEXT) src/base64$(EXEEXT) \
@@ -6742,7 +6742,7 @@ WARN_ON_USE_H = $(top_srcdir)/lib/warn-on-use.h
@@ -7399,7 +7399,7 @@ WARN_ON_USE_H = $(top_srcdir)/lib/warn-on-use.h
# FIXME: once lib/ and gnulib-tests/ are also converted, hoist to Makefile.am
AM_CFLAGS = $(WERROR_CFLAGS)
no_install__progs = src/arch src/coreutils src/hostname
-build_if_possible__progs = src/chroot src/df src/hostid \
+build_if_possible__progs = src/chroot src/df \
src/libstdbuf.so src/nice src/pinky src/stdbuf src/stty \
src/timeout src/uptime src/users src/who
src/timeout src/users src/who
default__progs = src/[ src/b2sum src/base64 src/base32 src/basenc \
--
2.37.3
2.45.2
From fa32a4ac99ec0d27d279114a0416cd4852460ebe Mon Sep 17 00:00:00 2001
From d2b5acefca4416f95accdeb4ae391d46554c6b68 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 6 Feb 2015 20:24:12 +0000
Subject: import Haiku changes, fix warnings.
diff --git a/INSTALL b/INSTALL
index 6e3904a..a44e797 100644
--- a/INSTALL
+++ b/INSTALL
@@ -245,10 +245,10 @@ directory contains several dysfunctional programs; working variants of
these programs are available in /usr/bin. So, if you need /usr/ucb
in your PATH, put it _after_ /usr/bin.
- On Haiku, software installed for all users goes in /boot/common,
+ On Haiku, software installed for all users goes in /boot/system,
not /usr/local. It is recommended to use the following options:
- ./configure --prefix=/boot/common
+ ./configure --prefix=/boot/system
Specifying the System Type
==========================
diff --git a/lib/localcharset.c b/lib/localcharset.c
index 7ed9c95..ca6d890 100644
index 32f6f78..77d0076 100644
--- a/lib/localcharset.c
+++ b/lib/localcharset.c
@@ -41,6 +41,13 @@
@@ -214,7 +197,7 @@ index 7ed9c95..ca6d890 100644
#if !defined WINDOWS_NATIVE
diff --git a/src/copy.c b/src/copy.c
index 13d9332..af94f6b 100644
index 7ffb998..10e9740 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -18,6 +18,7 @@
@@ -222,10 +205,10 @@ index 13d9332..af94f6b 100644
#include <config.h>
#include <stdio.h>
+#include <unistd.h>
#include <assert.h>
#include <sys/ioctl.h>
#include <sys/types.h>
@@ -69,6 +70,10 @@
#include <selinux/selinux.h>
@@ -67,6 +68,10 @@
# define USE_XATTR false
#endif
@@ -236,7 +219,7 @@ index 13d9332..af94f6b 100644
#if USE_XATTR
# include <attr/error_context.h>
# include <attr/libattr.h>
@@ -697,6 +702,92 @@ is_ancestor (const struct stat *sb, const struct dir_list *ancestors)
@@ -689,6 +694,92 @@ is_ancestor (const struct stat *sb, const struct dir_list *ancestors)
return false;
}
@@ -329,7 +312,7 @@ index 13d9332..af94f6b 100644
static bool
errno_unsupported (int err)
{
@@ -840,6 +931,10 @@ copy_dir (char const *src_name_in, char const *dst_name_in,
@@ -832,6 +923,10 @@ copy_dir (char const *src_name_in, char const *dst_name_in,
error (0, errno, _("cannot access %s"), quoteaf (src_name_in));
return false;
}
@@ -340,7 +323,7 @@ index 13d9332..af94f6b 100644
/* For cp's -H option, dereference command line arguments, but do not
dereference symlinks that are found via recursive traversal. */
@@ -1533,6 +1628,11 @@ copy_reg (char const *src_name, char const *dst_name,
@@ -1529,6 +1624,11 @@ copy_reg (char const *src_name, char const *dst_name,
return_val = false;
goto close_src_and_dst_desc;
}
@@ -352,7 +335,7 @@ index 13d9332..af94f6b 100644
/* If extra permissions needed for copy_xattr didn't happen (e.g.,
due to umask) chmod to add them temporarily; if that fails give
@@ -2747,6 +2847,12 @@ skip:
@@ -2708,6 +2808,12 @@ skip:
true, x->verbose, dereference))
goto un_backup;
@@ -365,7 +348,7 @@ index 13d9332..af94f6b 100644
return true;
}
}
@@ -3177,6 +3283,11 @@ skip:
@@ -3159,6 +3265,11 @@ skip:
preserving owner/group is a potential security problem. */
}
}
@@ -378,10 +361,10 @@ index 13d9332..af94f6b 100644
else
{
diff --git a/src/copy.h b/src/copy.h
index ea5023c..f84c3e0 100644
index 35068ea..1c6fbd0 100644
--- a/src/copy.h
+++ b/src/copy.h
@@ -202,6 +202,9 @@ struct cp_options
@@ -208,6 +208,9 @@ struct cp_options
must be false. */
bool require_preserve;
@@ -392,10 +375,10 @@ index ea5023c..f84c3e0 100644
Set this only if the kernel is SELinux enabled. */
bool preserve_security_context;
diff --git a/src/cp.c b/src/cp.c
index 488770a..4251400 100644
index a0ec067..88dcf5a 100644
--- a/src/cp.c
+++ b/src/cp.c
@@ -61,6 +61,7 @@ struct dir_attr
@@ -60,6 +60,7 @@ struct dir_attr
enum
{
ATTRIBUTES_ONLY_OPTION = CHAR_MAX + 1,
@@ -404,14 +387,14 @@ index 488770a..4251400 100644
DEBUG_OPTION,
NO_PRESERVE_ATTRIBUTES_OPTION,
@@ -121,6 +122,7 @@ static struct option const long_opts[] =
{"debug", no_argument, NULL, DEBUG_OPTION},
{"dereference", no_argument, NULL, 'L'},
{"force", no_argument, NULL, 'f'},
+ {"ignore-attributes", no_argument, NULL, IGNORE_ATTRIBUTES},
{"interactive", no_argument, NULL, 'i'},
{"link", no_argument, NULL, 'l'},
{"no-clobber", no_argument, NULL, 'n'},
@@ -182,6 +184,7 @@ Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n\
{"debug", no_argument, nullptr, DEBUG_OPTION},
{"dereference", no_argument, nullptr, 'L'},
{"force", no_argument, nullptr, 'f'},
+ {"ignore-attributes", no_argument, nullptr, IGNORE_ATTRIBUTES},
{"interactive", no_argument, nullptr, 'i'},
{"link", no_argument, nullptr, 'l'},
{"no-clobber", no_argument, nullptr, 'n'}, /* Deprecated. */
@@ -185,6 +187,7 @@ Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n\
-f, --force if an existing destination file cannot be\n\
opened, remove it and try again (this option\n\
is ignored when the -n option is also used)\n\
@@ -419,7 +402,7 @@ index 488770a..4251400 100644
-i, --interactive prompt before overwrite (overrides a previous -n\
\n\
option)\n\
@@ -838,6 +841,7 @@ cp_option_init (struct cp_options *x)
@@ -855,6 +858,7 @@ cp_option_init (struct cp_options *x)
x->data_copy_required = true;
x->require_preserve = false;
x->recursive = false;
@@ -427,7 +410,7 @@ index 488770a..4251400 100644
x->sparse_mode = SPARSE_AUTO;
x->symbolic_link = false;
x->set_mode = false;
@@ -1043,6 +1047,10 @@ main (int argc, char **argv)
@@ -1061,6 +1065,10 @@ main (int argc, char **argv)
x.dereference = DEREF_COMMAND_LINE_ARGUMENTS;
break;
@@ -439,36 +422,36 @@ index 488770a..4251400 100644
x.interactive = I_ASK_USER;
break;
diff --git a/src/dircolors.h b/src/dircolors.h
index 88f6a6b..0e71dce 100644
index 76e42e2..702fbcc 100644
--- a/src/dircolors.h
+++ b/src/dircolors.h
@@ -71,7 +71,7 @@ static char const G_line[] =
'S','E','T','G','I','D',' ','3','0',';','4','3',' ','#',' ','f','i','l','e',' ','t','h','a','t',' ','i','s',' ','s','e','t','g','i','d',' ','(','g','+','s',')',0,
'C','A','P','A','B','I','L','I','T','Y',' ','0','0',' ','#',' ','f','i','l','e',' ','w','i','t','h',' ','c','a','p','a','b','i','l','i','t','y',' ','(','v','e','r','y',' ','e','x','p','e','n','s','i','v','e',' ','t','o',' ','l','o','o','k','u','p',')',0,
'S','E','T','G','I','D',' ','3','0',';','4','3',' ','#',' ','r','e','g','u','l','a','r',' ','f','i','l','e',' ','t','h','a','t',' ','i','s',' ','s','e','t','g','i','d',' ','(','g','+','s',')',0,
'C','A','P','A','B','I','L','I','T','Y',' ','0','0',' ','#',' ','r','e','g','u','l','a','r',' ','f','i','l','e',' ','w','i','t','h',' ','c','a','p','a','b','i','l','i','t','y',' ','(','v','e','r','y',' ','e','x','p','e','n','s','i','v','e',' ','t','o',' ','l','o','o','k','u','p',')',0,
'S','T','I','C','K','Y','_','O','T','H','E','R','_','W','R','I','T','A','B','L','E',' ','3','0',';','4','2',' ','#',' ','d','i','r',' ','t','h','a','t',' ','i','s',' ','s','t','i','c','k','y',' ','a','n','d',' ','o','t','h','e','r','-','w','r','i','t','a','b','l','e',' ','(','+','t',',','o','+','w',')',0,
- 'O','T','H','E','R','_','W','R','I','T','A','B','L','E',' ','3','4',';','4','2',' ','#',' ','d','i','r',' ','t','h','a','t',' ','i','s',' ','o','t','h','e','r','-','w','r','i','t','a','b','l','e',' ','(','o','+','w',')',' ','a','n','d',' ','n','o','t',' ','s','t','i','c','k','y',0,
+ 'O','T','H','E','R','_','W','R','I','T','A','B','L','E',' ','3','4',';','4','3',' ','#',' ','d','i','r',' ','t','h','a','t',' ','i','s',' ','o','t','h','e','r','-','w','r','i','t','a','b','l','e',' ','(','o','+','w',')',' ','a','n','d',' ','n','o','t',' ','s','t','i','c','k','y',0,
'S','T','I','C','K','Y',' ','3','7',';','4','4',' ','#',' ','d','i','r',' ','w','i','t','h',' ','t','h','e',' ','s','t','i','c','k','y',' ','b','i','t',' ','s','e','t',' ','(','+','t',')',' ','a','n','d',' ','n','o','t',' ','o','t','h','e','r','-','w','r','i','t','a','b','l','e',0,
'#',' ','T','h','i','s',' ','i','s',' ','f','o','r',' ','f','i','l','e','s',' ','w','i','t','h',' ','e','x','e','c','u','t','e',' ','p','e','r','m','i','s','s','i','o','n',':',0,
'#',' ','T','h','i','s',' ','i','s',' ','f','o','r',' ','r','e','g','u','l','a','r',' ','f','i','l','e','s',' ','w','i','t','h',' ','e','x','e','c','u','t','e',' ','p','e','r','m','i','s','s','i','o','n',':',0,
'E','X','E','C',' ','0','1',';','3','2',0,
diff --git a/src/dircolors.hin b/src/dircolors.hin
index 262e1b5..9441659 100644
index 0e4e321..ce2616e 100644
--- a/src/dircolors.hin
+++ b/src/dircolors.hin
@@ -74,7 +74,7 @@ SETUID 37;41 # file that is setuid (u+s)
SETGID 30;43 # file that is setgid (g+s)
CAPABILITY 00 # file with capability (very expensive to lookup)
@@ -74,7 +74,7 @@ SETUID 37;41 # regular file that is setuid (u+s)
SETGID 30;43 # regular file that is setgid (g+s)
CAPABILITY 00 # regular file with capability (very expensive to lookup)
STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w)
-OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky
+OTHER_WRITABLE 34;43 # dir that is other-writable (o+w) and not sticky
STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable
# This is for files with execute permission:
# This is for regular files with execute permission:
diff --git a/src/ls.c b/src/ls.c
index 71d94fd..9e4fb98 100644
index 3215360..83c2a88 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -720,6 +720,11 @@ static struct ignore_pattern *hide_patterns;
@@ -748,6 +748,11 @@ static struct ignore_pattern *hide_patterns;
want to mess up the terminal if control chars get sent to it, and some
quoting methods pass through control chars as-is. */
static bool qmark_funny_chars;
@@ -480,7 +463,7 @@ index 71d94fd..9e4fb98 100644
/* Quoting options for file and dir name output. */
@@ -4447,6 +4452,7 @@ print_long_format (const struct fileinfo *f)
@@ -4393,6 +4398,7 @@ print_long_format (const struct fileinfo *f)
p = buf;
}
@@ -488,7 +471,7 @@ index 71d94fd..9e4fb98 100644
if (f->stat_ok
&& (S_ISCHR (f->stat.st_mode) || S_ISBLK (f->stat.st_mode)))
{
@@ -4462,6 +4468,7 @@ print_long_format (const struct fileinfo *f)
@@ -4408,6 +4414,7 @@ print_long_format (const struct fileinfo *f)
umaxtostr (minor (f->stat.st_rdev), minorbuf));
}
else
@@ -497,10 +480,10 @@ index 71d94fd..9e4fb98 100644
char hbuf[LONGEST_HUMAN_READABLE + 1];
char const *size =
diff --git a/src/mv.c b/src/mv.c
index fc2bf77..b5eeb66 100644
index cf1ac56..4802224 100644
--- a/src/mv.c
+++ b/src/mv.c
@@ -142,6 +142,7 @@ cp_option_init (struct cp_options *x)
@@ -143,6 +143,7 @@ cp_option_init (struct cp_options *x)
x->reduce_diagnostics = false;
x->data_copy_required = true;
x->require_preserve = false; /* FIXME: maybe make this an option */
@@ -509,10 +492,10 @@ index fc2bf77..b5eeb66 100644
x->preserve_xattr = true;
x->require_preserve_xattr = false;
diff --git a/src/remove.c b/src/remove.c
index e1da19e..81cf9c8 100644
index 079b00f..18e6644 100644
--- a/src/remove.c
+++ b/src/remove.c
@@ -219,7 +219,7 @@ prompt (FTS const *fts, FTSENT const *ent, bool is_dir,
@@ -218,7 +218,7 @@ prompt (FTS const *fts, FTSENT const *ent, bool is_dir,
wp_errno = errno;
}
@@ -522,7 +505,7 @@ index e1da19e..81cf9c8 100644
if (0 <= write_protected && dirent_type == DT_UNKNOWN)
{
diff --git a/src/uname.c b/src/uname.c
index 921a881..10cfedb 100644
index 96c532b..63067e9 100644
--- a/src/uname.c
+++ b/src/uname.c
@@ -44,6 +44,10 @@
@@ -534,8 +517,8 @@ index 921a881..10cfedb 100644
+#endif
+
#include "system.h"
#include "die.h"
#include "error.h"
#include "quote.h"
#include "uname.h"
@@ -341,6 +345,30 @@ main (int argc, char **argv)
element = processor;
}
@@ -568,10 +551,10 @@ index 921a881..10cfedb 100644
print_element (element);
}
--
2.37.3
2.45.2
From 4e2fcb246b9ae5a417af873f938d6f4a954ab0b1 Mon Sep 17 00:00:00 2001
From 3cbbd1a375e0b9e64ad21bbb1bb0959ab3929f25 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Mon, 1 Nov 2021 21:08:55 +0100
Subject: ln: handle negative errno
@@ -579,10 +562,10 @@ Subject: ln: handle negative errno
explicit check for -1 which is a special value in this code.
diff --git a/src/copy.c b/src/copy.c
index af94f6b..480da37 100644
index 10e9740..33c145c 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -2225,7 +2225,7 @@ create_hard_link (char const *src_name, int src_dirfd, char const *src_relname,
@@ -2222,7 +2222,7 @@ create_hard_link (char const *src_name, int src_dirfd, char const *src_relname,
int err = force_linkat (src_dirfd, src_relname, dst_dirfd, dst_relname,
dereference ? AT_SYMLINK_FOLLOW : 0,
replace, -1);
@@ -590,8 +573,8 @@ index af94f6b..480da37 100644
+ if (err != 0 && err != -1)
{
char *a_src_name = NULL;
@@ -2237,7 +2237,7 @@ create_hard_link (char const *src_name, int src_dirfd, char const *src_relname,
char *a_src_name = nullptr;
@@ -2234,7 +2234,7 @@ create_hard_link (char const *src_name, int src_dirfd, char const *src_relname,
free (a_src_name);
return false;
}
@@ -600,7 +583,7 @@ index af94f6b..480da37 100644
printf (_("removed %s\n"), quoteaf (dst_name));
return true;
}
@@ -3146,7 +3146,7 @@ skip:
@@ -3127,7 +3127,7 @@ skip:
int err = force_symlinkat (src_name, dst_dirfd, dst_relname,
x->unlink_dest_after_failed_open, -1);
@@ -609,17 +592,16 @@ index af94f6b..480da37 100644
{
error (0, err, _("cannot create symbolic link %s to %s"),
quoteaf_n (0, dst_name), quoteaf_n (1, src_name));
@@ -3233,7 +3233,8 @@ skip:
@@ -3214,7 +3214,7 @@ skip:
int symlink_err = force_symlinkat (src_link_val, dst_dirfd, dst_relname,
x->unlink_dest_after_failed_open, -1);
- if (0 < symlink_err && x->update && !new_dst && S_ISLNK (dst_sb.st_mode)
+ if (symlink_err != 0 && symlink_err != -1 && x->update && !new_dst
+ && S_ISLNK (dst_sb.st_mode)
- if (0 < symlink_err && x->update == UPDATE_OLDER
+ if (symlink_err != 0 && symlink_err != -1 && x->update == UPDATE_OLDER
&& !new_dst && S_ISLNK (dst_sb.st_mode)
&& dst_sb.st_size == strlen (src_link_val))
{
/* See if the destination is already the desired symlink.
@@ -3250,7 +3251,7 @@ skip:
@@ -3232,7 +3232,7 @@ skip:
}
}
free (src_link_val);
@@ -629,10 +611,10 @@ index af94f6b..480da37 100644
error (0, symlink_err, _("cannot create symbolic link %s"),
quoteaf (dst_name));
diff --git a/src/ln.c b/src/ln.c
index 1c3307c..653db04 100644
index 76ffc49..2e5a143 100644
--- a/src/ln.c
+++ b/src/ln.c
@@ -154,7 +154,7 @@ convert_abs_rel (char const *from, char const *target)
@@ -152,7 +152,7 @@ convert_abs_rel (char const *from, char const *target)
/* Link SOURCE to DESTDIR_FD + DEST_BASE atomically. DESTDIR_FD is
the directory containing DEST_BASE. Return 0 if successful, a
@@ -641,16 +623,16 @@ index 1c3307c..653db04 100644
done. This handles the common case where the destination does not
already exist and -r is not specified. */
@@ -185,7 +185,7 @@ do_link (char const *source, int destdir_fd, char const *dest_base,
char *backup_base = NULL;
char *rel_source = NULL;
@@ -183,7 +183,7 @@ do_link (char const *source, int destdir_fd, char const *dest_base,
char *backup_base = nullptr;
char *rel_source = nullptr;
int nofollow_flag = logical ? 0 : AT_SYMLINK_NOFOLLOW;
- if (link_errno < 0)
+ if (link_errno == -1)
link_errno = atomic_link (source, destdir_fd, dest_base);
/* Get SOURCE_STATS if later code will need it, if only for sharper
@@ -272,7 +272,7 @@ do_link (char const *source, int destdir_fd, char const *dest_base,
@@ -270,7 +270,7 @@ do_link (char const *source, int destdir_fd, char const *dest_base,
}
}
@@ -659,7 +641,7 @@ index 1c3307c..653db04 100644
{
if (interactive)
{
@@ -338,7 +338,7 @@ do_link (char const *source, int destdir_fd, char const *dest_base,
@@ -336,7 +336,7 @@ do_link (char const *source, int destdir_fd, char const *dest_base,
required removing the destination first. */
}
@@ -668,7 +650,7 @@ index 1c3307c..653db04 100644
{
/* Right after creating a hard link, do this: (note dest name and
source_stats, which are also the just-linked-destinations stats) */
@@ -393,7 +393,7 @@ do_link (char const *source, int destdir_fd, char const *dest_base,
@@ -391,7 +391,7 @@ do_link (char const *source, int destdir_fd, char const *dest_base,
free (backup_base);
free (rel_source);
@@ -678,45 +660,33 @@ index 1c3307c..653db04 100644
fail:
free (rel_source);
--
2.37.3
2.45.2
From 466cdffa0a76ea5acebc9167c9bb7a10dd04969e Mon Sep 17 00:00:00 2001
From d556560e8b6a7fc6f95ae95b3ce229c9f0b3ff8c Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Tue, 16 Nov 2021 10:22:30 +0100
Subject: uptime: make utmp error not critical
diff --git a/src/uptime.c b/src/uptime.c
index 061b85c..8b94aa2 100644
index 63b3551..5437116 100644
--- a/src/uptime.c
+++ b/src/uptime.c
@@ -105,7 +105,7 @@ print_uptime (size_t n, const STRUCT_UTMP *this)
#if HAVE_STRUCT_UTMP_UT_TYPE || HAVE_STRUCT_UTMPX_UT_TYPE
@@ -45,7 +45,7 @@ print_uptime (idx_t n, struct gl_utmp const *utmp_buf)
/* Loop through all the utmp entries we just read and count up the valid
ones, also in the process possibly gleaning boottime. */
- while (n--)
+ while (this && n--)
idx_t entries = 0;
- for (idx_t i = 0; i < n; i++)
+ for (idx_t i = 0; utmp_buf && i < n; i++)
{
struct gl_utmp const *this = &utmp_buf[i];
entries += IS_USER_PROCESS (this);
if (UT_TYPE_BOOT_TIME (this))
@@ -181,7 +181,11 @@ uptime (char const *filename, int options)
#if HAVE_STRUCT_UTMP_UT_TYPE || HAVE_STRUCT_UTMPX_UT_TYPE
if (read_utmp (filename, &n_users, &utmp_buf, options) != 0)
+#if HAVE_OS_H
+ ;
+#else
die (EXIT_FAILURE, errno, "%s", quotef (filename));
+#endif
#endif
print_uptime (n_users, utmp_buf);
--
2.37.3
2.45.2
From 94a6b6e0d965407db1e8335749ebf8a8938ec701 Mon Sep 17 00:00:00 2001
From 63e542c0689d44ca86430ed69a0a60a68581157d Mon Sep 17 00:00:00 2001
From: PulkoMandy <pulkomandy@pulkomandy.tk>
Date: Fri, 30 Jun 2023 20:14:30 +0200
Subject: stty: fix sign extension in check_speed
@@ -726,10 +696,10 @@ expansion. So, if you set a speed_t to -1, it is converted to 255 and
doesn't compare equal to -1.
diff --git a/src/stty.c b/src/stty.c
index 607a4e7..3bc0143 100644
index 133b33c..f19f4b5 100644
--- a/src/stty.c
+++ b/src/stty.c
@@ -2088,7 +2088,7 @@ display_all (struct termios *mode, char const *device_name)
@@ -2076,7 +2076,7 @@ display_all (struct termios *mode, char const *device_name)
static void
check_speed (struct termios *mode)
{
@@ -739,5 +709,5 @@ index 607a4e7..3bc0143 100644
if (cfgetispeed (mode) != last_ibaud
|| cfgetospeed (mode) != last_obaud)
--
2.37.3
2.45.2