Compare commits
	
		
			No commits in common. "c8s" and "c9-beta" have entirely different histories.
		
	
	
		
	
		
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -1 +1 @@ | ||||
| /sysfsutils-2.1.0.tar.gz | ||||
| SOURCES/v2.1.1.tar.gz | ||||
|  | ||||
							
								
								
									
										1
									
								
								.sysfsutils.metadata
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								.sysfsutils.metadata
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1 @@ | ||||
| 73f472c5ebc91c6288315f0fdefde0bbb1ef75e2 SOURCES/v2.1.1.tar.gz | ||||
							
								
								
									
										21
									
								
								SOURCES/sysfsutils-2.1.1-fix-my-strncat.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								SOURCES/sysfsutils-2.1.1-fix-my-strncat.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,21 @@ | ||||
| diff -up sysfsutils-2.1.1/lib/sysfs_utils.c.orig sysfsutils-2.1.1/lib/sysfs_utils.c
 | ||||
| --- sysfsutils-2.1.1/lib/sysfs_utils.c.orig	2025-03-11 15:06:31.976403632 +0100
 | ||||
| +++ sysfsutils-2.1.1/lib/sysfs_utils.c	2025-03-13 08:40:42.648753678 +0100
 | ||||
| @@ -369,14 +369,14 @@ char *my_strncpy(char *to, const char *f
 | ||||
|  } | ||||
|   | ||||
|  /** | ||||
| - * my_strncpy -- a safe strncpy
 | ||||
| + * my_strncat -- a safe strncat
 | ||||
|   */ | ||||
|  char *my_strncat(char *to, const char *from, size_t max) | ||||
|  { | ||||
|  	size_t i = 0; | ||||
|   | ||||
| -	while (i < max && to[i] != '\0')
 | ||||
| +	while (to[i] != '\0')
 | ||||
|  		i++; | ||||
| -	my_strncpy(to+i, from, max-i);
 | ||||
| +	my_strncpy(to+i, from, max);
 | ||||
|  	return to; | ||||
|  } | ||||
| @ -1,18 +1,24 @@ | ||||
| Name:           sysfsutils | ||||
| URL:            http://sourceforge.net/projects/linux-diag/ | ||||
| License:        GPLv2 | ||||
| Group:          Development/Tools | ||||
| Version:        2.1.0 | ||||
| Release:        25%{?dist} | ||||
| %global so_major_version 2 | ||||
| %global so_minor_version 0 | ||||
| %global so_patch_version 1 | ||||
| 
 | ||||
| Name:           sysfsutils | ||||
| Version:        2.1.1 | ||||
| Release:        11%{?dist} | ||||
| Summary:        Utilities for interfacing with sysfs | ||||
| BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) | ||||
| Source0:        http://prdownloads.sourceforge.net/linux-diag/%{name}-%{version}.tar.gz | ||||
| Patch0:         sysfsutils-2.0.0-redhatify.patch | ||||
| Patch1:         sysfsutils-2.0.0-class-dup.patch | ||||
| Patch2:         sysfsutils-2.1.0-get_link.patch | ||||
| Patch3:         sysfsutils-2.1.0-manpages.patch | ||||
| Patch4:         sysfsutils-aarch64.patch | ||||
| URL:            https://github.com/linux-ras/sysfsutils | ||||
| License:        GPLv2 | ||||
| 
 | ||||
| Source0:        https://github.com/linux-ras/sysfsutils/archive/v%{version}.tar.gz | ||||
| 
 | ||||
| Patch0:         sysfsutils-2.1.1-fix-my-strncat.patch | ||||
| 
 | ||||
| BuildRequires:  autoconf | ||||
| BuildRequires:  automake | ||||
| BuildRequires:  libtool | ||||
| BuildRequires:  make | ||||
| BuildRequires:  gcc | ||||
| Requires:       libsysfs = %{version}-%{release} | ||||
| 
 | ||||
| %description | ||||
| This package's purpose is to provide a set of utilities for interfacing | ||||
| @ -20,7 +26,6 @@ with sysfs. | ||||
| 
 | ||||
| %package -n libsysfs | ||||
| Summary: Shared library for interfacing with sysfs | ||||
| Group: System Environment/Libraries | ||||
| License: LGPLv2+ | ||||
| 
 | ||||
| %description -n libsysfs | ||||
| @ -28,7 +33,6 @@ Library used in handling linux kernel sysfs mounts and their various files. | ||||
| 
 | ||||
| %package -n libsysfs-devel | ||||
| Summary: Static library and headers for libsysfs | ||||
| Group: Development/Libraries | ||||
| License: LGPLv2+ | ||||
| Requires: libsysfs = %{version}-%{release} | ||||
| 
 | ||||
| @ -37,58 +41,110 @@ libsysfs-devel provides the header files and static libraries required | ||||
| to build programs using the libsysfs API. | ||||
| 
 | ||||
| %prep | ||||
| %setup -q | ||||
| %patch0 -p1 -b .redhatify | ||||
| %patch1 -p1 | ||||
| %patch2 -p1 | ||||
| %patch3 -p1 | ||||
| %patch4 -p1 | ||||
| %autosetup -p1 | ||||
| 
 | ||||
| %build | ||||
| %configure --disable-static --prefix=/usr | ||||
| make %{?_smp_mflags} | ||||
| ./autogen | ||||
| %configure --disable-static | ||||
| %{make_build} | ||||
| 
 | ||||
| %install | ||||
| rm -rf $RPM_BUILD_ROOT | ||||
| %{make_install} | ||||
| find %{buildroot} -type f -name "*.la" -delete | ||||
| 
 | ||||
| make DESTDIR=$RPM_BUILD_ROOT install | ||||
| 
 | ||||
| rm -f $RPM_BUILD_ROOT%{_bindir}/dlist_test $RPM_BUILD_ROOT%{_bindir}/get_bus_devices_list $RPM_BUILD_ROOT%{_bindir}/get_class_dev $RPM_BUILD_ROOT%{_bindir}/get_classdev_parent $RPM_BUILD_ROOT%{_bindir}/get_device $RPM_BUILD_ROOT%{_bindir}/get_driver $RPM_BUILD_ROOT%{_bindir}/testlibsysfs $RPM_BUILD_ROOT%{_bindir}/write_attr | ||||
| rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la  | ||||
| 
 | ||||
| %post -n libsysfs -p /sbin/ldconfig | ||||
| 
 | ||||
| %postun -n libsysfs -p /sbin/ldconfig | ||||
| 
 | ||||
| %clean | ||||
| rm -rf $RPM_BUILD_ROOT | ||||
| %ldconfig_scriptlets -n libsysfs | ||||
| 
 | ||||
| %files | ||||
| %defattr(-,root,root) | ||||
| %license COPYING cmd/GPL | ||||
| %doc AUTHORS README CREDITS docs/libsysfs.txt | ||||
| %{_bindir}/systool | ||||
| %{_bindir}/get_module | ||||
| %{_mandir}/man1/systool.1.gz | ||||
| %doc COPYING AUTHORS README NEWS CREDITS ChangeLog docs/libsysfs.txt cmd/GPL | ||||
| 
 | ||||
| %files -n libsysfs | ||||
| %defattr(-,root,root) | ||||
| /%{_libdir}/libsysfs.so.* | ||||
| %doc COPYING AUTHORS README NEWS CREDITS ChangeLog docs/libsysfs.txt lib/LGPL | ||||
| %license COPYING lib/LGPL | ||||
| /%{_libdir}/libsysfs.so.%{so_major_version} | ||||
| /%{_libdir}/libsysfs.so.%{so_major_version}.%{so_minor_version}.%{so_patch_version} | ||||
| 
 | ||||
| %files -n libsysfs-devel | ||||
| %defattr(-,root,root) | ||||
| %dir %{_includedir}/sysfs | ||||
| %{_includedir}/sysfs/libsysfs.h | ||||
| %{_includedir}/sysfs/dlist.h | ||||
| /%{_libdir}/libsysfs.so | ||||
| /%{_libdir}/pkgconfig/libsysfs.pc | ||||
| 
 | ||||
| 
 | ||||
| %changelog | ||||
| * Thu Jan 27 2021 Chris White <chwhite@redhat.com> 2.1.0-24 | ||||
| - Rebuilt for 8.6. Resolves: rhbz#2046426  | ||||
| * Tue Apr 22 2025 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.1.1-11 | ||||
| - Fix erroneous my_strncat implementation | ||||
|   Resolves: RHEL-83777 | ||||
| 
 | ||||
| * Mon Oct 22 2018 Neil Horman <nhorman@redhat.com> 2.1.0-24 | ||||
| - Fix annocheck build issues (bz 1630632) | ||||
| * Wed Jan 26 2022 Chris White <chwhite@redhat.com> - 2.1.1-10 | ||||
| - Rebuilding for RHEL9. Resolves rhbz#2043148 | ||||
| 
 | ||||
| * Mon Aug 23 2021 Chris White <chwhite@redhat.com> - 2.1.1- | ||||
| - Fixed tier0 test build process to work with 2.1.1. Resolves: rhbz#1975886 | ||||
| 
 | ||||
| * Mon Aug 16 2021 Chris White <chwhite@redhat.com> - 2.1.1-8 | ||||
| - Renamed tests/tests.yaml to tests/test.yml. Resolves: rhbz#1975886 | ||||
| 
 | ||||
| * Mon Aug 16 2021 Chris White <chwhite@redhat.com> - 2.1.1-7 | ||||
| - Rebuilt with tier0 test cases. Resolves: rhbz#1975886 | ||||
| 
 | ||||
| * Thu Aug 12 2021 Chris White <chwhite@redhat.com> - 2.1.1-6 | ||||
| - Rebuilt off of current upstream. Resolves: rhbz#1938880 | ||||
| 
 | ||||
| * Tue Aug 10 2021 Chris White <chwhite@redhat.com> - 2.1.1-5 | ||||
| - Renamed the gating.yml to gating.yaml Related: rhbz#1975886 | ||||
| 
 | ||||
| * Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 2.1.1-4 | ||||
| - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags | ||||
|   Related: rhbz#1991688 | ||||
| 
 | ||||
| * Fri Aug 6 2021 Chris White <chwhite@redhat.com> - 2.1.1-3 | ||||
| - Rebuilt for c9s and gating test. Related: rhbz#1953419 | ||||
| 
 | ||||
| * Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2.1.1-2 | ||||
| - Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 | ||||
| 
 | ||||
| * Sat Feb 20 2021 Christopher Engelhard <ce@lcts.de> - 2.1.1-1 | ||||
| - Update to 2.1.1 | ||||
| - Remove all patches merged upstream | ||||
| - Switched build to autotools | ||||
| - Include upstream pkgconfig module | ||||
| - Sysfsutils no longer includes /usr/bin/get_module | ||||
| 
 | ||||
| * Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-33 | ||||
| - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild | ||||
| 
 | ||||
| * Mon Sep 21 2020 Christopher Engelhard <ce@lcts.de> - 2.1.0-32 | ||||
| - fix GCC-11 build failure due to buffer overread, h/t Jeff Law | ||||
| 
 | ||||
| * Mon Aug 17 2020 Christopher Engelhard <ce@lcts.de> - 2.1.0-31 | ||||
| - use tarball hosted at new upstream site | ||||
| - Fedora's patches have been merged upstream, so use those instead | ||||
| - apply various unreleased upstream fixes that deal with compiler warnings | ||||
| 
 | ||||
| * Wed Jul 29 2020 Christopher Engelhard <ce@lcts.de> - 2.1.0-30 | ||||
| - specify .so and release versions via global vars | ||||
| - update URL to reflect new upstream | ||||
| 
 | ||||
| * Tue Jun 23 2020 Christopher Engelhard <ce@lcts.de> - 2.1.0-29 | ||||
| - list .so files explicitly in %%files instead of via glob, cleanup spec | ||||
| 
 | ||||
| * Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-28 | ||||
| - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild | ||||
| 
 | ||||
| * Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-27 | ||||
| - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild | ||||
| 
 | ||||
| * Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-26 | ||||
| - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild | ||||
| 
 | ||||
| * Sun Jul 22 2018 Peter Robinson <pbrobinson@fedoraproject.org> 2.1.0-25 | ||||
| - Fix build deps, use %%License, cleanup spec | ||||
| 
 | ||||
| * Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-24 | ||||
| - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild | ||||
| 
 | ||||
| * Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-23 | ||||
| - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild | ||||
| @ -136,7 +192,7 @@ rm -rf $RPM_BUILD_ROOT | ||||
| - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild | ||||
| 
 | ||||
| * Thu Jun 17 2010 Anton Arapov <anton@redhat.com> - 2.1.0-8 | ||||
| - Move libraries from /usr/lib to /lib since we need them  | ||||
| - Move libraries from /usr/lib to /lib since we need them | ||||
|   during the system boot. (#605546) | ||||
| 
 | ||||
| * Mon Jan 18 2010 Anton Arapov <anton@redhat.com> - 2.1.0-7 | ||||
| @ -1,6 +0,0 @@ | ||||
| --- !Policy | ||||
| product_versions: | ||||
|   - rhel-8 | ||||
| decision_context: osci_compose_gate | ||||
| rules: | ||||
|   - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} | ||||
							
								
								
									
										1
									
								
								sources
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								sources
									
									
									
									
									
								
							| @ -1 +0,0 @@ | ||||
| SHA512 (sysfsutils-2.1.0.tar.gz) = 485902d98b41a69343cb037883d0c0a1de8a1a4aed657cd4528fe10bc845ac51629657dff01deef042e57c9bd9243095e23fc931d06d74db31b03c5f0a18cf07 | ||||
| @ -1,12 +0,0 @@ | ||||
| diff -puN lib/sysfs_class.c~sysfsutils_class_dup lib/sysfs_class.c
 | ||||
| --- sysfsutils-2.1.0/lib/sysfs_class.c~sysfsutils_class_dup	2006-09-07 17:01:26.000000000 -0500
 | ||||
| +++ sysfsutils-2.1.0-bjking1/lib/sysfs_class.c	2006-09-07 17:01:26.000000000 -0500
 | ||||
| @@ -66,7 +66,7 @@ static int cdev_name_equal(void *a, void
 | ||||
|  		return 0; | ||||
|   | ||||
|  	if (strncmp((char *)a, ((struct sysfs_class_device *)b)->name, | ||||
| -				strlen((char *)a)) == 0)
 | ||||
| +				SYSFS_NAME_LEN) == 0)
 | ||||
|  		return 1; | ||||
|   | ||||
|  	return 0; | ||||
| @ -1,19 +0,0 @@ | ||||
| diff -Nurp sysfsutils-1.2.0.bak/COPYING sysfsutils-1.2.0/COPYING
 | ||||
| --- sysfsutils-1.2.0.bak/COPYING	2004-09-13 08:45:15.000000000 -0500
 | ||||
| +++ sysfsutils-1.2.0/COPYING	2004-10-11 13:05:00.483795976 -0500
 | ||||
| @@ -1,11 +1,10 @@
 | ||||
|   | ||||
| -The commands and utilities under the "test" directory are licensed under the 
 | ||||
| -GNU General Public License (GPL) Version 2, June 1991. The full text of the 
 | ||||
| -GPL is located at:
 | ||||
| +The commands and utilities are licensed under the GNU General Public License
 | ||||
| +(GPL) Version 2, June 1991. The full text of the GPL is located at:
 | ||||
|   | ||||
| -sysfsutils/cmd/GPL
 | ||||
| +/usr/share/doc/sysfsutils-{version}/GPL
 | ||||
|   | ||||
|  The sysfs library is licensed under the GNU Lesser Public License (LGPL) | ||||
|  Version 2.1, February 1999. The full text of the LGPL is located at: | ||||
|   | ||||
| -sysfsutils/lib/LGPL
 | ||||
| +/usr/share/doc/sysfsutils-{version}/LGPL
 | ||||
| @ -1,164 +0,0 @@ | ||||
| diff -upr sysfsutils-2.1.0-old/lib/sysfs_utils.c sysfsutils-2.1.0/lib/sysfs_utils.c
 | ||||
| --- sysfsutils-2.1.0-old/lib/sysfs_utils.c	2006-08-07 07:08:01.000000000 +0200
 | ||||
| +++ sysfsutils-2.1.0/lib/sysfs_utils.c	2008-05-13 07:42:50.000000000 +0200
 | ||||
| @@ -117,84 +117,104 @@ int sysfs_get_link(const char *path, cha
 | ||||
|  { | ||||
|  	char devdir[SYSFS_PATH_MAX]; | ||||
|  	char linkpath[SYSFS_PATH_MAX]; | ||||
| -	char temp_path[SYSFS_PATH_MAX];
 | ||||
| -	char *d = NULL, *s = NULL;
 | ||||
| -	int slashes = 0, count = 0;
 | ||||
| +	char *d, *s;
 | ||||
| +	int count;
 | ||||
|   | ||||
|  	if (!path || !target || len == 0) { | ||||
|  		errno = EINVAL; | ||||
|  		return -1; | ||||
|  	} | ||||
|   | ||||
| -	memset(devdir, 0, SYSFS_PATH_MAX);
 | ||||
| -	memset(linkpath, 0, SYSFS_PATH_MAX);
 | ||||
| -	memset(temp_path, 0, SYSFS_PATH_MAX);
 | ||||
| -	safestrcpy(devdir, path);
 | ||||
| -
 | ||||
| -	if ((readlink(path, linkpath, SYSFS_PATH_MAX)) < 0) {
 | ||||
| +	count = readlink(path, linkpath, SYSFS_PATH_MAX);
 | ||||
| +	if (count < 0)
 | ||||
|  		return -1; | ||||
| -	}
 | ||||
| -	d = linkpath;
 | ||||
| +	else
 | ||||
| +		linkpath[count] = '\0';
 | ||||
|  	/* | ||||
|  	 * Three cases here: | ||||
|  	 * 1. relative path => format ../.. | ||||
|  	 * 2. absolute path => format /abcd/efgh | ||||
|  	 * 3. relative path _from_ this dir => format abcd/efgh | ||||
|  	 */ | ||||
| -	switch (*d) {
 | ||||
| -		case '.':
 | ||||
| +	if (*linkpath == '/') {
 | ||||
| +		/* absolute path - copy as is */
 | ||||
| +		safestrcpymax(target, linkpath, len);
 | ||||
| +		return 0;
 | ||||
| +	}
 | ||||
| +
 | ||||
| +	safestrcpy(devdir, path);
 | ||||
| +	s = strrchr(devdir, '/');
 | ||||
| +	if (s == NULL)
 | ||||
| +		s = devdir - 1;
 | ||||
| +	d = linkpath;
 | ||||
| +	while (*d == '.') {
 | ||||
| +		if (*(d+1) == '/') {
 | ||||
|  			/* | ||||
|  			 * handle the case where link is of type ./abcd/xxx | ||||
|  			 */ | ||||
| -			safestrcpy(temp_path, devdir);
 | ||||
| -			if (*(d+1) == '/')
 | ||||
| -				d += 2;
 | ||||
| -			else if (*(d+1) == '.')
 | ||||
| -				goto parse_path;
 | ||||
| -			s = strrchr(temp_path, '/');
 | ||||
| -			if (s != NULL) {
 | ||||
| -				*(s+1) = '\0';
 | ||||
| -				safestrcat(temp_path, d);
 | ||||
| -			} else {
 | ||||
| -				safestrcpy(temp_path, d);
 | ||||
| -			}
 | ||||
| -			safestrcpymax(target, temp_path, len);
 | ||||
| -			break;
 | ||||
| +			d += 2;
 | ||||
| +			while (*d == '/')
 | ||||
| +				d++;
 | ||||
| +			continue;
 | ||||
| +		} else if (*(d+1) != '.' || *(d+2) != '/')
 | ||||
|  			/* | ||||
| -			 * relative path, getting rid of leading "../.."
 | ||||
| +			 * relative path from this directory, starting
 | ||||
| +			 * with a hidden directory
 | ||||
|  			 */ | ||||
| -parse_path:
 | ||||
| -			while (*d == '/' || *d == '.') {
 | ||||
| -				if (*d == '/')
 | ||||
| -					slashes++;
 | ||||
| -				d++;
 | ||||
| -			}
 | ||||
| -			d--;
 | ||||
| -			s = &devdir[strlen(devdir)-1];
 | ||||
| -			while (s != NULL && count != (slashes+1)) {
 | ||||
| +			break;
 | ||||
| +
 | ||||
| +		/*
 | ||||
| +		 * relative path, getting rid of leading "../.."; must
 | ||||
| +		 * be careful here since any path component of devdir
 | ||||
| +		 * could be a symlink again
 | ||||
| +		 */
 | ||||
| +		for (;;) {
 | ||||
| +			while (s > devdir && *s == '/') {
 | ||||
|  				s--; | ||||
| -				if (*s == '/')
 | ||||
| -					count++;
 | ||||
| +				if (*s == '.'
 | ||||
| +				    && (s == devdir || *(s-1) == '/'))
 | ||||
| +					s--;
 | ||||
|  			} | ||||
| -			safestrcpymax(s, d, (SYSFS_PATH_MAX-strlen(devdir)));
 | ||||
| -			safestrcpymax(target, devdir, len);
 | ||||
| -			break;
 | ||||
| -		case '/':
 | ||||
| -			/* absolute path - copy as is */
 | ||||
| -			safestrcpymax(target, linkpath, len);
 | ||||
| -			break;
 | ||||
| -		default:
 | ||||
| -			/* relative path from this directory */
 | ||||
| -			safestrcpy(temp_path, devdir);
 | ||||
| -			s = strrchr(temp_path, '/');
 | ||||
| -			if (s != NULL) {
 | ||||
| -				*(s+1) = '\0';
 | ||||
| -				safestrcat(temp_path, linkpath);
 | ||||
| -			} else {
 | ||||
| -				safestrcpy(temp_path, linkpath);
 | ||||
| +			*(s+1) = '\0';
 | ||||
| +			if (*devdir == '\0' || sysfs_path_is_link(devdir))
 | ||||
| +				/*
 | ||||
| +				 * condition will be true eventually
 | ||||
| +				 * because we already know that all
 | ||||
| +				 * but the last component of path
 | ||||
| +				 * resolve to a directory
 | ||||
| +				 */
 | ||||
| +				break;
 | ||||
| +			if (sysfs_get_link(devdir, devdir, SYSFS_PATH_MAX))
 | ||||
| +				return -1;
 | ||||
| +			s = devdir + strlen(devdir) - 1;
 | ||||
| +		}
 | ||||
| +		while (s >= devdir) {
 | ||||
| +			if (*s == '/') {
 | ||||
| +				if (*(s+1) != '.' || *(s+2) != '.'
 | ||||
| +				    || *(s+3) != '\0') {
 | ||||
| +					d += 3;
 | ||||
| +					while (*d == '/')
 | ||||
| +						d++;
 | ||||
| +				} else
 | ||||
| +					s += 2;
 | ||||
| +				break;
 | ||||
|  			} | ||||
| -			safestrcpymax(target, temp_path, len);
 | ||||
| +			s--;
 | ||||
| +		}
 | ||||
| +		if (s < devdir || *(s+1) == '\0')
 | ||||
| +			break;
 | ||||
|  	} | ||||
| +
 | ||||
| +	/*
 | ||||
| +	 * appending to devdir a slash and the (possibly shortened)
 | ||||
| +	 * relative path to the link source
 | ||||
| +	 */
 | ||||
| +	s++;
 | ||||
| +	if (s > devdir && *s == '\0')
 | ||||
| +		*s++ = '/';
 | ||||
| +	*s = '\0';
 | ||||
| +	safestrcpymax(s, d, SYSFS_PATH_MAX-(s-devdir));
 | ||||
| +	safestrcpymax(target, devdir, len);
 | ||||
|  	return 0; | ||||
|  } | ||||
|   | ||||
| @ -1,12 +0,0 @@ | ||||
| diff -urpN sysfsutils-2.1.0.orig/systool.1 sysfsutils-2.1.0/systool.1
 | ||||
| --- sysfsutils-2.1.0.orig/systool.1	2011-03-22 18:15:40.775891943 +0100
 | ||||
| +++ sysfsutils-2.1.0/systool.1	2011-03-22 18:16:05.158970786 +0100
 | ||||
| @@ -14,7 +14,7 @@ classes, and root devices.
 | ||||
|  .P | ||||
|  When | ||||
|  .I device | ||||
| -is supplied, the information reqested by
 | ||||
| +is supplied, the information requested by
 | ||||
|  .I options | ||||
|  is shown only for the specified device, otherwise all present devices | ||||
|  are displayed. | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Loading…
	
		Reference in New Issue
	
	Block a user