/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to plugins.d/askpass-fifo.c

  • Committer: Teddy Hogeborn
  • Date: 2019-07-18 00:02:43 UTC
  • Revision ID: teddy@recompile.se-20190718000243-okz4s9xao1r1tfnx
Document bug in mandos-keygen which strips white space from passwords

Passwords, as read by mandos-keygen when given the --password or -p
options, are stripped of white space from the start and from the end
of the password.  This is because mandos-keygen is a shell script, and
the Bourne Shell "read" builtin does not seem to have a way to avoid
this.  Document this bug.

* manods-keygen.xml (OPTIONS): Document the white space-stripping
                               nature of the --password/-p option, and
                               also note in the description of
                               --passfile and -F that they avoid this
                               behavior.
  (BUGS): Again mention the problem with the --password and -p
          options, and suggest --passfile as a possible workaround.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
/*
3
3
 * Askpass-FIFO - Read a password from a FIFO and output it
4
4
 * 
5
 
 * Copyright © 2008-2019, 2021 Teddy Hogeborn
6
 
 * Copyright © 2008-2019, 2021 Björn Påhlsson
 
5
 * Copyright © 2008-2019 Teddy Hogeborn
 
6
 * Copyright © 2008-2019 Björn Påhlsson
7
7
 * 
8
8
 * This file is part of Mandos.
9
9
 * 
23
23
 * Contact the authors at <mandos@recompile.se>.
24
24
 */
25
25
 
26
 
#define _GNU_SOURCE             /* vasprintf(),
27
 
                                   program_invocation_short_name */
28
 
#include <sys/types.h>          /* uid_t, gid_t, getuid(), getgid(),
29
 
                                   setgid(), setuid() */
30
 
#include <unistd.h>             /* uid_t, gid_t, ssize_t, getuid(),
31
 
                                   getgid(), setgid(), setuid(),
32
 
                                   read(), close(), write(),
33
 
                                   STDOUT_FILENO */
34
 
#include <stdarg.h>             /* va_list, va_start(), vfprintf() */
35
 
#include <stdio.h>              /* vasprintf(), fprintf(), stderr,
36
 
                                   vfprintf() */
37
 
#include <errno.h>              /* program_invocation_short_name,
38
 
                                   errno, EACCES, ENOTDIR, ELOOP,
 
26
#define _GNU_SOURCE             /* TEMP_FAILURE_RETRY() */
 
27
#include <sys/types.h>          /* uid_t, gid_t, ssize_t */
 
28
#include <sys/stat.h>           /* mkfifo(), S_IRUSR, S_IWUSR */
 
29
#include <iso646.h>             /* and */
 
30
#include <errno.h>              /* errno, EACCES, ENOTDIR, ELOOP,
39
31
                                   ENAMETOOLONG, ENOSPC, EROFS,
40
32
                                   ENOENT, EEXIST, EFAULT, EMFILE,
41
33
                                   ENFILE, ENOMEM, EBADF, EINVAL, EIO,
42
34
                                   EISDIR, EFBIG */
43
 
#include <string.h>             /* strerror() */
44
35
#include <error.h>              /* error() */
45
 
#include <stdlib.h>             /* free(), realloc(), EXIT_SUCCESS */
46
 
#include <sys/stat.h>           /* mkfifo(), S_IRUSR, S_IWUSR */
47
 
#include <sysexits.h>           /* EX_OSFILE, EX_OSERR,
 
36
#include <stdio.h>              /* fprintf(), vfprintf(),
 
37
                                   vasprintf() */
 
38
#include <stdlib.h>             /* EXIT_FAILURE, NULL, size_t, free(),
 
39
                                   realloc(), EXIT_SUCCESS */
 
40
#include <fcntl.h>              /* open(), O_RDONLY */
 
41
#include <unistd.h>             /* read(), close(), write(),
 
42
                                   STDOUT_FILENO */
 
43
#include <sysexits.h>           /* EX_OSERR, EX_OSFILE,
48
44
                                   EX_UNAVAILABLE, EX_IOERR */
49
 
#include <fcntl.h>              /* open(), O_RDONLY */
50
 
#include <stddef.h>             /* NULL, size_t */
 
45
#include <string.h>             /* strerror() */
 
46
#include <stdarg.h>             /* va_list, va_start(), ... */
51
47
 
52
48
uid_t uid = 65534;
53
49
gid_t gid = 65534;