diff options
author | Luke Leighton <lkcl@samba.org> | 1998-05-15 14:47:01 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1998-05-15 14:47:01 +0000 |
commit | 90e97bf9c550b05af643651c439c602e1924a9d3 (patch) | |
tree | 4ae749bc107d996ab372764d23dd780c612f88af /source3/script | |
parent | bc69d08227dae35fc65fafeb4c5263bd5cb45cba (diff) | |
download | samba-90e97bf9c550b05af643651c439c602e1924a9d3.tar.gz samba-90e97bf9c550b05af643651c439c602e1924a9d3.tar.bz2 samba-90e97bf9c550b05af643651c439c602e1924a9d3.zip |
two scripts from benny holmgren which a) create NIS+ table b) populate it
from private/smbpasswd.
(This used to be commit 1acdd9fd6c391ad4871c55c0ba8f5b00076ba115)
Diffstat (limited to 'source3/script')
-rwxr-xr-x | source3/script/mknissmbpasswd.sh | 29 | ||||
-rwxr-xr-x | source3/script/mknissmbpwdtbl.sh | 40 |
2 files changed, 69 insertions, 0 deletions
diff --git a/source3/script/mknissmbpasswd.sh b/source3/script/mknissmbpasswd.sh new file mode 100755 index 0000000000..e7b3df1f83 --- /dev/null +++ b/source3/script/mknissmbpasswd.sh @@ -0,0 +1,29 @@ +#!/bin/sh +# +# Script to import smbpasswd file into the smbpasswd NIS+ table. Reads +# from stdin the smbpasswd file. +# +while true +do + read row + if [ -z "$row" ] + then + break + fi + + if [ "`echo $row | cut -c1`" = "#" ] + then + continue + fi + + nistbladm -a \ + name=\"`echo $row | cut -d: -f1`\" \ + uid=\"`echo $row | cut -d: -f2`\" \ + lmpwd=\"`echo $row | cut -d: -f3`\" \ + ntpwd=\"`echo $row | cut -d: -f4`\" \ + acb=\"`echo $row | cut -d: -f5`\" \ + pwdlset_t=\"`echo $row | cut -d: -f6`\" \ + gcos=\"`echo $row | cut -d: -f7`\" \ + home=\"`echo $row | cut -d: -f8`\" \ + shell=\"`echo $row | cut -d: -f9`\" smbpasswd.org_dir.`nisdefaults -d` +done diff --git a/source3/script/mknissmbpwdtbl.sh b/source3/script/mknissmbpwdtbl.sh new file mode 100755 index 0000000000..a98aa572e3 --- /dev/null +++ b/source3/script/mknissmbpwdtbl.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# +# Creates smbpasswd table and smb group in NIS+ +# + +nistbladm \ + -D access=og=rmcd,nw= -c \ + -s : smbpasswd_tbl \ + name=S,nogw=r \ + uid=S,nogw=r \ + user_rid=S,nogw=r \ + smb_grpid=,nw+r \ + group_rid=,nw+r \ + acb=,nw+r \ + \ + lmpwd=C,nw=,g=r,o=rm \ + ntpwd=C,nw=,g=r,o=rm \ + \ + logon_t=,nw+r \ + logoff_t=,nw+r \ + kick_t=,nw+r \ + pwdlset_t=,nw+r \ + pwdlchg_t=,nw+r \ + pwdmchg_t=,nw+r \ + \ + full_name=,nw+r \ + home_dir=,nw+r \ + dir_drive=,nw+r \ + logon_script=,nw+r \ + profile_path=,nw+r \ + acct_desc=,nw+r \ + workstations=,nw+r \ + \ + hours=,nw+r \ + smbpasswd.org_dir.`nisdefaults -d` + +nisgrpadm -c smb.`nisdefaults -d` + +nischgrp smb.`nisdefaults -d` smbpasswd.org_dir.`nisdefaults -d` + |