]> git.armaanb.net Git - opendoas.git/blobdiff - doas.c
Add nolog option to avoid syslog(3)
[opendoas.git] / doas.c
diff --git a/doas.c b/doas.c
index 8275fe180b70ed80e99a8ee05affcca54b610e38..dea68f823181e1595e940a2666457dbb1a2fd799 100644 (file)
--- a/doas.c
+++ b/doas.c
@@ -391,8 +391,11 @@ main(int argc, char **argv)
        else
                cwd = cwdpath;
 
-       syslog(LOG_AUTHPRIV | LOG_INFO, "%s ran command %s as %s from %s",
-           mypw->pw_name, cmdline, targpw->pw_name, cwd);
+       if (!(rule->options & NOLOG)) {
+               syslog(LOG_AUTHPRIV | LOG_INFO,
+                   "%s ran command %s as %s from %s",
+                   mypw->pw_name, cmdline, targpw->pw_name, cwd);
+       }
 
        envp = prepenv(rule, mypw, targpw);