rhel 7
obsolete weakness #292

1

Weakness Breakdown


Definition:

An obsolete weakness occurs when someone uses deprecated or obsolete functions when building a system. As a programming language evolves, some functions occasionally become obsolete.

Warning code(s):

This C routine is considered obsolete.

File Name:

bltk/tools/bltk/main.c

Context:

The highlighted line of code below is the trigger point of this particular Red Hat Enterprise Linux 7 obsolete weakness.

 		write_to_err_log(prt_str);
		prog_exit(1);
	}
	tv_sec = tv.tv_sec;
	tv_usec = tv.tv_usec;

	return (tv_sec * MSEC_IN_SEC + tv_usec / MCSEC_IN_MSEC);
}

void prog_usleep(xtime_t t)
{
	(void)usleep(t * MCSEC_IN_MSEC);
}

static xtime_t xtime(void)
{
	return (prog_time());
}

static void idle(xtime_t t)
{
	if (debug_mode) {
		return;
	}
	(void)usleep(t * MCSEC_IN_MSEC);
}

static void load(xtime_t t)
{
	xtime_t t1, t2, t3 = t;

	t1 = xtime();

	if (debug_mode) {
		return;
	}

	while (1) {
		t2 = xtime();
		if (t2 - t1 >= t3) {
			return;
		}
	}
}

static void check_exec_access(char *prog)
{
	if (access(prog, X_OK) != 0) {
		(void)sprintf(prt_str, "Cannot execute %s\n", prog);
		write_to_err_log(prt_str); 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.