Merge branch 'test' into 55-oauth2-single-sign-on
This commit is contained in:
commit
7e28517b82
@ -5,17 +5,32 @@ use warnings;
|
||||
|
||||
use Data::Dumper;
|
||||
|
||||
print "Sanitize script for node removal from container.\n";
|
||||
|
||||
system("pwd");
|
||||
{
|
||||
my @l = (".","..");
|
||||
for(1..8) {
|
||||
push @l, (("../" x $_)."..")
|
||||
}
|
||||
for(@l) {
|
||||
my $cmd = "ls -ld $_";
|
||||
print "running: $cmd\n";
|
||||
system $cmd;
|
||||
}
|
||||
}
|
||||
|
||||
my $tmpdir = "tmp-sanitize";
|
||||
|
||||
die "Has already run, abort" if -e $tmpdir;
|
||||
|
||||
mkdir $tmpdir;
|
||||
|
||||
chmod(0755, $tmpdir);
|
||||
chmodWrap(0755, $tmpdir);
|
||||
chdir($tmpdir);
|
||||
system("ln -s ../uniworx.tar.gz .");
|
||||
system("tar xzvf uniworx.tar.gz");
|
||||
chmod(0755, '.'); # tar can change the rights of '.' if it contains an entry for '.' with other rights
|
||||
chmodWrap(0755, '.'); # tar can change the rights of '.' if it contains an entry for '.' with other rights
|
||||
|
||||
my %truerights = ();
|
||||
storeRightsMake7(".");
|
||||
@ -26,6 +41,25 @@ storeRightsMake7(".");
|
||||
#print "=== Reset rights:\n";
|
||||
#system("ls -l *");
|
||||
|
||||
sub chmodWrap {
|
||||
my ($mode, $fn) = @_;
|
||||
my $tries = 0;
|
||||
die "file '$fn' does not exist; cannot change its permissions to $mode" unless -e $fn;
|
||||
RIGHTS: {
|
||||
chmod($mode, $fn);
|
||||
my $ismode = (stat($fn))[2];
|
||||
my $fm = $ismode % 512;
|
||||
if($fm != $mode) {
|
||||
if($tries++ > 20) {
|
||||
die "Problem with file permissions, abort"
|
||||
}
|
||||
warn sprintf "File rights were meant to be set, but were not updated properly for file '%s', is %03o but was set to %03o; try again in 1 second";
|
||||
sleep 1;
|
||||
redo RIGHTS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
sub storeRightsMake7 {
|
||||
my ($pwd) = @_;
|
||||
@ -39,7 +73,7 @@ sub storeRightsMake7 {
|
||||
my $fm = $mode % 512;
|
||||
#my $fmo = sprintf("%03o",$fm);
|
||||
$truerights{$fullname} = $fm;
|
||||
chmod(($fm | 0700), $fullname);
|
||||
chmodWrap(($fm | 0700), $fullname);
|
||||
storeRightsMake7($fullname) if -d $fullname;
|
||||
}
|
||||
}
|
||||
@ -55,7 +89,7 @@ sub resetRights {
|
||||
#perl -le 'my $dh = undef;opendir($dh, ".");while(my $fn = readdir($dh)) { my $mode = (stat($fn))[2];my $fm = $mode % 512;my $fmo=sprintf("%03o",$fm);print "$fn -> $fmo" }'
|
||||
my $fullname = "$pwd/$fn";
|
||||
printf(" set rights of '$fullname' back to %03o\n", $truerights{$fullname});
|
||||
chmod($truerights{$fullname}, $fullname);
|
||||
chmodWrap($truerights{$fullname}, $fullname);
|
||||
resetRights($fullname) if -d $fullname;
|
||||
}
|
||||
}
|
||||
@ -72,6 +106,12 @@ sub renameWithRights {
|
||||
#my $rights = $truerights{$from};
|
||||
#delete $truerights{$from};
|
||||
rename($from, $to) or die "Could not rename '$from' to '$to', because $!";
|
||||
my $waittimer = 20;
|
||||
while(-e $from || not(-e $to) and $waittimer-- > 0) {
|
||||
sleep 1
|
||||
}
|
||||
die "rename file from '$from' to '$to', but it is still there" if -e $from;
|
||||
die "rename file from '$from' to '$to', but there is no file under the new name" unless -e $to;
|
||||
#$truerights{$to} = $rights
|
||||
}
|
||||
|
||||
@ -176,7 +216,8 @@ sub replaceInFile {
|
||||
}
|
||||
my $wh = undef;
|
||||
open($wh, '>', $filename) or die "Could not write $filename, because: $!";
|
||||
print $wh $content
|
||||
print $wh $content;
|
||||
close $wh;
|
||||
}
|
||||
|
||||
my %replacer = (
|
||||
@ -214,7 +255,7 @@ cautionWaiter();
|
||||
resetRights(".");
|
||||
|
||||
|
||||
|
||||
system("find");
|
||||
|
||||
unlink("uniworx.tar.gz");
|
||||
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
## [28.0.10](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/compare/t28.0.9...t28.0.10) (2024-04-18)
|
||||
|
||||
## [28.0.9](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/compare/t28.0.8...t28.0.9) (2024-04-08)
|
||||
|
||||
## [28.0.8](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/compare/t28.0.0...t28.0.8) (2024-04-06)
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"version": "28.0.9"
|
||||
"version": "28.0.10"
|
||||
}
|
||||
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "uni2work",
|
||||
"version": "28.0.9",
|
||||
"version": "28.0.10",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "uni2work",
|
||||
"version": "28.0.9",
|
||||
"version": "28.0.10",
|
||||
"description": "",
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
name: uniworx
|
||||
version: 28.0.9
|
||||
version: 28.0.10
|
||||
dependencies:
|
||||
- base
|
||||
- yesod
|
||||
|
||||
Loading…
Reference in New Issue
Block a user