同步操作将从 OpenCloudOS Stream/pam 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From d3b8c0723d0d691585474b0e14982f62b115a672 Mon Sep 17 00:00:00 2001From: Tobias Stoeckmann <tobias@stoeckmann.org>Date: Mon, 8 Jan 2024 21:59:23 +0100Subject: [PATCH] pam_unix: do not truncate user namesThis could allow users with very long names to impersonate a userwith a 255 characters long name.The check if the argument argv[1] actually matches the user nameimplies that "user" can unconditionally be set to argv[1]: If they areequal, the strings are obviously equal. If they are not or if null isreturned by getuidname, "user" is set to argv[1] anyway.This way, the static buffer can be safely removed because the resultof getpwuid() is not stored, which means that subsequent calls tosuch functions can safely overwrite their internal buffers.Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>---modules/pam_unix/passverify.c | 6 +-----modules/pam_unix/unix_chkpwd.c | 2 +-2 files changed, 2 insertions(+), 6 deletions(-)diff --git a/modules/pam_unix/passverify.c b/modules/pam_unix/passverify.cindex c48e3c5a79..c6515a65c0 100644--- a/modules/pam_unix/passverify.c+++ b/modules/pam_unix/passverify.c@@ -1190,16 +1190,12 @@ char *getuidname(uid_t uid){struct passwd *pw;- static char username[256];pw = getpwuid(uid);if (pw == NULL)return NULL;- strncpy(username, pw->pw_name, sizeof(username));- username[sizeof(username) - 1] = '0円';-- return username;+ return pw->pw_name;}#endifdiff --git a/modules/pam_unix/unix_chkpwd.c b/modules/pam_unix/unix_chkpwd.cindex 556a2e2cc5..50570dbc84 100644--- a/modules/pam_unix/unix_chkpwd.c+++ b/modules/pam_unix/unix_chkpwd.c@@ -138,11 +138,11 @@ int main(int argc, char *argv[])/* if the caller specifies the username, verify that usermatches it */if (user == NULL || strcmp(user, argv[1])) {- user = argv[1];/* no match -> permanently change to the real user and proceed */if (setuid(getuid()) != 0)return PAM_AUTH_ERR;}+ user = argv[1];}option=argv[2];
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。