jaymzh / pius

PGP Individual User Signer
Other
97 stars 25 forks source link

Fixed pathing for OSes (GPG, TMP, Home, etc. for Windows/Linux/Unix) #104

Closed F9Alejandro closed 5 years ago

F9Alejandro commented 6 years ago

Updated single commit to better track/organize for pulling.

libpius/path.py handles pathing of the local machine and determines what to use or do based on the host OS.

set_tmpdir() is hard coded for Mac (Darwin) and linux as $TMPDIR doesn't respond correctly or is not an env variable in varying versions.

(Note: MacOS uses mktemp which is not able to be accessed by anyone except the user, some versions of linux use $TMP/$TEMP/$TMPDIR/$TEMPDIR or just doesn't exist at all) includes root

F9Alejandro commented 6 years ago

Changes made has been tested on Mac, Linux, and Windows. pius.spec needs to have cross compatibility for other OSes, or multi stage depending on the platform run a different set of instructions.

jaymzh commented 6 years ago

I see I hadn't been very clear on some of my comments before - my apologies. Please don't hesitate to ask for further clarification on anything else. Thanks again for improving the experience for non-Linux users!

F9Alejandro commented 6 years ago

Remember that windows does not use the same structure tree as Linux there is no such thing as /usr in windows. If you want it removed then you can freely do so give me a few minutes and I will add you as a maintainer/contributor on my git repo

Sent from my T-Mobile 4G LTE Device -------- Original message --------From: Phil Dibowitz notifications@github.com Date: 9/23/18 00:38 (GMT-05:00) To: jaymzh/pius pius@noreply.github.com Cc: Alexander Featherson bytor10@live.com, Author author@noreply.github.com Subject: Re: [jaymzh/pius] Fixed pathing for OSes (GPG, TMP, Home, etc. for Windows/Linux/Unix) (#104)

@jaymzh commented on this pull request.

In libpius/path.py:

@@ -0,0 +1,124 @@ +'''A set of path functions and variables for the PIUS suite.''' +from future import print_function + +import os +import sys +import stat +from os.path import abspath +import fnmatch + +LINUX_TEMPDIR = '/tmp/' +BIN_PATHS = '/usr/bin;/usr/sbin/;/bin;/sbin;/usr/local/bin;/usr/local/sbin'

No distribution installs software into /usr/local - that's now how FSB works. /usr/local is where user-compiled software goes, which is not where we'd expect security-sensitive software like GPG to be on a Linux machine. We should not look in /usr/local by default on windows unless to user asks us to. Remember the user can do so with a config file by adding gpg-path=/usr/local/bin/gpg to their .piusrc. That's why we have a config file for anyone with a non-standard configuration. —

You are receiving this because you authored the thread.

Reply to this email directly, view it on GitHub, or mute the thread.

F9Alejandro commented 6 years ago

Latest commit should fix the last of your major concerns, push come to shove i could make it more narrowed down to just Cellar (Homebrew) and MacGPG2 (GPG Tools suite)

F9Alejandro commented 6 years ago

Resolved the issue about order of pius home checks in turn also fixing a hard coded path that should be checked if it is a dir or not.