diff --git a/autoconf/bareos/os.m4 b/autoconf/bareos/os.m4
index 48b6a59c627..8f8e4c871a2 100644
--- a/autoconf/bareos/os.m4
+++ b/autoconf/bareos/os.m4
@@ -342,7 +342,7 @@ if test "x$OBS_DISTRIBUTION" != "x"
then
echo "obsdistname set to $OBS_DISTRIBUTION"
else
- if test -e /.build.log; then
+ if test -f /.build.log; then
OBS_PROJECT=`grep 'Building bareos for project' /.build.log | cut -d' ' -f10 | sed "s#'##g"`
OBS_DISTRIBUTION=`grep 'Building bareos for project' /.build.log | cut -d' ' -f12 | sed "s#'##g"`
OBS_ARCH=`grep 'Building bareos for project' /.build.log | cut -d' ' -f14 | sed "s#'##g"`
diff --git a/autoconf/configure.in b/autoconf/configure.in
index 8cfb13753a1..d7e93a77374 100644
--- a/autoconf/configure.in
+++ b/autoconf/configure.in
@@ -947,7 +947,7 @@ AC_ARG_WITH(python,
PYTHON_LIBS=
if test "$withval" != "no"; then
if test "$withval" = "yes"; then
- if test -e /usr/bin/python-config ; then
+ if test -f /usr/bin/python-config ; then
PYTHON_INC=`/usr/bin/python-config --includes`
PYTHON_LIBS=`/usr/bin/python-config --libs`
else
@@ -980,7 +980,7 @@ AC_ARG_WITH(python,
fi
fi
else
- if test -e $withval/bin/python-config ; then
+ if test -f $withval/bin/python-config ; then
PYTHON_INC=`$withval/bin/python-config --includes`
PYTHON_LIBS=`$withval/bin/python-config --libs`
elif test -f $withval/Python.h; then
diff --git a/configure b/configure
index 9ad7ec80b36..3034eaf5fb6 100755
--- a/configure
+++ b/configure
@@ -965,7 +965,6 @@ infodir
docdir
oldincludedir
includedir
-runstatedir
localstatedir
sharedstatedir
sysconfdir
@@ -1154,7 +1153,6 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
-runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1407,15 +1405,6 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
- -runstatedir | --runstatedir | --runstatedi | --runstated \
- | --runstate | --runstat | --runsta | --runst | --runs \
- | --run | --ru | --r)
- ac_prev=runstatedir ;;
- -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
- | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
- | --run=* | --ru=* | --r=*)
- runstatedir=$ac_optarg ;;
-
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1553,7 +1542,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir runstatedir
+ libdir localedir mandir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@@ -1706,7 +1695,6 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -18047,7 +18035,7 @@ if test "x$OBS_DISTRIBUTION" != "x"
then
echo "obsdistname set to $OBS_DISTRIBUTION"
else
- if test -e /.build.log; then
+ if test -f /.build.log; then
OBS_PROJECT=`grep 'Building bareos for project' /.build.log | cut -d' ' -f10 | sed "s#'##g"`
OBS_DISTRIBUTION=`grep 'Building bareos for project' /.build.log | cut -d' ' -f12 | sed "s#'##g"`
OBS_ARCH=`grep 'Building bareos for project' /.build.log | cut -d' ' -f14 | sed "s#'##g"`
@@ -23752,7 +23740,7 @@ if test "${with_python+set}" = set; then :
PYTHON_LIBS=
if test "$withval" != "no"; then
if test "$withval" = "yes"; then
- if test -e /usr/bin/python-config ; then
+ if test -f /usr/bin/python-config ; then
PYTHON_INC=`/usr/bin/python-config --includes`
PYTHON_LIBS=`/usr/bin/python-config --libs`
else
@@ -23786,7 +23774,7 @@ $as_echo "no" >&6; }
fi
fi
else
- if test -e $withval/bin/python-config ; then
+ if test -f $withval/bin/python-config ; then
PYTHON_INC=`$withval/bin/python-config --includes`
PYTHON_LIBS=`$withval/bin/python-config --libs`
elif test -f $withval/Python.h; then
diff --git a/debian/univention-bareos.install.in b/debian/univention-bareos.install.in
index e6940d8c857..d31eb6f9a20 100644
--- a/debian/univention-bareos.install.in
+++ b/debian/univention-bareos.install.in
@@ -10,6 +10,7 @@
/etc/univention/templates/scripts/etc/bareos/bareos-dir.d/pool/Differential.conf
/etc/univention/templates/scripts/etc/bareos/bareos-dir.d/pool/Full.conf
/etc/univention/templates/scripts/etc/bareos/bareos-dir.d/pool/Incremental.conf
+/etc/univention/templates/scripts/etc/bareos/bareos-dir.d/webui-profiles.conf
/usr/lib/univention-directory-listener/system/univention-bareos.py
/usr/lib/univention-install/62univention-bareos.inst
/usr/lib/univention-uninstall/63univention-bareos.uinst
diff --git a/debian/univention-bareos.preinst b/debian/univention-bareos.preinst
index b3591538421..462367cea73 100644
--- a/debian/univention-bareos.preinst
+++ b/debian/univention-bareos.preinst
@@ -1,7 +1,7 @@
#!/bin/sh
if [ "$1" = "install" ]; then
- test -e /usr/lib/univention-install/63univention-bareos-uninstall.uinst && rm /usr/lib/univention-install/63univention-bareos-uninstall.uinst
+ test -f /usr/lib/univention-install/63univention-bareos-uninstall.uinst && rm /usr/lib/univention-install/63univention-bareos-uninstall.uinst
fi
# dh_installdeb will replace this with shell code automatically
diff --git a/debian/univention-bareos.univention-config-registry b/debian/univention-bareos.univention-config-registry
index bcc37739539..cef66d78dd7 100644
--- a/debian/univention-bareos.univention-config-registry
+++ b/debian/univention-bareos.univention-config-registry
@@ -31,6 +31,9 @@ File: etc/bareos/bareos-dir.d/pool/Incremental.conf
Variables: bareos/max_incr_volume_bytes
Variables: bareos/max_incr_volumes
+Type: file
+File: etc/bareos/bareos-dir.d/webui-profiles.conf
+
Type: file
File: etc/bareos/bareos-sd.d/device/FileStorage.conf
Variables: bareos/filestorage
diff --git a/platforms/univention/AppCenter/LICENSE_AGREEMENT.in b/platforms/univention/AppCenter/LICENSE_AGREEMENT.in
index e5512aeb737..8a5c74d5b9a 100644
--- a/platforms/univention/AppCenter/LICENSE_AGREEMENT.in
+++ b/platforms/univention/AppCenter/LICENSE_AGREEMENT.in
@@ -5,7 +5,7 @@
Copyright (C) 2000-2012 Free Software Foundation Europe e.V. |
- Copyright (C) 2013-2015 Bareos GmbH & Co. KG |
+ Copyright (C) 2013-2017 Bareos GmbH & Co. KG |
@@ -26,6 +26,7 @@
along with this program. If not, see http://www.gnu.org/licenses/
- See full license text at https://github.com/bareos/bareos/blob/master/LICENSE
+ Some parts of the code are licensed under other permissive licenses.
+ See the full license text.
diff --git a/platforms/univention/Makefile.in b/platforms/univention/Makefile.in
index 3f27a9356ad..4f7a7dd685e 100644
--- a/platforms/univention/Makefile.in
+++ b/platforms/univention/Makefile.in
@@ -16,7 +16,10 @@ all:
# remove autoconf template files
find ../../conffiles/ -name "*.in" -exec rm {} \;
@$(MKDIR) ../../AppCenter/
- $(INSTALL_DATA) AppCenter/univention-bareos.ini ../../AppCenter/
+ # Univention advices not to include the ini file any longer,
+ # to prevent to new settings added by Univention gets overwritten.
+ # Instead the settings should be done manually on the AppCenter Management interface.
+ #$(INSTALL_DATA) AppCenter/univention-bareos.ini ../../AppCenter/
$(INSTALL_DATA) AppCenter/LICENSE_AGREEMENT ../../AppCenter/
$(INSTALL_DATA) AppCenter/README ../../AppCenter/
$(INSTALL_DATA) AppCenter/README_DE ../../AppCenter/
diff --git a/platforms/univention/conffiles/etc/bareos/bareos-dir.d/webui-profiles.conf b/platforms/univention/conffiles/etc/bareos/bareos-dir.d/webui-profiles.conf
new file mode 100644
index 00000000000..f528a827f72
--- /dev/null
+++ b/platforms/univention/conffiles/etc/bareos/bareos-dir.d/webui-profiles.conf
@@ -0,0 +1,21 @@
+@%@UCRWARNING=# @%@
+
+#
+# bareos-webui profile resource.
+# Deprecated, only used when updating from bareos-15.2.
+# Fresh installation of bareos >= 16.2 will use
+# /etc/bareos/bareos-dir.d/profile/webui-admin.conf (profile name: webui-admin).
+#
+Profile {
+ Name = webui
+ CommandACL = !.bvfs_clear_cache, !.exit, !.sql, !configure, !create, !delete, !purge, !prune, !sqlquery, !umount, !unmount, *all*
+ Job ACL = *all*
+ Schedule ACL = *all*
+ Catalog ACL = *all*
+ Pool ACL = *all*
+ Storage ACL = *all*
+ Client ACL = *all*
+ FileSet ACL = *all*
+ Where ACL = *all*
+}
+
diff --git a/platforms/univention/job-generic.template b/platforms/univention/job-generic.template
index 2f02c2dc2ef..d432b215e65 100644
--- a/platforms/univention/job-generic.template
+++ b/platforms/univention/job-generic.template
@@ -8,7 +8,7 @@ Job {
Name = "Backup-${client_name}"
Client = "${client_name}-fd"
JobDefs = "DefaultJob"
- FileSet = "LinuxAll"
- Schedule = "WeeklyCycle"
+ #FileSet = "LinuxAll"
+ #Schedule = "WeeklyCycle"
Enabled = "${enable}"
}
diff --git a/platforms/win32/mingw-debugsrc-devel.spec b/platforms/win32/mingw-debugsrc-devel.spec
index 2b79dcb3816..02a6373e785 100644
--- a/platforms/win32/mingw-debugsrc-devel.spec
+++ b/platforms/win32/mingw-debugsrc-devel.spec
@@ -1,7 +1,7 @@
#
# spec file for package mingw-debugsrc-devel
#
-# Copyright (c) 2014-2016 Bareos GmbH & Co. KG
+# Copyright (c) 2014-2017 Bareos GmbH & Co. KG
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
diff --git a/platforms/win32/winbareos.nsi b/platforms/win32/winbareos.nsi
index 694edc247c5..40c4cd6739c 100644
--- a/platforms/win32/winbareos.nsi
+++ b/platforms/win32/winbareos.nsi
@@ -1,7 +1,7 @@
;
; BAREOS - Backup Archiving REcovery Open Sourced
;
-; Copyright (C) 2012-2016 Bareos GmbH & Co. KG
+; Copyright (C) 2012-2017 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
@@ -185,7 +185,7 @@ FunctionEnd
!define MUI_FINISHPAGE_RUN
#!define MUI_FINISHPAGE_RUN_NOTCHECKED
-!define MUI_FINISHPAGE_RUN_TEXT "open Bareos websites"
+!define MUI_FINISHPAGE_RUN_TEXT "Open Bareos websites"
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink"
!insertmacro MUI_PAGE_FINISH
diff --git a/scripts/git-info.sh b/scripts/git-info.sh
index 2b6117fdb30..318acf719a2 100755
--- a/scripts/git-info.sh
+++ b/scripts/git-info.sh
@@ -25,7 +25,7 @@ git_branch_info()
TRACKING_BRANCH=`git config branch.$LOCAL_BRANCH.merge`
TRACKING_REMOTE=`git config branch.$LOCAL_BRANCH.remote`
# remove credentials from url
- REMOTE_URL=`git config remote.$TRACKING_REMOTE.url | sed -r "s|(http[s]://).*@|\1|"`
+ REMOTE_URL=`git config remote.$TRACKING_REMOTE.url | sed "s|\(http[s]://\).*@|\1|"`
printf "remote_url=$REMOTE_URL\n"
# OBS return always "master" therefore disabled
diff --git a/src/dird/dbcheck.c b/src/dird/dbcheck.c
index 2b9dad9c5a1..9cde06e63c4 100644
--- a/src/dird/dbcheck.c
+++ b/src/dird/dbcheck.c
@@ -94,7 +94,7 @@ static void eliminate_restore_records();
static void repair_bad_paths();
static void repair_bad_filenames();
static void do_interactive_mode();
-static bool yes_no(const char *prompt);
+static bool yes_no(const char *prompt, bool batchvalue = false);
static bool check_idx(const char *col_name);
static bool create_tmp_idx(const char *idx_name, const char *table_name,
const char *col_name);
@@ -104,10 +104,10 @@ static int check_idx_handler(void *ctx, int num_fields, char **row);
static void usage()
{
fprintf(stderr,
-"Usage: dbcheck [ options ] [] []\n"
+"Usage: bareos-dbcheck [ options ] [] []\n"
" -b batch mode\n"
" -B print catalog configuration and exit\n"
-" -c Director configuration filename\n"
+" -c Director configuration filename or configuration directory (e.g. /etc/bareos)\n"
" -C catalog name in the director configuration file\n"
" -d set debug level to \n"
" -dt print a timestamp in debug output\n"
@@ -694,6 +694,7 @@ static void eliminate_duplicate_filenames()
char esc_name[5000];
printf(_("Checking for duplicate Filename entries.\n"));
+ fflush(stdout);
/*
* Make list of duplicated names
@@ -705,6 +706,7 @@ static void eliminate_duplicate_filenames()
exit(1);
}
printf(_("Found %d duplicate Filename records.\n"), name_list.num_ids);
+ fflush(stdout);
if (name_list.num_ids && verbose && yes_no(_("Print the list? (yes/no): "))) {
print_name_list(&name_list);
}
@@ -749,6 +751,7 @@ static void eliminate_duplicate_filenames()
db->sql_query(buf, NULL, NULL);
}
}
+ fflush(stdout);
}
free_name_list(&name_list);
}
@@ -759,6 +762,7 @@ static void eliminate_duplicate_paths()
char esc_name[5000];
printf(_("Checking for duplicate Path entries.\n"));
+ fflush(stdout);
/*
* Make list of duplicated names
@@ -770,6 +774,7 @@ static void eliminate_duplicate_paths()
exit(1);
}
printf(_("Found %d duplicate Path records.\n"), name_list.num_ids);
+ fflush(stdout);
if (name_list.num_ids && verbose && yes_no(_("Print them? (yes/no): "))) {
print_name_list(&name_list);
}
@@ -813,6 +818,7 @@ static void eliminate_duplicate_paths()
db->sql_query(buf, NULL, NULL);
}
}
+ fflush(stdout);
}
free_name_list(&name_list);
}
@@ -824,6 +830,7 @@ static void eliminate_orphaned_jobmedia_records()
"WHERE Job.JobId IS NULL LIMIT 300000";
printf(_("Checking for orphaned JobMedia entries.\n"));
+ fflush(stdout);
if (!make_id_list(query, &id_list)) {
exit(1);
}
@@ -858,6 +865,7 @@ static void eliminate_orphaned_jobmedia_records()
exit(1);
}
}
+ fflush(stdout);
}
static void eliminate_orphaned_file_records()
@@ -870,6 +878,7 @@ static void eliminate_orphaned_file_records()
if (verbose > 1) {
printf("%s\n", query);
}
+ fflush(stdout);
if (!make_id_list(query, &id_list)) {
exit(1);
}
@@ -903,6 +912,7 @@ static void eliminate_orphaned_file_records()
exit(1);
}
}
+ fflush(stdout);
}
static void eliminate_orphaned_path_records()
@@ -913,6 +923,7 @@ static void eliminate_orphaned_path_records()
db->sql_query("SELECT 1 FROM Job WHERE HasCache=1 LIMIT 1", db_int64_handler, &lctx);
if (lctx.count == 1) {
printf(_("Pruning orphaned Path entries isn't possible when using BVFS.\n"));
+ fflush(stdout);
return;
}
@@ -921,7 +932,7 @@ static void eliminate_orphaned_path_records()
* Check the existence of the required "one column" index
*/
if (!check_idx("PathId")) {
- if (yes_no(_("Create temporary index? (yes/no): "))) {
+ if (yes_no(_("Create temporary index? (yes/no): "), true)) {
/*
* create temporary index PathId
*/
@@ -937,6 +948,7 @@ static void eliminate_orphaned_path_records()
if (verbose > 1) {
printf("%s\n", query);
}
+ fflush(stdout);
if (!make_id_list(query, &id_list)) {
exit(1);
}
@@ -945,6 +957,7 @@ static void eliminate_orphaned_path_records()
*/
while (id_list.num_ids != 0) {
printf(_("Found %d orphaned Path records.\n"), id_list.num_ids);
+ fflush(stdout);
if (id_list.num_ids && verbose && yes_no(_("Print them? (yes/no): "))) {
for (int i=0; i < id_list.num_ids; i++) {
char ed1[50];
@@ -952,12 +965,14 @@ static void eliminate_orphaned_path_records()
edit_int64(id_list.Id[i], ed1));
db->sql_query(buf, print_name_handler, NULL);
}
+ fflush(stdout);
}
if (quit) {
return;
}
if (fix && id_list.num_ids > 0) {
printf(_("Deleting %d orphaned Path records.\n"), id_list.num_ids);
+ fflush(stdout);
delete_id_list("DELETE FROM Path WHERE PathId=%s", &id_list);
} else {
break; /* get out if not updating db */
@@ -979,7 +994,7 @@ static void eliminate_orphaned_filename_records()
* Check the existence of the required "one column" index
*/
if (!check_idx("FilenameId") ) {
- if (yes_no(_("Create temporary index? (yes/no): "))) {
+ if (yes_no(_("Create temporary index? (yes/no): "), true)) {
/*
* Create temporary index FilenameId
*/
@@ -995,6 +1010,7 @@ static void eliminate_orphaned_filename_records()
if (verbose > 1) {
printf("%s\n", query);
}
+ fflush(stdout);
if (!make_id_list(query, &id_list)) {
exit(1);
}
@@ -1003,6 +1019,7 @@ static void eliminate_orphaned_filename_records()
*/
while (id_list.num_ids != 0) {
printf(_("Found %d orphaned Filename records.\n"), id_list.num_ids);
+ fflush(stdout);
if (id_list.num_ids && verbose && yes_no(_("Print them? (yes/no): "))) {
for (int i=0; i < id_list.num_ids; i++) {
char ed1[50];
@@ -1016,6 +1033,7 @@ static void eliminate_orphaned_filename_records()
}
if (fix && id_list.num_ids > 0) {
printf(_("Deleting %d orphaned Filename records.\n"), id_list.num_ids);
+ fflush(stdout);
delete_id_list("DELETE FROM Filename WHERE FilenameId=%s", &id_list);
} else {
break; /* get out if not updating db */
@@ -1042,10 +1060,12 @@ static void eliminate_orphaned_fileset_records()
if (verbose > 1) {
printf("%s\n", query);
}
+ fflush(stdout);
if (!make_id_list(query, &id_list)) {
exit(1);
}
printf(_("Found %d orphaned FileSet records.\n"), id_list.num_ids);
+ fflush(stdout);
if (id_list.num_ids && verbose && yes_no(_("Print them? (yes/no): "))) {
for (int i=0; i < id_list.num_ids; i++) {
char ed1[50];
@@ -1055,12 +1075,14 @@ static void eliminate_orphaned_fileset_records()
printf("%s\n", db->strerror());
}
}
+ fflush(stdout);
}
if (quit) {
return;
}
if (fix && id_list.num_ids > 0) {
printf(_("Deleting %d orphaned FileSet records.\n"), id_list.num_ids);
+ fflush(stdout);
delete_id_list("DELETE FROM FileSet WHERE FileSetId=%s", &id_list);
}
}
@@ -1084,6 +1106,7 @@ static void eliminate_orphaned_client_records()
if (verbose > 1) {
printf("%s\n", query);
}
+ fflush(stdout);
if (!make_id_list(query, &id_list)) {
exit(1);
}
@@ -1097,12 +1120,14 @@ static void eliminate_orphaned_client_records()
printf("%s\n", db->strerror());
}
}
+ fflush(stdout);
}
if (quit) {
return;
}
if (fix && id_list.num_ids > 0) {
printf(_("Deleting %d orphaned Client records.\n"), id_list.num_ids);
+ fflush(stdout);
delete_id_list("DELETE FROM Client WHERE ClientId=%s", &id_list);
}
}
@@ -1126,10 +1151,12 @@ static void eliminate_orphaned_job_records()
if (verbose > 1) {
printf("%s\n", query);
}
+ fflush(stdout);
if (!make_id_list(query, &id_list)) {
exit(1);
}
printf(_("Found %d orphaned Job records.\n"), id_list.num_ids);
+ fflush(stdout);
if (id_list.num_ids && verbose && yes_no(_("Print them? (yes/no): "))) {
for (int i=0; i < id_list.num_ids; i++) {
char ed1[50];
@@ -1139,16 +1166,20 @@ static void eliminate_orphaned_job_records()
printf("%s\n", db->strerror());
}
}
+ fflush(stdout);
}
if (quit) {
return;
}
if (fix && id_list.num_ids > 0) {
printf(_("Deleting %d orphaned Job records.\n"), id_list.num_ids);
+ fflush(stdout);
delete_id_list("DELETE FROM Job WHERE JobId=%s", &id_list);
printf(_("Deleting JobMedia records of orphaned Job records.\n"));
+ fflush(stdout);
delete_id_list("DELETE FROM JobMedia WHERE JobId=%s", &id_list);
printf(_("Deleting Log records of orphaned Job records.\n"));
+ fflush(stdout);
delete_id_list("DELETE FROM Log WHERE JobId=%s", &id_list);
}
}
@@ -1163,6 +1194,7 @@ static void eliminate_admin_records()
if (verbose > 1) {
printf("%s\n", query);
}
+ fflush(stdout);
if (!make_id_list(query, &id_list)) {
exit(1);
}
@@ -1176,12 +1208,14 @@ static void eliminate_admin_records()
printf("%s\n", db->strerror());
}
}
+ fflush(stdout);
}
if (quit) {
return;
}
if (fix && id_list.num_ids > 0) {
printf(_("Deleting %d Admin Job records.\n"), id_list.num_ids);
+ fflush(stdout);
delete_id_list("DELETE FROM Job WHERE JobId=%s", &id_list);
}
}
@@ -1196,6 +1230,7 @@ static void eliminate_restore_records()
if (verbose > 1) {
printf("%s\n", query);
}
+ fflush(stdout);
if (!make_id_list(query, &id_list)) {
exit(1);
}
@@ -1209,12 +1244,14 @@ static void eliminate_restore_records()
printf("%s\n", db->strerror());
}
}
+ fflush(stdout);
}
if (quit) {
return;
}
if (fix && id_list.num_ids > 0) {
printf(_("Deleting %d Restore Job records.\n"), id_list.num_ids);
+ fflush(stdout);
delete_id_list("DELETE FROM Job WHERE JobId=%s", &id_list);
}
}
@@ -1230,6 +1267,7 @@ static void repair_bad_filenames()
if (verbose > 1) {
printf("%s\n", query);
}
+ fflush(stdout);
if (!make_id_list(query, &id_list)) {
exit(1);
}
@@ -1244,6 +1282,7 @@ static void repair_bad_filenames()
printf("%s\n", db->strerror());
}
}
+ fflush(stdout);
}
if (quit) {
return;
@@ -1252,6 +1291,7 @@ static void repair_bad_filenames()
POOLMEM *name = get_pool_memory(PM_FNAME);
char esc_name[5000];
printf(_("Reparing %d bad Filename records.\n"), id_list.num_ids);
+ fflush(stdout);
for (i=0; i < id_list.num_ids; i++) {
int len;
char ed1[50];
@@ -1284,6 +1324,7 @@ static void repair_bad_filenames()
}
free_pool_memory(name);
}
+ fflush(stdout);
}
static void repair_bad_paths()
@@ -1297,10 +1338,12 @@ static void repair_bad_paths()
if (verbose > 1) {
printf("%s\n", query);
}
+ fflush(stdout);
if (!make_id_list(query, &id_list)) {
exit(1);
}
printf(_("Found %d bad Path records.\n"), id_list.num_ids);
+ fflush(stdout);
if (id_list.num_ids && verbose && yes_no(_("Print them? (yes/no): "))) {
for (i=0; i < id_list.num_ids; i++) {
char ed1[50];
@@ -1310,6 +1353,7 @@ static void repair_bad_paths()
printf("%s\n", db->strerror());
}
}
+ fflush(stdout);
}
if (quit) {
return;
@@ -1318,6 +1362,7 @@ static void repair_bad_paths()
POOLMEM *name = get_pool_memory(PM_FNAME);
char esc_name[5000];
printf(_("Reparing %d bad Filename records.\n"), id_list.num_ids);
+ fflush(stdout);
for (i=0; i < id_list.num_ids; i++) {
int len;
char ed1[50];
@@ -1344,6 +1389,7 @@ static void repair_bad_paths()
}
db->sql_query(buf, NULL, NULL);
}
+ fflush(stdout);
free_pool_memory(name);
}
}
@@ -1356,6 +1402,7 @@ static char *get_cmd(const char *prompt)
static char cmd[1000];
printf("%s", prompt);
+ fflush(stdout);
if (fgets(cmd, sizeof(cmd), stdin) == NULL) {
printf("\n");
quit = true;
@@ -1365,9 +1412,15 @@ static char *get_cmd(const char *prompt)
return cmd;
}
-static bool yes_no(const char *prompt)
+static bool yes_no(const char *prompt, bool batchvalue/* = true*/)
{
char *cmd;
+ /*
+ * return the batchvalue if batch operation is set
+ */
+ if (batch) {
+ return batchvalue;
+ }
cmd = get_cmd(prompt);
if (!cmd) {
quit = true;
@@ -1447,6 +1500,7 @@ static bool check_idx(const char *col_name)
memset(&idx_list, 0, sizeof(idx_list));
if (!db->sql_query(query, check_idx_handler, (void *)col_name)) {
printf("%s\n", db->strerror());
+ fflush(stdout);
}
for (i = 0; (idx_list[i].key_name != NULL) && (i < (MAXIDX - 1)) ; i++) {
/*
@@ -1466,6 +1520,7 @@ static bool check_idx(const char *col_name)
} else {
printf(_("Note. Index over the %s column not found, that can greatly slow down dbcheck.\n"), col_name);
}
+ fflush(stdout);
return found;
default:
return true;
@@ -1480,6 +1535,7 @@ static bool create_tmp_idx(const char *idx_name, const char *table_name,
{
idx_tmp_name = NULL;
printf(_("Create temporary index... This may take some time!\n"));
+ fflush(stdout);
bsnprintf(buf, sizeof(buf), "CREATE INDEX %s ON %s (%s)", idx_name, table_name, col_name);
if (verbose) {
printf("%s\n", buf);
@@ -1493,6 +1549,7 @@ static bool create_tmp_idx(const char *idx_name, const char *table_name,
printf("%s\n", db->strerror());
return false;
}
+ fflush(stdout);
return true;
}
@@ -1503,6 +1560,7 @@ static bool drop_tmp_idx(const char *idx_name, const char *table_name)
{
if (idx_tmp_name != NULL) {
printf(_("Drop temporary index.\n"));
+ fflush(stdout);
bsnprintf(buf, sizeof(buf), "DROP INDEX %s ON %s", idx_name, table_name);
if (verbose) {
printf("%s\n", buf);
@@ -1515,6 +1573,7 @@ static bool drop_tmp_idx(const char *idx_name, const char *table_name)
printf(_("Temporary index %s deleted.\n"), idx_tmp_name);
}
}
+ fflush(stdout);
}
idx_tmp_name = NULL;
return true;
diff --git a/src/dird/ua.h b/src/dird/ua.h
index 56bb8a69cd5..b4d0067838f 100644
--- a/src/dird/ua.h
+++ b/src/dird/ua.h
@@ -92,7 +92,7 @@ class UAContext {
int rcode_to_acltype(int rcode);
void log_audit_event_acl_failure(int acl, const char *item);
void log_audit_event_acl_success(int acl, const char *item);
- void set_command_definition(ua_cmdstruct *cmd) { cmddef = cmd; }
+ void set_command_definition(ua_cmdstruct *cmdstruct) { cmddef = cmdstruct; }
public:
/*
diff --git a/src/dird/ua_status.c b/src/dird/ua_status.c
index ee4987d340d..6efc6ec8645 100644
--- a/src/dird/ua_status.c
+++ b/src/dird/ua_status.c
@@ -3,7 +3,7 @@
Copyright (C) 2001-2012 Free Software Foundation Europe e.V.
Copyright (C) 2011-2016 Planets Communications B.V.
- Copyright (C) 2013-2016 Bareos GmbH & Co. KG
+ Copyright (C) 2013-2017 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
@@ -1278,16 +1278,18 @@ static void list_connected_clients(UAContext *ua)
connections = get_client_connections()->get_as_alist();
ua->send->decoration("%-20s%-20s%-20s%-40s\n", "Connect time", "Protocol", "Authenticated", "Name");
ua->send->decoration("%-20s%-20s%-20s%-20s%-20s\n", separator, separator, separator, separator, separator);
+ ua->send->array_start("client-connection");
foreach_alist(connection, connections) {
- ua->send->object_start("client-connection");
+ ua->send->object_start();
bstrftime_nc(dt, sizeof(dt), connection->connect_time());
ua->send->object_key_value("connect_time", dt, "%-20s");
ua->send->object_key_value("protocol_version", connection->protocol_version(), "%-20d");
ua->send->object_key_value("authenticated", connection->authenticated(), "%-20d");
ua->send->object_key_value("name", connection->name(), "%-40s");
- ua->send->object_end("client-connection");
+ ua->send->object_end();
ua->send->decoration("\n");
}
+ ua->send->array_end("client-connection");
}
static void content_send_info_api(UAContext *ua, char type, int Slot, char *vol_name)
diff --git a/src/plugins/filed/Makefile.in b/src/plugins/filed/Makefile.in
index 9ce1a8ce785..2f181e03ba2 100644
--- a/src/plugins/filed/Makefile.in
+++ b/src/plugins/filed/Makefile.in
@@ -102,13 +102,15 @@ install: all
CONF=`echo $$plugin | sed 's/\(.*\)-fd.la$$/\1-conf.d/'`; \
if [ -d "$$CONF" ]; then \
for i in `find "$$CONF/" \( -name "*.conf" -o -name "*.conf.example" \) -print | cut -d'/' -f2-`; do \
- $(INSTALL_CONFIG) -D $$CONF/$$i ${DESTDIR}${confdir}/$$i; \
+ $(MKDIR) `dirname ${DESTDIR}${confdir}/$$i`; \
+ $(INSTALL_CONFIG) $$CONF/$$i ${DESTDIR}${confdir}/$$i; \
done; \
fi; \
if [ "$$plugin" = "python-fd.la" ]; then \
$(CP) *.py *.py.template $(DESTDIR)$(plugindir); \
for i in `find python-ldap-conf.d/ \( -name "*.conf" -o -name "*.conf.example" \) -print | cut -d'/' -f2-`; do \
- $(INSTALL_CONFIG) -D python-ldap-conf.d/$$i ${DESTDIR}${confdir}/$$i; \
+ $(MKDIR) `dirname ${DESTDIR}${confdir}/$$i`; \
+ $(INSTALL_CONFIG) python-ldap-conf.d/$$i ${DESTDIR}${confdir}/$$i; \
done; \
fi; \
done
diff --git a/src/stored/backends/Makefile.in b/src/stored/backends/Makefile.in
index c7e80443dc3..dba7da8c074 100644
--- a/src/stored/backends/Makefile.in
+++ b/src/stored/backends/Makefile.in
@@ -75,7 +75,7 @@ STORED_RESTYPES = autochanger device director ndmp messages storage
.c.lo:
@echo "Compiling $<"
$(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(INCLUDES) $(DINCLUDE) $(CXXFLAGS) $<
- if [ -e "$(@:.lo=.d)" ]; then $(MKDIR) $(CONF_EXTRA_DIR); $(CP) -r $(@:.lo=.d)/. $(CONF_EXTRA_DIR)/.; fi
+ if [ -d "$(@:.lo=.d)" ]; then $(MKDIR) $(CONF_EXTRA_DIR); $(CP) -r $(@:.lo=.d)/. $(CONF_EXTRA_DIR)/.; fi
$(ELASTO_LOBJS):
@echo "Compiling $(@:.lo=.c)"
@@ -84,12 +84,12 @@ $(ELASTO_LOBJS):
$(CHEPHFS_LOBJS):
@echo "Compiling $(@:.lo=.c)"
$(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(INCLUDES) $(CEPHFS_INC) $(DINCLUDE) $(CXXFLAGS) $(@:.lo=.c)
- if [ -e "$(@:.lo=.d)" ]; then $(MKDIR) $(CONF_EXTRA_DIR); $(CP) -r $(@:.lo=.d)/. $(CONF_EXTRA_DIR)/.; fi
+ if [ -d "$(@:.lo=.d)" ]; then $(MKDIR) $(CONF_EXTRA_DIR); $(CP) -r $(@:.lo=.d)/. $(CONF_EXTRA_DIR)/.; fi
$(GFAPI_LOBJS):
@echo "Compiling $(@:.lo=.c)"
$(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(INCLUDES) $(GLUSTER_INC) $(DINCLUDE) $(CXXFLAGS) $(@:.lo=.c)
- if [ -e "$(@:.lo=.d)" ]; then $(MKDIR) $(CONF_EXTRA_DIR); $(CP) -r $(@:.lo=.d)/. $(CONF_EXTRA_DIR)/.; fi
+ if [ -d "$(@:.lo=.d)" ]; then $(MKDIR) $(CONF_EXTRA_DIR); $(CP) -r $(@:.lo=.d)/. $(CONF_EXTRA_DIR)/.; fi
$(OBJECT_LOBJS):
@echo "Compiling $(@:.lo=.c)"
@@ -98,7 +98,7 @@ $(OBJECT_LOBJS):
$(RADOS_LOBJS):
@echo "Compiling $(@:.lo=.c)"
$(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(INCLUDES) $(RADOS_INC) $(DINCLUDE) $(CXXFLAGS) $(@:.lo=.c)
- if [ -e "$(@:.lo=.d)" ]; then $(MKDIR) $(CONF_EXTRA_DIR); $(CP) -r $(@:.lo=.d)/. $(CONF_EXTRA_DIR)/.; fi
+ if [ -d "$(@:.lo=.d)" ]; then $(MKDIR) $(CONF_EXTRA_DIR); $(CP) -r $(@:.lo=.d)/. $(CONF_EXTRA_DIR)/.; fi
#-------------------------------------------------------------------------
all: Makefile $(BUILD_BACKENDS)
@@ -186,7 +186,7 @@ install-config:
$(MKDIR) $$DESTCONFDIR; \
for RESTYPE in $(STORED_RESTYPES); do \
for f in $$SRCCONFDIR/$$RESTYPE/*.conf $$SRCCONFDIR/$$RESTYPE/*.conf.example; do \
- if test -e "$$f"; then \
+ if test -f "$$f"; then \
RESDIR="$$DESTCONFDIR/$$RESTYPE"; \
$(MKDIR) "$$RESDIR"; \
RES=`basename "$$f"`; \