This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 189012 - hp-toolbox umask causes owner-only readable qt settings file when run as root
hp-toolbox umask causes owner-only readable qt settings file when run as root
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: qt (Show other bugs)
6
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Ngo Than
Ben Levenson
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-04-14 13:29 EDT by Bernard Johnson
Modified: 2007-11-30 17:11 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-11-09 15:22:42 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Bernard Johnson 2006-04-14 13:29:23 EDT
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 Ngo Than 2006-04-27 10:04:41 EDT
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 12:11:33 EDT
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 12:31:38 EDT
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 11:54:55 EDT
I agree with Bernard.  Can't qt use chmod on that file if it's meant to be
globally readable?
Comment 5 Ngo Than 2006-05-17 11:30:11 EDT
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 06:06:04 EDT
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 04:43:05 EST
Just saw a report of this with FC6 on fedora-list as well.  Re-opening.
Comment 8 Ngo Than 2006-11-09 15:22:42 EST
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.