Deleted Added
full compact
ping.c (277562) ping.c (282436)
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Mike Muuss.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 28 unchanged lines hidden (view full) ---

37 The Regents of the University of California. All rights reserved.\n";
38#endif /* not lint */
39
40#ifndef lint
41static char sccsid[] = "@(#)ping.c 8.1 (Berkeley) 6/5/93";
42#endif /* not lint */
43#endif
44#include <sys/cdefs.h>
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Mike Muuss.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 28 unchanged lines hidden (view full) ---

37 The Regents of the University of California. All rights reserved.\n";
38#endif /* not lint */
39
40#ifndef lint
41static char sccsid[] = "@(#)ping.c 8.1 (Berkeley) 6/5/93";
42#endif /* not lint */
43#endif
44#include <sys/cdefs.h>
45__FBSDID("$FreeBSD: head/sbin/ping/ping.c 277562 2015-01-23 13:26:35Z ae $");
45__FBSDID("$FreeBSD: head/sbin/ping/ping.c 282436 2015-05-04 21:44:51Z brooks $");
46
47/*
48 * P I N G . C
49 *
50 * Using the Internet Control Message Protocol (ICMP) "ECHO" facility,
51 * measure round-trip-delays and packet loss across network paths.
52 *
53 * Author -

--- 678 unchanged lines hidden (view full) ---

732 /*
733 * Here we enter capability mode. Further down access to global
734 * namespaces (e.g filesystem) is restricted (see capsicum(4)).
735 * We must connect(2) our socket before this point.
736 */
737 if (cansandbox && cap_enter() < 0 && errno != ENOSYS)
738 err(1, "cap_enter");
739
46
47/*
48 * P I N G . C
49 *
50 * Using the Internet Control Message Protocol (ICMP) "ECHO" facility,
51 * measure round-trip-delays and packet loss across network paths.
52 *
53 * Author -

--- 678 unchanged lines hidden (view full) ---

732 /*
733 * Here we enter capability mode. Further down access to global
734 * namespaces (e.g filesystem) is restricted (see capsicum(4)).
735 * We must connect(2) our socket before this point.
736 */
737 if (cansandbox && cap_enter() < 0 && errno != ENOSYS)
738 err(1, "cap_enter");
739
740 if (cap_sandboxed())
741 fprintf(stderr, "capability mode sandbox enabled\n");
742
743 cap_rights_init(&rights, CAP_RECV, CAP_EVENT, CAP_SETSOCKOPT);
744 if (cap_rights_limit(srecv, &rights) < 0 && errno != ENOSYS)
745 err(1, "cap_rights_limit srecv");
746
747 cap_rights_init(&rights, CAP_SEND, CAP_SETSOCKOPT);
748 if (cap_rights_limit(ssend, &rights) < 0 && errno != ENOSYS)
749 err(1, "cap_rights_limit ssend");
750

--- 1093 unchanged lines hidden ---
740 cap_rights_init(&rights, CAP_RECV, CAP_EVENT, CAP_SETSOCKOPT);
741 if (cap_rights_limit(srecv, &rights) < 0 && errno != ENOSYS)
742 err(1, "cap_rights_limit srecv");
743
744 cap_rights_init(&rights, CAP_SEND, CAP_SETSOCKOPT);
745 if (cap_rights_limit(ssend, &rights) < 0 && errno != ENOSYS)
746 err(1, "cap_rights_limit ssend");
747

--- 1093 unchanged lines hidden ---