mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-07-13 05:45:50 +00:00
moved helper daemonization
add abillity to own users org.netctlgui.helper service
This commit is contained in:
@ -79,17 +79,14 @@ int main(int argc, char *argv[])
|
||||
(args[QString("version")].toBool()) ||
|
||||
(args[QString("error")].toBool()))
|
||||
args[QString("nodaemon")] = true;
|
||||
// heck euid
|
||||
// check euid
|
||||
if (geteuid() != 0) {
|
||||
cout << QCoreApplication::translate("NetctlHelper", "The helper is running with EUID %1. Some functions will not be available.")
|
||||
cout << QCoreApplication::translate("NetctlHelper", "The helper is running with EUID %1. Functions will not be available.")
|
||||
.arg(QString::number(geteuid())).toUtf8().data() << endl;
|
||||
cout << QCoreApplication::translate("NetctlHelper", "See security notes for more details.")
|
||||
.toUtf8().data() << endl;
|
||||
}
|
||||
|
||||
// detach from console
|
||||
if (!args[QString("nodaemon")].toBool())
|
||||
daemon(0, 0);
|
||||
#if QT_VERSION >= 0x050000
|
||||
QCoreApplication::setSetuidAllowed(true);
|
||||
#endif
|
||||
|
@ -36,6 +36,8 @@ NetctlHelper::NetctlHelper(QObject *parent, QMap<QString, QVariant> args)
|
||||
debug(args[QString("debug")].toBool())
|
||||
{
|
||||
updateConfiguration();
|
||||
if (!args[QString("nodaemon")].toBool())
|
||||
daemon(0, 0);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user