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 186241 Details for
Bug 270741
/sbin/kmodule ignores extra modules.
[?]
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]
different patch
kudzu.diff (text/plain), 1.82 KB, created by
Bill Nottingham
on 2007-09-04 15:03:55 UTC
(
hide
)
Description:
different patch
Filename:
MIME Type:
Creator:
Bill Nottingham
Created:
2007-09-04 15:03:55 UTC
Size:
1.82 KB
patch
obsolete
>Index: kmodule.c >=================================================================== >RCS file: /usr/local/CVS/initscripts/src/kmodule.c,v >retrieving revision 1.1.4.2 >diff -u -r1.1.4.2 kmodule.c >--- kmodule.c 7 Dec 2004 16:01:48 -0000 1.1.4.2 >+++ kmodule.c 4 Sep 2007 14:51:42 -0000 >@@ -10,7 +10,7 @@ > */ > > #include <ctype.h> >-#include <ftw.h> >+#include <fcntl.h> > #include <stdio.h> > #include <stdlib.h> > #include <string.h> >@@ -19,35 +19,38 @@ > > #include <popt.h> > >+#include <sys/mman.h> > #include <sys/utsname.h> > > #include <kudzu/kudzu.h> > > >-/* HACK. This is so not thread-safe. */ >-static char mod_name[100], cmod_name[100]; >- >-static int isModule(const char *filename, const struct stat *sb, int flag) { >- char *fname = basename(filename); >- if ((!strcmp(fname,mod_name) || !strcmp(fname,cmod_name))) { >- return 1; >- } >- return 0; >-} >- >- > int isAvailable(char *modulename) > { > struct utsname utsbuf; >- char path[512]; >+ struct stat sbuf; >+ char path[512], mod_name[100]; >+ char *buf; >+ int fd; > >- uname(&utsbuf); >- snprintf(mod_name,100,"%s.ko",modulename); >- snprintf(cmod_name,100,"%s.ko.gz",modulename); >- snprintf(path,512,"/lib/modules/%s/kernel",utsbuf.release); >- /* Do not set the third argument of this function to < 6. Blarg. */ >- if (ftw(path,isModule,15) == 1) { >- return 1; >+ snprintf(path,512,"/lib/modules/%s/modules.dep",utsbuf.release); >+ if (!stat(path,&sbuf)) { >+ fd = open(path, O_RDONLY); >+ buf = mmap(0, sbuf.st_size, PROT_READ, MAP_SHARED, fd, 0); >+ if (!buf || buf == MAP_FAILED) >+ return 0; >+ close(fd); >+ snprintf(mod_name,100,"/%s.ko:", modulename); >+ if (strstr(buf, mod_name)) { >+ munmap(buf, sbuf.st_size); >+ return 1; >+ } >+ snprintf(mod_name,100,"/%s.ko.gz:", modulename); >+ if (strstr(buf, mod_name)) { >+ munmap(buf, sbuf.st_size); >+ return 1; >+ } >+ munmap(buf,sbuf.st_size); > } > return 0; > }
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 270741
:
183041
| 186241 |
187261