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

Mkbootstrap.t fails within AFS filesystem #451

Open
djzhh opened this issue Mar 14, 2024 · 2 comments
Open

Mkbootstrap.t fails within AFS filesystem #451

djzhh opened this issue Mar 14, 2024 · 2 comments

Comments

@djzhh
Copy link

djzhh commented Mar 14, 2024

Mkbootstrap.t fails when Perl is compiled within AFS filesystem (perl-5.38.2 and perl-5.36.3) but works fine within the local filesystem:

cpan/ExtUtils-MakeMaker/t/Mkbootstrap ............................ 
#   Failed test 'should die given bad filename'
#   at t/Mkbootstrap.t line 84.
#                   ''
#     doesn't match '(?^:Unable to open dasboot\.bs)'
# Looks like you failed 1 test of 18.
FAILED at test 8

Snippet of test:

     78         chmod 0444, 'dasboot.bs';
     79
     80         SKIP: {
     81             skip("cannot write readonly files", 1) if -w 'dasboot.bs' || $^O eq 'cygwin';
     82
     83             eval{ Mkbootstrap('dasboot', 1) };
     84             like( $@, qr/Unable to open dasboot\.bs/, 'should die given bad filename' );
     85         }

The test must fail as there is no such thing as file-based ACLs in AFS; see https://docs.openafs.org/UserGuide/HDRWQ46.html
Instead ACLs are set on directories. As AFS is not that common, so below you'll find an example. Anyhow, ./Configure detects AFS and displays a notice "AFS may be running... I'll be extra cautious then..."

% systemctl status afs.mount
● afs.mount - /afs
     Loaded: loaded (/proc/self/mountinfo)
     Active: active (mounted) since Fri 2024-01-19 13:28:15 CET; 1 month 16 days ago
      Until: Fri 2024-01-19 13:28:15 CET; 1 month 16 days ago
      Where: /afs
       What: AFS

% mkdir demo
% cd demo

% fs listacl -path .
Access list for . is
Normal rights:
  username rlidwka
  system:administrators rlidwka
  system:anyuser l

% echo Hello World > a_file

% ls -ld a_file
-rw-r--r--. 1 username grp 12 Mar  6 02:34 a_file

% cat a_file
Hello World

% chmod 0000 a_file

% ls -ld a_file
----------. 1 username grp 12 Mar  6 02:34 a_file

% getfacl a_file
# file: a_file
# owner: username
# group: grp
user::---
group::---
other::---

% cat a_file
Hello World

% echo "Have a nice day" >> a_file

% cat a_file
Hello World
Have a nice day

I am not familiar with Perl tests, but anyhow propose this patch:

require Config;
     78         chmod 0444, 'dasboot.bs';
     79
     80         SKIP: {
     81             skip("cannot write readonly files", 1) if -w 'dasboot.bs' || $^O eq 'cygwin';
skip "AFS" if $Config::Config{afs} eq "true";
     82
     83             eval{ Mkbootstrap('dasboot', 1) };
     84             like( $@, qr/Unable to open dasboot\.bs/, 'should die given bad filename' );
     85         }
@Leont
Copy link
Member

Leont commented Mar 14, 2024

This should only be skipped if the current directory is under /afs, right? Something along the lines of

skip "Can't write readonly files" if $Config{afs} eq "true" and Cwd::getcwd =~ /^\Q$Config{afsroot}\E/;

@djzhh
Copy link
Author

djzhh commented Mar 14, 2024

All AFS cells I know of are starting with /afs, so this looks an appropriate condition to me.

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

No branches or pull requests

2 participants