Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6efa454 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick Committed by Android Git Automerger
Browse files

am 80337ffc: am 47e4ee59: am 71ead183: Close the client socket early for ctl.* properties.

* commit '80337ffc':
  Close the client socket early for ctl.* properties.
parents ab0c4e03 80337ffc
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -388,6 +388,9 @@ void handle_property_set_fd()
        msg.value[PROP_VALUE_MAX-1] = 0;

        if(memcmp(msg.name,"ctl.",4) == 0) {
            // Keep the old close-socket-early behavior when handling
            // ctl.* properties.
            close(s);
            if (check_control_perms(msg.value, cr.uid, cr.gid)) {
                handle_control_message((char*) msg.name + 4, (char*) msg.value);
            } else {
@@ -401,17 +404,18 @@ void handle_property_set_fd()
                ERROR("sys_prop: permission denied uid:%d  name:%s\n",
                      cr.uid, msg.name);
            }

            // Note: bionic's property client code assumes that the
            // property server will not close the socket until *AFTER*
            // the property is written to memory.
            close(s);
        }
        break;

    default:
        close(s);
        break;
    }

    // Note: bionic's property client code assumes that the property
    // server will not close the socket until *AFTER* the property is
    // written to memory.
    close(s);
}

void get_property_workspace(int *fd, int *sz)