Bug 303971 - Validation of 'Home Directory' within Create/Modify user [NEEDINFO]
Validation of 'Home Directory' within Create/Modify user
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: system-config-users (Show other bugs)
9
All Linux
low Severity low
: ---
: ---
Assigned To: Nils Philippsen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-09-24 16:36 EDT by ray hammond
Modified: 2009-07-14 14:13 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-07-14 14:13:38 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
nphilipp: needinfo? (ray.hammond77)


Attachments (Terms of Use)

  None (edit)
Description ray hammond 2007-09-24 16:36:08 EDT
Description of problem:
The home directory box permits special character i.e. ~ (tilda) or ` (backwards
quote).  The inclusion of these characters results in the failure to create the
home directory.

Version-Release number of selected component (if applicable):
1.2.64

How reproducible:
Every time

Steps to Reproduce:
1.Open system-config-users.
2.Select 'Create new user'.
3.Enter a name i.e. Boris.
4.Enter the password in both fields.
5.Ensure the checkbox 'Create home directory' is selected.
6.Enter a home directory lile `rm -rf *`
7.Press OK.
  
Actual results:
The user is created; however, the directory was not created, which is expected
but when the new user logs (via a terminal) he is faced with errors.

Expected results:
The utility should not permit special characters.  Additionally, the utility
would also benefit from informing the user of any failures experienced when
creating the home directory.


Additional info
Comment 1 Nils Philippsen 2007-10-04 05:20:30 EDT
I've added guards against some problems with the home directory to s-c-users
upstream:

- non-absolute dirs (i.e. not beginning with a slash)
- dirs containing empty ("/home//foo") or illegal or undesirable
("/home/../foo", "/home/./foo") path components
- path components which are too long ("/home/<more than 255 characters>/foo")

Contrary to what you say, tildes, backticks, asterisks and other "special"
characters are permissible as home directories (except the colon as it's used as
the field separator in /etc/passwd) and I've tried it out and confirmed that
these work if the rules above are kept in mind (tried it with "/home/blah~",
/home/blah`", "/home/rm -rf *").
Comment 2 Nils Philippsen 2007-10-04 05:20:59 EDT
"... permissible in home directories ..." even.
Comment 3 Nils Philippsen 2007-10-05 10:53:20 EDT
I've built system-config-users-1.2.69-1.fc8 for Rawhide, but I'll wait a while
to pick up translations before I'll build (a later version) for F7. It would be
good if you could try out whether 1.2.69 from Rawhide fixes things for you in
the meantime.
Comment 4 ray hammond 2007-10-19 17:46:20 EDT
I have just tested the reported bug using version 1.2.72 on Fedora 8 Test 3.  

I managed to find the following.

1) Open system-config-users.
2) Click create new user
3) Enter the 'User Name' as kate
4) Leave 'Full Name' blank.
5) Enter 'Password' as password and re-enter to confirm.
6) Ensure 'Create home directory' is checked.
7) Enter 'Home directory' as "/home/kate;rm -rf /*"
8) Press OK.

The utility creates the user without any warnings.  If you open a shell, as
root, and type 'su - kate' you get the following warning.

su warning: cannot change directory to /home/kate;`rm -rf /*`: No such file or
directory.
Comment 5 Nils Philippsen 2007-10-22 06:18:34 EDT
(In reply to comment #4)

> The utility creates the user without any warnings.  If you open a shell, as
> root, and type 'su - kate' you get the following warning.
> 
> su warning: cannot change directory to /home/kate;`rm -rf /*`: No such file or
> directory.

Ray, after you created the user, was there a directory "/home/kate;`rm -rf /*`"?

Mirek, do you know about limitations/regulations which prohibited such ludicrous
 paths for home directories or do you think we shall assume that this behaviour
is a bug in su, pam or the login scripts?

Comment 6 ray hammond 2007-10-22 17:36:38 EDT
The directory is not created.

Additionally, the shell in which I started the utility has the following error:

Traceback (most recent call last):
  File "/usr/share/system-config-users/userWindow.py", line 398, in on_userWin_
ok_button_clicked
    self.parent.ADMIN.addUser(userEnt, mkhomedir = True)
RuntimeError: Error creating `/home/kate;`rm -rf /*`': No such file or director
y
Comment 7 Nils Philippsen 2007-10-23 04:51:21 EDT
(In reply to comment #6)
> The directory is not created.
> 
> Additionally, the shell in which I started the utility has the following error:
> 
> Traceback (most recent call last):
>   File "/usr/share/system-config-users/userWindow.py", line 398, in on_userWin_
> ok_button_clicked
>     self.parent.ADMIN.addUser(userEnt, mkhomedir = True)
> RuntimeError: Error creating `/home/kate;`rm -rf /*`': No such file or
> directory

This is something different -- it tries to create a directory "*`" beneath
"kate;`rm -rf " in /home which doesn't exist. As it is, system-config-users can
only create home directories in already existing directories and fails badly
(with the traceback you've seen) if they don't. I'll clone this bug for that
problem.

If you don't have additional slashes in the home directory, does it work then?
Comment 8 ray hammond 2007-10-26 17:02:25 EDT
Without the last forward slash the directory is created without any problems.
Comment 9 Bug Zapper 2008-05-14 10:28:45 EDT
This message is a reminder that Fedora 7 is nearing the end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 7. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '7'.

Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 7's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 7 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug. If you are unable to change the version, please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. If possible, it is recommended that you try the newest available Fedora distribution to see if your bug still exists.

Please read the Release Notes for the newest Fedora distribution to make sure it will meet your needs:
http://docs.fedoraproject.org/release-notes/

The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 10 ray hammond 2008-06-04 18:56:16 EDT
The problem still exists in Fedora 9.
Comment 11 Bug Zapper 2009-06-09 18:51:53 EDT
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '9'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 9's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 9 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 12 Nils Philippsen 2009-06-10 10:55:28 EDT
Is there any other issue from this not resolved besides what is described in the clones bug #346491, i.e. that it fails to create missing parent directories?
Comment 13 Bug Zapper 2009-07-14 14:13:38 EDT
Fedora 9 changed to end-of-life (EOL) status on 2009-07-10. Fedora 9 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

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