Package init

This commit is contained in:
overweight 2019-09-30 11:17:54 -04:00
commit c5dbfb97be
5 changed files with 104 additions and 0 deletions

BIN
symlinks-1.4.tar.gz Normal file

Binary file not shown.

25
symlinks-LICENSE.txt Normal file
View File

@ -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

View File

@ -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);
}

View File

@ -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;
}

55
symlinks.spec Executable file
View File

@ -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 <buildteam@openeuler.org> - 1.4-23
- Modify spec error information
Sat Sep 07 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.4-22
- Package init