DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T t

⟦2da27d58d⟧ TextFile

    Length: 818 (0x332)
    Types: TextFile
    Names: »try.c«

Derivation

└─⟦4f9d7c866⟧ Bits:30007245 EUUGD6: Sikkerheds distributionen
    └─⟦62b59102f⟧ »./log_tcp/3.1.tar.Z« 
        └─⟦1de3ed35f⟧ 
            └─⟦this⟧ »log_tcp/try.c« 

TextFile

 /*
  * try - program to try out host access-control tables, including the
  * optional shell commands.
  * 
  * usage: try process_name host_name
  * 
  * where process_name is a daemon process name (argv[0] value), and host_name
  * is a host name or address.
  * 
  * Prints YES if access is granted, NO if denied.
  */

#include <stdio.h>
#include <syslog.h>

main(argc, argv)
int     argc;
char  **argv;
{
#ifdef HOSTS_ACCESS

#ifdef LOG_MAIL
    openlog(argv[0], LOG_PID, FACILITY);
#else
    openlog(argv[0], LOG_PID);
#endif

    if (argc != 3) {
	fprintf(stderr, "usage: %s process_name host_name\n", argv[0]);
	return (1);
    } else {
	printf(hosts_access(argv[1], argv[2]) ? "YES\n" : "NO\n");
	return (0);
    }
#else
    fprintf(stderr, "host access control is not enabled.\n");
    return (1);
#endif
}