Create and implemented userManager class

This commit is contained in:
2025-05-22 19:33:56 +02:00
parent 6ad501ec50
commit 40d58ab011
6 changed files with 135 additions and 4 deletions

View File

@@ -1,4 +1,7 @@
#include <iostream>
#include <array>
#include <string>
#include <map>
#include <unistd.h>
#include <sys/types.h>
#include <syslog.h>
@@ -7,10 +10,13 @@
#include <signal.h>
#include <stdbool.h>
#include "pipedata.h"
#include "locations.h"
#include "usermanager.h"
int main()
{
openlog("ncsambawatcher", LOG_PID | LOG_CONS, LOG_USER);
int p1[2];
pipe(p1);
@@ -21,7 +27,13 @@ int main()
{
close(p1[0]); // read
FILE* logpipe = popen(LOGFILE, "r");
std::array<char, 256> buffer;
while(fgets(buffer.data(), buffer.size(), logpipe) != nullptr)
{
std::string line(buffer.data());
}
close(p1[1]); // write
}
@@ -33,6 +45,8 @@ int main()
close(p1[0]); // read
}
closelog();
return EXIT_SUCCESS;
}