[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference yuppie::software_licensing

Title:Software Licensing Issues
Moderator:YUPPIE::JENNINGS
Created:Thu Aug 13 1987
Last Modified:Wed Apr 09 1997
Last Successful Update:Thu Apr 17 1997
Number of topics:441
Total number of notes:1794

437.0. "SYS$LOOKUP_LICENSE finds PAK that $LICENSE LIST doesn't..." by GALVIA::DUKE (Ronan) Tue Feb 18 1997 09:28

Hi,
  A customer of ours is having a problem which seems to be related to the
licenses that are/aren't on their system.   The product checks for the CDA-RT
license and if it doesn't find it it then looks for DW-MOTIF.
  I did a $ LICENSE LIST on my own system and found CDA-RT but no DW-MOTIF.  As
expected, my product worked.   I then deleted the CDA-RT license from the
system and my product continued to work !   I then took the license check code
out of the product source code and created a little test program to check 
whether it would find any of the following licenses on the system:
  CDA-RT
  DW-MOTIF
  Foo
 When I run this on my own system (VAX/VMS V6.1), it finds both CDA-RT and
DW-MOTIF even though neither show up when I do a $LICENSE LIST.
 Thinking that maybe there was some caching going on, I rebooted a test system
(VAX/VMS V7.1) and ran my test program.  Again, it finds the CDA-RT and
DW-MOTIF PAKs even though neither show up on a $ LICENSE LIST.
  Thankfully, in both cases, the PAK for the product Foo is not found.
 Anyone out there can point out the error of my ways (gently :-)  ?
 thanks in advance,
-ronan

----------check_license.c----------------------

/*
**  Include Files
*/
#include <lmfdef.h>
#include <stdio.h>
#include <descrip.h>
#include <stdlib.h>
/*
**  Type Definitions
*/
struct lmf_item {
    short int	 length;
    short int    code;
    void	*address;
    long	*ret_length;
};


/*
**  Static Data Definitions
*/

static char CdaRT_prod_name_str[] = "CDA-RT";
static char DWMotif_prod_name_str[] = "DW-MOTIF";
static char CdaRT_producer_str[] = "DEC";
static char Foo_prod_name_str[] = "Foo";
static short int CdaRT_prod_ver[2] = {1,0};
static short int DWMotif_prod_ver[2] = {0,0};
static char CdaRT_prod_datename_str[] = "28-JAN-1992 0:0:0.0";
static char DWMotif_prod_datename_str[] = "28-JAN-1992 0:0:0.0";


extern unsigned long sys$bintim
    (const struct dsc$descriptor_s *, const void *);

extern unsigned long sys$lookup_license
    (const struct dsc$descriptor_s *, const struct lmf_item *,
     const struct dsc$descriptor_s *, const long *, void *, unsigned long);

extern unsigned long sys$release_license (void *);



main (argc, argv)
int argc;
char *argv[];
    {

    unsigned int    status;
    unsigned long   license_context[4];
    int		    per_user_license;
    long int	    prod_date[2];
    struct lmf_item itm_lst[3];
    long	    flags = LMF$M_RETURN_FAILURES; /* | LMF$M_BROADCAST_FAILURES
*/


#pragma nostandard

    $DESCRIPTOR (CdaRT_prod_name, CdaRT_prod_name_str);
    $DESCRIPTOR (DWMotif_prod_name, DWMotif_prod_name_str);
    $DESCRIPTOR (Foo_prod_name, Foo_prod_name_str);
    $DESCRIPTOR (CdaRT_prod_datename, CdaRT_prod_datename_str);
    $DESCRIPTOR (DWMotif_prod_datename, DWMotif_prod_datename_str);
    $DESCRIPTOR (CdaRT_producer, CdaRT_producer_str);
#pragma standard


    /* Transform the time into binary and set up the item list */
    status = sys$bintim(&CdaRT_prod_datename, prod_date);
    if (!(status & 1))
       exit (-1);

    itm_lst[0].code = LMF$_PROD_DATE;
    itm_lst[0].length = 8;
    itm_lst[0].address = (char *)prod_date;

    itm_lst[1].code = LMF$_PROD_VERSION;
    itm_lst[1].length = 4;
    itm_lst[1].address = (char *)CdaRT_prod_ver;

    itm_lst[2].code = 0;
    itm_lst[2].length = 0;
    itm_lst[2].address = NULL;

    status = sys$lookup_license(&CdaRT_prod_name, itm_lst, &CdaRT_producer,
				&flags, license_context, 0);
    if (status & 1)
       printf ("\nCDA-RT licence found");		 
    else
       printf ("\nCDA-RT licence not found");		 

    status = sys$bintim(&DWMotif_prod_datename, prod_date);
    if (!(status & 1))
       exit (-1);

    itm_lst[0].code = LMF$_PROD_DATE;
    itm_lst[0].length = 8;
    itm_lst[0].address = (char *)prod_date;

    itm_lst[1].code = LMF$_PROD_VERSION;
    itm_lst[1].length = 4;
    itm_lst[1].address = (char *)DWMotif_prod_ver;

    status = sys$lookup_license(&DWMotif_prod_name, itm_lst, &CdaRT_producer,
				&flags, license_context, 0);
    if (status & 1)
       printf ("\nDW-MOTIF licence found");		 
    else
       printf ("\nDW-MOTIF licence not found");		 

    status = sys$lookup_license(&Foo_prod_name, itm_lst, &CdaRT_producer,
				&flags, license_context, 0);
    if (status & 1)
       printf ("\nFoo licence found");		 
    else
       printf ("\nFoo licence not found");		 

}


T.RTitleUserPersonal
Name
DateLines
437.1reply from VMSNOTESSTAR::ABISEasy as 3.14159265Tue Feb 18 1997 14:1224
              <<< VAXAXP::NOTES$:[NOTES$LIBRARY]VMSNOTES.NOTE;1 >>>
               -< VAX and Alpha VMS - Digital Internal Use Only >-
================================================================================
Note 207.2  SYS$LOOKUP_LICENSE finds PAK that $LICENSE LIST doesn't...    2 of 2
STAR::ABIS "Easy as 3.14159265"                      17 lines  18-FEB-1997 11:10
                         -< don't forget SHOW LICENSE >-
--------------------------------------------------------------------------------
The concept that is making things appear mysterious is the fact the LICENSE
LIST tells you what is in the license database file pointed to by the
LMF$LICENSE logical.  SYS$LOOKUP_LICENSE doesn't look there.

SYS$LOOKUP_LICENSE checks license data stored in memory by the LMF.  The LMF
reads the license database file (pointed to by the LMF$LICENSE logical) while
executing a LICENSE START (at system boot time) or LICENSE LOAD command and
stores the data in memory for SYS$LOOKUP_LICENSE.  To see what licenses are in
memory, use the SHOW LICENSE family of commands.

It sounds like to me that your LICENSE LIST command isn't reading the same
license database file your test systems are reading when they boot.  I think
now that you understand the license database file (LICENSE LIST) and in memory
database (SHOW LICENSE) concepts, finding the problem at the customer site
should be a piece o' cake.

Eric
437.2QUARK::LIONELFree advice is worth every centFri Mar 07 1997 19:164
More to the point, unless you've rebooted your system in the meantime, you would
have had to do a LICENSE UNLOAD CDA-RT to prevent the PAK from being found.

				Steve
437.3solved elsewhereSTAR::ABISI come in peaceMon Mar 10 1997 14:135
Just to properly terminate this local thread, we solved this problem in
VMSNOTES.  The problem was that the product was being enabled by a NAS group
license.

Eric