summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1997-12-03 04:20:39 +0000
committerAndrew Tridgell <tridge@samba.org>1997-12-03 04:20:39 +0000
commit02bc90ea442f5d115df17de0ebd0bbfdf214c1a5 (patch)
tree861cf2d9342ff9baa938d979c4afeef8ac8fb42d /source3
parent87df23458eac4e4a81673442db49467a65102b15 (diff)
downloadsamba-02bc90ea442f5d115df17de0ebd0bbfdf214c1a5.tar.gz
samba-02bc90ea442f5d115df17de0ebd0bbfdf214c1a5.tar.bz2
samba-02bc90ea442f5d115df17de0ebd0bbfdf214c1a5.zip
change the "username map" option to allow the user to stop the
processing part way through the file if a match is found. If a line starts with ! and a match is made by that line then processing stops. This allows better wildcard handling. (patch from Anselm.Kruis@Physik.Uni-Muenchen.DE) (This used to be commit af57bc05fe0f248aaef329358c583abcffe1657c)
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/username.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source3/lib/username.c b/source3/lib/username.c
index a9f6425991..a7241d309f 100644
--- a/source3/lib/username.c
+++ b/source3/lib/username.c
@@ -82,11 +82,19 @@ void map_username(char *user)
for (; (s=fgets_slash(NULL,80,f)); free(s)) {
char *unixname = s;
char *dosname = strchr(unixname,'=');
+ BOOL break_if_mapped = False;
if (!dosname) continue;
*dosname++ = 0;
while (isspace(*unixname)) unixname++;
+ if ('!' == *unixname)
+ {
+ break_if_mapped = True;
+ unixname++;
+ while (*unixname && isspace(*unixname)) unixname++;
+ }
+
if (!*unixname || strchr("#;",*unixname)) continue;
{
@@ -102,6 +110,10 @@ void map_username(char *user)
StrnCpy(last_from,user,sizeof(last_from)-1);
sscanf(unixname,"%s",user);
StrnCpy(last_to,user,sizeof(last_to)-1);
+ if(break_if_mapped) {
+ free(s);
+ break;
+ }
}
}