2014-06-18 07:12:09 +08:00
|
|
|
/*
|
2016-01-15 05:50:22 +08:00
|
|
|
Copyright (c) 2016, Antonio SJ Musumeci <trapexit@spawn.link>
|
|
|
|
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
purpose with or without fee is hereby granted, provided that the above
|
|
|
|
copyright notice and this permission notice appear in all copies.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
2014-06-18 07:12:09 +08:00
|
|
|
*/
|
|
|
|
|
2015-09-09 03:56:02 +08:00
|
|
|
#include <stdlib.h>
|
2016-08-27 02:31:19 +08:00
|
|
|
#include <sys/syscall.h>
|
2014-06-18 07:12:09 +08:00
|
|
|
#include <sys/types.h>
|
2015-09-09 03:56:02 +08:00
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
2018-03-08 07:24:47 +08:00
|
|
|
namespace ugid
|
2014-06-18 07:12:09 +08:00
|
|
|
{
|
2023-08-14 11:55:04 +08:00
|
|
|
thread_local uid_t currentuid = 0;
|
|
|
|
thread_local gid_t currentgid = 0;
|
|
|
|
thread_local bool initialized = false;
|
2015-09-09 03:56:02 +08:00
|
|
|
|
2018-03-08 07:24:47 +08:00
|
|
|
void
|
|
|
|
init()
|
|
|
|
{
|
2014-06-18 07:12:09 +08:00
|
|
|
}
|
|
|
|
}
|