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 306138 Details for
Bug 447410
'install' consumes all system memory
[?]
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 call matchpathcon_init_prefix just once and free memory afterwards
coreutils-6.11-matchpathconinstall.patch (text/plain), 2.58 KB, created by
Ondrej Vasik
on 2008-05-20 15:04:55 UTC
(
hide
)
Description:
Patch to call matchpathcon_init_prefix just once and free memory afterwards
Filename:
MIME Type:
Creator:
Ondrej Vasik
Created:
2008-05-20 15:04:55 UTC
Size:
2.58 KB
patch
obsolete
>diff -urNp coreutils-6.11-orig/src/install.c coreutils-6.11/src/install.c >--- coreutils-6.11-orig/src/install.c 2008-05-20 16:08:03.000000000 +0200 >+++ coreutils-6.11/src/install.c 2008-05-20 16:12:27.000000000 +0200 >@@ -85,6 +85,7 @@ static bool install_file_in_dir (const c > const struct cp_options *x); > static bool install_file_in_file (const char *from, const char *to, > const struct cp_options *x); >+static void set_prefix (const char* from_dir, const char* to_dir); > static void get_ids (void); > static void strip (char const *name); > static void announce_mkdir (char const *dir, void *options); >@@ -200,25 +201,25 @@ cp_option_init (struct cp_options *x) > x->src_info = NULL; > } > >-/* Modify file context to match the specified policy. >- If an error occurs the file will remain with the default directory >- context. */ >-static void >-setdefaultfilecon (char const *file) >+static void >+set_prefix (char const *from_dir, char const *to_dir) > { >+ const char *from_base = last_component (from_dir); >+ char *file = file_name_concat (to_dir, from_base, NULL); > struct stat st; >- security_context_t scontext = NULL; >+ > if (selinux_enabled != 1) > { > /* Indicate no context found. */ > return; > } >+ > if (lstat (file, &st) != 0) > return; > > if (IS_ABSOLUTE_FILE_NAME (file)) > { >- /* Calling matchpathcon_init_prefix (NULL, "/first_component/") >+ /* Calling matchpathcon_init_prefix (NULL, "/first_component/") > is an optimization to minimize the expense of the following > matchpathcon call. */ > char const *p0; >@@ -248,6 +249,26 @@ setdefaultfilecon (char const *file) > } > } > >+ return; >+} >+ >+/* Modify file context to match the specified policy. >+ If an error occurs the file will remain with the default directory >+ context. */ >+static void >+setdefaultfilecon (char const *file) >+{ >+ struct stat st; >+ security_context_t scontext = NULL; >+ return; >+ if (selinux_enabled != 1) >+ { >+ /* Indicate no context found. */ >+ return; >+ } >+ if (lstat (file, &st) != 0) >+ return; >+ > /* If there's an error determining the context, or it has none, > return to allow default context */ > if ((matchpathcon (file, st.st_mode, &scontext) != 0) || >@@ -526,9 +547,13 @@ main (int argc, char **argv) > { > int i; > dest_info_init (&x); >- for (i = 0; i < n_files; i++) >+ set_prefix (file[0], target_directory); >+ for (i = 0; i < n_files; i++) { > if (! install_file_in_dir (file[i], target_directory, &x)) > exit_status = EXIT_FAILURE; >+ } >+ if (selinux_enabled) >+ matchpathcon_fini(); > } > } >
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 447410
: 306138