Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem unzipping ctx files using filesystem ACLs #226

Closed
MartinDix opened this issue Apr 21, 2016 · 1 comment · Fixed by #227
Closed

Problem unzipping ctx files using filesystem ACLs #226

MartinDix opened this issue Apr 21, 2016 · 1 comment · Fixed by #227
Assignees
Labels
Milestone

Comments

@MartinDix
Copy link
Contributor

MartinDix commented Apr 21, 2016

We use filesystem access control lists to make prebuilds usable across a user group.

However when a member of this group tries to use the prebuild, it fails when trying to uncompress the ctx file. E.g.

[FAIL] /g/data/access/prebuilds/vn10.3_GA7/fcm_make_nci_um_safe_omp/.fcm-make2/ctx.gz: cannot retrieve cache
[FAIL] Inappropriate ioctl for device at /projects/access/apps/fcm/2015.10.0/bin/../lib/FCM/System/Make/Share/Dest.pm line 105, <$handle> line 6.

I haven't dug into the perl library but perhaps the gunzip function is using the simple -r test for readability that was the issue in #127?

Opening the file in the fcm code and passing a file handle to gunzip works

diff --git a/lib/FCM/System/Make/Share/Dest.pm b/lib/FCM/System/Make/Share/Dest.pm
index dd0fdab..fb634ba 100644
--- a/lib/FCM/System/Make/Share/Dest.pm
+++ b/lib/FCM/System/Make/Share/Dest.pm
@@ -102,7 +102,9 @@ sub _ctx_load {
     }
     my $old_m_ctx = eval {
         my $handle = IO::File->new_tmpfile();
-        gunzip($path, $handle) || die($!);
+       # Open the file here to work around ACL problems
+       my $path_handle = new IO::File $path || die("Cannot open cache file $path\n");
+        gunzip($path_handle, $handle) || die($!);
         $handle->seek(0, 0);
         fd_retrieve($handle);
     };
@matthewrmshin matthewrmshin added this to the soon milestone Apr 21, 2016
@matthewrmshin matthewrmshin self-assigned this Apr 21, 2016
@matthewrmshin
Copy link
Member

@MartinDix Thanks for patch. Given that you have done the work already, do you want to raise a pull request for this change? (Otherwise I am happy to raise a pull request with this change.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants