Возможно вы искали: 'Aquanox'

May 15 2025 19:15:28
  • Как сделать 8Gamers.Ru домашней страницей?
  • Игры
    • База данных по играх
    • Игровые новости
    • Игровая индустрия
    • Обзоры на игры
    • Прохождения игр
    • Гайды к играм
    • Превью о играх
    • Игровые тизеры
    • Игровые арты
    • Игровые обои
    • Игровые скриншоты
    • Игровые обложки
    • Игровые трейлеры
    • Игровое видео
    • Вышедшие игры
    • Ближайшие релизы игр
  • Кино и ТВ
    • База данных по кино
    • Статьи о кино
    • Постеры
    • Кадры из кино
    • Кино трейлеры
    • Сегодня в кино
    • Скоро в кино
  • Комиксы и манга
    • Манга по алфавиту
    • База данных по комиксах
    • Читать онлайн комиксы
    • Читать онлайн манга
    • База персонажей
  • Читы и коды
    • Чит-коды для PC игр
    • Чит-коды для консольных игр
    • Трейнеры
    • Коды Game Genie
  • Моддинг
    • Модификации
    • Карты к играм
    • Программы для моддинга
    • Статьи о моддинге
  • Геймдев
    • Всё о создании игр
    • Список движков
    • Утилиты в помощь игроделу
    • Конструкторы игр
    • Игровые движки
    • Библиотеки разработки
    • 3D-модели
    • Спрайты и тайлы
    • Музыка и звуки
    • Текстуры и фоны
  • Рецензии
    • Игры
    • Кино
    • Аниме
    • Комиксы
    • Мангу
    • Саундтреки
  • Саундтреки
    • Лирика
  • Файлы
    • Патчи к играм
    • Русификаторы к играм
    • Сохранения к играм
    • Субтитры к кино
  • Медиа
    • Видео
    • Фото
    • Аудио
    • Фан-арты
    • Косплей
    • Фото с виставок
    • Девушки из игр
    • Рисунки
    • Рисуем онлайн
    • Фотохостинг
  • Юмор
    • Анекдоты
    • Афоризмы
    • Истории
    • Стишки и эпиграммы
    • Тосты
    • Цитаты
  • Флеш
    • Азартные
    • Аркады
    • Бродилки
    • Гонки
    • Для девочек
    • Для мальчиков
    • Драки
    • Квесты
    • Леталки
    • Логические
    • Мультфильмы
    • Открытки
    • Приколы
    • Разное
    • Спорт
    • Стратегии
    • Стрелялки
Статистика

Статей: 87772
Просмотров: 96111483
Игры
Injustice:  Gods Among Us
Injustice: Gods Among Us
...
Dark Souls 2
Dark Souls 2
Dark Souls II - вторая часть самой хардкорной ролевой игры 2011-2012 года, с новым героем, сюжето...
Battlefield 4
Battlefield 4
Battlefield 4 - продолжение венценосного мультиплеер-ориентированного шутера от первого ли...
Кино
Steins;Gate
Steins;Gate
Любители японской анимации уже давно поняли ,что аниме сериалы могут дать порой гораздо больше пи...
Ку! Кин-дза-дза
Ку! Кин-дза-дза
Начинающий диджей Толик и всемирно известный виолончелист Владимир Чижов встречают на шумной моск...
Обзоры на игры
• Обзор Ibara [PCB/PS2] 18357
• Обзор The Walking ... 18801
• Обзор DMC: Devil M... 19879
• Обзор на игру Valk... 15877
• Обзор на игру Stars! 17764
• Обзор на Far Cry 3 17948
• Обзор на Resident ... 16024
• Обзор на Chivalry:... 17508
• Обзор на игру Kerb... 17981
• Обзор игры 007: Fr... 16619
Превью о играх
• Превью к игре Comp... 17960
• Превью о игре Mage... 14464
• Превью Incredible ... 14721
• Превью Firefall 13479
• Превью Dead Space 3 16334
• Превью о игре SimC... 14730
• Превью к игре Fuse 15442
• Превью Red Orche... 15542
• Превью Gothic 3 16343
• Превью Black & W... 17354
Главная » Статьи » Разное » Как преодалеть ограничение в 32 группы на пользователя в Linux (linux limit group trouble kernel)

Как преодалеть ограничение в 32 группы на пользователя в Linux (linux limit group trouble kernel)

Ключевые слова: linux, limit, group, trouble, kernel, (найти похожие документы)

From: Radu Constantin Rendec <http://radu.rendec.ines.ro>
Date: Mon, 20 Nov 2004 18:21:07 +0000 (UTC)
Subject: Как преодалеть ограничение в 32 группы на пользователя в Linux

Оригинал: http://radu.rendec.ines.ro/howto/32groups.html

More than 32 groups/user

Disclaimer: I am not responsible for anything the material or the
included code/patches may cause, including loss of data, physical
damage, service disruption, or damage of any kind. Use at your own
risk!

Background: Most linux distributions don't allow more than 32
groups/user. That means one user cannot belong to more than 32 groups.
Unfortunately, this limit is hard coded into the linux kernel, glibc,
and a few utilities including shadow.

1. Patching the kernel

I only tried this on 2.4.x kernels. However, things should be the same
with 2.2.x. Be careful when choosing the new limit. The kernel behaves
strangely with large limits because the groups structure per process
is held on an 8K stack which seems to overflow. A 2.4.2 kernel with a
limit of 1024 crashed during boot. However, I successfully used a 255
limit on a 2.4.8 kernel.

The group limit is set from two header files in the linux kernel
source:

* include/asm/param.h
This file should contain something like this:

#ifndef NGROUPS
#define NGROUPS 32
#endif
Simply replace 32 with the limit you want. If your param.h doesn't
contain these lines, just add them.

* include/linux/limits.h
Look for a line that looks like

#define NGROUPS_MAX 32

and change the limit.

Now the kernel must be recompiled. There are some howtos that explain
how this is done.


2. Recompiling glibc

This applies to glibc-2.2.2 (this is the version which I used). It may
also apply to other versions, but I didn't test it.

The __sysconf function in glibc is affected by the limits defined in
the system header files. Other functions (initgroups and setgroups) in
glibc rely on __sysconf rather than using the limits defined in the
header files. You'll have to modify two header files. Please note that
this limit will be used by glibc and all programs that you compile.
Choose a reasonable limit. However, it's safe to use a larger limit
than you used for the kernel. I successfully compiled and ran glibc
with a limit of 1024.

* /usr/include/asm/param.h
Make sure the file contains something like

#ifndef NGROUPS
#define NGROUPS 1024
#endif

* /usr/include/linux/limits.h
It should contain a line like this:

#define NGROUPS_MAX 1024 /* supplemental group IDs are available */

Now you have to recompile glibc. I hope there are some howtos that
explain how this is properly done. I only did it twice and I got into
trouble both times. Glibc compiles cleanly, but the actual problem is
installing the new libraries. A 'make install' won't do it, at least
not with bash (some people suggested it would work if I used a
statically linked shell, but I didn't try). This happened on RedHat,
where the distribution glibc was placed under a subdirectory of /lib
rather than directly under /lib. 'make install' copies libraries one
at a time. After glibc is copied, paths stored inside the new glibc
binary won't match those from the old ld-linux.so, causing ld not to
be able to dinamically link any program. So 'make install' won't be
able to run /usr/bin/install, which is needed to copy the new
binaries, and it will fail. I had to reset the machine (/sbin/shutdown
could no longer be run), boot from a bootable cd and manually copy
glibc-2.2.2.so, libm-2.2.2.so, and ld-2.2.2.so, sync and reboot. Then,
everything seemed to be normal.


3. Recompiling shadow utils

Before I recompiled glibc, I had manually put a user in more than 32
groups (that means it already belonged to 32 groups and I manually
modified /etc/groups). Proper permissions were granted for groups
above 32, but usermod failed to add a user to more than 32 groups. I
began browsing the shadow utils source and found that it uses the
system headers at compile time to set the limit. This means that it
had to be recompiled, because the old limits were hard coded into the
binaries. A simple recompilation will do. However I made a [1]patch
against shadow-20000826, that will dinamically allocate space for the
group structure using __sysconf(). This means it won't have to be
recompiled if glibc is recompiled with a different limit.


4. Fixing process tools

Once again I thought everything was fine. However I ran apache
webserver as user www1, which belonged to more than 100 groups (that
was a security measure for massive virtual hosting). The message
'Internal error' appeared (apparently) at random while running
different programs. After a few grep's I figured out the message came
from libproc. I began browsing the procps sources and found a terrible
bug. Process information is read from the kernel and concatenated into
one string which is then parsed to get a dynamic list. The problem is
that the string was blindly dimensioned to 512 bytes, which was not
enough to hold information for so many groups. I made a [2]patch
against procps-2.0.7, which only defines a symbolic constant in
readproc.c and allocates the string with the size given by that
constant. Of course, I used a larger value, such as 4096. You'll have
to apply this patch and recompile procps.

Good luck!

Material provided by: Radu Constantin Rendec (http://radu.rendec.ines.ro)
1064 Прочтений •  [Как преодалеть ограничение в 32 группы на пользователя в Linux (linux limit group trouble kernel)] [08.05.2012] [Комментариев: 0]
Добавил: Ukraine Vova
Ссылки
HTML: 
[BB Url]: 
Похожие статьи
Название Добавил Добавлено
• Как преодалеть ограничение в 32 гру... Ukraine Vova 08.05.2012
Ни одного комментария? Будешь первым :).
Пожалуйста, авторизуйтесь для добавления комментария.

Проект входит в сеть сайтов «8Gamers Network»

Все права сохранены. 8Gamers.NET © 2011 - 2025

Статьи
Рецензия на Pressure
Рецензия на Pressure
Чтобы обратить на себя внимание, начинающие маленькие разработчики, как правило, уходят в жанры, ...
Рецензия на Lost Chronicles of Zerzura
Рецензия на Lost Chron...
Игры, сделанные без любви и старания, похожи на воздушный шар – оболочка есть, а внутри пусто. Lo...
Рецензия на The Bridge
Рецензия на The Bridge
«Верх» и «низ» в The Bridge — понятия относительные. Прогуливаясь под аркой, можно запросто перей...
Рецензия на SimCity
Рецензия на SimCity
Когда месяц назад состоялся релиз SimCity, по Сети прокатилось цунами народного гнева – глупые ош...
Рецензия на Strategy & Tactics: World War 2
Рецензия на Strategy &...
Название Strategy & Tactics: World War II вряд ли кому-то знакомо. Зато одного взгляда на ее скри...
Рецензия на игру Scribblenauts Unlimited
Рецензия на игру Scrib...
По сложившейся традиции в информационной карточке игры мы приводим в пример несколько похожих игр...
Рецензия на игру Walking Dead: Survival Instinct, The
Рецензия на игру Walki...
Зомби и продукция-по-лицензии — которые и сами по себе не лучшие представители игровой биосферы —...
Обратная связь | RSS | Донейт | Статистика | Команда | Техническая поддержка