File: privmode.diff

package info (click to toggle)
bash 4.3-11%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 37,652 kB
  • ctags: 18,453
  • sloc: ansic: 99,503; sh: 6,836; yacc: 5,032; perl: 4,227; makefile: 4,197; asm: 48; awk: 23; sed: 16
file content (19 lines) | stat: -rw-r--r-- 557 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# DP: XXX missing description
# DP: 
# DP: Comment from Chet Ramey <chet@nike.ins.cwru.edu>:
# DP: 
# DP: Nope.  This will allow setuid scripts if not called as `sh' and not 
# DP: called with the -p option.  I won't install this. 
 

--- a/shell.c
+++ b/shell.c
@@ -492,7 +492,7 @@
   if (dump_translatable_strings)
     read_but_dont_execute = 1;
 
-  if (running_setuid && privileged_mode == 0)
+  if (running_setuid && privileged_mode == 0 && act_like_sh == 0)
     disable_priv_mode ();
 
   /* Need to get the argument to a -c option processed in the