[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#62848] [PATCH 1/2] guix: Rename white-list to allow-list.
From: |
Antero Mejr |
Subject: |
[bug#62848] [PATCH 1/2] guix: Rename white-list to allow-list. |
Date: |
Wed, 08 Nov 2023 15:19:37 +0000 |
* guix/profiles.scm (purify-environment): Rename white-list-regexps to
allow-list-regexps. Rename white-list to allow-list.
(load-profile): Rename #:white-list-regexps to #:allow-list-regexps.
* guix/scripts/environment.scm (launch-environment): Rename
(launch-environment/fork): Rename #:white-list-regexps to
(launch-environment/container): Rename #:white-list-regexps to
(guix-environment*): Rename white-list to allow-list.
* tests/profiles.scm (load-profile): Rename #:white-list to #:allow-list in
load-profile procedure call.
---
guix/profiles.scm | 18 +++++++++---------
guix/scripts/environment.scm | 24 ++++++++++++------------
tests/profiles.scm | 2 +-
3 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/guix/profiles.scm b/guix/profiles.scm
index 5d2fb8dc64..380f42c5a1 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -2103,32 +2103,32 @@ (define* (profile-search-paths profile
(list profile) getenv))
(define %precious-variables
- ;; Environment variables in the default 'load-profile' white list.
+ ;; Environment variables in the default 'load-profile' allow list.
'("HOME" "USER" "LOGNAME" "DISPLAY" "XAUTHORITY" "TERM" "TZ" "PAGER"))
-(define (purify-environment white-list white-list-regexps)
+(define (purify-environment allow-list allow-list-regexps)
"Unset all environment variables except those that match the regexps in
-WHITE-LIST-REGEXPS and those listed in WHITE-LIST."
+ALLOW-LIST-REGEXPS and those listed in ALLOW-LIST."
(for-each unsetenv
(remove (lambda (variable)
- (or (member variable white-list)
+ (or (member variable allow-list)
(find (cut regexp-exec <> variable)
- white-list-regexps)))
+ allow-list-regexps)))
(match (get-environment-variables)
(((names . _) ...)
names)))))
(define* (load-profile profile
#:optional (manifest (profile-manifest profile))
- #:key pure? (white-list-regexps '())
- (white-list %precious-variables))
+ #:key pure? (allow-list-regexps '())
+ (allow-list %precious-variables))
"Set the environment variables specified by MANIFEST for PROFILE. When
PURE? is #t, unset the variables in the current environment except those that
-match the regexps in WHITE-LIST-REGEXPS and those listed in WHITE-LIST.
+match the regexps in ALLOW-LIST-REGEXPS and those listed in ALLOW-LIST.
Otherwise, augment existing environment variables with additional search
paths."
(when pure?
- (purify-environment white-list white-list-regexps))
+ (purify-environment allow-list allow-list-regexps))
(for-each (match-lambda
((($ <search-path-specification> variable _ separator) . value)
(let ((current (getenv variable)))
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index 6ae3b11e39..e1ab66c9ed 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -485,18 +485,18 @@ (define exit/status (compose exit status->exit-code))
(define primitive-exit/status (compose primitive-exit status->exit-code))
(define* (launch-environment command profile manifest
- #:key pure? (white-list '())
+ #:key pure? (allow-list '())
emulate-fhs?)
"Load the environment of PROFILE, which corresponds to MANIFEST, and execute
COMMAND. When PURE?, pre-existing environment variables are cleared before
-setting the new ones, except those matching the regexps in WHITE-LIST. When
+setting the new ones, except those matching the regexps in ALLOW-LIST. When
EMULATE-FHS?, first set up an FHS environment with $PATH and generate the LD
cache."
;; Properly handle SIGINT, so pressing C-c in an interactive terminal
;; application works.
(sigaction SIGINT SIG_DFL)
(load-profile profile manifest
- #:pure? pure? #:white-list-regexps white-list)
+ #:pure? pure? #:allow-list-regexps allow-list)
;; Give users a way to know that they're in 'guix environment', so they can
;; adjust 'PS1' accordingly, for instance. Set it to PROFILE so users can
@@ -706,15 +706,15 @@ (define (suggest-command-name profile command)
closest))))))))
(define* (launch-environment/fork command profile manifest
- #:key pure? (white-list '()))
+ #:key pure? (allow-list '()))
"Run COMMAND in a new process with an environment containing PROFILE, with
the search paths specified by MANIFEST. When PURE?, pre-existing environment
variables are cleared before setting the new ones, except those matching the
-regexps in WHITE-LIST."
+regexps in ALLOW-LIST."
(match (primitive-fork)
(0 (launch-environment command profile manifest
#:pure? pure?
- #:white-list white-list))
+ #:allow-list allow-list))
(pid (match (waitpid pid)
((_ . status)
status)))))
@@ -723,7 +723,7 @@ (define* (launch-environment/container #:key command bash
user user-mappings
profile manifest link-profile? network?
map-cwd? emulate-fhs? nesting?
(setup-hook #f)
- (symlinks '()) (white-list '()))
+ (symlinks '()) (allow-list '()))
"Run COMMAND within a container that features the software in PROFILE.
Environment variables are set according to the search paths of MANIFEST. The
global shell is BASH, a file name for a GNU Bash binary in the store. When
@@ -818,7 +818,7 @@ (define* (launch-environment/container #:key command bash
user user-mappings
(environ (filter (match-lambda
((variable . value)
(find (cut regexp-exec <> variable)
- white-list)))
+ allow-list)))
(get-environment-variables)))
;; Bind-mount all requisite store items, user-specified mappings,
;; /bin/sh, the current working directory, and possibly networking
@@ -931,7 +931,7 @@ (define* (launch-environment/container #:key command bash
user user-mappings
(override-user-dir user home cwd)
home-dir))
- ;; Set environment variables that match WHITE-LIST.
+ ;; Set environment variables that match ALLOW-LIST.
(for-each (match-lambda
((variable . value)
(setenv variable value)))
@@ -1090,7 +1090,7 @@ (define (guix-environment* opts)
'("/bin/sh")
(list %default-shell))))
(mappings (pick-all opts 'file-system-mapping))
- (white-list (pick-all opts 'inherit-regexp)))
+ (allow-list (pick-all opts 'inherit-regexp)))
(define store-needed?
;; Whether connecting to the daemon is needed.
@@ -1203,7 +1203,7 @@ (define (guix-environment* opts)
#:user-mappings mappings
#:profile profile
#:manifest manifest
- #:white-list white-list
+ #:allow-list allow-list
#:link-profile? link-prof?
#:network? network?
#:map-cwd? (not no-cwd?)
@@ -1218,7 +1218,7 @@ (define (guix-environment* opts)
(return
(exit/status
(launch-environment/fork command profile manifest
- #:white-list white-list
+ #:allow-list allow-list
#:pure? pure?)))))))))))))
;;; Local Variables:
diff --git a/tests/profiles.scm b/tests/profiles.scm
index 9c419ada93..1e134f5105 100644
--- a/tests/profiles.scm
+++ b/tests/profiles.scm
@@ -367,7 +367,7 @@ (define glibc
(getenv "PATH"))
(getenv "GUILE_LOAD_PATH")))
(with-environment-excursion
- (load-profile profile #:pure? #t #:white-list '())
+ (load-profile profile #:pure? #t #:allow-list '())
(equal? (list (string-append "PATH=" bindir))
(environ)))))))
base-commit: 220759226e93d76d8d80058f69f9d8b29714bbde
--
2.41.0