34 #include <sys/types.h>
36 #include <sys/mount.h>
41 #define DETECT_DIR_INDEX 0
42 #define CONNECT_TIMEOUT 60
43 #define TRANSFER_TIMEOUT_MAX 60 * 60
45 #define EXPLICITLY_NO_PROXY "_none_"
47 #undef CURLVERSION_AT_LEAST
48 #define CURLVERSION_AT_LEAST(M,N,O) LIBCURL_VERSION_NUM >= ((((M)<<8)+(N))<<8)+(O)
51 using namespace zypp::base;
58 extern "C" void _do_free_once()
60 curl_global_cleanup();
63 extern "C" void globalFreeOnce()
68 extern "C" void _do_init_once()
70 CURLcode ret = curl_global_init( CURL_GLOBAL_ALL );
73 WAR <<
"curl global init failed" << endl;
86 inline void globalInitOnce()
91 int log_curl(CURL *
curl, curl_infotype info,
92 char *ptr,
size_t len,
void *max_lvl)
94 if ( max_lvl ==
nullptr )
97 long maxlvl = *((
long *)max_lvl);
102 case CURLINFO_TEXT:
if ( maxlvl < 1 )
return 0; pfx =
'*';
break;
103 case CURLINFO_HEADER_IN:
if ( maxlvl < 2 )
return 0; pfx =
'<';
break;
104 case CURLINFO_HEADER_OUT:
if ( maxlvl < 2 )
return 0; pfx =
'>';
break;
109 std::vector<std::string> lines;
110 zypp::str::split( std::string(ptr,len), std::back_inserter(lines),
"\r\n" );
111 for(
const auto & line : lines )
115 if ( pos == std::string::npos )
117 DBG << pfx <<
" " << line.substr( 0, pos ) <<
" <credentials removed>" << std::endl;
120 DBG << pfx <<
" " << line << std::endl;
127 void *ptr,
size_t size,
size_t nmemb,
void *stream)
131 char * lstart = (
char *)ptr, * lend = (
char *)ptr;
133 size_t max = size * nmemb;
134 while (pos + 1 < max)
137 for (lstart = lend; *lend !=
'\n' && pos < max; ++lend, ++pos);
140 string line(lstart, lend);
141 if (line.find(
"Location") != string::npos)
143 DBG <<
"redirecting to " << line << endl;
168 inline int getZYPP_MEDIA_CURL_IPRESOLVE()
171 if (
const char * envp = getenv(
"ZYPP_MEDIA_CURL_IPRESOLVE" ) )
173 WAR <<
"env set: $ZYPP_MEDIA_CURL_IPRESOLVE='" << envp <<
"'" << endl;
174 if ( strcmp( envp,
"4" ) == 0 ) ret = 4;
175 else if ( strcmp( envp,
"6" ) == 0 ) ret = 6;
183 static int _v = getZYPP_MEDIA_CURL_IPRESOLVE();
194 ProgressData( CURL *_curl, time_t _timeout = 0,
const Url & _url = Url(),
195 ByteCount expectedFileSize_r = 0,
196 callback::SendReport<DownloadProgressReport> *_report =
nullptr )
211 callback::SendReport<DownloadProgressReport> *
report;
228 void updateStats(
double dltotal = 0.0,
double dlnow = 0.0 )
236 if ( dlnow && dlnow !=
_dnlNow )
277 int reportProgress()
const
307 inline void escape(
string & str_r,
308 const char char_r,
const string & escaped_r ) {
310 pos != string::npos; pos = str_r.find( char_r, pos ) ) {
311 str_r.replace( pos, 1, escaped_r );
315 inline string escapedPath(
string path_r ) {
316 escape( path_r,
' ',
"%20" );
320 inline string unEscape(
string text_r ) {
321 char * tmp = curl_unescape( text_r.c_str(), 0 );
338 long num = str::strtonum<long>(param);
362 if( verify.empty() ||
368 else if( verify ==
"no")
375 std::vector<std::string> flags;
376 std::vector<std::string>::const_iterator flag;
377 str::split( verify, std::back_inserter(flags),
",");
378 for(flag = flags.begin(); flag != flags.end(); ++flag)
382 else if( *flag ==
"peer")
391 if( ! ca_path.empty())
393 if( !PathInfo(ca_path).isDir() || ! ca_path.absolute())
400 if( ! client_cert.empty())
402 if( !PathInfo(client_cert).isFile() || !client_cert.absolute())
408 if( ! client_key.empty())
410 if( !PathInfo(client_key).isFile() || !client_key.absolute())
417 if ( ! param.empty() )
429 if ( ! proxyport.empty() ) {
430 param +=
":" + proxyport;
438 if ( ! param.empty() )
450 CurlAuthData::auth_type_str2long(param);
454 DBG <<
"Rethrowing as MediaUnauthorizedException.";
462 if( !param.empty() && param ==
"no" )
479 s.
setProxy( u.asString( url::ViewOption::WITH_SCHEME + url::ViewOption::WITH_HOST + url::ViewOption::WITH_PORT ) );
492 Pathname MediaCurl::_cookieFile =
"/var/lib/YaST2/cookies";
504 static const std::string
_value(
506 "X-ZYpp-AnonymousId: %s",
507 Target::anonymousUniqueId( Pathname() ).c_str() ) )
509 return _value.c_str();
522 static const std::string
_value(
524 "X-ZYpp-DistributionFlavor: %s",
525 Target::distributionFlavor( Pathname() ).c_str() ) )
527 return _value.c_str();
540 static const std::string
_value(
542 "ZYpp %s (curl %s) %s"
544 , curl_version_info(CURLVERSION_NOW)->version
545 , Target::targetDistribution( Pathname() ).c_str()
548 return _value.c_str();
554 #define SET_OPTION(opt,val) do { \
555 ret = curl_easy_setopt ( _curl, opt, val ); \
557 ZYPP_THROW(MediaCurlSetOptException(_url, _curlError)); \
561 #define SET_OPTION_OFFT(opt,val) SET_OPTION(opt,(curl_off_t)val)
562 #define SET_OPTION_LONG(opt,val) SET_OPTION(opt,(long)val)
563 #define SET_OPTION_VOID(opt,val) SET_OPTION(opt,(void*)val)
565 MediaCurl::MediaCurl(
const Url & url_r,
566 const Pathname & attach_point_hint_r )
576 MIL <<
"MediaCurl::MediaCurl(" << url_r <<
", " << attach_point_hint_r <<
")" << endl;
584 char *atemp = ::strdup( apath.asString().c_str());
586 if( !ainfo.isDir() || !ainfo.userMayRWX() ||
587 atemp == NULL || (atest=::mkdtemp(atemp)) == NULL)
589 WAR <<
"attach point " << ainfo.path()
590 <<
" is not useable for " << url_r.
getScheme() << endl;
593 else if( atest != NULL)
641 curl_version_info_data *curl_info = NULL;
642 curl_info = curl_version_info(CURLVERSION_NOW);
644 if (curl_info->protocols)
646 const char *
const *proto;
649 for(proto=curl_info->protocols; !found && *proto; ++proto)
651 if( scheme == std::string((
const char *)*proto))
656 std::string msg(
"Unsupported protocol '");
667 char *ptr = getenv(
"ZYPP_MEDIA_CURL_DEBUG");
668 _curlDebug = (ptr && *ptr) ? str::strtonum<long>( ptr) : 0L;
671 curl_easy_setopt( _curl, CURLOPT_VERBOSE, 1L);
672 curl_easy_setopt( _curl, CURLOPT_DEBUGFUNCTION, log_curl);
673 curl_easy_setopt( _curl, CURLOPT_DEBUGDATA, &
_curlDebug);
677 curl_easy_setopt(_curl, CURLOPT_HEADERFUNCTION, log_redirects_curl);
678 CURLcode ret = curl_easy_setopt( _curl, CURLOPT_ERRORBUFFER,
_curlError );
725 case 4:
SET_OPTION(CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
break;
726 case 6:
SET_OPTION(CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V6);
break;
750 #if CURLVERSION_AT_LEAST(7,19,4)
752 SET_OPTION( CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTPS );
770 #ifdef CURLSSLOPT_ALLOW_BEAST
772 ret = curl_easy_setopt( _curl, CURLOPT_SSL_OPTIONS, CURLSSLOPT_ALLOW_BEAST );
781 SET_OPTION(CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);
797 if (use_auth.empty())
798 use_auth =
"digest,basic";
800 if( auth != CURLAUTH_NONE)
802 DBG <<
"Enabling HTTP authentication methods: " << use_auth
803 <<
" (CURLOPT_HTTPAUTH=" << auth <<
")" << std::endl;
812 SET_OPTION(CURLOPT_PROXYAUTH, CURLAUTH_BASIC|CURLAUTH_DIGEST|CURLAUTH_NTLM );
822 if ( proxyuserpwd.empty() )
827 DBG <<
"Proxy: ~/.curlrc does not contain the proxy-user option" << endl;
831 DBG <<
"Proxy: using proxy-user from ~/.curlrc" << endl;
839 if ( ! proxyuserpwd.empty() )
841 SET_OPTION(CURLOPT_PROXYUSERPWD, unEscape( proxyuserpwd ).c_str());
844 #if CURLVERSION_AT_LEAST(7,19,4)
849 DBG <<
"Proxy: explicitly NOPROXY" << endl;
855 DBG <<
"Proxy: not explicitly set" << endl;
856 DBG <<
"Proxy: libcurl may look into the environment" << endl;
867 #if CURLVERSION_AT_LEAST(7,15,5)
880 MIL <<
"No cookies requested" << endl;
885 #if CURLVERSION_AT_LEAST(7,18,0)
890 for ( TransferSettings::Headers::const_iterator it = vol_settings.
headersBegin();
922 _curl = curl_easy_init();
959 curl_easy_cleanup( _curl );
1008 doGetFileCopy(filename, target, report, expectedFileSize_r);
1075 bool timeout_reached)
const
1080 if (filename.empty())
1089 case CURLE_UNSUPPORTED_PROTOCOL:
1090 case CURLE_URL_MALFORMAT:
1091 case CURLE_URL_MALFORMAT_USER:
1094 case CURLE_LOGIN_DENIED:
1098 case CURLE_HTTP_RETURNED_ERROR:
1100 long httpReturnCode = 0;
1101 CURLcode infoRet = curl_easy_getinfo( _curl,
1102 CURLINFO_RESPONSE_CODE,
1104 if ( infoRet == CURLE_OK )
1106 string msg =
"HTTP response: " +
str::numstring( httpReturnCode );
1107 switch ( httpReturnCode )
1113 DBG << msg <<
" Login failed (URL: " << url.
asString() <<
")" << std::endl;
1114 DBG <<
"MediaUnauthorizedException auth hint: '" << auth_hint <<
"'" << std::endl;
1129 if (url.
asString().find(
"novell.com") != string::npos)
1130 msg403 =
_(
"Visit the Novell Customer Center to check whether your registration is valid and has not expired.");
1138 DBG << msg <<
" (URL: " << url.
asString() <<
")" << std::endl;
1143 string msg =
"Unable to retrieve HTTP response:";
1144 DBG << msg <<
" (URL: " << url.
asString() <<
")" << std::endl;
1149 case CURLE_FTP_COULDNT_RETR_FILE:
1150 #if CURLVERSION_AT_LEAST(7,16,0)
1151 case CURLE_REMOTE_FILE_NOT_FOUND:
1153 case CURLE_FTP_ACCESS_DENIED:
1154 case CURLE_TFTP_NOTFOUND:
1155 err =
"File not found";
1158 case CURLE_BAD_PASSWORD_ENTERED:
1159 case CURLE_FTP_USER_PASSWORD_INCORRECT:
1160 err =
"Login failed";
1162 case CURLE_COULDNT_RESOLVE_PROXY:
1163 case CURLE_COULDNT_RESOLVE_HOST:
1164 case CURLE_COULDNT_CONNECT:
1165 case CURLE_FTP_CANT_GET_HOST:
1166 err =
"Connection failed";
1168 case CURLE_WRITE_ERROR:
1169 err =
"Write error";
1171 case CURLE_PARTIAL_FILE:
1172 case CURLE_OPERATION_TIMEDOUT:
1173 timeout_reached =
true;
1175 case CURLE_ABORTED_BY_CALLBACK:
1176 if( timeout_reached )
1178 err =
"Timeout reached";
1186 case CURLE_SSL_PEER_CERTIFICATE:
1206 DBG << filename.asString() << endl;
1231 string urlBuffer( curlUrl.
asString());
1232 CURLcode ret = curl_easy_setopt( _curl, CURLOPT_URL,
1233 urlBuffer.c_str() );
1245 ret = curl_easy_setopt( _curl, CURLOPT_NOBODY, 1L );
1247 ret = curl_easy_setopt( _curl, CURLOPT_RANGE,
"0-1" );
1250 curl_easy_setopt( _curl, CURLOPT_NOBODY, 0L);
1251 curl_easy_setopt( _curl, CURLOPT_RANGE, NULL );
1257 curl_easy_setopt( _curl, CURLOPT_HTTPGET, 1L );
1261 AutoFILE file { ::fopen(
"/dev/null",
"w" ) };
1263 ERR <<
"fopen failed for /dev/null" << endl;
1264 curl_easy_setopt( _curl, CURLOPT_NOBODY, 0L);
1265 curl_easy_setopt( _curl, CURLOPT_RANGE, NULL );
1271 curl_easy_setopt( _curl, CURLOPT_HTTPGET, 1L );
1278 ret = curl_easy_setopt( _curl, CURLOPT_WRITEDATA, (*file) );
1281 curl_easy_setopt( _curl, CURLOPT_RANGE, NULL );
1282 curl_easy_setopt( _curl, CURLOPT_NOBODY, 0L);
1288 curl_easy_setopt( _curl, CURLOPT_HTTPGET, 1L );
1295 CURLcode ok = curl_easy_perform( _curl );
1296 MIL <<
"perform code: " << ok <<
" [ " << curl_easy_strerror(ok) <<
" ]" << endl;
1301 curl_easy_setopt( _curl, CURLOPT_RANGE, NULL );
1302 curl_easy_setopt( _curl, CURLOPT_NOBODY, 0L);
1312 curl_easy_setopt( _curl, CURLOPT_HTTPGET, 1L);
1321 curl_easy_setopt( _curl, CURLOPT_RANGE, NULL);
1342 return ( ok == CURLE_OK );
1348 #if DETECT_DIR_INDEX
1361 bool not_a_file =
false;
1363 CURLcode ret = curl_easy_getinfo( _curl,
1364 CURLINFO_EFFECTIVE_URL,
1366 if ( ret == CURLE_OK && ptr != NULL)
1371 std::string path( eurl.getPathName());
1372 if( !path.empty() && path !=
"/" && *path.rbegin() ==
'/')
1374 DBG <<
"Effective url ("
1376 <<
") seems to provide the index of a directory"
1392 Pathname dest = target.absolutename();
1395 DBG <<
"assert_dir " << dest.dirname() <<
" failed" << endl;
1399 ManagedFile destNew { target.extend(
".new.zypp.XXXXXX" ) };
1405 ERR <<
"out of memory for temp file name" << endl;
1409 AutoFD tmp_fd { ::mkostemp( buf, O_CLOEXEC ) };
1412 ERR <<
"mkstemp failed for file '" << destNew <<
"'" << endl;
1417 file = ::fdopen( tmp_fd,
"we" );
1420 ERR <<
"fopen failed for file '" << destNew <<
"'" << endl;
1423 tmp_fd.resetDispose();
1426 DBG <<
"dest: " << dest << endl;
1427 DBG <<
"temp: " << destNew << endl;
1432 curl_easy_setopt(_curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
1433 curl_easy_setopt(_curl, CURLOPT_TIMEVALUE, (
long)PathInfo(target).mtime());
1437 curl_easy_setopt(_curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_NONE);
1438 curl_easy_setopt(_curl, CURLOPT_TIMEVALUE, 0L);
1446 curl_easy_setopt(_curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_NONE);
1447 curl_easy_setopt(_curl, CURLOPT_TIMEVALUE, 0L);
1451 long httpReturnCode = 0;
1452 CURLcode infoRet = curl_easy_getinfo(_curl,
1453 CURLINFO_RESPONSE_CODE,
1455 bool modified =
true;
1456 if (infoRet == CURLE_OK)
1459 if ( httpReturnCode == 304
1462 DBG <<
" Not modified.";
1469 WAR <<
"Could not get the reponse code." << endl;
1472 if (modified || infoRet != CURLE_OK)
1477 ERR <<
"Failed to chmod file " << destNew << endl;
1481 if ( ::fclose( file ) )
1483 ERR <<
"Fclose failed for file '" << destNew <<
"'" << endl;
1488 if (
rename( destNew, dest ) != 0 ) {
1489 ERR <<
"Rename failed" << endl;
1492 destNew.resetDispose();
1495 DBG <<
"done: " << PathInfo(dest) << endl;
1502 DBG << filename.asString() << endl;
1527 string urlBuffer( curlUrl.
asString());
1528 CURLcode ret = curl_easy_setopt( _curl, CURLOPT_URL,
1529 urlBuffer.c_str() );
1534 ret = curl_easy_setopt( _curl, CURLOPT_WRITEDATA, file );
1542 report->start(url, dest);
1543 if ( curl_easy_setopt( _curl, CURLOPT_PROGRESSDATA, &progressData ) != 0 ) {
1544 WAR <<
"Can't set CURLOPT_PROGRESSDATA: " <<
_curlError << endl;;
1547 ret = curl_easy_perform( _curl );
1548 #if CURLVERSION_AT_LEAST(7,19,4)
1553 if ( ftell(file) == 0 && ret == 0 )
1555 long httpReturnCode = 33;
1556 if ( curl_easy_getinfo( _curl, CURLINFO_RESPONSE_CODE, &httpReturnCode ) == CURLE_OK && httpReturnCode == 200 )
1558 long conditionUnmet = 33;
1559 if ( curl_easy_getinfo( _curl, CURLINFO_CONDITION_UNMET, &conditionUnmet ) == CURLE_OK && conditionUnmet )
1561 WAR <<
"TIMECONDITION unmet - retry without." << endl;
1562 curl_easy_setopt(_curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_NONE);
1563 curl_easy_setopt(_curl, CURLOPT_TIMEVALUE, 0L);
1564 ret = curl_easy_perform( _curl );
1570 if ( curl_easy_setopt( _curl, CURLOPT_PROGRESSDATA, NULL ) != 0 ) {
1571 WAR <<
"Can't unset CURLOPT_PROGRESSDATA: " <<
_curlError << endl;;
1577 <<
", temp file size " << ftell(file)
1578 <<
" bytes." << endl;
1585 if ( progressData.fileSizeExceeded )
1596 #if DETECT_DIR_INDEX
1601 #endif // DETECT_DIR_INDEX
1611 for ( filesystem::DirContent::const_iterator it = content.begin(); it != content.end(); ++it ) {
1612 Pathname filename = dirname + it->name;
1615 switch ( it->type ) {
1622 getDir( filename, recurse_r );
1626 WAR <<
"Ignore error (" << res <<
") on creating local directory '" <<
localPath( filename ) <<
"'" << endl;
1640 const Pathname & dirname,
bool dots )
const
1648 const Pathname & dirname,
bool dots )
const
1657 ProgressData *pdata =
reinterpret_cast<ProgressData *
>( clientp );
1663 pdata->updateStats( 0.0, dlnow );
1664 return pdata->reportProgress();
1671 ProgressData *pdata =
reinterpret_cast<ProgressData *
>( clientp );
1675 long httpReturnCode = 0;
1676 if ( curl_easy_getinfo( pdata->curl, CURLINFO_RESPONSE_CODE, &httpReturnCode ) != CURLE_OK || httpReturnCode == 0 )
1677 return aliveCallback( clientp, dltotal, dlnow, ultotal, ulnow );
1679 pdata->updateStats( dltotal, dlnow );
1680 return pdata->reportProgress();
1687 ProgressData *pdata =
reinterpret_cast<ProgressData *
>(clientp);
1688 return pdata ? pdata->curl : 0;
1695 long auth_info = CURLAUTH_NONE;
1698 curl_easy_getinfo(_curl, CURLINFO_HTTPAUTH_AVAIL, &auth_info);
1700 if(infoRet == CURLE_OK)
1714 ProgressData *data =
reinterpret_cast<ProgressData *
>(clientp);
1716 data->_expectedFileSize = expectedFileSize;
1725 Target_Ptr target = zypp::getZYpp()->getTarget();
1732 if (cmcred && firstTry)
1735 DBG <<
"got stored credentials:" << endl << *credentials << endl;
1750 curlcred->setUsername(cmcred->username());
1759 curlcred->setAuthType(availAuthTypes);
1762 if (auth_report->prompt(
_url, prompt_msg, *curlcred))
1764 DBG <<
"callback answer: retry" << endl
1765 <<
"CurlAuthData: " << *curlcred << endl;
1767 if (curlcred->valid())
1769 credentials = curlcred;
1783 DBG <<
"callback answer: cancel" << endl;
1799 if (credentials->authType() == CURLAUTH_NONE)
1800 credentials->setAuthType(availAuthTypes);
1803 if (credentials->authType() != CURLAUTH_NONE)
1807 ret = curl_easy_setopt(_curl, CURLOPT_HTTPAUTH, credentials->authType());
1813 credentials->setUrl(
_url);
void setPassword(const std::string &pass, EEncoding eflag=zypp::url::E_DECODED)
Set the password in the URL authority.
int assert_dir(const Pathname &path, unsigned mode)
Like 'mkdir -p'.
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.
static ZConfig & instance()
Singleton ctor.
const std::string & msg() const
Return the message string provided to the ctor.
Flag to request encoded string(s).
Store and operate with byte count.
std::string getPathName(EEncoding eflag=zypp::url::E_DECODED) const
Returns the path name from the URL.
std::string getHost(EEncoding eflag=zypp::url::E_DECODED) const
Returns the hostname or IP from the URL authority.
std::string escape(const C_Str &str_r, const char sep_r)
Escape desired character c using a backslash.
void setPathParams(const std::string ¶ms)
Set the path parameters.
pthread_once_t OnceFlag
The OnceFlag variable type.
std::string getUsername(EEncoding eflag=zypp::url::E_DECODED) const
Returns the username from the URL authority.
AutoDispose< const Pathname > ManagedFile
A Pathname plus associated cleanup code to be executed when path is no longer needed.
void setUsername(const std::string &user, EEncoding eflag=zypp::url::E_DECODED)
Set the username in the URL authority.
bool isValid() const
Verifies the Url.
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
AutoDispose<int> calling ::close
void setFragment(const std::string &fragment, EEncoding eflag=zypp::url::E_DECODED)
Set the fragment string in the URL.
std::string asString() const
Returns a default string representation of the Url object.
int ZYPP_MEDIA_CURL_IPRESOLVE()
#define ZYPP_RETHROW(EXCPT)
Drops a logline and rethrows, updating the CodeLocation.
void setPathName(const std::string &path, EEncoding eflag=zypp::url::E_DECODED)
Set the path name.
int assert_file_mode(const Pathname &path, unsigned mode)
Like assert_file but enforce mode even if the file already exists.
unsigned split(const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=" \t")
Split line_r into words.
void callOnce(OnceFlag &flag, void(*func)())
Call once function.
std::string trim(const std::string &s, const Trim trim_r)
int unlink(const Pathname &path)
Like 'unlink'.
int rename(const Pathname &oldpath, const Pathname &newpath)
Like 'rename'.
bool startsWith(const C_Str &str_r, const C_Str &prefix_r)
alias for hasPrefix
std::list< DirEntry > DirContent
Returned by readdir.
std::string getQueryParam(const std::string ¶m, EEncoding eflag=zypp::url::E_DECODED) const
Return the value for the specified query parameter.
std::string numstring(char n, int w=0)
void resetDispose()
Set no dispose function.
int rmdir(const Pathname &path)
Like 'rmdir'.
Base class for Exception.
bool strToBool(const C_Str &str, bool default_r)
Parse str into a bool depending on the default value.
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
std::string asUserHistory() const
A single (multiline) string composed of asUserString and historyAsString.
AutoDispose<FILE*> calling ::fclose
mode_t applyUmaskTo(mode_t mode_r)
Modify mode_r according to the current umask ( mode_r & ~getUmask() ).
std::string getScheme() const
Returns the scheme name of the URL.
std::string getPassword(EEncoding eflag=zypp::url::E_DECODED) const
Returns the password from the URL authority.
void delQueryParam(const std::string ¶m)
remove the specified query parameter.