Репозитории ALT
S: | 1.82-alt4 |
5.1: | 1.82-alt3 |
4.1: | 1.82-alt2 |
4.0: | 1.82-alt2.M40.1 |
Группа :: Система/Серверы
Пакет: policyd
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: policyd-1.80-alt-uid_gid.patch
Скачать
Скачать
Allow usage of symbolic user/group names in config file
--- ./generic.c
+++ ./generic.c
@@ -1,5 +1,6 @@
#include "policyd.h"
-
+#include <pwd.h>
+#include <grp.h>
/*
*
*
@@ -79,15 +80,23 @@ read_conf(unsigned int prog)
/* UID */
if(strncmp(confbuf, "UID=", 4) == 0)
{
- extract(0, confbuf, 3);
- UID=atol(extract_array[0]);
+ struct passwd *pw;
+ extract_conf(0, confbuf, 3);
+ if ((pw=getpwnam(extract_array_conf[0]))!=NULL)
+ UID=pw->pw_uid;
+ else
+ UID=atol(extract_array_conf[0]);
}
/* GID */
if(strncmp(confbuf, "GID=", 4) == 0)
- {
- extract(0, confbuf, 3);
- GID=atol(extract_array[0]);
+ {
+ struct group *gr;
+ extract_conf(0, confbuf, 3);
+ if ((gr=getgrnam(extract_array_conf[0]))!=NULL)
+ GID=gr->gr_gid;
+ else
+ GID=atol(extract_array_conf[0]);
}
/* DEBUG MODE */