/mandos/release

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/release

« back to all changes in this revision

Viewing changes to plugins.d/plymouth.c

  • Committer: Björn Påhlsson
  • Date: 2010-11-05 18:30:07 UTC
  • mto: (237.7.11 mandos)
  • mto: This revision was merged to the branch mainline in revision 282.
  • Revision ID: belorn@fukt.bsnet.se-20101105183007-20us6fal38a60w4u
password-prompt: added conflic handling with plymouth daemon.
plymouth: bug fix when --ping dont return sucessful.

Show diffs side-by-side

added added

removed removed

Lines of Context:
196
196
      return 0;
197
197
    }
198
198
  }
199
 
  char exe_target[sizeof(plymouth_path)];
 
199
  char exe_target[sizeof(plymouthd_path)];
200
200
  char *exe_link;
201
201
  ret = asprintf(&exe_link, "/proc/%s/exe", proc_entry->d_name);
202
202
  if(ret == -1){
223
223
  
224
224
  ssize_t sret = readlink(exe_link, exe_target, sizeof(exe_target));
225
225
  free(exe_link);
226
 
  if((sret != (ssize_t)sizeof(plymouth_path)-1) or
227
 
      (memcmp(plymouth_path, exe_target,
228
 
              sizeof(plymouth_path)-1) != 0)){
 
226
  if((sret != (ssize_t)sizeof(plymouthd_path)-1) or
 
227
      (memcmp(plymouthd_path, exe_target,
 
228
              sizeof(plymouthd_path)-1) != 0)){
229
229
    return 0;
230
230
  }
231
231
  return 1;
245
245
  if(maxvalue == 0){
246
246
    struct dirent **direntries;
247
247
    ret = scandir("/proc", &direntries, is_plymouth, alphasort);
248
 
    sscanf(direntries[0]->d_name, "%" SCNuMAX, &maxvalue);
 
248
    if (ret == -1){
 
249
      error(0, errno, "scandir");
 
250
    }
 
251
    if (ret > 0){
 
252
      ret = sscanf(direntries[0]->d_name, "%" SCNuMAX, &maxvalue);
 
253
      if (ret < 0){
 
254
        error(0, errno, "sscanf");
 
255
      }
 
256
    }
249
257
  }
250
258
  pid_t pid;
251
259
  pid = (pid_t)maxvalue;