Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
0265576e
Commit
0265576e
authored
Feb 08, 2018
by
Francesc Guasch
Browse files
Get the user with pure perl
In some environments the USER global may not be set
parent
9964228b
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/Ravada/VM/KVM.pm
View file @
0265576e
...
...
@@ -965,6 +965,7 @@ sub _search_iso {
}
sub _download(
$self
,
$url
) {
$url
=~ s{(http://.*)//(.*)}{$1/$2};
if (
$url
=~ m{
\
*}) {
my
@found
=
$self
->_search_url_file(
$url
);
confess
"
No
match
for
$url
"
if !scalar
@found
;
...
...
@@ -1040,7 +1041,8 @@ sub _cache_filename($url) {
$file
=~ tr{a-zA-Z0-9_-}{_}c;
$file
=~ s/__+/_/g;
my
$dir
=
"
/var/
tmp
/ravada_cache/
$ENV
{
USER
}"
;
my (
$user
) = getpwuid($>);
my
$dir
=
"
/var/
tmp
/ravada_cache/
$user
"
;
make_path(
$dir
) if ! -e
$dir
;
return
"
$dir
/
$file
"
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment