Compile error has occured in 2.0.7/2.2/HEAD with Mac OS X

NEZU, Kensuke nez at samba.gr.jp
Wed Jun 6 06:47:19 GMT 2001


Hello all,

We had chance to compile Samba with Mac OS X at Linux World Expo/2001 Tokyo.
(Thanks Jeremy for participate!:-))

And, some compile error had found around mkdir() implementation of Mac OS X.
Is seems to be ok such as mkdir("abcde2"), but NG with mkdir("abcde2/").
It might be caused libc translate "abcde2/" string to "abcde2:" for Mac fs.

Followed patches is fix this problem for 2.0.9/2.2 and HEAD.

Regards,

---- Cut Here ---- For 2.0.9/2.2 ----
diff -ur passdb/passdb.c.010604 passdb/passdb.c
--- passdb/passdb.c.010604      Thu Apr 12 16:36:17 2001
+++ passdb/passdb.c     Mon Jun  4 09:52:10 2001
@@ -847,7 +847,8 @@
        pstrcpy(sid_file, lp_smb_passwd_file());
        p = strrchr(sid_file, '/');
        if(p != NULL) {
-               *++p = '\0';
+               *(p+1) = '\0';
+               if (p != sid_file) *p = '\0';
        }
 
        if (!directory_exist(sid_file, NULL)) {
@@ -858,6 +859,9 @@
                }
        }
 
+       if (p != sid_file) {
+               pstrcat(sid_file, "/");
+       }
        pstrcat(sid_file, "MACHINE.SID");
     
        if((fd = sys_open(sid_file, O_RDWR | O_CREAT, 0644)) == -1) {
---- Cut Here ----


---- Cut Here ---- For today's HEAD CVS branch ----
diff -ur passdb/machine_sid.c.010606 passdb/machine_sid.c
--- passdb/machine_sid.c.010606 Tue Nov 14 08:03:28 2000
+++ passdb/machine_sid.c        Wed Jun  6 08:49:26 2001
@@ -72,7 +72,8 @@
        pstrcpy(sid_file, lp_smb_passwd_file());
        p = strrchr(sid_file, '/');
        if(p != NULL) {
-               *++p = '\0';
+               if (p != sid_file) *p = '\0';
+               else *(p+1) = '\0';
        }
 
        if (!directory_exist(sid_file, NULL)) {
@@ -83,6 +84,9 @@
                }
        }
 
+       if (p != sid_file) {
+               pstrcat(sid_file, "/");
+       }
        pstrcat(sid_file, "MACHINE.SID");
     
        if((fd = sys_open(sid_file, O_RDWR | O_CREAT, 0644)) == -1) {
---- Cut Here ----


--
----------
Kensuke Nezu, nez at samba.gr.jp
Auditor , Samba Users Group in Japan




More information about the samba-technical mailing list