rda-python-setuid 1.0.5__tar.gz → 1.0.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (19) hide show
  1. {rda_python_setuid-1.0.5/src/rda_python_setuid.egg-info → rda_python_setuid-1.0.7}/PKG-INFO +23 -1
  2. {rda_python_setuid-1.0.5 → rda_python_setuid-1.0.7}/README.md +22 -0
  3. {rda_python_setuid-1.0.5 → rda_python_setuid-1.0.7}/pyproject.toml +1 -1
  4. {rda_python_setuid-1.0.5 → rda_python_setuid-1.0.7}/src/rda_python_setuid/install.py +6 -6
  5. {rda_python_setuid-1.0.5 → rda_python_setuid-1.0.7}/src/rda_python_setuid/install.usg +7 -6
  6. {rda_python_setuid-1.0.5 → rda_python_setuid-1.0.7/src/rda_python_setuid.egg-info}/PKG-INFO +23 -1
  7. {rda_python_setuid-1.0.5 → rda_python_setuid-1.0.7}/LICENSE +0 -0
  8. {rda_python_setuid-1.0.5 → rda_python_setuid-1.0.7}/MANIFEST.in +0 -0
  9. {rda_python_setuid-1.0.5 → rda_python_setuid-1.0.7}/setup.cfg +0 -0
  10. {rda_python_setuid-1.0.5 → rda_python_setuid-1.0.7}/src/rda_python_setuid/__init__.py +0 -0
  11. {rda_python_setuid-1.0.5 → rda_python_setuid-1.0.7}/src/rda_python_setuid/pgstart.py +0 -0
  12. {rda_python_setuid-1.0.5 → rda_python_setuid-1.0.7}/src/rda_python_setuid/pywrapper.c +0 -0
  13. {rda_python_setuid-1.0.5 → rda_python_setuid-1.0.7}/src/rda_python_setuid/pywrapper.py +0 -0
  14. {rda_python_setuid-1.0.5 → rda_python_setuid-1.0.7}/src/rda_python_setuid.egg-info/SOURCES.txt +0 -0
  15. {rda_python_setuid-1.0.5 → rda_python_setuid-1.0.7}/src/rda_python_setuid.egg-info/dependency_links.txt +0 -0
  16. {rda_python_setuid-1.0.5 → rda_python_setuid-1.0.7}/src/rda_python_setuid.egg-info/entry_points.txt +0 -0
  17. {rda_python_setuid-1.0.5 → rda_python_setuid-1.0.7}/src/rda_python_setuid.egg-info/requires.txt +0 -0
  18. {rda_python_setuid-1.0.5 → rda_python_setuid-1.0.7}/src/rda_python_setuid.egg-info/top_level.txt +0 -0
  19. {rda_python_setuid-1.0.5 → rda_python_setuid-1.0.7}/tests/test_setuid.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_setuid
3
- Version: 1.0.5
3
+ Version: 1.0.7
4
4
  Summary: RDA Python Package to setuid for program executions as an effective or common user
5
5
  Author-email: Zaihua Ji <zji@ucar.edu>
6
6
  Project-URL: Homepage, https://github.com/NCAR/rda-python-setuid
@@ -30,6 +30,28 @@ Two modes are supported:
30
30
  - **Mode 2 (pgstart specialist):** a copy `pgstart_zji` runs any command as specialist
31
31
  `zji` via `pgstart.py`, restricted to authorized users.
32
32
 
33
+ Two Python entry points are packaged alongside the C wrapper:
34
+
35
+ - **`pywrapper.py`** — the default fallback target executed when `pywrapper.c`
36
+ cannot resolve a matching `setuid_<program>` entry point. Acquires the
37
+ effective UID via `PgLOG.set_suid()`, prints the caller's real and effective
38
+ user names, and shows the `pyproject.toml` snippet plus the
39
+ `pywrapper-install -l <program>` command needed to wrap a new script.
40
+ Diagnostic flags `-env`, `-inc`, and `-plg` dump the environment variables,
41
+ `sys.path`, and `PGLOG` dictionary respectively — handy for verifying the
42
+ setuid environment before wiring up a real program.
43
+
44
+ - **`pgstart.py`** — the Mode 2 launcher invoked through a `pgstart_<USER>`
45
+ copy of `pywrapper`. Reads the real/effective UIDs from `PGLOG`, then
46
+ permits execution only if the real user matches the effective user or the
47
+ shared GDEX common user (`PGLOG['GDEXUSER']`); unauthorized callers receive
48
+ an informational message and exit. After authorization it parses leading
49
+ flag tokens — `-bg` (background via `subprocess.Popen`), `-fg` (explicit
50
+ foreground, default), `-cwd <dir>` (chdir before exec), and the same
51
+ `-env`/`-inc`/`-plg` diagnostics as `pywrapper.py` — and then runs the
52
+ remaining arguments as a command (`subprocess.run`/`Popen`) under the
53
+ effective UID, logging a host/program/timestamp/user line to `pgstart.log`.
54
+
33
55
  ## Dependency requirement
34
56
 
35
57
  Any Python package whose programs are to be run via the setuid mechanism must declare
@@ -14,6 +14,28 @@ Two modes are supported:
14
14
  - **Mode 2 (pgstart specialist):** a copy `pgstart_zji` runs any command as specialist
15
15
  `zji` via `pgstart.py`, restricted to authorized users.
16
16
 
17
+ Two Python entry points are packaged alongside the C wrapper:
18
+
19
+ - **`pywrapper.py`** — the default fallback target executed when `pywrapper.c`
20
+ cannot resolve a matching `setuid_<program>` entry point. Acquires the
21
+ effective UID via `PgLOG.set_suid()`, prints the caller's real and effective
22
+ user names, and shows the `pyproject.toml` snippet plus the
23
+ `pywrapper-install -l <program>` command needed to wrap a new script.
24
+ Diagnostic flags `-env`, `-inc`, and `-plg` dump the environment variables,
25
+ `sys.path`, and `PGLOG` dictionary respectively — handy for verifying the
26
+ setuid environment before wiring up a real program.
27
+
28
+ - **`pgstart.py`** — the Mode 2 launcher invoked through a `pgstart_<USER>`
29
+ copy of `pywrapper`. Reads the real/effective UIDs from `PGLOG`, then
30
+ permits execution only if the real user matches the effective user or the
31
+ shared GDEX common user (`PGLOG['GDEXUSER']`); unauthorized callers receive
32
+ an informational message and exit. After authorization it parses leading
33
+ flag tokens — `-bg` (background via `subprocess.Popen`), `-fg` (explicit
34
+ foreground, default), `-cwd <dir>` (chdir before exec), and the same
35
+ `-env`/`-inc`/`-plg` diagnostics as `pywrapper.py` — and then runs the
36
+ remaining arguments as a command (`subprocess.run`/`Popen`) under the
37
+ effective UID, logging a host/program/timestamp/user line to `pgstart.log`.
38
+
17
39
  ## Dependency requirement
18
40
 
19
41
  Any Python package whose programs are to be run via the setuid mechanism must declare
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
8
8
  name = "rda_python_setuid"
9
- version = "1.0.5"
9
+ version = "1.0.7"
10
10
  authors = [
11
11
  { name="Zaihua Ji", email="zji@ucar.edu" },
12
12
  ]
@@ -12,16 +12,16 @@
12
12
  #
13
13
  # Usage:
14
14
  # # 1. Compile and install pywrapper (run once per environment):
15
- # pywrapper-install [-u gdexdata] [-e $ENVHOME/bin/]
15
+ # pywrapper-install [-u gdexdata] [-e $ENVHOME]
16
16
  #
17
17
  # # 2. Create pgstart_USER entry so USER can run commands as themselves:
18
- # pywrapper-install -p [-u zji] [-e $ENVHOME/bin/]
18
+ # pywrapper-install -p [-u zji] [-e $ENVHOME]
19
19
  #
20
20
  # # 3. Create a symlink so a program runs as CommonUser via pywrapper (setuid):
21
- # pywrapper-install -l myprog [-u gdexdata] [-e $ENVHOME/bin/]
21
+ # pywrapper-install -l myprog [-u gdexdata] [-e $ENVHOME]
22
22
  #
23
23
  # # 4. Simple install: symlink PROGRAM -> setuid_PROGRAM (no setuid, runs as current user):
24
- # pywrapper-install -l myprog -s [-e $ENVHOME/bin/]
24
+ # pywrapper-install -l myprog -s [-e $ENVHOME]
25
25
  #
26
26
  # Convention for wrapped programs:
27
27
  # The target package must register its connector entry point with a setuid_ prefix:
@@ -73,7 +73,7 @@ def main():
73
73
  )
74
74
  parser.add_argument(
75
75
  '-e', '--envhome', default=None,
76
- help="Path to the venv bin/ directory (default: bin/ dir of the current Python executable)"
76
+ help="Path to the venv root directory containing bin/ (default: parent of the current Python executable's bin/ dir)"
77
77
  )
78
78
  parser.add_argument(
79
79
  '-u', '--user', default=None,
@@ -101,7 +101,7 @@ def main():
101
101
  else:
102
102
  args.user = 'gdexdata'
103
103
 
104
- bindir = args.envhome or get_bindir()
104
+ bindir = os.path.join(args.envhome, 'bin') if args.envhome else get_bindir()
105
105
  pywrapper = os.path.join(bindir, 'pywrapper')
106
106
 
107
107
  if args.link:
@@ -2,7 +2,7 @@
2
2
  that execute Python scripts as a common or effective user via the setuid mechanism.
3
3
  Must be run inside the target Python virtual environment.
4
4
 
5
- Usage: pywrapper-install [-u USER] [-e BINDIR] [-p | -l PROGRAM [-s]]
5
+ Usage: pywrapper-install [-u USER] [-e ENVHOME] [-p | -l PROGRAM [-s]]
6
6
 
7
7
  - Option -u or --user USER
8
8
  The user name to own the setuid binary. For Mode 1 (CommonUser program),
@@ -10,10 +10,11 @@
10
10
  the specialist user (e.g. zji). Defaults to 'gdexdata' unless -p/--pgstart
11
11
  is given, in which case it defaults to the current login user.
12
12
 
13
- - Option -e or --envhome BINDIR
14
- Path to the venv bin/ directory. Defaults to the bin/ directory of the
15
- currently active Python executable. Only needed when installing into an
16
- environment other than the one currently active.
13
+ - Option -e or --envhome ENVHOME
14
+ Path to the venv root directory (the parent of bin/). Defaults to the
15
+ parent of the currently active Python executable's bin/ directory.
16
+ Only needed when installing into an environment other than the one
17
+ currently active.
17
18
 
18
19
  - Option -p or --pgstart
19
20
  Mode 2: copy the compiled pywrapper binary to pgstart_USER (owned by USER,
@@ -120,7 +121,7 @@
120
121
  pywrapper-install
121
122
 
122
123
  2. Same, but targeting a specific environment:
123
- pywrapper-install -e /glade/u/home/gdexdata/gdexmsenv/bin/
124
+ pywrapper-install -e /glade/u/home/gdexdata/gdexmsenv
124
125
 
125
126
  3. Wire up dsarch to run as gdexdata via pywrapper:
126
127
  pywrapper-install -l dsarch
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_setuid
3
- Version: 1.0.5
3
+ Version: 1.0.7
4
4
  Summary: RDA Python Package to setuid for program executions as an effective or common user
5
5
  Author-email: Zaihua Ji <zji@ucar.edu>
6
6
  Project-URL: Homepage, https://github.com/NCAR/rda-python-setuid
@@ -30,6 +30,28 @@ Two modes are supported:
30
30
  - **Mode 2 (pgstart specialist):** a copy `pgstart_zji` runs any command as specialist
31
31
  `zji` via `pgstart.py`, restricted to authorized users.
32
32
 
33
+ Two Python entry points are packaged alongside the C wrapper:
34
+
35
+ - **`pywrapper.py`** — the default fallback target executed when `pywrapper.c`
36
+ cannot resolve a matching `setuid_<program>` entry point. Acquires the
37
+ effective UID via `PgLOG.set_suid()`, prints the caller's real and effective
38
+ user names, and shows the `pyproject.toml` snippet plus the
39
+ `pywrapper-install -l <program>` command needed to wrap a new script.
40
+ Diagnostic flags `-env`, `-inc`, and `-plg` dump the environment variables,
41
+ `sys.path`, and `PGLOG` dictionary respectively — handy for verifying the
42
+ setuid environment before wiring up a real program.
43
+
44
+ - **`pgstart.py`** — the Mode 2 launcher invoked through a `pgstart_<USER>`
45
+ copy of `pywrapper`. Reads the real/effective UIDs from `PGLOG`, then
46
+ permits execution only if the real user matches the effective user or the
47
+ shared GDEX common user (`PGLOG['GDEXUSER']`); unauthorized callers receive
48
+ an informational message and exit. After authorization it parses leading
49
+ flag tokens — `-bg` (background via `subprocess.Popen`), `-fg` (explicit
50
+ foreground, default), `-cwd <dir>` (chdir before exec), and the same
51
+ `-env`/`-inc`/`-plg` diagnostics as `pywrapper.py` — and then runs the
52
+ remaining arguments as a command (`subprocess.run`/`Popen`) under the
53
+ effective UID, logging a host/program/timestamp/user line to `pgstart.log`.
54
+
33
55
  ## Dependency requirement
34
56
 
35
57
  Any Python package whose programs are to be run via the setuid mechanism must declare