alpine 3.6
obsolete weakness #275

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:

cups-filters/src/cups-filters-1.12.0/backend/serial.c

Context:

The highlighted line of code below is the trigger point of this particular Alpine 3.6 obsolete weakness.

 	if (dtrdsr)
	{
	 /*
	  * Check the port and sleep until DSR is set...
	  */

	  int status;


	  if (!ioctl(device_fd, TIOCMGET, &status))
            if (!(status & TIOCM_DSR))
	    {
	     /*
	      * Wait for DSR to go high...
	      */

	      fputs("DEBUG: DSR is low; waiting for device.\n", stderr);

              do
	      {
	       /*
	        * Poll every 100ms...
		*/

		usleep(100000);

		if (ioctl(device_fd, TIOCMGET, &status))
		  break;
	      }
	      while (!(status & TIOCM_DSR));

	      fputs("DEBUG: DSR is high; writing to device.\n", stderr);
            }
	}

	if ((bytes = write(device_fd, print_ptr, print_bytes)) < 0)
	{
	 /*
          * Write error - bail if we don't see an error we can retry...
	  */

	  if (errno != EAGAIN && errno != EINTR && errno != ENOTTY)
	  {
	    perror("DEBUG: Unable to write print data");

            tcsetattr(device_fd, TCSADRAIN, &origopts);

	    close(device_fd);

	    if (print_fd != 0) 

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.