diff options
author | Miloslav Trmač <mitr@redhat.com> | 2012-07-24 14:04:33 +0200 |
---|---|---|
committer | Miloslav Trmač <mitr@redhat.com> | 2012-07-30 07:39:50 +0200 |
commit | c50904d3d0dbc95588eccdf147d9e33b6edece58 (patch) | |
tree | 4c7026b7cee561c55557cb8f7ce7c2f22805dc50 /t | |
parent | fa426feb6e1508c3204c44b15ec41e7b99809697 (diff) | |
download | libumberlog-c50904d3d0dbc95588eccdf147d9e33b6edece58.tar.gz libumberlog-c50904d3d0dbc95588eccdf147d9e33b6edece58.tar.xz libumberlog-c50904d3d0dbc95588eccdf147d9e33b6edece58.zip |
Initialize [UG]ID to "no value cached"
Now syslog () without openlog () will include a correct [UG]ID value instead
of 0. Also reset the cache on closelog ().
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Diffstat (limited to 't')
-rw-r--r-- | t/test_umberlog.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/t/test_umberlog.c b/t/test_umberlog.c index aa50484..8a47ab1 100644 --- a/t/test_umberlog.c +++ b/t/test_umberlog.c @@ -291,6 +291,10 @@ START_TEST (test_closelog) verify_value_missing (jo, "program"); #endif verify_value_differs (jo, "pid", "0"); + if (getuid () != 0) + verify_value_differs (jo, "uid", "0"); + if (getgid () != 0) + verify_value_differs (jo, "gid", "0"); json_object_put (jo); } @@ -346,6 +350,10 @@ START_TEST (test_openlog_defaults) verify_value_missing (jo, "program"); #endif verify_value_differs (jo, "pid", "0"); + if (getuid () != 0) + verify_value_differs (jo, "uid", "0"); + if (getgid () != 0) + verify_value_differs (jo, "gid", "0"); json_object_put (jo); closelog (); |