Loading src/sld/TODO +0 −1 Original line number Diff line number Diff line Loading @@ -6,4 +6,3 @@ command reload command update BUG: la commande file est buggé suremetn dans le MD5 src/sld/daemon.cc +6 −7 Original line number Diff line number Diff line Loading @@ -436,9 +436,9 @@ void SLDaemon::cmd_file(const char *line) { } //get md5 char *md5; char md5[512]; //FIXME: bad magic size buf = recvln(); ret = sscanf(buf, "MD5 %s\n", md5); ret = sscanf(buf, "MD5 %512s\n", md5); delete buf; if (ret != 1) { tee("Invalid md5 parameter."); Loading Loading @@ -466,23 +466,22 @@ void SLDaemon::cmd_file(const char *line) { } // check MD5 std::cout << SLDaemon::md5(target) <<std::endl;; if (SLDaemon::md5(target) != string(md5)) { tee("Transfer of " + target + ": FAILED."); tee("Transfer of " + target + ": Invalid MD5."); unlink(target.c_str()); return; } // proceed chown if (chown(target.c_str(), getuid(), getgid())) { tee("chown of " + target + ": FAILED."); tee("chown of " + target + ": Unable to chown."); unlink(target.c_str()); return; } // proceed chmod if (chmod(target.c_str(), S_IRUSR | S_IWUSR | S_IXUSR)) { tee("chmod of " + target + ": FAILED."); tee("chmod of " + target + ": Unable to chmod."); unlink(target.c_str()); return; } Loading src/sld/sld.hh +3 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,9 @@ protected: int socket_fd_; FILE* socket_fs_; // pid list std::set<int> jobs; // Options functions void usage(const char *argv0) const; void check_options() const; Loading Loading
src/sld/TODO +0 −1 Original line number Diff line number Diff line Loading @@ -6,4 +6,3 @@ command reload command update BUG: la commande file est buggé suremetn dans le MD5
src/sld/daemon.cc +6 −7 Original line number Diff line number Diff line Loading @@ -436,9 +436,9 @@ void SLDaemon::cmd_file(const char *line) { } //get md5 char *md5; char md5[512]; //FIXME: bad magic size buf = recvln(); ret = sscanf(buf, "MD5 %s\n", md5); ret = sscanf(buf, "MD5 %512s\n", md5); delete buf; if (ret != 1) { tee("Invalid md5 parameter."); Loading Loading @@ -466,23 +466,22 @@ void SLDaemon::cmd_file(const char *line) { } // check MD5 std::cout << SLDaemon::md5(target) <<std::endl;; if (SLDaemon::md5(target) != string(md5)) { tee("Transfer of " + target + ": FAILED."); tee("Transfer of " + target + ": Invalid MD5."); unlink(target.c_str()); return; } // proceed chown if (chown(target.c_str(), getuid(), getgid())) { tee("chown of " + target + ": FAILED."); tee("chown of " + target + ": Unable to chown."); unlink(target.c_str()); return; } // proceed chmod if (chmod(target.c_str(), S_IRUSR | S_IWUSR | S_IXUSR)) { tee("chmod of " + target + ": FAILED."); tee("chmod of " + target + ": Unable to chmod."); unlink(target.c_str()); return; } Loading
src/sld/sld.hh +3 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,9 @@ protected: int socket_fd_; FILE* socket_fs_; // pid list std::set<int> jobs; // Options functions void usage(const char *argv0) const; void check_options() const; Loading