1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

r3453: - split out the auth and popt includes

- tidied up some of the system includes

- moved a few more structures back from misc.idl to netlogon.idl and samr.idl now that pidl
  knows about inter-IDL dependencies
This commit is contained in:
Andrew Tridgell 2004-11-02 02:57:18 +00:00 committed by Gerald (Jerry) Carter
parent ced1a0fcdc
commit 7b7477ac42
52 changed files with 202 additions and 190 deletions

View File

@ -19,6 +19,7 @@
*/
#include "includes.h"
#include "auth/auth.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH

View File

@ -21,6 +21,11 @@
#ifndef _SAMBA_AUTH_H
#define _SAMBA_AUTH_H
#include "libcli/auth/ntlmssp.h"
#include "libcli/auth/credentials.h"
#include "libcli/auth/gensec.h"
#include "libcli/auth/spnego.h"
/* modules can use the following to determine if the interface has changed
* please increment the version number after each interface change
* with a comment and maybe update struct auth_critical_sizes.

View File

@ -20,6 +20,7 @@
*/
#include "includes.h"
#include "auth/auth.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH

View File

@ -22,6 +22,7 @@
#include "includes.h"
#include "librpc/gen_ndr/ndr_samr.h"
#include "system/time.h"
#include "auth/auth.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH

View File

@ -24,6 +24,7 @@
#include "includes.h"
#include "librpc/gen_ndr/ndr_samr.h"
#include "librpc/gen_ndr/ndr_netlogon.h"
#include "auth/auth.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH

View File

@ -23,6 +23,7 @@
#include "includes.h"
#include "librpc/gen_ndr/ndr_netlogon.h"
#include "auth/auth.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH

View File

@ -22,6 +22,7 @@
*/
#include "includes.h"
#include "lib/cmdline/popt_common.h"
#include "librpc/gen_ndr/ndr_srvsvc.h"
#include "libcli/raw/libcliraw.h"
#include "system/time.h"

View File

@ -20,6 +20,7 @@
*/
#include "includes.h"
#include "lib/cmdline/popt_common.h"
#include "gtk/common/select.h"
#include "gtk/common/gtk-smb.h"

View File

@ -72,12 +72,10 @@
/** Feel free to add definitions for other compilers here. */
#endif
#include <unistd.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <stddef.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
@ -87,53 +85,15 @@
#include <string.h>
#endif
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
#ifdef HAVE_MEMORY_H
#include <memory.h>
#endif
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#else
#ifdef HAVE_SYS_FCNTL_H
#include <sys/fcntl.h>
#endif
#endif
#include <sys/stat.h>
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
#include <signal.h>
#include <errno.h>
#ifdef HAVE_SYS_MODE_H
/* apparently AIX needs this for S_ISLNK */
#ifndef S_ISLNK
#include <sys/mode.h>
#endif
#endif
#ifdef HAVE_STDARG_H
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#ifdef HAVE_STROPTS_H
#include <stropts.h>
#endif
/* 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
@ -220,10 +180,6 @@ struct ipv4_addr {
#define UINT16_MAX 65535
#endif
/*
* Type for stat structure.
*/
#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
#endif
@ -300,12 +256,6 @@ extern int errno;
#include "librpc/rpc/dcerpc.h"
#include "librpc/gen_ndr/tables.h"
#include "libcli/auth/ntlmssp.h"
#include "libcli/auth/credentials.h"
#include "libcli/auth/gensec.h"
#include "libcli/auth/spnego.h"
#include "auth/auth.h"
#include "smb_interfaces.h"
#include "smbd/server.h"
#include "smbd/service.h"
@ -491,105 +441,11 @@ int vasprintf(char **ptr, const char *format, va_list ap);
#define MSG_WAITALL 0
#endif
/* default socket options. Dave Miller thinks we should default to TCP_NODELAY
given the socket IO pattern that Samba uses */
#ifdef TCP_NODELAY
#define DEFAULT_SOCKET_OPTIONS "TCP_NODELAY"
#else
#define DEFAULT_SOCKET_OPTIONS ""
#endif
/* Load header file for dynamic linking stuff */
#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#endif
/* dmalloc -- free heap debugger (dmalloc.org). This should be near
* the *bottom* of include files so as not to conflict. */
#ifdef ENABLE_DMALLOC
# include <dmalloc.h>
#endif
/* Some POSIX definitions for those without */
#ifndef S_IFDIR
#define S_IFDIR 0x4000
#endif
#ifndef S_ISDIR
#define S_ISDIR(mode) ((mode & 0xF000) == S_IFDIR)
#endif
#ifndef S_IRWXU
#define S_IRWXU 00700 /* read, write, execute: owner */
#endif
#ifndef S_IRUSR
#define S_IRUSR 00400 /* read permission: owner */
#endif
#ifndef S_IWUSR
#define S_IWUSR 00200 /* write permission: owner */
#endif
#ifndef S_IXUSR
#define S_IXUSR 00100 /* execute permission: owner */
#endif
#ifndef S_IRWXG
#define S_IRWXG 00070 /* read, write, execute: group */
#endif
#ifndef S_IRGRP
#define S_IRGRP 00040 /* read permission: group */
#endif
#ifndef S_IWGRP
#define S_IWGRP 00020 /* write permission: group */
#endif
#ifndef S_IXGRP
#define S_IXGRP 00010 /* execute permission: group */
#endif
#ifndef S_IRWXO
#define S_IRWXO 00007 /* read, write, execute: other */
#endif
#ifndef S_IROTH
#define S_IROTH 00004 /* read permission: other */
#endif
#ifndef S_IWOTH
#define S_IWOTH 00002 /* write permission: other */
#endif
#ifndef S_IXOTH
#define S_IXOTH 00001 /* execute permission: other */
#endif
/* For sys_adminlog(). */
#ifndef LOG_EMERG
#define LOG_EMERG 0 /* system is unusable */
#endif
#ifndef LOG_ALERT
#define LOG_ALERT 1 /* action must be taken immediately */
#endif
#ifndef LOG_CRIT
#define LOG_CRIT 2 /* critical conditions */
#endif
#ifndef LOG_ERR
#define LOG_ERR 3 /* error conditions */
#endif
#ifndef LOG_WARNING
#define LOG_WARNING 4 /* warning conditions */
#endif
#ifndef LOG_NOTICE
#define LOG_NOTICE 5 /* normal but significant condition */
#endif
#ifndef LOG_INFO
#define LOG_INFO 6 /* informational */
#endif
#ifndef LOG_DEBUG
#define LOG_DEBUG 7 /* debug-level messages */
#endif
extern int DEBUGLEVEL;
#ifndef RTLD_LAZY
@ -631,25 +487,6 @@ time_t timegm(struct tm *tm);
#define strlen(x) valgrind_strlen(x)
#endif
/*
* Veritas File System. Often in addition to native.
* Quotas different.
*/
#if defined(HAVE_SYS_FS_VX_QUOTA_H)
#define VXFS_QUOTA
#endif
#if HAVE_SYS_ATTRIBUTES_H
#include <sys/attributes.h>
#endif
/* mutually exclusive (SuSE 8.2) */
#if HAVE_ATTR_XATTR_H
#include <attr/xattr.h>
#elif HAVE_SYS_XATTR_H
#include <sys/xattr.h>
#endif
#define TALLOC_ABORT(reason) smb_panic(reason)

View File

@ -111,6 +111,4 @@ typedef struct {
void *cd_direct, *cd_pull, *cd_push;
} *smb_iconv_t;
#include "lib/cmdline/popt_common.h"
#endif /* _REWRITE_H */

View File

@ -44,6 +44,7 @@ struct samr_ChangePasswordUser3;
struct samr_ChangePasswordUser2;
struct samr_CryptPassword;
struct samr_CryptPasswordEx;
struct samr_LogonHours;
struct netr_SamInfo3;
struct netr_Authenticator;
@ -52,3 +53,14 @@ struct iface_struct;
struct tm;
struct utimbuf;
struct auth_usersupplied_info;
struct auth_serversupplied_info;
struct creds_CredentialState;
struct ntlmssp_state;
struct auth_methods;
struct schannel_state;
struct spnego_data;
typedef NTSTATUS (*gensec_password_callback)(struct gensec_security *gensec_security, TALLOC_CTX *mem_ctx,
char **password);

View File

@ -20,6 +20,9 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <unistd.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
@ -58,3 +61,87 @@
#include <sys/file.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#else
#ifdef HAVE_SYS_FCNTL_H
#include <sys/fcntl.h>
#endif
#endif
#ifdef HAVE_SYS_MODE_H
/* apparently AIX needs this for S_ISLNK */
#ifndef S_ISLNK
#include <sys/mode.h>
#endif
#endif
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
/*
* Veritas File System. Often in addition to native.
* Quotas different.
*/
#if defined(HAVE_SYS_FS_VX_QUOTA_H)
#define VXFS_QUOTA
#endif
#if HAVE_SYS_ATTRIBUTES_H
#include <sys/attributes.h>
#endif
/* mutually exclusive (SuSE 8.2) */
#if HAVE_ATTR_XATTR_H
#include <attr/xattr.h>
#elif HAVE_SYS_XATTR_H
#include <sys/xattr.h>
#endif
/* Some POSIX definitions for those without */
#ifndef S_IFDIR
#define S_IFDIR 0x4000
#endif
#ifndef S_ISDIR
#define S_ISDIR(mode) ((mode & 0xF000) == S_IFDIR)
#endif
#ifndef S_IRWXU
#define S_IRWXU 00700 /* read, write, execute: owner */
#endif
#ifndef S_IRUSR
#define S_IRUSR 00400 /* read permission: owner */
#endif
#ifndef S_IWUSR
#define S_IWUSR 00200 /* write permission: owner */
#endif
#ifndef S_IXUSR
#define S_IXUSR 00100 /* execute permission: owner */
#endif
#ifndef S_IRWXG
#define S_IRWXG 00070 /* read, write, execute: group */
#endif
#ifndef S_IRGRP
#define S_IRGRP 00040 /* read permission: group */
#endif
#ifndef S_IWGRP
#define S_IWGRP 00020 /* write permission: group */
#endif
#ifndef S_IXGRP
#define S_IXGRP 00010 /* execute permission: group */
#endif
#ifndef S_IRWXO
#define S_IRWXO 00007 /* read, write, execute: other */
#endif
#ifndef S_IROTH
#define S_IROTH 00004 /* read permission: other */
#endif
#ifndef S_IWOTH
#define S_IWOTH 00002 /* write permission: other */
#endif
#ifndef S_IXOTH
#define S_IXOTH 00001 /* execute permission: other */
#endif

View File

@ -28,3 +28,36 @@
#endif
#endif
/* For sys_adminlog(). */
#ifndef LOG_EMERG
#define LOG_EMERG 0 /* system is unusable */
#endif
#ifndef LOG_ALERT
#define LOG_ALERT 1 /* action must be taken immediately */
#endif
#ifndef LOG_CRIT
#define LOG_CRIT 2 /* critical conditions */
#endif
#ifndef LOG_ERR
#define LOG_ERR 3 /* error conditions */
#endif
#ifndef LOG_WARNING
#define LOG_WARNING 4 /* warning conditions */
#endif
#ifndef LOG_NOTICE
#define LOG_NOTICE 5 /* normal but significant condition */
#endif
#ifndef LOG_INFO
#define LOG_INFO 6 /* informational */
#endif
#ifndef LOG_DEBUG
#define LOG_DEBUG 7 /* debug-level messages */
#endif

View File

@ -20,6 +20,7 @@
*/
#include "includes.h"
#include "auth/auth.h"
/*
close the socket and shutdown a server_context

View File

@ -21,6 +21,7 @@
*/
#include "includes.h"
#include "lib/cmdline/popt_common.h"
/* Handle command line options:
* -d,--debuglevel

View File

@ -20,6 +20,7 @@
*/
#include "includes.h"
#include "lib/cmdline/popt_common.h"
static void writediff(struct registry_key *oldkey, struct registry_key *newkey, FILE *out)
{

View File

@ -21,6 +21,7 @@
*/
#include "includes.h"
#include "lib/cmdline/popt_common.h"
/*
* Routines to parse a REGEDIT4 file

View File

@ -20,6 +20,7 @@
*/
#include "includes.h"
#include "lib/cmdline/popt_common.h"
#include "system/time.h"
/*

View File

@ -20,6 +20,7 @@
*/
#include "includes.h"
#include "lib/cmdline/popt_common.h"
static void print_tree(int l, struct registry_key *p, int fullpath, int novals)
{

View File

@ -23,6 +23,7 @@
#include "includes.h"
#include "system/time.h"
#include "auth/auth.h"
/*
initialise the credentials state for old-style 64 bit session keys

View File

@ -22,6 +22,7 @@
*/
#include "includes.h"
#include "auth/auth.h"
/* the list of currently registered GENSEC backends */
const static struct gensec_security_ops **generic_security_ops;

View File

@ -82,9 +82,6 @@ struct gensec_security_ops {
void (*end)(struct gensec_security *gensec_security);
};
typedef NTSTATUS (*gensec_password_callback)(struct gensec_security *gensec_security, TALLOC_CTX *mem_ctx,
char **password);
#define GENSEC_INTERFACE_VERSION 0
struct gensec_security {

View File

@ -27,6 +27,7 @@
#include "system/kerberos.h"
#include "libcli/auth/kerberos.h"
#include "librpc/gen_ndr/ndr_krb5pac.h"
#include "auth/auth.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH

View File

@ -22,6 +22,7 @@
*/
#include "includes.h"
#include "auth/auth.h"
struct gensec_ntlmssp_state {
struct auth_context *auth_context;

View File

@ -22,6 +22,7 @@
*/
#include "includes.h"
#include "auth/auth.h"
static NTSTATUS ntlmssp_client_initial(struct ntlmssp_state *ntlmssp_state,
TALLOC_CTX *out_mem_ctx,

View File

@ -21,6 +21,7 @@
*/
#include "includes.h"
#include "auth/auth.h"
#define CLI_SIGN "session key to client-to-server signing key magic constant"
#define CLI_SEAL "session key to client-to-server sealing key magic constant"

View File

@ -23,6 +23,7 @@
*/
#include "includes.h"
#include "auth/auth.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH

View File

@ -22,6 +22,7 @@
*/
#include "includes.h"
#include "auth/auth.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH

View File

@ -19,6 +19,7 @@
*/
#include "includes.h"
#include "system/filesys.h"
#include "libcli/raw/libcliraw.h"
/*

View File

@ -26,6 +26,7 @@
#include "includes.h"
#include "system/network.h"
#include "system/iconv.h"
#include "auth/auth.h"
/****************************************************************************
*

View File

@ -21,6 +21,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
#include "auth/auth.h"
#define SETUP_REQUEST_SESSION(cmd, wct, buflen) do { \
req = smbcli_request_setup_session(session, cmd, wct, buflen); \

View File

@ -24,7 +24,7 @@
#include "includes.h"
#include "system/time.h"
#include "byteorder.h"
#include "auth/auth.h"
/*
This implements the X/Open SMB password encryption

View File

@ -123,24 +123,10 @@ interface misc
GUID uuid;
} policy_handle;
/* this is also used in samr and netlogon */
typedef [public, flag(NDR_PAHEX)] struct {
uint16 units_per_week;
[size_is(1260), length_is(units_per_week/8)] uint8 *bitmap;
} samr_LogonHours;
typedef [public, flag(NDR_PAHEX)] struct {
uint8 hash[16];
} samr_Password;
typedef [public,flag(NDR_PAHEX)] struct {
uint8 key[16];
} netr_UserSessionKey;
typedef [public,flag(NDR_PAHEX)] struct {
uint8 key[8];
} netr_LMSessionKey;
typedef [public, flag(NDR_PAHEX)] struct {
uint8 data[8];
} netr_Credential;

View File

@ -129,6 +129,14 @@ interface netlogon
uint32 attributes;
} netr_GroupMembership;
typedef [public,flag(NDR_PAHEX)] struct {
uint8 key[16];
} netr_UserSessionKey;
typedef [public,flag(NDR_PAHEX)] struct {
uint8 key[8];
} netr_LMSessionKey;
typedef [public] struct {
NTTIME last_logon;
NTTIME last_logoff;

View File

@ -567,6 +567,12 @@
uint16 code_page;
} samr_UserInfo2;
/* this is also used in samr and netlogon */
typedef [public, flag(NDR_PAHEX)] struct {
uint16 units_per_week;
[size_is(1260), length_is(units_per_week/8)] uint8 *bitmap;
} samr_LogonHours;
typedef struct {
samr_Name account_name;
samr_Name full_name;

View File

@ -22,6 +22,7 @@
#include "includes.h"
#include "librpc/gen_ndr/ndr_schannel.h"
#include "auth/auth.h"
enum schannel_position {
DCERPC_SCHANNEL_STATE_START = 0,

View File

@ -22,6 +22,7 @@
*/
#include "includes.h"
#include "auth/auth.h"
struct unixuid_private {
void *samctx;

View File

@ -55,6 +55,7 @@
#include "includes.h"
#include "system/time.h"
#include "system/iconv.h"
#include "system/network.h"
#include "librpc/gen_ndr/ndr_svcctl.h"
BOOL in_client = False; /* Not in the client by default */
@ -911,7 +912,9 @@ static void init_globals(void)
/* options that can be set on the command line must be initialised via
the slower do_parameter() to ensure that FLAG_CMDLINE is obeyed */
do_parameter("socket options", DEFAULT_SOCKET_OPTIONS);
#ifdef TCP_NODELAY
do_parameter("socket options", "TCP_NODELAY");
#endif
do_parameter("workgroup", DEFAULT_WORKGROUP);
do_parameter("netbios name", get_myname());
do_parameter("max protocol", "NT1");

View File

@ -23,8 +23,8 @@
#include "includes.h"
#include "librpc/gen_ndr/ndr_epmapper.h"
#include "librpc/gen_ndr/ndr_dcom.h"
#include "librpc/gen_ndr/ndr_oxidresolver.h"
#include "auth/auth.h"
/*
see if two endpoints match

View File

@ -23,6 +23,8 @@
#include "includes.h"
#include "librpc/gen_ndr/ndr_netlogon.h"
#include "rpc_server/common/common.h"
#include "librpc/gen_ndr/ndr_dcom.h"
#include "auth/auth.h"
struct server_pipe_state {
struct netr_Credential client_challenge;

View File

@ -22,6 +22,7 @@
#include "includes.h"
#include "system/time.h"
#include "auth/auth.h"
/* a reasonable amount of time to keep credentials live */
#define SCHANNEL_CREDENTIALS_EXPIRY 600

View File

@ -1054,7 +1054,7 @@ static NTSTATUS samr_OpenGroup(struct dcesrv_call_state *dce_call, TALLOC_CTX *m
} while (0)
#define SET_LHOURS(msg, field, attr) do { \
if (samdb_msg_add_logon_hours(a_state->sam_ctx, mem_ctx, msg, attr, r->in.info->field) != 0) { \
if (samdb_msg_add_logon_hours(a_state->sam_ctx, mem_ctx, msg, attr, &r->in.info->field) != 0) { \
return NT_STATUS_NO_MEMORY; \
} \
} while (0)

View File

@ -21,6 +21,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_netlogon.h"
/*
connect to the SAM database
@ -789,12 +790,12 @@ int samdb_msg_add_acct_flags(void *ctx, TALLOC_CTX *mem_ctx, struct ldb_message
add a logon_hours element to a message
*/
int samdb_msg_add_logon_hours(void *ctx, TALLOC_CTX *mem_ctx, struct ldb_message *msg,
const char *attr_name, struct samr_LogonHours hours)
const char *attr_name, struct samr_LogonHours *hours)
{
struct ldb_wrap *sam_ctx = ctx;
struct ldb_val val;
val.length = hours.units_per_week / 8;
val.data = hours.bitmap;
val.length = hours->units_per_week / 8;
val.data = hours->bitmap;
ldb_set_alloc(sam_ctx->ldb, talloc_realloc_fn, mem_ctx);
return ldb_msg_add_value(sam_ctx->ldb, msg, attr_name, &val);
}

View File

@ -19,6 +19,7 @@
*/
#include "includes.h"
#include "auth/auth.h"
/* initialise the auth_context for this server and return the cryptkey */
static void get_challenge(struct smbsrv_connection *smb_conn, char buff[8])

View File

@ -22,6 +22,7 @@
*/
#include "includes.h"
#include "auth/auth.h"
/*
setup the OS, Lanman and domain portions of a session setup reply

View File

@ -22,6 +22,7 @@
*/
#include "includes.h"
#include "lib/cmdline/popt_common.h"
static void exit_server(const char *reason)
{

View File

@ -19,6 +19,7 @@
*/
#include "includes.h"
#include "auth/auth.h"
BOOL torture_ntlmssp_self_check(void)
{

View File

@ -24,6 +24,7 @@
#include "includes.h"
#include "librpc/gen_ndr/ndr_netlogon.h"
#include "auth/auth.h"
static const char *machine_password;

View File

@ -19,6 +19,7 @@
*/
#include "includes.h"
#include "lib/cmdline/popt_common.h"
#include "libcli/raw/libcliraw.h"
#include "system/time.h"

View File

@ -19,6 +19,7 @@
*/
#include "includes.h"
#include "lib/cmdline/popt_common.h"
#include "system/iconv.h"
static const struct dcerpc_interface_table *find_pipe(const char *pipe_name)

View File

@ -42,6 +42,7 @@
/*****************************************************/
#include "includes.h"
#include "lib/cmdline/popt_common.h"
/*
run a function from a function table. If not found then

View File

@ -23,6 +23,8 @@
*/
#include "includes.h"
#include "lib/cmdline/popt_common.h"
#include "auth/auth.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND