From:	SMTP%"bailey@HMIVAX.HUMGEN.UPENN.EDU" 30-AUG-1993 09:12:31.48
To:	EVERHART
CC:	
Subj:	Re: NNTP_DEC broken in 6.1b8

Message-Id: <9308280129.AA22933@uu7.psi.com>
Date:         Fri, 27 Aug 1993 06:57:41 GMT
Reply-To: Charles Bailey <bailey@HMIVAX.HUMGEN.UPENN.EDU>
Sender: ANU-NEWS Discussion <ANU-NEWS@VM1.NoDak.EDU>
Comments:     Warning -- original Sender: tag was news@NETNEWS.UPENN.EDU
From: Charles Bailey <bailey@HMIVAX.HUMGEN.UPENN.EDU>
Organization: HHMI/Human Genetics, Univ of Pa.
Subject:      Re: NNTP_DEC broken in 6.1b8
To: Multiple recipients of list ANU-NEWS <ANU-NEWS@VM1.NoDak.EDU>

In article <1993Aug26.150745.6335@filly>, jack@nic.csu.net (Jack L. Hunker) writ
es:
> With the change from the getenv funtion to the news_getenv function, in 6.1b8,
> NNTP_DEC no longer returns remote ID and remote node.
> Does anyone have a fix for this?  I have gone back to the beta 5 version in
> the mean time.

This is a 'feature' of the secure logical name lookup I hadn't anticipated.
The DECnet logical names Sys$Node and Sys$Rem_ID are in the process and job
tables, but secure (executive mode) translation is set up to look only in the
system table by default.  The patch appended to this post should fix your
problem, and allow sites more flexibility in setting up secure logical names.
Basically, it modifies news_getenv() so it will take a list of name tables,
rather than a single table name (if only sys$trnlnm() would do this without
requiring you to define a search list), and modifies the default setting in
NewsSite.H so news_getenv() looks up secure logical names in the system, group,
process, or job table, in that order.  The requirement for executive or kernel
mode is still enforced, but the order of tables predominates (e.g. an executive
mode logical in the system table will be used in preference to a kernel mode
logical in the process table).

Please let me know if this doesn't solve your problem.  Good luck.

                    Regards,
                    Charles Bailey

!-------------------------------------------------------------------------------
!             Dept. of Genetics / Howard Hughes Medical Institute
! University of Pennsylvania School of Medicine  Rm. 430 Clinical Research Bldg.
!     422 Curie Blvd.  Philadelphia, PA 19104 USA      Tel. (215) 898-1699
!          Internet: bailey@genetics.upenn.edu  (IN 128.91.200.37)
!-------------------------------------------------------------------------------

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 =+=+=
