libalpm: don't chown download dir if not root
Commit 7bc5d55b56
disbaled the chown after
downloading if the current user is not root. It only makes sense for us
to do the same on this side otherwise files would end up stuck as the
download user.
This is also important for other alpm tools that configure themselves
via pacman.conf but download to user directories.
This commit is contained in:
parent
af54cd4ee1
commit
3370dd586a
1 changed files with 2 additions and 1 deletions
|
@ -955,10 +955,11 @@ const char *_alpm_filecache_setup(alpm_handle_t *handle)
|
|||
*/
|
||||
char *_alpm_temporary_download_dir_setup(const char *dir, const char *user)
|
||||
{
|
||||
uid_t myuid = getuid();
|
||||
struct passwd const *pw = NULL;
|
||||
|
||||
ASSERT(dir != NULL, return NULL);
|
||||
if(user != NULL) {
|
||||
if(myuid == 0 && user != NULL) {
|
||||
ASSERT((pw = getpwnam(user)) != NULL, return NULL);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue