Skip to content

Commit

Permalink
merge from 2_0_merge1 to 2_0_merge2
Browse files Browse the repository at this point in the history
  • Loading branch information
szmi committed Nov 11, 2004
1 parent 0761361 commit 3a6ea06
Show file tree
Hide file tree
Showing 15 changed files with 77 additions and 168 deletions.
12 changes: 0 additions & 12 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,3 @@ FUSE core
---------

Miklos Szeredi <[email protected]>


Python bindings
---------------

Jeff Epler <[email protected]>


Perl bindings
-------------

Mark Glines <[email protected]>
10 changes: 0 additions & 10 deletions BUGS

This file was deleted.

9 changes: 7 additions & 2 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
2004-11-10 Miklos Szeredi <[email protected]>
2004-11-11 Miklos Szeredi <[email protected]>

* Merge from fuse_2_0_bugfix to fuse_2_0_merge1
* Check kernel interface version in fusermount to prevent
strangeness in case of mismatch.

2004-11-10 Miklos Szeredi <[email protected]>

* Separate configure for the kernel directory

* Don't allow write to return more than 'count'

* Extend kernel interface for future use

2004-11-09 Miklos Szeredi <[email protected]>

* Fix 'makeconf.sh' to use autoreconf if available
Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ EXTRA_DIST = \
fuse.pc.in \
README* \
Filesystems \
BUGS \
FAQ \
doc/how-fuse-works

pkgconfigdir = $(libdir)/pkgconfig
Expand Down
17 changes: 17 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
What is new in 2.1

* Bug fixes

* Improved support for filesystems implementing a custom event-loop

* Add 'pkg-config' support

* Kernel module can be compiled separately

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

What is new in 1.9

* Lots of bugs fixed
Expand All @@ -20,6 +32,8 @@ What is new in 1.9

* Extended attributes support

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

What is new in 1.3

* Thanks to user bugreports and stress testing with LTP and sfx-linux
Expand All @@ -35,6 +49,8 @@ What is new in 1.2

* Other bugfixes

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

What is new in 1.1

* Support for the 2.6 kernels
Expand All @@ -50,6 +66,7 @@ What is new in 1.1

* Bugfixes

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

What is new in 1.0

Expand Down
4 changes: 0 additions & 4 deletions README-2.6

This file was deleted.

120 changes: 0 additions & 120 deletions fuse.spec

This file was deleted.

2 changes: 1 addition & 1 deletion kernel/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mkdir_p = mkdir -p
majver = @majver@
VERSION = @PACKAGE_VERSION@

DISTFILES = Makefile.in configure.ac configure config.h.in makeconf.sh \
DISTFILES = Makefile.in configure.ac configure config.h.in ../install-sh \
dev.c dir.c file.c inode.c util.c fuse_i.h
COMPATDISTFILES = compat/parser.c compat/parser.h
LINUXDISTFILES = linux/fuse.h
Expand Down
2 changes: 2 additions & 0 deletions kernel/configure.ac
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
AC_INIT(fuse-kernel, 2.1-pre0)
AC_CONFIG_HEADERS([config.h])

AC_PROG_INSTALL

AC_MSG_CHECKING([kernel source directory])
kernelsrc=
AC_ARG_WITH(kernel,
Expand Down
8 changes: 6 additions & 2 deletions kernel/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,8 +618,12 @@ static ssize_t fuse_send_write(struct fuse_req *req, int writepage,
req->out.args[0].value = &outarg;
request_send(fc, req);
res = req->out.h.error;
if (!res)
return outarg.size;
if (!res) {
if (outarg.size > count)
return -EPROTO;
else
return outarg.size;
}
else
return res;
}
Expand Down
2 changes: 2 additions & 0 deletions kernel/linux/fuse.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ struct fuse_open_in {

struct fuse_open_out {
unsigned long fh;
unsigned int _open_flags;
};

struct fuse_release_in {
Expand All @@ -155,6 +156,7 @@ struct fuse_release_in {

struct fuse_flush_in {
unsigned long fh;
unsigned int _nref;
};

struct fuse_read_in {
Expand Down
9 changes: 0 additions & 9 deletions kernel/makeconf.sh

This file was deleted.

3 changes: 2 additions & 1 deletion kernel/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ MODULE_DESCRIPTION("Filesystem in Userspace");
MODULE_LICENSE("GPL");
#endif

spinlock_t fuse_lock = SPIN_LOCK_UNLOCKED;
spinlock_t fuse_lock;

int __init fuse_init(void)
{
Expand All @@ -27,6 +27,7 @@ int __init fuse_init(void)
FUSE_VERSION,
FUSE_KERNEL_VERSION, FUSE_KERNEL_MINOR_VERSION);

spin_lock_init(&fuse_lock);
res = fuse_fs_init();
if (res)
goto err;
Expand Down
8 changes: 8 additions & 0 deletions makeconf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ else
autoconf
echo Running automake...
automake -a -c
(
echo Entering directory: kernel
cd kernel
echo Running autoheader...
autoheader
echo Running autoconf...
autoconf
)
fi

rm -f config.cache config.status
Expand Down
37 changes: 31 additions & 6 deletions util/fusermount.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
#include <sys/un.h>
#include <linux/fuse.h>

#define FUSE_DEV "/proc/fs/fuse/dev"

#define FUSE_COMMFD_ENV "_FUSE_COMMFD"

const char *progname;
Expand Down Expand Up @@ -375,6 +373,29 @@ static int do_mount(const char *mnt, const char *type, mode_t rootmode,
return res;
}

static int check_version(void)
{
int res;
int majorver;
int minorver;
FILE *vf = fopen(FUSE_VERSION_FILE, "r");
if (vf == NULL) {
fprintf(stderr, "%s: kernel interface too old\n", progname);
return -1;
}
res = fscanf(vf, "%i.%i", &majorver, &minorver);
fclose(vf);
if (res != 2) {
fprintf(stderr, "%s: error reading %s\n", progname, FUSE_VERSION_FILE);
return -1;
}
if (majorver < 3) {
fprintf(stderr, "%s: kernel interface too old\n", progname);
return -1;
}
return 0;
}

static int check_perm(const char **mntp, struct stat *stbuf, int *currdir_fd)
{
int res;
Expand Down Expand Up @@ -475,10 +496,14 @@ static int mount_fuse(const char *mnt, const char *opts)
return -1;
}

res = check_perm(&real_mnt, &stbuf, &currdir_fd);
if (res != -1)
res = do_mount(real_mnt, type, stbuf.st_mode & S_IFMT, fd, opts,
&fsname);
res = check_version();
if (res != -1) {
res = check_perm(&real_mnt, &stbuf, &currdir_fd);
if (res != -1)
res = do_mount(real_mnt, type, stbuf.st_mode & S_IFMT, fd, opts,
&fsname);
}

if (getuid() != 0)
restore_privs();

Expand Down

0 comments on commit 3a6ea06

Please sign in to comment.