# HG changeset patch # User lgb # Date 987866899 0 # Node ID 6fbd39309b87f99ea25c5438e52a682a74537580 # Parent 30d9f61e9c0b72fbf7f9a24ef78be351c4bace9e Detect unencrypted DVDs and not try to auth them diff -r 30d9f61e9c0b -r 6fbd39309b87 dvdauth.c --- a/dvdauth.c Sat Apr 21 12:26:29 2001 +0000 +++ b/dvdauth.c Sat Apr 21 15:28:19 2001 +0000 @@ -1,5 +1,5 @@ /* (C)2001 by LGB (Gabor Lenart), based on example programs in libcss - Some TODO: root privilegies really needed?? */ + lgb@lgb.hu */ /* don't do anything with this source if css support was not requested */ #include "config.h" @@ -86,17 +86,22 @@ } + int dvd_auth ( char *dev , int fd ) { int devfd; /* FD of DVD device */ int lba; -// printf("DVD: auth fd=%d on %s.\n",fd,dev); if ((devfd=open(dev,O_RDONLY))<0) { fprintf(stderr,"DVD: cannot open DVD device \"%s\".\n",dev); return 1; } + + if (!CSSisEncrypted(devfd)) { + printf("DVD is unencrypted! Skipping authentication!\n(note: you should not use -dvd switch for unencrypted discs!)\n"); + return 0; + } else printf("DVD is encrypted, issuing authentication ...\n"); /* reset AGIDs */ reset_agids(devfd);