home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / protocol / appletal / 4263 < prev    next >
Encoding:
Text File  |  1992-12-21  |  5.8 KB  |  203 lines

  1. Newsgroups: comp.protocols.appletalk
  2. Path: sparky!uunet!munnari.oz.au!uniwa!cujo!ncrpda.curtin.edu.au!rocky.curtin.edu.au!user
  3. From: peter@ncrpda.curtin.edu.au (Peter N Lewis)
  4. Subject: Re: help removing cap password prompt
  5. Message-ID: <peter-201292190603@rocky.curtin.edu.au>
  6. Followup-To: comp.protocols.appletalk
  7. Lines: 189
  8. Sender: news@ncrpda.curtin.edu.au
  9. Nntp-Posting-Host: ncrpda.curtin.edu.au
  10. Organization: NCRPDA, Curtin University
  11. References: <915@blue.cis.pitt.edu>
  12. Date: Sun, 20 Dec 1992 11:12:47 GMT
  13.  
  14. In article <915@blue.cis.pitt.edu>, ebe+@pitt.edu (Elmer Beachley) wrote:
  15.  
  16. > How can I eliminate the password prompt when opening a unix connection?
  17. > I have a small network and have to give my Mac unix account a password
  18. > because of CAP even tho I wouldn't have done this otherwise.
  19.  
  20. I'm not sure if this is what you're after, but others may find it useful, 
  21. and it might give you somewhere to start.  I wanted all my users to have
  22. the same CAP password, since our AppleShare network is secure, and I wanted
  23. to auto mount their AppleShare volume, and have it stay mounted even if
  24. they changed their unix password, so I did the following in afpos.c:
  25.  
  26. cap/applications/aufs/afpos.c:
  27. #ifdef ULTRIX_SECURITY
  28.       /* avoid evaluation order problem */
  29.       crypted_password = ultrix_crypt(pwd, p);
  30.       if (strcmp(crypted_password, p->pw_passwd) != 0) {
  31. #else  ULTRIX_SECURITY
  32. #ifdef NCRPDA
  33.       if (p->pw_gid == 100) { /* Use standard password for group user */
  34.         crypted_password = "abcdefghijklm";
  35.       } else {
  36.         crypted_password = p->pw_passwd;
  37.       }
  38.       if (strcmp(crypt(pwd,crypted_password),crypted_password) != 0) {
  39. #else  NCRPDA
  40.       if (strcmp(crypt(pwd,p->pw_passwd),p->pw_passwd) != 0) {
  41. #endif NCRPDA
  42. #endif ULTRIX_SECURITY
  43.  
  44. So all users with gid 100 get the standard password.  I can use
  45. AppleShare's "Save name & password" option to have the user's directory
  46. auto mounted on boot, and they don't have to worry about using the Chooser
  47. to log in.
  48.  
  49. Full diffs follow (which also includes an option to force the username to
  50. lowercase so it behaves the same as AppleShare volumes),
  51.    Peter.
  52.  
  53. diff -c2 afpos.c.orig afpos.c
  54. *** afpos.c.orig        Fri Oct 23 11:39:24 1992
  55. --- afpos.c     Mon Oct 26 11:47:44 1992
  56. ***************
  57. *** 1,6 ****
  58.   /*
  59. !  * $Author: djh $ $Date: 1992/07/14 11:30:17 $
  60. !  * $Header: /mac/src/cap60/applications/aufs/RCS/afpos.c,v 2.27
  61. 1992/07/14 11:
  62. 30:17 djh Rel djh $
  63. !  * $Revision: 2.27 $
  64.    */
  65.  
  66. --- 1,6 ----
  67.   /*
  68. !  * $Author: djh $ $Date: 1992/08/01 13:05:17 $
  69. !  * $Header: /mac/src/cap60/applications/aufs/RCS/afpos.c,v 2.28
  70. 1992/08/01 13:
  71. 05:17 djh Rel djh $
  72. !  * $Revision: 2.28 $
  73.    */
  74.  
  75. ***************
  76. *** 33,36 ****
  77. --- 33,40 ----
  78.    * POSSIBLE DEFINES:
  79.    *
  80. +  *  NCRPDA
  81. +  *    Use stupid passwords instead of real ones to simplify maintenance
  82. +  *    and keep passwds seperate from unix ones.  NCRPDA is incompatible
  83. +  *    with ULTRIX_SECURITY
  84.    *  NONLXLATE
  85.    *   Define to turn off translation of \n to \r on line at a time
  86. ***************
  87. *** 53,56 ****
  88. --- 57,62 ----
  89.    *
  90.    *  PERMISSIVE_USER_NAME - let the Chooser name be from the gcos field
  91. +  *  FORCE_LOWER_NAME - force the input name to lowercase (incompatible
  92. +  *    with PERMISSIVE_USER_NAME, which superseeds it)
  93.    *
  94.    *  aux has a couple of "ifdefs".
  95. ***************
  96. *** 70,73 ****
  97. --- 76,83 ----
  98.   */
  99.  
  100. + /* I'm sure this should be somewhere else, like m4.features or something
  101. */
  102. + #define NCRPDA
  103. + #define FORCE_LOWER_NAME
  104. +
  105.   #include <stdio.h>
  106.   #include <pwd.h>
  107. ***************
  108. *** 82,86 ****
  109.   #include <sys/ndir.h>
  110.   #else xenix5
  111. ! #include <sys/dir.h>
  112.   #endif xenix5
  113.   #include <sys/stat.h>
  114. --- 92,98 ----
  115.   #include <sys/ndir.h>
  116.   #else xenix5
  117. ! # ifndef drsnx
  118. ! #  include <sys/dir.h>
  119. ! # endif drsnx
  120.   #endif xenix5
  121.   #include <sys/stat.h>
  122. ***************
  123. *** 165,168 ****
  124. --- 177,186 ----
  125.   #endif USEGETMNT
  126.  
  127. + #ifdef drsnx
  128. + # ifdef USESTATFS
  129. + #  undef USESTATFS    /* ICL DRS/NX statfs() is a little different */
  130. + # endif USESTATFS
  131. + #endif drsnx
  132. +
  133.   #include <netat/afp.h>
  134.   #include <netat/afpcmd.h>             /* flags should be in misc  */
  135. ***************
  136. *** 183,186 ****
  137. --- 201,207 ----
  138.   #include <ctype.h>
  139.   #endif PERMISSIVE_USER_NAME
  140. + #ifdef FORCE_LOWER_NAME
  141. + #include <ctype.h>
  142. + #endif FORCE_LOWER_NAME
  143.  
  144.   #ifdef ULTRIX_SECURITY
  145. ***************
  146. *** 3055,3058 ****
  147. --- 3076,3083 ----
  148.     char *ultrix_crypt();
  149.     char *crypted_password;
  150. + #else  ULTRIX_SECURITY
  151. + #ifdef NCRPDA
  152. +   char *crypted_password;
  153. + #endif NCRPDA
  154.   #endif ULTRIX_SECURITY
  155.   #ifdef LWSRV_AUFS_SECURITY
  156. ***************
  157. *** 3060,3063 ****
  158. --- 3085,3091 ----
  159.     int namlen;
  160.   #endif LWSRV_AUFS_SECURITY
  161. + #ifdef FORCE_LOWER_NAME
  162. +   int i;
  163. + #endif FORCE_LOWER_NAME
  164.     extern int nousrvol;
  165.  
  166. ***************
  167. *** 3064,3067 ****
  168. --- 3092,3103 ----
  169.     safedebug = (DBOSI || (getuid() != 0 && geteuid() != 0));
  170.  
  171. + #ifdef FORCE_LOWER_NAME
  172. +   if (uam != UAM_ANON) {
  173. +     for (i = 0 ; nam[i] ; i++)
  174. +       if (isupper(nam[i]))
  175. +         nam[i] = tolower(nam[i]);
  176. +   }
  177. + #endif
  178. +
  179.     logit(0,"Login requested for %s (we are %srunning as root)",
  180.         (uam == UAM_ANON) ? "<anonymous>" : nam,
  181. ***************
  182. *** 3152,3156 ****
  183. --- 3188,3201 ----
  184.         if (strcmp(crypted_password, p->pw_passwd) != 0) {
  185.   #else  ULTRIX_SECURITY
  186. + #ifdef NCRPDA
  187. +       if (p->pw_gid == 100) { /* Use standard password for group user */
  188. +         crypted_password = "abcdefghijklm";
  189. +       } else {
  190. +         crypted_password = p->pw_passwd;
  191. +       }
  192. +       if (strcmp(crypt(pwd,crypted_password),crypted_password) != 0) {
  193. + #else  NCRPDA
  194.         if (strcmp(crypt(pwd,p->pw_passwd),p->pw_passwd) != 0) {
  195. + #endif NCRPDA
  196.   #endif ULTRIX_SECURITY
  197.         logit(0,"Login: Incorrect password for user %s",nam);
  198.  
  199.  
  200. _______________________________________________________________________
  201. Peter N Lewis <peter@ncrpda.curtin.edu.au>           Ph: +61 9 368 2055
  202.