charset.c: Fixed signed/unsigned issues.
authorSamba Release Account <samba-bugs@samba.org>
Tue, 22 Jul 1997 19:04:40 +0000 (19:04 +0000)
committerSamba Release Account <samba-bugs@samba.org>
Tue, 22 Jul 1997 19:04:40 +0000 (19:04 +0000)
password.c: Fixed problem with MS-Exchange services.
Jeremy (jallison@whistle.com)

source/lib/charset.c
source/smbd/password.c

index b463344daac1e330600a048e5b0fcb56b90b8375..6b4f0b07bcbd689d552464acbff9495aaedc5ea6 100644 (file)
@@ -273,12 +273,12 @@ void add_char_string(char *s)
   for (t=strtok(extra_chars," \t\r\n"); t; t=strtok(NULL," \t\r\n")) {
     char c1=0,c2=0;
     int i1=0,i2=0;
-    if (isdigit(*t) || (*t)=='-') {
+    if (isdigit((unsigned char)*t) || (*t)=='-') {
       sscanf(t,"%i:%i",&i1,&i2);
       add_dos_char(i1,True,i2,True);
     } else {
       sscanf(t,"%c:%c",&c1,&c2);
-      add_dos_char(c1,True,c2, True);
+      add_dos_char((unsigned char)c1,True,(unsigned char)c2, True);
     }
   }
 
index e00028d87e156638956a86add691fb14e8e9fd34..eb837c258431bb3020399f80fb976c5b549f3f15 100644 (file)
@@ -153,12 +153,26 @@ uint16 register_vuid(int uid,int gid, char *name,BOOL guest)
   struct passwd *pwfile; /* for getting real name from passwd file */
   int real_name_len;
 
+#if 0
+  /*
+   * After observing MS-Exchange services writing to a Samba share
+   * I belive this code is incorrect. Each service does it's own
+   * sessionsetup_and_X for the same user, and as each service shuts
+   * down, it does a user_logoff_and_X. As we are consolidating multiple
+   * sessionsetup_and_X's onto the same vuid here, when the first service
+   * shuts down, it invalidates all the open files for the other services.
+   * Hence I am removing this code and forcing each sessionsetup_and_X
+   * to get a new vuid.
+   * Jeremy Allison. (jallison@whistle.com).
+   */
+
   int i;
   for(i = 0; i < num_validated_users; i++) {
     vuser = &validated_users[i];
     if( vuser->uid == uid )
       return (uint16)(i + VUID_OFFSET); /* User already validated */
   }
+#endif
 
   validated_users = (user_struct *)Realloc(validated_users,
                           sizeof(user_struct)*