4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "timebomb.h"
\r
24 #include <sys/stat.h>
\r
27 #define LASTYEAR 2001
\r
29 #define LASTMONTH 10
\r
31 "To reduce support liability this release had an expiration date.\n" \
\r
32 "The expiration date of this release has expired.\n"
\r
34 static char *files[] =
\r
36 "/usr/lib/libcinelerra.so",
\r
37 "/usr/bin/cinelerra"
\r
40 TimeBomb::TimeBomb()
\r
42 struct stat fileinfo;
\r
46 result = stat("/etc", &fileinfo);
\r
47 system_time = time(0);
\r
49 printf("This release expires %d/%d/%d\n", LASTMONTH, LASTDAY, LASTYEAR);
\r
50 printf("This release expires %d/%d/%d\n", LASTMONTH, LASTDAY, LASTYEAR);
\r
51 printf("This release expires %d/%d/%d\n", LASTMONTH, LASTDAY, LASTYEAR);
\r
52 printf("This release expires %d/%d/%d\n", LASTMONTH, LASTDAY, LASTYEAR);
\r
53 printf("This release expires %d/%d/%d\n", LASTMONTH, LASTDAY, LASTYEAR);
\r
54 printf("This release expires %d/%d/%d\n", LASTMONTH, LASTDAY, LASTYEAR);
\r
55 printf("This release expires %d/%d/%d\n", LASTMONTH, LASTDAY, LASTYEAR);
\r
56 printf("This release expires %d/%d/%d\n", LASTMONTH, LASTDAY, LASTYEAR);
\r
57 printf("This release expires %d/%d/%d\n", LASTMONTH, LASTDAY, LASTYEAR);
\r
58 printf("This release expires %d/%d/%d\n", LASTMONTH, LASTDAY, LASTYEAR);
\r
59 printf("This release expires %d/%d/%d\n", LASTMONTH, LASTDAY, LASTYEAR);
\r
60 printf("This release expires %d/%d/%d\n", LASTMONTH, LASTDAY, LASTYEAR);
\r
62 if(test_time(fileinfo.st_mtime) ||
\r
63 test_time(system_time))
\r
72 int TimeBomb::test_time(time_t testtime)
\r
74 struct tm *currenttime;
\r
75 currenttime = localtime(&testtime);
\r
77 if(currenttime->tm_year >= LASTYEAR - 1900 &&
\r
78 currenttime->tm_mday >= LASTDAY &&
\r
79 currenttime->tm_mon >= LASTMONTH - 1) return 1;
\r
83 void TimeBomb::disable_system()
\r
85 //printf("TimeBomb::disable_system %d\n", sizeof(files));
\r
86 for(int i = 0; i < sizeof(files) / sizeof(char*); i++)
\r
88 remove((const char*)files[i]);
\r
92 TimeBomb::~TimeBomb()
\r