Lennart Poettering
992e8f224b
util-lib: rework /tmp and /var/tmp handling code
...
Beef up the existing var_tmp() call, rename it to var_tmp_dir() and add a
matching tmp_dir() call (the former looks for the place for /var/tmp, the
latter for /tmp).
Both calls check $TMPDIR, $TEMP, $TMP, following the algorithm Python3 uses.
All dirs are validated before use. secure_getenv() is used in order to limite
exposure in suid binaries.
This also ports a couple of users over to these new APIs.
The var_tmp() return parameter is changed from an allocated buffer the caller
will own to a const string either pointing into environ[], or into a static
const buffer. Given that environ[] is mostly considered constant (and this is
exposed in the very well-known getenv() call), this should be OK behaviour and
allows us to avoid memory allocations in most cases.
Note that $TMPDIR and friends override both /var/tmp and /tmp usage if set.
2016-08-04 16:27:07 +02:00
..
2014-10-23 17:38:02 +02:00
2016-02-10 13:41:57 +01:00
2015-10-24 23:05:02 +02:00
2016-03-03 18:46:58 +01:00
2016-02-10 13:41:57 +01:00
2015-10-24 23:05:02 +02:00
2016-02-10 13:41:57 +01:00
2015-10-27 13:25:55 +01:00
2016-02-10 13:41:57 +01:00
2015-07-31 19:08:26 +02:00
2016-03-04 21:45:45 -05:00
2016-02-10 13:41:57 +01:00
2016-08-03 19:04:53 -04:00
2016-02-10 13:41:57 +01:00
2016-01-12 12:14:50 +02:00
2016-05-20 18:53:11 +02:00
2016-02-10 13:41:57 +01:00
2016-07-20 14:35:15 +02:00
2016-02-29 17:40:08 +01:00
2016-07-31 22:06:09 -04:00
2016-02-10 13:41:57 +01:00
2016-03-03 19:04:06 +01:00
2016-04-29 14:28:04 +02:00
2016-03-03 18:46:58 +01:00
2016-03-04 21:45:45 -05:00
2016-02-10 13:41:57 +01:00
2016-02-10 13:41:57 +01:00
2016-02-10 13:41:57 +01:00
2016-02-10 13:41:57 +01:00
2016-05-20 15:08:24 +02:00
2016-03-21 16:49:42 -04:00
2016-03-03 18:46:58 +01:00
2016-08-02 16:22:56 +02:00
2016-02-10 13:41:57 +01:00
2016-03-03 19:04:06 +01:00
2015-10-27 13:25:55 +01:00
2016-05-17 16:55:20 -04:00
2016-02-10 13:41:57 +01:00
2016-08-04 16:27:07 +02:00
2016-03-03 19:04:06 +01:00
2016-03-03 19:04:07 +01:00
2016-02-18 19:39:10 -05:00
2015-11-16 22:09:36 +01:00
2016-02-10 13:41:57 +01:00
2016-03-03 18:46:58 +01:00
2016-02-10 13:41:57 +01:00
2016-02-10 13:41:57 +01:00
2016-07-25 20:53:26 +02:00
2016-07-25 16:20:16 +02:00
2016-04-29 15:59:51 +02:00
2016-03-03 19:04:06 +01:00
2016-03-10 12:57:23 +01:00
2016-02-10 13:41:57 +01:00
2016-03-04 21:45:45 -05:00
2015-08-04 03:23:43 -07:00
2015-11-16 22:09:36 +01:00
2016-02-10 13:41:57 +01:00
2016-03-04 21:45:44 -05:00
2016-04-10 23:41:04 +00:00
2016-02-23 14:20:34 -08:00
2016-02-11 22:12:04 +01:00
2016-06-15 01:26:01 +02:00
2016-08-04 09:54:10 -04:00
2016-04-12 13:43:32 +02:00
2016-07-31 21:50:50 -04:00
2016-05-20 15:08:24 +02:00
2016-02-10 13:41:57 +01:00
2016-06-13 16:28:42 +02:00
2016-07-29 14:30:46 -07:00
2015-11-16 22:09:36 +01:00
2016-02-10 13:41:57 +01:00
2016-04-29 16:27:49 +02:00
2016-05-20 15:08:24 +02:00
2016-03-04 21:45:58 -05:00
2015-04-10 17:13:15 +02:00
2016-02-10 13:41:57 +01:00
2016-03-03 18:46:58 +01:00
2016-02-20 16:34:59 -05:00
2016-03-02 10:42:27 -05:00
2016-02-10 13:41:57 +01:00
2016-06-15 01:26:01 +02:00
2016-03-03 19:04:06 +01:00
2016-02-10 13:41:57 +01:00
2016-03-03 18:46:58 +01:00
2016-02-10 13:41:57 +01:00
2016-07-17 15:34:57 -04:00
2016-02-10 13:41:57 +01:00
2016-02-12 19:10:01 +01:00
2015-11-16 22:09:36 +01:00
2016-08-03 19:04:53 -04:00
2016-04-22 20:49:07 -04:00
2016-04-11 21:31:57 +02:00
2016-02-10 13:41:57 +01:00
2016-06-06 19:59:09 +02:00
2016-05-20 15:08:24 +02:00
2016-04-12 13:43:30 +02:00
2016-07-22 15:53:45 +02:00
2016-02-10 13:41:57 +01:00
2016-07-22 15:33:12 +02:00
2015-01-08 15:57:38 -05:00
2016-02-10 13:41:57 +01:00
2016-03-03 18:46:58 +01:00
2016-03-03 19:04:07 +01:00
2016-02-10 13:41:57 +01:00