Skip to content

Commit

Permalink
Merge branch 'bareos-15.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco van Wieringen committed Nov 23, 2015
2 parents 1aa05e0 + e652bb0 commit a7a1f52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions scripts/bareos-config-lib.sh.in
Expand Up @@ -421,7 +421,8 @@ set_config_param()
chown --reference="${FILE}" "$TEMP"
chmod --reference="${FILE}" "$TEMP"

if ! mv "$TEMP" "$FILE"; then
mv "$TEMP" "$FILE"
if [ $? != 0 ]; then
warn "failed to set parameter ${SECTION} ${NAME} ${PARAM} = ${VALUE}: replacing $FILE failed"
rm -f "$TEMP"
return 1
Expand Down Expand Up @@ -462,7 +463,7 @@ get_database_param()
fi

# if $temp_log exists, but have only size 0, remove it.
if [ -f $temp_log ] && ! [ -s $temp_log ]; then
if [ -f $temp_log -a ! -s $temp_log ]; then
rm $temp_log
fi

Expand Down Expand Up @@ -576,7 +577,8 @@ get_translated_sql_file()
db_password="${db_password-`get_database_password @db_password@`}"
db_version=`get_database_version`

if echo "$db_password" | grep -q '#'; then
echo "$db_password" | grep '#' > /dev/null 2>&1
if [ $? != 0 ]; then
error "database passwords containing # are not supported."
return 3
fi
Expand Down
2 changes: 1 addition & 1 deletion src/lib/bsock.c
Expand Up @@ -215,7 +215,7 @@ bool BSOCK::fsend(const char *fmt, ...)
va_start(arg_ptr, fmt);
msglen = bvsnprintf(msg, maxlen, fmt, arg_ptr);
va_end(arg_ptr);
if (msglen > 0 && msglen < (maxlen - 5)) {
if (msglen >= 0 && msglen < (maxlen - 5)) {
break;
}
msg = realloc_pool_memory(msg, maxlen + maxlen / 2);
Expand Down

0 comments on commit a7a1f52

Please sign in to comment.