From 2727f74132b8066e1aba1c31a601e076dbdf19ab Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sat, 17 Aug 2002 20:59:17 +0000 Subject: preparing for release of 19 (This used to be commit be5a649ed4c06aa1ffb709f1d3ff8ed26919bf1c) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 74df1c9914..b333f68feb 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "3.0-alpha18" +#define VERSION "19" -- cgit From b3ce3a877c5af840edcc07a7e053b939795086db Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sat, 17 Aug 2002 21:11:13 +0000 Subject: preparing for release of 3.0-alpha19 (This used to be commit 227472286f479bddfac7ea958b779fc4459a9e1e) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index b333f68feb..87e3673a7f 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "19" +#define VERSION "3.0-alpha19" -- cgit From 66992aff21605e372546808e00fa0b0659add868 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sun, 18 Aug 2002 00:59:47 +0000 Subject: * fix Get/SetPrinterDataEx() to work with printer key other than SPOOL_PRINTERDATA_KEY * created an internal set/get_printer_dataex() call for reuse in Set/GetPrinterData() (This used to be commit 4eb8ffba032971cf83a0fcec7ca3730b4ded0bf0) --- source3/include/nt_printing.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/nt_printing.h b/source3/include/nt_printing.h index 5e2b8f7f64..26d6e7e5f2 100644 --- a/source3/include/nt_printing.h +++ b/source3/include/nt_printing.h @@ -181,6 +181,7 @@ typedef struct nt_printer_driver_info_level #define SPOOL_DSDRIVER_KEY "DsDriver" #define SPOOL_DSUSER_KEY "DsUser" #define SPOOL_PNPDATA_KEY "PnPData" +#define SPOOL_OID_KEY "OID" /* container for a single registry key */ -- cgit From e38148f78ca631dcbc8a09616c2c91e5ec64c670 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 19 Aug 2002 15:30:26 +0000 Subject: we now receive and parse the main cldap netlogon reply. we still need to parse the core of the structure (This used to be commit 6780ae25bf7ca291f612682dec7ee7ff44c24bef) --- source3/include/asn_1.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/asn_1.h b/source3/include/asn_1.h index 090c5459d1..7783ab4c2f 100644 --- a/source3/include/asn_1.h +++ b/source3/include/asn_1.h @@ -45,6 +45,7 @@ typedef struct { #define ASN1_BOOLEAN 0x1 #define ASN1_INTEGER 0x2 #define ASN1_ENUMERATED 0xa +#define ASN1_SET 0x31 #define ASN1_MAX_OIDS 20 -- cgit From 0aef8b2ea64afb96bdf4d65689af775215b9ee37 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 19 Aug 2002 17:26:00 +0000 Subject: the SMBD_SELECT_TIMEOUT_WITH_PENDING_LOCKS macro isn't needed any more (This used to be commit 341bb9fb78a2e750f05a902e020ba352e26ca030) --- source3/include/local.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index 2538715c41..46349cfa6d 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -126,7 +126,6 @@ #define IDLE_CLOSED_TIMEOUT (60) #define DPTR_IDLE_TIMEOUT (120) #define SMBD_SELECT_TIMEOUT (60) -#define SMBD_SELECT_TIMEOUT_WITH_PENDING_LOCKS (10) #define NMBD_SELECT_LOOP (10) #define BROWSE_INTERVAL (60) #define REGISTRATION_INTERVAL (10*60) -- cgit From 8674440d81f703cb59979426c92ed54de8e5f2ed Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 20 Aug 2002 01:54:28 +0000 Subject: Based orginally by work by Kai, this patch moves our NT_TOKEN generation into our authenticaion code - removing some of the duplication from the current code. This also gets us *much* closer to supporting a real SAM backend, becouse the SAM can give us the right info then. This also changes our service.c code, so that we do a VUID (rather than uid) cache on the connection struct, and do full NT ACL/NT_TOKEN checks (or cached equivilant) on every packet, for the same r or rw mode the whole share was open for. Andrew Bartlett (This used to be commit d8122cee059fc7098bfa7e42e638a9958b3ac902) --- source3/include/local.h | 2 +- source3/include/smb.h | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index 46349cfa6d..15231e92ee 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -117,7 +117,7 @@ #endif /* the size of the uid cache used to reduce valid user checks */ -#define UID_CACHE_SIZE 4 +#define VUID_CACHE_SIZE 32 /* the following control timings of various actions. Don't change them unless you know what you are doing. These are all in seconds */ diff --git a/source3/include/smb.h b/source3/include/smb.h index 263dd67c54..1ff0f1c328 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -430,9 +430,9 @@ typedef struct time_t status_time; } dir_status_struct; -struct uid_cache { +struct vuid_cache { int entries; - uid_t list[UID_CACHE_SIZE]; + uint16 list[VUID_CACHE_SIZE]; }; typedef struct @@ -461,7 +461,8 @@ typedef struct connection_struct unsigned cnum; /* an index passed over the wire */ int service; BOOL force_user; - struct uid_cache uid_cache; + BOOL force_group; + struct vuid_cache vuid_cache; void *dirptr; BOOL printer; BOOL ipc; -- cgit From a08427ea6efafd378e8cf207277b00a86ffd4bdd Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Tue, 20 Aug 2002 12:38:43 +0000 Subject: cannot use casts in the DLIST_xxx macros (This used to be commit c9ffc416aeee2610fdc896a9d41dac182039a5f9) --- source3/include/libsmbclient.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/libsmbclient.h b/source3/include/libsmbclient.h index f269563996..2b45709a5e 100644 --- a/source3/include/libsmbclient.h +++ b/source3/include/libsmbclient.h @@ -333,7 +333,7 @@ typedef struct _SMBCCTX { /** Space to store private data of the server cache. */ - void * server_cache; + struct smbc_server_cache * server_cache; /** INTERNAL functions * do _NOT_ touch these from your program ! -- cgit From f744db7a5dee0764bb41c43336b1b1a933a79682 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 20 Aug 2002 20:54:32 +0000 Subject: IFSTEST fixes for open fid, nametoolong. Jeremy. (This used to be commit e53a81261ed189881c0f07e1b46f97aa6770cab7) --- source3/include/smb.h | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 1ff0f1c328..091ef780ad 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1148,17 +1148,17 @@ struct bitmap { #define FILE_SHARE_DELETE 4 /* FileAttributesField */ -#define FILE_ATTRIBUTE_READONLY aRONLY -#define FILE_ATTRIBUTE_HIDDEN aHIDDEN -#define FILE_ATTRIBUTE_SYSTEM aSYSTEM -#define FILE_ATTRIBUTE_DIRECTORY aDIR -#define FILE_ATTRIBUTE_ARCHIVE aARCH -#define FILE_ATTRIBUTE_NORMAL 0x80L -#define FILE_ATTRIBUTE_TEMPORARY 0x100L -#define FILE_ATTRIBUTE_SPARSE 0x200L -#define FILE_ATTRIBUTE_COMPRESSED 0x800L -#define FILE_ATTRIBUTE_NONINDEXED 0x2000L -#define SAMBA_ATTRIBUTES_MASK 0x7F +#define FILE_ATTRIBUTE_READONLY 0x001L +#define FILE_ATTRIBUTE_HIDDEN 0x002L +#define FILE_ATTRIBUTE_SYSTEM 0x004L +#define FILE_ATTRIBUTE_DIRECTORY 0x010L +#define FILE_ATTRIBUTE_ARCHIVE 0x020L +#define FILE_ATTRIBUTE_NORMAL 0x080L +#define FILE_ATTRIBUTE_TEMPORARY 0x100L +#define FILE_ATTRIBUTE_SPARSE 0x200L +#define FILE_ATTRIBUTE_COMPRESSED 0x800L +#define FILE_ATTRIBUTE_NONINDEXED 0x2000L +#define SAMBA_ATTRIBUTES_MASK 0x7F /* Flags - combined with attributes. */ #define FILE_FLAG_WRITE_THROUGH 0x80000000L @@ -1186,6 +1186,7 @@ struct bitmap { #define FILE_EIGHT_DOT_THREE_ONLY 0x0400 #define FILE_RANDOM_ACCESS 0x0800 #define FILE_DELETE_ON_CLOSE 0x1000 +#define FILE_OPEN_BY_FILE_ID 0x2000 /* Responses when opening a file. */ #define FILE_WAS_OPENED 1 -- cgit From 257dfc89814f555d1f7478f8e303f7925bc143d7 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 21 Aug 2002 11:12:14 +0000 Subject: Handle wrap-around on this number by making it unsigned. (Wrapping to zero does not create problems in this cache) Andrew Bartlett (This used to be commit c58e3d5c7d78dd02584b1490a27f7007e11b8712) --- source3/include/smb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 091ef780ad..9101e947a7 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -431,7 +431,7 @@ typedef struct } dir_status_struct; struct vuid_cache { - int entries; + unsigned int entries; uint16 list[VUID_CACHE_SIZE]; }; -- cgit From d3aa76cef528a15571cade12ebdd10973f4ca579 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 21 Aug 2002 19:59:23 +0000 Subject: Patch from Paul Green to be more POSIX-compatible (This used to be commit addf29e6765393b25c35bd833d29e29e4581c233) --- source3/include/includes.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 6084d583ed..9b597db78b 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -216,7 +216,11 @@ #include #include #include + +#ifdef WITH_SYSLOG #include +#endif + #include #ifdef HAVE_NETINET_TCP_H -- cgit From 474c1489699cb36e5831e6546aef496404a45752 Mon Sep 17 00:00:00 2001 From: Jean-François Micouleau Date: Wed, 21 Aug 2002 23:08:28 +0000 Subject: NETLOGON NetServerAuthenticate3 include and parser file J.F. (This used to be commit 2f68d6f5ec925f07a387f784db6de0cfbaa53278) --- source3/include/rpc_netlogon.h | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) (limited to 'source3/include') diff --git a/source3/include/rpc_netlogon.h b/source3/include/rpc_netlogon.h index 80b00fbaad..3c19c574f0 100644 --- a/source3/include/rpc_netlogon.h +++ b/source3/include/rpc_netlogon.h @@ -4,6 +4,7 @@ Copyright (C) Andrew Tridgell 1992-1997 Copyright (C) Luke Kenneth Casson Leighton 1996-1997 Copyright (C) Paul Ashton 1997 + Copyright (C) Jean François Micouleau 2002 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 @@ -25,17 +26,18 @@ /* NETLOGON pipe */ -#define NET_SAMLOGON 0x02 -#define NET_SAMLOGOFF 0x03 -#define NET_REQCHAL 0x04 -#define NET_AUTH 0x05 -#define NET_SRVPWSET 0x06 -#define NET_SAM_DELTAS 0x07 -#define NET_LOGON_CTRL 0x0c -#define NET_AUTH2 0x0f -#define NET_LOGON_CTRL2 0x0e -#define NET_SAM_SYNC 0x10 -#define NET_TRUST_DOM_LIST 0x13 +#define NET_SAMLOGON 0x02 +#define NET_SAMLOGOFF 0x03 +#define NET_REQCHAL 0x04 +#define NET_AUTH 0x05 +#define NET_SRVPWSET 0x06 +#define NET_SAM_DELTAS 0x07 +#define NET_LOGON_CTRL 0x0c +#define NET_AUTH2 0x0f +#define NET_LOGON_CTRL2 0x0e +#define NET_SAM_SYNC 0x10 +#define NET_TRUST_DOM_LIST 0x13 +#define NET_AUTH3 0x1a /* Secure Channel types. used in NetrServerAuthenticate negotiation */ #define SEC_CHAN_WKSTA 2 @@ -370,6 +372,23 @@ typedef struct net_r_auth2_info NTSTATUS status; /* return code */ } NET_R_AUTH_2; +/* NET_Q_AUTH_3 */ +typedef struct net_q_auth3_info +{ + DOM_LOG_INFO clnt_id; /* client identification info */ + DOM_CHAL clnt_chal; /* client-calculated credentials */ + NEG_FLAGS clnt_flgs; /* usually 0x6007 ffff */ +} NET_Q_AUTH_3; + +/* NET_R_AUTH_3 */ +typedef struct net_r_auth3_info +{ + DOM_CHAL srv_chal; /* server-calculated credentials */ + NEG_FLAGS srv_flgs; /* usually 0x6007 ffff */ + uint32 unknown; /* 0x0000045b */ + NTSTATUS status; /* return code */ +} NET_R_AUTH_3; + /* NET_Q_SRV_PWSET */ typedef struct net_q_srv_pwset_info -- cgit From f99ed72f8bc46725094de27b961a0c3af84f1e12 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Thu, 22 Aug 2002 20:19:49 +0000 Subject: Spelling fixes. (This used to be commit 9b49d97b94a7e3842cdcbfa4ebfa961586857aea) --- source3/include/rpc_netlogon.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'source3/include') diff --git a/source3/include/rpc_netlogon.h b/source3/include/rpc_netlogon.h index 3c19c574f0..f4ad3113e5 100644 --- a/source3/include/rpc_netlogon.h +++ b/source3/include/rpc_netlogon.h @@ -51,16 +51,18 @@ #define SAM_DELTA_GROUP_MEM 0x08 /* Group membership */ #define SAM_DELTA_ALIAS_INFO 0x09 /* Local groups */ #define SAM_DELTA_ALIAS_MEM 0x0C /* Local group membership */ -#define SAM_DELTA_DOM_INFO 0x0D /* Privilige stuff */ -#define SAM_DELTA_UNK0E_INFO 0x0e /* Privilige stuff */ -#define SAM_DELTA_PRIVS_INFO 0x10 /* Privilige stuff */ -#define SAM_DELTA_UNK12_INFO 0x12 /* Privilige stuff */ +#define SAM_DELTA_DOM_INFO 0x0D /* Privilege stuff */ +#define SAM_DELTA_UNK0E_INFO 0x0e /* Privilege stuff */ +#define SAM_DELTA_PRIVS_INFO 0x10 /* Privilege stuff */ +#define SAM_DELTA_UNK12_INFO 0x12 /* Privilege stuff */ #define SAM_DELTA_SAM_STAMP 0x16 /* Some kind of journal record? */ /* SAM database types */ #define SAM_DATABASE_DOMAIN 0x00 /* Domain users and groups */ +#define SAM_DATABASE_BUILTIN 0x01 /* BUILTIN users and g/* SAM database types */ +#define SAM_DATABASE_DOMAIN 0x00 /* Domain users and groups */ #define SAM_DATABASE_BUILTIN 0x01 /* BUILTIN users and groups */ -#define SAM_DATABASE_PRIVS 0x02 /* Priviliges? */ +#define SAM_DATABASE_PRIVS 0x02 /* Privileges */ #if 0 /* I think this is correct - it's what gets parsed on the wire. JRA. */ -- cgit From 600558a2eaa953f42cfced3912612f8e9ce2e135 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Thu, 22 Aug 2002 21:42:59 +0000 Subject: typos typos :) (This used to be commit 78cfbebc69fb15326d8f6dbbce1090c301a1f270) --- source3/include/rpc_netlogon.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/rpc_netlogon.h b/source3/include/rpc_netlogon.h index f4ad3113e5..190199e048 100644 --- a/source3/include/rpc_netlogon.h +++ b/source3/include/rpc_netlogon.h @@ -59,8 +59,6 @@ /* SAM database types */ #define SAM_DATABASE_DOMAIN 0x00 /* Domain users and groups */ -#define SAM_DATABASE_BUILTIN 0x01 /* BUILTIN users and g/* SAM database types */ -#define SAM_DATABASE_DOMAIN 0x00 /* Domain users and groups */ #define SAM_DATABASE_BUILTIN 0x01 /* BUILTIN users and groups */ #define SAM_DATABASE_PRIVS 0x02 /* Privileges */ -- cgit From 266fd83651bb5b2446e136492b82c836a8be095b Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Thu, 22 Aug 2002 23:39:26 +0000 Subject: Added some new delta types discovered by Ronnie from ethereal" - SAM_DELTA_RENAME{USER,GROUP,ALIAS} - SAM_DELTA_DELETE{USER,GROUP} Renamed some of the unknown delta types and their unmarshalling functions: - SAM_DELTA_TRUST_DOMS - SAM_DELTA_SECRET_INFO (This used to be commit 1f29276c2ff450c4ca3705c27fb0be71ddcda4ad) --- source3/include/rpc_netlogon.h | 51 +++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 23 deletions(-) (limited to 'source3/include') diff --git a/source3/include/rpc_netlogon.h b/source3/include/rpc_netlogon.h index 190199e048..5ee8120c68 100644 --- a/source3/include/rpc_netlogon.h +++ b/source3/include/rpc_netlogon.h @@ -45,17 +45,22 @@ #define SEC_CHAN_BDC 6 /* Returned delta types */ -#define SAM_DELTA_DOMAIN_INFO 0x01 /* Domain */ -#define SAM_DELTA_GROUP_INFO 0x02 /* Domain groups */ -#define SAM_DELTA_ACCOUNT_INFO 0x05 /* Users */ -#define SAM_DELTA_GROUP_MEM 0x08 /* Group membership */ -#define SAM_DELTA_ALIAS_INFO 0x09 /* Local groups */ -#define SAM_DELTA_ALIAS_MEM 0x0C /* Local group membership */ -#define SAM_DELTA_DOM_INFO 0x0D /* Privilege stuff */ -#define SAM_DELTA_UNK0E_INFO 0x0e /* Privilege stuff */ -#define SAM_DELTA_PRIVS_INFO 0x10 /* Privilege stuff */ -#define SAM_DELTA_UNK12_INFO 0x12 /* Privilege stuff */ -#define SAM_DELTA_SAM_STAMP 0x16 /* Some kind of journal record? */ +#define SAM_DELTA_DOMAIN_INFO 0x01 +#define SAM_DELTA_GROUP_INFO 0x02 +#define SAM_DELTA_RENAME_GROUP 0x04 +#define SAM_DELTA_ACCOUNT_INFO 0x05 +#define SAM_DELTA_RENAME_USER 0x07 +#define SAM_DELTA_GROUP_MEM 0x08 +#define SAM_DELTA_ALIAS_INFO 0x09 +#define SAM_DELTA_RENAME_ALIAS 0x0b +#define SAM_DELTA_ALIAS_MEM 0x0c +#define SAM_DELTA_POLICY_INFO 0x0d +#define SAM_DELTA_TRUST_DOMS 0x0e +#define SAM_DELTA_PRIVS_INFO 0x10 /* DT_DELTA_ACCOUNTS */ +#define SAM_DELTA_SECRET_INFO 0x12 +#define SAM_DELTA_DELETE_GROUP 0x14 +#define SAM_DELTA_DELETE_USER 0x15 +#define SAM_DELTA_MODIFIED_COUNT 0x16 /* SAM database types */ #define SAM_DATABASE_DOMAIN 0x00 /* Domain users and groups */ @@ -711,7 +716,7 @@ typedef struct sam_alias_mem_info_info } SAM_ALIAS_MEM_INFO; -/* SAM_DELTA_DOM (0x0D) */ +/* SAM_DELTA_POLICY (0x0D) */ typedef struct { uint32 unknown1; /* 0x5000 */ @@ -753,9 +758,9 @@ typedef struct UNISTR2 domain_name; DOM_SID2 domain_sid; -} SAM_DELTA_DOM; +} SAM_DELTA_POLICY; -/* SAM_DELTA_UNK0E (0x0e) */ +/* SAM_DELTA_TRUST_DOMS */ typedef struct { uint32 buf_size; @@ -773,7 +778,7 @@ typedef struct uint32 unknown3; UNISTR2 domain; -} SAM_DELTA_UNK0E; +} SAM_DELTA_TRUSTDOMS; /* SAM_DELTA_PRIVS (0x10) */ typedef struct @@ -812,7 +817,7 @@ typedef struct } SAM_DELTA_PRIVS; -/* SAM_DELTA_UNK12 (0x12) */ +/* SAM_DELTA_SECRET */ typedef struct { uint32 buf_size; @@ -846,15 +851,15 @@ typedef struct uint32 buf_size3; SEC_DESC *sec_desc2; -} SAM_DELTA_UNK12; +} SAM_DELTA_SECRET; -/* SAM_DELTA_STAMP (0x16) */ +/* SAM_DELTA_MOD_COUNT (0x16) */ typedef struct { uint32 seqnum; uint32 dom_mod_count_ptr; UINT64_S dom_mod_count; /* domain mod count at last sync */ -} SAM_DELTA_STAMP; +} SAM_DELTA_MOD_COUNT; typedef union sam_delta_ctr_info { @@ -864,11 +869,11 @@ typedef union sam_delta_ctr_info SAM_GROUP_MEM_INFO grp_mem_info; SAM_ALIAS_INFO alias_info ; SAM_ALIAS_MEM_INFO als_mem_info; - SAM_DELTA_DOM dom_info; + SAM_DELTA_POLICY policy_info; SAM_DELTA_PRIVS privs_info; - SAM_DELTA_STAMP stamp; - SAM_DELTA_UNK0E unk0e_info; - SAM_DELTA_UNK12 unk12_info; + SAM_DELTA_MOD_COUNT mod_count; + SAM_DELTA_TRUSTDOMS trustdoms_info; + SAM_DELTA_SECRET secret_info; } SAM_DELTA_CTR; /* NET_R_SAM_SYNC */ -- cgit From 9c31d189875c3d95e46df6210d70c48f202e3c4a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 23 Aug 2002 15:51:28 +0000 Subject: Merged initial allocation code for IFSTEST fix. Jeremy. (This used to be commit 095e2bf9469a4c26814fb049f2870983c090ed81) --- source3/include/config.h.in | 1 + source3/include/smb.h | 1 + source3/include/smb_macros.h | 3 +-- 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 4a138b6db6..8c06e25396 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -252,6 +252,7 @@ #undef HAVE_LDAP #undef HAVE_STAT_ST_BLOCKS #undef STAT_ST_BLOCKSIZE +#undef HAVE_STAT_ST_BLKSIZE #undef HAVE_DEVICE_MAJOR_FN #undef HAVE_DEVICE_MINOR_FN #undef HAVE_PASSWD_PW_COMMENT diff --git a/source3/include/smb.h b/source3/include/smb.h index 9101e947a7..958a563642 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -391,6 +391,7 @@ typedef struct files_struct BOOL delete_on_close; SMB_OFF_T pos; SMB_OFF_T size; + SMB_OFF_T initial_allocation_size; /* Faked up initial allocation on disk. */ mode_t mode; uint16 vuid; write_bmpx_struct *wbmpx_ptr; diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index a2351c705e..ccf151fab2 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -165,8 +165,7 @@ /* this is how errors are generated */ #define UNIXERROR(defclass,deferror) unix_error_packet(outbuf,defclass,deferror,__LINE__,__FILE__) -#define SMB_ROUNDUP(x,g) (((x)+((g)-1))&~((g)-1)) -#define SMB_ROUNDUP_ALLOCATION(s) ((s) ? (SMB_ROUNDUP((SMB_OFF_T)((s)+1), ((SMB_OFF_T)SMB_ROUNDUP_ALLOCATION_SIZE))) : 0 ) +#define SMB_ROUNDUP(x,r) ( ((x)%(r)) ? ( (((x)+(r))/(r))*(r) ) : (x)) /* Extra macros added by Ying Chen at IBM - speed increase by inlining. */ #define smb_buf(buf) (((char *)(buf)) + smb_size + CVAL(buf,smb_wct)*2) -- cgit From d8767bcdad96355b54a02fdf8cc9be6c569bc49d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 26 Aug 2002 03:16:10 +0000 Subject: Header file change from last commit. (This used to be commit a760bca56a55b119cf399c5ac6f8b0db418be2e0) --- source3/include/client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/client.h b/source3/include/client.h index 711ae1fd19..1e8d1c3d29 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -60,6 +60,7 @@ struct print_job_info typedef struct smb_sign_info { BOOL use_smb_signing; BOOL negotiated_smb_signing; + BOOL temp_smb_signing; size_t mac_key_len; uint8 mac_key[44]; uint32 send_seq_num; -- cgit From 2b2b0f7119fe043f61259579ce70e782f5f9ec5f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 28 Aug 2002 04:54:43 +0000 Subject: Put in intermediate version of new SAM system. It's not stable yet, code might be ugly, etc - please don't blame me for anything but instead try to fix the code :-). Compiling of the new sam system can be enabled with the configure option --with-sam Removing passdb/passgrp.c as it's unused fix typo in utils/testparm.c (This used to be commit 4b7de5ee236c043e6169f137992baf09a95c6f2c) --- source3/include/config.h.in | 3 +- source3/include/debug.h | 5 +- source3/include/includes.h | 4 + source3/include/sam.h | 258 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 267 insertions(+), 3 deletions(-) create mode 100644 source3/include/sam.h (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 8c06e25396..70c0ae2f3c 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -1,4 +1,4 @@ -/* include/config.h.in. Generated automatically from configure.in by autoheader. */ +/* include/config.h.in. Generated automatically from configure.in by autoheader 2.13. */ /* Define if on AIX 3. System headers sometimes define this. @@ -232,6 +232,7 @@ #undef MMAP_BLACKLIST #undef HAVE_IMMEDIATE_STRUCTURES #undef HAVE_CUPS +#undef WITH_SAM #undef WITH_LDAP_SAM #undef WITH_NISPLUS_SAM #undef WITH_TDB_SAM diff --git a/source3/include/debug.h b/source3/include/debug.h index 0885827433..a926143701 100644 --- a/source3/include/debug.h +++ b/source3/include/debug.h @@ -89,8 +89,9 @@ extern int DEBUGLEVEL; #define DBGC_RPC_SRV 6 #define DBGC_RPC_CLI 7 #define DBGC_PASSDB 8 -#define DBGC_AUTH 9 -#define DBGC_WINBIND 10 +#define DBGC_SAM 9 +#define DBGC_AUTH 10 +#define DBGC_WINBIND 11 /* So you can define DBGC_CLASS before including debug.h */ diff --git a/source3/include/includes.h b/source3/include/includes.h index 9b597db78b..f7b0d76dd4 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -751,6 +751,10 @@ extern int errno; #include "passdb.h" +#ifdef WITH_SAM +#include "sam.h" +#endif + #include "session.h" #include "asn_1.h" diff --git a/source3/include/sam.h b/source3/include/sam.h new file mode 100644 index 0000000000..b279eb88a1 --- /dev/null +++ b/source3/include/sam.h @@ -0,0 +1,258 @@ +/* + Unix SMB/CIFS implementation. + SAM structures + Copyright (C) Kai Krueger 2002 + Copyright (C) Stefan (metze) Metzmacher 2002 + Copyright (C) Simo Sorce 2002 + Copyright (C) Andrew Bartlett 2002 + Copyright (C) Jelmer Vernooij 2002 + + 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. +*/ + +#ifndef _SAM_H +#define _SAM_H + +#define SAM_INTERFACE_VERSION 1 + +/* use this inside a passdb module */ +#define SAM_MODULE_VERSIONING_MAGIC \ +int sam_version(void)\ +{\ + return SAM_INTERFACE_VERSION;\ +} + +typedef struct sam_domain { + TALLOC_CTX *mem_ctx; + uint32 access_granted; + struct sam_methods *current_sam_methods; /* sam_methods creating this +handle */ + void (*free_fn)(struct sam_domain **); + struct domain_data { + DOM_SID sid; /*SID of the domain. Should not be changed */ + char *name; /* Name of the domain */ + char *servername; /* */ + NTTIME max_passwordage; /* time till next password expiration */ + NTTIME min_passwordage; /* time till password can be changed again */ + NTTIME lockout_duration; /* time till login is allowed again after +lockout*/ + NTTIME reset_count; /* time till bad login counter is reset */ + uint16 min_passwordlength; /* minimum number of characters for a password +*/ + uint16 password_history; /* number of passwords stored in history */ + uint16 lockout_count; /* number of bad login attempts before lockout */ + BOOL force_logoff; /* force logoff after logon hours have expired */ + BOOL login_pwdchange; /* Users need to logon to change their password */ + uint32 num_users; /* number of users in the domain */ + uint32 num_groups; /* number of global groups */ + uint32 num_aliases; /* number of local groups */ + } private; +} SAM_DOMAIN_HANDLE; + +typedef struct sam_user { + TALLOC_CTX *mem_ctx; + uint32 access_granted; + struct sam_methods *current_sam_methods; /* sam_methods creating this +handle */ + void (*free_fn)(struct sam_user **); + struct sam_user_data { + uint32 init_flag; + NTTIME logon_time; /* logon time */ + NTTIME logoff_time; /* logoff time */ + NTTIME kickoff_time; /* kickoff time */ + NTTIME pass_last_set_time; /* password last set time */ + NTTIME pass_can_change_time; /* password can change time */ + NTTIME pass_must_change_time; /* password must change time */ + char * username; /* username string */ + SAM_DOMAIN_HANDLE * domain; /* domain of user */ + char * full_name; /* user's full name string */ + char * unix_home_dir; /* UNIX home directory string */ + char * home_dir; /* home directory string */ + char * dir_drive; /* home directory drive string */ + char * logon_script; /* logon script string */ + char * profile_path; /* profile path string */ + char * acct_desc; /* user description string */ + char * workstations; /* login from workstations string */ + char * unknown_str; /* don't know what this is, yet. */ + char * munged_dial; /* munged path name and dial-back tel number */ + DOM_SID user_sid; /* Primary User SID */ + DOM_SID group_sid; /* Primary Group SID */ + DATA_BLOB lm_pw; /* .data is Null if no password */ + DATA_BLOB nt_pw; /* .data is Null if no password */ + DATA_BLOB plaintext_pw; /* .data is Null if not available */ + uint16 acct_ctrl; /* account info (ACB_xxxx bit-mask) */ + uint32 unknown_1; /* 0x00ff ffff */ + uint16 logon_divs; /* 168 - number of hours in a week */ + uint32 hours_len; /* normally 21 bytes */ + uint8 hours[MAX_HOURS_LEN]; + uint32 unknown_2; /* 0x0002 0000 */ + uint32 unknown_3; /* 0x0000 04ec */ + } private; +} SAM_USER_HANDLE; + +typedef struct sam_group { + TALLOC_CTX *mem_ctx; + uint32 access_granted; + struct sam_methods *current_sam_methods; /* sam_methods creating this +handle */ + void (*free_fn)(struct sam_group **); + struct sam_group_data { + char *name; + char *comment; + DOM_SID sid; + int32 flags; /* specifies if the group is a lokal group or a global group +*/ + uint32 num_members; + PRIVILEGE_SET privileges; + } private; +} SAM_GROUP_HANDLE; + + +typedef struct sam_group_member { + DOM_SID sid; + BOOL group; /* specifies if it is a group or a user */ + +} SAM_GROUP_MEMBER; + +typedef struct sam_user_enum { + DOM_SID sid; + char *username; + char *full_name; + char *user_desc; + uint16 acc_ctrl; +} SAM_USER_ENUM; + +typedef struct sam_group_enum { + DOM_SID sid; + char *groupname; + char *comment; +} SAM_GROUP_ENUM; + +typedef struct sam_context +{ + struct sam_methods *methods; + TALLOC_CTX *mem_ctx; + + /* General API */ + + NTSTATUS (*sam_get_sec_desc) ( const struct sam_context *, const NT_USER_TOKEN *access_token, const DOM_SID *sid, SEC_DESC **sd); + NTSTATUS (*sam_set_sec_desc) ( const struct sam_context *, const NT_USER_TOKEN *access_token, const DOM_SID *sid, const SEC_DESC *sd); + + NTSTATUS (*sam_lookup_sid) ( const struct sam_context *, const NT_USER_TOKEN *access_token, const DOM_SID *sid, char **name, uint32 *type); + NTSTATUS (*sam_lookup_name) ( const struct sam_context *, const NT_USER_TOKEN *access_token, const char *domain, const char *name, DOM_SID **sid, uint32 *type); + + + /* Domain API */ + + NTSTATUS (*sam_update_domain) ( const struct sam_context *, SAM_DOMAIN_HANDLE *domain); + + NTSTATUS (*sam_enum_domains) ( const struct sam_context *, const NT_USER_TOKEN *access_token, int32 *domain_count, DOM_SID **domains, char **domain_names); + NTSTATUS (*sam_lookup_domain) ( const struct sam_context *, const NT_USER_TOKEN * access_token, const char *domain, DOM_SID **domainsid); + + NTSTATUS (*sam_get_domain_by_sid) ( const struct sam_context *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const DOM_SID *domainsid, SAM_DOMAIN_HANDLE **domain); + + + /* User API */ + + NTSTATUS (*sam_create_user) ( const struct sam_context *context, const NT_USER_TOKEN *access_token, const uint32 access_desired, DOM_SID *domainsid, SAM_USER_HANDLE **user); + NTSTATUS (*sam_add_user) ( const struct sam_context *, DOM_SID *domainsid, SAM_USER_HANDLE *user); + NTSTATUS (*sam_update_user) ( const struct sam_context *, SAM_USER_HANDLE *user); + NTSTATUS (*sam_delete_user) ( const struct sam_context *, SAM_USER_HANDLE * user); + NTSTATUS (*sam_enum_users) ( const struct sam_context *, const NT_USER_TOKEN *access_token, const DOM_SID *domain, int32 *user_count, SAM_USER_ENUM **users); + + NTSTATUS (*sam_get_user_by_sid) ( const struct sam_context *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const DOM_SID *usersid, SAM_USER_HANDLE **user); + NTSTATUS (*sam_get_user_by_name) ( const struct sam_context *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const char *domain, const char *name, SAM_USER_HANDLE **user); + + /* Group API */ + + + NTSTATUS (*sam_add_group) ( const struct sam_context *, DOM_SID *domainsid, SAM_GROUP_HANDLE *samgroup); + NTSTATUS (*sam_update_group) ( const struct sam_context *, SAM_GROUP_HANDLE *samgroup); + NTSTATUS (*sam_delete_group) ( const struct sam_context *, SAM_GROUP_HANDLE *groupsid); + NTSTATUS (*sam_enum_groups) ( const struct sam_context *, const NT_USER_TOKEN *access_token, const DOM_SID *domainsid, const uint32 type, uint32 *groups_count, SAM_GROUP_ENUM **groups); + NTSTATUS (*sam_get_group_by_sid) ( const struct sam_context *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const DOM_SID *groupsid, SAM_GROUP_HANDLE **group); + NTSTATUS (*sam_get_group_by_name) ( const struct sam_context *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const char *domain, const char *name, SAM_GROUP_HANDLE **group); + + NTSTATUS (*sam_add_member_to_group) ( const struct sam_context *, SAM_GROUP_HANDLE *group, SAM_GROUP_MEMBER *member); + NTSTATUS (*sam_delete_member_from_group) ( const struct sam_context *, SAM_GROUP_HANDLE *group, SAM_GROUP_MEMBER *member); + NTSTATUS (*sam_enum_groupmembers) ( const struct sam_context *, SAM_GROUP_HANDLE *group, uint32 *members_count, SAM_GROUP_MEMBER **members); + + NTSTATUS (*sam_get_groups_of_user) ( const struct sam_context *, SAM_USER_HANDLE *user, const uint32 type, uint32 *group_count, SAM_GROUP_ENUM **groups); + + void (*free_fn)(struct sam_context **); +} SAM_CONTEXT; + +typedef struct sam_methods +{ + struct sam_context *parent; + struct sam_methods *next; + struct sam_methods *prev; + const char *backendname; + struct sam_domain *domain; + void *private_data; + + /* General API */ + + NTSTATUS (*sam_get_sec_desc) ( const struct sam_methods *, const NT_USER_TOKEN *access_token, const DOM_SID *sid, SEC_DESC **sd); + NTSTATUS (*sam_set_sec_desc) ( const struct sam_methods *, const NT_USER_TOKEN *access_token, const DOM_SID *sid, const SEC_DESC *sd); + + NTSTATUS (*sam_lookup_sid) ( const struct sam_methods *, const NT_USER_TOKEN *access_token, const DOM_SID *sid, char **name, uint32 *type); + NTSTATUS (*sam_lookup_name) ( const struct sam_methods *, const NT_USER_TOKEN *access_token, const char *name, DOM_SID **sid, uint32 *type); + + /* Domain API */ + + NTSTATUS (*sam_update_domain) ( const struct sam_methods *, SAM_DOMAIN_HANDLE *domain); + NTSTATUS (*sam_get_domain_handle) (const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, SAM_DOMAIN_HANDLE **domain); + + /* User API */ + + NTSTATUS (*sam_create_user) ( const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, SAM_USER_HANDLE **user); + NTSTATUS (*sam_add_user) ( const struct sam_methods *, const SAM_USER_HANDLE *user); + NTSTATUS (*sam_update_user) ( const struct sam_methods *, const SAM_USER_HANDLE *user); + NTSTATUS (*sam_delete_user) ( const struct sam_methods *, const SAM_USER_HANDLE *user); + NTSTATUS (*sam_enum_users) ( const struct sam_methods *, const NT_USER_TOKEN *access_token, int32 *user_count, SAM_USER_ENUM **users); + + NTSTATUS (*sam_get_user_by_sid) ( const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const DOM_SID *usersid, SAM_USER_HANDLE **user); + NTSTATUS (*sam_get_user_by_name) ( const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const char *name, SAM_USER_HANDLE **user); + + /* Group API */ + + NTSTATUS (*sam_create_group) ( const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const uint32 type, SAM_GROUP_HANDLE **group); + NTSTATUS (*sam_add_group) ( const struct sam_methods *, SAM_GROUP_HANDLE *samgroup); + NTSTATUS (*sam_update_group) ( const struct sam_methods *, SAM_GROUP_HANDLE *samgroup); + NTSTATUS (*sam_delete_group) ( const struct sam_methods *, SAM_GROUP_HANDLE *groupsid); + NTSTATUS (*sam_enum_groups) ( const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 type, uint32 *groups_count, SAM_GROUP_ENUM **groups); + NTSTATUS (*sam_get_group_by_sid) ( const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const DOM_SID *groupsid, SAM_GROUP_HANDLE **group); + NTSTATUS (*sam_get_group_by_name) ( const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const char *name, SAM_GROUP_HANDLE **group); + + NTSTATUS (*sam_add_member_to_group) ( const struct sam_methods *, SAM_GROUP_HANDLE *group, const SAM_GROUP_MEMBER *member); + NTSTATUS (*sam_delete_member_from_group) ( const struct sam_methods *, SAM_GROUP_HANDLE *group, const SAM_GROUP_MEMBER *member); + NTSTATUS (*sam_enum_groupmembers) ( const struct sam_methods *, SAM_GROUP_HANDLE *group, uint32 *members_count, SAM_GROUP_MEMBER **members); + + NTSTATUS (*sam_get_groups_of_user) ( const struct sam_methods *, SAM_USER_HANDLE *user, const uint32 type, uint32 *group_count, SAM_GROUP_ENUM **groups); + + void (*free_private_data)(void **); +} SAM_METHODS; + +typedef NTSTATUS (*sam_init_function)( const struct sam_context *, struct sam_methods **, const char *); + +struct sam_init_function_entry { + char *name; + /* Function to create a member of the sam_methods list */ + sam_init_function init; +}; + + +#endif /* _SAM_H */ -- cgit From 97a957107df5ba730dd6e121b7ce3e3287d0a14e Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 28 Aug 2002 07:51:07 +0000 Subject: Silly of me to only test this with --with-sam and not without. Doh! (This used to be commit 6395c34f2f981d59b761d8615851a8fd54c1c304) --- source3/include/includes.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index f7b0d76dd4..f1c8c50df4 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -751,9 +751,7 @@ extern int errno; #include "passdb.h" -#ifdef WITH_SAM #include "sam.h" -#endif #include "session.h" -- cgit From 790b85f5e21b3dafe5dc3e7835e8f14dfd498462 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 28 Aug 2002 19:47:48 +0000 Subject: Return correct FILE_SUPERSEDED response - IFSTEST strikes again... Jeremy. (This used to be commit df3e467eb7cce059782870bfec222293577c4f69) --- source3/include/smb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 958a563642..f2eb37096c 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1190,6 +1190,7 @@ struct bitmap { #define FILE_OPEN_BY_FILE_ID 0x2000 /* Responses when opening a file. */ +#define FILE_WAS_SUPERSEDED 0 #define FILE_WAS_OPENED 1 #define FILE_WAS_CREATED 2 #define FILE_WAS_OVERWRITTEN 3 -- cgit From fe518a828b36a505772682e4d125cc5559dbeef6 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 29 Aug 2002 07:19:05 +0000 Subject: Put in patch from metze (Stefan Metzmacher) to: - Rename user -> account - Add sam_* functions (api.c) - Several small fixes (This used to be commit eafcc387045f4f265631a952297caf3f6db779d8) --- source3/include/sam.h | 276 ++++++++++++++++++++++++-------------------------- 1 file changed, 135 insertions(+), 141 deletions(-) (limited to 'source3/include') diff --git a/source3/include/sam.h b/source3/include/sam.h index b279eb88a1..a2d980c2e3 100644 --- a/source3/include/sam.h +++ b/source3/include/sam.h @@ -34,105 +34,99 @@ int sam_version(void)\ return SAM_INTERFACE_VERSION;\ } -typedef struct sam_domain { - TALLOC_CTX *mem_ctx; - uint32 access_granted; - struct sam_methods *current_sam_methods; /* sam_methods creating this -handle */ - void (*free_fn)(struct sam_domain **); - struct domain_data { - DOM_SID sid; /*SID of the domain. Should not be changed */ - char *name; /* Name of the domain */ - char *servername; /* */ - NTTIME max_passwordage; /* time till next password expiration */ - NTTIME min_passwordage; /* time till password can be changed again */ - NTTIME lockout_duration; /* time till login is allowed again after -lockout*/ - NTTIME reset_count; /* time till bad login counter is reset */ - uint16 min_passwordlength; /* minimum number of characters for a password -*/ - uint16 password_history; /* number of passwords stored in history */ - uint16 lockout_count; /* number of bad login attempts before lockout */ - BOOL force_logoff; /* force logoff after logon hours have expired */ - BOOL login_pwdchange; /* Users need to logon to change their password */ - uint32 num_users; /* number of users in the domain */ - uint32 num_groups; /* number of global groups */ - uint32 num_aliases; /* number of local groups */ - } private; +typedef struct sam_domain_handle { + TALLOC_CTX *mem_ctx; + uint32 access_granted; + struct sam_methods *current_sam_methods; /* sam_methods creating this handle */ + void (*free_fn)(struct sam_domain_handle **); + struct domain_data { + DOM_SID sid; /*SID of the domain. Should not be changed */ + char *name; /* Name of the domain */ + char *servername; /* */ + NTTIME max_passwordage; /* time till next password expiration */ + NTTIME min_passwordage; /* time till password can be changed again */ + NTTIME lockout_duration; /* time till login is allowed again after lockout*/ + NTTIME reset_count; /* time till bad login counter is reset */ + uint16 min_passwordlength; /* minimum number of characters for a password */ + uint16 password_history; /* number of passwords stored in history */ + uint16 lockout_count; /* number of bad login attempts before lockout */ + BOOL force_logoff; /* force logoff after logon hours have expired */ + BOOL login_pwdchange; /* Users need to logon to change their password */ + uint32 num_accounts; /* number of accounts in the domain */ + uint32 num_groups; /* number of global groups */ + uint32 num_aliases; /* number of local groups */ + } private; } SAM_DOMAIN_HANDLE; -typedef struct sam_user { - TALLOC_CTX *mem_ctx; - uint32 access_granted; - struct sam_methods *current_sam_methods; /* sam_methods creating this -handle */ - void (*free_fn)(struct sam_user **); - struct sam_user_data { - uint32 init_flag; - NTTIME logon_time; /* logon time */ - NTTIME logoff_time; /* logoff time */ - NTTIME kickoff_time; /* kickoff time */ - NTTIME pass_last_set_time; /* password last set time */ - NTTIME pass_can_change_time; /* password can change time */ - NTTIME pass_must_change_time; /* password must change time */ - char * username; /* username string */ - SAM_DOMAIN_HANDLE * domain; /* domain of user */ - char * full_name; /* user's full name string */ - char * unix_home_dir; /* UNIX home directory string */ - char * home_dir; /* home directory string */ - char * dir_drive; /* home directory drive string */ - char * logon_script; /* logon script string */ - char * profile_path; /* profile path string */ - char * acct_desc; /* user description string */ - char * workstations; /* login from workstations string */ - char * unknown_str; /* don't know what this is, yet. */ - char * munged_dial; /* munged path name and dial-back tel number */ - DOM_SID user_sid; /* Primary User SID */ - DOM_SID group_sid; /* Primary Group SID */ - DATA_BLOB lm_pw; /* .data is Null if no password */ - DATA_BLOB nt_pw; /* .data is Null if no password */ - DATA_BLOB plaintext_pw; /* .data is Null if not available */ - uint16 acct_ctrl; /* account info (ACB_xxxx bit-mask) */ - uint32 unknown_1; /* 0x00ff ffff */ - uint16 logon_divs; /* 168 - number of hours in a week */ - uint32 hours_len; /* normally 21 bytes */ - uint8 hours[MAX_HOURS_LEN]; - uint32 unknown_2; /* 0x0002 0000 */ - uint32 unknown_3; /* 0x0000 04ec */ - } private; -} SAM_USER_HANDLE; - -typedef struct sam_group { - TALLOC_CTX *mem_ctx; - uint32 access_granted; - struct sam_methods *current_sam_methods; /* sam_methods creating this -handle */ - void (*free_fn)(struct sam_group **); - struct sam_group_data { - char *name; - char *comment; - DOM_SID sid; - int32 flags; /* specifies if the group is a lokal group or a global group -*/ - uint32 num_members; - PRIVILEGE_SET privileges; - } private; +typedef struct sam_account_handle { + TALLOC_CTX *mem_ctx; + uint32 access_granted; + struct sam_methods *current_sam_methods; /* sam_methods creating this handle */ + void (*free_fn)(struct sam_account_handle **); + struct sam_account_data { + uint32 init_flag; + NTTIME logon_time; /* logon time */ + NTTIME logoff_time; /* logoff time */ + NTTIME kickoff_time; /* kickoff time */ + NTTIME pass_last_set_time; /* password last set time */ + NTTIME pass_can_change_time; /* password can change time */ + NTTIME pass_must_change_time; /* password must change time */ + char * account_name; /* account_name string */ + SAM_DOMAIN_HANDLE * domain; /* domain of account */ + char *full_name; /* account's full name string */ + char *unix_home_dir; /* UNIX home directory string */ + char *home_dir; /* home directory string */ + char *dir_drive; /* home directory drive string */ + char *logon_script; /* logon script string */ + char *profile_path; /* profile path string */ + char *acct_desc; /* account description string */ + char *workstations; /* login from workstations string */ + char *unknown_str; /* don't know what this is, yet. */ + char *munged_dial; /* munged path name and dial-back tel number */ + DOM_SID account_sid; /* Primary Account SID */ + DOM_SID group_sid; /* Primary Group SID */ + DATA_BLOB lm_pw; /* .data is Null if no password */ + DATA_BLOB nt_pw; /* .data is Null if no password */ + char *plaintext_pw; /* if Null not available */ + uint16 acct_ctrl; /* account info (ACB_xxxx bit-mask) */ + uint32 unknown_1; /* 0x00ff ffff */ + uint16 logon_divs; /* 168 - number of hours in a week */ + uint32 hours_len; /* normally 21 bytes */ + uint8 hours[MAX_HOURS_LEN]; + uint32 unknown_2; /* 0x0002 0000 */ + uint32 unknown_3; /* 0x0000 04ec */ + } private; +} SAM_ACCOUNT_HANDLE; + +typedef struct sam_group_handle { + TALLOC_CTX *mem_ctx; + uint32 access_granted; + struct sam_methods *current_sam_methods; /* sam_methods creating this handle */ + void (*free_fn)(struct sam_group_handle **); + struct sam_group_data { + char *name; + char *comment; + DOM_SID sid; + int32 flags; /* specifies if the group is a lokal group or a global group */ + uint32 num_members; + PRIVILEGE_SET privileges; + } private; } SAM_GROUP_HANDLE; typedef struct sam_group_member { DOM_SID sid; - BOOL group; /* specifies if it is a group or a user */ + BOOL group; /* specifies if it is a group or a account */ } SAM_GROUP_MEMBER; -typedef struct sam_user_enum { +typedef struct sam_account_enum { DOM_SID sid; - char *username; + char *account_name; char *full_name; - char *user_desc; + char *account_desc; uint16 acc_ctrl; -} SAM_USER_ENUM; +} SAM_ACCOUNT_ENUM; typedef struct sam_group_enum { DOM_SID sid; @@ -147,106 +141,106 @@ typedef struct sam_context /* General API */ - NTSTATUS (*sam_get_sec_desc) ( const struct sam_context *, const NT_USER_TOKEN *access_token, const DOM_SID *sid, SEC_DESC **sd); - NTSTATUS (*sam_set_sec_desc) ( const struct sam_context *, const NT_USER_TOKEN *access_token, const DOM_SID *sid, const SEC_DESC *sd); + NTSTATUS (*sam_get_sec_desc) (const struct sam_context *, const NT_USER_TOKEN *access_token, const DOM_SID *sid, SEC_DESC **sd); + NTSTATUS (*sam_set_sec_desc) (const struct sam_context *, const NT_USER_TOKEN *access_token, const DOM_SID *sid, const SEC_DESC *sd); - NTSTATUS (*sam_lookup_sid) ( const struct sam_context *, const NT_USER_TOKEN *access_token, const DOM_SID *sid, char **name, uint32 *type); - NTSTATUS (*sam_lookup_name) ( const struct sam_context *, const NT_USER_TOKEN *access_token, const char *domain, const char *name, DOM_SID **sid, uint32 *type); + NTSTATUS (*sam_lookup_sid) (const struct sam_context *, const NT_USER_TOKEN *access_token, const DOM_SID *sid, char **name, uint32 *type); + NTSTATUS (*sam_lookup_name) (const struct sam_context *, const NT_USER_TOKEN *access_token, const char *domain, const char *name, DOM_SID **sid, uint32 *type); /* Domain API */ - NTSTATUS (*sam_update_domain) ( const struct sam_context *, SAM_DOMAIN_HANDLE *domain); + NTSTATUS (*sam_update_domain) (const struct sam_context *, const SAM_DOMAIN_HANDLE *domain); - NTSTATUS (*sam_enum_domains) ( const struct sam_context *, const NT_USER_TOKEN *access_token, int32 *domain_count, DOM_SID **domains, char **domain_names); - NTSTATUS (*sam_lookup_domain) ( const struct sam_context *, const NT_USER_TOKEN * access_token, const char *domain, DOM_SID **domainsid); + NTSTATUS (*sam_enum_domains) (const struct sam_context *, const NT_USER_TOKEN *access_token, int32 *domain_count, DOM_SID **domains, char **domain_names); + NTSTATUS (*sam_lookup_domain) (const struct sam_context *, const NT_USER_TOKEN * access_token, const char *domain, DOM_SID **domainsid); - NTSTATUS (*sam_get_domain_by_sid) ( const struct sam_context *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const DOM_SID *domainsid, SAM_DOMAIN_HANDLE **domain); + NTSTATUS (*sam_get_domain_by_sid) (const struct sam_context *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const DOM_SID *domainsid, SAM_DOMAIN_HANDLE **domain); - /* User API */ + /* Account API */ - NTSTATUS (*sam_create_user) ( const struct sam_context *context, const NT_USER_TOKEN *access_token, const uint32 access_desired, DOM_SID *domainsid, SAM_USER_HANDLE **user); - NTSTATUS (*sam_add_user) ( const struct sam_context *, DOM_SID *domainsid, SAM_USER_HANDLE *user); - NTSTATUS (*sam_update_user) ( const struct sam_context *, SAM_USER_HANDLE *user); - NTSTATUS (*sam_delete_user) ( const struct sam_context *, SAM_USER_HANDLE * user); - NTSTATUS (*sam_enum_users) ( const struct sam_context *, const NT_USER_TOKEN *access_token, const DOM_SID *domain, int32 *user_count, SAM_USER_ENUM **users); + NTSTATUS (*sam_create_account) (const struct sam_context *context, const NT_USER_TOKEN *access_token, const uint32 access_desired, const DOM_SID *domainsid, SAM_ACCOUNT_HANDLE **account); + NTSTATUS (*sam_add_account) (const struct sam_context *, const DOM_SID *domainsid, const SAM_ACCOUNT_HANDLE *account); + NTSTATUS (*sam_update_account) (const struct sam_context *, const SAM_ACCOUNT_HANDLE *account); + NTSTATUS (*sam_delete_account) (const struct sam_context *, const SAM_ACCOUNT_HANDLE *account); + NTSTATUS (*sam_enum_accounts) (const struct sam_context *, const NT_USER_TOKEN *access_token, const DOM_SID *domain, int32 *account_count, SAM_ACCOUNT_ENUM **accounts); - NTSTATUS (*sam_get_user_by_sid) ( const struct sam_context *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const DOM_SID *usersid, SAM_USER_HANDLE **user); - NTSTATUS (*sam_get_user_by_name) ( const struct sam_context *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const char *domain, const char *name, SAM_USER_HANDLE **user); + NTSTATUS (*sam_get_account_by_sid) (const struct sam_context *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const DOM_SID *accountsid, SAM_ACCOUNT_HANDLE **account); + NTSTATUS (*sam_get_account_by_name) (const struct sam_context *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const char *domain, const char *name, SAM_ACCOUNT_HANDLE **account); /* Group API */ - NTSTATUS (*sam_add_group) ( const struct sam_context *, DOM_SID *domainsid, SAM_GROUP_HANDLE *samgroup); - NTSTATUS (*sam_update_group) ( const struct sam_context *, SAM_GROUP_HANDLE *samgroup); - NTSTATUS (*sam_delete_group) ( const struct sam_context *, SAM_GROUP_HANDLE *groupsid); - NTSTATUS (*sam_enum_groups) ( const struct sam_context *, const NT_USER_TOKEN *access_token, const DOM_SID *domainsid, const uint32 type, uint32 *groups_count, SAM_GROUP_ENUM **groups); - NTSTATUS (*sam_get_group_by_sid) ( const struct sam_context *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const DOM_SID *groupsid, SAM_GROUP_HANDLE **group); - NTSTATUS (*sam_get_group_by_name) ( const struct sam_context *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const char *domain, const char *name, SAM_GROUP_HANDLE **group); + NTSTATUS (*sam_add_group) (const struct sam_context *, const DOM_SID *domainsid, const SAM_GROUP_HANDLE *group); + NTSTATUS (*sam_update_group) (const struct sam_context *, const SAM_GROUP_HANDLE *group); + NTSTATUS (*sam_delete_group) (const struct sam_context *, const SAM_GROUP_HANDLE *group); + NTSTATUS (*sam_enum_groups) (const struct sam_context *, const NT_USER_TOKEN *access_token, const DOM_SID *domainsid, const uint32 type, uint32 *groups_count, SAM_GROUP_ENUM **groups); + NTSTATUS (*sam_get_group_by_sid) (const struct sam_context *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const DOM_SID *groupsid, SAM_GROUP_HANDLE **group); + NTSTATUS (*sam_get_group_by_name) (const struct sam_context *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const char *domain, const char *name, SAM_GROUP_HANDLE **group); - NTSTATUS (*sam_add_member_to_group) ( const struct sam_context *, SAM_GROUP_HANDLE *group, SAM_GROUP_MEMBER *member); - NTSTATUS (*sam_delete_member_from_group) ( const struct sam_context *, SAM_GROUP_HANDLE *group, SAM_GROUP_MEMBER *member); - NTSTATUS (*sam_enum_groupmembers) ( const struct sam_context *, SAM_GROUP_HANDLE *group, uint32 *members_count, SAM_GROUP_MEMBER **members); + NTSTATUS (*sam_add_member_to_group) (const struct sam_context *, const SAM_GROUP_HANDLE *group, const SAM_GROUP_MEMBER *member); + NTSTATUS (*sam_delete_member_from_group) (const struct sam_context *, const SAM_GROUP_HANDLE *group, const SAM_GROUP_MEMBER *member); + NTSTATUS (*sam_enum_groupmembers) (const struct sam_context *, const SAM_GROUP_HANDLE *group, uint32 *members_count, SAM_GROUP_MEMBER **members); - NTSTATUS (*sam_get_groups_of_user) ( const struct sam_context *, SAM_USER_HANDLE *user, const uint32 type, uint32 *group_count, SAM_GROUP_ENUM **groups); + NTSTATUS (*sam_get_groups_of_account) (const struct sam_context *, const SAM_ACCOUNT_HANDLE *account, const uint32 type, uint32 *group_count, SAM_GROUP_ENUM **groups); void (*free_fn)(struct sam_context **); } SAM_CONTEXT; typedef struct sam_methods { - struct sam_context *parent; - struct sam_methods *next; - struct sam_methods *prev; + struct sam_context *parent; + struct sam_methods *next; + struct sam_methods *prev; const char *backendname; - struct sam_domain *domain; + struct sam_domain_handle *domain; void *private_data; /* General API */ - NTSTATUS (*sam_get_sec_desc) ( const struct sam_methods *, const NT_USER_TOKEN *access_token, const DOM_SID *sid, SEC_DESC **sd); - NTSTATUS (*sam_set_sec_desc) ( const struct sam_methods *, const NT_USER_TOKEN *access_token, const DOM_SID *sid, const SEC_DESC *sd); + NTSTATUS (*sam_get_sec_desc) (const struct sam_methods *, const NT_USER_TOKEN *access_token, const DOM_SID *sid, SEC_DESC **sd); + NTSTATUS (*sam_set_sec_desc) (const struct sam_methods *, const NT_USER_TOKEN *access_token, const DOM_SID *sid, const SEC_DESC *sd); - NTSTATUS (*sam_lookup_sid) ( const struct sam_methods *, const NT_USER_TOKEN *access_token, const DOM_SID *sid, char **name, uint32 *type); - NTSTATUS (*sam_lookup_name) ( const struct sam_methods *, const NT_USER_TOKEN *access_token, const char *name, DOM_SID **sid, uint32 *type); + NTSTATUS (*sam_lookup_sid) (const struct sam_methods *, const NT_USER_TOKEN *access_token, const DOM_SID *sid, char **name, uint32 *type); + NTSTATUS (*sam_lookup_name) (const struct sam_methods *, const NT_USER_TOKEN *access_token, const char *name, DOM_SID **sid, uint32 *type); /* Domain API */ - NTSTATUS (*sam_update_domain) ( const struct sam_methods *, SAM_DOMAIN_HANDLE *domain); + NTSTATUS (*sam_update_domain) (const struct sam_methods *, const SAM_DOMAIN_HANDLE *domain); NTSTATUS (*sam_get_domain_handle) (const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, SAM_DOMAIN_HANDLE **domain); - /* User API */ + /* Account API */ - NTSTATUS (*sam_create_user) ( const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, SAM_USER_HANDLE **user); - NTSTATUS (*sam_add_user) ( const struct sam_methods *, const SAM_USER_HANDLE *user); - NTSTATUS (*sam_update_user) ( const struct sam_methods *, const SAM_USER_HANDLE *user); - NTSTATUS (*sam_delete_user) ( const struct sam_methods *, const SAM_USER_HANDLE *user); - NTSTATUS (*sam_enum_users) ( const struct sam_methods *, const NT_USER_TOKEN *access_token, int32 *user_count, SAM_USER_ENUM **users); + NTSTATUS (*sam_create_account) (const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, SAM_ACCOUNT_HANDLE **account); + NTSTATUS (*sam_add_account) (const struct sam_methods *, const SAM_ACCOUNT_HANDLE *account); + NTSTATUS (*sam_update_account) (const struct sam_methods *, const SAM_ACCOUNT_HANDLE *account); + NTSTATUS (*sam_delete_account) (const struct sam_methods *, const SAM_ACCOUNT_HANDLE *account); + NTSTATUS (*sam_enum_accounts) (const struct sam_methods *, const NT_USER_TOKEN *access_token, int32 *account_count, SAM_ACCOUNT_ENUM **accounts); - NTSTATUS (*sam_get_user_by_sid) ( const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const DOM_SID *usersid, SAM_USER_HANDLE **user); - NTSTATUS (*sam_get_user_by_name) ( const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const char *name, SAM_USER_HANDLE **user); + NTSTATUS (*sam_get_account_by_sid) (const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const DOM_SID *accountsid, SAM_ACCOUNT_HANDLE **account); + NTSTATUS (*sam_get_account_by_name) (const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const char *name, SAM_ACCOUNT_HANDLE **account); /* Group API */ - NTSTATUS (*sam_create_group) ( const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const uint32 type, SAM_GROUP_HANDLE **group); - NTSTATUS (*sam_add_group) ( const struct sam_methods *, SAM_GROUP_HANDLE *samgroup); - NTSTATUS (*sam_update_group) ( const struct sam_methods *, SAM_GROUP_HANDLE *samgroup); - NTSTATUS (*sam_delete_group) ( const struct sam_methods *, SAM_GROUP_HANDLE *groupsid); - NTSTATUS (*sam_enum_groups) ( const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 type, uint32 *groups_count, SAM_GROUP_ENUM **groups); - NTSTATUS (*sam_get_group_by_sid) ( const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const DOM_SID *groupsid, SAM_GROUP_HANDLE **group); - NTSTATUS (*sam_get_group_by_name) ( const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const char *name, SAM_GROUP_HANDLE **group); + NTSTATUS (*sam_create_group) (const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const uint32 type, SAM_GROUP_HANDLE **group); + NTSTATUS (*sam_add_group) (const struct sam_methods *, const SAM_GROUP_HANDLE *group); + NTSTATUS (*sam_update_group) (const struct sam_methods *, const SAM_GROUP_HANDLE *group); + NTSTATUS (*sam_delete_group) (const struct sam_methods *, const SAM_GROUP_HANDLE *group); + NTSTATUS (*sam_enum_groups) (const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 type, uint32 *groups_count, SAM_GROUP_ENUM **groups); + NTSTATUS (*sam_get_group_by_sid) (const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const DOM_SID *groupsid, SAM_GROUP_HANDLE **group); + NTSTATUS (*sam_get_group_by_name) (const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const char *name, SAM_GROUP_HANDLE **group); - NTSTATUS (*sam_add_member_to_group) ( const struct sam_methods *, SAM_GROUP_HANDLE *group, const SAM_GROUP_MEMBER *member); - NTSTATUS (*sam_delete_member_from_group) ( const struct sam_methods *, SAM_GROUP_HANDLE *group, const SAM_GROUP_MEMBER *member); - NTSTATUS (*sam_enum_groupmembers) ( const struct sam_methods *, SAM_GROUP_HANDLE *group, uint32 *members_count, SAM_GROUP_MEMBER **members); + NTSTATUS (*sam_add_member_to_group) (const struct sam_methods *, const SAM_GROUP_HANDLE *group, const SAM_GROUP_MEMBER *member); + NTSTATUS (*sam_delete_member_from_group) (const struct sam_methods *, const SAM_GROUP_HANDLE *group, const SAM_GROUP_MEMBER *member); + NTSTATUS (*sam_enum_groupmembers) (const struct sam_methods *, const SAM_GROUP_HANDLE *group, uint32 *members_count, SAM_GROUP_MEMBER **members); - NTSTATUS (*sam_get_groups_of_user) ( const struct sam_methods *, SAM_USER_HANDLE *user, const uint32 type, uint32 *group_count, SAM_GROUP_ENUM **groups); + NTSTATUS (*sam_get_groups_of_account) (const struct sam_methods *, const SAM_ACCOUNT_HANDLE *account, const uint32 type, uint32 *group_count, SAM_GROUP_ENUM **groups); void (*free_private_data)(void **); } SAM_METHODS; -typedef NTSTATUS (*sam_init_function)( const struct sam_context *, struct sam_methods **, const char *); +typedef NTSTATUS (*sam_init_function)(const SAM_CONTEXT *, SAM_METHODS **, const char *); struct sam_init_function_entry { char *name; -- cgit From dcd029169424d8846c1fbb0b1527516a4a026b27 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 30 Aug 2002 06:59:57 +0000 Subject: convert the LDAP/SASL code to use GSS-SPNEGO if possible we now do this: - look for suported SASL mechanisms on the LDAP server - choose GSS-SPNEGO if possible - within GSS-SPNEGO choose KRB5 if we can do a kinit - otherwise use NTLMSSP This change also means that we no longer rely on having a gssapi library to do ADS. todo: - add TLS/SSL support over LDAP - change to using LDAP/SSL for password change in ADS (This used to be commit b04e91f660d3b26d23044075d4a7e707eb41462d) --- source3/include/includes.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index f1c8c50df4..544487f273 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -410,18 +410,14 @@ #if HAVE_GSSAPI_GSSAPI_H #include -#else -#undef HAVE_KRB5 #endif #if HAVE_GSSAPI_GSSAPI_GENERIC_H #include -#else -#undef HAVE_KRB5 #endif /* we support ADS if we have krb5 and ldap libs */ -#if defined(HAVE_KRB5) && defined(HAVE_LDAP) && defined(HAVE_GSSAPI) +#if defined(HAVE_KRB5) && defined(HAVE_LDAP) #define HAVE_ADS #endif -- cgit From 618b02416dbfce79ef271d82790f5385dcfd609f Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 2 Sep 2002 09:02:40 +0000 Subject: small typo, kai is german :-) (This used to be commit f435bf0095694a283db47e33c9eb1b5b6df13d03) --- source3/include/sam.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/sam.h b/source3/include/sam.h index a2d980c2e3..1fca8ec4f6 100644 --- a/source3/include/sam.h +++ b/source3/include/sam.h @@ -107,7 +107,7 @@ typedef struct sam_group_handle { char *name; char *comment; DOM_SID sid; - int32 flags; /* specifies if the group is a lokal group or a global group */ + int32 flags; /* specifies if the group is a local group or a global group */ uint32 num_members; PRIVILEGE_SET privileges; } private; -- cgit From f02b14f7c61496950178e4c8a41d9c68c983d51d Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Tue, 3 Sep 2002 03:20:21 +0000 Subject: Change JOB_INFO_CTR to return a pointer to an array rather than array of pointers. (This used to be commit e9b71b354d923b2cd0f028dd197e7ca81339ec3a) --- source3/include/rpc_spoolss.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/rpc_spoolss.h b/source3/include/rpc_spoolss.h index b7acf44c5d..456825a5f5 100755 --- a/source3/include/rpc_spoolss.h +++ b/source3/include/rpc_spoolss.h @@ -1240,8 +1240,8 @@ typedef struct job_info_ctr_info { union { - JOB_INFO_1 **job_info_1; - JOB_INFO_2 **job_info_2; + JOB_INFO_1 *job_info_1; + JOB_INFO_2 *job_info_2; void *info; } job; -- cgit From a1aafce4dc69b4bc4967ce9b70550ee3ecfab43b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 4 Sep 2002 19:13:06 +0000 Subject: Add bcast_msg_flags to connection struct. Allows sender to filter when sending broadcast messages. Also initial cut-down of printing notify messages (not yet finished). Jeremy. (This used to be commit aca333719695b278843c59e1c6eb07d6655fd59c) --- source3/include/local.h | 4 ---- source3/include/messages.h | 8 ++++++++ source3/include/smb.h | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index 15231e92ee..5096e13fc3 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -67,10 +67,6 @@ #define MAX_OPEN_FILES 10000 #endif -/* the max number of simultanous connections to the server by all clients */ -/* zero means no limit. */ -#define MAXSTATUS 0 - #define WORDMAX 0xFFFF /* the maximum password length before we declare a likely attack */ diff --git a/source3/include/messages.h b/source3/include/messages.h index 58e606b40f..0e995039ff 100644 --- a/source3/include/messages.h +++ b/source3/include/messages.h @@ -59,4 +59,12 @@ #define MSG_SMB_SAM_SYNC 3003 #define MSG_SMB_SAM_REPL 3004 +/* Flags to classify messages - used in message_send_all() */ +/* Sender will filter by flag. */ + +#define FLAG_MSG_GENERAL 0x0001 +#define FLAG_MSG_SMBD 0x0002 +#define FLAG_MSG_NMBD 0x0004 +#define FLAG_MSG_PRINTING 0x0008 + #endif diff --git a/source3/include/smb.h b/source3/include/smb.h index f2eb37096c..909c1a57ec 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -718,6 +718,7 @@ struct connections_data { char addr[24]; char machine[FSTRING_LEN]; time_t start; + uint32 bcast_msg_flags; }; -- cgit From 2658e4ee23600e49a4231bc2b40c20a571c3f826 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 4 Sep 2002 23:40:49 +0000 Subject: Added better error code on out of space. Removed total jobs check - not applicable any more. Jeremy. (This used to be commit 8828e2ea3c668aab6cda1b4be9a7e4ce1c23ca81) --- source3/include/doserr.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'source3/include') diff --git a/source3/include/doserr.h b/source3/include/doserr.h index 135d799596..93936463e6 100644 --- a/source3/include/doserr.h +++ b/source3/include/doserr.h @@ -148,17 +148,20 @@ /* these are win32 error codes. There are only a few places where these matter for Samba, primarily in the NT printing code */ #define WERR_OK W_ERROR(0) +#define WERR_BADFUNC W_ERROR(1) #define WERR_BADFILE W_ERROR(2) #define WERR_ACCESS_DENIED W_ERROR(5) #define WERR_BADFID W_ERROR(6) -#define WERR_BADFUNC W_ERROR(1) -#define WERR_INSUFFICIENT_BUFFER W_ERROR(122) +#define WERR_NOMEM W_ERROR(8) +#define WERR_GENERAL_FAILURE W_ERROR(31) +#define WERR_NOT_SUPPORTED W_ERROR(50) +#define WERR_PRINTQ_FULL W_ERROR(61) +#define WERR_NO_SPOOL_SPACE W_ERROR(62) #define WERR_NO_SUCH_SHARE W_ERROR(67) #define WERR_ALREADY_EXISTS W_ERROR(80) -#define WERR_INVALID_PARAM W_ERROR(87) -#define WERR_NOT_SUPPORTED W_ERROR(50) #define WERR_BAD_PASSWORD W_ERROR(86) -#define WERR_NOMEM W_ERROR(8) +#define WERR_INVALID_PARAM W_ERROR(87) +#define WERR_INSUFFICIENT_BUFFER W_ERROR(122) #define WERR_INVALID_NAME W_ERROR(123) #define WERR_UNKNOWN_LEVEL W_ERROR(124) #define WERR_OBJECT_PATH_INVALID W_ERROR(161) -- cgit From ce2ac33b736324b818b0dd23be70bb23448320d5 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 5 Sep 2002 15:47:22 +0000 Subject: Move the fancy NT_STATUS macros to a new file, so we can include them earlier in includes.h Andrew Bartlett (This used to be commit ed184ed1905b49956528b6835f48a69ba3c1a045) --- source3/include/includes.h | 1 + source3/include/nt_status.h | 62 +++++++++++++++++++++++++++++++++++++++++++++ source3/include/smb.h | 38 --------------------------- 3 files changed, 63 insertions(+), 38 deletions(-) create mode 100644 source3/include/nt_status.h (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 544487f273..b07b0c3649 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -702,6 +702,7 @@ extern int errno; #include "../tdb/spinlock.h" #include "../tdb/tdbutil.h" #include "talloc.h" +#include "nt_status.h" #include "ads.h" #include "interfaces.h" #include "hash.h" diff --git a/source3/include/nt_status.h b/source3/include/nt_status.h new file mode 100644 index 0000000000..1c80c5ecde --- /dev/null +++ b/source3/include/nt_status.h @@ -0,0 +1,62 @@ +/* + Unix SMB/CIFS implementation. + SMB parameters and setup, plus a whole lot more. + + Copyright (C) Andrew Tridgell 2001 + + 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. +*/ + +#ifndef _NT_STATUS_H +#define _NT_STATUS_H + +/* The Splint code analysis tool doesn't like immediate structures. */ + +#ifdef _SPLINT_ /* http://www.splint.org */ +#undef HAVE_IMMEDIATE_STRUCTURES +#endif + +/* the following rather strange looking definitions of NTSTATUS and WERROR + and there in order to catch common coding errors where different error types + are mixed up. This is especially important as we slowly convert Samba + from using BOOL for internal functions +*/ + +#if defined(HAVE_IMMEDIATE_STRUCTURES) +typedef struct {uint32 v;} NTSTATUS; +#define NT_STATUS(x) ((NTSTATUS) { x }) +#define NT_STATUS_V(x) ((x).v) +#else +typedef uint32 NTSTATUS; +#define NT_STATUS(x) (x) +#define NT_STATUS_V(x) (x) +#endif + +#if defined(HAVE_IMMEDIATE_STRUCTURES) +typedef struct {uint32 v;} WERROR; +#define W_ERROR(x) ((WERROR) { x }) +#define W_ERROR_V(x) ((x).v) +#else +typedef uint32 WERROR; +#define W_ERROR(x) (x) +#define W_ERROR_V(x) (x) +#endif + +#define NT_STATUS_IS_OK(x) (NT_STATUS_V(x) == 0) +#define NT_STATUS_IS_ERR(x) ((NT_STATUS_V(x) & 0xc0000000) == 0xc0000000) +#define NT_STATUS_EQUAL(x,y) (NT_STATUS_V(x) == NT_STATUS_V(y)) +#define W_ERROR_IS_OK(x) (W_ERROR_V(x) == 0) + +#endif diff --git a/source3/include/smb.h b/source3/include/smb.h index 909c1a57ec..2ee2f0cb72 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -193,44 +193,6 @@ typedef struct nttime_info } NTTIME; -/* The Splint code analysis tool doesn't like immediate structures. */ - -#ifdef _SPLINT_ /* http://www.splint.org */ -#undef HAVE_IMMEDIATE_STRUCTURES -#endif - -/* the following rather strange looking definitions of NTSTATUS and WERROR - and there in order to catch common coding errors where different error types - are mixed up. This is especially important as we slowly convert Samba - from using BOOL for internal functions -*/ - -#if defined(HAVE_IMMEDIATE_STRUCTURES) -typedef struct {uint32 v;} NTSTATUS; -#define NT_STATUS(x) ((NTSTATUS) { x }) -#define NT_STATUS_V(x) ((x).v) -#else -typedef uint32 NTSTATUS; -#define NT_STATUS(x) (x) -#define NT_STATUS_V(x) (x) -#endif - -#if defined(HAVE_IMMEDIATE_STRUCTURES) -typedef struct {uint32 v;} WERROR; -#define W_ERROR(x) ((WERROR) { x }) -#define W_ERROR_V(x) ((x).v) -#else -typedef uint32 WERROR; -#define W_ERROR(x) (x) -#define W_ERROR_V(x) (x) -#endif - -#define NT_STATUS_IS_OK(x) (NT_STATUS_V(x) == 0) -#define NT_STATUS_IS_ERR(x) ((NT_STATUS_V(x) & 0xc0000000) == 0xc0000000) -#define NT_STATUS_EQUAL(x,y) (NT_STATUS_V(x) == NT_STATUS_V(y)) -#define W_ERROR_IS_OK(x) (W_ERROR_V(x) == 0) - - /* Allowable account control bits */ #define ACB_DISABLED 0x0001 /* 1 = User account disabled */ #define ACB_HOMDIRREQ 0x0002 /* 1 = Home directory required */ -- cgit From 69b9cbf32744d4cb5327c8baca1308a48ae96b22 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 6 Sep 2002 10:00:24 +0000 Subject: Detect and use syslog.h or sys/syslog.h corretly. Fixes lack of prototype for syslog() since Paul Green's POSIX patch. (This used to be commit d3b29b0b2d2ffd5c050900ff8cae441b91f95526) --- source3/include/config.h.in | 8 +++++++- source3/include/includes.h | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 70c0ae2f3c..7945e49c79 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -1,4 +1,4 @@ -/* include/config.h.in. Generated automatically from configure.in by autoheader 2.13. */ +/* include/config.h.in. Generated automatically from configure.in by autoheader. */ /* Define if on AIX 3. System headers sometimes define this. @@ -1090,6 +1090,9 @@ /* Define if you have the header file. */ #undef HAVE_SYS_SYSCALL_H +/* Define if you have the header file. */ +#undef HAVE_SYS_SYSLOG_H + /* Define if you have the header file. */ #undef HAVE_SYS_TERMIO_H @@ -1108,6 +1111,9 @@ /* Define if you have the header file. */ #undef HAVE_SYSCALL_H +/* Define if you have the header file. */ +#undef HAVE_SYSLOG_H + /* Define if you have the header file. */ #undef HAVE_TERMIO_H diff --git a/source3/include/includes.h b/source3/include/includes.h index b07b0c3649..945ec2cbd7 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -217,8 +217,12 @@ #include #include -#ifdef WITH_SYSLOG +#ifdef HAVE_SYSLOG_H #include +#else +#ifdef HAVE_SYS_SYSLOG_H +#include +#endif #endif #include -- cgit From eec38ee3bb4bceeaa82abf8df1cce92b6a5781ce Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 6 Sep 2002 11:46:59 +0000 Subject: Patch from "Stefan (metze) Metzmacher" to extend the ADS_STATUS system to include NTSTATUS, and to provide a better general infrustructure for his sam_ads work. I've also added some extra failure mode DEBUG()s to parts of the code. NOTE: The ADS_ERR_OK() macro is rather sensitive to braketing issues - without the final set of brakets, the test is essentially inverted - causing some intersting 'error = success' messages... Andrew Bartlett (This used to be commit 5b9a7ab901bc311f3ad08462a8a68d133c34a8b4) --- source3/include/ads.h | 124 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 103 insertions(+), 21 deletions(-) (limited to 'source3/include') diff --git a/source3/include/ads.h b/source3/include/ads.h index 7504a369b4..6106eb6b40 100644 --- a/source3/include/ads.h +++ b/source3/include/ads.h @@ -92,11 +92,14 @@ typedef struct { /* there are 4 possible types of errors the ads subsystem can produce */ enum ads_error_type {ADS_ERROR_KRB5, ADS_ERROR_GSS, - ADS_ERROR_LDAP, ADS_ERROR_SYSTEM}; + ADS_ERROR_LDAP, ADS_ERROR_SYSTEM, ADS_ERROR_NT}; typedef struct { enum ads_error_type error_type; - int rc; + union err_state{ + int rc; + NTSTATUS nt_status; + } err; /* For error_type = ADS_ERROR_GSS minor_status describe GSS API error */ /* Where rc represents major_status of GSS API error */ int minor_status; @@ -109,12 +112,14 @@ typedef void **ADS_MODLIST; #endif /* macros to simplify error returning */ -#define ADS_ERROR(rc) ads_build_error(ADS_ERROR_LDAP, rc, 0) +#define ADS_ERROR(rc) ADS_ERROR_LDAP(rc) +#define ADS_ERROR_LDAP(rc) ads_build_error(ADS_ERROR_LDAP, rc, 0) #define ADS_ERROR_SYSTEM(rc) ads_build_error(ADS_ERROR_SYSTEM, rc?rc:EINVAL, 0) #define ADS_ERROR_KRB5(rc) ads_build_error(ADS_ERROR_KRB5, rc, 0) #define ADS_ERROR_GSS(rc, minor) ads_build_error(ADS_ERROR_GSS, rc, minor) +#define ADS_ERROR_NT(rc) ads_build_nt_error(ADS_ERROR_NT,rc) -#define ADS_ERR_OK(status) ((status).rc == 0) +#define ADS_ERR_OK(status) ((status.error_type == ADS_ERROR_NT) ? NT_STATUS_IS_OK(status.err.nt_status):(status.err.rc == 0)) #define ADS_SUCCESS ADS_ERROR(0) /* time between reconnect attempts */ @@ -128,23 +133,100 @@ typedef void **ADS_MODLIST; #define ADS_NO_REFERRALS_OID "1.2.840.113556.1.4.1339" #define ADS_SERVER_SORT_OID "1.2.840.113556.1.4.473" -#define UF_DONT_EXPIRE_PASSWD 0x10000 -#define UF_MNS_LOGON_ACCOUNT 0x20000 -#define UF_SMARTCARD_REQUIRED 0x40000 -#define UF_TRUSTED_FOR_DELEGATION 0x80000 -#define UF_NOT_DELEGATED 0x100000 -#define UF_USE_DES_KEY_ONLY 0x200000 -#define UF_DONT_REQUIRE_PREAUTH 0x400000 - -#define UF_TEMP_DUPLICATE_ACCOUNT 0x0100 -#define UF_NORMAL_ACCOUNT 0x0200 -#define UF_INTERDOMAIN_TRUST_ACCOUNT 0x0800 -#define UF_WORKSTATION_TRUST_ACCOUNT 0x1000 -#define UF_SERVER_TRUST_ACCOUNT 0x2000 - -/* account types */ -#define ATYPE_GROUP 0x10000000 -#define ATYPE_USER 0x30000000 +/* UserFlags for userAccountControl */ +#define UF_SCRIPT 0x00000001 +#define UF_ACCOUNTDISABLE 0x00000002 +#define UF_UNUSED_1 0x00000004 +#define UF_HOMEDIR_REQUIRED 0x00000008 + +#define UF_LOCKOUT 0x00000010 +#define UF_PASSWD_NOTREQD 0x00000020 +#define UF_PASSWD_CANT_CHANGE 0x00000040 +#define UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED 0x00000080 + +#define UF_TEMP_DUPLICATE_ACCOUNT 0x00000100 +#define UF_NORMAL_ACCOUNT 0x00000200 +#define UF_UNUSED_2 0x00000400 +#define UF_INTERDOMAIN_TRUST_ACCOUNT 0x00000800 + +#define UF_WORKSTATION_TRUST_ACCOUNT 0x00001000 +#define UF_SERVER_TRUST_ACCOUNT 0x00002000 +#define UF_UNUSED_3 0x00004000 +#define UF_UNUSED_4 0x00008000 + +#define UF_DONT_EXPIRE_PASSWD 0x00010000 +#define UF_MNS_LOGON_ACCOUNT 0x00020000 +#define UF_SMARTCARD_REQUIRED 0x00040000 +#define UF_TRUSTED_FOR_DELEGATION 0x00080000 + +#define UF_NOT_DELEGATED 0x00100000 +#define UF_USE_DES_KEY_ONLY 0x00200000 +#define UF_DONT_REQUIRE_PREAUTH 0x00400000 +#define UF_UNUSED_5 0x00800000 + +#define UF_UNUSED_6 0x01000000 +#define UF_UNUSED_7 0x02000000 +#define UF_UNUSED_8 0x04000000 +#define UF_UNUSED_9 0x08000000 + +#define UF_UNUSED_10 0x10000000 +#define UF_UNUSED_11 0x20000000 +#define UF_UNUSED_12 0x40000000 +#define UF_UNUSED_13 0x80000000 + +#define UF_MACHINE_ACCOUNT_MASK (\ + UF_INTERDOMAIN_TRUST_ACCOUNT |\ + UF_WORKSTATION_TRUST_ACCOUNT |\ + UF_SERVER_TRUST_ACCOUNT \ + ) + +#define UF_ACCOUNT_TYPE_MASK (\ + UF_TEMP_DUPLICATE_ACCOUNT |\ + UF_NORMAL_ACCOUNT |\ + UF_INTERDOMAIN_TRUST_ACCOUNT |\ + UF_WORKSTATION_TRUST_ACCOUNT |\ + UF_SERVER_TRUST_ACCOUNT \ + ) + +#define UF_SETTABLE_BITS (\ + UF_SCRIPT |\ + UF_ACCOUNTDISABLE |\ + UF_HOMEDIR_REQUIRED |\ + UF_LOCKOUT |\ + UF_PASSWD_NOTREQD |\ + UF_PASSWD_CANT_CHANGE |\ + UF_ACCOUNT_TYPE_MASK | \ + UF_DONT_EXPIRE_PASSWD | \ + UF_MNS_LOGON_ACCOUNT |\ + UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED |\ + UF_SMARTCARD_REQUIRED |\ + UF_TRUSTED_FOR_DELEGATION |\ + UF_NOT_DELEGATED |\ + UF_USE_DES_KEY_ONLY |\ + UF_DONT_REQUIRE_PREAUTH \ + ) + +/* sAMAccountType */ +#define ATYPE_NORMAL_ACCOUNT 0x30000000 /* 805306368 */ +#define ATYPE_WORKSTATION_TRUST 0x30000001 /* 805306369 */ +#define ATYPE_INTERDOMAIN_TRUST 0x30000002 /* 805306370 */ +#define ATYPE_SECURITY_GLOBAL_GROUP 0x10000000 /* 268435456 */ +#define ATYPE_DISTRIBUTION_GLOBAL_GROUP 0x10000001 /* 268435457 */ +#define ATYPE_DISTRIBUTION_UNIVERSAL_GROUP AT_DISTRIBUTION_GLOBAL_GROUP +#define ATYPE_SECURITY_LOCAL_GROUP 0x20000000 /* 536870912 */ +#define ATYPE_DISTRIBUTION_LOCAL_GROUP 0x20000001 /* 536870913 */ + +#define ATYPE_ACCOUNT ATYPE_NORMAL_ACCOUNT /* 0x30000000 805306368 */ +#define ATYPE_GLOBAL_GROUP ATYPE_SECURITY_GLOBAL_GROUP /* 0x10000000 268435456 */ +#define ATYPE_LOCAL_GROUP ATYPE_SECURITY_LOCAL_GROUP /* 0x20000000 536870912 */ + +/* groupType */ +#define GTYPE_SECURITY_BUILTIN_LOCAL_GROUP 0x80000005 /* -2147483643 */ +#define GTYPE_SECURITY_DOMAIN_LOCAL_GROUP 0x80000004 /* -2147483644 */ +#define GTYPE_SECURITY_GLOBAL_GROUP 0x80000002 /* -2147483646 */ +#define GTYPE_DISTRIBUTION_GLOBAL_GROUP 0x00000002 /* 2 */ +#define GTYPE_DISTRIBUTION_DOMAIN_LOCAL_GROUP 0x00000004 /* 4 */ +#define GTYPE_DISTRIBUTION_UNIVERSAL_GROUP 0x00000008 /* 8 */ /* Mailslot or cldap getdcname response flags */ #define ADS_PDC 0x00000001 /* DC is PDC */ -- cgit From 2d881357149c4cec6c109b801cef487ae0955126 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 6 Sep 2002 11:58:18 +0000 Subject: patch from metze: add a 'vfs' debug class (This used to be commit 601b56e04fddd9ddfb9be5b0a625d6d279df7f4c) --- source3/include/debug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/debug.h b/source3/include/debug.h index a926143701..4b0b4b1ac4 100644 --- a/source3/include/debug.h +++ b/source3/include/debug.h @@ -92,7 +92,7 @@ extern int DEBUGLEVEL; #define DBGC_SAM 9 #define DBGC_AUTH 10 #define DBGC_WINBIND 11 - +#define DBGC_VFS 12 /* So you can define DBGC_CLASS before including debug.h */ #ifndef DBGC_CLASS -- cgit From 68defac58da3f927cd8fb1405f3c648b7dec7f82 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 6 Sep 2002 12:57:12 +0000 Subject: This commit includes part of the patch from metze posted to the list, and a few of my own changes. In particular: I've added a SAM_ASSERT macro. This expands to either SMB_ASSERT() (which should help us track down bugs) or a return of NT_STATUS_CHECK_FAIL. Metze's changes are mostly to bring the code into line with current discussions on things like adding users/groups, flags etc. I've adjusted a fair bit of the 'const' in the SAM stuff. Const is currently used only for pointers, not for local variables or non-pointer paramters. The benifits and reasons for extending this further need discussion on samba-technical. Also, some of the 'context' paramters should not be const, to allow backend modules to do fancy caching etc in them. Andrew Bartlett (This used to be commit e13bc432628a6131be082caedc75cd8a3d206e5a) --- source3/include/sam.h | 76 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 30 deletions(-) (limited to 'source3/include') diff --git a/source3/include/sam.h b/source3/include/sam.h index 1fca8ec4f6..53d56a2a80 100644 --- a/source3/include/sam.h +++ b/source3/include/sam.h @@ -25,7 +25,18 @@ #ifndef _SAM_H #define _SAM_H -#define SAM_INTERFACE_VERSION 1 +/* We want to track down bugs early */ +#if 1 +#define SAM_ASSERT(x) SMB_ASSERT(x) +#else +#define SAM_ASSERT(x) while (0) { \ + if (!(x)) return NT_STATUS_FAIL_CHECK;\ + } +#endif + + +/* let it be 0 until we have a stable interface --metze */ +#define SAM_INTERFACE_VERSION 0 /* use this inside a passdb module */ #define SAM_MODULE_VERSIONING_MAGIC \ @@ -104,12 +115,11 @@ typedef struct sam_group_handle { struct sam_methods *current_sam_methods; /* sam_methods creating this handle */ void (*free_fn)(struct sam_group_handle **); struct sam_group_data { - char *name; - char *comment; + char *group_name; + char *group_desc; DOM_SID sid; - int32 flags; /* specifies if the group is a local group or a global group */ + uint16 group_ctrl; /* specifies if the group is a local group or a global group */ uint32 num_members; - PRIVILEGE_SET privileges; } private; } SAM_GROUP_HANDLE; @@ -117,7 +127,6 @@ typedef struct sam_group_handle { typedef struct sam_group_member { DOM_SID sid; BOOL group; /* specifies if it is a group or a account */ - } SAM_GROUP_MEMBER; typedef struct sam_account_enum { @@ -125,15 +134,23 @@ typedef struct sam_account_enum { char *account_name; char *full_name; char *account_desc; - uint16 acc_ctrl; + uint16 acct_ctrl; } SAM_ACCOUNT_ENUM; typedef struct sam_group_enum { DOM_SID sid; - char *groupname; - char *comment; + char *group_name; + char *group_desc; + uint16 group_ctrl; } SAM_GROUP_ENUM; + +/* bits for group_ctrl: to spezify if the group is global group or alias */ +#define GCB_LOCAL_GROUP 0x0001 +#define GCB_ALIAS_GROUP GCB_LOCAL_GROUP +#define GCB_GLOBAL_GROUP 0x0002 + + typedef struct sam_context { struct sam_methods *methods; @@ -155,36 +172,35 @@ typedef struct sam_context NTSTATUS (*sam_enum_domains) (const struct sam_context *, const NT_USER_TOKEN *access_token, int32 *domain_count, DOM_SID **domains, char **domain_names); NTSTATUS (*sam_lookup_domain) (const struct sam_context *, const NT_USER_TOKEN * access_token, const char *domain, DOM_SID **domainsid); - NTSTATUS (*sam_get_domain_by_sid) (const struct sam_context *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const DOM_SID *domainsid, SAM_DOMAIN_HANDLE **domain); + NTSTATUS (*sam_get_domain_by_sid) (const struct sam_context *, const NT_USER_TOKEN *access_token, uint32 access_desired, const DOM_SID *domainsid, SAM_DOMAIN_HANDLE **domain); /* Account API */ - NTSTATUS (*sam_create_account) (const struct sam_context *context, const NT_USER_TOKEN *access_token, const uint32 access_desired, const DOM_SID *domainsid, SAM_ACCOUNT_HANDLE **account); + NTSTATUS (*sam_create_account) (const struct sam_context *context, const NT_USER_TOKEN *access_token, uint32 access_desired, const DOM_SID *domainsid, const char *account_name, uint16 acct_ctrl, SAM_ACCOUNT_HANDLE **account); NTSTATUS (*sam_add_account) (const struct sam_context *, const DOM_SID *domainsid, const SAM_ACCOUNT_HANDLE *account); NTSTATUS (*sam_update_account) (const struct sam_context *, const SAM_ACCOUNT_HANDLE *account); NTSTATUS (*sam_delete_account) (const struct sam_context *, const SAM_ACCOUNT_HANDLE *account); - NTSTATUS (*sam_enum_accounts) (const struct sam_context *, const NT_USER_TOKEN *access_token, const DOM_SID *domain, int32 *account_count, SAM_ACCOUNT_ENUM **accounts); + NTSTATUS (*sam_enum_accounts) (const struct sam_context *, const NT_USER_TOKEN *access_token, const DOM_SID *domain, uint16 acct_ctrl, uint32 *account_count, SAM_ACCOUNT_ENUM **accounts); - NTSTATUS (*sam_get_account_by_sid) (const struct sam_context *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const DOM_SID *accountsid, SAM_ACCOUNT_HANDLE **account); - NTSTATUS (*sam_get_account_by_name) (const struct sam_context *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const char *domain, const char *name, SAM_ACCOUNT_HANDLE **account); + NTSTATUS (*sam_get_account_by_sid) (const struct sam_context *, const NT_USER_TOKEN *access_token, uint32 access_desired, const DOM_SID *accountsid, SAM_ACCOUNT_HANDLE **account); + NTSTATUS (*sam_get_account_by_name) (const struct sam_context *, const NT_USER_TOKEN *access_token, uint32 access_desired, const char *domain, const char *name, SAM_ACCOUNT_HANDLE **account); /* Group API */ - + NTSTATUS (*sam_create_group) (const struct sam_context *, const NT_USER_TOKEN *access_token, uint32 access_desired, const DOM_SID *domainsid, const char *group_name, uint16 group_ctrl, SAM_GROUP_HANDLE **group); NTSTATUS (*sam_add_group) (const struct sam_context *, const DOM_SID *domainsid, const SAM_GROUP_HANDLE *group); NTSTATUS (*sam_update_group) (const struct sam_context *, const SAM_GROUP_HANDLE *group); NTSTATUS (*sam_delete_group) (const struct sam_context *, const SAM_GROUP_HANDLE *group); - NTSTATUS (*sam_enum_groups) (const struct sam_context *, const NT_USER_TOKEN *access_token, const DOM_SID *domainsid, const uint32 type, uint32 *groups_count, SAM_GROUP_ENUM **groups); - NTSTATUS (*sam_get_group_by_sid) (const struct sam_context *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const DOM_SID *groupsid, SAM_GROUP_HANDLE **group); - NTSTATUS (*sam_get_group_by_name) (const struct sam_context *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const char *domain, const char *name, SAM_GROUP_HANDLE **group); + NTSTATUS (*sam_enum_groups) (const struct sam_context *, const NT_USER_TOKEN *access_token, const DOM_SID *domainsid, const uint16 group_ctrl, uint32 *groups_count, SAM_GROUP_ENUM **groups); + NTSTATUS (*sam_get_group_by_sid) (const struct sam_context *, const NT_USER_TOKEN *access_token, uint32 access_desired, const DOM_SID *groupsid, SAM_GROUP_HANDLE **group); + NTSTATUS (*sam_get_group_by_name) (const struct sam_context *, const NT_USER_TOKEN *access_token, uint32 access_desired, const char *domain, const char *name, SAM_GROUP_HANDLE **group); NTSTATUS (*sam_add_member_to_group) (const struct sam_context *, const SAM_GROUP_HANDLE *group, const SAM_GROUP_MEMBER *member); NTSTATUS (*sam_delete_member_from_group) (const struct sam_context *, const SAM_GROUP_HANDLE *group, const SAM_GROUP_MEMBER *member); NTSTATUS (*sam_enum_groupmembers) (const struct sam_context *, const SAM_GROUP_HANDLE *group, uint32 *members_count, SAM_GROUP_MEMBER **members); - NTSTATUS (*sam_get_groups_of_account) (const struct sam_context *, const SAM_ACCOUNT_HANDLE *account, const uint32 type, uint32 *group_count, SAM_GROUP_ENUM **groups); - + NTSTATUS (*sam_get_groups_of_sid) (const struct sam_context *, const NT_USER_TOKEN *access_token, const DOM_SID **sids, uint16 group_ctrl, uint32 *group_count, SAM_GROUP_ENUM **groups); void (*free_fn)(struct sam_context **); } SAM_CONTEXT; @@ -208,34 +224,34 @@ typedef struct sam_methods /* Domain API */ NTSTATUS (*sam_update_domain) (const struct sam_methods *, const SAM_DOMAIN_HANDLE *domain); - NTSTATUS (*sam_get_domain_handle) (const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, SAM_DOMAIN_HANDLE **domain); + NTSTATUS (*sam_get_domain_handle) (const struct sam_methods *, const NT_USER_TOKEN *access_token, uint32 access_desired, SAM_DOMAIN_HANDLE **domain); /* Account API */ - NTSTATUS (*sam_create_account) (const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, SAM_ACCOUNT_HANDLE **account); + NTSTATUS (*sam_create_account) (const struct sam_methods *, const NT_USER_TOKEN *access_token, uint32 access_desired, const char *account_name, uint16 acct_ctrl, SAM_ACCOUNT_HANDLE **account); NTSTATUS (*sam_add_account) (const struct sam_methods *, const SAM_ACCOUNT_HANDLE *account); NTSTATUS (*sam_update_account) (const struct sam_methods *, const SAM_ACCOUNT_HANDLE *account); NTSTATUS (*sam_delete_account) (const struct sam_methods *, const SAM_ACCOUNT_HANDLE *account); - NTSTATUS (*sam_enum_accounts) (const struct sam_methods *, const NT_USER_TOKEN *access_token, int32 *account_count, SAM_ACCOUNT_ENUM **accounts); + NTSTATUS (*sam_enum_accounts) (const struct sam_methods *, const NT_USER_TOKEN *access_token, uint16 acct_ctrl, uint32 *account_count, SAM_ACCOUNT_ENUM **accounts); - NTSTATUS (*sam_get_account_by_sid) (const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const DOM_SID *accountsid, SAM_ACCOUNT_HANDLE **account); - NTSTATUS (*sam_get_account_by_name) (const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const char *name, SAM_ACCOUNT_HANDLE **account); + NTSTATUS (*sam_get_account_by_sid) (const struct sam_methods *, const NT_USER_TOKEN *access_token, uint32 access_desired, const DOM_SID *accountsid, SAM_ACCOUNT_HANDLE **account); + NTSTATUS (*sam_get_account_by_name) (const struct sam_methods *, const NT_USER_TOKEN *access_token, uint32 access_desired, const char *name, SAM_ACCOUNT_HANDLE **account); /* Group API */ - NTSTATUS (*sam_create_group) (const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const uint32 type, SAM_GROUP_HANDLE **group); + NTSTATUS (*sam_create_group) (const struct sam_methods *, const NT_USER_TOKEN *access_token, uint32 access_desired, const char *group_name, uint16 group_ctrl, SAM_GROUP_HANDLE **group); NTSTATUS (*sam_add_group) (const struct sam_methods *, const SAM_GROUP_HANDLE *group); NTSTATUS (*sam_update_group) (const struct sam_methods *, const SAM_GROUP_HANDLE *group); NTSTATUS (*sam_delete_group) (const struct sam_methods *, const SAM_GROUP_HANDLE *group); - NTSTATUS (*sam_enum_groups) (const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 type, uint32 *groups_count, SAM_GROUP_ENUM **groups); - NTSTATUS (*sam_get_group_by_sid) (const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const DOM_SID *groupsid, SAM_GROUP_HANDLE **group); - NTSTATUS (*sam_get_group_by_name) (const struct sam_methods *, const NT_USER_TOKEN *access_token, const uint32 access_desired, const char *name, SAM_GROUP_HANDLE **group); + NTSTATUS (*sam_enum_groups) (const struct sam_methods *, const NT_USER_TOKEN *access_token, uint16 group_ctrl, uint32 *groups_count, SAM_GROUP_ENUM **groups); + NTSTATUS (*sam_get_group_by_sid) (const struct sam_methods *, const NT_USER_TOKEN *access_token, uint32 access_desired, const DOM_SID *groupsid, SAM_GROUP_HANDLE **group); + NTSTATUS (*sam_get_group_by_name) (const struct sam_methods *, const NT_USER_TOKEN *access_token, uint32 access_desired, const char *name, SAM_GROUP_HANDLE **group); NTSTATUS (*sam_add_member_to_group) (const struct sam_methods *, const SAM_GROUP_HANDLE *group, const SAM_GROUP_MEMBER *member); NTSTATUS (*sam_delete_member_from_group) (const struct sam_methods *, const SAM_GROUP_HANDLE *group, const SAM_GROUP_MEMBER *member); NTSTATUS (*sam_enum_groupmembers) (const struct sam_methods *, const SAM_GROUP_HANDLE *group, uint32 *members_count, SAM_GROUP_MEMBER **members); - NTSTATUS (*sam_get_groups_of_account) (const struct sam_methods *, const SAM_ACCOUNT_HANDLE *account, const uint32 type, uint32 *group_count, SAM_GROUP_ENUM **groups); + NTSTATUS (*sam_get_groups_of_sid) (const struct sam_methods *, const NT_USER_TOKEN *access_token, const DOM_SID **sids, uint16 group_ctrl, uint32 *group_count, SAM_GROUP_ENUM **groups); void (*free_private_data)(void **); } SAM_METHODS; -- cgit From 6c8e4faba19b78b8147ca9274ce65551ec27cba5 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 6 Sep 2002 13:00:37 +0000 Subject: Updates to sam_skel from metze, add sam/group.c and add a DEBUG() to the SAM_ASSERT if we are not going to crash. (This used to be commit f91fcb166107e45ffb3de95a3da65c79992341eb) --- source3/include/sam.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/sam.h b/source3/include/sam.h index 53d56a2a80..afa7e55c65 100644 --- a/source3/include/sam.h +++ b/source3/include/sam.h @@ -30,8 +30,11 @@ #define SAM_ASSERT(x) SMB_ASSERT(x) #else #define SAM_ASSERT(x) while (0) { \ - if (!(x)) return NT_STATUS_FAIL_CHECK;\ - } + if (!(x)) { + DEBUG(0, ("SAM_ASSERT failed!\n")) + return NT_STATUS_FAIL_CHECK;\ + } \ + } #endif -- cgit From df4e6c9bcc2bb007e07c6f775e33f9174ea57931 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 6 Sep 2002 23:10:28 +0000 Subject: As per the 'OK' at CIFS2002, only use the readline headers (and this crasy #ifdef mess...) in readline.c, we don't need or use them in the rest of Samba. (This OK was of course conditional on 'if you break it, you better fix it...') Andrew Bartlett (This used to be commit 55ee289f587f107fa03c5f889491fdaab101df2d) --- source3/include/includes.h | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 945ec2cbd7..dacac356e3 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -902,24 +902,6 @@ struct functable { #define ULTRIX_AUTH 1 #endif -#ifdef HAVE_LIBREADLINE -# ifdef HAVE_READLINE_READLINE_H -# include -# ifdef HAVE_READLINE_HISTORY_H -# include -# endif -# else -# ifdef HAVE_READLINE_H -# include -# ifdef HAVE_HISTORY_H -# include -# endif -# else -# undef HAVE_LIBREADLINE -# endif -# endif -#endif - #ifndef HAVE_STRDUP char *strdup(const char *s); #endif -- cgit From 885f4f9379b48e74de132d6e6c24f11e8b06ce26 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 7 Sep 2002 05:41:23 +0000 Subject: Winbind client-side cleanups. The global winbind file descriptor can cause havoc in some situations - particulary when it becomes 0, 1 or 2. This patch (based on some very nice work by Hannes Schmidt ) starts to recitfy the problem by ensuring that the close-on-exec flag is set, and that we move above 3 in the file descriptor table. I've also decided that the PAM module can close it's pipe handle on every request - this isn't performance-critical code. The next step is to do the same for nss_winbind. (But things like getent() might get in our way there). This also cleans up some function prototypes, puts them in just one place. Andrew Bartlett (This used to be commit 442eb39657b98f67cd229ed3110b63aae8bf4e3c) --- source3/include/includes.h | 2 ++ source3/include/smb.h | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index dacac356e3..eaa0d25239 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -762,6 +762,8 @@ extern int errno; #include "mangle.h" +#include "nsswitch/winbind_client.h" + /* * Type for wide character dirent structure. * Only d_name is defined by POSIX. diff --git a/source3/include/smb.h b/source3/include/smb.h index 2ee2f0cb72..a1b3faa343 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1623,8 +1623,6 @@ struct unix_error_map { #define SAFE_NETBIOS_CHARS ". -_" -#include "nsswitch/winbindd_nss.h" - /* generic iconv conversion structure */ typedef struct { size_t (*direct)(void *cd, char **inbuf, size_t *inbytesleft, -- cgit From e889fc07ac9ea09fd97035fabef629e4bdf54cd1 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 8 Sep 2002 15:25:22 +0000 Subject: Patch from Kai Krüger for the new SAM system (This used to be commit 771878a2d94009b6eccef5f98d4e782cd85c291e) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source3/include/sam.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/sam.h b/source3/include/sam.h index afa7e55c65..c8df95676e 100644 --- a/source3/include/sam.h +++ b/source3/include/sam.h @@ -259,13 +259,20 @@ typedef struct sam_methods void (*free_private_data)(void **); } SAM_METHODS; -typedef NTSTATUS (*sam_init_function)(const SAM_CONTEXT *, SAM_METHODS **, const char *); +typedef NTSTATUS (*sam_init_function)(const SAM_CONTEXT *, SAM_METHODS **, const DOM_SID *domain, const char *); struct sam_init_function_entry { - char *name; + char *module_name; /* Function to create a member of the sam_methods list */ sam_init_function init; }; +typedef struct sam_backend_entry { + char *module_name; + char *module_params; + char *domain_name; + DOM_SID *domain_sid; +} SAM_BACKEND_ENTRY; + #endif /* _SAM_H */ -- cgit From 8de41d59482e7d66824c4a69563875d768f1f100 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 9 Sep 2002 21:48:23 +0000 Subject: Merged Steve French's fix for OS/2 EA return error being removed. Jeremy. (This used to be commit af2168c0344d49041b1fe78cd5219ac50308deb3) --- source3/include/trans2.h | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'source3/include') diff --git a/source3/include/trans2.h b/source3/include/trans2.h index fb265fdb1a..3468d3b995 100644 --- a/source3/include/trans2.h +++ b/source3/include/trans2.h @@ -193,16 +193,19 @@ Byte offset Type name description } FSINFO; *************************************************************/ -#define SMB_INFO_STANDARD 1 -#define SMB_INFO_QUERY_EA_SIZE 2 -#define SMB_INFO_QUERY_EAS_FROM_LIST 3 -#define SMB_INFO_QUERY_ALL_EAS 4 +#define SMB_INFO_STANDARD 1 /* FILESTATUS3 struct */ +#define SMB_INFO_SET_EA 2 /* EAOP2 struct, only valid on set not query */ +#define SMB_INFO_QUERY_EA_SIZE 2 /* FILESTATUS4 struct, only valid on query not set */ +#define SMB_INFO_QUERY_EAS_FROM_LIST 3 /* only valid on query not set */ +#define SMB_INFO_QUERY_ALL_EAS 4 /* only valid on query not set */ #define SMB_INFO_IS_NAME_VALID 6 -#define SMB_QUERY_FS_LABEL_INFO 0x101 -#define SMB_QUERY_FS_VOLUME_INFO 0x102 -#define SMB_QUERY_FS_SIZE_INFO 0x103 -#define SMB_QUERY_FS_DEVICE_INFO 0x104 -#define SMB_QUERY_FS_ATTRIBUTE_INFO 0x105 +#define SMB_INFO_STANDARD_LONG 11 /* similar to level 1, ie struct FileStatus3 */ +#define SMB_QUERY_EA_SIZE_LONG 12 /* similar to level 2, ie struct FileStatus4 */ +#define SMB_QUERY_FS_LABEL_INFO 0x101 +#define SMB_QUERY_FS_VOLUME_INFO 0x102 +#define SMB_QUERY_FS_SIZE_INFO 0x103 +#define SMB_QUERY_FS_DEVICE_INFO 0x104 +#define SMB_QUERY_FS_ATTRIBUTE_INFO 0x105 #define l2_vol_fdateCreation 0 -- cgit From 5793e15a27bf9f3bd00120ab0ff000b3935b19bf Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 10 Sep 2002 02:38:15 +0000 Subject: change notify merge from APP_HEAD (This used to be commit b5227f0a645fdf2358fcb880f22e4662efdfe8e3) --- source3/include/nt_printing.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nt_printing.h b/source3/include/nt_printing.h index 26d6e7e5f2..57767fc3c6 100644 --- a/source3/include/nt_printing.h +++ b/source3/include/nt_printing.h @@ -351,7 +351,7 @@ typedef struct _form #define SPOOLSS_NOTIFY_MSG_UNIX_JOBID 0x0001 /* Job id is unix */ -struct spoolss_notify_msg { +typedef struct spoolss_notify_msg { fstring printer; /* Name of printer notified */ uint32 type; /* Printer or job notify */ uint32 field; /* Notify field changed */ @@ -362,6 +362,18 @@ struct spoolss_notify_msg { uint32 value[2]; char *data; } notify; -}; +} SPOOLSS_NOTIFY_MSG; + +typedef struct { + fstring printername; + uint32 num_msgs; + SPOOLSS_NOTIFY_MSG *msgs; +} SPOOLSS_NOTIFY_MSG_GROUP; + +typedef struct { + TALLOC_CTX *ctx; + uint32 num_groups; + SPOOLSS_NOTIFY_MSG_GROUP *msg_groups; +} SPOOLSS_NOTIFY_MSG_CTR; #endif /* NT_PRINTING_H_ */ -- cgit From 99928976ea8994f1e759b652e6f06fdd86ffe853 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 11 Sep 2002 01:05:22 +0000 Subject: Ensure we've failed a lock with a lock denied message before automatically pushing it onto the blocking queue. Jeremy. (This used to be commit 237e36124cedf0485deaff81f34688fa862c3317) --- source3/include/smb_macros.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index ccf151fab2..71d4bac795 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -80,17 +80,20 @@ #define FNUM_OK(fsp,c) (OPEN_FSP(fsp) && (c)==(fsp)->conn) #define CHECK_FSP(fsp,conn) if (!FNUM_OK(fsp,conn)) \ - return(ERROR_DOS(ERRDOS,ERRbadfid)); \ - else if((fsp)->fd == -1) \ - return(ERROR_DOS(ERRDOS,ERRbadaccess)) + return(ERROR_DOS(ERRDOS,ERRbadfid)); \ + else if((fsp)->fd == -1) \ + return(ERROR_DOS(ERRDOS,ERRbadaccess)) #define CHECK_READ(fsp) if (!(fsp)->can_read) \ - return(ERROR_DOS(ERRDOS,ERRbadaccess)) + return(ERROR_DOS(ERRDOS,ERRbadaccess)) #define CHECK_WRITE(fsp) if (!(fsp)->can_write) \ - return(ERROR_DOS(ERRDOS,ERRbadaccess)) + return(ERROR_DOS(ERRDOS,ERRbadaccess)) #define CHECK_ERROR(fsp) if (HAS_CACHED_ERROR(fsp)) \ - return(CACHED_ERROR(fsp)) + return(CACHED_ERROR(fsp)) + +#define ERROR_WAS_LOCK_DENIED(status) (NT_STATUS_EQUAL((status), NT_STATUS_LOCK_NOT_GRANTED) || \ + NT_STATUS_EQUAL((status), NT_STATUS_FILE_LOCK_CONFLICT) ) /* translates a connection number into a service number */ #define SNUM(conn) ((conn)?(conn)->service:-1) -- cgit From 4f613ac61e9bc442715141188d915b537e15f4c6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 12 Sep 2002 02:12:52 +0000 Subject: First cut at portable sendfile code. Only used in readX at the moment and doesn't actually call sendfile. Needs to be vectored through the VFS and tested on all supported platforms (Solaris/HPUX/FreeBSD/Linux). Linux doesn't actually work (2.4.19 kernel) at the moment because it doesn't have a 64-bit clean sendfile. Jeremy. (This used to be commit fd772ca7b16cd86e0d50c7ed8d537c202976a6d2) --- source3/include/smbprofile.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h index 82017cee85..870fef71e3 100644 --- a/source3/include/smbprofile.h +++ b/source3/include/smbprofile.h @@ -65,6 +65,9 @@ struct profile_stats { unsigned syscall_write_bytes; /* bytes written with write syscall */ unsigned syscall_lseek_count; unsigned syscall_lseek_time; + unsigned syscall_sendfile_count; + unsigned syscall_sendfile_time; + unsigned syscall_sendfile_bytes; /* bytes read with sendfile syscall */ unsigned syscall_rename_count; unsigned syscall_rename_time; unsigned syscall_fsync_count; -- cgit From f6fdad1315ad4fcd046b3132a7c0b60a31d5a605 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 12 Sep 2002 06:28:13 +0000 Subject: Changed profile version number to 7 - added sendfile statistics. Jeremy. (This used to be commit 2d080d7579c0a59bcb03608600c6b28243bbe353) --- source3/include/smbprofile.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h index 870fef71e3..e501de8c0e 100644 --- a/source3/include/smbprofile.h +++ b/source3/include/smbprofile.h @@ -34,7 +34,7 @@ enum flush_reason_enum { SEEK_FLUSH, READ_FLUSH, WRITE_FLUSH, READRAW_FLUSH, #define PROF_SHMEM_KEY ((key_t)0x07021999) #define PROF_SHM_MAGIC 0x6349985 -#define PROF_SHM_VERSION 6 +#define PROF_SHM_VERSION 7 /* time values in the following structure are in microseconds */ -- cgit From 081b70cd8d625f0d74b6b84e69d35ad01eecac68 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Fri, 13 Sep 2002 08:17:02 +0000 Subject: Updated some comments in the NET_USER_INFO_3 structure for the other_sids field. (This used to be commit d153d692a0f8499e1d6dac791a4d119cd9c15e45) --- source3/include/rpc_netlogon.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/rpc_netlogon.h b/source3/include/rpc_netlogon.h index 5ee8120c68..500f5fef8a 100644 --- a/source3/include/rpc_netlogon.h +++ b/source3/include/rpc_netlogon.h @@ -164,8 +164,8 @@ typedef struct net_user_info_3 uint32 buffer_dom_id; /* undocumented logon domain id pointer */ uint8 padding[40]; /* unused padding bytes. expansion room */ - uint32 num_other_sids; /* 0 - num_sids */ - uint32 buffer_other_sids; /* NULL - undocumented pointer to SIDs. */ + uint32 num_other_sids; /* number of foreign/trusted domain sids */ + uint32 buffer_other_sids; UNISTR2 uni_user_name; /* username unicode string */ UNISTR2 uni_full_name; /* user's full name unicode string */ @@ -184,7 +184,7 @@ typedef struct net_user_info_3 uint32 num_other_groups; /* other groups */ DOM_GID *other_gids; /* group info */ - DOM_SID2 *other_sids; /* undocumented - domain SIDs */ + DOM_SID2 *other_sids; /* foreign/trusted domain SIDs */ } NET_USER_INFO_3; -- cgit From 77f97113d0983bffe353b2a7ca8e99a0c9600572 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 15 Sep 2002 16:35:44 +0000 Subject: Make current_sam_methods a const - Patch by Kai Krüger (This used to be commit bd7245dc6fcff805fcb69f6bd1f4852dadf5aa84) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source3/include/sam.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/sam.h b/source3/include/sam.h index c8df95676e..875efbe0de 100644 --- a/source3/include/sam.h +++ b/source3/include/sam.h @@ -51,7 +51,7 @@ int sam_version(void)\ typedef struct sam_domain_handle { TALLOC_CTX *mem_ctx; uint32 access_granted; - struct sam_methods *current_sam_methods; /* sam_methods creating this handle */ + const struct sam_methods *current_sam_methods; /* sam_methods creating this handle */ void (*free_fn)(struct sam_domain_handle **); struct domain_data { DOM_SID sid; /*SID of the domain. Should not be changed */ @@ -75,7 +75,7 @@ typedef struct sam_domain_handle { typedef struct sam_account_handle { TALLOC_CTX *mem_ctx; uint32 access_granted; - struct sam_methods *current_sam_methods; /* sam_methods creating this handle */ + const struct sam_methods *current_sam_methods; /* sam_methods creating this handle */ void (*free_fn)(struct sam_account_handle **); struct sam_account_data { uint32 init_flag; @@ -115,7 +115,7 @@ typedef struct sam_account_handle { typedef struct sam_group_handle { TALLOC_CTX *mem_ctx; uint32 access_granted; - struct sam_methods *current_sam_methods; /* sam_methods creating this handle */ + const struct sam_methods *current_sam_methods; /* sam_methods creating this handle */ void (*free_fn)(struct sam_group_handle **); struct sam_group_data { char *group_name; -- cgit From 1dceadfadd267277e71a4451db8bb97e1e3a2f8c Mon Sep 17 00:00:00 2001 From: John Terpstra Date: Mon, 16 Sep 2002 07:48:39 +0000 Subject: Changed Major/Minor version info reported to Server Manager to 4.9. Added new SWAT Flags for Advanced and Developer modes. (This used to be commit 0250e2c52c7d7aa25308b6c20b8e2a51184cb598) --- source3/include/smb.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index a1b3faa343..59bfb6b449 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -3,7 +3,7 @@ SMB parameters and setup, plus a whole lot more. Copyright (C) Andrew Tridgell 1992-2000 - Copyright (C) John H Terpstra 1996-2000 + Copyright (C) John H Terpstra 1996-2002 Copyright (C) Luke Kenneth Casson Leighton 1996-2000 Copyright (C) Paul Ashton 1998-2000 Copyright (C) Simo Sorce 2001-2002 @@ -753,12 +753,16 @@ struct bitmap { int n; }; -#define FLAG_BASIC 0x01 /* fundamental options */ -#define FLAG_SHARE 0x02 /* file sharing options */ -#define FLAG_PRINT 0x04 /* printing options */ -#define FLAG_GLOBAL 0x08 /* local options that should be globally settable in SWAT */ -#define FLAG_DEPRECATED 0x10 /* options that should no longer be used */ -#define FLAG_HIDE 0x20 /* options that should be hidden in SWAT */ +#define FLAG_BASIC 0x0001 /* fundamental options */ +#define FLAG_SHARE 0x0002 /* file sharing options */ +#define FLAG_PRINT 0x0004 /* printing options */ +#define FLAG_GLOBAL 0x0008 /* local options that should be globally settable in SWAT */ +#define FLAG_WIZARD 0x0010 /* Parameters that the wizard will operate on */ +#define FLAG_ADVANCED 0x0020 /* Parameters that the wizard will operate on */ +#define FLAG_DEVELOPER 0x0040 /* Parameters that the wizard will operate on */ +#define FLAG_DEPRECATED 0x1000 /* options that should no longer be used */ +#define FLAG_HIDE 0x2000 /* options that should be hidden in SWAT */ +#define FLAG_DOS_STRING 0x4000 /* convert from UNIX to DOS codepage when reading this string. */ #ifndef LOCKING_VERSION #define LOCKING_VERSION 4 @@ -1266,7 +1270,7 @@ char *strdup(char *s); */ #define DEFAULT_MAJOR_VERSION 0x04 -#define DEFAULT_MINOR_VERSION 0x05 +#define DEFAULT_MINOR_VERSION 0x09 /* Browser Election Values */ #define BROWSER_ELECTION_VERSION 0x010f -- cgit From ad5ab5f5832844dc6eff3f2c72d24eba5e8b4d29 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 17 Sep 2002 00:45:39 +0000 Subject: Added autoconf detection for sendfile for Linux. lib/sendfile.c code still needs more work. Don't add --with-sendfile-support yet... Jeremy. (This used to be commit c6ece53ac2a7a6115ca1160cf02247d7cc0bbb95) --- source3/include/config.h.in | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 7945e49c79..3c56845174 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -288,6 +288,10 @@ #endif #undef LDAP_SET_REBIND_PROC_ARGS +#undef HAVE_SENDFILE +#undef HAVE_SENDFILE64 +#undef LINUX_SENDFILE_API +#undef LINUX_BROKEN_SENDFILE_API /* The number of bytes in a int. */ #undef SIZEOF_INT -- cgit From f74086ccf09e8157419f7c51490dc31effb6ba20 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 17 Sep 2002 01:00:03 +0000 Subject: Attempt to make broken Linux sendfile work.... Still in progress. Jeremy. (This used to be commit f956a4d29d0d88cd92fac0f0c9f636fc152afe0a) --- source3/include/config.h.in | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 3c56845174..119df4dd5b 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -292,6 +292,7 @@ #undef HAVE_SENDFILE64 #undef LINUX_SENDFILE_API #undef LINUX_BROKEN_SENDFILE_API +#undef WITH_SENDFILE /* The number of bytes in a int. */ #undef SIZEOF_INT -- cgit From e8ea0aadbb01d824851dfbf2e9122170791b7226 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 17 Sep 2002 01:10:47 +0000 Subject: Added FreeBSD sendfile configure tests. Richard please test... Jeremy. (This used to be commit 6425f169779ce65509b77cf6d5634de24894a965) --- source3/include/config.h.in | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 119df4dd5b..9fbde2bf37 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -293,6 +293,7 @@ #undef LINUX_SENDFILE_API #undef LINUX_BROKEN_SENDFILE_API #undef WITH_SENDFILE +#undef FREEBSD_SENDFILE_API /* The number of bytes in a int. */ #undef SIZEOF_INT -- cgit From ccfe2b848583d4036fb1a11a25e8c87c80e59520 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Tue, 17 Sep 2002 05:38:12 +0000 Subject: Added --with-ads option, defaults to yes. If you run ./configure --with-ads=no or ./configure --without-ads Samba will build without linking to the various kerberos libraries. (This used to be commit edb6172abf0f07fead8ed3aaaebe0411d757aa64) --- source3/include/config.h.in | 3 ++- source3/include/includes.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 9fbde2bf37..8e744e43f7 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -1,4 +1,4 @@ -/* include/config.h.in. Generated automatically from configure.in by autoheader. */ +/* include/config.h.in. Generated automatically from configure.in by autoheader 2.13. */ /* Define if on AIX 3. System headers sometimes define this. @@ -294,6 +294,7 @@ #undef LINUX_BROKEN_SENDFILE_API #undef WITH_SENDFILE #undef FREEBSD_SENDFILE_API +#undef WITH_ADS /* The number of bytes in a int. */ #undef SIZEOF_INT diff --git a/source3/include/includes.h b/source3/include/includes.h index eaa0d25239..bdf5bbcef3 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -420,8 +420,8 @@ #include #endif -/* we support ADS if we have krb5 and ldap libs */ -#if defined(HAVE_KRB5) && defined(HAVE_LDAP) +/* we support ADS if we want it and have krb5 and ldap libs */ +#if defined(WITH_ADS) && defined(HAVE_KRB5) && defined(HAVE_LDAP) #define HAVE_ADS #endif -- cgit From b33681fc0b8ef7b9fa91c154f7c3117afafa349e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 17 Sep 2002 12:12:50 +0000 Subject: Add clock skew handling to our kerberos code. This allows us to cope with the DC being out of sync with the local machine. (This used to be commit 0d28d769472ea3b98ae4c8757093dfd4499f6dd1) --- source3/include/ads.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/ads.h b/source3/include/ads.h index 6106eb6b40..875b895e49 100644 --- a/source3/include/ads.h +++ b/source3/include/ads.h @@ -24,7 +24,8 @@ typedef struct { char *password; char *user_name; char *kdc_server; - int no_bind; + unsigned flags; + int time_offset; } auth; /* info derived from the servers config */ @@ -32,6 +33,7 @@ typedef struct { char *realm; char *bind_path; char *ldap_server_name; + time_t current_time; } config; } ADS_STRUCT; @@ -249,3 +251,8 @@ typedef void **ADS_MODLIST; /* DomainCntrollerAddressType */ #define ADS_INET_ADDRESS 0x00000001 #define ADS_NETBIOS_ADDRESS 0x00000002 + + +/* ads auth control flags */ +#define ADS_AUTH_DISABLE_KERBEROS 1 +#define ADS_AUTH_NO_BIND 2 -- cgit From 9bab1d0c1a51a7532da0c55a59cf5a91b8ab6a3d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 17 Sep 2002 19:48:19 +0000 Subject: Actually use sendfile if selected. Jeremy. (This used to be commit 5881f0a22633ed9fb73e6cd788d0751c4db6cd32) --- source3/include/vfs.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 1b1a13d7c1..9a06764371 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -44,17 +44,18 @@ /* Changed to version 2 for CIFS UNIX extensions (mknod and link added). JRA. */ /* Changed to version 3 for POSIX acl extensions. JRA. */ /* Changed to version 4 for cascaded VFS interface. Alexander Bokovoy. */ +/* Changed to version 5 for sendfile addition. JRA. */ #define SMB_VFS_INTERFACE_VERSION 5 /* Version of supported cascaded interface backward copmatibility. - (version 4 corresponds to SMB_VFS_INTERFACE_VERSION 4) + (version 5 corresponds to SMB_VFS_INTERFACE_VERSION 5) It is used in vfs_init_custom() to detect VFS modules which conform to cascaded VFS interface but implement elder version than current version of Samba uses. This allows to use old modules with new VFS interface as far as combined VFS operation set is coherent (will be in most cases). */ -#define SMB_VFS_INTERFACE_CASCADED 4 +#define SMB_VFS_INTERFACE_CASCADED 5 /* Each VFS module must provide following global functions: @@ -116,6 +117,7 @@ struct vfs_ops { ssize_t (*read)(struct files_struct *fsp, int fd, void *data, size_t n); ssize_t (*write)(struct files_struct *fsp, int fd, const void *data, size_t n); SMB_OFF_T (*lseek)(struct files_struct *fsp, int filedes, SMB_OFF_T offset, int whence); + ssize_t (*sendfile)(int tofd, files_struct *fsp, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count); int (*rename)(struct connection_struct *conn, const char *old, const char *new); int (*fsync)(struct files_struct *fsp, int fd); int (*stat)(struct connection_struct *conn, const char *fname, SMB_STRUCT_STAT *sbuf); @@ -210,6 +212,7 @@ typedef enum _vfs_op_type { SMB_VFS_OP_READ, SMB_VFS_OP_WRITE, SMB_VFS_OP_LSEEK, + SMB_VFS_OP_SENDFILE, SMB_VFS_OP_RENAME, SMB_VFS_OP_FSYNC, SMB_VFS_OP_STAT, -- cgit From aad3c35ac1197a70c04eccaf7d4fee804a210954 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 18 Sep 2002 19:06:58 +0000 Subject: printjob merge from APP_HEAD regarding device modes (This used to be commit aa52351384abace54a89c9fbfa5e4c31a8464c91) --- source3/include/includes.h | 5 +++++ source3/include/printing.h | 1 + 2 files changed, 6 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index bdf5bbcef3..56b8357831 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -803,6 +803,11 @@ struct functable { #include "nsswitch/nss.h" +/* forward declaration from printing.h to get around + header file dependencies */ + +struct printjob; + /***** automatically generated prototypes *****/ #include "proto.h" diff --git a/source3/include/printing.h b/source3/include/printing.h index ecf603b8fc..9774a6acd9 100644 --- a/source3/include/printing.h +++ b/source3/include/printing.h @@ -43,6 +43,7 @@ struct printjob { fstring jobname; /* the job name given to us by the client */ fstring user; /* the user who started the job */ fstring queuename; /* service number of printer for this job */ + NT_DEVICEMODE *nt_devmode; }; /* Information for print interfaces */ -- cgit From 994638f577d2d0df8f5f185fd96d4448dcd9d7e5 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 18 Sep 2002 20:07:56 +0000 Subject: HPUX sendfile is now detected correctly. Jeremy. (This used to be commit 91e41ebe97c143f413e2a5614b20f3db4642490f) --- source3/include/config.h.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 8e744e43f7..770af1a6b5 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -1,4 +1,4 @@ -/* include/config.h.in. Generated automatically from configure.in by autoheader 2.13. */ +/* include/config.h.in. Generated automatically from configure.in by autoheader. */ /* Define if on AIX 3. System headers sometimes define this. @@ -294,6 +294,7 @@ #undef LINUX_BROKEN_SENDFILE_API #undef WITH_SENDFILE #undef FREEBSD_SENDFILE_API +#undef HPUX_SENDFILE_API #undef WITH_ADS /* The number of bytes in a int. */ -- cgit From 1244410cc4d48e3d68dad2c979a9ad2a2f70989e Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 19 Sep 2002 15:39:00 +0000 Subject: Merge in first command for 'samtest' Fix small bug in sam/interface.c Make sam backend to default to a define (This used to be commit 60ab55fedf03a0b505b0b73527e031124a46304e) --- source3/include/sam.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/sam.h b/source3/include/sam.h index 875efbe0de..ca1a84fd97 100644 --- a/source3/include/sam.h +++ b/source3/include/sam.h @@ -48,6 +48,9 @@ int sam_version(void)\ return SAM_INTERFACE_VERSION;\ } +/* Backend to use by default when no backend was specified */ +#define SAM_DEFAULT_BACKEND "plugin" + typedef struct sam_domain_handle { TALLOC_CTX *mem_ctx; uint32 access_granted; -- cgit From d06d2c876e3f295715e818fa6869d968e32b3dc4 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 22 Sep 2002 10:30:00 +0000 Subject: Change parsing of policy and privs delta to what Ethereal says. Volker (This used to be commit 8c41b5cd1b8b0c2639def9552bd20b8aca39785c) --- source3/include/rpc_netlogon.h | 93 +++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 56 deletions(-) (limited to 'source3/include') diff --git a/source3/include/rpc_netlogon.h b/source3/include/rpc_netlogon.h index 500f5fef8a..fb849f8238 100644 --- a/source3/include/rpc_netlogon.h +++ b/source3/include/rpc_netlogon.h @@ -719,45 +719,31 @@ typedef struct sam_alias_mem_info_info /* SAM_DELTA_POLICY (0x0D) */ typedef struct { - uint32 unknown1; /* 0x5000 */ - uint32 unknown2; /* 0 */ - uint32 unknown3; /* 0 */ - uint32 unknown4; /* 0 */ - uint32 count1; - uint32 ptr1; - uint16 count2; - uint16 count3; - uint32 ptr2; - uint32 ptr3; - - uint32 unknown4b; /* 0x02000000 */ - uint32 unknown5; /* 0x00100000 */ - uint32 unknown6; /* 0x00010000 */ - uint32 unknown7; /* 0x0f000000 */ - uint32 unknown8; /* 0 */ - uint32 unknown9; /* 0 */ - uint32 unknown10; /* 0 */ - uint32 unknown11; /* 0x3c*/ - uint32 unknown12; /* 0*/ - - uint32 unknown13; /* a7080110 */ - uint32 unknown14; /* 01bfb0dd */ - uint32 unknown15; /* 0f */ - uint32 unknown16; /* 68 */ - uint32 unknown17; /* 00169000 */ - - uint32 count4; - uint32 unknown18; /* 0 times count4 */ - - uint32 unknown19; /* 8 */ - - uint32 unknown20; /* 0x04 times count1 */ - - uint32 ptr4; - - UNISTR2 domain_name; + uint32 max_log_size; /* 0x5000 */ + UINT64_S audit_retention_period; /* 0 */ + uint32 auditing_mode; /* 0 */ + uint32 num_events; + uint32 ptr_events; + UNIHDR hdr_dom_name; + uint32 sid_ptr; + + uint32 paged_pool_limit; /* 0x02000000 */ + uint32 non_paged_pool_limit; /* 0x00100000 */ + uint32 min_workset_size; /* 0x00010000 */ + uint32 max_workset_size; /* 0x0f000000 */ + uint32 page_file_limit; /* 0 */ + UINT64_S time_limit; /* 0 */ + NTTIME modify_time; /* 0x3c*/ + NTTIME create_time; /* a7080110 */ + BUFHDR2 hdr_sec_desc; + + uint32 num_event_audit_options; + uint32 event_audit_option; + + UNISTR2 domain_name; DOM_SID2 domain_sid; + BUFFER4 buf_sec_desc; } SAM_DELTA_POLICY; /* SAM_DELTA_TRUST_DOMS */ @@ -783,29 +769,24 @@ typedef struct /* SAM_DELTA_PRIVS (0x10) */ typedef struct { - uint32 buf_size; - SEC_DESC *sec_desc; DOM_SID2 sid; uint32 priv_count; - uint32 reserved1; /* 0x0 */ - - uint32 ptr1; - uint32 ptr2; - - uint32 unknown1; - uint32 unknown2; - uint32 unknown3; - uint32 unknown4; - uint32 unknown5; - uint32 unknown6; - uint32 unknown7; - uint32 unknown8; - uint32 unknown9; + uint32 priv_control; + + uint32 priv_attr_ptr; + uint32 priv_name_ptr; + + uint32 paged_pool_limit; /* 0x02000000 */ + uint32 non_paged_pool_limit; /* 0x00100000 */ + uint32 min_workset_size; /* 0x00010000 */ + uint32 max_workset_size; /* 0x0f000000 */ + uint32 page_file_limit; /* 0 */ + UINT64_S time_limit; /* 0 */ + uint32 system_flags; /* 1 */ + BUFHDR2 hdr_sec_desc; uint32 buf_size2; - uint32 ptr3; - uint32 unknown10; /* 48 bytes 0x0*/ uint32 attribute_count; uint32 *attributes; @@ -814,7 +795,7 @@ typedef struct UNIHDR *hdr_privslist; UNISTR2 *uni_privslist; - + BUFFER4 buf_sec_desc; } SAM_DELTA_PRIVS; /* SAM_DELTA_SECRET */ -- cgit From 2cd64003e3b127ca5a204b801155fcb4a7447a48 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 24 Sep 2002 20:18:39 +0000 Subject: - Don't put pointer to sam_domain_handle in sam_methods but single domainsid and domainname - Allocate sam_methods, set domain_sid, domain_name and backend_name in make_sam_methods_backend_entry instead of in the backend - Remove sam_context and domain_sid pointers from the sam_init_function - we don't need those arguments anymore since they're available in sam_methods as well (This used to be commit 50d2527eed0eb26c16f2f7e28badbf08d771380e) --- source3/include/sam.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/sam.h b/source3/include/sam.h index ca1a84fd97..4d18ec61b9 100644 --- a/source3/include/sam.h +++ b/source3/include/sam.h @@ -216,7 +216,8 @@ typedef struct sam_methods struct sam_methods *next; struct sam_methods *prev; const char *backendname; - struct sam_domain_handle *domain; + const char *domain_name; + DOM_SID domain_sid; void *private_data; /* General API */ @@ -262,7 +263,7 @@ typedef struct sam_methods void (*free_private_data)(void **); } SAM_METHODS; -typedef NTSTATUS (*sam_init_function)(const SAM_CONTEXT *, SAM_METHODS **, const DOM_SID *domain, const char *); +typedef NTSTATUS (*sam_init_function)(SAM_METHODS *, const char *); struct sam_init_function_entry { char *module_name; -- cgit From 891f580300d8d8eb5e258bdc31c881e73aa6ad38 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 25 Sep 2002 09:38:27 +0000 Subject: Header files should not include includes.h - therein lies maddness, particuarly if we ever want to get rid of the magic macros. (This used to be commit 13f33e466ed31d35221157d6b3a1a05507157b66) --- source3/include/smb_acls.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb_acls.h b/source3/include/smb_acls.h index 3ed670d38b..e7edb62bde 100644 --- a/source3/include/smb_acls.h +++ b/source3/include/smb_acls.h @@ -20,9 +20,6 @@ #ifndef _SMB_ACLS_H #define _SMB_ACLS_H - -#include "includes.h" - #if defined(HAVE_POSIX_ACLS) /* This is an identity mapping (just remove the SMB_). */ -- cgit From b06d2abe746fb7873846e9f14bb8d3895c4290ed Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 25 Sep 2002 09:40:45 +0000 Subject: Another patch from metze, towards his work on sam_ads. See mx-ldap.sf.net for his current progress. (This used to be commit 9c62d1312fdf0aa7b1978e8bbb56fc076ba7e9d0) --- source3/include/ads.h | 13 +++++++------ source3/include/sam.h | 6 +++--- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'source3/include') diff --git a/source3/include/ads.h b/source3/include/ads.h index 875b895e49..0181ae535e 100644 --- a/source3/include/ads.h +++ b/source3/include/ads.h @@ -134,6 +134,7 @@ typedef void **ADS_MODLIST; #define ADS_PAGE_CTL_OID "1.2.840.113556.1.4.319" #define ADS_NO_REFERRALS_OID "1.2.840.113556.1.4.1339" #define ADS_SERVER_SORT_OID "1.2.840.113556.1.4.473" +#define ADS_PERMIT_MODIFY_OID "1.2.840.113556.1.4.1413" /* UserFlags for userAccountControl */ #define UF_SCRIPT 0x00000001 @@ -163,7 +164,7 @@ typedef void **ADS_MODLIST; #define UF_NOT_DELEGATED 0x00100000 #define UF_USE_DES_KEY_ONLY 0x00200000 -#define UF_DONT_REQUIRE_PREAUTH 0x00400000 +#define UF_DONT_REQUIRE_PREAUTH 0x00400000 #define UF_UNUSED_5 0x00800000 #define UF_UNUSED_6 0x01000000 @@ -210,11 +211,11 @@ typedef void **ADS_MODLIST; /* sAMAccountType */ #define ATYPE_NORMAL_ACCOUNT 0x30000000 /* 805306368 */ -#define ATYPE_WORKSTATION_TRUST 0x30000001 /* 805306369 */ -#define ATYPE_INTERDOMAIN_TRUST 0x30000002 /* 805306370 */ +#define ATYPE_WORKSTATION_TRUST 0x30000001 /* 805306369 */ +#define ATYPE_INTERDOMAIN_TRUST 0x30000002 /* 805306370 */ #define ATYPE_SECURITY_GLOBAL_GROUP 0x10000000 /* 268435456 */ -#define ATYPE_DISTRIBUTION_GLOBAL_GROUP 0x10000001 /* 268435457 */ -#define ATYPE_DISTRIBUTION_UNIVERSAL_GROUP AT_DISTRIBUTION_GLOBAL_GROUP +#define ATYPE_DISTRIBUTION_GLOBAL_GROUP 0x10000001 /* 268435457 */ +#define ATYPE_DISTRIBUTION_UNIVERSAL_GROUP ATYPE_DISTRIBUTION_GLOBAL_GROUP #define ATYPE_SECURITY_LOCAL_GROUP 0x20000000 /* 536870912 */ #define ATYPE_DISTRIBUTION_LOCAL_GROUP 0x20000001 /* 536870913 */ @@ -226,7 +227,7 @@ typedef void **ADS_MODLIST; #define GTYPE_SECURITY_BUILTIN_LOCAL_GROUP 0x80000005 /* -2147483643 */ #define GTYPE_SECURITY_DOMAIN_LOCAL_GROUP 0x80000004 /* -2147483644 */ #define GTYPE_SECURITY_GLOBAL_GROUP 0x80000002 /* -2147483646 */ -#define GTYPE_DISTRIBUTION_GLOBAL_GROUP 0x00000002 /* 2 */ +#define GTYPE_DISTRIBUTION_GLOBAL_GROUP 0x00000002 /* 2 */ #define GTYPE_DISTRIBUTION_DOMAIN_LOCAL_GROUP 0x00000004 /* 4 */ #define GTYPE_DISTRIBUTION_UNIVERSAL_GROUP 0x00000008 /* 8 */ diff --git a/source3/include/sam.h b/source3/include/sam.h index 4d18ec61b9..2157a37065 100644 --- a/source3/include/sam.h +++ b/source3/include/sam.h @@ -152,10 +152,10 @@ typedef struct sam_group_enum { /* bits for group_ctrl: to spezify if the group is global group or alias */ -#define GCB_LOCAL_GROUP 0x0001 -#define GCB_ALIAS_GROUP GCB_LOCAL_GROUP +#define GCB_LOCAL_GROUP 0x0001 +#define GCB_ALIAS_GROUP (GCB_LOCAL_GROUP |GCB_BUILTIN) #define GCB_GLOBAL_GROUP 0x0002 - +#define GCB_BUILTIN 0x1000 typedef struct sam_context { -- cgit From 82102d9c99f9b255d6262553187642e9637e4670 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 25 Sep 2002 11:34:31 +0000 Subject: This patch from "Stefan (metze) Metzmacher" cleans up pdb_ldap and adds a 'ldap passwd sync' option. The idea with this option is to do allow an ldap backend to do all the fancy password hashing etc - and to tell smbd no to try and double-up. Using 'ldap passwd sync = only' will do this, but is not recommended unless such a backend is in place... Running 'ldap passwd sync = yes' just gets you the same as doing 'pam passwd sync = yes' and having both PAM and pam_ldap correctly configured for 'magic root' behaviour, but only using ldap connection, and one set of credentials. This also gets us closer to allowing ldap to say 'password too short' etc, which might assist in maintaining a consistant password policy. Andrew Bartlett (This used to be commit f13e243f1a13d34ae057b40b01f561e8b95d4570) --- source3/include/smb.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 59bfb6b449..c39ebed950 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -616,7 +616,7 @@ typedef struct sam_passwd DATA_BLOB lm_pw; /* .data is Null if no password */ DATA_BLOB nt_pw; /* .data is Null if no password */ - DATA_BLOB plaintext_pw; /* .data is Null if not available */ + char* plaintext_pw; /* is Null if not available */ uint16 acct_ctrl; /* account info (ACB_xxxx bit-mask) */ uint32 unknown_3; /* 0x00ff ffff */ @@ -1346,6 +1346,9 @@ enum schema_types {SCHEMA_COMPAT, SCHEMA_AD, SCHEMA_SAMBA}; /* LDAP SSL options */ enum ldap_ssl_types {LDAP_SSL_ON, LDAP_SSL_OFF, LDAP_SSL_START_TLS}; +/* LDAP PASSWD SYNC methods */ +enum ldap_passwd_sync_types {LDAP_PASSWD_SYNC_ON, LDAP_PASSWD_SYNC_OFF, LDAP_PASSWD_SYNC_ONLY}; + /* Remote architectures we know about. */ enum remote_arch_types {RA_UNKNOWN, RA_WFWG, RA_OS2, RA_WIN95, RA_WINNT, RA_WIN2K, RA_SAMBA}; -- cgit