Package: nn
Version: 6.6.5-2
Severity: important

[I have checked 6.7.2-1 from testing and all the following applies.]
[I have also looked back at 6.6.4-0.woody.1, where it also applied.]

The control files nn.{templates,config,postinst} seem a bit broken, in
several ways.  Perhaps the bug severity should be serious?

Summary:
(1) Template name mismatch
(2) Obsolete (and deprecated) creation of /etc/news in nn.config
(3) Owner/group mismatch for /etc/news
(4) Postinst writes to /etc/servers when /etc/server seems intended

Details:

(1) Template name mismatch

File nn.templates defines "Template: nn/ask-server".

But the scripts nn.config and nn.postinst try to interact with the
differently-named template "nn/ask-newsserver".

The result of this mismatch is a bit unpredictable, because it depends
on the pre-existing data in /var/cache/debconf/{config,templates}.dat

If there is no pre-existing nn/ask-newsserver in its cache, debconf
may return $RET = "nn/ask-newsserver doesn't exist" and this is
written out by the postinst to /etc/news/servers (this actually
occurred during my upgrade to woody).

If there is a pre-existing (old) nn/ask-newsserver in the cache, debconf
uses it, completely ignoring the (new) nn/ask-server in the package.
(This occurs on my system now, under sarge, though I have not been able
to determine when nn/ask-newsserver entered the cache.)

For a quick fix, I suggest changing nn.templates so that the template
is called 'nn/ask-newsserver' consistently.

[In the longer term, it would be good to agree a shared template with
other news packages in debian.  This is touched on in various policy
documents.  Until this is done, I would expect preconfiguration on a
fresh install (with no existing /etc/news/server) to ask the news
server question for several packages but then use the answer only from
one; not good.]


(2) Obsolete (and deprecated) creation of /etc/news in nn.config

Since version June 2002 (6.6.4-0.woody.1) the directory /etc/news has
been part of the nn-dirs.  See the changelog and bug #134002.  Sure
enough, in nn_6.7.2-1_i386.deb-DATA, we see:

    drwxr-xr-x    root/root          0 ./etc/news/

So I think the creation of /etc/news by script nn.config is obsolete.
Doing it in the maintainer scripts seems to go back essentially to
bug #49639 from November 1999, before it was one of the nn-dirs.

Surely you don't need to do that any more? By the time the dir is
needed - in the postinst - it will exist.

Creating the dir in the config script is not just redundant, it is
deprecated: "the config script should not need to modify the
filesystem at all" [debconf-devel(7), from package debconf-doc].


(3) Owner/group mismatch for /etc/news

The package is unclear about the desired owner/group of /etc/news.
In nn.config it says
    install -d -m 755 -o news -g news /etc/news
but the nn-dir unpacked by the package (see above) was root/root.

If there is a good reason for departing from general policy (debian
policy, section 10.9) and having owner/group news/news , then the
.deb-DATA should change, so it unpacks the dir correctly.  If you
are happy with root/root, the code in nn.config should say so -
except, as suggested at (2) above, this code should probably be deleted
anyway.


(4) Postinst writes to /etc/servers when /etc/server seems intended

File nn.config asks its template question
    if [ ! -f /etc/news/server ]

But the postinst uses the answer to that template question like this:
    # setting /etc/news/servers
    db_get nn/ask-newsserver || true
    echo $RET > /etc/news/servers

Notice the difference: 'server' and 'servers'.

I don't know the package well enough.  Perhaps this is not a bug.  But
it does look strange.  Surely if /etc/news/server does not exist, that
is the file you want to create?  [If this *is* a bug, it helps explain
why the other bugs didn't get noticed sooner.]


- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.4.27-2-686
Locale: LANG=en_GB, LC_CTYPE=en_GB (charmap=ISO-8859-1)

Versions of packages nn depends on:
ii  debconf                     1.4.30.13    Debian configuration management sy
ii  libc6                       2.3.2.ds1-22 GNU C Library: Shared libraries an
ii  libncurses5                 5.4-4        Shared libraries for terminal hand

-- debconf information:
  nn/ask-server: news



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to