|
| 1 | +From 69ef2673766f4ea918a5b8290eb30db5db409a3a Mon Sep 17 00:00:00 2001 |
| 2 | +From: zhouzilong <zhouzilong@uniontech.com> |
| 3 | +Date: Wed, 23 Apr 2025 15:45:55 +0800 |
| 4 | +Subject: [PATCH] developer mode verify |
| 5 | + |
| 6 | +--- |
| 7 | + plugins/sudoers/auth/pam.c | 7 +++++++ |
| 8 | + plugins/sudoers/po/zh_CN.po | 11 ++++++----- |
| 9 | + 2 files changed, 13 insertions(+), 5 deletions(-) |
| 10 | + |
| 11 | +diff --git a/plugins/sudoers/auth/pam.c b/plugins/sudoers/auth/pam.c |
| 12 | +index 973d67b..d0cabc8 100644 |
| 13 | +--- a/plugins/sudoers/auth/pam.c |
| 14 | ++++ b/plugins/sudoers/auth/pam.c |
| 15 | +@@ -298,6 +298,7 @@ sudo_pam_verify(const struct sudoers_context *ctx, struct passwd *pw, |
| 16 | + const char *prompt, sudo_auth *auth, struct sudo_conv_callback *callback) |
| 17 | + { |
| 18 | + const char *envccname, *pam_user; |
| 19 | ++ const char *pam_item; |
| 20 | + int rc, *pam_status = (int *)auth->data; |
| 21 | + debug_decl(sudo_pam_verify, SUDOERS_DEBUG_AUTH); |
| 22 | + |
| 23 | +@@ -355,6 +356,12 @@ sudo_pam_verify(const struct sudoers_context *ctx, struct passwd *pw, |
| 24 | + sudo_debug_printf(SUDO_DEBUG_WARN|SUDO_DEBUG_LINENO, |
| 25 | + "pam_authenticate: %d", *pam_status); |
| 26 | + debug_return_int(AUTH_FAILURE); |
| 27 | ++ case PAM_ABORT: |
| 28 | ++ rc = pam_get_item(pamh, PAM_SERVICE, &pam_item); |
| 29 | ++ if((rc == PAM_SUCCESS)&&(!strcmp(pam_item, "security-verify"))){ |
| 30 | ++ log_warningx(ctx, 0, N_("No root privileges. Please request root access in developer mode in Control Center.")); |
| 31 | ++ debug_return_int(AUTH_ERROR); |
| 32 | ++ } |
| 33 | + default: |
| 34 | + log_warningx(ctx, 0, N_("PAM authentication error: %s"), |
| 35 | + sudo_pam_strerror(pamh, *pam_status)); |
| 36 | +diff --git a/plugins/sudoers/po/zh_CN.po b/plugins/sudoers/po/zh_CN.po |
| 37 | +index 00b5214..1194283 100644 |
| 38 | +--- a/plugins/sudoers/po/zh_CN.po |
| 39 | ++++ b/plugins/sudoers/po/zh_CN.po |
| 40 | +@@ -8,7 +8,7 @@ msgstr "" |
| 41 | + "Project-Id-Version: sudoers 1.9.16b1\n" |
| 42 | + "Report-Msgid-Bugs-To: https://bugzilla.sudo.ws\n" |
| 43 | + "POT-Creation-Date: 2024-06-08 09:06-0600\n" |
| 44 | +-"PO-Revision-Date: 2024-06-17 14:52-0400\n" |
| 45 | ++"PO-Revision-Date: 2025-04-23 15:36+0800\n" |
| 46 | + "Last-Translator: Boyuan Yang <073plan@gmail.com>\n" |
| 47 | + "Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n" |
| 48 | + "Language: zh_CN\n" |
| 49 | +@@ -17,7 +17,7 @@ msgstr "" |
| 50 | + "Content-Transfer-Encoding: 8bit\n" |
| 51 | + "Plural-Forms: nplurals=1; plural=0;\n" |
| 52 | + "X-Bugs: Report translation errors to the Language-Team address.\n" |
| 53 | +-"X-Generator: Poedit 3.4.4\n" |
| 54 | ++"X-Generator: Poedit 2.2.1\n" |
| 55 | + |
| 56 | + #: confstr.sh:1 gram.y:1240 plugins/sudoers/logging.c:919 |
| 57 | + msgid "syntax error" |
| 58 | +@@ -1530,6 +1530,10 @@ msgstr "无法初始化 PAM:%s" |
| 59 | + msgid "PAM authentication error: %s" |
| 60 | + msgstr "PAM 认证出错:%s" |
| 61 | + |
| 62 | ++#: plugins/sudoers/auth/pam.c:362 |
| 63 | ++msgid "No root privileges. Please request root access in developer mode in Control Center." |
| 64 | ++msgstr "无root权限,如想获得root权限可以在控制中心选择进入开发者模式" |
| 65 | ++ |
| 66 | + #: plugins/sudoers/auth/pam.c:369 |
| 67 | + msgid "account validation failure, is your account locked?" |
| 68 | + msgstr "账户验证失败,您的账户是不是上锁了?" |
| 69 | +@@ -3891,15 +3895,12 @@ msgstr "将忽略包含“.”字符的文件名" |
| 70 | + msgid "too many levels of includes" |
| 71 | + msgstr "include 嵌套层数过多" |
| 72 | + |
| 73 | +-#, c-format |
| 74 | + #~ msgid "%s must be owned by uid %d" |
| 75 | + #~ msgstr "%s 必须属于用户 ID %d" |
| 76 | + |
| 77 | +-#, c-format |
| 78 | + #~ msgid "%s must only be writable by owner" |
| 79 | + #~ msgstr "%s 必须只对所有者可写" |
| 80 | + |
| 81 | +-#, c-format |
| 82 | + #~ msgid "timestamp owner (%s): No such user" |
| 83 | + #~ msgstr "时间戳所有者(%s):无此用户" |
| 84 | + |
| 85 | +-- |
| 86 | +2.20.1 |
| 87 | + |
0 commit comments