Bug 7136 - xdg-su without -c prompts for password but does nothing
Summary: xdg-su without -c prompts for password but does nothing
Status: RESOLVED FIXED
Alias: None
Product: Portland
Classification: Unclassified
Component: xdg-utils (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Portland Integration Project
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-06 13:37 UTC by Tom Whipple
Modified: 2006-07-21 09:54 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Tom Whipple 2006-06-06 13:37:28 UTC
When "xdg-su 'touch foo.txt'" is run, the user is presented with a password
dialog, but the command (touch foo.txt) is not executed. xdg-su exits with code 4.

It appears that something flashes on the dialog before it goes away, but this
happens too fast for me to read.


This should probably fail with a usage message, since this case does not match
the documentation. It could also be fixed so that the -c is optional (much like
sudo).


Environment: Suse 10.0; Gnome 2.12.0
Comment 1 Bryce Harrington 2006-06-09 20:43:57 UTC
I cannot reproduce this bug on gentoo linux using the steps described.

If the current directory is owned by the executing user, then regardless of
whether a correct password is given, foo.txt exists at the termination of the
program.

If the current directory is set as writable only by root and the executing user
is not root, then if a correct password is given, a foo.txt file appears, owned
by root.  If Ignore is specified, then no file is created, and the following
error message appears:

 $ ./xdg-su 'touch foo.txt'
 touch: cannot touch `foo.txt': Permission denied
 $ echo $?
 4

If cancel is clicked instead, the program exits with error code 0, with no
message, and with no file created.

Could you provide some additional details about how to reproduce this bug?
Comment 2 Tom Whipple 2006-06-12 08:39:24 UTC
It appears that this bug has environment dependencies.

In my environment, I (Suse 10.0; Gome 2.12.0) I get identical result for each of
the follwing user inputs to the su password dialog:
1. Correct password. 
2. User clicks "cancel"
3. Bad password.

In each case the file is NOT created and no error message is printed. Exit code
is 4.

 $ xdg-su 'touch foo.txt'; echo $?
 4
Comment 3 Tom Whipple 2006-06-14 16:29:09 UTC
I would also think that we would want to allow xdg-su to pass an exit code of
whatever is being run in privelaged mode back to the caller.

For example:
  $ xdg-su -c 'exit 2' ; echo $?
  4

Should return 2 or something like ERROR+2 for some fixed ERROR value.
Comment 4 Tom Whipple 2006-07-21 09:54:18 UTC
This appears to be fixed for BETA2. 

Covered by test case xdg-su/t.su_no_cflag


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.