19 #include <ndb_global.h>
22 #include <logger/Logger.hpp>
28 #include <Properties.hpp>
29 #include <BaseString.hpp>
37 runas(
const char * user){
38 if(user == 0 || strlen(user) == 0){
41 struct passwd * pw = getpwnam(user);
43 logger.
error(
"Can't find user to %s", user);
46 uid_t uid = pw->pw_uid;
47 gid_t gid = pw->pw_gid;
48 int res = setgid(gid);
50 logger.
error(
"Can't change group to %s(%d)", user, gid);
56 logger.
error(
"Can't change user to %s(%d)", user, uid);
69 tmp.split(split,
":=", 2);
74 p.
put(split[0].trim().c_str(), split[1].trim().c_str());
80 insert_file(FILE * f,
class Properties& p,
bool break_on_empty){
92 if(insert(tmp.
c_str(), p) != 0 && break_on_empty)
100 insert_file(
const char * filename,
class Properties& p){
101 FILE * f = fopen(filename,
"r");
102 int res = insert_file(f, p);