Protecting volume ids from getting overwritten by predecessor
This commit is contained in:
parent
a163cca3eb
commit
d4b5098636
@ -2,7 +2,7 @@
|
|||||||
.\" First parameter, NAME, should be all caps
|
.\" First parameter, NAME, should be all caps
|
||||||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
||||||
.\" other parameters are allowed: see man(7), man(1)
|
.\" other parameters are allowed: see man(7), man(1)
|
||||||
.TH XORRISO 1 "February 5, 2008"
|
.TH XORRISO 1 "February 8, 2008"
|
||||||
.\" Please adjust this date whenever revising the manpage.
|
.\" Please adjust this date whenever revising the manpage.
|
||||||
.\"
|
.\"
|
||||||
.\" Some roff macros, for reference:
|
.\" Some roff macros, for reference:
|
||||||
@ -887,8 +887,11 @@ Specifies the volume ID. The text may be up to 32 characters long.
|
|||||||
Be aware that it might get used automatically as name of the mount point
|
Be aware that it might get used automatically as name of the mount point
|
||||||
when the media is inserted into a playful computer system.
|
when the media is inserted into a playful computer system.
|
||||||
.br
|
.br
|
||||||
If an ISO image gets loaded while the volume ID is set to default "ISOIMAGE",
|
If an ISO image gets loaded while the volume ID is set to default "ISOIMAGE"
|
||||||
then the volume ID of the loaded image will become the new -volid setting.
|
or to "", then the volume ID of the loaded image will become the effective
|
||||||
|
volume id for the next write run. But as soon as command -volid is performed
|
||||||
|
afterwards, this pending id is overridden by the new setting.
|
||||||
|
.br
|
||||||
Consider this when setting -volid "ISOIMAGE" before executing -dev, -indev,
|
Consider this when setting -volid "ISOIMAGE" before executing -dev, -indev,
|
||||||
or -rollback.
|
or -rollback.
|
||||||
If you insist in -volid "ISOIMAGE", set it again after those commands.
|
If you insist in -volid "ISOIMAGE", set it again after those commands.
|
||||||
|
@ -2686,6 +2686,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
|
|||||||
m->global_uid= 0;
|
m->global_uid= 0;
|
||||||
strcpy(m->volid, "ISOIMAGE");
|
strcpy(m->volid, "ISOIMAGE");
|
||||||
m->loaded_volid[0]= 0;
|
m->loaded_volid[0]= 0;
|
||||||
|
m->volid_default= 1;
|
||||||
m->do_global_gid= 0;
|
m->do_global_gid= 0;
|
||||||
m->global_gid= 0;
|
m->global_gid= 0;
|
||||||
m->do_global_mode= 0;
|
m->do_global_mode= 0;
|
||||||
@ -3852,10 +3853,16 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
|
|||||||
if(!(is_default && no_defaults))
|
if(!(is_default && no_defaults))
|
||||||
Xorriso_status_result(xorriso,filter,fp,flag&2);
|
Xorriso_status_result(xorriso,filter,fp,flag&2);
|
||||||
|
|
||||||
is_default= (strcmp(xorriso->volid, "ISOIMAGE")==0);
|
is_default= xorriso->volid_default;
|
||||||
sprintf(line,"-volid %s\n",Text_shellsafe(xorriso->volid,sfe,0));
|
sprintf(line,"-volid %s\n",Text_shellsafe(xorriso->volid,sfe,0));
|
||||||
if(!(is_default && no_defaults))
|
if(!(is_default && no_defaults))
|
||||||
Xorriso_status_result(xorriso,filter,fp,flag&2);
|
Xorriso_status_result(xorriso,filter,fp,flag&2);
|
||||||
|
if(is_default && xorriso->loaded_volid[0] &&
|
||||||
|
strcmp(xorriso->loaded_volid, xorriso->volid)!=0 && !no_defaults) {
|
||||||
|
sprintf(line,"# loaded image effective -volid %s\n",
|
||||||
|
Text_shellsafe(xorriso->loaded_volid,sfe,0));
|
||||||
|
Xorriso_status_result(xorriso,filter,fp,flag&2);
|
||||||
|
}
|
||||||
|
|
||||||
is_default= (xorriso->do_joliet==0);
|
is_default= (xorriso->do_joliet==0);
|
||||||
sprintf(line,"-joliet %s\n", (xorriso->do_joliet == 1 ? "on" : "off"));
|
sprintf(line,"-joliet %s\n", (xorriso->do_joliet == 1 ? "on" : "off"));
|
||||||
@ -8285,6 +8292,8 @@ int Xorriso_option_volid(struct XorrisO *xorriso, char *volid, int flag)
|
|||||||
ret= Xorriso_set_volid(xorriso, volid, 0);
|
ret= Xorriso_set_volid(xorriso, volid, 0);
|
||||||
if(ret<=0)
|
if(ret<=0)
|
||||||
return(ret);
|
return(ret);
|
||||||
|
xorriso->volid_default= (strcmp(xorriso->volid, "ISOIMAGE")==0 ||
|
||||||
|
xorriso->volid[0]==0);
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,6 +85,7 @@ struct XorrisO { /* the global context of xorriso */
|
|||||||
int do_reassure; /* 0=off, 1=on, 2=tree */
|
int do_reassure; /* 0=off, 1=on, 2=tree */
|
||||||
|
|
||||||
char volid[33];
|
char volid[33];
|
||||||
|
int volid_default;
|
||||||
char loaded_volid[33];
|
char loaded_volid[33];
|
||||||
|
|
||||||
/* >>> put libburn/isoburn aspects here */
|
/* >>> put libburn/isoburn aspects here */
|
||||||
|
@ -1 +1 @@
|
|||||||
#define Xorriso_timestamP "2008.02.08.174126"
|
#define Xorriso_timestamP "2008.02.08.175152"
|
||||||
|
@ -349,9 +349,7 @@ int Xorriso_update_volid(struct XorrisO *xorriso, int flag)
|
|||||||
int gret, sret= 1;
|
int gret, sret= 1;
|
||||||
|
|
||||||
gret= Xorriso_get_volid(xorriso, xorriso->loaded_volid, 0);
|
gret= Xorriso_get_volid(xorriso, xorriso->loaded_volid, 0);
|
||||||
if(gret>0 && strcmp(xorriso->volid, "ISOIMAGE")==0)
|
if(gret<=0 || (!xorriso->volid_default) || xorriso->loaded_volid[0]==0)
|
||||||
strcpy(xorriso->volid, xorriso->loaded_volid);
|
|
||||||
else
|
|
||||||
sret= Xorriso_set_volid(xorriso, xorriso->volid, 1);
|
sret= Xorriso_set_volid(xorriso, xorriso->volid, 1);
|
||||||
return(gret>0 && sret>0);
|
return(gret>0 && sret>0);
|
||||||
}
|
}
|
||||||
@ -574,7 +572,8 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
|
|||||||
if(xorriso->loaded_volid[0]!=0) {
|
if(xorriso->loaded_volid[0]!=0) {
|
||||||
sprintf(xorriso->result_line,"Volume id : '%s'\n",xorriso->loaded_volid);
|
sprintf(xorriso->result_line,"Volume id : '%s'\n",xorriso->loaded_volid);
|
||||||
Xorriso_result(xorriso,0);
|
Xorriso_result(xorriso,0);
|
||||||
if(strcmp(xorriso->loaded_volid, xorriso->volid)!=0) {
|
if(strcmp(xorriso->loaded_volid, xorriso->volid)!=0 &&
|
||||||
|
!xorriso->volid_default) {
|
||||||
sprintf(xorriso->result_line, "New volume id: '%s'\n", xorriso->volid);
|
sprintf(xorriso->result_line, "New volume id: '%s'\n", xorriso->volid);
|
||||||
Xorriso_result(xorriso,0);
|
Xorriso_result(xorriso,0);
|
||||||
}
|
}
|
||||||
@ -3508,6 +3507,8 @@ int Xorriso_set_volid(struct XorrisO *xorriso, char *volid, int flag)
|
|||||||
int ret;
|
int ret;
|
||||||
IsoImage *volume;
|
IsoImage *volume;
|
||||||
|
|
||||||
|
if(xorriso->in_volset_handle == NULL)
|
||||||
|
return(2);
|
||||||
ret= Xorriso_get_volume(xorriso, &volume, 0);
|
ret= Xorriso_get_volume(xorriso, &volume, 0);
|
||||||
if(ret<=0)
|
if(ret<=0)
|
||||||
return(ret);
|
return(ret);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user