HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: password problems??



On Mon, 30 Nov 1998, Gerry Doris wrote:

> Hi Jonathan (see I know your name!).
> 
> Keith sent me the password.c file but I've never compiled a c program
> before.  I started looking at the man files for the compiler and my eyes
> started to glaze over.
> 
> Is there any chance that you might be able to send me the executable for
> password.c??  I'm using SuSE 5.3 linux on a 486.

Unfortunately, I haven't got a Linux box anywhere (FreeBSD, SCO,
Digital, Irix; but no Linux). However, compiling the program is
pretty simple. Save the source file (as mkpass.c), and compile with:

	gcc -o mkpass mkpass.c

or possibly

	gcc -o mkpass mkpass.c -lcrypt

(depends on where crypt(3) lives on Linux)

And you can run the program with:

	./mkpass

Cheers.
--
Jonathan Chen                         | "Vini, vidi, velcro...
                                      |    I came, I saw, I stuck around"
/*
 *	Jonathan Chen: Apr 27 1997
 */
#include	<stdio.h>
#include	<stdlib.h>
#include	<unistd.h>
#include	<crypt.h>
#include	<time.h>

main (
 int	argc,
 char *	argv [])
{
	char	salt [3];
	time_t	now = time (NULL);

	if (argc < 2)
	{
		fprintf (stderr, "Usage: %s plaintext\n", argv [0]);
		return (EXIT_FAILURE);
	}

	if (getpid () % 52 > 26)
		salt [0] = getpid () % 26 + 'a';
	else
		salt [0] = getpid () % 26 + 'A';
	if (now % 52 > 26)
		salt [1] = now % 26 + 'a';
	else
		salt [1] = now % 26 + 'A';
	salt [2] = '\0';

	printf ("%s\n", crypt (argv [1], salt));
	return (EXIT_SUCCESS);
}
From: David Woolley <david@djwhome.demon.co.uk>
Subject: Re: flexfax: Paging system. (fwd)
To: cdick@mail.ocis.net (Colin Dick)
Date: Mon, 30 Nov 1998 08:55:19 +0000 (GMT)
Cc: flexfax@sgi.com, oswell@mail.ocis.net, gharris@pagecom.ca
Reply-To: flexfax@sgi.com
X-Mailer: ELM [version 2.4 PL25]
Sender: owner-flexfax@celestial.com

> IE: in the pagemap file
> 
> dick@page.ocis.net              314-6946/314-5705
> cdick@page.ocis.net             314-6946/3145704
  ^^^^^^^^^^^^^^^^^^^
These are regular expressions, and as they contain no magic characters
the result is a substring match, and as the first match is used, you 
get the observed behaviour.  The correct solution is to anchor the 
expressions (^ and $ meta characters - see normal *nix documentation),
but rearranging them should also work.




Project hosted by iFAX Solutions