Mail Archives: pgcc/1998/10/05/19:41:07
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime AT docserver DOT cac DOT washington DOT edu for more info.
--655616-418841772-907615696=:21568
Content-Type: TEXT/PLAIN; charset=US-ASCII
I believe I have found a bug present in all gcc 2.7.2.3, gcc 2.8.1, egcs 1.1,
pgcc 1.1, egcs and pgcc 19980921 - gcc seems to assume a result of an if
command is false a bit too early.
The sample file is taken from BeroFTPD 1.1.12 (old) and 1.1.13 (new).
While both procedures do exactly the same, the old one fails, the new one
works (by splitting an if in two parts, using a variable).
The problem with the old one is that, for example, if "noretrieve core" is
specified in ftpaccess [-> entry->arg[0] == "core"], and a user tries to
get a core file somewhere [-> lbasename(realname) == "core" ], he is
permitted to do so (return 0 rather than reply... return 1).
This happens on an ix86 running Linux; it's not an optimization bug (happens
with -O0 as only option, as well).
LLaP
bero
--
Windows 98 supports real multitasking - it can boot and crash simultaneously.
***
Anyone sending unwanted advertising e-mail to this address will be charged
$25 for network traffic and computing time. By extracting my address from
this message or its header, you agree to these terms.
--655616-418841772-907615696=:21568
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=NORET-OLD
Content-Transfer-Encoding: BASE64
Content-ID: <Pine DOT Bero DOT 4 DOT 05 DOT 9810052128160 DOT 21568 AT k6 DOT bero>
Content-Description: noretrieve() old version
Content-Disposition: attachment; filename=NORET-OLD
I2RlZmluZSBsYmFzZW5hbWUoeCkgKHN0cnJjaHIoeCwnLycpPzErc3RycmNo
cih4LCcvJyk6eCkNCiANCmludCBjaGVja25vcmV0cmlldmUgKGNoYXIgKm5h
bWUpDQp7DQogIGNoYXIgcmVhbG5hbWVbTUFYUEFUSExFTisxXTsNCiAgY2hh
ciBsb2NhbG5hbWVbTUFYUEFUSExFTisxXTsNCiAgY2hhciAqd2hpY2huYW1l
Ow0KICBpbnQgaTsNCiAgaW50IGxlbjsNCiAgc3RydWN0IGFjbG1lbWJlciAq
ZW50cnkgPSBOVUx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pXVtsZW4tMV0gPT0g
Jy8nKSAmJiAoc3RybmNtcChlbnRyeS0+YXJnW2ldLCB3aGljaG5hbWUsIGxl
bikgPT0gMCkpDQoJICB8fCAgKHN0cmNtcCAoKCgqKGVudHJ5LT5hcmdbaV0p
ID09ICcvJykgPyB3aGljaG5hbWUgOiBsYmFzZW5hbWUgKHdoaWNobmFtZSkp
LCBlbnRyeS0+YXJnW2ldKSA9PSAwKSkgew0KCSAgICByZXBseSAoNTUwLCAi
JXMgaXMgbWFya2VkIHVucmV0cmlldmFibGUiLCBsb2NhbG5hbWUpOw0KCSAg
ICByZXR1cm4gMTsNCgkgIH0NCiAgICAgICAgfQ0KICAgICAgfQ0KICAgcmV0
dXJuIDA7DQp9DQo=
--655616-418841772-907615696=:21568
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=NORET-NEW
Content-Transfer-Encoding: BASE64
Content-ID: <Pine DOT Bero DOT 4 DOT 05 DOT 9810052128161 DOT 21568 AT k6 DOT bero>
Content-Description: noretrieve() new version
Content-Disposition: attachment; filename=NORET-NEW
I2RlZmluZSBsYmFzZW5hbWUoeCkgKHN0cnJjaHIoeCwnLycpPzErc3RycmNo
cih4LCcvJyk6eCkNCg0KaW50IGNoZWNrbm9yZXRyaWV2ZSAoY2hhciAqbmFt
ZSkNCnsNCiAgY2hhciByZWFsbmFtZVtNQVhQQVRITEVOKzFdOw0KICBjaGFy
IGxvY2FsbmFtZVtNQVhQQVRITEVOKzFdOw0KICBjaGFyICp3aGljaG5hbWU7
DQogIGludCBpOw0KICBpbnQgbGVuOw0KICBzdHJ1Y3QgYWNsbWVtYmVyICpl
bnRyeSA9IE5VTEw7DQogIGNoYXIgbm9yZXQgPSAwOw0KDQogIGlmIChuYW1l
ID09IChjaGFyICopTlVMTCB8fCAqbmFtZSA9PSAnXDAnKQ0KICAgIHJldHVy
biAwOyANCg0KICAgd3VfcmVhbHBhdGggKG5hbWUsIGxvY2FsbmFtZSwgTlVM
TCk7DQogICB3dV9yZWFscGF0aCAobmFtZSwgcmVhbG5hbWUsIGNocm9vdF9w
YXRoKTsNCg0KICAgd2hpbGUgKGdldGFjbGVudHJ5KCJub3JldHJpZXZlIiwg
JmVudHJ5KSkgew0KICAgICAgICBpZiAoQVJHMCA9PSAoY2hhciAqKU5VTEwp
DQogICAgICAgICAgICBjb250aW51ZTsNCiAgICAgICAgd2hpY2huYW1lPXJl
YWxuYW1lOw0KICAgICAgICBpPTA7DQogICAgICAgIGlmIChlbnRyeS0+YXJn
WzBdKQ0KICAgICAgICAgIGlmIChzdHJjYXNlY21wIChlbnRyeS0+YXJnWzBd
LCAiYWJzb2x1dGUiKSA9PSAwKQ0KICAgICAgICAgICAgaSsrOw0KICAgICAg
ICAgIGVsc2UgaWYgKHN0cmNhc2VjbXAgKGVudHJ5LT5hcmdbMF0sICJyZWxh
dGl2ZSIpID09IDApIHsNCiAgICAgICAgICAgIGkrKzsNCiAgICAgICAgICAg
IHdoaWNobmFtZT1sb2NhbG5hbWU7DQogICAgICAgICAgfSBlbHNlIGlmIChz
dHJjYXNlY21wIChlbnRyeS0+YXJnWzBdLCAiLSIpID09IDApDQogICAgICAg
ICAgICBpKys7DQogICAgICAgICAgICANCglmb3IgKCA7IGk8IE1BWEFSR1Mg
JiYgDQoJICAgICAoZW50cnktPmFyZ1tpXSAhPSAoY2hhciAqKU5VTEwpICYm
ICgqKGVudHJ5LT5hcmdbaV0pICE9J1wwJyk7IGkrKykNCiAgICAgICAgew0K
ICAgICAgICAgIGxlbiA9IHN0cmxlbihlbnRyeS0+YXJnW2ldKTsNCiAgICAg
ICAgICBpZihzdHJjbXAgKCgoKihlbnRyeS0+YXJnW2ldKSA9PSAnLycpID8g
d2hpY2huYW1lIDogbGJhc2VuYW1lICh3aGljaG5hbWUpKSwgZW50cnktPmFy
Z1tpXSkgPT0gMCkNCiAgICAgICAgICAgIG5vcmV0PTE7DQogICAgICAgICAg
aWYgKCgoKihlbnRyeS0+YXJnW2ldKSA9ICcvJykgJiYgKGVudHJ5LT5hcmdb
aV1bbGVuLTFdID09ICcvJykgJiYgKHN0cm5jbXAoZW50cnktPmFyZ1tpXSwg
d2hpY2huYW1lLCBsZW4pID09IDApKQ0KCSAgfHwgbm9yZXQpIHsNCgkgICAg
cmVwbHkgKDU1MCwgIiVzIGlzIG1hcmtlZCB1bnJldHJpZXZhYmxlIiwgbG9j
YWxuYW1lKTsNCgkgICAgcmV0dXJuIDE7DQoJICB9DQogICAgICAgIH0NCiAg
ICAgIH0NCiAgIHJldHVybiAwOw0KfQ0K
--655616-418841772-907615696=:21568--
- Raw text -