dont use 'guest' if 'credentias' option is used when mounting CIFS (bnc #560496)
authorJán Kupec <jkupec@suse.cz>
Tue, 23 Feb 2010 18:03:56 +0000 (19:03 +0100)
committerJán Kupec <jkupec@suse.cz>
Tue, 23 Feb 2010 18:07:20 +0000 (19:07 +0100)
zypp/media/MediaCIFS.cc

index bbd9a5e..2c7fa4c 100644 (file)
@@ -174,12 +174,6 @@ namespace zypp {
       string username = _url.getUsername();
       string password = _url.getPassword();
 
-      // Use 'guest' option unless explicitly disabled (bnc #547354)
-      if ( options.has( "noguest" ) )
-        options.erase( "noguest" );
-      else
-        options["guest"];
-
       if ( ! options.has( "rw" ) ) {
         options["ro"];
       }
@@ -268,6 +262,17 @@ namespace zypp {
           credentials = tmp;
           options["credentials"] = credentials.path().asString();
         }
+        else
+        {
+          // Use 'guest' option unless explicitly disabled (bnc #547354)
+          if ( options.has( "noguest" ) )
+            options.erase( "noguest" );
+          else
+            // prevent smbmount from asking for password
+            // only add this option if 'credentials' is not used (bnc #560496)
+            options["guest"];
+        }
+
         //
         //////////////////////////////////////////////////////