Skip to content

Commit 4884ed7

Browse files
committed
Fix imports for bpf_get_current_uid_gid
1 parent 5b7769d commit 4884ed7

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

pythonbpf/helper/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
random,
1111
probe_read,
1212
smp_processor_id,
13+
uid,
1314
XDP_DROP,
1415
XDP_PASS,
1516
)
@@ -79,6 +80,7 @@ def helper_call_handler(
7980
"random",
8081
"probe_read",
8182
"smp_processor_id",
83+
"uid",
8284
"XDP_DROP",
8385
"XDP_PASS",
8486
]

pythonbpf/helper/helpers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ def smp_processor_id():
4242
return ctypes.c_int32(0)
4343

4444

45+
def uid():
46+
"""get current user id"""
47+
return ctypes.c_int32(0)
48+
49+
4550
XDP_ABORTED = ctypes.c_int64(0)
4651
XDP_DROP = ctypes.c_int64(1)
4752
XDP_PASS = ctypes.c_int64(2)

0 commit comments

Comments
 (0)