ANU News Patch Patch ID: 930827_newsrtl.c!bailey@genetics.upenn.edu Date: 27-Aug-1993 Author: Charles Bailey bailey@genetics.upenn.edu News Version: 6.1beta8 News Files: NewsRTL.C, NewsSite.H Description: Changes news_getenv() so it will take a comma-separated list of logical name tables in which to look for secure logical names. Changes default list in NewsSite.H of tables for secure logical name lookups, so that DECnet logical names will be found. NOTE: After applying this patch, you need to relink News.Exe and the NNTP images; NewsBuild.Com may not do this automatically for you, so to be safe you should execute NewsBuild.Com with p2=LINK after recompiling the modified sources. *** newsrtl.c --- newsrtl_new.c ************** *** 43,45 **-- **/ --- 43,47 ----- + ** V6.1b8 27-Aug-1993 bailey@genetics.upenn.edu + ** - fixed news_getenv() to try multiple tables for secure logical names **-- **/ ************** *** 857,863 unsigned long int systflag; { static char eqvstr[LNM$C_NAMLENGTH+1]; ! char systbl[] = LOG_TABLE, alltbl[] = "LNM$FILE_DEV"; unsigned char trnmode = MODE; unsigned long int attr = LNM$M_CASE_BLIND; unsigned short int retlen; --- 859,865 ----- unsigned long int systflag; { static char eqvstr[LNM$C_NAMLENGTH+1]; ! char systbl[] = LOG_TABLE, alltbl[] = "LNM$FILE_DEV", *cp1, *cp2; unsigned char trnmode = MODE; unsigned long int attr = LNM$M_CASE_BLIND; unsigned short int retlen; ************** *** 876,883 if (systflag) { ! tabdsc.dsc$w_length = sizeof systbl - 1; ! tabdsc.dsc$a_pointer = systbl; if (sys$trnlnm(&attr,&tabdsc,&lnmdsc,&trnmode,&trnlst) & 1) { eqvstr[retlen] = '\0'; --- 878,888 ----- if (systflag) { ! cp1 = systbl; ! do { ! cp2 = strchr(cp1,','); ! tabdsc.dsc$w_length = cp2 ? cp2 - cp1 : sizeof systbl - 1 + systbl - cp1; ! tabdsc.dsc$a_pointer = cp1; if (sys$trnlnm(&attr,&tabdsc,&lnmdsc,&trnmode,&trnlst) & 1) { eqvstr[retlen] = '\0'; ************** *** 879,888 tabdsc.dsc$w_length = sizeof systbl - 1; tabdsc.dsc$a_pointer = systbl; ! if (sys$trnlnm(&attr,&tabdsc,&lnmdsc,&trnmode,&trnlst) & 1) { ! eqvstr[retlen] = '\0'; ! return eqvstr; ! } #ifdef SECURE_LOGICALS return 0; #endif --- 884,896 ----- tabdsc.dsc$w_length = cp2 ? cp2 - cp1 : sizeof systbl - 1 + systbl - cp1; tabdsc.dsc$a_pointer = cp1; ! if (sys$trnlnm(&attr,&tabdsc,&lnmdsc,&trnmode,&trnlst) & 1) { ! eqvstr[retlen] = '\0'; ! return eqvstr; ! } ! ! cp1 = cp2 + 1; ! } while (cp2); #ifdef SECURE_LOGICALS return 0; #endif *** newssite.h --- newssite_new.h ************** *** 318,324 * to any logical name which the documentation states must be defined * /System/Executive_Mode. The translation process for these logical names * is as follows: ! * 1. Attempt to translate the logical name using the name table specified * by LOG_TABLE, and the access mode specified by MODE as the outermost * access mode allowed. * If this fails and SECURE_LOGICALS id #defined, translation fails. --- 318,324 ----- * to any logical name which the documentation states must be defined * /System/Executive_Mode. The translation process for these logical names * is as follows: ! * 1. Attempt to translate the logical name using the name tables specified * by LOG_TABLE, and the access mode specified by MODE as the outermost * access mode allowed. LOG_TABLE may be defined as a single table name * or as a comma-separated list of table names. ************** *** 320,327 * is as follows: * 1. Attempt to translate the logical name using the name table specified * by LOG_TABLE, and the access mode specified by MODE as the outermost ! * access mode allowed. ! * If this fails and SECURE_LOGICALS id #defined, translation fails. * 3. Attempt to translate the logical name using the usual progression of * name tables (LNM$FILE_DEV) and access modes. * --- 320,328 ----- * is as follows: * 1. Attempt to translate the logical name using the name tables specified * by LOG_TABLE, and the access mode specified by MODE as the outermost ! * access mode allowed. LOG_TABLE may be defined as a single table name ! * or as a comma-separated list of table names. ! * If this fails and SECURE_LOGICALS is #defined, translation fails. * 3. Attempt to translate the logical name using the usual progression of * name tables (LNM$FILE_DEV) and access modes. * ************** *** 334,340 #endif /* */ ! #define LOG_TABLE "LNM$SYSTEM" #define MODE PSL$C_EXEC /* The following are used for testing only ..... #define LOG_TABLE "LNM$PROCESS" --- 335,341 ----- #endif /* */ ! #define LOG_TABLE "LNM$SYSTEM,LNM$GROUP,LNM$PROCESS,LNM$JOB" #define MODE PSL$C_EXEC /* The following are used for testing only ..... #define LOG_TABLE "LNM$PROCESS" *** patchlist.h;-1 --- patchlist.h ************** *** 1,1 =+=+= End =+=+= --- 1,2 ----- + 930827_newsrtl.c!bailey@genetics.upenn.edu =+=+= End =+=+=