Skip to contentSkip to conversation

MAINTAINERS file addition: Al Viro

PATCH In review Rusty Russell 3 participants 3 messages May 27, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MAINTAINERS file addition: Al Viro

I'm sick of searching my mail archives to find that email addr.

Rusty.

MAINTAINERS +5 -0
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.18/MAINTAINERS working-2.5.18-viro/MAINTAINERS
@@ -574,6 +574,11 @@
 L:	[email protected]
 S:	Maintained
 
+FILESYSTEMS (VFS and infrastructure)
+P:	Alexander Viro
+M:	[email protected]
+S:	Maintained
+
 FPU EMULATOR
 P:	Bill Metzenthen
 M:	[email protected]

--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

#1 lore raw
Quoted 1 line · Rusty Russell

I'm sick of searching my mail archives to find that email addr.

Oh, for crying out loud... Even mail(1) supports aliases - say
echo alias bastard [email protected] >> ~/.mailrc and enjoy. If your MUA doesn't have aliases/address book/etc. - switch to something sane.

MAINTAINERS line 580

Quoted 4 lines
MAINTAINERS +4 -0
+FILESYSTEMS (VFS and infrastructure)
+P:	Alexander Viro
+M:	[email protected]
+S:	Maintained

<shrug> whatever...

#2 lore raw
In reply to Rusty Russell
Quoted 3 lines · Alexander Viro

Oh, for crying out loud... Even mail(1) supports aliases - say
echo alias bastard [email protected] >> ~/.mailrc and enjoy. If your MUA doesn't have aliases/address book/etc. - switch to something sane.

I got sick of everything not having this about 15 years ago. If you compile this as cc -o Alias alias.c and then do stuff like

alias mutt='Alias mutt'

then it will do the lookup and tell you how it is rewriting the addresses as you pop into the tool.

static char *id = "@(#)alias.c 1.2 - main, strsav; [email protected]";

/* Alias - provide front end for whatever that loads aliases.
* Look in ~/.fingerc for aliases. You could link this to .mailrc. *
* An alias is the regular expression:
*
* ^alias[ <tab>]+name[ <tab>]+full_name
*
* and "finger name" gets translated to finger fullname. Exception: any
* fullname that contains a "!" is ignored (can't do uucp, only internet). *
* Options: -I ignores the dotfiles; a good way to finger a local john instead
* of the aliased john.
*
* Revisions:
* 1/May/87: Add support for general machine aliasing as well as people
* aliasing. A machine alias for seismo is
*
* alias seismo @siesmo.css.gov
*
* and finger foo@seismo will rewrite to [email protected]
*
* 5/May/87: Make this a general interface to any program. Usage is:
* Alias program args
*
* and typical usage is
*
* alias mail 'Alias Mail \!*'
*/

#include <stdio.h>
#include <ctype.h>

char   *malloc();
char   *strcpy();
char   *strsav();
char   *index();
char   *PROG;

int quiet;

main(ac, av, ev)

	char  **av;
	char  **ev;
{
	char    fingerc[255], buf[500], machine[100];
	register i;
	FILE   *f = (FILE *) - 1;

	sprintf(fingerc, "%s/.fingerc", getenv("HOME"));

	/* quiet or noisy? */
	if (!strcmp(av[1], "-Q")) {
		quiet++;
		for (i = 1; i < ac; i++)
			av[i] = av[i + 1];
		--ac;
	}
	/* grab new program name and shift argv down */
	PROG = av[1];
	av[0] = PROG;
	for (i = 1; i < ac; i++)
		av[i] = av[i + 1];
	--ac;

	if (!(f = fopen(fingerc, "r"))) {
		execvp(PROG, av);
		perror(PROG);
	}
	/* stupid alg: scan the file for each av, but there's usually only one. */
	for (i = 1; i < ac; i++) {
		register len = strlen(av[i]);
		register mlen = 0;

		/* optimization: ignore options */
		if (*av[i] == '-')
			continue;

		rewind(f);

		/* grab machine name, it might be an alias */
		if (index(av[i], '@')) {
			strcpy(machine, index(av[i], '@') + 1);
			mlen = strlen(machine);
		} else
			machine[0] = 0;

		while (fgets(buf, sizeof(buf), f)) {
			register char *s;
			register char *t;

			/* chop newline */
			buf[strlen(buf) - 1] = 0;

			/* only aliases, please (sorry alice) */
			if (strncmp(buf, "alias", 5))
				continue;
			for (s = buf + 5; *s && isspace(*s); s++);

			/* match user alias? */
			if (!strncmp(s, av[i], len) && isspace(*(s + len))) {
				s += len;
				for (; *s && isspace(*s); s++);
				/* is it really a user or is it a machine? */
				if (*s == '@')
					s++;
				for (t = s; *t && !isspace(*t); t++);
				if (!index(s, '!')) {
					if (!quiet)
						fprintf(stderr, "%s --> %s\n", av[i], s);
					av[i] = strsav(s);
					break;	/* while, get next i */
				}
			}
			/* match system alias? */
			if (mlen && !strncmp(machine, s, mlen)) {
				char    buf2[200];
				register char *save;

				/* get to @full.name.part */
				s += mlen;
				for (; *s && isspace(*s); s++);
				if (*s++ != '@')
					continue;
				for (t = s; *t && !isspace(*t); t++);
				*t = NULL;

				*(index(av[i], '@') + 1) = NULL;
				sprintf(buf2, "%s%s", av[i], s);
				if (!quiet)
					fprintf(stderr, "%s%s --> %s\n", av[i], machine, buf2);
				av[i] = strsav(buf2);
				break;	/* while, get next i */
			}
		}
	}
	execvp(PROG, av);
	perror(PROG);
}

char *
strsav(s)

	register char *s;
{
	register char *t = malloc(strlen(s) + 1);

	return strcpy(t, s);
}