summaryrefslogtreecommitdiff
path: root/src/pacman/pacman.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pacman/pacman.c')
-rw-r--r--src/pacman/pacman.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index c57d3464..74493986 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -775,7 +775,9 @@ int main(int argc, char *argv[])
#if defined(HAVE_GETEUID)
/* check if we have sufficient permission for the requested operation */
- if(myuid > 0 && needs_transaction()) {
+ if(myuid > 0 && !strcmp(alpm_option_get_root(), "/") && needs_transaction()) {
+ /* special case: ignore root user check if -r is specified, fall back on
+ * normal FS checking */
pm_printf(PM_LOG_ERROR, _("you cannot perform this operation unless you are root.\n"));
cleanup(EXIT_FAILURE);
}