Skip to content
Closed
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
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Python

on: [push, pull_request, workflow_dispatch]

# Least privilege: no job needs to write back to the repo. Publishing to PyPI
# uses TWINE_* secrets, not GITHUB_TOKEN, so read access is sufficient here.
permissions:
contents: read

defaults:
run:
shell: bash
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Makefile

on: [push, pull_request, workflow_dispatch]

# Least privilege: this workflow only builds/tests, it never writes to the repo.
permissions:
contents: read

defaults:
run:
shell: bash
Expand Down
8 changes: 4 additions & 4 deletions src/p4p/_p4p.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ cdef extern from "<p4p.h>" namespace "p4p":
void disconnectDynamic(const shared_ptr[server.Source]& src) except+

# pvxs_client.cpp
void opHandler[Builder](Builder& builder, object handler)
void opBuilder[Builder](Builder& builder, object handler)
void opEvent(client.MonitorBuilder& builder, object handler)
object monPop(const shared_ptr[client.Subscription]& mon) with gil
void opHandler[Builder](Builder& builder, object handler) except+
void opBuilder[Builder](Builder& builder, object handler) except+
void opEvent(client.MonitorBuilder& builder, object handler) except+
object monPop(const shared_ptr[client.Subscription]& mon) except+ with gil

cimport numpy # must cimport after p4p.h is included

Expand Down
4 changes: 3 additions & 1 deletion src/p4p/asLib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,9 @@ def create(self, channel, group, user, host, level, roles=[]):

with self._lock:

uags = self._uag.get(user, set())
# copy the stored set; |= below is in-place and would otherwise
# permanently merge client-asserted roles into the shared UAG state
uags = set(self._uag.get(user, ()))
for role in roles:
uags |= self._uag.get('role/'+role, set())
hags = self._hag_addr.get(host, set())
Expand Down
5 changes: 2 additions & 3 deletions src/pvxs_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,8 @@ void disconnectDynamic(const std::shared_ptr<server::Source>& src)
if(!src)
return;

auto dynsrc = dynamic_cast<DynamicSource*>(src.get());

dynsrc->handler = nullptr;
if(auto dynsrc = dynamic_cast<DynamicSource*>(src.get()))
dynsrc->handler = nullptr;
}

}
Loading