=== modified file 'Makefile' --- Makefile 2008-08-08 23:28:55 +0000 +++ Makefile 2008-08-10 17:52:54 +0000 @@ -11,7 +11,12 @@ CFLAGS=$(WARN) $(DEBUG) $(FORTIFY) $(COVERAGE) $(OPTIMIZE) $(LANGUAGE) LDFLAGS=$(COVERAGE) -DOCBOOKTOMAN=xsltproc --nonet --param man.charmap.use.subset "0" --param make.year.ranges "1" --param make.single.year.ranges "1" --param man.output.quietly "1" +DOCBOOKTOMAN=xsltproc --nonet \ + --param man.charmap.use.subset 0 \ + --param make.year.ranges 1 \ + --param make.single.year.ranges 1 \ + --param man.output.quietly 1 \ + --param man.authors.section.enabled 0 PROGS=mandos-client plugins.d/password-request plugins.d/password-prompt DOCS=mandos.8 mandos-client.8mandos plugins.d/password-request.8mandos plugins.d/password-prompt.8mandos mandos.conf.5 mandos-clients.conf.5 === modified file 'TODO' --- TODO 2008-08-10 01:10:04 +0000 +++ TODO 2008-08-10 16:13:23 +0000 @@ -27,7 +27,7 @@ *** SEE ALSO Refer to mandos(8), password-request(8mandos), and password-prompt(8mandos) -** [#B] Fix %d format strings to use [[https://secure.wikimedia.org/wikipedia/en/wiki/Inttypes.h][]] +** Use asprintf instead of malloc and strcat? ** use strsep instead of strtok? ** use config file in addition to arguments ** pass things in environment, like device name, etc @@ -60,9 +60,7 @@ Create this section *** SEE ALSO Refer to mandos-client(8mandos) and password-prompt(8mandos) -** [#B] Fix %d format strings to use [[https://secure.wikimedia.org/wikipedia/en/wiki/Inttypes.h][]] -** start_mandos_communication: loop around gnutls_handshake - [[info:gnutls.info.gz:Core%20functions][gnutls_handshake]] +** Use asprintf instead of malloc and memcpy? ** IPv4 support ** use strsep instead of strtok? ** Do not depend on GPG key rings on disk @@ -152,6 +150,8 @@ ** /etc/initramfs-tools/hooks/mandos [[file:/usr/share/doc/initramfs-tools/examples/example_hook][Example initramfs-tools hook script]] *** Create GPG key ring files in initrd +** unperish +** bzr-builddeb * INSTALL file === modified file 'mandos' --- mandos 2008-08-10 00:04:11 +0000 +++ mandos 2008-08-10 16:13:23 +0000 @@ -71,6 +71,10 @@ ('Mandos: %(levelname)s: %(message)s')) logger.addHandler(syslogger) +console = logging.StreamHandler() +console.setFormatter(logging.Formatter('%(name)s: %(levelname)s:' + ' %(message)s')) +logger.addHandler(console) class AvahiError(Exception): def __init__(self, value): @@ -654,7 +658,7 @@ global main_loop_started main_loop_started = False - parser = OptionParser(version = "Mandos server %s" % version) + parser = OptionParser(version = "%%prog %s" % version) parser.add_option("-i", "--interface", type="string", metavar="IF", help="Bind to interface IF") parser.add_option("-a", "--address", type="string", @@ -717,6 +721,7 @@ if not debug: syslogger.setLevel(logging.WARNING) + console.setLevel(logging.WARNING) if server_settings["servicename"] != "Mandos": syslogger.setFormatter(logging.Formatter\ @@ -751,14 +756,6 @@ avahi.DBUS_INTERFACE_SERVER ) # End of Avahi example code - if debug: - console = logging.StreamHandler() - # console.setLevel(logging.DEBUG) - console.setFormatter(logging.Formatter\ - ('%(levelname)s: %(message)s')) - logger.addHandler(console) - del console - clients = Set() def remove_from_clients(client): clients.remove(client) @@ -776,6 +773,7 @@ sys.exit(1) if not debug: + logger.removeHandler(console) daemon() pidfilename = "/var/run/mandos/mandos.pid" === modified file 'mandos-client.c' --- mandos-client.c 2008-08-10 00:21:08 +0000 +++ mandos-client.c 2008-08-10 03:32:42 +0000 @@ -606,13 +606,16 @@ /* Bad exit by plugin */ if(debug){ if(WIFEXITED(proc->status)){ - fprintf(stderr, "Plugin %d exited with status %d\n", - proc->pid, WEXITSTATUS(proc->status)); + fprintf(stderr, "Plugin %u exited with status %d\n", + (unsigned int) (proc->pid), + WEXITSTATUS(proc->status)); } else if(WIFSIGNALED(proc->status)) { - fprintf(stderr, "Plugin %d killed by signal %d\n", - proc->pid, WTERMSIG(proc->status)); + fprintf(stderr, "Plugin %u killed by signal %d\n", + (unsigned int) (proc->pid), + WTERMSIG(proc->status)); } else if(WCOREDUMP(proc->status)){ - fprintf(stderr, "Plugin %d dumped core\n", proc->pid); + fprintf(stderr, "Plugin %d dumped core\n", + (unsigned int) (proc->pid)); } } /* Remove the plugin */ === modified file 'plugins.d/password-request.c' --- plugins.d/password-request.c 2008-08-10 00:21:08 +0000 +++ plugins.d/password-request.c 2008-08-10 03:32:42 +0000 @@ -50,6 +50,7 @@ sockaddr_in6, PF_INET6, SOCK_STREAM, INET6_ADDRSTRLEN, uid_t, gid_t */ +#include /* PRIu16 */ #include /* socket(), struct sockaddr_in6, struct in6_addr, inet_pton(), connect() */ @@ -228,7 +229,7 @@ } else { fprintf(stderr, "Unsupported algorithm: %s\n", result->unsupported_algorithm); - fprintf(stderr, "Wrong key usage: %d\n", + fprintf(stderr, "Wrong key usage: %u\n", result->wrong_key_usage); if(result->file_name != NULL){ fprintf(stderr, "File name: %s\n", result->file_name); @@ -455,8 +456,8 @@ } if(debug){ - fprintf(stderr, "Setting up a tcp connection to %s, port %d\n", - ip, port); + fprintf(stderr, "Setting up a tcp connection to %s, port %" PRIu16 + "\n", ip, port); } tcp_sd = socket(PF_INET6, SOCK_STREAM, 0); @@ -491,7 +492,8 @@ to.in6.sin6_scope_id = (uint32_t)if_index; if(debug){ - fprintf(stderr, "Connection to: %s, port %d\n", ip, port); + fprintf(stderr, "Connection to: %s, port %" PRIu16 "\n", ip, + port); char addrstr[INET6_ADDRSTRLEN] = ""; if(inet_ntop(to.in6.sin6_family, &(to.in6.sin6_addr), addrstr, sizeof(addrstr)) == NULL){ @@ -676,8 +678,9 @@ char ip[AVAHI_ADDRESS_STR_MAX]; avahi_address_snprint(ip, sizeof(ip), address); if(debug){ - fprintf(stderr, "Mandos server \"%s\" found on %s (%s, %d) on" - " port %d\n", name, host_name, ip, interface, port); + fprintf(stderr, "Mandos server \"%s\" found on %s (%s, %" + PRIu16 ") on port %d\n", name, host_name, ip, + interface, port); } int ret = start_mandos_communication(ip, port, interface, mc); if (ret == 0){