-int islocalok(char recp[]) {
-
- struct usersupp ust;
- long lookfor;
- char a_recp[128];
- int found_closest_match = 0;
- int a,us;
- strcpy(a_recp,recp);
- for (a=0; a<strlen(a_recp); ++a)
- if (a_recp[a]=='_') a_recp[a]=32;
- lookfor = (-1L); if (!struncmp(recp,"cit",3)) lookfor=atol(&recp[3]);
- us=open("/appl/citadel/usersupp",O_RDONLY);
- if (us>=0) {
- while(read(us,&ust,sizeof(struct usersupp))>0) {
- if (lookfor == ust.usernum) {
- strcpy(recp,ust.fullname);
- close(us);
- return(2);
- }
- if (!strucmp(ust.fullname,a_recp)) {
- strcpy(recp,ust.fullname);
- close(us);
- return(3);
- }
- if (!struncmp(ust.fullname,a_recp,strlen(a_recp))) {
- strcpy(recp,ust.fullname);
- found_closest_match = 1;
- }
- }
- close(us);
- }
- if (getpwnam(recp)!=NULL) return(1);
- if (found_closest_match) return(3);
- return(0);
- }
-