🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #6070

Re: Tin Indexes (Daemon and User)

#6070
From: Serge Robyns
Date: Thu, 30 Sep 1993 10:26
97 lines
3701 bytes
Mark Buckaway (mark@datasoft.com) wrote:
:>Tommy Wareing (p0070621@oxford-brookes.ac.uk) wrote:
:>: What I'm finally doing is letting everyone else run tin in setuid mode, so
:>: they get the central index, whilst I've linked my .tin/.index directory to
:>: the central one. It works... just ;-)

:>In my case, I made an alias in the .profile's of all users:

:>alias tin="tin -I /usr/spool/news/.index"

:>No links required here.

Ok,

I used the the same kind of work-around for 1.2 & 1.21.
But sometimes users just entered tin the hard way and then ....

So with 1.22 I patched main.c & init.c to have a FIXED_INDEX option.
It will disbale the -I option and use the INDEX_NEWSDIR for the
index_newsdir.

vvvv main.c vvvv
#if !defined(NNTP_ONLY) && !defined(FIXED_INDEX)
			case 'I':
				my_strncpy (index_newsdir, optarg, sizeof (index_newsdir));
				my_mkdir (index_newsdir, 0777);
				break;
#endif
^^^^ main.c ^^^^

This will cut off the -I option.

vvvv init.c vvvv
#ifdef INDEX_DAEMON
	joinpath  (lock_file, TMPDIR, LOCK_FILE);	
	strcpy (newsrc, news_active_file);	/* default so all groups are indexed */
	joinpath (active_times_file, rcdir, "active.times");
	joinpath (index_newsdir, get_val ("TIN_INDEXDIR", spooldir), INDEX_NEWSDIR);

	if (stat (index_newsdir, &sb) == -1) {
		my_mkdir (index_newsdir, 0755);
	}
#else
#	ifdef HAVE_LONG_FILENAMES
		sprintf (lock_file, "%stin.%s.LCK", TMPDIR, userid);	
#	else
		sprintf (lock_file, "%s%s.LCK", TMPDIR, userid);	
#	endif

	if (stat (rcdir, &sb) == -1) {
		created_rcdir = TRUE;
		my_mkdir (rcdir, 0755);
	}
#	ifdef FIXED_INDEX
	joinpath (index_newsdir, get_val ("TIN_INDEXDIR", spooldir), INDEX_NEWSDIR);
#	else
	if (tin_uid != real_uid) {
		joinpath (index_newsdir, get_val ("TIN_INDEXDIR", spooldir), INDEX_NEWSDIR);
		set_tin_uid_gid ();
		if (stat (index_newsdir, &sb) == -1) {
			my_mkdir (index_newsdir, 0777);
		}
		set_real_uid_gid ();
	} else if (stat (index_newsdir, &sb) == -1) {
		my_mkdir (index_newsdir, 0777);
	}
#	endif /* FIXED_INDEX */	
	if (stat (postfile, &sb) == -1) {
		if ((fp = fopen (postfile, "w")) != NULL) {
			fclose (fp);
		}
	}
	if (stat (attributes_file, &sb) == -1) {
		write_attributes_file ();
	}

	/*
	 * Read user config file ~/.tin/tinrc
	 */
	read_rcfile ();

#endif /* INDEX_DAEMON */	
^^^^ init.c ^^^^

This will used the INDEX_NEWSDIR as default index directory.

PS: Iain, can you insert such a kind of option for your next release.

	   ^ ^
	   o o
-------oOO-(_)-OOo-------------------------------------------------------------
Serge Robyns - System Engineer and Postmaster
Denkart n.v.
Molenweg 107
B-2830 Willebroek -  Belgium
Voice: +32 (3) 866-0022					Fax: +32 (3) 866-0301
e-mail: sr@denkart.be  (postmaster@denkart.be)
Technical Details
Message-ID: <CE5wzq.FyI@denkart.be>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!gmd.de!xlink.net!math.fu-berlin.de!umn.edu!news-feed-2.peachnet.edu!gatech!howland.reston.ans.net!math.ohio-state.edu!cs.utexas.edu!uunet!pipex!uknet!mcsun!ub4b!tyana!sr
References: <CDG517.CI9@uk.ac.brookes> <cliftonrCDGrLE.32H@netcom.com> <CDHsMF.27p@uk.ac.brookes> <cliftonrCDIMCq.HKy@netcom.com> <CDnAGA.D72@uk.ac.brookes> <1993Sep28.224015.11627@datasoft.com>

Show Full Headers
Complete Article Headers
Message-ID: <CE5wzq.FyI@denkart.be>
Subject: Re: Tin Indexes (Daemon and User)
Date: Thu, 30 Sep 1993 10:26:14 GMT
From: sr@denkart.be (Serge Robyns)
References: <CDG517.CI9@uk.ac.brookes> <cliftonrCDGrLE.32H@netcom.com> <CDHsMF.27p@uk.ac.brookes> <cliftonrCDIMCq.HKy@netcom.com> <CDnAGA.D72@uk.ac.brookes> <1993Sep28.224015.11627@datasoft.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!gmd.de!xlink.net!math.fu-berlin.de!umn.edu!news-feed-2.peachnet.edu!gatech!howland.reston.ans.net!math.ohio-state.edu!cs.utexas.edu!uunet!pipex!uknet!mcsun!ub4b!tyana!sr
Newsgroups: news.software.readers
Organization: Denkart n.v. - Belgium
X-Newsreader: TIN [version 1.2 PL2]
Lines: 97