/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: 2017-09-03 09:00:31 UTC
  • Revision ID: teddy@recompile.se-20170903090031-zhxw13lca97zuysr
Plymouth plugin bug fix: Actually try the old PID file location

* plugins.d/plymouth.c (get_pid): Try both plymouth_pid and
  plymouth_old_pid, not just plymouth_pid twice.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
/*
3
3
 * Plymouth - Read a password from Plymouth and output it
4
4
 * 
5
 
 * Copyright © 2010-2018 Teddy Hogeborn
6
 
 * Copyright © 2010-2018 Björn Påhlsson
 
5
 * Copyright © 2010-2017 Teddy Hogeborn
 
6
 * Copyright © 2010-2017 Björn Påhlsson
7
7
 * 
8
8
 * This file is part of Mandos.
9
9
 * 
57
57
sig_atomic_t interrupted_by_signal = 0;
58
58
 
59
59
/* Used by Ubuntu 11.04 (Natty Narwahl) */
60
 
const char plymouth_old_old_pid[] = "/dev/.initramfs/plymouth.pid";
 
60
const char plymouth_old_pid[] = "/dev/.initramfs/plymouth.pid";
61
61
/* Used by Ubuntu 11.10 (Oneiric Ocelot) */
62
 
const char plymouth_old_pid[] = "/run/initramfs/plymouth.pid";
63
 
/* Used by Debian 9 (stretch) */
64
 
const char plymouth_pid[] = "/run/plymouth/pid";
 
62
const char plymouth_pid[] = "/run/initramfs/plymouth.pid";
65
63
 
66
64
const char plymouth_path[] = "/bin/plymouth";
67
65
const char plymouthd_path[] = "/sbin/plymouthd";
293
291
      fclose(pidfile);
294
292
    }
295
293
  }
296
 
  /* Try the old old pid file location */
297
 
  if(proc_id == 0){
298
 
    pidfile = fopen(plymouth_old_old_pid, "r");
299
 
    if(pidfile != NULL){
300
 
      ret = fscanf(pidfile, "%" SCNuMAX, &proc_id);
301
 
      if(ret != 1){
302
 
        proc_id = 0;
303
 
      }
304
 
      fclose(pidfile);
305
 
    }
306
 
  }
307
294
  /* Look for a plymouth process */
308
295
  if(proc_id == 0){
309
296
    struct dirent **direntries = NULL;