/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/plymouth.c

  • Committer: teddy at recompile
  • Date: 2020-02-05 21:39:28 UTC
  • Revision ID: teddy@recompile.se-20200205213928-vpvt0fwfg47ikv6f
Allow users to alter ask-password-mandos.service

If a user uses dracut with systemd and wishes to modify the options
passed to password-agent(8mandos) or mandos-client(8mandos), they
should be able to do so by simply creating a file
/etc/systemd/system/ask-password-mandos.service.d/override.conf,
containing, for instance:

[Service]
Environment=MANDOS_CLIENT_OPTIONS=--debug

Adding PASSWORD_AGENT_OPTIONS should also be possible (but should not
normally be needed).

* dracut-module/ask-password-mandos.service ([Service]/ExecStart): Add
  $PASSWORD_AGENT_OPTIONS before "--" and "$MANDOS_CLIENT_OPTIONS" to
  end of line.
* dracut-module/module-setup.sh (install): Install all files named
  /etc/systemd/system/ask-password-mandos.service.d/*.conf if any
  exists.  Also add --dh-params before $MANDOS_CLIENT_OPTIONS instead
  of at end of line.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
                                   STDERR_FILENO, execv(), access() */
45
45
#include <stdlib.h>             /* free(), EXIT_FAILURE, realloc(),
46
46
                                   EXIT_SUCCESS, malloc(), _exit(),
47
 
                                   getenv(), reallocarray() */
 
47
                                   getenv() */
48
48
#include <dirent.h>             /* scandir(), alphasort() */
49
49
#include <inttypes.h>           /* intmax_t, strtoumax(), SCNuMAX */
50
50
#include <sys/stat.h>           /* struct stat, lstat() */
204
204
    char **tmp;
205
205
    int i = 0;
206
206
    for (; argv[i] != NULL; i++){
207
 
#if defined(__GLIBC_PREREQ) and __GLIBC_PREREQ(2, 26)
208
 
      tmp = reallocarray(new_argv, ((size_t)i + 2),
209
 
                         sizeof(const char *));
210
 
#else
211
 
      if(((size_t)i + 2) > (SIZE_MAX / sizeof(const char *))){
212
 
        /* overflow */
213
 
        tmp = NULL;
214
 
        errno = ENOMEM;
215
 
      } else {
216
 
        tmp = realloc(new_argv, ((size_t)i + 2) * sizeof(const char *));
217
 
      }
218
 
#endif
 
207
      tmp = realloc(new_argv, sizeof(const char *) * ((size_t)i + 2));
219
208
      if(tmp == NULL){
220
 
        error_plus(0, errno, "reallocarray");
 
209
        error_plus(0, errno, "realloc");
221
210
        free(new_argv);
222
211
        _exit(EX_OSERR);
223
212
      }