Skip to content

Rework open mode parsing in TNetXNGFile #22778

Open
vepadulano wants to merge 1 commit into
root-project:masterfrom
vepadulano:netxng-sanitise-mode
Open

Rework open mode parsing in TNetXNGFile #22778
vepadulano wants to merge 1 commit into
root-project:masterfrom
vepadulano:netxng-sanitise-mode

Conversation

@vepadulano

@vepadulano vepadulano commented Jul 9, 2026

Copy link
Copy Markdown
Member

The parsing of the opening mode string option to create the corresponding XRootD
opening mode flag assumes the string option is a single word. Given that the input
open mode string may not contain just one word, e.g. because of the internal
extra option _WITHOUT_GLOBALREGISTRATION, rework the parsing logic by

  • Tokenizing the input open mode string.
  • Returning early in case a token corresponds to one of the accepted words.
  • In all other cases, return success (0) or failure (-1) depending on whether
    the assumeRead parameter is true or false.

Found while testing #20272 on EOS

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Test Results

    23 files      23 suites   3d 16h 30m 28s ⏱️
 3 872 tests  3 872 ✅ 0 💤 0 ❌
79 695 runs  79 695 ✅ 0 💤 0 ❌

Results for commit 551d8bf.

@jblomer jblomer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be simpler/better to use Split in ParseOpenMode, iterate through the tokens and stop when a known token was found?

@vepadulano

Copy link
Copy Markdown
Member Author

Would it be simpler/better to use Split in ParseOpenMode, iterate through the tokens and stop when a known token was found?

I don't really know, I don't have a strong opinion about this. I feel like ParseOpenMode is flawed in any case. I can implement what you suggest if you feel it would be better 👍 .

@vepadulano vepadulano force-pushed the netxng-sanitise-mode branch from 551d8bf to 17f9d45 Compare July 10, 2026 09:01
@vepadulano vepadulano changed the title [net] Sanitise open mode string option before parsing Rework open mode parsing in TNetXNGFile Jul 10, 2026
@vepadulano

Copy link
Copy Markdown
Member Author

@jblomer I have implemented the suggested change, let me know what you think.

The parsing of the opening mode string option to create the corresponding XRootD
opening mode flag assumes the string option is a single word. Given that the input
open mode string may not contain just one word, e.g. because of the internal
extra option `_WITHOUT_GLOBALREGISTRATION`, rework the parsing logic by

* Tokenizing the input open mode string.
* Returning early in case a token corresponds to one of the accepted words.
* In all other cases, return success (0) or failure (-1) depending on whether
  the `assumeRead` parameter is true or false.
@vepadulano vepadulano force-pushed the netxng-sanitise-mode branch from 17f9d45 to db80d7d Compare July 10, 2026 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants