Category : Alternate Operating Systems - Quarterdeck DesqView, CP/M, etc
Archive   : VMS_ACL.ZIP
Filename : WHOHAS.C

 
Output of file : WHOHAS.C contained in archive : VMS_ACL.ZIP
/*************************************************************************
** Module Name : whohas.c
**
** Purpose : To display all users of a given identifier
**
** Parameters : The Identifier in question
**
** Return value: None
**
** Side affects: None
**
** *** Revision History ***
**
** Date Description
** -------- ---------------------------------------------------
** 05/24/90 Steve Coleman R.S. Carson & Assoc Initial Revision
**
*************************************************************************/
#include
#include
#include "libi:dsc.h"

#define MAXUSR 50

struct ID_TYPE {
int id;
int unused;
};

main(argc,argv)
int argc;
char ** argv;
{
int retcode;
dsc$s user_name;
dsc$s id_name;
struct ID_TYPE uaf_ident = {0,0};
struct ID_TYPE user_ident = {0,0};
int attrib;
int contxt = 0;
char namebuf[32];
int namlen;
int done;
int usrcnt;
int user[MAXUSR];
int idx;

if(argc != 2) {
printf("Usage is: $ whohas identifier \n\n");
exit(0);
}

SET_DSC$(id_name, strlen(argv[1]),argv[1]);
SET_DSC$(user_name,sizeof(namebuf),namebuf);

retcode = sys$asctoid(&id_name,&uaf_ident.id,NULL);

if (retcode != SS$_NORMAL) {
printf("Error %d, invalid identifier :%s\n\n",retcode,argv[1]);
exit(0);
}

printf("\n\nUsers found for: %16s %10u\n",argv[1],uaf_ident.id);
printf("----------------------------------------------\n");

usrcnt = attrib = done = contxt = 0;
while (!done) {

retcode = sys$find_holder(uaf_ident.id, &user_ident, NULL, &contxt);

if ( (retcode != SS$_NORMAL) && (usrcnt < MAXUSR) ) {
sys$finish_rdb( &contxt );
done = 1;
}
else {
user[usrcnt++] = user_ident.id;
}
}

for ( idx = 0 ; idx < usrcnt ; idx++ ) {

retcode = sys$idtoasc(user[idx],&namlen,&user_name,NULL,&attrib,NULL);

if (retcode != SS$_NORMAL) {
printf("User name name not found for: %d \n\n",user_ident.id);
exit(0);
}

namebuf[32] = '\0';
printf("%32s %10u %X \n",namebuf,user[idx],attrib);

}
printf("\n -- done --\n\n");
}


  3 Responses to “Category : Alternate Operating Systems - Quarterdeck DesqView, CP/M, etc
Archive   : VMS_ACL.ZIP
Filename : WHOHAS.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/