New -osirrox settings "blocked" and "unblock"

This commit is contained in:
Thomas Schmitt 2013-01-04 19:00:14 +00:00
parent c915d8d68d
commit 960311ebc7
8 changed files with 114 additions and 63 deletions

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2012 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2013 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -1973,7 +1973,7 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" Like -show_stream but affecting all files below directories.",
"",
"Restore commands which copy file objects from ISO image to disk filesystem:",
" -osirrox \"on\"|\"device_files\"|\"off\"|\"banned\"",
" -osirrox \"on\"|\"device_files\"|\"off\"|\"blocked\"|\"unblock\"|\"banned\"",
" [:\"concat_split_on\"|\"concat_split_off\"]",
" [:\"auto_chmod_on\"|\"auto_chmod_off\"]",
" [:\"sort_lba_on\"|\"sort_lba_off\"]",
@ -1981,7 +1981,8 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" By default \"off\" the inverse operation of xorriso from ISO",
" image to disk filesystem is disabled. \"on\" allows xorriso",
" to create, overwrite, delete files in the disk filesystem.",
" \"banned\" is irrevocably \"off\".",
" \"banned\" is irrevocably \"off\". \"blocked\" can only be",
" revoked by \"unblock\". (\"device_files\" is dangerous.)",
" -extract iso_rr_path disk_path",
" Copy tree under iso_rr_path onto disk address disk_path.",
" This avoids the pitfalls of cp -r addressing rules.",

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2012 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2013 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -1465,7 +1465,13 @@ int Xorriso_option_osirrox(struct XorrisO *xorriso, char *mode, int flag)
allow_restore= 0;
else if(strncmp(cpt, "banned", l)==0 && l >= 5)
allow_restore= -1;
else if(strncmp(cpt, "device_files", l)==0 && l >= 12)
else if(strncmp(cpt, "blocked", l)==0 && l >= 7)
allow_restore= -2;
else if(strncmp(cpt, "unblock", l)==0 && l >= 7) {
if(xorriso->allow_restore == -2)
xorriso->allow_restore= 0;
allow_restore= 1;
} else if(strncmp(cpt, "device_files", l)==0 && l >= 12)
allow_restore= 2;
else if((strncmp(cpt, "on", l)==0 && l >= 2) || mode[0]==0)
allow_restore= 1;
@ -1502,6 +1508,12 @@ unknown_mode:;
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
if(allow_restore > 0 && xorriso->allow_restore == -2) {
sprintf(xorriso->info_text,
"-osirrox: is currently disabled by setting 'blocked'");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
if(xorriso->allow_restore != -1)
xorriso->allow_restore= allow_restore;
sprintf(xorriso->info_text,

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2012 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2013 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -2581,7 +2581,9 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
is_default= (xorriso->allow_restore==0 && xorriso->do_concat_split==1 &&
xorriso->do_auto_chmod==0 && xorriso->drives_exclusive == 1);
mode_pt= "off";
if(xorriso->allow_restore == -1)
if(xorriso->allow_restore == -2)
mode_pt= "blocked";
else if(xorriso->allow_restore == -1)
mode_pt= "banned";
else if(xorriso->allow_restore == 1)
mode_pt= "on";

View File

@ -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.2.5, Dec 25, 2012"
.TH XORRISO 1 "Version 1.2.5, Jan 04, 2013"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@ -3911,12 +3911,16 @@ of \-overwrite "nondir". I.e. directories cannot be deleted.
Access permissions of files in the ISO image do not restrict restoring.
The directory permissions on disk have to allow rwx.
.TP
\fB\-osirrox\fR "on"|"device_files"|"off"|"banned"|[:option:...]
\fB\-osirrox\fR setting[:option:...]
Setting "off" disables disk filesystem manipulations. This is the default
unless the program was started with leafname "osirrox". Elsewise
the capability to restore files can be enabled explicitly by \-osirrox "on".
It can be irrevocably disabled by \-osirrox "banned".
.br
The setting "blocked" is like "off". But it can only be revoked by
setting "unblock", which elsewise is like "on". This can be used to curb
command scripts which might use "on" undesiredly.
.br
To enable restoring of special files by "device_files" is potentially
dangerous.
The meaning of the number st_rdev (see man 2 stat) depends much on the
@ -4592,6 +4596,11 @@ Sorted from low to high severity.
Start the program that is given as first parameter. Submit the other
parameters as program arguments. Enable xorriso dialog mode.
.br
Two nameless pipe objects are created. xorriso standard input gets
connected to the standard output of the started program.
xorriso standard output and standard error get connected to the
standard input of that program.
.br
xorriso will abort when the started program ends or if it cannot
be started at all. In both cases it will return a non\-zero exit value.
The exit value will be zero if the frontend sends \-end or \-rollback_end
@ -4604,6 +4613,10 @@ The program name will not be searched in the $PATH directories.
To make this clear, it must contain at least one /\-character.
Best is an absolute path.
.br
Example:
.br
xorriso \-launch_frontend "$(which xorriso\-tcltk)" \-stdio \-\-
.br
The frontend program should first send via its standard output:
.br
\-mark 0 \-pkt_output on \-msg_op start_sieve \- \-reassure off

View File

@ -3442,12 +3442,15 @@ file objects already exist then the settings of -overwrite and
Access permissions of files in the ISO image do not restrict restoring.
The directory permissions on disk have to allow rwx.
-osirrox "on"|"device_files"|"off"|"banned"|[:option:...]
-osirrox setting[:option:...]
Setting "off" disables disk filesystem manipulations. This is the
default unless the program was started with leafname "osirrox".
Elsewise the capability to restore files can be enabled explicitly
by -osirrox "on". It can be irrevocably disabled by -osirrox
"banned".
The setting "blocked" is like "off". But it can only be revoked by
setting "unblock", which elsewise is like "on". This can be used
to curb command scripts which might use "on" undesiredly.
To enable restoring of special files by "device_files" is
potentially dangerous. The meaning of the number st_rdev (see man
2 stat) depends much on the operating system. Best is to restore
@ -4017,6 +4020,10 @@ File: xorriso.info, Node: Frontend, Next: ExDevices, Prev: Scripting, Up: Co
-launch_frontend program [arguments ...] --
Start the program that is given as first parameter. Submit the
other parameters as program arguments. Enable xorriso dialog mode.
Two nameless pipe objects are created. xorriso standard input gets
connected to the standard output of the started program. xorriso
standard output and standard error get connected to the standard
input of that program.
xorriso will abort when the started program ends or if it cannot
be started at all. In both cases it will return a non-zero exit
value. The exit value will be zero if the frontend sends -end or
@ -4026,6 +4033,8 @@ File: xorriso.info, Node: Frontend, Next: ExDevices, Prev: Scripting, Up: Co
The program name will not be searched in the $PATH directories.
To make this clear, it must contain at least one /-character.
Best is an absolute path.
Example:
xorriso -launch_frontend "$(which xorriso-tcltk)" -stdio -
The frontend program should first send via its standard output:
-mark 0 -pkt_output on -msg_op start_sieve - -reassure off
It should be ready to decode -pkt_output and to react on -mark
@ -4698,10 +4707,10 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -compliance controls standard compliance: SetWrite. (line 58)
* -copyright_file sets copyright file name: SetWrite. (line 227)
* -cp_clone copies ISO directory tree: Insert. (line 191)
* -cp_rx copies file trees to disk: Restore. (line 108)
* -cpax copies files to disk: Restore. (line 104)
* -cp_rx copies file trees to disk: Restore. (line 111)
* -cpax copies files to disk: Restore. (line 107)
* -cpr inserts like with cp -r: Insert. (line 155)
* -cpx copies files to disk: Restore. (line 92)
* -cpx copies files to disk: Restore. (line 95)
* -cut_out inserts piece of data file: Insert. (line 129)
* -data_cache_size adjusts read cache size: Loading. (line 269)
* -dev acquires one drive for input and output: AqDrive. (line 12)
@ -4726,10 +4735,10 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -error_behavior controls error workarounds: Exception. (line 96)
* -external_filter registers data filter: Filter. (line 20)
* -external_filter unregisters data filter: Filter. (line 48)
* -extract copies file tree to disk: Restore. (line 60)
* -extract_cut copies file piece to disk: Restore. (line 81)
* -extract_l copies files to disk: Restore. (line 76)
* -extract_single copies file to disk: Restore. (line 72)
* -extract copies file tree to disk: Restore. (line 63)
* -extract_cut copies file piece to disk: Restore. (line 84)
* -extract_l copies files to disk: Restore. (line 79)
* -extract_single copies file to disk: Restore. (line 75)
* -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 106)
@ -4780,7 +4789,7 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -mark sets synchronizing message: Frontend. (line 25)
* -md5 controls handling of MD5 sums: Loading. (line 156)
* -mkdir creates ISO directory: Insert. (line 169)
* -mount issues mount command for ISO session: Restore. (line 126)
* -mount issues mount command for ISO session: Restore. (line 129)
* -mount_cmd composes mount command line: Inquiry. (line 52)
* -mount_cmd controls mount command: Inquiry. (line 68)
* -msg_op perform operations on program messages: Frontend. (line 30)
@ -4798,7 +4807,7 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -pacifier controls pacifier text form: Emulation. (line 158)
* -padding sets amount or mode of image padding: SetWrite. (line 349)
* -page set terminal geometry: DialogCtl. (line 19)
* -paste_in copies file into disk file: Restore. (line 121)
* -paste_in copies file into disk file: Restore. (line 124)
* -path_list inserts paths from disk file: Insert. (line 78)
* -pathspecs sets meaning of = with -add: SetInsert. (line 118)
* -pkt_output consolidates text output: Frontend. (line 7)
@ -4807,8 +4816,8 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -print_info prints message text line: Scripting. (line 102)
* -print_mark prints synchronizing text line: Scripting. (line 105)
* -print_size predicts image size: Inquiry. (line 91)
* -prog sets program name: Frontend. (line 142)
* -prog_help prints help text: Frontend. (line 145)
* -prog sets program name: Frontend. (line 148)
* -prog_help prints help text: Frontend. (line 151)
* -prompt prompts for enter key: Scripting. (line 110)
* -publisher sets publisher id: SetWrite. (line 186)
* -pvd_info shows image id strings: Inquiry. (line 104)
@ -5080,7 +5089,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Program, end without writing, -rollback_end: Scripting. (line 159)
* Program, list extra features, -list_extras: Scripting. (line 26)
* Program, print help text, -help: Scripting. (line 20)
* Program, print help text, -prog_help: Frontend. (line 145)
* Program, print help text, -prog_help: Frontend. (line 151)
* Program, print message text line, -print_info: Scripting. (line 102)
* Program, print result text line, -print: Scripting. (line 99)
* Program, print synchronizing text line, -print_mark: Scripting.
@ -5088,7 +5097,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Program, print version, -version: Scripting. (line 23)
* Program, prompt for enter key, -prompt: Scripting. (line 110)
* Program, replace --, -list_delimiter: Scripting. (line 60)
* Program, set name, -prog: Frontend. (line 142)
* Program, set name, -prog: Frontend. (line 148)
* Program, show current settings, -status: Scripting. (line 47)
* Program, status history, -status_history_max: Scripting. (line 56)
* Program, wait a time span, -sleep: Scripting. (line 114)
@ -5096,20 +5105,20 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Recovery, retrieve blocks, -check_media: Verify. (line 21)
* Relocation directory, set name, -rr_reloc_dir: SetWrite. (line 141)
* Rename, in ISO image, -mv: Manip. (line 35)
* Restore, copy file into disk file, -paste_in: Restore. (line 121)
* Restore, copy file piece to disk, -extract_cut: Restore. (line 81)
* Restore, copy file to disk, -extract_single: Restore. (line 72)
* Restore, copy file tree to disk, -extract: Restore. (line 60)
* Restore, copy file trees to disk, -cp_rx: Restore. (line 108)
* Restore, copy files to disk, -cpax: Restore. (line 104)
* Restore, copy files to disk, -cpx: Restore. (line 92)
* Restore, copy files to disk, -extract_l: Restore. (line 76)
* Restore, copy file into disk file, -paste_in: Restore. (line 124)
* Restore, copy file piece to disk, -extract_cut: Restore. (line 84)
* Restore, copy file to disk, -extract_single: Restore. (line 75)
* Restore, copy file tree to disk, -extract: Restore. (line 63)
* Restore, copy file trees to disk, -cp_rx: Restore. (line 111)
* Restore, copy files to disk, -cpax: Restore. (line 107)
* Restore, copy files to disk, -cpx: Restore. (line 95)
* Restore, copy files to disk, -extract_l: Restore. (line 79)
* Restore, enable ISO-to-disk, -osirrox: Restore. (line 18)
* Rock Ridge, _definition: Extras. (line 6)
* Session, _definition: Model. (line 6)
* Session, altered start address, -displacement: Loading. (line 36)
* Session, info string, -session_string: Inquiry. (line 78)
* Session, issue mount command, -mount: Restore. (line 126)
* Session, issue mount command, -mount: Restore. (line 129)
* Session, log when written, -session_log: Scripting. (line 138)
* Session, mount command line, -mount_cmd: Inquiry. (line 52)
* Session, mount parameters, -mount_opts: Inquiry. (line 68)
@ -5191,31 +5200,31 @@ Node: Inquiry151992
Node: Navigate157452
Node: Verify165750
Node: Restore174782
Node: Emulation181692
Node: Scripting191504
Node: Frontend198665
Node: Examples206223
Node: ExDevices207401
Node: ExCreate208060
Node: ExDialog209345
Node: ExGrowing210610
Node: ExModifying211415
Node: ExBootable211919
Node: ExCharset212471
Node: ExPseudo213292
Node: ExCdrecord214190
Node: ExMkisofs214507
Node: ExGrowisofs215847
Node: ExException216982
Node: ExTime217436
Node: ExIncBackup217895
Node: ExRestore221887
Node: ExRecovery222847
Node: Files223417
Node: Seealso224716
Node: Bugreport225439
Node: Legal226020
Node: CommandIdx227031
Node: ConceptIdx243260
Node: Emulation181869
Node: Scripting191681
Node: Frontend198842
Node: Examples206719
Node: ExDevices207897
Node: ExCreate208556
Node: ExDialog209841
Node: ExGrowing211106
Node: ExModifying211911
Node: ExBootable212415
Node: ExCharset212967
Node: ExPseudo213788
Node: ExCdrecord214686
Node: ExMkisofs215003
Node: ExGrowisofs216343
Node: ExException217478
Node: ExTime217932
Node: ExIncBackup218391
Node: ExRestore222383
Node: ExRecovery223343
Node: Files223913
Node: Seealso225212
Node: Bugreport225935
Node: Legal226516
Node: CommandIdx227527
Node: ConceptIdx243756

End Tag Table

View File

@ -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.2.5, Dec 25, 2012"
@c man .TH XORRISO 1 "Version 1.2.5, Jan 04, 2013"
@c man .\" Please adjust this date whenever revising the manpage.
@c man .\"
@c man .\" Some roff macros, for reference:
@ -4592,7 +4592,7 @@ The directory permissions on disk have to allow rwx.
@table @asis
@sp 1
@c man .TP
@item -osirrox "on"|"device_files"|"off"|"banned"|[:option:...]
@item -osirrox setting[:option:...]
@kindex -osirrox enables ISO-to-disk copying
@cindex Restore, enable ISO-to-disk, -osirrox
Setting "off" disables disk filesystem manipulations. This is the default
@ -4600,6 +4600,10 @@ unless the program was started with leafname "osirrox". Elsewise
the capability to restore files can be enabled explicitly by -osirrox "on".
It can be irrevocably disabled by -osirrox "banned".
@*
The setting "blocked" is like "off". But it can only be revoked by
setting "unblock", which elsewise is like "on". This can be used to curb
command scripts which might use "on" undesiredly.
@*
To enable restoring of special files by "device_files" is potentially
dangerous.
The meaning of the number st_rdev (see man 2 stat) depends much on the
@ -5380,6 +5384,11 @@ Sorted from low to high severity.
Start the program that is given as first parameter. Submit the other
parameters as program arguments. Enable xorriso dialog mode.
@*
Two nameless pipe objects are created. xorriso standard input gets
connected to the standard output of the started program.
xorriso standard output and standard error get connected to the
standard input of that program.
@*
xorriso will abort when the started program ends or if it cannot
be started at all. In both cases it will return a non-zero exit value.
The exit value will be zero if the frontend sends -end or -rollback_end
@ -5392,6 +5401,10 @@ The program name will not be searched in the $PATH directories.
To make this clear, it must contain at least one /-character.
Best is an absolute path.
@*
Example:
@*
xorriso -launch_frontend "$(which xorriso-tcltk)" -stdio --
@*
The frontend program should first send via its standard output:
@*
-mark 0 -pkt_output on -msg_op start_sieve - -reassure off

View File

@ -2,7 +2,7 @@
/* Command line oriented batch and dialog tool which creates, loads,
manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2012 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2013 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -473,7 +473,8 @@ struct XorrisO { /* the global context of xorriso */
/* XORRISO options */
int allow_graft_points;
int allow_restore; /* -1=permanently disallowed
int allow_restore; /* -2=disallowed until special mode "unblock"
-1=permanently disallowed
0=disallowed, 1=allowed, 2=device files allowed */
int do_concat_split; /* 1= restore complete split file directories as
regular files

View File

@ -1 +1 @@
#define Xorriso_timestamP "2013.01.04.143459"
#define Xorriso_timestamP "2013.01.04.185925"