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) 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)
98 case CURLINFO_TEXT: lvl = 1; pfx =
"*";
break;
99 case CURLINFO_HEADER_IN: lvl = 2; pfx =
"<";
break;
100 case CURLINFO_HEADER_OUT: lvl = 2; pfx =
">";
break;
103 if( lvl > 0 && max_lvl != NULL && lvl <= *((
long *)max_lvl))
105 std::string msg(ptr, len);
106 std::list<std::string> lines;
107 std::list<std::string>::const_iterator line;
109 for(line = lines.begin(); line != lines.end(); ++line)
111 DBG << pfx <<
" " << *line << endl;
117 static size_t log_redirects_curl(
char *ptr,
size_t size,
size_t nmemb,
void *userdata)
121 char * lstart = ptr, * lend = ptr;
123 size_t max = size * nmemb;
124 while (pos + 1 < max)
127 for (lstart = lend; *lend !=
'\n' && pos < max; ++lend, ++pos);
130 if ( lstart[0] ==
'L' 138 && lstart[8] ==
':' )
140 std::string line { lstart, *(lend-1)==
'\r' ? lend-1 : lend };
141 DBG <<
"redirecting to " << line << endl;
143 *
reinterpret_cast<std::string *
>( userdata ) = line;
169 inline int getZYPP_MEDIA_CURL_IPRESOLVE()
172 if (
const char * envp = getenv(
"ZYPP_MEDIA_CURL_IPRESOLVE" ) )
174 WAR <<
"env set: $ZYPP_MEDIA_CURL_IPRESOLVE='" << envp <<
"'" << endl;
175 if ( strcmp( envp,
"4" ) == 0 ) ret = 4;
176 else if ( strcmp( envp,
"6" ) == 0 ) ret = 6;
184 static int _v = getZYPP_MEDIA_CURL_IPRESOLVE();
195 ProgressData( CURL *_curl, time_t _timeout = 0,
const Url & _url = Url(),
196 ByteCount expectedFileSize_r = 0,
197 callback::SendReport<DownloadProgressReport> *_report =
nullptr )
212 callback::SendReport<DownloadProgressReport> *
report;
229 void updateStats(
double dltotal = 0.0,
double dlnow = 0.0 )
237 if ( dlnow && dlnow !=
_dnlNow )
278 int reportProgress()
const 308 inline void escape(
string & str_r,
309 const char char_r,
const string & escaped_r ) {
311 pos != string::npos; pos = str_r.find( char_r, pos ) ) {
312 str_r.replace( pos, 1, escaped_r );
316 inline string escapedPath(
string path_r ) {
317 escape( path_r,
' ',
"%20" );
321 inline string unEscape(
string text_r ) {
322 char * tmp = curl_unescape( text_r.c_str(), 0 );
336 std::string param(
url.getQueryParam(
"timeout"));
339 long num = str::strtonum<long>(param);
344 if ( !
url.getUsername().empty() )
347 if (
url.getPassword().size() )
353 if ( (
url.getScheme() ==
"ftp" ||
url.getScheme() ==
"tftp" ) && s.
username().empty() )
357 if (
url.getScheme() ==
"https" )
362 std::string verify(
url.getQueryParam(
"ssl_verify"));
363 if( verify.empty() ||
369 else if( verify ==
"no")
376 std::vector<std::string> flags;
377 std::vector<std::string>::const_iterator flag;
378 str::split( verify, std::back_inserter(flags),
",");
379 for(flag = flags.begin(); flag != flags.end(); ++flag)
383 else if( *flag ==
"peer")
391 Pathname ca_path(
url.getQueryParam(
"ssl_capath") );
392 if( ! ca_path.empty())
400 Pathname client_cert(
url.getQueryParam(
"ssl_clientcert") );
401 if( ! client_cert.empty())
408 Pathname client_key(
url.getQueryParam(
"ssl_clientkey") );
409 if( ! client_key.empty())
417 param =
url.getQueryParam(
"proxy" );
418 if ( ! param.empty() )
429 string proxyport(
url.getQueryParam(
"proxyport" ) );
430 if ( ! proxyport.empty() ) {
431 param +=
":" + proxyport;
438 param =
url.getQueryParam(
"proxyuser" );
439 if ( ! param.empty() )
446 param =
url.getQueryParam(
"auth");
447 if (!param.empty() && (
url.getScheme() ==
"http" ||
url.getScheme() ==
"https"))
451 CurlAuthData::auth_type_str2long(param);
455 DBG <<
"Rethrowing as MediaUnauthorizedException.";
462 param =
url.getQueryParam(
"head_requests");
463 if( !param.empty() && param ==
"no" )
480 s.
setProxy( u.asString( url::ViewOption::WITH_SCHEME + url::ViewOption::WITH_HOST + url::ViewOption::WITH_PORT ) );
493 Pathname MediaCurl::_cookieFile =
"/var/lib/YaST2/cookies";
505 static const std::string
_value(
507 "X-ZYpp-AnonymousId: %s",
508 Target::anonymousUniqueId(
Pathname() ).c_str() ) )
523 static const std::string
_value(
525 "X-ZYpp-DistributionFlavor: %s",
526 Target::distributionFlavor(
Pathname() ).c_str() ) )
541 static const std::string
_value(
543 "ZYpp %s (curl %s) %s" 545 , curl_version_info(CURLVERSION_NOW)->version
546 , Target::targetDistribution(
Pathname() ).c_str()
555 #define SET_OPTION(opt,val) do { \ 556 ret = curl_easy_setopt ( _curl, opt, val ); \ 558 ZYPP_THROW(MediaCurlSetOptException(_url, _curlError)); \ 562 #define SET_OPTION_OFFT(opt,val) SET_OPTION(opt,(curl_off_t)val) 563 #define SET_OPTION_LONG(opt,val) SET_OPTION(opt,(long)val) 564 #define SET_OPTION_VOID(opt,val) SET_OPTION(opt,(void*)val) 566 MediaCurl::MediaCurl(
const Url & url_r,
567 const Pathname & attach_point_hint_r )
577 MIL <<
"MediaCurl::MediaCurl(" << url_r <<
", " << attach_point_hint_r <<
")" << endl;
585 char *atemp = ::strdup( apath.
asString().c_str());
588 atemp == NULL || (atest=::mkdtemp(atemp)) == NULL)
590 WAR <<
"attach point " << ainfo.
path()
591 <<
" is not useable for " << url_r.
getScheme() << endl;
594 else if( atest != NULL)
642 curl_version_info_data *curl_info = NULL;
643 curl_info = curl_version_info(CURLVERSION_NOW);
645 if (curl_info->protocols)
647 const char *
const *proto;
650 for(proto=curl_info->protocols; !found && *proto; ++proto)
652 if( scheme == std::string((
const char *)*proto))
657 std::string msg(
"Unsupported protocol '");
668 char *ptr = getenv(
"ZYPP_MEDIA_CURL_DEBUG");
669 _curlDebug = (ptr && *ptr) ? str::strtonum<long>( ptr) : 0L;
672 curl_easy_setopt(
_curl, CURLOPT_VERBOSE, 1L);
673 curl_easy_setopt(
_curl, CURLOPT_DEBUGFUNCTION, log_curl);
678 curl_easy_setopt(
_curl, CURLOPT_HEADERFUNCTION, log_redirects_curl);
680 CURLcode ret = curl_easy_setopt(
_curl, CURLOPT_ERRORBUFFER,
_curlError );
727 case 4:
SET_OPTION(CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
break;
728 case 6:
SET_OPTION(CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V6);
break;
752 #if CURLVERSION_AT_LEAST(7,19,4) 754 SET_OPTION( CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTPS );
772 #ifdef CURLSSLOPT_ALLOW_BEAST 774 ret = curl_easy_setopt(
_curl, CURLOPT_SSL_OPTIONS, CURLSSLOPT_ALLOW_BEAST );
783 SET_OPTION(CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);
799 if (use_auth.empty())
800 use_auth =
"digest,basic";
802 if( auth != CURLAUTH_NONE)
804 DBG <<
"Enabling HTTP authentication methods: " << use_auth
805 <<
" (CURLOPT_HTTPAUTH=" << auth <<
")" << std::endl;
814 SET_OPTION(CURLOPT_PROXYAUTH, CURLAUTH_BASIC|CURLAUTH_DIGEST|CURLAUTH_NTLM );
824 if ( proxyuserpwd.empty() )
829 DBG <<
"Proxy: ~/.curlrc does not contain the proxy-user option" << endl;
833 DBG <<
"Proxy: using proxy-user from ~/.curlrc" << endl;
841 if ( ! proxyuserpwd.empty() )
843 SET_OPTION(CURLOPT_PROXYUSERPWD, unEscape( proxyuserpwd ).c_str());
846 #if CURLVERSION_AT_LEAST(7,19,4) 851 DBG <<
"Proxy: explicitly NOPROXY" << endl;
857 DBG <<
"Proxy: not explicitly set" << endl;
858 DBG <<
"Proxy: libcurl may look into the environment" << endl;
869 #if CURLVERSION_AT_LEAST(7,15,5) 881 MIL <<
"No cookies requested" << endl;
886 #if CURLVERSION_AT_LEAST(7,18,0) 891 for ( TransferSettings::Headers::const_iterator it = vol_settings.
headersBegin();
923 _curl = curl_easy_init();
960 curl_easy_cleanup(
_curl );
1076 bool timeout_reached)
const 1081 if (filename.
empty())
1090 case CURLE_UNSUPPORTED_PROTOCOL:
1091 err =
" Unsupported protocol";
1094 err +=
" or redirect (";
1099 case CURLE_URL_MALFORMAT:
1100 case CURLE_URL_MALFORMAT_USER:
1103 case CURLE_LOGIN_DENIED:
1107 case CURLE_HTTP_RETURNED_ERROR:
1109 long httpReturnCode = 0;
1110 CURLcode infoRet = curl_easy_getinfo(
_curl,
1111 CURLINFO_RESPONSE_CODE,
1113 if ( infoRet == CURLE_OK )
1115 string msg =
"HTTP response: " +
str::numstring( httpReturnCode );
1116 switch ( httpReturnCode )
1122 DBG << msg <<
" Login failed (URL: " <<
url.
asString() <<
")" << std::endl;
1123 DBG <<
"MediaUnauthorizedException auth hint: '" << auth_hint <<
"'" << std::endl;
1138 if (
url.
getHost().find(
".suse.com") != string::npos )
1139 msg403 =
_(
"Visit the SUSE Customer Center to check whether your registration is valid and has not expired.");
1140 else if (
url.
asString().find(
"novell.com") != string::npos)
1141 msg403 =
_(
"Visit the Novell Customer Center to check whether your registration is valid and has not expired.");
1154 string msg =
"Unable to retrieve HTTP response:";
1160 case CURLE_FTP_COULDNT_RETR_FILE:
1161 #if CURLVERSION_AT_LEAST(7,16,0) 1162 case CURLE_REMOTE_FILE_NOT_FOUND:
1164 case CURLE_FTP_ACCESS_DENIED:
1165 case CURLE_TFTP_NOTFOUND:
1166 err =
"File not found";
1169 case CURLE_BAD_PASSWORD_ENTERED:
1170 case CURLE_FTP_USER_PASSWORD_INCORRECT:
1171 err =
"Login failed";
1173 case CURLE_COULDNT_RESOLVE_PROXY:
1174 case CURLE_COULDNT_RESOLVE_HOST:
1175 case CURLE_COULDNT_CONNECT:
1176 case CURLE_FTP_CANT_GET_HOST:
1177 err =
"Connection failed";
1179 case CURLE_WRITE_ERROR:
1180 err =
"Write error";
1182 case CURLE_PARTIAL_FILE:
1183 case CURLE_OPERATION_TIMEDOUT:
1184 timeout_reached =
true;
1186 case CURLE_ABORTED_BY_CALLBACK:
1187 if( timeout_reached )
1189 err =
"Timeout reached";
1197 case CURLE_SSL_PEER_CERTIFICATE:
1243 string urlBuffer( curlUrl.
asString());
1244 CURLcode ret = curl_easy_setopt(
_curl, CURLOPT_URL,
1245 urlBuffer.c_str() );
1257 ret = curl_easy_setopt(
_curl, CURLOPT_NOBODY, 1L );
1259 ret = curl_easy_setopt(
_curl, CURLOPT_RANGE,
"0-1" );
1262 curl_easy_setopt(
_curl, CURLOPT_NOBODY, 0L);
1263 curl_easy_setopt(
_curl, CURLOPT_RANGE, NULL );
1269 curl_easy_setopt(
_curl, CURLOPT_HTTPGET, 1L );
1273 FILE *file = ::fopen(
"/dev/null",
"w" );
1275 ERR <<
"fopen failed for /dev/null" << endl;
1276 curl_easy_setopt(
_curl, CURLOPT_NOBODY, 0L);
1277 curl_easy_setopt(
_curl, CURLOPT_RANGE, NULL );
1283 curl_easy_setopt(
_curl, CURLOPT_HTTPGET, 1L );
1290 ret = curl_easy_setopt(
_curl, CURLOPT_WRITEDATA, file );
1294 curl_easy_setopt(
_curl, CURLOPT_RANGE, NULL );
1295 curl_easy_setopt(
_curl, CURLOPT_NOBODY, 0L);
1301 curl_easy_setopt(
_curl, CURLOPT_HTTPGET, 1L );
1308 CURLcode ok = curl_easy_perform(
_curl );
1309 MIL <<
"perform code: " << ok <<
" [ " << curl_easy_strerror(ok) <<
" ]" << endl;
1314 curl_easy_setopt(
_curl, CURLOPT_NOBODY, 0L);
1324 curl_easy_setopt(
_curl, CURLOPT_HTTPGET, 1L);
1333 curl_easy_setopt(
_curl, CURLOPT_RANGE, NULL);
1358 return ( ok == CURLE_OK );
1364 #if DETECT_DIR_INDEX 1377 bool not_a_file =
false;
1379 CURLcode ret = curl_easy_getinfo(
_curl,
1380 CURLINFO_EFFECTIVE_URL,
1382 if ( ret == CURLE_OK && ptr != NULL)
1387 std::string path( eurl.getPathName());
1388 if( !path.empty() && path !=
"/" && *path.rbegin() ==
'/')
1390 DBG <<
"Effective url (" 1392 <<
") seems to provide the index of a directory" 1411 DBG <<
"assert_dir " << dest.
dirname() <<
" failed" << endl;
1415 string destNew = target.
asString() +
".new.zypp.XXXXXX";
1416 char *buf = ::strdup( destNew.c_str());
1419 ERR <<
"out of memory for temp file name" << endl;
1424 int tmp_fd = ::mkostemp( buf, O_CLOEXEC );
1428 ERR <<
"mkstemp failed for file '" << destNew <<
"'" << endl;
1434 FILE *file = ::fdopen( tmp_fd,
"we" );
1438 ERR <<
"fopen failed for file '" << destNew <<
"'" << endl;
1442 DBG <<
"dest: " << dest << endl;
1443 DBG <<
"temp: " << destNew << endl;
1448 curl_easy_setopt(
_curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
1449 curl_easy_setopt(
_curl, CURLOPT_TIMEVALUE, (
long)
PathInfo(target).mtime());
1453 curl_easy_setopt(
_curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_NONE);
1454 curl_easy_setopt(
_curl, CURLOPT_TIMEVALUE, 0L);
1464 curl_easy_setopt(
_curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_NONE);
1465 curl_easy_setopt(
_curl, CURLOPT_TIMEVALUE, 0L);
1469 long httpReturnCode = 0;
1470 CURLcode infoRet = curl_easy_getinfo(
_curl,
1471 CURLINFO_RESPONSE_CODE,
1473 bool modified =
true;
1474 if (infoRet == CURLE_OK)
1477 if ( httpReturnCode == 304
1480 DBG <<
" Not modified.";
1487 WAR <<
"Could not get the reponse code." << endl;
1490 if (modified || infoRet != CURLE_OK)
1495 ERR <<
"Failed to chmod file " << destNew << endl;
1497 if (::fclose( file ))
1499 ERR <<
"Fclose failed for file '" << destNew <<
"'" << endl;
1503 if (
rename( destNew, dest ) != 0 ) {
1504 ERR <<
"Rename failed" << endl;
1548 string urlBuffer( curlUrl.
asString());
1549 CURLcode ret = curl_easy_setopt(
_curl, CURLOPT_URL,
1550 urlBuffer.c_str() );
1555 ret = curl_easy_setopt(
_curl, CURLOPT_WRITEDATA, file );
1564 if ( curl_easy_setopt(
_curl, CURLOPT_PROGRESSDATA, &progressData ) != 0 ) {
1565 WAR <<
"Can't set CURLOPT_PROGRESSDATA: " <<
_curlError << endl;;
1568 ret = curl_easy_perform(
_curl );
1569 #if CURLVERSION_AT_LEAST(7,19,4) 1574 if ( ftell(file) == 0 && ret == 0 )
1576 long httpReturnCode = 33;
1577 if ( curl_easy_getinfo(
_curl, CURLINFO_RESPONSE_CODE, &httpReturnCode ) == CURLE_OK && httpReturnCode == 200 )
1579 long conditionUnmet = 33;
1580 if ( curl_easy_getinfo(
_curl, CURLINFO_CONDITION_UNMET, &conditionUnmet ) == CURLE_OK && conditionUnmet )
1582 WAR <<
"TIMECONDITION unmet - retry without." << endl;
1583 curl_easy_setopt(
_curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_NONE);
1584 curl_easy_setopt(
_curl, CURLOPT_TIMEVALUE, 0L);
1585 ret = curl_easy_perform(
_curl );
1591 if ( curl_easy_setopt(
_curl, CURLOPT_PROGRESSDATA, NULL ) != 0 ) {
1592 WAR <<
"Can't unset CURLOPT_PROGRESSDATA: " <<
_curlError << endl;;
1598 <<
", temp file size " << ftell(file)
1599 <<
" bytes." << endl;
1606 if ( progressData.fileSizeExceeded )
1617 #if DETECT_DIR_INDEX 1622 #endif // DETECT_DIR_INDEX 1632 for ( filesystem::DirContent::const_iterator it = content.begin(); it != content.end(); ++it ) {
1633 Pathname filename = dirname + it->name;
1636 switch ( it->type ) {
1643 getDir( filename, recurse_r );
1647 WAR <<
"Ignore error (" << res <<
") on creating local directory '" <<
localPath( filename ) <<
"'" << endl;
1661 const Pathname & dirname,
bool dots )
const 1669 const Pathname & dirname,
bool dots )
const 1678 ProgressData *pdata =
reinterpret_cast<ProgressData *
>( clientp );
1684 pdata->updateStats( 0.0, dlnow );
1685 return pdata->reportProgress();
1692 ProgressData *pdata =
reinterpret_cast<ProgressData *
>( clientp );
1696 long httpReturnCode = 0;
1697 if ( curl_easy_getinfo( pdata->curl, CURLINFO_RESPONSE_CODE, &httpReturnCode ) != CURLE_OK || httpReturnCode == 0 )
1698 return aliveCallback( clientp, dltotal, dlnow, ultotal, ulnow );
1700 pdata->updateStats( dltotal, dlnow );
1701 return pdata->reportProgress();
1708 ProgressData *pdata =
reinterpret_cast<ProgressData *
>(clientp);
1709 return pdata ? pdata->curl : 0;
1716 long auth_info = CURLAUTH_NONE;
1719 curl_easy_getinfo(
_curl, CURLINFO_HTTPAUTH_AVAIL, &auth_info);
1721 if(infoRet == CURLE_OK)
1735 ProgressData *data =
reinterpret_cast<ProgressData *
>(clientp);
1737 data->_expectedFileSize = expectedFileSize;
1752 if (cmcred && firstTry)
1755 DBG <<
"got stored credentials:" << endl << *credentials << endl;
1770 curlcred->setUsername(cmcred->username());
1779 curlcred->setAuthType(availAuthTypes);
1782 if (auth_report->prompt(
_url, prompt_msg, *curlcred))
1784 DBG <<
"callback answer: retry" << endl
1785 <<
"CurlAuthData: " << *curlcred << endl;
1787 if (curlcred->valid())
1789 credentials = curlcred;
1803 DBG <<
"callback answer: cancel" << endl;
1819 if (credentials->authType() == CURLAUTH_NONE)
1820 credentials->setAuthType(availAuthTypes);
1823 if (credentials->authType() != CURLAUTH_NONE)
1827 ret = curl_easy_setopt(
_curl, CURLOPT_HTTPAUTH, credentials->authType());
1833 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.
const char * c_str() const
String representation.
void setPathParams(const std::string ¶ms)
Set the path parameters.
pthread_once_t OnceFlag
The OnceFlag variable type.
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.
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.
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'.
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)
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.
Wrapper class for ::stat/::lstat.
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.