=== modified file 'Makefile' --- Makefile 2009-01-10 21:45:37 +0000 +++ Makefile 2009-01-10 21:49:25 +0000 @@ -9,13 +9,14 @@ #DEBUG=-ggdb3 # For info about _FORTIFY_SOURCE, see # -FORTIFY=-D_FORTIFY_SOURCE=2 -fstack-protector-all -fPIE -pie -LINK_FORTIFY=-z relro -pie +FORTIFY=-D_FORTIFY_SOURCE=2 -fstack-protector-all -fPIC -fPIE +LINK_FORTIFY_LD=-z relro -fPIE +LINK_FORTIFY=-pie #COVERAGE=--coverage OPTIMIZE=-Os LANGUAGE=-std=gnu99 htmldir=man -version=1.0.2 +version=1.0.3 SED=sed ## Use these settings for a traditional /usr/local install @@ -45,7 +46,7 @@ CFLAGS=$(WARN) $(DEBUG) $(FORTIFY) $(COVERAGE) $(OPTIMIZE) \ $(LANGUAGE) $(GNUTLS_CFLAGS) $(AVAHI_CFLAGS) $(GPGME_CFLAGS) \ -DVERSION='"$(version)"' -LDFLAGS=$(COVERAGE) $(foreach flag,$(LINK_FORTIFY),-Xlinker $(flag)) +LDFLAGS=$(COVERAGE) $(LINK_FORTIFY) $(foreach flag,$(LINK_FORTIFY_LD),-Xlinker $(flag)) # Commands to format a DocBook document into a manual page DOCBOOKTOMAN=cd $(dir $<); xsltproc --nonet --xinclude \ @@ -175,6 +176,9 @@ $(SED) --in-place \ --expression='s/^\(Entered-date:\).*/\1\t$(shell date --rfc-3339=date --reference=Makefile)/' \ $@ + $(SED) --in-place \ + --expression='s/\(mandos_\)[0-9.]\+\(\.orig\.tar\.gz\)/\1$(version)\2/' \ + $@ plugins.d/mandos-client: plugins.d/mandos-client.o $(LINK.o) $(GNUTLS_LIBS) $(AVAHI_LIBS) $(GPGME_LIBS) \ @@ -199,7 +203,8 @@ run-client: all keydir/seckey.txt keydir/pubkey.txt ./plugin-runner --plugin-dir=plugins.d \ --config-file=plugin-runner.conf \ - --options-for=mandos-client:--seckey=keydir/seckey.txt,--pubkey=keydir/pubkey.txt + --options-for=mandos-client:--seckey=keydir/seckey.txt,--pubkey=keydir/pubkey.txt \ + $(CLIENTARGS) # Used by run-client keydir/seckey.txt keydir/pubkey.txt: mandos-keygen @@ -208,7 +213,7 @@ # Run the server with a local config run-server: confdir/mandos.conf confdir/clients.conf - ./mandos --debug --configdir=confdir + ./mandos --debug --configdir=confdir $(SERVERARGS) # Used by run-server confdir/mandos.conf: mandos.conf === modified file 'NEWS' --- NEWS 2008-10-17 18:56:25 +0000 +++ NEWS 2009-01-06 02:42:53 +0000 @@ -1,6 +1,18 @@ This NEWS file records noteworthy changes, very tersely. See the manual for detailed information. +Version 1.0.3 (2009-01-06) +* Server +** Now tries to change to user and group "_mandos" before falling back + to trying the old values "mandos", "nobody:nogroup", and "65534". +** Now does not abort on startup even if no clients are defined in + clients.conf. + +* Client +** Plugins named "*.dpkg-bak" are now ignored. +** Hopefully fixed compilation failure on some architectures where the + C compiler does not recognize the "-z" option as a linker option. + Version 1.0.2 (2008-10-17) * mandos-keygen now signs the encrypted key blobs. This signature is not currently verified by mandos-client, but this may change in the === modified file 'clients.conf' --- clients.conf 2008-09-21 13:42:34 +0000 +++ clients.conf 2009-01-08 03:54:06 +0000 @@ -14,7 +14,7 @@ ;interval = 5m # What command to run as "the checker". -;checker = fping -q -- %(host)s +;checker = fping -q -- %%(host)s ;#### === modified file 'debian/changelog' --- debian/changelog 2008-10-17 18:56:25 +0000 +++ debian/changelog 2009-01-06 22:43:19 +0000 @@ -1,3 +1,26 @@ +mandos (1.0.3-2) unstable; urgency=low + + * Removed some now-unused debconf files. + * Changed postinst scripts to not source debconf/confmodule. + * Removed po-debconf from build-depends. + + -- Teddy Hogeborn Tue, 06 Jan 2009 21:28:20 +0100 + +mandos (1.0.3-1) unstable; urgency=low + + * New upstream release. + * Add -Xlinker to linker flags to fix FTBFS for some architectures. + Thanks to Thiemo Seufer for the report and + fix. (Closes: #509398) + * Remove debconf use altogether, thereby stopping debconf abuse. Thanks + to Christian Perrier . (Closes: #509653) + * Add NEWS file to /usr/share/doc directories. + * Use and create "_mandos" user+group. Rename old user+group created by + older versions of this package. + * Fix manual pages by adding build-depend on "docbook-xml". + + -- Teddy Hogeborn Tue, 06 Jan 2009 01:21:20 +0100 + mandos (1.0.2-1) unstable; urgency=low * New upstream release. === modified file 'debian/control' --- debian/control 2009-01-04 21:20:50 +0000 +++ debian/control 2009-01-06 20:39:35 +0000 @@ -6,7 +6,7 @@ Björn Påhlsson Build-Depends: debhelper (>= 7), docbook-xml, docbook-xsl, libavahi-core-dev, libgpgme11-dev, libgnutls-dev, xsltproc, - po-debconf, pkg-config + pkg-config Standards-Version: 3.8.0 Vcs-Bzr: http://ftp.fukt.bsnet.se/pub/mandos/trunk Vcs-Browser: http://bzr.fukt.bsnet.se/loggerhead/mandos/trunk/files === removed file 'debian/mandos-client.config' --- debian/mandos-client.config 2008-09-21 04:22:50 +0000 +++ debian/mandos-client.config 1970-01-01 00:00:00 +0000 @@ -1,27 +0,0 @@ -#! /bin/sh -# -# config Mandos Debconf configuration. -# - -# Source debconf library. -. /usr/share/debconf/confmodule -if ! db_version 2.0; then - echo "mandos.config: need DebConf 2.0 or later" - exit 1 -fi - -set -e -umask 022 - -# Now, interaction. Batch it in case any front ends can use this. -db_beginblock - -# If this is a first time install then prompt -if [ "$1" = "configure" -a "$2" != "" ]; then - db_input high mandos-client/not-yet-configured || true -fi - -db_endblock -db_go || true - -exit 0 === modified file 'debian/mandos-client.postinst' --- debian/mandos-client.postinst 2008-12-10 01:26:02 +0000 +++ debian/mandos-client.postinst 2009-01-06 05:08:37 +0000 @@ -15,8 +15,6 @@ # If prerm fails during replacement due to conflict: # abort-remove in-favour -. /usr/share/debconf/confmodule - # Update the initial RAM file system image update_initramfs() { === removed file 'debian/mandos.config' --- debian/mandos.config 2008-09-21 04:22:50 +0000 +++ debian/mandos.config 1970-01-01 00:00:00 +0000 @@ -1,27 +0,0 @@ -#! /bin/sh -# -# config Mandos Debconf configuration. -# - -# Source debconf library. -. /usr/share/debconf/confmodule -if ! db_version 2.0; then - echo "mandos.config: need DebConf 2.0 or later" - exit 1 -fi - -set -e -umask 022 - -# Now, interaction. Batch it in case any front ends can use this. -db_beginblock - -# If this is a first time install then prompt -if [ "$1" = "configure" -a "$2" != "" ]; then - db_input high mandos/not-yet-configured || true -fi - -db_endblock -db_go || true - -exit 0 === modified file 'debian/mandos.postinst' --- debian/mandos.postinst 2008-12-10 01:26:02 +0000 +++ debian/mandos.postinst 2009-01-06 05:08:37 +0000 @@ -15,8 +15,6 @@ # If prerm fails during replacement due to conflict: # abort-remove in-favour -. /usr/share/debconf/confmodule - case "$1" in configure) # Rename old "mandos" user and group === modified file 'mandos' --- mandos 2009-01-10 21:45:37 +0000 +++ mandos 2009-01-10 21:49:25 +0000 @@ -66,7 +66,7 @@ import ctypes import ctypes.util -version = "1.0.2" +version = "1.0.3" logger = logging.Logger('mandos') syslogger = (logging.handlers.SysLogHandler @@ -993,23 +993,17 @@ try: uid = pwd.getpwnam("_mandos").pw_uid + gid = pwd.getpwnam("_mandos").pw_gid except KeyError: try: uid = pwd.getpwnam("mandos").pw_uid + gid = pwd.getpwnam("mandos").pw_gid except KeyError: try: uid = pwd.getpwnam("nobody").pw_uid + gid = pwd.getpwnam("nogroup").pw_gid except KeyError: uid = 65534 - try: - gid = pwd.getpwnam("_mandos").pw_gid - except KeyError: - try: - gid = pwd.getpwnam("mandos").pw_gid - except KeyError: - try: - gid = pwd.getpwnam("nogroup").pw_gid - except KeyError: gid = 65534 try: os.setuid(uid) === modified file 'mandos-clients.conf.xml' --- mandos-clients.conf.xml 2009-01-04 21:54:55 +0000 +++ mandos-clients.conf.xml 2009-01-08 03:54:06 +0000 @@ -3,7 +3,7 @@ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ /etc/mandos/clients.conf"> - + %common; ]> @@ -170,7 +170,7 @@ PATH will be searched. The default value for the checker command is fping %(host)s. + >-- %%(host)s. In addition to normal start time expansion, this option @@ -351,7 +351,7 @@ [DEFAULT] timeout = 1h interval = 5m -checker = fping -q -- %(host)s +checker = fping -q -- %%(host)s # Client "foo" [foo] === modified file 'mandos-keygen' --- mandos-keygen 2009-01-04 21:54:55 +0000 +++ mandos-keygen 2009-01-06 02:42:53 +0000 @@ -21,7 +21,7 @@ # Contact the authors at . # -VERSION="1.0.2" +VERSION="1.0.3" KEYDIR="/etc/keys/mandos" KEYTYPE=DSA === modified file 'mandos.lsm' --- mandos.lsm 2009-01-10 21:45:37 +0000 +++ mandos.lsm 2009-01-10 21:49:25 +0000 @@ -1,7 +1,7 @@ Begin4 Title: Mandos -Version: 1.0.2 -Entered-date: 2009-01-08 +Version: 1.0.3 +Entered-date: 2009-01-06 Description: The Mandos system allows computers to have encrypted root file systems and at the same time be capable of remote and/or unattended reboots. @@ -12,9 +12,9 @@ Maintained-by: teddy@fukt.bsnet.se (Teddy Hogeborn), belorn@fukt.bsnet.se (Björn Påhlsson) Primary-site: http://www.fukt.bsnet.se/mandos - 89K mandos_1.0.2.orig.tar.gz + 92K mandos_1.0.3.orig.tar.gz Alternate-site: ftp://ftp.fukt.bsnet.se/pub/mandos - 89K mandos_1.0.2.orig.tar.gz + 92K mandos_1.0.3.orig.tar.gz Platforms: Requires GCC, GNU libC, Avahi, GnuPG, Python 2.4, and various other libraries. While made for Debian GNU/Linux, it is probably portable to other distributions, but not other Unixes. === modified file 'plugin-runner.c' --- plugin-runner.c 2009-01-04 21:54:55 +0000 +++ plugin-runner.c 2009-01-06 22:49:50 +0000 @@ -309,6 +309,7 @@ struct stat st; fd_set rfds_all; int ret, maxfd = 0; + ssize_t sret; uid_t uid = 65534; gid_t gid = 65534; bool debug = false; @@ -546,7 +547,6 @@ char *org_line = NULL; char *p, *arg, *new_arg, *line; size_t size = 0; - ssize_t sret; const char whitespace_delims[] = " \r\t\f\v\n"; const char comment_delim[] = "#"; @@ -1019,18 +1019,18 @@ proc->buffer_size += BUFFER_SIZE; } /* Read from the process */ - ret = read(proc->fd, proc->buffer + proc->buffer_length, - BUFFER_SIZE); - if(ret < 0){ + sret = read(proc->fd, proc->buffer + proc->buffer_length, + BUFFER_SIZE); + if(sret < 0){ /* Read error from this process; ignore the error */ proc = proc->next; continue; } - if(ret == 0){ + if(sret == 0){ /* got EOF */ proc->eof = true; } else { - proc->buffer_length += (size_t) ret; + proc->buffer_length += (size_t) sret; } } } === modified file 'plugins.d/askpass-fifo.c' --- plugins.d/askpass-fifo.c 2009-01-04 21:54:55 +0000 +++ plugins.d/askpass-fifo.c 2009-01-10 06:00:50 +0000 @@ -1,6 +1,6 @@ /* -*- coding: utf-8 -*- */ /* - * Passprompt - Read a password from a FIFO and output it + * Askpass-FIFO - Read a password from a FIFO and output it * * Copyright © 2008,2009 Teddy Hogeborn * Copyright © 2008,2009 Björn Påhlsson @@ -43,14 +43,14 @@ /* Create FIFO */ const char passfifo[] = "/lib/cryptsetup/passfifo"; - ret = TEMP_FAILURE_RETRY(mkfifo(passfifo, S_IRUSR | S_IWUSR)); + ret = (int)TEMP_FAILURE_RETRY(mkfifo(passfifo, S_IRUSR | S_IWUSR)); if(ret == -1 and errno != EEXIST){ perror("mkfifo"); return EXIT_FAILURE; } /* Open FIFO */ - int fifo_fd = TEMP_FAILURE_RETRY(open(passfifo, O_RDONLY)); + int fifo_fd = (int)TEMP_FAILURE_RETRY(open(passfifo, O_RDONLY)); if(fifo_fd == -1){ perror("open"); return EXIT_FAILURE; === modified file 'plugins.d/mandos-client.c' --- plugins.d/mandos-client.c 2009-01-04 21:54:55 +0000 +++ plugins.d/mandos-client.c 2009-01-10 06:00:50 +0000 @@ -1,6 +1,6 @@ /* -*- coding: utf-8 -*- */ /* - * Mandos client - get and decrypt data from a Mandos server + * Mandos-client - get and decrypt data from a Mandos server * * This program is partly derived from an example program for an Avahi * service browser, downloaded from @@ -156,7 +156,7 @@ int fd; gpgme_data_t pgp_data; - fd = TEMP_FAILURE_RETRY(open(filename, O_RDONLY)); + fd = (int)TEMP_FAILURE_RETRY(open(filename, O_RDONLY)); if(fd == -1){ perror("open"); return false; @@ -176,7 +176,7 @@ return false; } - ret = TEMP_FAILURE_RETRY(close(fd)); + ret = (int)TEMP_FAILURE_RETRY(close(fd)); if(ret == -1){ perror("close"); } @@ -501,6 +501,7 @@ AvahiIfIndex if_index, mandos_context *mc){ int ret, tcp_sd; + ssize_t sret; union { struct sockaddr in; struct sockaddr_in6 in6; } to; char *buffer = NULL; char *decrypted_buffer; @@ -577,7 +578,7 @@ written = 0; while (true){ size_t out_size = strlen(out); - ret = TEMP_FAILURE_RETRY(write(tcp_sd, out + written, + ret = (int)TEMP_FAILURE_RETRY(write(tcp_sd, out + written, out_size - written)); if (ret == -1){ perror("write"); @@ -632,13 +633,13 @@ goto mandos_end; } - ret = gnutls_record_recv(session, buffer+buffer_length, - BUFFER_SIZE); - if (ret == 0){ + sret = gnutls_record_recv(session, buffer+buffer_length, + BUFFER_SIZE); + if (sret == 0){ break; } - if (ret < 0){ - switch(ret){ + if (sret < 0){ + switch(sret){ case GNUTLS_E_INTERRUPTED: case GNUTLS_E_AGAIN: break; @@ -661,7 +662,7 @@ goto mandos_end; } } else { - buffer_length += (size_t) ret; + buffer_length += (size_t) sret; } } @@ -703,7 +704,7 @@ mandos_end: free(buffer); - ret = TEMP_FAILURE_RETRY(close(tcp_sd)); + ret = (int)TEMP_FAILURE_RETRY(close(tcp_sd)); if(ret == -1){ perror("close"); } @@ -940,7 +941,7 @@ goto end; } } - ret = TEMP_FAILURE_RETRY(close(sd)); + ret = (int)TEMP_FAILURE_RETRY(close(sd)); if(ret == -1){ perror("close"); } === modified file 'plugins.d/password-prompt.c' --- plugins.d/password-prompt.c 2009-01-04 21:54:55 +0000 +++ plugins.d/password-prompt.c 2009-01-10 06:00:50 +0000 @@ -1,6 +1,6 @@ /* -*- coding: utf-8 -*- */ /* - * Passprompt - Read a password from the terminal and print it + * Password-prompt - Read a password from the terminal and print it * * Copyright © 2008,2009 Teddy Hogeborn * Copyright © 2008,2009 Björn Påhlsson @@ -79,7 +79,7 @@ .doc = "Debug mode", .group = 3 }, { .name = NULL } }; - + error_t parse_opt (int key, char *arg, struct argp_state *state) { /* Get the INPUT argument from `argp_parse', which we know is a pointer to our plugin list pointer. */ @@ -100,7 +100,7 @@ } return 0; } - + struct argp argp = { .options = options, .parser = parse_opt, .args_doc = "", .doc = "Mandos password-prompt -- Read and" @@ -111,7 +111,7 @@ return EXIT_FAILURE; } } - + if (debug){ fprintf(stderr, "Starting %s\n", argv[0]); } @@ -250,7 +250,7 @@ fprintf(stderr, "getline() returned 0, retrying.\n"); } } - + free(buffer); if (debug){ === modified file 'plugins.d/splashy.c' --- plugins.d/splashy.c 2009-01-04 21:54:55 +0000 +++ plugins.d/splashy.c 2009-01-10 06:23:04 +0000 @@ -1,6 +1,6 @@ /* -*- coding: utf-8 -*- */ /* - * Passprompt - Read a password from splashy and output it + * Splashy - Read a password from splashy and output it * * Copyright © 2008,2009 Teddy Hogeborn * Copyright © 2008,2009 Björn Påhlsson @@ -120,6 +120,10 @@ struct stat exe_stat; ret = lstat(exe_link, &exe_stat); if(ret == -1){ + if(errno == ENOENT){ + free(exe_link); + continue; + } perror("lstat"); free(exe_link); free(prompt); === modified file 'plugins.d/usplash.c' --- plugins.d/usplash.c 2009-01-04 21:54:55 +0000 +++ plugins.d/usplash.c 2009-01-10 06:23:04 +0000 @@ -1,6 +1,6 @@ /* -*- coding: utf-8 -*- */ /* - * Passprompt - Read a password from usplash and output it + * Usplash - Read a password from usplash and output it * * Copyright © 2008,2009 Teddy Hogeborn * Copyright © 2008,2009 Björn Påhlsson @@ -92,10 +92,11 @@ } size_t written = 0; + ssize_t sret = 0; while(not interrupted_by_signal and written < cmd_line_len){ - ret = write(fifo_fd, cmd_line + written, - cmd_line_len - written); - if(ret == -1){ + sret = write(fifo_fd, cmd_line + written, + cmd_line_len - written); + if(sret == -1){ if(errno != EINTR or interrupted_by_signal){ int e = errno; close(fifo_fd); @@ -106,7 +107,7 @@ continue; } } - written += (size_t)ret; + written += (size_t)sret; } free(cmd_line_alloc); do{ @@ -192,6 +193,10 @@ struct stat exe_stat; ret = lstat(exe_link, &exe_stat); if(ret == -1){ + if(errno == ENOENT){ + free(exe_link); + continue; + } perror("lstat"); free(exe_link); free(prompt); @@ -207,9 +212,6 @@ sret = readlink(exe_link, exe_target, sizeof(exe_target)); free(exe_link); - if(sret == -1){ - continue; - } } if((sret == ((ssize_t)sizeof(exe_target)-1)) and (memcmp(usplash_name, exe_target,