🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
2 messages
2 total messages Started by Luc-Olivier Gouedart Lafeuille Tue, 18 Feb 2003 22:55
password file format ????
#64077
Author: Luc-Olivier Gouedart Lafeuille
Date: Tue, 18 Feb 2003 22:55
26 lines
1536 bytes
auth all {
               auth: "ckpasswd -d /usr/local/news/db/newsusers"
               auth: "ckpasswd -s"
           }

           access full {
               users: *
               newsgroups: *
           }

I'm looking for the format of file where chpasswd look for access by
user and password.
I've scann many and many pages, contrib, messages in news but I've
never find out the solution.

Is someone can help me.

My goal is only to run an innd for private news like in the old
version with nnrp.access file where user name, password, access type,
news wildcard and resolv reaching were set.

Thanks,
Regards.

luc-olivier@gouedart-lafeuille.net
Re: password file format ????
#64080
Author: Jeffrey M. Vinocur
Date: Wed, 19 Feb 2003 01:25
139 lines
4536 bytes
In article <b6f4115d.0302181455.5edf8ae9@posting.google.com>,
Luc-Olivier Gouedart Lafeuille <luc-olivier@gouedart-lafeuille.net> wrote:
>
>               auth: "ckpasswd -d /usr/local/news/db/newsusers"
>
>I'm looking for the format of file where chpasswd look for access by
>user and password.

Did you examine the ckpasswd manpage?


>My goal is only to run an innd for private news like in the old
>version with nnrp.access file where user name, password, access type,
>news wildcard and resolv reaching were set.

I have a script for converting nnrp.access to readers.conf:


#!/usr/bin/perl

# Written by Jeffrey M. Vinocur <jeff@litech.org>
# This work is hereby placed in the public domain by its author.

use strict;
use warnings;

my ($src, $passwd, $dst, $debug);

if(@ARGV == 1) {
    $src = shift;
    $passwd = 'passwd';
    $debug = 1;
} elsif(@ARGV == 3) {
    ($src, $passwd, $dst) = @ARGV;
    $debug = 0;
} else {
    usage();
}

my ($address, $access, $user, $pass, $groups);
my %passwords;
my @badsyntax;
my @duplicates;
my $OUT;

open(SRC, $src) or die "Could not open $src: $!\n";

if($debug) {
    $OUT = \*STDOUT;
} else {
    open(DST, ">$dst") or die "Could not open $dst: $!\n";
    $OUT = \*DST;
}

while(<SRC>) {
    chomp;
    next if /^\#/;
    s/\#.*//;
    ($address, $access, $user, $pass, $groups) = split /:/;
    unless (defined $groups) {
        push @badsyntax, $.;
        next;
    }

    # XXX - what exactly were the semantics of using
    # whitespace in user/pass to disable access?

    unless($user eq '') {
        push @duplicates, $. if defined $passwords{$user};
        $passwords{$user} = $pass;
    }

    print $OUT "auth \"$address\" {\n";
    print $OUT "    hosts: \"$address\"\n";
    print $OUT "    key: \"line$.\"\n";
    print $OUT "    auth: \"ckpasswd -f $passwd\"\n" unless $user eq '';
    print $OUT "}\n";
    print $OUT "access \"$address\" {\n";
    print $OUT "    key: \"line$.\"\n";
    print $OUT "    newsgroups: \"$groups\"\n";
    print $OUT "    access: \"$access\"\n";
    print $OUT "    users: \"$user\"\n" unless $user eq '';
    print $OUT "}\n\n";

}
close SRC;

srand($$^time);

# XXX - if $passwd exists, should we overwrite, append, or merge?
if(!$debug) {
    close $OUT;
    open(PASSWD, ">$passwd") or die "Could not open $passwd: $!\n";
    $OUT = \*PASSWD;
}
while (my ($user, $pass) = each %passwords) {
    $pass = crypt($pass, seedchar().seedchar());
    print $OUT "$user:$pass\n";
}
close PASSWD unless $debug;

print STDERR "Had trouble with syntax on line", 
             @badsyntax > 1 ? 's ' : ' ',
             join(", ", @badsyntax), ".\n"
    if @badsyntax;

print STDERR "Found username duplication on line",
             @duplicates > 1 ? 's ' : ' ',
             join(", ", @duplicates), ".\n"
    if @duplicates;


sub seedchar {  # from Randal Schwarz
    ('a'..'z','A'..'Z','0'..'9','.','/')[rand(64)];
}

sub usage {
    print STDERR << "__END__";
Usage:

$0 <nnrp.access file> [<passwd file> <readers.conf file>]

Use $0 to convert an old-style nnrp.access file to readers.conf 
format.  All unique user/password pairs from the nnrp.access file are 
placed in the passwd file (in format suitable for ckpasswd).

If the second and third arguments are missing, everything is 
printed instead to stdout for examination purposes.

__END__

exit 1;

}

-- 
Jeffrey M. Vinocur
jeff@litech.org
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads