public inbox for speakup@linux-speakup.org
 help / color / mirror / Atom feed
From: William Hubbs <w.d.hubbs@gmail.com>
To: "Speakup is a screen review system for Linux." <speakup@braille.uwo.ca>
Subject: Re: speakupconf problem and fix
Date: Tue, 23 Jun 2009 10:36:31 -0500	[thread overview]
Message-ID: <20090623153631.GA18737@linux1> (raw)
In-Reply-To: <alpine.LNX.2.00.0906222015020.3459@dell.bellsouth.net>

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

Hi Adam,

On Mon, Jun 22, 2009 at 08:25:59PM -0500, Adam Myrow wrote:
> The problem is, the version of find in Slackware 12.2 does not recognize 
> the "-readable" and "-writable" options.  I suspect that they are in some 
> newer version of find.  The "find --version" command gives the following on 
> my system.
>
> GNU find version 4.2.31
> Built using GNU gnulib version 2007-02-24
> Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION

You are correct; you are running an old version of findutils.  find
- --version returns the following here:

find (GNU findutils) 4.4.0
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Eric B. Decker, James Youngman, and Kevin Dalley.
Built using GNU gnulib version e5573b1bad88bfabcda181b9e0125fb0c52b7d3b
Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION FTS() CBO(level=0) 

I also looked in my changelogs, and we have had this version of
findutils since march 2008, so it has been around for quite a while.

> I quickly found the solution.  I modified the problem line to look like 
> this.
>
> SAVELIST=`find . -perm -u+rw -type f |sed 's/..//'`
>
> I believe this accomplishes the same thing as the original line, using the 
> "-perm" flag which is a part of find on just about any Unix system in 
> existence.  Does anybody see any problem with having this change made to 
> the GIT version of speakupconf?  It is probably best to use the most 
> portable syntax where possible to avoid future problems like this. Thanks.

Actually it doesn't do the same thing.  The difference is subtile, but
important.

The solution you propose only works if the user running speakupconf is
also the owner of the files in /sys/accessibility/speakup, which is not
necessarily true.  This is because the -perm flag compares its argument
to the permissions of the files.  The -readable and -writable flags, on
the other hand, test to see if the user running the find has permission
to read and write the files even if the user does not own them.  This is what
we want with speakupconf, since it is possible for different users to
have their own preferred speakup settings.  I don't know of a way to
accomplish this easily without the -readable and -writable flags.

For those of you on the list with newer findutils, here is a great
example of the difference:

As a user, run the following two commands:

find /sbin -perm -u+rw -type f -print
find /sbin -readable -writable -type f -print

They give very different results.

If you can come up with another solution that does the same thing we
are looking for (allows a user to save the files they can read and write
regardless of whether they actually own the files), let me know.

Thanks,

William

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)

iEYEARECAAYFAkpA9n8ACgkQblQW9DDEZThpBACfWomclS8OUY/aPmomGaf6Da6g
HzgAoLM28hCyiX6jvBE9spXqO9w+QwOb
=j41U
-----END PGP SIGNATURE-----

  reply	other threads:[~ UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
 Adam Myrow
 ` William Hubbs [this message]
   ` William Hubbs
     ` Adam Myrow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090623153631.GA18737@linux1 \
    --to=w.d.hubbs@gmail.com \
    --cc=speakup@braille.uwo.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).