commit c5dbfb97be007ea7ffa7c89c1c8fcade57ef00ef Author: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon Sep 30 11:17:54 2019 -0400 Package init diff --git a/symlinks-1.4.tar.gz b/symlinks-1.4.tar.gz new file mode 100644 index 0000000..8769528 Binary files /dev/null and b/symlinks-1.4.tar.gz differ diff --git a/symlinks-LICENSE.txt b/symlinks-LICENSE.txt new file mode 100644 index 0000000..ff9cb98 --- /dev/null +++ b/symlinks-LICENSE.txt @@ -0,0 +1,25 @@ +From: http://packages.debian.org/changelogs/pool/main/s/symlinks/symlinks_1.2-4.2/symlinks.copyright + +Copyright (c) Mark Lord, freely distributable + +License clarification as found in Debian Bug #273338: + +Hi, + +My "symlinks" utility pre-dates the "open source licensing" fad +by a number of years. Just to clarify, this is 100% freeware, +written entirely by myself. The intent is to use it to detect +missing/obsolete symlink targets on an installed distro, before +creating the "gold" (or "final") release discs. + +Use and distribute and modify as you (or anyone else) sees fit. +There have no formal restrictions or requirements whatsoever +regarding distribution of either binaries or source code, +whether modified or original. + +Cheers +-- +Mark Lord +Real-Time Remedies Inc. +mlord@pobox.com + diff --git a/symlinks-coverity-overrun-dynamic.patch b/symlinks-coverity-overrun-dynamic.patch new file mode 100644 index 0000000..e5f0b49 --- /dev/null +++ b/symlinks-coverity-overrun-dynamic.patch @@ -0,0 +1,12 @@ +diff -up symlinks-1.4/symlinks.c.coverity-overrun-dynamic symlinks-1.4/symlinks.c +--- symlinks-1.4/symlinks.c.coverity-overrun-dynamic 2011-05-20 14:10:25.682843723 +0100 ++++ symlinks-1.4/symlinks.c 2011-05-20 14:11:15.792920839 +0100 +@@ -44,7 +44,7 @@ static int substr (char *s, char *old, c + newlen = strlen(new); + + if (newlen > oldlen) { +- if ((tmp = malloc(strlen(s))) == NULL) { ++ if ((tmp = malloc(strlen(s)+1)) == NULL) { + fprintf(stderr, "no memory\n"); + exit (1); + } diff --git a/symlinks-coverity-readlink.patch b/symlinks-coverity-readlink.patch new file mode 100644 index 0000000..ce28ff8 --- /dev/null +++ b/symlinks-coverity-readlink.patch @@ -0,0 +1,12 @@ +diff -up symlinks-1.4/symlinks.c.coverity-readlink symlinks-1.4/symlinks.c +--- symlinks-1.4/symlinks.c.coverity-readlink 2009-10-09 15:03:55.000000000 +0100 ++++ symlinks-1.4/symlinks.c 2011-05-20 14:10:25.682843723 +0100 +@@ -160,7 +160,7 @@ static void fix_symlink (char *path, dev + struct stat stbuf, lstbuf; + int c, fix_abs = 0, fix_messy = 0, fix_long = 0; + +- if ((c = readlink(path, lpath, sizeof(lpath))) == -1) { ++ if ((c = readlink(path, lpath, sizeof(lpath)-1)) == -1) { + perror(path); + return; + } diff --git a/symlinks.spec b/symlinks.spec new file mode 100755 index 0000000..e3f7f2d --- /dev/null +++ b/symlinks.spec @@ -0,0 +1,55 @@ +Name: symlinks +Version: 1.4 +Release: 23 +Summary: Scan or change symbolic links +License: Copyright only +URL: http://ibiblio.org/pub/Linux/utils/file/ +Source0: http://ibiblio.org/pub/Linux/utils/file/%{name}-%{version}.tar.gz +Source1: symlinks-LICENSE.txt + +BuildRequires: gcc + +Patch1: symlinks-coverity-readlink.patch +Patch2: symlinks-coverity-overrun-dynamic.patch + +%description +Scans directories for symbolic links, and identifies dangling, +relative, absolute, messy, and other_fs links. Can optionally +change absolute links to relative within a given filesystem. + +%prep +%autosetup -p1 -n %{name}-%{version} +cp %{SOURCE1} . + +%build +%make_build CFLAGS="%{optflags} %{build_ldflags}" + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT%{_bindir} +mkdir -p $RPM_BUILD_ROOT%{_mandir}/man8 +install -m 755 symlinks $RPM_BUILD_ROOT%{_bindir} +install -m 644 symlinks.8 $RPM_BUILD_ROOT%{_mandir}/man8 + +%check + +%pre + +%preun + +%post + +%postun + +%files +%doc symlinks-LICENSE.txt +%{_bindir}/symlinks +%{_mandir}/man8/symlinks.8* + + +%changelog +* Sat Sep 21 2019 openEuler Buildteam - 1.4-23 +- Modify spec error information + + Sat Sep 07 2019 openEuler Buildteam - 1.4-22 +- Package init