Commit Graph

12 Commits

Author SHA1 Message Date
Noam Postavsky
c00a03a26f Fix secure URL checking for :type elpa
* el-get-methods.el (el-get-insecure-check): Also consider URLs
satisfying `file-name-absolute-p' to be secure.  `package-archives' uses
absolute file names *without* file:// prefix, so we have allow this too.
* methods/el-get-elpa.el (el-get-elpa-package-id):
(el-get-elpa-package-archive-base): New compat functions.
* methods/el-get-elpa.el (el-get-elpa-install): Call
`el-get-insecure-check' after ensuring `package-archive-contents' is
initialized.
2016-10-08 22:00:41 -04:00
Noam Postavsky
58d071a26c Additional (failing) test for ELPA+allow-insecure 2016-10-08 20:04:12 -04:00
Mykola Nikishov
63be589c1d Delegate install and update actions for github to git
github method, as a derived method, should build a final repository URL
and let parent's respective methods do the actual work.

Register new 'el-get-github-pull function as update method.

Make both methods, 'el-get-github-pull and 'el-get-github-clone,
implement the same pattern:

- Delegate check if URL is a secure one to the parent method
- Ignore :url from package's recipe passed by 'el-get-do-update as it
  makes no sense
- Unconditionally build package repository URL with 'el-get-github-url
- Call respective git method
2016-09-19 08:42:04 +03:00
Noam Postavsky
b8cfcd981a elpa-feature test: don't make a mess in $HOME
* test/el-get-tests.el (el-get-elpa-feature): Use the temp
user-emacs-directory, don't make a mess in user's $HOME.
2016-09-18 16:18:04 -04:00
Noam Postavsky
e80bfd4ec9 Prevent jump to debugger from failed assertion
In Emacs 25.1, a failed cl-assert will always jump to the debugger if
debug-on-error is non-nil.  In batch-mode runs this becomes confusing
with the message suppression we have, and the crazy long stack traces
that are printed are really hard to read, so suppress this debugger
behaviour with advice as well.
2016-09-18 16:03:30 -04:00
Mykola Nikishov
cb02c71181 Customize list of secure URL protocols via 'el-get-secure-protocols 2016-09-06 08:49:29 +03:00
Mykola Nikishov
600ddcee76 Treat 'bzr+ssh', 'git+ssh' and 'sftp' as secure protocols 2016-09-05 06:48:21 +03:00
Mykola Nikishov
6a724f9168 Add few more 'insecure' URLs to the test
For some reason, these, X-over-SSH protocols, are not considered as
secure by 'el-get-insecure-check:
- git+ssh
- bzr+ssh
- sftp
2016-09-05 06:48:21 +03:00
Mykola Nikishov
17b0da4984 Package with empty :checksum is insecure
For compatibility with Emacs versions before 24.4, fall back to
'string-match if 'string-blank-p from subr-x is not available.
2016-09-05 06:48:18 +03:00
Mykola Nikishov
070dddde7e Consider URL pointing to a local file as secure
URL starting with 'file:///' (hostname is empty) is secure because it
always points to a local file.

OTOH, 'file://example.com/' (with any hostname, including 'localhost'
and '127.0.0.1') is insecure as it may refer to the remote file and
deciding if some hostname is actually a local in given moment in time is
tricky and too error-prone.
2016-09-03 22:22:14 +03:00
Mykola Nikishov
e8c3ec6c80 Add test for 'el-get-insecure-check 2016-09-01 13:39:24 +03:00
Noam Postavsky
d79c395f22 enable ert tests in travis, reorganize test files
rename ert tests file test.el => el-get-tests.el
move el-get-issue-* files to separate dir
2015-11-13 23:39:27 -05:00