Commit Graph

13132 Commits

Author SHA1 Message Date
Guy Helmer
074db536b3 Allow daemon(8) to run pidfile_open() before relenquishing privileges
so pid files can be written in /var/run when started as root.

I do not expect this to cause any security issues, but if anyone objects
it could be easily reverted.

PR:		bin/159568
MFC after:	4 weeks
2012-01-05 22:48:36 +00:00
Ulrich Spörlein
389ae6c65d Touch up some more small typos missed in the previous round.
Reported by:	Ben Kaduk <minimarmot@gmail.com> et al.
2012-01-05 21:36:45 +00:00
Ulrich Spörlein
f7bcc1c411 Further fix a typo and spelling classic correctly in function names,
too.

Submitted by:	Ben Kaduk <minimarmot@gmail.com>
2012-01-05 21:36:36 +00:00
Ulrich Spörlein
b81da4450d Partial backout of r228990, restore original MIB object name.
It's too late to change this in 9.0 -- so we have a release with the
misspelling in the wild and should not break users that depend on it.

Deprecating/replacing it because of a one-char typo seems excessive.
2012-01-05 21:36:28 +00:00
Pawel Jakub Dawidek
9a492fd171 Add an missing argument to open(2). If O_CREAT flag is specified,
file permission has to be specified as well.
2012-01-04 07:21:37 +00:00
Pawel Jakub Dawidek
24bc5224c6 Add an missing argument to open(2). If O_CREAT flag is specified,
file permission has to be specified as well.
2012-01-04 07:04:43 +00:00
Ed Schouten
b3608ae18f Replace index() and rindex() calls with strchr() and strrchr().
The index() and rindex() functions were marked LEGACY in the 2001
revision of POSIX and were subsequently removed from the 2008 revision.
The strchr() and strrchr() functions are part of the C standard.

This makes the source code a lot more consistent, as most of these C
files also call into other str*() routines. In fact, about a dozen
already perform strchr() calls.
2012-01-03 18:51:58 +00:00
Ed Schouten
b589816c74 Fix subtle typo: compare against idx -- not index.
In this contest, index refers to the index(3) function. In this case it
doesn't really harm, as this function is never called with idx == NULL.

MFC after:	2 weeks
2012-01-03 11:10:15 +00:00
Ed Schouten
c70a327b9f Simply use getprogname() to obtain the name of the process. 2012-01-03 11:08:58 +00:00
Stefan Farfeleder
45360108f8 Fix typos in command descriptions. 2011-12-31 12:12:41 +00:00
Ulrich Spörlein
3df5ecac8c Spelling fixes for usr.sbin/ 2011-12-30 10:58:14 +00:00
Ulrich Spörlein
f76b319989 Reencode files to UTF-8. Drop CP1252 em-dash. 2011-12-30 00:59:08 +00:00
Xin LI
981dfb0965 - Fail when the utility is not invoked as rtprio nor idprio.
- use warnx() to tell the user whether a process is running in normal,
   idle or realtime priority. with the old code it would have been possible
   for another process to send data to stdout between
	printf("%s: ", p);
   and
	printf("* priority\n");
   and thus break the formatting.
 - 'rtprio 10 -0' triggeres non-intuitive behavior.  It would first set the
   priority of itself to 10 *and* would then try to execute '-0'. Of course,
   setting the priority of [id|rt]prio itself doesn't make a lot of sense,
   but it is intuitive compared to the previous behavior.
 - 'rtprio -t --1' will actually pass over the '-1' to rtprio().  Now
   invoking rtprio like this will catch the wrong usage before passing
   over the invalid argument to rtprio().
 - Garrett Cooper suggested to add further diagnostics where the failure
   occures, if execvp fails.

PR:		bin/154042
Submitted by:	arundel
MFC after:	1 month
2011-12-27 20:03:57 +00:00
Eitan Adler
19e1bf2997 - document the -l option to usermod
PR:		docs/161588
Submitted by:	"Luchesar V. ILIEV" <luchesar.iliev@gmail.com>
Approved by:	gjb
MFC after:	1 week
2011-12-22 03:36:54 +00:00
Eitan Adler
5bf8645b8d - Fix style(9) bug I introduced in the last commit
Approved by:	jhb
2011-12-21 20:47:24 +00:00
Eitan Adler
520374b5aa - Remove extraneous null ptr deref checks
- Fix memory leak

Submitted by:	Slono Slono <slonoman2011@yandex.ru>
Approved by:	jhb
MFC after:	1 week
2011-12-21 20:27:41 +00:00
John Baldwin
f9a0145857 Allow boot0cfg to force a PXE boot via boot0 on the next boot.
- Fix boot0 to check for PXE when using the pre-set setting for the
  preferred slice.
- Update boot0cfg to use slice 6 to select PXE.  Accept a 'pxe' argument
  instead of a number for the 's' option as a way to select PXE as well.

Submitted by:	Andrew Boyer  aboyer averesystems
MFC after:	2 weeks
2011-12-20 15:19:29 +00:00
Ed Schouten
55a1bde99c Small cleanups to panic() prototype.
- Let panic() use _Noreturn and __printflike() instead of GCC-specific
  attributes.
- Remove prototype from ffs_subr.c and let it include ffs_extern.h.
- Forward declare struct inode to make ffs_extern.h not depend on it.
2011-12-20 12:34:17 +00:00
Dimitry Andric
8a0e4ea185 In usr.sbin/yp_mkdb/yp_mkdb.c, cast some printf field width parameters
to int, cast time_t to intmax_t, and use the corresponding printf length
modifier.

MFC after:	1 week
2011-12-19 20:44:44 +00:00
Dimitry Andric
5eeae9a725 In usr.sbin/uhsoctl/uhsoctl.c, fix a few warnings about format strings
not being literals.

MFC after:	1 week
2011-12-19 20:38:26 +00:00
Dimitry Andric
5c67a2799c Fix r228719; when you use intmax_t, you need stdint.h.
Pointy hat to:	dim
MFC after:	1 week
2011-12-19 20:33:53 +00:00
Dimitry Andric
655353a78c Some people pointed out long is 32-bit on some arches, while time_t is
64-bit, so better cast time_t to intmax_t, and use the appropriate
printf format strings.

MFC after:	1 week
2011-12-19 20:29:50 +00:00
Dimitry Andric
ad5b59d82c In usr.sbin/timed, fix several issues with printf formats:
- Cast time_t's to long, and print them with %ld.
- Print ptrdiff_t's with %td.
- Print ssize_t's and size_t's with %zd and %zu.
- Print int32_t's with %d.
Also, replace some int variables with the more appropriate size_t.

MFC after:	1 week
2011-12-19 18:08:31 +00:00
Dimitry Andric
136fb141c6 Unfortunately, clang gives warnings about sendmail code that cannot be
turned off yet.  Since this is contrib code, and we don't really care
about the warnings, just turn make them non-fatal for now.

MFC after:	1 week
2011-12-19 13:35:44 +00:00
Dimitry Andric
b134560923 Forgot to add usr.sbin/sade/label.c in the previous commit.
MFC after:	1 week
2011-12-18 01:14:38 +00:00
Dimitry Andric
7b910e702a In usr.sbin/sade/install.c and usr.sbin/sade/label.c, fix a few warnings
about format strings not being literals.

MFC after:	1 week
2011-12-18 01:13:21 +00:00
Dimitry Andric
4c14050c9d In usr.sbin/sa/db.c, avoid warnings about assigning two const char
arrays to non-const void pointers, by casting away const explicitly.

MFC after:	1 week
2011-12-18 01:08:25 +00:00
Dimitry Andric
0af4e80ae5 In usr.sbin/rpc.ypupdated/yp_dbupdate.c, since intmax_t is signed, just
like time_t, better use %jd instead of %ju.  Strangely enough, neither
gcc, clang nor gcc 4.6 warn about this discrepancy...

MFC after:	1 week
2011-12-18 00:55:46 +00:00
Dimitry Andric
ae1d153674 In usr.sbin/rpc.ypupdated/yp_dbupdate.c, include stdint.h, so intmax_t
is known, otherwise it won't build.

Pointy hat to:	dim
MFC after:	1 week
2011-12-18 00:44:59 +00:00
Dimitry Andric
7027737f5a In usr.sbin/rpc.ypupdated/yp_dbupdate.c, use the appropriate printf
length modifier for time_t (after casting it to intmax_t).

MFC after:	1 week
2011-12-18 00:40:30 +00:00
Dimitry Andric
2214781145 In usr.sbin/route6d/route6d.c, use the correct printf length modifier
for an ssize_t.

MFC after:	1 week
2011-12-18 00:03:03 +00:00
Dimitry Andric
5893527d84 In usr.sbin/pw/pw_user.c, use the correct printf length modifier for a
ptrdiff_t.

MFC after:	1 week
2011-12-17 23:46:47 +00:00
Dimitry Andric
e2d0cd59c3 In usr.sbin/pmccontrol/pmccontrol.c, fix a few warnings about format
strings not being literals.

MFC after:	1 week
2011-12-17 23:39:13 +00:00
Dimitry Andric
9a3df8edd1 In usr.sbin/pkg_install/updating/main.c, use the size of the destination
buffer as size argument to strlcpy(), not the length of the source.

MFC after:	1 week
2011-12-17 23:35:46 +00:00
Dimitry Andric
b41349deef Use NO_WCAST_ALIGN for usr.sbin/ndiscvt; because this is only built for
x86, any alignment warnings can be safely ignored.  Define YY_NO_INPUT
in usr.sbin/ndiscvt/inf-token.l, so no unused lex functions are defined.

MFC after:	1 week
2011-12-17 22:16:27 +00:00
Dimitry Andric
97fbdc11ea In usr.sbin/lpr/lpd/printjob.c, use the correct printf length modifiers
for off_t (aka int64_t).

MFC after:	1 week
2011-12-17 22:05:28 +00:00
Dimitry Andric
7ae1a27825 In usr.sbin/lpr/filters/lpf.c, use a less obtuse way of clearing the
buffer, that also avoids warnings.

MFC after:	1 week
2011-12-17 21:37:21 +00:00
Dimitry Andric
740885817c In usr.sbin/keyserv, fix some implicit enum conversions, and use the
correct printf length modifiers for uid_t.

MFC after:	1 week
2011-12-17 20:53:06 +00:00
Dimitry Andric
cfed15e6c5 In usr.sbin/iostat/iostat.c, use printf format specifiers from
inttypes.h for u_int64_t's.  While here, sort #include directives.

MFC after:	1 week
2011-12-17 20:25:23 +00:00
Dimitry Andric
928e797dc0 In usr.sbin/i2c/i2c.c, fix a few warnings about format strings not being
literals.

MFC after:	1 week
2011-12-17 20:12:17 +00:00
Dimitry Andric
e0c518be94 In usr.sbin/ctm/ctm_dequeue/ctm_dequeue.c, cast a printf field width
parameter to int.

MFC after:	1 week
2011-12-17 20:07:42 +00:00
Dimitry Andric
5207dac8ba Use NO_WCAST_ALIGN for usr.sbin/cpucontrol; because this is only built
for x86, any alignment warnings can be safely ignored.

MFC after:	1 week
2011-12-17 19:58:48 +00:00
Dimitry Andric
1605515d77 In usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.h, use the correct
enumeration types for the mesh_peering and mesh_forwarding members of
struct wlan_iface, to fix enum conversion warnings.

MFC after:	1 week
2011-12-17 19:53:08 +00:00
Dimitry Andric
14fa6dc403 Use NO_WCAST_ALIGN for usr.sbin/boot0cfg; because this is only built for
x86, any alignment warnings can be safely ignored.

MFC after:	1 week
2011-12-17 19:33:26 +00:00
Dimitry Andric
98e0f284ba In usr.sbin/bluetooth/sdpd/server.c, don't use the size of a pointer as
the length argument to memset, but the size of the object pointed to.

MFC after:	1 week
2011-12-17 19:26:03 +00:00
Ed Schouten
4d9a3537ff Add missing static and const keywords to kbdcontrol.
None of the symbols provided by kbdcontrol.c are used by other source
files of this binary. Slightly reduce the binary size and make much more
symbols read-only by adding proper static and const keywords.
2011-12-12 12:33:38 +00:00
Fabien Thomas
96ff3b75d4 Add VIA microde update support to cpuctl(4) and cpucontrol(8).
Support have been tested with X2 CPU and QuadCore CPU.

MFC after:	1 month
2011-12-12 12:30:44 +00:00
Ed Schouten
3be02c20ca Add static keywords to vidcontrol(1).
While there, remove the false optimisation of the colors array. It seems
that changing it to an array of pointers instead of a 16x16 array does
not cause any increase in binary size at all.
2011-12-11 21:02:33 +00:00
Ed Schouten
e120624d32 Add missing static keyword.
All global variables and functions in powerd are marked static, except
this array of strings. Add the keyword, for consistency.
2011-12-11 19:22:42 +00:00
Ed Schouten
516c8ed9dd Replace char copyright[] by static const char copyright[].
It seems the latter is used throughout the tree.
2011-12-10 18:11:06 +00:00