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