Kozea/Radicale — pull request #68 by shenek (2013-09-27 19:41:19+00:00)
Title: PAM fixes

The pull request fixes two errors.

**First**
Exception which was thrown when a client connects without username and password
```
Traceback (most recent call last):
File "/usr/lib64/python2.7/wsgiref/handlers.py", line 85, in run
self.result = application(self.environ, self.start_response)
File "/home/steve/projects/Radicale/radicale/__init__.py", line 285, in __call__
and auth.is_authenticated(user, password)) or \
File "/home/steve/projects/Radicale/radicale/auth/PAM.py", line 41, in is_authenticated
pwd.getpwnam(user).pw_uid
TypeError: must be string, not None
```
and HTTP status=501

The server should return 401 unauthorized.
This issue made my Korganizer confused. First it tries to connect without a username&password and expects 401 and then it connects for the second time with a username&password.

**Second**
Only supplementary groups were matched with pam_group_membership.
Although user's primary group (usually the one from /etc/passwd) matched the required group, the authentication failed.