Accepting request 93711 from multimedia:libs

- open files with O_CLOEXEC, in order to avoid fd leaks 
  when calling applications fork() ..execve()...
  This patch does not cover the executable tools since
  it is not critical for them. (forwarded request 93708 from elvigia)

OBS-URL: https://build.opensuse.org/request/show/93711
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libvorbis?expand=0&rev=33
This commit is contained in:
Stephan Kulow 2011-11-28 11:54:27 +00:00 committed by Git OBS Bridge
commit 1a6f1a7ff7
3 changed files with 92 additions and 0 deletions

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Fri Nov 25 21:08:52 UTC 2011 - crrodriguez@opensuse.org
- open files with O_CLOEXEC, in order to avoid fd leaks
when calling applications fork() ..execve()...
This patch does not cover the executable tools since
it is not critical for them.
-------------------------------------------------------------------
Tue Nov 22 10:21:04 UTC 2011 - coolo@suse.com

View File

@ -39,6 +39,7 @@ Patch2: libvorbis-m4.dif
# PATCH-FIX-UPSTREAM libvorbis-pkgconfig.patch https://trac.xiph.org/ticket/1759 reddwarf@opensuse.org -- Use Requires/Libs.private to avoid overlinking
Patch10: libvorbis-pkgconfig.patch
Patch11: vorbis-fix-linking.patch
Patch12: vorbis-ocloexec.patch
BuildRequires: libogg-devel
BuildRequires: fdupes libtool pkgconfig
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -141,6 +142,7 @@ if [ "%{_lib}" == "lib64" ]; then
%patch1
fi
%patch11
%patch12
%build
autoreconf -fiv

82
vorbis-ocloexec.patch Normal file
View File

@ -0,0 +1,82 @@
--- lib/analysis.c.orig
+++ lib/analysis.c
@@ -73,7 +73,7 @@ void _analysis_output_always(char *base,
char buffer[80];
sprintf(buffer,"%s_%d.m",base,i);
- of=fopen(buffer,"w");
+ of=fopen(buffer,"we");
if(!of)perror("failed to open data dump file");
--- lib/floor1.c.orig
+++ lib/floor1.c
@@ -899,7 +899,7 @@ int floor1_encode(oggpack_buffer *opb,vo
char buffer[80];
sprintf(buffer,"line_%dx%ld_class%d.vqd",
vb->pcmend/2,posts-2,class);
- of=fopen(buffer,"a");
+ of=fopen(buffer,"ae");
fprintf(of,"%d\n",cval);
fclose(of);
}
@@ -923,7 +923,7 @@ int floor1_encode(oggpack_buffer *opb,vo
char buffer[80];
sprintf(buffer,"line_%dx%ld_%dsub%d.vqd",
vb->pcmend/2,posts-2,class,bookas[k]);
- of=fopen(buffer,"a");
+ of=fopen(buffer,"ae");
fprintf(of,"%d\n",out[j+k]);
fclose(of);
}
--- lib/psytune.c.orig
+++ lib/psytune.c
@@ -202,7 +202,7 @@ void analysis(char *base,int i,float *v,
FILE *of;
char buffer[80];
sprintf(buffer,"%s_%d.m",base,i);
- of=fopen(buffer,"w");
+ of=fopen(buffer,"we");
for(j=0;j<n;j++){
if(dB && v[j]==0)
--- lib/res0.c.orig
+++ lib/res0.c
@@ -93,7 +93,7 @@ void res0_free_look(vorbis_look_residue
/* long and short into the same bucket by current convention */
sprintf(buffer,"res_sub%d_part%d_pass%d.vqd",look->submap,j,k);
- of=fopen(buffer,"a");
+ of=fopen(buffer,"ae");
for(l=0;l<statebook->entries;l++)
fprintf(of,"%d:%ld\n",l,look->training_data[k][j][l]);
@@ -462,7 +462,7 @@ static long **_01class(vorbis_block *vb,
for(i=0;i<ch;i++){
sprintf(buffer,"resaux_%d.vqd",look->train_seq);
- of=fopen(buffer,"a");
+ of=fopen(buffer,"ae");
for(j=0;j<partvals;j++)
fprintf(of,"%ld, ",partword[i][j]);
fprintf(of,"\n");
@@ -521,7 +521,7 @@ static long **_2class(vorbis_block *vb,v
#ifdef TRAIN_RESAUX
sprintf(buffer,"resaux_%d.vqd",look->train_seq);
- of=fopen(buffer,"a");
+ of=fopen(buffer,"ae");
for(i=0;i<partvals;i++)
fprintf(of,"%ld, ",partword[0][i]);
fprintf(of,"\n");
--- lib/vorbisfile.c.orig
+++ lib/vorbisfile.c
@@ -1010,7 +1010,7 @@ int ov_open(FILE *f,OggVorbis_File *vf,c
int ov_fopen(const char *path,OggVorbis_File *vf){
int ret;
- FILE *f = fopen(path,"rb");
+ FILE *f = fopen(path,"rbe");
if(!f) return -1;
ret = ov_open(f,vf,NULL,0);