diff options
Diffstat (limited to 'sbolint')
| -rwxr-xr-x | sbolint | 33 |
1 files changed, 25 insertions, 8 deletions
@@ -140,7 +140,7 @@ Filename extension must match compression type. Archive must contain a directory with the same name as the archive's base name, e.g. I<foo.tar.gz> must contain I<foo/>. Everything else in the archive must be -inside this directory. +inside this directory. The directory's permissions must be 0755. =item - @@ -569,6 +569,10 @@ sub chdir_or_die { chdir($_[0]) or die "$SELF: chdir($_[0]): $!\n"; } +sub get_mode { + 07777 & ((stat($_[0]))[2]); +} + sub make_temp_dir { return if $tempdir; my $tmp = $ENV{TMP} || "/tmp"; @@ -693,6 +697,15 @@ sub extract_tarball { make_temp_dir(); chdir_or_die($tempdir); system("tar xf $file"); + + # 20260602 bkw: check permissions on the enclosing dir. If it's + # not +x, the upload form will fail. + my $gotmode = get_mode("$tempdir/$buildname"); + if($gotmode != 0755) { + my $p = sprintf("%04o", $gotmode); + log_error("$file not a SBo-compliant tarball, permission of $buildname/ should be 0755, not $p."); + } + return "$tempdir/$buildname"; } @@ -731,13 +744,17 @@ sub run_checks { $in_git_repo = system("git rev-parse >/dev/null 2>/dev/null") == 0; } - # what permissions are allowed for the SlackBuild? 3 choices: - # in a tarball, it has to be 755. + # what permissions are allowed for the SlackBuild? 2 choices: # in a git repo, it has to be 644. # anywhere else, 644 and 755 are allowed. - if($checking_tarball) { - @script_perms = (0755); - } elsif($in_git_repo) { + # 20260603 bkw: this changed. we used to enforce 755 in tarballs, but + # there's no point in it: we don't use the submission tarball as the + # final downloadable file on the site. everything goes through git, + # with a git hook that changes the script perms to 0644... then when + # the update happens and the site tarballs get generated, the script + # that does that, sets the script perms to 0755. so it really doesn't + # matter what they are in the submission tarball. + if($in_git_repo) { @script_perms = (0644); } else { @script_perms = (0644, 0755); @@ -777,7 +794,7 @@ sub check_mode { return 0; } - my $gotmode = 07777 & ((stat($file))[2]); + my $gotmode = get_mode($file); if($wantmode != $gotmode) { log_error("$file must be mode %04o, not %04o", $wantmode, $gotmode); return 0; @@ -1375,7 +1392,7 @@ sub script_exists { sub check_script { my $file = $buildname . ".SlackBuild"; - my $gotmode = 07777 & ((stat($file))[2]); + my $gotmode = get_mode($file); my $mode_ok = 0; my @octalmodes = (); |
