diff options
author | Stefan Metzmacher <metze@samba.org> | 2005-04-05 07:03:31 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:11:26 -0500 |
commit | cf52d62ec998ae30f4460e75817b0503894aff5d (patch) | |
tree | 6b22b0c3acfae28bc57bf45937a143a25e1aa0a5 /source4/script/addtosmbpass | |
parent | f9b3a8d3b9a0d83b47f2de6229db59221b4dd68d (diff) | |
download | samba-cf52d62ec998ae30f4460e75817b0503894aff5d.tar.gz samba-cf52d62ec998ae30f4460e75817b0503894aff5d.tar.bz2 samba-cf52d62ec998ae30f4460e75817b0503894aff5d.zip |
r6207: - clean up source topdir
- move provision stuff to setup/
- remove unused scripts
metze
(This used to be commit c35887ca649675f28ca986713a08082420418d74)
Diffstat (limited to 'source4/script/addtosmbpass')
-rw-r--r-- | source4/script/addtosmbpass | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/source4/script/addtosmbpass b/source4/script/addtosmbpass deleted file mode 100644 index bc82851c52..0000000000 --- a/source4/script/addtosmbpass +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/awk -f -# edit the line above to point to your real location of awk interpreter - -# awk program for adding new entries in smbpasswd files -# arguments are account names to add; feed it an existent Samba password -# file on stdin, results will be written on stdout -# -# Michal Jaegermann, michal@ellpspace.math.ualberta.ca, 1995-11-09 - -BEGIN { - me = "addtosmbpass"; - count = ARGC; - FS = ":"; - - if (count == 1) { - print "Usage:", me, - "name1 [name2 ....] < smbpasswd.in > smbpasswd.out"; - ARGV[1] = "/dev/null"; - ARGC = 2; - exit; - } - - for(i = 1; i < count; i++) { - names[ARGV[i]] = " "; - delete ARGV[i]; - } -# sane awk should work simply with 'ARGC = 1', but not every awk -# implementation is sane - big sigh!! - ARGV[1] = "-"; - ARGC = 2; -# -# If you have ypmatch but is not RPC registered (some Linux systems -# for example) comment out the next line. -# "which ypmatch" | getline ypmatch; - if (1 != match(ypmatch, /^\//)) { - ypmatch = ""; - } - pwdf = "/etc/passwd"; -} -#check for names already present in input -{ - print $0; - for(name in names) { - if($1 == name) { - delete names[name]; - } - } -} -END { - fmt = "%s:%s:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:"; - fmt = fmt "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:[U ]:LCT-00000000:%s:\n"; - for(name in names) { - while ((getline < pwdf) > 0) { - if ($1 == name) { - printf(fmt, $1, $3, $5); - close(pwdf); - notfound = ""; - break; - } - notfound = "n"; - } - $0 = ""; - if (notfound && ypmatch) { -# try to find in NIS databases - command = ypmatch " " name " passwd"; - command | getline; - if (NF > 0) { - printf(fmt, $1, $3, $5); - } - close(command); - } - } -} - |