38 #define __attribute__(x)
50 #include <sys/types.h>
64 if (authPolicy == 0) {
67 long maxbuf = sysconf(_SC_GETPW_R_SIZE_MAX);
69 int ret = getpwuid_r(geteuid(), &pwd, buffer.get(), maxbuf, &pw);
70 if (ret != 0 || pw->pw_dir == 0) {
76 ret = stat(dir.
c_str(), &st);
77 if (ret != 0 || (st.st_mode & (S_IRWXG | S_IRWXO)) != 0) {
80 ret = stat(filename.
c_str(), &st);
81 if (ret != 0 || (st.st_mode & (S_IRWXG | S_IRWXO)) != 0) {
88 for (pexPolicy::Policy::PolicyPtrArray::const_iterator i = authArray.begin(); i != authArray.end(); ++i) {
89 if ((*i)->getString(
"host") == host && (*i)->getInt(
"port") == portNum) {
92 if (username.
empty()) {
94 "Empty username for host/port: " + host +
":" + port);
137 return result.first +
":" + result.second;
157 return result.second;