-bool OidentdConfigGenerator::lineByUs(const QByteArray &line) {
- return !quasselStanza.exactMatch(line);
+
+bool OidentdConfigGenerator::writeConfig()
+{
+#ifdef HAVE_UMASK
+ mode_t prev_umask = umask(S_IXUSR | S_IWGRP | S_IXGRP | S_IWOTH | S_IXOTH); // == 0133, rw-r--r--
+#endif
+ bool not_open = (!_configFile->isOpen() && !_configFile->open(QIODevice::ReadWrite | QIODevice::Text));
+#ifdef HAVE_UMASK
+ umask(prev_umask);
+#endif
+
+ if (not_open)
+ return false;
+
+ _mutex.lock();
+
+ _configFile->seek(0);
+ _configFile->resize(0);
+ _configFile->write(_parsedConfig);
+ _configFile->write(_quasselConfig);
+
+ _configFile->close();
+ _mutex.unlock();
+ return true;
+}
+
+
+bool OidentdConfigGenerator::lineByUs(const QByteArray &line)
+{
+ return _quasselStanzaRx.exactMatch(line);