diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-11-12 06:12:19 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-11-12 06:12:19 +0000 |
commit | 713864dd0322ae2ae2d83e333d85be35a7eed4ec (patch) | |
tree | 9d40396028cf5b42e19c75592b484f3f7e5824a6 /source/lib | |
parent | 45131501f23ce1eec2f23fe2c1060cd5a2736ec9 (diff) | |
download | samba-713864dd0322ae2ae2d83e333d85be35a7eed4ec.tar.gz samba-713864dd0322ae2ae2d83e333d85be35a7eed4ec.tar.xz samba-713864dd0322ae2ae2d83e333d85be35a7eed4ec.zip |
largely rewrote smbpasswd so that the code is understandable. This
should allow us to call a function in swat rather than piping to
smbpasswd.
while doing this I also fixed quite a few "const char *" versus "char *" issues
that cropped up while using const to track down bugs in the code. This
led to changes in several generic functions.
The smbpasswd changes should be correct but they have not been
extensively tested. At least if I have introduced bugs then we should
be able to fix them more easily than before.
Diffstat (limited to 'source/lib')
-rw-r--r-- | source/lib/util.c | 2 | ||||
-rw-r--r-- | source/lib/util_str.c | 8 | ||||
-rw-r--r-- | source/lib/util_unistr.c | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/source/lib/util.c b/source/lib/util.c index f1fae9155c8..2be1fcaf6fc 100644 --- a/source/lib/util.c +++ b/source/lib/util.c @@ -2386,7 +2386,7 @@ BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask) a wrapper for gethostbyname() that tries with all lower and all upper case if the initial name fails ****************************************************************************/ -struct hostent *Get_Hostbyname(char *name) +struct hostent *Get_Hostbyname(const char *name) { char *name2 = strdup(name); struct hostent *ret; diff --git a/source/lib/util_str.c b/source/lib/util_str.c index 996273bf3ad..02fa892d7b2 100644 --- a/source/lib/util_str.c +++ b/source/lib/util_str.c @@ -115,7 +115,7 @@ char **toktocliplist(int *ctok, char *sep) /******************************************************************* case insensitive string compararison ********************************************************************/ -int StrCaseCmp(char *s, char *t) +int StrCaseCmp(const char *s, const char *t) { /* compare until we run out of string, either t or s, or find a difference */ /* We *must* use toupper rather than tolower here due to the @@ -272,7 +272,7 @@ int StrnCaseCmp(char *s, char *t, int n) /******************************************************************* compare 2 strings ********************************************************************/ -BOOL strequal(char *s1, char *s2) +BOOL strequal(const char *s1, const char *s2) { if (s1 == s2) return(True); if (!s1 || !s2) return(False); @@ -819,7 +819,7 @@ char *StrCpy(char *dest,char *src) /**************************************************************************** like strncpy but always null terminates. Make sure there is room! ****************************************************************************/ -char *StrnCpy(char *dest,char *src,int n) +char *StrnCpy(char *dest,const char *src,int n) { char *d = dest; if (!dest) return(NULL); @@ -837,7 +837,7 @@ char *StrnCpy(char *dest,char *src,int n) like strncpy but copies up to the character marker. always null terminates. returns a pointer to the character marker in the source string (src). ****************************************************************************/ -char *strncpyn(char *dest, char *src,int n, char c) +char *strncpyn(char *dest, const char *src,int n, char c) { char *p; int str_len; diff --git a/source/lib/util_unistr.c b/source/lib/util_unistr.c index 49fb7292670..c58820cfece 100644 --- a/source/lib/util_unistr.c +++ b/source/lib/util_unistr.c @@ -189,7 +189,7 @@ return number of unicode chars copied, excluding the null character. only handles ascii strings ********************************************************************/ #define MAXUNI 1024 -int struni2(uint16 *p, char *buf) +int struni2(uint16 *p, const char *buf) { int len = 0; |