0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-02-22 16:57:09 +00:00
2023-09-16 04:42:50 +01:00

15 lines
583 B
Diff

diff -uNr coreutils-9.4/src/date.c coreutils-9.4.mod/src/date.c
--- coreutils-9.4/src/date.c 2023-07-05 12:09:55.000000000 +0100
+++ coreutils-9.4.mod/src/date.c 2023-09-12 18:13:27.556340784 +0100
@@ -633,6 +633,10 @@
if (set_date)
{
+ if (getuid() != 0)
+ {
+ error (EXIT_FAILURE, 0, "only root user can change date/time");
+ }
/* Set the system clock to the specified date, then regardless of
the success of that operation, format and print that date. */
if (settime (&when) != 0)