diff options
author | Nagy Gabor <ngaba@bibl.u-szeged.hu> | 2009-05-16 17:59:45 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2009-06-02 05:01:04 +0200 |
commit | f4ecc908eccc3ace2e40b15be837e4fa44ecf0a0 (patch) | |
tree | ce82bf945d8dd4a3105890ad3773f7fcd3ab875c /src/pacman/pacman.c | |
parent | c520d3845113ce4dc1a473c012288da7f2a655b8 (diff) | |
download | pacman-f4ecc908eccc3ace2e40b15be837e4fa44ecf0a0.tar.gz pacman-f4ecc908eccc3ace2e40b15be837e4fa44ecf0a0.tar.xz |
We don't need root with -Sp
FS#8905 is fixed. The front-end passes PM_TRANS_FLAG_NOLOCK to the back-end,
so it doesn't lock the database. That's why we don't need root anymore.
I reworked (and renamed) needs_transaction() accordingly. I also added
missing -Sc check there (for example, -Sci didn't print non-root error, but
pacman wanted to lock the database).
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman/pacman.c')
-rw-r--r-- | src/pacman/pacman.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index c542a989..3f5384ca 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -481,6 +481,7 @@ static int parseargs(int argc, char *argv[]) config->op_q_isfile = 1; config->op_s_printuris = 1; config->flags |= PM_TRANS_FLAG_NOCONFLICTS; + config->flags |= PM_TRANS_FLAG_NOLOCK; break; case 'q': config->quiet = 1; @@ -900,7 +901,7 @@ int main(int argc, char *argv[]) #if defined(HAVE_GETEUID) && !defined(CYGWIN) /* check if we have sufficient permission for the requested operation */ - if(myuid > 0 && needs_transaction()) { + if(myuid > 0 && needs_root()) { pm_printf(PM_LOG_ERROR, _("you cannot perform this operation unless you are root.\n")); cleanup(EXIT_FAILURE); } |