Re: Can't use sshfs as user

2016-05-22 Thread Ray Lai
I've fixed "sshfs -o idmap=user", please test and give feedback:

https://marc.info/?l=openbsd-tech=146383589632694=2

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)



Re: Can't use sshfs as user

2016-04-28 Thread Stuart Henderson
On 2016-04-26, Daniel Boyd  wrote:
> Any idea how to get it to map the uid?  Once I mount the folder, I can't
> access it.
>
> I've tried -o idmap=user, -o uid=1000, etc. None of that seems to work.

iirc that's not supported in OpenBSD's FUSE implementation yet.



Re: Can't use sshfs as user

2016-04-26 Thread Daniel Boyd
Any idea how to get it to map the uid?  Once I mount the folder, I can't
access it.

I've tried -o idmap=user, -o uid=1000, etc. None of that seems to work.

On Mon, Apr 25, 2016 at 6:18 AM, Dmitrij D. Czarkoff 
wrote:

> Thuban said:
> > Oh, that was it.
> > It works after a
> > # chmod 666 /dev/fuse0
> >
> > Not sure it's really secure thought.
>
> You only need 660 and your user in 'wheel' group.
>
> --
> Dmitrij D. Czarkoff



Re: Can't use sshfs as user

2016-04-25 Thread Dmitrij D. Czarkoff
Thuban said:
> Oh, that was it.
> It works after a
> # chmod 666 /dev/fuse0
> 
> Not sure it's really secure thought.

You only need 660 and your user in 'wheel' group.

-- 
Dmitrij D. Czarkoff



Re: Can't use sshfs as user

2016-04-25 Thread Thuban
* Sebastien Marie  le [24-04-2016 10:17:58 +0200]:
> On Fri, Apr 22, 2016 at 04:51:39PM +0200, Thuban wrote:
> > Hi,
> > I try to mount a directory with sshfs as non-root, but I get the
> > following error :
> >
> > fuse_mount: Permission denied
> >
> > I don't get it. I have "kern.usermount=1" in /etc/sysctl.conf, but
> > according to [1] I need to use some option about uid. But which ones?
> >
>
> - read/write permissions on /dev/fuse0
> - mount point owned by the user
>

Oh, that was it.
It works after a
# chmod 666 /dev/fuse0

Not sure it's really secure thought.

Thanks.

--
/Thuban/

[demime 1.01d removed an attachment of type application/pgp-signature which had 
a name of signature.asc]



Re: Can't use sshfs as user

2016-04-24 Thread Sebastien Marie
On Fri, Apr 22, 2016 at 04:51:39PM +0200, Thuban wrote:
> Hi,
> I try to mount a directory with sshfs as non-root, but I get the
> following error :
> 
> fuse_mount: Permission denied
> 
> I don't get it. I have "kern.usermount=1" in /etc/sysctl.conf, but
> according to [1] I need to use some option about uid. But which ones?
> 

- read/write permissions on /dev/fuse0
- mount point owned by the user

-- 
Sebastien Marie



Re: Can't use sshfs as user

2016-04-24 Thread Thuban
* Thuban  le [22-04-2016 16:51:39 +0200]:
> Hi,
> I try to mount a directory with sshfs as non-root, but I get the
> following error :
>
> fuse_mount: Permission denied
>
> I don't get it. I have "kern.usermount=1" in /etc/sysctl.conf, but
> according to [1] I need to use some option about uid. But which ones?
>
> Regards.
>
> [1] :
>
http://openbsd-archive.7691.n7.nabble.com/sshfs-as-non-root-fuse-mount-Permis
> sion-denied-td253224.html

I tried to add -o uid=1000 -o gid=1000 to sshfs, but he does'n seems to
understand these options despite the man page says.

Where am I wrong?

[demime 1.01d removed an attachment of type application/pgp-signature which had 
a name of signature.asc]



Can't use sshfs as user

2016-04-22 Thread Thuban
Hi,
I try to mount a directory with sshfs as non-root, but I get the
following error :

fuse_mount: Permission denied

I don't get it. I have "kern.usermount=1" in /etc/sysctl.conf, but
according to [1] I need to use some option about uid. But which ones?

Regards.

[1] :
http://openbsd-archive.7691.n7.nabble.com/sshfs-as-non-root-fuse-mount-Permis
sion-denied-td253224.html
--
/Thuban/

[demime 1.01d removed an attachment of type application/pgp-signature which had 
a name of signature.asc]