Research Menu

.
Skip Search Box

SELinux Mailing List

[Fwd: libsemanage API]

From: Daniel J Walsh <dwalsh_at_redhat.com>
Date: Fri, 06 Jul 2007 12:52:38 -0400

  • Original Message -------- Subject: libsemanage API Date: Fri, 06 Jul 2007 10:59:23 -0400 From: Joe Rocklin <joe.rocklin@ngc.com> To: dwalsh@redhat.com

Hi Dan,

I'm trying to use the API to libsemanage from C++, and I'm running into some difficulties finding relevant documentation on the subject. If you could point me in the right direction, I'd really appreciate it!

The issue I'm having is with trying to work with the return results from semanage_user_list. The struct defines for semanage_user_t (as well as semanage_user_base_t and semanage_user_extra_t) are in the .c files, not the header files, which causes a compile to fail with the following error:

    setest.cpp:19: error: request for member ‘name’ in     â€˜*(((semanage_user_t**)(((unsigned int)i) * 4u)) + list)’, which is     of non-class type ‘semanage_user_t*’

I've attached the small program used to test this. If I run this in ddd and display the variable list[0].name it correctly displays the contents. I believe the issue is that the compiler isn't aware of the struct definition, which isn't presented until the link phase.

Is there another way of accessing this data? Or is the correct answer to move the struct definitions into the header files?

--Joe

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

Received on Fri 6 Jul 2007 - 12:54:01 EDT
 

Date Posted: Jan 15, 2009 | Last Modified: Jan 15, 2009 | Last Reviewed: Jan 15, 2009

 
bottom

National Security Agency / Central Security Service