#undef LOG_TAG
#define LOG_TAG "SESSIOND_REGENERATE_SKEL"
#include <dlog.h>
+#include <unistd.h>
+#include <fcntl.h>
#include "fs_helpers.hpp"
#include "os_ops.hpp"
constexpr auto TEMPLATE_IMAGE_SIZE_KB = 10240;
+void print_creds(void)
+{
+ int fd = open("/proc/self/attr/current", O_RDONLY);
+ char buf[3084] = {0, };
+ int r = read(fd, buf, sizeof(buf));
+ if (r >= sizeof(buf))
+ buf[sizeof(buf) - 1] = 0;
+ else if (r > 0)
+ buf[r] = 0;
+
+ LOGW("Starting with creds: uid: %d, euid: %d, gid: %d, egid: %d, label: %s", getuid(), geteuid(), getgid(), getegid(), buf);
+}
+
+
int regenerate_skel()
{
+ print_creds();
+
try {
fs::current_path("/opt/usr/home");
} catch (const std::exception& ex) {