diff --git a/.cvsignore b/.cvsignore deleted file mode 100644 index 6aee227..0000000 --- a/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -afuse-0.2.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78e1615 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +afuse-0.2.tar.gz +/afuse-0.4.tar.gz +/afuse-0.4.1.tar.gz diff --git a/Makefile b/Makefile deleted file mode 100644 index 05c9fba..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: afuse -# $Id$ -NAME := afuse -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/afuse-0.4.1-strcpy-buffer-overflow-fix.patch b/afuse-0.4.1-strcpy-buffer-overflow-fix.patch new file mode 100644 index 0000000..ae46e23 --- /dev/null +++ b/afuse-0.4.1-strcpy-buffer-overflow-fix.patch @@ -0,0 +1,22 @@ +diff -up afuse-0.4.1/src/afuse.c.strcpy-buffer-overflow-fix afuse-0.4.1/src/afuse.c +--- afuse-0.4.1/src/afuse.c.strcpy-buffer-overflow-fix 2013-02-12 21:36:47.000000000 -0500 ++++ afuse-0.4.1/src/afuse.c 2021-02-24 13:31:58.884245692 -0500 +@@ -1853,8 +1853,16 @@ static int afuse_opt_proc(void *data, co + int main(int argc, char *argv[]) + { + struct fuse_args args = FUSE_ARGS_INIT(argc, argv); +- char *temp_dir_name = my_malloc(strlen(TMP_DIR_TEMPLATE)); +- strcpy(temp_dir_name, TMP_DIR_TEMPLATE); ++ size_t buflen = strlen(TMP_DIR_TEMPLATE); ++ // need one more for the null terminator ++ buflen++; ++ char *temp_dir_name = my_malloc(buflen); ++ if (buflen > 0) { ++ strncpy(temp_dir_name, TMP_DIR_TEMPLATE, buflen - 1); ++ temp_dir_name[buflen - 1] = '\0'; ++ } ++ ++ // strcpy(temp_dir_name, TMP_DIR_TEMPLATE); + + if (fuse_opt_parse(&args, &user_options, afuse_opts, afuse_opt_proc) == + -1) diff --git a/afuse-template-tokenize.patch b/afuse-template-tokenize.patch new file mode 100644 index 0000000..914400e --- /dev/null +++ b/afuse-template-tokenize.patch @@ -0,0 +1,214 @@ +diff -ur afuse-0.2.orig/src/afuse.c afuse-0.2/src/afuse.c +--- afuse-0.2.orig/src/afuse.c 2008-02-18 17:16:32.000000000 -0500 ++++ afuse-0.2/src/afuse.c 2008-07-10 21:50:06.000000000 -0400 +@@ -280,14 +280,19 @@ + } + + +-// !!FIXME!! allow escaping of %'s + // Note: this method strips out quotes and applies them itself as should be appropriate +-char *expand_template(const char *template, const char *mount_point, const char *root_name) ++bool run_template(const char *template, const char *mount_point, const char *root_name) + { + int len = 0; ++ int nargs = 1; + int i; +- char *expanded_name; +- char *expanded_name_start; ++ char *buf; ++ char *p; ++ char **args; ++ char **arg; ++ bool quote = false; ++ pid_t pid; ++ int status; + + // calculate length + for(i = 0; template[i]; i++) +@@ -295,53 +300,100 @@ + switch(template[i + 1]) + { + case 'm': +- len += strlen(mount_point) + 2; ++ len += strlen(mount_point); + i++; + break; + case 'r': +- len += strlen(root_name) + 2; ++ len += strlen(root_name); ++ i++; ++ break; ++ case '%': ++ len++; + i++; + break; + } +- } else if(template[i] != '"') ++ } else if(template[i] == ' ' && !quote) { ++ len++; ++ nargs++; ++ } else if(template[i] == '"') ++ quote = !quote; ++ else if(template[i] == '\\' && template[i + 1]) ++ len++, i++; ++ else + len++; + +- expanded_name_start = expanded_name = my_malloc(len + 1); ++ buf = my_malloc(len + 1); ++ args = my_malloc((nargs + 1) * sizeof(*args)); ++ ++ p = buf; ++ arg = args; ++ *arg++ = p; + + for(i = 0; template[i]; i++) + if(template[i] == '%') { +- int j = 0; + switch(template[i + 1]) + { + case 'm': +- *expanded_name++ = '"'; +- while(mount_point[j]) +- *expanded_name++ = mount_point[j++]; +- *expanded_name++ = '"'; ++ strcpy(p, mount_point); ++ p += strlen(mount_point); + i++; + break; + case 'r': +- *expanded_name++ = '"'; +- while(root_name[j]) +- *expanded_name++ = root_name[j++]; +- *expanded_name++ = '"'; ++ strcpy(p, root_name); ++ p += strlen(root_name); ++ i++; ++ break; ++ case '%': ++ *p++ = '%'; + i++; + break; + } +- } else if(template[i] != '"') +- *expanded_name++ = template[i]; +- +- *expanded_name = '\0'; +- +- return expanded_name_start; ++ } else if(template[i] == ' ' && !quote) { ++ *p++ = '\0'; ++ *arg++ = p; ++ } else if(template[i] == '"') ++ quote = !quote; ++ else if(template[i] == '\\' && template[i + 1]) ++ *p++ = template[++i]; ++ else ++ *p++ = template[i]; ++ ++ *p = '\0'; ++ *arg = NULL; ++ ++ pid = fork(); ++ if(pid == -1) { ++ fprintf(stderr, "Failed to fork (%s)\n", strerror(errno)); ++ free(args); ++ free(buf); ++ return false; ++ } ++ if(pid == 0) { ++ execvp(args[0], args); ++ abort(); ++ } ++ pid = waitpid(pid, &status, 0); ++ if(pid == -1) { ++ fprintf(stderr, "Failed to waitpid (%s)\n", strerror(errno)); ++ free(args); ++ free(buf); ++ return false; ++ } ++ if(!WIFEXITED(status) || WEXITSTATUS(status) != 0) { ++ fprintf(stderr, "Failed to invoke command: %s\n", args[0]); ++ free(args); ++ free(buf); ++ return false; ++ } ++ free(args); ++ free(buf); ++ return true; + } + + mount_list_t *do_mount(const char *root_name) + { + char *mount_point; +- char *mount_command; + mount_list_t *mount; +- int sysret; + + fprintf(stderr, "Mounting: %s\n", root_name); + +@@ -351,57 +403,33 @@ + return NULL; + } + +- mount_command = expand_template(user_options.mount_command_template, +- mount_point, root_name); +- sysret = system(mount_command); +- +- fprintf(stderr, "sysret: %.8x\n", sysret); +- +- if(sysret) { +- fprintf(stderr, "Failed to invoke mount command: '%s' (%s)\n", +- mount_command, sysret != -1 ? +- "Error executing mount" : +- strerror(errno)); +- ++ if(!run_template(user_options.mount_command_template, ++ mount_point, root_name)) { + // remove the now unused directory + if( rmdir(mount_point) == -1 ) + fprintf(stderr, "Failed to remove mount point dir: %s (%s)", + mount_point, strerror(errno)); + +- free(mount_command); + free(mount_point); + return NULL; + } + + mount = add_mount(root_name, mount_point); +- +- free(mount_command); + return mount; + } + + int do_umount(mount_list_t *mount) + { +- char *unmount_command; +- int sysret; +- + fprintf(stderr, "Unmounting: %s\n", mount->root_name); + +- unmount_command = expand_template(user_options.unmount_command_template, +- mount->mount_point, mount->root_name); +- sysret = system(unmount_command); +- if(sysret) { +- fprintf(stderr, "Failed to invoke unmount command: '%s' (%s)\n", +- unmount_command, sysret != -1 ? +- "Error executing mount" : +- strerror(errno)); +- /* Still unmount anyway */ +- } ++ run_template(user_options.unmount_command_template, ++ mount->mount_point, mount->root_name); ++ /* Still unmount anyway */ + + if( rmdir(mount->mount_point) == -1 ) + fprintf(stderr, "Failed to remove mount point dir: %s (%s)", + mount->mount_point, strerror(errno)); + remove_mount(mount); +- free(unmount_command); + return 1; + } + + + diff --git a/afuse.spec b/afuse.spec index 355855f..12244d8 100644 --- a/afuse.spec +++ b/afuse.spec @@ -1,25 +1,28 @@ Name: afuse -Summary: An automounter implemented with FUSE -Version: 0.2 -Release: 2%{?dist} -License: GPLv2+ -Group: System Environment/Base -Source0: http://downloads.sourceforge.net/afuse/%{name}-%{version}.tar.gz -URL: http://afuse.sourceforge.net/ -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Summary: An automounter implemented with FUSE +Version: 0.4.1 +Release: 29%{?dist} +# Automatically converted from old format: GPLv2+ - review is highly recommended. +License: GPL-2.0-or-later +Source0: https://afuse.googlecode.com/files/%{name}-%{version}.tar.gz +Patch0: afuse-0.4.1-strcpy-buffer-overflow-fix.patch +URL: https://github.com/pcarrier/afuse/ +BuildRequires: gcc BuildRequires: fuse-devel +BuildRequires: make %description -Afuse is an automounting file system implemented in user-space using FUSE. -Afuse currently implements the most basic functionality that can be expected -by an automounter; that is it manages a directory of virtual directories. If -one of these virtual directories is accessed and is not already automounted, -afuse will attempt to mount a filesystem onto that directory. If the mount -succeeds the requested access proceeds as normal, otherwise it will fail +Afuse is an automounting file system implemented in user-space using FUSE. +Afuse currently implements the most basic functionality that can be expected +by an automounter; that is it manages a directory of virtual directories. If +one of these virtual directories is accessed and is not already automounted, +afuse will attempt to mount a filesystem onto that directory. If the mount +succeeds the requested access proceeds as normal, otherwise it will fail with an error. %prep %setup -q +%patch -P0 -p1 -b .strcpy-buffer-overflow-fix %build %configure @@ -29,15 +32,127 @@ make %{?_smp_mflags} rm -rf %{buildroot} make DESTDIR=%{buildroot} install -%clean -rm -rf %{buildroot} - %files -%defattr(-,root,root,-) %doc AUTHORS ChangeLog COPYING README %{_bindir}/afuse +%{_bindir}/afuse-avahissh %changelog +* Fri Jan 16 2026 Fedora Release Engineering - 0.4.1-29 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild + +* Wed Jul 23 2025 Fedora Release Engineering - 0.4.1-28 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Thu Jan 16 2025 Fedora Release Engineering - 0.4.1-27 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Thu Jul 25 2024 Miroslav Suchý - 0.4.1-26 +- convert license to SPDX + +* Wed Jul 17 2024 Fedora Release Engineering - 0.4.1-25 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Mon Jan 22 2024 Fedora Release Engineering - 0.4.1-24 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Jan 19 2024 Fedora Release Engineering - 0.4.1-23 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Wed Jul 19 2023 Fedora Release Engineering - 0.4.1-22 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Wed Jan 18 2023 Fedora Release Engineering - 0.4.1-21 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Wed Jul 20 2022 Fedora Release Engineering - 0.4.1-20 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Wed Jan 19 2022 Fedora Release Engineering - 0.4.1-19 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Wed Jul 21 2021 Fedora Release Engineering - 0.4.1-18 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Wed Feb 24 2021 Tom Callaway - 0.4.1-17 +- fix buffer overflow issue with strcpy + +* Mon Jan 25 2021 Fedora Release Engineering - 0.4.1-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Fri Jul 31 2020 Fedora Release Engineering - 0.4.1-15 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Mon Jul 27 2020 Fedora Release Engineering - 0.4.1-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jan 28 2020 Fedora Release Engineering - 0.4.1-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Wed Jul 24 2019 Fedora Release Engineering - 0.4.1-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Thu Jan 31 2019 Fedora Release Engineering - 0.4.1-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Thu Jul 12 2018 Fedora Release Engineering - 0.4.1-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed Feb 07 2018 Fedora Release Engineering - 0.4.1-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Aug 02 2017 Fedora Release Engineering - 0.4.1-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 0.4.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Feb 10 2017 Fedora Release Engineering - 0.4.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Wed Feb 03 2016 Fedora Release Engineering - 0.4.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Tue Jun 16 2015 Fedora Release Engineering - 0.4.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Fri Aug 15 2014 Fedora Release Engineering - 0.4.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 0.4.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Mon Nov 18 2013 Tom Callaway - 0.4.1-1 +- update to 0.4.1 + +* Sat Aug 03 2013 Fedora Release Engineering - 0.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Wed Feb 13 2013 Fedora Release Engineering - 0.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Fri Jan 18 2013 Tom Callaway - 0.4-1 +- update to 0.4 + +* Wed Jul 18 2012 Fedora Release Engineering - 0.2-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Thu Jan 12 2012 Fedora Release Engineering - 0.2-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Mon Feb 07 2011 Fedora Release Engineering - 0.2-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Thu Sep 17 2009 Peter Lemenkov - 0.2-5 +- Rebuilt with new fuse + +* Mon Aug 17 2009 Tom "spot" Callaway - 0.2-4 +- fix CVS-2008-2232 + +* Fri Jul 24 2009 Fedora Release Engineering - 0.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + * Mon Feb 23 2009 Fedora Release Engineering - 0.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild diff --git a/import.log b/import.log deleted file mode 100644 index f4b2ddd..0000000 --- a/import.log +++ /dev/null @@ -1 +0,0 @@ -afuse-0_2-1_fc11:HEAD:afuse-0.2-1.fc11.src.rpm:1228241706 diff --git a/sources b/sources index 4b287f4..c4cb225 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -97b58a768ecb30696fb6c33dd8435b83 afuse-0.2.tar.gz +317efdda85d5585d085c61a0d262b83b afuse-0.4.1.tar.gz