Skip to content

[r] Sanitize R package and repo names in TRInterface helpers#22181

Open
guitargeek wants to merge 1 commit intoroot-project:masterfrom
guitargeek:trinterface
Open

[r] Sanitize R package and repo names in TRInterface helpers#22181
guitargeek wants to merge 1 commit intoroot-project:masterfrom
guitargeek:trinterface

Conversation

@guitargeek
Copy link
Copy Markdown
Contributor

TRInterface::IsInstalled, ::Require, and ::Install built R source by concatenating the caller-provided package name into a string literal and passing it to the embedded R interpreter.

Validate pkg against CRAN's package-name rule (starts with an ASCII letter, only letters, digits, and dots, does not end in a dot) before putting it into the R command, and emit an Error and return kFALSE on any other input.

The repos argument of Install is validated to be a valid URL.

`TRInterface::IsInstalled`, `::Require`, and `::Install` built R source by
concatenating the caller-provided package name into a string literal and
passing it to the embedded R interpreter.

Validate pkg against CRAN's package-name rule (starts with an ASCII
letter, only letters, digits, and dots, does not end in a dot) before
putting it into the R command, and emit an Error and return `kFALSE` on
any other input.

The `repos` argument of Install is validated to be a valid URL.
@guitargeek guitargeek self-assigned this May 7, 2026
@guitargeek guitargeek requested a review from dpiparo as a code owner May 7, 2026 19:38
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Test Results

    22 files      22 suites   3d 10h 28m 33s ⏱️
 3 847 tests  3 846 ✅ 0 💤 1 ❌
76 894 runs  76 893 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit 4999865.

♻️ This comment has been updated with latest results.

@dpiparo
Copy link
Copy Markdown
Member

dpiparo commented May 8, 2026

Thanks a lot for taking the time to work on this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants