diff options
author | Rob Mensching <rob@firegiant.com> | 2021-03-16 16:12:50 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2021-03-16 16:16:02 -0700 |
commit | fb2e8cb8a28a2a1a84909a8793a57d0d575da610 (patch) | |
tree | b16b703c6ec142413878ccfcbc8fada467d9fc47 /src | |
parent | bf9daf7547175f7a17b949feaeaa9f3cac388073 (diff) | |
download | wix-fb2e8cb8a28a2a1a84909a8793a57d0d575da610.tar.gz wix-fb2e8cb8a28a2a1a84909a8793a57d0d575da610.tar.bz2 wix-fb2e8cb8a28a2a1a84909a8793a57d0d575da610.zip |
Make ResetAcl opt-in instead of opt-out
Diffstat (limited to 'src')
-rw-r--r-- | src/WixToolset.Core/Bind/TransferFilesCommand.cs | 10 | ||||
-rw-r--r-- | src/WixToolset.Core/CommandLine/BuildCommand.cs | 8 | ||||
-rw-r--r-- | src/WixToolset.Core/LayoutContext.cs | 2 | ||||
-rw-r--r-- | src/WixToolset.Core/LayoutCreator.cs | 6 |
4 files changed, 14 insertions, 12 deletions
diff --git a/src/WixToolset.Core/Bind/TransferFilesCommand.cs b/src/WixToolset.Core/Bind/TransferFilesCommand.cs index 51d5a744..b3b74fbc 100644 --- a/src/WixToolset.Core/Bind/TransferFilesCommand.cs +++ b/src/WixToolset.Core/Bind/TransferFilesCommand.cs | |||
@@ -13,12 +13,12 @@ namespace WixToolset.Core.Bind | |||
13 | 13 | ||
14 | internal class TransferFilesCommand | 14 | internal class TransferFilesCommand |
15 | { | 15 | { |
16 | public TransferFilesCommand(IMessaging messaging, IEnumerable<ILayoutExtension> extensions, IEnumerable<IFileTransfer> fileTransfers, bool suppressAclReset) | 16 | public TransferFilesCommand(IMessaging messaging, IEnumerable<ILayoutExtension> extensions, IEnumerable<IFileTransfer> fileTransfers, bool resetAcls) |
17 | { | 17 | { |
18 | this.Extensions = extensions; | 18 | this.Extensions = extensions; |
19 | this.Messaging = messaging; | 19 | this.Messaging = messaging; |
20 | this.FileTransfers = fileTransfers; | 20 | this.FileTransfers = fileTransfers; |
21 | this.SuppressAclReset = suppressAclReset; | 21 | this.ResetAcls = resetAcls; |
22 | } | 22 | } |
23 | 23 | ||
24 | private IMessaging Messaging { get; } | 24 | private IMessaging Messaging { get; } |
@@ -27,7 +27,7 @@ namespace WixToolset.Core.Bind | |||
27 | 27 | ||
28 | private IEnumerable<IFileTransfer> FileTransfers { get; } | 28 | private IEnumerable<IFileTransfer> FileTransfers { get; } |
29 | 29 | ||
30 | private bool SuppressAclReset { get; } | 30 | private bool ResetAcls { get; } |
31 | 31 | ||
32 | public void Execute() | 32 | public void Execute() |
33 | { | 33 | { |
@@ -152,9 +152,9 @@ namespace WixToolset.Core.Bind | |||
152 | } while (retry); | 152 | } while (retry); |
153 | } | 153 | } |
154 | 154 | ||
155 | // Finally, if there were any files remove the ACL that may have been added to | 155 | // Finally, if directed then reset remove ACLs that may may have been picked up |
156 | // during the file transfer process. | 156 | // during the file transfer process. |
157 | if (0 < destinationFiles.Count && !this.SuppressAclReset) | 157 | if (this.ResetAcls && 0 < destinationFiles.Count) |
158 | { | 158 | { |
159 | try | 159 | try |
160 | { | 160 | { |
diff --git a/src/WixToolset.Core/CommandLine/BuildCommand.cs b/src/WixToolset.Core/CommandLine/BuildCommand.cs index eda93f31..9efef830 100644 --- a/src/WixToolset.Core/CommandLine/BuildCommand.cs +++ b/src/WixToolset.Core/CommandLine/BuildCommand.cs | |||
@@ -372,7 +372,7 @@ namespace WixToolset.Core.CommandLine | |||
372 | context.ContentsFile = this.ContentsFile; | 372 | context.ContentsFile = this.ContentsFile; |
373 | context.OutputsFile = this.OutputsFile; | 373 | context.OutputsFile = this.OutputsFile; |
374 | context.BuiltOutputsFile = this.BuiltOutputsFile; | 374 | context.BuiltOutputsFile = this.BuiltOutputsFile; |
375 | context.SuppressAclReset = false; // TODO: correctly set SuppressAclReset | 375 | context.ResetAcls = this.commandLine.ResetAcls; |
376 | context.CancellationToken = cancellationToken; | 376 | context.CancellationToken = cancellationToken; |
377 | 377 | ||
378 | var layout = this.ServiceProvider.GetService<ILayoutCreator>(); | 378 | var layout = this.ServiceProvider.GetService<ILayoutCreator>(); |
@@ -547,6 +547,8 @@ namespace WixToolset.Core.CommandLine | |||
547 | 547 | ||
548 | public bool SuppressValidation { get; set; } | 548 | public bool SuppressValidation { get; set; } |
549 | 549 | ||
550 | public bool ResetAcls { get; set; } | ||
551 | |||
550 | public CommandLine(IServiceProvider serviceProvider, IMessaging messaging) | 552 | public CommandLine(IServiceProvider serviceProvider, IMessaging messaging) |
551 | { | 553 | { |
552 | this.ServiceProvider = serviceProvider; | 554 | this.ServiceProvider = serviceProvider; |
@@ -702,6 +704,10 @@ namespace WixToolset.Core.CommandLine | |||
702 | case "sval": | 704 | case "sval": |
703 | this.SuppressValidation = true; | 705 | this.SuppressValidation = true; |
704 | return true; | 706 | return true; |
707 | |||
708 | case "resetacls": | ||
709 | this.ResetAcls = true; | ||
710 | return true; | ||
705 | } | 711 | } |
706 | 712 | ||
707 | if (parameter.StartsWith("sw")) | 713 | if (parameter.StartsWith("sw")) |
diff --git a/src/WixToolset.Core/LayoutContext.cs b/src/WixToolset.Core/LayoutContext.cs index e4c8db7c..deb5057f 100644 --- a/src/WixToolset.Core/LayoutContext.cs +++ b/src/WixToolset.Core/LayoutContext.cs | |||
@@ -33,7 +33,7 @@ namespace WixToolset.Core | |||
33 | 33 | ||
34 | public string BuiltOutputsFile { get; set; } | 34 | public string BuiltOutputsFile { get; set; } |
35 | 35 | ||
36 | public bool SuppressAclReset { get; set; } | 36 | public bool ResetAcls { get; set; } |
37 | 37 | ||
38 | public CancellationToken CancellationToken { get; set; } | 38 | public CancellationToken CancellationToken { get; set; } |
39 | } | 39 | } |
diff --git a/src/WixToolset.Core/LayoutCreator.cs b/src/WixToolset.Core/LayoutCreator.cs index b31c4e16..0c5aaf63 100644 --- a/src/WixToolset.Core/LayoutCreator.cs +++ b/src/WixToolset.Core/LayoutCreator.cs | |||
@@ -18,13 +18,9 @@ namespace WixToolset.Core | |||
18 | { | 18 | { |
19 | internal LayoutCreator(IServiceProvider serviceProvider) | 19 | internal LayoutCreator(IServiceProvider serviceProvider) |
20 | { | 20 | { |
21 | this.ServiceProvider = serviceProvider; | ||
22 | |||
23 | this.Messaging = serviceProvider.GetService<IMessaging>(); | 21 | this.Messaging = serviceProvider.GetService<IMessaging>(); |
24 | } | 22 | } |
25 | 23 | ||
26 | private IServiceProvider ServiceProvider { get; } | ||
27 | |||
28 | private IMessaging Messaging { get; } | 24 | private IMessaging Messaging { get; } |
29 | 25 | ||
30 | public void Layout(ILayoutContext context) | 26 | public void Layout(ILayoutContext context) |
@@ -44,7 +40,7 @@ namespace WixToolset.Core | |||
44 | { | 40 | { |
45 | this.Messaging.Write(VerboseMessages.LayingOutMedia()); | 41 | this.Messaging.Write(VerboseMessages.LayingOutMedia()); |
46 | 42 | ||
47 | var command = new TransferFilesCommand(this.Messaging, context.Extensions, context.FileTransfers, context.SuppressAclReset); | 43 | var command = new TransferFilesCommand(this.Messaging, context.Extensions, context.FileTransfers, context.ResetAcls); |
48 | command.Execute(); | 44 | command.Execute(); |
49 | } | 45 | } |
50 | 46 | ||