[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: encfs over sshfs suffering with permission problem



On Fri, 23 Nov 2012 09:28:21 +0530
Kushal Kumaran <kushal.kumaran+debian@gmail.com> wrote:


> 
> 1. Ensure both encfs and sshfs are running as you, not root or any other
> user.
> 

Confirmed

> 2. Check for I/O errors both on the local box and the remote box (run
> dmesg and look for suspicious logs).
>
nothing found

> 3. Verify that you are able to create, delete and rename files on the
> sshfs mountpoint directly.  Verify that newly-created files are writable
> by you.

on sshfs mount point
----------------------

echo "test" > test.txt
echo "test more" >> test.txt

 cat test.txt 
test
test more

mv test.txt test12.txt

rm test12.txt

> 
> 4. After mounting using sshfs and encfs, attach strace to the encfs
> process (run strace -p <encfs-pid> -o ~/encfs.log -f), and try to create
> a single file in the sshfs mountpoint (presumably this fails).  Then
> detach the strace (C-c in that shell), and examine encfs.log for
> permission errors (EPERM).  If you do not understand the log, reply back
> with a link to the log.  The log might be large, so upload it to, for
> example, paste.debian.net, rather than attaching it to your email.
> 

cd to encfs mout point

cd ../pcbackup_decrypt/

touch 123
touch: cannot touch `123': Permission denied

log from strace

=============
13184 read(4, "8\0\0\0\3\0\0\0\253\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\350\3\0\0\350\3\0\0"..., 135168) = 56
13184 lstat("/tmp/pcbackup_encrypt/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
13184 lstat("/tmp/pcbackup_encrypt/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
13184 writev(4, [{"x\0\0\0\0\0\0\0\253\0\0\0\0\0\0\0", 16}, {"\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\20\0\0\0\0\0\0"..., 104}], 2) = 120
13184 read(4, "8\0\0\0\3\0\0\0\254\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\350\3\0\0\350\3\0\0"..., 135168) = 56
13184 lstat("/tmp/pcbackup_encrypt/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
13184 lstat("/tmp/pcbackup_encrypt/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
13184 writev(4, [{"x\0\0\0\0\0\0\0\254\0\0\0\0\0\0\0", 16}, {"\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\20\0\0\0\0\0\0"..., 104}], 2) = 120
13184 read(4, "8\0\0\0\3\0\0\0\255\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\350\3\0\0\350\3\0\0"..., 135168) = 56
13184 lstat("/tmp/pcbackup_encrypt/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
13184 lstat("/tmp/pcbackup_encrypt/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
13184 writev(4, [{"x\0\0\0\0\0\0\0\255\0\0\0\0\0\0\0", 16}, {"\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\20\0\0\0\0\0\0"..., 104}], 2) = 120
13184 read(4, "8\0\0\0\3\0\0\0\256\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\350\3\0\0\350\3\0\0"..., 135168) = 56
13184 lstat("/tmp/pcbackup_encrypt/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
13184 lstat("/tmp/pcbackup_encrypt/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
13184 writev(4, [{"x\0\0\0\0\0\0\0\256\0\0\0\0\0\0\0", 16}, {"\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\20\0\0\0\0\0\0"..., 104}], 2) = 120
13184 read(4, "8\0\0\0\3\0\0\0\257\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\350\3\0\0\350\3\0\0"..., 135168) = 56
13184 lstat("/tmp/pcbackup_encrypt/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
13184 lstat("/tmp/pcbackup_encrypt/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
13184 writev(4, [{"x\0\0\0\0\0\0\0\257\0\0\0\0\0\0\0", 16}, {"\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\20\0\0\0\0\0\0"..., 104}], 2) = 120
13184 read(4, "8\0\0\0\3\0\0\0\260\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\350\3\0\0\350\3\0\0"..., 135168) = 56
13184 lstat("/tmp/pcbackup_encrypt/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
13184 lstat("/tmp/pcbackup_encrypt/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
13184 writev(4, [{"x\0\0\0\0\0\0\0\260\0\0\0\0\0\0\0", 16}, {"\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\20\0\0\0\0\0\0"..., 104}], 2) = 120
13184 read(4, "8\0\0\0\3\0\0\0\261\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\350\3\0\0\350\3\0\0"..., 135168) = 56
13184 lstat("/tmp/pcbackup_encrypt/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
13184 lstat("/tmp/pcbackup_encrypt/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
13184 writev(4, [{"x\0\0\0\0\0\0\0\261\0\0\0\0\0\0\0", 16}, {"\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\20\0\0\0\0\0\0"..., 104}], 2) = 120
13184 read(4, "8\0\0\0\3\0\0\0\262\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\350\3\0\0\350\3\0\0"..., 135168) = 56
13184 lstat("/tmp/pcbackup_encrypt/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
13184 lstat("/tmp/pcbackup_encrypt/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
13184 writev(4, [{"x\0\0\0\0\0\0\0\262\0\0\0\0\0\0\0", 16}, {"\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\20\0\0\0\0\0\0"..., 104}], 2) = 120
13184 read(4, ",\0\0\0\1\0\0\0\263\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\350\3\0\0\350\3\0\0"..., 135168) = 44
13184 lstat("/tmp/pcbackup_encrypt/SqUeX,,Q7SGt21hq7ByV-Zvc", 0x7fff5fd26eb0) = -1 ENOENT (No such file or directory)
13184 lstat("/tmp/pcbackup_encrypt/SqUeX,,Q7SGt21hq7ByV-Zvc", 0x7fff5fd27190) = -1 ENOENT (No such file or directory)
13184 writev(4, [{"\20\0\0\0\376\377\377\377\263\0\0\0\0\0\0\0", 16}], 1) = 16
13184 read(4, ",\0\0\0\1\0\0\0\264\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\350\3\0\0\350\3\0\0"..., 135168) = 44
13184 lstat("/tmp/pcbackup_encrypt/SqUeX,,Q7SGt21hq7ByV-Zvc", 0x7fff5fd26eb0) = -1 ENOENT (No such file or directory)
13184 lstat("/tmp/pcbackup_encrypt/SqUeX,,Q7SGt21hq7ByV-Zvc", 0x7fff5fd27190) = -1 ENOENT (No such file or directory)
13184 writev(4, [{"\20\0\0\0\376\377\377\377\264\0\0\0\0\0\0\0", 16}], 1) = 16
13184 read(4, "8\0\0\0\3\0\0\0\265\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\350\3\0\0\350\3\0\0"..., 135168) = 56
13184 lstat("/tmp/pcbackup_encrypt/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
13184 lstat("/tmp/pcbackup_encrypt/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
13184 writev(4, [{"x\0\0\0\0\0\0\0\265\0\0\0\0\0\0\0", 16}, {"\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\20\0\0\0\0\0\0"..., 104}], 2) = 120
13184 read(4, "8\0\0\0\3\0\0\0\266\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\350\3\0\0\350\3\0\0"..., 135168) = 56
13184 lstat("/tmp/pcbackup_encrypt/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
13184 lstat("/tmp/pcbackup_encrypt/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
13184 writev(4, [{"x\0\0\0\0\0\0\0\266\0\0\0\0\0\0\0", 16}, {"\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\20\0\0\0\0\0\0"..., 104}], 2) = 120
13184 read(4,  <unfinished ...>

=============


strace with touch command on encfs mount point

==============
strace touch 123

execve("/usr/bin/touch", ["touch", "123"], [/* 25 vars */]) = 0
brk(0)                                  = 0x1265000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f39a973c000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=150606, ...}) = 0
mmap(NULL, 150606, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f39a9717000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/librt.so.1", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220!\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=31744, ...}) = 0
mmap(NULL, 2128856, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f39a9317000
mprotect(0x7f39a931e000, 2093056, PROT_NONE) = 0
mmap(0x7f39a951d000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7f39a951d000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\357\1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1583120, ...}) = 0
mmap(NULL, 3696728, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f39a8f90000
mprotect(0x7f39a910d000, 2097152, PROT_NONE) = 0
mmap(0x7f39a930d000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17d000) = 0x7f39a930d000
mmap(0x7f39a9312000, 18520, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f39a9312000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\\\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=131107, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f39a9716000
mmap(NULL, 2208672, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f39a8d74000
mprotect(0x7f39a8d8b000, 2093056, PROT_NONE) = 0
mmap(0x7f39a8f8a000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16000) = 0x7f39a8f8a000
mmap(0x7f39a8f8c000, 13216, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f39a8f8c000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f39a8d73000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f39a8d72000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f39a8d71000
arch_prctl(ARCH_SET_FS, 0x7f39a8d72700) = 0
mprotect(0x7f39a8f8a000, 4096, PROT_READ) = 0
mprotect(0x7f39a930d000, 16384, PROT_READ) = 0
mprotect(0x7f39a951d000, 4096, PROT_READ) = 0
mprotect(0x60e000, 4096, PROT_READ)     = 0
mprotect(0x7f39a973e000, 4096, PROT_READ) = 0
munmap(0x7f39a9717000, 150606)          = 0
set_tid_address(0x7f39a8d729d0)         = 18068
set_robust_list(0x7f39a8d729e0, 0x18)   = 0
futex(0x7fff82f3fbcc, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1, NULL, 7f39a8d72700) = -1 EAGAIN (Resource temporarily unavailable)
rt_sigaction(SIGRTMIN, {0x7f39a8d79ad0, [], SA_RESTORER|SA_SIGINFO, 0x7f39a8d83030}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0x7f39a8d79b60, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x7f39a8d83030}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
brk(0)                                  = 0x1265000
brk(0x1286000)                          = 0x1286000
open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=1534848, ...}) = 0
mmap(NULL, 1534848, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f39a959f000
close(3)                                = 0
open("123", O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK, 0666) = -1 EACCES (Permission denied)
utimensat(AT_FDCWD, "123", NULL, 0)     = -1 ENOENT (No such file or directory)
open("/usr/share/locale/locale.alias", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2570, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f39a973b000
read(3, "# Locale name alias data base.\n#"..., 4096) = 2570
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x7f39a973b000, 4096)            = 0
open("/usr/share/locale/en_IN.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_IN/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "touch: ", 7touch: )                  = 7
write(2, "cannot touch `123'", 18cannot touch `123')      = 18
open("/usr/share/locale/en_IN.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_IN/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, ": Permission denied", 19: Permission denied)     = 19
write(2, "\n", 1
)                       = 1
close(1)                                = 0
close(2)                                = 0
exit_group(1)                           = ?

==============



Reply to: