1
0
mirror of https://github.com/moparisthebest/pacman synced 2025-03-02 10:21:49 -05:00
Dan McGee e07547ee4e 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>
2011-08-19 13:10:17 -05:00
..
2011-08-15 16:09:45 -05:00
2011-08-19 11:09:57 -05:00
2011-06-28 14:04:00 +10:00
2011-07-02 02:01:39 +10:00
2011-08-15 06:24:49 -05:00
2011-08-15 06:24:49 -05:00
2011-08-19 11:09:57 -05:00
2011-08-18 10:47:41 -05:00
2011-06-28 23:28:23 +10:00
2011-06-28 14:04:00 +10:00
2011-06-28 23:28:24 +10:00
2011-06-28 23:28:24 +10:00
2011-07-18 21:06:24 -05:00
2011-07-02 02:01:39 +10:00
2011-06-28 23:28:24 +10:00
2011-06-28 23:28:24 +10:00
2011-06-28 23:28:24 +10:00
2011-07-05 22:36:40 -05:00
2011-07-06 09:26:09 -05:00
2011-06-28 14:04:00 +10:00
2011-08-15 12:13:35 -05:00
2011-03-20 19:49:45 -05:00