109 QString input = QString(),
bool readStdout =
true,
110 bool readStderr =
true);
122 const QString &dest,
bool force);
148 auto passMoveTarget(
const QString &src,
const QString &dest)
const
164 const QFileInfo &srcFileInfo,
const QString &dest,
165 const QString &occupied,
bool force) -> bool;
178 const QFileInfo &srcFileInfo,
193 bool srcIsDir,
bool intoFolder)
203 auto passName(
const QString &path,
bool stripGpg)
const -> QString;
214 [[nodiscard]]
auto insertWritten(
const QString &err)
const ->
bool override;
235 auto listLinesUnder(
const QString &dir,
const QString &except) -> QStringList;
247 auto entryWouldGain(
const QString &entry,
const QStringList &target,
248 const QStringList &before,
249 QHash<QString, std::optional<QSet<QString>>> &probes)
266 auto refuseLinkedList(
const QString &file,
const QString &within = QString(),
267 const QString &except = QString(),
287 const QString &except, QSet<QString> &checked) -> bool;
295 auto storeGit(
const QStringList &args, QString *out) ->
bool override;
318 const QString &repository = QString()) -> QStringList;
327 auto unrecorded(
const QStringList &paths,
bool ignored) -> QStringList;
348 const QStringList &committing) -> bool;
397 const QStringList &moving) -> QStringList;
409 auto checkIgnore(
const QString &repository,
const QStringList &paths,
410 bool verbose, QStringList *fields) -> bool;
453 const QString &except = QString()) -> bool;
477 QSet<QString> &verified,
const QString &within = QString(),
478 const QString &except = QString(),
554 static auto reencryptFailed(
const QString &out,
const QString &err) -> bool;
566 const QHash<QString, qint64> &status) -> bool;
596 void Show(QString file)
override;
603 void Insert(QString file, QString newValue,
bool overwrite)
override;
615 void Remove(QString file,
bool isDir)
override;
617 -> QStringList
override;
619 -> QStringList
override;
627 -> QString
override {
635 void Init(QString path,
const QList<UserInfo> &users)
override;
646 void finished(
int id,
int exitCode,
const QString &out,
647 const QString &err)
override;
657 void Move(
const QString src,
const QString dest,
const bool force)
override;
664 void Copy(
const QString src,
const QString dest,
const bool force)
override;
675 void Grep(QString pattern,
bool caseInsensitive)
override;
The detached signature on a store's .gpg-id: whether the configured signing key is usable,...
Full-text search over a password store without pass grep: every .gpg file is decrypted with gpg on a ...
void cancel()
Ask running searches to stop without waiting for them: the walk ends at the next file and a gpg that ...
Enums::PROCESS PROCESS
Alias for Enums::PROCESS used throughout this class.
Pass()
Construct a Pass instance.
QHash< QString, SkippedWalk > SkippedWalks
SkippedWalk per absolute folder, for one check of many folders.
QHash< QString, std::optional< QString > > LinkedWalks
void finishLinkCommit(const LinkCommit &commit, const QString &out, const QString &err)
Judge a queued linked-folder removal commit by what is left staged in the store it ran in: pass git e...
void reportReencryptFailure(Enums::PROCESS pid, const QString &out, const QString &err)
Report a pass init, mv or cp that exited 0 having left entries encrypted to the previous recipients: ...
QQueue< QString > m_reencryptPending
void Remove(QString file, bool isDir) override
Remove an entry or folder with pass rm.
void Init(QString path, const QList< UserInfo > &users) override
Initialize password store.
auto refuseUnrecordedChanges(const QStringList &paths, const QStringList &committing) -> bool
Refuse a pass init, mv, cp or insert when paths hold changes git has not recorded,...
void Copy(const QString src, const QString dest, const bool force) override
Copy password file or directory.
auto entryWouldGain(const QString &entry, const QStringList &target, const QStringList &before, QHash< QString, std::optional< QSet< QString > > > &probes) -> bool
Whether pass re-encrypting entry to target would hand it to someone who cannot read it now,...
auto unrecorded(const QStringList &paths, bool ignored) -> QStringList
What git has not recorded at paths: git status --porcelain lines, through pass git....
auto storeGit(const QStringList &args, QString *out) -> bool override
Run a git command in the store through pass git, blocking.
bool m_pushAfterReencrypt
QQueue< InsertRecord > m_insertPending
auto recipientArgument(const QString &line) const -> QString override
As written: pass hands each line to gpg itself, so the probe must reach what pass will.
auto checkIgnore(const QString &repository, const QStringList &paths, bool verbose, QStringList *fields) -> bool
git check-ignore --stdin -z on paths through pass git.
auto refuseSpecialEntry(const QString &entry) -> bool
Refuse, and tell the user, when entry is set: an entry named like a password that is no regular file,...
auto refuseIgnoredThatMoves(const QString &src, const QString &dest) -> bool
Refuse a pass mv or cp of the folder src when a file in it that Git ignores would not be ignored wher...
auto passMoveTarget(const QString &src, const QString &dest) const -> PassMoveTarget
Name src and dest for pass mv/pass cp, and work out where pass 1.7.4 then puts the source.
auto stopsAtOccupiedTarget(PROCESS id, const QString &src, const QFileInfo &srcFileInfo, const QString &dest, const QString &occupied, bool force) -> bool
Whether a move or copy stops at what already lies where pass writes: a file dest the user declined to...
auto ignoredByRulesWithin(const QString &repository, const QString &from, const QStringList &moving) -> QStringList
Those of moving that a .gitignore inside the folder from ignores, by git check-ignore -v: the rule mo...
auto entriesInitWouldWiden(const QString &dir, const QList< UserInfo > &users) -> QStringList override
Entries a pass init of dir with users would hand to someone who cannot read them now (an entry copied...
auto entriesMoveWouldWiden(const QString &src, const QString &dest) -> QStringList override
Entries already in the place a pass mv or pass cp of src to dest re-encrypts (the whole destination f...
auto refuseMoveOrCopyRisks(PROCESS id, const QString &src, const QFileInfo &srcFileInfo, const PassMoveTarget &target) -> bool
Whether a move or copy is refused for what pass would do along the way: re-encrypt to an unverified l...
void Insert(QString file, QString newValue, bool overwrite) override
Insert new password.
static auto reencryptFailed(const QString &out, const QString &err) -> bool
Whether a pass init, mv or cp that exited 0 left entries as they were: pass carries on past an entry ...
void Show(QString file) override
Show decrypted password.
InsertRecord m_insertDone
The insert whose completion is being handled.
void reportUnrecorded(const QStringList &paths)
After a pass insert, init, mv or cp that exited 0, say so when git did not record the entries it wrot...
RealPass()
Construct a RealPass instance.
void onDequeuing(int id, bool completes)
The executor is about to run (or drop) its next item: for an insert, take its entry from m_insertQueu...
auto refuseLinkInCopiedFolder(const QString &src) -> bool
Refuse a pass cp of the folder src when anything in it is a symbolic link or NTFS junction,...
auto refuseLinkedList(const QString &file, const QString &within=QString(), const QString &except=QString(), LinkedWalks *walks=nullptr) -> bool
Refuse to have pass encrypt file when the walk to its list meets a .gpg-id that is a link or junction...
void passMoveOrCopy(PROCESS id, const QString &subcommand, const QString &src, const QString &dest, bool force)
Shared implementation of Move and Copy via pass mv/pass cp.
auto passName(const QString &path, bool stripGpg) const -> QString
path as pass names it: relative to the store, without the .gpg pass appends itself.
auto refuseUnverifiedList(const QString &file) -> bool
Refuse to have pass encrypt file when the list it would use is a link (refuseLinkedList()),...
auto refuseList(const QString &file, const GpgIdSigner &signer, QSet< QString > &verified, const QString &within=QString(), const QString &except=QString(), SkippedWalks *walks=nullptr) -> bool
The checks of refuseUnverifiedList() for file's nearest list, once per list.
auto repositoryOf(const QString &path) -> QString
The Git repository pass commits path in: the store's own, or one a folder in it holds (pass looks for...
void sendDeferredPush()
Once the last queued init, move or copy has completed, make the push asked for meanwhile (GitPush())....
static auto entryFingerprint(const QString &path) -> QByteArray
A SHA-256 of the size and first 64 KiB of the regular file path (opened without following a link or b...
void GitInit() override
Initialize Git repository in password store.
QQueue< QString > m_reencryptScopes
auto statusEntries(const QStringList &args, const QString &repository=QString()) -> QStringList
git status --porcelain -z through pass git, read: one "XY name" per entry, a rename's old name droppe...
void GitPull() override
Pull changes from remote.
auto listLinesUnder(const QString &dir, const QString &except) -> QStringList
The lines of every folder's own .gpg-id that pass's walk of dir meets, for keyLinesHeldTwice(): pass ...
bool m_deferredPushByHand
One of those pushes was asked for by hand: it goes despite a hold.
QQueue< LinkCommit > m_linkCommits
void removeLinkedFolder(const QString &full)
Remove a linked folder for Remove(): unlink it here, so that pass rm -rf cannot follow it,...
void Move(const QString src, const QString dest, const bool force) override
Move password file or directory.
auto linesPassEncryptsTo(const QString &src, const PassMoveTarget &target, bool srcIsDir, bool intoFolder) -> QStringList
The recipient lines pass re-encrypts to when it moves or copies src as target says: the destination's...
void finished(int id, int exitCode, const QString &out, const QString &err) override
Finish a process; a linked-folder removal commit (GIT_COMMIT, which RealPass uses for nothing else) i...
void GitPull_b(int timeoutMs) override
Run pass git pull and wait for it, at most timeoutMs.
void finishRecipientRun(Enums::PROCESS pid, int exitCode, const QString &out, const QString &err)
Finish a pass init, mv or cp: hold the automatic push for a run that left entries to the previous rec...
auto refuseLineBreakName(const QString &path) -> bool
Refuse, and tell the user, when the store-relative name of path holds a line feed or carriage return.
void CancelGrep() override
Stop the running search (NativeGrep::cancel()).
void executePass(PROCESS id, const QStringList &args, QString input=QString(), bool readStdout=true, bool readStderr=true)
Execute pass command with arguments.
void GitPush() override
Push changes to remote.
auto insertWritten(const QString &err) const -> bool override
Whether the failed pass insert wrote its entry before its git step failed. pass does not say,...
auto refuseMisreadList(const QString &file, const QString &within, const QString &except, QSet< QString > &checked) -> bool
Refuse to have pass encrypt file when its nearest .gpg-id holds lines pass reads differently from the...
void Grep(QString pattern, bool caseInsensitive) override
Search all password content by GPG-decrypting each real .gpg file, as ImitatePass does.
auto refuseUnverifiedTree(const QString &dir, bool onlyListsWithin, const QString &except=QString()) -> bool
For a folder pass is about to re-encrypt in a move or copy: refuse when an entry pass's walk takes (h...
auto listSigner() -> GpgIdSigner
The verifier for signed lists, gpg in the store's environment.
QQueue< QString > m_insertQueue
The entries of the queued inserts, oldest first.
PROCESS
Identifies different subprocess operations used in QtPass.
NativeGrep, the content search that decrypts every entry on a worker thread instead of running pass g...
Pass, the abstract password-store backend that RealPass and ImitatePass implement,...
QString target
The entry's file.
QByteArray before
Its fingerprint when the insert started.
QString rel
The folder, relative to the store.
QProcessEnvironment environment
What pass mv/pass cp is handed and what it then does with it.
QString passSrc
The source name handed to pass.