summaryrefslogtreecommitdiff
path: root/source3/passdb/pdb_tdb.c
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/passdb/pdb_tdb.c
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/passdb/pdb_tdb.c')
-rw-r--r--source3/passdb/pdb_tdb.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/source3/passdb/pdb_tdb.c b/source3/passdb/pdb_tdb.c
index 95f66fc671..a170ac1345 100644
--- a/source3/passdb/pdb_tdb.c
+++ b/source3/passdb/pdb_tdb.c
@@ -173,7 +173,7 @@ done:
/**********************************************************************
Intialize a BYTE buffer from a SAM_ACCOUNT struct
*********************************************************************/
-static uint32 init_buffer_from_sam (uint8 **buf, SAM_ACCOUNT *sampass)
+static uint32 init_buffer_from_sam (uint8 **buf, const SAM_ACCOUNT *sampass)
{
size_t len, buflen;
@@ -186,25 +186,25 @@ static uint32 init_buffer_from_sam (uint8 **buf, SAM_ACCOUNT *sampass)
pass_last_set_time,
pass_can_change_time,
pass_must_change_time;
- char *username;
- char *domain;
- char *nt_username;
- char *dir_drive;
- char *unknown_str;
- char *munged_dial;
- char *fullname;
- char *homedir;
- char *logon_script;
- char *profile_path;
- char *acct_desc;
- char *workstations;
+ const char *username;
+ const char *domain;
+ const char *nt_username;
+ const char *dir_drive;
+ const char *unknown_str;
+ const char *munged_dial;
+ const char *fullname;
+ const char *homedir;
+ const char *logon_script;
+ const char *profile_path;
+ const char *acct_desc;
+ const char *workstations;
uint32 username_len, domain_len, nt_username_len,
dir_drive_len, unknown_str_len, munged_dial_len,
fullname_len, homedir_len, logon_script_len,
profile_path_len, acct_desc_len, workstations_len;
- uint8 *lm_pw;
- uint8 *nt_pw;
+ const uint8 *lm_pw;
+ const uint8 *nt_pw;
uint32 lm_pw_len = 16;
uint32 nt_pw_len = 16;
@@ -476,7 +476,7 @@ BOOL pdb_getsampwent(SAM_ACCOUNT *user)
Lookup a name in the SAM TDB
******************************************************************/
-BOOL pdb_getsampwnam (SAM_ACCOUNT *user, char *sname)
+BOOL pdb_getsampwnam (SAM_ACCOUNT *user, const char *sname)
{
TDB_CONTEXT *pwd_tdb;
TDB_DATA data, key;
@@ -624,7 +624,7 @@ BOOL pdb_getsampwrid (SAM_ACCOUNT *user, uint32 rid)
Delete a SAM_ACCOUNT
****************************************************************************/
-BOOL pdb_delete_sam_account(char *sname)
+BOOL pdb_delete_sam_account(const char *sname)
{
SAM_ACCOUNT *sam_pass = NULL;
TDB_CONTEXT *pwd_tdb;
@@ -799,7 +799,7 @@ done:
Modifies an existing SAM_ACCOUNT
****************************************************************************/
-BOOL pdb_update_sam_account (SAM_ACCOUNT *newpwd, BOOL override)
+BOOL pdb_update_sam_account (const SAM_ACCOUNT *newpwd, BOOL override)
{
return (tdb_update_sam(newpwd, override, TDB_MODIFY));
}
@@ -808,7 +808,7 @@ BOOL pdb_update_sam_account (SAM_ACCOUNT *newpwd, BOOL override)
Adds an existing SAM_ACCOUNT
****************************************************************************/
-BOOL pdb_add_sam_account (SAM_ACCOUNT *newpwd)
+BOOL pdb_add_sam_account (const SAM_ACCOUNT *newpwd)
{
return (tdb_update_sam(newpwd, True, TDB_INSERT));
}