1 /* $NetBSD: postconf_other.c,v 1.1.1.2 2014/07/06 19:27:53 tron Exp $ */ 2 3 /*++ 4 /* NAME 5 /* postconf_other 3 6 /* SUMMARY 7 /* support for miscellaneous information categories 8 /* SYNOPSIS 9 /* #include <postconf.h> 10 /* 11 /* void pcf_show_maps() 12 /* 13 /* void pcf_show_locks() 14 /* 15 /* void pcf_show_sasl(mode) 16 /* int mode; 17 /* DESCRIPTION 18 /* pcf_show_maps() lists the available map (lookup table) 19 /* types. 20 /* 21 /* pcf_show_locks() lists the available mailbox lock types. 22 /* 23 /* pcf_show_sasl() shows the available SASL authentication 24 /* plugin types. 25 /* 26 /* Arguments: 27 /* .IP mode 28 /* Show server information if the PCF_SHOW_SASL_SERV flag is 29 /* set, otherwise show client information. 30 /* DIAGNOSTICS 31 /* Problems are reported to the standard error stream. 32 /* LICENSE 33 /* .ad 34 /* .fi 35 /* The Secure Mailer license must be distributed with this software. 36 /* AUTHOR(S) 37 /* Wietse Venema 38 /* IBM T.J. Watson Research 39 /* P.O. Box 704 40 /* Yorktown Heights, NY 10598, USA 41 /*--*/ 42 43 /* System library. */ 44 45 #include <sys_defs.h> 46 47 /* Utility library. */ 48 49 #include <vstream.h> 50 #include <argv.h> 51 #include <dict.h> 52 53 /* Global library. */ 54 55 #include <mbox_conf.h> 56 57 /* XSASL library. */ 58 59 #include <xsasl.h> 60 61 /* Application-specific. */ 62 63 #include <postconf.h> 64 65 /* pcf_show_maps - show available maps */ 66 67 void pcf_show_maps(void) 68 { 69 ARGV *maps_argv; 70 int i; 71 72 maps_argv = dict_mapnames(); 73 for (i = 0; i < maps_argv->argc; i++) 74 vstream_printf("%s\n", maps_argv->argv[i]); 75 argv_free(maps_argv); 76 } 77 78 /* pcf_show_locks - show available mailbox locking methods */ 79 80 void pcf_show_locks(void) 81 { 82 ARGV *locks_argv; 83 int i; 84 85 locks_argv = mbox_lock_names(); 86 for (i = 0; i < locks_argv->argc; i++) 87 vstream_printf("%s\n", locks_argv->argv[i]); 88 argv_free(locks_argv); 89 } 90 91 /* pcf_show_sasl - show SASL plug-in types */ 92 93 void pcf_show_sasl(int what) 94 { 95 ARGV *sasl_argv; 96 int i; 97 98 sasl_argv = (what & PCF_SHOW_SASL_SERV) ? xsasl_server_types() : 99 xsasl_client_types(); 100 for (i = 0; i < sasl_argv->argc; i++) 101 vstream_printf("%s\n", sasl_argv->argv[i]); 102 argv_free(sasl_argv); 103 } 104