From: Antero Mejr via Guix-patches via <guix-patches@gnu.org>
To: Liliana Marie Prikler <liliana.prikler@gmail.com>
Cc: 62848@debbugs.gnu.org, maxim.cournoyer@gmail.com
Subject: [bug#62848] [PATCH 1/2] guix: Rename white-list to allow-list.
Date: Wed, 08 Nov 2023 15:19:37 +0000 [thread overview]
Message-ID: <87pm0kuvau.fsf_-_@mailbox.org> (raw)
In-Reply-To: <16e985a5a6cc331daecfb58a1a737e6c6f76fa32.camel@gmail.com> (Liliana Marie Prikler's message of "Wed, 08 Nov 2023 06:29:03 +0100")
* 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
next prev parent reply other threads:[~2023-11-08 15:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-15 1:44 [bug#62848] [PATCH] environment: Add --remote option and emacsclient-eshell backend Antero Mejr via Guix-patches via
2023-09-01 13:26 ` Maxim Cournoyer
2023-11-07 22:30 ` [bug#62848] [PATCH v2] " Antero Mejr via Guix-patches via
2023-11-08 5:29 ` Liliana Marie Prikler
2023-11-08 15:19 ` Antero Mejr via Guix-patches via [this message]
2023-11-08 15:21 ` [bug#62848] [PATCH 2/2] " Antero Mejr via Guix-patches via
2023-11-08 19:32 ` Liliana Marie Prikler
2023-11-08 15:34 ` [bug#62848] [PATCH v2] " Antero Mejr via Guix-patches via
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pm0kuvau.fsf_-_@mailbox.org \
--to=guix-patches@gnu.org \
--cc=62848@debbugs.gnu.org \
--cc=antero@mailbox.org \
--cc=liliana.prikler@gmail.com \
--cc=maxim.cournoyer@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.