]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Added user_global_uid and user_global_gid LDAP settings.
authorTimo Sirainen <tss@iki.fi>
Tue, 11 Feb 2003 12:53:56 +0000 (14:53 +0200)
committerTimo Sirainen <tss@iki.fi>
Tue, 11 Feb 2003 12:53:56 +0000 (14:53 +0200)
--HG--
branch : HEAD

doc/dovecot-ldap.conf
src/auth/db-ldap.c
src/auth/db-ldap.h
src/auth/userdb-ldap.c

index d814d591884592eb81da4d474331f9ca5db41d0e..39530075f31c309e029691bacd30b5afe486e884 100644 (file)
@@ -39,3 +39,8 @@ base = uid=someone, dc=foo, dc=bar, dc=org
 
 # Filter for password lookups
 #pass_filter = (&(objectClass=posixAccount)(uid=%u))
+
+# You can use same UID and GID for all user accounts if you really want to.
+# If the UID/GID is still found from LDAP reply, it overrides these values.
+#user_global_uid = 
+#user_global_gid = 
index d3c5a04eaa6581c4dcba6e41d0a88e5ad1876622..f40f219ad63d7e099a1246469370fc1e6aa0696d 100644 (file)
@@ -32,7 +32,9 @@ static struct setting_def setting_defs[] = {
        DEF(SET_STR, user_attrs),
        DEF(SET_STR, user_filter),
        DEF(SET_STR, pass_attrs),
-       DEF(SET_STR, pass_filter)
+       DEF(SET_STR, pass_filter),
+       DEF(SET_STR, user_global_uid),
+       DEF(SET_STR, user_global_gid)
 };
 
 struct ldap_settings default_ldap_settings = {
@@ -45,7 +47,9 @@ struct ldap_settings default_ldap_settings = {
        MEMBER(user_attrs) NULL,
        MEMBER(user_filter) NULL,
        MEMBER(pass_attrs) NULL,
-       MEMBER(pass_filter) NULL
+       MEMBER(pass_filter) NULL,
+       MEMBER(user_global_uid) 0,
+       MEMBER(user_global_gid) 0
 };
 
 static int ldap_conn_open(struct ldap_connection *conn);
index c39c7b74a3fd2f3fd1d74f18cef342a76b4d926b..75685d87e36376b5498916e1e462e01f1426205b 100644 (file)
@@ -22,6 +22,9 @@ struct ldap_settings {
        const char *pass_attrs;
        const char *pass_filter;
 
+       unsigned int user_global_uid;
+       unsigned int user_global_gid;
+
        int ldap_deref, ldap_scope;
 };
 
index 1854473badd6bd635b275ad18632bdc6e8d88e5c..70c508df8e007bbbb9400b8e13b4f5841bdbd3d9 100644 (file)
@@ -107,6 +107,9 @@ static void handle_request(struct ldap_connection *conn,
        t_push();
        memset(&user, 0, sizeof(user));
 
+       user.uid = conn->set.user_global_uid;
+       user.gid = conn->set.user_global_gid;
+
        attr = ldap_first_attribute(conn->ld, entry, &ber);
        while (attr != NULL) {
                vals = ldap_get_values(conn->ld, entry, attr);