Changeset c0a8738 for fedkit/smbmount.FreeBSD.pl
- Timestamp:
- Feb 14, 2010 2:25:46 PM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
- Children:
- b7f6ccc
- Parents:
- d87778f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedkit/smbmount.FreeBSD.pl
rd87778f rc0a8738 40 40 } 41 41 42 open(TM, "$TMCC accounts windows |") or die("Failed to execute TMCC"); 42 # open(TM, "$TMCC accounts windows |") or die("Failed to execute TMCC"); 43 open(TM, "/usr/local/federation/etc/userconf")or die("Failed to open userconf"); 43 44 open(CONFIG, ">/etc/nsmb.conf") or die("Failed to open /etc/nsmb.conf"); 44 45 open(MAP, ">$AMDMAP") or die("Failed to open $AMDMAP"); … … 52 53 53 54 while(<TM>) { 54 if (/ADDUSER LOGIN=(\S+) PSWD=(\S+) UID=(\d+) GID=(\d+).*HOMEDIR=(\S+) / ){55 $user = $1;56 $pswd = $2;57 $uid = $3;58 $gid = $4;59 $homedir = $5;55 /ADDUSER/ && do { 56 /LOGIN=(\S+)/ && do { $user = $1; }; 57 /WPSWD=(\S+)/ && do { $pswd = $1; }; 58 /UID=(\S+)/ && do { $uid = $1; }; 59 /GID=(\S+)/ && do { $gid = $1; }; 60 /HOMEDIR=(\S+)/ && do { $homedir = $1; }; 60 61 61 62 63 64 62 $userlc = $user; 63 # SMB demands upper case. 64 $user =~ tr/a-z/A-Z/; 65 my $pass = `smbutil crypt '$pswd'`; 65 66 66 print CONFIG "[$SHARE:$user]\npassword=$pass\n"; 67 68 if(! -d "$AMDROOT$homedir") { 69 system("$MKDIR -p $AMDROOT$homedir") && die("Failed to make directory"); 70 } 67 print CONFIG "[$SHARE:$user]\npassword=$pass\n"; 68 69 if(! -d "$AMDROOT$homedir") { 70 system("$MKDIR -p $AMDROOT$homedir") && 71 die("Failed to make directory"); 72 } 71 73 72 73 74 74 print FSTAB "//$user\@$SHARE/$user\t"; 75 print FSTAB "$AMDROOT$homedir\tsmbfs\t"; 76 print FSTAB "noauto,rw,-N,-f744,-d755,-u$uid,-g$gid\t0\t0\n"; 75 77 76 77 78 78 print MAP "\n$userlc type:=program;fs:=$AMDROOT$homedir;\\\n"; 79 print MAP "mount:=\"$MOUNT mount $AMDROOT$homedir\";\\\n"; 80 print MAP "unmount:=\"$UMOUNT unmount $AMDROOT$homedir\";"; 79 81 80 81 82 83 84 85 86 82 # 83 # If we are PUSER, the user assigned to mount the project directory, 84 # then we add in the mount for that. The share is called proj-$PNAME 85 # where PNAME is the name of the project at the mothership. We need 86 # a second map for this since we will be mounting under /proj. 87 # We should really not use share in federation. 88 # 87 89 88 89 90 91 90 if($user =~ m/$PUSER/i) { 91 print FSTAB "//$user\@$SHARE/proj-$PNAME\t"; 92 print FSTAB "$AMDROOT/proj\tsmbfs\t"; 93 print FSTAB "noauto,rw,-N,-f774,-d775,-u$uid,-g$gid\t0\t0\n"; 92 94 93 94 95 95 print PMAP "$PNAME type:=program;fs:=$AMDROOT/proj;\\\n"; 96 print PMAP "mount:=\"$MOUNT mount $AMDROOT/proj\";\\\n"; 97 print PMAP "unmount:=\"$UMOUNT unmount $AMDROOT/proj\";\n"; 96 98 97 if(! -d "$AMDROOT/proj") { 98 system("$MKDIR -p $AMDROOT/proj") && die("Failed to make directory"); 99 } 100 } 101 } 99 if(! -d "$AMDROOT/proj") { 100 system("$MKDIR -p $AMDROOT/proj") && 101 die("Failed to make directory"); 102 } 103 } 104 } 102 105 } 103 106
Note: See TracChangeset
for help on using the changeset viewer.