Tell MacFusion to set permissions to 774 when uploading file via SSHFS?

437 views
Skip to first unread message

Advrk Aplmrkt

unread,
Jun 29, 2012, 12:11:05 PM6/29/12
to osxfus...@googlegroups.com
Hello,

I've been using the latest MacFusion on Mac OS X 10.6.8 to work with some files on a server via SSHFS. I noticed that files I've edited on, or uploaded to the server have their permissions set as 644. This became a problem as my colleagues (in the same user group) are unable to edit those files.

I would like permissions set to 774 by default when I edit or upload files to this server via MacFusion SSHFS. Trying "-o idmap=TYPE" with different options didn't help. What should I do?

Thank you.

P.S. The other option set for SSHFS right now is "-o defer_permissions". I couldn't do anything on the server before adding this option. Not sure if this is related...

Benjamin Fleischer

unread,
Jun 30, 2012, 1:04:58 PM6/30/12
to osxfus...@googlegroups.com
Hi,

I can't offer a simple solution to your problem. As far as I know the issue is neither caused by OSXFUSE nor Macfusion but is related to the umask of the SSH daemon running on your server. The following webpage explains why files and folders uploaded/changed using SSHFS are only editable by you. The second page explains how to get rid of this limitation (in case of a linux server):


I hope this helps,
Benjamin

Advrk Aplmrkt

unread,
Jul 2, 2012, 5:29:55 PM7/2/12
to osxfus...@googlegroups.com
Hello,

Thanks for your reply.

According the the first post, the author developed a patch for SSHFS
that fixed the problem. Is there a build of this patched version that
is known to work with the current MacFusion?

BTW, the patch was for SSHFS 2.2, which I know is old. Would it even work?

As for the second post, I don't think the administrator of our server
would be willing to make the change to umask. So hopefully there is
something I can do client-side to resolve this issue...

Benjamin Fleischer

unread,
Jul 5, 2012, 1:18:25 AM7/5/12
to osxfus...@googlegroups.com
Hi,

The patch is not very extensive. I have not tested to apply it to the most recent version of SSHFS but I assume there shouldn't be any major issues. But to be honest I'm not a big fan of integrating this patch in the official OSXFUSE version of SSHFS after it got rejected by the original SSHFS author. I think OSXFUSE SSHFS should stay as close to upstream SSHFS as possible. But I will look into it. In newer versions of FUSE there might be another way of dealing with umasks in user space file systems.

Regards,
Benjamin

Advrk Aplmrkt

unread,
Jul 5, 2012, 7:51:09 PM7/5/12
to osxfus...@googlegroups.com
Hello,

Thanks fleiben for your answers!

I wanted to try to compile the patched 2.4.1 code from GitHub, but
there is a problem.

Before applying the patch, I tried to compile the original master
branch code. But I get this error during the configure process:

./configure: line 3523: syntax error near unexpected token `SSHFS,'
./configure: line 3523: `PKG_CHECK_MODULES(SSHFS, fuse >= 2.3 glib-2.0
gthread-2.0)'

BTW, I do have glib 2.32.3 installed via MacPorts on my system running
Mac OS X 10.6.8. Can anyone provide some tips on how to successfully
compile SSHFS in Mac OS X?

Once I figure this out, then I can try to apply the patch. Thanks!

Benjamin Fleischer

unread,
Jul 6, 2012, 2:17:20 PM7/6/12
to osxfus...@googlegroups.com
Hi,

If I remember correctly, you need to install the following ports (including their dependencies) to build SSHFS:

autoconf
automake
glib2
help2man
pkgconfig

Then execute the following commands in the source directory:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
autoreconf -i
CFLAGS="-DDARWIN_SEMAPHORE_COMPAT" ./configure --prefix=/usr/local --disable-dependency-tracking
make

To install SSHFS run:

sudo make install

Regards,
Benjamin

Advrk Aplmkt

unread,
Jul 6, 2012, 4:38:45 PM7/6/12
to osxfus...@googlegroups.com, osxfus...@googlegroups.com
That makes sense. I'll try it ASAP and report back. Thanks!

Advrk Aplmrkt

unread,
Jul 9, 2012, 10:27:18 PM7/9/12
to osxfus...@googlegroups.com
Hello,

Thank you for the directions, and I was able to successfully compile SSHFS including the patch!

However, I encountered another problem *before* I could test the patched SSHFS. When I mount my remote share via Macfusion (again pre-patch), I can open and edit files from it, but I get permissions error when I try to copy files to the mounted volume. The exact error is:

cp: [a file on my local machine]: could not copy extended attributes to [destination on the server]: Operation not permitted

I also used Get Info on the mounted volume in question, and attached a screenshot of it with this message.

This is confusing because Macfusion was working fine (albeit with permissions problems for files *after* they were uploaded) and I was able to upload files, but not anymore.....

Any suggestions on how I can troubleshoot this? Thank you very much, I appreciate your patience.

Advrk Aplmrkt

unread,
Jul 11, 2012, 9:36:07 PM7/11/12
to osxfus...@googlegroups.com
Hello again,

I've tried more, and am getting close.
I was finally able to compile the patched SSHFS 2.4 from GitHub and
make Macfusion use it. My SSH volume mounted correctly, and writing to
it from the command line was fine, and permissions were what I wanted
by using the remote_dmask and remote_fmask options provided by the
patch.

However, if I try to drag a file to my SSH volume from the Finder, the
file would copy correctly, yet the Finder also shows me an error
message saying it doesn't have permissions to write to the volume??
This seems contradictory.

I also tried Macfusion with only the defer_permissions option, but in
this case the file really can't be written to the volume.

All this is very confusing. Does anyone have an idea as to what is going on?

Thanks!
Reply all
Reply to author
Forward
0 new messages