Skip to content

Commit 6121069

Browse files
committed
Bugfix: greyhole-dfree might fail, if it is executed by two different (Samba) users with incompatible umask: first user creates this file by connecting to any Greyhole share, and umask makes this file unwritable by the second user, who will then see 0 bytes free on the shares
1 parent 54190b6 commit 6121069

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

greyhole-dfree.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
$total_space = 0;
2828
$total_free_space = 0;
2929
foreach (Config::storagePoolDrives() as $sp_drive) {
30-
$response = explode(' ', exec("df -k ".escapeshellarg($sp_drive)." 2>/tmp/greyhole_df_error.log | tail -1 | awk '{print \$(NF-4),\$(NF-2)}'"));
30+
$response = explode(' ', exec("df -k ".escapeshellarg($sp_drive)." 2>/tmp/greyhole_df_error_\$(whoami).log | tail -1 | awk '{print \$(NF-4),\$(NF-2)}'"));
3131
if (count($response) != 2) {
3232
continue;
3333
}

0 commit comments

Comments
 (0)