alpine 3.6
access weakness #228


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.

 	if (dr_timeout > time((time_t *)0))
		return 0;

	say(WARN, "Drmgr has exceeded its specified wait time and will not "
	return 1;

 * dr_lock
 * @brief Attempt to lock a token
 * This will attempt to lock a token (either file or directory) and wait
 * a specified amount of time if the lock cannot be granted.
 * @returns lock id if successful, -1 otherwise
int dr_lock(void)
	struct flock    dr_lock_info;
	int             rc;
	mode_t          old_mode;
	int             first_try = 1;

	old_mode = umask(0);
	dr_lock_fd = open(DR_LOCK_FILE, O_RDWR | O_CREAT,
	if (dr_lock_fd < 0)
		return -1;

	dr_lock_info.l_type = F_WRLCK;
	dr_lock_info.l_whence = SEEK_SET;
	dr_lock_info.l_start = 0;
	dr_lock_info.l_len = 0;

	do {
		if (!first_try) {
			first_try = 0;

		rc = fcntl(dr_lock_fd, F_SETLK, &dr_lock_info);
		if (rc != -1)
			return 0;

		if (drmgr_timed_out())

		if (rc == -1 && errno == EACCES) 

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.