#include "auth/auth.h"
#include "librpc/gen_ndr/ndr_samr.h"
#include "librpc/gen_ndr/ndr_security.h"
-#include "pstring.h"
/**
* Return an error based on username
{
NTSTATUS nt_status;
struct auth_serversupplied_info *server_info;
- fstring user;
uint32_t error_num;
- fstrcpy(user, user_info->client.account_name);
+ const char *user;
+
+ user = user_info->client.account_name;
if (strncasecmp("NT_STATUS", user, strlen("NT_STATUS")) == 0) {
nt_status = nt_status_string_to_code(user);
#include "system/time.h"
#include "auth/kerberos/kerberos.h"
#include "secrets.h"
-#include "pstring.h"
#include "ads.h"
#ifdef HAVE_KRB5
#include "asn_1.h"
#include "lib/ldb/include/ldb.h"
#include "secrets.h"
-#include "pstring.h"
#ifdef HAVE_KRB5
#include "dlinklist.h"
#include "credentials.h"
#include "system/readline.h"
+#include "pstring.h"
#ifndef REGISTER
#define REGISTER 0
enum protocol_types {PROTOCOL_NONE,PROTOCOL_CORE,PROTOCOL_COREPLUS,PROTOCOL_LANMAN1,PROTOCOL_LANMAN2,PROTOCOL_NT1};
/* security levels */
-enum security_types {SEC_SHARE,SEC_USER,SEC_SERVER,SEC_DOMAIN,SEC_ADS};
-
-/* printing types */
-enum printing_types {PRINT_BSD,PRINT_SYSV,PRINT_AIX,PRINT_HPUX,
- PRINT_QNX,PRINT_PLP,PRINT_LPRNG,PRINT_SOFTQ,
- PRINT_CUPS,PRINT_LPRNT,PRINT_LPROS2
-#ifdef DEVELOPER
-,PRINT_TEST,PRINT_VLP
-#endif /* DEVELOPER */
-};
-
-/* LDAP schema types */
-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_WINXP, RA_SAMBA};
-
-/* case handling */
-enum case_handling {CASE_LOWER,CASE_UPPER};
-
+enum security_types {SEC_SHARE,SEC_USER};
#include <varargs.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
-#endif
-
/* tell ldb we have the internal ldap code */
#define HAVE_ILDAP 1
#define _POPT_COMMON_H
#include "popt.h"
-#include "pstring.h"
/* Common popt structures */
extern struct poptOption popt_common_samba[];
*/
#include "includes.h"
-#include "pstring.h"
#include "system/filesys.h"
#ifndef O_NONBLOCK
int fd;
char pidstr[20];
uint_t ret;
- pstring pidFile;
+ char *pidFile;
- slprintf(pidFile, sizeof(pidFile)-1, "%s/%s.pid", lp_piddir(), name);
+ asprintf(&pidFile, "%s/%s.pid", lp_piddir(), name);
fd = open(pidFile, O_NONBLOCK | O_RDONLY, 0644);
+ SAFE_FREE(pidFile);
+
if (fd == -1) {
return 0;
}
{
int fd;
char buf[20];
- pstring pidFile;
+ char *pidFile;
pid_t pid;
- slprintf(pidFile, sizeof(pidFile)-1, "%s/%s.pid", lp_piddir(), name);
+ asprintf(&pidFile, "%s/%s.pid", lp_piddir(), name);
pid = pidfile_pid(name);
if (pid != 0) {
pidFile, strerror(errno)));
exit(1);
}
+
/* Leave pid file open & locked for the duration... */
+ SAFE_FREE(pidFile);
}
/*****************************************************************************
returns the NT_STATUS constant matching the string supplied (as an NTSTATUS)
*****************************************************************************/
-NTSTATUS nt_status_string_to_code(char *nt_status_str)
+NTSTATUS nt_status_string_to_code(const char *nt_status_str)
{
int idx = 0;
static const struct enum_list enum_security[] = {
{SEC_SHARE, "SHARE"},
{SEC_USER, "USER"},
- {SEC_SERVER, "SERVER"},
- {SEC_DOMAIN, "DOMAIN"},
-#ifdef HAVE_ADS
- {SEC_ADS, "ADS"},
-#endif
{-1, NULL}
};
#include "lib/tdb/include/tdbutil.h"
#include "secrets.h"
#include "system/filesys.h"
-#include "pstring.h"
#include "db_wrap.h"
#include "lib/ldb/include/ldb.h"
/* open up the secrets database */
BOOL secrets_init(void)
{
- pstring fname;
+ char *fname;
uint8_t dummy;
if (tdb)
return True;
- pstrcpy(fname, lp_private_dir());
- pstrcat(fname,"/secrets.tdb");
+ asprintf(&fname, "%s/secrets.tdb", lp_private_dir());
tdb = tdb_wrap_open(talloc_autofree_context(), fname, 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
if (!tdb) {
DEBUG(0,("Failed to open %s\n", fname));
+ SAFE_FREE(fname);
return False;
}
+ SAFE_FREE(fname);
/**
* Set a reseed function for the crypto random generator
secrets_init();
if (!tdb)
return NULL;
- kbuf.dptr = strdup(key);
+ kbuf.dptr = (uint8_t *)strdup(key);
kbuf.dsize = strlen(key);
dbuf = tdb_fetch(tdb->tdb, kbuf);
if (size)
char *user_name;
};
+/* Remote architectures we know about. */
+enum remote_arch_types {RA_UNKNOWN, RA_WFWG, RA_OS2, RA_WIN95, RA_WINNT, RA_WIN2K, RA_WINXP, RA_SAMBA};
+
/* smb server context structure. This should contain all the state
* information associated with a SMB server connection
*/
#include "auth/auth.h"
#include "librpc/gen_ndr/ndr_security.h"
#include "credentials.h"
+#include "pstring.h"
#define SQUID_BUFFER_SIZE 2010