#include <cctype>#include <grp.h>#include <cstdio>#include <list>#include <vector>#include <unordered_set>#include <algorithm>#include <charconv>#include <random>#include <regex.h>#include <fcntl.h>#include <math.h>#include <pwd.h>#include <sys/stat.h>#include <sys/types.h>#include <map>#include <iomanip>#include "XrdNet/XrdNetUtils.hh"#include "XrdOuc/XrdOucCRC.hh"#include "XrdOuc/XrdOucEnv.hh"#include "XrdOuc/XrdOucSHA3.hh"#include "XrdOuc/XrdOucStream.hh"#include "XrdOuc/XrdOucString.hh"#include "XrdOuc/XrdOucUtils.hh"#include "XrdOuc/XrdOucPrivateUtils.hh"#include "XrdSys/XrdSysE2T.hh"#include "XrdSys/XrdSysError.hh"#include "XrdSys/XrdSysPlatform.hh"#include "XrdSys/XrdSysPthread.hh"Go to the source code of this file.
Macros | |
| #define | ENODATA ENOATTR |
| #define | SHFT(k) |
| #define | SHFT(k, m) |
Functions | |
| static int | from_hex (char c) |
| static bool | is_rfc3986_unreserved (unsigned char c) |
| static bool | is_token_character (int c) |
| std::string | obfuscateAuth (const std::string &input) |
| void | splitHostCgi (std::string_view target, std::string &host, std::string &cgi) |
| void | stripCgi (std::string &url, const std::unordered_set< std::string > &cgiKeys) |
| void | stripCgi (XrdOucString &url, const std::unordered_set< std::string > &cgiKeys) |
| #define ENODATA ENOATTR |
Definition at line 69 of file XrdOucUtils.cc.
| #define SHFT | ( | k | ) |
Referenced by XrdOucUtils::Log10(), and XrdOucUtils::Log2().
| #define SHFT | ( | k, | |
| m ) |
|
static |
Definition at line 1673 of file XrdOucUtils.cc.
Referenced by XrdOucUtils::UrlDecode().
|
static |
Definition at line 1642 of file XrdOucUtils.cc.
Referenced by XrdOucUtils::UrlEncode().
|
static |
Returns a boolean indicating whether 'c' is a valid token character or not. See https://datatracker.ietf.org/doc/html/rfc6750#section-2.1 for details.
Definition at line 1588 of file XrdOucUtils.cc.
Referenced by obfuscateAuth(), and stripCgi().
| std::string obfuscateAuth | ( | const std::string & | input | ) |
This function obfuscates away authz= cgi elements and/or HTTP authorization headers from URL or other log line strings which might contain them.
| input | the string to obfuscate |
Definition at line 1610 of file XrdOucUtils.cc.
References is_token_character().
Referenced by XrdPfc::Cache::Attach(), XrdPosixXrootd::Close(), XrdPosixFile::DelayedDestroy(), XrdPosixFile::DelayedDestroy(), XrdPosixPrepIO::Disable(), XrdCl::URL::FromString(), XrdPssSys::FSctl(), XrdPssCks::Get(), XrdCl::URL::GetObfuscatedURL(), XrdCl::Utils::LogPropertyList(), main(), XrdPssSys::Mkdir(), XrdPssFile::Open(), XrdPssDir::Opendir(), XrdHttpProtocol::Process(), XrdHttpReq::ProcessHTTPReq(), XrdPssSys::Remdir(), XrdPssSys::Rename(), XrdCl::Message::SetDescription(), XrdPssSys::Stat(), XrdPssSys::Truncate(), and XrdPssSys::Unlink().
| void splitHostCgi | ( | std::string_view | target, |
| std::string & | host, | ||
| std::string & | cgi ) |
Split a "host[?cgi]" string at its first '?'.
| target | the "host[?cgi]" string to split |
| host | output: the portion before the first '?', or the whole string when target contains no '?' |
| cgi | output: the first '?' and everything after it (so it begins with '?'), or empty when target contains no '?' |
Definition at line 1751 of file XrdOucUtils.cc.
Referenced by XrdXrootdRedirHelper::Redirect().
| void stripCgi | ( | std::string & | url, |
| const std::unordered_set< std::string > & | cgiKeys ) |
Strip selected CGI elements (e.g. "authz=...") from a string/URL.
| url | the string/URL to sanitize |
| cgiKeys | CGI parameter names to remove (without the trailing '=') |
Definition at line 1717 of file XrdOucUtils.cc.
References is_token_character().
Referenced by XrdHttpReq::Redir(), and stripCgi().
| void stripCgi | ( | XrdOucString & | url, |
| const std::unordered_set< std::string > & | cgiKeys ) |
Definition at line 1744 of file XrdOucUtils.cc.
References XrdOucString::c_str(), and stripCgi().