Bug fix: The .. directory record exposed Rock Ridge properties of its grand grand parent. Caused by commit 4d0063f7
in 2009 which fixed the block address pointer of the .. record.
This commit is contained in:
@@ -729,6 +729,12 @@ void write_one_dir_record(Ecma119Image *t, Ecma119Node *dir, Ecma119Node *node,
|
||||
rec->file_id[len_fi++] = '1';
|
||||
}
|
||||
|
||||
/*
|
||||
* For ".." entry we need to write the parent info!
|
||||
*/
|
||||
if (file_id == 1 && node->parent)
|
||||
node = node->parent;
|
||||
|
||||
if (node->type == ECMA119_DIR) {
|
||||
/* use the cached length */
|
||||
len = node->info.dir->len;
|
||||
@@ -749,12 +755,6 @@ void write_one_dir_record(Ecma119Image *t, Ecma119Node *dir, Ecma119Node *node,
|
||||
block = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* For ".." entry we need to write the parent info!
|
||||
*/
|
||||
if (file_id == 1 && node->parent)
|
||||
node = node->parent;
|
||||
|
||||
rec->len_dr[0] = len_dr + (info != NULL ? info->suf_len : 0);
|
||||
iso_bb(rec->block, block - t->eff_partition_offset, 4);
|
||||
iso_bb(rec->length, len, 4);
|
||||
@@ -1024,8 +1024,11 @@ int write_one_dir(Ecma119Image *t, Ecma119Node *dir, Ecma119Node *parent)
|
||||
}
|
||||
}
|
||||
len = 34 + info.suf_len;
|
||||
write_one_dir_record(t, (parent != NULL ? parent->parent : NULL), parent,
|
||||
1, buf, 1, &info, 0, 0);
|
||||
|
||||
/* (The third argument will be changed in write_one_dir_record()
|
||||
to dir->parent because of type==1)
|
||||
*/
|
||||
write_one_dir_record(t, dir, dir, 1, buf, 1, &info, 0, 0);
|
||||
buf += len;
|
||||
|
||||
for (i = 0; i < dir->info.dir->nchildren; i++) {
|
||||
|
Reference in New Issue
Block a user