Hi all,

I tried the following program for my learning purpose on i386 machine.
The getexecuser() works fine but match_execattr() failed.
Could any one help me to sort out this problem. I think there are some problem 
in passing the arguments of match_execattr().
my output is:
Profile Name = Printer Management
Profile Type = cmd
Policy = suser
match_execattr() fail
match_execattr:: Error 0

//my program
#include<exec_attr.h>
#include<secdb.h>

void display_exec(execattr_t * );

int
main()
{
        char           *username = "lp";
        execattr_t     *execprof = NULL;

        if ((execprof = getexecuser(username, KV_COMMAND, "/usr/bin/cancel",
                                    GET_ALL)) == NULL) {
                perror("getexecuser:");
                exit(1);

        }

        display_exec(execprof);

        execattr_t *match;
        match = match_execattr(execprof, execprof->name , KV_COMMAND, 
"/usr/bin/cancel");
        if(match == NULL) {
                printf("match_execattr() fail\n");
                perror("match_exec:");
        else
                printf("match_execattr() success\n");


        free_execattr(execprof);
}

void
display_exec(execattr_t * exec)
{

        printf("Profile Name = %s\n", exec->name);
        printf("Profile Type = %s\n", exec->type);
        printf("Policy = %s\n", exec->policy);
}
 
 
This message posted from opensolaris.org

Reply via email to