[Samba] Logon script

Gilberto Nunes gilbertonunes at cbj.g12.br
Fri Jan 16 18:52:50 GMT 2004


Hi

   I make a perl script, to build on the fly login script to my users.
   In this script, there's some group that called, to mount specif shares.
   However, when logged on to the domain, with the student group, for
example,
   I received this message, for the syslog:

 [2004/01/16 16:37:13, 0] groupdb/mapping.c:init_group_mapping(139)
Jan 16 16:37:13 samba smbd[8299]:   Failed to open group mapping database
Jan 16 16:37:13 samba smbd[8299]: [2004/01/16 16:37:13, 0]
groupdb/mapping.c:get_group_from_gid(655)
Jan 16 16:37:13 samba smbd[8299]:   failed to initialize group
mappingFailed to open group mapping database
Jan 16 16:37:13 samba smbd[8299]: [2004/01/16 16:37:13, 0]
groupdb/mapping.c:get_group_from_gid(655)
Jan 16 16:37:13 samba smbd[8299]:   failed to initialize group
mappingget_alias_user_groups: gid of user gnunes doesn't exist. Check your
/etc/passwd and /etc/group files
Jan 16 16:39:46 samba sshd(pam_unix)[8405]: session opened for user root
by (uid=0)

      Note that users gnunes, is enclosed in the student group.

      What's wrong with this?

This the logon script:

#!/usr/bin/perl

$server="samba";

# Log Start
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
open LOG, ">>/var/log/samba/netlogon.log";
print LOG "$mon/$mday/$year $hour:$min:$sec - User $ARGV[0] logged into
$ARGV[1]\n";
close LOG;

# login script start

open (LOGON,">/home/netlogon/.$ARGV[0].bat");

print LOGON "\@ECHO OFF\r\n";
print LOGON "NET TIME \\\\$server /SET /YES\r\n";
print LOGON "NET USE H: /HOME\r\n";


if ($ARGV[1] eq "student" || $ARVG[0] eq "student")
{
        print LOGON "NET USE M: \\\\$server\\publico\\pub_student\r\n";
}


print LOGON "\\\\$server\\NETLOGON\\.logon.bat\r\n";
close LOGON;



-- 
Gilberto Nunes
Suporte Rede Bonja - Bom Jesus/Ielusc
Fone: 433-0155 - ramal 235
www.ielusc.br - suporte at ielusc.br
Linux User nº 199930
ICQ #136176504


More information about the samba mailing list