Bug 174672 - inn's server_init sets TMPDIR; how rude!
inn's server_init sets TMPDIR; how rude!
Product: Fedora
Classification: Fedora
Component: inn (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Martin Stransky
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2005-12-01 05:04 EST by Jonathan Kamens
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-12-20 09:22:38 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jonathan Kamens 2005-12-01 05:04:58 EST
With inn-devel-2.4.2-4, if you link against libinn and call its server_init
function, you end up with TMPDIR set to /var/lib/news/tmp, which doesn't do much
good if you aren't running as root or news (which you probably aren't, if you're
a news client that links against libinn).

Demonstrate this by compiling and running the following problem with "gcc
-I/usr/include/inn -L/usr/lib/news/lib test.c -linn", with inn-devel installed:

#include <stdlib.h>
#include <libinn.h>
#include <stdio.h>

  if (getenv("TMPDIR")) {
    printf("%s\n", getenv("TMPDIR"));
  else {
  server_init("localhost", 119);
  if (getenv("TMPDIR")) {
    printf("%s\n", getenv("TMPDIR"));
  else {

Library functions should not be setting TMPDIR.
Comment 1 Martin Stransky 2005-12-02 05:35:27 EST
I'm going to consult it with upstream....
Comment 2 ptomblin 2005-12-02 11:16:03 EST
The concept of a news client that talks directly to the server with libinn
rather than talking NNTP over a socket is so repellant that I hope this is
closed as "NOTABUG".  I would think libinn is meant more for people writing
server extensions, like spam filtering or the like.
Comment 3 Jonathan Kamens 2005-12-02 11:20:11 EST
You are confused.  The routines I'm talking about in libinn are intended for 
clients to link against to talk to the server via NNTP.  They are a 
replacement for the old "clientlib.c" that was shipped with rrn and is the 
quasi-standard interface for Unix news clients to talk NNTP with a server.

Routines that are intended to be used by News clients shouldn't mess with 
Comment 4 Martin Stransky 2005-12-20 09:22:38 EST
Reported to upstream, here is the reply from Russ Allbery:

"I plan on dropping all of the clientlib compatibility functions in the
next major release of INN.  INN really doesn't do a good enough job of
providing an NNTP library to warrant continuing to include them, and very
few programs use them.  (INN will eventually provide a different NNTP
library with a much different API, but that's another story.)"

Note You need to log in before you can comment on or make changes to this bug.