⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 passdb.h

📁 samba-3.0.22.tar.gz 编译smb服务器的源码
💻 H
📖 第 1 页 / 共 2 页
字号:
/*    Unix SMB/CIFS implementation.   passdb structures and parameters   Copyright (C) Gerald Carter 2001   Copyright (C) Luke Kenneth Casson Leighton 1998 - 2000   Copyright (C) Andrew Bartlett 2002   Copyright (C) Simo Sorce 2003      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 _PASSDB_H#define _PASSDB_H/* * fields_present flags meanings * same names as found in samba4 idl files */#define ACCT_USERNAME		0x00000001#define ACCT_FULL_NAME		0x00000002#define ACCT_RID		0x00000004#define ACCT_PRIMARY_GID	0x00000008#define ACCT_ADMIN_DESC		0x00000010#define ACCT_DESCRIPTION	0x00000020#define ACCT_HOME_DIR		0x00000040#define ACCT_HOME_DRIVE		0x00000080#define ACCT_LOGON_SCRIPT	0x00000100#define ACCT_PROFILE		0x00000200#define ACCT_WORKSTATIONS	0x00000400#define ACCT_LAST_LOGON		0x00000800#define ACCT_LAST_LOGOFF	0x00001000#define ACCT_LOGON_HOURS	0x00002000#define ACCT_BAD_PWD_COUNT	0x00004000#define ACCT_NUM_LOGONS		0x00008000#define ACCT_ALLOW_PWD_CHANGE	0x00010000#define ACCT_FORCE_PWD_CHANGE	0x00020000#define ACCT_LAST_PWD_CHANGE	0x00040000#define ACCT_EXPIRY		0x00080000#define ACCT_FLAGS		0x00100000#define ACCT_CALLBACK		0x00200000#define ACCT_COUNTRY_CODE	0x00400000#define ACCT_CODE_PAGE		0x00800000#define ACCT_NT_PWD_SET		0x01000000#define ACCT_LM_PWD_SET		0x02000000#define ACCT_PRIVATEDATA	0x04000000#define ACCT_EXPIRED_FLAG	0x08000000#define ACCT_SEC_DESC		0x10000000#define ACCT_OWF_PWD		0x20000000/* * bit flags representing initialized fields in SAM_ACCOUNT */enum pdb_elements {	PDB_UNINIT,	PDB_SMBHOME,	PDB_PROFILE,	PDB_DRIVE,	PDB_LOGONSCRIPT,	PDB_LOGONTIME,	PDB_LOGOFFTIME,	PDB_KICKOFFTIME,	PDB_BAD_PASSWORD_TIME,	PDB_CANCHANGETIME,	PDB_MUSTCHANGETIME,	PDB_PLAINTEXT_PW,	PDB_USERNAME,	PDB_FULLNAME,	PDB_DOMAIN,	PDB_NTUSERNAME,	PDB_HOURSLEN,	PDB_LOGONDIVS,	PDB_USERSID,	PDB_GROUPSID,	PDB_ACCTCTRL,	PDB_PASSLASTSET,	PDB_UNIXHOMEDIR,	PDB_ACCTDESC,	PDB_WORKSTATIONS,	PDB_UNKNOWNSTR,	PDB_MUNGEDDIAL,	PDB_HOURS,	PDB_FIELDS_PRESENT,	PDB_BAD_PASSWORD_COUNT,	PDB_LOGON_COUNT,	PDB_UNKNOWN6,	PDB_LMPASSWD,	PDB_NTPASSWD,	PDB_PWHISTORY,	PDB_BACKEND_PRIVATE_DATA,	/* this must be the last element */	PDB_COUNT};enum pdb_group_elements {	PDB_GROUP_NAME,	PDB_GROUP_SID,	PDB_GROUP_SID_NAME_USE,	PDB_GROUP_MEMBERS,	/* this must be the last element */	PDB_GROUP_COUNT};enum pdb_value_state {	PDB_DEFAULT=0,	PDB_SET,	PDB_CHANGED};#define IS_SAM_SET(x, flag)	(pdb_get_init_flags(x, flag) == PDB_SET)#define IS_SAM_CHANGED(x, flag)	(pdb_get_init_flags(x, flag) == PDB_CHANGED)#define IS_SAM_DEFAULT(x, flag)	(pdb_get_init_flags(x, flag) == PDB_DEFAULT)/* cache for bad password lockout data, to be used on replicated SAMs */typedef struct logon_cache_struct {	time_t entry_timestamp;	uint16 acct_ctrl;	uint16 bad_password_count;	time_t bad_password_time;} LOGIN_CACHE;		typedef struct sam_passwd {	TALLOC_CTX *mem_ctx;		void (*free_fn)(struct sam_passwd **);	struct pdb_methods *methods;	struct user_data {		/* initialization flags */		struct bitmap *change_flags;		struct bitmap *set_flags;		time_t logon_time;            /* logon time */		time_t logoff_time;           /* logoff time */		time_t kickoff_time;          /* kickoff time */		time_t bad_password_time;     /* last bad password entered */		time_t pass_last_set_time;    /* password last set time */		time_t pass_can_change_time;  /* password can change time */		time_t pass_must_change_time; /* password must change time */				const char * username;     /* UNIX username string */		const char * domain;       /* Windows Domain name */		const char * nt_username;  /* Windows username string */		const char * full_name;    /* user's full name string */		const char * unix_home_dir;     /* UNIX home directory string */		const char * home_dir;     /* home directory string */		const char * dir_drive;    /* home directory drive string */		const char * logon_script; /* logon script string */		const char * profile_path; /* profile path string */		const char * acct_desc;    /* user description string */		const char * workstations; /* login from workstations string */		const char * unknown_str;  /* don't know what this is, yet. */		const 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 nt_pw_his; /* nt hashed password history .data is Null if not available */		char* plaintext_pw; /* is Null if not available */				uint16 acct_ctrl; /* account info (ACB_xxxx bit-mask) */		uint32 fields_present; /* 0x00ff ffff */				uint16 logon_divs; /* 168 - number of hours in a week */		uint32 hours_len; /* normally 21 bytes */		uint8 hours[MAX_HOURS_LEN];				/* Was unknown_5. */		uint16 bad_password_count;		uint16 logon_count;		uint32 unknown_6; /* 0x0000 04ec */		/* a tag for who added the private methods */		const struct pdb_methods *backend_private_methods;		void *backend_private_data; 		void (*backend_private_data_free_fn)(void **);	} private_u;	/* Lets see if the remaining code can get the hint that you	   are meant to use the pdb_...() functions. */	} SAM_ACCOUNT;typedef struct sam_group {	TALLOC_CTX *mem_ctx;		void (*free_fn)(struct sam_group **);	struct pdb_methods *methods;	struct group_data {		/* initialization flags */		struct bitmap *change_flags;		struct bitmap *set_flags;		const char *name;		/* Windows group name string */		DOM_SID sid;			/* Group SID */		enum SID_NAME_USE sid_name_use;	/* Group type */		uint32 mem_num;			/* Number of member SIDs */		DOM_SID *members;		/* SID array */	} private_g;} SAM_GROUP;struct acct_info {	fstring acct_name; /* account name */	fstring acct_desc; /* account name */	uint32 rid; /* domain-relative RID */};struct samr_displayentry {	uint32 idx;	uint32 rid;	uint16 acct_flags;	const char *account_name;	const char *fullname;	const char *description;};enum pdb_search_type {	PDB_USER_SEARCH,	PDB_GROUP_SEARCH,	PDB_ALIAS_SEARCH};struct pdb_search {	TALLOC_CTX *mem_ctx;	enum pdb_search_type type;	struct samr_displayentry *cache;	uint32 num_entries;	ssize_t cache_size;	BOOL search_ended;	void *private_data;	BOOL (*next_entry)(struct pdb_search *search,			   struct samr_displayentry *entry);	void (*search_end)(struct pdb_search *search);};/***************************************************************** Functions to be implemented by the new (v2) passdb API ****************************************************************//* * This next constant specifies the version number of the PASSDB interface * this SAMBA will load. Increment this if *ANY* changes are made to the interface.  * Changed interface to fix int -> size_t problems. JRA. * There's no point in allocating arrays in * samr_lookup_rids twice. It was done in the srv_samr_nt.c code as well as in * the pdb module. Remove the latter, this might happen more often. VL.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -