OpenBSD CVS

CVS log for src/usr.sbin/snmpd/proc.c


[BACK] Up to [local] / src / usr.sbin / snmpd

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.32 / (download) - annotate - [select for diffs], Tue Apr 9 15:48:01 2024 UTC (8 weeks, 4 days ago) by tobhe
Branch: MAIN
CVS Tags: HEAD
Changes since 1.31: +4 -21 lines
Diff to previous 1.31 (colored)

Sync removal of setsid(), setpgid() and a few dup2() from relayd. They are
redundant since we call daemon() earlier.

ok bluhm@

Revision 1.31 / (download) - annotate - [select for diffs], Mon Apr 8 13:18:54 2024 UTC (2 months ago) by tobhe
Branch: MAIN
Changes since 1.30: +4 -1 lines
Diff to previous 1.30 (colored)

Call daemon() only in parent and before proc_exec() to avoid orphaning child
processes. Synced from relayd.

ok florian@

Revision 1.30 / (download) - annotate - [select for diffs], Tue Jan 16 13:33:12 2024 UTC (4 months, 3 weeks ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5
Changes since 1.29: +2 -10 lines
Diff to previous 1.29 (colored)

Convert to imsg_get_fd() and remove unused proc_forward_imsg().
OK martijn@

Revision 1.29 / (download) - annotate - [select for diffs], Thu Dec 21 12:43:31 2023 UTC (5 months, 2 weeks ago) by martijn
Branch: MAIN
Changes since 1.28: +3 -3 lines
Diff to previous 1.28 (colored)

Clean up snmpd's header situation.

With the help of tb@ and include-what-you-use.

OK tb@

Revision 1.28 / (download) - annotate - [select for diffs], Wed Feb 15 20:44:01 2023 UTC (15 months, 3 weeks ago) by tobhe
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.27: +1 -14 lines
Diff to previous 1.27 (colored)

proc_ispeer() is not used anywhere anymore so remove it everywhere.

ok florian@ bluhm@
ok for vmd mlarkin@

Revision 1.27 / (download) - annotate - [select for diffs], Tue Jun 30 17:11:49 2020 UTC (3 years, 11 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.26: +1 -19 lines
Diff to previous 1.26 (colored)

Remove agentx and control socket support.

snmpctl has been removed two releases ago, which makes the control
interface obsolete.

agentx support has always been quirky at best, but got completely broken
with the BER_MAX_OID_LEN increase in ber.h. This change resulted in the
oid length on the snmp side being left uninitialized because of size
difference, resulting in weird behaviour. No one reported the breakage,
even after 6.7 was released.

This change requires users to remove the socket keyword from their
snmpd.conf.

OK denis@

Revision 1.26 / (download) - annotate - [select for diffs], Tue Jan 8 15:38:36 2019 UTC (5 years, 5 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.25: +16 -5 lines
Diff to previous 1.25 (colored)

The child processes of snmpd(8) did not detach from the terminal.
Dup /dev/null to the stdio file descriptors in the children.
based on a fix for httpd(8) and relayd(8); from Jan Klemkow

Revision 1.25 / (download) - annotate - [select for diffs], Sun Aug 5 09:33:13 2018 UTC (5 years, 10 months ago) by mestre
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.24: +1 -4 lines
Diff to previous 1.24 (colored)

Remove cpath pledge(2) promise. We decided that not deleting the unix control
sockets cause no harm and this way we close another attack surface by not
allowing the daemon to create/delete any more files.

While here also scramble pledge promises to their canonical form.

OK florian@

Revision 1.24 / (download) - annotate - [select for diffs], Mon May 29 12:56:26 2017 UTC (7 years ago) by benno
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.23: +5 -5 lines
Diff to previous 1.23 (colored)

sync proc.c changes from relayd/httpd

Revision 1.23 / (download) - annotate - [select for diffs], Tue Jan 17 22:10:56 2017 UTC (7 years, 4 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.22: +2 -2 lines
Diff to previous 1.22 (colored)

Nuke some whitespace that keeps poking me in the eye as I try to
steal code.

Revision 1.22 / (download) - annotate - [select for diffs], Mon Jan 9 14:49:22 2017 UTC (7 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.21: +2 -2 lines
Diff to previous 1.21 (colored)

Stop accessing verbose and debug variables from log.c directly.

This replaces log_verbose() and "extern int verbose" with the two functions
log_setverbose() and log_getverbose().

Pointed out by benno@
OK krw@ eric@ gilles@ (OK gilles@ for the snmpd bits as well)

Revision 1.21 / (download) - annotate - [select for diffs], Fri Oct 28 09:07:08 2016 UTC (7 years, 7 months ago) by rzalamena
Branch: MAIN
Changes since 1.20: +392 -198 lines
Diff to previous 1.20 (colored)

Sync snmpd(8) with other daemons proc.c and teach him how to fork+exec.

ok jca@, reyk@

Revision 1.20 / (download) - annotate - [select for diffs], Mon Dec 7 16:05:56 2015 UTC (8 years, 6 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.19: +6 -4 lines
Diff to previous 1.19 (colored)

Add imsg "peerid" to debug messages (only within -DDEBUG).

Revision 1.19 / (download) - annotate - [select for diffs], Mon Dec 7 12:33:08 2015 UTC (8 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.18: +20 -6 lines
Diff to previous 1.18 (colored)

Sync proc.c, use proc_composev()

Revision 1.18 / (download) - annotate - [select for diffs], Sat Dec 5 13:14:40 2015 UTC (8 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

EAGAIN handling for imsg_read. OK henning@ benno@

Revision 1.17 / (download) - annotate - [select for diffs], Mon Nov 23 19:31:52 2015 UTC (8 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.16: +3 -5 lines
Diff to previous 1.16 (colored)

Use SOCK_NONBLOCK to replace socket_set_blockmode() and fcntl(..O_NONBLOCK).
(SOCK_CLOEXEC should also be added where it is appropriate, but this is OBnot
done in this commit yet.)

OK claudio@

Revision 1.16 / (download) - annotate - [select for diffs], Mon Nov 23 16:43:55 2015 UTC (8 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.15: +13 -4 lines
Diff to previous 1.15 (colored)

Sync proc.c with iked

Revision 1.15 / (download) - annotate - [select for diffs], Sun Nov 22 13:27:13 2015 UTC (8 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.14: +12 -15 lines
Diff to previous 1.14 (colored)

Update log.c: change fatal() and fatalx() into variadic functions,
include the process name, and replace all calls of fatal*(NULL) with
fatal(__func__) for better debugging.

OK benno@

Revision 1.14 / (download) - annotate - [select for diffs], Wed Oct 14 14:51:57 2015 UTC (8 years, 7 months ago) by reyk
Branch: MAIN
Changes since 1.13: +19 -18 lines
Diff to previous 1.13 (colored)

sync with httpd - no functional change, just C99 types

Revision 1.13 / (download) - annotate - [select for diffs], Tue Dec 16 03:35:49 2014 UTC (9 years, 5 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.12: +2 -2 lines
Diff to previous 1.12 (colored)

Replace setpgrp(0, getpid()) with setpgid(0, 0).  OK deraadt@ tedu@

Revision 1.12 / (download) - annotate - [select for diffs], Sat Oct 25 03:23:49 2014 UTC (9 years, 7 months ago) by lteo
Branch: MAIN
Changes since 1.11: +1 -2 lines
Diff to previous 1.11 (colored)

Remove unnecessary netinet/in_systm.h include.

ok millert@

Revision 1.11 / (download) - annotate - [select for diffs], Mon Aug 18 13:13:42 2014 UTC (9 years, 9 months ago) by reyk
Branch: MAIN
Changes since 1.10: +5 -4 lines
Diff to previous 1.10 (colored)

Sync proc.c with httpd.  httpd needs SIGUSR1 but snmpd will ignore it
now instead of terminating the process.

ok blambert@

Revision 1.10 / (download) - annotate - [select for diffs], Sat Jul 12 14:15:04 2014 UTC (9 years, 10 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

Sync msgbuf_write() changes from relayd.

Please note that proc.c should be kept identical in relayd, iked and
snmpd (currently without the includes).

ok benno@

Revision 1.9 / (download) - annotate - [select for diffs], Thu May 8 13:04:28 2014 UTC (10 years, 1 month ago) by blambert
Branch: MAIN
Changes since 1.8: +12 -5 lines
Diff to previous 1.8 (colored)

Bring back restricted sockets, inadvertantly removed in
previous proc.c update

ok reyk@

Revision 1.8 / (download) - annotate - [select for diffs], Tue May 6 06:40:03 2014 UTC (10 years, 1 month ago) by jsg
Branch: MAIN
Changes since 1.7: +1 -2 lines
Diff to previous 1.7 (colored)

no need to include rand.h now the RAND_seed() calls are gone.
ok reyk@

Revision 1.7 / (download) - annotate - [select for diffs], Sun May 4 10:34:35 2014 UTC (10 years, 1 month ago) by reyk
Branch: MAIN
Changes since 1.6: +1 -13 lines
Diff to previous 1.6 (colored)

With the recent change by deraadt@ to introduce kern.nosuidcoredump=3,
we don't need the horrible debug hack anymore that disabled privdrop
and chroot to get core dumps of privsep processes.  No functional
change for the normal binary, only if it is compiled with the
non-default -DDEBUG option.

Revision 1.6 / (download) - annotate - [select for diffs], Mon Apr 21 19:47:27 2014 UTC (10 years, 1 month ago) by reyk
Branch: MAIN
Changes since 1.5: +308 -108 lines
Diff to previous 1.5 (colored)

Copy the updated proc.c from relayd to use the same file.  Adjust
snmpd accordingly.

ok sthen@

Revision 1.5 / (download) - annotate - [select for diffs], Fri Apr 18 21:29:20 2014 UTC (10 years, 1 month ago) by tedu
Branch: MAIN
Changes since 1.4: +1 -6 lines
Diff to previous 1.4 (colored)

round up some enemy sympathizers found calling RAND_seed().
ok beck reyk

Revision 1.4 / (download) - annotate - [select for diffs], Mon Apr 14 07:18:05 2014 UTC (10 years, 1 month ago) by blambert
Branch: MAIN
Changes since 1.3: +2 -1 lines
Diff to previous 1.3 (colored)

Fix the following idiom in the following way:

        arc4random_buf(seed, sizeof(seed));
        RAND_seed(seed, sizeof(seed));
+       explicit_bzero(seed, sizeof(seed));

ok reyk@

Revision 1.3 / (download) - annotate - [select for diffs], Fri Feb 14 10:38:09 2014 UTC (10 years, 3 months ago) by florian
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.2: +1 -7 lines
Diff to previous 1.2 (colored)

remove unused function that distracts from cleaning up the imsg_flush() mess
OK hennig@, benno@

Revision 1.2 / (download) - annotate - [select for diffs], Wed Nov 13 20:45:19 2013 UTC (10 years, 6 months ago) by benno
Branch: MAIN
Changes since 1.1: +2 -2 lines
Diff to previous 1.1 (colored)

handle msgbuf_write() returning EAGAIN

ok reyk

Revision 1.1 / (download) - annotate - [select for diffs], Thu Oct 17 08:42:44 2013 UTC (10 years, 7 months ago) by reyk
Branch: MAIN

Update snmpd(8) to use the proc.c privsep style from iked and relayd.

ok sthen@ deraadt@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.