FAQ SearchLogin
Tuxera Home
View unanswered posts | View active topics It is currently Sun Nov 29, 2020 01:02



Post new topic Reply to topic  [ 12 posts ] 
Unprivileged user unable to mount using NTFS-3g 
Author Message

Joined: Sat Feb 07, 2009 03:07
Posts: 5
Post Unprivileged user unable to mount using NTFS-3g
As the subject states:

~> ntfs-3g /dev/ad0s1 winxp
mount_fusefs: /dev/fuse1 on /home/robert/winxp: Operation not permitted
fuse: failed to mount file system: Unknown error: 0

If I setuid in /usr/loca/bin/ntfs-3g

[robert@asus64] ~> sudo chmod 4755 /usr/local/bin/ntfs-3g
Password:
[robert@asus64] ~> ls -l /usr/local/bin/ntfs-3g
-rwsr-xr-x 1 root robert 29968 Feb 6 06:31 /usr/local/bin/ntfs-3g

then
[robert@asus64] ~> ntfs-3g /dev/ad0s1 winxp
Mount is denied because setuid and setgid root ntfs-3g is insecure with the
external FUSE library. Either remove the setuid/setgid bit from the binary
or rebuild NTFS-3G with integrated FUSE support and make it setuid root.
Please see more information at http://ntfs-3g.org/support.html#unprivileged

In /etc/rc.conf I have:
fusefs_enable="YES"

[robert@asus64] ~> kldstat
Id Refs Address Size Name
1 11 0xffffffff80100000 b6e000 kernel
2 1 0xffffffff80c6e000 205f8 geom_mirror.ko
3 1 0xffffffff80c8f000 230b0 snd_hda.ko
4 2 0xffffffff80cb3000 67458 sound.ko
5 1 0xffffffff80d1b000 4828 nfsmb.ko
6 2 0xffffffff80d20000 24a0 smbus.ko
7 1 0xffffffff80d23000 4fd8 atapicam.ko
8 1 0xffffffff80e22000 aa7a fuse.ko

How do I rebuild with integrated FUSE? It is not an option in the port.

[robert@asus64] ~> uname -a
FreeBSD asus64.shasta204.local 7.1-STABLE FreeBSD 7.1-STABLE #13: Fri Feb 6 14:43:48 PST 2009 root@asus64.shasta204.local:/usr/obj/usr/src/sys/GENERIC amd64

All ports were updated to the latest as of Friday.

Thanks in advance


Sat Feb 07, 2009 17:34
Profile
Tuxera CTO

Joined: Tue Nov 21, 2006 23:15
Posts: 1648
Post Re: Unprivileged user unable to mount using NTFS-3g
I'm not sure if FUSE/FreeBSD supports block device based unprivileged mounts. Probably yes.

Please remove the relevant check from the source code and let us know how it works. If it will work for you fine then we will enable this in the next NTFS-3G version. Thank you.


Sun Feb 08, 2009 23:22
Profile

Joined: Sat Feb 07, 2009 03:07
Posts: 5
Post Re: Unprivileged user unable to mount using NTFS-3g
I have been searching but I can't seem to find the relevant code. It has been a long, long time since I have done any C coding. so a little help would be appreciated.

Thanks

Robert


Mon Feb 09, 2009 06:08
Profile
Tuxera CTO

Joined: Tue Nov 21, 2006 23:15
Posts: 1648
Post Re: Unprivileged user unable to mount using NTFS-3g
It's in the src/ntfs-3g.c file at the beginning of the main() function. The main() function is at the end of the src/ntfs-3g.c.


Mon Feb 09, 2009 12:40
Profile

Joined: Sat Feb 07, 2009 03:07
Posts: 5
Post Re: Unprivileged user unable to mount using NTFS-3g
Thanks for that. I was not thinking too well yesterday. I did search for the file ntfs-3g.c but of course after cleaning a port it is no longer available.

In case you are not familiar with FreeBSD ports system, the "make" will expand the *.tgz and place everything into a work directory. I commented out the #ifndef statement and rebuilt the port. (see below). I was then able to do an unprivileged mount after setting the setuid bit at /usr/local/bin/ntfs-3g.

I was unable to do an unprivileged umount. This is a minor annoyance but I thought that I should bring it to your attention.

Thanks again for your help.

Robert

/* #ifndef FUSE_INTERNAL
* if ((getuid() != geteuid()) || (getgid() != getegid())) {
* fprintf(stderr, "%s", setuid_msg);
* return NTFS_VOLUME_INSECURE;
* }
* #endif
*/


Mon Feb 09, 2009 18:34
Profile
Tuxera CTO

Joined: Tue Nov 21, 2006 23:15
Posts: 1648
Post Re: Unprivileged user unable to mount using NTFS-3g
For unprivileged unmount please try 'fusermount -u mountpoint'.


Mon Feb 09, 2009 19:08
Profile

Joined: Sat Feb 07, 2009 03:07
Posts: 5
Post Re: Unprivileged user unable to mount using NTFS-3g
I believe that fusermount is a linux only command.

[robert] ~> whereis fusermount
fusermount:
[robert] ~>


Tue Feb 10, 2009 00:57
Profile
Tuxera CTO

Joined: Tue Nov 21, 2006 23:15
Posts: 1648
Post Re: Unprivileged user unable to mount using NTFS-3g
It should be in the fuse package.


Tue Feb 10, 2009 01:07
Profile

Joined: Sat Feb 07, 2009 03:07
Posts: 5
Post Re: Unprivileged user unable to mount using NTFS-3g
In Debian the fusermount shows to be contained in the package fuse-utils. There is no such port or package available to FreeBSD.

As I stated before, it is a minor annoyance. I can use sudo to umount.

I want to again thank you for your help. ntfs-3g is now doing everything I really need it to do.

Robert


Tue Feb 10, 2009 16:20
Profile
Tuxera CTO

Joined: Tue Nov 21, 2006 23:15
Posts: 1648
Post Re: Unprivileged user unable to mount using NTFS-3g
On FreeBSD fusermount should be in fusefs-libs.


Tue Feb 10, 2009 19:27
Profile

Joined: Fri Feb 29, 2008 14:28
Posts: 3
Post Re: Unprivileged user unable to mount using NTFS-3g
I have the same problem too.
All my ports were just updated, and there is no fusermount in fusefs-libs:

Code:
cat /usr/ports/sysutils/fusefs-libs/pkg-plist
include/fuse/fuse.h
include/fuse/fuse_compat.h
include/fuse/fuse_common.h
include/fuse/fuse_common_compat.h
include/fuse/fuse_lowlevel.h
include/fuse/fuse_lowlevel_compat.h
include/fuse/fuse_opt.h
include/fuse/fuse_kernel.h
include/fuse.h
include/ulockmgr.h
lib/libfuse.a
lib/libfuse.la
lib/libfuse.so
lib/libfuse.so.2
lib/libulockmgr.la
lib/libulockmgr.a
lib/libulockmgr.so
lib/libulockmgr.so.1
libdata/pkgconfig/fuse.pc
@dirrm include/fuse
%%PORTDOCS%%%%DOCSDIR%%/libs/how-fuse-works
%%PORTDOCS%%%%DOCSDIR%%/libs/kernel.txt
%%PORTDOCS%%@dirrm %%DOCSDIR%%/libs
@dirrmtry %%DOCSDIR%%


Fri Mar 13, 2009 00:18
Profile WWW

Joined: Fri Dec 10, 2010 00:38
Posts: 1
Post Re: Unprivileged user unable to mount using NTFS-3g
So, continuing my topic: -> http://forums.freebsd.org/showthread.php?p=114007
2) Has been achieved.
What parts of code should be modified/deleted in order to achieve 1) and 3)

Thanks in advance.


Fri Dec 10, 2010 00:43
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Original forum style by Vjacheslav Trushkin.