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; }
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; }
RETRCommand(ftp::Client& client, const std::string& argStr, const Args& args) : Command(client, client.Control(), client.Data(), argStr, args) { }
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) { }
ADDUSERCommand(ftp::Client& client, const std::string& argStr, const Args& args) : Command(client, client.Control(), client.Data(), argStr, args), gadmin(false) { }
LOGSCommand(ftp::Client& client, const std::string& argStr, const Args& args) : Command(client, client.Control(), client.Data(), argStr, args), number(defaultNumberLines) { }