diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2009-11-20 16:00:06 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2009-11-25 09:01:30 +0200 |
commit | f6ff66d8e77efe3a33d94b98db3a6640872afe5b (patch) | |
tree | 30e4a172ef96b11bdb5cad42d1af56fdcc47a6b3 | |
parent | 48dec7beba0068367e7622192d62729c688d753e (diff) | |
download | rpm-f6ff66d8e77efe3a33d94b98db3a6640872afe5b.tar.gz |
Error out early trying to install on readonly fs (ticket #99, RhBug:464750)
- simply make readonly filesystems appear as full, preventing install
early instead of failing with cpio errors in middle of transaction
(cherry picked from commit 5e26a8be7193a90612d800eadba46b417c1d4944)
-rw-r--r-- | lib/rpmts.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rpmts.c b/lib/rpmts.c index e696589ce..b94b43a22 100644 --- a/lib/rpmts.c +++ b/lib/rpmts.c @@ -829,7 +829,7 @@ int rpmtsInitDSI(const rpmts ts) dsi->bneeded = 0; dsi->ineeded = 0; #ifdef STATFS_HAS_F_BAVAIL - dsi->bavail = sfb.f_bavail; + dsi->bavail = (sfb.f_flag & ST_RDONLY) ? 0 : sfb.f_bavail; #else /* FIXME: the statfs struct doesn't have a member to tell how many blocks are * available for non-superusers. f_blocks - f_bfree is probably too big, but |