==> Regarding [autofs] [patch rfc] don't exit from parent until autofs can 
service requests; Jeff Moyer <[EMAIL PROTECTED]> adds:

[snip]

Stupid thinko:

> +static void daemon_status(int code, const char *fmt, ...)
> +{
> +     va_list ap;
> +     struct daemon_status_msg msg;
> +     char buf[DAEMON_STATUS_MSG_SZ];
> +     int ret = 0;
> +
> +     if (submount || daemon_status_fd < 0)
> +             return;
> +
> +     msg.code = code;
> +     if (code) {
> +             va_start(ap, fmt);
> +             ret = vsnprintf(buf, DAEMON_STATUS_MSG_SZ, "%s", ap);
                                                           ^^^

That should be fmt, of course.

> +     if (code) {
> +             va_start(ap, fmt);
> +             ret = vsnprintf(buf, DAEMON_STATUS_MSG_SZ, fmt, ap);
> +             va_end(ap);
> +             if (ret > DAEMON_STATUS_MSG_SZ)
> +                     ret = DAEMON_STATUS_MSG_SZ - 1;
> +     }

And here it should be if ret >= DAEMON_STATUS_MSG_SZ, since the consumer
sets buf[msg.len] to NULL.

-Jeff

_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs

Reply via email to