The Ubuntu 16.04 implementation of the 4.4 BSD script program dumps core when trying to open a file in a non-existant directory.

This commit is contained in:
D. Joe 2018-12-31 12:11:30 -05:00
parent 6aaa63e30f
commit 9853669116

41
script-missing-dir.md Normal file
View file

@ -0,0 +1,41 @@
The `script` utility dumps core when one attempts to log to a file in a
non-existent directory.
```
~$ mkdir script-demo
~$ cd script-demo
~/script-demo$ script nosuchdir/file.txt
Script started, file is nosuchdir/file.txt
script: cannot open nosuchdir/file.txt: No such file or directory
Script done, file is nosuchdir/file.txt
Segmentation fault (core dumped)
```
```
~$ which script
bsdutils: /usr/bin/script
~$ dpkg -S `which script`
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-===================-============-=================================
ii bsdutils 1:2.27.1-6ubuntu3.4 amd64 basic utilities from 4.4BSD-Lite
```
One expects instead that the program exit with an error message:
```
~$ mkdir script-demo
~$ cd script-demo
~/script-demo$ script nosuchdir/file.txt
Script started, file is nosuchdir/file.txt
script: cannot open nosuchdir/file.txt: No such file or directory
```