Skip to content

Commit

Permalink
Explitly check password encoding for NDMP resources.
Browse files Browse the repository at this point in the history
If you define for a client or storage daemon the protocol after you
configured the password it will store the password using the wrong
encoding as at the time of parsing it still thinks you will be using the
native protocol.

Fixes #408: Director crashes on password encoding for NDMP storage.
  • Loading branch information
Marco van Wieringen committed Feb 17, 2015
1 parent 30bfb24 commit bb43ec0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/dird/ndmp_dma.c
Expand Up @@ -503,6 +503,12 @@ static inline bool validate_client(JCR *jcr)
case APT_NDMPV2:
case APT_NDMPV3:
case APT_NDMPV4:
if (jcr->res.client->password.encoding != p_encoding_clear) {
Jmsg(jcr, M_FATAL, 0,
_("Client %s, has incompatible password encoding for running NDMP backup.\n"),
jcr->res.client->name());
return false;
}
break;
default:
Jmsg(jcr, M_FATAL, 0,
Expand All @@ -520,6 +526,12 @@ static inline bool validate_storage(JCR *jcr, STORERES *store)
case APT_NDMPV2:
case APT_NDMPV3:
case APT_NDMPV4:
if (store->password.encoding != p_encoding_clear) {
Jmsg(jcr, M_FATAL, 0,
_("Storage %s, has incompatible password encoding for running NDMP backup.\n"),
store->name());
return false;
}
break;
default:
Jmsg(jcr, M_FATAL, 0, _("Storage %s has illegal backup protocol %s for NDMP backup\n"),
Expand Down

0 comments on commit bb43ec0

Please sign in to comment.