Bug 303971

Summary: Validation of 'Home Directory' within Create/Modify user
Product: [Fedora] Fedora Reporter: ray hammond <ray.hammond77>
Component: system-config-usersAssignee: Nils Philippsen <nphilipp>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 9CC: mitr, triage
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-07-14 18:13:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description ray hammond 2007-09-24 20:36:08 UTC
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 09:20:30 UTC
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 09:20:59 UTC
"... permissible in home directories ..." even.

Comment 3 Nils Philippsen 2007-10-05 14:53:20 UTC
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 21:46:20 UTC
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 10:18:34 UTC
(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 21:36:38 UTC
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 08:51:21 UTC
(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 21:02:25 UTC
Without the last forward slash the directory is created without any problems.

Comment 9 Bug Zapper 2008-05-14 14:28:45 UTC
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 22:56:16 UTC
The problem still exists in Fedora 9.

Comment 11 Bug Zapper 2009-06-09 22:51:53 UTC
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 14:55:28 UTC
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 18:13:38 UTC
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.

Comment 14 Red Hat Bugzilla 2023-09-14 01:11:29 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days