From 9e32beab762f347d7ef800b43d5940856467ae39 Mon Sep 17 00:00:00 2001 From: Marco van Wieringen Date: Mon, 19 May 2014 09:33:54 +0200 Subject: [PATCH] Fix hardware encryption (LTO) not creating cachefile/hangs bconsole Use bget_dirmsg() instead of bnet_recv() when automounting volume because as part of the mount request the stored can request catalog information for any plugin who listens to the bsdEventLabelVerified event. Fixes #297: hardware encryption (LTO) not creating cachefile/hangs bconsole --- src/dird/ua_label.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/dird/ua_label.c b/src/dird/ua_label.c index 410a62eeecc..2f6cdb42c09 100644 --- a/src/dird/ua_label.c +++ b/src/dird/ua_label.c @@ -291,8 +291,19 @@ static int do_label(UAContext *ua, const char *cmd, bool relabel) bash_spaces(dev_name); bnet_fsend(sd, "mount %s drive=%d", dev_name, drive); unbash_spaces(dev_name); - while (bnet_recv(sd) >= 0) { + + /* + * We use bget_dirmsg here and not bnet_recv because as part of + * the mount request the stored can request catalog information for + * any plugin who listens to the bsdEventLabelVerified event. + * As we don't want to loose any non protocol data e.g. errors + * without a 3xxx prefix we set the allow_any_message of + * bget_dirmsg to true and as such is behaves like a normal + * bnet_recv for any non protocol messages. + */ + while (bget_dirmsg(sd, true) >= 0) { ua->send_msg("%s", sd->msg); + /* * Here we can get * 3001 OK mount. Device=xxx or @@ -309,9 +320,11 @@ static int do_label(UAContext *ua, const char *cmd, bool relabel) } } } + if (print_reminder) { ua->info_msg(_("Do not forget to mount the drive!!!\n")); } + close_sd_bsock(ua); return 1;