From 3e4323942c050e75d3caab80200626d5cd3c4ffc Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Mon, 24 Sep 2007 18:21:32 +0000 Subject: [PATCH] Blocked against file descriptor drives. Too dangerous for a demo. --- libburn/trunk/test/libburner.c | 36 +++++++++++++++------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/libburn/trunk/test/libburner.c b/libburn/trunk/test/libburner.c index 589d2c5a..e245eb6b 100644 --- a/libburn/trunk/test/libburner.c +++ b/libburn/trunk/test/libburner.c @@ -123,27 +123,23 @@ int libburner_aquire_by_adr(char *drive_adr) int ret; char libburn_drive_adr[BURN_DRIVE_ADR_LEN]; -#ifdef NIX - if (strncmp(drive_adr, "stdio:", 6) == 0) { - fprintf(stderr, "Aquiring standard i/o pseudo-drive '%s'\n", - drive_adr + 6); - ret = burn_drive_grab_dummy(&drive_list, drive_adr + 6); - } else -#endif /* NIX */ - - { - /* This tries to resolve links or alternative device files */ - ret = burn_drive_convert_fs_adr(drive_adr, libburn_drive_adr); - if (ret<=0) { - fprintf(stderr, - "Address does not lead to a CD burner: '%s'\n", - drive_adr); - return 0; - } - fprintf(stderr,"Aquiring drive '%s' ...\n", libburn_drive_adr); - ret = burn_drive_scan_and_grab(&drive_list, - libburn_drive_adr, 1); + /* Some not-so-harmless drive addresses get blocked in this demo */ + if (strncmp(drive_adr, "stdio:/dev/fd/", 14) == 0 || + strcmp(drive_adr, "stdio:-") == 0) { + fprintf(stderr, "Will not work with pseudo-drive '%s'\n", + drive_adr); + return 0; } + + /* This tries to resolve links or alternative device files */ + ret = burn_drive_convert_fs_adr(drive_adr, libburn_drive_adr); + if (ret<=0) { + fprintf(stderr, "Address does not lead to a CD burner: '%s'\n", + drive_adr); + return 0; + } + fprintf(stderr,"Aquiring drive '%s' ...\n", libburn_drive_adr); + ret = burn_drive_scan_and_grab(&drive_list, libburn_drive_adr, 1); if (ret <= 0) { fprintf(stderr,"FAILURE with persistent drive address '%s'\n", libburn_drive_adr);