Example #1
0
Reader::Reader(ftp::Client& client, const std::vector<std::string>& argv) :
  client(client), open(false)
{
  util::ProcessReader::ArgvType env;
  client.Child().Open(argv[0], argv, BuildEnv(client));
  open = true;
}
Example #2
0
std::vector<std::string> BuildEnv(ftp::Client& client)
{
  std::ostringstream os;
  os << "USER="******"\n"
     << "UID=" << client.User().ID() << "\n"
     << "FLAGS=" << client.User().Flags() << "\n"
     << "TAGLINE=" << client.User().Tagline() << "\n"
     << "GROUP=" << client.User().PrimaryGroup() << "\n"
     << "GID=" << client.User().PrimaryGID() << "\n"
     << "HOST=" << client.Ident() << "@" << client.IP();
  
  std::string envStr(os.str());
  std::vector<std::string> env;
  util::Split(env, envStr, "\n", true);
  return env;
}
Example #3
0
 RETRCommand(ftp::Client& client, const std::string& argStr, const Args& args) :
   Command(client, client.Control(), client.Data(), argStr, args) { }
Example #4
0
 CHOWNCommand(ftp::Client& client, const std::string& argStr, const Args& args) :
   Command(client, client.Control(), client.Data(), argStr, args),
   owner(-1, -1), recursive(false), dirs(0), files(0), failed(0) { }
Example #5
0
 ADDUSERCommand(ftp::Client& client, const std::string& argStr, const Args& args) :
   Command(client, client.Control(), client.Data(), argStr, args), gadmin(false) { }
Example #6
0
 LOGSCommand(ftp::Client& client, const std::string& argStr, const Args& args) :
   Command(client, client.Control(), client.Data(), argStr, args),
   number(defaultNumberLines) { }