mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
removed license checks
This commit is contained in:
parent
88a6f0cf5d
commit
0534f5ce65
4 changed files with 0 additions and 67 deletions
|
@ -75,15 +75,6 @@ receive: receive.o $(OBJS)
|
|||
test: test.o $(OBJS)
|
||||
random: random.o msg.o utils.o timing.o log.o
|
||||
|
||||
protected: CFLAGS += -DLICENSE -DLICENSE_VALID=$(shell date -d "now +5months" +%s) -s -O3 -fvisibility=hidden
|
||||
protected: clean strip
|
||||
|
||||
strip: $(TARGETS)
|
||||
strip --remove-section=.comment \
|
||||
--remove-section=.note \
|
||||
--strip-debug \
|
||||
--strip-all \
|
||||
$(TARGETS)
|
||||
|
||||
clean:
|
||||
$(RM) *~ *.o *.d
|
||||
|
|
|
@ -50,17 +50,4 @@ int check_kernel_module(char *module);
|
|||
*/
|
||||
int check_root();
|
||||
|
||||
/** Simple copy protection.
|
||||
*
|
||||
* This function checks several machine IDs for predefined values.
|
||||
*
|
||||
* @retval 0 The machine is allowed to run this program.
|
||||
* @reval <>0 The machine is not allowed to run this program.
|
||||
*/
|
||||
int check_license_ids();
|
||||
|
||||
int check_license_time();
|
||||
|
||||
int check_license_trace();
|
||||
|
||||
#endif /* _CHECKS_H_ */
|
||||
|
|
|
@ -81,40 +81,3 @@ int check_root()
|
|||
{
|
||||
return getuid();
|
||||
}
|
||||
|
||||
int check_license_time()
|
||||
{
|
||||
return time(NULL) > LICENSE_VALID;
|
||||
}
|
||||
|
||||
int check_license_trace()
|
||||
{
|
||||
return ptrace(PTRACE_TRACEME, 0, 0, 0) < 0;
|
||||
}
|
||||
|
||||
int check_license_ids()
|
||||
{
|
||||
const struct {
|
||||
char *file, *content;
|
||||
off_t offset;
|
||||
} checks[] = LICENSE_CHECKS;
|
||||
|
||||
FILE *f;
|
||||
char buf[128];
|
||||
|
||||
for (int i = 0; i < ARRAY_LEN(checks); i++) {
|
||||
f = fopen(checks[i].file, "r");
|
||||
if (!f)
|
||||
return -1;
|
||||
|
||||
fseek(f, checks[i].offset, SEEK_SET);
|
||||
fgets(buf, sizeof(buf), f);
|
||||
fclose(f);
|
||||
|
||||
if (strncmp(buf, checks[i].content, strlen(checks[i].content)))
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -151,14 +151,6 @@ int main(int argc, char *argv[])
|
|||
BLD(MAG(__DATE__)), BLD(MAG(__TIME__)));
|
||||
|
||||
/* Checks system requirements*/
|
||||
#ifdef LICENSE
|
||||
if (check_license_trace())
|
||||
error("This software should not be traced!");
|
||||
if (check_license_time())
|
||||
error("Your license expired");
|
||||
if (check_license_ids())
|
||||
error("This version is compiled for a different machine!");
|
||||
#endif
|
||||
if (check_kernel_version())
|
||||
error("Your kernel version is to old: required >= %u.%u", KERNEL_VERSION_MAJ, KERNEL_VERSION_MIN);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue