rda-python-dsarch 1.0.5__tar.gz → 1.0.6__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.
- {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/PKG-INFO +1 -1
- {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/pyproject.toml +1 -1
- {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch/dsarch.c +12 -21
- {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch.egg-info/PKG-INFO +1 -1
- {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/LICENSE +0 -0
- {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/MANIFEST.in +0 -0
- {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/README.md +0 -0
- {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/setup.cfg +0 -0
- {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch/PgArch.py +0 -0
- {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch/PgMeta.py +0 -0
- {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch/__init__.py +0 -0
- {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch/dsarch.py +0 -0
- {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch/dsarch.usg +0 -0
- {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch.egg-info/SOURCES.txt +0 -0
- {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch.egg-info/dependency_links.txt +0 -0
- {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch.egg-info/entry_points.txt +0 -0
- {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch.egg-info/top_level.txt +0 -0
- {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/tests/test_dsarch.py +0 -0
|
@@ -3,16 +3,17 @@
|
|
|
3
3
|
* Title: dsarch.c
|
|
4
4
|
* Author: Zaihua Ji, zji@ucar.edu
|
|
5
5
|
* Date: 2024-01-30
|
|
6
|
-
* Purpose: C wrapper to setuid for
|
|
6
|
+
* Purpose: C wrapper to setuid for a common effective user to
|
|
7
|
+
* run dsarch python scripts
|
|
7
8
|
*
|
|
8
9
|
* Instruction:
|
|
10
|
+
* after python -m pip install rda_python_dsarch
|
|
11
|
+
* cd ../rda_python_dsarch/
|
|
12
|
+
* cp dsarch.c $ENVHOME/bin/
|
|
13
|
+
* cd $ENVHOME/bin/
|
|
14
|
+
* sudo -u CommonUser gcc -o dsarch $ENVHOME/bin/dsarch.c
|
|
15
|
+
* sudo -u CommonUser chmod 4750 dsarch
|
|
9
16
|
*
|
|
10
|
-
* dsarch.c $LOCHOME/bin/dsarch.c
|
|
11
|
-
* cd $LOCHOME/bin/
|
|
12
|
-
* gcc -o dsarch dsarch.c
|
|
13
|
-
* chmod 4750 dsarch
|
|
14
|
-
*
|
|
15
|
-
* $LOCHOME: /usr/local/decs On DECS machines, and /ncar/rda/setuid on DAV
|
|
16
17
|
* $ENVHOME: /glade/u/home/rdadata/rdamsenv on DECS machines, and
|
|
17
18
|
* /glade/work/zji/conda-envs/pg-rda on DAV
|
|
18
19
|
*
|
|
@@ -23,25 +24,15 @@
|
|
|
23
24
|
#include <stdio.h>
|
|
24
25
|
#include <stdlib.h>
|
|
25
26
|
#include <string.h>
|
|
27
|
+
#include <libgen.h>
|
|
26
28
|
|
|
27
29
|
/* main program */
|
|
28
30
|
int main(int argc, char *argv[]) {
|
|
29
|
-
char *name;
|
|
30
31
|
char prog[128];
|
|
31
|
-
char
|
|
32
|
+
char file[] = __FILE__;
|
|
32
33
|
|
|
33
|
-
strcpy(prog,
|
|
34
|
-
strcat(prog, "/
|
|
35
|
-
name = strrchr(argv[0], '/');
|
|
36
|
-
if(name == (char *)NULL) {
|
|
37
|
-
strcat(prog, argv[0]);
|
|
38
|
-
} else {
|
|
39
|
-
strcat(prog, ++name);
|
|
40
|
-
}
|
|
41
|
-
name = strrchr(prog, '.');
|
|
42
|
-
if(name == (char *)NULL || strcmp(name, pext) != 0) {
|
|
43
|
-
strcat(prog, pext);
|
|
44
|
-
}
|
|
34
|
+
strcpy(prog, dirname(file));
|
|
35
|
+
strcat(prog, "/dsarch.py");
|
|
45
36
|
|
|
46
37
|
/* call Python script */
|
|
47
38
|
execv(prog, argv);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|