https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c407460f6af9e6d10913c…
commit c407460f6af9e6d10913c48616646e2aa2e3f6b6
Author: George Bișoc <george.bisoc(a)reactos.org>
AuthorDate: Tue Aug 31 12:34:25 2021 +0200
Commit: George Bișoc <george.bisoc(a)reactos.org>
CommitDate: Sun Sep 5 17:01:21 2021 +0200
[NTOS:SE] Implement effective token option upon duplication
This implements the EffectiveOnly option of SepDuplicateToken routine (used by NtDuplicateToken syscall and other functions alike) which makes the access token effective by removing the disabled parts like privileges and groups.
---
ntoskrnl/se/token.c | 100 +++++++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 95 insertions(+), 5 deletions(-)
diff --git a/ntoskrnl/se/token.c b/ntoskrnl/se/token.c
index bef3d5a2bcf..73d70263e52 100644
--- a/ntoskrnl/se/token.c
+++ b/ntoskrnl/se/token.c
@@ -598,6 +598,43 @@ SepRemovePrivilegeToken(
Token->PrivilegeCount--;
}
+/**
+ * @brief
+ * Removes a group from the token.
+ *
+ * @param[in,out] Token
+ * The token where the group is to be removed.
+ *
+ * @param[in] Index
+ * The index count which represents the number position of the group
+ * we want to remove.
+ *
+ * @return
+ * Nothing.
+ */
+static
+VOID
+SepRemoveUserGroupToken(
+ _Inout_ PTOKEN Token,
+ _In_ ULONG Index)
+{
+ ULONG MoveCount;
+ ASSERT(Index < Token->UserAndGroupCount);
+
+ /* Calculate the number of trailing groups */
+ MoveCount = Token->UserAndGroupCount - Index - 1;
+ if (MoveCount != 0)
+ {
+ /* Time to remove the group by moving one location ahead */
+ RtlMoveMemory(&Token->UserAndGroups[Index],
+ &Token->UserAndGroups[Index + 1],
+ MoveCount * sizeof(SID_AND_ATTRIBUTES));
+ }
+
+ /* Remove one group count */
+ Token->UserAndGroupCount--;
+}
+
/**
* @unimplemented
* @brief
@@ -969,6 +1006,7 @@ SepDuplicateToken(
PVOID EndMem;
ULONG VariableLength;
ULONG TotalSize;
+ ULONG PrivilegesIndex, GroupsIndex;
PAGED_CODE();
@@ -1141,12 +1179,64 @@ SepDuplicateToken(
}
}
+ /*
+ * Filter the token by removing the disabled privileges
+ * and groups if the caller wants to duplicate an access
+ * token as effective only.
+ */
+ if (EffectiveOnly)
+ {
+ /* Begin querying the groups and search for disabled ones */
+ for (GroupsIndex = 0; GroupsIndex < AccessToken->UserAndGroupCount; GroupsIndex++)
+ {
+ /*
+ * A group or user is considered disabled if its attributes is either
+ * 0 or SE_GROUP_ENABLED is not included in the attributes flags list.
+ * That is because a certain user and/or group can have several attributes
+ * that bear no influence on whether a user/group is enabled or not
+ * (SE_GROUP_ENABLED_BY_DEFAULT for example which is a mere indicator
+ * that the group has just been enabled by default). A mandatory
+ * group (that is, the group has SE_GROUP_MANDATORY attribute)
+ * by standards it's always enabled and no one can disable it.
+ */
+ if (AccessToken->UserAndGroups[GroupsIndex].Attributes == 0 ||
+ (AccessToken->UserAndGroups[GroupsIndex].Attributes & SE_GROUP_ENABLED) == 0)
+ {
+ /*
+ * A group is not enabled, it's time to remove
+ * from the token and update the groups index
+ * accordingly and continue with the next group.
+ */
+ SepRemoveUserGroupToken(AccessToken, GroupsIndex);
+ GroupsIndex--;
+ }
+ }
- //
- // FIXME: Implement the "EffectiveOnly" option, that removes all
- // the disabled parts (privileges and groups) of the token.
- //
-
+ /* Begin querying the privileges and search for disabled ones */
+ for (PrivilegesIndex = 0; PrivilegesIndex < AccessToken->PrivilegeCount; PrivilegesIndex++)
+ {
+ /*
+ * A privilege is considered disabled if its attributes is either
+ * 0 or SE_PRIVILEGE_ENABLED is not included in the attributes flags list.
+ * That is because a certain privilege can have several attributes
+ * that bear no influence on whether a privilege is enabled or not
+ * (SE_PRIVILEGE_ENABLED_BY_DEFAULT for example which is a mere indicator
+ * that the privilege has just been enabled by default).
+ */
+ if (AccessToken->Privileges[PrivilegesIndex].Attributes == 0 ||
+ (AccessToken->Privileges[PrivilegesIndex].Attributes & SE_PRIVILEGE_ENABLED) == 0)
+ {
+ /*
+ * A privilege is not enabled, therefor it's time
+ * to strip it from the token and continue with the next
+ * privilege. Of course we must also want to update the
+ * privileges index accordingly.
+ */
+ SepRemovePrivilegeToken(AccessToken, PrivilegesIndex);
+ PrivilegesIndex--;
+ }
+ }
+ }
//
// NOTE: So far our dynamic area only contains
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0de0013cec25766e18612…
commit 0de0013cec25766e1861299de7b38aacd586c4cf
Author: Stanislav Motylkov <x86corez(a)gmail.com>
AuthorDate: Sun Sep 5 16:22:29 2021 +0300
Commit: Stanislav Motylkov <x86corez(a)gmail.com>
CommitDate: Sun Sep 5 16:22:29 2021 +0300
[TRANSLATION] Add and improve Russian and Ukrainian translations
[NETID]
- Add and improve Russian translation. Addendum to b9426a3f and c276681e.
[MACHINE.INF]
- Fix probably a machine translation. Addendum to 2d8274bd.
- Standardize some device names.
- Also add missing Ukrainian translation.
---
dll/win32/netid/lang/ru-RU.rc | 18 ++++++-------
media/inf/machine.inf | 60 ++++++++++++++++++++++++++-----------------
2 files changed, 46 insertions(+), 32 deletions(-)
diff --git a/dll/win32/netid/lang/ru-RU.rc b/dll/win32/netid/lang/ru-RU.rc
index d1df41b40cb..891356000fa 100644
--- a/dll/win32/netid/lang/ru-RU.rc
+++ b/dll/win32/netid/lang/ru-RU.rc
@@ -19,7 +19,7 @@ BEGIN
PUSHBUTTON "И&зменить...", IDC_NETWORK_PROPERTY, 180, 149, 72, 15
LTEXT "", IDC_MESSAGETEXT, 7, 179, 242, 46
ICON IDI_WARNINGICO, IDC_RESTARTICON, 7, 194, 20, 20, SS_ICON | SS_REALSIZEIMAGE
- LTEXT "Changes will take effect after you restart this computer.", IDC_RESTARTTEXT, 25, 195, 209, 8
+ LTEXT "Изменения вступят в силу после перезагрузки компьютера.", IDC_RESTARTTEXT, 25, 195, 209, 8
END
IDD_PROPPAGECOMPNAMECHENGE DIALOGEX 0, 0, 232, 222
@@ -66,20 +66,20 @@ BEGIN
4 "Изменение имени компьютера"
5 "Рабочая группа:"
6 "Домен:"
- 7 "The domain name ""%1"" does not conform to Internet Domain Name Service specifications, although it is a legal ReactOS name. You must use ReactOS DNS server for non-standard names."
- 8 "The domain name ""%1"" is not properly formatted. Periods (.) are used to separate domains. Each domain is limited to 63 characters. Example: domain-1.reactos.org."
- 10 "The new computer name ""%1"" is too long. The name may not be longer than 63 characters."
- 11 "The new computer name entered is not properly formatted. Standard names may contain letters (a-z, A-Z), numbers (0-9), and hyphens (-), but no spaces or periods (.). The name may not consist entirely of digits."
+ 7 "Имя домена ""%1"" не соответствует спецификациям DNS Интернета, хотя оно является допустимым именем в ReactOS. Для поддержки нестандартных имён следует использовать DNS-сервер ReactOS."
+ 8 "Имя домена ""%1"" имеет неправильный формат. Точки (.) используются как разделители доменов. Каждый домен должен быть не длиннее 63 символов. Пример: domain-1.reactos.org."
+ 10 "Новое имя компьютера ""%1"" слишком длинное. Это имя не может быть длиннее, чем 63 символа."
+ 11 "Введённое имя компьютера имеет неправильный формат. Стандартные имена могут содержать только латинские буквы (a-z, A-Z), цифры (0-9) и дефисы (-), но не могут содержать пробелы или точки (.). Имя не может состоять только из цифр."
22 "Добро пожаловать в рабочую группу %1."
23 "Добро пожаловать в домен %1."
24 "Необходимо перезапустить компьютер для того, чтобы эти изменения вступили в силу."
25 "Можно изменить имя и принадлежность этого компьютера. Изменения могут повлиять на доступ к сетевым ресурсам."
1021 "Примечание: только администраторы могут изменить идентификацию этого компьютера."
1022 "Примечание: идентификация этого компьютера не может быть изменена, потому что:"
- 1029 "The new computer name ""%1"" is a number. The name may not be a number."
- 1030 "Новое имя компьютера ""%1"" содержит запрещенные знаки. Запрещенные знаки ` ~ ! @ # $ %% ^ & * ( ) = + [ ] { } \\ | ; : ' "" , < > / и ?"
- 1031 "The first domain of the domain name ""%1"" is a number. The first domain may not be a number."
- 1032 "The domain name ""%1"" contains characters which are not allowed. Standard DNS names may contain letters (a-z, A-Z), numbers (0-9), and hyphens, but no spaces. Periods (.) are used to separate domains. Example: domain-1.reactos.org."
+ 1029 "Новое имя компьютера ""%1"" является числом. Имя компьютера не может быть числом."
+ 1030 "Новое имя компьютера ""%1"" содержит запрещённые знаки. Запрещённые знаки ` ~ ! @ # $ %% ^ & * ( ) = + [ ] { } \\ | ; : ' "" , < > / и ?"
+ 1031 "Первый домен в доменном имени ""%1"" является числом. Имя первого домена не может быть числом."
+ 1032 "Имя домена ""%1"" содержит запрещённые знаки. Стандартные DNS-имена могут содержать только латинские буквы (a-z, A-Z), цифры (0-9) и дефисы, но не могут содержать пробелы. Точки (.) используются как разделители доменов. Пример: domain-1.reactos.org."
3210 "&Подробно >>"
3220 "<< &Подробно"
4000 "Информация"
diff --git a/media/inf/machine.inf b/media/inf/machine.inf
index 063c85f0a61..ad3f2897e6a 100644
--- a/media/inf/machine.inf
+++ b/media/inf/machine.inf
@@ -197,17 +197,17 @@ PCI\VEN_8086&DEV_2413.DeviceDesc = "Intel 82801AA SMBus"
PCI\VEN_8086&DEV_7000.DeviceDesc = "Intel 82371SB PIIX3 PCI to ISA Bridge"
PCI\VEN_8086&DEV_7110.DeviceDesc = "Intel 82371AB/EB PCI to ISA Bridge"
PCI\VEN_8086&DEV_7113.DeviceDesc = "Intel 82371AB/EB Power Management Controller"
-PCI\VEN_8086&DEV_7180.DeviceDesc = "Intel 82443LX/EX Pentium(R) II CPU to PCI-Bridge"
-PCI\VEN_8086&DEV_7190.DeviceDesc = "Intel 82443BX/ZX/DX Pentium(R) II CPU to PCI-Bridge"
-PCI\VEN_8086&DEV_7192.DeviceDesc = "Intel 82443BX/ZX/DX Pentium(R) II CPU to PCI-Bridge"
+PCI\VEN_8086&DEV_7180.DeviceDesc = "Intel 82443LX/EX Pentium(R) II CPU to PCI Bridge"
+PCI\VEN_8086&DEV_7190.DeviceDesc = "Intel 82443BX/ZX/DX Pentium(R) II CPU to PCI Bridge"
+PCI\VEN_8086&DEV_7192.DeviceDesc = "Intel 82443BX/ZX/DX Pentium(R) II CPU to PCI Bridge"
nVidiaMfg = "nVidia"
PCI\VEN_10DE&DEV_01B2.DeviceDesc = "nVidia nForce PCI to ISA Bridge"
PCI\VEN_10DE&DEV_01B4.DeviceDesc = "nVidia nForce SMBus Controller"
PCI\VEN_10DE&DEV_01B7.DeviceDesc = "nVidia nForce AGP to PCI Bridge"
PCI\VEN_10DE&DEV_01B8.DeviceDesc = "nVidia nForce PCI to PCI Bridge"
-PCI\VEN_10DE&DEV_02A5.DeviceDesc = "nVidia MCPX CPU Bridge"
-PCI\VEN_10DE&DEV_02A6.DeviceDesc = "nVidia MCPX Memory Controller"
+PCI\VEN_10DE&DEV_02A5.DeviceDesc = "nVidia MCPX CPU to PCI Bridge"
+PCI\VEN_10DE&DEV_02A6.DeviceDesc = "nVidia MCPX PCI RAM Controller"
[Strings.0404]
GenericMfg = "(標準系統裝置)"
@@ -254,7 +254,7 @@ PCI\VEN_10DE&DEV_01B2.DeviceDesc = "nVidia nForce PCI - ISA 橋接器"
PCI\VEN_10DE&DEV_01B4.DeviceDesc = "nVidia nForce SMBus 控制器"
PCI\VEN_10DE&DEV_01B7.DeviceDesc = "nVidia nForce AGP - PCI 橋接器"
PCI\VEN_10DE&DEV_01B8.DeviceDesc = "nVidia nForce PCI - PCI 橋接器"
-PCI\VEN_10DE&DEV_02A5.DeviceDesc = "nVidia MCPX CPU 橋接器"
+PCI\VEN_10DE&DEV_02A5.DeviceDesc = "nVidia MCPX CPU - PCI 橋接器"
PCI\VEN_10DE&DEV_02A6.DeviceDesc = "nVidia MCPX 記憶體控制器"
[Strings.0405]
@@ -415,8 +415,8 @@ PCI\VEN_10DE&DEV_01B2.DeviceDesc = "nVidia nForce Puente PCI-ISA Bridge"
PCI\VEN_10DE&DEV_01B4.DeviceDesc = "nVidia nForce Controlador SMBus"
PCI\VEN_10DE&DEV_01B7.DeviceDesc = "nVidia nForce Puente AGP-PCI"
PCI\VEN_10DE&DEV_01B8.DeviceDesc = "nVidia nForce Puente PCI-PCI"
-PCI\VEN_10DE&DEV_02A5.DeviceDesc = "nVidia MCPX Puente CPU"
-PCI\VEN_10DE&DEV_02A6.DeviceDesc = "nVidia MCPX Controlador de Memoria"
+PCI\VEN_10DE&DEV_02A5.DeviceDesc = "nVidia MCPX Puente CPU-PCI"
+PCI\VEN_10DE&DEV_02A6.DeviceDesc = "nVidia MCPX Controlador de PCI RAM"
[Strings.040C]
@@ -645,9 +645,9 @@ GenericMfg = "(Стандартные системные устройства)"
ACPI\FixedButton.DeviceDesc = "Кнопка фиксированной возможности ACPI"
ISAPNP\ReadDataPort.DeviceDesc = "Порт чтения данных ISAPNP"
PCI\CC_0500.DeviceDesc = "Стандартный контроллер PCI RAM"
-PCI\CC_0600.DeviceDesc = "Стандартный процессор на мосте PCI"
-PCI\CC_0601.DeviceDesc = "Стандартный PCI на ISA мосте"
-PCI\CC_0604.DeviceDesc = "Стандартный PCI на PCI мосте"
+PCI\CC_0600.DeviceDesc = "Стандартный мост CPU - PCI"
+PCI\CC_0601.DeviceDesc = "Стандартный мост PCI - ISA"
+PCI\CC_0604.DeviceDesc = "Стандартный мост PCI - PCI"
*ThermalZone.DeviceDesc = "Термальная зона ACPI"
PCI\CC_0C05.DeviceDesc = "Контроллер SMBus"
SWENUM.DeviceDesc = "Перечислитель программных устройств Plug & Play"
@@ -655,12 +655,19 @@ SWENUM.DeviceDesc = "Перечислитель программных устр
*INT0800.DeviceDesc = "Устройство Intel 82802 Firmware Hub"
PCI\VEN_8086&DEV_1237.DeviceDesc = "Intel 440FX - 82441FX PMC [Natoma]"
PCI\VEN_8086&DEV_2413.DeviceDesc = "Intel 82801AA SMBus"
-PCI\VEN_8086&DEV_7000.DeviceDesc = "Intel 82371SB PIIX3 PCI на ISA мосте"
-PCI\VEN_8086&DEV_7110.DeviceDesc = "Intel 82371AB/EB PCI на ISA мосте"
+PCI\VEN_8086&DEV_7000.DeviceDesc = "Intel 82371SB PIIX3 мост PCI - ISA"
+PCI\VEN_8086&DEV_7110.DeviceDesc = "Intel 82371AB/EB мост PCI - ISA"
PCI\VEN_8086&DEV_7113.DeviceDesc = "Контроллер управления питанием Intel 82371AB/EB"
-PCI\VEN_8086&DEV_7180.DeviceDesc = "Intel 82443LX/EX Pentium(R) II CPU на PCI мосте"
-PCI\VEN_8086&DEV_7190.DeviceDesc = "Intel 82443BX/ZX/DX Pentium(R) II CPU на PCI мосте"
-PCI\VEN_8086&DEV_7192.DeviceDesc = "Intel 82443BX/ZX/DX Pentium(R) II CPU на PCI мосте"
+PCI\VEN_8086&DEV_7180.DeviceDesc = "Intel 82443LX/EX Pentium(R) II мост CPU - PCI"
+PCI\VEN_8086&DEV_7190.DeviceDesc = "Intel 82443BX/ZX/DX Pentium(R) II мост CPU - PCI"
+PCI\VEN_8086&DEV_7192.DeviceDesc = "Intel 82443BX/ZX/DX Pentium(R) II мост CPU - PCI"
+
+PCI\VEN_10DE&DEV_01B2.DeviceDesc = "nVidia nForce мост PCI - ISA"
+PCI\VEN_10DE&DEV_01B4.DeviceDesc = "nVidia nForce контроллер SMBus"
+PCI\VEN_10DE&DEV_01B7.DeviceDesc = "nVidia nForce мост AGP - PCI"
+PCI\VEN_10DE&DEV_01B8.DeviceDesc = "nVidia nForce мост PCI - PCI"
+PCI\VEN_10DE&DEV_02A5.DeviceDesc = "nVidia MCPX мост CPU - PCI"
+PCI\VEN_10DE&DEV_02A6.DeviceDesc = "nVidia MCPX контроллер PCI RAM"
[Strings.041B]
SystemClassName = "Systémové zariadenia"
@@ -767,9 +774,9 @@ GenericMfg = "(Стандартні системні пристрої)"
*PNP0C0D.DeviceDesc = "Кришка ACPI"
*PNP0C0E.DeviceDesc = "Кнопка сплячого режиму ACPI"
*PNP0C0F.DeviceDesc = "Контроллер переривань PCI"
-*PNP0C15.DeviceDesc = "Docking Station"
+*PNP0C15.DeviceDesc = "Док станція"
ACPI\FixedButton.DeviceDesc = "Кнопка фіксованої можливості ACPI"
-PCI\CC_0500.DeviceDesc = "Standard PCI RAM controller"
+PCI\CC_0500.DeviceDesc = "Стандартний контролер PCI RAM"
PCI\CC_0600.DeviceDesc = "Стандартний міст CPU на PCI"
PCI\CC_0601.DeviceDesc = "Стандартний міст PCI на ISA"
PCI\CC_0604.DeviceDesc = "Стандартний міст PCI на PCI"
@@ -777,12 +784,19 @@ PCI\CC_0604.DeviceDesc = "Стандартний міст PCI на PCI"
PCI\CC_0C05.DeviceDesc = "Контроллер SMBus"
*INT0800.DeviceDesc = "Пристрій Intel 82802 Firmware Hub"
-PCI\VEN_8086&DEV_7000.DeviceDesc = "Міст Intel 82371SB PIIX3 PCI на ISA"
-PCI\VEN_8086&DEV_7110.DeviceDesc = "Міст Intel 82371AB/EB PCI на ISA"
+PCI\VEN_8086&DEV_7000.DeviceDesc = "Intel 82371SB PIIX3 міст PCI на ISA"
+PCI\VEN_8086&DEV_7110.DeviceDesc = "Intel 82371AB/EB міст PCI на ISA"
PCI\VEN_8086&DEV_7113.DeviceDesc = "Контроллер керування живленням Intel 82371AB/EB"
-PCI\VEN_8086&DEV_7180.DeviceDesc = "Intel 82443LX/EX Pentium(R) II CPU на PCI-мості"
-PCI\VEN_8086&DEV_7190.DeviceDesc = "Intel 82443BX/ZX/DX Pentium(R) II CPU на PCI-мості"
-PCI\VEN_8086&DEV_7192.DeviceDesc = "Intel 82443BX/ZX/DX Pentium(R) II CPU на PCI-мості"
+PCI\VEN_8086&DEV_7180.DeviceDesc = "Intel 82443LX/EX Pentium(R) II міст CPU на PCI"
+PCI\VEN_8086&DEV_7190.DeviceDesc = "Intel 82443BX/ZX/DX Pentium(R) II міст CPU на PCI"
+PCI\VEN_8086&DEV_7192.DeviceDesc = "Intel 82443BX/ZX/DX Pentium(R) II міст CPU на PCI"
+
+PCI\VEN_10DE&DEV_01B2.DeviceDesc = "nVidia nForce міст PCI на ISA"
+PCI\VEN_10DE&DEV_01B4.DeviceDesc = "nVidia nForce контролер SMBus"
+PCI\VEN_10DE&DEV_01B7.DeviceDesc = "nVidia nForce міст AGP на PCI"
+PCI\VEN_10DE&DEV_01B8.DeviceDesc = "nVidia nForce міст PCI на PCI"
+PCI\VEN_10DE&DEV_02A5.DeviceDesc = "nVidia MCPX міст CPU на PCI"
+PCI\VEN_10DE&DEV_02A6.DeviceDesc = "nVidia MCPX контролер PCI RAM"
[Strings.0427]
SystemClassName = "Sisteminiai įrenginiai"