FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 07-20-2011, 11:02 AM
Martin Gracik
 
Default Copy skel files even if the home directory exists (#598957)

---
modules/create_user.py | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/modules/create_user.py b/modules/create_user.py
index 7e87dd6..d1b9365 100644
--- a/modules/create_user.py
+++ b/modules/create_user.py
@@ -24,6 +24,7 @@ import os.path
import pwd
import unicodedata
import re
+import shutil

from firstboot.config import *
from firstboot.constants import *
@@ -230,7 +231,22 @@ class moduleClass(Module):
gtk.main_iteration(False)

os.chown("/home/%s" % username, uidNumber, gidNumber)
- os.path.walk("/home/%s" % username, self._chown, (uidNumber, gidNumber))
+ os.path.walk("/home/%s" % username, self._chown, (uidNumber,
+ gidNumber))
+
+ # copy skel files
+ for fname in os.listdir("/etc/skel"):
+ dst = "/home/%s/%s" % (username, fname)
+ if not os.path.exists(dst):
+ src = "/etc/skel/%s" % fname
+ if os.path.isdir(src):
+ shutil.copytree(src, dst)
+ os.path.walk(dst, self._chown, (uidNumber,
+ gidNumber))
+ else:
+ shutil.copy2(src, dst)
+ os.chown(dst, uidNumber, gidNumber)
+
dlg.destroy()

if len(self._problemFiles) > 0:
--
1.7.3.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 07-20-2011, 11:27 AM
Martin Sivak
 
Default Copy skel files even if the home directory exists (#598957)

The code looks ok, I'm just not sure if we always want to copy it.
I know we have a bug which requests it, but even adduser does not do that by default.

--
Martin Sivák
msivak@redhat.com
Red Hat Czech
Anaconda team / Brno, CZ

----- Original Message -----
> ---
> modules/create_user.py | 18 +++++++++++++++++-
> 1 files changed, 17 insertions(+), 1 deletions(-)
>
> diff --git a/modules/create_user.py b/modules/create_user.py
> index 7e87dd6..d1b9365 100644
> --- a/modules/create_user.py
> +++ b/modules/create_user.py
> @@ -24,6 +24,7 @@ import os.path
> import pwd
> import unicodedata
> import re
> +import shutil
>
> from firstboot.config import *
> from firstboot.constants import *
> @@ -230,7 +231,22 @@ class moduleClass(Module):
> gtk.main_iteration(False)
>
> os.chown("/home/%s" % username, uidNumber, gidNumber)
> - os.path.walk("/home/%s" % username, self._chown, (uidNumber,
> gidNumber))
> + os.path.walk("/home/%s" % username, self._chown, (uidNumber,
> + gidNumber))
> +
> + # copy skel files
> + for fname in os.listdir("/etc/skel"):
> + dst = "/home/%s/%s" % (username, fname)
> + if not os.path.exists(dst):
> + src = "/etc/skel/%s" % fname
> + if os.path.isdir(src):
> + shutil.copytree(src, dst)
> + os.path.walk(dst, self._chown, (uidNumber,
> + gidNumber))
> + else:
> + shutil.copy2(src, dst)
> + os.chown(dst, uidNumber, gidNumber)
> +
> dlg.destroy()
>
> if len(self._problemFiles) > 0:
> --
> 1.7.3.2
>
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@redhat.com
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 07-20-2011, 12:13 PM
Martin Gracik
 
Default Copy skel files even if the home directory exists (#598957)

Well, my idea is that firstboot should be "easy", so it really does not
matter what other command line apps do or don't. But I'm not gonna fight
with anyone who thinks we should not do it too, I just want to close the
bug. So can we maybe vote on this one?

On Wed, 2011-07-20 at 07:27 -0400, Martin Sivak wrote:
> The code looks ok, I'm just not sure if we always want to copy it.
> I know we have a bug which requests it, but even adduser does not do that by default.
>
> --
> Martin Sivák
> msivak@redhat.com
> Red Hat Czech
> Anaconda team / Brno, CZ
>
> ----- Original Message -----
> > ---
> > modules/create_user.py | 18 +++++++++++++++++-
> > 1 files changed, 17 insertions(+), 1 deletions(-)
> >
> > diff --git a/modules/create_user.py b/modules/create_user.py
> > index 7e87dd6..d1b9365 100644
> > --- a/modules/create_user.py
> > +++ b/modules/create_user.py
> > @@ -24,6 +24,7 @@ import os.path
> > import pwd
> > import unicodedata
> > import re
> > +import shutil
> >
> > from firstboot.config import *
> > from firstboot.constants import *
> > @@ -230,7 +231,22 @@ class moduleClass(Module):
> > gtk.main_iteration(False)
> >
> > os.chown("/home/%s" % username, uidNumber, gidNumber)
> > - os.path.walk("/home/%s" % username, self._chown, (uidNumber,
> > gidNumber))
> > + os.path.walk("/home/%s" % username, self._chown, (uidNumber,
> > + gidNumber))
> > +
> > + # copy skel files
> > + for fname in os.listdir("/etc/skel"):
> > + dst = "/home/%s/%s" % (username, fname)
> > + if not os.path.exists(dst):
> > + src = "/etc/skel/%s" % fname
> > + if os.path.isdir(src):
> > + shutil.copytree(src, dst)
> > + os.path.walk(dst, self._chown, (uidNumber,
> > + gidNumber))
> > + else:
> > + shutil.copy2(src, dst)
> > + os.chown(dst, uidNumber, gidNumber)
> > +
> > dlg.destroy()
> >
> > if len(self._problemFiles) > 0:
> > --
> > 1.7.3.2
> >
> > _______________________________________________
> > Anaconda-devel-list mailing list
> > Anaconda-devel-list@redhat.com
> > https://www.redhat.com/mailman/listinfo/anaconda-devel-list
>
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@redhat.com
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

--
Martin Gracik <mgracik@redhat.com>

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 07-25-2011, 07:52 PM
Chris Lumens
 
Default Copy skel files even if the home directory exists (#598957)

> The code looks ok, I'm just not sure if we always want to copy it.
> I know we have a bug which requests it, but even adduser does not do that by default.

Yeah, I'd say if there's a pre-existing home directory without the skel
files, there's probably a reason for the user not having them there. We
shouldn't try to be too smart with people's existing stuff.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 07-25-2011, 07:52 PM
Chris Lumens
 
Default Copy skel files even if the home directory exists (#598957)

> The code looks ok, I'm just not sure if we always want to copy it.
> I know we have a bug which requests it, but even adduser does not do that by default.

Yeah, I'd say if there's a pre-existing home directory without the skel
files, there's probably a reason for the user not having them there. We
shouldn't try to be too smart with people's existing stuff.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 11:10 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org