summaryrefslogtreecommitdiff
path: root/source3/rpc_parse
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/rpc_parse
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/rpc_parse')
-rw-r--r--source3/rpc_parse/parse_net.c12
-rw-r--r--source3/rpc_parse/parse_samr.c22
2 files changed, 17 insertions, 17 deletions
diff --git a/source3/rpc_parse/parse_net.c b/source3/rpc_parse/parse_net.c
index a3ff179605..2ad970a61b 100644
--- a/source3/rpc_parse/parse_net.c
+++ b/source3/rpc_parse/parse_net.c
@@ -1209,12 +1209,12 @@ void init_net_user_info3(TALLOC_CTX *ctx, NET_USER_INFO_3 *usr, SAM_ACCOUNT *sam
int len_user_name, len_full_name, len_home_dir,
len_dir_drive, len_logon_script, len_profile_path;
- char* user_name = pdb_get_username(sampw);
- char* full_name = pdb_get_fullname(sampw);
- char* home_dir = pdb_get_homedir(sampw);
- char* dir_drive = pdb_get_dirdrive(sampw);
- char* logon_script = pdb_get_logon_script(sampw);
- char* profile_path = pdb_get_profile_path(sampw);
+ const char* user_name = pdb_get_username(sampw);
+ const char* full_name = pdb_get_fullname(sampw);
+ const char* home_dir = pdb_get_homedir(sampw);
+ const char* dir_drive = pdb_get_dirdrive(sampw);
+ const char* logon_script = pdb_get_logon_script(sampw);
+ const char* profile_path = pdb_get_profile_path(sampw);
int len_logon_srv = strlen(logon_srv);
int len_logon_dom = strlen(logon_dom);
diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c
index c92dbda7ec..3f489f0a2b 100644
--- a/source3/rpc_parse/parse_samr.c
+++ b/source3/rpc_parse/parse_samr.c
@@ -4978,7 +4978,7 @@ inits a SAM_USER_INFO_12 structure.
********************************************************************/
void init_sam_user_info12(SAM_USER_INFO_12 * usr,
- uint8 lm_pwd[16], uint8 nt_pwd[16])
+ const uint8 lm_pwd[16], const uint8 nt_pwd[16])
{
DEBUG(5, ("init_sam_user_info12\n"));
@@ -5770,15 +5770,15 @@ void init_sam_user_info21A(SAM_USER_INFO_21 *usr, SAM_ACCOUNT *pw)
len_description, len_workstations, len_unknown_str,
len_munged_dial;
- char* user_name = pdb_get_username(pw);
- char* full_name = pdb_get_fullname(pw);
- char* home_dir = pdb_get_homedir(pw);
- char* dir_drive = pdb_get_dirdrive(pw);
- char* logon_script = pdb_get_logon_script(pw);
- char* profile_path = pdb_get_profile_path(pw);
- char* description = pdb_get_acct_desc(pw);
- char* workstations = pdb_get_workstations(pw);
- char* munged_dial = pdb_get_munged_dial(pw);
+ const char* user_name = pdb_get_username(pw);
+ const char* full_name = pdb_get_fullname(pw);
+ const char* home_dir = pdb_get_homedir(pw);
+ const char* dir_drive = pdb_get_dirdrive(pw);
+ const char* logon_script = pdb_get_logon_script(pw);
+ const char* profile_path = pdb_get_profile_path(pw);
+ const char* description = pdb_get_acct_desc(pw);
+ const char* workstations = pdb_get_workstations(pw);
+ const char* munged_dial = pdb_get_munged_dial(pw);
len_user_name = user_name != NULL ? strlen(user_name )+1 : 0;
len_full_name = full_name != NULL ? strlen(full_name )+1 : 0;
@@ -5974,7 +5974,7 @@ static BOOL sam_io_user_info21(char *desc, SAM_USER_INFO_21 * usr,
void init_sam_user_info20A(SAM_USER_INFO_20 *usr, SAM_ACCOUNT *pw)
{
int len_munged_dial;
- char* munged_dial = pdb_get_munged_dial(pw);
+ const char* munged_dial = pdb_get_munged_dial(pw);
len_munged_dial = munged_dial != NULL ? strlen(munged_dial )+1 : 0;
init_uni_hdr(&usr->hdr_munged_dial, len_munged_dial);