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
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
# 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 \
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 \
#include "internal.h"
#include "domain_conf.h"
-#include "authhelper.h"
+#include "virauth.h"
#include "util.h"
#include "memory.h"
#include "logging.h"
#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"
#include <domain_event.h>
#include "internal.h"
-#include "authhelper.h"
+#include "virauth.h"
#include "util.h"
#include "datatypes.h"
#include "buf.h"
+++ /dev/null
-
-/*
- * 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;
-}
+++ /dev/null
-
-/*
- * 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__ */
--- /dev/null
+/*
+ * 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;
+}
--- /dev/null
+/*
+ * 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__ */
#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"