summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorjgart <jgart@dismail.de>2026-04-12 09:02:55 -0400
committerjgart <jgart@dismail.de>2026-04-15 17:56:23 -0400
commit0d11c221b8063d8db85a0353f702fc19f9a9efeb (patch)
treeadbb7f0590db7eb2af29ed86bd203cfb8f55efd6 /guix
parent6abb7bc42234fd2c0dfe67b5de80dd609625ecb9 (diff)
guix: scripts: gc: Give better error reporting when attempting to vacuum.
* guix/scripts/gc.scm (%options): Error out when a non-root user tries to vacuum the database. Change-Id: Iee7d626c43980640aa91a3ceeb95675016932c55 Signed-off-by: jgart <jgart@dismail.de>
Diffstat (limited to 'guix')
-rw-r--r--guix/scripts/gc.scm4
1 files changed, 4 insertions, 0 deletions
diff --git a/guix/scripts/gc.scm b/guix/scripts/gc.scm
index c5017a6e52..11d1a00fe6 100644
--- a/guix/scripts/gc.scm
+++ b/guix/scripts/gc.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2012-2013, 2015-2020, 2022, 2025 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2022 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2022 Remco van 't Veer <remco@remworks.net>
+;;; Copyright © 2026 jgart <jgart@dismail.de>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -140,6 +141,9 @@ current one."
(option '("vacuum-database") #f #f
(lambda args
+ (unless (zero? (getuid))
+ (leave
+ (G_ "vacuuming the database can only be used by root~%")))
(vacuum-database)
(exit 0)))