summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2024-02-29 00:05:11 -0800
committerAllan McRae <allan@archlinux.org>2024-03-04 01:33:51 +0000
commit9f6c0817719edc9eb0618ce6dcbeb4bebf57d6ee (patch)
tree374a7bebec630dc7cd9bcbb1a0ec72ffea28ac01 /src
parentcddad6fccdbaafe5b1985891ed019c6dbb7a35c0 (diff)
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 <andrew.gregory.8@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/conf.c4
1 files changed, 1 insertions, 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;
}