OpenBSD CVS

CVS log for src/usr.bin/usbhidctl/usbhid.c


[BACK] Up to [local] / src / usr.bin / usbhidctl

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.20 / (download) - annotate - [select for diffs], Tue Mar 7 17:43:59 2023 UTC (14 months, 1 week ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, HEAD
Changes since 1.19: +1 -5 lines
Diff to previous 1.19 (colored)

Delete obsolete /* ARGSUSED1 */ lint comments.

ok claudio@ cheloha@ krw@ deraadt@ miod@ millert@

Revision 1.19 / (download) - annotate - [select for diffs], Sun Dec 4 23:50:50 2022 UTC (17 months, 2 weeks ago) by cheloha
Branch: MAIN
Changes since 1.18: +2 -3 lines
Diff to previous 1.18 (colored)

userspace: remove vestigial '?' cases from top-level getopt(3) loops

getopt(3) returns '?' when it encounters a flag not present in the in
the optstring or if a flag is missing its option argument.  We can
handle this case with the "default" failure case with no loss of
legibility.  Hence, remove all the redundant "case '?':" lines.

Prompted by dlg@.  With help from dlg@ and millert@.

Link: https://marc.info/?l=openbsd-tech&m=167011979726449&w=2

ok naddy@ millert@ dlg@

Revision 1.18 / (download) - annotate - [select for diffs], Wed Dec 15 11:21:35 2021 UTC (2 years, 5 months ago) by mestre
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.17: +6 -1 lines
Diff to previous 1.17 (colored)

restrict all filesystem access with unveil(2).

hid_start(3) opens `table' through libusbhid, then usbhidctl(1) itself opens
`dev', after that it's just performing ioctls on the fd left opened by the
latter so all fs access can be disabled.

Revision 1.17 / (download) - annotate - [select for diffs], Mon May 31 18:30:11 2021 UTC (2 years, 11 months ago) by jcs
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.16: +26 -10 lines
Diff to previous 1.16 (colored)

add an -R flag to dump the raw report descriptor bytes for parsing
with other tools

man page help from jmc
ok anton

Revision 1.16 / (download) - annotate - [select for diffs], Thu Feb 4 06:57:19 2021 UTC (3 years, 3 months ago) by anton
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.15: +2 -8 lines
Diff to previous 1.15 (colored)

Unconditionally allocate a buffer big enough to hold a struct
usb_ctl_report.

Limiting the size of the buffer to the size of the requested report can
cause the ioctl(USB_GET_REPORT) command to fail with EFAULT as the
kernel will always copy sizeof(struct usb_ctl_report) bytes from the
address passed from user space. That is when the given address +
sizeof(struct usb_ctl_report) crosses a page boundary and the adjacent
page is not mapped.

ok mglocker@

Revision 1.15 / (download) - annotate - [select for diffs], Fri Jun 28 13:35:05 2019 UTC (4 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.14: +6 -6 lines
Diff to previous 1.14 (colored)

When system calls indicate an error they return -1, not some arbitrary
value < 0.  errno is only updated in this case.  Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.

Revision 1.14 / (download) - annotate - [select for diffs], Sat Jan 9 02:01:34 2016 UTC (8 years, 4 months ago) by jcs
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.13: +1 -5 lines
Diff to previous 1.13 (colored)

revert previous now that they are found in usbhid.h again

Revision 1.13 / (download) - annotate - [select for diffs], Fri Jan 8 16:59:33 2016 UTC (8 years, 4 months ago) by jcs
Branch: MAIN
Changes since 1.12: +5 -1 lines
Diff to previous 1.12 (colored)

redefine 3 UHID_* vars that moved

Revision 1.12 / (download) - annotate - [select for diffs], Tue Dec 22 19:46:16 2015 UTC (8 years, 4 months ago) by mmcc
Branch: MAIN
Changes since 1.11: +2 -3 lines
Diff to previous 1.11 (colored)

remove a NULL-check before free()

Revision 1.11 / (download) - annotate - [select for diffs], Wed Nov 27 00:13:23 2013 UTC (10 years, 5 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

unsigned char for ctype
ok okan

Revision 1.10 / (download) - annotate - [select for diffs], Mon Aug 2 13:57:32 2010 UTC (13 years, 9 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

Only open with O_RDWR if we are actually chaging a report descriptor, other
operations only need O_RDONLY.
ok blambert@ deraadt@

Revision 1.9 / (download) - annotate - [select for diffs], Thu Oct 16 18:37:19 2008 UTC (15 years, 7 months ago) by jakemsr
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.8: +5 -2 lines
Diff to previous 1.8 (colored)


make -a the default when no other options besides the required
-f are used

input from and ok sthen@, jmc@, deraadt@

Revision 1.8 / (download) - annotate - [select for diffs], Thu Jun 26 05:42:21 2008 UTC (15 years, 10 months ago) by ray
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.7: +1 -8 lines
Diff to previous 1.7 (colored)

First pass at removing clauses 3 and 4 from NetBSD licenses.

Not sure what's more surprising: how long it took for NetBSD to
catch up to the rest of the BSDs (including UCB), or the amount of
code that NetBSD has claimed for itself without attributing to the
actual authors.

OK deraadt@

Revision 1.7 / (download) - annotate - [select for diffs], Mon Oct 4 05:21:27 2004 UTC (19 years, 7 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.6: +2 -2 lines
Diff to previous 1.6 (colored)

hierarchy is spelt hierarchy, ok djm@

Revision 1.6 / (download) - annotate - [select for diffs], Fri Jun 4 00:47:32 2004 UTC (19 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.5: +3 -2 lines
Diff to previous 1.5 (colored)

knf + new interface: hid_start() is non-exit non-stderr spewing version of hid_init(); ok matthieu millert

Revision 1.5 / (download) - annotate - [select for diffs], Sat Apr 3 21:01:25 2004 UTC (20 years, 1 month ago) by jmc
Branch: MAIN
Changes since 1.4: +5 -5 lines
Diff to previous 1.4 (colored)

- correct SYNOPSIS
- sync usage()
- some small tweaks

Revision 1.4 / (download) - annotate - [select for diffs], Fri May 10 00:09:17 2002 UTC (22 years ago) by nate
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4, OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.3: +305 -140 lines
Diff to previous 1.3 (colored)

Update usb userland stuff to reflect hid changes in the kernel.
This adds the new program usbhidaction which can be used to assign actions
to events that occur on a uhid device.  For example, you can now make the
volume buttons on some newer keyboards actually do something.

Revision 1.3 / (download) - annotate - [select for diffs], Thu May 2 20:12:07 2002 UTC (22 years ago) by nate
Branch: MAIN
Changes since 1.2: +7 -7 lines
Diff to previous 1.2 (colored)

userland portion of prefixing usb structure members to avoid name clashes.
From NetBSD

Revision 1.2 / (download) - annotate - [select for diffs], Sun Dec 30 07:10:42 2001 UTC (22 years, 4 months ago) by pvalchev
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.1: +2 -2 lines
Diff to previous 1.1 (colored)

libusb has been renamed

Revision 1.1 / (download) - annotate - [select for diffs], Sun Sep 2 17:55:29 2001 UTC (22 years, 8 months ago) by pvalchev
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0

program to manipulate USB HID devices
from NetBSD, reviewed by jakob

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.