/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 Hogeborn
  • Date: 2010-09-12 03:00:40 UTC
  • Revision ID: teddy@fukt.bsnet.se-20100912030040-b0uopyennste9fdh
Documentation changes:

* DBUS-API: New file documenting the server D-Bus interface.

* clients.conf: Add examples of new approval settings.

* debian/mandos.docs: Added "DBUS-API".

* mandos-clients.conf.xml (OPTIONS): Added "approved_by_default",
                                     "approval_delay", and
                                     "approval_duration".
* mandos.xml (D-BUS INTERFACE): Refer to the "DBUS-API" file.
  (BUGS): Remove mention of lack of a remote query interface.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <sysexits.h>           /* EX_OSERR */
25
25
#include <error.h>              /* error() */
26
26
#include <errno.h>              /* TEMP_FAILURE_RETRY */
27
 
#include <argz.h>               /* argz_count(), argz_extract() */
 
27
#include <stdarg.h>
28
28
 
29
29
sig_atomic_t interrupted_by_signal = 0;
30
30
const char plymouth_pid[] = "/dev/.initramfs/plymouth.pid";
286
286
  }
287
287
  
288
288
  /* we got cmdline and cmdline_len, ignore rest... */
289
 
  char **argv = malloc((argz_count(cmdline, cmdline_len) + 1)
290
 
                       * sizeof(char *)); /* Get number of args */
291
 
  if(argv == NULL){
292
 
    error(0, errno, "argv = malloc()");
293
 
    free(cmdline);
294
 
    return NULL;
 
289
  const char **argv = NULL;
 
290
  size_t argv_size = 0;
 
291
  for(char *arg = cmdline; arg-cmdline < (ssize_t)cmdline_len;
 
292
      arg = strchr(arg, '\0')+1){
 
293
    tmp = realloc(argv, ((++argv_size)+1)*sizeof(char *));
 
294
    if(tmp == NULL){
 
295
      error(0, errno, "realloc");
 
296
      free(argv);
 
297
      return NULL;
 
298
    }
 
299
    argv = (const char **)tmp;
 
300
    argv[argv_size-1] = arg;
295
301
  }
296
 
  argz_extract(cmdline, cmdline_len, argv); /* Create argv */
297
 
  return (const char **)argv;
 
302
  argv[argv_size] = NULL;
 
303
  return argv;
298
304
}
299
305
 
300
306
int main(__attribute__((unused))int argc,