lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher Currens (Resolved) (JIRA)" <j...@apache.org>
Subject [Lucene.Net] [jira] [Resolved] (LUCENENET-454) MSBuild may wipe entire root drive if bad parameters are passed to build.targets
Date Sun, 06 Nov 2011 02:50:51 GMT

     [ https://issues.apache.org/jira/browse/LUCENENET-454?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Christopher Currens resolved LUCENENET-454.
-------------------------------------------

    Resolution: Fixed

I added checks in the build.targets to make sure the ArtifactsFolder variable is populated
before trying to gather files to delete.  It will also now throw an error during the clean
stage if the ArtifactsFolder variable is empty.

There were also some issues with the 2 build.cmd scripts, one in root and the other in build/scripts.
 Variables were being set but had quotes around them, causing string comparisons to fail in
the build scripts.  That is now fixed as well.
                
> MSBuild may wipe entire root drive if bad parameters are passed to build.targets
> --------------------------------------------------------------------------------
>
>                 Key: LUCENENET-454
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-454
>             Project: Lucene.Net
>          Issue Type: Bug
>          Components: Build Automation
>            Reporter: Christopher Currens
>            Priority: Critical
>
> If the Area variable is passed to MSBuild and includes quotes or doesn't match a valid
target area, MSBuild populates the "CleanFiles" ItemGroup with every file on the local harddrive.
 When the clean step is run, all files on the drive will be deleted!
> This can be reproduced with the following command (I do not recommend reproducing this
unless you've taken precautions to protect your data).
> MSBuild.exe build.targets /t:all /p:Area=invalidareaname
> The causes "ArtifactsFolder" to never be populated.  "CleanFiles" then gathers a list
of files from "\**\*.*" instead of "valid\path\**\*.*" which, at least on windows computers,
evaluates out to "D:\**\*.*", or all files on my local hard drive.
> One solution would be to force MSBuild to throw an error if "ArtifactsFolder" is empty
during the clean target.  In fact, we should make a note to check every place we're calling
the Delete task, and make sure we do sanity checks on the variables involved in gathering
the files to delete.
> I'm testing a fix for it right now, and if it seems to work, I'll be committing it tonight.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message