def drop_privileges(self):
        if getuid() > 0:
            # Running as non-root. Ignore.
            return

        try:
            # Get the uid/gid from the name
            uid = getpwnam(self.user).pw_uid
            gid = getgrnam(self.group).gr_gid
        except __HOLE__ as error:
            print("ERROR: Could not drop privileges {0:s}".format(error))
            print(format_exc())
            raise SystemExit(-1)

        try:
            # Remove group privileges
            setgroups([])

            # Try setting the new uid/gid
            setgid(gid)
            setuid(uid)

            if self.umask is not None:
	            umask(self.umask)
        except Exception as error:
            print("ERROR: Could not drop privileges {0:s}".format(error))
            print(format_exc())
            raise SystemExit(-1)
dataset/ETHPy150Open circuits/circuits/circuits/app/dropprivileges.py/DropPrivileges.drop_privileges