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 299972 Details for
Bug 440143
[PATCH] NMDispatcher: ignore cruft
[?]
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 ignore backup/packaging cruft
diff (text/plain), 1.51 KB, created by
Bill Nottingham
on 2008-04-01 21:37:43 UTC
(
hide
)
Description:
patch to ignore backup/packaging cruft
Filename:
MIME Type:
Creator:
Bill Nottingham
Created:
2008-04-01 21:37:43 UTC
Size:
1.51 KB
patch
obsolete
>diff -up NetworkManager-0.7.0/dispatcher-daemon/NetworkManagerDispatcher.c.foo NetworkManager-0.7.0/dispatcher-daemon/NetworkManagerDispatcher.c >--- NetworkManager-0.7.0/dispatcher-daemon/NetworkManagerDispatcher.c.foo 2008-04-01 14:19:36.000000000 -0400 >+++ NetworkManager-0.7.0/dispatcher-daemon/NetworkManagerDispatcher.c 2008-04-01 14:32:38.000000000 -0400 >@@ -74,6 +74,35 @@ nmd_permission_check (struct stat *s) > > > /* >+ * nmd_is_valid_filename >+ * >+ * Verify that the given script is a valid file name. Specifically, >+ * ensure that the file: >+ * - is not a editor backup file >+ * - is not a package management file >+ * - does not start with '.' >+ */ >+static inline gboolean >+nmd_is_valid_filename (const char *file_name) >+{ >+ char *bad_suffixes[] = { "~", ".rpmsave", ".rpmorig", ".rpmnew", NULL }; >+ char *tmp; >+ int i; >+ >+ if (file_name[0] == '.') >+ return FALSE; >+ for (i = 0; bad_suffixes[i]; i++) { >+ if (g_str_has_suffix(file_name, bad_suffixes[i])) >+ return FALSE; >+ } >+ tmp = g_strrstr(file_name, ".dpkg-"); >+ if (tmp && (tmp == strrchr(file_name,'.'))) >+ return FALSE; >+ return TRUE; >+} >+ >+ >+/* > * nmd_execute_scripts > * > * Call scripts in /etc/NetworkManager.d when devices go down or up >@@ -106,7 +132,7 @@ nmd_execute_scripts (NMDeviceState state > char *file_path = g_build_filename (NM_SCRIPT_DIR, file_name, NULL); > struct stat s; > >- if ((file_name[0] != '.') && (stat (file_path, &s) == 0)) >+ if (nmd_is_valid_filename(file_name) && (stat (file_path, &s) == 0)) > { > if (nmd_permission_check (&s)) > {
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 440143
: 299972