Re: sysctl machdep.lidaction=suspend

2017-07-29 Thread Martin Natano
On Sat, Jul 29, 2017 at 02:19:50PM +0200, Martin Natano wrote: > On Sat, Jul 29, 2017 at 02:03:22PM +0200, Mark Kettenis wrote: > > > > I don't think we want to add string parsing like this in the kernel. > > Maybe the sysctl(8) frontend should do the mapping from strin

Re: sysctl machdep.lidaction=suspend

2017-07-29 Thread Martin Natano
On Sat, Jul 29, 2017 at 02:03:22PM +0200, Mark Kettenis wrote: > > I don't think we want to add string parsing like this in the kernel. > Maybe the sysctl(8) frontend should do the mapping from strings to > numbers? Ok, I'll try to come up with an alternative diff that does the parsing in sysctl(

sysctl machdep.lidaction=suspend

2017-07-29 Thread Martin Natano
Words are more descriptive than numbers. Let's use them! This diff removes sysctl machdep.lidaction=0 sysctl machdep.lidaction=1 sysctl machdep.lidaction=2 in favor of the more descriptive sysctl machdep.lidaction=none sysctl machdep.lidaction=suspend

Re: remove CPU_LIDSUSPEND/machdep.lidsuspend

2017-07-11 Thread Martin Natano
On Tue, Jul 11, 2017 at 02:40:16PM -0700, Mike Larkin wrote: > On Tue, Jul 11, 2017 at 11:19:17PM +0200, Martin Natano wrote: > > Go ahead replacing machdep.lidsuspend with cpu.lidaction. OpenBSD 6.1 > > cpu.lidaction or machdep.lidaction? machdep.lidaction; I got confused by the #define name.

remove CPU_LIDSUSPEND/machdep.lidsuspend

2017-07-11 Thread Martin Natano
Go ahead replacing machdep.lidsuspend with cpu.lidaction. OpenBSD 6.1 contains both MIBs, so there is a clear path for migration. ok? natano Index: arch/amd64/amd64/machdep.c === RCS file: /cvs/src/sys/arch/amd64/amd64/machdep.c,v

Re: vi(1): remove stub settings

2017-07-02 Thread Martin Natano
On Fri, Jun 30, 2017 at 09:19:31AM -0600, Anthony J. Bentley wrote: > > Here's a diff that updates the STANDARDS section in the manual. > I think it will be enough to talk about our POSIX compliance. POSIX > discusses its differences from historical ex/vi in great detail, > including an explicit r

Re: CPU_LIDSUSPEND in init(8) and reboot(8)

2017-06-13 Thread Martin Natano
ping? On Sun, May 21, 2017 at 09:46:45AM +0200, Martin Natano wrote: > While switching init and reboot to CPU_LIDACTION, I forgot about the > #ifdef's. Ok? > > natano > > > Index: init/init.c > === &

Re: ping: Style fixes/cleanups

2017-06-13 Thread Martin Natano
On Tue, Jun 13, 2017 at 08:02:13PM +0200, Klemens Nanni wrote: > Unify option checking and simply logic. > > F_HDRINCL and F_ROUTE are mutually exclusive, thus check the latter only > if the former one is not set. > > Index: ping.c > ===

CPU_LIDSUSPEND in init(8) and reboot(8)

2017-05-21 Thread Martin Natano
While switching init and reboot to CPU_LIDACTION, I forgot about the #ifdef's. Ok? natano Index: init/init.c === RCS file: /cvs/src/sbin/init/init.c,v retrieving revision 1.64 diff -u -p -r1.64 init.c --- init/init.c 3 May 2017 09:5

Re: Fix comment into sys/dev/acpi/acpibtn.c

2017-05-21 Thread Martin Natano
On Thu, May 11, 2017 at 01:11:16PM +0200, David Coppa wrote: > > I think this comment was copy-pasted as is from the comment some > lines below, but this is about hibernation, not sleep. sleep != suspend Suspend and hibernate both are sleep states. > > Ok? > > Index: acpibtn.c >

switch base tools from /dev/bpf0 to /dev/bpf

2017-04-18 Thread Martin Natano
Now that /dev/bpf has been around for two releases, it should be safe to move the base tools to /dev/bpf. No need to worry about the upgrade path anymore. Ok? natano Index: lib/libpcap/pcap-bpf.c === RCS file: /cvs/src/lib/libpcap/

makefs filename handling

2017-04-05 Thread Martin Natano
Turns out there is no need to have a CD9660MAXPATH define. It is used to construct the path for opening the file, so PATH_MAX makes more sense here. While there I changed the code to do two less allocations per file. Still seems to work fine. Ok? natano Index: cd9660.c =

Re: mkdir(2): document EACCESS when no write permission

2017-03-23 Thread Martin Natano
On Thu, Mar 23, 2017 at 10:07:43AM -0600, Todd C. Miller wrote: > From FreeBSD, POSIX has identical wording. > > Alternately, we could add an extra EACCESS entry similar to what > exists in open(2). I'm happy with either approach. OK natano@. I think using one entry is fine in this case as both

Re: makefs: fix msdos create size

2017-03-23 Thread Martin Natano
On Wed, Mar 22, 2017 at 01:32:09PM +0100, Patrick Wildt wrote: > > apparently the "create_size" option does currently not work. This is > because the strsuftoll() function uses "long long" compares which limits > the positive maximum to LLONG_MAX. Unfortunately the maximum is always > set to ULL

Re: .depend permissions for libraries

2016-11-08 Thread Martin Natano
On Sun, Nov 06, 2016 at 12:56:31PM +0100, Theo Buehler wrote: > The lib/*/obj/.depend files end up having permissions 600 since they are > created as tempfiles and then moved to the obj directory. I think that > there is no deeper reason for such restrictive permissions and it gets > in the way of

Re: config(8): remove OLDSCSIBUF

2016-10-27 Thread Martin Natano
On Thu, Oct 27, 2016 at 12:24:29PM +0200, Theo Buehler wrote: > This conditional has been there since the beginning of history and > apparently it's never been used or mentioned in our tree. > > ok? OK > > Index: ukcutil.c > === >

Re: config(8): remove some disabled code

2016-10-27 Thread Martin Natano
On Thu, Oct 27, 2016 at 12:09:39PM +0200, Theo Buehler wrote: > This code has been disabled since it was committed 20 years ago. While > there, eliminate two instances of the same dead assignment. > > ok? Absolutely. > > Index: mkioconf.c >

Re: remove useless extern declaration

2016-10-20 Thread Martin Natano
On Wed, Oct 19, 2016 at 11:48:05PM +0200, Jan Stary wrote: > extern char *optarg is already declared in unistd.h > This is the only occurence in src/sbin and src/bin; > others will follow in separate mails. > > Jan > OK. > > Index: bioctl.c >

Re: config(8): use {err,warn}{,x} instead of fprintf(stderr, ...)

2016-10-16 Thread Martin Natano
On Sun, Oct 16, 2016 at 01:35:34PM +0200, Theo Buehler wrote: > On Sun, Oct 16, 2016 at 11:47:32AM +0200, Theo Buehler wrote: > > Many files already include and there's a mix of hand-rolled > > warning messages and there's incorrect usage warn("config: ..."). This > > is a first sweep at unifying

make obj in config

2016-10-16 Thread Martin Natano
We don't need to re-run 'make obj' when obj exists. Ok? natano Index: main.c === RCS file: /cvs/src/usr.sbin/config/main.c,v retrieving revision 1.55 diff -u -p -r1.55 main.c --- main.c 16 Oct 2016 09:36:46 - 1.55 +++

remove config -g option

2016-10-16 Thread Martin Natano
The -g option is obsolete (and undocumented) at least since the initial import in '95. Your finger memory should be updated by now. Ok to remove? natano Index: main.c === RCS file: /cvs/src/usr.sbin/config/main.c,v retrieving revis

config(8) getopt cleanup

2016-10-16 Thread Martin Natano
The declarations for optarg and optind are pulled in from . No need to declare them again. Ok? natano Index: main.c === RCS file: /cvs/src/usr.sbin/config/main.c,v retrieving revision 1.53 diff -u -p -r1.53 main.c --- main.c 16

cleanup before cvs up

2016-10-14 Thread Martin Natano
> CVSROOT: /cvs > Module name: src > Changes by: dera...@cvs.openbsd.org 2016/10/14 12:43:02 > > ... > > Log message: > Kernel builds now happen in compile/CONFIG/obj@ -> /usr/obj/... [or ./obj/, > if srctree is not rooted at /usr/src]. As a result, stock GENERIC & RAMDISK > kernels are

Re: /usr/src beforeinstall: make prereq as BUILDUSER

2016-10-14 Thread Martin Natano
On Thu, Oct 13, 2016 at 02:48:07AM +0200, Theo Buehler wrote: > On Wed, Oct 12, 2016 at 10:30:26PM +0200, Theo Buehler wrote: > > Several people noticed that a few files from libstdc++-v3 in /usr/obj > > end up being owned by root, namely: > > > > c++config.h gthr.h gthr-single.h gthr-posix.h gthr

make(1): implement ${

2016-10-09 Thread Martin Natano
Diff below implements the ${ */ - true, /* $< */ true, /* ${@F} */ true, /* ${@D} */ false, /* ${*F} */ @@ -177,6 +179,8 @@ static bool xtlist[] = { false, /* ${!D} */ true, /* ${%F} */ true, /* ${%D} */ + true, /* ${context.

Re: rework xenocara make includes step

2016-10-09 Thread Martin Natano
On Sun, Oct 09, 2016 at 02:32:12PM +0200, Matthieu Herrb wrote: > Hi, > > while looking at what is needed to switch the xenocara build system to > the same kind of scheme as base (no more SUDO, start as root and drop > privs to $BUILDUSER), I figured out that the global 'includes' step > done at t

Re: libGLw/libexpoy: generate pkg-config files during build

2016-10-08 Thread Martin Natano
On Sat, Oct 08, 2016 at 04:16:47PM +0200, Matthieu Herrb wrote: > > I would prefer to swith them to use the bsd.xorg.mk support for > pkg-config files like that: Yeah, that's much nicer. OK. See two comments below. > > Index: lib/libGLw/Makefile > ==

libX11 ks_tables.h rebuild

2016-10-07 Thread Martin Natano
ks_tables.h is always considered out of date due to the forced rebuild of the makekeys util. This means it's also rebuilt during install. First as root during build, later by the BUILDUSER during release, which won't be able to rewrite it, because it's now owned by root. With this result:

libGLw/libexpoy: generate pkg-config files during build

2016-10-07 Thread Martin Natano
Generate the pkg-config files at build time, otherwise we might run into permission issues with noperm release builds. While there properly clean up glw.pc. Ok? natano Index: lib/libGLw/Makefile === RCS file: /cvs/xenocara/lib/libGL

Re: ps.1 tweak

2016-10-06 Thread Martin Natano
On Thu, Oct 06, 2016 at 09:27:21PM +0200, Michal Mazurek wrote: > > Don't place a space after the minus sign. Change from this: > width in columns. Otherwise, ps defaults to the terminal width > - 1, or 79 columns if none of stdout, stderr and stdin are a > To this: > width in c

Re: 'make build': simplify 'make includes' step

2016-10-06 Thread Martin Natano
On Thu, Oct 06, 2016 at 03:55:14PM +0200, Theo Buehler wrote: > On Thu, Oct 06, 2016 at 03:09:49PM +0200, Martin Natano wrote: > > > > Seems right to me. I wonder whether we should enforce root for includes > > like we do for build. Either in the command list of the target,

Re: 'make build': simplify 'make includes' step

2016-10-06 Thread Martin Natano
On Thu, Oct 06, 2016 at 02:02:41PM +0200, Theo Buehler wrote: > Before calling 'make includes' during 'make build', the first two steps > are repetitions of what a direct 'make includes' does anyway, so move > the privdrop up there and simply call 'make includes' from 'make build'. > > While there

Re: stricter sys_mount() flag handling

2016-10-03 Thread Martin Natano
> > And I want this check also for sys_unmount(). > > > > Good idea, sys_mount() is easy, because the only flag allowed there is > MNT_FORCE. s/sys_mount/sys_unmount/

Re: stricter sys_mount() flag handling

2016-10-03 Thread Martin Natano
Thank you for the feedback. On Sun, Oct 02, 2016 at 07:53:04PM +0200, Alexander Bluhm wrote: > > I think we once had a simmilar problem, when someone tried to unmount > with MNT_DOOMED. So I like to check all flags at the beginning of > the system call. > > But I think you should remove these f

stricter sys_mount() flag handling

2016-10-01 Thread Martin Natano
After committing the new MNT_NOPERM flag I got some complaints that my code doesn't work by people that recompiled mount_ffs, but didn't reboot to the new kernel. I don't blame them; in that situation sys_mount() silently ignores the unknown flag. IMHO we should check the flags more strictly. Ok?

Re: cvs: owner of installed files

2016-09-29 Thread Martin Natano
> The diff doesn't apply because mkinstalldirs has an odd revision: > > > Index: mkinstalldirs > > === > > RCS file: /cvs/src/gnu/usr.bin/cvs/mkinstalldirs,v > > retrieving revision 1.1.1.3 > > diff -u -p -r1.1.1.3 mkinstalldirs > > -

Re: rasops.c: avoid calculating offset several times

2016-09-26 Thread Martin Natano
On Mon, Sep 26, 2016 at 11:35:34AM +0200, Frederic Cambus wrote: > Hi tech@, > > Here is a diff to avoid calculating offset several times in rasops.c. > This was done for a few functions already, but not all of them. > > Comments? OK? OK, that's more readable. > > Index: sys/dev/rasops/rasops

Re: /usr/share/man owner fixes for noperm builds

2016-09-25 Thread Martin Natano
On Sun, Sep 25, 2016 at 01:14:17AM +0200, Theo Buehler wrote: > usr/share/mandoc.db is currently installed as the build user: > > -rw-r--r-- 1 builder wheel 396748 Sep 24 23:07 mandoc.db > > bsd.own.mk defines MANOWN=root, MANGRP=bin, MANMODE=444 and uses these > for installing the manpages t

libcrypto/Makefile CLEANFILES

2016-09-23 Thread Martin Natano
There are two lines in the Makefile setting CLEANFILES with the latter one overriding the former. The result: libcrypto.pc is not removed on make clean. Ok? natano Index: Makefile === RCS file: /cvs/src/lib/libcrypto/Makefile,v retr

LKMDIR in bsd.own.mk

2016-09-21 Thread Martin Natano
Loadable kernel modules are gone. Ok? natano Index: share/mk/bsd.own.mk === RCS file: /cvs/src/share/mk/bsd.own.mk,v retrieving revision 1.178 diff -u -p -r1.178 bsd.own.mk --- share/mk/bsd.own.mk 8 Sep 2016 18:59:49 - 1.1

ownership fix for /usr/lib/locate/src.db

2016-09-20 Thread Martin Natano
Without this diff src.db is installed as the build user when makeing a noperm release. is required for BINOWN/BINGRP. Ok? natano Index: Makefile === RCS file: /cvs/src/distrib/sets/Makefile,v retrieving revision 1.1 diff -u -p -r1.

Re: share/: install ownership fixes

2016-09-20 Thread Martin Natano
Ping. Ok? On Sat, Sep 10, 2016 at 10:16:20PM +0200, Martin Natano wrote: > Another diff I typoed, also found by rpe@. Ok? > > Index: share/misc/pcvtfonts/Makefile > === > RCS file: /cvs/src/share/misc/pcvtf

Re: libc: remove pointless off_t, size_t, void* and char* casts

2016-09-20 Thread Martin Natano
Reads fine to me. OK.

Re: little simpler ssh code

2016-09-18 Thread Martin Natano
Two more loops that can be converted to arc4random_buf(). Ok? natano Index: channels.c === RCS file: /cvs/src/usr.bin/ssh/channels.c,v retrieving revision 1.352 diff -u -p -r1.352 channels.c --- channels.c 12 Sep 2016 01:22:38 -000

gnu/usr.bin/binutils*: install vs. ${INSTALL}

2016-09-17 Thread Martin Natano
I think we should be using ${INSTALL} here like in all the other Makefile's. Ok? natano Index: binutils/Makefile.bsd-wrapper === RCS file: /cvs/src/gnu/usr.bin/binutils/Makefile.bsd-wrapper,v retrieving revision 1.84 diff -u -p -r1.

cvs: owner of installed files

2016-09-17 Thread Martin Natano
Next round of wrestling with install permissions. This diff adjusts the file owner/group for installed files of cvs(1). Ok? natano Index: Makefile.bsd-wrapper === RCS file: /cvs/src/gnu/usr.bin/cvs/Makefile.bsd-wrapper,v retrieving

Re: little simpler ssh code

2016-09-16 Thread Martin Natano
On Fri, Sep 16, 2016 at 09:19:40PM -0400, Ted Unangst wrote: > no change, but makes the code a little shorter. Reads fine to me. arc4random() is already used in other places in ssh, so this shouldn't be an issue for portable. > > > Index: clientloop.c >

Re: binutils-2.17 ownership fixes

2016-09-16 Thread Martin Natano
On Thu, Sep 15, 2016 at 09:07:49PM -0700, Philip Guenther wrote: > On Thu, Sep 15, 2016 at 1:58 PM, Martin Natano wrote: > > This should do it. The 'fix' is ugly, but I couldn't find a cleaner way > > to pass the right STRIP value to libtool. Any better ideas?

Re: binutils-2.17 ownership fixes

2016-09-15 Thread Martin Natano
> install: strip: No such file or directory > > Is there a better option than removing it again? > > > $ cd /usr/src/gnu/usr.bin/binutils-2.17 > $ doas make -f Makefile.bsd-wapper install > [...] > Making install in po > test -z "/usr/bin" || /bin/sh > /usr/src/gnu/usr.bin/binutils-2.17/binutil

generate pkg-config files at build time

2016-09-13 Thread Martin Natano
Currently pkg-config files are generated at install time, while they should be generated at build time like everything else. One reason why generating files during install is bad is that the two steps might be run by two differnt users, resulting in permission problems. While there I removed the d

texinfo ownership fix

2016-09-11 Thread Martin Natano
Similar to guenther's fix for gnu/binutils*. Ok? natano Index: gnu/usr.bin/texinfo/Makefile.bsd-wrapper === RCS file: /cvs/src/gnu/usr.bin/texinfo/Makefile.bsd-wrapper,v retrieving revision 1.42 diff -u -p -r1.42 Makefile.bsd-wrappe

/etc/ssl/* owner

2016-09-11 Thread Martin Natano
Following diff installs the files in /etc/ssl with the correct owner. Ok? natano Index: lib/libcrypto/Makefile === RCS file: /cvs/src/lib/libcrypto/Makefile,v retrieving revision 1.4 diff -u -p -r1.4 Makefile --- lib/libcrypto/Makef

sqlite3 headers owner

2016-09-11 Thread Martin Natano
The sqlite3 headers are installed with the build user as owner, but should be owned by root. Ok? natano Index: Makefile === RCS file: /cvs/src/lib/libsqlite3/Makefile,v retrieving revision 1.15 diff -u -p -r1.15 Makefile --- Makefil

/usr/bin/skeyprune owner

2016-09-11 Thread Martin Natano
Another ${INSTALL} invokation that doesn't mention the owner. Ok? natano Index: Makefile === RCS file: /cvs/src/usr.bin/skey/Makefile,v retrieving revision 1.15 diff -u -p -r1.15 Makefile --- Makefile30 Mar 2016 06:38:46 -

Re: binutils-2.17 ownership fixes

2016-09-11 Thread Martin Natano
> Index: gnu/usr.bin/binutils-2.17/Makefile.bsd-wrapper > === > RCS file: > /data/src/openbsd/src/gnu/usr.bin/binutils-2.17/Makefile.bsd-wrapper,v > retrieving revision 1.8 > diff -u -p -r1.8 Makefile.bsd-wrapper > --- gnu/usr.bin/bin

Re: share/: install ownership fixes

2016-09-10 Thread Martin Natano
Another diff I typoed, also found by rpe@. Ok? Index: share/misc/pcvtfonts/Makefile === RCS file: /cvs/src/share/misc/pcvtfonts/Makefile,v retrieving revision 1.6 diff -u -p -r1.6 Makefile --- share/misc/pcvtfonts/Makefile 13 Ma

Re: etc ownership fixes

2016-09-10 Thread Martin Natano
I used chmod instead of chown. That's what I get for changing the diff _after_ testing it... Mistake found by rpe@, thanks! Fixed diff below. Ok? Index: etc/Makefile === RCS file: /cvs/src/etc/Makefile,v retrieving revision 1.430 di

etc ownership fixes

2016-09-10 Thread Martin Natano
Diff below sets the owner for the /etc/localtime, /etc/rmt, /var/tmp and /sys symlinks and for the /var/sysmerge/etc.tgz tarball. This is the last of the noperm related pending M's in my tree. Ok? natano Index: etc/Makefile === RC

share/: install ownership fixes

2016-09-10 Thread Martin Natano
A couple of ownership fixes for share/. While there I cleaned up the pcvtfonts install loop. Ok? natano Index: share/misc/pcvtfonts/Makefile === RCS file: /cvs/src/share/misc/pcvtfonts/Makefile,v retrieving revision 1.6 diff -u -p -

/usr/sbin/sysctl owner

2016-09-10 Thread Martin Natano
Yet another symlink that belongs to root. Ok? natano Index: sbin/sysctl/Makefile === RCS file: /cvs/src/sbin/sysctl/Makefile,v retrieving revision 1.11 diff -u -p -r1.11 Makefile --- sbin/sysctl/Makefile4 May 2016 19:48:08 -

mailwrapper symlinks owner

2016-09-10 Thread Martin Natano
Another set of symlinks, same drill: the owner should be root. Ok? natano Index: usr.sbin/mailwrapper/Makefile === RCS file: /cvs/src/usr.sbin/mailwrapper/Makefile,v retrieving revision 1.5 diff -u -p -r1.5 Makefile --- usr.sbin/mai

mg docs ownership

2016-09-10 Thread Martin Natano
We should be explicit about owner/group when using install, so this also works correctly with noperm. Ok? natano Index: usr.bin/mg/Makefile === RCS file: /cvs/src/usr.bin/mg/Makefile,v retrieving revision 1.31 diff -u -p -r1.31 Make

create /usr/share/calendar/$lang with root owner

2016-09-10 Thread Martin Natano
Currently the /usr/share/calendar/$lang directories are created with the build user as owner, but should be owned by root. Ok? natano Index: usr.bin/calendar/Makefile === RCS file: /cvs/src/usr.bin/calendar/Makefile,v retrieving rev

bin/chmod: set owner of symlinks

2016-09-10 Thread Martin Natano
When building with noperm the symlinks end up with the build user as owner instead of root. Ok? natano Index: bin/chmod/Makefile === RCS file: /cvs/src/bin/chmod/Makefile,v retrieving revision 1.7 diff -u -p -r1.7 Makefile --- bin/c

Re: new getformat() for jot(1)

2016-09-06 Thread Martin Natano
On Sat, Sep 03, 2016 at 04:55:59PM +0100, Theo Buehler wrote: > The -w flag to jot() allows the user to specify a format string that > will be passed to printf after it was verified that it contains only one > conversion specifier. There are some subtle differences what jot's > getformat() accepts

remove usermount remnants

2016-09-04 Thread Martin Natano
usermount is dead. Ok? natano Index: lib/libc/gen/sysctl.3 === RCS file: /cvs/src/lib/libc/gen/sysctl.3,v retrieving revision 1.267 diff -u -p -r1.267 sysctl.3 --- lib/libc/gen/sysctl.3 20 Jul 2016 09:15:28 - 1.267 ++

regen pkg-config files

2016-09-04 Thread Martin Natano
Currently we regenerate the pkg-config files on every install. Following patch allows to only regen the files when the library version changed. Ok? natano Index: lib/libcrypto/Makefile === RCS file: /cvs/src/lib/libcrypto/Makefile,

Re: iwm(4): Use htole16 for policy field in iwm_time_event_cmd_v2 struct.

2016-09-01 Thread Martin Natano
On Wed, Aug 31, 2016 at 09:39:47PM +0200, Imre Vadasz wrote: > Hi, > The policy field in struct iwm_time_event_cmd_v2 is just a 16bit integer, > so we should use htole16() when setting it, instead of htole32(). Makes sense to me, although I don't have hardware to test this. > > Index: sys/dev/p

Re: remove ntfs write code

2016-09-01 Thread Martin Natano
ystem (not that I care). > > > On Wed, Aug 31, 2016 at 3:34 PM, Martin Natano wrote: > > > mount_ntfs forces the mount point to be MNT_RDONLY, so the write parts > > in ntfs are never used. OK to remove? >

remove ntfs write code

2016-08-31 Thread Martin Natano
mount_ntfs forces the mount point to be MNT_RDONLY, so the write parts in ntfs are never used. OK to remove? natano Index: ntfs/ntfs_subr.c === RCS file: /cvs/src/sys/ntfs/ntfs_subr.c,v retrieving revision 1.47 diff -u -p -r1.47 ntf

fusefs lookup/reclaim bug

2016-08-31 Thread Martin Natano
Watch this: $ doas fuse-zip ~/Downloads/foo.zip /mnt $ ls /mnt openbsd-www $ grep -IR foo /usr/src > /dev/null # force vfs to reclaim vnodes $ ls /mnt ls: /mnt: No such file or directory $ Currently fusefs nodes in the kernel remember the parent inode number for ".." lookups. This only works

replace struct vattr with struct stat in fusebuf

2016-08-27 Thread Martin Natano
In struct fusebuf the attributes (used for getattr/setattr and to return the ino/mode of a newly created file) are stored in a struct vattr. The problem with this is, that using struct vattr in userspace is suboptimal as some related helpers are not available, e.g. VATTR_NULL() and IFTOVT(). What

Re: ksh.1: $() quirk note

2016-08-19 Thread Martin Natano
On Thu, Aug 18, 2016 at 02:38:28PM +0200, Dmitrij D. Czarkoff wrote: > Christian Weisgerber wrote: > > >I guess. There _are_ problems in this area, though. > > > >$ case x in x);; *);; esac > >$ echo $(case x in x);; *);; esac) > >ksh: syntax error: `;;' unexpected > > This should probably be i

fusefs: remove update_vattr() helper function

2016-08-18 Thread Martin Natano
There are three callers of update_vattr(). Two of them don't use the updated struct vattr afterwards, so the call can be removed. Following diff removes both calls and the function itself, inlining the last remaining call. While there I removed this gem: #if (S_BLKSIZE == 512)

ksh.1: $() quirk note

2016-08-18 Thread Martin Natano
ksh.1 states: Note: $(command) expressions are currently parsed by finding the matching parenthesis, regardless of quoting. This should be fixed soon. Seems like the "soon" mentioned here is already past. $ echo $(echo "closing: )") closing: ) $ Ok? Am

Re: fuse cache shenanigans

2016-08-16 Thread Martin Natano
cts of this removal? I can't find any side effect beside of it being slower. As far as I can tell the cache as used by fuse is strictly optional. > > > On Mon, Aug 15, 2016 at 1:52 PM, Ted Unangst wrote: > > > Martin Natano wrote: > > > Watch this: > > &g

Re: cvs(1): default to a)bort for empty commit log

2016-08-16 Thread Martin Natano
On Mon, Aug 15, 2016 at 12:46:23PM +0200, Theo Buehler wrote: > This is one of the quirks of cvs that I have a hard time getting used to: > > $ cvs commit > > Log message unchanged or not specified > a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs > Action: (continue)

Re: nitems not from param.h

2016-08-16 Thread Martin Natano
Ok.

fuse cache shenanigans

2016-08-15 Thread Martin Natano
Watch this: $ doas sshfs natano@localhost:/tmp /mnt $ cat /mnt/foo cat: /mnt/foo: No such file or directory $ echo bar > /tmp/foo $ cat /mnt/foo cat: /mnt/foo: No such file or directory $ touch /mnt/foo $ cat /mnt/foo bar

Re: a few userspace quad_t conversions

2016-08-14 Thread Martin Natano
On Sun, Aug 14, 2016 at 09:59:21PM -0700, Philip Guenther wrote: > > du is an easy on, though the use of fts_number here reminded me that we > need to increase to a long long at some point like the other BSDs did. > > hexdump is...subtle, as it both creates format strings on the fly and > *rewr

Re: csh: don't reinvent rlim_t

2016-08-14 Thread Martin Natano
On Sun, Aug 14, 2016 at 11:49:00AM -0700, Philip Guenther wrote: > On Sun, Aug 14, 2016 at 1:26 AM, Martin Natano wrote: > > On Sat, Aug 13, 2016 at 11:41:26PM -0700, Philip Guenther wrote: > ... > >> @@ -1124,14 +1122,14 @@ getval(struct limits *lp, Char **v) > >>

fuse: fh functions must die

2016-08-14 Thread Martin Natano
After staring a couple of days at fusefs and libfuse code I came to the conclusion, that the fuse_vptofh() and fuse_fhtovp() functions must die. I implemented those functions under the assumption, that fuse_vget() has reasonable semantics, while this is not the case. fusefs_vget() only functions co

Re: eliminate uses of strtoq/strtouq

2016-08-14 Thread Martin Natano
> Index: usr.sbin/mtree/spec.c > === > RCS file: /data/src/openbsd/src/usr.sbin/mtree/spec.c,v > retrieving revision 1.26 > diff -u -p -r1.26 spec.c > --- usr.sbin/mtree/spec.c 8 Jul 2012 21:19:42 - 1.26 > +++ usr.sbin/mt

Re: reduce qabs() and qdiv() to aliases and deprecate them in manual

2016-08-14 Thread Martin Natano
On Sun, Aug 14, 2016 at 12:25:18AM -0700, Philip Guenther wrote: > > strtoq() and strtouq() are already provided as just aliases of strtoll() > and strotull(); let's do the same with qabs() and qdiv() instead of having > them as fully separate functions. > > Similarly, they don't need separate

Re: csh: don't reinvent rlim_t

2016-08-14 Thread Martin Natano
On Sat, Aug 13, 2016 at 11:41:26PM -0700, Philip Guenther wrote: > > This seems unnecessary: > typedef quad_t RLIM_TYPE; > > when we have rlim_t. Yes, rlim_t is unsigned while RLIM_TYPE is signed, > but it's not doing anything with this that needs a signed type. > > While ktracing csh to

kill FUSE_ROOT_ID

2016-08-13 Thread Martin Natano
Kill FUSE_ROOT_ID and use FUSE_ROOTINO instead for the only place where it was used. Also, remove one (ino_t) cast from FUSE_ROOTINO, as it is already included in the #define. Ok? natano Index: miscfs/fuse/fuse_vfsops.c === RCS file

fuse: dedup vnode type

2016-08-12 Thread Martin Natano
Fuse stores the vnode type in two places: vtype in struct fusefs_node and v_type in struct vnode. Given the fact, that fusefs_node structs are never allocated without an associated vnode and those two fields are always in sync, one of those locations is superfluous. Ok? natano Index: miscfs/fus

Re: fuse: dedup vnode type

2016-08-12 Thread Martin Natano
> Index: miscfs/fuse/fusefs_node.h > === > RCS file: /cvs/src/sys/miscfs/fuse/fusefs_node.h,v > retrieving revision 1.2 > diff -u -p -r1.2 fusefs_node.h > --- miscfs/fuse/fusefs_node.h 1 Feb 2014 09:30:38 - 1.2 > +++ miscfs/f

Re: fuse needs ufs ihash

2016-08-12 Thread Martin Natano
On Thu, Aug 11, 2016 at 10:48:59AM -0400, Ted Unangst wrote: > Martin Natano wrote: > > I'm already working on a diff to decouple fuse from ufs ihash. In the > > meantime: Make sure the necessary code is compiled in when fuse is > > enabled in the config. > > Are

fuse needs ufs ihash

2016-08-11 Thread Martin Natano
I'm already working on a diff to decouple fuse from ufs ihash. In the meantime: Make sure the necessary code is compiled in when fuse is enabled in the config. natano Index: conf/files === RCS file: /cvs/src/sys/conf/files,v retriev

stale prototypes in ntfs_ihash.h

2016-08-10 Thread Martin Natano
Seems like ntfs_ihash.h has grown some mold; those functions don't exist. Ok? natano Index: ntfs/ntfs_ihash.h === RCS file: /cvs/src/sys/ntfs/ntfs_ihash.h,v retrieving revision 1.5 diff -u -p -r1.5 ntfs_ihash.h --- ntfs/ntfs_ihash.h

Re: ksh, ctrl-r followed by arrow key leaves "[D" or "[C" artifacts

2016-08-09 Thread Martin Natano
On Mon, Aug 08, 2016 at 07:12:34PM +0200, Ingo Schwarze wrote: > > According to the documentation, typing the escape key alone is not > a supported method of exiting the search prompt. The ksh(1) manual > says: > > search-history: ^R > Enter incremental search mode. [...] >

Re: ksh, ctrl-r followed by arrow key leaves "[D" or "[C" artifacts

2016-08-07 Thread Martin Natano
On Mon, Aug 08, 2016 at 03:33:23AM +0200, Ingo Schwarze wrote: > Hi Dave, > > redirecting from misc@ to tech@ because i'm appending a patch > at the very end, lightly tested. > > This has indeed been annoying me for years, but it never occurred > to me that i might be able to figure out what's go

move ufs_vinit() to ffs

2016-08-07 Thread Martin Natano
The ufs_vinit() function should really be called ffs_vinit(). The only place it is called from is ffs_vget(). And again, the FIFOOPS macro can be killed. Ok? natano Index: ufs/ffs/ffs_extern.h === RCS file: /cvs/src/sys/ufs/ffs/ffs

ext2fs_vinit() cleanup

2016-08-07 Thread Martin Natano
ext2fs has only one set of specops/fifoops, so no need to pass those to the function. This also allows to get rid of the EXT2FS_FIFOOPS define. Ok? natano Index: ufs/ext2fs/ext2fs_extern.h === RCS file: /cvs/src/sys/ufs/ext2fs/ext2

Re: hotplugd restart problem

2016-07-25 Thread Martin Natano
On Mon, Jul 25, 2016 at 02:17:11PM +0300, Alexey Vatchenko wrote: > Hi! > If something is running which is started from attach script, restarting of > hotplugd fails because /dev/hotplug is occupied by child process. > > Attached is the patch to fix this problem. Makes sense, but why not pass O_C

Re: [Bug49] Tmpfs mount with bad args can lead to a panic

2016-07-11 Thread Martin Natano
On Mon, Jul 11, 2016 at 04:39:05PM -0400, Ted Unangst wrote: > Tim Newsham wrote: > > The tmpfs filesystem allows the mounting user to specify a > > username, a groupname or a device name for the root node of > > the filesystem. A user that specifies a value of VNOVAL for > > any of these fields w

Re: [Bug49] Tmpfs mount with bad args can lead to a panic

2016-07-11 Thread Martin Natano
On Mon, Jul 11, 2016 at 05:06:33PM -0400, Ted Unangst wrote: > Todd C. Miller wrote: > > On Mon, 11 Jul 2016 16:39:05 -0400, "Ted Unangst" wrote: > > > > > sigh. i don't know what else can trigger that kassert, so just fix the > > > caller > > > to do the same check and return an error. > > > >

Re: nfsrv_mknod(): missing vput() in error path

2016-07-03 Thread Martin Natano
nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr); } else { On Sun, Jul 03, 2016 at 09:16:26PM +0200, Martin Natano wrote: > When perfoming a mknod operation over NFS it can happen that another > client creates a file with the same name between the namei() and > VOP_MKNOD

nfsrv_mknod(): missing vput() in error path

2016-07-03 Thread Martin Natano
When perfoming a mknod operation over NFS it can happen that another client creates a file with the same name between the namei() and VOP_MKNOD() calls in domknod(). This leads to an error path in nfsrv_mknod() being triggered. In that error path there is a vput(nd.ni_np) missing, resulting in the

  1   2   3   >