}
/* Get the suricata user ID to given user ID */
if (suri->do_setuid == TRUE) {
- if (SCGetUserID(suri->user_name, suri->group_name,
- &suri->userid, &suri->groupid) != 0) {
- SCLogError("failed in getting user ID");
- return TM_ECODE_FAILED;
- }
-
+ SCGetUserID(suri->user_name, suri->group_name, &suri->userid, &suri->groupid);
sc_set_caps = TRUE;
/* Get the suricata group ID to given group ID */
} else if (suri->do_setgid == TRUE) {
- if (SCGetGroupID(suri->group_name, &suri->groupid) != 0) {
- SCLogError("failed in getting group ID");
- return TM_ECODE_FAILED;
- }
-
+ SCGetGroupID(suri->group_name, &suri->groupid);
sc_set_caps = TRUE;
}
#endif
* \param uid pointer to the user id in which result will be stored
* \param gid pointer to the group id in which result will be stored
*
- * \retval upon success it return 0
+ * \retval FatalError on a failure
*/
-int SCGetUserID(const char *user_name, const char *group_name, uint32_t *uid, uint32_t *gid)
+void SCGetUserID(const char *user_name, const char *group_name, uint32_t *uid, uint32_t *gid)
{
uint32_t userid = 0;
uint32_t groupid = 0;
*uid = userid;
*gid = groupid;
-
- return 0;
}
/**
* \param group_name pointer to the given group name
* \param gid pointer to the group id in which result will be stored
*
- * \retval upon success it return 0
+ * \retval FatalError on a failure
*/
-int SCGetGroupID(const char *group_name, uint32_t *gid)
+void SCGetGroupID(const char *group_name, uint32_t *gid)
{
uint32_t grpid = 0;
struct group *gp;
endgrent();
*gid = grpid;
-
- return 0;
}
#ifdef __OpenBSD__
#define SCDropMainThreadCaps(...)
#endif /* HAVE_LIBCAP_NG */
-int SCGetUserID(const char *, const char *, uint32_t *, uint32_t *);
-int SCGetGroupID(const char *, uint32_t *);
+void SCGetUserID(const char *, const char *, uint32_t *, uint32_t *);
+void SCGetGroupID(const char *, uint32_t *);
#ifdef __OpenBSD__
int SCPledge(void);