|
|
@@ -1,7 +1,7 @@
|
|
|
-Index: lib/auth_unix.c
|
|
|
---- lib/auth_unix.c.orig 2006-11-30 18:11:22 +0100
|
|
|
-+++ lib/auth_unix.c 2007-02-08 09:32:47 +0100
|
|
|
-@@ -48,6 +48,7 @@
|
|
|
+diff -r e502c48f9ba9 lib/auth_unix.c
|
|
|
+--- a/lib/auth_unix.c Thu Oct 25 08:10:12 2007 +0200
|
|
|
++++ b/lib/auth_unix.c Fri Nov 30 11:33:23 2007 +0100
|
|
|
+@@ -48,12 +48,133 @@
|
|
|
#include <stdlib.h>
|
|
|
#include <pwd.h>
|
|
|
#include <grp.h>
|
|
|
@@ -9,10 +9,10 @@ Index: lib/auth_unix.c
|
|
|
#include <ctype.h>
|
|
|
#include <string.h>
|
|
|
|
|
|
-@@ -55,6 +56,126 @@
|
|
|
+ #include "auth.h"
|
|
|
#include "libcyr_cfg.h"
|
|
|
#include "xmalloc.h"
|
|
|
-
|
|
|
++
|
|
|
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
|
|
+/*
|
|
|
+ * __getgrent.c - This file is part of the libc-8086/grp package for ELKS,
|
|
|
@@ -132,11 +132,10 @@ Index: lib/auth_unix.c
|
|
|
+ return __getgrent(fileno(file), line_buff, members);
|
|
|
+}
|
|
|
+#endif /* __FreeBSD__ */
|
|
|
-+
|
|
|
+
|
|
|
struct auth_state {
|
|
|
char userid[81];
|
|
|
- char **group;
|
|
|
-@@ -142,6 +263,25 @@
|
|
|
+@@ -142,6 +263,25 @@ static char allowedchars[256] = {
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
|
|
};
|
|
|
|
|
|
@@ -162,7 +161,7 @@ Index: lib/auth_unix.c
|
|
|
/*
|
|
|
* Convert 'identifier' into canonical form.
|
|
|
* Returns a pointer to a static buffer containing the canonical form
|
|
|
-@@ -177,7 +317,7 @@
|
|
|
+@@ -177,7 +317,7 @@ size_t len;
|
|
|
*/
|
|
|
|
|
|
if (!strncmp(retbuf, "group:", 6)) {
|
|
|
@@ -171,18 +170,18 @@ Index: lib/auth_unix.c
|
|
|
if (!grp) return 0;
|
|
|
strcpy(retbuf+6, grp->gr_name);
|
|
|
return retbuf;
|
|
|
-@@ -224,6 +364,7 @@
|
|
|
- struct passwd *pwd;
|
|
|
- struct group *grp;
|
|
|
+@@ -228,6 +368,7 @@ static struct auth_state *mynewstate(con
|
|
|
+ int ret, ngroups = 0;
|
|
|
+ #else
|
|
|
char **mem;
|
|
|
+ FILE *groupfile;
|
|
|
+ #endif
|
|
|
|
|
|
identifier = mycanonifyid(identifier, 0);
|
|
|
- if (!identifier) return 0;
|
|
|
-@@ -240,20 +381,23 @@
|
|
|
+@@ -286,20 +427,23 @@ err:
|
|
|
+ if (groupids) free(groupids);
|
|
|
|
|
|
- pwd = getpwnam(identifier);
|
|
|
-
|
|
|
+ #else /* !HAVE_GETGROUPLIST */
|
|
|
- setgrent();
|
|
|
- while ((grp = getgrent())) {
|
|
|
- for (mem = grp->gr_mem; *mem; mem++) {
|
|
|
@@ -214,6 +213,6 @@ Index: lib/auth_unix.c
|
|
|
+ }
|
|
|
+ fclose(groupfile);
|
|
|
+ }
|
|
|
- return newstate;
|
|
|
- }
|
|
|
+ #endif /* HAVE_GETGROUPLIST */
|
|
|
|
|
|
+ return newstate;
|