/*
 *
 *	Copyright (C) 1988, 1989 by the Massachusetts Institute of Technology
 *    	Developed by the MIT Student Information Processing Board (SIPB).
 *    	For copying information, see the file mit-copyright.h in this release.
 *
 */
/*
 *
 *	$Source: /afs/sipb.mit.edu/project/discuss/.cvsroot/discuss/source/libds/auth_weak.c,v $
 *	$Header: /afs/sipb.mit.edu/project/discuss/.cvsroot/discuss/source/libds/auth_weak.c,v 1.1 1994/09/24 04:07:31 srz Exp $
 *
 * auth_dum () -- Authentication procedure for non-kerberos sites.
 *		  Just returns an empty string.
 *
 *	$Log: auth_weak.c,v $
 * Revision 1.1  1994/09/24  04:07:31  srz
 * Changed source tree to use configure instead of Imake.  Added WEAK_REALM
 * authentication.  Fixed up includes, etc, for new configure...  still needs
 * more testing.
 *
 * Revision 1.4  1992/06/26  02:18:06  raeburn
 * getting in sync with current source tree
 *
 * Revision 1.3  89/06/03  00:19:30  srz
 * Added standard copyright notice.
 * 
 * Revision 1.2  87/04/11  00:05:35  srz
 * Added RCS junk
 * 
 */
#ifndef lint
static char *rcsid__c = "$Header: /afs/sipb.mit.edu/project/discuss/.cvsroot/discuss/source/libds/auth_weak.c,v 1.1 1994/09/24 04:07:31 srz Exp $";
#endif lint

#include <pwd.h>
#include "rpc.h"

int auth_type = AUTH_WEAK;

get_authenticator (service_id, checksum, authp, authl, result)
char *service_id;
int checksum;
char **authp;
int *authl;
int *result;
{
    static struct passwd *pwent;
    int uid;

    uid = getuid ();
    pwent = getpwuid(uid);

    if (pwent != 0) {
	 *authp = pwent -> pw_name;
	 *authl = strlen(pwent -> pw_name)+1;
    } else {
	 *authl = 0;
	 *authp = "";
    }
    *result = 0;
    return;
}
