diff --git a/xorriso/drive_mgt.c b/xorriso/drive_mgt.c index 07eaee34..48726728 100644 --- a/xorriso/drive_mgt.c +++ b/xorriso/drive_mgt.c @@ -325,8 +325,11 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, char *show_adr, aquire_flag|= 512; if(!(xorriso->do_aaip & 1)) aquire_flag|= 32; - if((xorriso->ino_behavior & (1 | 2)) && !(xorriso->do_aaip & (4 | 32))) + if((xorriso->ino_behavior & (1 | 2)) && !(xorriso->do_aaip & (4 | 32))) { aquire_flag|= 64; + } else if(xorriso->do_aaip & 1024) { + aquire_flag|= 1024; + } if(flag & 128) aquire_flag|= 256; burn_preset_device_open(xorriso->drives_exclusive | diff --git a/xorriso/iso_img.c b/xorriso/iso_img.c index 56748b0e..2ca00797 100644 --- a/xorriso/iso_img.c +++ b/xorriso/iso_img.c @@ -47,6 +47,8 @@ int Xorriso_set_ignore_aclea(struct XorrisO *xorriso, int flag) hflag= (~xorriso->do_aaip) & 1; if((xorriso->ino_behavior & (1 | 2)) && !(xorriso->do_aaip & (4 | 16))) hflag|= 2; + if(xorriso->do_aaip & 1024) + hflag|= 8; iso_image_set_ignore_aclea(volume, hflag); return(1); } diff --git a/xorriso/opts_d_h.c b/xorriso/opts_d_h.c index b5bd040c..926e6b1a 100644 --- a/xorriso/opts_d_h.c +++ b/xorriso/opts_d_h.c @@ -1778,12 +1778,12 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag) " \"cheap_sorted_extract\", \"normal_extract\"", " -acl \"on\"|\"off\"", " Enable or disable reading and writing of ACLs.", -" -xattr \"on\"|\"off\"", +" -xattr \"on\"|\"user\"|\"any\"|\"off\"", " Enable or disable reading and writing of xattr.", " -md5 \"on\"|\"all\"|\"off\"", " Enable or disable processing of MD5 checksums.", " -for_backup", -" Shortcut for: -hardlinks on -acl on -xattr on -md5 on", +" Shortcut for: -hardlinks on -acl on -xattr any -md5 on", " -ecma119_map \"unmapped\"|\"stripped\"|\"uppercase\"|\"lowercase\"", " Choose conversion of file names if neither Rock Ridge", " nor Joliet is present in the loaded ISO session.", diff --git a/xorriso/opts_p_z.c b/xorriso/opts_p_z.c index db3aac90..08475c05 100644 --- a/xorriso/opts_p_z.c +++ b/xorriso/opts_p_z.c @@ -2189,10 +2189,13 @@ int Xorriso_option_xattr(struct XorrisO *xorriso, char *mode, int flag) { int ret; + xorriso->do_aaip&= ~(4 | 8 | 1024); if(strcmp(mode, "off")==0) - xorriso->do_aaip&= ~12; - else if(strcmp(mode, "on")==0) + ; + else if(strcmp(mode, "on") == 0 || strcmp(mode, "user") == 0) xorriso->do_aaip|= (4 | 8); + else if(strcmp(mode, "any")==0) + xorriso->do_aaip|= (4 | 8 | 1024); else { sprintf(xorriso->info_text, "-xattr: unknown mode '%s'", mode); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); diff --git a/xorriso/parse_exec.c b/xorriso/parse_exec.c index 1b8fbe09..80f239cd 100644 --- a/xorriso/parse_exec.c +++ b/xorriso/parse_exec.c @@ -1,7 +1,7 @@ /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images. - Copyright 2007-2016 Thomas Schmitt, + Copyright 2007-2017 Thomas Schmitt, Provided under GPL version 2 or later. @@ -1346,7 +1346,7 @@ next_command:; } else if(strcmp(cmd,"for_backup")==0) { Xorriso_option_hardlinks(xorriso, "on", 0); Xorriso_option_acl(xorriso, "on", 0); - Xorriso_option_xattr(xorriso, "on", 0); + Xorriso_option_xattr(xorriso, "any", 0); Xorriso_option_md5(xorriso, "on", 0); ret= 1; diff --git a/xorriso/read_run.c b/xorriso/read_run.c index 4fe950ea..2ae8db3b 100644 --- a/xorriso/read_run.c +++ b/xorriso/read_run.c @@ -309,14 +309,15 @@ ex:; int Xorriso_restore_properties(struct XorrisO *xorriso, char *disk_path, IsoNode *node, int flag) { - int ret, is_dir= 0, errno_copy= 0; + int ret, is_dir= 0, errno_copy= 0, local_attrs_set= 0, i, err_count; mode_t mode; - uid_t uid; - gid_t gid; + uid_t uid, disk_uid; + gid_t gid, disk_gid; struct utimbuf utime_buffer; struct stat stbuf; size_t num_attrs= 0, *value_lengths= NULL; char **names= NULL, **values= NULL; + int *errnos= NULL; ret= lstat(disk_path, &stbuf); if(ret==-1) { @@ -326,7 +327,8 @@ int Xorriso_restore_properties(struct XorrisO *xorriso, char *disk_path, Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); {ret= 0; goto ex;} } - uid= stbuf.st_uid; + disk_uid= uid= stbuf.st_uid; + disk_gid= stbuf.st_gid; is_dir= S_ISDIR(stbuf.st_mode); @@ -342,22 +344,46 @@ int Xorriso_restore_properties(struct XorrisO *xorriso, char *disk_path, {ret= 0; goto ex;} } if(num_attrs > 0) { - ret= iso_local_set_attrs(disk_path, num_attrs, names, value_lengths, - values, (!(xorriso->do_strict_acl & 1)) << 6); + Xorriso_alloc_meM(errnos, int, num_attrs); + ret= iso_local_set_attrs_errno(disk_path, num_attrs, names, value_lengths, + values, errnos, + ((!(xorriso->do_strict_acl & 1)) << 6) | + ((!!(xorriso->do_aaip & 1024)) << 3) ); if(ret < 0) { +cannot_set_xattr:; errno_copy= errno; if(ret != (int) ISO_AAIP_NO_SET_LOCAL) errno_copy= 0; Xorriso_report_iso_error(xorriso, "", ret, "Error on iso_local_set_attrs", 0, "FAILURE", 1 | ((ret == -1)<<2) ); - sprintf(xorriso->info_text, - "Cannot change ACL or xattr of disk file "); + sprintf(xorriso->info_text, "Disk file "); Text_shellsafe(disk_path, xorriso->info_text, 1); + err_count= 0; + for(i= 0; (unsigned int) i < num_attrs; i++) { + if(errnos[i] == 0) + continue; + if(err_count >= 3) { + strcat(xorriso->info_text, " , and more"); + break; + } + err_count++; + errno_copy= 0; /* Detail errno overrides final errno */ + if(names[i][0] == 0) + sprintf(xorriso->info_text + strlen(xorriso->info_text), " , ACL "); + else + sprintf(xorriso->info_text + strlen(xorriso->info_text), + " , xattr %s ", names[i]); + if(errnos[i] < 0) + Text_shellsafe("Unknown error", xorriso->info_text, 1); + else + Text_shellsafe(strerror(errnos[i]), xorriso->info_text, 1); + } Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno_copy, "FAILURE",0); {ret= 0; goto ex;} } + local_attrs_set= 1; } Xorriso_process_msg_queues(xorriso,0); } @@ -381,6 +407,7 @@ int Xorriso_restore_properties(struct XorrisO *xorriso, char *disk_path, } ret= chmod(disk_path, mode); if(ret==-1) { +cannot_set_perm:; sprintf(xorriso->info_text, "Cannot change access permissions of disk file "); Text_shellsafe(disk_path, xorriso->info_text, 1); @@ -391,10 +418,6 @@ int Xorriso_restore_properties(struct XorrisO *xorriso, char *disk_path, if(flag&1) {ret= 1; goto ex;} - gid= iso_node_get_gid(node); - if(!(S_ISDIR(stbuf.st_mode) && (flag&2))) - uid= iso_node_get_uid(node); - ret= chown(disk_path, uid, gid); /* don't complain if it fails */ utime_buffer.actime= iso_node_get_atime(node); utime_buffer.modtime= iso_node_get_mtime(node); ret= utime(disk_path,&utime_buffer); @@ -405,9 +428,43 @@ int Xorriso_restore_properties(struct XorrisO *xorriso, char *disk_path, Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0); {ret= 0; goto ex;} } + + gid= iso_node_get_gid(node); + if(!(S_ISDIR(stbuf.st_mode) && (flag&2))) + uid= iso_node_get_uid(node); + + if(uid != disk_uid || gid != disk_gid) { + + ret= chown(disk_path, uid, gid); /* don't complain if it fails */ + + /* Check whether xattr are still set and try to set them again if needed. + E.g. Linux 3.16 removes security.capability on chown(2). + */ + if(local_attrs_set && (xorriso->do_aaip & 1024)) { + ret= iso_local_set_attrs_errno(disk_path, num_attrs, names, value_lengths, + values, errnos, + 1 | ((!!(xorriso->do_aaip & 1024)) << 3) | + 128); + if(ret < 0) + goto cannot_set_xattr; + } + + /* Check whether setuid or setgid bits got reset */ + ret= lstat(disk_path, &stbuf); + if(ret != -1) { + if((mode ^ stbuf.st_mode) & (S_ISUID | S_ISGID)) { + ret= chmod(disk_path, mode); + if(ret==-1) + goto cannot_set_perm; + } + } + + } ret= 1; ex:; iso_node_get_attrs(node, &num_attrs, &names, &value_lengths, &values,1 << 15); + if(errnos != NULL) + free(errnos); return(ret); } diff --git a/xorriso/text_io.c b/xorriso/text_io.c index 12a11adc..49893bb2 100644 --- a/xorriso/text_io.c +++ b/xorriso/text_io.c @@ -3696,7 +3696,9 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag) if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= ((xorriso->do_aaip & (2 | 8)) == 0); - sprintf(line,"-xattr %s\n", (xorriso->do_aaip & 4 ? "on" : "off")); + sprintf(line,"-xattr %s\n", (xorriso->do_aaip & 4 ? + xorriso->do_aaip & 1024 ? "any" : "on" + : "off")); if(!(is_default && no_defaults)) Xorriso_status_result(xorriso,filter,fp,flag&2); is_default= ((xorriso->do_aaip & (16 | 32 | 64)) == 0); diff --git a/xorriso/write_run.c b/xorriso/write_run.c index 6f003343..eeb26259 100644 --- a/xorriso/write_run.c +++ b/xorriso/write_run.c @@ -1214,6 +1214,10 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag) if(ret<=0) goto ex; } + if(iso_image_was_blind_attrs(image, 0)) + Xorriso_msgs_submit(xorriso, 0, + "Some file xattr namespace could not be explored", + 0, "WARNING", 0); if(image!=NULL && 12+strlen(Xorriso_timestamP)<80) { strcpy(xorriso_id, xorriso->preparer_id); diff --git a/xorriso/xorriso.1 b/xorriso/xorriso.1 index 9b1e3097..306a5531 100644 --- a/xorriso/xorriso.1 +++ b/xorriso/xorriso.1 @@ -9,7 +9,7 @@ .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) -.TH XORRISO 1 "Version 1.4.9, Sep 16, 2017" +.TH XORRISO 1 "Version 1.4.9, Oct 10, 2017" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: @@ -464,9 +464,15 @@ only on GNU/Linux and FreeBSD. .PP \fBxattr\fR (aka EA, or extattr) are pairs of name and value which can be attached to file objects. AAIP is -able to represent them and \fBxorriso\fR can record and restore pairs which -have names out of the user namespace. I.e. those which begin with "user.", -like "user.x" or "user.whatever". Name has to be a 0 terminated string. +able to represent them and \fBxorriso\fR can record and restore them. +.br +But be aware that pairs with names of non\-user namespaces are not necessarily +portable between operating systems and not even between filesystems. +I.e. only those which begin with "user.", like "user.x" or "user.whatever", +can unconditionally be expected to be appropriate on other machines and disks. +Processing of other xattr may need administrator privileges. +.br +Name has to be a 0 terminated string. Value may be any array of bytes which does not exceed the size of 4095 bytes. xattr processing happens only if it is enabled by command \fB\-xattr\fR. @@ -930,10 +936,18 @@ load AAIP data from ISO images, test ACL during file comparison, and restore ACLs to disk files when extracting them from ISO images. See also commands \-getfacl, \-setfacl. .TP -\fB\-xattr\fR "on"|"off" -Enable or disable processing of xattr attributes in user namespace. +\fB\-xattr\fR "on"|"user"|"any"|"off" +Enable or disable processing of xattr attributes. If enabled, then \fBxorriso\fR will handle xattr similar to ACL. See also commands \-getfattr, \-setfattr and above paragraph about xattr. +.br +Modes "on" and "user" read and write only attributes from namespace "user". +.br +Mode "any" processes attributes of all namespaces. This might need adminstrator +privileges, even if the owner of the disk file tries to read or write the +attributes. +.br +Note that xattr from namespace "isofs." are never restored to disk. .TP \fB\-md5\fR "on"|"all"|"off"|"load_check_off" Enable or disable processing of MD5 checksums for the overall session and for @@ -970,8 +984,19 @@ actions get_md5, check_md5, and via \-check_media. .TP \fB\-for_backup\fR Enable all extra features which help to produce or to restore backups with -highest fidelity of file properties. -Currently this is a shortcut for: \-hardlinks on \-acl on \-xattr on \-md5 on. +highest fidelity of file properties. Currently this is a shortcut for: +.br +\-hardlinks on \-acl on \-xattr any \-md5 on +.br +If you restore a backup with xattr from non\-user namespaces, then make sure +that the target operating system and filesystem know what these attributes +mean. Possibly you will need administrator privileges to record or restore +such attributes. At recording time, xorriso will try to tolerate missing +privileges and just record what is readable. +But at restore time, missing privileges will cause failure events. +.br +Command \-xattr "user" after command \-for_backup excludes non\-user attributes +from being recorded or restored. .TP \fB\-ecma119_map\fR "stripped"|"unmapped"|"lowercase"|"uppercase" Choose the conversion of file names from the loaded session if neither diff --git a/xorriso/xorriso.h b/xorriso/xorriso.h index ef1a84dd..47cb12b6 100644 --- a/xorriso/xorriso.h +++ b/xorriso/xorriso.h @@ -1593,10 +1593,13 @@ int Xorriso_option_follow(struct XorrisO *xorriso, char *mode, int flag); /* Command -for_backup is a shortcut for Xorriso_option_hardlinks(xorriso, "on", 0); Xorriso_option_acl(xorriso, "on", 0); - Xorriso_option_xattr(xorriso, "on", 0); + Xorriso_option_xattr(xorriso, "any", 0); Xorriso_option_md5(xorriso, "on", 0); */ /* @since 0.4.0 */ +/* xattr "any" + @since 1.5.0 +*/ /* Command -fs */ /* @since 0.1.0 */ diff --git a/xorriso/xorriso.info b/xorriso/xorriso.info index 4af1b1cd..6cfc85e3 100644 --- a/xorriso/xorriso.info +++ b/xorriso/xorriso.info @@ -405,8 +405,13 @@ only on GNU/Linux and FreeBSD. *xattr* (aka EA, or extattr) are pairs of name and value which can be attached to file objects. AAIP is able to represent them and 'xorriso' -can record and restore pairs which have names out of the user namespace. -I.e. those which begin with "user.", like "user.x" or "user.whatever". +can record and restore them. +But be aware that pairs with names of non-user namespaces are not +necessarily portable between operating systems and not even between +filesystems. I.e. only those which begin with "user.", like "user.x" +or "user.whatever", can unconditionally be expected to be appropriate on +other machines and disks. Processing of other xattr may need +administrator privileges. Name has to be a 0 terminated string. Value may be any array of bytes which does not exceed the size of 4095 bytes. xattr processing happens only if it is enabled by command *-xattr*. @@ -842,10 +847,17 @@ activate them only after image loading. ISO images, test ACL during file comparison, and restore ACLs to disk files when extracting them from ISO images. See also commands -getfacl, -setfacl. --xattr "on"|"off" - Enable or disable processing of xattr attributes in user namespace. - If enabled, then 'xorriso' will handle xattr similar to ACL. See - also commands -getfattr, -setfattr and above paragraph about xattr. +-xattr "on"|"user"|"any"|"off" + Enable or disable processing of xattr attributes. If enabled, then + 'xorriso' will handle xattr similar to ACL. See also commands + -getfattr, -setfattr and above paragraph about xattr. + Modes "on" and "user" read and write only attributes from namespace + "user". + Mode "any" processes attributes of all namespaces. This might need + adminstrator privileges, even if the owner of the disk file tries + to read or write the attributes. + Note that xattr from namespace "isofs." are never restored to + disk. -md5 "on"|"all"|"off"|"load_check_off" Enable or disable processing of MD5 checksums for the overall session and for each single data file. If enabled then images with @@ -877,7 +889,17 @@ activate them only after image loading. -for_backup Enable all extra features which help to produce or to restore backups with highest fidelity of file properties. Currently this - is a shortcut for: -hardlinks on -acl on -xattr on -md5 on. + is a shortcut for: + -hardlinks on -acl on -xattr any -md5 on + If you restore a backup with xattr from non-user namespaces, then + make sure that the target operating system and filesystem know what + these attributes mean. Possibly you will need administrator + privileges to record or restore such attributes. At recording + time, xorriso will try to tolerate missing privileges and just + record what is readable. But at restore time, missing privileges + will cause failure events. + Command -xattr "user" after command -for_backup excludes non-user + attributes from being recorded or restored. -ecma119_map "stripped"|"unmapped"|"lowercase"|"uppercase" Choose the conversion of file names from the loaded session if neither a Rock Ridge name nor a Joliet name was read from the @@ -5224,11 +5246,11 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top * -assert_volid rejects undesired images: Loading. (line 111) * -auto_charset learns character set from image: Loading. (line 123) * -backslash_codes enables backslash conversion: Scripting. (line 71) -* -ban_stdio_write demands real drive: Loading. (line 316) +* -ban_stdio_write demands real drive: Loading. (line 333) * -biblio_file sets biblio file name: SetWrite. (line 250) * -blank erases media: Writing. (line 57) * -boot_image controls bootability: Bootable. (line 75) -* -calm_drive reduces drive activity: Loading. (line 306) +* -calm_drive reduces drive activity: Loading. (line 323) * -cd sets working directory in ISO: Navigate. (line 7) * -cdx sets working directory on disk: Navigate. (line 15) * -changes_pending overrides change status: Writing. (line 12) @@ -5262,12 +5284,12 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top * -cp_rx copies file trees to disk: Restore. (line 103) * -cp_rx copies file trees to disk <1>: Restore. (line 111) * -cut_out inserts piece of data file: Insert. (line 139) -* -data_cache_size adjusts read cache size: Loading. (line 332) +* -data_cache_size adjusts read cache size: Loading. (line 349) * -dev acquires one drive for input and output: AqDrive. (line 12) * -devices gets list of drives: Inquiry. (line 7) * -device_links gets list of drives: Inquiry. (line 17) * -dialog enables dialog mode: DialogCtl. (line 7) -* -disk_dev_ino fast incremental backup: Loading. (line 226) +* -disk_dev_ino fast incremental backup: Loading. (line 243) * -disk_pattern controls pattern expansion: Insert. (line 34) * -displacement compensate altered image start address: Loading. (line 57) @@ -5278,8 +5300,8 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top * -dusx show directory size on disk: Navigate. (line 85) * -dux show directory size on disk: Navigate. (line 81) * -dvd_obs set write block size: SetWrite. (line 330) -* -early_stdio_test classifies stdio drives: Loading. (line 320) -* -ecma119_map names w/o Rock Ridge, Joliet: Loading. (line 214) +* -early_stdio_test classifies stdio drives: Loading. (line 337) +* -ecma119_map names w/o Rock Ridge, Joliet: Loading. (line 231) * -eject ejects drive tray: Writing. (line 50) * -end writes pending session and ends program: Scripting. (line 151) * -errfile_log logs problematic disk files: Scripting. (line 116) @@ -5290,13 +5312,13 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top * -extract_cut copies file piece to disk: Restore. (line 80) * -extract_l copies files to disk: Restore. (line 76) * -extract_single copies file to disk: Restore. (line 73) -* -file_name_limit curbs length of file names: Loading. (line 246) +* -file_name_limit curbs length of file names: Loading. (line 263) * -file_size_limit limits data file size: SetInsert. (line 7) * -find traverses and alters ISO tree: CmdFind. (line 7) * -findx traverses disk tree: Navigate. (line 88) * -follow softlinks and mount points: SetInsert. (line 69) * -format formats media: Writing. (line 87) -* -for_backup -acl,-xattr,-hardlinks,-md5: Loading. (line 210) +* -for_backup -acl,-xattr,-hardlinks,-md5: Loading. (line 217) * -fs sets size of fifo: SetWrite. (line 396) * -getfacl shows ACL in ISO image: Navigate. (line 60) * -getfacl_r shows ACL in ISO image: Navigate. (line 66) @@ -5338,7 +5360,7 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top * -map_l inserts paths from disk file: Insert. (line 96) * -map_single inserts path: Insert. (line 93) * -mark sets synchronizing message: Frontend. (line 23) -* -md5 controls handling of MD5 sums: Loading. (line 182) +* -md5 controls handling of MD5 sums: Loading. (line 189) * -mkdir creates ISO directory: Insert. (line 177) * -modesty_on_drive keep drive buffer hungry: SetWrite. (line 336) * -mount issues mount command for ISO session: Restore. (line 146) @@ -5395,7 +5417,7 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top (line 51) * -rollback discards pending changes: Writing. (line 9) * -rollback_end ends program without writing: Scripting. (line 154) -* -rom_toc_scan searches for sessions: Loading. (line 278) +* -rom_toc_scan searches for sessions: Loading. (line 295) * -rr_reloc_dir sets name of relocation directory: SetWrite. (line 144) * -scdbackup_tag enables scdbackup checksum tag: Emulation. (line 179) * -scsi_dev_family choose Linux device file type: AqDrive. (line 43) @@ -5469,8 +5491,8 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top * Appended partition, in MBR or GPT: Bootable. (line 276) * Automatic execution order, of arguments, -x: ArgSort. (line 16) * Backslash Interpretation, _definition: Processing. (line 53) -* Backup, enable fast incremental, -disk_dev_ino: Loading. (line 226) -* Backup, enable features, -for_backup: Loading. (line 210) +* Backup, enable fast incremental, -disk_dev_ino: Loading. (line 243) +* Backup, enable features, -for_backup: Loading. (line 217) * Backup, scdbackup checksum tag, -scdbackup: Emulation. (line 179) * Blank media, _definition: Media. (line 29) * Blank, format, Immed bit, -use_immed_bit: SetWrite. (line 374) @@ -5508,8 +5530,8 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top * Directory, delete, -rmdir: Manip. (line 29) * disk_path, _definition: Insert. (line 6) * Drive, accessability, -drive_class: Loading. (line 73) -* Drive, classify stdio, -early_stdio_test: Loading. (line 320) -* Drive, demand real MMC, -ban_stdio_write: Loading. (line 316) +* Drive, classify stdio, -early_stdio_test: Loading. (line 337) +* Drive, demand real MMC, -ban_stdio_write: Loading. (line 333) * Drive, eject tray, -eject: Writing. (line 50) * Drive, for input and output, -dev: AqDrive. (line 12) * Drive, for input, -indev: AqDrive. (line 23) @@ -5517,7 +5539,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top * Drive, get drive list, -devices: Inquiry. (line 7) * Drive, get drive list, -device_links: Inquiry. (line 17) * Drive, list supported media, -list_profiles: Writing. (line 177) -* Drive, reduce activity, -calm_drive: Loading. (line 306) +* Drive, reduce activity, -calm_drive: Loading. (line 323) * Drive, report SCSI commands, -scsi_log: Scripting. (line 143) * Drive, write and eject, -commit_eject: Writing. (line 53) * Drive, _definition: Drives. (line 6) @@ -5533,8 +5555,8 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top * Examples: Examples. (line 6) * extattr, _definition: Extras. (line 66) * File content, copy, -concat: Restore. (line 118) -* File names, curb length, -file_name_limit: Loading. (line 246) -* File names, if neither Rock Ridge nor Joliet: Loading. (line 214) +* File names, curb length, -file_name_limit: Loading. (line 263) +* File names, if neither Rock Ridge nor Joliet: Loading. (line 231) * Filter, apply to file tree, -set_filter_r: Filter. (line 84) * Filter, apply to file, -set_filter: Filter. (line 58) * Filter, ban registration, -close_filter_list: Filter. (line 50) @@ -5557,7 +5579,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top * HFS+ serial number: Bootable. (line 400) * hidden, set in ISO image, -hide: Manip. (line 174) * HP-PA boot sector, production: Bootable. (line 375) -* Image reading, cache size, -data_cache_size: Loading. (line 332) +* Image reading, cache size, -data_cache_size: Loading. (line 349) * Image, demand volume ID, -assert_volid: Loading. (line 111) * Image, discard pending changes, -rollback: Writing. (line 9) * Image, filesystem to load, -read_fs: Loading. (line 102) @@ -5615,7 +5637,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top * MBR bootable/active flag, enforce: Bootable. (line 343) * MBR, set, -boot_image system_area=: Bootable. (line 200) * MBR, _definition: Extras. (line 27) -* MD5, control handling, -md5: Loading. (line 182) +* MD5, control handling, -md5: Loading. (line 189) * Media, erase, -blank: Writing. (line 57) * Media, format, -format: Writing. (line 87) * Media, list formats, -list_formats: Writing. (line 129) @@ -5719,7 +5741,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top * SUN SPARC boot images, activation: Bootable. (line 438) * Symbolic link, create, -lns: Insert. (line 181) * System area, _definition: Bootable. (line 200) -* Table-of-content, search sessions, -rom_toc_scan: Loading. (line 278) +* Table-of-content, search sessions, -rom_toc_scan: Loading. (line 295) * Table-of-content, show, -toc: Inquiry. (line 27) * Timestamps, set in ISO image, -alter_date: Manip. (line 136) * Timestamps, set in ISO image, -alter_date_r: Manip. (line 171) @@ -5771,54 +5793,54 @@ Node: Media6346 Node: Methods9033 Node: Drives11619 Node: Extras15561 -Node: Processing20030 -Node: Dialog23665 -Node: Commands25354 -Node: ArgSort27031 -Node: AqDrive28525 -Node: Loading32639 -Node: Insert52746 -Node: SetInsert64249 -Node: Manip73681 -Node: CmdFind83640 -Node: Filter102412 -Node: Writing107034 -Node: SetWrite117190 -Node: Bootable141949 -Node: Jigdo168121 -Node: Charset172380 -Node: Exception175709 -Node: DialogCtl181838 -Node: Inquiry184440 -Node: Navigate193324 -Node: Verify201619 -Node: Restore211497 -Node: Emulation220110 -Node: Scripting230569 -Node: Frontend238352 -Node: Examples247978 -Node: ExDevices249156 -Node: ExCreate249817 -Node: ExDialog251117 -Node: ExGrowing252388 -Node: ExModifying253197 -Node: ExBootable253707 -Node: ExCharset254262 -Node: ExPseudo255158 -Node: ExCdrecord256085 -Node: ExMkisofs256405 -Node: ExGrowisofs257762 -Node: ExException258916 -Node: ExTime259374 -Node: ExIncBackup259832 -Node: ExRestore263858 -Node: ExRecovery264804 -Node: Files265376 -Node: Environ266710 -Node: Seealso267419 -Node: Bugreport268136 -Node: Legal268727 -Node: CommandIdx269739 -Node: ConceptIdx287073 +Node: Processing20280 +Node: Dialog23915 +Node: Commands25604 +Node: ArgSort27281 +Node: AqDrive28775 +Node: Loading32889 +Node: Insert53913 +Node: SetInsert65416 +Node: Manip74848 +Node: CmdFind84807 +Node: Filter103579 +Node: Writing108201 +Node: SetWrite118357 +Node: Bootable143116 +Node: Jigdo169288 +Node: Charset173547 +Node: Exception176876 +Node: DialogCtl183005 +Node: Inquiry185607 +Node: Navigate194491 +Node: Verify202786 +Node: Restore212664 +Node: Emulation221277 +Node: Scripting231736 +Node: Frontend239519 +Node: Examples249145 +Node: ExDevices250323 +Node: ExCreate250984 +Node: ExDialog252284 +Node: ExGrowing253555 +Node: ExModifying254364 +Node: ExBootable254874 +Node: ExCharset255429 +Node: ExPseudo256325 +Node: ExCdrecord257252 +Node: ExMkisofs257572 +Node: ExGrowisofs258929 +Node: ExException260083 +Node: ExTime260541 +Node: ExIncBackup260999 +Node: ExRestore265025 +Node: ExRecovery265971 +Node: Files266543 +Node: Environ267877 +Node: Seealso268586 +Node: Bugreport269303 +Node: Legal269894 +Node: CommandIdx270906 +Node: ConceptIdx288240  End Tag Table diff --git a/xorriso/xorriso.texi b/xorriso/xorriso.texi index 8f260782..20c6fc7e 100644 --- a/xorriso/xorriso.texi +++ b/xorriso/xorriso.texi @@ -50,7 +50,7 @@ @c man .\" First parameter, NAME, should be all caps @c man .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection @c man .\" other parameters are allowed: see man(7), man(1) -@c man .TH XORRISO 1 "Version 1.4.9, Sep 16, 2017" +@c man .TH XORRISO 1 "Version 1.4.9, Oct 10, 2017" @c man .\" Please adjust this date whenever revising the manpage. @c man .\" @c man .\" Some roff macros, for reference: @@ -613,9 +613,15 @@ only on GNU/Linux and FreeBSD. @cindex extattr, _definition @strong{xattr} (aka EA, or extattr) are pairs of name and value which can be attached to file objects. AAIP is -able to represent them and @command{xorriso} can record and restore pairs which -have names out of the user namespace. I.e. those which begin with "user.", -like "user.x" or "user.whatever". Name has to be a 0 terminated string. +able to represent them and @command{xorriso} can record and restore them. +@* +But be aware that pairs with names of non-user namespaces are not necessarily +portable between operating systems and not even between filesystems. +I.e. only those which begin with "user.", like "user.x" or "user.whatever", +can unconditionally be expected to be appropriate on other machines and disks. +Processing of other xattr may need administrator privileges. +@* +Name has to be a 0 terminated string. Value may be any array of bytes which does not exceed the size of 4095 bytes. xattr processing happens only if it is enabled by command @strong{-xattr}. @@ -1172,12 +1178,20 @@ load AAIP data from ISO images, test ACL during file comparison, and restore ACLs to disk files when extracting them from ISO images. See also commands -getfacl, -setfacl. @c man .TP -@item -xattr "on"|"off" +@item -xattr "on"|"user"|"any"|"off" @kindex -xattr controls handling of xattr (EA) @cindex xattr, control handling, -xattr -Enable or disable processing of xattr attributes in user namespace. +Enable or disable processing of xattr attributes. If enabled, then @command{xorriso} will handle xattr similar to ACL. See also commands -getfattr, -setfattr and above paragraph about xattr. +@* +Modes "on" and "user" read and write only attributes from namespace "user". +@* +Mode "any" processes attributes of all namespaces. This might need adminstrator +privileges, even if the owner of the disk file tries to read or write the +attributes. +@* +Note that xattr from namespace "isofs." are never restored to disk. @c man .TP @item -md5 "on"|"all"|"off"|"load_check_off" @kindex -md5 controls handling of MD5 sums @@ -1218,8 +1232,19 @@ actions get_md5, check_md5, and via -check_media. @kindex -for_backup -acl,-xattr,-hardlinks,-md5 @cindex Backup, enable features, -for_backup Enable all extra features which help to produce or to restore backups with -highest fidelity of file properties. -Currently this is a shortcut for: -hardlinks on -acl on -xattr on -md5 on. +highest fidelity of file properties. Currently this is a shortcut for: +@* +-hardlinks on -acl on -xattr any -md5 on +@* +If you restore a backup with xattr from non-user namespaces, then make sure +that the target operating system and filesystem know what these attributes +mean. Possibly you will need administrator privileges to record or restore +such attributes. At recording time, xorriso will try to tolerate missing +privileges and just record what is readable. +But at restore time, missing privileges will cause failure events. +@* +Command -xattr "user" after command -for_backup excludes non-user attributes +from being recorded or restored. @c man .TP @item -ecma119_map "stripped"|"unmapped"|"lowercase"|"uppercase" @kindex -ecma119_map names w/o Rock Ridge, Joliet diff --git a/xorriso/xorriso_private.h b/xorriso/xorriso_private.h index bced3f6e..702946b7 100644 --- a/xorriso/xorriso_private.h +++ b/xorriso/xorriso_private.h @@ -161,6 +161,10 @@ struct XorrisO { /* the global context of xorriso */ bit7= omit dev check with bit5 bit8= store output charset in xattr "isofs.cs" bit9= set input charset from xattr "isofs.cs" + bit10= if bit2: import from local filesystem all xattr + namespaces, not only "user." + if bit3: export to local filesystem all xattr + namespaces, not only "user." */ int do_md5; /* bit0= read MD5 array diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index 43ce35ba..5b2ae19f 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2017.10.23.095252" +#define Xorriso_timestamP "2017.10.23.100749"