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.
Files changed (18) hide show
  1. {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/PKG-INFO +1 -1
  2. {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/pyproject.toml +1 -1
  3. {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch/dsarch.c +12 -21
  4. {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch.egg-info/PKG-INFO +1 -1
  5. {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/LICENSE +0 -0
  6. {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/MANIFEST.in +0 -0
  7. {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/README.md +0 -0
  8. {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/setup.cfg +0 -0
  9. {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch/PgArch.py +0 -0
  10. {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch/PgMeta.py +0 -0
  11. {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch/__init__.py +0 -0
  12. {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch/dsarch.py +0 -0
  13. {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch/dsarch.usg +0 -0
  14. {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch.egg-info/SOURCES.txt +0 -0
  15. {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch.egg-info/dependency_links.txt +0 -0
  16. {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch.egg-info/entry_points.txt +0 -0
  17. {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch.egg-info/top_level.txt +0 -0
  18. {rda_python_dsarch-1.0.5 → rda_python_dsarch-1.0.6}/tests/test_dsarch.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: rda_python_dsarch
3
- Version: 1.0.5
3
+ Version: 1.0.6
4
4
  Summary: RDA Python package for utility program dsarch archive RDA data
5
5
  Author-email: Zaihua Ji <zji@ucar.edu>
6
6
  Project-URL: Homepage, https://github.com/NCAR/rda-python-dsarch
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
7
7
 
8
8
  [project]
9
9
  name = "rda_python_dsarch"
10
- version = "1.0.5"
10
+ version = "1.0.6"
11
11
  authors = [
12
12
  { name="Zaihua Ji", email="zji@ucar.edu" },
13
13
  ]
@@ -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 dsarch python scripts
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 pext[] = ".py";
32
+ char file[] = __FILE__;
32
33
 
33
- strcpy(prog, getenv("ENVHOME"));
34
- strcat(prog, "/bin/");
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);
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: rda_python_dsarch
3
- Version: 1.0.5
3
+ Version: 1.0.6
4
4
  Summary: RDA Python package for utility program dsarch archive RDA data
5
5
  Author-email: Zaihua Ji <zji@ucar.edu>
6
6
  Project-URL: Homepage, https://github.com/NCAR/rda-python-dsarch