/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/mandos-client.c

  • Committer: Teddy Hogeborn
  • Date: 2014-06-07 22:37:22 UTC
  • Revision ID: teddy@recompile.se-20140607223722-55qmdr3n9x39pvx4
Make mandos-client use fstatat().

* plugins.d/mandos-client.d (runnable_hook): Use fstatat().

Show diffs side-by-side

added added

removed removed

Lines of Context:
1346
1346
    return 0;
1347
1347
  }
1348
1348
  
1349
 
  char *fullname = NULL;
1350
 
  ret = asprintf(&fullname, "%s/%s", hookdir, direntry->d_name);
1351
 
  if(ret < 0){
1352
 
    perror_plus("asprintf");
1353
 
    return 0;
1354
 
  }
1355
 
  
1356
 
  ret = stat(fullname, &st);
 
1349
  ret = fstatat(hookdir_fd, direntry->d_name, &st, 0);
1357
1350
  if(ret == -1){
1358
1351
    if(debug){
1359
1352
      perror_plus("Could not stat hook");
1360
1353
    }
1361
1354
    return 0;
1362
1355
  }
1363
 
  free(fullname);
1364
1356
  if(not (S_ISREG(st.st_mode))){
1365
1357
    /* Not a regular file */
1366
1358
    if(debug){