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

fix permissions for specified files in DotNetCoreInstallerV0, DotNetCoreInstallerV1, UseDotNetV2 tasks #16100

Merged
merged 12 commits into from
Apr 26, 2022
Merged
2 changes: 1 addition & 1 deletion Tasks/DotNetCoreInstallerV0/Tests/L0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ describe('DotNetCoreInstaller', function() {
assert(tr.stdout.indexOf("loc_mock_ToolToInstall sdk 1.0.4") > -1, "should print to-be-installed info");
assert(tr.stdout.indexOf("Checking local tool for dncs and version 1.0.4") > -1, "should check for local cached tool");
assert(tr.stdout.indexOf("loc_mock_InstallingAfresh") > -1, "should install fresh if cache miss");
assert(tr.stdout.indexOf("Changing attribute for file /somedir/currdir/externals/get-os-distro.sh to 777") > -1, "should iset executable attribute for install script");
assert(tr.stdout.indexOf("Changing attribute for file /somedir/currdir/externals/get-os-distro.sh to 755") > -1, "should set executable attribute for install script");
assert(tr.stdout.indexOf("Downloading tool from https://primary-url") > -1, "should download from correct url");
assert(tr.stdout.indexOf("Extracting tar archive from "+process.env["AGENT_TEMPDIRECTORY"]+"/someArchive.tar") > -1, "Should extract downloaded archive corectly");
assert(tr.stdout.indexOf("Caching dir "+process.env["AGENT_TEMPDIRECTORY"]+"/someDir for tool dncs version 1.0.4") > -1, "should cache correctly");
Expand Down
2 changes: 1 addition & 1 deletion Tasks/DotNetCoreInstallerV0/dotnetcoreinstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class DotnetCoreInstaller {
}
else {
let scriptPath = path.join(utilities.getCurrentDir(), 'externals', 'get-os-distro.sh');
utilities.setFileAttribute(scriptPath, "777");
utilities.setFileAttribute(scriptPath, "755");

scriptRunner = tl.tool(tl.which(scriptPath, true));
}
Expand Down
2 changes: 1 addition & 1 deletion Tasks/DotNetCoreInstallerV0/releasesfetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class DotNetCoreReleaseFetcher {
legacyUrlSearchString = "dotnet-install: Legacy - ";
} else {
let escapedScript = path.join(utils.getCurrentDir(), 'externals', 'install-dotnet.sh').replace(/'/g, "''");
utils.setFileAttribute(escapedScript, "777");
utils.setFileAttribute(escapedScript, "755");
scriptRunner = taskLib.tool(taskLib.which(escapedScript, true));
scriptRunner.arg('--version');
scriptRunner.arg(version);
Expand Down
2 changes: 1 addition & 1 deletion Tasks/DotNetCoreInstallerV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 198,
"Minor": 204,
"Patch": 0
},
"satisfies": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/DotNetCoreInstallerV0/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
"Minor": 198,
"Minor": 204,
"Patch": 0
},
"satisfies": [
Expand Down
2 changes: 1 addition & 1 deletion Tasks/DotNetCoreInstallerV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 198,
"Minor": 204,
"Patch": 0
},
"deprecated": true,
Expand Down
2 changes: 1 addition & 1 deletion Tasks/DotNetCoreInstallerV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 1,
"Minor": 198,
"Minor": 204,
"Patch": 0
},
"deprecated": true,
Expand Down
2 changes: 1 addition & 1 deletion Tasks/DotNetCoreInstallerV1/versionfetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export class DotNetCoreVersionFetcher {
}
else {
let scriptPath = path.join(this.getCurrentDir(), 'externals', 'get-os-distro.sh');
this.setFileAttribute(scriptPath, "777");
this.setFileAttribute(scriptPath, "755");

scriptRunner = tl.tool(tl.which(scriptPath, true));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@
"loc.messages.OnlyExplicitVersionAllowed": "Only explicit versions and accepted, such as: 2.2.301. Version: %s is not valid.",
"loc.messages.SupportPhaseNotPresentInChannel": "support-phase is not present in the channel with channel-version %s.",
"loc.messages.DepricatedVersionNetCore": "NET Core version you specfied %s is out of support and will be removed from hosted agents soon. Please refer to https://aka.ms/dotnet-core-support for more information about the .NET support policy."
}
}
6 changes: 3 additions & 3 deletions Tasks/UseDotNetV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 2,
"Minor": 198,
"Patch": 1
"Minor": 204,
"Patch": 0
},
"satisfies": [
"DotNetCore"
Expand Down Expand Up @@ -190,4 +190,4 @@
"SupportPhaseNotPresentInChannel": "support-phase is not present in the channel with channel-version %s.",
"DepricatedVersionNetCore": "NET Core version you specfied %s is out of support and will be removed from hosted agents soon. Please refer to https://aka.ms/dotnet-core-support for more information about the .NET support policy."
}
}
}
6 changes: 3 additions & 3 deletions Tasks/UseDotNetV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 2,
"Minor": 198,
"Patch": 1
"Minor": 204,
"Patch": 0
},
"satisfies": [
"DotNetCore"
Expand Down Expand Up @@ -190,4 +190,4 @@
"SupportPhaseNotPresentInChannel": "ms-resource:loc.messages.SupportPhaseNotPresentInChannel",
"DepricatedVersionNetCore": "ms-resource:loc.messages.DepricatedVersionNetCore"
}
}
}
2 changes: 1 addition & 1 deletion Tasks/UseDotNetV2/versionfetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export class DotNetCoreVersionFetcher {
}
else {
let scriptPath = path.join(this.getCurrentDir(),'externals', 'get-os-distro.sh');
this.setFileAttribute(scriptPath, "777");
this.setFileAttribute(scriptPath, "755");

scriptRunner = tl.tool(tl.which(scriptPath, true));
}
Expand Down