mirror of
https://github.com/samba-team/samba.git
synced 2024-12-27 03:21:53 +03:00
2203bed32c
to make full use of the new talloc() interface. Discussed with Volker
and Jeremy.
* remove the internal mem_ctx and simply use the talloc()
structure as the context.
* replace the internal free_fn() with a talloc_destructor() function
* remove the unnecessary private nested structure
* rename SAM_ACCOUNT to 'struct samu' to indicate the current an
upcoming changes. Groups will most likely be replaced with a
'struct samg' in the future.
Note that there are now passbd API changes. And for the most
part, the wrapper functions remain the same.
While this code has been tested on tdb and ldap based Samba PDC's
as well as Samba member servers, there are probably still
some bugs. The code also needs more testing under valgrind to
ensure it's not leaking memory.
But it's a start......
(This used to be commit 19b7593972
)
51 lines
1.6 KiB
C
51 lines
1.6 KiB
C
/* syslogging function for errors and other information */
|
|
extern void _log_err(int, const char *, ...);
|
|
|
|
/* set the control flags for the UNIX module. */
|
|
extern int set_ctrl(int, int, const char **);
|
|
|
|
/* generic function for freeing pam data segments */
|
|
extern void _cleanup(pam_handle_t *, void *, int);
|
|
|
|
/*
|
|
* Safe duplication of character strings. "Paranoid"; don't leave
|
|
* evidence of old token around for later stack analysis.
|
|
*/
|
|
|
|
extern char *smbpXstrDup(const char *);
|
|
|
|
/* ************************************************************** *
|
|
* Useful non-trivial functions *
|
|
* ************************************************************** */
|
|
|
|
extern void _cleanup_failures(pam_handle_t *, void *, int);
|
|
|
|
/* compare 2 strings */
|
|
extern BOOL strequal(const char *, const char *);
|
|
|
|
extern struct smb_passwd *
|
|
_my_get_smbpwnam(FILE *, const char *, BOOL *, BOOL *, long *);
|
|
|
|
extern int _smb_verify_password( pam_handle_t *pamh , struct samu *sampass,
|
|
const char *p, unsigned int ctrl );
|
|
|
|
/*
|
|
* this function obtains the name of the current user and ensures
|
|
* that the PAM_USER item is set to this value
|
|
*/
|
|
|
|
extern int _smb_get_user(pam_handle_t *, unsigned int,
|
|
const char *, const char **);
|
|
|
|
/* _smb_blankpasswd() is a quick check for a blank password */
|
|
|
|
extern int _smb_blankpasswd(unsigned int, struct samu *);
|
|
|
|
|
|
/* obtain a password from the user */
|
|
extern int _smb_read_password( pam_handle_t *, unsigned int, const char*,
|
|
const char *, const char *, const char *, char **);
|
|
|
|
extern int _pam_smb_approve_pass(pam_handle_t *, unsigned int, const char *,
|
|
const char *);
|