33 #include <sys/types.h> 35 #include <sys/mount.h> 40 #define DETECT_DIR_INDEX 0 41 #define CONNECT_TIMEOUT 60 42 #define TRANSFER_TIMEOUT_MAX 60 * 60 44 #define EXPLICITLY_NO_PROXY "_none_" 46 #undef CURLVERSION_AT_LEAST 47 #define CURLVERSION_AT_LEAST(M,N,O) LIBCURL_VERSION_NUM >= ((((M)<<8)+(N))<<8)+(O) 54 inline void globalInitOnce()
57 static bool once __attribute__ ((__unused__)) = ( [] {
58 if ( curl_global_init( CURL_GLOBAL_ALL ) != 0 )
59 WAR <<
"curl global init failed" << endl;
63 int log_curl(CURL *
curl, curl_infotype info,
64 char *ptr,
size_t len,
void *max_lvl)
70 case CURLINFO_TEXT: lvl = 1; pfx =
"*";
break;
71 case CURLINFO_HEADER_IN: lvl = 2; pfx =
"<";
break;
72 case CURLINFO_HEADER_OUT: lvl = 2; pfx =
">";
break;
75 if( lvl > 0 && max_lvl != NULL && lvl <= *((
long *)max_lvl))
77 std::string msg(ptr, len);
78 std::list<std::string> lines;
79 std::list<std::string>::const_iterator line;
81 for(line = lines.begin(); line != lines.end(); ++line)
83 DBG << pfx <<
" " << *line << endl;
89 static size_t log_redirects_curl(
char *ptr,
size_t size,
size_t nmemb,
void *userdata)
93 char * lstart = ptr, * lend = ptr;
95 size_t max = size * nmemb;
99 for (lstart = lend; *lend !=
'\n' && pos < max; ++lend, ++pos);
102 if ( lstart[0] ==
'L' 110 && lstart[8] ==
':' )
112 std::string line { lstart, *(lend-1)==
'\r' ? lend-1 : lend };
113 DBG <<
"redirecting to " << line << endl;
115 *
reinterpret_cast<std::string *
>( userdata ) = line;
141 inline int getZYPP_MEDIA_CURL_IPRESOLVE()
144 if (
const char * envp = getenv(
"ZYPP_MEDIA_CURL_IPRESOLVE" ) )
146 WAR <<
"env set: $ZYPP_MEDIA_CURL_IPRESOLVE='" << envp <<
"'" << endl;
147 if ( strcmp( envp,
"4" ) == 0 ) ret = 4;
148 else if ( strcmp( envp,
"6" ) == 0 ) ret = 6;
156 static int _v = getZYPP_MEDIA_CURL_IPRESOLVE();
167 ProgressData( CURL *_curl, time_t _timeout = 0,
const Url & _url = Url(),
168 ByteCount expectedFileSize_r = 0,
169 callback::SendReport<DownloadProgressReport> *_report =
nullptr )
184 callback::SendReport<DownloadProgressReport> *
report;
201 void updateStats(
double dltotal = 0.0,
double dlnow = 0.0 )
209 if ( dlnow && dlnow !=
_dnlNow )
250 int reportProgress()
const 280 inline void escape(
string & str_r,
281 const char char_r,
const string & escaped_r ) {
283 pos != string::npos; pos = str_r.find( char_r, pos ) ) {
284 str_r.replace( pos, 1, escaped_r );
288 inline string escapedPath(
string path_r ) {
289 escape( path_r,
' ',
"%20" );
293 inline string unEscape(
string text_r ) {
294 char * tmp = curl_unescape( text_r.c_str(), 0 );
308 std::string param(
url.getQueryParam(
"timeout"));
311 long num = str::strtonum<long>(param);
316 if ( !
url.getUsername().empty() )
319 if (
url.getPassword().size() )
325 if ( (
url.getScheme() ==
"ftp" ||
url.getScheme() ==
"tftp" ) && s.
username().empty() )
329 if (
url.getScheme() ==
"https" )
334 std::string verify(
url.getQueryParam(
"ssl_verify"));
335 if( verify.empty() ||
341 else if( verify ==
"no")
348 std::vector<std::string> flags;
349 std::vector<std::string>::const_iterator flag;
350 str::split( verify, std::back_inserter(flags),
",");
351 for(flag = flags.begin(); flag != flags.end(); ++flag)
355 else if( *flag ==
"peer")
363 Pathname ca_path(
url.getQueryParam(
"ssl_capath") );
364 if( ! ca_path.empty())
372 Pathname client_cert(
url.getQueryParam(
"ssl_clientcert") );
373 if( ! client_cert.empty())
380 Pathname client_key(
url.getQueryParam(
"ssl_clientkey") );
381 if( ! client_key.empty())
389 param =
url.getQueryParam(
"proxy" );
390 if ( ! param.empty() )
401 string proxyport(
url.getQueryParam(
"proxyport" ) );
402 if ( ! proxyport.empty() ) {
403 param +=
":" + proxyport;
410 param =
url.getQueryParam(
"proxyuser" );
411 if ( ! param.empty() )
418 param =
url.getQueryParam(
"auth");
419 if (!param.empty() && (
url.getScheme() ==
"http" ||
url.getScheme() ==
"https"))
423 CurlAuthData::auth_type_str2long(param);
427 DBG <<
"Rethrowing as MediaUnauthorizedException.";
434 param =
url.getQueryParam(
"head_requests");
435 if( !param.empty() && param ==
"no" )
452 s.
setProxy( u.asString( url::ViewOption::WITH_SCHEME + url::ViewOption::WITH_HOST + url::ViewOption::WITH_PORT ) );
465 Pathname MediaCurl::_cookieFile =
"/var/lib/YaST2/cookies";
477 static const std::string
_value(
479 "X-ZYpp-AnonymousId: %s",
480 Target::anonymousUniqueId(
Pathname() ).c_str() ) )
495 static const std::string
_value(
497 "X-ZYpp-DistributionFlavor: %s",
498 Target::distributionFlavor(
Pathname() ).c_str() ) )
513 static const std::string
_value(
515 "ZYpp %s (curl %s) %s" 517 , curl_version_info(CURLVERSION_NOW)->version
518 , Target::targetDistribution(
Pathname() ).c_str()
527 #define SET_OPTION(opt,val) do { \ 528 ret = curl_easy_setopt ( _curl, opt, val ); \ 530 ZYPP_THROW(MediaCurlSetOptException(_url, _curlError)); \ 534 #define SET_OPTION_OFFT(opt,val) SET_OPTION(opt,(curl_off_t)val) 535 #define SET_OPTION_LONG(opt,val) SET_OPTION(opt,(long)val) 536 #define SET_OPTION_VOID(opt,val) SET_OPTION(opt,(void*)val) 538 MediaCurl::MediaCurl(
const Url & url_r,
539 const Pathname & attach_point_hint_r )
549 MIL <<
"MediaCurl::MediaCurl(" << url_r <<
", " << attach_point_hint_r <<
")" << endl;
557 char *atemp = ::strdup( apath.
asString().c_str());
560 atemp == NULL || (atest=::mkdtemp(atemp)) == NULL)
562 WAR <<
"attach point " << ainfo.
path()
563 <<
" is not useable for " << url_r.
getScheme() << endl;
566 else if( atest != NULL)
614 curl_version_info_data *curl_info = NULL;
615 curl_info = curl_version_info(CURLVERSION_NOW);
617 if (curl_info->protocols)
619 const char *
const *proto;
622 for(proto=curl_info->protocols; !found && *proto; ++proto)
624 if( scheme == std::string((
const char *)*proto))
629 std::string msg(
"Unsupported protocol '");
640 char *ptr = getenv(
"ZYPP_MEDIA_CURL_DEBUG");
641 _curlDebug = (ptr && *ptr) ? str::strtonum<long>( ptr) : 0L;
644 curl_easy_setopt(
_curl, CURLOPT_VERBOSE, 1L);
645 curl_easy_setopt(
_curl, CURLOPT_DEBUGFUNCTION, log_curl);
650 curl_easy_setopt(
_curl, CURLOPT_HEADERFUNCTION, log_redirects_curl);
652 CURLcode ret = curl_easy_setopt(
_curl, CURLOPT_ERRORBUFFER,
_curlError );
699 case 4:
SET_OPTION(CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
break;
700 case 6:
SET_OPTION(CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V6);
break;
724 #if CURLVERSION_AT_LEAST(7,19,4) 726 SET_OPTION( CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTPS );
744 #ifdef CURLSSLOPT_ALLOW_BEAST 746 ret = curl_easy_setopt(
_curl, CURLOPT_SSL_OPTIONS, CURLSSLOPT_ALLOW_BEAST );
755 SET_OPTION(CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);
771 if (use_auth.empty())
772 use_auth =
"digest,basic";
774 if( auth != CURLAUTH_NONE)
776 DBG <<
"Enabling HTTP authentication methods: " << use_auth
777 <<
" (CURLOPT_HTTPAUTH=" << auth <<
")" << std::endl;
786 SET_OPTION(CURLOPT_PROXYAUTH, CURLAUTH_BASIC|CURLAUTH_DIGEST|CURLAUTH_NTLM );
796 if ( proxyuserpwd.empty() )
801 DBG <<
"Proxy: ~/.curlrc does not contain the proxy-user option" << endl;
805 DBG <<
"Proxy: using proxy-user from ~/.curlrc" << endl;
813 if ( ! proxyuserpwd.empty() )
815 SET_OPTION(CURLOPT_PROXYUSERPWD, unEscape( proxyuserpwd ).c_str());
818 #if CURLVERSION_AT_LEAST(7,19,4) 823 DBG <<
"Proxy: explicitly NOPROXY" << endl;
829 DBG <<
"Proxy: not explicitly set" << endl;
830 DBG <<
"Proxy: libcurl may look into the environment" << endl;
841 #if CURLVERSION_AT_LEAST(7,15,5) 853 MIL <<
"No cookies requested" << endl;
858 #if CURLVERSION_AT_LEAST(7,18,0) 863 for ( TransferSettings::Headers::const_iterator it = vol_settings.
headersBegin();
895 _curl = curl_easy_init();
932 curl_easy_cleanup(
_curl );
1048 bool timeout_reached)
const 1053 if (filename.
empty())
1062 case CURLE_UNSUPPORTED_PROTOCOL:
1063 err =
" Unsupported protocol";
1066 err +=
" or redirect (";
1071 case CURLE_URL_MALFORMAT:
1072 case CURLE_URL_MALFORMAT_USER:
1075 case CURLE_LOGIN_DENIED:
1079 case CURLE_HTTP_RETURNED_ERROR:
1081 long httpReturnCode = 0;
1082 CURLcode infoRet = curl_easy_getinfo(
_curl,
1083 CURLINFO_RESPONSE_CODE,
1085 if ( infoRet == CURLE_OK )
1087 string msg =
"HTTP response: " +
str::numstring( httpReturnCode );
1088 switch ( httpReturnCode )
1094 DBG << msg <<
" Login failed (URL: " <<
url.
asString() <<
")" << std::endl;
1095 DBG <<
"MediaUnauthorizedException auth hint: '" << auth_hint <<
"'" << std::endl;
1110 if (
url.
getHost().find(
".suse.com") != string::npos )
1111 msg403 =
_(
"Visit the SUSE Customer Center to check whether your registration is valid and has not expired.");
1112 else if (
url.
asString().find(
"novell.com") != string::npos)
1113 msg403 =
_(
"Visit the Novell Customer Center to check whether your registration is valid and has not expired.");
1126 string msg =
"Unable to retrieve HTTP response:";
1132 case CURLE_FTP_COULDNT_RETR_FILE:
1133 #if CURLVERSION_AT_LEAST(7,16,0) 1134 case CURLE_REMOTE_FILE_NOT_FOUND:
1136 case CURLE_FTP_ACCESS_DENIED:
1137 case CURLE_TFTP_NOTFOUND:
1138 err =
"File not found";
1141 case CURLE_BAD_PASSWORD_ENTERED:
1142 case CURLE_FTP_USER_PASSWORD_INCORRECT:
1143 err =
"Login failed";
1145 case CURLE_COULDNT_RESOLVE_PROXY:
1146 case CURLE_COULDNT_RESOLVE_HOST:
1147 case CURLE_COULDNT_CONNECT:
1148 case CURLE_FTP_CANT_GET_HOST:
1149 err =
"Connection failed";
1151 case CURLE_WRITE_ERROR:
1152 err =
"Write error";
1154 case CURLE_PARTIAL_FILE:
1155 case CURLE_OPERATION_TIMEDOUT:
1156 timeout_reached =
true;
1158 case CURLE_ABORTED_BY_CALLBACK:
1159 if( timeout_reached )
1161 err =
"Timeout reached";
1169 case CURLE_SSL_PEER_CERTIFICATE:
1215 string urlBuffer( curlUrl.
asString());
1216 CURLcode ret = curl_easy_setopt(
_curl, CURLOPT_URL,
1217 urlBuffer.c_str() );
1229 ret = curl_easy_setopt(
_curl, CURLOPT_NOBODY, 1L );
1231 ret = curl_easy_setopt(
_curl, CURLOPT_RANGE,
"0-1" );
1234 curl_easy_setopt(
_curl, CURLOPT_NOBODY, 0L);
1235 curl_easy_setopt(
_curl, CURLOPT_RANGE, NULL );
1241 curl_easy_setopt(
_curl, CURLOPT_HTTPGET, 1L );
1245 AutoFILE file { ::fopen(
"/dev/null",
"w" ) };
1247 ERR <<
"fopen failed for /dev/null" << endl;
1248 curl_easy_setopt(
_curl, CURLOPT_NOBODY, 0L);
1249 curl_easy_setopt(
_curl, CURLOPT_RANGE, NULL );
1255 curl_easy_setopt(
_curl, CURLOPT_HTTPGET, 1L );
1262 ret = curl_easy_setopt(
_curl, CURLOPT_WRITEDATA, (*file) );
1265 curl_easy_setopt(
_curl, CURLOPT_RANGE, NULL );
1266 curl_easy_setopt(
_curl, CURLOPT_NOBODY, 0L);
1272 curl_easy_setopt(
_curl, CURLOPT_HTTPGET, 1L );
1279 CURLcode ok = curl_easy_perform(
_curl );
1280 MIL <<
"perform code: " << ok <<
" [ " << curl_easy_strerror(ok) <<
" ]" << endl;
1285 curl_easy_setopt(
_curl, CURLOPT_NOBODY, 0L);
1295 curl_easy_setopt(
_curl, CURLOPT_HTTPGET, 1L);
1304 curl_easy_setopt(
_curl, CURLOPT_RANGE, NULL);
1325 return ( ok == CURLE_OK );
1331 #if DETECT_DIR_INDEX 1344 bool not_a_file =
false;
1346 CURLcode ret = curl_easy_getinfo(
_curl,
1347 CURLINFO_EFFECTIVE_URL,
1349 if ( ret == CURLE_OK && ptr != NULL)
1354 std::string path( eurl.getPathName());
1355 if( !path.empty() && path !=
"/" && *path.rbegin() ==
'/')
1357 DBG <<
"Effective url (" 1359 <<
") seems to provide the index of a directory" 1378 DBG <<
"assert_dir " << dest.
dirname() <<
" failed" << endl;
1388 ERR <<
"out of memory for temp file name" << endl;
1392 AutoFD tmp_fd { ::mkostemp( buf, O_CLOEXEC ) };
1395 ERR <<
"mkstemp failed for file '" << destNew <<
"'" << endl;
1400 file = ::fdopen( tmp_fd,
"we" );
1403 ERR <<
"fopen failed for file '" << destNew <<
"'" << endl;
1406 tmp_fd.resetDispose();
1409 DBG <<
"dest: " << dest << endl;
1410 DBG <<
"temp: " << destNew << endl;
1415 curl_easy_setopt(
_curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
1416 curl_easy_setopt(
_curl, CURLOPT_TIMEVALUE, (
long)
PathInfo(target).mtime());
1420 curl_easy_setopt(
_curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_NONE);
1421 curl_easy_setopt(
_curl, CURLOPT_TIMEVALUE, 0L);
1429 curl_easy_setopt(
_curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_NONE);
1430 curl_easy_setopt(
_curl, CURLOPT_TIMEVALUE, 0L);
1434 long httpReturnCode = 0;
1435 CURLcode infoRet = curl_easy_getinfo(
_curl,
1436 CURLINFO_RESPONSE_CODE,
1438 bool modified =
true;
1439 if (infoRet == CURLE_OK)
1442 if ( httpReturnCode == 304
1445 DBG <<
" Not modified.";
1452 WAR <<
"Could not get the reponse code." << endl;
1455 if (modified || infoRet != CURLE_OK)
1460 ERR <<
"Failed to chmod file " << destNew << endl;
1464 if ( ::fclose( file ) )
1466 ERR <<
"Fclose failed for file '" << destNew <<
"'" << endl;
1471 if (
rename( destNew, dest ) != 0 ) {
1472 ERR <<
"Rename failed" << endl;
1475 destNew.resetDispose();
1511 string urlBuffer( curlUrl.
asString());
1512 CURLcode ret = curl_easy_setopt(
_curl, CURLOPT_URL,
1513 urlBuffer.c_str() );
1518 ret = curl_easy_setopt(
_curl, CURLOPT_WRITEDATA, file );
1527 if ( curl_easy_setopt(
_curl, CURLOPT_PROGRESSDATA, &progressData ) != 0 ) {
1528 WAR <<
"Can't set CURLOPT_PROGRESSDATA: " <<
_curlError << endl;;
1531 ret = curl_easy_perform(
_curl );
1532 #if CURLVERSION_AT_LEAST(7,19,4) 1537 if ( ftell(file) == 0 && ret == 0 )
1539 long httpReturnCode = 33;
1540 if ( curl_easy_getinfo(
_curl, CURLINFO_RESPONSE_CODE, &httpReturnCode ) == CURLE_OK && httpReturnCode == 200 )
1542 long conditionUnmet = 33;
1543 if ( curl_easy_getinfo(
_curl, CURLINFO_CONDITION_UNMET, &conditionUnmet ) == CURLE_OK && conditionUnmet )
1545 WAR <<
"TIMECONDITION unmet - retry without." << endl;
1546 curl_easy_setopt(
_curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_NONE);
1547 curl_easy_setopt(
_curl, CURLOPT_TIMEVALUE, 0L);
1548 ret = curl_easy_perform(
_curl );
1554 if ( curl_easy_setopt(
_curl, CURLOPT_PROGRESSDATA, NULL ) != 0 ) {
1555 WAR <<
"Can't unset CURLOPT_PROGRESSDATA: " <<
_curlError << endl;;
1561 <<
", temp file size " << ftell(file)
1562 <<
" bytes." << endl;
1569 if ( progressData.fileSizeExceeded )
1580 #if DETECT_DIR_INDEX 1585 #endif // DETECT_DIR_INDEX 1595 for ( filesystem::DirContent::const_iterator it = content.begin(); it != content.end(); ++it ) {
1596 Pathname filename = dirname + it->name;
1599 switch ( it->type ) {
1606 getDir( filename, recurse_r );
1610 WAR <<
"Ignore error (" << res <<
") on creating local directory '" <<
localPath( filename ) <<
"'" << endl;
1624 const Pathname & dirname,
bool dots )
const 1632 const Pathname & dirname,
bool dots )
const 1641 ProgressData *pdata =
reinterpret_cast<ProgressData *
>( clientp );
1647 pdata->updateStats( 0.0, dlnow );
1648 return pdata->reportProgress();
1655 ProgressData *pdata =
reinterpret_cast<ProgressData *
>( clientp );
1659 long httpReturnCode = 0;
1660 if ( curl_easy_getinfo( pdata->curl, CURLINFO_RESPONSE_CODE, &httpReturnCode ) != CURLE_OK || httpReturnCode == 0 )
1661 return aliveCallback( clientp, dltotal, dlnow, ultotal, ulnow );
1663 pdata->updateStats( dltotal, dlnow );
1664 return pdata->reportProgress();
1671 ProgressData *pdata =
reinterpret_cast<ProgressData *
>(clientp);
1672 return pdata ? pdata->curl : 0;
1679 long auth_info = CURLAUTH_NONE;
1682 curl_easy_getinfo(
_curl, CURLINFO_HTTPAUTH_AVAIL, &auth_info);
1684 if(infoRet == CURLE_OK)
1698 ProgressData *data =
reinterpret_cast<ProgressData *
>(clientp);
1700 data->_expectedFileSize = expectedFileSize;
1715 if (cmcred && firstTry)
1718 DBG <<
"got stored credentials:" << endl << *credentials << endl;
1733 curlcred->setUsername(cmcred->username());
1742 curlcred->setAuthType(availAuthTypes);
1745 if (auth_report->prompt(
_url, prompt_msg, *curlcred))
1747 DBG <<
"callback answer: retry" << endl
1748 <<
"CurlAuthData: " << *curlcred << endl;
1750 if (curlcred->valid())
1752 credentials = curlcred;
1766 DBG <<
"callback answer: cancel" << endl;
1782 if (credentials->authType() == CURLAUTH_NONE)
1783 credentials->setAuthType(availAuthTypes);
1786 if (credentials->authType() != CURLAUTH_NONE)
1790 ret = curl_easy_setopt(
_curl, CURLOPT_HTTPAUTH, credentials->authType());
1796 credentials->setUrl(
_url);
std::string getScheme() const
Returns the scheme name of the 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'.
const Pathname & path() const
Return current Pathname.
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.
static ZConfig & instance()
Singleton ctor.
Flag to request encoded string(s).
Store and operate with byte count.
Pathname extend(const std::string &r) const
Append string r to the last component of the path.
const char * c_str() const
String representation.
void setPathParams(const std::string ¶ms)
Set the path parameters.
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.
unsigned split(const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=" \)
Split line_r into words.
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.
int ZYPP_MEDIA_CURL_IPRESOLVE()
bool empty() const
Test for an empty path.
#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.
std::string asString() const
Returns a default string representation of the Url object.
std::string escape(const C_Str &str_r, const char sep_r)
Escape desired character c using a backslash.
std::string getQueryParam(const std::string ¶m, EEncoding eflag=zypp::url::E_DECODED) const
Return the value for the specified query parameter.
std::string trim(const std::string &s, const Trim trim_r)
int unlink(const Pathname &path)
Like 'unlink'.
const std::string & asString() const
String representation.
int rename(const Pathname &oldpath, const Pathname &newpath)
Like 'rename'.
std::string asUserHistory() const
A single (multiline) string composed of asUserString and historyAsString.
Pathname dirname() const
Return all but the last component od this path.
std::list< DirEntry > DirContent
Returned by readdir.
bool isValid() const
Verifies the Url.
std::string numstring(char n, int w=0)
void resetDispose()
Set no dispose function.
int rmdir(const Pathname &path)
Like 'rmdir'.
Pathname absolutename() const
Return this path, adding a leading '/' if relative.
Base class for Exception.
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.
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...
Wrapper class for ::stat/::lstat.
AutoDispose<FILE*> calling ::fclose
mode_t applyUmaskTo(mode_t mode_r)
Modify mode_r according to the current umask ( mode_r & ~getUmask() ).
Easy-to use interface to the ZYPP dependency resolver.
void delQueryParam(const std::string ¶m)
remove the specified query parameter.
std::string getUsername(EEncoding eflag=zypp::url::E_DECODED) const
Returns the username from the URL authority.
const std::string & msg() const
Return the message string provided to the ctor.