Browse Source

Implemented emulation for cdrecord option -lock

ZeroFourZero
Thomas Schmitt 15 years ago
parent
commit
2748f396ae
  1. 14
      cdrskin/cdrskin.1
  2. 25
      cdrskin/cdrskin.c
  3. 2
      cdrskin/cdrskin_timestamp.h

14
cdrskin/cdrskin.1

@ -240,8 +240,10 @@ who is able to get this list without further
precautions.
.br
It is consensus that \fBchmod a+rw /dev/sr0\fP or \fBchmod a+rw /dev/hdc\fP
is less security sensitive than chmod u+s /usr/bin/cdrskin. The risk for the
drive is somewhat higher but the overall system is much less at stake.
is less security sensitive than chmod u+s,a+x /usr/bin/cdrskin. The risk for
the drive is somewhat higher but the overall system is much less at stake.
Consider to restrict rw-access to a single group which bundles the users who
are allowed to use the burner drive (like group "floppy").
.br
.PP
If you only got one CD capable drive then you may leave out cdrskin option
@ -468,6 +470,14 @@ of source if there is a fifo of at least 64 kiB. See option fs= .
Load the media and exit. Exit value is 0 if any kind of media was found, non
zero else. Note: Option -eject will unload the media even if -load is given.
.TP
.BI -lock
Like option -load but leave the drive's eject button disabled if there is any
media found and not option -eject is given.
.br
Use program "eject" or cdrskin -eject to get the tray out of the drive.
Runs of programs like cdrecord, growisofs, wodim, cdrskin will not be hampered
and normally enable the drive's eject button when they are done.
.TP
.BI minbuf= percentage
Equivalent to:
.br

25
cdrskin/cdrskin.c

@ -2425,6 +2425,8 @@ see_cdrskin_eng_html:;
fprintf(stderr,
"\t-load\t\tload the disk and exit (works only with tray loader)\n");
fprintf(stderr,
"\t-lock\t\tload and lock the disk and exit (works only with tray loader)\n");
fprintf(stderr,
"\t-eject\t\teject the disk after doing the work\n");
fprintf(stderr,"\t-dummy\t\tdo everything with laser turned off\n");
#ifdef Cdrskin_libburn_has_multI
@ -3361,6 +3363,7 @@ ex:;
/** Release grabbed libburn drive
@param flag Bitfield for control purposes:
bit0= eject
bit1= leave tray locked (eventually overrides bit0)
*/
int Cdrskin_release_drive(struct CdrskiN *skin, int flag)
{
@ -3368,7 +3371,10 @@ int Cdrskin_release_drive(struct CdrskiN *skin, int flag)
fprintf(stderr,"cdrskin: CAUGHT : release of non-grabbed drive.\n");
return(0);
}
burn_drive_release(skin->grabbed_drive,(flag&1));
if(flag&2)
burn_drive_leave_locked(skin->grabbed_drive,0);
else
burn_drive_release(skin->grabbed_drive,(flag&1));
skin->drive_is_grabbed= 0;
skin->grabbed_drive= NULL;
return(1);
@ -6376,7 +6382,7 @@ int Cdrskin_setup(struct CdrskiN *skin, int argc, char **argv, int flag)
static char ignored_full_options[][41]= {
"-d", "-Verbose", "-V", "-silent", "-s", "-setdropts", "-prcap",
"-reset", "-abort", "-overburn", "-ignsize", "-useinfo",
"-lock", "-fix", "-nofix", "-waiti",
"-fix", "-nofix", "-waiti",
"-immed", "-raw", "-raw96p", "-raw16",
"-clone", "-text", "-mode2", "-xa", "-xa1", "-xa2", "-xamix",
"-cdi", "-preemp", "-nopreemp", "-copy", "-nocopy",
@ -6816,6 +6822,9 @@ gracetime_equals:;
} else if(strcmp(argv[i],"-load")==0) {
skin->do_load= 1;
} else if(strcmp(argv[i],"-lock")==0) {
skin->do_load= 2;
} else if(strncmp(argv[i],"-minbuf=",8)==0) {
value_pt= argv[i]+8;
goto minbuf_equals;
@ -7362,9 +7371,15 @@ int Cdrskin_run(struct CdrskiN *skin, int *exit_value, int flag)
if(skin->do_load) {
ret= Cdrskin_grab_drive(skin,8);
if(ret>0) {
printf(
"cdrskin: NOTE : option -load orders program to exit after loading tray\n");
Cdrskin_release_drive(skin,0);
if(skin->do_load==2 && !skin->do_eject) {
printf(
"cdrskin: NOTE : Option -lock orders program to exit with locked tray.\n");
printf(
"cdrskin: HINT : Run cdrskin with option -eject to unlock the drive tray.\n");
} else if(!skin->do_eject)
printf(
"cdrskin: NOTE : option -load orders program to exit after loading tray.\n");
Cdrskin_release_drive(skin,(skin->do_load==2)<<1);
}
{*exit_value= 14*(ret<=0); goto ex;}
}

2
cdrskin/cdrskin_timestamp.h

@ -1 +1 @@
#define Cdrskin_timestamP "2007.09.18.090713"
#define Cdrskin_timestamP "2007.09.18.090839"

Loading…
Cancel
Save