- /*
- * Restore object */
- if (ar->FileType == FT_RESTORE_FIRST) {
- ROBJECT_DBR ro;
- POOLMEM *attrEx = get_pool_memory(PM_MESSAGE);
- char *p;
- memset(&ro, 0, sizeof(ro));
- ro.full_fname = fname;
- ro.Stream = Stream;
- ro.FileType = ar->FileType;
- ro.FileIndex = FileIndex;
- ro.JobId = ar->JobId;
- p = ar->attr; /* point to attributes */
- while (*p++ != 0) /* skip attributes */
- { }
- while (*p++ != 0) /* skip link */
- { }
- /* We have an object, so do a binary copy */
- ro.object_len = msglen + jcr->attr - p;
- attrEx = check_pool_memory_size(attrEx, ro.object_len + 1);
- memcpy(attrEx, p, ro.object_len);
- ro.object = attrEx;
- /* Add a EOS for those who attempt to print the object */
- p = attrEx + ro.object_len;
- *p = 0;
- Dmsg7(000, "fname=%s stream=%d FT=%d FI=%d JobId=%d, obj_len=%d\nobj=\"%s\"\n",
- ro.full_fname, ro.Stream, ro.FileType, ro.FileIndex, ro.JobId,
- ro.object_len, attrEx);
- /* Send it */
- if (!db_create_restore_object_record(jcr, jcr->db, &ro)) {
- Jmsg1(jcr, M_FATAL, 0, _("Restore object create error. %s"), db_strerror(jcr->db));
- }
- free_pool_memory(attrEx);
- } else {
- ar->Digest = NULL;
- ar->DigestType = CRYPTO_DIGEST_NONE;
- jcr->cached_attribute = true;
- }