Pro PHP Security phần 10

Một hệ thống báo cáo theo yêu cầu cung cấp một giải pháp cho vấn đề của tình trạng quá tải bằng cách cung cấp một giao diện năng động cho các ứng dụng thu thập dữ liệu đăng nhập hệ thống. Một hệ thống như vậy cho phép có xu hướng được xem, và một bản tóm tắt bảo mật được tạo ra, bất cứ lúc nào | CHAPTER 22 SAFELY EXECUTING SYSTEM COMMANDS 449 work changing permissions on the just-created temporary file. That it has been successful we can see by examining the log file 18766 Daemon running. 18766 Thu 07 Jul 2005 18766 Starting job 15 18766 Finished job 15 18766 Starting job 16 18766 Finished job 16 18766 Starting job 17 18766 Finished job 17 10 51 52 -0400 changeownership csnyder tmp changeOwnershipDemoZbblYA . done changeownership csnyder tmp change0wnershipDemotwQ7rG . done changeownership csnyder tmp changeOwnershipDemonqOsxx . done This script may seem simple but it is carrying out a task that is important for the security of your system. If you were to create similar daemons focused each on carrying out safely a particular potentially dangerous task you would go a long way toward ensuring the security of your server and your users data. It should be noted that such a daemon will run literally forever or at least as long as your server is up and running until it is killed by a command from the console. Tracking Queued Tasks We have discussed how to set up a queue and how to pull jobs off that queue for execution. We turn now to the third part of the picture. Your web application requires some means of tracking the progress of any batch jobs it creates and picking up the results when processing is completed. For jobs that will take less than a few minutes to make their way up the queue and be executed the session ID is a viable tracking device and is the obvious way to identify the results and make them available to the web application after processing. As long as your web application can keep the user around while the job is processed in the background the results can be picked up directly. But with heavy-duty processing tasks or large queues it may be several minutes or longer before processing is complete. Since it is not very realistic to expect a user to maintain an active session for even 15 seconds when nothing is apparently happening it is likely

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
23    83    1    22-05-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.