Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Public Attributes
ArcSec::Charon::PolicyLocation Class Reference

#include <charon.h>

Collaboration diagram for ArcSec::Charon::PolicyLocation:
Collaboration graph

List of all members.

Public Member Functions

 PolicyLocation (const std::string &location, bool reload)
bool IsModified (void)

Public Attributes

std::string path
bool reload
time_t mtime
time_t ctime

Detailed Description

Definition at line 18 of file charon.h.

Constructor & Destructor Documentation

ArcSec::Charon::PolicyLocation::PolicyLocation ( const std::string &  location,
bool  reload 

Definition at line 336 of file charon.cpp.

  reload = autoreload;
  struct stat st;
  if(stat(location.c_str(), &st) != 0) return;
  if(!S_ISREG(st.st_mode)) return;
  mtime = st.st_mtime;
  ctime = st.st_ctime;
  path = location;

Member Function Documentation

Definition at line 346 of file charon.cpp.

  if(!reload) return false;
  logger.msg(Arc::DEBUG, "Checking policy modification: %s",path);
  if(path.empty()) return false;
  struct stat st;
  if((stat(path.c_str(), &st) != 0) || (!S_ISREG(st.st_mode))) {
    logger.msg(Arc::INFO, "Policy removed: %s", path);
    return true;
  logger.msg(Arc::DEBUG, "Old policy times: %u/%u",(unsigned int)mtime,(unsigned int)ctime);
  logger.msg(Arc::DEBUG, "New policy times: %u/%u",(unsigned int)st.st_mtime,(unsigned int)st.st_ctime);
  if((mtime == st.st_mtime) && (ctime == st.st_ctime)) return false;
  mtime = st.st_mtime;
  ctime = st.st_ctime;
  logger.msg(Arc::INFO, "Policy modified: %s", path);
  return true;

Here is the call graph for this function:

Member Data Documentation

Definition at line 23 of file charon.h.

Definition at line 22 of file charon.h.

Definition at line 20 of file charon.h.

Definition at line 21 of file charon.h.

The documentation for this class was generated from the following files: