From 9f6c0817719edc9eb0618ce6dcbeb4bebf57d6ee Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Thu, 29 Feb 2024 00:05:11 -0800 Subject: [PATCH] conf: do not default sysroot to / Setting sysroot to / is not the same as having no sysroot, because the sysroot is prepended to ALL config paths including relative ones: $ cd /etc $ pacman --config=pacman.conf error: config file /pacman.conf could not be read: No such file or directory Signed-off-by: Andrew Gregory --- src/pacman/conf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pacman/conf.c b/src/pacman/conf.c index 7a92bf8f..207ebf7a 100644 --- a/src/pacman/conf.c +++ b/src/pacman/conf.c @@ -108,7 +108,6 @@ config_t *config_new(void) newconfig->op = PM_OP_MAIN; newconfig->logmask = ALPM_LOG_ERROR | ALPM_LOG_WARNING; newconfig->configfile = strdup(CONFFILE); - newconfig->sysroot = strdup("/"); if(alpm_capabilities() & ALPM_CAPABILITY_SIGNATURES) { newconfig->siglevel = ALPM_SIG_PACKAGE | ALPM_SIG_PACKAGE_OPTIONAL | ALPM_SIG_DATABASE | ALPM_SIG_DATABASE_OPTIONAL; @@ -1257,8 +1256,7 @@ static int prepend_sysroot(config_t *c) { alpm_list_t *i; - if(c->sysroot == NULL || c->sysroot[0] == '\0' - || strcmp(c->sysroot, "/") == 0) { + if(c->sysroot == NULL) { return 0; }