summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-05-22 12:14:28 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-05-22 12:14:28 +0000
commitdaec6cbbeee8401ef1aa0a3424ee05a3148d7ec8 (patch)
tree818ccf249203cf2ddc3d0ecd538f406b814b60b2 /source3/lib
parentc2b867038a9e4ddad987bbc6472bd9b8d42fed9d (diff)
downloadsamba-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')
-rw-r--r--source3/lib/util.c2
-rw-r--r--source3/lib/util_pw.c44
2 files changed, 1 insertions, 45 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index e143364db5..a23ef91a31 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -118,7 +118,7 @@ BOOL in_group(gid_t group, gid_t current_gid, int ngroups, gid_t *groups)
Like atoi but gets the value up to the separator character.
****************************************************************************/
-char *Atoic(char *p, int *n, char *c)
+static char *Atoic(char *p, int *n, char *c)
{
if (!isdigit((int)*p)) {
DEBUG(5, ("Atoic: malformed number\n"));
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));