summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2001-10-29 07:35:11 +0000
committerAndrew Bartlett <abartlet@samba.org>2001-10-29 07:35:11 +0000
commitd9d7f023d8d11943ca0375e1573e6ec9921889bc (patch)
tree05cc98ee549f6d8d52711172c6fdcd3564d7ef55 /source3/smbd
parent2038649e51f48a489aeec49947e1b791f0b3df43 (diff)
downloadsamba-d9d7f023d8d11943ca0375e1573e6ec9921889bc.tar.gz
samba-d9d7f023d8d11943ca0375e1573e6ec9921889bc.tar.bz2
samba-d9d7f023d8d11943ca0375e1573e6ec9921889bc.zip
This commit is number 4 of 4.
In particular this commit focuses on: Actually adding the 'const' to the passdb interface, and the flow-on changes. Also kill off the 'disp_info' stuff, as its no longer used. While these changes have been mildly tested, and are pretty small, any assistance in this is appreciated. ---- These changes introduces a large dose of 'const' to the Samba tree. There are a number of good reasons to do this: - I want to allow the SAM_ACCOUNT structure to move from wasteful pstrings and fstrings to allocated strings. We can't do that if people are modifying these outputs, as they may well make assumptions about getting pstrings and fstrings - I want --with-pam_smbpass to compile with a slightly sane volume of warnings, currently its pretty bad, even in 2.2 where is compiles at all. - Tridge assures me that he no longer opposes 'const religion' based on the ability to #define const the problem away. - Changed Get_Pwnam(x,y) into two variants (so that the const parameter can work correctly): - Get_Pwnam(const x) and Get_Pwnam_Modify(x). - Reworked smbd/chgpasswd.c to work with these mods, passing around a 'struct passwd' rather than the modified username --- This finishes this line of commits off, your tree should now compile again :-) Andrew Bartlett (This used to be commit c95f5aeb9327347674589ae313b75bee3bf8e317)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/auth_smbpasswd.c6
-rw-r--r--source3/smbd/chgpasswd.c20
2 files changed, 13 insertions, 13 deletions
diff --git a/source3/smbd/auth_smbpasswd.c b/source3/smbd/auth_smbpasswd.c
index 2070f09fd6..6bc3793666 100644
--- a/source3/smbd/auth_smbpasswd.c
+++ b/source3/smbd/auth_smbpasswd.c
@@ -65,8 +65,8 @@ static BOOL smb_pwd_check_ntlmv1(const uchar *password,
core of smb password checking routine.
****************************************************************************/
static BOOL smb_pwd_check_ntlmv2(const uchar *password, size_t pwd_len,
- uchar *part_passwd,
- uchar const *c8,
+ const uchar *part_passwd,
+ const uchar *c8,
const char *user, const char *domain,
char user_sess_key[16])
{
@@ -109,7 +109,7 @@ static BOOL smb_pwd_check_ntlmv2(const uchar *password, size_t pwd_len,
****************************************************************************/
NTSTATUS sam_password_ok(SAM_ACCOUNT *sampass, const auth_usersupplied_info *user_info, char user_sess_key[16])
{
- uint8 *nt_pw, *lm_pw;
+ const uint8 *nt_pw, *lm_pw;
uint16 acct_ctrl = pdb_get_acct_ctrl(sampass);
if (!user_info || !sampass)
diff --git a/source3/smbd/chgpasswd.c b/source3/smbd/chgpasswd.c
index 132a20cf05..286c316b93 100644
--- a/source3/smbd/chgpasswd.c
+++ b/source3/smbd/chgpasswd.c
@@ -51,9 +51,9 @@
extern struct passdb_ops pdb_ops;
-static BOOL check_oem_password(char *user,
- uchar * lmdata, uchar * lmhash,
- uchar * ntdata, uchar * nthash,
+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,
int new_passwd_size);
@@ -598,7 +598,7 @@ BOOL check_lanman_password(char *user, uchar * pass1,
uchar unenc_old_pw[16];
SAM_ACCOUNT *sampass = NULL;
uint16 acct_ctrl;
- uint8 *lanman_pw;
+ const uint8 *lanman_pw;
BOOL ret;
become_root();
@@ -663,7 +663,7 @@ BOOL change_lanman_password(SAM_ACCOUNT *sampass, uchar * pass1,
uchar unenc_new_pw[16];
BOOL ret;
uint16 acct_ctrl;
- uint8 *pwd;
+ const uint8 *pwd;
if (sampass == NULL) {
DEBUG(0,("change_lanman_password: no smb password entry.\n"));
@@ -759,16 +759,16 @@ BOOL pass_oem_change(char *user,
but does use the lm OEM password to check the nt hashed-hash.
************************************************************/
-static BOOL check_oem_password(char *user,
- uchar * lmdata, uchar * lmhash,
- uchar * ntdata, uchar * nthash,
+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,
int new_passwd_size)
{
static uchar null_pw[16];
static uchar null_ntpw[16];
SAM_ACCOUNT *sampass = NULL;
- uint8 *lanman_pw, *nt_pw;
+ const uint8 *lanman_pw, *nt_pw;
uint16 acct_ctrl;
int new_pw_len;
uchar new_ntp16[16];
@@ -827,7 +827,7 @@ static BOOL check_oem_password(char *user,
/*
* Call the hash function to get the new password.
*/
- SamOEMhash((uchar *) lmdata, (uchar *)lanman_pw, 516);
+ SamOEMhash( lmdata, lanman_pw, 516);
/*
* The length of the new password is in the last 4 bytes of