*** sesssetup.c.original 2003-09-17 07:01:53.000000000 -0400 --- sesssetup.c 2003-09-17 10:19:38.000000000 -0400 *************** *** 203,208 **** --- 203,229 ---- pw = Get_Pwnam(user); if (!pw && !foreign) { pw = Get_Pwnam(client); + /* test modification by Duane Rezac. Code borrowed from + srv_samr_nt.c to add user to the unix system if it + does not exist. + */ + if ( !pw ) { + /* see if we have a machine account.. */ + if (client[strlen(client)-1] != '$') { + pstring add_script; + pstrcpy(add_script,lp_adduser_script()); + if (*add_script) { + int add_ret; + /* convert to lower case as per normal unix standards... */ + strlower_m(client); + all_string_sub(add_script,"%u",client,sizeof(add_script)); + add_ret = smbrun(add_script,NULL); + DEBUG(3,("sesssetup: running the command `%s' gave %d\n",add_script,add_ret)); + } + } + } + pw = Get_Pwnam(client); + /* end of test code modification */ SAFE_FREE(user); user = smb_xstrdup(client); }