Bug 189012 - hp-toolbox umask causes owner-only readable qt settings file when run as root
Summary: hp-toolbox umask causes owner-only readable qt settings file when run as root
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: qt
Version: 6
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Than Ngo
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-04-14 17:29 UTC by Bernard Johnson
Modified: 2007-11-30 22:11 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-11-09 20:22:42 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Bernard Johnson 2006-04-14 17:29:23 UTC
Description of problem:
If a qt program is run by root, the program is able to write a file
/usr/lib/qt-3.3/etc/settings/qt_plugins_3.3rc.  This file is created with mode
600 permissions.  When a normal user then tries to run a qt program (hp-toolbox
from hplip in this case), the following error is emitted:

[bjohnson@localhost settings]$ hp-toolbox

HP Linux Imaging and Printing System (ver. 0.9.9)
HP Device Manager ver. 6.2

Copyright (c) 2003-6 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

QSettings: failed to open file '/usr/lib/qt-3.3/etc/settings/qt_plugins_3.3rc'
[bjohnson@localhost settings]$

This is a minor problem, as it seem to not affect the operation of the program
at all.  It is however confusing when you have other problems you are trying to
solve and not sure if this is related.

Version-Release number of selected component (if applicable):
qt-3.3.5-13

How reproducible:
always

Steps to Reproduce:
1. run qt program as root
2. run qt program as normal user
3.
  
Actual results:
QSettings: failed to open file '/usr/lib/qt-3.3/etc/settings/qt_plugins_3.3rc'

Expected results:
No error

Additional info:

Comment 1 Than Ngo 2006-04-27 14:04:41 UTC
qt uses the default umask setting to set the file permission when it's created.
It seems your umask setting is not correct here. set umask 0022 will fix
the problem


Comment 2 Bernard Johnson 2006-04-27 16:11:33 UTC
Oh, I see now.  It's actually line 272 in hp-toolbox setting the umask (0.9.10-1.3).

Comment 3 Bernard Johnson 2006-04-27 16:31:38 UTC
It still seems to me the root of the problem is that qt should set the umask to
a sane value before it writes a file that _everyone_ is expected to be able to use.

Comment 4 Tim Waugh 2006-05-12 15:54:55 UTC
I agree with Bernard.  Can't qt use chmod on that file if it's meant to be
globally readable?

Comment 5 Than Ngo 2006-05-17 15:30:11 UTC
I have taken a look at the hp-toolbox and qt source. Qt tries to read the global
setting first and then the local settings in $HOME/.qt. So this warning is
needless here and should be ignored. I will disable this annoying warning in
next Qt rebuild.


Comment 6 Mary Ellen Foster 2006-07-11 10:06:04 UTC
I still get this "annoying warning" with qt-3.3.6-0.4.fc5 (the latest from
updates-testing); maybe the fix for the warning slipped through the cracks? It
would be good to get rid of it, as it just causes noise every time I run any QT
app from the command line.

Comment 7 Tim Waugh 2006-11-02 09:43:05 UTC
Just saw a report of this with FC6 on fedora-list as well.  Re-opening.

Comment 8 Than Ngo 2006-11-09 20:22:42 UTC
it's now really fixed in qt-3.3.7-1.fc7. The fix will be included in next qt 
build for FC6 update.


Note You need to log in before you can comment on or make changes to this bug.