Opening /dev/stdout in Docker

Alan DeKok aland at
Thu Aug 4 13:34:04 UTC 2022

On Aug 4, 2022, at 4:14 AM, Benjamin Thompson <b.thompson at> wrote:
> I am running v3.2.0 in a Docker container and I wanted to do some logging
> with linelog so I set the filename parameter to "/dev/stdout".
> This gave me the error:
> Error: rlm_linelog: Failed to open /dev/stdout: Permission denied

  Yeah, that's a little weird.

> However this did not help so I looked at the source code and noticed that
> FreeRADIUS is opening the file with read/write permissions whereas only
> write is available:
> if (strncmp(filename, "/dev/", 5) == 0) {
>         fd = open(filename, O_RDWR, permissions);

  It's possible to add some checks there for permissions, and modify O_RDWR for that.  I've pushed a fix.

  See commit 1abf810524 on GitHub.  You should be able to add that to 3.2.0 without any issues.

> So then I ran:
> chmod g+r /dev/pts/0
> After this linelog was able to log to stdout.
> However with "tty: true" I am now getting some extra control characters in
> my logs such as "'#033#015". This is inconvenient but non critical.


> I would be grateful if anyone could advise or assist with a better solution.

  See above.

  Alan DeKok.

More information about the Freeradius-Users mailing list