Koozali.org: home of the SME Server

Obsolete Releases => SME Server 7.x => Topic started by: thymox on February 05, 2009, 03:41:52 PM

Title: Modifying user creation script?
Post by: thymox on February 05, 2009, 03:41:52 PM
Hi all,

When I create a new user on SME7.4, a corresponding directory is created here:
/home/e-smith/files/samba/profiles/<username>

What file would I have to modify to have a symlink created here:
/home/e-smith/files/samba/profiles/<username>.v2

So, essentially, creating the <username> directory and them symlinking it adding a ".v2" at the end (for some level of Vista compatibility).

Cheers.
Grant.
Title: Re: Modifying user creation script?
Post by: cactus on February 05, 2009, 09:20:12 PM
Hi all,

When I create a new user on SME7.4, a corresponding directory is created here:
/home/e-smith/files/samba/profiles/<username>

What file would I have to modify to have a symlink created here:
/home/e-smith/files/samba/profiles/<username>.v2

So, essentially, creating the <username> directory and them symlinking it adding a ".v2" at the end (for some level of Vista compatibility).

Cheers.
Grant.
I suggest you do not wander of here but add your requirements to http://bugs.contribs.org/show_bug.cgi?id=3666 as this deals with the issue you are facing. It is not as simple as just creating that directory to get your Vista roaming profiles running. Symlinking the XP/NT profile is not an option as the Vista profile is (very) different to it's predecessors, mixing them makes them both not working most likely.

One way to get this resolved quicker would be to sponsor the development team with a Vista license. I once was offered one but unfortunately never received the offered copy. Since the development team does not have Vista licenses they do not have methods on testing this. So perhaps that might be an option.
Title: Re: Modifying user creation script?
Post by: thymox on February 05, 2009, 11:39:23 PM
I suggest you do not wander of here but add your requirements to http://bugs.contribs.org/show_bug.cgi?id=3666 as this deals with the issue you are facing. It is not as simple as just creating that directory to get your Vista roaming profiles running. Symlinking the XP/NT profile is not an option as the Vista profile is (very) different to it's predecessors, mixing them makes them both not working most likely.
Thank you, Cactus.  Yes, I've now discovered a few failings of having a v1 and v2 profile symlinked together.  If I can get the folder redirections working nicely on both XP and Vista clients, then I will be more than happy to have two separate profile directories - most users will be on a single machine anyway, so it's not vital that it works across the two systems.  I will be adding comments to that bug.  Thanks for the link. :)
One way to get this resolved quicker would be to sponsor the development team with a Vista license. I once was offered one but unfortunately never received the offered copy. Since the development team does not have Vista licenses they do not have methods on testing this. So perhaps that might be an option.
Alas, I do not have any spare licenses.  It would seem, however, that Windows 7 uses the same system as Vista for profiles, and that was (until recently) freely available for Beta download... so that might be a way to test things legitimately. :)
Title: Re: Modifying user creation script?
Post by: cactus on February 06, 2009, 08:44:36 AM
Alas, I do not have any spare licenses.
That is a pity, perhaps some one else :-)

It would seem, however, that Windows 7 uses the same system as Vista for profiles, and that was (until recently) freely available for Beta download... so that might be a way to test things legitimately. :)
That might be the case, but testing against a beta release has the drawback that the system is not fully stable and fundamental design changes might occur. Besides we need to test Vista and Beta as well when released as RC I guess.
Title: Re: Modifying user creation script?
Post by: m on February 17, 2009, 11:17:00 PM
One way to get this resolved quicker would be to sponsor the development team with a Vista license. I once was offered one but unfortunately never received the offered copy. Since the development team does not have Vista licenses they do not have methods on testing this. So perhaps that might be an option.
If this was meant serious, I have a spare Windows Vista Business OEM Licence, which I can provide. I don't have a media, but getting one should be no problem for you.
Title: Re: Modifying user creation script?
Post by: cactus on February 17, 2009, 11:30:43 PM
If this was meant serious, I have a spare Windows Vista Business OEM Licence, which I can provide. I don't have a media, but getting one should be no problem for you.
Yes this is serious.
Title: Re: Modifying user creation script?
Post by: m on February 17, 2009, 11:48:40 PM
Yes this is serious.
so, do you want the license? If yes, I 'll send it to snetram AT users.sourceforge.net. Is this ok?
Title: Re: Modifying user creation script?
Post by: steever on February 18, 2009, 05:15:22 AM
I sent you the media and licence last year, Cactus.  I'm disappointed that you didn't receive it.

Steve
Title: Re: Modifying user creation script?
Post by: cactus on February 18, 2009, 08:46:05 PM
I sent you the media and licence last year, Cactus.  I'm disappointed that you didn't receive it.

Steve
I am as well, thanks for sending it out anyhow. I did not remember who it was back then to follow-up, I figured you might have decided to use it for a different purpose. Somewhere something must have gone wrong :-(
Title: Re: Modifying user creation script?
Post by: cactus on February 19, 2009, 06:18:22 PM
I have a spare Windows Vista Business OEM Licence, which I can provide.

so, do you want the license? If yes, I 'll send it to snetram AT users.sourceforge.net. Is this ok?
AFAIK a OEM license is of little use as you can not reinstall it unlimited, which is done during testing extensively (without reactivation), see also http://arstechnica.com/business/news/2006/11/8140.ars and http://www.tomshardware.co.uk/forum/page-235074_34_0.html .

Correct me if I am wrong.
Title: Re: Modifying user creation script?
Post by: steever on February 19, 2009, 11:47:16 PM
No, even with OEM versions of Vista business, you can choose not to activate.  You then have 60 days to use it, then you need to reinstall.

Steve
Title: Re: Modifying user creation script?
Post by: David Harper on February 20, 2009, 03:09:01 AM
So long as you are using the same physical hardware, Microsoft will continue to issue activation keys.

That may not be needed, anyway; AFAIK you can install your copy inside VMWare, activate it, and then create a snapshot that can be used to clone new, pre-activated Vista VMs.
Title: Re: Modifying user creation script?
Post by: cactus on February 20, 2009, 07:32:03 AM
So long as you are using the same physical hardware, Microsoft will continue to issue activation keys.

That may not be needed, anyway; AFAIK you can install your copy inside VMWare, activate it, and then create a snapshot that can be used to clone new, pre-activated Vista VMs.
Perhaps you can, but IMHO you will be violating the EULA, also it makes it impossible for other developers to use it as well.
Title: Re: Modifying user creation script?
Post by: cactus on February 20, 2009, 07:34:24 AM
No, even with OEM versions of Vista business, you can choose not to activate.  You then have 60 days to use it, then you need to reinstall.
I was not aware of that option, is this official MS policy?
Title: Re: Modifying user creation script?
Post by: Craig Cabrey on February 23, 2009, 01:44:01 AM
The file that you need to modify is
Code: [Select]
/etc/e-smith/events/actions/user-create-profiledir

I modified it enough that it automatically create the user.V2 profile directory, but the needed permissions are not applied. Can anybody perhaps modify it further?

EDIT: I might have just seen the problem after posting. Will test it now.
EDIT2: My hunch did not work, can somebody else jump in?

Here it is:
Code: [Select]
#!/usr/bin/perl -w
#----------------------------------------------------------------------
# snip
#----------------------------------------------------------------------
package esmith;

use strict;
use Errno;
use esmith::util;

use esmith::AccountsDB;
my $adb = esmith::AccountsDB->open_ro();

my $event = $ARGV ;
my @users = ('admin', map { $_->key } $adb->users);

my @newusers = ($event eq "post-upgrade") ? @users : $ARGV[1] ;

foreach my $user ( @newusers )
{
    die "$user is not a user account "
        unless ( grep /^$user$/, @users );

    my $dir = "/home/e-smith/files/samba/profiles/$user";
    my $V2dir = "/home/e-smith/files/samba/profiles/$user.V2";

    my $pre_existing = ( -d $dir );
    my $V2pre_existing = ( -d $newdir );

    $pre_existing || mkdir $dir, 700 || die "Couldn't create directory $dir ";
    $V2pre_existing || mkdir $V2dir, 700 || die "Couldn't create directory $V2dir ";

    chmod 0700, $dir;   # Remove setgid bit
    # chmod 0700, $V2dir; (doesn't work)

    next if $pre_existing;

    esmith::util::chownFile($user, $user, $dir) ||
        die "Couldn't change ownership of $dir ";

    chmod 0700, $V2dir;

    next if $V2pre_existing;

    esmith::util::chownFile($user, $user, $V2dir) ||
        die "Couldn't change ownership of $V2dir ";
}

exit (0);

Craig
Title: Re: Modifying user creation script?
Post by: David Harper on February 23, 2009, 01:54:30 AM
Craig, this would be worth raising a Feature Request bug to have the modifications tested and then included in the base packages.
Title: Re: Modifying user creation script?
Post by: Craig Cabrey on February 23, 2009, 02:11:47 AM
Craig, this would be worth raising a Feature Request bug to have the modifications tested and then included in the base packages.

Well first I need to get it working (http://Smileys/default/grin.gif) (http://javascript:void(0);).

My sudden epiphany didn't amount to anything, either. But I have one more hunch.
Title: Re: Modifying user creation script?
Post by: steever on February 23, 2009, 03:19:26 AM
Quote
I was not aware of that option, is this official MS policy?

OEM rules changed with vista.  You could buy an OEM disk without purchasing hardware, but as soon as it is installed and activated on a piece of hardware, it is linked to that hardware and cannot legally be wiped and installed somewhere else.  The trick, therefore, is to take advantage of the time MS allows us to use the product without activation - 60 days I believe.

Steve
Title: Re: Modifying user creation script?
Post by: cactus on February 23, 2009, 08:15:33 AM
Please do not post code changes (especially to the core) in the forums, instead open a bug for it or in this case attach it to the relevant bug: http://bugs.contribs.org/show_bug.cgi?id=3666

If you would have looked there, you would have seen that a suggestion is already attached to that bug in the forum of a patch.