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 | d85dcf86d59c14cb624bbb69b658fc6aba842593 (patch) | |
tree | bbf2f5e28c6cc7cc328feb2c3a03352f85573509 /source3/libsmb | |
parent | 10a9addc222b29acdcfe6afed0597dd17551fa5c (diff) | |
download | samba-d85dcf86d59c14cb624bbb69b658fc6aba842593.tar.gz samba-d85dcf86d59c14cb624bbb69b658fc6aba842593.tar.bz2 samba-d85dcf86d59c14cb624bbb69b658fc6aba842593.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.
(This used to be commit 713864dd0322ae2ae2d83e333d85be35a7eed4ec)
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/clientgen.c | 6 | ||||
-rw-r--r-- | source3/libsmb/namequery.c | 12 | ||||
-rw-r--r-- | source3/libsmb/nmblib.c | 2 | ||||
-rw-r--r-- | source3/libsmb/smbencrypt.c | 2 |
4 files changed, 11 insertions, 11 deletions
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index fc4c7f1d5d..b4ca7a1d77 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -2087,8 +2087,8 @@ int cli_list(struct cli_state *cli,const char *Mask,uint16 attribute, Send a SamOEMChangePassword command ****************************************************************************/ -BOOL cli_oem_change_password(struct cli_state *cli, char *user, char *new_password, - char *old_password) +BOOL cli_oem_change_password(struct cli_state *cli, const char *user, const char *new_password, + const char *old_password) { char param[16+sizeof(fstring)]; char data[532]; @@ -2317,7 +2317,7 @@ retry: /**************************************************************************** open the client sockets ****************************************************************************/ -BOOL cli_connect(struct cli_state *cli, char *host, struct in_addr *ip) +BOOL cli_connect(struct cli_state *cli, const char *host, struct in_addr *ip) { extern struct in_addr ipzero; diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index 0e92e6b5dd..f06ecc94e4 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -194,7 +194,7 @@ BOOL name_status(int fd,char *name,int name_type,BOOL recurse, returns an array of IP addresses or NULL if none *count will be set to the number of addresses returned ****************************************************************************/ -struct in_addr *name_query(int fd,char *name,int name_type, BOOL bcast,BOOL recurse, +struct in_addr *name_query(int fd,const char *name,int name_type, BOOL bcast,BOOL recurse, struct in_addr to_ip, int *count, void (*fn)(struct packet_struct *)) { BOOL found=False; @@ -440,7 +440,7 @@ void endlmhosts(FILE *fp) /******************************************************** resolve via "bcast" method *********************************************************/ -static BOOL resolve_bcast(char *name, struct in_addr *return_ip, int name_type) +static BOOL resolve_bcast(const char *name, struct in_addr *return_ip, int name_type) { int sock, i; @@ -486,7 +486,7 @@ static BOOL resolve_bcast(char *name, struct in_addr *return_ip, int name_type) /******************************************************** resolve via "wins" method *********************************************************/ -static BOOL resolve_wins(char *name, struct in_addr *return_ip, int name_type) +static BOOL resolve_wins(const char *name, struct in_addr *return_ip, int name_type) { int sock; struct in_addr wins_ip; @@ -536,7 +536,7 @@ static BOOL resolve_wins(char *name, struct in_addr *return_ip, int name_type) /******************************************************** resolve via "lmhosts" method *********************************************************/ -static BOOL resolve_lmhosts(char *name, struct in_addr *return_ip, int name_type) +static BOOL resolve_lmhosts(const char *name, struct in_addr *return_ip, int name_type) { /* * "lmhosts" means parse the local lmhosts file. @@ -566,7 +566,7 @@ static BOOL resolve_lmhosts(char *name, struct in_addr *return_ip, int name_type /******************************************************** resolve via "hosts" method *********************************************************/ -static BOOL resolve_hosts(char *name, struct in_addr *return_ip) +static BOOL resolve_hosts(const char *name, struct in_addr *return_ip) { /* * "host" means do a localhost, or dns lookup. @@ -589,7 +589,7 @@ static BOOL resolve_hosts(char *name, struct in_addr *return_ip) or NetBIOS name. This uses the name switch in the smb.conf to determine the order of name resolution. *********************************************************/ -BOOL resolve_name(char *name, struct in_addr *return_ip, int name_type) +BOOL resolve_name(const char *name, struct in_addr *return_ip, int name_type) { int i; BOOL pure_address = True; diff --git a/source3/libsmb/nmblib.c b/source3/libsmb/nmblib.c index 87f483e9fd..6314a9076b 100644 --- a/source3/libsmb/nmblib.c +++ b/source3/libsmb/nmblib.c @@ -762,7 +762,7 @@ static int build_dgram(char *buf,struct packet_struct *p) /******************************************************************* build a nmb name *******************************************************************/ -void make_nmb_name( struct nmb_name *n, char *name, int type, char *this_scope ) +void make_nmb_name( struct nmb_name *n, const char *name, int type, const char *this_scope ) { memset( (char *)n, '\0', sizeof(struct nmb_name) ); StrnCpy( n->name, name, 15 ); diff --git a/source3/libsmb/smbencrypt.c b/source3/libsmb/smbencrypt.c index 5017b33c07..9234088404 100644 --- a/source3/libsmb/smbencrypt.c +++ b/source3/libsmb/smbencrypt.c @@ -190,7 +190,7 @@ void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24) #endif } -BOOL make_oem_passwd_hash(char data[516], char *passwd, uchar old_pw_hash[16], BOOL unicode) +BOOL make_oem_passwd_hash(char data[516], const char *passwd, uchar old_pw_hash[16], BOOL unicode) { int new_pw_len = strlen(passwd) * (unicode ? 2 : 1); |