From 8d0c3eefbc49bffdf73d90a1d1f89db4f7977dab Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 8 Dec 2004 08:21:35 +0000 Subject: r4096: move the samdb code to source/dsdb/ the idea is to have a directory service db layer which will be used by the ldap server, samr server, drsuapi server authentification... I plan to make different implementations of this interface possible - current default will be the current samdb code with sam.ldb - a compat implementation for samba3 (if someone wants to write one) - a new dsdb implementation which: - understands naming contexts (directory parrtitions) - do schema and acl checking checking - maintain objectGUID, timestamps and USN number, maybe linked attributes ('member' and 'memberOf' attributes) - store metadata on a attribute=value combination... metze (This used to be commit 893a8b8bca2f020fbbe6f469aaa8dd4478249eb8) --- source4/dsdb/common/flag_mapping.c | 135 +++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 source4/dsdb/common/flag_mapping.c (limited to 'source4/dsdb/common/flag_mapping.c') diff --git a/source4/dsdb/common/flag_mapping.c b/source4/dsdb/common/flag_mapping.c new file mode 100644 index 0000000000..30c5b0cf13 --- /dev/null +++ b/source4/dsdb/common/flag_mapping.c @@ -0,0 +1,135 @@ +/* + Unix SMB/CIFS implementation. + helper mapping functions for the SAMDB server + + Copyright (C) Stefan (metze) Metzmacher 2002 + Copyright (C) Andrew Tridgell 2004 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_samr.h" + +/* +translated the ACB_CTRL Flags to UserFlags (userAccountControl) +*/ +/* mapping between ADS userAccountControl and SAMR acct_flags */ +static const struct { + uint32_t uf; + uint16_t acb; +} acct_flags_map[] = { + { UF_ACCOUNTDISABLE, ACB_DISABLED }, + { UF_HOMEDIR_REQUIRED, ACB_HOMDIRREQ }, + { UF_PASSWD_NOTREQD, ACB_PWNOTREQ }, + { UF_TEMP_DUPLICATE_ACCOUNT, ACB_TEMPDUP }, + { UF_NORMAL_ACCOUNT, ACB_NORMAL }, + { UF_MNS_LOGON_ACCOUNT, ACB_MNS }, + { UF_INTERDOMAIN_TRUST_ACCOUNT, ACB_DOMTRUST }, + { UF_WORKSTATION_TRUST_ACCOUNT, ACB_WSTRUST }, + { UF_SERVER_TRUST_ACCOUNT, ACB_SVRTRUST }, + { UF_DONT_EXPIRE_PASSWD, ACB_PWNOEXP }, + { UF_LOCKOUT, ACB_AUTOLOCK } +}; + +uint32_t samdb_acb2uf(uint16_t acb) +{ + uint32_t i, ret = 0; + for (i=0;i Date: Thu, 6 Jan 2005 13:34:18 +0000 Subject: r4568: make use of SidType and move it to lsa.idl metze (This used to be commit c2523adc0a0807979fb21b8ba77d556bac82e435) --- source4/dsdb/common/flag_mapping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/dsdb/common/flag_mapping.c') diff --git a/source4/dsdb/common/flag_mapping.c b/source4/dsdb/common/flag_mapping.c index 30c5b0cf13..8fdded98f5 100644 --- a/source4/dsdb/common/flag_mapping.c +++ b/source4/dsdb/common/flag_mapping.c @@ -119,7 +119,7 @@ uint32_t samdb_gtype2atype(uint32_t gtype) } /* turn a sAMAccountType into a SID_NAME_USE */ -enum samr_SidType samdb_atype_map(uint32_t atype) +enum lsa_SidType samdb_atype_map(uint32_t atype) { switch (atype & 0xF0000000) { case ATYPE_GLOBAL_GROUP: -- cgit From a0e6f6c05b438765c8bbb6f8e7f7e6478dc67293 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 10 Feb 2005 07:43:39 +0000 Subject: r5309: removed ads.h from includes.h (This used to be commit 196c45b834c39f293b9533cec5cfe5a77382d4e2) --- source4/dsdb/common/flag_mapping.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/dsdb/common/flag_mapping.c') diff --git a/source4/dsdb/common/flag_mapping.c b/source4/dsdb/common/flag_mapping.c index 8fdded98f5..eab0d67825 100644 --- a/source4/dsdb/common/flag_mapping.c +++ b/source4/dsdb/common/flag_mapping.c @@ -22,6 +22,7 @@ #include "includes.h" #include "librpc/gen_ndr/ndr_samr.h" +#include "ads.h" /* translated the ACB_CTRL Flags to UserFlags (userAccountControl) -- cgit From 475bbbfa842d96b65de07eb1d5bd6982bfc41b4e Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 15 Mar 2006 11:56:58 +0000 Subject: r14442: the ACB_ flags are 32 bit... metze (This used to be commit a653ebd15da09a7e085338400925a6bbeb3cb316) --- source4/dsdb/common/flag_mapping.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/dsdb/common/flag_mapping.c') diff --git a/source4/dsdb/common/flag_mapping.c b/source4/dsdb/common/flag_mapping.c index eab0d67825..150179b841 100644 --- a/source4/dsdb/common/flag_mapping.c +++ b/source4/dsdb/common/flag_mapping.c @@ -30,7 +30,7 @@ translated the ACB_CTRL Flags to UserFlags (userAccountControl) /* mapping between ADS userAccountControl and SAMR acct_flags */ static const struct { uint32_t uf; - uint16_t acb; + uint32_t acb; } acct_flags_map[] = { { UF_ACCOUNTDISABLE, ACB_DISABLED }, { UF_HOMEDIR_REQUIRED, ACB_HOMDIRREQ }, @@ -45,7 +45,7 @@ static const struct { { UF_LOCKOUT, ACB_AUTOLOCK } }; -uint32_t samdb_acb2uf(uint16_t acb) +uint32_t samdb_acb2uf(uint32_t acb) { uint32_t i, ret = 0; for (i=0;i Date: Thu, 16 Mar 2006 00:23:11 +0000 Subject: r14464: Don't include ndr_BASENAME.h files unless strictly required, instead try to include just the BASENAME.h files (containing only structs) (This used to be commit 3dd477ca5147f28a962b8437e2611a8222d706bd) --- source4/dsdb/common/flag_mapping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/dsdb/common/flag_mapping.c') diff --git a/source4/dsdb/common/flag_mapping.c b/source4/dsdb/common/flag_mapping.c index 150179b841..4105ba74b1 100644 --- a/source4/dsdb/common/flag_mapping.c +++ b/source4/dsdb/common/flag_mapping.c @@ -21,7 +21,7 @@ */ #include "includes.h" -#include "librpc/gen_ndr/ndr_samr.h" +#include "librpc/gen_ndr/samr.h" #include "ads.h" /* -- cgit From 0aeb2a50b1fbad02fa676664ba1a1518994f1657 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 22 Mar 2006 10:22:46 +0000 Subject: r14637: Extend the ACB -> userParameters flag mapping based on the ovbious connections. Andrew Bartlett (This used to be commit 3e9e505e9e5b72dddccb548d17a5f02785d3a2e1) --- source4/dsdb/common/flag_mapping.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source4/dsdb/common/flag_mapping.c') diff --git a/source4/dsdb/common/flag_mapping.c b/source4/dsdb/common/flag_mapping.c index 4105ba74b1..e9c7469dd7 100644 --- a/source4/dsdb/common/flag_mapping.c +++ b/source4/dsdb/common/flag_mapping.c @@ -42,7 +42,15 @@ static const struct { { UF_WORKSTATION_TRUST_ACCOUNT, ACB_WSTRUST }, { UF_SERVER_TRUST_ACCOUNT, ACB_SVRTRUST }, { UF_DONT_EXPIRE_PASSWD, ACB_PWNOEXP }, - { UF_LOCKOUT, ACB_AUTOLOCK } + { UF_LOCKOUT, ACB_AUTOLOCK }, + { UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED, ACB_ENC_TXT_PWD_ALLOWED }, + { UF_SMARTCARD_REQUIRED, ACB_SMARTCARD_REQUIRED }, + { UF_TRUSTED_FOR_DELEGATION, ACB_TRUSTED_FOR_DELEGATION }, + { UF_NOT_DELEGATED, ACB_NOT_DELEGATED }, + { UF_USE_DES_KEY_ONLY, ACB_USE_DES_KEY_ONLY}, + { UF_DONT_REQUIRE_PREAUTH, ACB_DONT_REQUIRE_PREAUTH }, + { UF_PASSWORD_EXPIRED, ACB_PW_EXPIRED }, + { UF_NO_AUTH_DATA_REQUIRED, ACB_NO_AUTH_DATA_REQD } }; uint32_t samdb_acb2uf(uint32_t acb) -- cgit From 0329d755a7611ba3897fc1ee9bdce410cc33d7f8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 30 Aug 2006 11:29:34 +0000 Subject: r17930: Merge noinclude branch: * Move dlinklist.h, smb.h to subsystem-specific directories * Clean up ads.h and move what is left of it to dsdb/ (only place where it's used) (This used to be commit f7afa1cb77f3cfa7020b57de12e6003db7cfcc42) --- source4/dsdb/common/flag_mapping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/dsdb/common/flag_mapping.c') diff --git a/source4/dsdb/common/flag_mapping.c b/source4/dsdb/common/flag_mapping.c index e9c7469dd7..28d6cc3c0b 100644 --- a/source4/dsdb/common/flag_mapping.c +++ b/source4/dsdb/common/flag_mapping.c @@ -22,7 +22,7 @@ #include "includes.h" #include "librpc/gen_ndr/samr.h" -#include "ads.h" +#include "dsdb/common/flags.h" /* translated the ACB_CTRL Flags to UserFlags (userAccountControl) -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/dsdb/common/flag_mapping.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/dsdb/common/flag_mapping.c') diff --git a/source4/dsdb/common/flag_mapping.c b/source4/dsdb/common/flag_mapping.c index 28d6cc3c0b..4a2a079e45 100644 --- a/source4/dsdb/common/flag_mapping.c +++ b/source4/dsdb/common/flag_mapping.c @@ -7,7 +7,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -16,8 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "includes.h" -- cgit