Bug 174672 - inn's server_init sets TMPDIR; how rude!
Summary: inn's server_init sets TMPDIR; how rude!
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: inn
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Martin Stransky
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-12-01 10:04 UTC by Jonathan Kamens
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-12-20 14:22:38 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jonathan Kamens 2005-12-01 10:04:58 UTC
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>

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

Library functions should not be setting TMPDIR.

Comment 1 Martin Stransky 2005-12-02 10:35:27 UTC
I'm going to consult it with upstream....

Comment 2 ptomblin 2005-12-02 16:16:03 UTC
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 16:20:11 UTC
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 
TMPDIR.


Comment 4 Martin Stransky 2005-12-20 14:22:38 UTC
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.