[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: quick scripting 'is /P/Q mounted'



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, Mar 13, 2018 at 03:56:00PM -0400, The Wanderer wrote:
> On 2018-03-13 at 15:39, Joe wrote:

[...]

> > I prefer to test for the existence of a known lower directory in
> > this case, which tests not only for mounting but for a successful
> > read.
> 
> That test can be spoofed, however, by the creation of a directory with
> the same name (and/or other characteristics) under the mount point while
> the mount is not active.
> 
> Even if you don't think anything malicious is ever going to try to spoof
> this in whatever case is at hand, can you be sure no script (or, for
> that matter, user) will ever attempt to create that directory under the
> mistaken impression that the mount is active?

Seconded. That depends on what you want to achieve, but if this is some
kind of backup script, if it manages once (by mistake) to sync to the
mount point while no mount is active, it'll keep repeating that mistake
forever...

Cheers
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlqoM9MACgkQBcgs9XrR2kbJfwCdE45msW7x44N4Ma+HQb57oZKO
gMAAnivPzGgYCRXAs6xRRBfVzYwfnrYm
=pRcJ
-----END PGP SIGNATURE-----


Reply to: