gss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU gss branch, master, updated. gss-1-0-2-21-ga20d692


From: Simon Josefsson
Subject: [SCM] GNU gss branch, master, updated. gss-1-0-2-21-ga20d692
Date: Tue, 14 Aug 2012 13:33:27 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU gss".

http://git.savannah.gnu.org/cgit/gss.git/commit/?id=a20d692d58d9d3c5c6be782b02d9083c00d77d0a

The branch, master has been updated
       via  a20d692d58d9d3c5c6be782b02d9083c00d77d0a (commit)
       via  5772d41e830d1e12f3ec565cdf5b63fb3515706e (commit)
       via  7811554f4440509c6d0c28e281478782b72431a6 (commit)
       via  e9750b2964a27132ec0f1c5bcfd4e10c2e1a1286 (commit)
       via  449cdd49739136c8dad9664f5413304177929fc9 (commit)
       via  abd51b23a9bf1506357d4480c85c2974b91c030a (commit)
       via  4b207876c2512dda84a25d090accd2f0121318f4 (commit)
       via  4b795ad221db67d507897a77b7202e63cc44cc3d (commit)
       via  611c7c5d40eec73205f95eb7393cba8535313383 (commit)
       via  ed24cc0414961acc75714bad092284aa1fdd32a0 (commit)
      from  c896885fb79303e09f9aba3a696764f3190d8f00 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a20d692d58d9d3c5c6be782b02d9083c00d77d0a
Author: Simon Josefsson <address@hidden>
Date:   Tue Aug 14 15:33:12 2012 +0200

    gss: Support security contexts.

commit 5772d41e830d1e12f3ec565cdf5b63fb3515706e
Author: Simon Josefsson <address@hidden>
Date:   Tue Aug 14 14:11:52 2012 +0200

    acquire_cred: Don't crash on NULL desired_name.

commit 7811554f4440509c6d0c28e281478782b72431a6
Author: Simon Josefsson <address@hidden>
Date:   Tue Aug 14 13:49:46 2012 +0200

    Don't crash on NULL target_name.

commit e9750b2964a27132ec0f1c5bcfd4e10c2e1a1286
Author: Simon Josefsson <address@hidden>
Date:   Tue Aug 14 13:45:07 2012 +0200

    Add base64 gnulib module.

commit 449cdd49739136c8dad9664f5413304177929fc9
Author: Simon Josefsson <address@hidden>
Date:   Tue Aug 14 13:35:41 2012 +0200

    Update gnulib files.

commit abd51b23a9bf1506357d4480c85c2974b91c030a
Author: Simon Josefsson <address@hidden>
Date:   Mon Aug 13 13:50:47 2012 +0200

    Sync with TP.

commit 4b207876c2512dda84a25d090accd2f0121318f4
Author: Simon Josefsson <address@hidden>
Date:   Mon Jun 11 12:14:52 2012 +0200

    Sync with TP.

commit 4b795ad221db67d507897a77b7202e63cc44cc3d
Author: Simon Josefsson <address@hidden>
Date:   Fri Jun 1 09:29:16 2012 +0200

    Update gnulib files.

commit 611c7c5d40eec73205f95eb7393cba8535313383
Author: Simon Josefsson <address@hidden>
Date:   Mon May 14 13:17:40 2012 +0200

    Fix make check when Kerberos V5 is disabled.

commit ed24cc0414961acc75714bad092284aa1fdd32a0
Author: Simon Josefsson <address@hidden>
Date:   Mon May 14 13:17:03 2012 +0200

    Add -Wno-array-bounds for meta.c false positive.

-----------------------------------------------------------------------

Summary of changes:
 NEWS                               |    4 +
 build-aux/gnupload                 |   28 ++-
 configure.ac                       |    1 +
 doc/gss.texi                       |   69 ++++-
 gl/Makefile.am                     |    2 +-
 gl/m4/gnulib-cache.m4              |    2 +-
 gl/m4/gnulib-common.m4             |    7 +-
 gl/m4/gnulib-comp.m4               |    1 -
 gl/m4/manywarnings.m4              |    3 +-
 gl/m4/warnings.m4                  |   47 ++-
 lib/gl/m4/extensions.m4            |    4 +-
 lib/gl/m4/gnulib-cache.m4          |    2 +-
 lib/gl/m4/gnulib-common.m4         |    7 +-
 lib/gl/override/lib/gettext.h.diff |  361 +++++++++++------------
 lib/krb5/context.c                 |    5 +
 lib/krb5/cred.c                    |    3 +-
 maint.mk                           |  151 +++++++---
 po/LINGUAS                         |    1 +
 po/{pl.po.in => hr.po.in}          |  150 +++++-----
 po/id.po.in                        |  182 +++++++-----
 src/gl/Makefile.am                 |   67 ++++-
 src/gl/base64.c                    |  574 ++++++++++++++++++++++++++++++++++++
 src/gl/base64.h                    |   68 +++++
 src/gl/errno.in.h                  |   48 +++-
 src/gl/m4/base64.m4                |   16 +
 src/gl/m4/errno_h.m4               |   11 +-
 src/gl/m4/extensions.m4            |    4 +-
 src/gl/m4/getopt.m4                |  291 ++++++++++---------
 src/gl/m4/gnulib-cache.m4          |    5 +-
 src/gl/m4/gnulib-common.m4         |    7 +-
 src/gl/m4/gnulib-comp.m4           |   26 ++
 src/gl/m4/memchr.m4                |   88 ++++++
 src/gl/m4/mmap-anon.m4             |   55 ++++
 src/gl/m4/nocrash.m4               |    4 +-
 src/gl/m4/off_t.m4                 |   18 ++
 src/gl/m4/stdbool.m4               |  100 +++++++
 src/gl/m4/strerror.m4              |   48 ++-
 src/gl/m4/sys_types_h.m4           |   24 ++
 src/gl/m4/unistd_h.m4              |    6 +-
 src/gl/memchr.c                    |  172 +++++++++++
 src/gl/memchr.valgrind             |   14 +
 src/gl/override/lib/gettext.h.diff |  361 +++++++++++------------
 src/gl/stdbool.in.h                |  121 ++++++++
 src/gl/strerror-override.c         |   16 +-
 src/gl/strerror-override.h         |    5 +-
 src/gl/sys_types.in.h              |   51 ++++
 src/gl/unistd.in.h                 |   20 +-
 src/gl/verify.h                    |    6 +-
 src/gss.c                          |  248 ++++++++++++++++-
 src/gss.ggo                        |    3 +
 tests/saslname.c                   |    2 +
 51 files changed, 2743 insertions(+), 766 deletions(-)
 copy po/{pl.po.in => hr.po.in} (59%)
 create mode 100644 src/gl/base64.c
 create mode 100644 src/gl/base64.h
 create mode 100644 src/gl/m4/base64.m4
 create mode 100644 src/gl/m4/memchr.m4
 create mode 100644 src/gl/m4/mmap-anon.m4
 create mode 100644 src/gl/m4/off_t.m4
 create mode 100644 src/gl/m4/stdbool.m4
 create mode 100644 src/gl/m4/sys_types_h.m4
 create mode 100644 src/gl/memchr.c
 create mode 100644 src/gl/memchr.valgrind
 create mode 100644 src/gl/stdbool.in.h
 create mode 100644 src/gl/sys_types.in.h

diff --git a/NEWS b/NEWS
index 2173368..bd6daf5 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,10 @@ See the end for copying conditions.
 
 * Version 1.0.3 (unreleased)
 
+** gss: The command line tool can now initialize and accept security contexts.
+This is useful for debugging.  See the section "Invoking gss" in the
+manual for more information.
+
 ** i18n: Translations were updated.
 
 ** build: Update gnulib files.
diff --git a/build-aux/gnupload b/build-aux/gnupload
index 40a59d3..a0e5c7b 100755
--- a/build-aux/gnupload
+++ b/build-aux/gnupload
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Sign files and upload them.
 
-scriptversion=2012-01-15.15; # UTC
+scriptversion=2012-06-11.00; # UTC
 
 # Copyright (C) 2004-2012 Free Software Foundation, Inc.
 #
@@ -28,6 +28,7 @@ GPG='gpg --batch --no-tty'
 conffile=.gnuploadrc
 to=
 dry_run=false
+replace=
 symlink_files=
 delete_files=
 delete_symlinks=
@@ -53,8 +54,10 @@ Options:
   --to DEST                specify one destination for FILES
                            (multiple --to options are allowed)
   --user NAME              sign with key NAME
+  --replace                allow replacements of existing files
   --symlink-regex[=EXPR]   use sed script EXPR to compute symbolic link names
   --dry-run                do nothing, show what would have been done
+                           (including the constructed directive file)
   --version                output version information and exit
 
 If --symlink-regex is given without EXPR, then the link target name
@@ -146,6 +149,9 @@ while test -n "$1"; do
     --delete)
       collect_var=delete_files
       ;;
+    --replace)
+      replace="replace: true"
+      ;;
     --rmsymlink)
       collect_var=delete_symlinks
       ;;
@@ -243,11 +249,13 @@ unset passphrase
 # listings with their arguments...).
 # Remember this script runs with 'set -e', so if echo is not built-in
 # it will exit now.
-PATH=/empty echo -n "Enter GPG passphrase: "
-stty -echo
-read -r passphrase
-stty echo
-echo
+if $dry_run; then :; else
+  PATH=/empty echo -n "Enter GPG passphrase: "
+  stty -echo
+  read -r passphrase
+  stty echo
+  echo
+fi
 
 if test $# -ne 0; then
   for file
@@ -270,7 +278,7 @@ filename: $3$stmt"
   fi
 
   cat >${2}.directive<<EOF
-version: 1.1
+version: 1.2
 directory: $1
 comment: gnupload v. $scriptversion$stmt
 EOF
@@ -393,6 +401,12 @@ do
   do
     echo "Uploading $file to $dest ..."
     stmt=
+    #
+    # allowing file replacement is all or nothing.
+    if test -n "$replace"; then stmt="$stmt
+$replace"
+    fi
+    #
     files="$file $file.sig"
     destdir=`echo $dest | sed 's/[^:]*://'`
     if test -n "$symlink_expr"; then
diff --git a/configure.ac b/configure.ac
index d006741..f8a17ac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -130,6 +130,7 @@ if test "$gl_gcc_warnings" = yes; then
 
   gl_WARN_ADD([-Wno-unused-parameter])
   gl_WARN_ADD([-Wno-stack-protector])  # Some functions cannot be protected
+  gl_WARN_ADD([-Wno-array-bounds])     # gcc-4.6 meta.c false positive
   gl_WARN_ADD([-fdiagnostics-show-option])
 fi
 
diff --git a/doc/gss.texi b/doc/gss.texi
index 6be5fe4..40de8c4 100644
--- a/doc/gss.texi
+++ b/doc/gss.texi
@@ -1532,8 +1532,16 @@ optional for any corresponding short options.
   -l, --list-mechanisms
                     List information about supported mechanisms
                     in a human readable format.
-
   -m, --major=LONG  Describe a `major status' error code value.
+  -a, --accept-sec-context
+                    Accept a security context as server.
+  -i, --init-sec-context=MECH
+                    Initialize a security context as client.
+                    MECH is the SASL name of mechanism, use -l
+                    to list supported mechanisms.
+  -n, address@hidden
+                    For -i, set the name of the remote host.
+                    For example, "address@hidden".
 @end verbatim
 
 @majorheading Other Options
@@ -1548,12 +1556,65 @@ These are some standard parameters.
 
 @majorheading Examples
 
+To list the supported mechanisms, use @code{gss -l} like this:
 
address@hidden
+$ src/gss -l
+Found 1 supported mechanisms.
+
+Mechanism 0:
+        Mechanism name: Kerberos V5
+        Mechanism description: Kerberos V5 GSS-API mechanism
+        SASL Mechanism name: GS2-KRB5
+$
address@hidden verbatim
+
+To initialize a Kerberos V5 security context, use the
address@hidden parameter.  Kerberos V5 needs to know the name
+of the remote entity, so you need to supply the @code{--server-name}
+parameter as well.  That will provide the name of the server.  For
+example, use @code{imap@@mail.example.com} to setup a security context
+with the @code{imap} service on the host @code{mail.example.com}.  The
+Kerberos V5 client will use your ticket-granting ticket (which needs to
+be available) and acquire a server ticket for the service.  The KDC must
+know about the server for this to work.  The tool will print the GSS-API
+context tokens base64 encoded on standard output.
 
 @verbatim
-  -h, --help        Print help and exit
-  -V, --version     Print version and exit
-  -q, --quiet       Silent operation  (default=off)
+$ gss -i GS2-KRB5 -n address@hidden
+Context token (protection is available):
+YIICIQYJKoZIhvcSAQICAQBuggIQMIICDKADAgEFoQMCAQ6iBwMFACAAAACjggEYYYIBFDCCARCgAwIBBaEXGxVpbnRlcm9wLmpvc2Vmc3Nvbi5vcmeiKDAmoAMCAQGhHzAdGwRob3N0GxVpbnRlcm9wLmpvc2Vmc3Nvbi5vcmejgcUwgcKgAwIBEqKBugSBt0zqTh6tBBKV2BwDjQg6H4abEaPshPa0o3tT/TH9U7BaSw/M9ugYYqpHAhOitVjcQidhG2FdSl1n3FOgDBufHHO+gHOW0Y1XHc2QtEdkg1xYF2J4iR1vNQB14kXDM78pogCsfvfLnjsEESKWoeKRGOYWPRx0ksLJDnl/e5tXecZTjhJ3hLrFNBEWRmpIOakTAPnL+Xzz6xcnLHMLLnhZ5VcHqtIMm5p9IDWsP0juIncJ6tO8hjMA2qSB2jCB16ADAgESooHPBIHMWSeRBgV80gh/6hNNMr00jTVwCs5TEAIkljvjOfyPmNBzIFWoG+Wj5ZKOBdizdi7vYbJ2s8b1iSsq/9YEZSqaTxul+5aNrclKoJ7J/IW4kTuMklHcQf/A16TeZFsm9TdfE+x8+PjbOBFtKYXT8ODT8LLicNNiDbWW0meY7lsktXAVpZiUds4wTZ1W5bOSEGY7+mxAWrAlTnNwNAt1J2MHZnfGJFJDLJZldXoyG8OwHyp4h1nBhgzC5BfAmL85QJVxxgVfiHhM5oT9mE1O
+Input context token:
+
address@hidden verbatim
+
+The tool is waiting for the final Kerberos V5 context token from the
+server.  Note the status text informing you that message protection is
+available.
+
+To accept a Kerberos V5 context, the process is similar.  The server
+needs to know its name, so that it can find the host key from
+(typically) @code{/etc/shishi/shishi.keys}.  Once started it will wait
+for a context token from the client.  Below we'll paste in the token
+printed above.
+
address@hidden
+$ gss -a -n address@hidden
+Input context token:
+YIICIQYJKoZIhvcSAQICAQBuggIQMIICDKADAgEFoQMCAQ6iBwMFACAAAACjggEYYYIBFDCCARCgAwIBBaEXGxVpbnRlcm9wLmpvc2Vmc3Nvbi5vcmeiKDAmoAMCAQGhHzAdGwRob3N0GxVpbnRlcm9wLmpvc2Vmc3Nvbi5vcmejgcUwgcKgAwIBEqKBugSBt0zqTh6tBBKV2BwDjQg6H4abEaPshPa0o3tT/TH9U7BaSw/M9ugYYqpHAhOitVjcQidhG2FdSl1n3FOgDBufHHO+gHOW0Y1XHc2QtEdkg1xYF2J4iR1vNQB14kXDM78pogCsfvfLnjsEESKWoeKRGOYWPRx0ksLJDnl/e5tXecZTjhJ3hLrFNBEWRmpIOakTAPnL+Xzz6xcnLHMLLnhZ5VcHqtIMm5p9IDWsP0juIncJ6tO8hjMA2qSB2jCB16ADAgESooHPBIHMWSeRBgV80gh/6hNNMr00jTVwCs5TEAIkljvjOfyPmNBzIFWoG+Wj5ZKOBdizdi7vYbJ2s8b1iSsq/9YEZSqaTxul+5aNrclKoJ7J/IW4kTuMklHcQf/A16TeZFsm9TdfE+x8+PjbOBFtKYXT8ODT8LLicNNiDbWW0meY7lsktXAVpZiUds4wTZ1W5bOSEGY7+mxAWrAlTnNwNAt1J2MHZnfGJFJDLJZldXoyG8OwHyp4h1nBhgzC5BfAmL85QJVxxgVfiHhM5oT9mE1O
+Context has been accepted.  Final context token:
+YHEGCSqGSIb3EgECAgIAb2IwYKADAgEFoQMCAQ+iVDBSoAMCARKhAwIBAKJGBESy1Zoy9DrG+DuV/6aWmAp79s9d+ofGXC/WKOzRuxAqo98vMRWbsbILW8z9aF1th4GZz0kjFz/hZAmnWyomZ9JiP3yQvg==
+$
address@hidden verbatim
+
+Returning to the client, you may now cut'n'paste the final context token
+as shown by the server.  The client has then authenticated the server as
+well.  The output from the client is shown below.
+
address@hidden
+YHEGCSqGSIb3EgECAgIAb2IwYKADAgEFoQMCAQ+iVDBSoAMCARKhAwIBAKJGBESy1Zoy9DrG+DuV/6aWmAp79s9d+ofGXC/WKOzRuxAqo98vMRWbsbILW8z9aF1th4GZz0kjFz/hZAmnWyomZ9JiP3yQvg==
+Context has been initialized.
+$
 @end verbatim
 
 @c **********************************************************
diff --git a/gl/Makefile.am b/gl/Makefile.am
index bcb792f..bfd4d4f 100644
--- a/gl/Makefile.am
+++ b/gl/Makefile.am
@@ -62,7 +62,7 @@ EXTRA_DIST += $(top_srcdir)/build-aux/gendocs.sh
 
 distclean-local: clean-GNUmakefile
 clean-GNUmakefile:
-       test x'$(VPATH)' != x && rm -f $(top_builddir)/GNUmakefile || :
+       test '$(srcdir)' = . || rm -f $(top_builddir)/GNUmakefile
 
 EXTRA_DIST += $(top_srcdir)/GNUmakefile
 
diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4
index e81b480..8892286 100644
--- a/gl/m4/gnulib-cache.m4
+++ b/gl/m4/gnulib-cache.m4
@@ -56,5 +56,5 @@ gl_MAKEFILE_NAME([])
 gl_LIBTOOL
 gl_MACRO_PREFIX([gl])
 gl_PO_DOMAIN([])
-gl_WITNESS_C_DOMAIN([])
+gl_WITNESS_C_MACRO([])
 gl_VC_FILES([false])
diff --git a/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4
index ae4d254..15d2b2b 100644
--- a/gl/m4/gnulib-common.m4
+++ b/gl/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 32
+# gnulib-common.m4 serial 33
 dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,8 @@ AC_DEFUN([gl_COMMON], [
 AC_DEFUN([gl_COMMON_BODY], [
   AH_VERBATIM([_Noreturn],
 [/* The _Noreturn keyword of C11.  */
-#ifndef _Noreturn
+#if ! (defined _Noreturn \
+       || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
 # if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
       || 0x5110 <= __SUNPRO_C)
 #  define _Noreturn __attribute__ ((__noreturn__))
@@ -29,7 +30,7 @@ AC_DEFUN([gl_COMMON_BODY], [
 [/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
    the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
    earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
-   __APPLE__ && __MACH__ test for MacOS X.
+   __APPLE__ && __MACH__ test for Mac OS X.
    __APPLE_CC__ tests for the Apple compiler and its version.
    __STDC_VERSION__ tests for the C99 mode.  */
 #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined 
__cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index 5fbe307..a89d7bd 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -85,7 +85,6 @@ AC_CONFIG_COMMANDS_PRE([m4_ifdef([AH_HEADER],
   [AC_SUBST([CONFIG_INCLUDE], m4_defn([AH_HEADER]))])])
 AC_PATH_PROG([PMCCABE], [pmccabe], [false])
 gl_VALGRIND_TESTS
-AC_SUBST([WARN_CFLAGS])
   # End of code from modules
   m4_ifval(gl_LIBSOURCES_LIST, [
     m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ ||
diff --git a/gl/m4/manywarnings.m4 b/gl/m4/manywarnings.m4
index fd0e372..864fc85 100644
--- a/gl/m4/manywarnings.m4
+++ b/gl/m4/manywarnings.m4
@@ -1,4 +1,4 @@
-# manywarnings.m4 serial 3
+# manywarnings.m4 serial 4
 dnl Copyright (C) 2008-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -143,7 +143,6 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
   for gl_manywarn_item in \
     -Wattributes \
     -Wcoverage-mismatch \
-    -Wmultichar \
     -Wunused-macros \
     ; do
     gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
diff --git a/gl/m4/warnings.m4 b/gl/m4/warnings.m4
index c14c480..28b8294 100644
--- a/gl/m4/warnings.m4
+++ b/gl/m4/warnings.m4
@@ -1,4 +1,4 @@
-# warnings.m4 serial 6
+# warnings.m4 serial 7
 dnl Copyright (C) 2008-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -15,28 +15,47 @@ m4_ifdef([AS_VAR_APPEND],
 [AS_VAR_SET([$1], [AS_VAR_GET([$1])$2])])])
 
 
-# gl_WARN_ADD(PARAMETER, [VARIABLE = WARN_CFLAGS])
-# ------------------------------------------------
-# Adds parameter to WARN_CFLAGS if the compiler supports it.  For example,
-# gl_WARN_ADD([-Wparentheses]).
+# gl_COMPILER_OPTION_IF(OPTION, [IF-SUPPORTED], [IF-NOT-SUPPORTED],
+#                       [PROGRAM = AC_LANG_PROGRAM()])
+# -----------------------------------------------------------------
+# Check if the compiler supports OPTION when compiling PROGRAM.
 #
-# If VARIABLE is a variable name, AC_SUBST it.
-AC_DEFUN([gl_WARN_ADD],
-dnl FIXME: gl_Warn must be used unquoted until we can assume
-dnl autoconf 2.64 or newer.
+# FIXME: gl_Warn must be used unquoted until we can assume Autoconf
+# 2.64 or newer.
+AC_DEFUN([gl_COMPILER_OPTION_IF],
 [AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_[]_AC_LANG_ABBREV[]_$1])dnl
 AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl
 AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], m4_defn([gl_Warn]), [
   gl_save_compiler_FLAGS="$gl_Flags"
-  gl_Flags="$gl_Flags $1"
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
+  gl_AS_VAR_APPEND(m4_defn([gl_Flags]), [" $1"])
+  AC_COMPILE_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([])])],
                     [AS_VAR_SET(gl_Warn, [yes])],
                     [AS_VAR_SET(gl_Warn, [no])])
   gl_Flags="$gl_save_compiler_FLAGS"
 ])
-AS_VAR_IF(gl_Warn, [yes],
-  [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]), [" $1"])])
+AS_VAR_IF(gl_Warn, [yes], [$2], [$3])
 AS_VAR_POPDEF([gl_Flags])dnl
 AS_VAR_POPDEF([gl_Warn])dnl
-m4_ifval([$2], [AS_LITERAL_IF([$2], [AC_SUBST([$2])], [])])dnl
 ])
+
+
+# gl_WARN_ADD(OPTION, [VARIABLE = WARN_CFLAGS],
+#             [PROGRAM = AC_LANG_PROGRAM()])
+# ---------------------------------------------
+# Adds parameter to WARN_CFLAGS if the compiler supports it when
+# compiling PROGRAM.  For example, gl_WARN_ADD([-Wparentheses]).
+#
+# If VARIABLE is a variable name, AC_SUBST it.
+AC_DEFUN([gl_WARN_ADD],
+[gl_COMPILER_OPTION_IF([$1],
+  [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]), [" $1"])],
+  [],
+  [$3])
+m4_ifval([$2],
+         [AS_LITERAL_IF([$2], [AC_SUBST([$2])])],
+         [AC_SUBST([WARN_CFLAGS])])dnl
+])
+
+# Local Variables:
+# mode: autoconf
+# End:
diff --git a/lib/gl/m4/extensions.m4 b/lib/gl/m4/extensions.m4
index 0bfaef6..6d17d8a 100644
--- a/lib/gl/m4/extensions.m4
+++ b/lib/gl/m4/extensions.m4
@@ -1,4 +1,4 @@
-# serial 11  -*- Autoconf -*-
+# serial 12  -*- Autoconf -*-
 # Enable extensions on systems that normally disable them.
 
 # Copyright (C) 2003, 2006-2012 Free Software Foundation, Inc.
@@ -67,7 +67,7 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
 #endif
-/* Enable general extensions on MacOS X.  */
+/* Enable general extensions on Mac OS X.  */
 #ifndef _DARWIN_C_SOURCE
 # undef _DARWIN_C_SOURCE
 #endif
diff --git a/lib/gl/m4/gnulib-cache.m4 b/lib/gl/m4/gnulib-cache.m4
index 21ae656..162db60 100644
--- a/lib/gl/m4/gnulib-cache.m4
+++ b/lib/gl/m4/gnulib-cache.m4
@@ -47,5 +47,5 @@ gl_MAKEFILE_NAME([])
 gl_LIBTOOL
 gl_MACRO_PREFIX([libgl])
 gl_PO_DOMAIN([])
-gl_WITNESS_C_DOMAIN([])
+gl_WITNESS_C_MACRO([])
 gl_VC_FILES([false])
diff --git a/lib/gl/m4/gnulib-common.m4 b/lib/gl/m4/gnulib-common.m4
index ae4d254..15d2b2b 100644
--- a/lib/gl/m4/gnulib-common.m4
+++ b/lib/gl/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 32
+# gnulib-common.m4 serial 33
 dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,8 @@ AC_DEFUN([gl_COMMON], [
 AC_DEFUN([gl_COMMON_BODY], [
   AH_VERBATIM([_Noreturn],
 [/* The _Noreturn keyword of C11.  */
-#ifndef _Noreturn
+#if ! (defined _Noreturn \
+       || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
 # if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
       || 0x5110 <= __SUNPRO_C)
 #  define _Noreturn __attribute__ ((__noreturn__))
@@ -29,7 +30,7 @@ AC_DEFUN([gl_COMMON_BODY], [
 [/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
    the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
    earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
-   __APPLE__ && __MACH__ test for MacOS X.
+   __APPLE__ && __MACH__ test for Mac OS X.
    __APPLE_CC__ tests for the Apple compiler and its version.
    __STDC_VERSION__ tests for the C99 mode.  */
 #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined 
__cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
diff --git a/lib/gl/override/lib/gettext.h.diff 
b/lib/gl/override/lib/gettext.h.diff
index 881a5f3..d4c27c8 100644
--- a/lib/gl/override/lib/gettext.h.diff
+++ b/lib/gl/override/lib/gettext.h.diff
@@ -1,182 +1,179 @@
---- gl/gettext.h.orig  2011-11-21 14:07:26.773777267 +0100
-+++ gl/gettext.h       2011-11-21 14:07:38.953333088 +0100
-@@ -108,179 +108,4 @@
-    initializer for static 'char[]' or 'const char[]' variables.  */
- #define gettext_noop(String) String
- 
--/* The separator between msgctxt and msgid in a .mo file.  */
--#define GETTEXT_CONTEXT_GLUE "\004"
--
--/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a
--   MSGID.  MSGCTXT and MSGID must be string literals.  MSGCTXT should be
--   short and rarely need to change.
--   The letter 'p' stands for 'particular' or 'special'.  */
--#ifdef DEFAULT_TEXT_DOMAIN
--# define pgettext(Msgctxt, Msgid) \
--   pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, 
Msgid, LC_MESSAGES)
--#else
--# define pgettext(Msgctxt, Msgid) \
--   pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
--#endif
--#define dpgettext(Domainname, Msgctxt, Msgid) \
--  pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
LC_MESSAGES)
--#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \
--  pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
Category)
--#ifdef DEFAULT_TEXT_DOMAIN
--# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
--   npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, 
Msgid, MsgidPlural, N, LC_MESSAGES)
--#else
--# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
--   npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, LC_MESSAGES)
--#endif
--#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
--  npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, LC_MESSAGES)
--#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \
--  npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, Category)
--
--#ifdef __GNUC__
--__inline
--#else
--#ifdef __cplusplus
--inline
--#endif
--#endif
--static const char *
--pgettext_aux (const char *domain,
--              const char *msg_ctxt_id, const char *msgid,
--              int category)
--{
--  const char *translation = dcgettext (domain, msg_ctxt_id, category);
--  if (translation == msg_ctxt_id)
--    return msgid;
--  else
--    return translation;
--}
--
--#ifdef __GNUC__
--__inline
--#else
--#ifdef __cplusplus
--inline
--#endif
--#endif
--static const char *
--npgettext_aux (const char *domain,
--               const char *msg_ctxt_id, const char *msgid,
--               const char *msgid_plural, unsigned long int n,
--               int category)
--{
--  const char *translation =
--    dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
--  if (translation == msg_ctxt_id || translation == msgid_plural)
--    return (n == 1 ? msgid : msgid_plural);
--  else
--    return translation;
--}
--
--/* The same thing extended for non-constant arguments.  Here MSGCTXT and MSGID
--   can be arbitrary expressions.  But for string literals these macros are
--   less efficient than those above.  */
--
--#include <string.h>
--
--#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \
--  (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
--   /* || __STDC_VERSION__ >= 199901L */ )
--
--#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
--#include <stdlib.h>
--#endif
--
--#define pgettext_expr(Msgctxt, Msgid) \
--  dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES)
--#define dpgettext_expr(Domainname, Msgctxt, Msgid) \
--  dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES)
--
--#ifdef __GNUC__
--__inline
--#else
--#ifdef __cplusplus
--inline
--#endif
--#endif
--static const char *
--dcpgettext_expr (const char *domain,
--                 const char *msgctxt, const char *msgid,
--                 int category)
--{
--  size_t msgctxt_len = strlen (msgctxt) + 1;
--  size_t msgid_len = strlen (msgid) + 1;
--  const char *translation;
--#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
--  char msg_ctxt_id[msgctxt_len + msgid_len];
--#else
--  char buf[1024];
--  char *msg_ctxt_id =
--    (msgctxt_len + msgid_len <= sizeof (buf)
--     ? buf
--     : (char *) malloc (msgctxt_len + msgid_len));
--  if (msg_ctxt_id != NULL)
--#endif
--    {
--      memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
--      msg_ctxt_id[msgctxt_len - 1] = '\004';
--      memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
--      translation = dcgettext (domain, msg_ctxt_id, category);
--#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
--      if (msg_ctxt_id != buf)
--        free (msg_ctxt_id);
--#endif
--      if (translation != msg_ctxt_id)
--        return translation;
--    }
--  return msgid;
--}
--
--#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \
--  dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
--#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
--  dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
--
--#ifdef __GNUC__
--__inline
--#else
--#ifdef __cplusplus
--inline
--#endif
--#endif
--static const char *
--dcnpgettext_expr (const char *domain,
--                  const char *msgctxt, const char *msgid,
--                  const char *msgid_plural, unsigned long int n,
--                  int category)
--{
--  size_t msgctxt_len = strlen (msgctxt) + 1;
--  size_t msgid_len = strlen (msgid) + 1;
--  const char *translation;
--#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
--  char msg_ctxt_id[msgctxt_len + msgid_len];
--#else
--  char buf[1024];
--  char *msg_ctxt_id =
--    (msgctxt_len + msgid_len <= sizeof (buf)
--     ? buf
--     : (char *) malloc (msgctxt_len + msgid_len));
--  if (msg_ctxt_id != NULL)
--#endif
--    {
--      memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
--      msg_ctxt_id[msgctxt_len - 1] = '\004';
--      memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
--      translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, 
category);
--#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
--      if (msg_ctxt_id != buf)
--        free (msg_ctxt_id);
--#endif
--      if (!(translation == msg_ctxt_id || translation == msgid_plural))
--        return translation;
--    }
--  return (n == 1 ? msgid : msgid_plural);
--}
--
- #endif /* _LIBGETTEXT_H */
+110,287d109
+< /* The separator between msgctxt and msgid in a .mo file.  */
+< #define GETTEXT_CONTEXT_GLUE "\004"
+< 
+< /* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a
+<    MSGID.  MSGCTXT and MSGID must be string literals.  MSGCTXT should be
+<    short and rarely need to change.
+<    The letter 'p' stands for 'particular' or 'special'.  */
+< #ifdef DEFAULT_TEXT_DOMAIN
+< # define pgettext(Msgctxt, Msgid) \
+<    pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, 
Msgid, LC_MESSAGES)
+< #else
+< # define pgettext(Msgctxt, Msgid) \
+<    pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
LC_MESSAGES)
+< #endif
+< #define dpgettext(Domainname, Msgctxt, Msgid) \
+<   pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
LC_MESSAGES)
+< #define dcpgettext(Domainname, Msgctxt, Msgid, Category) \
+<   pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
Category)
+< #ifdef DEFAULT_TEXT_DOMAIN
+< # define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
+<    npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, 
Msgid, MsgidPlural, N, LC_MESSAGES)
+< #else
+< # define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
+<    npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, LC_MESSAGES)
+< #endif
+< #define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
+<   npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, LC_MESSAGES)
+< #define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \
+<   npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, Category)
+< 
+< #ifdef __GNUC__
+< __inline
+< #else
+< #ifdef __cplusplus
+< inline
+< #endif
+< #endif
+< static const char *
+< pgettext_aux (const char *domain,
+<               const char *msg_ctxt_id, const char *msgid,
+<               int category)
+< {
+<   const char *translation = dcgettext (domain, msg_ctxt_id, category);
+<   if (translation == msg_ctxt_id)
+<     return msgid;
+<   else
+<     return translation;
+< }
+< 
+< #ifdef __GNUC__
+< __inline
+< #else
+< #ifdef __cplusplus
+< inline
+< #endif
+< #endif
+< static const char *
+< npgettext_aux (const char *domain,
+<                const char *msg_ctxt_id, const char *msgid,
+<                const char *msgid_plural, unsigned long int n,
+<                int category)
+< {
+<   const char *translation =
+<     dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
+<   if (translation == msg_ctxt_id || translation == msgid_plural)
+<     return (n == 1 ? msgid : msgid_plural);
+<   else
+<     return translation;
+< }
+< 
+< /* The same thing extended for non-constant arguments.  Here MSGCTXT and 
MSGID
+<    can be arbitrary expressions.  But for string literals these macros are
+<    less efficient than those above.  */
+< 
+< #include <string.h>
+< 
+< #if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
+<      /* || __STDC_VERSION__ >= 199901L */ )
+< # define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1
+< #else
+< # define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0
+< #endif
+< 
+< #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+< #include <stdlib.h>
+< #endif
+< 
+< #define pgettext_expr(Msgctxt, Msgid) \
+<   dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES)
+< #define dpgettext_expr(Domainname, Msgctxt, Msgid) \
+<   dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES)
+< 
+< #ifdef __GNUC__
+< __inline
+< #else
+< #ifdef __cplusplus
+< inline
+< #endif
+< #endif
+< static const char *
+< dcpgettext_expr (const char *domain,
+<                  const char *msgctxt, const char *msgid,
+<                  int category)
+< {
+<   size_t msgctxt_len = strlen (msgctxt) + 1;
+<   size_t msgid_len = strlen (msgid) + 1;
+<   const char *translation;
+< #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+<   char msg_ctxt_id[msgctxt_len + msgid_len];
+< #else
+<   char buf[1024];
+<   char *msg_ctxt_id =
+<     (msgctxt_len + msgid_len <= sizeof (buf)
+<      ? buf
+<      : (char *) malloc (msgctxt_len + msgid_len));
+<   if (msg_ctxt_id != NULL)
+< #endif
+<     {
+<       memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
+<       msg_ctxt_id[msgctxt_len - 1] = '\004';
+<       memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
+<       translation = dcgettext (domain, msg_ctxt_id, category);
+< #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+<       if (msg_ctxt_id != buf)
+<         free (msg_ctxt_id);
+< #endif
+<       if (translation != msg_ctxt_id)
+<         return translation;
+<     }
+<   return msgid;
+< }
+< 
+< #define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \
+<   dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
+< #define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
+<   dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
+< 
+< #ifdef __GNUC__
+< __inline
+< #else
+< #ifdef __cplusplus
+< inline
+< #endif
+< #endif
+< static const char *
+< dcnpgettext_expr (const char *domain,
+<                   const char *msgctxt, const char *msgid,
+<                   const char *msgid_plural, unsigned long int n,
+<                   int category)
+< {
+<   size_t msgctxt_len = strlen (msgctxt) + 1;
+<   size_t msgid_len = strlen (msgid) + 1;
+<   const char *translation;
+< #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+<   char msg_ctxt_id[msgctxt_len + msgid_len];
+< #else
+<   char buf[1024];
+<   char *msg_ctxt_id =
+<     (msgctxt_len + msgid_len <= sizeof (buf)
+<      ? buf
+<      : (char *) malloc (msgctxt_len + msgid_len));
+<   if (msg_ctxt_id != NULL)
+< #endif
+<     {
+<       memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
+<       msg_ctxt_id[msgctxt_len - 1] = '\004';
+<       memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
+<       translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, 
category);
+< #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+<       if (msg_ctxt_id != buf)
+<         free (msg_ctxt_id);
+< #endif
+<       if (!(translation == msg_ctxt_id || translation == msgid_plural))
+<         return translation;
+<     }
+<   return (n == 1 ? msgid : msgid_plural);
+< }
+< 
diff --git a/lib/krb5/context.c b/lib/krb5/context.c
index 3bbf480..400a60a 100644
--- a/lib/krb5/context.c
+++ b/lib/krb5/context.c
@@ -213,6 +213,11 @@ gss_krb5_init_sec_context (OM_uint32 * minor_status,
       return GSS_S_NO_CRED;
     }
 
+  if (target_name == NULL)
+    {
+      return GSS_S_BAD_NAME;
+    }
+
   if (k5 == NULL)
     {
       k5 = ctx->krb5 = calloc (sizeof (*k5), 1);
diff --git a/lib/krb5/cred.c b/lib/krb5/cred.c
index 343ca15..f958507 100644
--- a/lib/krb5/cred.c
+++ b/lib/krb5/cred.c
@@ -51,11 +51,12 @@ acquire_cred1 (OM_uint32 * minor_status,
   if (GSS_ERROR (maj_stat))
     return maj_stat;
 
-  if (desired_name == GSS_C_NO_NAME)
+  if (k5->peerptr == GSS_C_NO_NAME)
     {
       maj_stat = gss_release_name (minor_status, &name);
       if (GSS_ERROR (maj_stat))
        return maj_stat;
+      return GSS_S_BAD_NAME;
     }
 
   if (shishi_init_server (&k5->sh) != SHISHI_OK)
diff --git a/maint.mk b/maint.mk
index 2228a37..a2b0b8d 100644
--- a/maint.mk
+++ b/maint.mk
@@ -61,7 +61,7 @@ endif
 # (i.e., with no $(srcdir) prefix), this definition is careful to
 # remove any $(srcdir) prefix, and to restore what it removes.
 _sc_excl = \
-  $(if $(exclude_file_name_regexp--$@),$(exclude_file_name_regexp--$@),^$$)
+  $(or $(exclude_file_name_regexp--$@),^$$)
 VC_LIST_EXCEPT = \
   $(VC_LIST) | sed 's|^$(_dot_escaped_srcdir)/||' \
        | if test -f $(srcdir)/.x-$@; then grep -vEf $(srcdir)/.x-$@; \
@@ -187,9 +187,11 @@ syntax-check: $(local-check)
 #
 #  in_vc_files | in_files
 #
-#     grep-E-style regexp denoting the files to check.  If no files
-#     are specified the default are all the files that are under
-#     version control.
+#     grep-E-style regexp selecting the files to check.  For in_vc_files,
+#     the regexp is used to select matching files from the list of all
+#     version-controlled files; for in_files, it's from the names printed
+#     by "find $(srcdir)".  When neither is specified, use all files that
+#     are under version control.
 #
 #  containing | non_containing
 #
@@ -261,7 +263,7 @@ define _sc_search_regexp
    : Filter by file name;                                              \
    if test -n "$$in_files"; then                                       \
      files=$$(find $(srcdir) | grep -E "$$in_files"                    \
-              | grep -Ev '$(exclude_file_name_regexp--$@)');           \
+              | grep -Ev '$(_sc_excl)');                               \
    else                                                                        
\
      files=$$($(VC_LIST_EXCEPT));                                      \
      if test -n "$$in_vc_files"; then                                  \
@@ -332,6 +334,14 @@ sc_prohibit_strcmp:
        halt='$(ME): replace strcmp calls above with STREQ/STRNEQ'      \
          $(_sc_search_regexp)
 
+# Really.  You don't want to use this function.
+# It may fail to NUL-terminate the destination,
+# and always NUL-pads out to the specified length.
+sc_prohibit_strncpy:
+       @prohibit='\<strncpy *\('                                       \
+       halt='do not use strncpy, period'                               \
+         $(_sc_search_regexp)
+
 # Pass EXIT_*, not number, to usage, exit, and error (when exiting)
 # Convert all uses automatically, via these two commands:
 # git grep -l '\<exit *(1)' \
@@ -343,8 +353,9 @@ sc_prohibit_strcmp:
 #  | xargs --no-run-if-empty \
 #      perl -pi -e 's/(^|[^.])\b(exit ?)\(0\)/$1$2(EXIT_SUCCESS)/'
 sc_prohibit_magic_number_exit:
-       @prohibit='(^|[^.])\<(usage|exit) ?\([0-9]|\<error ?\([1-9][0-9]*,'     
\
-       halt='use EXIT_* values rather than magic number'                       
\
+       @prohibit='(^|[^.])\<(usage|exit|error) ?\(-?[0-9]+[,)]'        \
+       exclude='error ?\((0,|[^,]*)'                                   \
+       halt='use EXIT_* values rather than magic number'               \
          $(_sc_search_regexp)
 
 # Using EXIT_SUCCESS as the first argument to error is misleading,
@@ -767,6 +778,11 @@ sc_prohibit_always_true_header_tests:
        '  with the corresponding gnulib module, they are always true') \
          $(_sc_search_regexp)
 
+sc_prohibit_defined_have_decl_tests:
+       @prohibit='#[    ]*if(n?def|.*\<defined)\>[      (]+HAVE_DECL_' \
+       halt='$(ME): HAVE_DECL macros are always defined'               \
+         $(_sc_search_regexp)
+
 # ==================================================================
 gl_other_headers_ ?= \
   intprops.h   \
@@ -932,8 +948,15 @@ sc_prohibit_doubled_word:
 # A regular expression matching undesirable combinations of words like
 # "can not"; this matches them even when the two words appear on different
 # lines, but not when there is an intervening delimiter like "#" or "*".
+# Similarly undesirable, "See @xref{...}", since an @xref should start
+# a sentence.  Explicitly prohibit any prefix of "see" or "also".
+# Also prohibit a prefix matching "\w+ +".
+# @pxref gets the same see/also treatment and should be parenthesized;
+# presume it must *not* start a sentence.
+bad_xref_re_ ?= (?:[\w,:;] +|(?:see|also)\s+)address@hidden
+bad_pxref_re_ ?= (?:[.!?]|(?:see|also))address@hidden
 prohibit_undesirable_word_seq_RE_ ?=                                   \
-  /\bcan\s+not\b/gims
+  /(?:\bcan\s+not\b|$(bad_xref_re_)|$(bad_pxref_re_))/gims
 prohibit_undesirable_word_seq_ =                                       \
     -e 'while ($(prohibit_undesirable_word_seq_RE_))'                  \
     $(perl_filename_lineno_text_)
@@ -1044,7 +1067,7 @@ sc_makefile_at_at_check:
          && { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || :
 
 news-check: NEWS
-       if sed -n $(news-check-lines-spec)p $(srcdir)/NEWS              \
+       $(AM_V_GEN)if sed -n $(news-check-lines-spec)p $<               \
            | grep -E $(news-check-regexp) >/dev/null; then             \
          :;                                                            \
        else                                                            \
@@ -1199,16 +1222,25 @@ sc_prohibit_path_max_allocation:
 
 sc_vulnerable_makefile_CVE-2009-4029:
        @prohibit='perm -777 -exec chmod a\+rwx|chmod 777 \$$\(distdir\)' \
-       in_files=$$(find $(srcdir) -name Makefile.in)                   \
+       in_files='(^|/)Makefile\.in$$'                                  \
        halt=$$(printf '%s\n'                                           \
          'the above files are vulnerable; beware of running'           \
          '  "make dist*" rules, and upgrade to fixed automake'         \
          '  see http://bugzilla.redhat.com/542609 for details')        \
          $(_sc_search_regexp)
 
+sc_vulnerable_makefile_CVE-2012-3386:
+       @prohibit='chmod a\+w \$$\(distdir\)'                           \
+       in_files='(^|/)Makefile\.in$$'                                  \
+       halt=$$(printf '%s\n'                                           \
+         'the above files are vulnerable; beware of running'           \
+         '  "make distcheck", and upgrade to fixed automake'           \
+         '  see http://bugzilla.redhat.com/CVE-2012-3386 for details') \
+         $(_sc_search_regexp)
+
 vc-diff-check:
-       (unset CDPATH; cd $(srcdir) && $(VC) diff) > vc-diffs || :
-       if test -s vc-diffs; then                               \
+       $(AM_V_GEN)(unset CDPATH; cd $(srcdir) && $(VC) diff) > vc-diffs || :
+       $(AM_V_at)if test -s vc-diffs; then                     \
          cat vc-diffs;                                         \
          echo "Some files are locally modified:" 1>&2;         \
          exit 1;                                               \
@@ -1224,10 +1256,11 @@ bootstrap-tools ?= autoconf,automake,gnulib
 
 # If it's not already specified, derive the GPG key ID from
 # the signed tag we've just applied to mark this release.
-gpg_key_ID ?= \
-  $$(git cat-file tag v$(VERSION) \
-     | gpgv --status-fd 1 --keyring /dev/null - - 2>/dev/null \
-     | sed -n '/^\[GNUPG:\] ERRSIG /{s///;s/ .*//p;q}')
+gpg_key_ID ?=                                                          \
+  $$(cd $(srcdir)                                                      \
+     && git cat-file tag v$(VERSION)                                   \
+        | gpgv --status-fd 1 --keyring /dev/null - - 2>/dev/null       \
+        | awk '/^\[GNUPG:\] ERRSIG / {print $$3; exit}')
 
 translation_project_ ?= address@hidden
 
@@ -1246,13 +1279,14 @@ else
 endif
 
 announcement: NEWS ChangeLog $(rel-files)
-       @$(srcdir)/$(_build-aux)/announce-gen                           \
+       $(AM_V_GEN)$(srcdir)/$(_build-aux)/announce-gen                 \
            --mail-headers='$(announcement_mail_headers_)'              \
            --release-type=$(RELEASE_TYPE)                              \
            --package=$(PACKAGE)                                        \
            --prev=$(PREV_VERSION)                                      \
            --curr=$(VERSION)                                           \
            --gpg-key-id=$(gpg_key_ID)                                  \
+           --srcdir=$(srcdir)                                          \
            --news=$(srcdir)/NEWS                                       \
            --bootstrap-tools=$(bootstrap-tools)                        \
            $$(case ,$(bootstrap-tools), in (*,gnulib,*)                \
@@ -1260,6 +1294,12 @@ announcement: NEWS ChangeLog $(rel-files)
            --no-print-checksums                                        \
            $(addprefix --url-dir=, $(url_dir_list))
 
+.PHONY: release-commit
+release-commit:
+       $(AM_V_GEN)cd $(srcdir)                         \
+         && $(_build-aux)/do-release-commit-and-tag    \
+              -C $(abs_builddir) $(RELEASE)
+
 ## ---------------- ##
 ## Updating files.  ##
 ## ---------------- ##
@@ -1287,7 +1327,7 @@ endef
 
 .PHONY: no-submodule-changes
 no-submodule-changes:
-       if test -d $(srcdir)/.git; then                                 \
+       $(AM_V_GEN)if test -d $(srcdir)/.git; then                      \
          diff=$$(cd $(srcdir) && git submodule -q foreach              \
                  git diff-index --name-only HEAD)                      \
            || exit 1;                                                  \
@@ -1326,16 +1366,16 @@ check: $(gl_public_submodule_commit)
 .PHONY: alpha beta stable
 ALL_RECURSIVE_TARGETS += alpha beta stable
 alpha beta stable: $(local-check) writable-files $(submodule-checks)
-       test $@ = stable                                                \
+       $(AM_V_GEN)test $@ = stable                                     \
          && { echo $(VERSION) | grep -E '^[0-9]+(\.[0-9]+)+$$'         \
               || { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\
          || :
-       $(MAKE) vc-diff-check
-       $(MAKE) news-check
-       $(MAKE) distcheck
-       $(MAKE) dist
-       $(MAKE) $(release-prep-hook) RELEASE_TYPE=$@
-       $(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
+       $(AM_V_at)$(MAKE) vc-diff-check
+       $(AM_V_at)$(MAKE) news-check
+       $(AM_V_at)$(MAKE) distcheck
+       $(AM_V_at)$(MAKE) dist
+       $(AM_V_at)$(MAKE) $(release-prep-hook) RELEASE_TYPE=$@
+       $(AM_V_at)$(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
 
 # Override this in cfg.mk if you follow different procedures.
 release-prep-hook ?= release-prep
@@ -1343,19 +1383,21 @@ release-prep-hook ?= release-prep
 gl_noteworthy_news_ = * Noteworthy changes in release ?.? (????-??-??) [?]
 .PHONY: release-prep
 release-prep:
-       case $$RELEASE_TYPE in alpha|beta|stable) ;; \
+       $(AM_V_GEN)case $$RELEASE_TYPE in alpha|beta|stable) ;; \
          *) echo "invalid RELEASE_TYPE: $$RELEASE_TYPE" 1>&2; exit 1;; esac
-       $(MAKE) --no-print-directory -s announcement > ~/announce-$(my_distdir)
-       if test -d $(release_archive_dir); then                 \
+       $(AM_V_at)$(MAKE) --no-print-directory -s announcement \
+         > ~/announce-$(my_distdir)
+       $(AM_V_at)if test -d $(release_archive_dir); then       \
          ln $(rel-files) $(release_archive_dir);               \
          chmod a-w $(rel-files);                               \
        fi
-       echo $(VERSION) > $(prev_version_file)
-       $(MAKE) update-NEWS-hash
-       perl -pi -e '$$. == 3 and print "$(gl_noteworthy_news_)\n\n\n"' NEWS
-       $(emit-commit-log) > .ci-msg
-       $(VC) commit -F .ci-msg -a
-       rm .ci-msg
+       $(AM_V_at)echo $(VERSION) > $(prev_version_file)
+       $(AM_V_at)$(MAKE) update-NEWS-hash
+       $(AM_V_at)perl -pi                                              \
+         -e '$$. == 3 and print "$(gl_noteworthy_news_)\n\n\n"'        \
+         $(srcdir)/NEWS
+       $(AM_V_at)msg=$$($(emit-commit-log)) || exit 1;         \
+       cd $(srcdir) && $(VC) commit -m "$$msg" -a
 
 # Override this with e.g., -s $(srcdir)/some_other_name.texi
 # if the default $(PACKAGE)-derived name doesn't apply.
@@ -1363,14 +1405,20 @@ gendocs_options_ ?=
 
 .PHONY: web-manual
 web-manual:
-       @test -z "$(manual_title)" \
+       $(AM_V_GEN)test -z "$(manual_title)" \
          && { echo define manual_title in cfg.mk 1>&2; exit 1; } || :
-       @cd '$(srcdir)/doc'; \
+       $(AM_V_at)cd '$(srcdir)/doc'; \
          $(SHELL) ../$(_build-aux)/gendocs.sh $(gendocs_options_) \
             -o '$(abs_builddir)/doc/manual' \
             --email $(PACKAGE_BUGREPORT) $(PACKAGE) \
            "$(PACKAGE_NAME) - $(manual_title)"
-       @echo " *** Upload the doc/manual directory to web-cvs."
+       $(AM_V_at)echo " *** Upload the doc/manual directory to web-cvs."
+
+.PHONY: web-manual-update
+web-manual-update:
+       $(AM_V_GEN)cd $(srcdir) \
+         && $(_build-aux)/gnu-web-doc-update -C $(abs_builddir)
+
 
 # Code Coverage
 
@@ -1396,6 +1444,31 @@ gen-coverage:
 
 coverage: init-coverage build-coverage gen-coverage
 
+# Some projects carry local adjustments for gnulib modules via patches in
+# a gnulib patch directory whose default name is gl/ (defined in bootstrap
+# via local_gl_dir=gl).  Those patches become stale as the originals evolve
+# in gnulib.  Use this rule to refresh any stale patches.  It applies each
+# patch to the original in $(gnulib_dir) and uses the temporary result to
+# generate a fuzz-free .diff file.  If you customize the name of your local
+# gnulib patch directory via bootstrap.conf, this rule detects that name.
+# Run this from a non-VPATH (i.e., srcdir) build directory.
+.PHONY: refresh-gnulib-patches
+refresh-gnulib-patches:
+       gl=gl;                                                          \
+       if test -f bootstrap.conf; then                                 \
+         t=$$(perl -lne '/^\s*local_gl_dir=(\S+)/ and $$d=$$1;'        \
+              -e 'END{defined $$d and print $$d}' bootstrap.conf);     \
+         test -n "$$t" && gl=$$t;                                      \
+       fi;                                                             \
+       for diff in $$(cd $$gl; git ls-files | grep '\.diff$$'); do     \
+         b=$$(printf %s "$$diff"|sed 's/\.diff$$//');                  \
+         VERSION_CONTROL=none                                          \
+           patch "$(gnulib_dir)/$$b" "$$gl/$$diff" || exit 1;          \
+         ( cd $(gnulib_dir) || exit 1;                                 \
+           git diff "$$b" > "../$$gl/$$diff";                          \
+           git checkout $$b ) || exit 1;                               \
+       done
+
 # Update gettext files.
 PACKAGE ?= $(shell basename $(PWD))
 PO_DOMAIN ?= $(PACKAGE)
@@ -1407,7 +1480,7 @@ refresh-po:
        wget --no-verbose --directory-prefix $(PODIR) --no-directories 
--recursive --level 1 --accept .po --accept .po.1 $(POURL) && \
        echo 'address@hidden' > $(PODIR)/LINGUAS && \
        echo 'address@hidden' >> $(PODIR)/LINGUAS && \
-       ls $(PODIR)/*.po | sed 's/\.po//' | sed 's,$(PODIR)/,,' | sort >> 
$(PODIR)/LINGUAS
+       ls $(PODIR)/*.po | sed 's/\.po//;s,$(PODIR)/,,' | sort >> 
$(PODIR)/LINGUAS
 
  # Running indent once is not idempotent, but running it twice is.
 INDENT_SOURCES ?= $(C_SOURCES)
@@ -1429,7 +1502,7 @@ update-copyright-env ?=
 # in the file .x-update-copyright.
 .PHONY: update-copyright
 update-copyright:
-       grep -l -w Copyright                                             \
+       $(AM_V_GEN)grep -l -w Copyright                                  \
          $$(export VC_LIST_EXCEPT_DEFAULT=COPYING && $(VC_LIST_EXCEPT)) \
          | $(update-copyright-env) xargs $(srcdir)/$(_build-aux)/$@
 
diff --git a/po/LINGUAS b/po/LINGUAS
index a9a0a86..664e053 100644
--- a/po/LINGUAS
+++ b/po/LINGUAS
@@ -4,6 +4,7 @@ eo
 fi
 fr
 ga
+hr
 id
 it
 pl
diff --git a/po/pl.po.in b/po/hr.po.in
similarity index 59%
copy from po/pl.po.in
copy to po/hr.po.in
index 50efcda..fa31938 100644
--- a/po/pl.po.in
+++ b/po/hr.po.in
@@ -1,229 +1,232 @@
-# Polish translation for gss.
-# Copyright (C) 2004, 2010 Free Software Foundation, Inc.
+# Translation of gss to Croatian.
+# Copyright (C) 2012 Free Software Foundation, Inc.
 # This file is distributed under the same license as the gss package.
-# Jakub Bogusz <address@hidden>, 2004-2010.
 #
+# Tomislav Krznar <address@hidden>, 2012.
 msgid ""
 msgstr ""
 "Project-Id-Version: gss 1.0.1\n"
 "Report-Msgid-Bugs-To: address@hidden"
 "POT-Creation-Date: 2010-05-20 15:38+0200\n"
-"PO-Revision-Date: 2010-11-16 21:01+0100\n"
-"Last-Translator: Jakub Bogusz <address@hidden>\n"
-"Language-Team: Polish <address@hidden>\n"
+"PO-Revision-Date: 2012-07-31 00:27+0200\n"
+"Last-Translator: Tomislav Krznar <address@hidden>\n"
+"Language-Team: Croatian <address@hidden>\n"
+"Language: hr\n"
 "MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=ISO-8859-2\n"
+"Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && 
n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+"X-Generator: Lokalize 1.4\n"
 
 #: lib/meta.c:37
 msgid "Kerberos V5 GSS-API mechanism"
-msgstr "Mechanizm Kerberos V5 GSS-API"
+msgstr "Kerberos V5 GSS-API mehanizam"
 
 #: lib/error.c:37
 msgid "A required input parameter could not be read"
-msgstr "Wymagany parametr wej¶ciowy nie móg³ byæ odczytany"
+msgstr "Ne mogu čitati potreban ulazni parametar"
 
 #: lib/error.c:39
 msgid "A required output parameter could not be written"
-msgstr "Wymagany parametr wyj¶ciowy nie móg³ byæ zapisany"
+msgstr "Ne mogu pisati potreban izlazni parametar"
 
 #: lib/error.c:41
 msgid "A parameter was malformed"
-msgstr "Parametr by³ ¼le sformu³owany"
+msgstr "Parametar je izobličen"
 
 #: lib/error.c:46
 msgid "An unsupported mechanism was requested"
-msgstr "¯±dano nieobs³ugiwanego mechanizmu"
+msgstr "Tražen je nepodržani mehanizam"
 
 #: lib/error.c:48
 msgid "An invalid name was supplied"
-msgstr "Podano b³êdn± nazwê"
+msgstr "Navedeno je neispravno ime"
 
 #: lib/error.c:50
 msgid "A supplied name was of an unsupported type"
-msgstr "Podana nazwa by³a nieobs³ugiwanego typu"
+msgstr "Vrsta navedenog imena nije podržana"
 
 #: lib/error.c:52
 msgid "Incorrect channel bindings were supplied"
-msgstr "Podano niepoprawne powi±zania kana³u"
+msgstr "Navedene su netočne veze kanala"
 
 #: lib/error.c:54
 msgid "An invalid status code was supplied"
-msgstr "Podano b³êdny kod stanu"
+msgstr "Naveden je neispravan kod stanja"
 
 #: lib/error.c:56
 msgid "A token had an invalid MIC"
-msgstr "Token mia³ b³êdny MIC"
+msgstr "Simbol ima neispravan MIC"
 
 #: lib/error.c:58
 msgid "No credentials were supplied, or the credentials were unavailable or 
inaccessible"
-msgstr "Nie podano danych uwierzytelniaj±cych lub by³y niedostêpne"
+msgstr "Nisu navedene vjerodajnice, nedostupne su ili im nije moguć pristup"
 
 #: lib/error.c:61
 msgid "No context has been established"
-msgstr "Nie ustalono kontekstu"
+msgstr "Nije izgrađen kontekst"
 
 #: lib/error.c:63
 msgid "A token was invalid"
-msgstr "Token by³ b³êdny"
+msgstr "Simbol je neispravan"
 
 #: lib/error.c:65
 msgid "A credential was invalid"
-msgstr "Dane uwierzytelniaj±ce by³y niepoprawne"
+msgstr "Vjerodajnica je neispravna"
 
 #: lib/error.c:67
 msgid "The referenced credentials have expired"
-msgstr "Wskazane dane uwierzytelniaj±ce wygas³y"
+msgstr "Navedene vjerodajnice su istekle"
 
 #: lib/error.c:69
 msgid "The context has expired"
-msgstr "Kontekst wygas³"
+msgstr "Kontekst je istekao"
 
 #: lib/error.c:71
 msgid "Unspecified error in underlying mechanism"
-msgstr "Nieokre¶lony b³±d w podrzêdnym mechanizmie"
+msgstr "Neodređena greška u pozadinskom mehanizmu"
 
 #: lib/error.c:73
 msgid "The quality-of-protection requested could not be provided"
-msgstr "¯±dana jako¶æ zabezpieczenia nie mog³a byæ zapewniona"
+msgstr "Ne može se pružiti tražena kvaliteta zaštite 
(quality-of-protection)"
 
 #: lib/error.c:75
 msgid "The operation is forbidden by local security policy"
-msgstr "Operacja jest zabroniona przez lokaln± politykê bezpieczeñstwa"
+msgstr "Lokalna sigurnosna pravila zabranjuju operaciju"
 
 #: lib/error.c:77
 msgid "The operation or option is unavailable"
-msgstr "Operacja lub opcja jest niedostêpna"
+msgstr "Operacija ili opcija nije dostupna"
 
 #: lib/error.c:79
 msgid "The requested credential element already exists"
-msgstr "¯±dany element danych uwierzytelniaj±cych ju¿ istnieje"
+msgstr "Traženi element vjerodajnice već postoji"
 
 #: lib/error.c:81
 msgid "The provided name was not a mechanism name"
-msgstr "Dostarczona nazwa nie by³a nazw± mechanizmu"
+msgstr "Navedeno ime nije ime mehanizma"
 
 #: lib/error.c:86
 msgid "The gss_init_sec_context() or gss_accept_sec_context() function must be 
called again to complete its function"
-msgstr "Funkcja gss_init_sec_context() lub gss_accept_sec_context() musi byæ 
wywo³ana ponownie aby dokoñczyæ funkcjê"
+msgstr "Potrebno je ponovo pozvati funkciju gss_init_sec_context() ili 
gss_accept_sec_context() za završetak djelovanja"
 
 #: lib/error.c:89
 msgid "The token was a duplicate of an earlier token"
-msgstr "Token by³ duplikatem wcze¶niejszego"
+msgstr "Simbol je duplikat prethodnog simbola"
 
 #: lib/error.c:91
 msgid "The token's validity period has expired"
-msgstr "Okres poprawno¶ci tokenu min±³"
+msgstr "Rok trajanja simbola je istekao"
 
 #: lib/error.c:93
 msgid "A later token has already been processed"
-msgstr "Pó¼niejszy token by³ ju¿ przetworzony"
+msgstr "Noviji simbol je već obrađen"
 
 #: lib/error.c:95
 msgid "An expected per-message token was not received"
-msgstr "Nie otrzymano oczekiwanego tokenu dla komunikatu"
+msgstr "Očekivani simbol poruke nije primljen"
 
 #: lib/error.c:312
 msgid "No error"
-msgstr "Brak b³êdu"
+msgstr "Nema greške"
 
 #: lib/krb5/error.c:36
 msgid "No @ in SERVICE-NAME name string"
-msgstr "Brak @ w ³añcuchu nazwy SERVICE-NAME"
+msgstr "Nedostaje @ u nizu SERVICE-NAME"
 
 #: lib/krb5/error.c:38
 msgid "STRING-UID-NAME contains nondigits"
-msgstr "STRING-UID-NAME zawiera znaki nie bêd±ce cyframi"
+msgstr "STRING-UID-NAME sadrži znakove koji nisu znamenke"
 
 #: lib/krb5/error.c:40
 msgid "UID does not resolve to username"
-msgstr "UID nie rozwi±zuje siê na nazwê u¿ytkownika"
+msgstr "UID se ne može povezati s korisničkim imenom"
 
 #: lib/krb5/error.c:42
 msgid "Validation error"
-msgstr "B³±d kontroli poprawno¶ci"
+msgstr "Greška provjere valjanosti"
 
 #: lib/krb5/error.c:44
 msgid "Couldn't allocate gss_buffer_t data"
-msgstr "Nie mo¿na przydzieliæ danych gss_buffer_t"
+msgstr "Ne mogu alocirati gss_buffer_t podatke"
 
 #: lib/krb5/error.c:46
 msgid "Message context invalid"
-msgstr "B³êdny kontekst komunikatu"
+msgstr "Kontekst poruke neispravan"
 
 #: lib/krb5/error.c:48
 msgid "Buffer is the wrong size"
-msgstr "Z³y rozmiar bufora"
+msgstr "Međuspremnik ima neispravnu veličinu"
 
 #: lib/krb5/error.c:50
 msgid "Credential usage type is unknown"
-msgstr "Nieznany sposób u¿ycia danych uwierzytelniaj±cych"
+msgstr "Vrsta korištenja vjerodajnice je nepoznata"
 
 #: lib/krb5/error.c:52
 msgid "Unknown quality of protection specified"
-msgstr "Podano nieznan± jako¶ zabezpieczenia"
+msgstr "Navedena je nepoznata kvaliteta zaštite"
 
 #: lib/krb5/error.c:55
 msgid "Principal in credential cache does not match desired name"
-msgstr "Zarz±dca w buforze danych uwierzytelniaj±cych nie pasuje do ¿±danej 
nazwy"
+msgstr "Upravitelj u spremniku vjerodajnica ne odgovara željenom imenu"
 
 #: lib/krb5/error.c:57
 msgid "No principal in keytab matches desired name"
-msgstr "¯aden zarz±dca w keytab nie pasuje do ¿±danej nazwy"
+msgstr "Nijedan upravitelj u tablici ključeva ne odgovara željenom imenu"
 
 #: lib/krb5/error.c:59
 msgid "Credential cache has no TGT"
-msgstr "Bufor danych uwierzytelniaj±cych nie zawiera TGT"
+msgstr "Spremnik vjerodajnica nema TGT"
 
 #: lib/krb5/error.c:61
 msgid "Authenticator has no subkey"
-msgstr "Authenticator nie ma pola subkey"
+msgstr "Ovjeritelj nema podključ"
 
 #: lib/krb5/error.c:63
 msgid "Context is already fully established"
-msgstr "Kontekst ju¿ zosta³ w pe³ni ustalony"
+msgstr "Kontekst je već u potpunosti izgrađen"
 
 #: lib/krb5/error.c:65
 msgid "Unknown signature type in token"
-msgstr "Nieznany rodzaj sygnatury w tokenie"
+msgstr "Nepoznata vrsta potpisa u simbolu"
 
 #: lib/krb5/error.c:67
 msgid "Invalid field length in token"
-msgstr "B³êdna d³ugo¶æ pola w tokenie"
+msgstr "Neispravna duljina polja u simbolu"
 
 #: lib/krb5/error.c:69
 msgid "Attempt to use incomplete security context"
-msgstr "Próba u¿ycia niepe³nego kontekstu bezpieczeñstwa"
+msgstr "Pokušaj korištenja nepotpunog sigurnosnog konteksta"
 
 #: lib/krb5/error.c:86
 msgid "No krb5 error"
-msgstr "Brak b³êdu krb5"
+msgstr "Nema krb5 greške"
 
 #: lib/krb5/error.c:127
 msgid "Unknown krb5 error"
-msgstr "Nieznany b³±d krb5"
+msgstr "Nepoznata krb5 greška"
 
 #: src/gss.c:65
 #, c-format
 msgid "Try `%s --help' for more information.\n"
-msgstr "`%s --help' poda wiêcej informacji.\n"
+msgstr "Pokušajte „%s --help” za više informacija.\n"
 
 #: src/gss.c:69
 #, c-format
 msgid "Usage: %s OPTIONS...\n"
-msgstr "Sk³adnia: %s OPCJE...\n"
+msgstr "Uporaba: %s OPCIJE...\n"
 
 #: src/gss.c:72
 msgid ""
 "Command line interface to GSS, used to explain error codes.\n"
 "\n"
 msgstr ""
-"Interfejs linii poleceñ do GSS s³u¿±cy do wyja¶niania kodów b³êdów.\n"
+"Sučelje naredbenog retka prema GSS-u, korišteno za pojašnjavanje kodova 
grešaka.\n"
 "\n"
 
 #: src/gss.c:76
 msgid "Mandatory arguments to long options are mandatory for short options 
too.\n"
-msgstr "Argumenty obowi±zkowe dla opcji d³ugich s± obowi±zkowe tak¿e dla opcji 
krótkich.\n"
+msgstr "Obavezni argumenti dugačkih opcija također su obavezni i za kratke 
opcije.\n"
 
 #: src/gss.c:79
 msgid ""
@@ -234,16 +237,17 @@ msgid ""
 "                    in a human readable format.\n"
 "  -m, --major=LONG  Describe a `major status' error code value.\n"
 msgstr ""
-"  -h, --help        Wypisanie tego opisu i zakoñczenie\n"
-"  -V, --version     Wypisanie numeru wersji i zakoñczenie\n"
+"  -h, --help        Ispiši pomoć i izađi.\n"
+"  -V, --version     Ispiši inačicu i izađi.\n"
 "  -l, --list-mechanisms\n"
-"                    Informacje o obs³ugiwanych mechanizmach\n"
-"                    w postaci czytelnej dla cz³owieka\n"
-"  -m, --major=LONG  Opis \"g³ównego\" kodu b³êdu w postaci tekstowej\n"
+"                    Ispiši informacije o podržanim mehanizmima\n"
+"                    u ljudima čitljivom obliku.\n"
+"  -m, --major=DUG   Opiši vrijednost koda greške glavnog stanja\n"
+"                    („major status”).\n"
 
 #: src/gss.c:87
 msgid "  -q, --quiet       Silent operation (default=off).\n"
-msgstr "  -q, --quiet       Dzia³anie bez komunikatów (domy¶lnie wy³±czone)\n"
+msgstr "  -q, --quiet       Tih rad (početna vrijednost „off”).\n"
 
 #: src/gss.c:106
 #, c-format
@@ -251,7 +255,7 @@ msgid ""
 "GSS-API major status code %ld (0x%lx).\n"
 "\n"
 msgstr ""
-"G³ówny kod stanu GSS-API %ld (0x%lx).\n"
+"GSS-API kod glavnog stanja %ld (0x%lx).\n"
 "\n"
 
 #: src/gss.c:109
@@ -264,7 +268,7 @@ msgid ""
 msgstr ""
 "   MSB                                                                 LSB\n"
 "   +-----------------+-----------------+---------------------------------+\n"
-"   |  B³±d wywo³ania |  B³±d procedury |       Dodatkowe informacje      |\n"
+"   |Greška pozivanja |  Greška rutine  |       Dodatne informacije       
|\n"
 "   | "
 
 #: src/gss.c:123
@@ -283,34 +287,34 @@ msgstr ""
 #: src/gss.c:133
 #, c-format
 msgid "Masked routine error %ld (0x%lx) shifted into %ld (0x%lx):\n"
-msgstr "Maskowany b³±d procedury %ld (0x%lx) przesuniêty do %ld (0x%lx):\n"
+msgstr "Maskirana greška rutine %ld (0x%lx) pomaknuta u %ld (0x%lx):\n"
 
 #: src/gss.c:150 src/gss.c:184 src/gss.c:221
 #, c-format
 msgid "displaying status code failed (%d)"
-msgstr "wy¶wietlenie kodu stanu nie powiod³o siê (%d)"
+msgstr "prikaz koda stanja nije uspio (%d)"
 
 #: src/gss.c:170
 #, c-format
 msgid "Masked calling error %ld (0x%lx) shifted into %ld (0x%lx):\n"
-msgstr "Maskowany b³±d wywo³ania %ld (0x%lx) przesuniêty do %ld (0x%lx):\n"
+msgstr "Maskirana greška pozivanja %ld (0x%lx) pomaknuta u %ld (0x%lx):\n"
 
 #: src/gss.c:203
 #, c-format
 msgid "Masked supplementary info %ld (0x%lx) shifted into %ld (0x%lx):\n"
-msgstr "Maskowane dodatkowe informacje %ld (0x%lx) przesuniête do %ld 
(0x%lx):\n"
+msgstr "Maskirane dodatne informacije %ld (0x%lx) pomaknute u %ld (0x%lx):\n"
 
 #: src/gss.c:238
 #, c-format
 msgid "No error\n"
-msgstr "Brak b³êdu\n"
+msgstr "Nema greške\n"
 
 #: src/gss.c:256
 #, c-format
 msgid "indicating mechanisms failed (%d)"
-msgstr "okre¶lanie mechanizmów nie powiod³o siê (%d)"
+msgstr "prikazivanje mehanizama nije uspjelo (%d)"
 
 #: src/gss.c:271
 #, c-format
 msgid "inquiring information about mechanism failed (%d)"
-msgstr "pobieranie informacji o mechanizmach nie powiod³o siê (%d)"
+msgstr "traženje informacija o mehanizmu nije uspjelo (%d)"
diff --git a/po/id.po.in b/po/id.po.in
index d60e5ea..3b08b1e 100644
--- a/po/id.po.in
+++ b/po/id.po.in
@@ -1,219 +1,220 @@
 # Indonesian translations for gss package.
 # Copyright (C) 2010 Free Software Foundation, Inc.
 # This file is distributed under the same license as the gss package.
-# Andhika Padmawan <address@hidden>, 2010.
+# Andhika Padmawan <address@hidden>, 2010-2012.
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: gss 0.1.5\n"
-"Report-Msgid-Bugs-To: address@hidden"
-"POT-Creation-Date: 2010-03-22 10:38+0100\n"
-"PO-Revision-Date: 2010-03-25 23:00+0700\n"
+"Project-Id-Version: gss 1.0.1\n"
+"Report-Msgid-Bugs-To: address@hidden"
+"POT-Creation-Date: 2010-05-20 15:38+0200\n"
+"PO-Revision-Date: 2012-05-18 15:45+0700\n"
 "Last-Translator: Andhika Padmawan <address@hidden>\n"
 "Language-Team: Indonesian <address@hidden>\n"
+"Language: id\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=utf-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: lib/meta.c:43
+#: lib/meta.c:37
 msgid "Kerberos V5 GSS-API mechanism"
 msgstr "Mekanisme Kerberos V5 GSS-API"
 
-#: lib/error.c:43
+#: lib/error.c:37
 msgid "A required input parameter could not be read"
 msgstr "Parameter masukan yang dibutuhkan tak bisa dibaca"
 
-#: lib/error.c:45
+#: lib/error.c:39
 msgid "A required output parameter could not be written"
 msgstr "Parameter keluaran yang dibutuhkan tak bisa ditulis"
 
-#: lib/error.c:47
+#: lib/error.c:41
 msgid "A parameter was malformed"
 msgstr "Parameter salah bentuk"
 
-#: lib/error.c:52
+#: lib/error.c:46
 msgid "An unsupported mechanism was requested"
 msgstr "Mekanisme yang tak didukung telah diminta"
 
-#: lib/error.c:54
+#: lib/error.c:48
 msgid "An invalid name was supplied"
 msgstr "Nama tidak sah telah diberikan"
 
-#: lib/error.c:56
+#: lib/error.c:50
 msgid "A supplied name was of an unsupported type"
 msgstr "Nama yang diberikan merupakan tipe yang tak didukung"
 
-#: lib/error.c:58
+#: lib/error.c:52
 msgid "Incorrect channel bindings were supplied"
 msgstr "Pengikat kanal tidak sah telah dipasok"
 
-#: lib/error.c:60
+#: lib/error.c:54
 msgid "An invalid status code was supplied"
 msgstr "Kode status tidak sah telah dipasok"
 
-#: lib/error.c:62
+#: lib/error.c:56
 msgid "A token had an invalid MIC"
 msgstr "Token memiliki MIC tidak sah"
 
-#: lib/error.c:64
+#: lib/error.c:58
 msgid "No credentials were supplied, or the credentials were unavailable or 
inaccessible"
 msgstr "Tak ada kredensial yang dipasok, atau kredensial tak tersedia atau tak 
dapat diakses"
 
-#: lib/error.c:67
+#: lib/error.c:61
 msgid "No context has been established"
 msgstr "Tak ada konteks yang dibangun"
 
-#: lib/error.c:69
+#: lib/error.c:63
 msgid "A token was invalid"
 msgstr "Token tidak sah"
 
-#: lib/error.c:71
+#: lib/error.c:65
 msgid "A credential was invalid"
 msgstr "Kredensial tidak sah"
 
-#: lib/error.c:73
+#: lib/error.c:67
 msgid "The referenced credentials have expired"
 msgstr "Kredensial yang diacu telah kadaluarsa"
 
-#: lib/error.c:75
+#: lib/error.c:69
 msgid "The context has expired"
 msgstr "Konteks telah kadaluarsa"
 
-#: lib/error.c:77
+#: lib/error.c:71
 msgid "Unspecified error in underlying mechanism"
 msgstr "Galat tak ditentukan di mekanisme dasar"
 
-#: lib/error.c:79
+#: lib/error.c:73
 msgid "The quality-of-protection requested could not be provided"
 msgstr "Kualitas proteksi diminta tak dapat disediakan"
 
-#: lib/error.c:81
+#: lib/error.c:75
 msgid "The operation is forbidden by local security policy"
 msgstr "Operasi dilarang oleh kebijakan keamanan lokal"
 
-#: lib/error.c:83
+#: lib/error.c:77
 msgid "The operation or option is unavailable"
 msgstr "Operasi atau opsi tak tersedia"
 
-#: lib/error.c:85
+#: lib/error.c:79
 msgid "The requested credential element already exists"
 msgstr "Elemen kredensial yang diminta telah ada"
 
-#: lib/error.c:87
+#: lib/error.c:81
 msgid "The provided name was not a mechanism name"
 msgstr "Nama yang diberikan bukan nama mekanisme"
 
-#: lib/error.c:92
+#: lib/error.c:86
 msgid "The gss_init_sec_context() or gss_accept_sec_context() function must be 
called again to complete its function"
 msgstr "Fungsi gss_init_sec_context() atau gss_accept_sec_context() harus 
dipanggil ulang untuk melengkapi fungsinya"
 
-#: lib/error.c:95
+#: lib/error.c:89
 msgid "The token was a duplicate of an earlier token"
 msgstr "Token merupakan duplikat dari token sebelumnya"
 
-#: lib/error.c:97
+#: lib/error.c:91
 msgid "The token's validity period has expired"
 msgstr "Periode validitas token telah kadaluarsa"
 
-#: lib/error.c:99
+#: lib/error.c:93
 msgid "A later token has already been processed"
 msgstr "Token selanjutnya telah diproses"
 
-#: lib/error.c:101
+#: lib/error.c:95
 msgid "An expected per-message token was not received"
 msgstr "Token per-pesan yang diharapkan tidak diterima"
 
-#: lib/error.c:318
+#: lib/error.c:312
 msgid "No error"
 msgstr "Tak ada galat"
 
-#: lib/krb5/error.c:42
+#: lib/krb5/error.c:36
 msgid "No @ in SERVICE-NAME name string"
 msgstr "Tak ada @ di benang nama SERVICE-NAME"
 
-#: lib/krb5/error.c:44
+#: lib/krb5/error.c:38
 msgid "STRING-UID-NAME contains nondigits"
 msgstr "STRING-UID-NAME berisi nondigit"
 
-#: lib/krb5/error.c:46
+#: lib/krb5/error.c:40
 msgid "UID does not resolve to username"
 msgstr "UID tak dapat memecahkan ke nama pengguna"
 
-#: lib/krb5/error.c:48
+#: lib/krb5/error.c:42
 msgid "Validation error"
 msgstr "Galat validasi"
 
-#: lib/krb5/error.c:50
+#: lib/krb5/error.c:44
 msgid "Couldn't allocate gss_buffer_t data"
 msgstr "Tak dapat mengalokasikan data gss_buffer_t"
 
-#: lib/krb5/error.c:52
+#: lib/krb5/error.c:46
 msgid "Message context invalid"
 msgstr "Konteks pesan tidak sah"
 
-#: lib/krb5/error.c:54
+#: lib/krb5/error.c:48
 msgid "Buffer is the wrong size"
 msgstr "Penyangga dalam ukuran yang salah"
 
-#: lib/krb5/error.c:56
+#: lib/krb5/error.c:50
 msgid "Credential usage type is unknown"
 msgstr "Tipe penggunaan kredensial tak diketahui"
 
-#: lib/krb5/error.c:58
+#: lib/krb5/error.c:52
 msgid "Unknown quality of protection specified"
 msgstr "Kualitas proteksi tak diketahui telah ditentukan"
 
-#: lib/krb5/error.c:61
+#: lib/krb5/error.c:55
 msgid "Principal in credential cache does not match desired name"
 msgstr "Prinsip dalam tembolok kredensial tidak cocok dengan nama yang 
diinginkan"
 
-#: lib/krb5/error.c:63
+#: lib/krb5/error.c:57
 msgid "No principal in keytab matches desired name"
 msgstr "Tak ada prinsip di tab kunci yang cocok dengan nama yang diinginkan"
 
-#: lib/krb5/error.c:65
+#: lib/krb5/error.c:59
 msgid "Credential cache has no TGT"
 msgstr "Tembolok kredensial tak memiliki TGT"
 
-#: lib/krb5/error.c:67
+#: lib/krb5/error.c:61
 msgid "Authenticator has no subkey"
 msgstr "Otentikator tidak memiliki subkunci"
 
-#: lib/krb5/error.c:69
+#: lib/krb5/error.c:63
 msgid "Context is already fully established"
 msgstr "Konteks telah sepenuhnya terbangun"
 
-#: lib/krb5/error.c:71
+#: lib/krb5/error.c:65
 msgid "Unknown signature type in token"
 msgstr "Tipe tanda tangan tak dikenal di token"
 
-#: lib/krb5/error.c:73
+#: lib/krb5/error.c:67
 msgid "Invalid field length in token"
 msgstr "Panjang medan tak sah di token"
 
-#: lib/krb5/error.c:75
+#: lib/krb5/error.c:69
 msgid "Attempt to use incomplete security context"
 msgstr "Coba menggunakan konteks keamanan tidak lengkap"
 
-#: lib/krb5/error.c:92
+#: lib/krb5/error.c:86
 msgid "No krb5 error"
 msgstr "Tak ada galat krb5"
 
-#: lib/krb5/error.c:133
+#: lib/krb5/error.c:127
 msgid "Unknown krb5 error"
 msgstr "Galat krb5 tak dikenal"
 
-#: src/gss.c:64
+#: src/gss.c:65
 #, c-format
 msgid "Try `%s --help' for more information.\n"
 msgstr "Coba `%s --help' untuk informasi lebih lanjut.\n"
 
-#: src/gss.c:68
+#: src/gss.c:69
 #, c-format
 msgid "Usage: %s OPTIONS...\n"
 msgstr "Penggunaan: %s OPSI...\n"
 
-#: src/gss.c:71
+#: src/gss.c:72
 msgid ""
 "Command line interface to GSS, used to explain error codes.\n"
 "\n"
@@ -221,23 +222,31 @@ msgstr ""
 "Antarmuka baris perintah ke GSS, digunakan untuk menjelaskan kode galat.\n"
 "\n"
 
-#: src/gss.c:75
+#: src/gss.c:76
 msgid "Mandatory arguments to long options are mandatory for short options 
too.\n"
 msgstr "Argumen wajib untuk opsi panjang juga wajib untuk opsi pendek.\n"
 
-#: src/gss.c:78
+#: src/gss.c:79
 msgid ""
-"  -h, --help        Print help and exit\n"
-"  -V, --version     Print version and exit\n"
-"  -m, --major=LONG  Describe a `major status' error code vaue in plain 
text.\n"
-"  -q, --quiet       Silent operation  (default=off)\n"
+"  -h, --help        Print help and exit.\n"
+"  -V, --version     Print version and exit.\n"
+"  -l, --list-mechanisms\n"
+"                    List information about supported mechanisms\n"
+"                    in a human readable format.\n"
+"  -m, --major=LONG  Describe a `major status' error code value.\n"
 msgstr ""
-"  -h, --help        Cetak bantuan dan keluar\n"
-"  -V, --version     Cetak versi dan keluar\n"
-"  -m, --major=LONG  Jelaskan nilai kode galat `status utama' dalam teks 
biasa.\n"
-"  -q, --quiet       Operasi diam (standar=off)\n"
-
-#: src/gss.c:119
+"  -h, --help        Cetak bantuan lalu keluar.\n"
+"  -V, --version     Cetak versi lalu keluar.\n"
+"  -l, --list-mechanisms\n"
+"                    Tampilkan informasi tentang mekanisme yang didukung\n"
+"                    dalam format yang dapat dibaca manusia.\n"
+"  -m, --major=LONG  Jelaskan nilai kode galat `major status'.\n"
+
+#: src/gss.c:87
+msgid "  -q, --quiet       Silent operation (default=off).\n"
+msgstr "  -q, --quiet       Operasi diam (standar=mati).\n"
+
+#: src/gss.c:106
 #, c-format
 msgid ""
 "GSS-API major status code %ld (0x%lx).\n"
@@ -246,7 +255,7 @@ msgstr ""
 "Kode status mayor GSS-API %ld (0x%lx).\n"
 "\n"
 
-#: src/gss.c:122
+#: src/gss.c:109
 #, c-format
 msgid ""
 "   MSB                                                                 LSB\n"
@@ -259,7 +268,7 @@ msgstr ""
 "   |  Galat Memanggil  |  Galat Rutin  |       Info Tambahan             |\n"
 "   | "
 
-#: src/gss.c:136
+#: src/gss.c:123
 #, c-format
 msgid ""
 "|\n"
@@ -272,30 +281,51 @@ msgstr ""
 "Bita 31            24  23            16  15                             0\n"
 "\n"
 
-#: src/gss.c:146
+#: src/gss.c:133
 #, c-format
 msgid "Masked routine error %ld (0x%lx) shifted into %ld (0x%lx):\n"
 msgstr "Galat rutin bertopeng %ld (0x%lx) digeser ke %ld (0x%lx):\n"
 
-#: src/gss.c:163 src/gss.c:198 src/gss.c:236
+#: src/gss.c:150 src/gss.c:184 src/gss.c:221
 #, c-format
-msgid "%s: displaying status code failed\n"
-msgstr "%s: menampilkan kode status gagal\n"
+msgid "displaying status code failed (%d)"
+msgstr "menampilkan kode status gagal (%d)"
 
-#: src/gss.c:184
+#: src/gss.c:170
 #, c-format
 msgid "Masked calling error %ld (0x%lx) shifted into %ld (0x%lx):\n"
 msgstr "Galat memanggil bertopeng %ld (0x%lx) digeser ke %ld (0x%lx):\n"
 
-#: src/gss.c:218
+#: src/gss.c:203
 #, c-format
 msgid "Masked supplementary info %ld (0x%lx) shifted into %ld (0x%lx):\n"
 msgstr "Info tambahan bertopeng %ld (0x%lx) digeser ke %ld (0x%lx):\n"
 
-#: src/gss.c:254
+#: src/gss.c:238
 #, c-format
 msgid "No error\n"
 msgstr "Tak ada galat\n"
 
+#: src/gss.c:256
+#, c-format
+msgid "indicating mechanisms failed (%d)"
+msgstr "mengindikasikan kegagalan mekanisme (%d)"
+
+#: src/gss.c:271
+#, c-format
+msgid "inquiring information about mechanism failed (%d)"
+msgstr "mencari tahu informasi tentang kegagalan mekanisme (%d)"
+
+#~ msgid ""
+#~ "  -h, --help        Print help and exit\n"
+#~ "  -V, --version     Print version and exit\n"
+#~ "  -m, --major=LONG  Describe a `major status' error code vaue in plain 
text.\n"
+#~ "  -q, --quiet       Silent operation  (default=off)\n"
+#~ msgstr ""
+#~ "  -h, --help        Cetak bantuan dan keluar\n"
+#~ "  -V, --version     Cetak versi dan keluar\n"
+#~ "  -m, --major=LONG  Jelaskan nilai kode galat `status utama' dalam teks 
biasa.\n"
+#~ "  -q, --quiet       Operasi diam (standar=off)\n"
+
 #~ msgid "%s: missing parameter\n"
 #~ msgstr "%s: kehilangan parameter\n"
diff --git a/src/gl/Makefile.am b/src/gl/Makefile.am
index 1ecf05e..e2f6cfb 100644
--- a/src/gl/Makefile.am
+++ b/src/gl/Makefile.am
@@ -21,7 +21,7 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --local-dir=src/gl/override 
--lib=libgnu --source-base=src/gl --m4-base=src/gl/m4 --doc-base=doc 
--tests-base=src/gl/tests --aux-dir=build-aux --no-conditional-dependencies 
--libtool --macro-prefix=srcgl --no-vc-files error getopt-gnu progname 
version-etc
+# Reproduce by: gnulib-tool --import --dir=. --local-dir=src/gl/override 
--lib=libgnu --source-base=src/gl --m4-base=src/gl/m4 --doc-base=doc 
--tests-base=src/gl/tests --aux-dir=build-aux --no-conditional-dependencies 
--libtool --macro-prefix=srcgl --no-vc-files base64 error getopt-gnu progname 
version-etc
 
 AUTOMAKE_OPTIONS = 1.5 gnits
 
@@ -52,6 +52,12 @@ libgnu_la_LDFLAGS = $(AM_LDFLAGS)
 libgnu_la_LDFLAGS += -no-undefined
 libgnu_la_LDFLAGS += $(LTLIBINTL)
 
+## begin gnulib module base64
+
+libgnu_la_SOURCES += base64.h base64.c
+
+## end   gnulib module base64
+
 ## begin gnulib module errno
 
 BUILT_SOURCES += $(ERRNO_H)
@@ -135,6 +141,15 @@ EXTRA_DIST += intprops.h
 
 ## end   gnulib module intprops
 
+## begin gnulib module memchr
+
+
+EXTRA_DIST += memchr.c memchr.valgrind
+
+EXTRA_libgnu_la_SOURCES += memchr.c
+
+## end   gnulib module memchr
+
 ## begin gnulib module msvc-inval
 
 
@@ -256,6 +271,29 @@ EXTRA_DIST += stdarg.in.h
 
 ## end   gnulib module stdarg
 
+## begin gnulib module stdbool
+
+BUILT_SOURCES += $(STDBOOL_H)
+
+# We need the following in order to create <stdbool.h> when the system
+# doesn't have one that works.
+if GL_GENERATE_STDBOOL_H
+stdbool.h: stdbool.in.h $(top_builddir)/config.status
+       $(AM_V_GEN)rm -f address@hidden $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; 
\
+       } > address@hidden && \
+       mv address@hidden $@
+else
+stdbool.h: $(top_builddir)/config.status
+       rm -f $@
+endif
+MOSTLYCLEANFILES += stdbool.h stdbool.h-t
+
+EXTRA_DIST += stdbool.in.h
+
+## end   gnulib module stdbool
+
 ## begin gnulib module stddef
 
 BUILT_SOURCES += $(STDDEF_H)
@@ -404,6 +442,31 @@ EXTRA_DIST += string.in.h
 
 ## end   gnulib module string
 
+## begin gnulib module sys_types
+
+BUILT_SOURCES += sys/types.h
+
+# We need the following in order to create <sys/types.h> when the system
+# doesn't have one that works with the given compiler.
+sys/types.h: sys_types.in.h $(top_builddir)/config.status
+       $(AM_V_at)$(MKDIR_P) sys
+       $(AM_V_GEN)rm -f address@hidden $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''GUARD_PREFIX''@|GL_SRCGL|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \
+             -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
+             < $(srcdir)/sys_types.in.h; \
+       } > address@hidden && \
+       mv address@hidden $@
+MOSTLYCLEANFILES += sys/types.h sys/types.h-t
+
+EXTRA_DIST += sys_types.in.h
+
+## end   gnulib module sys_types
+
 ## begin gnulib module unistd
 
 BUILT_SOURCES += unistd.h
@@ -419,6 +482,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \
+             -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
              -e 's/@''GNULIB_CHDIR''@/$(GNULIB_CHDIR)/g' \
              -e 's/@''GNULIB_CHOWN''@/$(GNULIB_CHOWN)/g' \
              -e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \
@@ -517,6 +581,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status 
$(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
              -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
              -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
+             -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \
              -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
              -e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \
              -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \
diff --git a/src/gl/base64.c b/src/gl/base64.c
new file mode 100644
index 0000000..351c5fd
--- /dev/null
+++ b/src/gl/base64.c
@@ -0,0 +1,574 @@
+/* base64.c -- Encode binary data using printable characters.
+   Copyright (C) 1999-2001, 2004-2006, 2009-2012 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Simon Josefsson.  Partially adapted from GNU MailUtils
+ * (mailbox/filter_trans.c, as of 2004-11-28).  Improved by review
+ * from Paul Eggert, Bruno Haible, and Stepan Kasal.
+ *
+ * See also RFC 4648 <http://www.ietf.org/rfc/rfc4648.txt>.
+ *
+ * Be careful with error checking.  Here is how you would typically
+ * use these functions:
+ *
+ * bool ok = base64_decode_alloc (in, inlen, &out, &outlen);
+ * if (!ok)
+ *   FAIL: input was not valid base64
+ * if (out == NULL)
+ *   FAIL: memory allocation error
+ * OK: data in OUT/OUTLEN
+ *
+ * size_t outlen = base64_encode_alloc (in, inlen, &out);
+ * if (out == NULL && outlen == 0 && inlen != 0)
+ *   FAIL: input too long
+ * if (out == NULL)
+ *   FAIL: memory allocation error
+ * OK: data in OUT/OUTLEN.
+ *
+ */
+
+#include <config.h>
+
+/* Get prototype. */
+#include "base64.h"
+
+/* Get malloc. */
+#include <stdlib.h>
+
+/* Get UCHAR_MAX. */
+#include <limits.h>
+
+#include <string.h>
+
+/* C89 compliant way to cast 'char' to 'unsigned char'. */
+static inline unsigned char
+to_uchar (char ch)
+{
+  return ch;
+}
+
+/* Base64 encode IN array of size INLEN into OUT array of size OUTLEN.
+   If OUTLEN is less than BASE64_LENGTH(INLEN), write as many bytes as
+   possible.  If OUTLEN is larger than BASE64_LENGTH(INLEN), also zero
+   terminate the output buffer. */
+void
+base64_encode (const char *restrict in, size_t inlen,
+               char *restrict out, size_t outlen)
+{
+  static const char b64str[64] =
+    "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+
+  while (inlen && outlen)
+    {
+      *out++ = b64str[(to_uchar (in[0]) >> 2) & 0x3f];
+      if (!--outlen)
+        break;
+      *out++ = b64str[((to_uchar (in[0]) << 4)
+                       + (--inlen ? to_uchar (in[1]) >> 4 : 0))
+                      & 0x3f];
+      if (!--outlen)
+        break;
+      *out++ =
+        (inlen
+         ? b64str[((to_uchar (in[1]) << 2)
+                   + (--inlen ? to_uchar (in[2]) >> 6 : 0))
+                  & 0x3f]
+         : '=');
+      if (!--outlen)
+        break;
+      *out++ = inlen ? b64str[to_uchar (in[2]) & 0x3f] : '=';
+      if (!--outlen)
+        break;
+      if (inlen)
+        inlen--;
+      if (inlen)
+        in += 3;
+    }
+
+  if (outlen)
+    *out = '\0';
+}
+
+/* Allocate a buffer and store zero terminated base64 encoded data
+   from array IN of size INLEN, returning BASE64_LENGTH(INLEN), i.e.,
+   the length of the encoded data, excluding the terminating zero.  On
+   return, the OUT variable will hold a pointer to newly allocated
+   memory that must be deallocated by the caller.  If output string
+   length would overflow, 0 is returned and OUT is set to NULL.  If
+   memory allocation failed, OUT is set to NULL, and the return value
+   indicates length of the requested memory block, i.e.,
+   BASE64_LENGTH(inlen) + 1. */
+size_t
+base64_encode_alloc (const char *in, size_t inlen, char **out)
+{
+  size_t outlen = 1 + BASE64_LENGTH (inlen);
+
+  /* Check for overflow in outlen computation.
+   *
+   * If there is no overflow, outlen >= inlen.
+   *
+   * If the operation (inlen + 2) overflows then it yields at most +1, so
+   * outlen is 0.
+   *
+   * If the multiplication overflows, we lose at least half of the
+   * correct value, so the result is < ((inlen + 2) / 3) * 2, which is
+   * less than (inlen + 2) * 0.66667, which is less than inlen as soon as
+   * (inlen > 4).
+   */
+  if (inlen > outlen)
+    {
+      *out = NULL;
+      return 0;
+    }
+
+  *out = malloc (outlen);
+  if (!*out)
+    return outlen;
+
+  base64_encode (in, inlen, *out, outlen);
+
+  return outlen - 1;
+}
+
+/* With this approach this file works independent of the charset used
+   (think EBCDIC).  However, it does assume that the characters in the
+   Base64 alphabet (A-Za-z0-9+/) are encoded in 0..255.  POSIX
+   1003.1-2001 require that char and unsigned char are 8-bit
+   quantities, though, taking care of that problem.  But this may be a
+   potential problem on non-POSIX C99 platforms.
+
+   IBM C V6 for AIX mishandles "#define B64(x) ...'x'...", so use "_"
+   as the formal parameter rather than "x".  */
+#define B64(_)                                  \
+  ((_) == 'A' ? 0                               \
+   : (_) == 'B' ? 1                             \
+   : (_) == 'C' ? 2                             \
+   : (_) == 'D' ? 3                             \
+   : (_) == 'E' ? 4                             \
+   : (_) == 'F' ? 5                             \
+   : (_) == 'G' ? 6                             \
+   : (_) == 'H' ? 7                             \
+   : (_) == 'I' ? 8                             \
+   : (_) == 'J' ? 9                             \
+   : (_) == 'K' ? 10                            \
+   : (_) == 'L' ? 11                            \
+   : (_) == 'M' ? 12                            \
+   : (_) == 'N' ? 13                            \
+   : (_) == 'O' ? 14                            \
+   : (_) == 'P' ? 15                            \
+   : (_) == 'Q' ? 16                            \
+   : (_) == 'R' ? 17                            \
+   : (_) == 'S' ? 18                            \
+   : (_) == 'T' ? 19                            \
+   : (_) == 'U' ? 20                            \
+   : (_) == 'V' ? 21                            \
+   : (_) == 'W' ? 22                            \
+   : (_) == 'X' ? 23                            \
+   : (_) == 'Y' ? 24                            \
+   : (_) == 'Z' ? 25                            \
+   : (_) == 'a' ? 26                            \
+   : (_) == 'b' ? 27                            \
+   : (_) == 'c' ? 28                            \
+   : (_) == 'd' ? 29                            \
+   : (_) == 'e' ? 30                            \
+   : (_) == 'f' ? 31                            \
+   : (_) == 'g' ? 32                            \
+   : (_) == 'h' ? 33                            \
+   : (_) == 'i' ? 34                            \
+   : (_) == 'j' ? 35                            \
+   : (_) == 'k' ? 36                            \
+   : (_) == 'l' ? 37                            \
+   : (_) == 'm' ? 38                            \
+   : (_) == 'n' ? 39                            \
+   : (_) == 'o' ? 40                            \
+   : (_) == 'p' ? 41                            \
+   : (_) == 'q' ? 42                            \
+   : (_) == 'r' ? 43                            \
+   : (_) == 's' ? 44                            \
+   : (_) == 't' ? 45                            \
+   : (_) == 'u' ? 46                            \
+   : (_) == 'v' ? 47                            \
+   : (_) == 'w' ? 48                            \
+   : (_) == 'x' ? 49                            \
+   : (_) == 'y' ? 50                            \
+   : (_) == 'z' ? 51                            \
+   : (_) == '0' ? 52                            \
+   : (_) == '1' ? 53                            \
+   : (_) == '2' ? 54                            \
+   : (_) == '3' ? 55                            \
+   : (_) == '4' ? 56                            \
+   : (_) == '5' ? 57                            \
+   : (_) == '6' ? 58                            \
+   : (_) == '7' ? 59                            \
+   : (_) == '8' ? 60                            \
+   : (_) == '9' ? 61                            \
+   : (_) == '+' ? 62                            \
+   : (_) == '/' ? 63                            \
+   : -1)
+
+static const signed char b64[0x100] = {
+  B64 (0), B64 (1), B64 (2), B64 (3),
+  B64 (4), B64 (5), B64 (6), B64 (7),
+  B64 (8), B64 (9), B64 (10), B64 (11),
+  B64 (12), B64 (13), B64 (14), B64 (15),
+  B64 (16), B64 (17), B64 (18), B64 (19),
+  B64 (20), B64 (21), B64 (22), B64 (23),
+  B64 (24), B64 (25), B64 (26), B64 (27),
+  B64 (28), B64 (29), B64 (30), B64 (31),
+  B64 (32), B64 (33), B64 (34), B64 (35),
+  B64 (36), B64 (37), B64 (38), B64 (39),
+  B64 (40), B64 (41), B64 (42), B64 (43),
+  B64 (44), B64 (45), B64 (46), B64 (47),
+  B64 (48), B64 (49), B64 (50), B64 (51),
+  B64 (52), B64 (53), B64 (54), B64 (55),
+  B64 (56), B64 (57), B64 (58), B64 (59),
+  B64 (60), B64 (61), B64 (62), B64 (63),
+  B64 (64), B64 (65), B64 (66), B64 (67),
+  B64 (68), B64 (69), B64 (70), B64 (71),
+  B64 (72), B64 (73), B64 (74), B64 (75),
+  B64 (76), B64 (77), B64 (78), B64 (79),
+  B64 (80), B64 (81), B64 (82), B64 (83),
+  B64 (84), B64 (85), B64 (86), B64 (87),
+  B64 (88), B64 (89), B64 (90), B64 (91),
+  B64 (92), B64 (93), B64 (94), B64 (95),
+  B64 (96), B64 (97), B64 (98), B64 (99),
+  B64 (100), B64 (101), B64 (102), B64 (103),
+  B64 (104), B64 (105), B64 (106), B64 (107),
+  B64 (108), B64 (109), B64 (110), B64 (111),
+  B64 (112), B64 (113), B64 (114), B64 (115),
+  B64 (116), B64 (117), B64 (118), B64 (119),
+  B64 (120), B64 (121), B64 (122), B64 (123),
+  B64 (124), B64 (125), B64 (126), B64 (127),
+  B64 (128), B64 (129), B64 (130), B64 (131),
+  B64 (132), B64 (133), B64 (134), B64 (135),
+  B64 (136), B64 (137), B64 (138), B64 (139),
+  B64 (140), B64 (141), B64 (142), B64 (143),
+  B64 (144), B64 (145), B64 (146), B64 (147),
+  B64 (148), B64 (149), B64 (150), B64 (151),
+  B64 (152), B64 (153), B64 (154), B64 (155),
+  B64 (156), B64 (157), B64 (158), B64 (159),
+  B64 (160), B64 (161), B64 (162), B64 (163),
+  B64 (164), B64 (165), B64 (166), B64 (167),
+  B64 (168), B64 (169), B64 (170), B64 (171),
+  B64 (172), B64 (173), B64 (174), B64 (175),
+  B64 (176), B64 (177), B64 (178), B64 (179),
+  B64 (180), B64 (181), B64 (182), B64 (183),
+  B64 (184), B64 (185), B64 (186), B64 (187),
+  B64 (188), B64 (189), B64 (190), B64 (191),
+  B64 (192), B64 (193), B64 (194), B64 (195),
+  B64 (196), B64 (197), B64 (198), B64 (199),
+  B64 (200), B64 (201), B64 (202), B64 (203),
+  B64 (204), B64 (205), B64 (206), B64 (207),
+  B64 (208), B64 (209), B64 (210), B64 (211),
+  B64 (212), B64 (213), B64 (214), B64 (215),
+  B64 (216), B64 (217), B64 (218), B64 (219),
+  B64 (220), B64 (221), B64 (222), B64 (223),
+  B64 (224), B64 (225), B64 (226), B64 (227),
+  B64 (228), B64 (229), B64 (230), B64 (231),
+  B64 (232), B64 (233), B64 (234), B64 (235),
+  B64 (236), B64 (237), B64 (238), B64 (239),
+  B64 (240), B64 (241), B64 (242), B64 (243),
+  B64 (244), B64 (245), B64 (246), B64 (247),
+  B64 (248), B64 (249), B64 (250), B64 (251),
+  B64 (252), B64 (253), B64 (254), B64 (255)
+};
+
+#if UCHAR_MAX == 255
+# define uchar_in_range(c) true
+#else
+# define uchar_in_range(c) ((c) <= 255)
+#endif
+
+/* Return true if CH is a character from the Base64 alphabet, and
+   false otherwise.  Note that '=' is padding and not considered to be
+   part of the alphabet.  */
+bool
+isbase64 (char ch)
+{
+  return uchar_in_range (to_uchar (ch)) && 0 <= b64[to_uchar (ch)];
+}
+
+/* Initialize decode-context buffer, CTX.  */
+void
+base64_decode_ctx_init (struct base64_decode_context *ctx)
+{
+  ctx->i = 0;
+}
+
+/* If CTX->i is 0 or 4, there are four or more bytes in [*IN..IN_END), and
+   none of those four is a newline, then return *IN.  Otherwise, copy up to
+   4 - CTX->i non-newline bytes from that range into CTX->buf, starting at
+   index CTX->i and setting CTX->i to reflect the number of bytes copied,
+   and return CTX->buf.  In either case, advance *IN to point to the byte
+   after the last one processed, and set *N_NON_NEWLINE to the number of
+   verified non-newline bytes accessible through the returned pointer.  */
+static inline char *
+get_4 (struct base64_decode_context *ctx,
+       char const *restrict *in, char const *restrict in_end,
+       size_t *n_non_newline)
+{
+  if (ctx->i == 4)
+    ctx->i = 0;
+
+  if (ctx->i == 0)
+    {
+      char const *t = *in;
+      if (4 <= in_end - *in && memchr (t, '\n', 4) == NULL)
+        {
+          /* This is the common case: no newline.  */
+          *in += 4;
+          *n_non_newline = 4;
+          return (char *) t;
+        }
+    }
+
+  {
+    /* Copy non-newline bytes into BUF.  */
+    char const *p = *in;
+    while (p < in_end)
+      {
+        char c = *p++;
+        if (c != '\n')
+          {
+            ctx->buf[ctx->i++] = c;
+            if (ctx->i == 4)
+              break;
+          }
+      }
+
+    *in = p;
+    *n_non_newline = ctx->i;
+    return ctx->buf;
+  }
+}
+
+#define return_false                            \
+  do                                            \
+    {                                           \
+      *outp = out;                              \
+      return false;                             \
+    }                                           \
+  while (false)
+
+/* Decode up to four bytes of base64-encoded data, IN, of length INLEN
+   into the output buffer, *OUT, of size *OUTLEN bytes.  Return true if
+   decoding is successful, false otherwise.  If *OUTLEN is too small,
+   as many bytes as possible are written to *OUT.  On return, advance
+   *OUT to point to the byte after the last one written, and decrement
+   *OUTLEN to reflect the number of bytes remaining in *OUT.  */
+static inline bool
+decode_4 (char const *restrict in, size_t inlen,
+          char *restrict *outp, size_t *outleft)
+{
+  char *out = *outp;
+  if (inlen < 2)
+    return false;
+
+  if (!isbase64 (in[0]) || !isbase64 (in[1]))
+    return false;
+
+  if (*outleft)
+    {
+      *out++ = ((b64[to_uchar (in[0])] << 2)
+                | (b64[to_uchar (in[1])] >> 4));
+      --*outleft;
+    }
+
+  if (inlen == 2)
+    return_false;
+
+  if (in[2] == '=')
+    {
+      if (inlen != 4)
+        return_false;
+
+      if (in[3] != '=')
+        return_false;
+    }
+  else
+    {
+      if (!isbase64 (in[2]))
+        return_false;
+
+      if (*outleft)
+        {
+          *out++ = (((b64[to_uchar (in[1])] << 4) & 0xf0)
+                    | (b64[to_uchar (in[2])] >> 2));
+          --*outleft;
+        }
+
+      if (inlen == 3)
+        return_false;
+
+      if (in[3] == '=')
+        {
+          if (inlen != 4)
+            return_false;
+        }
+      else
+        {
+          if (!isbase64 (in[3]))
+            return_false;
+
+          if (*outleft)
+            {
+              *out++ = (((b64[to_uchar (in[2])] << 6) & 0xc0)
+                        | b64[to_uchar (in[3])]);
+              --*outleft;
+            }
+        }
+    }
+
+  *outp = out;
+  return true;
+}
+
+/* Decode base64-encoded input array IN of length INLEN to output array
+   OUT that can hold *OUTLEN bytes.  The input data may be interspersed
+   with newlines.  Return true if decoding was successful, i.e. if the
+   input was valid base64 data, false otherwise.  If *OUTLEN is too
+   small, as many bytes as possible will be written to OUT.  On return,
+   *OUTLEN holds the length of decoded bytes in OUT.  Note that as soon
+   as any non-alphabet, non-newline character is encountered, decoding
+   is stopped and false is returned.  If INLEN is zero, then process
+   only whatever data is stored in CTX.
+
+   Initially, CTX must have been initialized via base64_decode_ctx_init.
+   Subsequent calls to this function must reuse whatever state is recorded
+   in that buffer.  It is necessary for when a quadruple of base64 input
+   bytes spans two input buffers.
+
+   If CTX is NULL then newlines are treated as garbage and the input
+   buffer is processed as a unit.  */
+
+bool
+base64_decode_ctx (struct base64_decode_context *ctx,
+                   const char *restrict in, size_t inlen,
+                   char *restrict out, size_t *outlen)
+{
+  size_t outleft = *outlen;
+  bool ignore_newlines = ctx != NULL;
+  bool flush_ctx = false;
+  unsigned int ctx_i = 0;
+
+  if (ignore_newlines)
+    {
+      ctx_i = ctx->i;
+      flush_ctx = inlen == 0;
+    }
+
+
+  while (true)
+    {
+      size_t outleft_save = outleft;
+      if (ctx_i == 0 && !flush_ctx)
+        {
+          while (true)
+            {
+              /* Save a copy of outleft, in case we need to re-parse this
+                 block of four bytes.  */
+              outleft_save = outleft;
+              if (!decode_4 (in, inlen, &out, &outleft))
+                break;
+
+              in += 4;
+              inlen -= 4;
+            }
+        }
+
+      if (inlen == 0 && !flush_ctx)
+        break;
+
+      /* Handle the common case of 72-byte wrapped lines.
+         This also handles any other multiple-of-4-byte wrapping.  */
+      if (inlen && *in == '\n' && ignore_newlines)
+        {
+          ++in;
+          --inlen;
+          continue;
+        }
+
+      /* Restore OUT and OUTLEFT.  */
+      out -= outleft_save - outleft;
+      outleft = outleft_save;
+
+      {
+        char const *in_end = in + inlen;
+        char const *non_nl;
+
+        if (ignore_newlines)
+          non_nl = get_4 (ctx, &in, in_end, &inlen);
+        else
+          non_nl = in;  /* Might have nl in this case. */
+
+        /* If the input is empty or consists solely of newlines (0 
non-newlines),
+           then we're done.  Likewise if there are fewer than 4 bytes when not
+           flushing context and not treating newlines as garbage.  */
+        if (inlen == 0 || (inlen < 4 && !flush_ctx && ignore_newlines))
+          {
+            inlen = 0;
+            break;
+          }
+        if (!decode_4 (non_nl, inlen, &out, &outleft))
+          break;
+
+        inlen = in_end - in;
+      }
+    }
+
+  *outlen -= outleft;
+
+  return inlen == 0;
+}
+
+/* Allocate an output buffer in *OUT, and decode the base64 encoded
+   data stored in IN of size INLEN to the *OUT buffer.  On return, the
+   size of the decoded data is stored in *OUTLEN.  OUTLEN may be NULL,
+   if the caller is not interested in the decoded length.  *OUT may be
+   NULL to indicate an out of memory error, in which case *OUTLEN
+   contains the size of the memory block needed.  The function returns
+   true on successful decoding and memory allocation errors.  (Use the
+   *OUT and *OUTLEN parameters to differentiate between successful
+   decoding and memory error.)  The function returns false if the
+   input was invalid, in which case *OUT is NULL and *OUTLEN is
+   undefined. */
+bool
+base64_decode_alloc_ctx (struct base64_decode_context *ctx,
+                         const char *in, size_t inlen, char **out,
+                         size_t *outlen)
+{
+  /* This may allocate a few bytes too many, depending on input,
+     but it's not worth the extra CPU time to compute the exact size.
+     The exact size is 3 * (inlen + (ctx ? ctx->i : 0)) / 4, minus 1 if the
+     input ends with "=" and minus another 1 if the input ends with "==".
+     Dividing before multiplying avoids the possibility of overflow.  */
+  size_t needlen = 3 * (inlen / 4) + 3;
+
+  *out = malloc (needlen);
+  if (!*out)
+    return true;
+
+  if (!base64_decode_ctx (ctx, in, inlen, *out, &needlen))
+    {
+      free (*out);
+      *out = NULL;
+      return false;
+    }
+
+  if (outlen)
+    *outlen = needlen;
+
+  return true;
+}
diff --git a/src/gl/base64.h b/src/gl/base64.h
new file mode 100644
index 0000000..b7e155c
--- /dev/null
+++ b/src/gl/base64.h
@@ -0,0 +1,68 @@
+/* base64.h -- Encode binary data using printable characters.
+   Copyright (C) 2004-2006, 2009-2012 Free Software Foundation, Inc.
+   Written by Simon Josefsson.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef BASE64_H
+# define BASE64_H
+
+/* Get size_t. */
+# include <stddef.h>
+
+/* Get bool. */
+# include <stdbool.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+/* This uses that the expression (n+(k-1))/k means the smallest
+   integer >= n/k, i.e., the ceiling of n/k.  */
+# define BASE64_LENGTH(inlen) ((((inlen) + 2) / 3) * 4)
+
+struct base64_decode_context
+{
+  unsigned int i;
+  char buf[4];
+};
+
+extern bool isbase64 (char ch) _GL_ATTRIBUTE_CONST;
+
+extern void base64_encode (const char *restrict in, size_t inlen,
+                           char *restrict out, size_t outlen);
+
+extern size_t base64_encode_alloc (const char *in, size_t inlen, char **out);
+
+extern void base64_decode_ctx_init (struct base64_decode_context *ctx);
+
+extern bool base64_decode_ctx (struct base64_decode_context *ctx,
+                               const char *restrict in, size_t inlen,
+                               char *restrict out, size_t *outlen);
+
+extern bool base64_decode_alloc_ctx (struct base64_decode_context *ctx,
+                                     const char *in, size_t inlen,
+                                     char **out, size_t *outlen);
+
+#define base64_decode(in, inlen, out, outlen) \
+        base64_decode_ctx (NULL, in, inlen, out, outlen)
+
+#define base64_decode_alloc(in, inlen, out, outlen) \
+        base64_decode_alloc_ctx (NULL, in, inlen, out, outlen)
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif /* BASE64_H */
diff --git a/src/gl/errno.in.h b/src/gl/errno.in.h
index 2f42612..5e5af92 100644
--- a/src/gl/errno.in.h
+++ b/src/gl/errno.in.h
@@ -84,6 +84,16 @@
 #   define GNULIB_defined_ECANCELED 1
 #  endif
 
+#  ifndef EOWNERDEAD
+#   define EOWNERDEAD 133
+#   define GNULIB_defined_EOWNERDEAD 1
+#  endif
+
+#  ifndef ENOTRECOVERABLE
+#   define ENOTRECOVERABLE 127
+#   define GNULIB_defined_ENOTRECOVERABLE 1
+#  endif
+
 #  ifndef EINPROGRESS
 #   define EINPROGRESS     112
 #   define EALREADY        103
@@ -108,15 +118,17 @@
 #   define ELOOP           114
 #   define EHOSTUNREACH    110
 #   define EWOULDBLOCK     140
+#   define GNULIB_defined_ESOCK 1
+#  endif
+
+#  ifndef ETXTBSY
 #   define ETXTBSY         139
 #   define ENODATA         120  /* not required by POSIX */
 #   define ENOSR           124  /* not required by POSIX */
 #   define ENOSTR          125  /* not required by POSIX */
-#   define ENOTRECOVERABLE 127  /* not required by POSIX */
-#   define EOWNERDEAD      133  /* not required by POSIX */
 #   define ETIME           137  /* not required by POSIX */
 #   define EOTHER          131  /* not required by POSIX */
-#   define GNULIB_defined_ESOCK 1
+#   define GNULIB_defined_ESTREAMS 1
 #  endif
 
 /* These are intentionally the same values as the WSA* error numbers, defined
@@ -227,6 +239,36 @@
 #  define GNULIB_defined_ECANCELED 1
 # endif
 
+/* On many platforms, the macros EOWNERDEAD and ENOTRECOVERABLE are not
+   defined.  */
+
+# ifndef EOWNERDEAD
+#  if defined __sun
+    /* Use the same values as defined for Solaris >= 8, for
+       interoperability.  */
+#   define EOWNERDEAD      58
+#   define ENOTRECOVERABLE 59
+#  elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+    /* We have a conflict here: pthreads-win32 defines these values
+       differently than MSVC 10.  It's hairy to decide which one to use.  */
+#   if defined __MINGW32__ && !defined USE_WINDOWS_THREADS
+     /* Use the same values as defined by pthreads-win32, for
+        interoperability.  */
+#    define EOWNERDEAD      43
+#    define ENOTRECOVERABLE 44
+#   else
+     /* Use the same values as defined by MSVC 10, for
+        interoperability.  */
+#    define EOWNERDEAD      133
+#    define ENOTRECOVERABLE 127
+#   endif
+#  else
+#   define EOWNERDEAD      2013
+#   define ENOTRECOVERABLE 2014
+#  endif
+#  define GNULIB_defined_EOWNERDEAD 1
+#  define GNULIB_defined_ENOTRECOVERABLE 1
+# endif
 
 #endif /* address@hidden@_ERRNO_H */
 #endif /* address@hidden@_ERRNO_H */
diff --git a/src/gl/m4/base64.m4 b/src/gl/m4/base64.m4
new file mode 100644
index 0000000..fa0c192
--- /dev/null
+++ b/src/gl/m4/base64.m4
@@ -0,0 +1,16 @@
+# base64.m4 serial 3
+dnl Copyright (C) 2004, 2006, 2009-2012 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_BASE64],
+[
+  gl_PREREQ_BASE64
+])
+
+# Prerequisites of lib/base64.c.
+AC_DEFUN([gl_PREREQ_BASE64], [
+  AC_REQUIRE([AC_C_INLINE])
+  AC_REQUIRE([AC_C_RESTRICT])
+])
diff --git a/src/gl/m4/errno_h.m4 b/src/gl/m4/errno_h.m4
index 4f0bb83..1e76ba2 100644
--- a/src/gl/m4/errno_h.m4
+++ b/src/gl/m4/errno_h.m4
@@ -1,4 +1,4 @@
-# errno_h.m4 serial 10
+# errno_h.m4 serial 11
 dnl Copyright (C) 2004, 2006, 2008-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -10,6 +10,9 @@ AC_DEFUN_ONCE([gl_HEADER_ERRNO_H],
   AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [
     AC_EGREP_CPP([booboo],[
 #include <errno.h>
+#if !defined ETXTBSY
+booboo
+#endif
 #if !defined ENOMSG
 booboo
 #endif
@@ -49,6 +52,12 @@ booboo
 #if !defined ECANCELED
 booboo
 #endif
+#if !defined EOWNERDEAD
+booboo
+#endif
+#if !defined ENOTRECOVERABLE
+booboo
+#endif
       ],
       [gl_cv_header_errno_h_complete=no],
       [gl_cv_header_errno_h_complete=yes])
diff --git a/src/gl/m4/extensions.m4 b/src/gl/m4/extensions.m4
index 0bfaef6..6d17d8a 100644
--- a/src/gl/m4/extensions.m4
+++ b/src/gl/m4/extensions.m4
@@ -1,4 +1,4 @@
-# serial 11  -*- Autoconf -*-
+# serial 12  -*- Autoconf -*-
 # Enable extensions on systems that normally disable them.
 
 # Copyright (C) 2003, 2006-2012 Free Software Foundation, Inc.
@@ -67,7 +67,7 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
 #endif
-/* Enable general extensions on MacOS X.  */
+/* Enable general extensions on Mac OS X.  */
 #ifndef _DARWIN_C_SOURCE
 # undef _DARWIN_C_SOURCE
 #endif
diff --git a/src/gl/m4/getopt.m4 b/src/gl/m4/getopt.m4
index 2aea895..f6902b5 100644
--- a/src/gl/m4/getopt.m4
+++ b/src/gl/m4/getopt.m4
@@ -1,4 +1,4 @@
-# getopt.m4 serial 39
+# getopt.m4 serial 44
 dnl Copyright (C) 2002-2006, 2008-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -9,18 +9,17 @@ AC_DEFUN([gl_FUNC_GETOPT_POSIX],
 [
   m4_divert_text([DEFAULTS], [gl_getopt_required=POSIX])
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+  AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
   dnl Other modules can request the gnulib implementation of the getopt
   dnl functions unconditionally, by defining gl_REPLACE_GETOPT_ALWAYS.
   dnl argp.m4 does this.
   m4_ifdef([gl_REPLACE_GETOPT_ALWAYS], [
-    gl_GETOPT_IFELSE([], [])
     REPLACE_GETOPT=1
   ], [
     REPLACE_GETOPT=0
-    gl_GETOPT_IFELSE([
+    if test -n "$gl_replace_getopt"; then
       REPLACE_GETOPT=1
-    ],
-    [])
+    fi
   ])
   if test $REPLACE_GETOPT = 1; then
     dnl Arrange for getopt.h to be created.
@@ -38,13 +37,6 @@ AC_DEFUN([gl_FUNC_GETOPT_GNU],
   AC_REQUIRE([gl_FUNC_GETOPT_POSIX])
 ])
 
-# emacs' configure.in uses this.
-AC_DEFUN([gl_GETOPT_IFELSE],
-[
-  AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
-  AS_IF([test -n "$gl_replace_getopt"], [$1], [$2])
-])
-
 # Determine whether to replace the entire getopt facility.
 AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
 [
@@ -74,11 +66,6 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
     AC_CHECK_FUNCS([getopt_long_only], [], [gl_replace_getopt=yes])
   fi
 
-  dnl mingw's getopt (in libmingwex.a) does weird things when the options
-  dnl strings starts with '+' and it's not the first call.  Some internal state
-  dnl is left over from earlier calls, and neither setting optind = 0 nor
-  dnl setting optreset = 1 get rid of this internal state.
-  dnl POSIX is silent on optind vs. optreset, so we allow either behavior.
   dnl POSIX 2008 does not specify leading '+' behavior, but see
   dnl http://austingroupbugs.net/view.php?id=191 for a recommendation on
   dnl the next version of POSIX.  For now, we only guarantee leading '+'
@@ -87,30 +74,16 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
     AC_CACHE_CHECK([whether getopt is POSIX compatible],
       [gl_cv_func_getopt_posix],
       [
-        dnl BSD getopt_long uses an incompatible method to reset option
-        dnl processing.  Existence of the optreset variable, in and of
-        dnl itself, is not a reason to replace getopt, but knowledge
-        dnl of the variable is needed to determine how to reset and
-        dnl whether a reset reparses the environment.  Solaris
-        dnl supports neither optreset nor optind=0, but keeps no state
-        dnl that needs a reset beyond setting optind=1; detect Solaris
-        dnl by getopt_clip.
-        AC_LINK_IFELSE(
-          [AC_LANG_PROGRAM(
-             [[#include <unistd.h>]],
-             [[int *p = &optreset; return optreset;]])],
-          [gl_optind_min=1],
-          [AC_COMPILE_IFELSE(
-             [AC_LANG_PROGRAM(
-                [[#include <getopt.h>]],
-                [[return !getopt_clip;]])],
-             [gl_optind_min=1],
-             [gl_optind_min=0])])
-
-        dnl This test fails on mingw and succeeds on many other platforms.
-        gl_save_CPPFLAGS=$CPPFLAGS
-        CPPFLAGS="$CPPFLAGS -DOPTIND_MIN=$gl_optind_min"
-        AC_RUN_IFELSE([AC_LANG_SOURCE([[
+        dnl Merging these three different test programs into a single one
+        dnl would require a reset mechanism. On BSD systems, it can be done
+        dnl through 'optreset'; on some others (glibc), it can be done by
+        dnl setting 'optind' to 0; on others again (HP-UX, IRIX, OSF/1,
+        dnl Solaris 9, musl libc), there is no such mechanism.
+        if test $cross_compiling = no; then
+          dnl Sanity check. Succeeds everywhere (except on MSVC,
+          dnl which lacks <unistd.h> and getopt() entirely).
+          AC_RUN_IFELSE(
+            [AC_LANG_SOURCE([[
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
@@ -118,89 +91,107 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
 int
 main ()
 {
-  {
-    static char program[] = "program";
-    static char a[] = "-a";
-    static char foo[] = "foo";
-    static char bar[] = "bar";
-    char *argv[] = { program, a, foo, bar, NULL };
-    int c;
+  static char program[] = "program";
+  static char a[] = "-a";
+  static char foo[] = "foo";
+  static char bar[] = "bar";
+  char *argv[] = { program, a, foo, bar, NULL };
+  int c;
 
-    optind = OPTIND_MIN;
-    opterr = 0;
-
-    c = getopt (4, argv, "ab");
-    if (!(c == 'a'))
-      return 1;
-    c = getopt (4, argv, "ab");
-    if (!(c == -1))
-      return 2;
-    if (!(optind == 2))
-      return 3;
-  }
-  /* Some internal state exists at this point.  */
-  {
-    static char program[] = "program";
-    static char donald[] = "donald";
-    static char p[] = "-p";
-    static char billy[] = "billy";
-    static char duck[] = "duck";
-    static char a[] = "-a";
-    static char bar[] = "bar";
-    char *argv[] = { program, donald, p, billy, duck, a, bar, NULL };
-    int c;
+  c = getopt (4, argv, "ab");
+  if (!(c == 'a'))
+    return 1;
+  c = getopt (4, argv, "ab");
+  if (!(c == -1))
+    return 2;
+  if (!(optind == 2))
+    return 3;
+  return 0;
+}
+]])],
+            [gl_cv_func_getopt_posix=maybe],
+            [gl_cv_func_getopt_posix=no])
+          if test $gl_cv_func_getopt_posix = maybe; then
+            dnl Sanity check with '+'. Succeeds everywhere (except on MSVC,
+            dnl which lacks <unistd.h> and getopt() entirely).
+            AC_RUN_IFELSE(
+              [AC_LANG_SOURCE([[
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
 
-    optind = OPTIND_MIN;
-    opterr = 0;
+int
+main ()
+{
+  static char program[] = "program";
+  static char donald[] = "donald";
+  static char p[] = "-p";
+  static char billy[] = "billy";
+  static char duck[] = "duck";
+  static char a[] = "-a";
+  static char bar[] = "bar";
+  char *argv[] = { program, donald, p, billy, duck, a, bar, NULL };
+  int c;
 
-    c = getopt (7, argv, "+abp:q:");
-    if (!(c == -1))
-      return 4;
-    if (!(strcmp (argv[0], "program") == 0))
-      return 5;
-    if (!(strcmp (argv[1], "donald") == 0))
-      return 6;
-    if (!(strcmp (argv[2], "-p") == 0))
-      return 7;
-    if (!(strcmp (argv[3], "billy") == 0))
-      return 8;
-    if (!(strcmp (argv[4], "duck") == 0))
-      return 9;
-    if (!(strcmp (argv[5], "-a") == 0))
-      return 10;
-    if (!(strcmp (argv[6], "bar") == 0))
-      return 11;
-    if (!(optind == 1))
-      return 12;
-  }
-  /* Detect MacOS 10.5, AIX 7.1 bug.  */
-  {
-    static char program[] = "program";
-    static char ab[] = "-ab";
-    char *argv[3] = { program, ab, NULL };
-    optind = OPTIND_MIN;
-    opterr = 0;
-    if (getopt (2, argv, "ab:") != 'a')
-      return 13;
-    if (getopt (2, argv, "ab:") != '?')
-      return 14;
-    if (optopt != 'b')
-      return 15;
-    if (optind != 2)
-      return 16;
-  }
+  c = getopt (7, argv, "+abp:q:");
+  if (!(c == -1))
+    return 4;
+  if (!(strcmp (argv[0], "program") == 0))
+    return 5;
+  if (!(strcmp (argv[1], "donald") == 0))
+    return 6;
+  if (!(strcmp (argv[2], "-p") == 0))
+    return 7;
+  if (!(strcmp (argv[3], "billy") == 0))
+    return 8;
+  if (!(strcmp (argv[4], "duck") == 0))
+    return 9;
+  if (!(strcmp (argv[5], "-a") == 0))
+    return 10;
+  if (!(strcmp (argv[6], "bar") == 0))
+    return 11;
+  if (!(optind == 1))
+    return 12;
+  return 0;
+}
+]])],
+              [gl_cv_func_getopt_posix=maybe],
+              [gl_cv_func_getopt_posix=no])
+          fi
+          if test $gl_cv_func_getopt_posix = maybe; then
+            dnl Detect Mac OS X 10.5, AIX 7.1, mingw bug.
+            AC_RUN_IFELSE(
+              [AC_LANG_SOURCE([[
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
 
+int
+main ()
+{
+  static char program[] = "program";
+  static char ab[] = "-ab";
+  char *argv[3] = { program, ab, NULL };
+  if (getopt (2, argv, "ab:") != 'a')
+    return 13;
+  if (getopt (2, argv, "ab:") != '?')
+    return 14;
+  if (optopt != 'b')
+    return 15;
+  if (optind != 2)
+    return 16;
   return 0;
 }
 ]])],
-          [gl_cv_func_getopt_posix=yes], [gl_cv_func_getopt_posix=no],
-          [case "$host_os" in
-             mingw*)         gl_cv_func_getopt_posix="guessing no";;
-             darwin* | aix*) gl_cv_func_getopt_posix="guessing no";;
-             *)              gl_cv_func_getopt_posix="guessing yes";;
-           esac
-          ])
-        CPPFLAGS=$gl_save_CPPFLAGS
+              [gl_cv_func_getopt_posix=yes],
+              [gl_cv_func_getopt_posix=no])
+          fi
+        else
+          case "$host_os" in
+            darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";;
+            *)                       gl_cv_func_getopt_posix="guessing yes";;
+          esac
+        fi
       ])
     case "$gl_cv_func_getopt_posix" in
       *no) gl_replace_getopt=yes ;;
@@ -236,7 +227,7 @@ dnl is ambiguous with environment values that contain 
newlines.
              nocrash_init();
 
              /* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw,
-                and fails on MacOS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
+                and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
                 OSF/1 5.1, Solaris 10.  */
              {
                static char conftest[] = "conftest";
@@ -247,7 +238,7 @@ dnl is ambiguous with environment values that contain 
newlines.
                  result |= 1;
              }
              /* This code succeeds on glibc 2.8, mingw,
-                and fails on MacOS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
+                and fails on Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
                 IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x.  */
              {
                static char program[] = "program";
@@ -276,7 +267,7 @@ dnl is ambiguous with environment values that contain 
newlines.
                if (getopt (3, argv, "-p") != 1)
                  result |= 16;
                else if (getopt (3, argv, "-p") != 'p')
-                 result |= 32;
+                 result |= 16;
              }
              /* This code fails on glibc 2.11.  */
              {
@@ -286,9 +277,9 @@ dnl is ambiguous with environment values that contain 
newlines.
                char *argv[] = { program, b, a, NULL };
                optind = opterr = 0;
                if (getopt (3, argv, "+:a:b") != 'b')
-                 result |= 64;
+                 result |= 32;
                else if (getopt (3, argv, "+:a:b") != ':')
-                 result |= 64;
+                 result |= 32;
              }
              /* This code dumps core on glibc 2.14.  */
              {
@@ -298,18 +289,14 @@ dnl is ambiguous with environment values that contain 
newlines.
                char *argv[] = { program, w, dummy, NULL };
                optind = opterr = 1;
                if (getopt (3, argv, "W;") != 'W')
-                 result |= 128;
+                 result |= 64;
              }
              return result;
            ]])],
         [gl_cv_func_getopt_gnu=yes],
         [gl_cv_func_getopt_gnu=no],
-        [dnl Cross compiling. Guess based on host and declarations.
-         case $host_os:$ac_cv_have_decl_optreset in
-           *-gnu*:* | mingw*:*) gl_cv_func_getopt_gnu=no;;
-           *:yes)               gl_cv_func_getopt_gnu=no;;
-           *)                   gl_cv_func_getopt_gnu=yes;;
-         esac
+        [dnl Cross compiling. Assume the worst, even on glibc platforms.
+         gl_cv_func_getopt_gnu="guessing no"
         ])
        case $gl_had_POSIXLY_CORRECT in
          exported) ;;
@@ -317,13 +304,54 @@ dnl is ambiguous with environment values that contain 
newlines.
          *) AS_UNSET([POSIXLY_CORRECT]) ;;
        esac
       ])
-    if test "$gl_cv_func_getopt_gnu" = "no"; then
+    if test "$gl_cv_func_getopt_gnu" != yes; then
       gl_replace_getopt=yes
+    else
+      AC_CACHE_CHECK([for working GNU getopt_long function],
+        [gl_cv_func_getopt_long_gnu],
+        [AC_RUN_IFELSE(
+           [AC_LANG_PROGRAM(
+              [[#include <getopt.h>
+                #include <stddef.h>
+                #include <string.h>
+              ]],
+              [[static const struct option long_options[] =
+                  {
+                    { "xtremely-",no_argument,       NULL, 1003 },
+                    { "xtra",     no_argument,       NULL, 1001 },
+                    { "xtreme",   no_argument,       NULL, 1002 },
+                    { "xtremely", no_argument,       NULL, 1003 },
+                    { NULL,       0,                 NULL, 0 }
+                  };
+                /* This code fails on OpenBSD 5.0.  */
+                {
+                  static char program[] = "program";
+                  static char xtremel[] = "--xtremel";
+                  char *argv[] = { program, xtremel, NULL };
+                  int option_index;
+                  optind = 1; opterr = 0;
+                  if (getopt_long (2, argv, "", long_options, &option_index) 
!= 1003)
+                    return 1;
+                }
+                return 0;
+              ]])],
+           [gl_cv_func_getopt_long_gnu=yes],
+           [gl_cv_func_getopt_long_gnu=no],
+           [dnl Cross compiling. Guess no on OpenBSD, yes otherwise.
+            case "$host_os" in
+              openbsd*) gl_cv_func_getopt_long_gnu="guessing no";;
+              *)        gl_cv_func_getopt_long_gnu="guessing yes";;
+            esac
+           ])
+        ])
+      case "$gl_cv_func_getopt_long_gnu" in
+        *yes) ;;
+        *) gl_replace_getopt=yes ;;
+      esac
     fi
   fi
 ])
 
-# emacs' configure.in uses this.
 AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
 [
   GETOPT_H=getopt.h
@@ -334,7 +362,6 @@ AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
 ])
 
 # Prerequisites of lib/getopt*.
-# emacs' configure.in uses this.
 AC_DEFUN([gl_PREREQ_GETOPT],
 [
   AC_CHECK_DECLS_ONCE([getenv])
diff --git a/src/gl/m4/gnulib-cache.m4 b/src/gl/m4/gnulib-cache.m4
index f42238f..c88c5ab 100644
--- a/src/gl/m4/gnulib-cache.m4
+++ b/src/gl/m4/gnulib-cache.m4
@@ -27,11 +27,12 @@
 
 
 # Specification in the form of a command-line invocation:
-#   gnulib-tool --import --dir=. --local-dir=src/gl/override --lib=libgnu 
--source-base=src/gl --m4-base=src/gl/m4 --doc-base=doc 
--tests-base=src/gl/tests --aux-dir=build-aux --no-conditional-dependencies 
--libtool --macro-prefix=srcgl --no-vc-files error getopt-gnu progname 
version-etc
+#   gnulib-tool --import --dir=. --local-dir=src/gl/override --lib=libgnu 
--source-base=src/gl --m4-base=src/gl/m4 --doc-base=doc 
--tests-base=src/gl/tests --aux-dir=build-aux --no-conditional-dependencies 
--libtool --macro-prefix=srcgl --no-vc-files base64 error getopt-gnu progname 
version-etc
 
 # Specification in the form of a few gnulib-tool.m4 macro invocations:
 gl_LOCAL_DIR([src/gl/override])
 gl_MODULES([
+  base64
   error
   getopt-gnu
   progname
@@ -48,5 +49,5 @@ gl_MAKEFILE_NAME([])
 gl_LIBTOOL
 gl_MACRO_PREFIX([srcgl])
 gl_PO_DOMAIN([])
-gl_WITNESS_C_DOMAIN([])
+gl_WITNESS_C_MACRO([])
 gl_VC_FILES([false])
diff --git a/src/gl/m4/gnulib-common.m4 b/src/gl/m4/gnulib-common.m4
index ae4d254..15d2b2b 100644
--- a/src/gl/m4/gnulib-common.m4
+++ b/src/gl/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 32
+# gnulib-common.m4 serial 33
 dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,8 @@ AC_DEFUN([gl_COMMON], [
 AC_DEFUN([gl_COMMON_BODY], [
   AH_VERBATIM([_Noreturn],
 [/* The _Noreturn keyword of C11.  */
-#ifndef _Noreturn
+#if ! (defined _Noreturn \
+       || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
 # if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
       || 0x5110 <= __SUNPRO_C)
 #  define _Noreturn __attribute__ ((__noreturn__))
@@ -29,7 +30,7 @@ AC_DEFUN([gl_COMMON_BODY], [
 [/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
    the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
    earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
-   __APPLE__ && __MACH__ test for MacOS X.
+   __APPLE__ && __MACH__ test for Mac OS X.
    __APPLE_CC__ tests for the Apple compiler and its version.
    __STDC_VERSION__ tests for the C99 mode.  */
 #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined 
__cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
diff --git a/src/gl/m4/gnulib-comp.m4 b/src/gl/m4/gnulib-comp.m4
index b5038ce..35bcd51 100644
--- a/src/gl/m4/gnulib-comp.m4
+++ b/src/gl/m4/gnulib-comp.m4
@@ -38,6 +38,7 @@ AC_DEFUN([srcgl_EARLY],
   m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
   m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
   AC_REQUIRE([gl_PROG_AR_RANLIB])
+  # Code from module base64:
   # Code from module errno:
   # Code from module error:
   # Code from module extensions:
@@ -47,6 +48,7 @@ AC_DEFUN([srcgl_EARLY],
   # Code from module gettext-h:
   # Code from module include_next:
   # Code from module intprops:
+  # Code from module memchr:
   # Code from module msvc-inval:
   # Code from module msvc-nothrow:
   # Code from module nocrash:
@@ -61,10 +63,12 @@ AC_DEFUN([srcgl_EARLY],
   dnl gl_PROG_CC_C99 arranges for this.  With older Autoconf gl_PROG_CC_C99
   dnl shouldn't hurt, though installers are on their own to set c99 mode.
   gl_PROG_CC_C99
+  # Code from module stdbool:
   # Code from module stddef:
   # Code from module strerror:
   # Code from module strerror-override:
   # Code from module string:
+  # Code from module sys_types:
   # Code from module unistd:
   # Code from module verify:
   # Code from module version-etc:
@@ -84,6 +88,7 @@ AC_DEFUN([srcgl_INIT],
   m4_pushdef([srcgl_LIBSOURCES_DIR], [])
   gl_COMMON
   gl_source_base='src/gl'
+gl_FUNC_BASE64
 gl_HEADER_ERRNO_H
 gl_ERROR
 if test $ac_cv_lib_error_at_line = no; then
@@ -114,6 +119,12 @@ fi
 AC_SUBST([GNULIB_GL_SRCGL_UNISTD_H_GETOPT])
 AC_SUBST([LIBINTL])
 AC_SUBST([LTLIBINTL])
+gl_FUNC_MEMCHR
+if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
+  AC_LIBOBJ([memchr])
+  gl_PREREQ_MEMCHR
+fi
+gl_STRING_MODULE_INDICATOR([memchr])
 gl_MSVC_INVAL
 if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
   AC_LIBOBJ([msvc-inval])
@@ -126,6 +137,7 @@ AC_CHECK_DECLS([program_invocation_name], [], [], [#include 
<errno.h>])
 AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include <errno.h>])
 gt_TYPE_SSIZE_T
 gl_STDARG_H
+AM_STDBOOL_H
 gl_STDDEF_H
 gl_FUNC_STRERROR
 if test $REPLACE_STRERROR = 1; then
@@ -140,6 +152,8 @@ if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then
   gl_PREREQ_SYS_H_WINSOCK2
 fi
 gl_HEADER_STRING_H
+gl_SYS_TYPES_H
+AC_PROG_MKDIR_P
 gl_UNISTD_H
 gl_VERSION_ETC
   # End of code from modules
@@ -281,6 +295,8 @@ AC_DEFUN([srcgl_FILE_LIST], [
   build-aux/snippet/arg-nonnull.h
   build-aux/snippet/c++defs.h
   build-aux/snippet/warn-on-use.h
+  lib/base64.c
+  lib/base64.h
   lib/errno.in.h
   lib/error.c
   lib/error.h
@@ -290,6 +306,8 @@ AC_DEFUN([srcgl_FILE_LIST], [
   lib/getopt_int.h
   lib/gettext.h
   lib/intprops.h
+  lib/memchr.c
+  lib/memchr.valgrind
   lib/msvc-inval.c
   lib/msvc-inval.h
   lib/msvc-nothrow.c
@@ -297,31 +315,39 @@ AC_DEFUN([srcgl_FILE_LIST], [
   lib/progname.c
   lib/progname.h
   lib/stdarg.in.h
+  lib/stdbool.in.h
   lib/stddef.in.h
   lib/strerror-override.c
   lib/strerror-override.h
   lib/strerror.c
   lib/string.in.h
+  lib/sys_types.in.h
   lib/unistd.in.h
   lib/verify.h
   lib/version-etc.c
   lib/version-etc.h
   m4/00gnulib.m4
+  m4/base64.m4
   m4/errno_h.m4
   m4/error.m4
   m4/extensions.m4
   m4/getopt.m4
   m4/gnulib-common.m4
   m4/include_next.m4
+  m4/memchr.m4
+  m4/mmap-anon.m4
   m4/msvc-inval.m4
   m4/msvc-nothrow.m4
   m4/nocrash.m4
+  m4/off_t.m4
   m4/ssize_t.m4
   m4/stdarg.m4
+  m4/stdbool.m4
   m4/stddef_h.m4
   m4/strerror.m4
   m4/string_h.m4
   m4/sys_socket_h.m4
+  m4/sys_types_h.m4
   m4/unistd_h.m4
   m4/version-etc.m4
   m4/warn-on-use.m4
diff --git a/src/gl/m4/memchr.m4 b/src/gl/m4/memchr.m4
new file mode 100644
index 0000000..0040294
--- /dev/null
+++ b/src/gl/m4/memchr.m4
@@ -0,0 +1,88 @@
+# memchr.m4 serial 12
+dnl Copyright (C) 2002-2004, 2009-2012 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
+[
+  dnl Check for prerequisites for memory fence checks.
+  gl_FUNC_MMAP_ANON
+  AC_CHECK_HEADERS_ONCE([sys/mman.h])
+  AC_CHECK_FUNCS_ONCE([mprotect])
+
+  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+  m4_ifdef([gl_FUNC_MEMCHR_OBSOLETE], [
+    dnl These days, we assume memchr is present.  But if support for old
+    dnl platforms is desired:
+    AC_CHECK_FUNCS_ONCE([memchr])
+    if test $ac_cv_func_memchr = no; then
+      HAVE_MEMCHR=0
+    fi
+  ])
+  if test $HAVE_MEMCHR = 1; then
+    # Detect platform-specific bugs in some versions of glibc:
+    # memchr should not dereference anything with length 0
+    #   http://bugzilla.redhat.com/499689
+    # memchr should not dereference overestimated length after a match
+    #   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737
+    #   http://sourceware.org/bugzilla/show_bug.cgi?id=10162
+    # Assume that memchr works on platforms that lack mprotect.
+    AC_CACHE_CHECK([whether memchr works], [gl_cv_func_memchr_works],
+      [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <string.h>
+#if HAVE_SYS_MMAN_H
+# include <fcntl.h>
+# include <unistd.h>
+# include <sys/types.h>
+# include <sys/mman.h>
+# ifndef MAP_FILE
+#  define MAP_FILE 0
+# endif
+#endif
+]], [[
+  int result = 0;
+  char *fence = NULL;
+#if HAVE_SYS_MMAN_H && HAVE_MPROTECT
+# if HAVE_MAP_ANONYMOUS
+  const int flags = MAP_ANONYMOUS | MAP_PRIVATE;
+  const int fd = -1;
+# else /* !HAVE_MAP_ANONYMOUS */
+  const int flags = MAP_FILE | MAP_PRIVATE;
+  int fd = open ("/dev/zero", O_RDONLY, 0666);
+  if (fd >= 0)
+# endif
+    {
+      int pagesize = getpagesize ();
+      char *two_pages =
+        (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE,
+                       flags, fd, 0);
+      if (two_pages != (char *)(-1)
+          && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0)
+        fence = two_pages + pagesize;
+    }
+#endif
+  if (fence)
+    {
+      if (memchr (fence, 0, 0))
+        result |= 1;
+      strcpy (fence - 9, "12345678");
+      if (memchr (fence - 9, 0, 79) != fence - 1)
+        result |= 2;
+      if (memchr (fence - 1, 0, 3) != fence - 1)
+        result |= 4;
+    }
+  return result;
+]])], [gl_cv_func_memchr_works=yes], [gl_cv_func_memchr_works=no],
+      [dnl Be pessimistic for now.
+       gl_cv_func_memchr_works="guessing no"])])
+    if test "$gl_cv_func_memchr_works" != yes; then
+      REPLACE_MEMCHR=1
+    fi
+  fi
+])
+
+# Prerequisites of lib/memchr.c.
+AC_DEFUN([gl_PREREQ_MEMCHR], [
+  AC_CHECK_HEADERS([bp-sym.h])
+])
diff --git a/src/gl/m4/mmap-anon.m4 b/src/gl/m4/mmap-anon.m4
new file mode 100644
index 0000000..748b17d
--- /dev/null
+++ b/src/gl/m4/mmap-anon.m4
@@ -0,0 +1,55 @@
+# mmap-anon.m4 serial 10
+dnl Copyright (C) 2005, 2007, 2009-2012 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Detect how mmap can be used to create anonymous (not file-backed) memory
+# mappings.
+# - On Linux, AIX, OSF/1, Solaris, Cygwin, Interix, Haiku, both MAP_ANONYMOUS
+#   and MAP_ANON exist and have the same value.
+# - On HP-UX, only MAP_ANONYMOUS exists.
+# - On Mac OS X, FreeBSD, NetBSD, OpenBSD, only MAP_ANON exists.
+# - On IRIX, neither exists, and a file descriptor opened to /dev/zero must be
+#   used.
+
+AC_DEFUN([gl_FUNC_MMAP_ANON],
+[
+  dnl Persuade glibc <sys/mman.h> to define MAP_ANONYMOUS.
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+  # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
+  # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
+  # irrelevant for anonymous mappings.
+  AC_CHECK_FUNC([mmap], [gl_have_mmap=yes], [gl_have_mmap=no])
+
+  # Try to allow MAP_ANONYMOUS.
+  gl_have_mmap_anonymous=no
+  if test $gl_have_mmap = yes; then
+    AC_MSG_CHECKING([for MAP_ANONYMOUS])
+    AC_EGREP_CPP([I cannot identify this map], [
+#include <sys/mman.h>
+#ifdef MAP_ANONYMOUS
+    I cannot identify this map
+#endif
+],
+      [gl_have_mmap_anonymous=yes])
+    if test $gl_have_mmap_anonymous != yes; then
+      AC_EGREP_CPP([I cannot identify this map], [
+#include <sys/mman.h>
+#ifdef MAP_ANON
+    I cannot identify this map
+#endif
+],
+        [AC_DEFINE([MAP_ANONYMOUS], [MAP_ANON],
+          [Define to a substitute value for mmap()'s MAP_ANONYMOUS flag.])
+         gl_have_mmap_anonymous=yes])
+    fi
+    AC_MSG_RESULT([$gl_have_mmap_anonymous])
+    if test $gl_have_mmap_anonymous = yes; then
+      AC_DEFINE([HAVE_MAP_ANONYMOUS], [1],
+        [Define to 1 if mmap()'s MAP_ANONYMOUS flag is available after 
including
+         config.h and <sys/mman.h>.])
+    fi
+  fi
+])
diff --git a/src/gl/m4/nocrash.m4 b/src/gl/m4/nocrash.m4
index 08ef825..c2638df 100644
--- a/src/gl/m4/nocrash.m4
+++ b/src/gl/m4/nocrash.m4
@@ -1,4 +1,4 @@
-# nocrash.m4 serial 3
+# nocrash.m4 serial 4
 dnl Copyright (C) 2005, 2009-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -18,7 +18,7 @@ dnl          int main() { nocrash_init(); ... }
 AC_DEFUN([GL_NOCRASH],[[
 #include <stdlib.h>
 #if defined __MACH__ && defined __APPLE__
-/* Avoid a crash on MacOS X.  */
+/* Avoid a crash on Mac OS X.  */
 #include <mach/mach.h>
 #include <mach/mach_error.h>
 #include <mach/thread_status.h>
diff --git a/src/gl/m4/off_t.m4 b/src/gl/m4/off_t.m4
new file mode 100644
index 0000000..dfca2df
--- /dev/null
+++ b/src/gl/m4/off_t.m4
@@ -0,0 +1,18 @@
+# off_t.m4 serial 1
+dnl Copyright (C) 2012 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Check whether to override the 'off_t' type.
+dnl Set WINDOWS_64_BIT_OFF_T.
+
+AC_DEFUN([gl_TYPE_OFF_T],
+[
+  m4_ifdef([gl_LARGEFILE], [
+    AC_REQUIRE([gl_LARGEFILE])
+  ], [
+    WINDOWS_64_BIT_OFF_T=0
+  ])
+  AC_SUBST([WINDOWS_64_BIT_OFF_T])
+])
diff --git a/src/gl/m4/stdbool.m4 b/src/gl/m4/stdbool.m4
new file mode 100644
index 0000000..eabfa64
--- /dev/null
+++ b/src/gl/m4/stdbool.m4
@@ -0,0 +1,100 @@
+# Check for stdbool.h that conforms to C99.
+
+dnl Copyright (C) 2002-2006, 2009-2012 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# Prepare for substituting <stdbool.h> if it is not supported.
+
+AC_DEFUN([AM_STDBOOL_H],
+[
+  AC_REQUIRE([AC_CHECK_HEADER_STDBOOL])
+
+  # Define two additional variables used in the Makefile substitution.
+
+  if test "$ac_cv_header_stdbool_h" = yes; then
+    STDBOOL_H=''
+  else
+    STDBOOL_H='stdbool.h'
+  fi
+  AC_SUBST([STDBOOL_H])
+  AM_CONDITIONAL([GL_GENERATE_STDBOOL_H], [test -n "$STDBOOL_H"])
+
+  if test "$ac_cv_type__Bool" = yes; then
+    HAVE__BOOL=1
+  else
+    HAVE__BOOL=0
+  fi
+  AC_SUBST([HAVE__BOOL])
+])
+
+# AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future.
+AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H])
+
+# This version of the macro is needed in autoconf <= 2.68.
+
+AC_DEFUN([AC_CHECK_HEADER_STDBOOL],
+  [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
+     [ac_cv_header_stdbool_h],
+     [AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[
+             #include <stdbool.h>
+             #ifndef bool
+              "error: bool is not defined"
+             #endif
+             #ifndef false
+              "error: false is not defined"
+             #endif
+             #if false
+              "error: false is not 0"
+             #endif
+             #ifndef true
+              "error: true is not defined"
+             #endif
+             #if true != 1
+              "error: true is not 1"
+             #endif
+             #ifndef __bool_true_false_are_defined
+              "error: __bool_true_false_are_defined is not defined"
+             #endif
+
+             struct s { _Bool s: 1; _Bool t; } s;
+
+             char a[true == 1 ? 1 : -1];
+             char b[false == 0 ? 1 : -1];
+             char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+             char d[(bool) 0.5 == true ? 1 : -1];
+             /* See body of main program for 'e'.  */
+             char f[(_Bool) 0.0 == false ? 1 : -1];
+             char g[true];
+             char h[sizeof (_Bool)];
+             char i[sizeof s.t];
+             enum { j = false, k = true, l = false * true, m = true * 256 };
+             /* The following fails for
+                HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
+             _Bool n[m];
+             char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+             char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+             /* Catch a bug in an HP-UX C compiler.  See
+                http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+                
http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+              */
+             _Bool q = true;
+             _Bool *pq = &q;
+           ]],
+           [[
+             bool e = &s;
+             *pq |= q;
+             *pq |= ! q;
+             /* Refer to every declared value, to avoid compiler 
optimizations.  */
+             return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + 
!!l
+                     + !m + !n + !o + !p + !q + !pq);
+           ]])],
+        [ac_cv_header_stdbool_h=yes],
+        [ac_cv_header_stdbool_h=no])])
+   AC_CHECK_TYPES([_Bool])
+])
diff --git a/src/gl/m4/strerror.m4 b/src/gl/m4/strerror.m4
index 6bf14ef..1c96e52 100644
--- a/src/gl/m4/strerror.m4
+++ b/src/gl/m4/strerror.m4
@@ -1,4 +1,4 @@
-# strerror.m4 serial 16
+# strerror.m4 serial 17
 dnl Copyright (C) 2002, 2007-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -9,6 +9,7 @@ AC_DEFUN([gl_FUNC_STRERROR],
   AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
   AC_REQUIRE([gl_HEADER_ERRNO_H])
   AC_REQUIRE([gl_FUNC_STRERROR_0])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   m4_ifdef([gl_FUNC_STRERROR_R_WORKS], [
     AC_REQUIRE([gl_FUNC_STRERROR_R_WORKS])
   ])
@@ -22,14 +23,22 @@ AC_DEFUN([gl_FUNC_STRERROR],
            [[if (!*strerror (-2)) return 1;]])],
         [gl_cv_func_working_strerror=yes],
         [gl_cv_func_working_strerror=no],
-        [dnl Be pessimistic on cross-compiles for now.
-         gl_cv_func_working_strerror="guessing no"])
+        [case "$host_os" in
+                   # Guess yes on glibc systems.
+           *-gnu*) gl_cv_func_working_strerror="guessing yes" ;;
+                   # If we don't know, assume the worst.
+           *)      gl_cv_func_working_strerror="guessing no" ;;
+         esac
+        ])
     ])
-    if test "$gl_cv_func_working_strerror" != yes; then
-      dnl The system's strerror() fails to return a string for out-of-range
-      dnl integers. Replace it.
-      REPLACE_STRERROR=1
-    fi
+    case "$gl_cv_func_working_strerror" in
+      *yes) ;;
+      *)
+        dnl The system's strerror() fails to return a string for out-of-range
+        dnl integers. Replace it.
+        REPLACE_STRERROR=1
+        ;;
+    esac
     m4_ifdef([gl_FUNC_STRERROR_R_WORKS], [
       dnl If the system's strerror_r or __xpg_strerror_r clobbers strerror's
       dnl buffer, we must replace strerror.
@@ -48,6 +57,7 @@ dnl Detect if strerror(0) passes (that is, does not set 
errno, and does not
 dnl return a string that matches strerror(-1)).
 AC_DEFUN([gl_FUNC_STRERROR_0],
 [
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   REPLACE_STRERROR_0=0
   AC_CACHE_CHECK([whether strerror(0) succeeds],
    [gl_cv_func_strerror_0_works],
@@ -67,12 +77,20 @@ AC_DEFUN([gl_FUNC_STRERROR_0],
            return result;]])],
       [gl_cv_func_strerror_0_works=yes],
       [gl_cv_func_strerror_0_works=no],
-      [dnl Be pessimistic on cross-compiles for now.
-       gl_cv_func_strerror_0_works="guessing no"])
+      [case "$host_os" in
+                 # Guess yes on glibc systems.
+         *-gnu*) gl_cv_func_strerror_0_works="guessing yes" ;;
+                 # If we don't know, assume the worst.
+         *)      gl_cv_func_strerror_0_works="guessing no" ;;
+       esac
+      ])
   ])
-  if test "$gl_cv_func_strerror_0_works" != yes; then
-    REPLACE_STRERROR_0=1
-    AC_DEFINE([REPLACE_STRERROR_0], [1], [Define to 1 if strerror(0)
-      does not return a message implying success.])
-  fi
+  case "$gl_cv_func_strerror_0_works" in
+    *yes) ;;
+    *)
+      REPLACE_STRERROR_0=1
+      AC_DEFINE([REPLACE_STRERROR_0], [1], [Define to 1 if strerror(0)
+        does not return a message implying success.])
+      ;;
+  esac
 ])
diff --git a/src/gl/m4/sys_types_h.m4 b/src/gl/m4/sys_types_h.m4
new file mode 100644
index 0000000..f11eef2
--- /dev/null
+++ b/src/gl/m4/sys_types_h.m4
@@ -0,0 +1,24 @@
+# sys_types_h.m4 serial 4
+dnl Copyright (C) 2011-2012 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_SYS_TYPES_H],
+[
+  AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS])
+  gl_NEXT_HEADERS([sys/types.h])
+
+  dnl Ensure the type pid_t gets defined.
+  AC_REQUIRE([AC_TYPE_PID_T])
+
+  dnl Ensure the type mode_t gets defined.
+  AC_REQUIRE([AC_TYPE_MODE_T])
+
+  dnl Whether to override the 'off_t' type.
+  AC_REQUIRE([gl_TYPE_OFF_T])
+])
+
+AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS],
+[
+])
diff --git a/src/gl/m4/unistd_h.m4 b/src/gl/m4/unistd_h.m4
index 7595534..7e7651b 100644
--- a/src/gl/m4/unistd_h.m4
+++ b/src/gl/m4/unistd_h.m4
@@ -1,4 +1,4 @@
-# unistd_h.m4 serial 63
+# unistd_h.m4 serial 65
 dnl Copyright (C) 2006-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -24,6 +24,9 @@ AC_DEFUN([gl_UNISTD_H],
   dnl Ensure the type pid_t gets defined.
   AC_REQUIRE([AC_TYPE_PID_T])
 
+  dnl Determine WINDOWS_64_BIT_OFF_T.
+  AC_REQUIRE([gl_TYPE_OFF_T])
+
   dnl Check for declarations of anything we want to poison if the
   dnl corresponding gnulib module is not in use.
   gl_WARN_ON_USE_PREPARE([[
@@ -155,6 +158,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   REPLACE_DUP=0;          AC_SUBST([REPLACE_DUP])
   REPLACE_DUP2=0;         AC_SUBST([REPLACE_DUP2])
   REPLACE_FCHOWNAT=0;     AC_SUBST([REPLACE_FCHOWNAT])
+  REPLACE_FTRUNCATE=0;    AC_SUBST([REPLACE_FTRUNCATE])
   REPLACE_GETCWD=0;       AC_SUBST([REPLACE_GETCWD])
   REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME])
   REPLACE_GETLOGIN_R=0;   AC_SUBST([REPLACE_GETLOGIN_R])
diff --git a/src/gl/memchr.c b/src/gl/memchr.c
new file mode 100644
index 0000000..b8fb0ef
--- /dev/null
+++ b/src/gl/memchr.c
@@ -0,0 +1,172 @@
+/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2012
+   Free Software Foundation, Inc.
+
+   Based on strlen implementation by Torbjorn Granlund (address@hidden),
+   with help from Dan Sahlin (address@hidden) and
+   commentary by Jim Blandy (address@hidden);
+   adaptation to memchr suggested by Dick Karpinski (address@hidden),
+   and implemented by Roland McGrath (address@hidden).
+
+NOTE: The canonical source of this file is maintained with the GNU C Library.
+Bugs can be reported to address@hidden
+
+This program is free software: you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3 of the License, or any
+later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef _LIBC
+# include <config.h>
+#endif
+
+#include <string.h>
+
+#include <stddef.h>
+
+#if defined _LIBC
+# include <memcopy.h>
+#else
+# define reg_char char
+#endif
+
+#include <limits.h>
+
+#if HAVE_BP_SYM_H || defined _LIBC
+# include <bp-sym.h>
+#else
+# define BP_SYM(sym) sym
+#endif
+
+#undef __memchr
+#ifdef _LIBC
+# undef memchr
+#endif
+
+#ifndef weak_alias
+# define __memchr memchr
+#endif
+
+/* Search no more than N bytes of S for C.  */
+void *
+__memchr (void const *s, int c_in, size_t n)
+{
+  /* On 32-bit hardware, choosing longword to be a 32-bit unsigned
+     long instead of a 64-bit uintmax_t tends to give better
+     performance.  On 64-bit hardware, unsigned long is generally 64
+     bits already.  Change this typedef to experiment with
+     performance.  */
+  typedef unsigned long int longword;
+
+  const unsigned char *char_ptr;
+  const longword *longword_ptr;
+  longword repeated_one;
+  longword repeated_c;
+  unsigned reg_char c;
+
+  c = (unsigned char) c_in;
+
+  /* Handle the first few bytes by reading one byte at a time.
+     Do this until CHAR_PTR is aligned on a longword boundary.  */
+  for (char_ptr = (const unsigned char *) s;
+       n > 0 && (size_t) char_ptr % sizeof (longword) != 0;
+       --n, ++char_ptr)
+    if (*char_ptr == c)
+      return (void *) char_ptr;
+
+  longword_ptr = (const longword *) char_ptr;
+
+  /* All these elucidatory comments refer to 4-byte longwords,
+     but the theory applies equally well to any size longwords.  */
+
+  /* Compute auxiliary longword values:
+     repeated_one is a value which has a 1 in every byte.
+     repeated_c has c in every byte.  */
+  repeated_one = 0x01010101;
+  repeated_c = c | (c << 8);
+  repeated_c |= repeated_c << 16;
+  if (0xffffffffU < (longword) -1)
+    {
+      repeated_one |= repeated_one << 31 << 1;
+      repeated_c |= repeated_c << 31 << 1;
+      if (8 < sizeof (longword))
+        {
+          size_t i;
+
+          for (i = 64; i < sizeof (longword) * 8; i *= 2)
+            {
+              repeated_one |= repeated_one << i;
+              repeated_c |= repeated_c << i;
+            }
+        }
+    }
+
+  /* Instead of the traditional loop which tests each byte, we will test a
+     longword at a time.  The tricky part is testing if *any of the four*
+     bytes in the longword in question are equal to c.  We first use an xor
+     with repeated_c.  This reduces the task to testing whether *any of the
+     four* bytes in longword1 is zero.
+
+     We compute tmp =
+       ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7).
+     That is, we perform the following operations:
+       1. Subtract repeated_one.
+       2. & ~longword1.
+       3. & a mask consisting of 0x80 in every byte.
+     Consider what happens in each byte:
+       - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff,
+         and step 3 transforms it into 0x80.  A carry can also be propagated
+         to more significant bytes.
+       - If a byte of longword1 is nonzero, let its lowest 1 bit be at
+         position k (0 <= k <= 7); so the lowest k bits are 0.  After step 1,
+         the byte ends in a single bit of value 0 and k bits of value 1.
+         After step 2, the result is just k bits of value 1: 2^k - 1.  After
+         step 3, the result is 0.  And no carry is produced.
+     So, if longword1 has only non-zero bytes, tmp is zero.
+     Whereas if longword1 has a zero byte, call j the position of the least
+     significant zero byte.  Then the result has a zero at positions 0, ...,
+     j-1 and a 0x80 at position j.  We cannot predict the result at the more
+     significant bytes (positions j+1..3), but it does not matter since we
+     already have a non-zero bit at position 8*j+7.
+
+     So, the test whether any byte in longword1 is zero is equivalent to
+     testing whether tmp is nonzero.  */
+
+  while (n >= sizeof (longword))
+    {
+      longword longword1 = *longword_ptr ^ repeated_c;
+
+      if ((((longword1 - repeated_one) & ~longword1)
+           & (repeated_one << 7)) != 0)
+        break;
+      longword_ptr++;
+      n -= sizeof (longword);
+    }
+
+  char_ptr = (const unsigned char *) longword_ptr;
+
+  /* At this point, we know that either n < sizeof (longword), or one of the
+     sizeof (longword) bytes starting at char_ptr is == c.  On little-endian
+     machines, we could determine the first such byte without any further
+     memory accesses, just by looking at the tmp result from the last loop
+     iteration.  But this does not work on big-endian machines.  Choose code
+     that works in both cases.  */
+
+  for (; n > 0; --n, ++char_ptr)
+    {
+      if (*char_ptr == c)
+        return (void *) char_ptr;
+    }
+
+  return NULL;
+}
+#ifdef weak_alias
+weak_alias (__memchr, BP_SYM (memchr))
+#endif
diff --git a/src/gl/memchr.valgrind b/src/gl/memchr.valgrind
new file mode 100644
index 0000000..60f247e
--- /dev/null
+++ b/src/gl/memchr.valgrind
@@ -0,0 +1,14 @@
+# Suppress a valgrind message about use of uninitialized memory in memchr().
+# POSIX states that when the character is found, memchr must not read extra
+# bytes in an overestimated length (for example, where memchr is used to
+# implement strnlen).  However, we use a safe word read to provide a speedup.
+{
+    memchr-value4
+    Memcheck:Value4
+    fun:rpl_memchr
+}
+{
+    memchr-value8
+    Memcheck:Value8
+    fun:rpl_memchr
+}
diff --git a/src/gl/override/lib/gettext.h.diff 
b/src/gl/override/lib/gettext.h.diff
index f8db15d..d4c27c8 100644
--- a/src/gl/override/lib/gettext.h.diff
+++ b/src/gl/override/lib/gettext.h.diff
@@ -1,182 +1,179 @@
---- gl/gettext.h.orig  2011-11-21 14:07:46.505832414 +0100
-+++ gl/gettext.h       2011-11-21 14:07:54.178335478 +0100
-@@ -108,179 +108,4 @@
-    initializer for static 'char[]' or 'const char[]' variables.  */
- #define gettext_noop(String) String
- 
--/* The separator between msgctxt and msgid in a .mo file.  */
--#define GETTEXT_CONTEXT_GLUE "\004"
--
--/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a
--   MSGID.  MSGCTXT and MSGID must be string literals.  MSGCTXT should be
--   short and rarely need to change.
--   The letter 'p' stands for 'particular' or 'special'.  */
--#ifdef DEFAULT_TEXT_DOMAIN
--# define pgettext(Msgctxt, Msgid) \
--   pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, 
Msgid, LC_MESSAGES)
--#else
--# define pgettext(Msgctxt, Msgid) \
--   pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
--#endif
--#define dpgettext(Domainname, Msgctxt, Msgid) \
--  pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
LC_MESSAGES)
--#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \
--  pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
Category)
--#ifdef DEFAULT_TEXT_DOMAIN
--# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
--   npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, 
Msgid, MsgidPlural, N, LC_MESSAGES)
--#else
--# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
--   npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, LC_MESSAGES)
--#endif
--#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
--  npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, LC_MESSAGES)
--#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \
--  npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, Category)
--
--#ifdef __GNUC__
--__inline
--#else
--#ifdef __cplusplus
--inline
--#endif
--#endif
--static const char *
--pgettext_aux (const char *domain,
--              const char *msg_ctxt_id, const char *msgid,
--              int category)
--{
--  const char *translation = dcgettext (domain, msg_ctxt_id, category);
--  if (translation == msg_ctxt_id)
--    return msgid;
--  else
--    return translation;
--}
--
--#ifdef __GNUC__
--__inline
--#else
--#ifdef __cplusplus
--inline
--#endif
--#endif
--static const char *
--npgettext_aux (const char *domain,
--               const char *msg_ctxt_id, const char *msgid,
--               const char *msgid_plural, unsigned long int n,
--               int category)
--{
--  const char *translation =
--    dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
--  if (translation == msg_ctxt_id || translation == msgid_plural)
--    return (n == 1 ? msgid : msgid_plural);
--  else
--    return translation;
--}
--
--/* The same thing extended for non-constant arguments.  Here MSGCTXT and MSGID
--   can be arbitrary expressions.  But for string literals these macros are
--   less efficient than those above.  */
--
--#include <string.h>
--
--#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \
--  (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
--   /* || __STDC_VERSION__ >= 199901L */ )
--
--#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
--#include <stdlib.h>
--#endif
--
--#define pgettext_expr(Msgctxt, Msgid) \
--  dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES)
--#define dpgettext_expr(Domainname, Msgctxt, Msgid) \
--  dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES)
--
--#ifdef __GNUC__
--__inline
--#else
--#ifdef __cplusplus
--inline
--#endif
--#endif
--static const char *
--dcpgettext_expr (const char *domain,
--                 const char *msgctxt, const char *msgid,
--                 int category)
--{
--  size_t msgctxt_len = strlen (msgctxt) + 1;
--  size_t msgid_len = strlen (msgid) + 1;
--  const char *translation;
--#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
--  char msg_ctxt_id[msgctxt_len + msgid_len];
--#else
--  char buf[1024];
--  char *msg_ctxt_id =
--    (msgctxt_len + msgid_len <= sizeof (buf)
--     ? buf
--     : (char *) malloc (msgctxt_len + msgid_len));
--  if (msg_ctxt_id != NULL)
--#endif
--    {
--      memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
--      msg_ctxt_id[msgctxt_len - 1] = '\004';
--      memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
--      translation = dcgettext (domain, msg_ctxt_id, category);
--#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
--      if (msg_ctxt_id != buf)
--        free (msg_ctxt_id);
--#endif
--      if (translation != msg_ctxt_id)
--        return translation;
--    }
--  return msgid;
--}
--
--#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \
--  dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
--#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
--  dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
--
--#ifdef __GNUC__
--__inline
--#else
--#ifdef __cplusplus
--inline
--#endif
--#endif
--static const char *
--dcnpgettext_expr (const char *domain,
--                  const char *msgctxt, const char *msgid,
--                  const char *msgid_plural, unsigned long int n,
--                  int category)
--{
--  size_t msgctxt_len = strlen (msgctxt) + 1;
--  size_t msgid_len = strlen (msgid) + 1;
--  const char *translation;
--#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
--  char msg_ctxt_id[msgctxt_len + msgid_len];
--#else
--  char buf[1024];
--  char *msg_ctxt_id =
--    (msgctxt_len + msgid_len <= sizeof (buf)
--     ? buf
--     : (char *) malloc (msgctxt_len + msgid_len));
--  if (msg_ctxt_id != NULL)
--#endif
--    {
--      memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
--      msg_ctxt_id[msgctxt_len - 1] = '\004';
--      memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
--      translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, 
category);
--#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
--      if (msg_ctxt_id != buf)
--        free (msg_ctxt_id);
--#endif
--      if (!(translation == msg_ctxt_id || translation == msgid_plural))
--        return translation;
--    }
--  return (n == 1 ? msgid : msgid_plural);
--}
--
- #endif /* _LIBGETTEXT_H */
+110,287d109
+< /* The separator between msgctxt and msgid in a .mo file.  */
+< #define GETTEXT_CONTEXT_GLUE "\004"
+< 
+< /* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a
+<    MSGID.  MSGCTXT and MSGID must be string literals.  MSGCTXT should be
+<    short and rarely need to change.
+<    The letter 'p' stands for 'particular' or 'special'.  */
+< #ifdef DEFAULT_TEXT_DOMAIN
+< # define pgettext(Msgctxt, Msgid) \
+<    pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, 
Msgid, LC_MESSAGES)
+< #else
+< # define pgettext(Msgctxt, Msgid) \
+<    pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
LC_MESSAGES)
+< #endif
+< #define dpgettext(Domainname, Msgctxt, Msgid) \
+<   pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
LC_MESSAGES)
+< #define dcpgettext(Domainname, Msgctxt, Msgid, Category) \
+<   pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
Category)
+< #ifdef DEFAULT_TEXT_DOMAIN
+< # define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
+<    npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, 
Msgid, MsgidPlural, N, LC_MESSAGES)
+< #else
+< # define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
+<    npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, LC_MESSAGES)
+< #endif
+< #define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
+<   npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, LC_MESSAGES)
+< #define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \
+<   npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, 
MsgidPlural, N, Category)
+< 
+< #ifdef __GNUC__
+< __inline
+< #else
+< #ifdef __cplusplus
+< inline
+< #endif
+< #endif
+< static const char *
+< pgettext_aux (const char *domain,
+<               const char *msg_ctxt_id, const char *msgid,
+<               int category)
+< {
+<   const char *translation = dcgettext (domain, msg_ctxt_id, category);
+<   if (translation == msg_ctxt_id)
+<     return msgid;
+<   else
+<     return translation;
+< }
+< 
+< #ifdef __GNUC__
+< __inline
+< #else
+< #ifdef __cplusplus
+< inline
+< #endif
+< #endif
+< static const char *
+< npgettext_aux (const char *domain,
+<                const char *msg_ctxt_id, const char *msgid,
+<                const char *msgid_plural, unsigned long int n,
+<                int category)
+< {
+<   const char *translation =
+<     dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
+<   if (translation == msg_ctxt_id || translation == msgid_plural)
+<     return (n == 1 ? msgid : msgid_plural);
+<   else
+<     return translation;
+< }
+< 
+< /* The same thing extended for non-constant arguments.  Here MSGCTXT and 
MSGID
+<    can be arbitrary expressions.  But for string literals these macros are
+<    less efficient than those above.  */
+< 
+< #include <string.h>
+< 
+< #if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
+<      /* || __STDC_VERSION__ >= 199901L */ )
+< # define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1
+< #else
+< # define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0
+< #endif
+< 
+< #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+< #include <stdlib.h>
+< #endif
+< 
+< #define pgettext_expr(Msgctxt, Msgid) \
+<   dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES)
+< #define dpgettext_expr(Domainname, Msgctxt, Msgid) \
+<   dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES)
+< 
+< #ifdef __GNUC__
+< __inline
+< #else
+< #ifdef __cplusplus
+< inline
+< #endif
+< #endif
+< static const char *
+< dcpgettext_expr (const char *domain,
+<                  const char *msgctxt, const char *msgid,
+<                  int category)
+< {
+<   size_t msgctxt_len = strlen (msgctxt) + 1;
+<   size_t msgid_len = strlen (msgid) + 1;
+<   const char *translation;
+< #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+<   char msg_ctxt_id[msgctxt_len + msgid_len];
+< #else
+<   char buf[1024];
+<   char *msg_ctxt_id =
+<     (msgctxt_len + msgid_len <= sizeof (buf)
+<      ? buf
+<      : (char *) malloc (msgctxt_len + msgid_len));
+<   if (msg_ctxt_id != NULL)
+< #endif
+<     {
+<       memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
+<       msg_ctxt_id[msgctxt_len - 1] = '\004';
+<       memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
+<       translation = dcgettext (domain, msg_ctxt_id, category);
+< #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+<       if (msg_ctxt_id != buf)
+<         free (msg_ctxt_id);
+< #endif
+<       if (translation != msg_ctxt_id)
+<         return translation;
+<     }
+<   return msgid;
+< }
+< 
+< #define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \
+<   dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
+< #define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
+<   dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
+< 
+< #ifdef __GNUC__
+< __inline
+< #else
+< #ifdef __cplusplus
+< inline
+< #endif
+< #endif
+< static const char *
+< dcnpgettext_expr (const char *domain,
+<                   const char *msgctxt, const char *msgid,
+<                   const char *msgid_plural, unsigned long int n,
+<                   int category)
+< {
+<   size_t msgctxt_len = strlen (msgctxt) + 1;
+<   size_t msgid_len = strlen (msgid) + 1;
+<   const char *translation;
+< #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+<   char msg_ctxt_id[msgctxt_len + msgid_len];
+< #else
+<   char buf[1024];
+<   char *msg_ctxt_id =
+<     (msgctxt_len + msgid_len <= sizeof (buf)
+<      ? buf
+<      : (char *) malloc (msgctxt_len + msgid_len));
+<   if (msg_ctxt_id != NULL)
+< #endif
+<     {
+<       memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
+<       msg_ctxt_id[msgctxt_len - 1] = '\004';
+<       memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
+<       translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, 
category);
+< #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+<       if (msg_ctxt_id != buf)
+<         free (msg_ctxt_id);
+< #endif
+<       if (!(translation == msg_ctxt_id || translation == msgid_plural))
+<         return translation;
+<     }
+<   return (n == 1 ? msgid : msgid_plural);
+< }
+< 
diff --git a/src/gl/stdbool.in.h b/src/gl/stdbool.in.h
new file mode 100644
index 0000000..ed1f9aa
--- /dev/null
+++ b/src/gl/stdbool.in.h
@@ -0,0 +1,121 @@
+/* Copyright (C) 2001-2003, 2006-2012 Free Software Foundation, Inc.
+   Written by Bruno Haible <address@hidden>, 2001.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef _GL_STDBOOL_H
+#define _GL_STDBOOL_H
+
+/* ISO C 99 <stdbool.h> for platforms that lack it.  */
+
+/* Usage suggestions:
+
+   Programs that use <stdbool.h> should be aware of some limitations
+   and standards compliance issues.
+
+   Standards compliance:
+
+       - <stdbool.h> must be #included before 'bool', 'false', 'true'
+         can be used.
+
+       - You cannot assume that sizeof (bool) == 1.
+
+       - Programs should not undefine the macros bool, true, and false,
+         as C99 lists that as an "obsolescent feature".
+
+   Limitations of this substitute, when used in a C89 environment:
+
+       - <stdbool.h> must be #included before the '_Bool' type can be used.
+
+       - You cannot assume that _Bool is a typedef; it might be a macro.
+
+       - Bit-fields of type 'bool' are not supported.  Portable code
+         should use 'unsigned int foo : 1;' rather than 'bool foo : 1;'.
+
+       - In C99, casts and automatic conversions to '_Bool' or 'bool' are
+         performed in such a way that every nonzero value gets converted
+         to 'true', and zero gets converted to 'false'.  This doesn't work
+         with this substitute.  With this substitute, only the values 0 and 1
+         give the expected result when converted to _Bool' or 'bool'.
+
+       - C99 allows the use of (_Bool)0.0 in constant expressions, but
+         this substitute cannot always provide this property.
+
+   Also, it is suggested that programs use 'bool' rather than '_Bool';
+   this isn't required, but 'bool' is more common.  */
+
+
+/* 7.16. Boolean type and values */
+
+/* BeOS <sys/socket.h> already #defines false 0, true 1.  We use the same
+   definitions below, but temporarily we have to #undef them.  */
+#if defined __BEOS__ && !defined __HAIKU__
+# include <OS.h> /* defines bool but not _Bool */
+# undef false
+# undef true
+#endif
+
+/* For the sake of symbolic names in gdb, we define true and false as
+   enum constants, not only as macros.
+   It is tempting to write
+      typedef enum { false = 0, true = 1 } _Bool;
+   so that gdb prints values of type 'bool' symbolically. But if we do
+   this, values of type '_Bool' may promote to 'int' or 'unsigned int'
+   (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int'
+   (see ISO C 99 6.3.1.1.(2)).  So we add a negative value to the
+   enum; this ensures that '_Bool' promotes to 'int'.  */
+#if defined __cplusplus || (defined __BEOS__ && !defined __HAIKU__)
+  /* A compiler known to have 'bool'.  */
+  /* If the compiler already has both 'bool' and '_Bool', we can assume they
+     are the same types.  */
+# if address@hidden@
+typedef bool _Bool;
+# endif
+#else
+# if !defined __GNUC__
+   /* If @HAVE__BOOL@:
+        Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when
+        the built-in _Bool type is used.  See
+          http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+          http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+          http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
+        Similar bugs are likely with other compilers as well; this file
+        wouldn't be used if <stdbool.h> was working.
+        So we override the _Bool type.
+      If address@hidden@:
+        Need to define _Bool ourselves. As 'signed char' or as an enum type?
+        Use of a typedef, with SunPRO C, leads to a stupid
+          "warning: _Bool is a keyword in ISO C99".
+        Use of an enum type, with IRIX cc, leads to a stupid
+          "warning(1185): enumerated type mixed with another type".
+        Even the existence of an enum type, without a typedef,
+          "Invalid enumerator. (badenum)" with HP-UX cc on Tru64.
+        The only benefit of the enum, debuggability, is not important
+        with these compilers.  So use 'signed char' and no enum.  */
+#  define _Bool signed char
+# else
+   /* With this compiler, trust the _Bool type if the compiler has it.  */
+#  if address@hidden@
+typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
+#  endif
+# endif
+#endif
+#define bool _Bool
+
+/* The other macros must be usable in preprocessor directives.  */
+#define false 0
+#define true 1
+#define __bool_true_false_are_defined 1
+
+#endif /* _GL_STDBOOL_H */
diff --git a/src/gl/strerror-override.c b/src/gl/strerror-override.c
index 9ca6523..9f55cfa 100644
--- a/src/gl/strerror-override.c
+++ b/src/gl/strerror-override.c
@@ -89,6 +89,8 @@ strerror_override (int errnum)
       return "No route to host";
     case EWOULDBLOCK:
       return "Operation would block";
+#endif
+#if GNULIB_defined_ESTREAMS /* native Windows platforms with older <errno.h> */
     case ETXTBSY:
       return "Text file busy";
     case ENODATA:
@@ -97,10 +99,6 @@ strerror_override (int errnum)
       return "Out of streams resources";
     case ENOSTR:
       return "Device not a stream";
-    case ENOTRECOVERABLE:
-      return "State not recoverable";
-    case EOWNERDEAD:
-      return "Owner died";
     case ETIME:
       return "Timer expired";
     case EOTHER:
@@ -283,6 +281,16 @@ strerror_override (int errnum)
       return "Operation canceled";
 #endif
 
+#if GNULIB_defined_EOWNERDEAD
+    case EOWNERDEAD:
+      return "Owner died";
+#endif
+
+#if GNULIB_defined_ENOTRECOVERABLE
+    case ENOTRECOVERABLE:
+      return "State not recoverable";
+#endif
+
     default:
       return NULL;
     }
diff --git a/src/gl/strerror-override.h b/src/gl/strerror-override.h
index 09526ea..fe1fb2c 100644
--- a/src/gl/strerror-override.h
+++ b/src/gl/strerror-override.h
@@ -30,6 +30,7 @@
    describing the error.  Otherwise return NULL.  */
 # if REPLACE_STRERROR_0 \
      || GNULIB_defined_ESOCK \
+     || GNULIB_defined_ESTREAMS \
      || GNULIB_defined_EWINSOCK \
      || GNULIB_defined_ENOMSG \
      || GNULIB_defined_EIDRM \
@@ -43,7 +44,9 @@
      || GNULIB_defined_ECONNABORTED \
      || GNULIB_defined_ESTALE \
      || GNULIB_defined_EDQUOT \
-     || GNULIB_defined_ECANCELED
+     || GNULIB_defined_ECANCELED \
+     || GNULIB_defined_EOWNERDEAD \
+     || GNULIB_defined_ENOTRECOVERABLE
 extern const char *strerror_override (int errnum);
 # else
 #  define strerror_override(ignored) NULL
diff --git a/src/gl/sys_types.in.h b/src/gl/sys_types.in.h
new file mode 100644
index 0000000..8139d98
--- /dev/null
+++ b/src/gl/sys_types.in.h
@@ -0,0 +1,51 @@
+/* Provide a more complete sys/types.h.
+
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
+#if __GNUC__ >= 3
address@hidden@
+#endif
address@hidden@
+
+#ifndef address@hidden@_SYS_TYPES_H
+
+/* The include_next requires a split double-inclusion guard.  */
address@hidden@ @NEXT_SYS_TYPES_H@
+
+#ifndef address@hidden@_SYS_TYPES_H
+#define address@hidden@_SYS_TYPES_H
+
+/* Override off_t if Large File Support is requested on native Windows.  */
+#if @WINDOWS_64_BIT_OFF_T@
+/* Same as int64_t in <stdint.h>.  */
+# if defined _MSC_VER
+#  define off_t __int64
+# else
+#  define off_t long long int
+# endif
+/* Indicator, for gnulib internal purposes.  */
+# define _GL_WINDOWS_64_BIT_OFF_T 1
+#endif
+
+/* MSVC 9 defines size_t in <stddef.h>, not in <sys/types.h>.  */
+/* But avoid namespace pollution on glibc systems.  */
+#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
+    && ! defined __GLIBC__
+# include <stddef.h>
+#endif
+
+#endif /* address@hidden@_SYS_TYPES_H */
+#endif /* address@hidden@_SYS_TYPES_H */
diff --git a/src/gl/unistd.in.h b/src/gl/unistd.in.h
index 1b26c09..e904e51 100644
--- a/src/gl/unistd.in.h
+++ b/src/gl/unistd.in.h
@@ -107,8 +107,9 @@
 # include <netdb.h>
 #endif
 
-/* MSVC defines off_t in <sys/types.h>.  */
-#if address@hidden@
+/* MSVC defines off_t in <sys/types.h>.
+   May also define off_t to a 64-bit type on native Windows.  */
+#if address@hidden@ || @WINDOWS_64_BIT_OFF_T@
 /* Get off_t.  */
 # include <sys/types.h>
 #endif
@@ -562,10 +563,19 @@ _GL_WARN_ON_USE (fsync, "fsync is unportable - "
    Return 0 if successful, otherwise -1 and errno set.
    See the POSIX:2008 specification
    <http://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html>. 
 */
-# if address@hidden@
+# if @REPLACE_FTRUNCATE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef ftruncate
+#   define ftruncate rpl_ftruncate
+#  endif
+_GL_FUNCDECL_RPL (ftruncate, int, (int fd, off_t length));
+_GL_CXXALIAS_RPL (ftruncate, int, (int fd, off_t length));
+# else
+#  if address@hidden@
 _GL_FUNCDECL_SYS (ftruncate, int, (int fd, off_t length));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (ftruncate, int, (int fd, off_t length));
+# endif
 _GL_CXXALIASWARN (ftruncate);
 #elif defined GNULIB_POSIXCHECK
 # undef ftruncate
@@ -1308,7 +1318,7 @@ _GL_WARN_ON_USE (rmdir, "rmdir is unportable - "
 _GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len)
                                     _GL_ARG_NONNULL ((1)));
 # endif
-/* Need to cast, because on Solaris 11 2011-10, MacOS X 10.5, IRIX 6.5
+/* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, IRIX 6.5
    and FreeBSD 6.4 the second parameter is int.  On Solaris 11
    2011-10, the first parameter is not const.  */
 _GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len));
diff --git a/src/gl/verify.h b/src/gl/verify.h
index cef14ad..0c320b1 100644
--- a/src/gl/verify.h
+++ b/src/gl/verify.h
@@ -125,7 +125,7 @@
        extern int (*dummy (void)) [sizeof (struct {...})];
 
    * GCC warns about duplicate declarations of the dummy function if
-     -Wredundant_decls is used.  GCC 4.3 and later have a builtin
+     -Wredundant-decls is used.  GCC 4.3 and later have a builtin
      __COUNTER__ macro that can let us generate unique identifiers for
      each dummy function, to suppress this warning.
 
@@ -133,6 +133,10 @@
      which do not support _Static_assert, also do not warn about the
      last declaration mentioned above.
 
+   * GCC warns if -Wnested-externs is enabled and verify() is used
+     within a function body; but inside a function, you can always
+     arrange to use verify_expr() instead.
+
    * In C++, any struct definition inside sizeof is invalid.
      Use a template type to work around the problem.  */
 
diff --git a/src/gss.c b/src/gss.c
index 96255c7..02b9289 100644
--- a/src/gss.c
+++ b/src/gss.c
@@ -25,6 +25,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <errno.h>
 
 /* For gettext. */
 #include <locale.h>
@@ -38,8 +39,9 @@
 #include "gss_cmd.h"
 
 /* Gnulib utils. */
-#include "progname.h"
+#include "base64.h"
 #include "error.h"
+#include "progname.h"
 #include "version-etc.h"
 
 const char version_etc_copyright[] =
@@ -85,6 +87,17 @@ Mandatory arguments to long options are mandatory for short 
options too.\n\
   -m, --major=LONG  Describe a `major status' error code value.\n\
 "), stdout);
       fputs (_("\
+  -a, --accept-sec-context\n\
+                    Accept a security context as server.\n\
+  -i, --init-sec-context=MECH\n\
+                    Initialize a security context as client.\n\
+                    MECH is the SASL name of mechanism, use -l\n\
+                    to list supported mechanisms.\n\
+  -n, address@hidden
+                    For -i, set the name of the remote host.\n\
+                    For example, \"address@hidden".\n\
+"), stdout);
+      fputs (_("\
   -q, --quiet       Silent operation (default=off).\n\
 "), stdout);
       emit_bug_reporting_address ();
@@ -284,6 +297,234 @@ list_mechanisms (unsigned quiet)
   return 0;
 }
 
+static ssize_t
+gettrimline (char **line, size_t * n, FILE * fh)
+{
+  ssize_t s = getline (line, n, fh);
+
+  if (s >= 2)
+    {
+      if ((*line)[strlen (*line) - 1] == '\n')
+       (*line)[strlen (*line) - 1] = '\0';
+      if ((*line)[strlen (*line) - 1] == '\r')
+       (*line)[strlen (*line) - 1] = '\0';
+    }
+
+  return s;
+}
+
+static int
+init_sec_context (unsigned quiet, const char *mech, const char *server)
+{
+  OM_uint32 maj, min;
+  gss_ctx_id_t ctx = GSS_C_NO_CONTEXT;
+  gss_name_t servername = GSS_C_NO_NAME;
+  gss_buffer_desc inbuf_desc;
+  gss_buffer_t inbuf = GSS_C_NO_BUFFER;
+  gss_buffer_desc bufdesc;
+  gss_buffer_desc sasl_mech_name;
+  gss_OID mech_type;
+  size_t outlen;
+  char *out;
+  ssize_t s;
+  char *line = NULL;
+  size_t n = 0;
+  bool ok;
+  OM_uint32 ret_flags;
+
+  sasl_mech_name.length = strlen (mech);
+  sasl_mech_name.value = (void*) mech;
+
+  maj = gss_inquire_mech_for_saslname (&min, &sasl_mech_name, &mech_type);
+  if (GSS_ERROR (maj))
+    error (EXIT_FAILURE, 0,
+          _("inquiring mechanism for SASL name (%d/%d)"), maj, min);
+
+  if (server)
+    {
+      gss_buffer_desc namebuf;
+
+      namebuf.length = strlen (server);
+      namebuf.value = (void*) server;
+
+      maj = gss_import_name (&min, &namebuf, GSS_C_NT_HOSTBASED_SERVICE,
+                            &servername);
+      if (GSS_ERROR (maj))
+       error (EXIT_FAILURE, 0,
+              _("could not import server name \"%s\" (%d/%d)"),
+              server, maj, min);
+    }
+
+  do
+    {
+      maj = gss_init_sec_context (&min,
+                                 GSS_C_NO_CREDENTIAL,
+                                 &ctx,
+                                 servername,
+                                 mech_type,
+                                 GSS_C_MUTUAL_FLAG |
+                                 GSS_C_REPLAY_FLAG |
+                                 GSS_C_SEQUENCE_FLAG,
+                                 0,
+                                 GSS_C_NO_CHANNEL_BINDINGS,
+                                 inbuf, NULL,
+                                 &bufdesc,
+                                 &ret_flags, NULL);
+      if (GSS_ERROR (maj))
+       error (EXIT_FAILURE, 0,
+              _("initializing security context failed (%d/%d)"), maj, min);
+
+      outlen = base64_encode_alloc (bufdesc.value, bufdesc.length, &out);
+      if (out == NULL && outlen == 0 && bufdesc.length != 0)
+       error (EXIT_FAILURE, 0, _("base64 input too long"));
+      if (out == NULL)
+       error (EXIT_FAILURE, errno, _("malloc"));
+
+      if (!quiet)
+       {
+         if (maj == GSS_S_COMPLETE && bufdesc.length == 0)
+           printf ("Context has been initialized.\n");
+         else if (maj == GSS_S_COMPLETE)
+           printf ("Context has been initialized.  Final context token:\n");
+         else if (maj == GSS_S_CONTINUE_NEEDED &&
+                  (ret_flags & GSS_C_PROT_READY_FLAG))
+           printf ("Context token (protection is available):\n");
+         else if (maj == GSS_S_CONTINUE_NEEDED)
+           printf ("Context token:\n");
+       }
+      if (bufdesc.length != 0)
+       printf ("%s\n", out);
+
+      free (out);
+
+      if (maj == GSS_S_COMPLETE)
+       break;
+
+      if (!quiet)
+       printf ("Input context token:\n");
+
+      s = gettrimline (&line, &n, stdin);
+      if (s == -1 && !feof (stdin))
+       error (EXIT_FAILURE, errno, _("getline"));
+      if (s == -1)
+       error (EXIT_FAILURE, 0, _("EOF"));
+
+      ok = base64_decode_alloc (line, strlen (line), &out, &outlen);
+      if (!ok)
+       error (EXIT_FAILURE, 0, _("base64 fail"));
+      if (out == NULL)
+       error (EXIT_FAILURE, errno, _("malloc"));
+
+      inbuf_desc.value = out;
+      inbuf_desc.length = outlen;
+      inbuf = &inbuf_desc;
+    }
+  while (maj == GSS_S_CONTINUE_NEEDED);
+
+  return 0;
+}
+
+static int
+accept_sec_context (unsigned quiet, const char *server)
+{
+  OM_uint32 maj, min;
+  gss_ctx_id_t ctx = GSS_C_NO_CONTEXT;
+  gss_name_t servername = GSS_C_NO_NAME;
+  gss_cred_id_t cred = GSS_C_NO_CREDENTIAL;
+  gss_name_t client = GSS_C_NO_NAME;
+  gss_buffer_desc bufdesc, bufdesc2;
+  gss_OID mech_type;
+  char *out;
+  size_t outlen;
+  ssize_t s;
+  char *line = NULL;
+  size_t n = 0;
+  bool ok;
+  OM_uint32 ret_flags;
+
+  if (server)
+    {
+      gss_buffer_desc namebuf;
+
+      namebuf.length = strlen (server);
+      namebuf.value = (void*) server;
+
+      maj = gss_import_name (&min, &namebuf, GSS_C_NT_HOSTBASED_SERVICE,
+                            &servername);
+      if (GSS_ERROR (maj))
+       error (EXIT_FAILURE, 0,
+              _("could not import server name \"%s\" (%d/%d)"),
+              server, maj, min);
+    }
+
+  maj = gss_acquire_cred (&min, servername, 0,
+                         GSS_C_NULL_OID_SET, GSS_C_ACCEPT,
+                         &cred, NULL, NULL);
+  if (GSS_ERROR (maj))
+    error (EXIT_FAILURE, 0,
+          _("could not acquire server creentials (%d/%d)"), maj, min);
+
+  do
+    {
+      if (!quiet)
+       printf ("Input context token:\n");
+
+      s = gettrimline (&line, &n, stdin);
+      if (s == -1 && !feof (stdin))
+       error (EXIT_FAILURE, errno, _("getline"));
+      if (s == -1)
+       error (EXIT_FAILURE, 0, _("EOF"));
+
+      ok = base64_decode_alloc (line, strlen (line), &out, &outlen);
+      if (!ok)
+       error (EXIT_FAILURE, 0, _("base64 fail"));
+      if (out == NULL)
+       error (EXIT_FAILURE, errno, _("malloc"));
+
+      bufdesc.value = out;
+      bufdesc.length = outlen;
+
+      maj = gss_accept_sec_context (&min,
+                                   &ctx,
+                                   cred,
+                                   &bufdesc,
+                                   GSS_C_NO_CHANNEL_BINDINGS,
+                                   &client,
+                                   &mech_type,
+                                   &bufdesc2,
+                                   &ret_flags, NULL, NULL);
+      if (GSS_ERROR (maj))
+       error (EXIT_FAILURE, 0,
+              _("accepting security context failed (%d/%d)"), maj, min);
+
+      outlen = base64_encode_alloc (bufdesc2.value, bufdesc2.length, &out);
+      if (out == NULL && outlen == 0 && bufdesc2.length != 0)
+       error (EXIT_FAILURE, 0, _("base64 input too long"));
+      if (out == NULL)
+       error (EXIT_FAILURE, errno, _("malloc"));
+
+      if (!quiet)
+       {
+         if (maj == GSS_S_COMPLETE && bufdesc2.length == 0)
+           printf ("Context has been accepted.\n");
+         else if (maj == GSS_S_COMPLETE)
+           printf ("Context has been accepted.  Final context token:\n");
+         else if (maj == GSS_S_CONTINUE_NEEDED &&
+                  (ret_flags & GSS_C_PROT_READY_FLAG))
+           printf ("Context token (protection is available):\n");
+         else if (maj == GSS_S_CONTINUE_NEEDED)
+           printf ("Context token:\n");
+       }
+      if (bufdesc2.length != 0)
+       printf ("%s\n", out);
+
+      free (out);
+    }
+  while (maj == GSS_S_CONTINUE_NEEDED);
+
+  return 0;
+}
+
 int
 main (int argc, char *argv[])
 {
@@ -311,6 +552,11 @@ main (int argc, char *argv[])
     rc = describe_major (args.quiet_given, args.major_arg);
   else if (args.list_mechanisms_given)
     rc = list_mechanisms (args.quiet_given);
+  else if (args.init_sec_context_given)
+    rc = init_sec_context (args.quiet_given, args.init_sec_context_arg,
+                          args.server_name_arg);
+  else if (args.accept_sec_context_given)
+    rc = accept_sec_context (args.quiet_given, args.server_name_arg);
   else
     usage (EXIT_SUCCESS);
 
diff --git a/src/gss.ggo b/src/gss.ggo
index b153dc4..c65069d 100644
--- a/src/gss.ggo
+++ b/src/gss.ggo
@@ -22,4 +22,7 @@ purpose "Command line interface to GSS, used to explain error 
codes."
 
 option "major" m "See gss.c for doc string" long no
 option "list-mechanisms" l "See gss.c for doc string" no
+option "accept-sec-context" a "See gss.c for doc string" no
+option "init-sec-context" i "See gss.c for doc string" string no
+option "server-name" n "See gss.c for doc string" string no
 option "quiet" q "Silent operation" flag off
diff --git a/tests/saslname.c b/tests/saslname.c
index cf8c7b0..e6f650d 100644
--- a/tests/saslname.c
+++ b/tests/saslname.c
@@ -38,7 +38,9 @@ main (int argc, char *argv[])
 {
   gss_uint32 maj_stat, min_stat;
   gss_buffer_desc bufdesc;
+#ifdef USE_KERBEROS5
   gss_OID oid;
+#endif
 
   do
     if (strcmp (argv[argc - 1], "-v") == 0 ||


hooks/post-receive
-- 
GNU gss



reply via email to

[Prev in Thread] Current Thread [Next in Thread]