Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cygwin installed , but make integration failed #519

Closed
youngh070 opened this issue May 3, 2018 · 9 comments
Closed

cygwin installed , but make integration failed #519

youngh070 opened this issue May 3, 2018 · 9 comments

Comments

@youngh070
Copy link

youngh070 commented May 3, 2018

I have installed encfs under win10 cygwin64 on a lenovo X1 carbon laptop.
but make integration failed .
and after install , it works not ok .
can somebody help me out . thanks .

Details:
I fully obey the instruction : https://github.com/vgough/encfs/wiki/Windows
in section "Mainline EncFS with Cygwin"
the install runs ok except ./build.sh says "make integration failed "
the output log2 append at the end of this message .

Then I make install , it works ok .
but when I use it . the newly create file can not be accessed .
the following log1 , append here :

----------------- log1 start ----------

yh@yanghua-x1 ~
$ export LC_ALL=en_US.UTF-8

yh@yanghua-x1 ~
$ export LANG=en_US.UTF-8

yh@yanghua-x1 ~
$ encfs ~/.crypt4 ~/crypt4
The directory "/home/yh/.crypt4/" does not exist. Should it be created? (y,N) y
A drive is prefered for mouting, so a path like X: (or /cygdrive/x) should rather be used. Mounting anyway.
Creating new encrypted volume.
Please choose from one of the following options:
 enter "x" for expert configuration mode,
 enter "p" for pre-configured paranoia mode,
 anything else, or an empty line will select standard mode.
?>

Standard configuration selected.

Configuration finished.  The filesystem to be created has
the following properties:
Filesystem cipher: "ssl/aes", version 3:0:2
Filename encoding: "nameio/block32", version 4:0:2
Key Size: 192 bits
Block Size: 1024 bytes
Each file contains 8 byte header with unique IV data.
Filenames encoded using IV chaining mode.
File holes passed through to ciphertext.

Now you will need to enter a password for your filesystem.
You will need to remember this password, as there is absolutely
no recovery mechanism.  However, the password can be changed
later using encfsctl.

New Encfs Password:
Verify Encfs Password:

yh@yanghua-x1 ~
$ echo aaa > ~/crypt4/aaa.txt

yh@yanghua-x1 ~
$ ls -l ~/crypt4
ls: cannot access '/home/yh/crypt4/aaa.txt': No such file or directory
total 0
-????????? ? ? ? ?            ? aaa.txt

yh@yanghua-x1 ~
$ cat ~/crypt4/aaa.txt
cat: /home/yh/crypt4/aaa.txt: No such file or directory

--------------------- log1 end ----------------

--------------------- log2 start ----------------

Scanning dependencies of target integration
++ dirname ../integration.sh
+ cd ..
+ perl -I. -MTest::Harness -e '$$Test::Harness::debug=1; runtests @ARGV;' integr                                                       ation/normal.t.pl integration/reverse.t.pl
integration/normal.t.pl ...
runTests: mode=standard sudo=off
integration/normal.t.pl ... 6/136
#   Failed test 'fqn link traversal'
#   at integration/normal.t.pl line 312.
#          got: '!<symlink>▒▒/cygdrive/x/data'
#     expected: 'hello world'

#   Failed test 'read fqn symlink'
#   at integration/normal.t.pl line 340.
#          got: undef
#     expected: '/cygdrive/x/data'

#   Failed test 'rel link traversal'
#   at integration/normal.t.pl line 312.
#          got: '!<symlink>▒▒data'
#     expected: 'hello world'

#   Failed test 'read rel symlink'
#   at integration/normal.t.pl line 344.
#          got: undef
#     expected: 'data'

#   Failed test 'hard link'
#   at integration/normal.t.pl line 349.
readline() on closed filehandle IN at integration/normal.t.pl line 311.

#   Failed test 'hardlink read'
#   at integration/normal.t.pl line 312.
#          got: undef
#     expected: 'hello world'
integration/normal.t.pl ... 65/136
runTests: mode=paranoia sudo=off
integration/normal.t.pl ... 76/136
#   Failed test 'fqn link traversal'
#   at integration/normal.t.pl line 312.
#          got: '!<symlink>▒▒/cygdrive/x/data'
#     expected: 'hello world'

#   Failed test 'read fqn symlink'
#   at integration/normal.t.pl line 340.
#          got: undef
#     expected: '/cygdrive/x/data'

#   Failed test 'rel link traversal'
#   at integration/normal.t.pl line 312.
#          got: '!<symlink>▒▒data'
#     expected: 'hello world'

#   Failed test 'read rel symlink'
#   at integration/normal.t.pl line 344.
#          got: undef
#     expected: 'data'
integration/normal.t.pl ... 134/136 # Looks like you failed 10 tests of 136.
integration/normal.t.pl ... Dubious, test returned 10 (wstat 2560, 0xa00)
Failed 10/136 subtests
        (less 2 skipped subtests: 124 okay)
integration/reverse.t.pl .. 21/46
#   Failed test 'Symlink read, /cygdrive/y/symlink -> /'
#   at integration/reverse.t.pl line 144.

#   Failed test 'Symlink compare, '/' != '''
#   at integration/reverse.t.pl line 146.

#   Failed test 'Symlink read, /cygdrive/y/symlink -> /1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/15/17/18'
#   at integration/reverse.t.pl line 144.

#   Failed test 'Symlink compare, '/1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/15/17/18' != '''
#   at integration/reverse.t.pl line 146.
integration/reverse.t.pl .. 33/46
#   Failed test 'Symlink read, /cygdrive/y/symlink -> /tmp/encfs-reverse-tests-fPMV/plain/foo'
#   at integration/reverse.t.pl line 144.

#   Failed test 'Symlink compare, '/tmp/encfs-reverse-tests-fPMV/plain/foo' != '''
#   at integration/reverse.t.pl line 146.
integration/reverse.t.pl .. 46/46 # Looks like you failed 6 tests of 46.
integration/reverse.t.pl .. Dubious, test returned 6 (wstat 1536, 0x600)
Failed 6/46 subtests

Test Summary Report
-------------------
integration/normal.t.pl (Wstat: 2560 Tests: 136 Failed: 10)
  Failed tests:  13-14, 16-19, 83-84, 86-87
  Non-zero exit status: 10
integration/reverse.t.pl (Wstat: 1536 Tests: 46 Failed: 6)
  Failed tests:  21-22, 29-30, 37-38
  Non-zero exit status: 6
Files=2, Tests=182, 83 wallclock secs ( 0.05 usr  0.05 sys + 28.42 cusr  5.74 csys = 34.25 CPU)
Result: FAIL
Failed 2/2 test programs. 16/182 subtests failed.
make[3]: *** [CMakeFiles/integration.dir/build.make:57:CMakeFiles/integration] 错误 6
make[2]: *** [CMakeFiles/Makefile2:405:CMakeFiles/integration.dir/all] 错误 2
make[1]: *** [CMakeFiles/Makefile2:412:CMakeFiles/integration.dir/rule] 错误 2
make: *** [Makefile:312:integration] 错误 2

--------------------- log2 end ----------------

@benrubson
Copy link
Contributor

Yes, as stated in the Wiki and in #499, symlinks behavior depends on some Cygwin & WinFsp configuration items. If you need symlinks, you may experiment and set these settings upon your needs.
Other tests are fine.

$ encfs ~/.crypt4 ~/crypt4
The directory "/home/yh/.crypt4/" does not exist. Should it be created? (y,N) y
A drive is prefered for mouting, so a path like X: (or /cygdrive/x) should rather be used. Mounting anyway.

As stated, you should mount like this :
$ encfs ~/.crypt4 /cygdrive/x
or :
$ encfs ~/.crypt4 X:

Or from a Windows console :
$ encfs C:\enc X:

@youngh070
Copy link
Author

thanks benrubson for your rapid reply .
"$ encfs ~/.crypt4 /cygdrive/x " and "$ encfs ~/.crypt4 X:"
that really worked .

I search wiki , but cannot find the usage mentioned above .
so , will you be so kind to update wiki page , in case other people do not know the mount syntax .
thanks again .

@benrubson
Copy link
Contributor

Wiki modified 👍
https://github.com/vgough/encfs/wiki/Windows#usage

I'm closing this then, feel free to re-open if needed 👍

@youngh070
Copy link
Author

excellent !

got updated wiki :
Note that you should provide EncFS with a drive-like mountpoint, such as X:
(or /cygdrive/x).

btw:
give a example such as "encfs ~/.crypt /cygdrive/x" seems more convenient .

@benrubson
Copy link
Contributor

You're right, I just added 2 examples 👍

@youngh070
Copy link
Author

👍

@youngh070
Copy link
Author

youngh070 commented May 4, 2018

I have write my install procedure , and make a guide in Chinese .
I can attach it here , if you feel it is usefull, feel free to link it to wiki .
encfs_安装说明.txt


2018-05-03 12:31:39 4
在 cygwin 中安装 EncFs , 实现全目录树加密. (可用于 保存到网络云盘的方法)
参见: https://github.com/vgough/encfs/wiki/Windows

    注意, 我以下均以 64 bit 为准 , 如果您电脑是 32位, 请自行更换. 
    下载软件包, 如果不喜欢用 wget , 可以采用您喜欢的其它方式 . 

1: 下载 cygwin 安装包
wget http://www.cygwin.com/setup-x86_64.exe

2: 安装必要的开发包, 在 windows cmd 中, 执行安装命令:
setup-x86_64.exe -DL -q -a x86_64 -O -d -l d:\save\soft\cygwin --root c:\cygwin64 -s http://mirrors.163.com/cygwin -P "cmake,make,gcc-g++,gettext-devel,openssl-devel,procps-ng,perl-test-harness"
其中, (下面2个位置, 可换成你喜欢的位置):
d:\save\soft\cygwin 这是下载包存放在电脑的位置.
c:\cygwin64 这是cygwin 安装的位置

3: 安装 WinFsp , 请选择全安装, 下面2个都要选中安装 (Developer , FUSE for cygwin)
wget https://github.com/billziss-gh/winfsp/releases/download/v1.2POST1/winfsp-1.2.17346.msi

4: 在 cygwin 的 console 中, 安装 WinFsp 支持
cd /cygdrive/c/Program\ Files\ (x86)/WinFsp/opt/cygfuse/
$ sh install.sh
FUSE for Cygwin installed.

5: vi /usr/include/fuse/winfsp_fuse.h
原代码: return cygwin_create_path(
修改为: return (char *)cygwin_create_path(

6: 下载 encfs
wget https://github.com/vgough/encfs/releases/download/v1.9.5/encfs-1.9.5.tar.gz

7: 编译测试 encfs
tar -zxf encfs-1.9.5.tar.gz
cd encfs-1.9.5
./build.sh
make 时, integration 出错, 注意都是在 symlink, hardlink 错. 这个如果不使用连接, 可以忽略

8: 安装 encfs
make install (注意, 要在 cd build 目录中 再执行)

9: 试用
9.1 创建:
encfs /cygdrive/c/enc /cygdrive/x -- 加密盘保存在 c:\enc , 挂载在 X: 盘
-- 模式选择, 直接回车选项 standard
-- 设置初始密码.
9.2 文件操作:
echo aaa > /cygdrive/x/aaa.txt
ls -l /cygdrive/c/enc
-rw-r--r-- 1 aa None 1299 5月 3 15:03 .encfs6.xml -- 这是配置文件. 极重要, 千万保存好.
-rwx------ 1 aa None 17460 5月 4 02:55 5PBEBQX5JFVZXU6PHYULOJDHZBJ6D -- 这是 aaa.txt 的加密后版本.

ls -l /cygdrive/x
-rw-r--r-- 1 aa None 4 5月 3 15:04 aaa.txt -- 这是 aaa.txt 明文版本.
同时, 在windows 资源管理器中 就可看到多了一个 X: 盘. 里面有 aaa.txt

9.3 卸载:
encfs -u /cygdrive/x

10: 以上作完后, 可把加密后的文件夹, c:\enc 目录直接复制到 云盘. 如百度云 .
建议不要把 .encfs6.xml 复制到云盘. 但千万自己保存好, 因为这是全盘的密钥. 如果丢失. 全盘数据就全丢失了.

附:
第3步WinFsp 安装完. 有2个测试方法 :
1: 在windows explore 中, 映射一个远端 \memfs64\share , 到本地一个如 Z:
2: 在命令行中打.
memfs-x64 -u \memfs64\share2 -m *
会显示映射成如 Y:
这样, 新映射的内存磁盘可访问 .

@benrubson
Copy link
Contributor

Many thanks @youngh070, procedure linked 👍
Feel free to update your it here if/when needed.

@youngh070
Copy link
Author

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants