Skip to content

Commit

Permalink
Fix hardware encryption (LTO) not creating cachefile/hangs bconsole
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Marco van Wieringen committed May 20, 2014
1 parent 2dc3267 commit 9e32bea
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/dird/ua_label.c
Expand Up @@ -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
Expand All @@ -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;
Expand Down

0 comments on commit 9e32bea

Please sign in to comment.