shithub: riscv

Download patch

ref: b8397a3c2c1603b37a6f4385b70d022f60489625
parent: 5796736b708701ad7f7275d3603fbe24faa63a2c
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Thu Apr 11 09:45:11 EDT 2013

libauth: auth_chuid empty (from sources)

instead of an "i/o count too small", detect a missing capability (empty, null string)
before the write, and diagnose it as such.

--- a/sys/src/libauth/auth_chuid.c
+++ b/sys/src/libauth/auth_chuid.c
@@ -10,7 +10,7 @@
 {
 	int rv, fd;
 
-	if(ai == nil || ai->cap == nil){
+	if(ai == nil || ai->cap == nil || ai->cap[0] == 0){
 		werrstr("no capability");
 		return -1;
 	}
--