/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: 2009-09-10 06:28:14 UTC
  • Revision ID: teddy@fukt.bsnet.se-20090910062814-wkkngiwm0xhxwlm2
* init.d-mandos: Bug fix: Correct the LSB header.

* mandos.xml (CHECKING): Add text about client disabling requiring
                         manual intervention to reverse.

* plugin-runner.c: Cast return value of TEMP_FAILURE_RETRY to "int"
                   where necessary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
  
43
43
  /* Create FIFO */
44
44
  const char passfifo[] = "/lib/cryptsetup/passfifo";
45
 
  ret = mkfifo(passfifo, S_IRUSR | S_IWUSR);
 
45
  ret = (int)TEMP_FAILURE_RETRY(mkfifo(passfifo, S_IRUSR | S_IWUSR));
46
46
  if(ret == -1 and errno != EEXIST){
47
47
    perror("mkfifo");
48
48
    return EXIT_FAILURE;
49
49
  }
50
50
  
51
51
  /* Open FIFO */
52
 
  int fifo_fd = open(passfifo, O_RDONLY);
 
52
  int fifo_fd = (int)TEMP_FAILURE_RETRY(open(passfifo, O_RDONLY));
53
53
  if(fifo_fd == -1){
54
54
    perror("open");
55
55
    return EXIT_FAILURE;
72
72
        buf = tmp;
73
73
        buf_allocated += blocksize;
74
74
      }
75
 
      sret = read(fifo_fd, buf + buf_len, buf_allocated - buf_len);
 
75
      sret = TEMP_FAILURE_RETRY(read(fifo_fd, buf + buf_len,
 
76
                                     buf_allocated - buf_len));
76
77
      if(sret == -1){
77
78
        perror("read");
78
79
        free(buf);
83
84
  }
84
85
  
85
86
  /* Close FIFO */
86
 
  close(fifo_fd);
 
87
  TEMP_FAILURE_RETRY(close(fifo_fd));
87
88
  
88
89
  /* Print password to stdout */
89
90
  size_t written = 0;
90
91
  while(written < buf_len){
91
 
    sret = write(STDOUT_FILENO, buf + written, buf_len - written);
 
92
    sret = TEMP_FAILURE_RETRY(write(STDOUT_FILENO, buf + written,
 
93
                                    buf_len - written));
92
94
    if(sret == -1){
93
95
      perror("write");
94
96
      free(buf);