dg_running_with(3C) DG/UX 5.4R3.00 dg_running_with(3C)
NAME
dg_running_with_aa, dg_running_with_acl, dg_running_with_audit,
dg_running_with_cap, dg_running_with_mac, - determine if the system
is configured for the given feature
SYNOPSIS
#include <dg_running_with.h>
int dg_running_with_aa()
int dg_running_with_acl()
int dg_running_with_audit()
int dg_running_with_cap()
int dg_running_with_mac()
DESCRIPTION
Use the dg_running_with function to find out if the given feature is
configured into the currently running system. These functions are
contained in the libdgc.a library.
The dg_running_with_aa function returns 1 if the system is configured
for Trusted DG/UX Authentication and Authorization. This is
determined to be the case if sysconf(_SC_SEC_LEVEL) returns a value
of _DG_C2, _DG_B1 or _DG_B2.
The dg_running_with_acl function returns 1 if the system is
configured for Trusted DG/UX Access Control Lists. This is
determined to be the case if sysconf(_SC_ACL) returns a value of
_POSIX_ACL.
The dg_running_with_audit function returns 1 if the system is
configured for Trusted DG/UX Auditing. This is determined to be the
case if sysconf(_SC_AUD) returns a value of _DG_AUD.
The dg_running_with_cap function returns 1 if the system is
configured for Trusted DG/UX Least Privilege. This is determined to
be the case if sysconf(_SC_CAP) returns a value of _POSIX_CAP.
The dg_running_with_mac function returns 1 if the system is
configured for Trusted DG/UX Mandatory Access Control. This is
determined to be the case if sysconf(_SC_MAC) returns a value of
_POSIX_MAC.
These routines should be used rather than using direct calls to
sysconf(2) because Data General reserves the right to change the
underlying test that these routines use to detect the presence of the
various features.
These routines allow applications to be written that can change their
behavior based on the configuration of the system. If written
correctly, the same binary image of the application can then run on
Licensed material--property of copyright holder(s) 1
dg_running_with(3C) DG/UX 5.4R3.00 dg_running_with(3C)
both DG/UX and Trusted DG/UX.
EXAMPLE
Below is an excerpt from the ttymon source code showing a change in
behavior based on the presence of the A&A feature:
/*
* If host system running A&A, use -s to identify as
* "login" service.
*/
if (dg_running_with_aa()) {
pmtab->p_server = "/usr/bin/login -s login";
}
else {
pmtab->p_server = "/usr/bin/login";
}
SEE ALSO
sysconf(2).
Licensed material--property of copyright holder(s) 2