16#include <zypp/base/Logger.h>
17#include <zypp/base/Gettext.h>
18#include <zypp/TmpPath.h>
19#include <zypp-core/KVMap>
20#include <zypp-media/Mount>
21#include <zypp-media/auth/AuthData>
22#include <zypp-media/auth/CredentialManager>
52 std::string::size_type
sep =
share.find(
'/', 1 );
53 if (
sep == std::string::npos )
59 while ( (
sep =
share.find(
"%2f" )) != std::string::npos ) {
80 std::string::size_type
sep =
striped.find(
'/', 1 );
81 if (
sep == std::string::npos )
136 std::string path =
"//";
142 if(
ret.mediaSource &&
144 !
ret.attachPoint->empty())
146 DBG <<
"Using a shared media "
147 <<
ret.mediaSource->name
149 <<
ret.attachPoint->path
171 if ( ! options.has(
"rw" ) ) {
184 Mount::Options::iterator
toEnv;
185 toEnv = options.find(
"username");
186 if (
toEnv != options.end() ) {
187 if ( username.empty() )
188 username =
toEnv->second;
189 options.erase(
toEnv );
192 toEnv = options.find(
"user");
193 if (
toEnv != options.end() ) {
194 if ( username.empty() )
195 username =
toEnv->second;
196 options.erase(
toEnv );
201 toEnv = options.find(
"password");
202 if (
toEnv != options.end() ) {
203 if ( password.empty() )
204 password =
toEnv->second;
205 options.erase(
toEnv );
208 toEnv = options.find(
"pass");
209 if (
toEnv != options.end() ) {
210 if ( password.empty() )
211 password =
toEnv->second;
212 options.erase(
toEnv );
215 if ( username.empty() || password.empty() )
220 username =
c->username();
221 password =
c->password();
239 if ( !username.empty() )
241 if ( !password.empty() )
248 if ( !username.empty() || !password.empty() )
251 std::ofstream
outs(
tmp.path().asString().c_str() );
252 outs <<
"username=" << username << endl;
253 outs <<
"password=" << password << endl;
257 options[
"credentials"] =
credentials.path().asString();
262 if ( options.has(
"noguest" ) )
263 options.erase(
"noguest" );
284 if (
e.mountError() ==
"Permission denied" )
313 "Unable to verify that the media was mounted",
427 _(
"Authentication required for '%s'"),
_url.
asString().c_str());
432 DBG <<
"callback answer: retry" << endl
433 <<
"AuthData: " << *
smbcred << endl;
450 DBG <<
"callback answer: cancel" << endl;
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
void reset()
Reset to default Ctor values.
std::string asString() const
Returns a default string representation of the Url object.
std::string getUsername(EEncoding eflag=zypp::url::E_DECODED) const
Returns the username from the URL authority.
std::string getPathName(EEncoding eflag=zypp::url::E_DECODED) const
Returns the path name from the URL.
std::string getQueryParam(const std::string ¶m, EEncoding eflag=zypp::url::E_DECODED) const
Return the value for the specified query parameter.
std::string getHost(EEncoding eflag=zypp::url::E_DECODED) const
Returns the hostname or IP from the URL authority.
std::string getPassword(EEncoding eflag=zypp::url::E_DECODED) const
Returns the password from the URL authority.
static ZConfig & instance()
Singleton ctor.
Provide a new empty temporary file and delete it when no longer needed.
Automaticaly deletes files or directories when no longer needed.
std::list< DirEntry > DirContent
Returned by readdir.
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
Easy-to use interface to the ZYPP dependency resolver.
std::string asString(const Patch::Category &obj)
#define ZYPP_RETHROW(EXCPT)
Drops a logline and rethrows, updating the CodeLocation.
#define ZYPP_CAUGHT(EXCPT)
Drops a logline telling the Exception was caught (in order to handle it).
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.