-disk_dev_ino mode ino_only

This commit is contained in:
Thomas Schmitt 2009-02-25 14:40:47 +00:00
parent 73fe193351
commit 493d2817bc
5 changed files with 103 additions and 23 deletions

View File

@ -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 "Feb 12, 2008" .TH XORRISO 1 "Feb 23, 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:
@ -414,7 +414,10 @@ enhanced images and to restore them to xattr capable file systems.
.SS .SS
.B Command processing: .B Command processing:
.br .br
Commands are either actions or settings. They consist of a command word, Commands are either actions which happen immediately or settings which
influence following actions. So their sequence does matter.
.br
Commands consist of a command word,
followed by zero or more parameter words. If the list of parameter words followed by zero or more parameter words. If the list of parameter words
is of variable length (indicated by "[...]" or "[***]") then it has to be is of variable length (indicated by "[...]" or "[***]") then it has to be
terminated by either the \fBlist delimiter\fR, or the end of argument list, terminated by either the \fBlist delimiter\fR, or the end of argument list,
@ -667,10 +670,10 @@ Enable or disable processing of xattr attributes in user namespace.
If enabled, then xorriso will handle xattr similar to ACL. If enabled, then xorriso will handle xattr similar to ACL.
See also options -getfattr, -setfattr and above paragraph about xattr. See also options -getfattr, -setfattr and above paragraph about xattr.
.TP .TP
\fB\-disk_dev_ino\fR "on"|"off" \fB\-disk_dev_ino\fR "on"|"ino_only"|"off"
Enable or disable processing of recorded file identification numbers Enable or disable processing of recorded file identification numbers
(dev_t and ino_t). They are eventually stored as xattr "isofs.di" and allow (dev_t and ino_t). They are eventually stored as xattr "isofs.di" and allow
to substantially accelerate file comparison: to substantially accelerate file comparison.
.br .br
If device numbers and inode numbers of the disk filesystems are persistent If device numbers and inode numbers of the disk filesystems are persistent
and if no irregular alterations of timestamps or system clock happen, and if no irregular alterations of timestamps or system clock happen,
@ -678,6 +681,10 @@ then potential content changes can be detected without reading that content.
File content change is assumed if any of mtime, ctime, device number or inode File content change is assumed if any of mtime, ctime, device number or inode
number have changed. number have changed.
.br .br
Mode "ino_only" replaces the precondition that device numbers are stable by the
precondition that mount points in the compared tree always lead to the
same filesystems. Use this if mode "on" always sees all files changed.
.br
The speed advantage appears only if the loaded session was produced with The speed advantage appears only if the loaded session was produced with
-disk_dev_ino "on" too. -disk_dev_ino "on" too.
.TP .TP
@ -1141,11 +1148,12 @@ match files which have resp. have not a non-trivial ACL.
.br .br
-has_xattr , -has_no_xattr -has_xattr , -has_no_xattr
.br .br
match files which have resp. have not xattr name-value pairs. match files which have resp. have not xattr name-value pairs
from user namespace.
.br .br
-has_aaip , -has_no_aaip -has_aaip , -has_no_aaip
.br .br
match files which have ACL or xattr resp. have neither of them. match files which have ACL or any xattr resp. have neither of them.
.br .br
Default action is "echo", Default action is "echo",
@ -3104,11 +3112,17 @@ This changes the directory trees /open_source_project and /personal_mail
in the ISO image so that they become exact copies of their disk counterparts. in the ISO image so that they become exact copies of their disk counterparts.
ISO file objects get created, deleted or get their attributes adjusted ISO file objects get created, deleted or get their attributes adjusted
accordingly. accordingly.
.br
ACL and xattr will be recorded. Accelerated comparison is enabled at the
expense of potentially larger backup size.
Only media with the expected volume id or blank media are accepted.
Files with names matching *.o or *.swp get excluded explicitely. Files with names matching *.o or *.swp get excluded explicitely.
.br .br
Only media with the expected volume id or blank media are accepted. \fB$\fR xorriso \\
.br .br
\fB$\fR xorriso -assert_volid 'PROJECTS_MAIL_*' FATAL \\ -acl on -xattr on -disk_dev_ino on \\
.br
-assert_volid 'PROJECTS_MAIL_*' FATAL \\
.br .br
-dev /dev/sr0 \\ -dev /dev/sr0 \\
.br .br
@ -3129,8 +3143,10 @@ the old one.
.br .br
This makes sense if the full backup leaves substantial remaining capacity This makes sense if the full backup leaves substantial remaining capacity
on media and if the expected changes are much smaller than the full backup. on media and if the expected changes are much smaller than the full backup.
An update run will probably save no time but last longer than a full backup, .br
unless option -disk_dev_ino "on" is used. Option -disk_dev_ino depends on stable device and inode numbers on disk.
Without it, an update run will probably save no time but last longer than
a full backup. Such a slow run might produce a smaller backup, though.
.br .br
With \fBmount\fR option \fB-o "sbsector="\fR on Linux resp. \fB-s\fR on FreeBSD With \fBmount\fR option \fB-o "sbsector="\fR on Linux resp. \fB-s\fR on FreeBSD
it is possible to access the session trees which represent the older backup it is possible to access the session trees which represent the older backup

View File

@ -6356,7 +6356,9 @@ 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= ((xorriso->do_aaip & (16 | 32 | 64)) == 0); is_default= ((xorriso->do_aaip & (16 | 32 | 64)) == 0);
sprintf(line,"-disk_dev_ino %s\n", (xorriso->do_aaip & 16 ? "on" : "off")); sprintf(line,"-disk_dev_ino %s\n",
(xorriso->do_aaip & 16 ? (xorriso->do_aaip & 128 ? "ino_only" : "on" )
: "off"));
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);
@ -6951,7 +6953,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
if(xorriso->do_aaip & 32) { if(xorriso->do_aaip & 32) {
/* dev,inode comparison. Eventually skip content comparison */ /* dev,inode comparison. Eventually skip content comparison */
ret= Xorriso_record_dev_inode(xorriso, "", s1.st_dev, s1.st_ino, NULL, ret= Xorriso_record_dev_inode(xorriso, "", s1.st_dev, s1.st_ino, NULL,
iso_adr, 1 | 2 | ((flag & (1 << 28)) >> 23)); iso_adr, 1 | 2 | ((flag & (1 << 28)) >> 23) | (xorriso->do_aaip & 128));
if(ret < 0) { if(ret < 0) {
ret= -1; goto ex; ret= -1; goto ex;
} else if(ret == 0) { /* match */ } else if(ret == 0) { /* match */
@ -13018,13 +13020,15 @@ int Xorriso_option_dialog(struct XorrisO *xorriso, char *mode, int flag)
} }
/* Option -disk_dev_ino "on"|"off" */ /* Option -disk_dev_ino "on"|"ino_only"|"off" */
int Xorriso_option_disk_dev_ino(struct XorrisO *xorriso, char *mode, int flag) int Xorriso_option_disk_dev_ino(struct XorrisO *xorriso, char *mode, int flag)
{ {
if(strcmp(mode, "on") == 0) if(strcmp(mode, "on") == 0)
xorriso->do_aaip|= 16 | 32 | 64; xorriso->do_aaip= (xorriso->do_aaip & ~128) | 16 | 32 | 64;
else if(strcmp(mode, "ino_only") == 0)
xorriso->do_aaip|= 16 | 32 | 64 | 128;
else if(strcmp(mode, "off") == 0) else if(strcmp(mode, "off") == 0)
xorriso->do_aaip &= ~(16 | 32 | 64); xorriso->do_aaip &= ~(16 | 32 | 64 | 128);
else { else {
sprintf(xorriso->info_text, "-disk_dev_ino: unknown mode '%s'", mode); sprintf(xorriso->info_text, "-disk_dev_ino: unknown mode '%s'", mode);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
@ -13905,7 +13909,7 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" Enable resp. disable reading and writing of ACLs.", " Enable resp. disable reading and writing of ACLs.",
" -xattr \"on\"|\"off\"", " -xattr \"on\"|\"off\"",
" Enable resp. disable reading and writing of xattr.", " Enable resp. disable reading and writing of xattr.",
" -disk_dev_ino \"on\"|\"off\"", " -disk_dev_ino \"on\"|\"ino_only\"|\"off\"",
" Enable resp. disable recording of disk file dev_t and ino_t", " Enable resp. disable recording of disk file dev_t and ino_t",
" and their use in file comparison.", " and their use in file comparison.",
" -ban_stdio_write", " -ban_stdio_write",

View File

@ -104,6 +104,7 @@ struct XorrisO { /* the global context of xorriso */
int do_aaip; /* bit0= ACL in , bit1= ACL out , bit2= EA in , bit3= EA out int do_aaip; /* bit0= ACL in , bit1= ACL out , bit2= EA in , bit3= EA out
bit4= record dev,inode , bit5= check dev,inode bit4= record dev,inode , bit5= check dev,inode
bit6= omit content check if dev,inode check is conclusive bit6= omit content check if dev,inode check is conclusive
bit7= omit dev check mit bit5
*/ */
int relax_compliance; /* opaque bitfield to be set by xorrisoburn */ int relax_compliance; /* opaque bitfield to be set by xorrisoburn */

View File

@ -1 +1 @@
#define Xorriso_timestamP "2009.02.19.183707" #define Xorriso_timestamP "2009.02.25.144045"

View File

@ -120,6 +120,12 @@ int Xorriso_path_from_node(struct XorrisO *xorriso, IsoNode *node, int lba,
isoburn_igopt_always_gmt) isoburn_igopt_always_gmt)
/* <<< Whether to allow xattr and ACL with the root node.
(It is supposed to work since libisofs-ng resision 479)
*/
#define Xorriso_root_with_aaiP yes
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
@ -1694,6 +1700,35 @@ int Xorriso_get_volume(struct XorrisO *xorriso, IsoImage **volume,
return(*volume != NULL); return(*volume != NULL);
} }
/*
@param flag bit0= do not issue warning
*/
int Xorriso_aaip_warn_of_root(struct XorrisO *xorriso, IsoNode *node, int flag)
{
#ifndef Xorriso_root_with_aaiP
int ret;
IsoDir *root= NULL;
IsoImage *volume;
ret= Xorriso_get_volume(xorriso, &volume, 0);
if(ret<=0)
return(ret);
root= iso_image_get_root(volume);
if(node == (IsoNode *) root) {
sprintf(xorriso->info_text,
"Cannot attach ACL or xattr to ISO root directory");
if(!(flag & 1))
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
return(0);
}
#endif /* ! Xorriso_root_with_aaiP */
return(1);
}
/* @param flag bit0=do not complain about non existent node */ /* @param flag bit0=do not complain about non existent node */
int Xorriso_node_from_path(struct XorrisO *xorriso, IsoImage *volume, int Xorriso_node_from_path(struct XorrisO *xorriso, IsoImage *volume,
@ -8838,7 +8873,7 @@ int Xorriso_getfname(struct XorrisO *xorriso, char *path, int flag)
strlen(path + path_offset), 8); strlen(path + path_offset), 8);
if(ret <= 0) if(ret <= 0)
return(-1); return(-1);
sprintf(xorriso->result_line, "# file: %s\n", bsl_path); sprintf(xorriso->result_line, "# file: %s\n", bsl_path[0] ? bsl_path : ".");
free(bsl_path); free(bsl_path);
bsl_path= NULL; bsl_path= NULL;
/* temporarily disable -backslash_codes with result output */ /* temporarily disable -backslash_codes with result output */
@ -9032,7 +9067,7 @@ int Xorriso_set_ignore_aclea(struct XorrisO *xorriso, int flag)
@param path is used as address if node is NULL. @param path is used as address if node is NULL.
@param access_text "access" ACL in long text form @param access_text "access" ACL in long text form
@param default_text "default" ACL in long text form @param default_text "default" ACL in long text form
@param flag Unused yet, submit 0 @param flag bit0= do not warn of root directory if not capable of AAIP
@return >0 success , <=0 failure @return >0 success , <=0 failure
*/ */
int Xorriso_setfacl(struct XorrisO *xorriso, void *in_node, char *path, int Xorriso_setfacl(struct XorrisO *xorriso, void *in_node, char *path,
@ -9048,6 +9083,12 @@ int Xorriso_setfacl(struct XorrisO *xorriso, void *in_node, char *path,
goto ex; goto ex;
} }
ret= Xorriso_aaip_warn_of_root(xorriso, node, flag & 1);
if (ret < 0)
goto ex;
if (ret == 0)
{ret= 1; goto ex;}
#ifdef Xorriso_with_aaiP #ifdef Xorriso_with_aaiP
ret= iso_node_set_acl_text(node, access_text, default_text, 0); ret= iso_node_set_acl_text(node, access_text, default_text, 0);
#else #else
@ -9169,6 +9210,7 @@ ex:;
bit1= Do not clear the existing attribute list bit1= Do not clear the existing attribute list
bit2= Delete the attributes with the given names bit2= Delete the attributes with the given names
bit3= Allow non-user attributes. bit3= Allow non-user attributes.
bit4= do not warn of root if incapable of AAIP
@return >0 success , <=0 failure @return >0 success , <=0 failure
*/ */
int Xorriso_setfattr(struct XorrisO *xorriso, void *in_node, char *path, int Xorriso_setfattr(struct XorrisO *xorriso, void *in_node, char *path,
@ -9185,6 +9227,12 @@ int Xorriso_setfattr(struct XorrisO *xorriso, void *in_node, char *path,
goto ex; goto ex;
} }
ret= Xorriso_aaip_warn_of_root(xorriso, node, !!(flag & 16));
if (ret < 0)
goto ex;
if (ret == 0)
{ret= 1; goto ex;}
#ifdef Xorriso_with_aaiP #ifdef Xorriso_with_aaiP
ret= iso_node_set_attrs(node, num_attrs, names, value_lengths, values, ret= iso_node_set_attrs(node, num_attrs, names, value_lengths, values,
flag & (1 | 2 | 4 | 8)); flag & (1 | 2 | 4 | 8));
@ -9423,6 +9471,7 @@ ex:
-1=error -1=error
bit5= if not bit0: bit5= if not bit0:
transfer dev,inode from eventual link target transfer dev,inode from eventual link target
bit7= omit dev check mit bit1
*/ */
int Xorriso_record_dev_inode(struct XorrisO *xorriso, char *disk_path, int Xorriso_record_dev_inode(struct XorrisO *xorriso, char *disk_path,
dev_t dev, ino_t ino, dev_t dev, ino_t ino,
@ -9474,11 +9523,21 @@ int Xorriso_record_dev_inode(struct XorrisO *xorriso, char *disk_path,
goto ex; goto ex;
if(ret == 0) if(ret == 0)
{ret= 2; goto ex;} {ret= 2; goto ex;}
if(l != di_l) if(flag & 128) {
{ret= 1; goto ex;} if(di_l <= 0)
for(i= 0; i < l; i++)
if(di[i] != buf[i])
{ret= 1; goto ex;} {ret= 1; goto ex;}
hino= 0;
for(i= di[0] + 2; i < di_l && i - di[0] - 2 < di[(int) di[0] + 1]; i++)
hino= (hino << 8) | ((unsigned char *) di)[i];
if(hino != ino)
{ret= 1; goto ex;}
} else {
if(l != di_l)
{ret= 1; goto ex;}
for(i= 0; i < l; i++)
if(di[i] != buf[i])
{ret= 1; goto ex;}
}
ret= 0; ret= 0;
} else { } else {
ret= Xorriso_setfattr(xorriso, in_node, iso_path, ret= Xorriso_setfattr(xorriso, in_node, iso_path,