]> xenbits.xensource.com Git - libvirt.git/commitdiff
Rename src/util/authhelper.[ch] to src/util/virauth.[ch]
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 19 Mar 2012 16:21:12 +0000 (16:21 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 23 Mar 2012 13:24:06 +0000 (13:24 +0000)
To follow latest naming conventions, rename src/util/authhelper.[ch]
to src/util/virauth.[ch].

* src/util/authhelper.[ch]: Rename to src/util/virauth.[ch]
* src/esx/esx_driver.c, src/hyperv/hyperv_driver.c,
  src/phyp/phyp_driver.c, src/xenapi/xenapi_driver.c: Update
  for renamed include files

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
po/POTFILES.in
src/Makefile.am
src/esx/esx_driver.c
src/hyperv/hyperv_driver.c
src/phyp/phyp_driver.c
src/util/authhelper.c [deleted file]
src/util/authhelper.h [deleted file]
src/util/virauth.c [new file with mode: 0644]
src/util/virauth.h [new file with mode: 0644]
src/xenapi/xenapi_driver.c

index 8354c09abfb71f4f2ff1f9c5dee42a20e7d40ed3..145ea515414bbf3d94953f55281a112850f85976 100644 (file)
@@ -106,7 +106,6 @@ src/storage/storage_driver.c
 src/test/test_driver.c
 src/uml/uml_conf.c
 src/uml/uml_driver.c
-src/util/authhelper.c
 src/util/cgroup.c
 src/util/command.c
 src/util/conf.c
@@ -125,6 +124,7 @@ src/util/storage_file.c
 src/util/sysinfo.c
 src/util/util.c
 src/util/viraudit.c
+src/util/virauth.c
 src/util/virfile.c
 src/util/virhash.c
 src/util/virkeyfile.c
index 07d7faa4cbd4ef7e7f6d1288a48b6c24156e432a..3cbf9d7ba65dddfd99f237639055b784b249e1b5 100644 (file)
@@ -52,7 +52,6 @@ augeastest_DATA =
 # These files are not related to driver APIs. Simply generic
 # helper APIs for various purposes
 UTIL_SOURCES =                                                 \
-               util/authhelper.c util/authhelper.h             \
                util/bitmap.c util/bitmap.h                     \
                util/buf.c util/buf.h                           \
                util/command.c util/command.h                   \
@@ -81,6 +80,7 @@ UTIL_SOURCES =                                                        \
                util/uuid.c util/uuid.h                         \
                util/util.c util/util.h                         \
                util/viraudit.c util/viraudit.h                 \
+               util/virauth.c util/virauth.h                   \
                util/virfile.c util/virfile.h                   \
                util/virnodesuspend.c util/virnodesuspend.h     \
                util/virpidfile.c util/virpidfile.h             \
index 7e41fa32cdaf696e61140f23f692502caec734de..51bd5b2e89bca4bc57a115cc8ac3dfd58c55cede 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "internal.h"
 #include "domain_conf.h"
-#include "authhelper.h"
+#include "virauth.h"
 #include "util.h"
 #include "memory.h"
 #include "logging.h"
index 27c8747cc28331f488fa74684413c783fbeb55b1..5ca20cf73cafbe1d1a9cf81615c12c6eca3787ee 100644 (file)
@@ -26,7 +26,7 @@
 #include "internal.h"
 #include "datatypes.h"
 #include "domain_conf.h"
-#include "authhelper.h"
+#include "virauth.h"
 #include "util.h"
 #include "memory.h"
 #include "logging.h"
index bdf4a7bfd4989b055a27f9b855d0364a2a44a281..4b99465850a241461e0d38b4a7c15a60658d17b9 100644 (file)
@@ -44,7 +44,7 @@
 #include <domain_event.h>
 
 #include "internal.h"
-#include "authhelper.h"
+#include "virauth.h"
 #include "util.h"
 #include "datatypes.h"
 #include "buf.h"
diff --git a/src/util/authhelper.c b/src/util/authhelper.c
deleted file mode 100644 (file)
index 9398cb3..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-
-/*
- * authhelper.c: authentication related utility functions
- *
- * Copyright (C) 2010 Matthias Bolte <matthias.bolte@googlemail.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- *
- */
-
-#include <config.h>
-
-#include "authhelper.h"
-#include "util.h"
-#include "memory.h"
-
-
-char *
-virRequestUsername(virConnectAuthPtr auth, const char *defaultUsername,
-                   const char *hostname)
-{
-    unsigned int ncred;
-    virConnectCredential cred;
-    char *prompt;
-
-    memset(&cred, 0, sizeof (virConnectCredential));
-
-    if (defaultUsername != NULL) {
-        if (virAsprintf(&prompt, _("Enter username for %s [%s]"), hostname,
-                        defaultUsername) < 0) {
-            return NULL;
-        }
-    } else {
-        if (virAsprintf(&prompt, _("Enter username for %s"), hostname) < 0) {
-            return NULL;
-        }
-    }
-
-    for (ncred = 0; ncred < auth->ncredtype; ncred++) {
-        if (auth->credtype[ncred] != VIR_CRED_AUTHNAME) {
-            continue;
-        }
-
-        cred.type = VIR_CRED_AUTHNAME;
-        cred.prompt = prompt;
-        cred.challenge = hostname;
-        cred.defresult = defaultUsername;
-        cred.result = NULL;
-        cred.resultlen = 0;
-
-        if ((*(auth->cb))(&cred, 1, auth->cbdata) < 0) {
-            VIR_FREE(cred.result);
-        }
-
-        break;
-    }
-
-    VIR_FREE(prompt);
-
-    return cred.result;
-}
-
-
-
-char *
-virRequestPassword(virConnectAuthPtr auth, const char *username,
-                   const char *hostname)
-{
-    unsigned int ncred;
-    virConnectCredential cred;
-    char *prompt;
-
-    memset(&cred, 0, sizeof (virConnectCredential));
-
-    if (virAsprintf(&prompt, _("Enter %s's password for %s"), username,
-                    hostname) < 0) {
-        return NULL;
-    }
-
-    for (ncred = 0; ncred < auth->ncredtype; ncred++) {
-        if (auth->credtype[ncred] != VIR_CRED_PASSPHRASE &&
-            auth->credtype[ncred] != VIR_CRED_NOECHOPROMPT) {
-            continue;
-        }
-
-        cred.type = auth->credtype[ncred];
-        cred.prompt = prompt;
-        cred.challenge = hostname;
-        cred.defresult = NULL;
-        cred.result = NULL;
-        cred.resultlen = 0;
-
-        if ((*(auth->cb))(&cred, 1, auth->cbdata) < 0) {
-            VIR_FREE(cred.result);
-        }
-
-        break;
-    }
-
-    VIR_FREE(prompt);
-
-    return cred.result;
-}
diff --git a/src/util/authhelper.h b/src/util/authhelper.h
deleted file mode 100644 (file)
index ca45d16..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-
-/*
- * authhelper.h: authentication related utility functions
- *
- * Copyright (C) 2010 Matthias Bolte <matthias.bolte@googlemail.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- *
- */
-
-#ifndef __VIR_AUTHHELPER_H__
-# define __VIR_AUTHHELPER_H__
-
-# include "internal.h"
-
-char *virRequestUsername(virConnectAuthPtr auth, const char *defaultUsername,
-                         const char *hostname);
-char *virRequestPassword(virConnectAuthPtr auth, const char *username,
-                         const char *hostname);
-
-#endif /* __VIR_AUTHHELPER_H__ */
diff --git a/src/util/virauth.c b/src/util/virauth.c
new file mode 100644 (file)
index 0000000..a3c6b94
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * virauth.c: authentication related utility functions
+ *
+ * Copyright (C) 2010 Matthias Bolte <matthias.bolte@googlemail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ *
+ */
+
+#include <config.h>
+
+#include "virauth.h"
+#include "util.h"
+#include "memory.h"
+
+
+char *
+virRequestUsername(virConnectAuthPtr auth, const char *defaultUsername,
+                   const char *hostname)
+{
+    unsigned int ncred;
+    virConnectCredential cred;
+    char *prompt;
+
+    memset(&cred, 0, sizeof (virConnectCredential));
+
+    if (defaultUsername != NULL) {
+        if (virAsprintf(&prompt, _("Enter username for %s [%s]"), hostname,
+                        defaultUsername) < 0) {
+            return NULL;
+        }
+    } else {
+        if (virAsprintf(&prompt, _("Enter username for %s"), hostname) < 0) {
+            return NULL;
+        }
+    }
+
+    for (ncred = 0; ncred < auth->ncredtype; ncred++) {
+        if (auth->credtype[ncred] != VIR_CRED_AUTHNAME) {
+            continue;
+        }
+
+        cred.type = VIR_CRED_AUTHNAME;
+        cred.prompt = prompt;
+        cred.challenge = hostname;
+        cred.defresult = defaultUsername;
+        cred.result = NULL;
+        cred.resultlen = 0;
+
+        if ((*(auth->cb))(&cred, 1, auth->cbdata) < 0) {
+            VIR_FREE(cred.result);
+        }
+
+        break;
+    }
+
+    VIR_FREE(prompt);
+
+    return cred.result;
+}
+
+
+
+char *
+virRequestPassword(virConnectAuthPtr auth, const char *username,
+                   const char *hostname)
+{
+    unsigned int ncred;
+    virConnectCredential cred;
+    char *prompt;
+
+    memset(&cred, 0, sizeof (virConnectCredential));
+
+    if (virAsprintf(&prompt, _("Enter %s's password for %s"), username,
+                    hostname) < 0) {
+        return NULL;
+    }
+
+    for (ncred = 0; ncred < auth->ncredtype; ncred++) {
+        if (auth->credtype[ncred] != VIR_CRED_PASSPHRASE &&
+            auth->credtype[ncred] != VIR_CRED_NOECHOPROMPT) {
+            continue;
+        }
+
+        cred.type = auth->credtype[ncred];
+        cred.prompt = prompt;
+        cred.challenge = hostname;
+        cred.defresult = NULL;
+        cred.result = NULL;
+        cred.resultlen = 0;
+
+        if ((*(auth->cb))(&cred, 1, auth->cbdata) < 0) {
+            VIR_FREE(cred.result);
+        }
+
+        break;
+    }
+
+    VIR_FREE(prompt);
+
+    return cred.result;
+}
diff --git a/src/util/virauth.h b/src/util/virauth.h
new file mode 100644 (file)
index 0000000..2c8d80f
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * virauth.h: authentication related utility functions
+ *
+ * Copyright (C) 2010 Matthias Bolte <matthias.bolte@googlemail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ *
+ */
+
+#ifndef __VIR_AUTH_H__
+# define __VIR_AUTH_H__
+
+# include "internal.h"
+
+char *virRequestUsername(virConnectAuthPtr auth, const char *defaultUsername,
+                         const char *hostname);
+char *virRequestPassword(virConnectAuthPtr auth, const char *username,
+                         const char *hostname);
+
+#endif /* __VIR_AUTH_H__ */
index 298db1220f1b498c3e094badf851be38efa2f0d8..8d261ef5f57d9266dfdfe864c5157f1a1f43f912 100644 (file)
@@ -31,7 +31,7 @@
 #include "domain_conf.h"
 #include "virterror_internal.h"
 #include "datatypes.h"
-#include "authhelper.h"
+#include "virauth.h"
 #include "util.h"
 #include "uuid.h"
 #include "memory.h"