diff options
author | Pete Travis <immanetize@fedoraproject.org> | 2014-10-01 11:54:54 -0600 |
---|---|---|
committer | Pete Travis <immanetize@fedoraproject.org> | 2014-10-01 11:54:54 -0600 |
commit | b7fb238e0ec327db793aefa670ffedb8cbd63f0b (patch) | |
tree | d795a1fa84fedd491d912cd97c26d80ec523c1fa /SOURCES/bash-2.05a-security.patch | |
parent | 08b01b8f3f227bda87ee2591c7e6ccb379fad187 (diff) | |
download | rpmbuild-sles11.1-bash.tar.gz rpmbuild-sles11.1-bash.tar.xz rpmbuild-sles11.1-bash.zip |
starting bash bracnch for sles 11.1sles11.1-bash
Diffstat (limited to 'SOURCES/bash-2.05a-security.patch')
-rw-r--r-- | SOURCES/bash-2.05a-security.patch | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/SOURCES/bash-2.05a-security.patch b/SOURCES/bash-2.05a-security.patch new file mode 100644 index 0000000..86af623 --- /dev/null +++ b/SOURCES/bash-2.05a-security.patch @@ -0,0 +1,69 @@ +--- variables.c ++++ variables.c Wed Aug 21 12:14:18 2002 +@@ -1035,6 +1035,7 @@ + return v; + } + ++#if !defined(linux) + /* The random number seed. You can change this by setting RANDOM. */ + static unsigned long rseed = 1; + static int last_random_value; +@@ -1060,6 +1061,21 @@ + last_random_value = 0; + } + ++#else ++ ++static int last_sbrand_pid; ++ ++static int brand () ++{ ++ return random() & 32767; ++} ++ ++static void sbrand (unsigned long seed) ++{ ++ srandom(seed); ++} ++#endif ++ + static SHELL_VAR * + assign_random (self, value, unused) + SHELL_VAR *self; +@@ -1075,6 +1091,7 @@ + { + int rv; + ++#if !defined(linux) + /* Reset for command and process substitution. */ + if (subshell_environment) + sbrand (rseed + getpid() + NOW); +@@ -1082,6 +1099,18 @@ + do + rv = brand (); + while (rv == last_random_value); ++#else ++ if (subshell_environment) ++ { ++ int mypid = getpid(); ++ if (mypid != last_sbrand_pid) ++ { ++ last_sbrand_pid = mypid; ++ sbrand (mypid + NOW); ++ } ++ } ++ rv = brand(); ++#endif + return rv; + } + +@@ -1093,7 +1122,9 @@ + char *p; + + rv = get_random_number (); ++#if !defined(linux) + last_random_value = rv; ++#endif + p = itos (rv); + + FREE (value_cell (var)); |