GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  PRIV_CUSTOM (3)

NAME

priv_register_{info,cap}_fn, priv_invoke_{info,cap}_fn - register and invoke custom privileged methods.

CONTENTS

Synopsis
Description
Errors
Bugs
Author

SYNOPSIS

#include <privman.h>

int priv_register_info_fn(char *(*fnptr)(char * const *));
int priv_register_cap_fn(int (*fnptr)(char * const *));
char *priv_invoke_info_fn(int handle, char * const args[]);
int priv_invoke_cap_fn(int handle, char * const args[]);

DESCRIPTION

These methods allow you to register functions to be executed inside the Privman server. The info functions return a string, the capability functions return a file descriptor.

The register functions only work before priv_init(3) is invoked. They return an integer handle to identify the registered function. The handle is then passed into the invoke functions after priv_init(3) s invoked to cause the registered function to be invoked inside the context of the Privman server.

RETURN VALUE

On success, a handle is returned. On error, -1 is returned and errno is set appropriately.

ERRORS

If one of the register functions is called after priv_init(3) is invoked, errno will be EPERM.

If an invalid handle is passed to either of the invoke functions, either -1 or NULL will be returned, and errno will be set to ENOENT.

If the registered function returns -1 or NULL, errno will be set to the value of errno after the registered function was executed.

BUGS

There is currently no configuration option to allow setting custom methods. While the fork(2) that happens in priv_init(3) will protect the Privman servers function map from modification, any poorly written methods can trash the servers state. Write your custom methods carefully.

AUTHOR

Network Associates. Send email to <privman@nailabs.com>

SEE ALSO

priv_daemon(3) priv_execve(3) priv_fopen(3) priv_fork(3) priv_wait4(3) priv_init(3) privman_conf(5) priv_open(3) priv_pam(3) priv_rerunas(3) priv_rerespawn_as(3) privman(7)
Search for    or go to Top of page |  Section 3 |  Main Index


Unix PRIV_CUSTOM (3) OCTOBER 2002

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.