Operation not permitted
I get the following when running a program as a normal user (not root):
wwwrun@fsx01:~> /usr/local/bin/k74 1 set /dev/port: Operation not permitted Here is the code that sets the bit on 0x378 (parport 0) - c code: void out_byte(int port, unsigned char byte) { off_t s; int r; s = lseek(dev_port_fd, port, 0); if (s < 0) perror("lseek"); else if (s != port) fprintf(stderr, "hmmm: seeking to %d, went to %ld.\n", port, (long)s); r = write(dev_port_fd, &byte, 1); if (r != 1) { fprintf(stderr, "hmmm: write returned %d\n", r); if (r < 0) perror("write"); } } I have tried numerous options such as setting read-write on the devices and /dev/port and the app (k74) etc, nothing works. I want to do this because I want php to execute the command (remote control garden system via wap). At this stage I have added apache to the sudoers list and it works. When running the command as apache in CONSOLE, it works fine, but as soon as I run it using php (web): shell_exec,exec,passthru, nothing happen :( Any ideas anyone? |
Sorry, I'm not sure I quite understand your question.
Are you saying that the program runs as a priveleged (root) user but not as a normal user? Note that the lower ports are reserved for root usage only and only the higher ports are accessible as a regular user. (Thus why apache must be started with root priveleges) |
the program can only run as a root user due to its nature. apache does not run as this user (should not anyways). How can I execute this program using php in apache?
|
Quote:
|
All times are GMT -5. The time now is 11:35 AM. |