How do we set up the file to allow each individual user to use their individual NIS shell while using pmloginshell?
解决办法
Assuming that the NIS lookups can be performed on the master host, you could use the system() policy function to perform the lookup, and use the results in the policy file.
The following policy example shows how this might be accomplished:
if (basename(command)=="pmloginshell") { yp_out=system("/usr/bin/ypmatch -k "+user+" passwd");
# successful ypmatch if ( status == 0 ) { pwent=strsub(yp_out,0,strindex(yp_out,"\n")); # strip return chars runcommand=splitSubst(pwent,":")[7]; } # if the user is not in NIS, set the shell to something reasonable else { runcommand="/bin/bash"; }