char obj_name[OBJ_NAME_SIZE];
struct sockaddr_un clientaddr;
-/**
- * Dropping root privileges
- * returns 0 on success, 1 on error
- */
-int drop_root_privileges()
-{
- if (getuid() == 0) {
- /* process is running as root, drop privileges */
- if (setgid(APP_GID) != 0)
- return 1;
- if (setuid(APP_UID) != 0)
- return 1;
- }
- uid_t uid = getuid();
- if (uid == APP_UID)
- return 0;
-
- return 1;
-}
-
/* Create a Unix domain socket and bind */
int create_new_socket()
{