/usr/share/xul-ext/enigmail/modules/attachment.jsm is in enigmail 2:1.9.9-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | /*global Components: false, escape: false, unescape: false */
/*jshint -W097 */
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
"use strict";
var EXPORTED_SYMBOLS = ["EnigmailAttachment"];
const Cu = Components.utils;
Cu.import("resource://enigmail/execution.jsm"); /*global EnigmailExecution: false */
Cu.import("resource://enigmail/log.jsm"); /*global EnigmailLog: false */
Cu.import("resource://enigmail/gpgAgent.jsm"); /*global EnigmailGpgAgent: false */
Cu.import("resource://enigmail/passwords.jsm"); /*global EnigmailPassword: false */
Cu.import("resource://enigmail/gpg.jsm"); /*global EnigmailGpg: false */
Cu.import("resource://enigmail/data.jsm"); /*global EnigmailData: false */
const EnigmailAttachment = {
getFileName: function(parent, byteData) {
EnigmailLog.DEBUG("attachment.jsm: getFileName\n");
const args = EnigmailGpg.getStandardArgs(true).
concat(EnigmailPassword.command()).
concat(["--decrypt"]);
const listener = EnigmailExecution.newSimpleListener(
function _stdin(pipe) {
EnigmailLog.DEBUG("attachment.jsm: getFileName: _stdin\n");
pipe.write(byteData);
pipe.write("\n");
pipe.close();
});
listener.stdout = function(data) {};
const proc = EnigmailExecution.execStart(EnigmailGpgAgent.agentPath, args, false, parent, listener, {});
if (!proc) {
return null;
}
proc.wait();
const matches = listener.stderrData.match(/^(\[GNUPG:\] PLAINTEXT [0-9]+ [0-9]+ )(.*)$/m);
if (matches && (matches.length > 2)) {
var filename = matches[2];
if (filename.indexOf(" ") > 0) {
filename = filename.replace(/ .*$/, "");
}
return EnigmailData.convertToUnicode(unescape(filename), "utf-8");
}
else {
return null;
}
}
};
|