Skip to content

Commit

Permalink
Merge pull request bareos#1865
Browse files Browse the repository at this point in the history
create_bareos_database: fix `db_name` not being double quoted
  • Loading branch information
BareosBot authored Jun 28, 2024
2 parents e1eace7 + 6244ad9 commit fbe5bd6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- fix various memory leaks [PR #1723]
- fix sql error on bad virtualfull; detect parsing errors with strtod [PR #1725]
- windows: fix some crashes, change handling of invalid paths; lex: add better error detection; accurate: fix out of bounds writes [PR #1793]
- create_bareos_database: fix `db_name` not being double quoted [PR #1865]

[PR #1538]: https://github.com/bareos/bareos/pull/1538
[PR #1581]: https://github.com/bareos/bareos/pull/1581
Expand Down Expand Up @@ -190,5 +191,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[PR #1829]: https://github.com/bareos/bareos/pull/1829
[PR #1840]: https://github.com/bareos/bareos/pull/1840
[PR #1853]: https://github.com/bareos/bareos/pull/1853
[PR #1865]: https://github.com/bareos/bareos/pull/1865
[PR #1868]: https://github.com/bareos/bareos/pull/1868
[unreleased]: https://github.com/bareos/bareos/tree/master
6 changes: 3 additions & 3 deletions core/src/cats/create_bareos_database.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# BAREOS® - Backup Archiving REcovery Open Sourced
#
# Copyright (C) 2000-2011 Free Software Foundation Europe e.V.
# Copyright (C) 2013-2023 Bareos GmbH & Co. KG
# Copyright (C) 2013-2024 Bareos GmbH & Co. KG
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -47,8 +47,8 @@ info "Creating database '${db_name}'"
retval=0
psql -f - -d template1 << END-OF-DATA || retval=$?
\set ON_ERROR_STOP on
CREATE DATABASE ${db_name} ENCODING 'SQL_ASCII' LC_COLLATE 'C' LC_CTYPE 'C' TEMPLATE template0;
ALTER DATABASE ${db_name} SET datestyle TO 'ISO, YMD';
CREATE DATABASE "${db_name}" ENCODING 'SQL_ASCII' LC_COLLATE 'C' LC_CTYPE 'C' TEMPLATE template0;
ALTER DATABASE "${db_name}" SET datestyle TO 'ISO, YMD';
END-OF-DATA

QUERY="SELECT pg_catalog.pg_encoding_to_char(d.encoding) as encoding \
Expand Down

0 comments on commit fbe5bd6

Please sign in to comment.