diff options
author | Luke Leighton <lkcl@samba.org> | 1998-05-07 19:59:32 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1998-05-07 19:59:32 +0000 |
commit | b543829dfceae6781624bebe11a2365c34e2d159 (patch) | |
tree | 6ff2af6dada6447e556f199b4b63508a8dd02cf0 /source3/passdb | |
parent | 01df1ed95f880a671ead7bc92b3bcff01a2e2dc0 (diff) | |
download | samba-b543829dfceae6781624bebe11a2365c34e2d159.tar.gz samba-b543829dfceae6781624bebe11a2365c34e2d159.tar.bz2 samba-b543829dfceae6781624bebe11a2365c34e2d159.zip |
moving gethexpwd into util.c, because it's used in both smbpass.c and ldap.c
(This used to be commit abe261b2f5ea7036e7be6230876176d134ef4ee4)
Diffstat (limited to 'source3/passdb')
-rw-r--r-- | source3/passdb/ldap.c | 28 | ||||
-rw-r--r-- | source3/passdb/smbpass.c | 29 |
2 files changed, 0 insertions, 57 deletions
diff --git a/source3/passdb/ldap.c b/source3/passdb/ldap.c index d9387dfcc4..6045534998 100644 --- a/source3/passdb/ldap.c +++ b/source3/passdb/ldap.c @@ -401,34 +401,6 @@ static void ldap_get_user(LDAP *ldap_struct,LDAPMessage *entry, } } -/************************************************************* - Routine to get the next 32 hex characters and turn them - into a 16 byte array. -**************************************************************/ - -static int gethexpwd(char *p, char *pwd) -{ - int i; - unsigned char lonybble, hinybble; - char *hexchars = "0123456789ABCDEF"; - char *p1, *p2; - - for (i = 0; i < 32; i += 2) { - hinybble = toupper(p[i]); - lonybble = toupper(p[i + 1]); - - p1 = strchr(hexchars, hinybble); - p2 = strchr(hexchars, lonybble); - if (!p1 || !p2) - return (False); - hinybble = PTR_DIFF(p1, hexchars); - lonybble = PTR_DIFF(p2, hexchars); - - pwd[i / 2] = (hinybble << 4) | lonybble; - } - return (True); -} - /******************************************************************* retrieve the machine's info and contruct a smb_passwd structure. ******************************************************************/ diff --git a/source3/passdb/smbpass.c b/source3/passdb/smbpass.c index 31567eafd8..3344a22eb5 100644 --- a/source3/passdb/smbpass.c +++ b/source3/passdb/smbpass.c @@ -165,41 +165,12 @@ void endsmbpwent(void *vp) DEBUG(7, ("endsmbpwent: closed password file.\n")); } -/************************************************************* - Routine to get the next 32 hex characters and turn them - into a 16 byte array. -**************************************************************/ - -static int gethexpwd(char *p, char *pwd) -{ - int i; - unsigned char lonybble, hinybble; - char *hexchars = "0123456789ABCDEF"; - char *p1, *p2; - - for (i = 0; i < 32; i += 2) { - hinybble = toupper(p[i]); - lonybble = toupper(p[i + 1]); - - p1 = strchr(hexchars, hinybble); - p2 = strchr(hexchars, lonybble); - if (!p1 || !p2) - return (False); - hinybble = PTR_DIFF(p1, hexchars); - lonybble = PTR_DIFF(p2, hexchars); - - pwd[i / 2] = (hinybble << 4) | lonybble; - } - return (True); -} - /************************************************************************* Routine to return the next entry in the smbpasswd list. do not call this function directly. use passdb.c instead. *************************************************************************/ - struct smb_passwd *getsmbpwent(void *vp) { /* Static buffers we will return. */ |