mirror of
https://github.com/samba-team/samba.git
synced 2025-12-17 04:23:50 +03:00
passdb.c: Fixed typo in coment.
smb.h: Removed comments no longer valid. smbpass.c: Stopped dummy function from being prototyped. util.c: Fix for multibyte char problems with strlower, strupper and string_replace. Jeremy.
This commit is contained in:
@@ -637,17 +637,6 @@ struct shmem_ops {
|
|||||||
/*
|
/*
|
||||||
* Each implementation of the password database code needs
|
* Each implementation of the password database code needs
|
||||||
* to support the following operations.
|
* to support the following operations.
|
||||||
*
|
|
||||||
* either the get/mod/add-smbXXX or the get/mod/add-sam21XXX functions
|
|
||||||
* are optional, but not both. conversion routines will be called
|
|
||||||
* if only one of each is supported. the preference is to provide
|
|
||||||
* full getsam21pwXXX functionality.
|
|
||||||
*
|
|
||||||
* e.g: provide a getsam21pwnam() function but set getsmbpwnam() to NULL:
|
|
||||||
* passdb.c will automatically call getsam21pwnam() and then call the
|
|
||||||
* sam21-to-smb conversion routine if the passdb.c::getsmbpwnam() function
|
|
||||||
* is called.
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct passdb_ops {
|
struct passdb_ops {
|
||||||
|
|||||||
@@ -1115,9 +1115,15 @@ void strlower(char *s)
|
|||||||
else
|
else
|
||||||
#endif /* KANJI_WIN95_COMPATIBILITY */
|
#endif /* KANJI_WIN95_COMPATIBILITY */
|
||||||
{
|
{
|
||||||
if (isupper(*s))
|
int skip = skip_multibyte_char( *s );
|
||||||
*s = tolower(*s);
|
if( skip != 0 )
|
||||||
s++;
|
s += skip;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (isupper(*s))
|
||||||
|
*s = tolower(*s);
|
||||||
|
s++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1162,9 +1168,15 @@ void strupper(char *s)
|
|||||||
else
|
else
|
||||||
#endif /* KANJI_WIN95_COMPATIBILITY */
|
#endif /* KANJI_WIN95_COMPATIBILITY */
|
||||||
{
|
{
|
||||||
if (islower(*s))
|
int skip = skip_multibyte_char( *s );
|
||||||
*s = toupper(*s);
|
if( skip != 0 )
|
||||||
s++;
|
s += skip;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (islower(*s))
|
||||||
|
*s = toupper(*s);
|
||||||
|
s++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1197,34 +1209,13 @@ BOOL strisnormal(char *s)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
void string_replace(char *s,char oldc,char newc)
|
void string_replace(char *s,char oldc,char newc)
|
||||||
{
|
{
|
||||||
|
int skip;
|
||||||
while (*s)
|
while (*s)
|
||||||
{
|
{
|
||||||
#if !defined(KANJI_WIN95_COMPATIBILITY)
|
skip = skip_multibyte_char( *s );
|
||||||
/*
|
if( skip != 0 )
|
||||||
* For completeness we should put in equivalent code for code pages
|
s += skip;
|
||||||
* 949 (Korean hangul) and 950 (Big5 Traditional Chinese) here - but
|
|
||||||
* doubt anyone wants Samba to behave differently from Win95 and WinNT
|
|
||||||
* here. They both treat full width ascii characters as case senstive
|
|
||||||
* filenames (ie. they don't do the work we do here).
|
|
||||||
* JRA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if(lp_client_code_page() == KANJI_CODEPAGE)
|
|
||||||
{
|
|
||||||
/* Win95 treats full width ascii characters as case sensitive. */
|
|
||||||
if (is_shift_jis (*s))
|
|
||||||
s += 2;
|
|
||||||
else if (is_kana (*s))
|
|
||||||
s++;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (oldc == *s)
|
|
||||||
*s = newc;
|
|
||||||
s++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
#endif /* KANJI_WIN95_COMPATIBILITY */
|
|
||||||
{
|
{
|
||||||
if (oldc == *s)
|
if (oldc == *s)
|
||||||
*s = newc;
|
*s = newc;
|
||||||
|
|||||||
@@ -324,7 +324,7 @@ struct sam_passwd *iterate_getsam21pwnam(char *name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
Utility function to search sam passwd by uid. use this if your database
|
Utility function to search sam passwd by rid. use this if your database
|
||||||
does not have search facilities.
|
does not have search facilities.
|
||||||
|
|
||||||
search capability by both rid and uid are needed as the rid <-> uid
|
search capability by both rid and uid are needed as the rid <-> uid
|
||||||
|
|||||||
@@ -896,6 +896,10 @@ static BOOL mod_smbfilepwd_entry(struct smb_passwd* pwd, BOOL override)
|
|||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Stub functions - implemented in terms of others.
|
||||||
|
*/
|
||||||
|
|
||||||
static BOOL mod_smbfile21pwd_entry(struct sam_passwd* pwd, BOOL override)
|
static BOOL mod_smbfile21pwd_entry(struct sam_passwd* pwd, BOOL override)
|
||||||
{
|
{
|
||||||
return mod_smbfilepwd_entry(pdb_sam_to_smb(pwd), override);
|
return mod_smbfilepwd_entry(pdb_sam_to_smb(pwd), override);
|
||||||
@@ -948,5 +952,5 @@ struct passdb_ops *file_initialize_password_db(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
static void dummy_function(void) { } /* stop some compilers complaining */
|
void dummy_function(void) { } /* stop some compilers complaining */
|
||||||
#endif /* USE_SMBPASS_DB */
|
#endif /* USE_SMBPASS_DB */
|
||||||
|
|||||||
Reference in New Issue
Block a user