diff options
Diffstat (limited to 'patches/coreutils')
-rw-r--r-- | patches/coreutils/no-chown-cp.patch | 54 | ||||
-rw-r--r-- | patches/coreutils/uptime.patch | 42 |
2 files changed, 96 insertions, 0 deletions
diff --git a/patches/coreutils/no-chown-cp.patch b/patches/coreutils/no-chown-cp.patch new file mode 100644 index 00000000..7b68a140 --- /dev/null +++ b/patches/coreutils/no-chown-cp.patch @@ -0,0 +1,54 @@ +diff -ru coreutils-9.1.orig/src/copy.c coreutils-9.1/src/copy.c +--- coreutils-9.1.orig/src/copy.c 2022-04-15 15:53:28.000000000 +0200 ++++ coreutils-9.1/src/copy.c 2023-02-07 21:10:41.696869950 +0100 +@@ -859,6 +859,7 @@ + } + } + ++#if 0 + if (! chown_failure_ok (x)) + { + error (0, errno, _("failed to preserve ownership for %s"), +@@ -866,6 +867,7 @@ + if (x->require_preserve) + return -1; + } ++#endif + + return 0; + } +@@ -2877,6 +2879,7 @@ + if (x->preserve_security_context) + restore_default_fscreatecon_or_die (); + ++#if 0 + if (x->preserve_ownership) + { + /* Preserve the owner and group of the just-'copied' +@@ -2900,6 +2903,7 @@ + preserving owner/group is a potential security problem. */ + } + } ++#endif + } + else + { +diff -ru coreutils-9.1.orig/src/cp.c coreutils-9.1/src/cp.c +--- coreutils-9.1.orig/src/cp.c 2023-02-07 21:11:39.720870709 +0100 ++++ coreutils-9.1/src/cp.c 2023-02-07 21:06:22.167995788 +0100 +@@ -303,6 +303,7 @@ + } + } + ++#if 0 + if (x->preserve_ownership) + { + if (lchownat (dst_dirfd, src_name, p->st.st_uid, p->st.st_gid) != 0) +@@ -318,6 +319,7 @@ + ignore_value (lchownat (dst_dirfd, src_name, -1, p->st.st_gid)); + } + } ++#endif + + if (x->preserve_mode) + { diff --git a/patches/coreutils/uptime.patch b/patches/coreutils/uptime.patch new file mode 100644 index 00000000..2f2edcc0 --- /dev/null +++ b/patches/coreutils/uptime.patch @@ -0,0 +1,42 @@ +diff -ru coreutils-9.1.orig/src/uptime.c coreutils-9.1/src/uptime.c +--- coreutils-9.1.orig/src/uptime.c 2022-04-08 13:22:18.000000000 +0200 ++++ coreutils-9.1/src/uptime.c 2023-09-06 12:26:22.909930119 +0200 +@@ -30,6 +30,11 @@ + # include <OS.h> + #endif + ++#ifdef __midipix__ ++#undef sa_handler ++#include <ntapi/ntapi.h> ++#endif ++ + #include "c-strtod.h" + #include "die.h" + #include "error.h" +@@ -59,6 +64,26 @@ + struct tm *tmn; + double avg[3]; + int loads; ++#ifdef __midipix__ ++ ntapi_vtbl *__ntapi; ++ nt_system_time_of_day_information stodi; ++ ++ if((ntapi_init(&__ntapi)) == 0) ++ { ++ char buf[BUFSIZ]; ++ long long nt_time; ++ __ntapi->zw_query_system_information(NT_SYSTEM_TIME_OF_DAY_INFORMATION, &stodi, sizeof(stodi), NULL); ++ nt_time = (stodi.current_time.quad - stodi.boot_time.quad) / 100000ULL; ++ sprintf(buf, "%u.%02u", nt_time / 100, nt_time % 100); ++ { ++ char *end_ptr; ++ double upsecs = c_strtod (buf, &end_ptr); ++ if (buf != end_ptr) ++ uptime = (0 <= upsecs && upsecs < TYPE_MAXIMUM (time_t) ++ ? upsecs : -1); ++ } ++ } ++#endif + #ifdef HAVE_PROC_UPTIME + FILE *fp; + |