87d2352fffc93024e75d08d2d13a3b829cb223a3
[samba] / debian / patches / ubuntu-auxsrc.patch
1 --- samba-3.0.7.orig/source/utils/ntlm_auth_proto.h
2 +++ samba-3.0.7/source/utils/ntlm_auth_proto.h
3 @@ -0,0 +1,28 @@
4 +#ifndef _NTLM_AUTH_PROTO_H_
5 +#define _NTLM_AUTH_PROTO_H_
6 +
7 +/* This file is automatically generated with "make proto". DO NOT EDIT */
8 +
9 +
10 +/* The following definitions come from utils/ntlm_auth.c  */
11 +
12 +const char *get_winbind_domain(void);
13 +const char *get_winbind_netbios_name(void);
14 +DATA_BLOB get_challenge(void) ;
15 +NTSTATUS contact_winbind_auth_crap(const char *username, 
16 +                                  const char *domain, 
17 +                                  const char *workstation,
18 +                                  const DATA_BLOB *challenge, 
19 +                                  const DATA_BLOB *lm_response, 
20 +                                  const DATA_BLOB *nt_response, 
21 +                                  uint32 flags, 
22 +                                  uint8 lm_key[8], 
23 +                                  uint8 user_session_key[16], 
24 +                                  char **error_string, 
25 +                                  char **unix_name) ;
26 +
27 +/* The following definitions come from utils/ntlm_auth_diagnostics.c  */
28 +
29 +BOOL diagnose_ntlm_auth(void);
30 +
31 +#endif /*  _NTLM_AUTH_PROTO_H_  */
32 --- samba-3.0.7.orig/source/smbadduser
33 +++ samba-3.0.7/source/smbadduser
34 @@ -0,0 +1,79 @@
35 +#!/bin/csh
36 +#
37 +# smbadduser - Written by Mike Zakharoff
38 +#
39 +
40 +prefix=/usr
41 +exec_prefix=${prefix}
42 +LIBDIR=${prefix}/lib/samba
43 +PRIVATEDIR=/etc/samba
44 +CONFIGDIR=/etc/samba
45 +
46 +unalias *
47 +set path = ($path /usr/local/samba/bin)
48 +
49 +set smbpasswd = $PRIVATEDIR/smbpasswd
50 +set user_map  = $CONFIGDIR/users.map
51 +
52 +#
53 +# Set to site specific passwd command
54 +#
55 +set passwd    = "cat /etc/passwd"
56 +#set passwd    = "niscat passwd.org_dir"
57 +#set passwd    = "ypcat passwd"
58 +
59 +set line = "----------------------------------------------------------"
60 +if ($#argv == 0) then
61 +       echo $line
62 +       echo "Written: Mike Zakharoff email: michael.j.zakharoff@boeing.com"
63 +       echo ""
64 +       echo "   1) Updates $smbpasswd"
65 +       echo "   2) Updates $user_map"
66 +       echo "   3) Executes smbpasswd for each new user"
67 +       echo ""
68 +       echo "smbadduser unixid:ntid unixid:ntid ..."
69 +       echo ""
70 +       echo "Example: smbadduser zak:zakharoffm johns:smithj"
71 +       echo $line
72 +       exit 1
73 +endif
74 +
75 +touch $smbpasswd $user_map
76 +set new  = ()
77 +foreach one ($argv)
78 +       echo $one | grep ':' >& /dev/null
79 +       if ($status != 0) then
80 +               echo "ERROR: Must use unixid:ntid like -> zak:zakharoffm"
81 +               continue
82 +       endif
83 +       set unix = `echo $one | awk -F: '{print $1}'`
84 +       set ntid = `echo $one | awk -F: '{print $2}'`
85 +
86 +       set usr = `eval $passwd | awk -F: '$1==USR {print $1}' USR=$unix`
87 +       if ($#usr != 1) then
88 +               echo "ERROR: $unix Not in passwd database SKIPPING..."
89 +               continue
90 +       endif
91 +        set tmp = `cat $smbpasswd | awk -F: '$1==USR {print $1}' USR=$unix`
92 +       if ($#tmp != 0) then
93 +               echo "ERROR: $unix is already in $smbpasswd SKIPPING..."
94 +               continue
95 +       endif
96 +
97 +       echo "Adding: $unix to $smbpasswd"
98 +       /usr/bin/smbpasswd -a -n $unix
99 +       if ($unix != $ntid) then
100 +               echo "Adding: {$unix = $ntid} to $user_map"
101 +               echo "$unix = $ntid" >> $user_map
102 +       endif
103 +       set new = ($new $unix)
104 +end
105 +
106 +#
107 +# Enter password for new users
108 +#
109 +foreach one ($new)
110 +       echo $line
111 +       echo "ENTER password for $one"
112 +       smbpasswd $one
113 +end
114 --- samba-3.0.7.orig/source/script/gen-8bit-gap.sh
115 +++ samba-3.0.7/source/script/gen-8bit-gap.sh
116 @@ -0,0 +1,49 @@
117 +#!/bin/sh
118 +if test $# -ne 2 ; then
119 +       echo "Usage: $0 <charmap file> <CHARSET NAME>"
120 +       exit 1
121 +fi
122 +
123 +CHARMAP=$1
124 +CHARSETNAME=$2
125 +
126 +echo "/* "
127 +echo " * Conversion table for $CHARSETNAME charset "
128 +echo " * "
129 +echo " * Conversion tables are generated using $CHARMAP table "
130 +echo " * and source/script/gen-8bit-gap.sh script "
131 +echo " * "
132 +echo " * This program is free software; you can redistribute it and/or modify "
133 +echo " * it under the terms of the GNU General Public License as published by "
134 +echo " * the Free Software Foundation; either version 2 of the License, or "
135 +echo " * (at your option) any later version. "
136 +echo " *  "
137 +echo " * This program is distributed in the hope that it will be useful,"
138 +echo " * but WITHOUT ANY WARRANTY; without even the implied warranty of "
139 +echo " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the "
140 +echo " * GNU General Public License for more details. "
141 +echo " *  "
142 +echo " * You should have received a copy of the GNU General Public License "
143 +echo " * along with this program; if not, write to the Free Software "
144 +echo " * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. "
145 +echo " */"
146 +
147 +echo '#include "includes.h"'
148 +echo
149 +echo "static const uint16 to_ucs2[256] = {"
150 +cat "$CHARMAP" | gawk -f ./script/gen-8bit-gap.awk
151 +echo "};"
152 +echo
153 +echo "static const struct charset_gap_table from_idx[] = {"
154 +sed -ne 's/^<U\(....\).*/\1/p' \
155 +    "$CHARMAP" | sort -u | gawk -f ./script/gap.awk
156 +echo "  { 0xffff, 0xffff, 0 }"
157 +echo "};"
158 +echo
159 +echo "static const unsigned char from_ucs2[] = {"
160 +sed -ne 's/^<U\(....\)>[[:space:]]*.x\(..\).*/\1 \2/p' \
161 +    "$CHARMAP" | sort -u | gawk -f ./script/gaptab.awk
162 +echo "};"
163 +echo 
164 +echo "SMB_GENERATE_CHARSET_MODULE_8_BIT_GAP($CHARSETNAME)"
165 +echo