#! /bin/sh

if [ "$1" = "--version" ]
then
cat << EOF
ccs-queryd 1.8.0

Copyright (C) 2005-2010 NTT DATA CORPORATION.

This program is free software; you may redistribute it under the terms of
the GNU General Public License. This program has absolutely no warranty.
EOF
elif [ "$1" = "--help" ]
then
cat << EOF
Usage: ccs-queryd [remote_ip:remote_port]

This program detects policy violation in enforcing mode and displays the access request. You can tell the system whether the access request should be granted or rejected after you validate the access request.

By running this program while updating packages, you can avoid errors due to insufficient permissions.

Never grant access requests unconditionally. The cause of policy violation is not always updating packages, but may by malicious requests by attackers. If you grant access requests caused by malicious requests by attackers, the system gets intruded.

 remote_ip:remote_port     Receive policy from agent listening at specified IP address and port number. 

Examples:

# ccs-queryd
 Handle local query.

# ccs-queryd 192.168.1.1:10000
 Handle remote query via agent listening at 192.168.1.1:10000 .

Usage is available at http://tomoyo.sourceforge.jp/1.8/enforcing.html

EOF
else
cat << EOF | help2man -i - -N -s 8 -n "Handle TOMOYO Linux's delayed enforcing mode" $0 | gzip -9 > man8/ccs-queryd.8.gz
[NOTES]

 You need to register either path to this program ( /usr/sbin/ccs-queryd ) or a domain for this program in /proc/ccs/manager before invoking this program.

[SEE ALSO]

 ccs-editpolicy-agent (8)
 ccs-notifyd (8)

[AUTHORS]

 penguin-kernel _at_ I-love.SAKURA.ne.jp

EOF
fi
exit 0
