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

  • Committer: Teddy Hogeborn
  • Date: 2016-03-23 07:11:22 UTC
  • Revision ID: teddy@recompile.se-20160323071122-55srtjdizr21rr7f
Use HTTPS in home page links

Since we have a real certificate now, change all links to the home
page to use HTTPS.

* README: Use HTTPS in home page links
* debian/control (Source: mandos/Homepage): - '' -
* debian/copyright (Source): - '' -
* intro.xml (SEE ALSO): - '' -
* mandos.lsm (Primary-site): - '' -

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
/*
3
3
 * Usplash - Read a password from usplash and output it
4
4
 * 
5
 
 * Copyright © 2008-2011 Teddy Hogeborn
6
 
 * Copyright © 2008-2011 Björn Påhlsson
 
5
 * Copyright © 2008-2016 Teddy Hogeborn
 
6
 * Copyright © 2008-2016 Björn Påhlsson
7
7
 * 
8
8
 * This program is free software: you can redistribute it and/or
9
9
 * modify it under the terms of the GNU General Public License as
58
58
const char usplash_name[] = "/sbin/usplash";
59
59
 
60
60
/* Function to use when printing errors */
 
61
__attribute__((format (gnu_printf, 3, 4)))
61
62
void error_plus(int status, int errnum, const char *formatstring,
62
63
                ...){
63
64
  va_list ap;
66
67
  
67
68
  va_start(ap, formatstring);
68
69
  ret = vasprintf(&text, formatstring, ap);
69
 
  if (ret == -1){
 
70
  if(ret == -1){
70
71
    fprintf(stderr, "Mandos plugin %s: ",
71
72
            program_invocation_short_name);
72
73
    vfprintf(stderr, formatstring, ap);
116
117
      ret = asprintf(&cmd_line_alloc, "%s %s", cmd, arg);
117
118
      if(ret == -1){
118
119
        int e = errno;
119
 
        TEMP_FAILURE_RETRY(close(*fifo_fd_r));
 
120
        close(*fifo_fd_r);
120
121
        errno = e;
121
122
        return false;
122
123
      }
132
133
                 cmd_line_len - written);
133
134
    if(sret == -1){
134
135
      int e = errno;
135
 
      TEMP_FAILURE_RETRY(close(*fifo_fd_r));
 
136
      close(*fifo_fd_r);
136
137
      free(cmd_line_alloc);
137
138
      errno = e;
138
139
      return false;
490
491
        error_plus(0, errno, "read");
491
492
        status = EX_OSERR;
492
493
      }
493
 
      TEMP_FAILURE_RETRY(close(outfifo_fd));
 
494
      close(outfifo_fd);
494
495
      goto failure;
495
496
    }
496
497
    if(interrupted_by_signal){
577
578
  
578
579
  /* Close FIFO */
579
580
  if(fifo_fd != -1){
580
 
    ret = (int)TEMP_FAILURE_RETRY(close(fifo_fd));
 
581
    ret = close(fifo_fd);
581
582
    if(ret == -1 and errno != EINTR){
582
583
      error_plus(0, errno, "close");
583
584
    }
586
587
  
587
588
  /* Close output FIFO */
588
589
  if(outfifo_fd != -1){
589
 
    ret = (int)TEMP_FAILURE_RETRY(close(outfifo_fd));
 
590
    ret = close(outfifo_fd);
590
591
    if(ret == -1){
591
592
      error_plus(0, errno, "close");
592
593
    }
654
655
  
655
656
  /* Close FIFO (again) */
656
657
  if(fifo_fd != -1){
657
 
    ret = (int)TEMP_FAILURE_RETRY(close(fifo_fd));
 
658
    ret = close(fifo_fd);
658
659
    if(ret == -1 and errno != EINTR){
659
660
      error_plus(0, errno, "close");
660
661
    }