Metropoli BBS
VIEWER: renuser.c MODE: TEXT (ASCII)
/*
	RENUSER 1.0 - rename a Novell UserId
    Copyright (C) 1991  R.J.Letts

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 1, or any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
	
	R.J.Letts@salford.ac.uk
	Network Manager
	University of Salford
	The Crescent
	Salford
	M5 4WT
	
	*/
	
#define cdecl
#include <nit.h>
#include <stdio.h>

main(argc,argv)
int argc;
char *argv[];
{
int err;
printf("[RENUSER 1.0 (c) 1991 R.J.Letts]\nDistributed under the GNU General Public License - see LICENCE.TXT");
if (argc!=3) {
	fprintf(stderr,"\nUsage :\n\tRENUSER <old_username> <new_username>\n",argv[0]);
	exit(1);
	};
	
#ifdef DEBUG
	printf("DEBUG:Renaming %s to %s",argv[1],argv[2]);
#endif	

err=RenameBinderyObject(argv[1],argv[2],OT_USER);

#ifdef DEBUG
	printf("DEBUG:Renbo returned %02X\n",err);
#endif

switch (err) {
	case 0 : printf("%s to %s done",argv[1],argv[2]);
		exit(0);
	case 239 : printf("Pick a better name than %s\n",argv[2]);
		exit(1);
	case 243 : printf("You must run this program as supervisor or equivalent\n");
		exit(1);
	case 252 : printf("User %s does not exists\n",argv[1]);
		exit(1);
	case 254 : printf("Someone is backing up the bindery!!\n");
		exit(1);
	case 255 : printf("Your bindery is screwed\n");
		exit(1);
	default : printf("Some sort of error occurred : %02X\n",err);
		exit(1);
		};

printf("This program failed - network probably crashed \n");
exit(2);
};

		
[ RETURN TO DIRECTORY ]