centos 6
obsolete weakness #1

2

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):

These functions are considered obsolete on most systems, and very non-portable.

File Name:

ntp-4.2.6p5/kernel/tty_chu.c

Context:

The highlighted line of code below is the trigger point of this particular Centos 6 obsolete weakness.

 	} else {
		/*
		 * Mark this buffer full and point at next.  If the
		 * next buffer is full we overwrite it by bumping the
		 * next pointer.
		 */
		chuc->ncodechars = NCHUCHARS;
		if (++(chu->curindex) >= NUMCHUBUFS)
			chu->curindex = 0;
		if (chu->curindex == chu->lastindex)
			if (++(chu->lastindex) >= NUMCHUBUFS)
				chu->lastindex = 0;
		chu->chubuf[chu->curindex].ncodechars = 0;

		/*
		 * Wake up anyone sleeping on this.  Also wake up
		 * selectors and/or deliver a SIGIO as required.
		 */
		if (tp->t_rsel) {
			selwakeup(tp->t_rsel, tp->t_state&TS_RCOLL);
			tp->t_state &= ~TS_RCOLL;
			tp->t_rsel = 0;
		}
		if (tp->t_state & TS_ASYNC)
			gsignal(tp->t_pgrp, SIGIO);
		if (chu->sleeping)
			(void) wakeup((caddr_t)chuc);
	}
}

/*
 * Handle ioctls.  We reject all tty-style except those that
 * change the line discipline.
 */
chuioctl(tp, cmd, data, flag)
	struct tty *tp;
	int cmd;
	caddr_t data;
	int flag;
{

	if ((cmd>>8) != 't')
		return (-1);
	switch (cmd) {
	case TIOCSETD:
	case TIOCGETD:
	case TIOCGETP:
	case TIOCGETC:
		return (-1);
	} 

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.