1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## 800-correct-perm2oct.dpatch by Eero Häkkinen <eero.hakkinen@nokia.com>
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: Fix perm2oct to correctly detect set-{user,group}-ID and sticky bits.
8 diff -urNad lintian-1.23.8~/checks/control-files lintian-1.23.8/checks/control-files
9 --- lintian-1.23.8~/checks/control-files 2006-07-18 12:12:55.000000000 +0000
10 +++ lintian-1.23.8/checks/control-files 2006-07-18 12:15:10.000000000 +0000
13 package Lintian::control_files;
23 -# translate permission strings like `-rwxrwxrwx' into an octal number
29 - $t =~ m/^.(.)(.)(.)(.)(.)(.)(.)(.)(.)/o;
31 - $o += 04000 if $3 eq 's'; # set-uid
32 - $o += 02000 if $6 eq 's'; # set-gid
33 - $o += 01000 if $9 eq 't'; # sticky bit
34 - $o += 00400 if $1 ne '-'; # owner read
35 - $o += 00200 if $2 ne '-'; # owner write
36 - $o += 00100 if $3 ne '-'; # owner execute
37 - $o += 00040 if $4 ne '-'; # owner read
38 - $o += 00020 if $5 ne '-'; # owner write
39 - $o += 00010 if $6 ne '-'; # owner execute
40 - $o += 00004 if $7 ne '-'; # owner read
41 - $o += 00002 if $8 ne '-'; # owner write
42 - $o += 00001 if $9 ne '-'; # owner execute
49 # vim: syntax=perl sw=4 ts=8
50 diff -urNad lintian-1.23.8~/checks/files lintian-1.23.8/checks/files
51 --- lintian-1.23.8~/checks/files 2006-07-18 12:14:48.000000000 +0000
52 +++ lintian-1.23.8/checks/files 2006-07-18 12:15:10.000000000 +0000
54 package Lintian::files;
65 -# translate permission strings like `-rwxrwxrwx' into an octal number
71 - $t =~ m/^.(.)(.)(.)(.)(.)(.)(.)(.)(.)/;
73 - $o += 04000 if $3 eq 's'; # set-uid
74 - $o += 02000 if $6 eq 's'; # set-gid
75 - $o += 01000 if $9 eq 't'; # sticky bit
76 - $o += 00400 if $1 ne '-'; # owner read
77 - $o += 00200 if $2 ne '-'; # owner write
78 - $o += 00100 if $3 ne '-'; # owner execute
79 - $o += 00040 if $4 ne '-'; # owner read
80 - $o += 00020 if $5 ne '-'; # owner write
81 - $o += 00010 if $6 ne '-'; # owner execute
82 - $o += 00004 if $7 ne '-'; # owner read
83 - $o += 00002 if $8 ne '-'; # owner write
84 - $o += 00001 if $9 ne '-'; # owner execute
91 # vim: syntax=perl ts=8 sw=4
92 diff -urNad lintian-1.23.8~/checks/menus lintian-1.23.8/checks/menus
93 --- lintian-1.23.8~/checks/menus 2006-07-18 12:12:55.000000000 +0000
94 +++ lintian-1.23.8/checks/menus 2006-07-18 12:16:29.000000000 +0000
97 package Lintian::menus;
105 # -----------------------------------
107 -# translate permission strings like `-rwxrwxrwx' into an octal number
113 - $t =~ /^.(.)(.)(.)(.)(.)(.)(.)(.)(.)/o;
115 - $o += 04000 if $3 eq 's'; # set-uid
116 - $o += 02000 if $6 eq 's'; # set-gid
117 - $o += 01000 if $9 eq 't'; # sticky bit
118 - $o += 00400 if $1 ne '-'; # owner read
119 - $o += 00200 if $2 ne '-'; # owner write
120 - $o += 00100 if $3 ne '-'; # owner execute
121 - $o += 00040 if $4 ne '-'; # owner read
122 - $o += 00020 if $5 ne '-'; # owner write
123 - $o += 00010 if $6 ne '-'; # owner execute
124 - $o += 00004 if $7 ne '-'; # owner read
125 - $o += 00002 if $8 ne '-'; # owner write
126 - $o += 00001 if $9 ne '-'; # owner execute
132 my ($script,$pres) = @_;
133 my ($no_check_menu,$no_check_installdocs,$no_check_wmmenu,$calls_wmmenu);
134 diff -urNad lintian-1.23.8~/checks/shared-libs lintian-1.23.8/checks/shared-libs
135 --- lintian-1.23.8~/checks/shared-libs 2006-07-18 12:14:48.000000000 +0000
136 +++ lintian-1.23.8/checks/shared-libs 2006-07-18 12:15:10.000000000 +0000
139 package Lintian::shared_libs;
149 -# translate permission strings like `-rwxrwxrwx' into an octal number
155 - $t =~ m/^.(.)(.)(.)(.)(.)(.)(.)(.)(.)/o;
157 - $o += 04000 if $3 eq 's'; # set-uid
158 - $o += 02000 if $6 eq 's'; # set-gid
159 - $o += 01000 if $9 eq 't'; # sticky bit
160 - $o += 00400 if $1 ne '-'; # owner read
161 - $o += 00200 if $2 ne '-'; # owner write
162 - $o += 00100 if $3 ne '-'; # owner execute
163 - $o += 00040 if $4 ne '-'; # owner read
164 - $o += 00020 if $5 ne '-'; # owner write
165 - $o += 00010 if $6 ne '-'; # owner execute
166 - $o += 00004 if $7 ne '-'; # owner read
167 - $o += 00002 if $8 ne '-'; # owner write
168 - $o += 00001 if $9 ne '-'; # owner execute
173 # make /tmp/baz/baz.txt from /tmp/foo/../bar/../baz/baz.txt
176 diff -urNad lintian-1.23.8~/lib/PermModes.pm lintian-1.23.8/lib/PermModes.pm
177 --- lintian-1.23.8~/lib/PermModes.pm 1970-01-01 00:00:00.000000000 +0000
178 +++ lintian-1.23.8/lib/PermModes.pm 2006-07-18 12:15:10.000000000 +0000
180 +# Hey emacs! This is a -*- Perl -*- script!
181 +# PermModes -- Perl file permission mode functions for lintian
183 +# Copyright (C) 2006 Nokia Corporation.
185 +# This program is free software; you can redistribute it and/or modify
186 +# it under the terms of the GNU General Public License as published by
187 +# the Free Software Foundation; either version 2 of the License, or
188 +# (at your option) any later version.
190 +# This program is distributed in the hope that it will be useful,
191 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
192 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
193 +# GNU General Public License for more details.
195 +# You should have received a copy of the GNU General Public License
196 +# along with this program. If not, you can find it on the World Wide
197 +# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
198 +# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
199 +# MA 02110-1301, USA.
206 +our @ISA = qw( Exporter );
211 +# translate permission strings like `-rwxrwxrwx' into an octal number
214 + my @c = split "", shift, 11;
216 + $oct |= 04000 if $c[3] =~ /s/i; # set-user-ID
217 + $oct |= 02000 if $c[6] =~ /s/i; # set-group-ID
218 + $oct |= 01000 if $c[9] =~ /t/i; # sticky
219 + $oct |= 00400 if $c[1] eq 'r'; # user readable
220 + $oct |= 00200 if $c[2] eq 'w'; # user writable
221 + $oct |= 00100 if $c[3] =~ /[[:lower:]]/; # user executable
222 + $oct |= 00040 if $c[4] eq 'r'; # group readable
223 + $oct |= 00020 if $c[5] eq 'w'; # group writable
224 + $oct |= 00010 if $c[6] =~ /[[:lower:]]/; # group executable
225 + $oct |= 00004 if $c[7] eq 'r'; # world readable
226 + $oct |= 00002 if $c[8] eq 'w'; # world writable
227 + $oct |= 00001 if $c[9] =~ /[[:lower:]]/; # world executable