* Bug in subscriber searching function is_subbed_in()
@ 2006-08-07 3:49 Magnus Naeslund(k)
2006-08-07 9:44 ` Mads Martin Joergensen
0 siblings, 1 reply; 2+ messages in thread
From: Magnus Naeslund(k) @ 2006-08-07 3:49 UTC (permalink / raw)
To: mlmmj
I found out that the subscribercode searches the subscriber directory
and tries to mmap the lockfile it created earlier which size is zero,
hence the logentry:
/usr/bin/mlmmj-sub[25209]: subscriberfuncs.c:61: Could not mmap fd: Invalid argument
I modified the code to skip ALL files that starts with a dot, that
takes care if . and .. directories aswell as the .$file.lock files.
Is this patch acceptable?
Regards,
Magnus
--- mlmmj-1.2.11-vanilla/src/subscriberfuncs.c 2005-02-14 23:59:24.000000000 +0100
+++ mlmmj-1.2.11/src/subscriberfuncs.c 2006-08-07 05:42:49.000000000 +0200
@@ -101,9 +101,8 @@
}
while((dp = readdir(subddir)) != NULL) {
- if(!strcmp(dp->d_name, "."))
- continue;
- if(!strcmp(dp->d_name, ".."))
+ /* Skip "." ".." and ".*.lock" files */
+ if(dp->d_name[0] = '.')
continue;
subreadname = concatstr(2, subddirname, dp->d_name);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Bug in subscriber searching function is_subbed_in()
2006-08-07 3:49 Bug in subscriber searching function is_subbed_in() Magnus Naeslund(k)
@ 2006-08-07 9:44 ` Mads Martin Joergensen
0 siblings, 0 replies; 2+ messages in thread
From: Mads Martin Joergensen @ 2006-08-07 9:44 UTC (permalink / raw)
To: mlmmj
* Magnus Naeslund(k) <mag@kite.se> [Aug 07. 2006 05:49]:
> I found out that the subscribercode searches the subscriber directory
> and tries to mmap the lockfile it created earlier which size is zero,
> hence the logentry:
>
> /usr/bin/mlmmj-sub[25209]: subscriberfuncs.c:61: Could not mmap fd: Invalid argument
>
> I modified the code to skip ALL files that starts with a dot, that
> takes care if . and .. directories aswell as the .$file.lock files.
>
> Is this patch acceptable?
Not really. It means it wont search .somesubshereinthis file. But to
that bug, there's already a fix in the tree:
/* No need to check in 0-size file */
if(st.st_size = 0)
return (off_t)-1;
So after ignoring . and .. we only work on files bigger than 0.
--
Mads Martin Joergensen, http://mmj.dk
"Why make things difficult, when it is possible to make them cryptic
and totally illogical, with just a little bit more effort?"
-- A. P. J.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-08-07 9:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-07 3:49 Bug in subscriber searching function is_subbed_in() Magnus Naeslund(k)
2006-08-07 9:44 ` Mads Martin Joergensen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.