Path: news.mitre.org!blanket.mitre.org!agate!newsgate.duke.edu!nntprelay.mathworks.com!news.mathworks.com!mvb.saic.com!macro32
From: "Brian Schenkenberger, VAXman-" <system@TMESIS.COM>
Newsgroups: vmsnet.internals
Subject: Re: VMS Security
Message-ID: <009C1005.49004B78.7@TMESIS.COM>
Date: Thu, 29 Jan 1998 06:12:05 -0400
Organization: Macro32<==>Vmsnet.Internals Gateway
X-Gateway-Source-Info: Mailing List
Lines: 76

Comrade "Ruslan R. Laishev" <RLaishev@DeltaTel.RU> sez:
>Hoff Hoffman wrote:
>> :       I known about $set_security/$get_security, but probably this is
>> :possible from DCL ?
>> 
>>   To add an ACE to an ACL under program control, one typically:
>> 
>>     o invokes sys$parse_acl to create the binary-format ACE from
>>       a text-format ACE.
>	Sorry for other "dumb" question: where I can find example program written using
>$parse_acl/$set_surity/$get_security calls ?
>
>	I try to write small program with use of these calls, it's exit with ACCVIO error
>code.
>#include        "mvp_srv.h"
>#include        <acedef.h>
>#include        <acldef.h>
>
>void    main    (void)
>{
>int     status,errpos=0;
>char    aclstr_bf [] = "IDENTIFIER=[SYSMAN],ACCESS=READ+WRITE";
>char    aclent_bf [256];
>struct  dsc$descriptor  aclstr_dsc,aclent_dsc;
>
>        INIT_SDESC(aclstr_dsc,sizeof(aclstr_bf),aclstr_bf);
>        INIT_SDESC(aclent_dsc,sizeof(aclent_bf),aclent_bf);
>
>        status = sys$parse_acl (&aclstr_dsc,&aclent_dsc,&errpos);
>        if (!$VMS_STATUS_SUCCESS(status))
>                {
>                printf("\nerrpos=%d\n",errpos);
>                lib$signal(status);
>                }
>}

Programming error(s)!

Try this!  Please excuse my use of such a vulgar language in this group!

#include        <stdio.h>	/* you missed this */
#include        <descrip.h>	/* you missed this */
#include        <acedef.h>
#include        <acldef.h>

void    main    (void)
{
int     status,errpos=0;
                            /*  v--Important               Important--v */
static  char    aclstr_bf [] = "(IDENTIFIER=[SYSTEM],ACCESS=READ+WRITE)";
static  char    aclent_bf [256];
/*
struct  dsc$descriptor  aclstr_dsc,aclent_dsc;
*/
        $DESCRIPTOR(aclstr_dsc,aclstr_bf);
        $DESCRIPTOR(aclent_dsc,aclent_bf);

        status = sys$parse_acl (&aclstr_dsc,&aclent_dsc,&errpos);

        if (!(status&1))
                {
                 printf("\nerrpos=%d\n",errpos);
                 lib$signal(status);
                }
}

BTW, I changed your SYSMAN to SYSTEM as I didn't have a SYSMAN identifer on
my box. 

--
VAXman- OpenVMS APE certification number: AAA-0001          VAXman@TMESIS.COM

        All your spirit rack abuses, come to haunt you back by day.  
          All your byzantine excuses, given time, give you away. 
Don't be surprised when daylight comes, to find that memory prick your thumbs.
  You'll tell them where we run to hide.  I'm already dead.  Matter of time.
