rda-python-dsarch 1.0.4__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.4 → rda_python_dsarch-1.0.6}/PKG-INFO +1 -1
- {rda_python_dsarch-1.0.4 → rda_python_dsarch-1.0.6}/pyproject.toml +2 -2
- {rda_python_dsarch-1.0.4 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch/dsarch.c +12 -21
- {rda_python_dsarch-1.0.4 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch/dsarch.py +2 -3
- {rda_python_dsarch-1.0.4 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch.egg-info/PKG-INFO +1 -1
- {rda_python_dsarch-1.0.4 → rda_python_dsarch-1.0.6}/LICENSE +0 -0
- {rda_python_dsarch-1.0.4 → rda_python_dsarch-1.0.6}/MANIFEST.in +0 -0
- {rda_python_dsarch-1.0.4 → rda_python_dsarch-1.0.6}/README.md +0 -0
- {rda_python_dsarch-1.0.4 → rda_python_dsarch-1.0.6}/setup.cfg +0 -0
- {rda_python_dsarch-1.0.4 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch/PgArch.py +0 -0
- {rda_python_dsarch-1.0.4 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch/PgMeta.py +0 -0
- {rda_python_dsarch-1.0.4 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch/__init__.py +0 -0
- {rda_python_dsarch-1.0.4 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch/dsarch.usg +0 -0
- {rda_python_dsarch-1.0.4 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch.egg-info/SOURCES.txt +0 -0
- {rda_python_dsarch-1.0.4 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch.egg-info/dependency_links.txt +0 -0
- {rda_python_dsarch-1.0.4 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch.egg-info/entry_points.txt +0 -0
- {rda_python_dsarch-1.0.4 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch.egg-info/top_level.txt +0 -0
- {rda_python_dsarch-1.0.4 → rda_python_dsarch-1.0.6}/tests/test_dsarch.py +0 -0
|
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
|
|
|
7
7
|
|
|
8
8
|
[project]
|
|
9
9
|
name = "rda_python_dsarch"
|
|
10
|
-
version = "1.0.
|
|
10
|
+
version = "1.0.6"
|
|
11
11
|
authors = [
|
|
12
12
|
{ name="Zaihua Ji", email="zji@ucar.edu" },
|
|
13
13
|
]
|
|
@@ -28,7 +28,7 @@ include-package-data = true
|
|
|
28
28
|
where = ["src"]
|
|
29
29
|
|
|
30
30
|
[tool.setuptools.package-data]
|
|
31
|
-
"
|
|
31
|
+
"rda_python_dsarch" = ["dsarch.usg", "dsarch.c"]
|
|
32
32
|
|
|
33
33
|
[project.urls]
|
|
34
34
|
"Homepage" = "https://github.com/NCAR/rda-python-dsarch"
|
|
@@ -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);
|
|
@@ -22,7 +22,6 @@ from rda_python_common import PgUtil
|
|
|
22
22
|
from rda_python_common import PgOPT
|
|
23
23
|
from rda_python_common import PgSIG
|
|
24
24
|
from rda_python_common import PgCMD
|
|
25
|
-
from rda_python_common import PgGLBS
|
|
26
25
|
from rda_python_common import PgDBI
|
|
27
26
|
from rda_python_common import PgSplit
|
|
28
27
|
from . import PgMeta
|
|
@@ -1661,7 +1660,7 @@ def tar_backup_savedfiles(tarfile, tinfo, ccnt, chkstat):
|
|
|
1661
1660
|
if not pgrec:
|
|
1662
1661
|
PgLOG.pglog("{}-{}: Saved file record not in RDADB".format(dsid, sfile), PgOPT.PGOPT['extlog'])
|
|
1663
1662
|
elif chkstat and pgrec['bid'] and pgrec['bid'] != tinfo['bid']:
|
|
1664
|
-
|
|
1663
|
+
PgFile.file_backup_status(pgrec, 0, PgOPT.PGOPT['extlog'])
|
|
1665
1664
|
if not stype: stype = pgrec['type']
|
|
1666
1665
|
if pgrec['locflag'] == 'O':
|
|
1667
1666
|
tardir = tarhome
|
|
@@ -1750,7 +1749,7 @@ def tar_backup_webfiles(tarfile, tinfo, ccnt, chkstat):
|
|
|
1750
1749
|
if not pgrec:
|
|
1751
1750
|
PgLOG.pglog("{}-{}: Web file record not in RDADB".format(dsid, wfile), PgOPT.PGOPT['extlog'])
|
|
1752
1751
|
elif chkstat and pgrec['bid'] and pgrec['bid'] != tinfo['bid']:
|
|
1753
|
-
|
|
1752
|
+
PgFile.file_backup_status(pgrec, 0, PgOPT.PGOPT['extlog'])
|
|
1754
1753
|
if pgrec['locflag'] == 'O':
|
|
1755
1754
|
tardir = tarhome
|
|
1756
1755
|
webfile = "{}/{}".format(tardir, wfile)
|
|
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.4 → 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.4 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{rda_python_dsarch-1.0.4 → rda_python_dsarch-1.0.6}/src/rda_python_dsarch.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|