jayduhon / inferno-os

Automatically exported from code.google.com/p/inferno-os
2 stars 0 forks source link

slashes aren't allowed in anames #312

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
/emu/port/sysfile.c:/^kfauth/+/validname rejects anames containing slashes such 
as main/archive or main/snapshot. Also /appl/lib/factotum.b:/^mount didn't go 
out of its way to help me find the problem.

diff -r 01665ab22684 emu/port/sysfile.c
--- a/emu/port/sysfile.c    Sat Sep 07 11:32:50 2013 +0100
+++ b/emu/port/sysfile.c    Sat May 24 01:52:19 2014 +0000
@@ -292,7 +292,7 @@
    if(waserror())
        return -1;

-   validname(aname, 0);
+   validname(aname, 1);
    c = fdtochan(up->env->fgrp, fd, ORDWR, 0, 1);
    if(waserror()){
        cclose(c);
diff -r 01665ab22684 os/port/sysfile.c
--- a/os/port/sysfile.c Sat Sep 07 11:32:50 2013 +0100
+++ b/os/port/sysfile.c Sat May 24 01:52:19 2014 +0000
@@ -309,7 +309,7 @@
    if(waserror())
        return -1;

-   validname(aname, 0);
+   validname(aname, 1);
    c = fdtochan(up->env->fgrp, fd, ORDWR, 0, 1);
    if(waserror()){
        cclose(c);
diff -r 01665ab22684 appl/lib/factotum.b
--- a/appl/lib/factotum.b   Sat Sep 07 11:32:50 2013 +0100
+++ b/appl/lib/factotum.b   Sat May 24 01:52:19 2014 +0000
@@ -66,6 +66,10 @@
 {
    ai: ref Authinfo;
    afd := sys->fauth(fd, aname);
+   if(debug && afd == nil){
+       sys->print("fauth %s: %r\n", aname);
+       return (-1, nil);
+   }
    if(afd != nil){
        ai = proxy(afd, open(), "proto=p9any role=client "+keyspec);
        if(debug && ai == nil){

Original issue reported on code.google.com by kristofwycz on 24 May 2014 at 2:04

GoogleCodeExporter commented 9 years ago
Thanks for spotting that. I hadn't tried accessing a fossil dump from Inferno, 
only the default tree.

committed changeset 636:c9d2c96d1f4e
pushing to https://Charles.Forsyth:***@inferno-os.googlecode.com/hg
searching for changes
3 changesets found
remote: added 3 changesets with 5 changes to 5 files

Original comment by Charles....@gmail.com on 24 May 2014 at 5:49

GoogleCodeExporter commented 9 years ago

Original comment by Charles....@gmail.com on 24 May 2014 at 5:49