Fixes compilation when ./configure --without-sasl.

Rich.

--
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903
Index: qemud/qemud.c
===================================================================
RCS file: /data/cvs/libvirt/qemud/qemud.c,v
retrieving revision 1.69
diff -u -r1.69 qemud.c
--- qemud/qemud.c	5 Dec 2007 15:34:05 -0000	1.69
+++ qemud/qemud.c	5 Dec 2007 17:40:15 -0000
@@ -1620,6 +1619,7 @@
         sock = next;
     }
 
+#ifdef HAVE_SASL
     if (server->saslUsernameWhitelist) {
         char **list = server->saslUsernameWhitelist;
         while (*list) {
@@ -1628,6 +1628,7 @@
             list++;
         }
     }
+#endif
 
     virStateCleanup();
 
@@ -1789,6 +1790,27 @@
     return 0;
 }
 
+#ifdef HAVE_SASL
+static inline int
+remoteReadSaslAllowedUsernameList (virConfPtr conf,
+                                   struct qemud_server *server,
+                                   const char *filename)
+{
+    return
+        remoteConfigGetStringList (conf, "sasl_allowed_username_list",
+                                   &server->saslUsernameWhitelist, filename);
+}
+#else
+static inline int
+remoteReadSaslAllowedUsernameList (virConfPtr conf ATTRIBUTE_UNUSED,
+                                   struct qemud_server *server ATTRIBUTE_UNUSED,
+                                   const char *filename ATTRIBUTE_UNUSED)
+{
+    return 0;
+}
+#endif
+
+
 /* Read the config file if it exists.
  * Only used in the remote case, hence the name.
  */
@@ -1876,8 +1898,7 @@
                                    &tls_allowed_dn_list, filename) < 0)
         goto free_and_fail;
 
-    if (remoteConfigGetStringList (conf, "sasl_allowed_username_list",
-                                   &server->saslUsernameWhitelist, filename) < 0)
+    if (remoteReadSaslAllowedUsernameList (conf, server, filename) < 0)
         goto free_and_fail;
 
     virConfFree (conf);

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to