Warning of -volid which are not ECMA 119 compliant

This commit is contained in:
Thomas Schmitt 2008-02-08 19:57:18 +00:00
parent cb0b796c34
commit 94ce48c7c2
2 changed files with 16 additions and 7 deletions

View File

@ -8271,23 +8271,32 @@ int Xorriso_option_version(struct XorrisO *xorriso, int flag)
/* Option -volid */
int Xorriso_option_volid(struct XorrisO *xorriso, char *volid, int flag)
{
int warn= 0, i, ret;
static char good_chars[]= {
int warn_shell= 0, warn_ecma= 0, i, ret;
static char shell_chars[]= {
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-+=:.,~@"};
static char ecma_chars[]= {"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"};
for(i=0; volid[i]!=0; i++)
if(strchr(good_chars, volid[i])==NULL)
warn= 1;
for(i=0; volid[i]!=0; i++) {
if(strchr(shell_chars, volid[i])==NULL)
warn_shell= 1;
if(strchr(ecma_chars, volid[i])==NULL)
warn_ecma= 1;
}
if(i>32) {
sprintf(xorriso->info_text, "-volid: Text too long (%d > 32)", i);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
if(warn) {
if(warn_shell) {
sprintf(xorriso->info_text,
"-volid text problematic as automatic mount point name");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
}
if(warn_ecma) {
sprintf(xorriso->info_text,
"-volid text does not comply to ISO 9660 / ECMA 119 rules");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
}
strcpy(xorriso->volid, volid);
ret= Xorriso_set_volid(xorriso, volid, 0);
if(ret<=0)

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.02.08.175152"
#define Xorriso_timestamP "2008.02.08.195627"