If we have a duplicated entry, something like this:
[Issuer https://chtc.cs.wisc.edu/icecube]
issuer = https://chtc.cs.wisc.edu/icecube
base_path = /icecube
[Issuer https://chtc.cs.wisc.edu/icecube]
issuer = https://chtc.cs.wisc.edu/icecube
base_path = /icecube
The issuer and the base path became:
221213 04:51:12 596604 scitokens_Reconfig: Configuring issuer
https://chtc.cs.wisc.edu/icecube
https://chtc.cs.wisc.edu/icecube
With that, the token can find the issuer.
Maybe a good approach is to use rindex.
*--Fábio Andrijauskas*
On Mon, Dec 12, 2022 at 9:54 PM Andrew Hanushevsky ***@***.***>
wrote:
> ***@***.**** commented on this pull request.
>
> So, now I am a bit confused as what we are trying to fix. More comments
> inside.
> ------------------------------
>
> In src/XrdSciTokens/XrdSciTokensAccess.cc
> <https://github.com/xrootd/xrootd/pull/1859#discussion_r1046685840>:
>
> > @@ -1083,6 +1083,16 @@ class XrdAccSciTokens : public XrdAccAuthorize, public XrdSciTokensHelper
> section.c_str());
> continue;
> }
> + // prevent two identical issuers break the config
> + for (size_t i = 0; i < issuer.length(); i++)
>
> Well, I was thinking of something much simpler. But before we get to that,
> I am wondering what is being fixed here. According to INIReader, the new
> line character ('\n') is considered a separator so there should never be a
> new line character in the value string. So, why is it that the code assumes
> otherwise?
>
> Second, if indeed a new line can be in the value string then there is no
> easy solution here as the new line character can appear anywhere and
> multiple times as well. So, consider "\nissuer", "issuer\n", or
> "\nissuer\n" the fixes are very different in each case. The variations are
> endless (well actually two basic cases).
>
> OK, simplicity (note we only handle the simple case here):
> size_t i = issuer.find('\n');
> if (i != std::string::npos) {
> if (i != 0) issuer = issuer.substr(0, i);
> else /*error* string starts with newline and we don't handle that */
> }
>
> Yes, I should have have mentioned index() -- old habits.
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/xrootd/xrootd/pull/1859#pullrequestreview-1214751508>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ACEEH7YZHDXUGP7IZYUTK4DWNAFPXANCNFSM6AAAAAAS4UI76I>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <xrootd/xrootd/pull/1859/c1347810960@github.com>
[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/xrootd/xrootd/pull/1859#issuecomment-1347810960",
"url": "https://github.com/xrootd/xrootd/pull/1859#issuecomment-1347810960",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]
Use REPLY-ALL to reply to list
To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1