Commit 970ebb8a authored by Alexander Mikhalitsyn's avatar Alexander Mikhalitsyn Committed by Paul Moore
Browse files

SafeSetID: fix UID printed instead of GID



pr_warn message clearly says that GID should be printed,
but we have UID there. Let's fix that.

Found accidentally during the work on isolated user namespaces.

Signed-off-by: default avatarAlexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
[PM: fix spelling errors in description, subject tweak]
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent b432b551
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -131,7 +131,7 @@ static int safesetid_security_capable(const struct cred *cred,
		 * set*gid() (e.g. setting up userns gid mappings).
		 * set*gid() (e.g. setting up userns gid mappings).
		 */
		 */
		pr_warn("Operation requires CAP_SETGID, which is not available to GID %u for operations besides approved set*gid transitions\n",
		pr_warn("Operation requires CAP_SETGID, which is not available to GID %u for operations besides approved set*gid transitions\n",
			__kuid_val(cred->uid));
			__kgid_val(cred->gid));
		return -EPERM;
		return -EPERM;
	default:
	default:
		/* Error, the only capabilities were checking for is CAP_SETUID/GID */
		/* Error, the only capabilities were checking for is CAP_SETUID/GID */