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

Handle empty --vt-verification-collation correctly (backport #1651) #1652

Merged
merged 3 commits into from
Jul 29, 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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed
- Fix VTs hash check and add --dump-vt-verification [#1611](https://github.com/greenbone/gvmd/pull/1611) [#1629](https://github.com/greenbone/gvmd/pull/1629)
- Solved a performance problem when filtering results by tags [#1579](https://github.com/greenbone/gvmd/pull/1579)
- Fix VTs hash check and add --dump-vt-verification [#1611](https://github.com/greenbone/gvmd/pull/1611) [#1629](https://github.com/greenbone/gvmd/pull/1629) [#1643](https://github.com/greenbone/gvmd/pull/1643)
- Fix VTs hash check and add --dump-vt-verification [#1611](https://github.com/greenbone/gvmd/pull/1611) [#1629](https://github.com/greenbone/gvmd/pull/1629) [#1643](https://github.com/greenbone/gvmd/pull/1643) [1541](https://github.com/greenbone/gvmd/pull/1651)
- Fix memory errors in modify_permission [#1613](https://github.com/greenbone/gvmd/pull/1613)
- Fix sensor connection for performance reports on failure [#1633](https://github.com/greenbone/gvmd/pull/1633)
- Sort the "host" column by IPv4 address if possible [#1637](https://github.com/greenbone/gvmd/pull/1637)
Expand Down
2 changes: 1 addition & 1 deletion doc/gvmd.8
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ Verify scanner SCANNER-UUID and exit.
Print version and exit.
.TP
\fB--vt-verification-collation=\fICOLLATION\fB\f1
Set collation for VT verification to COLLATION, leave empty to choose automatically. Should be 'ucs_default' if DB uses UTF-8 or 'C' for single-byte encodings.
Set collation for VT verification to COLLATION, omit or leave empty to choose automatically. Should be 'ucs_default' if DB uses UTF-8 or 'C' for single-byte encodings.
.SH SIGNALS
SIGHUP causes gvmd to rebuild the database with information from the Scanner (openvas).
.SH EXAMPLES
Expand Down
2 changes: 1 addition & 1 deletion doc/gvmd.8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<p><opt>--vt-verification-collation=<arg>COLLATION</arg></opt></p>
<optdesc>
<p>
Set collation for VT verification to COLLATION, leave empty
Set collation for VT verification to COLLATION, omit or leave empty
to choose automatically. Should be 'ucs_default' if DB uses UTF-8
or 'C' for single-byte encodings.
</p>
Expand Down
2 changes: 1 addition & 1 deletion doc/gvmd.html
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ <h2>Options</h2>
<p><b>--vt-verification-collation=<em>COLLATION</em></b></p>

<p>
Set collation for VT verification to COLLATION, leave empty
Set collation for VT verification to COLLATION, omit or leave empty
to choose automatically. Should be 'ucs_default' if DB uses UTF-8
or 'C' for single-byte encodings.
</p>
Expand Down
6 changes: 3 additions & 3 deletions src/gvmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2110,9 +2110,9 @@ gvmd (int argc, char** argv)
NULL },
{ "vt-verification-collation", '\0', 0, G_OPTION_ARG_STRING,
&vt_verification_collation,
"Set collation for VT verification to <collation>, leave empty"
" to choose automatically. Should be 'ucs_default' if DB uses UTF-8"
" or 'C' for single-byte encodings.",
"Set collation for VT verification to <collation>, omit or leave"
" empty to choose automatically. Should be 'ucs_default' if DB uses"
" UTF-8 or 'C' for single-byte encodings.",
"<collation>" },
{ NULL }
};
Expand Down
5 changes: 4 additions & 1 deletion src/manage_sql.c
Original file line number Diff line number Diff line change
Expand Up @@ -56232,5 +56232,8 @@ void
set_vt_verification_collation (const char *new_collation)
{
g_free (vt_verification_collation);
vt_verification_collation = new_collation ? g_strdup(new_collation) : NULL;
if (new_collation && strcmp (new_collation, ""))
vt_verification_collation = g_strdup(new_collation);
else
vt_verification_collation = NULL;
}