UPDATE: net/wifind 0.5 -> 0.7

2017-09-15 Thread Ray Lai
Hi ports,

Attached is a diff to update wifind to 0.7. This release merges
changes from and fixes bugs reported by qbit, iandarwin, and kpcyrd:

- support percentage-based signal strength reporting (iwm)
- support for interface descriptions
- don't die if we don't have an existing hostname.if
- don't validate empty wpakey

Thanks!

Index: Makefile
===
RCS file: /home/cvs/ports/net/wifind/Makefile,v
retrieving revision 1.3
diff -u -p -r1.3 Makefile
--- Makefile4 Jun 2016 20:08:47 -   1.3
+++ Makefile15 Sep 2017 07:14:10 -
@@ -4,7 +4,7 @@ COMMENT=wifi automagic connector
 
 GH_ACCOUNT=raylai
 GH_PROJECT=wifind
-GH_TAGNAME=0.5
+GH_TAGNAME=0.7
 
 CATEGORIES=net
 
Index: distinfo
===
RCS file: /home/cvs/ports/net/wifind/distinfo,v
retrieving revision 1.2
diff -u -p -r1.2 distinfo
--- distinfo4 Jun 2016 15:58:10 -   1.2
+++ distinfo15 Sep 2017 07:14:25 -
@@ -1,2 +1,2 @@
-SHA256 (wifind-0.5.tar.gz) = OMAKolOf3Z+kdV+z6Ra/wcl9+7UyrCdYfLaEzuLDCnI=
-SIZE (wifind-0.5.tar.gz) = 3482
+SHA256 (wifind-0.7.tar.gz) = 1N7WPmlJj18QPOJ2Gl93Eb076R69A/BY/t2uhav9wHM=
+SIZE (wifind-0.7.tar.gz) = 3646



Fix exponential glob

2017-04-28 Thread Ray Lai
As reported in https://research.swtch.com/glob, matching 
aaa with a*a*a*a*a*a*...etc takes exponential time.



Tested with rsc's program: https://news.ycombinator.com/item?id=14187948


I copied the glob implementation from one of the BSDs - I believe 
FreeBSD - into a standalone C program and ran that program on the same 
Linux system as the rest of the tests. Here's the version that tests the 
system glob. If you run it on your FooBSD systems you can see whether it 
runs quickly or not. The program assumes that you've already done:

  rm -rf /tmp/glob
  mkdir /tmp/glob
  cd /tmp/glob
  touch $(perl -e 'print "a"x100')
And here's the program:
  #include 
  #include 
  #include 
  #include 
  #include 
  #include 
  #include 

  int
  main(void)
  {
  glob_t g;
  char pattern[1000], *p;
  struct timespec t, t2;
  double dt;
  int i, j, k;

  chdir("/tmp/glob");
  setlinebuf(stdout);

  int mul = 1000;
  for(i = 0; i < 100; i++) {
  p = pattern;
  for (k = 0; k < i; k++) {
  *p++ = 'a';
  *p++ = '*';
  }
  *p++ = 'b';
  *p = '\0';
  printf("# %d %s\n", i, pattern);
  clock_gettime(CLOCK_REALTIME, );
  for (j = 0; j < mul; j++) {
  memset(, 0, sizeof g);
  if(glob(pattern, 0, 0, ) != GLOB_NOMATCH) {
  fprintf(stderr, "error: found matches\n");
  exit(2);
  }
  globfree();
  }
  clock_gettime(CLOCK_REALTIME, );
  t2.tv_sec -= t.tv_sec;
  t2.tv_nsec -= t.tv_nsec;
  dt = t2.tv_sec + (double)t2.tv_nsec/1e9;
  printf("%d %.9f\n", i, dt/mul);
  fflush(stdout);
  if(dt/mul >= 0.0001)
  mul = 1;
  if(i >= 8 && dt/mul >= 10)
  break;
  }
  }
I won't be filing any specific bugs myself. I mailed oss-security@ this 
morning, which should reach relevant BSD maintainers, but more bug 
filing can't hurt.



Fix ported from 
https://perl5.git.perl.org/perl.git/commit/33252c318625f3c6c89b816ee88481940e3e6f95



diff --git a/lib/libc/gen/glob.c b/lib/libc/gen/glob.c
index e521dcd098d..ee9ab78ef88 100644
--- a/lib/libc/gen/glob.c
+++ b/lib/libc/gen/glob.c
@@ -126,9 +126,6 @@ typedef char Char;
 #defineGLOB_LIMIT_STAT2048
 #defineGLOB_LIMIT_READDIR16384

-/* Limit of recursion during matching attempts. */
-#define GLOB_LIMIT_RECUR64
-
 struct glob_lim {
 size_tglim_malloc;
 size_tglim_stat;
@@ -161,7 +158,7 @@ static const Char *
 static int globexp1(const Char *, glob_t *, struct glob_lim *);
 static int globexp2(const Char *, const Char *, glob_t *,
 struct glob_lim *);
-static int match(Char *, Char *, Char *, int);
+static int match(Char *, Char *, Char *);
 #ifdef DEBUG
 static void qprintf(const char *, Char *);
 #endif
@@ -753,7 +750,7 @@ glob3(Char *pathbuf, Char *pathbuf_last, Char 
*pathend, Char *pathend_last,

 break;
 }

-if (!match(pathend, pattern, restpattern, GLOB_LIMIT_RECUR)) {
+if (!match(pathend, pattern, restpattern)) {
 *pathend = EOS;
 continue;
 }
@@ -883,17 +880,25 @@ globextend(const Char *path, glob_t *pglob, struct 
glob_lim *limitp,


 /*
  * pattern matching function for filenames.  Each occurrence of the *
- * pattern causes a recursion level.
+ * pattern causes an iteration.
+ *
+ * Note, this function differs from the original as per the discussion
+ * here: https://research.swtch.com/glob
+ *
+ * Basically we removed the recursion and made it use the algorithm
+ * from Russ Cox to not go quadratic on cases like a file called ("a" x 
100) . "x"

+ * matched against a pattern like "a*a*a*a*a*a*a*y".
+ *
  */
 static int
-match(Char *name, Char *pat, Char *patend, int recur)
+match(Char *name, Char *pat, Char *patend)
 {
 int ok, negate_range;
 Char c, k;
+Char *nextp = NULL;
+Char *nextn = NULL;

-if (recur-- == 0)
-return(GLOB_NOSPACE);
-
+loop:
 while (pat < patend) {
 c = *pat++;
 switch (c & M_MASK) {
@@ -902,19 +907,19 @@ match(Char *name, Char *pat, Char *patend, int recur)
 pat++;/* eat consecutive '*' */
 if (pat == patend)
 return(1);
-do {
-if (match(name, pat, patend, recur))
-return(1);
-} while (*name++ != EOS);
-return(0);
+if (*name == EOS)
+return 0;
+nextn = name + 1;
+nextp = pat - 1;
+break;
 case M_ONE:
 if (*name++ == EOS)
-return(0);
+goto fail;
 break;
 case M_SET:
 ok = 0;
 if ((k = *name++) == EOS)
-return(0);
+goto fail;
 if ((negate_range = 

Re: Scheduler with a single runqueue

2016-07-08 Thread Ray Lai
On Wed, 6 Jul 2016 21:14:05 +0200
Martin Pieuchot  wrote:
> By using a single runqueue I prioritise latency over throughput.  That
> means your performance might degrade, but at least I can watch my HD
> video while doing a "make -j4".

When I run borgbackup, audio (and my mouse) still stutters. Is disk IO 
something that this diff should help with? Anything I can do to help diagnose 
this?

X200 with 4G ram.



Clean up regress/usr.bin/sdiff

2016-05-30 Thread Ray Lai
Okan reminded me that my old regress tests used systrace policy files as 
example text, which weren't the easiest to decypher. I've replaced them with 
simpler files that should make life easier for any future regress test writers.

Comments? Suggestions?

Ray



Index: Iflag12.out
===
RCS file: /home/cvs/src/regress/usr.bin/sdiff/Iflag12.out,v
retrieving revision 1.2
diff -u -p -r1.2 Iflag12.out
--- Iflag12.out 13 Sep 2015 17:08:04 -  1.2
+++ Iflag12.out 30 May 2016 06:06:09 -
@@ -1,100 +1,8 @@
-Policy: /usr/bin/lynx, Emulation: nativePolicy: 
/usr/bin/lynx, Emulation: native
-  > 
native-issetugid: permit
-  > 
native-mprotect: permit
-  > 
native-mmap: permit
-native-sysctl: permit   
native-sysctl: permit
-  > 
native-fsread: filename eq "/var/run/ld.so.hints" then pe
-  > 
native-fstat: permit
-native-close: permit
native-close: permit
-native-connect: sockaddr eq "inet-[127.0.0.1]:53" then pe | 
native-fsread: filename match "/usr/lib/libssl.so.*" then
-native-connect: sockaddr match "inet-\\\[*\\\]:80" then p | 
native-read: permit
-native-exit: permit   | 
native-fsread: filename match "/usr/lib/libcrypto.so.*" t
-native-fcntl: cmd eq "F_SETFD" then permit| 
native-fsread: filename match "/usr/lib/libncurses.so.*" 
-native-fsread: filename eq "/" then permit| 
native-fsread: filename match "/usr/lib/libc.so.*" then p
-native-fsread: filename match "/:  | 
native-munmap: permit
-native-fsread: filename eq "/etc/lynx.cfg" then permit| 
native-sigprocmask: permit
-native-fsread: filename eq "/etc/malloc.conf" then permit   
native-fsread: filename eq "/etc/malloc.conf" then permit
-native-fsread: filename eq "/etc/resolv.conf" then permit | 
native-getpid: permit
-native-fsread: filename eq "/etc/utmp" then permit<
-native-fsread: filename eq "/home" then permit<
-native-fsread: filename eq "$HOME" then permit<
-native-fsread: filename eq "$HOME/.lynx-keymaps" then per <
-native-fsread: filename eq "$HOME/.lynxrc" then permit<
-native-fsread: filename eq "$HOME/.mailcap" then permit   <
-native-fsread: filename eq "$HOME/.mime.types" then permi <
-native-fsread: filename eq "$HOME/.terminfo" then permit  <
-native-fsread: filename eq "$HOME/.terminfo.db" then perm <
-native-fsread: filename eq "/obj" then permit <
-native-fsread: filename eq "/tmp" then permit   
native-fsread: filename eq "/tmp" then permit
-native-fsread: filename match "/tmp/lynx-*/." then permit   
native-fswrite: filename match "/tmp/lynx-*" then permit
-  ) 
native-fsread: filename match "/tmp/lynx-*/." then permit
-  > 
native-fsread: filename eq "$HOME" then permit
-  > 
native-fsread: filename eq "/etc/lynx.cfg" then permit
-  > 
native-fsread: filename eq "/" then permit
-  > 
native-fsread: filename eq "/usr/obj/bin/systrace/." then
-  > 
native-fsread: filename eq "/usr/obj/bin" then permit
-  > 
native-fcntl: permit
-  > 
native-getdirentries: permit
-  > 
native-lseek: permit
-  > 
native-fsread: filename eq "/usr/obj" then permit
-native-fsread: filename eq "/usr" then permit   
native-fsread: filename eq "/usr" then permit
-native-fsread: filename eq "/usr/bin" then permit   
native-fsread: filename eq "/usr/bin" then permit
-native-fsread: filename eq "/usr/games" then permit 
native-fsread: filename eq "/usr/games" then permit
-native-fsread: filename eq "/usr/include" then permit   
native-fsread: filename eq "/usr/include" then permit
-native-fsread: filename eq "/usr/lib" then permit   
native-fsread: filename eq "/usr/lib" then permit
-

improve fuse_parse_opt() parsing

2016-05-21 Thread Ray Lai
This fixes "sshfs -o idmap=user".

The "if (o->off != ULONG_MAX)" logic is basically
"if (!FUSE_OPT_IS_OPT_KEY(o))" from above, so I stuck it into an else.

Ideas from Helg: https://marc.info/?l=openbsd-tech=142451814811631=2

Ray

Index: fuse_opt.c
===
RCS file: /home/cvs/src/lib/libfuse/fuse_opt.c,v
retrieving revision 1.15
diff -u -p -r1.15 fuse_opt.c
--- fuse_opt.c  19 Oct 2015 17:24:07 -  1.15
+++ fuse_opt.c  21 May 2016 12:53:57 -
@@ -247,13 +247,14 @@ parse_opt(const struct fuse_opt *o, cons
ret = f(data, [idx], o->val, arg);
else
ret = f(data, val, o->val, arg);
-   }
-
-   if (o->off != ULONG_MAX && data && o->val >= 0) {
-   ret = f(data, val, o->val, arg);
-   int *addr = (int *)(data + o->off);
-   *addr = o->val;
-   ret = 0;
+   /* exact match, e.g. "idmap=user" (instead of 
"idmap=%s") */
+   } else if (keyval && strcmp(val, o->templ) == 0) {
+   if (data && o->val >= 0) {
+   ret = f(data, val, o->val, arg);
+   int *addr = (int *)(data + o->off);
+   *addr = o->val;
+   ret = 0;
+   }
}
 
if (ret == -1)



Missing strdup NULL checks in libfuse

2016-05-21 Thread Ray Lai
Index: fuse.c
===
RCS file: /home/cvs/src/lib/libfuse/fuse.c,v
retrieving revision 1.27
diff -u -p -u -p -r1.27 fuse.c
--- fuse.c  24 Dec 2015 17:02:37 -  1.27
+++ fuse.c  21 May 2016 09:05:20 -
@@ -424,6 +424,8 @@ fuse_parse_cmdline(struct fuse_args *arg
}
 
*mp = strdup(opt.mp);
+   if (*mp == NULL)
+   return (-1);
*mt = 0;
 
return (0);
Index: fuse_subr.c
===
RCS file: /home/cvs/src/lib/libfuse/fuse_subr.c,v
retrieving revision 1.9
diff -u -p -u -p -r1.9 fuse_subr.c
--- fuse_subr.c 3 Jun 2015 19:51:16 -   1.9
+++ fuse_subr.c 21 May 2016 09:08:14 -
@@ -143,9 +143,13 @@ char *
 build_realname(struct fuse *f, ino_t ino)
 {
struct fuse_vnode *vn;
-   char *name = strdup("/");
+   char *name;
char *tmp = NULL;
int firstshot = 0, ret;
+
+   name = strdup("/");
+   if (name == NULL)
+   return (NULL);
 
vn = tree_get(>vnode_tree, ino);
if (!vn || !name) {



Re: libfuse: null-terminate argv (fuse_opt_insert_arg)

2016-05-20 Thread Ray Lai
On Thu, 19 May 2016 18:57:50 +0200
Hiltjo Posthuma  wrote:

> Hi peoples,
> 
> This diff makes sure to NUL-terminate argv when parsing options in libfuse.
> The upstream/other libfuse does it this way. This fixes an issue with the
> sysutils/sshfs port, it uses execvp(3) on the fuse_args argv and this gave
> an error "bad address".
> 
> 
> Index: fuse_opt.c
> ===
> RCS file: /cvs/src/lib/libfuse/fuse_opt.c,v
> retrieving revision 1.15
> diff -u -p -r1.15 fuse_opt.c
> --- fuse_opt.c19 Oct 2015 17:24:07 -  1.15
> +++ fuse_opt.c19 May 2016 16:50:39 -
> @@ -353,7 +353,7 @@ fuse_opt_insert_arg(struct fuse_args *ar
>   if (p < 0 || p > args->argc)
>   return (-1);
>  
> - av = reallocarray(args->argv, args->argc + 1, sizeof(*av));
> + av = reallocarray(args->argv, args->argc + 2, sizeof(*av));
>   if (av == NULL)
>   return (-1);
>  
> @@ -365,6 +365,7 @@ fuse_opt_insert_arg(struct fuse_args *ar
>  
>   args->argc++;
>   args->argv = av;
> + args->argv[args->argc] = NULL;
>   for (i = p; i < args->argc; i++) {
>   next_arg = args->argv[i];
>   args->argv[i] = this_arg;
> 
> 
> [0] upstream libfuse fuse_opt_add_arg:
> https://github.com/libfuse/libfuse/blob/master/lib/fuse_opt.c#L62
> 

This looks correct, but don't forget about free_argv() and alloc_argv().

Ray



New man page: fuse_opt.3

2016-05-20 Thread Ray Lai
Here's a man page for fuse_opt.h. It's far from perfect, I mostly tried
to document our existing behavior and avoid copying from libfuse. There
are definitely areas of improvement but I think this goes a long way to
helping debug our fuse implementation.

I'm new to fuse, so please, anyone with more fuse knowledge, feel free
to chime in!

Ray


.\" $OpenBSD$
.\"
.\" Copyright (c) Ray Lai <r...@raylai.com>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate$
.Dt FUSE_OPT 3
.Os
.Sh NAME
.Nm FUSE_ARGS_INIT ,
.Nm FUSE_OPT_IS_OPT_KEY ,
.Nm FUSE_OPT_KEY ,
.Nm fuse_opt_add_arg ,
.Nm fuse_opt_insert_arg ,
.Nm fuse_opt_free_args ,
.Nm fuse_opt_add_opt ,
.Nm fuse_opt_add_opt_escaped ,
.Nm fuse_opt_match ,
.Nm fuse_opt_parse
.Nd FUSE options parser
.Sh SYNOPSIS
.In fuse_opt.h
.Ft struct fuse_args
.Fn FUSE_ARGS_INIT "int argc" "char argv**"
.Ft int
.Fn FUSE_OPT_IS_OPT_KEY "fuse_opt *t"
.Ft struct fuse_opt
.Fn FUSE_OPT_KEY "const char *templ" "int key"
.Ft int
.Fn fuse_opt_add_arg "struct fuse_args *args" "const char *arg"
.Ft int
.Fn fuse_opt_insert_arg "struct fuse_args *" "int" "const char *"
.Ft void
.Fn fuse_opt_free_args "struct fuse_args *args"
.Ft int
.Fn fuse_opt_add_opt "char **opts" "const char *opt"
.Ft int
.Fn fuse_opt_add_opt_escaped "char **opts" "const char *opt"
.Ft int
.Fn fuse_opt_match "const struct fuse_opt *opts" "const char *opt"
.Ft int
.Fo fuse_opt_parse
.Fa "struct fuse_args *args"
.Fa "void *data"
.Fa "const struct fuse_opt *opts"
.Fa "fuse_opt_proc_t proc"
.Fc
.Sh DESCRIPTION
.Ft struct fuse_args
holds string options in an array:
.Bd -literal -offset indent
struct fuse_args {
int argc;   /* argument count */
char **argv;/* NULL-terminated array of arguments */
int allocated;  /* allocated by malloc? */
};
.Ed
.Pp
.Fn FUSE_ARGS_INIT
initializes a
.Ft struct fuse_args
with
.Ar argc
and
.Ar argv ,
which can be from
.Fn main .
.Ar argv
is NULL-terminated, and is suitable for use with
.Xr execvp 3 .
.Ar allocated
is set to 0.
.Pp
.Fn fuse_opt_add_arg
adds a single option to the end of
.Ar args .
On
.Ox ,
if
.Ar args->allocated
is 0,
.Ar args->argv
is copied to the heap and
.Ar args->allocated
is set to a non-zero value.
.Pp
.Fn fuse_opt_insert_arg
inserts a single option at position
.Ar p
into
.Ar args ,
shifting
.Ar args->argv
as needed.
(Shifting is currently unimplemented.)
.Pp
.Fn fuse_opt_free_args
frees all allocated memory in
.Ar args
and initializes everything to 0.
.Pp
.Fn fuse_opt_add_opt
adds an option
.Ar opt
to a pointer to an comma-separated string of options
.Ar opts .
.Ar *opts
can be NULL for adding the first option.
.Fn fuse_opt_add_opt_escaped
escapes any
.Sq ","
and
.Sq "\\"
characters in
.Ar opt
before adding it to
.Ar opts .
.Pp
.Fn fuse_opt_match
checks
.Ar opts
for whether
.Ar opt
is set or not.
.Pp
.Fn fuse_opt_parse
parses options.
.Ar opts
is an array of
.Ft struct fuse_opt ,
each which describes actions for each option:
.Bd -literal -offset indent
struct fuse_opt {
const char *templ;  /* template for option */
unsigned long off;  /* data offset */
int val;/* key value */
};
.Ed
.Pp
.Fn FUSE_OPT_KEY
returns a
.Ft struct fuse_opt
that matches an option
.Ar templ
with option key
.Ar key .
This function is used as an element in
.Ft struct fuse_opt
arrays.
.Fn FUSE_OPT_IS_OPT_KEY
checks if
.Ar t
is an option key.
.Pp
The last element of the
.Ar opts
.Ft struct fuse_opt
option array must be
.Dv FUSE_OPT_END .
.Pp
.Ar proc
points to a function with the following signature:
.Ft int (*fuse_opt_proc_t)
.Fo proc
.Fa "void *data"
.Fa "const char *arg"
.Fa "int key"
.Fa "struct fuse_args *outargs"
.Fc
.Pp
Special key values:
.Bd -literal -offset indent
FUSE_OPT_KEY_OPT/* no match */
FUSE_OPT_KEY_NONOPT /* non-option */
FUSE_OPT_KEY_KEEP   /* don't process; return 1 */
FUSE_OPT_KEY_DISCARD/* don't process; return 0 

Re: libfuse has moved to github

2016-05-18 Thread Ray Lai
Looks good to me

> On May 18, 2016, at 11:14 PM, Jason McIntyre <j...@kerhand.co.uk> wrote:
> 
>> On Wed, May 18, 2016 at 12:13:14AM +0800, Ray Lai wrote:
>> Also separate out the specification (does that count as a "standard"?)
>> and the implementation.
> 
> i've tweaked the diff a little to shorten it and keep the links in one
> section. STANDARDS seems the better choice.  i also don;t think the
> HISTORY tweak is neccessary.
> 
> ok with that, ray?
> 
> jmc
> 
> Index: fuse_main.3
> ===
> RCS file: /cvs/src/lib/libfuse/fuse_main.3,v
> retrieving revision 1.1
> diff -u -r1.1 fuse_main.3
> --- fuse_main.38 Aug 2013 06:41:06 -1.1
> +++ fuse_main.318 May 2016 15:13:16 -
> @@ -252,10 +252,12 @@
> }
> .Ed
> .Sh SEE ALSO
> -The FUSE specifications and orignal implementation can be found at:
> -.Lk http://fuse.sourceforge.net/
> -.Pp
> .Xr fuse 4
> +.Sh STANDARDS
> +The original FUSE specification can be found at
> +.Lk http://libfuse.github.io/doxygen/ .
> +The original implementation can be found at
> +.Lk https://github.com/libfuse/libfuse/ .
> .Sh HISTORY
> The FUSE library first appeared in
> .Ox 5.4 .



libfuse has moved to github

2016-05-17 Thread Ray Lai
Also separate out the specification (does that count as a "standard"?)
and the implementation.

Index: fuse_main.3
===
RCS file: /home/cvs/src/lib/libfuse/fuse_main.3,v
retrieving revision 1.1
diff -u -p -r1.1 fuse_main.3
--- fuse_main.3 8 Aug 2013 06:41:06 -   1.1
+++ fuse_main.3 17 May 2016 16:05:43 -
@@ -252,12 +252,17 @@ main(int ac, char **av)
 }
 .Ed
 .Sh SEE ALSO
-The FUSE specifications and orignal implementation can be found at:
-.Lk http://fuse.sourceforge.net/
-.Pp
 .Xr fuse 4
+.Sh STANDARDS
+The original FUSE specification can be found at:
+.Lk http://libfuse.github.io/doxygen/ .
 .Sh HISTORY
-The FUSE library first appeared in
+The original FUSE implementation can be found at:
+.Lk https://github.com/libfuse/libfuse/ .
+.Pp
+The
+.Ox
+FUSE library first appeared in
 .Ox 5.4 .
 .Sh BUGS
 This man page is woefully incomplete.



lpd systrace policy update

2016-03-28 Thread Ray Lai
Probably going to be obsolete once lpd gets pledged, but as it stands, 
the lpd systrace policy is missing these system calls.


Index: usr_sbin_lpd
===
RCS file: /home/cvs/src/etc/systrace/usr_sbin_lpd,v
retrieving revision 1.9
diff -u -p -u -p -r1.9 usr_sbin_lpd
--- usr_sbin_lpd13 Sep 2015 17:08:04 -  1.9
+++ usr_sbin_lpd28 Mar 2016 14:11:40 -
@@ -12,7 +12,9 @@ Policy: /usr/sbin/lpd, Emulation: native
native-chdir: permit
native-chmod: filename eq "/var/run/printer" then permit
native-chown: filename eq "/var/run/printer" then permit
+   native-clock_gettime: permit
native-close: permit
+   native-connect: sockaddr eq "/var/run/printer" then permit
native-connect: sockaddr match "inet-*:53" then permit
native-connect: sockaddr sub ":515" then permit
native-dup2: permit
@@ -30,6 +32,7 @@ Policy: /usr/sbin/lpd, Emulation: native
native-fsread: filename eq "/etc/spwd.db" then deny[eperm]
native-fsread: filename eq "/usr/libexec/ld.so" then permit
native-fsread: filename eq "/var/run/ld.so.hints" then permit
+   native-fsread: filename eq "/var/run/ypbind.lock" then permit
native-fsread: filename eq "" then deny[enoent]
native-fsread: filename match "/usr/lib" then permit
native-fsread: filename match "/usr/share/nls" then permit



Re: New scheduler for OpenBSD

2016-03-19 Thread Ray Lai
With this diff on my X200, YouTube used to be a stuttering mess on both 
chrome and firefox, and is now buttery smooth, even at 1080p. Thanks!




Fix MacBook Air 2010 speakers

2012-11-29 Thread Ray Lai
Adapted from
http://marc.info/?l=openbsd-miscm=128919130029011w=2

OK?



Index: dev/pci/azalia_codec.c
===
RCS file: /home/cvs/src/sys/dev/pci/azalia_codec.c,v
retrieving revision 1.151
diff -u -p -r1.151 azalia_codec.c
--- dev/pci/azalia_codec.c  10 Sep 2010 15:11:23 -  1.151
+++ dev/pci/azalia_codec.c  29 Nov 2012 11:16:41 -
@@ -64,6 +64,13 @@ azalia_codec_init_vtbl(codec_t *this)
this-name = NULL;
this-qrks = AZ_QRK_NONE;
switch (this-vid) {
+   case 0x10134206:
+   this-name = Cirrus Logic CS4206;
+   if (this-subid == 0xcb8910de) {/* APPLE_MBA3_1 */
+   this-qrks |= AZ_QRK_GPIO_UNMUTE_1 |
+   AZ_QRK_GPIO_UNMUTE_3;
+   }
+   break;
case 0x10ec0260:
this-name = Realtek ALC260;
break;
@@ -2403,6 +2410,9 @@ azalia_codec_gpio_quirks(codec_t *this)
}
if (this-qrks  AZ_QRK_GPIO_UNMUTE_2) {
azalia_gpio_unmute(this, 2);
+   }
+   if (this-qrks  AZ_QRK_GPIO_UNMUTE_3) {
+   azalia_gpio_unmute(this, 3);
}
 
return(0);