summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/build_options.c4
-rw-r--r--source3/smbd/chgpasswd.c112
-rw-r--r--source3/smbd/connection.c6
-rw-r--r--source3/smbd/dir.c21
-rw-r--r--source3/smbd/filename.c6
-rw-r--r--source3/smbd/lanman.c59
-rw-r--r--source3/smbd/mangle.c4
-rw-r--r--source3/smbd/mangle_hash.c8
-rw-r--r--source3/smbd/negprot.c6
-rw-r--r--source3/smbd/nttrans.c2
-rw-r--r--source3/smbd/process.c4
-rw-r--r--source3/smbd/reply.c2
-rw-r--r--source3/smbd/server.c14
-rw-r--r--source3/smbd/utmp.c2
-rw-r--r--source3/smbd/vfs.c2
15 files changed, 100 insertions, 152 deletions
diff --git a/source3/smbd/build_options.c b/source3/smbd/build_options.c
index da5accebab..085f287446 100644
--- a/source3/smbd/build_options.c
+++ b/source3/smbd/build_options.c
@@ -23,7 +23,7 @@
#include "build_env.h"
#include "dynconfig.h"
-static void output(BOOL screen, const char *format, ...) PRINTF_ATTRIBUTE(2,3);
+static void output(BOOL screen, char *format, ...) PRINTF_ATTRIBUTE(2,3);
/*
#define OUTPUT(x) snprintf(outstring,sizeof(outstring),x); output(screen,outstring);
@@ -31,7 +31,7 @@ static void output(BOOL screen, const char *format, ...) PRINTF_ATTRIBUTE(2,3);
/****************************************************************************
helper function for build_options
****************************************************************************/
-static void output(BOOL screen, const char *format, ...)
+static void output(BOOL screen, char *format, ...)
{
char *ptr;
va_list ap;
diff --git a/source3/smbd/chgpasswd.c b/source3/smbd/chgpasswd.c
index 80b412af49..c2a82d1eb6 100644
--- a/source3/smbd/chgpasswd.c
+++ b/source3/smbd/chgpasswd.c
@@ -2,7 +2,6 @@
Unix SMB/CIFS implementation.
Samba utility functions
Copyright (C) Andrew Tridgell 1992-1998
- Copyright (C) Andrew Bartlett 2001-2002
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
@@ -51,7 +50,7 @@
extern struct passdb_ops pdb_ops;
-static NTSTATUS check_oem_password(const char *user,
+static BOOL check_oem_password(const char *user,
uchar * lmdata, const uchar * lmhash,
const uchar * ntdata, const uchar * nthash,
SAM_ACCOUNT **hnd, char *new_passwd,
@@ -479,10 +478,6 @@ BOOL chgpasswd(const char *name, const char *oldpass, const char *newpass, BOOL
DEBUG(1, ("NULL username specfied to chgpasswd()!\n"));
}
- if (!oldpass) {
- oldpass = "";
- }
-
DEBUG(3, ("Password change for user: %s\n", name));
#if DEBUG_PASSWORD
@@ -737,19 +732,15 @@ BOOL change_lanman_password(SAM_ACCOUNT *sampass, uchar * pass1,
/***********************************************************
Code to check and change the OEM hashed password.
************************************************************/
-NTSTATUS pass_oem_change(char *user,
- uchar * lmdata, uchar * lmhash,
- uchar * ntdata, uchar * nthash)
+BOOL pass_oem_change(char *user,
+ uchar * lmdata, uchar * lmhash,
+ uchar * ntdata, uchar * nthash)
{
fstring new_passwd;
const char *unix_user;
SAM_ACCOUNT *sampass = NULL;
- NTSTATUS nt_status
- = check_oem_password(user, lmdata, lmhash, ntdata, nthash,
- &sampass, new_passwd, sizeof(new_passwd));
-
- if (NT_STATUS_IS_OK(nt_status))
- return nt_status;
+ BOOL ret = check_oem_password(user, lmdata, lmhash, ntdata, nthash,
+ &sampass, new_passwd, sizeof(new_passwd));
/*
* At this point we have the new case-sensitive plaintext
@@ -762,13 +753,17 @@ NTSTATUS pass_oem_change(char *user,
unix_user = pdb_get_username(sampass);
- nt_status = change_oem_password(sampass, NULL, new_passwd);
+ if ((ret) && (unix_user) && (*unix_user) && lp_unix_password_sync())
+ ret = chgpasswd(unix_user, "", new_passwd, True);
+
+ if (ret)
+ ret = change_oem_password(sampass, new_passwd);
memset(new_passwd, 0, sizeof(new_passwd));
pdb_free_sam(&sampass);
- return nt_status;
+ return ret;
}
/***********************************************************
@@ -778,7 +773,7 @@ NTSTATUS pass_oem_change(char *user,
but does use the lm OEM password to check the nt hashed-hash.
************************************************************/
-static NTSTATUS check_oem_password(const char *user,
+static BOOL check_oem_password(const char *user,
uchar * lmdata, const uchar * lmhash,
const uchar * ntdata, const uchar * nthash,
SAM_ACCOUNT **hnd, char *new_passwd,
@@ -807,11 +802,7 @@ static NTSTATUS check_oem_password(const char *user,
if (ret == False) {
DEBUG(0, ("check_oem_password: getsmbpwnam returned NULL\n"));
- return NT_STATUS_WRONG_PASSWORD;
- /*
- TODO: check what Win2k returns for this:
- return NT_STATUS_NO_SUCH_USER;
- */
+ return False;
}
*hnd = sampass;
@@ -820,7 +811,7 @@ static NTSTATUS check_oem_password(const char *user,
if (acct_ctrl & ACB_DISABLED) {
DEBUG(0,("check_lanman_password: account %s disabled.\n", user));
- return NT_STATUS_ACCOUNT_DISABLED;
+ return False;
}
/* construct a null password (in case one is needed */
@@ -836,14 +827,14 @@ static NTSTATUS check_oem_password(const char *user,
if (lanman_pw == NULL) {
if (!(acct_ctrl & ACB_PWNOTREQ)) {
DEBUG(0,("check_oem_password: no lanman password !\n"));
- return NT_STATUS_WRONG_PASSWORD;
+ return False;
}
}
if (pdb_get_nt_passwd(sampass) == NULL && nt_pass_set) {
if (!(acct_ctrl & ACB_PWNOTREQ)) {
DEBUG(0,("check_oem_password: no ntlm password !\n"));
- return NT_STATUS_WRONG_PASSWORD;
+ return False;
}
}
@@ -860,7 +851,7 @@ static NTSTATUS check_oem_password(const char *user,
new_pw_len = IVAL(lmdata, 512);
if (new_pw_len < 0 || new_pw_len > new_passwd_size - 1) {
DEBUG(0,("check_oem_password: incorrect password length (%d).\n", new_pw_len));
- return NT_STATUS_WRONG_PASSWORD;
+ return False;
}
if (nt_pass_set) {
@@ -893,14 +884,14 @@ static NTSTATUS check_oem_password(const char *user,
if (memcmp(lanman_pw, unenc_old_pw, 16))
{
DEBUG(0,("check_oem_password: old lm password doesn't match.\n"));
- return NT_STATUS_WRONG_PASSWORD;
+ return False;
}
#ifdef DEBUG_PASSWORD
DEBUG(100,
("check_oem_password: password %s ok\n", new_passwd));
#endif
- return NT_STATUS_OK;
+ return True;
}
/*
@@ -913,76 +904,31 @@ static NTSTATUS check_oem_password(const char *user,
if (memcmp(lanman_pw, unenc_old_pw, 16))
{
DEBUG(0,("check_oem_password: old lm password doesn't match.\n"));
- return NT_STATUS_WRONG_PASSWORD;
+ return False;
}
if (memcmp(nt_pw, unenc_old_ntpw, 16))
{
DEBUG(0,("check_oem_password: old nt password doesn't match.\n"));
- return NT_STATUS_WRONG_PASSWORD;
+ return False;
}
#ifdef DEBUG_PASSWORD
DEBUG(100, ("check_oem_password: password %s ok\n", new_passwd));
#endif
- return NT_STATUS_OK;
+ return True;
}
/***********************************************************
Code to change the oem password. Changes both the lanman
- and NT hashes. Old_passwd is almost always NULL.
+ and NT hashes.
************************************************************/
-NTSTATUS change_oem_password(SAM_ACCOUNT *hnd, char *old_passwd, char *new_passwd)
+BOOL change_oem_password(SAM_ACCOUNT *hnd, char *new_passwd)
{
BOOL ret;
- uint32 min_len;
-
- if (time(NULL) < pdb_get_pass_can_change_time(hnd)) {
- DEBUG(1, ("user %s cannot change password now, must wait until %s\n",
- pdb_get_username(hnd), http_timestring(pdb_get_pass_can_change_time(hnd))));
- return NT_STATUS_PASSWORD_RESTRICTION;
- }
-
- if (account_policy_get(AP_MIN_PASSWORD_LEN, &min_len) && (strlen(new_passwd) < min_len)) {
- DEBUG(1, ("user %s cannot change password - password too short\n",
- pdb_get_username(hnd)));
- DEBUGADD(1, (" account policy min password len = %d\n", min_len));
- return NT_STATUS_PASSWORD_RESTRICTION;
-/* return NT_STATUS_PWD_TOO_SHORT; */
- }
-
- /* Take the passed information and test it for minimum criteria */
- /* Minimum password length */
- if (strlen(new_passwd) < lp_min_passwd_length()) {
- /* too short, must be at least MINPASSWDLENGTH */
- DEBUG(1, ("Password Change: user %s, New password is shorter than minimum password length = %d\n",
- pdb_get_username(hnd), lp_min_passwd_length()));
- return NT_STATUS_PASSWORD_RESTRICTION;
-/* return NT_STATUS_PWD_TOO_SHORT; */
- }
-
- /* TODO: Add cracklib support here */
-
- /*
- * If unix password sync was requested, attempt to change
- * the /etc/passwd database first. Return failure if this cannot
- * be done.
- *
- * This occurs before the oem change, becouse we don't want to
- * update it if chgpasswd failed.
- *
- * Conditional on lp_unix_password_sync() becouse we don't want
- * to touch the unix db unless we have admin permission.
- */
-
- if(lp_unix_password_sync() && IS_SAM_UNIX_USER(hnd)
- && !chgpasswd(pdb_get_username(hnd),
- old_passwd, new_passwd, False)) {
- return NT_STATUS_ACCESS_DENIED;
- }
if (!pdb_set_plaintext_passwd (hnd, new_passwd)) {
- return NT_STATUS_ACCESS_DENIED;
+ return False;
}
/* Now write it into the file. */
@@ -990,11 +936,7 @@ NTSTATUS change_oem_password(SAM_ACCOUNT *hnd, char *old_passwd, char *new_passw
ret = pdb_update_sam_account (hnd);
unbecome_root();
- if (!ret) {
- return NT_STATUS_ACCESS_DENIED;
- }
-
- return NT_STATUS_OK;
+ return ret;
}
diff --git a/source3/smbd/connection.c b/source3/smbd/connection.c
index a7636e889e..ad394a01ca 100644
--- a/source3/smbd/connection.c
+++ b/source3/smbd/connection.c
@@ -35,7 +35,7 @@ TDB_CONTEXT *conn_tdb_ctx(void)
return tdb;
}
-static void make_conn_key(connection_struct *conn, const char *name, TDB_DATA *pkbuf, struct connections_key *pkey)
+static void make_conn_key(connection_struct *conn,char *name, TDB_DATA *pkbuf, struct connections_key *pkey)
{
ZERO_STRUCTP(pkey);
pkey->pid = sys_getpid();
@@ -50,7 +50,7 @@ static void make_conn_key(connection_struct *conn, const char *name, TDB_DATA *p
Delete a connection record.
****************************************************************************/
-BOOL yield_connection(connection_struct *conn, const char *name)
+BOOL yield_connection(connection_struct *conn,char *name)
{
struct connections_key key;
TDB_DATA kbuf;
@@ -116,7 +116,7 @@ static int count_fn( TDB_CONTEXT *the_tdb, TDB_DATA kbuf, TDB_DATA dbuf, void *u
Claim an entry in the connections database.
****************************************************************************/
-BOOL claim_connection(connection_struct *conn, const char *name,int max_connections,BOOL Clear, uint32 msg_flags)
+BOOL claim_connection(connection_struct *conn,char *name,int max_connections,BOOL Clear, uint32 msg_flags)
{
struct connections_key key;
struct connections_data crec;
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index d3c71ad24e..396ecd98c4 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -327,20 +327,15 @@ void dptr_closepath(char *path,uint16 spid)
Start a directory listing.
****************************************************************************/
-static BOOL start_dir(connection_struct *conn, pstring directory)
+static BOOL start_dir(connection_struct *conn,char *directory)
{
- const char *dir2;
-
DEBUG(5,("start_dir dir=%s\n",directory));
if (!check_name(directory,conn))
return(False);
-
- /* use a const pointer from here on */
- dir2 = directory;
- if (! *dir2)
- dir2 = ".";
+ if (! *directory)
+ directory = ".";
conn->dirptr = OpenDir(conn, directory, True);
if (conn->dirptr) {
@@ -397,7 +392,7 @@ static void dptr_close_oldest(BOOL old)
me at Andrew's knee.... :-) :-). JRA.
****************************************************************************/
-int dptr_create(connection_struct *conn, pstring path, BOOL old_handle, BOOL expect_close,uint16 spid)
+int dptr_create(connection_struct *conn,char *path, BOOL old_handle, BOOL expect_close,uint16 spid)
{
dptr_struct *dptr;
@@ -817,10 +812,10 @@ static BOOL file_is_special(connection_struct *conn, char *name, SMB_STRUCT_STAT
Open a directory.
********************************************************************/
-void *OpenDir(connection_struct *conn, const char *name, BOOL use_veto)
+void *OpenDir(connection_struct *conn, char *name, BOOL use_veto)
{
Dir *dirp;
- const char *n;
+ char *n;
DIR *p = conn->vfs_ops.opendir(conn,name);
int used=0;
@@ -1014,7 +1009,7 @@ static ubi_dlNewList( dir_cache );
Output: None.
*****************************************************************************/
-void DirCacheAdd( const char *path, char *name, char *dname, int snum )
+void DirCacheAdd( char *path, char *name, char *dname, int snum )
{
int pathlen;
int namelen;
@@ -1061,7 +1056,7 @@ void DirCacheAdd( const char *path, char *name, char *dname, int snum )
for large caches.
*****************************************************************************/
-char *DirCacheCheck( const char *path, const char *name, int snum )
+char *DirCacheCheck( char *path, char *name, int snum )
{
dir_cache_entry *entry;
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index bcfd366741..202bd75d4c 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -31,7 +31,7 @@ extern BOOL case_preserve;
extern BOOL short_case_preserve;
extern BOOL use_mangled_map;
-static BOOL scan_directory(const char *path, pstring name,connection_struct *conn,BOOL docache);
+static BOOL scan_directory(char *path, char *name,connection_struct *conn,BOOL docache);
/****************************************************************************
Check if two filenames are equal.
@@ -387,7 +387,7 @@ BOOL unix_convert(pstring name,connection_struct *conn,char *saved_last_componen
a valid one for the user to access.
****************************************************************************/
-BOOL check_name(pstring name,connection_struct *conn)
+BOOL check_name(char *name,connection_struct *conn)
{
BOOL ret;
@@ -428,7 +428,7 @@ BOOL check_name(pstring name,connection_struct *conn)
If the name looks like a mangled name then try via the mangling functions
****************************************************************************/
-static BOOL scan_directory(const char *path, pstring name,connection_struct *conn,BOOL docache)
+static BOOL scan_directory(char *path, char *name,connection_struct *conn,BOOL docache)
{
void *cur_dir;
char *dname;
diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c
index 61288e0167..43b5d9e55f 100644
--- a/source3/smbd/lanman.c
+++ b/source3/smbd/lanman.c
@@ -109,14 +109,14 @@ static char* Expand(connection_struct *conn, int snum, char* s)
/*******************************************************************
check a API string for validity when we only need to check the prefix
******************************************************************/
-static BOOL prefix_ok(const char *str, const char *prefix)
+static BOOL prefix_ok(char *str,char *prefix)
{
return(strncmp(str,prefix,strlen(prefix)) == 0);
}
struct pack_desc {
- const char* format; /* formatstring for structure */
- const char* subformat; /* subformat for structure */
+ char* format; /* formatstring for structure */
+ char* subformat; /* subformat for structure */
char* base; /* baseaddress of buffer */
int buflen; /* remaining size for fixed part; on init: length of base */
int subcount; /* count of substructures */
@@ -125,11 +125,11 @@ struct pack_desc {
char* stringbuf; /* pointer into buffer for remaining variable part */
int neededlen; /* total needed size */
int usedlen; /* total used size (usedlen <= neededlen and usedlen <= buflen) */
- const char* curpos; /* current position; pointer into format or subformat */
+ char* curpos; /* current position; pointer into format or subformat */
int errcode;
};
-static int get_counter(const char** p)
+static int get_counter(char** p)
{
int i, n;
if (!p || !(*p)) return(1);
@@ -144,7 +144,7 @@ static int get_counter(const char** p)
}
}
-static int getlen(const char* p)
+static int getlen(char* p)
{
int n = 0;
if (!p) return(0);
@@ -329,7 +329,7 @@ static int package(struct pack_desc* p, ...)
#define PACKl(desc,t,v,l) package(desc,v,l)
#endif
-static void PACKI(struct pack_desc* desc, const char *t,int v)
+static void PACKI(struct pack_desc* desc,char *t,int v)
{
PACK(desc,t,v);
}
@@ -1704,7 +1704,7 @@ static BOOL api_NetUserGetGroups(connection_struct *conn,uint16 vuid, char *para
char *UserName = skip_string(str2,1);
char *p = skip_string(UserName,1);
int uLevel = SVAL(p,0);
- const char *level_string;
+ char *p2;
int count=0;
*rparam_len = 8;
@@ -1715,13 +1715,13 @@ static BOOL api_NetUserGetGroups(connection_struct *conn,uint16 vuid, char *para
return False;
switch( uLevel ) {
case 0:
- level_string = "B21";
+ p2 = "B21";
break;
default:
return False;
}
- if (strcmp(level_string,str2) != 0)
+ if (strcmp(p2,str2) != 0)
return False;
*rdata_len = mdrcnt + 1024;
@@ -1930,7 +1930,25 @@ static BOOL api_SetUserPassword(connection_struct *conn,uint16 vuid, char *param
DATA_BLOB password = data_blob(pass1, strlen(pass1)+1);
if (NT_STATUS_IS_OK(check_plaintext_password(user,password,&server_info))) {
- if (NT_STATUS_IS_OK(change_oem_password(server_info->sam_account, pass1, pass2)))
+ /*
+ * If unix password sync was requested, attempt to change
+ * the /etc/passwd database first. Return failure if this cannot
+ * be done.
+ *
+ * This occurs before the oem change, becouse we don't want to
+ * update it if chgpasswd failed.
+ *
+ * Conditional on lp_unix_password_sync() becouse we don't want
+ * to touch the unix db unless we have admin permission.
+ */
+
+ if(lp_unix_password_sync() && IS_SAM_UNIX_USER(server_info->sam_account)
+ && !chgpasswd(pdb_get_username(server_info->sam_account),
+ pass1,pass2,False)) {
+ SSVAL(*rparam,0,NERR_badpass);
+ }
+
+ if (change_oem_password(server_info->sam_account,pass2))
{
SSVAL(*rparam,0,NERR_Success);
}
@@ -2013,7 +2031,7 @@ static BOOL api_SamOEMChangePassword(connection_struct *conn,uint16 vuid, char *
(void)map_username(user);
- if (NT_STATUS_IS_OK(pass_oem_change(user, (uchar*) data, (uchar *)&data[516], NULL, NULL)))
+ if (pass_oem_change(user, (uchar*) data, (uchar *)&data[516], NULL, NULL))
{
SSVAL(*rparam,0,NERR_Success);
}
@@ -2584,7 +2602,6 @@ static BOOL api_RNetUserGetInfo(connection_struct *conn,uint16 vuid, char *param
char *p = skip_string(UserName,1);
int uLevel = SVAL(p,0);
char *p2;
- const char *level_string;
/* get NIS home of a previously validated user - simeon */
/* With share level security vuid will always be zero.
@@ -2603,15 +2620,15 @@ static BOOL api_RNetUserGetInfo(connection_struct *conn,uint16 vuid, char *param
if (strcmp(str1,"zWrLh") != 0) return False;
switch( uLevel )
{
- case 0: level_string = "B21"; break;
- case 1: level_string = "B21BB16DWzzWz"; break;
- case 2: level_string = "B21BB16DWzzWzDzzzzDDDDWb21WWzWW"; break;
- case 10: level_string = "B21Bzzz"; break;
- case 11: level_string = "B21BzzzWDDzzDDWWzWzDWb21W"; break;
+ case 0: p2 = "B21"; break;
+ case 1: p2 = "B21BB16DWzzWz"; break;
+ case 2: p2 = "B21BB16DWzzWzDzzzzDDDDWb21WWzWW"; break;
+ case 10: p2 = "B21Bzzz"; break;
+ case 11: p2 = "B21BzzzWDDzzDDWWzWzDWb21W"; break;
default: return False;
}
- if (strcmp(level_string,str2) != 0) return False;
+ if (strcmp(p2,str2) != 0) return False;
*rdata_len = mdrcnt + 1024;
*rdata = REALLOC(*rdata,*rdata_len);
@@ -3408,9 +3425,9 @@ static BOOL api_Unsupported(connection_struct *conn,uint16 vuid, char *param,cha
-static const struct
+const static struct
{
- const char *name;
+ char *name;
int id;
BOOL (*fn)(connection_struct *,uint16,char *,char *,
int,int,char **,char **,int *,int *);
diff --git a/source3/smbd/mangle.c b/source3/smbd/mangle.c
index f5c703a5bf..392e48afc1 100644
--- a/source3/smbd/mangle.c
+++ b/source3/smbd/mangle.c
@@ -23,8 +23,8 @@
static struct mangle_fns *mangle_fns;
/* this allows us to add more mangling backends */
-static const struct {
- const char *name;
+static struct {
+ char *name;
struct mangle_fns *(*init_fn)(void);
} mangle_backends[] = {
{ "hash", mangle_hash_init },
diff --git a/source3/smbd/mangle_hash.c b/source3/smbd/mangle_hash.c
index 929cb0e07f..0446a953ff 100644
--- a/source3/smbd/mangle_hash.c
+++ b/source3/smbd/mangle_hash.c
@@ -361,15 +361,15 @@ done:
*/
static void init_chartest( void )
{
- const char *illegalchars = "*\\/?<>|\":";
- const unsigned char *s;
+ char *illegalchars = "*\\/?<>|\":";
+ unsigned char *s;
memset( (char *)chartest, '\0', 256 );
- for( s = (const unsigned char *)illegalchars; *s; s++ )
+ for( s = (unsigned char *)illegalchars; *s; s++ )
chartest[*s] = ILLEGAL_MASK;
- for( s = (const unsigned char *)basechars; *s; s++ )
+ for( s = (unsigned char *)basechars; *s; s++ )
chartest[*s] |= BASECHAR_MASK;
ct_initialized = True;
diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c
index c8f023514e..b91c0c0866 100644
--- a/source3/smbd/negprot.c
+++ b/source3/smbd/negprot.c
@@ -377,9 +377,9 @@ protocol [LANMAN2.1]
#define ARCH_ALL 0x3F
/* List of supported protocols, most desired first */
-static const struct {
- const char *proto_name;
- const char *short_name;
+static struct {
+ char *proto_name;
+ char *short_name;
int (*proto_reply_fn)(char *, char *);
int protocol_level;
} supported_protocols[] = {
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 29ebdce5a8..740f450db6 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -27,7 +27,7 @@ extern BOOL case_sensitive;
extern BOOL case_preserve;
extern BOOL short_case_preserve;
-static const char *known_nt_pipes[] = {
+static char *known_nt_pipes[] = {
"\\LANMAN",
"\\srvsvc",
"\\samr",
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 7421c16b40..923b20ad66 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -339,7 +339,7 @@ force write permissions on print services.
functions. Any message that has a NULL function is unimplemented -
please feel free to contribute implementations!
*/
-static const struct smb_message_struct
+const static struct smb_message_struct
{
const char *name;
int (*fn)(connection_struct *conn, char *, char *, int, int);
@@ -890,7 +890,7 @@ return a string containing the function name of a SMB command
****************************************************************************/
const char *smb_fn_name(int type)
{
- const char *unknown_name = "SMBunknown";
+ static char *unknown_name = "SMBunknown";
if (smb_messages[type].name == NULL)
return(unknown_name);
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index beccc1bba6..4335728afc 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -271,7 +271,7 @@ int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt
set_message_end(outbuf,p);
} else {
/* NT sets the fstype of IPC$ to the null string */
- const char *fsname = IS_IPC(conn) ? "" : lp_fstype(SNUM(conn));
+ char *fsname = IS_IPC(conn) ? "" : lp_fstype(SNUM(conn));
set_message(outbuf,3,0,True);
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 0a11919577..7581eb6001 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -179,12 +179,11 @@ static BOOL open_sockets_smbd(BOOL is_daemon,const char *smb_ports)
if (!smb_ports) {
ports = lp_smb_ports();
if (!ports || !*ports) {
- ports = smb_xstrdup(SMB_PORTS);
- } else {
- ports = smb_xstrdup(ports);
+ ports = SMB_PORTS;
}
+ ports = strdup(ports);
} else {
- ports = smb_xstrdup(smb_ports);
+ ports = strdup(smb_ports);
}
if (lp_interfaces() && lp_bind_interfaces_only()) {
@@ -374,10 +373,6 @@ static BOOL open_sockets_smbd(BOOL is_daemon,const char *smb_ports)
return False;
}
- /* Load DSO's */
- if(lp_modules())
- smb_load_modules(lp_modules());
-
return True;
}
/* The parent doesn't need this socket */
@@ -544,7 +539,7 @@ static void decrement_smbd_process_count(void)
Exit the server.
****************************************************************************/
-void exit_server(const char *reason)
+void exit_server(char *reason)
{
static int firsttime=1;
extern char *last_inbuf;
@@ -867,7 +862,6 @@ static BOOL init_structs(void )
smbd_process();
uni_group_cache_shutdown();
- namecache_shutdown();
exit_server("normal exit");
return(0);
}
diff --git a/source3/smbd/utmp.c b/source3/smbd/utmp.c
index 6c12cfac62..6b7b0f3ad1 100644
--- a/source3/smbd/utmp.c
+++ b/source3/smbd/utmp.c
@@ -457,7 +457,7 @@ static void sys_utmp_update(struct utmp *u, const char *hostname, BOOL claim)
static int ut_id_encode(int i, char *fourbyte)
{
int nbase;
- const char *ut_id_encstr = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ char *ut_id_encstr = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
fourbyte[0] = 'S';
fourbyte[1] = 'M';
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 7b8d9d7e9e..7e60d3dacb 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -781,7 +781,7 @@ char *vfs_GetWd(connection_struct *conn, char *path)
Widelinks are allowed if widelinks is true.
********************************************************************/
-BOOL reduce_name(connection_struct *conn, pstring s, const char *dir,BOOL widelinks)
+BOOL reduce_name(connection_struct *conn, char *s,char *dir,BOOL widelinks)
{
#ifndef REDUCE_PATHS
return True;