]> git.pld-linux.org Git - packages/samba.git/blob - samba-smbadduser.patch
- missing pl summary, BuildRequires: autoconf
[packages/samba.git] / samba-smbadduser.patch
1 diff -urN samba-2.2.0.org/source/smbadduser samba-2.2.0/source/smbadduser
2 --- samba-2.2.0.org/source/smbadduser   Wed Apr 18 01:27:35 2001
3 +++ samba-2.2.0/source/smbadduser       Wed Apr 18 01:33:08 2001
4 @@ -3,10 +3,10 @@
5  # smbadduser - Written by Mike Zakharoff
6  #
7  unalias *
8 -set path = ($path /usr/local/samba/bin)
9 +set path = ($path /usr/bin)
10  
11 -set smbpasswd = /usr/local/samba/private/smbpasswd
12 -set user_map  = /usr/local/samba/lib/users.map
13 +set smbpasswd = /etc/samba/smbpasswd
14 +set user_map  = /etc/samba/users.map
15  #
16  # Set to site specific passwd command
17  #
18 @@ -46,19 +46,23 @@
19                 echo "ERROR: $unix Not in passwd database SKIPPING..."
20                 continue
21         endif
22 -        set tmp = `cat $smbpasswd | awk -F: '$1==USR {print $1}' USR=$unix`
23 -       if ($#tmp != 0) then
24 -               echo "ERROR: $unix is already in $smbpasswd SKIPPING..."
25 -               continue
26 -       endif
27  
28 -       echo "Adding: $unix to $smbpasswd"
29 -       eval $passwd | \
30 -       awk -F: '$1==USR { \
31 -       printf( "%s:%s:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:%s:%s:%s\n", $1, $3, $5, $6, $7) }' USR=$unix >> $smbpasswd
32 +       # Fix 8/7/2000 Phil Knirsch: Removed the smbpasswd stuff here and fixed
33 +       # the way the usermap gets updated as that one was really wrong: If a
34 +       # user was added twice the usermap would contain 2 entries! We now
35 +       # first select the existing entry, remove it from the usermap and add
36 +       # a new one with the new ntid. If something goes wrong the new entry
37 +       # will as before simply be added to the file (for manual fixing later).
38 +        set usr = `eval cat $user_map | awk -F= '{if(match($1, USR" *") != 0) print $2}' USR=$unix`
39 +
40         if ($unix != $ntid) then
41 -               echo "Adding: {$unix = $ntid} to $user_map"
42 -               echo "$unix = $ntid" >> $user_map
43 +               echo "Adding: {$unix = $usr $ntid} to $user_map"
44 +                cat $user_map | sed /"$unix.*"/d > $user_map.new
45 +                if (-e $user_map.new) then
46 +                    cp $user_map.new $user_map
47 +                endif
48 +                rm $user_map.new
49 +               echo "$unix = $usr $ntid" >> $user_map
50         endif
51         set new = ($new $unix)
52  end
53 @@ -69,5 +73,9 @@
54  foreach one ($new)
55         echo $line
56         echo "ENTER password for $one"
57 -       smbpasswd $one
58 +
59 +        # Fix Phil Knirsch 8/6/2000: Use the -a option to create the user
60 +        # entry in case it didn't exist before. This way we get rid of the
61 +        # file format dependent awk replacement in the previous version.
62 +       smbpasswd -a $one
63  end
This page took 0.030685 seconds and 3 git commands to generate.