Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 150259 Details for
Bug 221883
'hardlink -h' generates SEGFAULT
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch to fix segfault and actually implement -h flag.
hardlink-h.patch (text/plain), 4.13 KB, created by
Jarod Wilson
on 2007-03-16 17:34:45 UTC
(
hide
)
Description:
Patch to fix segfault and actually implement -h flag.
Filename:
MIME Type:
Creator:
Jarod Wilson
Created:
2007-03-16 17:34:45 UTC
Size:
4.13 KB
patch
obsolete
>? hardlink-h.patch >Index: hardlink.1 >=================================================================== >RCS file: /cvs/dist/rpms/kernel-utils/RHEL-4/hardlink.1,v >retrieving revision 1.1 >diff -u -r1.1 hardlink.1 >--- hardlink.1 2 May 2006 11:07:55 -0000 1.1 >+++ hardlink.1 16 Mar 2007 17:33:56 -0000 >@@ -3,7 +3,7 @@ > hardlink \- Consolidate duplicate files via hardlinks > .SH "SYNOPSIS" > .PP >-\fBhardlink\fP [\fB-c\fP] [\fB-n\fP] [\fB-v\fP] [\fB-h\fP] directory1 [ directory2 ... ] >+\fBhardlink\fP [\fB-c\fP] [\fB-n\fP] [\fB-v\fP] [\fB-vv\fP] [\fB-h\fP] directory1 [ directory2 ... ] > .SH "DESCRIPTION" > .PP > This manual page documents \fBhardlink\fP, a >@@ -27,13 +27,15 @@ > .IP "\fB-n\fP" 10 > Do not perform the consolidation; only print what would be changed. > .IP "\fB-v\fP" 10 >-Enable verbose logging. >+Print summary after hardlinking. >+.IP "\fB-vv\fP" 10 >+Print every hardlinked file and bytes saved. Also print summary after hardlinking. > .IP "\fB-h\fP" 10 > Show help. > .SH "AUTHOR" > .PP > \fBhardlink\fP was written by Jakub Jelinek <jakub@redhat.com>. > .PP >-Man page written by Brian Long <brilong@cisco.com>. >+Man page written by Brian Long. > .PP >-Man page updated by Jindrich Novy <jnovy@redhat.com>. >+Man page updated by Jindrich Novy <jnovy@redhat.com> >Index: hardlink.c >=================================================================== >RCS file: /cvs/dist/rpms/kernel-utils/RHEL-4/hardlink.c,v >retrieving revision 1.1 >diff -u -r1.1 hardlink.c >--- hardlink.c 9 Sep 2004 07:06:01 -0000 1.1 >+++ hardlink.c 16 Mar 2007 17:33:56 -0000 >@@ -17,7 +17,8 @@ > write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, > Boston, MA 02111-1307, USA. */ > >-/* Changes by Rémy Card to use constants and add option -n. */ >+/* Changes by Rémy Card to use constants and add option -n. */ >+/* Changes by Jindrich Novy to add option -h. */ > > #define _GNU_SOURCE > #include <sys/types.h> >@@ -94,9 +95,14 @@ > exit(i); > } > >-void usage(prog) >+void usage(char *prog) > { >- fprintf (stderr, "Usage: %s [-cnv] directories...\n", prog); >+ fprintf (stderr, "Usage: %s [-cnvh] directories...\n", prog); >+ fprintf (stderr, " -c When finding candidates for linking, compare only file contents.\n"); >+ fprintf (stderr, " -n Don't actually link anything, just report what would be done.\n"); >+ fprintf (stderr, " -v Print summary after hardlinking.\n"); >+ fprintf (stderr, " -vv Print every hardlinked file and bytes saved + summary.\n"); >+ fprintf (stderr, " -h Show help.\n"); > exit(255); > } > >@@ -122,7 +128,7 @@ > int fd, i; > f * fp, * fp2; > h * hp; >- char *p, *q; >+ char *p = NULL, *q; > char *n1, *n2; > int cksumsize = sizeof(buf); > unsigned int cksum; >@@ -175,7 +181,7 @@ > fprintf(stderr, "\r%*s\r", (int)strlen(name)+2, ""); > return; > } >- if (fp) { >+ if (fp && st.st_size > 0) { > p = mmap (NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0); > nmmap++; > if (p == (void *)-1) { >@@ -191,7 +197,7 @@ > st2.st_dev == st.st_dev) { > int fd2 = open (fp2->name, O_RDONLY); > if (fd2 < 0) continue; >- if (fstat (fd2, &st2) || !S_ISREG (st2.st_mode)) { >+ if (fstat (fd2, &st2) || !S_ISREG (st2.st_mode) || st2.st_size == 0) { > close (fd2); > continue; > } >@@ -289,7 +295,7 @@ > d * dp; > DIR *dh; > struct dirent *di; >- while ((ch = getopt (argc, argv, "cnv")) != -1) { >+ while ((ch = getopt (argc, argv, "cnvh")) != -1) { > switch (ch) { > case 'n': > no_link++; >@@ -300,6 +306,7 @@ > case 'c': > content_only++; > break; >+ case 'h': > default: > usage(argv[0]); > } >Index: kernel-utils.spec >=================================================================== >RCS file: /cvs/dist/rpms/kernel-utils/RHEL-4/kernel-utils.spec,v >retrieving revision 1.99 >diff -u -r1.99 kernel-utils.spec >--- kernel-utils.spec 16 Feb 2007 13:16:34 -0000 1.99 >+++ kernel-utils.spec 16 Mar 2007 17:33:56 -0000 >@@ -253,6 +253,9 @@ > > > %changelog >+* Fri Mar 16 2007 Jarod Wilson <jwilson@redhat.com> >+- Fix hardlink segfault (#221883) >+ > * Fri Feb 16 2007 Aristeu Rozanski <arozansk@redhat.com> > - don't use RPM tags on changelog >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 221883
:
145091
| 150259