aboutsummaryrefslogtreecommitdiffstats
path: root/epan/privileges.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2008-03-16 00:32:12 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2008-03-16 00:32:12 +0000
commitd951728e6bf58815e1358611b2f1614d000986c9 (patch)
tree76f343eeada0f23481b0d12c6f83c5395b7aa8a6 /epan/privileges.c
parent6367e7c05456f87f6632993871a854bb08091562 (diff)
Have started_with_special_privs() assert out if get_credential_info() was not
previously called. This prevents the function from always returning TRUE in programs that hadn't called get_credential_info(). Call get_credential_info() in the programs that should have been. svn path=/trunk/; revision=24648
Diffstat (limited to 'epan/privileges.c')
-rw-r--r--epan/privileges.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/epan/privileges.c b/epan/privileges.c
index 1728c91df8..a62001343b 100644
--- a/epan/privileges.c
+++ b/epan/privileges.c
@@ -151,6 +151,7 @@ npf_sys_is_running() {
static uid_t ruid, euid;
static gid_t rgid, egid;
+static gboolean get_credential_info_called = FALSE;
/*
* Called when the program starts, to save whatever credential information
@@ -164,6 +165,8 @@ get_credential_info(void)
euid = geteuid();
rgid = getgid();
egid = getegid();
+
+ get_credential_info_called = TRUE;
}
/*
@@ -173,6 +176,7 @@ get_credential_info(void)
gboolean
started_with_special_privs(void)
{
+ g_assert(get_credential_info_called);
#ifdef HAVE_ISSETUGID
return issetugid();
#else