summaryrefslogtreecommitdiff
path: root/source3/lib
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/lib
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/lib')
-rw-r--r--source3/lib/replace.c2
-rw-r--r--source3/lib/username.c10
-rw-r--r--source3/lib/util.c6
3 files changed, 9 insertions, 9 deletions
diff --git a/source3/lib/replace.c b/source3/lib/replace.c
index b972c745b0..4dbcedc93a 100644
--- a/source3/lib/replace.c
+++ b/source3/lib/replace.c
@@ -124,7 +124,7 @@ Corrections by richard.kettlewell@kewill.com
/*
* Search for a match in a netgroup. This replaces it on broken systems.
*/
- int innetgr(char *group,char *host,char *user,char *dom)
+ int innetgr(const char *group,const char *host,const char *user,const char *dom)
{
char *hst, *usr, *dm;
diff --git a/source3/lib/username.c b/source3/lib/username.c
index 074e6c8992..e2ef539cec 100644
--- a/source3/lib/username.c
+++ b/source3/lib/username.c
@@ -299,7 +299,7 @@ static BOOL user_in_netgroup_list(const char *user, const char *ngname)
Check if a user is in a winbind group.
****************************************************************************/
-static BOOL user_in_winbind_group_list(char *user,char *gname, BOOL *winbind_answered)
+static BOOL user_in_winbind_group_list(const char *user, const char *gname, BOOL *winbind_answered)
{
int num_groups;
int i;
@@ -407,7 +407,7 @@ static BOOL user_in_unix_group_list(const char *user,const char *gname)
Check if a user is in a group list. Ask winbind first, then use UNIX.
****************************************************************************/
-BOOL user_in_group_list(char *user,char *gname)
+BOOL user_in_group_list(const char *user, const char *gname)
{
BOOL winbind_answered = False;
BOOL ret = user_in_winbind_group_list(user, gname, &winbind_answered);
@@ -423,7 +423,7 @@ BOOL user_in_group_list(char *user,char *gname)
and netgroup lists.
****************************************************************************/
-BOOL user_in_list(char *user,char **list)
+BOOL user_in_list(const char *user,char **list)
{
if (!list || !*list) return False;
@@ -505,7 +505,7 @@ BOOL user_in_list(char *user,char **list)
it assumes the string starts lowercased
****************************************************************************/
-static struct passwd *uname_string_combinations2(char *s,int offset,struct passwd *(*fn)(char *),int N)
+static struct passwd *uname_string_combinations2(char *s,int offset,struct passwd *(*fn)(const char *),int N)
{
ssize_t len = (ssize_t)strlen(s);
int i;
@@ -539,7 +539,7 @@ static struct passwd *uname_string_combinations2(char *s,int offset,struct passw
it assumes the string starts lowercased
****************************************************************************/
-static struct passwd * uname_string_combinations(char *s,struct passwd * (*fn)(char *),int N)
+static struct passwd * uname_string_combinations(char *s,struct passwd * (*fn)(const char *),int N)
{
int n;
struct passwd *ret;
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 61da9eb230..af0a6bda71 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -824,7 +824,7 @@ static void strip_mount_options( pstring *str)
*******************************************************************/
#ifdef WITH_NISPLUS_HOME
-char *automount_lookup(char *user_name)
+char *automount_lookup(const char *user_name)
{
static fstring last_key = "";
static pstring last_value = "";
@@ -872,7 +872,7 @@ char *automount_lookup(char *user_name)
return last_value;
}
#else /* WITH_NISPLUS_HOME */
-char *automount_lookup(char *user_name)
+char *automount_lookup(const char *user_name)
{
static fstring last_key = "";
static pstring last_value = "";
@@ -1020,7 +1020,7 @@ uid_t nametouid(char *name)
is present does a shortcut lookup...
********************************************************************/
-gid_t nametogid(char *name)
+gid_t nametogid(const char *name)
{
struct group *grp;
char *p;