"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "xorriso/iso_manip.c" between
libisoburn-1.5.0.tar.gz and libisoburn-1.5.2.tar.gz

About: libisoburn is a frontend for the libraries libburn and libisofs which enables creation and expansion of ISO-9660 filesystems on all media and file types supported by libburn. It implements the API and command interpreter of program xorriso, and installs this program as small dynamically linked binary. xorriso is suitable for incremental data backup and for production of bootable ISO 9660 images. A statically linked version is available as GNU xorriso.

iso_manip.c  (libisoburn-1.5.0):iso_manip.c  (libisoburn-1.5.2)
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2017 Thomas Schmitt, <scdbackup@gmx.net> Copyright 2007-2019 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later. Provided under GPL version 2 or later.
This file contains functions which manipulate the libisofs tree model. This file contains functions which manipulate the libisofs tree model.
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "../config.h" #include "../config.h"
#endif #endif
skipping to change at line 361 skipping to change at line 361
struct LinkiteM *link_stack, int flag) struct LinkiteM *link_stack, int flag)
{ {
IsoImage *volume; IsoImage *volume;
IsoNode *node; IsoNode *node;
int ret, source_is_dir, source_is_link, fret, was_failure= 0; int ret, source_is_dir, source_is_link, fret, was_failure= 0;
int do_not_dive, hide_attrs; int do_not_dive, hide_attrs;
struct DirseQ *dirseq= NULL; struct DirseQ *dirseq= NULL;
char *name, *img_name, *srcpt, *stbuf_src= ""; char *name, *img_name, *srcpt, *stbuf_src= "";
struct stat stbuf, hstbuf; struct stat stbuf, hstbuf;
dev_t dir_dev; dev_t dir_dev;
struct LinkiteM *own_link_stack; struct LinkiteM *own_link_stack = NULL;
char *sfe= NULL, *sfe2= NULL; char *sfe= NULL, *sfe2= NULL;
char *disk_path= NULL, *img_path= NULL, *link_target= NULL; char *disk_path= NULL, *img_path= NULL, *link_target= NULL;
#define Xorriso_add_handle_collisioN 1 #define Xorriso_add_handle_collisioN 1
#define Xorriso_optimistic_add_treE 1 #define Xorriso_optimistic_add_treE 1
#ifndef Xorriso_optimistic_add_treE #ifndef Xorriso_optimistic_add_treE
#ifndef Xorriso_add_handle_collisioN #ifndef Xorriso_add_handle_collisioN
int target_is_split= 0, target_is_dir; int target_is_split= 0, target_is_dir;
#endif #endif
skipping to change at line 863 skipping to change at line 863
ret= Xorriso_get_volume(xorriso, &volume, 0); ret= Xorriso_get_volume(xorriso, &volume, 0);
if(ret<=0) if(ret<=0)
goto ex; goto ex;
strncpy(path, img_path, SfileadrL - 1); strncpy(path, img_path, SfileadrL - 1);
path[SfileadrL - 1]= 0; path[SfileadrL - 1]= 0;
apt= npt= path; apt= npt= path;
if(!(flag & (1 | 1024))) { if(!(flag & (1 | 1024))) {
if(disk_path[0] == 0) {
Xorriso_msgs_submit(xorriso, 0, "/", 0, "ERRFILE", 0);
sprintf(xorriso->info_text,
"Will not graft-in the whole local filesystem by path '/'");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
ret= lstat(disk_path, &stbuf); ret= lstat(disk_path, &stbuf);
if(ret!=-1) { if(ret!=-1) {
if(S_ISDIR(stbuf.st_mode)) if(S_ISDIR(stbuf.st_mode))
is_dir= 1; is_dir= 1;
else if((stbuf.st_mode&S_IFMT)==S_IFLNK && else if((stbuf.st_mode&S_IFMT)==S_IFLNK &&
(xorriso->do_follow_links || (xorriso->do_follow_links ||
(xorriso->do_follow_param && !(flag&4)))) { (xorriso->do_follow_param && !(flag&4)))) {
resolve_link= 1; resolve_link= 1;
ret= stat(disk_path, &stbuf); ret= stat(disk_path, &stbuf);
if(ret!=-1) { if(ret!=-1) {
skipping to change at line 1573 skipping to change at line 1580
if(flag&16) if(flag&16)
xorriso->pacifier_count++; xorriso->pacifier_count++;
Xorriso_set_change_pending(xorriso, 0); Xorriso_set_change_pending(xorriso, 0);
ret= 1+!!is_dir; ret= 1+!!is_dir;
ex:; ex:;
if(sfe!=NULL) if(sfe!=NULL)
free(sfe); free(sfe);
if(sub_path!=NULL) if(sub_path!=NULL)
free(sub_path); free(sub_path);
Xorriso_findi_iter(xorriso, (IsoDir *) victim_node, &mem, &iter, Xorriso_findi_iter(xorriso, (IsoDir *) victim_node, &mem, &iter,
&node_array, &node_count, &node_idx, &node, (1<<31)); &node_array, &node_count, &node_idx, &node, (1u<<31));
return(ret); return(ret);
} }
int Xorriso_overwrite_dest(struct XorrisO *xorriso, void *boss_iter, int Xorriso_overwrite_dest(struct XorrisO *xorriso, void *boss_iter,
char *eff_dest, int dest_ret, char *activity, char *eff_dest, int dest_ret, char *activity,
int flag) int flag)
{ {
int ret; int ret;
if(dest_ret==2 && xorriso->do_overwrite!=1) { if(dest_ret==2 && xorriso->do_overwrite!=1) {
skipping to change at line 2070 skipping to change at line 2077
{ {
int ret; int ret;
IsoNode *node; IsoNode *node;
node= (IsoNode *) in_node; node= (IsoNode *) in_node;
if(node == NULL) { if(node == NULL) {
ret= Xorriso_get_node_by_path(xorriso, path, NULL, &node, 0); ret= Xorriso_get_node_by_path(xorriso, path, NULL, &node, 0);
if(ret<=0) if(ret<=0)
goto ex; goto ex;
} }
ret= iso_node_set_acl_text(node, access_text, default_text, 0); ret= iso_node_set_acl_text(node, access_text, default_text, 4);
Xorriso_process_msg_queues(xorriso,0);
if(ret <= 0) { if(ret <= 0) {
Xorriso_report_iso_error(xorriso, "", ret, Xorriso_report_iso_error(xorriso, "", ret,
"Error when setting ACL to image node", "Error when setting ACL to image node",
0, "FAILURE", 1); 0, "FAILURE", 1);
if(path != NULL && path[0] != 0) { if(path != NULL && path[0] != 0) {
strcpy(xorriso->info_text, "Error with setting ACL of "); strcpy(xorriso->info_text, "Error with setting ACL of ");
Text_shellsafe(path, xorriso->info_text, 1); Text_shellsafe(path, xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
} }
ret= 0; goto ex; ret= 0; goto ex;
} }
Xorriso_set_change_pending(xorriso, 0); Xorriso_set_change_pending(xorriso, 0);
ret= 1; ret= 1;
ex:; ex:;
Xorriso_process_msg_queues(xorriso,0);
return(ret); return(ret);
} }
/* @param in_node Opaque handle to IsoNode which is to be manipulated /* @param in_node Opaque handle to IsoNode which is to be manipulated
instead of path if it is not NULL. instead of path if it is not NULL.
@param path is used as address if node is NULL. @param path is used as address if node is NULL.
@param num_attrs Number of attributes @param num_attrs Number of attributes
@param names Array of pointers to 0 terminated name strings @param names Array of pointers to 0 terminated name strings
@param value_lengths Array of byte lengths for each attribute payload @param value_lengths Array of byte lengths for each attribute payload
@param values Array of pointers to the attribute payload bytes @param values Array of pointers to the attribute payload bytes
skipping to change at line 2551 skipping to change at line 2558
iso_dir_iter_free(*iter); iso_dir_iter_free(*iter);
*iter= NULL; *iter= NULL;
*node_count= *node_idx; *node_count= *node_idx;
*node_idx= 0; *node_idx= 0;
if((flag&4) && *node_count>1) if((flag&4) && *node_count>1)
qsort(*node_array, *node_count, sizeof(IsoNode *), qsort(*node_array, *node_count, sizeof(IsoNode *),
Xorriso__node_lba_cmp); Xorriso__node_lba_cmp);
} }
} }
if(flag&(1<<31)) { if(flag&(1u<<31)) {
if(*node_count>=0 && *node_array!=NULL) { if(*node_count>=0 && *node_array!=NULL) {
for(i= 0; i<*node_count; i++) for(i= 0; i<*node_count; i++)
iso_node_unref((*node_array)[i]); iso_node_unref((*node_array)[i]);
free(*node_array); free(*node_array);
*node_array= NULL; *node_array= NULL;
*node_count= -1; *node_count= -1;
*node_idx= 0; *node_idx= 0;
} else { } else {
if(*iter!=NULL) if(*iter!=NULL)
iso_dir_iter_free(*iter); iso_dir_iter_free(*iter);
*iter= NULL; *iter= NULL;
} }
} }
if(flag&(1|(1<<31))) if(flag&(1|(1u<<31)))
return(1); return(1);
if(*node_count>=0) { if(*node_count>=0) {
/* return next node_array element */ /* return next node_array element */
if(*node_idx>=*node_count) if(*node_idx>=*node_count)
return(0); return(0);
*iterated_node= (*node_array)[*node_idx]; *iterated_node= (*node_array)[*node_idx];
(*node_idx)++; (*node_idx)++;
} else { } else {
ret= iso_dir_iter_next(*iter, iterated_node); ret= iso_dir_iter_next(*iter, iterated_node);
return(ret == 1); return(ret == 1);
skipping to change at line 3508 skipping to change at line 3515
ret= 1; ret= 1;
ex:; ex:;
job->depth= depth; job->depth= depth;
if(path!=NULL) if(path!=NULL)
free(path); free(path);
if(abs_path!=NULL) if(abs_path!=NULL)
free(abs_path); free(abs_path);
Xorriso_process_msg_queues(xorriso,0); Xorriso_process_msg_queues(xorriso,0);
Xorriso_findi_iter(xorriso, dir_node, &mem, &iter, &node_array, &node_count, Xorriso_findi_iter(xorriso, dir_node, &mem, &iter, &node_array, &node_count,
&node_idx, &node, (1<<31)); &node_idx, &node, (1u<<31));
if(ret<=0) if(ret<=0)
return(ret); return(ret);
if(deleted) if(deleted)
return(2); return(2);
return(1); return(1);
} }
/* @param flag bit0= do not dive into trees /* @param flag bit0= do not dive into trees
bit1= do not perform job->action on resulting node array bit1= do not perform job->action on resulting node array
bit2= do not free node_array after all actions are done bit2= do not free node_array after all actions are done
 End of changes. 9 change blocks. 
8 lines changed or deleted 15 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)