]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: Remove invalid parameter checks from virAuthGet{Username|Password}
authorJohn Ferlan <jferlan@redhat.com>
Tue, 14 Aug 2018 16:34:43 +0000 (12:34 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 15 Aug 2018 19:41:55 +0000 (15:41 -0400)
Now that the virAuthGet*Path helpers make the checks, we can remove
them from here.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
src/util/virauth.c

index 7e7098317d683111c0c0151fdccc9b840848e639..a04abb613b46abcbce46484776ad0ac72491faf7 100644 (file)
@@ -210,14 +210,8 @@ virAuthGetUsername(virConnectPtr conn,
     if (virAuthGetConfigFilePath(conn, &path) < 0)
         return NULL;
 
-    if (!auth || !auth->cb) {
-        virReportError(VIR_ERR_INVALID_ARG, "%s",
-                       _("Missing or invalid auth pointer"));
-        return NULL;
-    }
-
     return virAuthGetUsernamePath(path, auth, servicename,
-                                 defaultUsername, hostname);
+                                  defaultUsername, hostname);
 }
 
 
@@ -292,11 +286,5 @@ virAuthGetPassword(virConnectPtr conn,
     if (virAuthGetConfigFilePath(conn, &path) < 0)
         return NULL;
 
-    if (!auth || !auth->cb) {
-        virReportError(VIR_ERR_INVALID_ARG, "%s",
-                       _("Missing or invalid auth pointer"));
-        return NULL;
-    }
-
     return virAuthGetPasswordPath(path, auth, servicename, username, hostname);
 }