There is two values :
Backup Client: this is related to the backup job, then this is immutable as the job already ran
Restore Client: this is related to the restore, this can change
In a "normal" restore, the values that are assigned are as follow :
Backup Client: rc.client ? rc.client->hdr.name : jcr->job->client->hdr.name
Restore Client: jcr->client->name()
We can see the values that have changed before and after the "mod"
ua_run.c:173-0 ASX rc.client=0x55af0c0d5aa8 jcr->job->client->hdr.name=1-fd rc.client->hdr.name=1-fd jcr->client->name()=1-fd
ua_run.c:173-0 ASX rc.client=0x55af0c0d7eb8 jcr->job->client->hdr.name=1-fd rc.client->hdr.name=2-fd jcr->client->name()=2-fd
The value jcr->job->client->hdr.name did not change has expected (it should be immutable) and should be used instead of the conditional for the "Backup Client" value
When doing the mod, the code does
case 4:
/* Client */
{
int32_t jt = rc.job ? rc.job->JobType : JT_SYSTEM;
rc.client = select_client_resource(ua, jt);
if (rc.client) {
jcr->client = rc.client;
goto try_again;
}
}
Then both the rc.client and the jcr->client are modified
I think the right solution is just to use
jcr->job->client->hdr.name
instead of the conditional
rc.client ? rc.client->hdr.name : jcr->job->client->hdr.name
* allow him to modify them.
*/
if (!display_job_parameters(ua, jcr, rc.job, rc.verify_list, rc.jid, rc.replace,
- rc.client ? rc.client->hdr.name : jcr->job->client->hdr.name)) {
+ jcr->job->client->hdr.name)) {
break; /* error get out of while loop */
}