Bug 23232 - пользователь %lighttpd_user должен входить в группу _webserver
Summary: пользователь %lighttpd_user должен входить в группу _webserver
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: lighttpd (show other bugs)
Version: unstable
Hardware: all Linux
: P3 normal
Assignee: Alexei Takaseev
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-25 19:04 MSK by Alexey Shabalin
Modified: 2010-10-01 14:12 MSD (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Shabalin 2010-03-25 19:04:19 MSK
Для соответствия полиси http://www.altlinux.org/WebPolicy, пользователь, от которого работает lighttpd, должен иметь доступ к "web-приложениям" и входить в группу _webserver.
В полиси однозначно указано для web-приложений использовать владельцев root:_webserver.
Это позволит не менять права доступа на файлы web-приложений, если изменится httpd сервер (например с apache на lighttpd)

Предлагаю %pre изменить на(по аналогии с apache2):

%_sbindir/groupadd -r -f %lighttpd_group ||:
%_sbindir/useradd -r -g %lighttpd_group -d /dev/null -s /dev/null -G %webserver_group -n %lighttpd_user \
2> /dev/null > /dev/null ||:

if LANG=C %_bindir/id %lighttpd_user 2>/dev/null | \
grep -qv "groups=[^[:space:]]*(%webserver_group)"; then
echo 'Warning: User %lighttpd_user was not included in the group %webserver_group!'
%_bindir/gpasswd -M %lighttpd_user %webserver_group
echo '     Added user %lighttpd_user to group %webserver_group.'
fi
Comment 1 Alexey Shabalin 2010-03-26 17:38:25 MSK
не надо использовать gpasswd -M, это замещает всех предыдущих пользователей.
надо использовать usermod -G _webserver lighttpd
Пошёл вешать баг на apache.
Comment 2 Vladimir V. Kamarzin 2010-03-29 09:25:23 MSD
usermod -G, насколько я помню, надо скармливать как раз полный список групп, например так:
%post
/usr/sbin/usermod -G bar$(groups foo | cut -d ':' -f 2 | sed 's/ /,/g') foo ||:

`gpasswd -a` можно заюзать
Comment 3 Repository Robot 2010-10-01 14:12:05 MSD
lighttpd-1.4.28-alt1 -> sisyphus:

* Fri Oct 01 2010 Vladimir V. Kamarzin <vvk@altlinux> 1.4.28-alt1
- 1.4.28.
- New config scheme introduced by upstream: small main config which
  includes configs for modules and vhosts (Closes: #23233).
- Add lighttpd pseudouser to %webserver_group according to WebPolicy
  (Closes: #23232).
- Don't create docdir when starting lighttpd service.