]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
owncloudcmd: Don't put the password in the URL
authorOlivier Goffart <ogoffart@woboq.com>
Fri, 25 Nov 2016 17:47:37 +0000 (18:47 +0100)
committerOlivier Goffart <olivier@woboq.com>
Sat, 26 Nov 2016 11:57:44 +0000 (12:57 +0100)
As the URL might be print on the logs.
Also don't change the scheme from http to owncloud.

This was required before when we were using neon through csync, but now that
we use QNAM for everything we don't need it. The credentials from the account
are used.

src/cmd/cmd.cpp

index a37de2853a014d8dea97c6c2a0b43091e26c793d..09b9de11db7c2301632d1cd5de3d9df6615ad70e 100644 (file)
@@ -329,8 +329,7 @@ int main(int argc, char **argv) {
     if( !options.target_url.contains( account->davPath() )) {
         options.target_url.append(account->davPath());
     }
-    if (options.target_url.startsWith("http"))
-        options.target_url.replace(0, 4, "owncloud");
+
     QUrl url = QUrl::fromUserInput(options.target_url);
 
     // Order of retrieval attempt (later attempts override earlier ones):
@@ -371,14 +370,6 @@ int main(int argc, char **argv) {
          }
      }
 
-    // ### ensure URL is free of credentials
-    if (url.userName().isEmpty()) {
-        url.setUserName(user);
-    }
-    if (url.password().isEmpty()) {
-        url.setPassword(password);
-    }
-
     // take the unmodified url to pass to csync_create()
     QByteArray remUrl = options.target_url.toUtf8();