Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --ldap-debug option #1439

Merged
merged 2 commits into from
Mar 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Added
- Add standard info elem fields for NVTs in get_info [#1426](https://github.com/greenbone/gvmd/pull/1426)
- Add --ldap-debug option [#1439](https://github.com/greenbone/gvmd/pull/1439)

### Changed

Expand Down
12 changes: 9 additions & 3 deletions doc/gvmd.8
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ Create admin user USERNAME and exit.
\fB-d, --database=\fINAME\fB\f1
Use NAME as database for PostgreSQL.
.TP
\fB--db-host=\fIHOST\fB\f1
Use HOST as database host or socket directory for PostgreSQL.
.TP
\fB--db-port=\fIPORT\fB\f1
Use PORT as database port or socket extension for PostgreSQL.
.TP
\fB--delete-scanner=\fISCANNER-UUID\fB\f1
Delete scanner SCANNER-UUID and exit.
.TP
Expand Down Expand Up @@ -73,6 +79,9 @@ Have USERNAME inherit from deleted user.
\fB-a, --listen=\fIADDRESS\fB\f1
Listen on ADDRESS.
.TP
\fB--ldap-debug\f1
Enable debugging of LDAP authentication.
.TP
\fB--listen2=\fIADDRESS\fB\f1
Listen also on ADDRESS.
.TP
Expand Down Expand Up @@ -170,9 +179,6 @@ Time out tasks that are more than TIME minutes overdue. -1 to disable, 0 for min
\fB--secinfo-commit-size=\fINUMBER\fB\f1
During CERT and SCAP sync, commit updates to the database every NUMBER items, 0 for unlimited.
.TP
\fB--slave-commit-size=\fINUMBER\fB\f1
During slave updates, commit after every NUMBER updated results and hosts, 0 for unlimited.
.TP
\fB-c, --unix-socket=\fIFILENAME\fB\f1
Listen on UNIX socket at FILENAME.
.TP
Expand Down
6 changes: 6 additions & 0 deletions doc/gvmd.8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<p>Listen on ADDRESS.</p>
</optdesc>
</option>
<option>
<p><opt>--ldap-debug</opt></p>
<optdesc>
<p>Enable debugging of LDAP authentication.</p>
</optdesc>
</option>
<option>
<p><opt>--listen2=<arg>ADDRESS</arg></opt></p>
<optdesc>
Expand Down
17 changes: 17 additions & 0 deletions src/gvmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
#include <gvm/base/proctitle.h>
#include <gvm/util/fileutils.h>
#include <gvm/util/serverutils.h>
#include <gvm/util/ldaputils.h>

#include "manage.h"
#include "manage_sql_nvts.h"
Expand Down Expand Up @@ -1729,6 +1730,7 @@ gvmd (int argc, char** argv)
static gchar *verify_scanner = NULL;
static gchar *priorities = "NORMAL";
static gchar *dh_params = NULL;
static gboolean ldap_debug = FALSE;
static gchar *listen_owner = NULL;
static gchar *listen_group = NULL;
static gchar *listen_mode = NULL;
Expand Down Expand Up @@ -1851,6 +1853,10 @@ gvmd (int argc, char** argv)
&inheritor,
"Have <username> inherit from deleted user.",
"<username>" },
{ "ldap-debug", '\0', 0, G_OPTION_ARG_NONE,
&ldap_debug,
"Enable debugging of LDAP authentication",
NULL },
{ "listen", 'a', 0, G_OPTION_ARG_STRING,
&manager_address_string,
"Listen on <address>.",
Expand Down Expand Up @@ -2192,6 +2198,17 @@ gvmd (int argc, char** argv)
g_debug ("No default relay mapper found.");
}

/**
* LDAP debugging
*/
if (ldap_debug)
{
if (ldap_enable_debug () == 0)
g_message ("LDAP debugging enabled");
else
g_warning ("Could not enable LDAP debugging");
}

#ifdef GVMD_GIT_REVISION
g_message (" Greenbone Vulnerability Manager version %s (GIT revision %s) (DB revision %i)",
GVMD_VERSION,
Expand Down