mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
r3425: got rid of a bunch of cruft from rewrite.h
(This used to be commit 3f902f8d85
)
This commit is contained in:
parent
37fffa54cf
commit
475c958450
@ -51,89 +51,9 @@ typedef int BOOL;
|
||||
#include "debug.h"
|
||||
#include "doserr.h"
|
||||
|
||||
/* for compatibility */
|
||||
#define SID_NAME_USE samr_SidType
|
||||
|
||||
/* used to hold an arbitrary blob of data */
|
||||
typedef struct data_blob {
|
||||
uint8_t *data;
|
||||
size_t length;
|
||||
} DATA_BLOB;
|
||||
|
||||
/* Globally Unique ID */
|
||||
#define GUID_SIZE 16
|
||||
|
||||
/* 64 bit time (100 nanosec) 1601 - cifs6.txt, section 3.5, page 30 */
|
||||
typedef uint64_t NTTIME;
|
||||
|
||||
/* 8 byte aligned 'hyper' type from MS IDL */
|
||||
typedef uint64_t HYPER_T;
|
||||
|
||||
|
||||
#include "enums.h"
|
||||
#include "events.h"
|
||||
|
||||
/* used for network interfaces */
|
||||
struct interface
|
||||
{
|
||||
struct interface *next, *prev;
|
||||
struct in_addr ip;
|
||||
struct in_addr bcast;
|
||||
struct in_addr nmask;
|
||||
};
|
||||
|
||||
/* the following are used by loadparm for option lists */
|
||||
typedef enum
|
||||
{
|
||||
P_BOOL,P_BOOLREV,P_CHAR,P_INTEGER,P_OCTAL,P_LIST,
|
||||
P_STRING,P_USTRING,P_ENUM,P_SEP
|
||||
} parm_type;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
P_LOCAL,P_GLOBAL,P_SEPARATOR,P_NONE
|
||||
} parm_class;
|
||||
|
||||
struct enum_list {
|
||||
int value;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
struct parm_struct
|
||||
{
|
||||
const char *label;
|
||||
parm_type type;
|
||||
parm_class class;
|
||||
void *ptr;
|
||||
BOOL (*special)(const char *, char **);
|
||||
const struct enum_list *enum_list;
|
||||
uint_t flags;
|
||||
union {
|
||||
BOOL bvalue;
|
||||
int ivalue;
|
||||
char *svalue;
|
||||
char cvalue;
|
||||
char **lvalue;
|
||||
} def;
|
||||
};
|
||||
|
||||
struct bitmap {
|
||||
uint32_t *b;
|
||||
uint_t n;
|
||||
};
|
||||
|
||||
#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. */
|
||||
#define FLAG_CMDLINE 0x8000 /* this option was set from the command line */
|
||||
|
||||
#ifndef LOCKING_VERSION
|
||||
#define LOCKING_VERSION 4
|
||||
#endif /* LOCKING_VERSION */
|
||||
@ -196,42 +116,10 @@ struct nmb_name {
|
||||
};
|
||||
|
||||
|
||||
/* A netbios node status array element. */
|
||||
struct node_status {
|
||||
char name[16];
|
||||
uint8_t type;
|
||||
uint8_t flags;
|
||||
};
|
||||
|
||||
#include "rpc_secdes.h"
|
||||
|
||||
#include "client.h"
|
||||
|
||||
/*
|
||||
Do you want session setups at user level security with a invalid
|
||||
password to be rejected or allowed in as guest? WinNT rejects them
|
||||
but it can be a pain as it means "net view" needs to use a password
|
||||
|
||||
You have 3 choices in the setting of map_to_guest:
|
||||
|
||||
"NEVER_MAP_TO_GUEST" means session setups with an invalid password
|
||||
are rejected. This is the default.
|
||||
|
||||
"MAP_TO_GUEST_ON_BAD_USER" means session setups with an invalid password
|
||||
are rejected, unless the username does not exist, in which case it
|
||||
is treated as a guest login
|
||||
|
||||
"MAP_TO_GUEST_ON_BAD_PASSWORD" means session setups with an invalid password
|
||||
are treated as a guest login
|
||||
|
||||
Note that map_to_guest only has an effect in user or server
|
||||
level security.
|
||||
*/
|
||||
|
||||
#define NEVER_MAP_TO_GUEST 0
|
||||
#define MAP_TO_GUEST_ON_BAD_USER 1
|
||||
#define MAP_TO_GUEST_ON_BAD_PASSWORD 2
|
||||
|
||||
#define SAFE_NETBIOS_CHARS ". -_"
|
||||
|
||||
/* generic iconv conversion structure */
|
||||
|
@ -200,6 +200,19 @@ typedef struct nt_user_token {
|
||||
struct dom_sid **user_sids;
|
||||
} NT_USER_TOKEN;
|
||||
|
||||
/* used to hold an arbitrary blob of data */
|
||||
typedef struct data_blob {
|
||||
uint8_t *data;
|
||||
size_t length;
|
||||
} DATA_BLOB;
|
||||
|
||||
/* 64 bit time (100 nanosec) 1601 - cifs6.txt, section 3.5, page 30 */
|
||||
typedef uint64_t NTTIME;
|
||||
|
||||
/* 8 byte aligned 'hyper' type from MS IDL */
|
||||
typedef uint64_t HYPER_T;
|
||||
|
||||
|
||||
/* the basic packet size, assuming no words or bytes. Does not include the NBT header */
|
||||
#define MIN_SMB_SIZE 35
|
||||
|
||||
|
@ -26,6 +26,14 @@ static int total_probed;
|
||||
static struct in_addr allones_ip;
|
||||
struct in_addr loopback_ip;
|
||||
|
||||
/* used for network interfaces */
|
||||
struct interface {
|
||||
struct interface *next, *prev;
|
||||
struct in_addr ip;
|
||||
struct in_addr bcast;
|
||||
struct in_addr nmask;
|
||||
};
|
||||
|
||||
static struct interface *local_interfaces;
|
||||
|
||||
#define ALLONES ((uint32_t)0xFFFFFFFF)
|
||||
|
@ -28,7 +28,7 @@
|
||||
NTSTATUS ads_name_to_sid(ADS_STRUCT *ads,
|
||||
const char *name,
|
||||
DOM_SID *sid,
|
||||
enum SID_NAME_USE *type)
|
||||
enum samr_SidType *type)
|
||||
{
|
||||
const char *attrs[] = {"objectSid", "sAMAccountType", NULL};
|
||||
int count;
|
||||
@ -95,7 +95,7 @@ NTSTATUS ads_sid_to_name(ADS_STRUCT *ads,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
const DOM_SID *sid,
|
||||
char **name,
|
||||
enum SID_NAME_USE *type)
|
||||
enum samr_SidType *type)
|
||||
{
|
||||
const char *attrs[] = {"userPrincipalName",
|
||||
"sAMAccountName",
|
||||
|
@ -21,6 +21,14 @@
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
/* A netbios node status array element. */
|
||||
struct node_status {
|
||||
char name[16];
|
||||
uint8_t type;
|
||||
uint8_t flags;
|
||||
};
|
||||
|
||||
|
||||
/* nmbd.c sets this to True. */
|
||||
BOOL global_in_nmbd = False;
|
||||
|
||||
|
@ -78,6 +78,56 @@ static BOOL do_parameter_var(const char *pszParmName, const char *fmt, ...);
|
||||
|
||||
static BOOL defaults_saved = False;
|
||||
|
||||
|
||||
#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. */
|
||||
#define FLAG_CMDLINE 0x8000 /* this option was set from the command line */
|
||||
|
||||
|
||||
/* the following are used by loadparm for option lists */
|
||||
typedef enum
|
||||
{
|
||||
P_BOOL,P_BOOLREV,P_CHAR,P_INTEGER,P_OCTAL,P_LIST,
|
||||
P_STRING,P_USTRING,P_ENUM,P_SEP
|
||||
} parm_type;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
P_LOCAL,P_GLOBAL,P_SEPARATOR,P_NONE
|
||||
} parm_class;
|
||||
|
||||
struct enum_list {
|
||||
int value;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
struct parm_struct
|
||||
{
|
||||
const char *label;
|
||||
parm_type type;
|
||||
parm_class class;
|
||||
void *ptr;
|
||||
BOOL (*special)(const char *, char **);
|
||||
const struct enum_list *enum_list;
|
||||
uint_t flags;
|
||||
union {
|
||||
BOOL bvalue;
|
||||
int ivalue;
|
||||
char *svalue;
|
||||
char cvalue;
|
||||
char **lvalue;
|
||||
} def;
|
||||
};
|
||||
|
||||
|
||||
struct param_opt {
|
||||
struct param_opt *prev, *next;
|
||||
char *key;
|
||||
@ -465,33 +515,6 @@ static const struct enum_list enum_smb_signing_vals[] = {
|
||||
{-1, NULL}
|
||||
};
|
||||
|
||||
/*
|
||||
Do you want session setups at user level security with a invalid
|
||||
password to be rejected or allowed in as guest? WinNT rejects them
|
||||
but it can be a pain as it means "net view" needs to use a password
|
||||
|
||||
You have 3 choices in the setting of map_to_guest:
|
||||
|
||||
"Never" means session setups with an invalid password
|
||||
are rejected. This is the default.
|
||||
|
||||
"Bad User" means session setups with an invalid password
|
||||
are rejected, unless the username does not exist, in which case it
|
||||
is treated as a guest login
|
||||
|
||||
"Bad Password" means session setups with an invalid password
|
||||
are treated as a guest login
|
||||
|
||||
Note that map_to_guest only has an effect in user or server
|
||||
level security.
|
||||
*/
|
||||
|
||||
static const struct enum_list enum_map_to_guest[] = {
|
||||
{NEVER_MAP_TO_GUEST, "Never"},
|
||||
{MAP_TO_GUEST_ON_BAD_USER, "Bad User"},
|
||||
{MAP_TO_GUEST_ON_BAD_PASSWORD, "Bad Password"},
|
||||
{-1, NULL}
|
||||
};
|
||||
|
||||
/* Note: We do not initialise the defaults union - it is not allowed in ANSI C
|
||||
*
|
||||
@ -1375,26 +1398,6 @@ static BOOL lp_bool(const char *s)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
convenience routine to return enum parameters.
|
||||
********************************************************************/
|
||||
static int lp_enum(const char *s,const struct enum_list *_enum)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!s || !_enum) {
|
||||
DEBUG(0,("lp_enum(%s,enum): is called with NULL!\n",s));
|
||||
return False;
|
||||
}
|
||||
|
||||
for (i=0; _enum[i].name; i++) {
|
||||
if (strcasecmp(_enum[i].name,s)==0)
|
||||
return _enum[i].value;
|
||||
}
|
||||
|
||||
DEBUG(0,("lp_enum(%s,enum): value is not in enum_list!\n",s));
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* Return parametric option from a given service. Type is a part of option before ':' */
|
||||
/* Parametric option has following syntax: 'Type: option = value' */
|
||||
@ -1464,20 +1467,6 @@ BOOL lp_parm_bool(int lookup_service, const char *type, const char *option, BOOL
|
||||
return default_v;
|
||||
}
|
||||
|
||||
/* Return parametric option from a given service. Type is a part of option before ':' */
|
||||
/* Parametric option has following syntax: 'Type: option = value' */
|
||||
|
||||
int lp_parm_enum(int lookup_service, const char *type, const char *option,
|
||||
const struct enum_list *_enum)
|
||||
{
|
||||
const char *value = get_parametrics(lookup_service, type, option);
|
||||
|
||||
if (value)
|
||||
return lp_enum(value, _enum);
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
Initialise a service to the defaults.
|
||||
@ -2717,19 +2706,6 @@ static void dump_globals(FILE *f)
|
||||
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
Return True if a local parameter is currently set to the global default.
|
||||
***************************************************************************/
|
||||
|
||||
BOOL lp_is_default(int snum, struct parm_struct *parm)
|
||||
{
|
||||
int pdiff = PTR_DIFF(parm->ptr, &sDefault);
|
||||
|
||||
return equal_parameter(parm->type,
|
||||
((char *)ServicePtrs[snum]) + pdiff,
|
||||
((char *)&sDefault) + pdiff);
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
Display the contents of a single services record.
|
||||
***************************************************************************/
|
||||
|
@ -118,7 +118,7 @@ uint32_t samdb_gtype2atype(uint32_t gtype)
|
||||
}
|
||||
|
||||
/* turn a sAMAccountType into a SID_NAME_USE */
|
||||
enum SID_NAME_USE samdb_atype_map(uint32_t atype)
|
||||
enum samr_SidType samdb_atype_map(uint32_t atype)
|
||||
{
|
||||
switch (atype & 0xF0000000) {
|
||||
case ATYPE_GLOBAL_GROUP:
|
||||
|
@ -213,7 +213,6 @@ struct smbsrv_connection {
|
||||
/* the context associated with open files on an smb socket */
|
||||
struct {
|
||||
struct files_struct *files; /* open files */
|
||||
struct bitmap *file_bmap; /* bitmap used to allocate file handles */
|
||||
|
||||
/* a fsp to use when chaining */
|
||||
struct files_struct *chain_fsp;
|
||||
|
@ -390,7 +390,7 @@ static NTSTATUS trans2_qfsinfo(struct smbsrv_request *req, struct smb_trans2 *tr
|
||||
return status;
|
||||
}
|
||||
|
||||
memcpy(trans->out.data.data, guid_blob.data, GUID_SIZE);
|
||||
memcpy(trans->out.data.data, guid_blob.data, guid_blob.length);
|
||||
|
||||
for (i=0;i<6;i++) {
|
||||
SBVAL(trans->out.data.data, 16 + 8*i, fsinfo.objectid_information.out.unknown[i]);
|
||||
|
Loading…
Reference in New Issue
Block a user