Thread-topic: Changing permissions on system files
Comments below...
-----Original Message-----
From: java-dev-bounces+eric.kolotyluk=email@hidden
[mailto:java-dev-bounces+eric.kolotyluk=email@hidden] On
Behalf Of Greg Guerin
Sent: Saturday, January 28, 2006 2:43 PM
To: email@hidden
Subject: Re: Changing permissions on system files
Eric Kolotyluk wrote:
>I've written some code during our application start up that checks all
>the usual places for fonts to see if Arial and Helvetica have been
>removed. If they have, I throw up a dialog asking them if they want to
>install Helvetica. I use the Lucida Grande font for the dialog because
>I'm told that if Lucida Grande is missing, Mac OS won't run very well
>anyway (so the point is moot).
A reasonable strategy.
>I thought the best place to install Helvetica would be
>
>/System/Library/Frameworks/JavaVM.framework/versions/1.4.2/Home/lib/fon
t
>s
Have you confirmed that installing Helvetica there actually prevents
crashes?
[Eric Kolotyluk] Not myself, but according to our service people it
cures the problem.
Although Java code might look there, I don't think Mac OS X native code
will, and it's native code that's the problem. However, I could be
wrong,
so I suggest a deliberate crash-test.
[Eric Kolotyluk] Oooh, good point, I never thought of that before. I've
tried several times, with my own Macintosh, to cause our Java
application to crash by removing fonts from the various directories in
the system, but haven't been successful yet. I don't know if it's the
version of the OS or the version of Java. I've tried to get more
information about our customer's systems when there's a problem, but
none of our customers seem interested in helping and our service people
don't want to push the issue.
I don't know of an app-specific Fonts folder, only user-specific. Adobe
and some other mfgrs have app-specific font folders, but I think that
uses
app-specific code they wrote. Whether the JVM does this or not, I don't
know, which is why I suggest the crash-test.
>However, this
>directory is owned by root, and there is no write access for the wheel
>group or others. I thought I could temporarily chown the fonts
directory
>to a user with admin rights, install the font file, then chown it back
>to root.
Since you'd have to be root in order to chown the dir, you can just do
the
copy as root directly, and not have to chown anything. Ownership and
privileges are irrelevant when you're omnipotent.
So doing this as root:
chown $ADMIN $FONTDIR
cp $FONTPARKING/Helvetica.dfont $FONTPARKING/Arial.dfont $FONTDIR
chown root $FONTDIR
can be replaced by:
cp $FONTPARKING/Helvetica.dfont $FONTPARKING/Arial.dfont $FONTDIR
I also recommend ensuring the installed fonts are always readable,
regardless of what the permissions are in $FONTPARKING:
chmod a+r $FONTDIR/Helvetica.dfont $FONTDIR/Arial.dfont
Which must also be done as root.
Although I'm using shell variables for the example, you can of course
hard-wire whatever text you want. If you do want to user
shell-variables
in a single exec(), I suggest the 'env' command, with 'sh -c' as its
target
command. If that doesnt make sense after reading 'man env' and 'man
sh',
ask again.
-- GG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden
m
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden
This email sent to email@hidden