Initialize Tizen 2.3
[external/bash.git] / debian / patches / privmode.dpatch
1 #! /bin/sh -e
2
3 if [ $# -eq 3 -a "$2" = '-d' ]; then
4     pdir="-d $3"
5 elif [ $# -ne 1 ]; then
6     echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
7     exit 1
8 fi
9 case "$1" in
10     -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;;
11     -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;;
12     *)
13         echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
14         exit 1
15 esac
16 exit 0
17
18 # DP: XXX missing description
19 # DP: 
20 # DP: Comment from Chet Ramey <chet@nike.ins.cwru.edu>:
21 # DP: 
22 # DP: Nope.  This will allow setuid scripts if not called as `sh' and not 
23 # DP: called with the -p option.  I won't install this. 
24  
25
26 diff -urb bash.orig/shell.c bash/shell.c
27 --- bash.orig/shell.c   2003-06-03 19:50:35.000000000 +0200
28 +++ bash/shell.c        2003-09-28 00:26:28.000000000 +0200
29 @@ -447,7 +447,7 @@
30    if (dump_translatable_strings)
31      read_but_dont_execute = 1;
32  
33 -  if (running_setuid && privileged_mode == 0)
34 +  if (running_setuid && privileged_mode == 0 && act_like_sh == 0)
35      disable_priv_mode ();
36  
37    /* Need to get the argument to a -c option processed in the