Skip to content

Commit 2135ad7

Browse files
committed
Initial commit to git.
0 parents  commit 2135ad7

22 files changed

+3512
-0
lines changed

.gitignore

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Autotools stuff
2+
Makefile.in
3+
Makefile
4+
5+
/autom4te.cache
6+
/aclocal.m4
7+
/compile
8+
/configure
9+
/depcomp
10+
/install-sh
11+
/missing
12+
13+
/config.log
14+
/config.sub
15+
/config.guess
16+
/config.status
17+
/config.h.in
18+
/config.h
19+
/libtool
20+
/ltmain.sh
21+
/stamp-h1
22+
23+
# C stuff
24+
25+
*.o
26+
.libs
27+
.deps
28+
29+
# Products
30+
31+
src/bindfs
32+

COPYING

+340
Large diffs are not rendered by default.

ChangeLog

+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
2010-08-07 Martin Pärtel <martin dot partel at gmail dot com>
2+
3+
* Improved --help and manpage.
4+
* Disabled FUSE attribute cache when using mirroring to avoid
5+
caching the owner of files when observed by a mirrored user.
6+
* Added a testcase for the above.
7+
* Released 1.9
8+
9+
2010-01-17 Martin Pärtel <martin dot partel at gmail dot com>
10+
11+
* Added options to control the behavior of chown and chgrp.
12+
* Released 1.8.4
13+
14+
2009-03-28 Martin Pärtel <martin dot partel at gmail dot com>
15+
16+
* Added --ctime-from-mtime. Contributed by Shez.
17+
* Added --chmod-allow-x.
18+
* Released 1.8.3
19+
20+
2008-12-14 Martin Pärtel <martin dot partel at gmail dot com>
21+
22+
* Converted ChangeLog to UTF-8.
23+
24+
2008-12-13 Martin Pärtel <martin dot partel at gmail dot com>
25+
26+
* Specified that the license is GPL v2 or later in all source files
27+
and in the README file.
28+
* Released 1.8.2 with no functional changes.
29+
30+
2008-12-12 Martin Pärtel <martin dot partel at gmail dot com>
31+
32+
* Made xattr-rw the default instead of xattr-ro,
33+
which returned a "permission denied" that could mislead some programs.
34+
* Released 1.8.1
35+
36+
2008-08-17 Martin Pärtel <martin dot partel at gmail dot com>
37+
38+
* Fixed segfault in option parsing on platforms where
39+
sizeof(int) != sizeof(long), such as amd64.
40+
* Released 1.8
41+
42+
2008-07-08 Martin Pärtel <martin dot partel at gmail dot com>
43+
44+
* Symlinks to absolute paths didn't work. Now they do.
45+
Reported by rpfuller. Thanks!
46+
* Ownership of symlinks weren't set. Now they are.
47+
Again, reported by rpfuller. Thanks again!
48+
* Released 1.7
49+
50+
2008-06-26 Martin Pärtel <martin dot partel at gmail dot com>
51+
52+
* --create-as-* and --create-for-* weren't applied for mknod().
53+
Bug report and patch by rpfuller. Thanks!
54+
* Released 1.6.2
55+
56+
2008-06-25 Martin Pärtel <martin dot partel at gmail dot com>
57+
58+
* Added copyright messages to each source file.
59+
* Escaped man-page dashes, since unescaped dashes are treated as
60+
hyphens.
61+
62+
2008-06-19 Martin Pärtel <martin dot partel at gmail dot com>
63+
64+
* Fixed missing '=' signs in the man-page.
65+
66+
2008-05-14 Martin Pärtel <martin dot partel at gmail dot com>
67+
68+
* If the mount source and destination directories are the same
69+
then we no longer require that the directory be empty.
70+
(-ononempty is added implicitly)
71+
* Released 1.6.1
72+
73+
2008-05-10 Martin Pärtel <martin dot partel at gmail dot com>
74+
75+
* Added --create-with-perms.
76+
* Added a little automated test suite.
77+
* Moved the project to code.google.com.
78+
* Released 1.6
79+
80+
2008-01-26 Martin Pärtel <martin dot partel at gmail dot com>
81+
82+
* Fixed an embarrassing segfault while parsing --mirror arguments.
83+
Thanks to Stefan Kost for reporting it!
84+
* Released 1.5
85+
86+
2007-12-31 Martin Pärtel <martin dot partel at gmail dot com>
87+
88+
* Made compatible with Mac OS X with the help of Theocharis Athanasakis.
89+
* Released 1.4.2
90+
91+
2007-11-09 Martin Pärtel <martin dot partel at gmail dot com>
92+
93+
* Fixed a bug in userinfo.c that could prevent using numeric
94+
user or group IDs when /etc/passwd or /etc/group have long records.
95+
* Released 1.4.1
96+
97+
2007-10-31 Martin Pärtel <martin dot partel at gmail dot com>
98+
99+
* Applied another patch from Joel Daniels to fix a bug that
100+
occurred when /etc/passwd or /etc/group had long records.
101+
Thanks!
102+
* Released 1.4
103+
104+
2007-07-17 Martin Pärtel <martin dot partel at gmail dot com>
105+
106+
* Renamed the new options added by Joel
107+
to --create-for-user and --create-for-group.
108+
* Made it an error to use --create-as-user as non-root.
109+
* Released 1.3
110+
111+
2007-07-17 Joel Daniels <jdaniel4 at uiuc dot e d u>
112+
113+
* Added the user_for_create and group_for_create options
114+
115+
116+
2007-03-24 Martin Pärtel <martin dot partel at gmail dot com>
117+
118+
* Fixed minor errors in man-page.
119+
* Released 1.2.1
120+
121+
2007-03-03 Martin Pärtel <martin dot partel at gmail dot com>
122+
123+
* Michael Roitzsch pointed out incorrect permission checks
124+
for symlinks and fixed unlink() to correctly check for write permission
125+
to the the directory (instead of the file). Thanks!
126+
* Removed check_access() altogether. Will now rely on the kernel for
127+
all permission checks by always enabling -o default_permissions.
128+
* Released 1.2
129+
130+
131+
2007-01-14 Martin Pärtel <martin dot partel at gmail dot com>
132+
133+
* Changed -o no_allow_others to -o no_allow_other.
134+
* Added a way to specify group members in -m and -M.
135+
* Released 1.1

Makefile.am

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# not a GNU package. You can remove this line, if
2+
# have all needed files, that a GNU package needs
3+
AUTOMAKE_OPTIONS = foreign
4+
5+
SUBDIRS = src tests
6+

README

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
bindfs - http://code.google.com/p/bindfs/
3+
4+
-- Overview --
5+
6+
bindfs is a FUSE filesystem for mirroring a directory to another
7+
directory, similarly to mount --bind. The permissions of the mirrored
8+
directory can be altered in various ways.
9+
10+
Some things bindfs can be used for:
11+
- Making a directory read-only.
12+
- Making all executables non-executable.
13+
- Sharing a directory with a list of users (or groups).
14+
- Modifying permission bits using rules with chmod-like syntax.
15+
- Changing the permissions with which files are created.
16+
17+
Non-root users can use almost all features, but most interesting
18+
use-cases need user_allow_other to be defined in /etc/fuse.conf
19+
20+
21+
-- Installation --
22+
23+
Make sure fuse 2.5.3 or above is installed (http://fuse.sf.net/).
24+
Then compile and install as usual:
25+
./configure
26+
make
27+
make install
28+
29+
If you want the mounts made by non-root users to be visible to other users,
30+
you may have to add the line user_allow_other to /etc/fuse.conf.
31+
32+
33+
-- Usage --
34+
35+
See the bindfs --help or the man-page for instructions and examples.
36+
37+
38+
-- License --
39+
40+
GNU General Public License version 2 or any later version.
41+
See the file COPYING.

TODO

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Major (i.e. probably not very soon):
3+
4+
- Applying options to a subset of all files;
5+
something like --if-file-matches '*.md5' { -u checksummer -p u+rw }
6+
- This would make for some new useful options like --hide or --deny
7+
- We could also have special xattrs like 'bindfs:perms' that
8+
don't get propagated to the base directory but control bindfs behaviour
9+
instead.
10+
- All this leads to the thought of an integrated minilanguage.
11+
Taken to the extreme, would this make bindfs almost yet another scripting
12+
language binding for FUSE?
13+
- Stackable/pluggable scripts? Any benefit over a remount?
14+
15+
Minor:
16+
17+
- Decide what to do with the fuse options uid=N and gid=N, or at least
18+
mention them in the docs.
19+
20+
- Look at capabilities instead of uid==0 when checking for special privileges.
21+
Do this in a portable way and fall back to uid==0 if not available.
22+

autogen.sh

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/bash
2+
3+
# Enable environment variables to override tool commands.
4+
: ${AUTOCONF=autoconf}
5+
: ${AUTOHEADER=autoheader}
6+
: ${AUTOMAKE=automake}
7+
: ${ACLOCAL=aclocal}
8+
: ${LIBTOOLIZE=libtoolize}
9+
10+
# Apple calls the GNU libtoolize "glibtoolize"
11+
if [[ ! -x `which "$LIBTOOLIZE"` ]]; then
12+
LIBTOOLIZE=glibtoolize
13+
fi
14+
if [[ ! -x `which "$LIBTOOLIZE"` ]]; then
15+
echo "Cannot find libtoolize"
16+
exit 1
17+
fi
18+
19+
# Add /usr/local/share/aclocal to aclocal's search path
20+
if [[ -d /usr/local/share/aclocal ]]; then
21+
ACLOCAL="$ACLOCAL -I /usr/local/share/aclocal"
22+
fi
23+
24+
rm -rf autom4te.cache
25+
rm -f aclocal.m4
26+
rm -f missing mkinstalldirs depcomp install-sh libtool
27+
28+
echo "Running $ACLOCAL..."
29+
$ACLOCAL || exit 1
30+
31+
echo "Running $AUTOHEADER..."
32+
$AUTOHEADER || exit 1
33+
34+
echo "Running $AUTOCONF..."
35+
$AUTOCONF || exit 1
36+
37+
echo "Running $LIBTOOLIZE..."
38+
$LIBTOOLIZE --automake --copy --force || exit 1
39+
40+
echo "Running $AUTOMAKE..."
41+
$AUTOMAKE -a -c || exit 1
42+
43+
if [ "$1" == "-d" ]; then
44+
echo "Running configure --enable-debug"
45+
echo
46+
sleep 1s
47+
./configure --enable-debug
48+
elif [ -n "$1" ]; then
49+
echo
50+
echo "./configure $@"
51+
./configure $@
52+
else
53+
echo
54+
echo "autogen.sh completed successfully."
55+
echo "Now run ./configure with the appropriate flags and then make."
56+
fi
57+

configure.ac

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
AC_INIT([bindfs],[1.9],[[email protected]])
2+
3+
AM_INIT_AUTOMAKE
4+
AM_CONFIG_HEADER(config.h)
5+
6+
AC_PROG_CC
7+
AC_LANG(C)
8+
AC_PROG_LIBTOOL
9+
10+
# --enable and --with options
11+
AC_ARG_ENABLE([debug],
12+
[AS_HELP_STRING([--enable-debug], [enable extra debug output])])
13+
AC_ARG_WITH([core-foundation],
14+
AS_HELP_STRING([--with-core-foundation], [link against Core Foundation (OS X only) @<:@default=no@:>@]))
15+
16+
17+
if test x"$enable_debug" == "xyes" ; then
18+
CFLAGS="${CFLAGS} -g -O0 -DMALLOC_CHECK_=2"
19+
AC_DEFINE([BINDFS_DEBUG], [1], [Define to 1 to enable debugging messages])
20+
else
21+
CFLAGS="${CFLAGS} -O2"
22+
fi
23+
24+
if test x"$with_core_foundation" == "xyes" ; then
25+
AC_MSG_NOTICE([Linking with Core Foundation])
26+
LDFLAGS="${LDFLAGS} -framework CoreFoundation"
27+
fi
28+
29+
CFLAGS="${CFLAGS} -Wall -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=25"
30+
31+
# Check for xattrs
32+
AC_CHECK_FUNCS([setxattr getxattr listxattr removexattr])
33+
AC_CHECK_FUNCS([lsetxattr lgetxattr llistxattr lremovexattr])
34+
35+
# Check for fuse
36+
PKG_CHECK_MODULES([fuse], [fuse >= 2.5.3])
37+
38+
AC_CONFIG_FILES([Makefile \
39+
src/Makefile \
40+
tests/Makefile])
41+
AC_OUTPUT
42+

src/Makefile.am

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## Process this file with automake to produce Makefile.in
2+
3+
bin_PROGRAMS = bindfs
4+
5+
noinst_HEADERS = debug.h permchain.h userinfo.h misc.h
6+
bindfs_SOURCES = bindfs.c permchain.c userinfo.c misc.c
7+
8+
AM_CFLAGS = $(fuse_CFLAGS)
9+
bindfs_LDADD = $(fuse_LIBS)
10+
11+
man_MANS = bindfs.1

0 commit comments

Comments
 (0)