Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/topic/awelzel/setuid-error-handl…
Browse files Browse the repository at this point in the history
…ing'

* origin/topic/awelzel/setuid-error-handling:
  rst: Handle setuid() error
  • Loading branch information
awelzel committed Dec 6, 2023
2 parents f9f5dcb + 1c1c5b3 commit 6bd1725
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
11 changes: 11 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
0.50-27 | 2023-12-06 18:40:17 +0100

* rst: Handle setuid() error (Arne Welzel, Corelight)

Mostly to squelch the warning here, not sure anyone is using this...

zeek-aux/rst/rst.c:377:9: warning: ignoring return value of ‘setuid’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
377 | setuid(getuid());

* plugin-support/skeleton: Bump to CMake 3.15 (Arne Welzel, Corelight)

0.50-24 | 2023-08-24 15:28:11 -0700

* CI: Add variable to Dockerfiles to force rebuilds (Tim Wojtulewicz, Corelight)
Expand Down
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. -*- mode: rst; -*-
..
.. Version number is filled in automatically.
.. |version| replace:: 0.50-24
.. |version| replace:: 0.50-27

=======================
Zeek Auxiliary Programs
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.50-24
0.50-27
3 changes: 2 additions & 1 deletion rst/rst.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,8 @@ int main(int argc, char **argv)
if ( s < 0 )
pgripe("couldn't create raw socket");

setuid(getuid());
if ( setuid(getuid()) )
pgripe("couldn't lower privileges");

if ( setsockopt(s, 0, IP_HDRINCL, (char *) &on, sizeof(on)) < 0 )
pgripe("can't turn on IP_HDRINCL");
Expand Down

0 comments on commit 6bd1725

Please sign in to comment.