Mailinglist Archive: opensuse-bugs (6470 mails)

< Previous Next >
[Bug 1124481] [Build 20190201] openQA test fails in lvm_thin_check - bash v5 file descriptors for ~/.bash_history
  • From: bugzilla_noreply@xxxxxxxxxx
  • Date: Fri, 19 Jul 2019 03:32:56 +0000
  • Message-id: <bug-1124481-21960-BtZgEJbNiX@http.bugzilla.suse.com/>
http://bugzilla.suse.com/show_bug.cgi?id=1124481
http://bugzilla.suse.com/show_bug.cgi?id=1124481#c15

--- Comment #15 from heming zhao <heming.zhao@xxxxxxxx> ---
I have no idea about who opens the .bash_history file.
From first Description (comment #0) of Martin Loviska, lvm2 as a bash child,
just closed its fd[3], but his parents fd[3] was still opened.
There are lots of test cases running before lvm2, any of them may cause this
bug.

I only quickly grep 'grub2' source code, and there is no keyword of
'.bash_histroy'.
and I also think the bash is correct.

there is a example to trigger this bug, which copied from redhat bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=618995

```c
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>

int main() {
char buf[] = "pvdisplay; lsof -p $$";
char fd_name[256];
int fd[2], s;

pipe(fd);

if (fork()) {
close(fd[0]);
write(fd[1], buf, sizeof(buf));
close(fd[1]);
wait(&s);
return 0;
}

close(fd[1]);
sprintf(fd_name, "/dev/fd/%d", fd[0]);
execl("/bin/bash", "bash", fd_name, NULL);
}
```

compiling: gcc file.c
run it with root.

--
You are receiving this mail because:
You are on the CC list for the bug.
< Previous Next >