MacOS X Server samba diffs

Steffond Jones sjones at apple.com
Wed Dec 12 17:17:05 GMT 2001


The source for the samba components in MacOS X Server is located at:
http://www.opensource.apple.com/tools/cvs ('samba' module)
The latest vendor branch is samba2.2.1a. The main branch
includes the following modifications (see diffs below)..

1) DirectoryService suport (encrypted authentication)
2) CFString usage (DOS code page <-> decomposed UTF8)
3) smbstatus -r (raw dump of user connections)

You may forward questions regarding MacOS X Server
system services (e.g. DirectoryService) to the following mailing list..
  http://lists.apple.com/mailman/listinfo/macos-x-server

Index: source/Makefile.in
===================================================================
RCS file: /cvs/repository/iservers/Servers/samba/source/Makefile.in,v
retrieving revision 1.3
retrieving revision 1.1.1.2
diff -u -r1.3 -r1.1.1.2
--- Makefile.in	2001/07/17 06:02:38	1.3
+++ Makefile.in	2001/07/16 22:26:18	1.1.1.2
@@ -28,7 +28,7 @@
  top_builddir=.
  SHELL=/bin/sh

-BASEDIR= @exec_prefix@
+BASEDIR= @prefix@
  BINDIR = @bindir@
  DATADIR = @datadir@
  # sbindir is mapped to bindir when compiling SAMBA in 2.0.x 
compatibility mode.
@@ -616,8 +616,6 @@
  installdirs:
  	$(SHELL) $(srcdir)/install-sh -d -m $(INSTALLPERMS) \
  	$(BASEDIR) $(SBINDIR) $(BINDIR) $(LIBDIR) $(VARDIR) $(CODEPAGEDIR)
-	$(SHELL) $(srcdir)/install-sh -d -m $(INSTALLPERMS) $(mandir)
-	$(SHELL) $(srcdir)/install-sh -d -m 500 $(PRIVATEDIR)

  installservers: all installdirs
  	@$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(BASEDIR) 
$(SBINDIR) $(LIBDIR) $(VARDIR) $(SPROGS)
@@ -641,12 +639,12 @@
  	@$(SHELL) $(srcdir)/script/revert.sh $(BINDIR) $(PROGS) $(SCRIPTS)

  installman:
-	@$(SHELL) $(srcdir)/script/installman.sh $(mandir) $(srcdir) "@ROFF@"
+	@$(SHELL) $(srcdir)/script/installman.sh $(MANDIR) $(srcdir) "@ROFF@"

  uninstall: uninstallman uninstallbin uninstallscripts uninstallcp

  uninstallman:
-	@$(SHELL) $(srcdir)/script/uninstallman.sh $(mandir) $(srcdir)
+	@$(SHELL) $(srcdir)/script/uninstallman.sh $(MANDIR) $(srcdir)

  uninstallbin:
  	@$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) 
$(BASEDIR) $(SBINDIR) $(LIBDIR) $(VARDIR) $(SPROGS)
Index: source/include/includes.h
===================================================================
RCS file: 
/cvs/repository/iservers/Servers/samba/source/include/includes.h,v
retrieving revision 1.6
retrieving revision 1.1.1.2
diff -u -r1.6 -r1.1.1.2
--- includes.h	2001/09/09 08:21:54	1.6
+++ includes.h	2001/07/16 22:26:37	1.1.1.2
@@ -1043,25 +1043,5 @@
  #define slprintf snprintf
  #define vslprintf vsnprintf

-/* MacOS X DirectoryService */
-#ifdef DIRECTORY_SERVICE_X
-#include <DirectoryService/DirServices.h>
-#include <DirectoryService/DirServicesConst.h>
-#include <DirectoryService/DirServicesUtils.h>
-#include <Security/checkpw.h>
-#include <CoreFoundation/CFString.h>
-
-tDirNodeReference getusernode(tDirReference dirRef, char *userName);
-BOOL pass_check_directoryservice(char *user, char *challenge, char 
*password);
-BOOL DirServicesAuthUser(tDirReference dirRef, tDirNodeReference 
userNode, char *user, char *challenge, char *password, char 
*inAuthMethod);
-#endif
-
-/* MacOS X CFString */
-#ifdef USES_CFSTRING
-#include <CoreFoundation/CFString.h>
-#include <CoreFoundation/CFStringEncodingExt.h>
-#include <CoreFoundation/CFStringEncodingConverter.h>
-#endif
-
  #endif /* _INCLUDES_H */

Index: source/lib/charset.c
===================================================================
RCS file: /cvs/repository/iservers/Servers/samba/source/lib/charset.c,v
retrieving revision 1.3
retrieving revision 1.1.1.2
diff -u -r1.3 -r1.1.1.2
--- charset.c	2001/07/17 06:02:41	1.3
+++ charset.c	2001/07/16 22:26:47	1.1.1.2
@@ -24,10 +24,6 @@

  extern int DEBUGLEVEL;

-#ifdef USES_CFSTRING
-extern int global_CFString_Encoding;
-#endif
-
  /*
   * Codepage definitions.
   */
@@ -346,9 +342,7 @@
     * Known client codepages - these can be added to.
     */
    cp = load_client_codepage( client_codepage );
-#ifdef USES_CFSTRING
-  global_CFString_Encoding = 
CFStringConvertWindowsCodepageToEncoding(client_codepage);
-#endif
+
    if(cp == NULL)
    {
  #ifdef KANJI
Index: source/lib/kanji.c
===================================================================
RCS file: /cvs/repository/iservers/Servers/samba/source/lib/kanji.c,v
retrieving revision 1.4
retrieving revision 1.1.1.2
diff -u -r1.4 -r1.1.1.2
--- kanji.c	2001/08/03 00:31:37	1.4
+++ kanji.c	2001/07/16 22:26:51	1.1.1.2
@@ -29,12 +29,6 @@
  #define _KANJI_C_
  #include "includes.h"

-#ifdef USES_CFSTRING
-int global_CFString_Encoding = kCFStringEncodingDOSLatin1;
-int ConvertEncodingToUTF8(const char* inCStr, char* outUTF8Buffer, int 
outUTF8BufferLength, unsigned long scriptEncoding, unsigned long flags);
-int ConvertUTF8ToEncoding(const char* inUTF8Buf, int inUTF8BufLength, 
char* outCStrBuffer, int outCStrBufferLength, unsigned long 
scriptEncoding, unsigned long flags);
-#endif
-
  /*
   * Function pointers that get overridden when multi-byte code pages
   * are loaded.
@@ -388,9 +382,7 @@

  /* convesion buffer */
  static char cvtbuf[2*sizeof(pstring)];
-#ifdef USES_CFSTRING
-static smb_ucs2_t ucs2Str[1024];
-#endif
+
  /*******************************************************************
    EUC <-> SJIS
  ********************************************************************/
@@ -1362,36 +1354,8 @@
  ********************************************************************/
  static char *cp_to_utf8(char *from, BOOL overwrite)
  {
-#ifdef USES_CFSTRING
    unsigned char *dst;
    unsigned char *src;
-  int result = 0;
-  smb_ucs2_t *ucs2result = NULL;
-  unsigned int unicodeChars = 0;
-  unsigned long usedByteLen = 0;
-  unsigned long usedCharLen = 0;
-
-  src = (unsigned char *)from;
-  dst = (unsigned char *)cvtbuf;
-
-  dst[0] = '\0';
-  if (global_CFString_Encoding != kCFStringEncodingDOSJapanese)
-  {
-      if (*src)
-      {
-          ucs2result = dos_to_unicode(ucs2Str, src, 2048);
-          unicodeChars = strlen_w(ucs2Str);
-          result = 
CFStringEncodingUnicodeToBytes(kCFStringEncodingUTF8, 
kCFStringEncodingUseHFSPlusCanonical,(const UniChar 
*)ucs2Str,unicodeChars,&usedCharLen,(UInt8*)dst,2047,&usedByteLen);
-		  if (result == 0)
-		  	dst[usedByteLen] = '\0';
-      }
-  }
-else
-    result = ConvertEncodingToUTF8((const char*) src, dst, 2048, 
global_CFString_Encoding, kCFStringEncodingUseHFSPlusCanonical);
-
-#else /* composed utf8 */
-  unsigned char *dst;
-  unsigned char *src;
    smb_ucs2_t val;
    int w;
    size_t len;
@@ -1421,7 +1385,6 @@

    }
    *dst++='\0';
-#endif
    if (overwrite) {
      pstrcpy ((char *) from, (char *) cvtbuf);
      return (char *) from;
@@ -1435,32 +1398,6 @@
  ********************************************************************/
  static char *utf8_to_cp(char *from, BOOL overwrite)
  {
-#ifdef USES_CFSTRING
-  unsigned char *src;
-  unsigned char *dst;
-  int srclen;
-  CFStringRef 	cfstr = NULL;
-
-  src = (unsigned char *)from;
-  dst = (unsigned char *)cvtbuf;
-
-  dst[0] = '\0';
-  if (global_CFString_Encoding != kCFStringEncodingDOSJapanese)
-  {
-    if (*src)
-    {
-        cfstr = CFStringCreateWithCString(NULL, 
src,kCFStringEncodingUTF8);
-        if (!CFStringGetCString(cfstr, (char*)dst, 2048, 
global_CFString_Encoding))
-            safe_strcpy(dst, src, 2048);
-        CFRelease( cfstr );
-		
-    }
-  } else {
-     srclen = strlen(src);
-     ConvertUTF8ToEncoding((const char*) src, srclen, dst, 2048, 
global_CFString_Encoding,kCFStringEncodingUseHFSPlusCanonical);
-  }
-
-#else /* composed utf8 */
    unsigned char *src;
    unsigned char *dst;
    smb_ucs2_t val;
@@ -1488,7 +1425,6 @@
      }
    }
    *dst++='\0';
-#endif
    if (overwrite) {
      pstrcpy ((char *) from, (char *) cvtbuf);
      return (char *) from;
@@ -1753,81 +1689,3 @@
         return temp;
  }
  char *(*_dos_to_dos)(char *, BOOL) = no_conversion;
-
-#ifdef USES_CFSTRING
-
-int ConvertEncodingToUTF8(const char* inCStr,
-                                                   char* outUTF8Buffer,
-                                                   int 
outUTF8BufferLength,
-                                                   unsigned long 
scriptEncoding,
-                                                    unsigned long flags)
-{
-        unsigned long unicodeChars;
-        unsigned long srcCharsUsed;
-        unsigned long usedByteLen = 0;
-        UniChar uniStr[512];
-        unsigned long cfResult;
-
-        cfResult = CFStringEncodingBytesToUnicode(
-                                scriptEncoding,
-                                flags,
-                                                  (char *)inCStr,
-                                strlen(inCStr),
-                                &srcCharsUsed,
-                                uniStr,
-                                512,
-                                &unicodeChars);
-        if (cfResult == 0) {
-                cfResult = CFStringEncodingUnicodeToBytes(
-                                        kCFStringEncodingUTF8,
-                                        flags,
-                                        uniStr,
-                                        unicodeChars,
-                                        &srcCharsUsed,
-                                                          
(char*)outUTF8Buffer,
-                                        outUTF8BufferLength - 1,
-                                        &usedByteLen);
-                outUTF8Buffer[usedByteLen] = '\0';
-        }
-        return cfResult;
-}
-
-
-int ConvertUTF8ToEncoding(const char* inUTF8Buf,
-                                                   int inUTF8BufLength,
-                                                   char* outCStrBuffer,
-                                                   int 
outCStrBufferLength,
-                                                    unsigned long 
scriptEncoding,
-                                                    unsigned long flags)
-{
-        unsigned long unicodeChars;
-        unsigned long srcCharsUsed;
-        unsigned long usedByteLen = 0;
-        UniChar uniStr[256];
-        unsigned long cfResult;
-
-        cfResult = CFStringEncodingBytesToUnicode(
-                                kCFStringEncodingUTF8,
-                                flags,
-                                (char*)inUTF8Buf,
-                                inUTF8BufLength,
-                                &srcCharsUsed,
-                                uniStr,
-                                255,
-                                &unicodeChars);
-        if (cfResult == 0) {
-                        cfResult = CFStringEncodingUnicodeToBytes(
-                                                scriptEncoding,
-                                                flags,
-                                                uniStr,
-                                                unicodeChars,
-                                                &srcCharsUsed,
-                                                (char*)outCStrBuffer,
-                                                outCStrBufferLength - 1,
-                                                &usedByteLen);
-                        outCStrBuffer[usedByteLen] = '\0';
-        }
-        return cfResult;
-}
-#endif /* USES_CFSTRING */
-
Index: source/lib/system.c
===================================================================
RCS file: /cvs/repository/iservers/Servers/samba/source/lib/system.c,v
retrieving revision 1.4
retrieving revision 1.1.1.2
diff -u -r1.4 -r1.1.1.2
Index: source/lib/util.c
===================================================================
RCS file: /cvs/repository/iservers/Servers/samba/source/lib/util.c,v
retrieving revision 1.3
retrieving revision 1.1.1.2
diff -u -r1.3 -r1.1.1.2
Index: source/lib/util_sock.c
===================================================================
RCS file: /cvs/repository/iservers/Servers/samba/source/lib/util_sock.c,v
retrieving revision 1.3
retrieving revision 1.1.1.2
diff -u -r1.3 -r1.1.1.2
Index: source/lib/util_unistr.c
===================================================================
RCS file: 
/cvs/repository/iservers/Servers/samba/source/lib/util_unistr.c,v
retrieving revision 1.4
retrieving revision 1.1.1.2
diff -u -r1.4 -r1.1.1.2
--- util_unistr.c	2001/08/01 18:53:48	1.4
+++ util_unistr.c	2001/07/16 22:27:00	1.1.1.2
@@ -737,7 +737,7 @@

  	dst_len /= sizeof(smb_ucs2_t); /* Convert to smb_ucs2_t units. */

-	for(i = 0; (i < (dst_len  - 1)) && *src;) {
+	for(i = 0; (i < (dst_len  - 1)) && src[i];) {
  		size_t skip = skip_multibyte_char(*src);
  		smb_ucs2_t val = (*src & 0xff);

@@ -757,6 +757,7 @@
  	}

  	dst[i] = 0;
+
  	return dst;
  }

Index: source/passdb/pass_check.c
===================================================================
RCS file: 
/cvs/repository/iservers/Servers/samba/source/passdb/pass_check.c,v
retrieving revision 1.3
retrieving revision 1.1.1.2
diff -u -r1.3 -r1.1.1.2
--- pass_check.c	2001/07/17 06:02:51	1.3
+++ pass_check.c	2001/07/16 22:27:23	1.1.1.2
@@ -598,13 +598,6 @@
  static BOOL password_check(char *password)
  {

-#ifdef DIRECTORY_SERVICE_X
-    if (checkpw(this_user,password) == 0)
-        return(True);
-    else
-        return(False);
-#endif
-
  #ifdef WITH_PAM
  	return (smb_pam_passcheck(this_user, password) == 
NT_STATUS_NOPROBLEMO);
  #endif /* WITH_PAM */
Index: source/script/installbin.sh
===================================================================
RCS file: 
/cvs/repository/iservers/Servers/samba/source/script/installbin.sh,v
retrieving revision 1.2
retrieving revision 1.1.1.2
diff -u -r1.2 -r1.1.1.2
--- installbin.sh	2001/09/10 22:08:45	1.2
+++ installbin.sh	2001/07/16 22:27:51	1.1.1.2
@@ -11,7 +11,7 @@
  shift
  shift

-for d in $BASEDIR $BINDIR $LIBDIR $VARDIR; do
+for d in $BASEDIR $BINDIR $LIBDIR $VARDIR $BASEDIR/private; do
  if [ ! -d $d ]; then
  mkdir $d
  if [ ! -d $d ]; then
@@ -31,8 +31,7 @@
   fi
   cp $p $BINDIR/
   chmod $INSTALLPERMS $BINDIR/$p2
- strip -S $BINDIR/$p2
-
+
   # this is a special case, mount needs this in a specific location
   if [ $p2 = smbmount ]; then
     ln -sf $BINDIR/$p2 /sbin/mount.smbfs
Index: source/smbd/password.c
===================================================================
RCS file: /cvs/repository/iservers/Servers/samba/source/smbd/password.c,v
retrieving revision 1.5
retrieving revision 1.1.1.2
diff -u -r1.5 -r1.1.1.2
--- password.c	2001/09/09 08:21:54	1.5
+++ password.c	2001/07/16 22:28:11	1.1.1.2
@@ -611,13 +611,9 @@
  			return False;
  		}

-#ifdef DIRECTORY_SERVICE_X
-                ret = pass_check_directoryservice(user, challenge, 
password);
-#else
  		ret = pass_check_smb(user, global_myworkgroup,
  		                      challenge, (uchar *)password, (uchar 
*)password, pwd);

-#endif
  		/*
  		 * Try with PAM (may not be compiled in - returns True if not. JRA).
  		 * FIXME ! Should this be called if we're using winbindd ? What about
@@ -1656,216 +1652,3 @@
    cli_shutdown(&cli);
    return True;
  }
-
-#ifdef DIRECTORY_SERVICE_X
-BOOL pass_check_directoryservice(char *user, char *challenge, char 
*password)
-{
-    tDirStatus		status		= eDSNoErr;
-    tDirReference	dirRef		= NULL;
-    tDirNodeReference	userNodeRef	= NULL;
-    BOOL		result		= False;
-
-    status = dsOpenDirService(&dirRef);
-    if (status != eDSNoErr) return False;
-
-    userNodeRef = getusernode(dirRef, user);
-
-    if (userNodeRef != NULL)
-    {
-        result =DirServicesAuthUser(dirRef, userNodeRef, user, 
challenge, password, kDSStdAuthSMB_NT_Key) ||
-                DirServicesAuthUser(dirRef, userNodeRef, user, 
challenge, password, kDSStdAuthSMB_LM_Key);
-        dsCloseDirNode( userNodeRef );
-    }
-    dsCloseDirService(dirRef);
-
-    return result;
-}
-
-tDirNodeReference getusernode(tDirReference dirRef, char *userName)
-{
-    tDirStatus			status			= eDSNoErr;
-    long			bufferSize		= 2048;
-    long			returnCount		= 0;
-    tDataBufferPtr		nodeBuffer		= NULL;
-    tDirNodeReference		searchNodeRef		= NULL;
-    tDataListPtr		searchNodeName		= NULL;
-    tDirNodeReference		userNodeRef		= NULL;
-    tDataListPtr		userNodePath		= NULL;
-    char			userNodePathStr[256]	= {0};
-    char			recUserName[128]	= {0};
-
-    tDataListPtr		recName			= NULL;
-    tDataListPtr		recType			= NULL;
-    tDataListPtr		attrType		= NULL;
-
-    tAttributeListRef		attributeListRef	= 0;
-    tRecordEntryPtr		outRecordEntryPtr	= NULL;
-    tAttributeEntryPtr		attributeInfo		= NULL;
-    tAttributeValueListRef	attributeValueListRef	= 0;
-    tAttributeValueEntryPtr	attrValue		= NULL;
-    long			i			= 0;
-
-    nodeBuffer = dsDataBufferAllocate(dirRef, bufferSize);
-    if (nodeBuffer == NULL) goto cleanup;
-    status = dsFindDirNodes(dirRef, nodeBuffer, NULL, 
eDSSearchNodeName, &returnCount, NULL);
-    if ((status != eDSNoErr) || (returnCount <= 0)) goto cleanup;
-
-    searchNodeName = dsDataListAllocate(dirRef);
-    status = dsGetDirNodeName(dirRef, nodeBuffer, 1, &searchNodeName);
-    if (status != eDSNoErr) goto cleanup;
-    status = dsOpenDirNode(dirRef, searchNodeName, &searchNodeRef);
-    if (status != eDSNoErr) goto cleanup;
-
-    recName = dsBuildListFromStrings(dirRef, userName, NULL);
-    recType = dsBuildListFromStrings(dirRef, kDSStdRecordTypeUsers, 
NULL);	
-    attrType = dsBuildListFromStrings(dirRef, kDSNAttrMetaNodeLocation, 
kDSNAttrRecordName, NULL);
-
-    status = dsGetRecordList(searchNodeRef, nodeBuffer, recName, 
eDSiExact, recType, attrType, 0, &returnCount, NULL);
-    if (status != eDSNoErr) goto cleanup;
-
-    status = dsGetRecordEntry(searchNodeRef, nodeBuffer, 1, 
&attributeListRef, &outRecordEntryPtr);
-    if (status == eDSNoErr)
-    {
-        for (i = 1 ; i <= outRecordEntryPtr->fRecordAttributeCount; i++)
-        {
-            status = dsGetAttributeEntry(searchNodeRef, nodeBuffer, 
attributeListRef, i, &attributeValueListRef, &attributeInfo);
-            status = dsGetAttributeValue(searchNodeRef, nodeBuffer, 1, 
attributeValueListRef, &attrValue);
-            if (attributeValueListRef != 0)
-            {
-                    dsCloseAttributeValueList(attributeValueListRef);
-                    attributeValueListRef = 0;
-            }	
-            if (status == eDSNoErr)
-            {
-                if 
(strncmp(attributeInfo->fAttributeSignature.fBufferData, 
kDSNAttrMetaNodeLocation, strlen(kDSNAttrMetaNodeLocation)) == 0)
-                    strncpy(userNodePathStr, 
attrValue->fAttributeValueData.fBufferData, 
attrValue->fAttributeValueData.fBufferSize);
-                else if 
(strncmp(attributeInfo->fAttributeSignature.fBufferData, 
kDSNAttrRecordName, strlen(kDSNAttrRecordName)) == 0)
-                    strncpy(recUserName, 
attrValue->fAttributeValueData.fBufferData, 
attrValue->fAttributeValueData.fBufferSize);
-            }
-            if (attrValue != NULL) {
-                    dsDeallocAttributeValueEntry(dirRef, attrValue);
-                    attrValue = NULL;
-            }				
-            if (attributeInfo != NULL) {
-                    dsDeallocAttributeEntry(dirRef, attributeInfo);
-                    attributeInfo = NULL;
-            }
-        }
-        if (outRecordEntryPtr != NULL) {
-            dsDeallocRecordEntry(dirRef, outRecordEntryPtr);
-            outRecordEntryPtr = NULL;
-        }
-        if (strlen(userNodePathStr) != 0 && strlen(recUserName) != 0)
-        {
-            userNodePath = dsBuildFromPath(dirRef, 
userNodePathStr, "/");
-            status = dsOpenDirNode(dirRef, userNodePath, &userNodeRef);
-            dsDataListDeAllocate( dirRef, userNodePath, true );
-            free(userNodePath);
-        }
-    }
-cleanup:
-    if (nodeBuffer != NULL)
-        dsDataBufferDeAllocate(dirRef, nodeBuffer);
-    if (searchNodeName != NULL)
-    {
-        dsDataListDeAllocate(dirRef, searchNodeName, 0);
-        free(searchNodeName);
-    }
-    if (searchNodeRef != NULL)
-        dsCloseDirNode(searchNodeRef);
-    if (recName != NULL)
-    {
-        dsDataListDeAllocate(dirRef, recName, 0);
-        free(recName);
-    }
-    if (recType != NULL)
-    {
-        dsDataListDeAllocate(dirRef, recType, 0);
-        free(recType);
-    }
-    if (attrType != NULL)
-    {
-        dsDataListDeAllocate(dirRef, attrType, 0);
-        free(attrType);
-    }
-
-    return userNodeRef;
-}
-
-BOOL DirServicesAuthUser(tDirReference dirRef, tDirNodeReference 
userNode, char* user, char *challenge, char *password, char 
*inAuthMethod)
-{
-	tDirStatus 		status			= eDSNoErr;
-	unsigned long		curr			= 0;
-	unsigned long		len			= 0;
-	tDataBufferPtr		authBuff  		= NULL;
-	tDataBufferPtr		stepBuff  		= NULL;
-	tDataNodePtr		authType		= NULL;
-	BOOL			result			= False;
-			
-	
-        authBuff = dsDataBufferAllocate( dirRef, 2048 );
-        if ( authBuff != NULL )
-        {
-                stepBuff = dsDataBufferAllocate( dirRef, 2048 );
-                if ( stepBuff != NULL )
-                {
-                        authType = dsDataNodeAllocateString( dirRef,  
inAuthMethod);
-                        if ( authType != NULL )
-                        {
-                                // User Name
-                                len = strlen( user );
-                                memcpy( &(authBuff->fBufferData
[ curr ]), &len, 4 );
-                                curr += sizeof( long );
-                                memcpy( &(authBuff->fBufferData
[ curr ]), user, len );
-                                curr += len;
-                                // C8
-                                len = 8;
-                                memcpy( &(authBuff->fBufferData
[ curr ]), &len, 4 );
-                                curr += sizeof (long );
-                                memcpy( &(authBuff->fBufferData
[ curr ]), challenge, len );
-                                curr += len;
-                                // P24
-                                len = 24;
-                                memcpy( &(authBuff->fBufferData
[ curr ]), &len, 4 );
-                                curr += sizeof (long );
-                                memcpy( &(authBuff->fBufferData
[ curr ]), password, len );
-                                curr += len;
-
-                                authBuff->fBufferLength = curr;
-                                status = dsDoDirNodeAuth( userNode, 
authType, True, authBuff, stepBuff, NULL );
-                                if ( status == eDSNoErr )
-                                {
-                                        result = True;
-                                        DEBUG(1,("User \"%s\" 
authenticated successfully with \"%s\" :)\n", user, inAuthMethod ));
-                                }
-                                else
-                                {
-                                        DEBUG(1,("User \"%s\" failed to 
authenticate with \"%s\" (%d) :(\n", user, inAuthMethod,status) );
-                                }
-                        }
-                        status = dsDataBufferDeAllocate( dirRef, 
stepBuff );
-                        if ( status != eDSNoErr )
-                        {
-                                DEBUG(1,("*** dsDataBufferDeAllocate(2) 
faild with error = %ld: \n", status) );
-                        }
-                }
-                else
-                {
-                        DEBUG(1,("*** dsDataBufferAllocate(2) faild 
with \n" ));
-                }
-                status = dsDataBufferDeAllocate( dirRef, authBuff );
-                if ( status != eDSNoErr )
-                {
-                        DEBUG(1,( "*** dsDataBufferDeAllocate(2) faild 
with error = %ld: \n", status ));
-                }
-        }
-        else
-        {
-                DEBUG(1,("*** dsDataBufferAllocate(1) faild with \n" ));
-        }
-
-	return result;
-
-
-}
-#endif
Index: source/utils/status.c
===================================================================
RCS file: /cvs/repository/iservers/Servers/samba/source/utils/status.c,v
retrieving revision 1.2
retrieving revision 1.1.1.2
diff -u -r1.2 -r1.1.1.2
--- status.c	2001/07/17 06:03:01	1.2
+++ status.c	2001/07/16 22:28:33	1.1.1.2
@@ -56,7 +56,6 @@
  static int            locks_only  = 0;            /* Added by RJS */
  static BOOL processes_only=False;
  static int show_brl;
-static int raw = 0;

  /* we need these because we link to locking*.o */
   void become_root(void) {}
@@ -221,9 +220,7 @@
  		}
  	} else {
  		Ucrit_addPid(crec.pid);
-		if (raw)
-                    printf("%d %d %d 
%s\n",(int)crec.pid,crec.uid,(int)crec.start, crec.addr);		
-		else if (processes_only) {
+		if (processes_only) {
  			if (last_pid != crec.pid)
  				printf("%d\n",(int)crec.pid);
  			last_pid = crec.pid; /* XXXX we can still get repeats, have to
@@ -265,7 +262,7 @@
  		return(1);
  	}
  	
-	while ((c = getopt(argc, argv, "pdLSs:u:bPBr")) != EOF) {
+	while ((c = getopt(argc, argv, "pdLSs:u:bPB")) != EOF) {
  		switch (c) {
  		case 'b':
  			brief = 1;
@@ -285,9 +282,6 @@
  		case 'P':
  			profile_only = 1;
  			break;
-		case 'r':
-			raw = 1;
-			break;
  		case 'S':
  			shares_only = 1;
  			break;
@@ -318,12 +312,9 @@
  	
  	tdb = tdb_open_log(lock_path("connections.tdb"), 0, 0, O_RDONLY, 0);
  	if (!tdb) {
-		if (!raw)
-		{
-			printf("connections.tdb not initialised\n");
-			if (!lp_status(-1))
-				printf("You need to have status=yes in your smb config file\n");
-		}
+		printf("connections.tdb not initialised\n");
+		if (!lp_status(-1))
+			printf("You need to have status=yes in your smb config file\n");
  		return(0);
  	}  else if (verbose) {
  		printf("Opened status file %s\n", fname);
@@ -331,21 +322,18 @@

  	if (locks_only) goto locks;

-	if (!raw)
-	{
-		printf("\nSamba version %s\n",VERSION);
-		if (brief) {
-			printf("PID     Username  Machine                       
Time logged in\n");
-		
	printf("-------------------------------------------------------------------\n"
);
-		} else {
-			printf("Service      uid      gid      pid     machine\n");
-			printf("----------------------------------------------\n");
-		}
+	printf("\nSamba version %s\n",VERSION);
+	if (brief) {
+		printf("PID     Username  Machine                       Time 
logged in\n");
+	
	printf("-------------------------------------------------------------------\n"
);
+	} else {
+		printf("Service      uid      gid      pid     machine\n");
+		printf("----------------------------------------------\n");
  	}
  	tdb_traverse(tdb, traverse_fn1, NULL);

   locks:
-	if (processes_only || raw) exit(0);
+	if (processes_only) exit(0);

  	if (brief)  {
  		ptr=srecs;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 27545 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba/attachments/20011212/fdca234c/attachment.bin


More information about the samba mailing list