php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81663 PHP calls shell_exec. The process it starts ends but php does not continue from
Submitted: 2021-11-26 23:34 UTC Modified: 2021-11-29 12:18 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: arian_a at hotmail dot se Assigned: cmb (profile)
Status: Not a bug Package: Program Execution
PHP Version: 8.0.13 OS: win 10
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: arian_a at hotmail dot se
New email:
PHP Version: OS:

 

 [2021-11-26 23:34 UTC] arian_a at hotmail dot se
Description:
------------
This problem is difficult to explain with text only. So therefore I have combined text and images to be able to explain it better. 

The explanations can be found in the links below. (The links show you how to reproduce the bugg.) The links should be read in the same order as they appear.


1.
https://i.ibb.co/dj10yqP/1eng.png

2.
https://i.ibb.co/1zwLwQ6/2eng.png

3.
https://i.ibb.co/pxY5GN9/3eng.png

4.
https://i.ibb.co/ggpZXKk/4-eng.png



Here is all the files used in the project. Nothing is excluded
https://github.com/somedudeokey/monitor/archive/refs/heads/main.zip


Pathmonitor.exe was created with pathmonitor.cpp.
If you do not trust the .exe file, you can create the same .exe by using the .cpp file (pathmonitor.cpp)



Take care


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-11-29 12:18 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Package: Systems problem +Package: Program Execution -Assigned To: +Assigned To: cmb
 [2021-11-29 12:18 UTC] cmb@php.net
I don't see a bug in PHP here.  The problem is your code, since
you first modify the file(s), and then execute pathmonitor.exe
which waits possibly indefinitely for modifications.
Additionally, you should not pass the name of a file to
pathmonitor.exe, but rather its directory:

    shell_exec("pathmonitor.exe " . dirname($_GET['path']));
 [2021-12-13 23:10 UTC] arian_a at hotmail dot se
"The problem is your code, since
you first modify the file(s), and then execute pathmonitor.exe
which waits possibly indefinitely for modifications"

This is not true.
test1, test2 and test3.html, they all make a request onload to insert.php which starts pathmonitor.exe. At this point pathmonitor.exe is waiting for something to happen.

Then after that use "write-buttons.html" to write in the folders.  

This is what the program should do, no matter which buttons you press, two folders gets a write (One folder is one of the options in "write-buttons.html", the other folder is folder1). When the write happens the ajax request is returned and new request is sent back to start a new wait.

It works in the beginning, but then after some "button pressing", one of the two ajax requests that should return doesn't return.



So I still belive it's a bugg, don't you think?
 [2021-12-13 23:15 UTC] arian_a at hotmail dot se
I wrote wrong at the beginning of my last comment. This is how it should be instead:

test1, test2 and test3.html, they all make a request onload to monitor.php (NOT to insert.php)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC