rda-python-common 3.0.11__py3-none-any.whl → 3.0.13__py3-none-any.whl

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.
@@ -22,7 +22,7 @@ object that existing callers expect.
22
22
 
23
23
  from . import PgLOG, PgUtil, PgDBI, PgFile, PgLock, PgCMD, PgSIG, PgOPT, PgSplit
24
24
 
25
- __version__ = "3.0.0"
25
+ __version__ = "3.0.13"
26
26
 
27
27
  __all__ = [
28
28
  "PgLOG",
@@ -1635,11 +1635,23 @@ class PgFile(PgUtil, PgSIG):
1635
1635
  if not (omode and logname):
1636
1636
  info = self.check_local_file(file, 6)
1637
1637
  if not info:
1638
- if info != None: return self.FAILURE
1639
- return self.lmsg(file, "{} to set mode({})".format(self.PGLOG['MISSFILE'], self.int2base(nmode, 8)), logact)
1638
+ if info != None: return self.FAILURE
1639
+ return self.lmsg(file, "{} to set mode({})".format(self.PGLOG['MISSFILE'], self.int2base(nmode, 8)), logact)
1640
1640
  omode = info['mode']
1641
1641
  logname = info['logname']
1642
1642
  if nmode == omode: return self.SUCCESS
1643
+ if logact and logact&self.EXITLG: logact &= ~self.EXITLG
1644
+ euid = os.geteuid()
1645
+ if euid and logname and pwd.getpwnam(logname).pw_uid != euid:
1646
+ # only the file owner (or root) can chmod; try the pgstart_<owner> setuid wrapper
1647
+ cmd = "chmod {} {}".format(self.int2base(nmode, 8), file)
1648
+ wcmd = self.get_local_command(cmd, logname)
1649
+ msg = "{}: Cannot set mode({}) for file owned by {}".format(file, self.int2base(nmode, 8), logname)
1650
+ if wcmd != cmd:
1651
+ if self.pgsystem(wcmd, logact, 257): return self.SUCCESS
1652
+ if self.PGLOG['SYSERR']: msg += "\n" + self.PGLOG['SYSERR']
1653
+ self.pglog(msg, self.LOGWRN)
1654
+ return self.SUCCESS
1643
1655
  try:
1644
1656
  os.chmod(file, nmode)
1645
1657
  except Exception as e:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_common
3
- Version: 3.0.11
3
+ Version: 3.0.13
4
4
  Summary: RDA Python common library codes shared by other RDA python packages
5
5
  Author-email: Zaihua Ji <zji@ucar.edu>
6
6
  Project-URL: Homepage, https://github.com/NCAR/rda-python-common
@@ -189,7 +189,7 @@ PgLOG.pglog("hello", PgLOG.LOGWRN)
189
189
  python -c "import rda_python_common; print(rda_python_common.__version__)"
190
190
  ```
191
191
 
192
- You should see the installed version (currently `3.0.0`). If the import
192
+ You should see the installed version (currently `3.0.13`). If the import
193
193
  fails, double-check that the active Python environment is the one where you
194
194
  ran `pip install`.
195
195
 
@@ -7,10 +7,10 @@ rda_python_common/PgOPT.py,sha256=tJ8qb2515HaMPR-oLIg8BKalI1BxcmIHcSb0UEYx2K4,56
7
7
  rda_python_common/PgSIG.py,sha256=dVENQ6tvnoa8fSZ8sYenMP4IVKExtU7fdSdKhSLxlWE,35807
8
8
  rda_python_common/PgSplit.py,sha256=SSg5_Qu5PqP44EkqebO-V_cErNcdE2QtORgFHQ7RqlQ,8822
9
9
  rda_python_common/PgUtil.py,sha256=OqESKCd72b9g8m8jwjPJhXDtPYlW6G8oSOhwChvz2Cg,48600
10
- rda_python_common/__init__.py,sha256=WTpasPcnTQMDxRbPXv6vTbQQv8bITdUSkZ_RfdyBtig,994
10
+ rda_python_common/__init__.py,sha256=TKxEaXAFdS7iHllqsAtufwcDOB_dxrNnr_otWnJeJvI,995
11
11
  rda_python_common/pg_cmd.py,sha256=PiQaAeb7l92LceqMwSzLpz9nD5pDRHJcEZxTDn-HeCs,33255
12
12
  rda_python_common/pg_dbi.py,sha256=QYoDJQ9VBGSvlYybhVNcyVAWpw-6BjQxC1tYmxSMjzQ,118481
13
- rda_python_common/pg_file.py,sha256=fZyZAh3N8BWZ0N83YqNqreR_yY0LJVr4bRw1hDSEppI,163492
13
+ rda_python_common/pg_file.py,sha256=1SA509s7Hyp4QgFLl9DTpHD0LCZ-tt8LpGdIp1PIBu4,164198
14
14
  rda_python_common/pg_lock.py,sha256=31EaVDjCkcx3-n8-KnzG18R8Pz7Z6KyFsEqcml6Iq5c,32702
15
15
  rda_python_common/pg_log.py,sha256=crsw6Jb-ZrmYrb7qWivEA37fJMh7JiuIrT-KzG1UAc0,81944
16
16
  rda_python_common/pg_opt.py,sha256=LxVAf47wi2STkVGSXMvV3IZphEJcoO8bvYXy6kQ5ox4,82403
@@ -20,9 +20,9 @@ rda_python_common/pg_split.py,sha256=aAWKUZPmZ-LQ_fJ3DSKzPKxJw0fMDJ2fgP8ZT629M30
20
20
  rda_python_common/pg_util.py,sha256=3_-baqCI9j5bkC2Uw3hRJZtYwdr0FQC6mtgbeIhLwyQ,86045
21
21
  rda_python_common/pgpassword.py,sha256=aTQaO59QokWrv2EKom4TvKhNW2Mr6aFMMBVG4DCbcKI,5023
22
22
  rda_python_common/pgpassword.usg,sha256=Wrle6A8sdlMGx3ZEAmE6TNDPOlG84Whe0T3rCNFzPfY,2013
23
- rda_python_common-3.0.11.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
24
- rda_python_common-3.0.11.dist-info/METADATA,sha256=3Fzp4zxXx5EA8Y6nTCmLE_fc9DOYsnFidBIjUenKPO0,14529
25
- rda_python_common-3.0.11.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
26
- rda_python_common-3.0.11.dist-info/entry_points.txt,sha256=pZgVNWspcK-F1TbPav7C3C9NdeHDZMm_25fW9weix00,65
27
- rda_python_common-3.0.11.dist-info/top_level.txt,sha256=KVQmx7D3DD-jsiheqL8HdTrRE14hpRnZY5_ioMArA5k,18
28
- rda_python_common-3.0.11.dist-info/RECORD,,
23
+ rda_python_common-3.0.13.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
24
+ rda_python_common-3.0.13.dist-info/METADATA,sha256=aUt1kdVu9uQ--LyjaXrq-COpqdC-17ygKcn9Xg-7hlQ,14530
25
+ rda_python_common-3.0.13.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
26
+ rda_python_common-3.0.13.dist-info/entry_points.txt,sha256=pZgVNWspcK-F1TbPav7C3C9NdeHDZMm_25fW9weix00,65
27
+ rda_python_common-3.0.13.dist-info/top_level.txt,sha256=KVQmx7D3DD-jsiheqL8HdTrRE14hpRnZY5_ioMArA5k,18
28
+ rda_python_common-3.0.13.dist-info/RECORD,,