Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bindings/python: Add priv_drop_user and priv_drop_group #1564

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bindings/python/rgbmatrix/core.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ cdef class RGBMatrixOptions:
cdef bytes __py_encoded_led_rgb_sequence
cdef bytes __py_encoded_pixel_mapper_config
cdef bytes __py_encoded_panel_type
cdef bytes __py_encoded_drop_priv_user
cdef bytes __py_encoded_drop_priv_group

# Local Variables:
# mode: python
Expand Down
12 changes: 12 additions & 0 deletions bindings/python/rgbmatrix/core.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,18 @@ cdef class RGBMatrixOptions:
def __get__(self): return self.__runtime_options.drop_privileges
def __set__(self, uint8_t value): self.__runtime_options.drop_privileges = value

property drop_priv_user:
def __get__(self): return self.__runtime_options.drop_priv_user
def __set__(self, value):
self.__py_encoded_drop_priv_user = value.encode('utf-8')
self.__runtime_options.drop_priv_user = self.__py_encoded_drop_priv_user

property drop_priv_group:
def __get__(self): return self.__runtime_options.drop_priv_group
def __set__(self, value):
self.__py_encoded_drop_priv_group = value.encode('utf-8')
self.__runtime_options.drop_priv_group = self.__py_encoded_drop_priv_group

cdef class RGBMatrix(Canvas):
def __cinit__(self, int rows = 0, int chains = 0, int parallel = 0,
RGBMatrixOptions options = None):
Expand Down
2 changes: 2 additions & 0 deletions bindings/python/rgbmatrix/cppinc.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ cdef extern from "led-matrix.h" namespace "rgb_matrix":
int gpio_slowdown
int daemon
int drop_privileges
const char *drop_priv_user
const char *drop_priv_group


RGBMatrix *CreateMatrixFromOptions(Options &options, RuntimeOptions runtime_options)
Expand Down
Loading