automount: don't allow autorun for things we mount at startup

We don't want to potentially flood the user with notifications about
mounts when starting up the system.

https://bugzilla.gnome.org/show_bug.cgi?id=660595
This commit is contained in:
Cosimo Cecchi 2012-06-19 14:49:40 -04:00
parent cbb8d5b0dc
commit 646435ee3e

View File

@ -123,7 +123,8 @@ const AutomountManager = new Lang.Class({
let volumes = this._volumeMonitor.get_volumes(); let volumes = this._volumeMonitor.get_volumes();
volumes.forEach(Lang.bind(this, function(volume) { volumes.forEach(Lang.bind(this, function(volume) {
this._checkAndMountVolume(volume, { checkSession: false, this._checkAndMountVolume(volume, { checkSession: false,
useMountOp: false }); useMountOp: false,
allowAutorun: false });
})); }));
return false; return false;
@ -201,7 +202,8 @@ const AutomountManager = new Lang.Class({
_checkAndMountVolume: function(volume, params) { _checkAndMountVolume: function(volume, params) {
params = Params.parse(params, { checkSession: true, params = Params.parse(params, { checkSession: true,
useMountOp: true }); useMountOp: true,
allowAutorun: true });
if (params.checkSession) { if (params.checkSession) {
// if we're not in the current ConsoleKit session, // if we're not in the current ConsoleKit session,
@ -236,14 +238,16 @@ const AutomountManager = new Lang.Class({
if (params.useMountOp) { if (params.useMountOp) {
let operation = new ShellMountOperation.ShellMountOperation(volume); let operation = new ShellMountOperation.ShellMountOperation(volume);
this._mountVolume(volume, operation.mountOp); this._mountVolume(volume, operation.mountOp, params.allowAutorun);
} else { } else {
this._mountVolume(volume, null); this._mountVolume(volume, null, params.allowAutorun);
} }
}, },
_mountVolume: function(volume, operation) { _mountVolume: function(volume, operation, allowAutorun) {
this._allowAutorun(volume); if (allowAutorun)
this._allowAutorun(volume);
volume.mount(0, operation, null, volume.mount(0, operation, null,
Lang.bind(this, this._onVolumeMounted)); Lang.bind(this, this._onVolumeMounted));
}, },