WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: encFS - a simple way to encrypt dropbox folders  (Read 14341 times)

Offline caminati

  • Full Member
  • ***
  • Posts: 184
    • Homepage
Re: encFS - a simple way to encrypt dropbox folders
« Reply #15 on: November 02, 2012, 07:38:34 AM »
no, since the fuse udev rules are in your extension, the script needs to be in your extension

Sorry, I'm lost (I admit I don't know how udev works, so maybe it's me): my encfs.tcz has no rules, it only contains three encfs binary files: /usr/local/bin/{encfs,encfsctl,encfssh}, and nothing else.

Moreover, fuse.tcz seems to have the same problem with basically any of its dependers: try
Code: [Select]
tce-load -i firmware.tcz
tce-load -i fusecompress.tcz {sshfs-fuse-2.2.tcz, sshfs-fuse.tcz} CurlFtpFS.tcz

Using any of these programs fails due to denied permission on /dev/fuse.
Note that you have to use valid ssh/ftp connection to see that.
My impression (see also http://forum.tinycorelinux.net/index.php?topic=11777.0) is that the problem is with fuse.tcz. Am I wrong?

Offline AmatCoder

  • Full Member
  • ***
  • Posts: 179
    • AmatCoder Projects
Re: encFS - a simple way to encrypt dropbox folders
« Reply #16 on: November 02, 2012, 09:17:34 AM »
IMO, those commands should be into tce.install script from fuse.tcz (extension made by Daniel Barnes).

Fuse.tcz ships with a 99-fuse.rules file, so fuse.tcz should ensure its correct implementation (and should not do extensions which depended on it).
« Last Edit: November 02, 2012, 09:20:56 AM by AmatCoder »

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14546
Re: encFS - a simple way to encrypt dropbox folders
« Reply #17 on: November 02, 2012, 10:05:40 AM »
Ah - I thought the rules were in the proposed extension, sorry for the confusion

Offline caminati

  • Full Member
  • ***
  • Posts: 184
    • Homepage
Re: encFS - a simple way to encrypt dropbox folders
« Reply #18 on: November 02, 2012, 10:45:50 AM »
Ah - I thought the rules were in the proposed extension, sorry for the confusion

No prob.
I queried the tce bugs forum board about the issue, hoping danielibarnes is going to give feedback.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11221
Re: encFS - a simple way to encrypt dropbox folders
« Reply #19 on: November 02, 2012, 01:16:56 PM »
Hi caminati
That was my fault, I should have said the fuse extension, not your extension.

Offline netnomad

  • Hero Member
  • *****
  • Posts: 1026
Re: encFS - a simple way to encrypt dropbox folders
« Reply #20 on: November 04, 2012, 09:03:11 AM »
hi caminati,

thank you for your encfs.tcz-package.

everything works fine after these two mentioned fuse-commands...

you could do it much more convenient for all users,
if you put these in a little script in your package under following path:
/usr/local/tce.installed/

so create that encfs-starting-script /usr/local/tce.installed/encfs

#!/bin/sh
sudo udevadm control --reload-rules
sudo udevadm trigger --action=change --sysname-match=fuse

make it executable f.e. with chmod 700 encfs,
repackage and upload it again.

btw i did that already in my individual meta-package encfs_meta.tcz and everything works fine.

thank you for your help
« Last Edit: November 04, 2012, 09:06:28 AM by netnomad »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10962
Re: encFS - a simple way to encrypt dropbox folders
« Reply #21 on: November 04, 2012, 11:29:16 AM »
Eh, extensions shouldn't work around other extensions. Better fix that one in fuse.tcz.
The only barriers that can stop you are the ones you create yourself.

Offline netnomad

  • Hero Member
  • *****
  • Posts: 1026
Re: encFS - a simple way to encrypt dropbox folders
« Reply #22 on: November 04, 2012, 01:09:08 PM »
Eh, extensions shouldn't work around other extensions. Better fix that one in fuse.tcz.

hi curaga,

of course, you are right!
sometimes meta-packages can help to load a set of packages and pre-configurations in one set.

hopefully fuse.tcz will be soon fixed, so this should be the first goal.

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14546
Re: encFS - a simple way to encrypt dropbox folders
« Reply #23 on: November 04, 2012, 07:36:25 PM »
Rather than adding a new group "fuse", I wonder if it wouldn't be better to compile fuse so that it works with "staff" - if possible of course...

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11221
Re: encFS - a simple way to encrypt dropbox folders
« Reply #24 on: November 04, 2012, 08:12:32 PM »
Hi Juanito
Since the fuse rules file sets the mode to 666, would the group setting even matter?

Offline AmatCoder

  • Full Member
  • ***
  • Posts: 179
    • AmatCoder Projects
Re: encFS - a simple way to encrypt dropbox folders
« Reply #25 on: November 06, 2012, 04:29:48 AM »
Problem is that udev has a bug...or an undocumented behavior...Example:

Code: [Select]
KERNEL=="fuse", MODE="0666"Works...mode is setted. (rule from fuse is like this...)

Code: [Select]
KERNEL=="fuse", ACTION=="add", MODE="0666"Does not work...mode is ignored. (default rule from udev is like this...)

Code: [Select]
KERNEL=="fuse", ACTION=="change", MODE="0666"Works...mode is setted.

Code: [Select]
KERNEL=="fuse", ACTION=="add|change", MODE="0666"Works...mode is setted.

Offline althalus

  • Sr. Member
  • ****
  • Posts: 351
Re: encFS - a simple way to encrypt dropbox folders
« Reply #26 on: November 06, 2012, 03:09:04 PM »
Problem is that udev has a bug...or an undocumented behavior...Example:

Code: [Select]
KERNEL=="fuse", MODE="0666"Works...mode is setted. (rule from fuse is like this...)

Code: [Select]
KERNEL=="fuse", ACTION=="add", MODE="0666"Does not work...mode is ignored. (default rule from udev is like this...)

Code: [Select]
KERNEL=="fuse", ACTION=="change", MODE="0666"Works...mode is setted.

Code: [Select]
KERNEL=="fuse", ACTION=="add|change", MODE="0666"Works...mode is setted.

Quick idea, haven't looked into how udev rules work or anything so feel free to tell me I'm wrong, but mightn't that just mean udev won't perform the add action because it thinks that it's already been added?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11221
Re: encFS - a simple way to encrypt dropbox folders
« Reply #27 on: November 06, 2012, 06:16:30 PM »
Hi AmatCoder
Doesn't sound like a bug to me. If the item exists, there is nothing to add, and the rule is skipped.

Offline AmatCoder

  • Full Member
  • ***
  • Posts: 179
    • AmatCoder Projects
Re: encFS - a simple way to encrypt dropbox folders
« Reply #28 on: November 07, 2012, 03:02:06 AM »
But /dev/fuse is created at boot by udev following default rules... The default rule is:
Code: [Select]
KERNEL=="fuse", ACTION=="add", MODE="0666", OPTIONS+="static_node=fuse", \
  RUN+="/bin/mount -t fusectl fusectl /sys/fs/fuse/connections"


And at boot, udev is executed as we can see in /etc/init.d/rcS :

Code: [Select]
# Start Udev to populate /dev and handle hotplug events
echo -n "${BLUE}Starting udev daemon for hotplug support...${NORMAL}"
/sbin/udevd --daemon 2>&1 >/dev/null
/sbin/udevadm trigger --action=add 2>&1 >/dev/null &
rotdash $!
echo "${GREEN}Done.${NORMAL}"

Note that action triggered is "add", so mode should be setted...

Offline AmatCoder

  • Full Member
  • ***
  • Posts: 179
    • AmatCoder Projects
Re: encFS - a simple way to encrypt dropbox folders
« Reply #29 on: November 07, 2012, 04:00:30 AM »
Oh, now I can see what's happening....

Some tce.installed scripts (e.g.: alsa.tcz) do:
Code: [Select]
udevadm trigger
If you run this without --action parameter then default action is "change"... So rules with ACTION=="add" are skipped, devices are preserved BUT permission is set to default mode (600):

Code: [Select]
[...]
udev_node_mknod: preserve file '/dev/fuse', because it has correct dev_t
udev_node_mknod: set permissions /dev/fuse, 020600, uid=0, gid=0
[...]