-
Notifications
You must be signed in to change notification settings - Fork 865
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix execution of scripts in variables (#4016)
* Update vars expanding * Pass task name to expanding function * Add check in RecalculateExpanded for target vars * Refactor vars expanding impl * Correct cmdline postfix * Fix recursive matching of next variables * Add check for script tasks * Move & rename lists to constants * Rename dict with variables and add description * Add test for non-expanding of vulnerable vars * Add tests for varutil * Add new tests for variables expanding * Make prefixes suffixes maps per shell * Add release environment variables * Fix enum naming * Update variables expanding for cmd shell * Add & update tests for cmd * Add test case for cmd * Use ConvertToEnvVariableFormat util * Shorten variables names * Add tracing logs * Ignore case for task & variable names * Remove unused import * Fix test with ignoring case * Add new test cases * Fix grammar * Add & update tracing logs * Change cmd replacing to regex * Move shell var constructs to separate const class * Move suffixes and prefixes to structure * Add test to check if wrong task version specified
- Loading branch information
1 parent
321c73b
commit af5328b
Showing
8 changed files
with
399 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/Microsoft.VisualStudio.Services.Agent/EnvVariableParts.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace Microsoft.VisualStudio.Services.Agent | ||
{ | ||
public class EnvVariableParts | ||
{ | ||
public string Prefix { get; set; } | ||
public string Suffix { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.