Import Debian changes 0.69.0-2
[hcoop/debian/courier-authlib.git] / authdaemondcpp.cpp
diff --git a/authdaemondcpp.cpp b/authdaemondcpp.cpp
new file mode 100644 (file)
index 0000000..4d7f8d7
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+** Copyright 2016 Double Precision, Inc.  See COPYING for
+** distribution information.
+*/
+
+#include <iostream>
+#include <stdlib.h>
+
+extern "C" {
+
+#include "courierauthdebug.h"
+
+       int start();
+};
+
+int main(int argc, char **argv)
+{
+       courier_authdebug_login_init();
+
+       if (argc > 1)
+       {
+               std::cerr <<
+                       "Error: authdaemond no longer handles its own daemonizing."
+                         << std::endl
+                         << "Use new startup script." << std::endl;
+               exit(1);
+       }
+
+       start();
+       return (0);
+}