summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-04-09 14:30:54 +0200
committerVolker Lendecke <vl@samba.org>2010-04-12 13:18:18 +0200
commitd73a7e7e9063083f73fcce5170ea9b9682d66ef6 (patch)
tree063051fd5a1b960e8a46275fb8e8e0a10ed38796 /source3/smbd
parent8c3fa1668654f482168e0c565458e701c23d4d9b (diff)
downloadsamba-d73a7e7e9063083f73fcce5170ea9b9682d66ef6.tar.gz
samba-d73a7e7e9063083f73fcce5170ea9b9682d66ef6.tar.bz2
samba-d73a7e7e9063083f73fcce5170ea9b9682d66ef6.zip
s3: Little refactoring: Factor out skip_space
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/map_username.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source3/smbd/map_username.c b/source3/smbd/map_username.c
index 8cbe40defd..8c8eb2ed9d 100644
--- a/source3/smbd/map_username.c
+++ b/source3/smbd/map_username.c
@@ -68,6 +68,14 @@ static bool set_last_from_to(const char *from, const char *to)
return true;
}
+static char *skip_space(char *s)
+{
+ while (isspace((int)(*s))) {
+ s += 1;
+ }
+ return s;
+}
+
bool map_username(struct smbd_server_connection *sconn, fstring user)
{
XFILE *f;
@@ -157,14 +165,11 @@ bool map_username(struct smbd_server_connection *sconn, fstring user)
*dosname++ = 0;
- while (isspace((int)*unixname))
- unixname++;
+ unixname = skip_space(unixname);
if ('!' == *unixname) {
return_if_mapped = True;
- unixname++;
- while (isspace((int)*unixname))
- unixname++;
+ unixname = skip_space(unixname+1);
}
if (!*unixname || strchr_m("#;",*unixname))