7f605376157cab4b2e524938e78d4ab62d5ff8eb
Stefan Schuermans move most sources into libp...

Stefan Schuermans authored 4 years ago

libpermissioner/src/Tree.cpp  1) #include <permissioner/Tree.h>
Stefan Schuermans begin of permissioner confi...

Stefan Schuermans authored 4 years ago

permissionerd/src/Tree.cpp    2) 
Stefan Schuermans user/group lookup

Stefan Schuermans authored 4 years ago

libpermissioner/src/Tree.cpp  3) #include <permissioner/Group.h>
Stefan Schuermans move most sources into libp...

Stefan Schuermans authored 4 years ago

libpermissioner/src/Tree.cpp  4) #include <permissioner/Permissions.h>
Stefan Schuermans user/group lookup

Stefan Schuermans authored 4 years ago

libpermissioner/src/Tree.cpp  5) #include <permissioner/User.h>
Stefan Schuermans move most sources into libp...

Stefan Schuermans authored 4 years ago

libpermissioner/src/Tree.cpp  6) #include <permissioner/StringUtils.h>
Stefan Schuermans begin of permissioner confi...

Stefan Schuermans authored 4 years ago

permissionerd/src/Tree.cpp    7) 
permissionerd/src/Tree.cpp    8) #include <boost/filesystem.hpp>
permissionerd/src/Tree.cpp    9) #include <sstream>
permissionerd/src/Tree.cpp   10) #include <stdexcept>
permissionerd/src/Tree.cpp   11) #include <string>
permissionerd/src/Tree.cpp   12) #include <vector>
permissionerd/src/Tree.cpp   13) 
permissionerd/src/Tree.cpp   14) void Tree::parseParams(std::string const &paramStr) {
permissionerd/src/Tree.cpp   15)   // format of paramStr is: <user> " " <group> " " <permissions> " " <root>
permissionerd/src/Tree.cpp   16)   // user, group, permissions may be - for no change
permissionerd/src/Tree.cpp   17)   std::string userStr, groupStr, permissionsStr, rootStr;
permissionerd/src/Tree.cpp   18) 
permissionerd/src/Tree.cpp   19)   std::string::size_type pos = 0;
permissionerd/src/Tree.cpp   20)   StringUtils::getNextField(paramStr, pos, userStr, "user");
permissionerd/src/Tree.cpp   21)   StringUtils::getNextField(paramStr, pos, groupStr, "group");
permissionerd/src/Tree.cpp   22)   StringUtils::getNextField(paramStr, pos, permissionsStr, "permissions");
permissionerd/src/Tree.cpp   23)   if (pos >= paramStr.length()) {
permissionerd/src/Tree.cpp   24)     std::stringstream msg;
permissionerd/src/Tree.cpp   25)     msg << "<root> field missing in \"" << paramStr << "\"";
permissionerd/src/Tree.cpp   26)     throw std::runtime_error(msg.str());
permissionerd/src/Tree.cpp   27)   }
permissionerd/src/Tree.cpp   28) 
Stefan Schuermans user/group lookup

Stefan Schuermans authored 4 years ago

libpermissioner/src/Tree.cpp 29)   try {
libpermissioner/src/Tree.cpp 30)     user.parseUserName(userStr);
libpermissioner/src/Tree.cpp 31)   } catch (std::exception const & e) {
libpermissioner/src/Tree.cpp 32)     std::stringstream msg;
libpermissioner/src/Tree.cpp 33)     msg << "invalid <user> field \"" << userStr << "\" in \""
libpermissioner/src/Tree.cpp 34)         << paramStr << "\": " << e.what();
libpermissioner/src/Tree.cpp 35)     throw std::runtime_error(msg.str());
Stefan Schuermans begin of permissioner confi...

Stefan Schuermans authored 4 years ago

permissionerd/src/Tree.cpp   36)   }
Stefan Schuermans user/group lookup

Stefan Schuermans authored 4 years ago

libpermissioner/src/Tree.cpp 37) 
libpermissioner/src/Tree.cpp 38)   try {
libpermissioner/src/Tree.cpp 39)     group.parseGroupName(groupStr);
libpermissioner/src/Tree.cpp 40)   } catch (std::exception const & e) {
libpermissioner/src/Tree.cpp 41)     std::stringstream msg;
libpermissioner/src/Tree.cpp 42)     msg << "invalid <group> field \"" << groupStr << "\" in \""
libpermissioner/src/Tree.cpp 43)         << paramStr << "\": " << e.what();
libpermissioner/src/Tree.cpp 44)     throw std::runtime_error(msg.str());
Stefan Schuermans begin of permissioner confi...

Stefan Schuermans authored 4 years ago

permissionerd/src/Tree.cpp   45)   }
Stefan Schuermans user/group lookup

Stefan Schuermans authored 4 years ago

libpermissioner/src/Tree.cpp 46) 
Stefan Schuermans begin of permissioner confi...

Stefan Schuermans authored 4 years ago

permissionerd/src/Tree.cpp   47)   try {
permissionerd/src/Tree.cpp   48)     permissions.parseParams(permissionsStr);
permissionerd/src/Tree.cpp   49)   } catch (std::exception const & e) {
permissionerd/src/Tree.cpp   50)     std::stringstream msg;
Stefan Schuermans user/group lookup

Stefan Schuermans authored 4 years ago

libpermissioner/src/Tree.cpp 51)     msg << "invalid <permissions> field \"" << permissionsStr << "\" in \""
libpermissioner/src/Tree.cpp 52)         << paramStr << "\": " << e.what();
Stefan Schuermans begin of permissioner confi...

Stefan Schuermans authored 4 years ago

permissionerd/src/Tree.cpp   53)     throw std::runtime_error(msg.str());
permissionerd/src/Tree.cpp   54)   }
Stefan Schuermans user/group lookup

Stefan Schuermans authored 4 years ago

libpermissioner/src/Tree.cpp 55) 
Stefan Schuermans canonicalize root paths

Stefan Schuermans authored 4 years ago

libpermissioner/src/Tree.cpp 56)   try {
libpermissioner/src/Tree.cpp 57)     root = boost::filesystem::canonical(rootStr);
libpermissioner/src/Tree.cpp 58)   } catch (std::exception const & e) {
libpermissioner/src/Tree.cpp 59)     std::stringstream msg;
libpermissioner/src/Tree.cpp 60)     msg << "invalid <root> field \"" << rootStr << "\" in \""
libpermissioner/src/Tree.cpp 61)         << paramStr << "\": " << e.what();
libpermissioner/src/Tree.cpp 62)     throw std::runtime_error(msg.str());
libpermissioner/src/Tree.cpp 63)   }
Stefan Schuermans begin of permissioner confi...

Stefan Schuermans authored 4 years ago

permissionerd/src/Tree.cpp   64) }