Revert "s3/s4: Move CONST_DISCARD into lib/util so it's available from s3 and s4"
[tprouty/samba.git] / source3 / include / includes.h
index 73600e379b47df2bfe67a979fb67c09eb611886d..930df6e36cd33227fe229b7f2d0549df934ee9ad 100644 (file)
@@ -524,14 +524,6 @@ struct timespec {
 };
 #endif
 
-#ifndef MIN
-#define MIN(a,b) ((a)<(b)?(a):(b))
-#endif
-
-#ifndef MAX
-#define MAX(a,b) ((a)>(b)?(a):(b))
-#endif
-
 #ifdef HAVE_BROKEN_GETGROUPS
 #define GID_T int
 #else
@@ -567,7 +559,6 @@ typedef char fstring[FSTRING_LEN];
 #endif
 
 /* Samba 3 doesn't use iconv_convenience: */
-extern void *global_loadparm;
 extern void *cmdline_lp_ctx;
 struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx);
 
@@ -583,6 +574,8 @@ struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx);
 
 #include "../talloc/talloc.h"
 
+#include "event.h"
+
 #include "../lib/util/data_blob.h"
 #include "../lib/util/time.h"
 #include "../lib/util/asn1.h"
@@ -601,7 +594,6 @@ struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx);
 #include "dynconfig.h"
 #include "util_getent.h"
 #include "debugparse.h"
-#include "version.h"
 #include "privileges.h"
 #include "messages.h"
 #include "locking.h"
@@ -627,13 +619,9 @@ struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx);
 #include "ntlmssp.h"
 #include "auth.h"
 #include "ntdomain.h"
-#include "rpc_svcctl.h"
-#include "rpc_ntsvcs.h"
-#include "rpc_lsa.h"
 #include "reg_objects.h"
 #include "reg_db.h"
 #include "rpc_spoolss.h"
-#include "rpc_eventlog.h"
 #include "rpc_perfcount.h"
 #include "rpc_perfcount_defs.h"
 #include "librpc/gen_ndr/notify.h"
@@ -652,18 +640,21 @@ struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx);
 #include "nsswitch/winbind_client.h"
 #include "spnego.h"
 #include "rpc_client.h"
-#include "event.h"
 #include "dbwrap.h"
 #include "packet.h"
 #include "ctdbd_conn.h"
 #include "../lib/util/talloc_stack.h"
 #include "memcache.h"
-#include "async_req.h"
+#include "../lib/async_req/async_req_ntstatus.h"
 #include "async_smb.h"
-#include "async_sock.h"
+#include "../lib/async_req/async_sock.h"
 #include "services.h"
+#include "eventlog.h"
 
 #include "lib/smbconf/smbconf.h"
+#include "lib/smbconf/smbconf_init.h"
+#include "lib/smbconf/smbconf_reg.h"
+#include "lib/smbconf/smbconf_txt.h"
 
 /* Defines for wisXXX functions. */
 #define UNI_UPPER    0x1
@@ -685,20 +676,6 @@ struct printjob;
 
 #include "smb_ldap.h"
 
-struct dns_reg_state;
-
-void dns_register_smbd(struct dns_reg_state ** dns_state_ptr,
-               unsigned port,
-               int *maxfd,
-               fd_set *listen_set,
-               struct timeval *timeout);
-
-void dns_register_close(struct dns_reg_state ** dns_state_ptr);
-
-
-bool dns_register_smbd_reply(struct dns_reg_state *dns_state,
-               fd_set *lfds, struct timeval *timeout);
-
 /*
  * Reasons for cache flush.
  */
@@ -719,7 +696,7 @@ enum flush_reason_enum {
 #include "modules/nfs4_acls.h"
 #include "nsswitch/libwbclient/wbclient.h"
 
-/***** automatically generated prototypes *****/
+/***** prototypes *****/
 #ifndef NO_PROTO_H
 #include "proto.h"
 #endif
@@ -812,14 +789,6 @@ enum flush_reason_enum {
 #define ULTRIX_AUTH 1
 #endif
 
-#if (defined(USE_SETRESUID) && !defined(HAVE_SETRESUID_DECL))
-/* stupid glibc */
-int setresuid(uid_t ruid, uid_t euid, uid_t suid);
-#endif
-#if (defined(USE_SETRESUID) && !defined(HAVE_SETRESGID_DECL))
-int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
-#endif
-
 /* yuck, I'd like a better way of doing this */
 #define DIRP_SIZE (256 + 32)
 
@@ -892,11 +861,6 @@ int smb_xvasprintf(char **ptr, const char *format, va_list ap) PRINTF_ATTRIBUTE(
 int asprintf_strupper_m(char **strp, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
 char *talloc_asprintf_strupper_m(TALLOC_CTX *t, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
 
-/* we used to use these fns, but now we have good replacements
-   for snprintf and vsnprintf */
-#define slprintf snprintf
-#define vslprintf vsnprintf
-
 /*
  * Veritas File System.  Often in addition to native.
  * Quotas different.
@@ -913,8 +877,25 @@ char *talloc_asprintf_strupper_m(TALLOC_CTX *t, const char *fmt, ...) PRINTF_ATT
 #define XATTR_REPLACE 0x2       /* set value, fail if attr does not exist */
 #endif
 
-#if defined(HAVE_KRB5)
+/*
+ * This should be under the HAVE_KRB5 flag but since they're used
+ * in lp_kerberos_method(), they ned to be always available
+ */
+#define KERBEROS_VERIFY_SECRETS 0
+#define KERBEROS_VERIFY_SYSTEM_KEYTAB 1
+#define KERBEROS_VERIFY_DEDICATED_KEYTAB 2
+#define KERBEROS_VERIFY_SECRETS_AND_KEYTAB 3
 
+/*
+ * If you add any entries to the above, please modify the below expressions
+ * so they remain accurate.
+ */
+#define USE_KERBEROS_KEYTAB (KERBEROS_VERIFY_SECRETS != lp_kerberos_method())
+#define USE_SYSTEM_KEYTAB \
+    ((KERBEROS_VERIFY_SECRETS_AND_KEYTAB == lp_kerberos_method()) || \
+     (KERBEROS_VERIFY_SYSTEM_KEYTAB == lp_kerberos_method()))
+
+#if defined(HAVE_KRB5)
 krb5_error_code smb_krb5_parse_name(krb5_context context,
                                const char *name, /* in unix charset */
                                 krb5_principal *principal);