Skip to content

Potential issue with left-over project source code in ProjectSourceRule #11699

@sschuberth

Description

@sschuberth

The ProjectSourceRule can download a remote project repository in order to perform checks on the project's source code. It leverages a SourceTreeResolver for that which downloads the source code to a temporary directory:

fun forRemoteRepository(vcsInfo: VcsInfo) =
SourceTreeResolver {
val downloadDir = createOrtTempDir()
val downloaderConfiguration = DownloaderConfiguration(sourceCodeOrigins = listOf(SourceCodeOrigin.VCS))
val downloader = Downloader(downloaderConfiguration)
val pkg = Package.EMPTY.copy(vcsProcessed = vcsInfo)
downloader.download(pkg, downloadDir)
downloadDir
}

However, this temporary directory seems to never get deleted. This could be problematic if different users share a CI node that runs the evaluator. Then user A could access the (proprietary) project source code of user B.

So we probably should delete the temporary directory after use, but this seems to be tricky with the current design of the ProjectSourceRule rule.

@fviernau would you have any idea how to properly delete the temporary directory after its use? Ideally automatically, without the need for the user to call a special function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    evaluatorAbout the evaluator tool

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions