[Bug 4225] New: acpid.c executes "wrong" script/binary

bugzilla at busybox.net bugzilla at busybox.net
Wed Sep 21 12:28:27 UTC 2011


           Summary: acpid.c executes "wrong" script/binary
           Product: Busybox
           Version: 1.19.x
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P5
         Component: Other
        AssignedTo: unassigned at busybox.net
        ReportedBy: pzychofaze at web.de
                CC: busybox-cvs at busybox.net
   Estimated Hours: 0.0

while playing around with busybox acpid i found that if i add a line like
PWRF   /scripts/poweroff.sh
to acpid.conf where /scripts/poweroff.sh is an absolute path to a poweroff
script then the code would check via stat if the file exists but would execute
the file .//scripts/poweroff.sh in the current working directory (which is
I don't know if its correct that the scripts should only be executed if they
are in /etc/acpi, in my case i wanted to execute a script with an absolute path
so i changed the process_event-code in acpid.c line 120 to
        char *handler = xasprintf("%s", event);
patch1 attached

if its correct that the scripts should only be executed when they are in
/etc/acpi i guess the stat in line 132 should be changed to
        if (0 == stat(handler, &st))

I guess one of these should be correct. Or the handler variable could be
removed to use the event variable direct

Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the busybox-cvs mailing list