diff options
author | Andrew Bartlett <abartlet@samba.org> | 2002-05-22 12:14:28 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2002-05-22 12:14:28 +0000 |
commit | daec6cbbeee8401ef1aa0a3424ee05a3148d7ec8 (patch) | |
tree | 818ccf249203cf2ddc3d0ecd538f406b814b60b2 /source3/lib/util_pw.c | |
parent | c2b867038a9e4ddad987bbc6472bd9b8d42fed9d (diff) | |
download | samba-daec6cbbeee8401ef1aa0a3424ee05a3148d7ec8.tar.gz samba-daec6cbbeee8401ef1aa0a3424ee05a3148d7ec8.tar.bz2 samba-daec6cbbeee8401ef1aa0a3424ee05a3148d7ec8.zip |
Cleanups!
Make some code static, add some const to the PAM code, and make the plaintext
password code actually function - particulary without the requirement to
modify the 'struct passwd' (which it assumed was made up of fstrings)
This kills some particularly ugly code in lib/util_pw.c
Andrew Bartlett
(This used to be commit 302dad4990ba5194f072e435465d9adaa089ae06)
Diffstat (limited to 'source3/lib/util_pw.c')
-rw-r--r-- | source3/lib/util_pw.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/source3/lib/util_pw.c b/source3/lib/util_pw.c index 259649a064..47711788c7 100644 --- a/source3/lib/util_pw.c +++ b/source3/lib/util_pw.c @@ -22,50 +22,6 @@ #include "includes.h" -struct passwd *make_modifyable_passwd(const struct passwd *from) -{ - struct passwd *ret = smb_xmalloc(sizeof(*ret)); -/* This is the assumed shape of the members by certain parts of the code... - fstring pw_name; - fstring pw_passwd; - fstring pw_gecos; - pstring pw_dir; - pstring pw_shell; -*/ - char *pw_name = smb_xmalloc(sizeof(fstring)); - char *pw_passwd = smb_xmalloc(sizeof(fstring)); - char *pw_gecos = smb_xmalloc(sizeof(fstring)); - char *pw_dir = smb_xmalloc(sizeof(pstring)); - char *pw_shell = smb_xmalloc(sizeof(pstring)); - - ZERO_STRUCTP(ret); - - /* - * Now point the struct's members as the - * newly allocated buffers: - */ - - ret->pw_name = pw_name; - fstrcpy(ret->pw_name, from->pw_name); - - ret->pw_passwd = pw_passwd; - fstrcpy(ret->pw_passwd, from->pw_passwd); - - ret->pw_uid = from->pw_uid; - ret->pw_gid = from->pw_gid; - - ret->pw_gecos = pw_gecos; - fstrcpy(ret->pw_gecos, from->pw_gecos); - - ret->pw_dir = pw_dir; - pstrcpy(ret->pw_dir, from->pw_dir); - - ret->pw_shell = pw_shell; - pstrcpy(ret->pw_shell, from->pw_shell); - - return ret; -} - static struct passwd *alloc_copy_passwd(const struct passwd *from) { struct passwd *ret = smb_xmalloc(sizeof(struct passwd)); |