alpine 3.6
access weakness #414


Weakness Breakdown


An access weakness occurs when software does not properly implement permissions that could have unintended consequences if exploited by malicious actors. An example of this weakness is when a default username and password are set by the developer but do not get changed by the system administrator.

Warning code(s):

Ensure that umask is given most restrictive possible setting.

File Name:



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

                * Wait for confirmation signal from the child via
                * SIGCHILD / USR1, or for two seconds to elapse
                * (SIGALRM).  pause() should not return.

               /* should not be reachable */

	/* At this point we are executing as the child process */
	parent = getppid();
	pid_daemon = getpid();

	/* Cancel certain signals */
	signal(SIGCHLD, SIG_DFL); /* A child process dies */
	signal(SIGTSTP, SIG_IGN); /* Various TTY signals */
	signal(SIGTTOU, SIG_IGN);
	signal(SIGTTIN, SIG_IGN);
	signal(SIGHUP, SIG_IGN); /* Ignore hangup signal */

	/* Change the file mode mask */

	/* Create a new SID for the child process */
	sid = setsid();
	if (sid < 0) {
			"unable to create a new session, code %d (%s)",
			errno, strerror(errno));

	 * Change the current working directory.  This prevents the current
	 * directory from being locked; hence not being able to remove it.
	if (chdir("/tmp") < 0) {
			"unable to change directory to %s, code %d (%s)",
			"/", errno, strerror(errno));

	/* Redirect standard files to /dev/null */
	if (!freopen("/dev/null", "r", stdin))
		fprintf(stderr, "unable to freopen() stdin, code %d (%s)",
						       errno, strerror(errno)); 

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.