[SCM] Samba Shared Repository - branch v3-2-test updated -
initial-v3-2-unstable-307-g01663c2
Jeremy Allison
jra at samba.org
Tue Nov 13 02:13:08 GMT 2007
The branch, v3-2-test has been updated
via 01663c2312467ceebeb2e2fb1aa432ad96c626e5 (commit)
from 7bfd25c75602e25da73710261a54da8e0feea133 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test
- Log -----------------------------------------------------------------
commit 01663c2312467ceebeb2e2fb1aa432ad96c626e5
Author: Jeremy Allison <jra at samba.org>
Date: Mon Nov 12 18:12:26 2007 -0800
More pstring removal from smbd/*.c
Jeremy.
-----------------------------------------------------------------------
Summary of changes:
source/smbd/map_username.c | 28 +++++++++++++++++-----------
1 files changed, 17 insertions(+), 11 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/smbd/map_username.c b/source/smbd/map_username.c
index d9ad81a..c04e0f1 100644
--- a/source/smbd/map_username.c
+++ b/source/smbd/map_username.c
@@ -39,30 +39,36 @@ bool map_username(fstring user)
XFILE *f;
char *mapfile = lp_username_map();
char *s;
- pstring buf;
+ char buf[512];
bool mapped_user = False;
char *cmd = lp_username_map_script();
-
+
if (!*user)
- return False;
-
+ return false;
+
if (strequal(user,last_to))
- return False;
+ return false;
if (strequal(user,last_from)) {
DEBUG(3,("Mapped user %s to %s\n",user,last_to));
fstrcpy(user,last_to);
- return True;
+ return true;
}
-
+
/* first try the username map script */
-
+
if ( *cmd ) {
char **qlines;
- pstring command;
+ char *command = NULL;
int numlines, ret, fd;
- pstr_sprintf( command, "%s \"%s\"", cmd, user );
+ command = talloc_asprintf(talloc_tos(),
+ "%s \"%s\"",
+ cmd,
+ user);
+ if (!command) {
+ return false;
+ }
DEBUG(10,("Running [%s]\n", command));
ret = smbrun(command, &fd);
@@ -87,7 +93,7 @@ bool map_username(fstring user)
}
file_lines_free(qlines);
-
+
return numlines != 0;
}
--
Samba Shared Repository
More information about the samba-cvs
mailing list