Skip to content

Commit

Permalink
Merge pull request #1442 from greenbone/mergify/bp/master/pr-1439
Browse files Browse the repository at this point in the history
Add --ldap-debug option (bp #1439)
  • Loading branch information
timopollmeier committed Mar 15, 2021
2 parents f944951 + 897f3d3 commit 9875d3d
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,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 @@ -1728,6 +1729,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 @@ -1854,6 +1856,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 @@ -2187,6 +2193,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

0 comments on commit 9875d3d

Please sign in to comment.