diff options
author | Dan McGee <dan@archlinux.org> | 2011-08-19 13:10:17 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-08-19 13:10:17 -0500 |
commit | e07547ee4ed4fd812a7f50b998589fa27c12de4c (patch) | |
tree | 4ab4b3869e7e3cf1ab6bf96e954beea4ab9de276 /lib/libalpm/po | |
parent | 6d544984f2418ea34caab4c433580487b760362a (diff) | |
download | pacman-e07547ee4ed4fd812a7f50b998589fa27c12de4c.tar.xz |
Rework finding a writable cache directory
This is a refactor and refresh of the code used to find where we should
download packages.
* Incorporate suggestions from FS#25435 to use TMPDIR from the
environment if set, otherwise fall back to /tmp as before.
* Make the writability tests a bit more in depth. We now do a three part
check consisting of:
- S_ISDIR(): is this even a directory
- access(W_OK): is this directory writable by the current user.
Unfortunately for root, this almost always returns that it is, but
in the case of a RO mount or NFS share inaccessible to root, this
check will exclude the directory.
- mode & (any write bit): is there a writable bit set on this
directory. This makes it possible to enforce a read-only cache
directory by setting permissions to 0555, for example.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/po')
0 files changed, 0 insertions, 0 deletions