From 0e8fd3398771da2f016d72830179507f3edda51b Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sat, 4 May 1996 07:50:46 +0000 Subject: Initial version imported to CVS (This used to be commit 291551d80711daab7b7581720bcd9a08d6096517) --- source3/include/byteorder.h | 80 +++ source3/include/charset.h | 61 +++ source3/include/clitar.h | 17 + source3/include/includes.h | 1154 +++++++++++++++++++++++++++++++++++++++++++ source3/include/kanji.h | 130 +++++ source3/include/local.h | 167 +++++++ source3/include/nameserv.h | 184 +++++++ source3/include/smb.h | 1006 +++++++++++++++++++++++++++++++++++++ source3/include/trans2.h | 241 +++++++++ source3/include/version.h | 1 + source3/include/vt_mode.h | 48 ++ 11 files changed, 3089 insertions(+) create mode 100644 source3/include/byteorder.h create mode 100644 source3/include/charset.h create mode 100644 source3/include/clitar.h create mode 100644 source3/include/includes.h create mode 100644 source3/include/kanji.h create mode 100644 source3/include/local.h create mode 100644 source3/include/nameserv.h create mode 100644 source3/include/smb.h create mode 100644 source3/include/trans2.h create mode 100644 source3/include/version.h create mode 100644 source3/include/vt_mode.h (limited to 'source3/include') diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h new file mode 100644 index 0000000000..899cd6c499 --- /dev/null +++ b/source3/include/byteorder.h @@ -0,0 +1,80 @@ +/* + Unix SMB/Netbios implementation. + Version 1.9. + SMB Byte handling + Copyright (C) Andrew Tridgell 1992-1995 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +/* + This file implements macros for machine independent short and + int manipulation +*/ + +#undef CAREFUL_ALIGNMENT + +/* we know that the 386 can handle misalignment and has the "right" + byteorder */ +#ifdef __i386__ +#define CAREFUL_ALIGNMENT 0 +#endif + +#ifndef CAREFUL_ALIGNMENT +#define CAREFUL_ALIGNMENT 1 +#endif + +#define CVAL(buf,pos) (((unsigned char *)(buf))[pos]) +#define PVAL(buf,pos) ((unsigned)CVAL(buf,pos)) +#define SCVAL(buf,pos,val) (CVAL(buf,pos) = (val)) + + +#if CAREFUL_ALIGNMENT +#define SVAL(buf,pos) (PVAL(buf,pos)|PVAL(buf,(pos)+1)<<8) +#define IVAL(buf,pos) (SVAL(buf,pos)|SVAL(buf,(pos)+2)<<16) +#define SSVALX(buf,pos,val) (CVAL(buf,pos)=(val)&0xFF,CVAL(buf,pos+1)=(val)>>8) +#define SIVALX(buf,pos,val) (SSVALX(buf,pos,val&0xFFFF),SSVALX(buf,pos+2,val>>16)) +#define SVALS(buf,pos) ((int16)SVAL(buf,pos)) +#define IVALS(buf,pos) ((int32)IVAL(buf,pos)) +#define SSVAL(buf,pos,val) SSVALX((buf),(pos),((uint16)(val))) +#define SIVAL(buf,pos,val) SIVALX((buf),(pos),((uint32)(val))) +#define SSVALS(buf,pos,val) SSVALX((buf),(pos),((int16)(val))) +#define SIVALS(buf,pos,val) SIVALX((buf),(pos),((int32)(val))) +#else +/* this handles things for architectures like the 386 that can handle + alignment errors */ +/* + WARNING: This section is dependent on the length of int16 and int32 + being correct +*/ +#define SVAL(buf,pos) (*(uint16 *)((char *)(buf) + (pos))) +#define IVAL(buf,pos) (*(uint32 *)((char *)(buf) + (pos))) +#define SVALS(buf,pos) (*(int16 *)((char *)(buf) + (pos))) +#define IVALS(buf,pos) (*(int32 *)((char *)(buf) + (pos))) +#define SSVAL(buf,pos,val) SVAL(buf,pos)=((uint16)(val)) +#define SIVAL(buf,pos,val) IVAL(buf,pos)=((uint32)(val)) +#define SSVALS(buf,pos,val) SVALS(buf,pos)=((int16)(val)) +#define SIVALS(buf,pos,val) IVALS(buf,pos)=((int32)(val)) +#endif + + +/* now the reverse routines - these are used in nmb packets (mostly) */ +#define SREV(x) ((((x)&0xFF)<<8) | (((x)>>8)&0xFF)) +#define IREV(x) ((SREV(x)<<16) | (SREV((x)>>16))) + +#define RSVAL(buf,pos) SREV(SVAL(buf,pos)) +#define RIVAL(buf,pos) IREV(IVAL(buf,pos)) +#define RSSVAL(buf,pos,val) SSVAL(buf,pos,SREV(val)) +#define RSIVAL(buf,pos,val) SIVAL(buf,pos,IREV(val)) diff --git a/source3/include/charset.h b/source3/include/charset.h new file mode 100644 index 0000000000..7091732223 --- /dev/null +++ b/source3/include/charset.h @@ -0,0 +1,61 @@ +/* + Unix SMB/Netbios implementation. + Version 1.9. + Character set handling + Copyright (C) Andrew Tridgell 1992-1995 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef CHARSET_C + +extern char *dos_char_map; +extern char *upper_char_map; +extern char *lower_char_map; +extern void add_char_string(char *s); +extern void charset_initialise(void); + +#ifdef toupper +#undef toupper +#endif + +#ifdef tolower +#undef tolower +#endif + +#ifdef isupper +#undef isupper +#endif + +#ifdef islower +#undef islower +#endif + +#ifdef isdoschar +#undef isdoschar +#endif + +#ifdef isspace +#undef isspace +#endif + +#define toupper(c) upper_char_map[(char)(c)] +#define tolower(c) lower_char_map[(char)(c)] +#define isupper(c) (((char)(c)) != tolower(c)) +#define islower(c) (((char)(c)) != toupper(c)) +#define isdoschar(c) (dos_char_map[(char)(c)] != 0) +#define isspace(c) ((c)==' ' || (c) == '\t') +#endif + diff --git a/source3/include/clitar.h b/source3/include/clitar.h new file mode 100644 index 0000000000..2305fceeec --- /dev/null +++ b/source3/include/clitar.h @@ -0,0 +1,17 @@ + +#define TBLOCK 512 +#define NAMSIZ 100 +union hblock { + char dummy[TBLOCK]; + struct header { + char name[NAMSIZ]; + char mode[8]; + char uid[8]; + char gid[8]; + char size[12]; + char mtime[12]; + char chksum[8]; + char linkflag; + char linkname[NAMSIZ]; + } dbuf; +}; diff --git a/source3/include/includes.h b/source3/include/includes.h new file mode 100644 index 0000000000..cc2bbbfad7 --- /dev/null +++ b/source3/include/includes.h @@ -0,0 +1,1154 @@ +#ifndef _INCLUDES_H +#define _INCLUDES_H +/* + Unix SMB/Netbios implementation. + Version 1.9. + Machine customisation and include handling + Copyright (C) Andrew Tridgell 1994-1995 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +/* + This file does all the #includes's. This makes it easier to + port to a new unix. Hopefully a port will only have to edit the Makefile + and add a section for the new unix below. +*/ + + +/* the first OS dependent section is to setup what includes will be used. + the main OS dependent section comes later on +*/ + +#ifdef ALTOS +#define NO_UTIMEH +#endif + +#ifdef MIPS +#define POSIX_H +#define NO_UTIMEH +#endif + +#ifdef sun386 +#define NO_UTIMEH +#endif + +#ifdef NEXT2 +#define NO_UTIMEH +#endif + +#ifdef NEXT3_0 +#define NO_UTIMEH +#define NO_UNISTDH +#endif + +#ifdef APOLLO +#define NO_UTIMEH +#define NO_SYSMOUNTH +#define NO_UNISTDH +#endif + +#ifdef AIX +#define NO_SYSMOUNTH +#endif + +#ifdef M88K_R3 +#define SVR3H +#define NO_RESOURCEH +#endif + +#ifdef DNIX +#define NO_SYSMOUNTH +#define NO_NETIFH +#define NO_RESOURCEH +#define PRIME_NMBD 0 +#define NO_SETGROUPS +#endif + + +#ifdef ISC +#define SYSSTREAMH +#define NO_RESOURCEH +#endif + +#ifdef QNX +#define NO_RESOURCEH +#define NO_SYSMOUNTH +#define USE_MMAP 1 +#ifdef __386__ + #define __i386__ +#endif +#endif + +#ifdef NEWS42 +#define NO_UTIMEH +#define NO_STRFTIME +#define NO_UTIMBUF +#define REPLACE_MKTIME +#define NO_TM_NAME +#endif + +#ifdef OS2 +#define NO_SYSMOUNTH +#define NO_NETIFH +#endif + +#ifdef LYNX +#define NO_SYSMOUNTH +#endif + + +#if (defined(SHADOW_PWD)||defined(OSF1_ENH_SEC)||defined(SecureWare)||defined(PWDAUTH)) +#define PASSWORD_LENGTH 16 +#endif + +/* here is the general includes section - with some ifdefs generated + by the previous section +*/ +#include "local.h" +#include +#ifdef POSIX_STDLIBH +#include +#else +#include +#endif +#include +#include +#ifndef NO_UTIMEH +#include +#endif +#include + +#ifdef SVR3H +#include +#include +#include +#include +#include +#endif + +#include +#include +#include +#ifdef POSIX_H +#include +#include +#include +#else +#include +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#ifndef NO_RESOURCEH +#include +#endif +#ifndef NO_SYSMOUNTH +#include +#endif +#include +#ifdef __STDC__ +#include +#else +#include +#endif +#ifndef NO_UNISTDH +#include +#endif +#include +#ifdef SYSSTREAMH +#include +#endif +#ifndef NO_NETIFH +#ifdef POSIX_H +#include +#else +#include +#endif +#endif + +#if USE_MMAP +#include +#endif + +#if defined(GETPWANAM) +#include +#include +#include +#include +#endif + +#if defined(SHADOW_PWD) && !defined(NETBSD) && !defined(CONVEX) +#include +#endif + +/* this might be different on different systems */ +#ifdef QUOTAS +#ifdef LINUX +#ifdef __KERNEL__ +#undef __KERNEL__ +#include +#define __KERNEL__ +#else +#include +#endif +#include +#else +#include +#ifndef CRAY +#include +#else +#include +#endif +#endif +#endif + +#ifdef SYSLOG +#include +#endif + + + +/*************************************************************************** +Here come some platform specific sections +***************************************************************************/ + + +#ifdef LINUX +#include +#include +#include +#include +#include +#ifndef NO_ASMSIGNALH +#include +#endif +#define SIGNAL_CAST (__sighandler_t) +#define USE_GETCWD +#define USE_SETSID +#define HAVE_BZERO +#define HAVE_MEMMOVE +#ifdef SHADOW_PWD +#ifndef crypt +#define crypt pw_encrypt +#endif +#endif +#endif + +#ifdef SUNOS4 +#define SIGNAL_CAST (void (*)(int)) +#include +#include +#include +#include +#include +#include +#include +#include +/* #include */ +#ifdef sun386 +#define NO_STRFTIME +#define NO_UTIMBUF +#define mktime timelocal +typedef unsigned short mode_t; +#else +#include +#define NO_STRERROR +#endif +#define REPLACE_GETPASS +#define BSD_TERMIO +#endif + + +#ifdef SUNOS5 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +extern int gettimeofday (struct timeval *, void *); +extern int gethostname (char *name, int namelen); +extern int innetgr (const char *, const char *, const char *, const char *); +#define USE_SETVBUF +#define SIGNAL_CAST (void (*)(int)) +#ifndef SYSV +#define SYSV +#endif +#define USE_WAITPID +#define REPLACE_STRLEN +#define USE_STATVFS +#define USE_GETCWD +#define USE_SETSID +#define REPLACE_GETPASS +#endif + + +#ifdef ULTRIX +#include +#include +#include +#include +#ifdef ULTRIX_AUTH +#include +#endif +char *getwd(char *); +#define NOSTRDUP +#ifdef __STDC__ +#define SIGNAL_CAST (void(*)(int)) +#endif +#define USE_DIRECT +#endif + +#ifdef SGI +#include +#include +#include +#include +#ifndef SYSV +#define SYSV +#endif +#define SIGNAL_CAST (void (*)()) +#define STATFS4 +#define USE_WAITPID +#define USE_DIRECT +#endif + +#ifdef SGI5 +#include +#include +#include +#include +#include +#define USE_WAITPID +#define NETGROUP +#ifndef SYSV +#define SYSV +#endif +#define SIGNAL_CAST (void (*)()) +#define USE_STATVFS +#define USE_WAITPID +#endif + + +#ifdef MIPS +#include +#include +#include +#include +#include +#include +#include +#define SIGNAL_CAST (void (*)()) +typedef int mode_t; +extern struct group *getgrnam(); +extern struct passwd *getpwnam(); +#define STATFS4 +#define NO_STRERROR +#define REPLACE_STRSTR +#endif /* MIPS */ + + + +#ifdef DGUX +#include +#include +#include +#include +#include +#include +#define SYSV +#define USE_WAITPID +#define SIGNAL_CAST (void (*)(int)) +#define STATFS4 +#define USE_GETCWD +#endif + + +#ifdef SVR4 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define SYSV +#define USE_WAITPID +#define SIGNAL_CAST (void (*)(int)) +#define USE_STATVFS +#define USE_GETCWD +#define USE_SETSID +#endif + + +#ifdef OSF1 +#include +#include +#include +char *getwd(char *); +char *mktemp(char *); /* No standard include */ +#include +#include /* both for inet_ntoa */ +#define SIGNAL_CAST ( void (*) (int) ) +#define STATFS3 +#define USE_F_FSIZE +#include +#ifdef OSF1_ENH_SEC +#include +#include +#include +#include +#include +#define PASSWORD_LENGTH 16 +#define NEED_AUTH_PARAMETERS +#endif /* OSF1_ENH_SEC */ +#endif + + +#ifdef CLIX +#include +#define SIGNAL_CAST (void (*)()) +#include +#include +#include +#define NO_EID +#define USE_WAITPID +#define STATFS4 +#define NO_FSYNC +#define USE_GETCWD +#define USE_SETSID +#define REPLACE_GETPASS +#define NO_GETRLIMIT +#endif /* CLIX */ + + + +#ifdef BSDI +#include +#include +#define SIGNAL_CAST (void (*)()) +#define USE_DIRECT +#endif + + +#ifdef NETBSD +#include +#include +/* you may not need this */ +#define NO_GETSPNAM +#define SIGNAL_CAST (void (*)()) +#define USE_DIRECT +#define REPLACE_INNETGR +#endif + + + +#ifdef FreeBSD +#include +#include +#include +#include +#define SIGNAL_CAST (void (*)()) +#define USE_DIRECT +#define REPLACE_INNETGR +#endif + + + +#ifdef AIX +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define SYSV +#define USE_WAITPID +#define SIGNAL_CAST (void (*)()) +#define DEFAULT_PRINTING PRINT_AIX +#endif + + +#ifdef HPUX +#include +#include +#include +#include +#include +#include +#include +#ifdef HPUX_10_TRUSTED +#include +#include +#define NEED_AUTH_PARAMETERS +#endif +#define SIGNAL_CAST (void (*)(__harg)) +#define SELECT_CAST (int *) +#define SYSV +#define USE_WAITPID +#define WAIT3_CAST2 (int *) +#define USE_GETCWD +#define USE_SETSID +#define USE_SETRES +#define DEFAULT_PRINTING PRINT_HPUX +#define SIGCLD_IGNORE +#endif + + +#ifdef SEQUENT +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define SIGNAL_CAST (void (*)(int)) +#define USE_WAITPID +#define USE_GETCWD +#define NO_EID +#define STATFS4 +#define USE_DIRECT +#endif + +#ifdef NEXT2 +#include +#include +#include +#include +#define bzero(b,len) memset(b,0,len) +#define mode_t int +#define NO_UTIMBUF +#include +#define NOSTRDUP +#define USE_DIRECT +#define USE_WAITPID +#endif + + +#ifdef NEXT3_0 +#include +#include +#include +#define bzero(b,len) memset(b,0,len) +#define NO_UTIMBUF +#include +#define NOSTRDUP +#define USE_DIRECT +#define mode_t int +#define GID_TYPE int +#define gid_t int +#define SIGNAL_CAST (void (*)(int)) +#define WAIT3_CAST1 (union wait *) +#define HAVE_GMTOFF +#endif + + + +#ifdef APOLLO +#include +#include +#include +#define NO_UTIMBUF +#define USE_DIRECT +#define USE_GETCWD +#define SIGNAL_CAST (void (*)()) +#define HAVE_FCNTL_LOCK 0 +#define HAVE_GETTIMEOFDAY +#define STATFS4 +#endif + + + +#ifdef SCO +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef EVEREST +#include +#endif +#ifdef NETGROUP +#include +#endif +#ifdef SecureWare +#include +#include +#include +#define crypt bigcrypt +#endif +#ifndef EVEREST + #define ftruncate(f,l) syscall(0x0a28,f,l) +#endif +#define SIGNAL_CAST (void (*)(int)) +#define USE_WAITPID +#define USE_GETCWD +#define USE_SETSID +#ifdef SCO3_2_2 +#define NO_EID +#else +#ifndef EVEREST +#define USE_IFREQ +#endif +#endif +#define STATFS4 +#define NO_FSYNC +#ifndef EVEREST +#define NO_INITGROUPS +#endif +#define HAVE_PATHCONF +#define NO_GETRLIMIT +#endif + + + +/* Definitions for RiscIX */ +#ifdef RiscIX +#define SIGNAL_CAST (void (*)(int)) +#include +#include +#include +#include +#include +#include +#define HAVE_GETTIMEOFDAY +#define NOSTRCASECMP +#define NOSTRDUP +#endif + + + +#ifdef ISC +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define FIONREAD FIORDCHK +#define SYSV +#define USE_WAITPID +#define SIGNAL_CAST (void (*)(int)) +#define USE_GETCWD +#define USE_SETSID +#define USE_IFREQ +#define NO_FTRUNCATE +#define STATFS4 +#define NO_FSYNC +#endif + + + +#ifdef AUX +#include +#include +#include +#include +#include +#include +#define SYSV +#define USE_WAITPID +#define SIGNAL_CAST (void (*)(int)) +char *strdup (char *); +#define USE_GETCWD +#endif + + +#ifdef M88K_R3 +#include +#include +#include +#include +#define STATFS4 +#define SYSV +#define USE_WAITPID +#define SIGNAL_CAST (void (*)(int)) +char *strdup (char *); +#define USE_GETCWD +#define NO_FSYNC +#define NO_EID +#endif + + +#ifdef DNIX +#include +#include +#include +#include +#include +#define NO_GET_BROADCAST +#define USE_WAITPID +#define USE_GETCWD +#define USE_SETSID +#define STATFS4 +#define NO_EID +#define PF_INET AF_INET +#define NO_STRERROR +#define ftruncate(f,l) chsize(f,l) +#endif /* DNIX */ + +#ifdef CONVEX +#define SIGNAL_CAST (void (*)(int)) +#include +#include +#include +#include +#include +#include +#define DONT_REINSTALL_SIG +#define USE_SIGBLOCK +#define USE_WAITPID +#define SIGNAL_CAST (_SigFunc_Ptr_t) +#define NO_GETSPNAM +#define HAVE_MEMMOVE +extern char *mktemp(char *); +extern int fsync(int); +extern int seteuid(uid_t); +extern int setgroups(int, int *); +extern int initgroups(char *, int); +extern int statfs(char *, struct statfs *); +extern int setegid(gid_t); +extern int getopt(int, char *const *, const char *); +extern int chroot(char *); +extern int gettimeofday(struct timeval *, struct timezone *); +extern int gethostname(char *, int); +extern char *crypt(char *, char *); +extern char *getpass(char *); +#endif + + +#ifdef CRAY +#define MAXPATHLEN 1024 +#include +#include +#include +#include +#define SIGNAL_CAST (void (*)(int)) +#define SIGCLD_IGNORE +#define HAVE_FCNTL_LOCK 1 +#define USE_SETSID +#define STATFS4 +#endif + + +#ifdef ALTOS +#include +#include +#include +#include +#include +#define const +#define uid_t int +#define gid_t int +#define mode_t int +#define ptrdiff_t int +#define HAVE_GETGRNAM 0 +#define NO_EID +#define NO_FSYNC +#define NO_FTRUNCATE +#define NO_GETRLIMIT +#define NO_INITGROUPS +#define NO_SELECT +#define NO_SETGROUPS +#define NO_STRERROR +#define NO_STRFTIME +#define NO_TM_NAME +#define NO_UTIMEH +#define NOSTRCASECMP +#define REPLACE_MKTIME +#define REPLACE_RENAME +#define REPLACE_STRSTR +#define STATFS4 +#define USE_GETCWD +#endif + +#ifdef QNX +#define STATFS4 +#include +#include +#include +#include +#define SIGNAL_CAST (void (*)()) +#define USE_WAITPID +#define NO_INITGROUPS +#define NO_SETGROUPS +#define HAVE_TIMEZONE +#define USE_GETCWD +#define USE_SETSID +#define HAVE_FCNTL_LOCK 1 +#define DEFAULT_PRINTING PRINT_QNX +#endif + + +#ifdef NEWS42 +#include +#include +#include +#include +typedef int mode_t; +#endif + +#ifdef OS2 +#include +#include +#include +#include +#define SIGNAL_CAST (void (*)()) +#define HAVE_FCNTL_LOCK 0 +#define USE_WAITPID +#define NO_GET_BROADCAST +#define NO_EID +#define NO_SETGROUPS +#define NO_INITGROUPS +#define NO_CRYPT +#define NO_STATFS +#define NO_CHROOT +#define NO_CHOWN +#define strcasecmp stricmp +#define strncasecmp strnicmp +#endif + + +#ifdef LYNX +#define SIGNAL_CAST (void (*)()) +#define WAIT3_CAST1 (union wait *) +#define STATFS4 +#include +#include +#include +#include +#include +#include +#define USE_GETCWD +#define USE_GETSID +#endif + + +/******************************************************************* +end of the platform specific sections +********************************************************************/ + +#ifdef SecureWare +#define NEED_AUTH_PARAMETERS +#endif + +#ifdef REPLACE_GETPASS +extern char *getsmbpass(char *); +#define getpass(s) getsmbpass(s) +#endif + +#ifdef REPLACE_INNETGR +#define innetgr(group,host,user,dom) InNetGr(group,host,user,dom) +#endif + +#ifndef FD_SETSIZE +#define FD_SETSIZE 255 +#endif + +#ifndef MAXINT +#define MAXINT ((((unsigned)1)<<(sizeof(int)*8-1))-1) +#endif + +#ifndef __STDC__ +#define const +#endif + +/* Now for some other grungy stuff */ +#ifdef NO_GETSPNAM +struct spwd { /* fake shadow password structure */ + char *sp_pwdp; +}; +#endif + +#ifndef HAVE_BZERO +#ifndef bzero +#define bzero(p,s) memset(p,0,s) +#endif +#endif + +#ifndef HAVE_MEMMOVE +#ifndef memmove +#define memmove(d,s,n) MemMove(d,s,n) +#endif +#endif + +#ifdef USE_DIRECT +#include +#endif + +/* some unixes have ENOTTY instead of TIOCNOTTY */ +#ifndef TIOCNOTTY +#ifdef ENOTTY +#define TIOCNOTTY ENOTTY +#endif +#endif + +#ifndef SIGHUP +#define SIGHUP 1 +#endif + +/* if undefined then use bsd or sysv printing */ +#ifndef DEFAULT_PRINTING +#ifdef SYSV +#define DEFAULT_PRINTING PRINT_SYSV +#else +#define DEFAULT_PRINTING PRINT_BSD +#endif +#endif + + +#ifdef AFS_AUTH +#include +#include +#endif + +#ifdef DFS_AUTH +#include +#include +#endif + +#ifdef NO_UTIMBUF +struct utimbuf { + time_t actime; + time_t modtime; +}; +#endif + +#ifdef NO_STRERROR +#ifndef strerror +extern char *sys_errlist[]; +#define strerror(i) sys_errlist[i] +#endif +#endif + +#ifndef perror +#define perror(m) printf("%s: %s\n",m,strerror(errno)) +#endif + +#ifndef MAXHOSTNAMELEN +#define MAXHOSTNAMELEN 255 +#endif + +#include "version.h" +#include "smb.h" +#include "byteorder.h" +#ifdef SMB_PASSWD +#include "smbpass.h" +#endif + +#include "kanji.h" +#include "charset.h" + +#ifndef S_IFREG +#define S_IFREG 0100000 +#endif + +#ifndef S_ISREG +#define S_ISREG(x) ((S_IFREG & x)!=0) +#endif + +#ifndef S_ISDIR +#define S_ISDIR(x) ((S_IFDIR & x)!=0) +#endif + +#ifdef UFC_CRYPT +#define crypt ufc_crypt +#endif + +#ifdef REPLACE_STRLEN +#define strlen(s) Strlen(s) +#endif + +#ifdef REPLACE_STRSTR +#define strstr(s,p) Strstr(s,p) +#endif + +#ifdef REPLACE_MKTIME +#define mktime(t) Mktime(t) +#endif + +#ifndef NGROUPS_MAX +#define NGROUPS_MAX 128 +#endif + +#ifndef EDQUOT +#define EDQUOT ENOSPC +#endif + +#ifndef HAVE_GETGRNAM +#define HAVE_GETGRNAM 1 +#endif + +#ifndef SOL_TCP +#define SOL_TCP 6 +#endif + +/* default to using ftruncate workaround as this is safer than assuming +it works and getting lots of bug reports */ +#ifndef FTRUNCATE_CAN_EXTEND +#define FTRUNCATE_CAN_EXTEND 0 +#endif + +/* maybe this unix doesn't separate RD and WR locks? */ +#ifndef F_RDLCK +#define F_RDLCK F_WRLCK +#endif + +#ifndef ENOTSOCK +#define ENOTSOCK EINVAL +#endif + +#ifndef SIGCLD +#define SIGCLD SIGCHLD +#endif + +#ifndef HAVE_FCNTL_LOCK +#define HAVE_FCNTL_LOCK 1 +#endif + +#ifndef WAIT3_CAST2 +#define WAIT3_CAST2 (struct rusage *) +#endif + +#ifndef WAIT3_CAST1 +#define WAIT3_CAST1 (int *) +#endif + +#ifndef QSORT_CAST +#define QSORT_CAST (int (*)()) +#endif + +/* this is a rough check to see if this machine has a lstat() call. + it is not guaranteed to work */ +#if !(defined(S_ISLNK) || defined(S_IFLNK)) +#define lstat stat +#endif + +/* Not all systems declare ERRNO in errno.h... and some systems #define it! */ +#ifndef errno +extern int errno; +#endif + + +#ifdef NO_EID +#define geteuid() getuid() +#define getegid() getgid() +#define seteuid(x) setuid(x) +#define setegid(x) setgid(x) +#endif + + +#if (HAVE_FCNTL_LOCK == 0) +/* since there is no locking available, system includes */ +/* for DomainOS 10.4 do not contain any of the following */ +/* #define's. So, to satisfy the compiler, add these */ +/* #define's, although they arn't really necessary. */ +#define F_GETLK 0 +#define F_SETLK 0 +#define F_WRLCK 0 +#define F_UNLCK 0 +#endif /* HAVE_FCNTL_LOCK == 0 */ + +#ifdef NOSTRCASECMP +#define strcasecmp(s1,s2) StrCaseCmp(s1,s2) +#define strncasecmp(s1,s2,n) StrnCaseCmp(s1,s2,n) +#endif + +#ifndef strcpy +#define strcpy(dest,src) StrCpy(dest,src) +#endif + + +/* possibly wrap the malloc calls */ +#if WRAP_MALLOC + +/* undo the old malloc def if necessary */ +#ifdef malloc +#define xx_old_malloc malloc +#undef malloc +#endif + +#define malloc(size) malloc_wrapped(size,__FILE__,__LINE__) + +/* undo the old realloc def if necessary */ +#ifdef realloc +#define xx_old_realloc realloc +#undef realloc +#endif + +#define realloc(ptr,size) realloc_wrapped(ptr,size,__FILE__,__LINE__) + +/* undo the old free def if necessary */ +#ifdef free +#define xx_old_free free +#undef free +#endif + +#define free(ptr) free_wrapped(ptr,__FILE__,__LINE__) + +/* and the malloc prototypes */ +void *malloc_wrapped(int,char *,int); +void *realloc_wrapped(void *,int,char *,int); +void free_wrapped(void *,char *,int); + +#endif + + +#if WRAP_MEMCPY +/* undo the old memcpy def if necessary */ +#ifdef memcpy +#define xx_old_memcpy memcpy +#undef memcpy +#endif + +#define memcpy(d,s,l) memcpy_wrapped(d,s,l,__FILE__,__LINE__) +void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line); +#endif + +#endif diff --git a/source3/include/kanji.h b/source3/include/kanji.h new file mode 100644 index 0000000000..4f18305c63 --- /dev/null +++ b/source3/include/kanji.h @@ -0,0 +1,130 @@ +/* + Unix SMB/Netbios implementation. + Version 1.9. + Kanji Extensions + Copyright (C) Andrew Tridgell 1992-1994 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + Adding for Japanese language by 1994.9.5 + and extend coding system to EUC/SJIS/JIS/HEX at 1994.10.11 + and add all jis codes sequence at 1995.8.16 + Notes: Hexadecimal code by +*/ +#ifndef _KANJI_H_ +#define _KANJI_H_ + +#ifdef KANJI + +/* FOR SHIFT JIS CODE */ +#define is_shift_jis(c) \ + ((0x81 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0x9f) \ + || (0xe0 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0xef)) +#define is_shift_jis2(c) \ + (0x40 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0xfc \ + && ((unsigned char) (c)) != 0x7f) +#define is_kana(c) ((0xa0 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0xdf)) + +#ifdef _KANJI_C_ +/* FOR EUC CODE */ +#define euc_kana (0x8e) +#define is_euc_kana(c) (((unsigned char) (c)) == euc_kana) +#define is_euc(c) (0xa0 < ((unsigned char) (c)) && ((unsigned char) (c)) < 0xff) + +/* FOR JIS CODE */ +/* default jis third shift code, use for output */ +#ifndef JIS_KSO +#define JIS_KSO 'B' +#endif +#ifndef JIS_KSI +#define JIS_KSI 'J' +#endif +/* in: \E$B or \E$@ */ +/* out: \E(J or \E(B or \E(H */ +#define jis_esc (0x1b) +#define jis_so (0x0e) +#define jis_so1 ('$') +#define jis_so2 ('B') +#define jis_si (0x0f) +#define jis_si1 ('(') +#define jis_si2 ('J') +#define is_esc(c) (((unsigned char) (c)) == jis_esc) +#define is_so1(c) (((unsigned char) (c)) == jis_so1) +#define is_so2(c) (((unsigned char) (c)) == jis_so2 || ((unsigned char) (c)) == '@') +#define is_si1(c) (((unsigned char) (c)) == jis_si1) +#define is_si2(c) (((unsigned char) (c)) == jis_si2 || ((unsigned char) (c)) == 'B' \ + || ((unsigned char) (c)) == 'H') +#define is_so(c) (((unsigned char) (c)) == jis_so) +#define is_si(c) (((unsigned char) (c)) == jis_si) +#define junet_kana1 ('(') +#define junet_kana2 ('I') +#define is_juk1(c) (((unsigned char) (c)) == junet_kana1) +#define is_juk2(c) (((unsigned char) (c)) == junet_kana2) + +#define _KJ_ROMAN (0) +#define _KJ_KANJI (1) +#define _KJ_KANA (2) + +/* FOR HEX */ +#define HEXTAG ':' +#define hex2bin(x) \ + ( ((int) '0' <= ((int) (x)) && ((int) (x)) <= (int)'9')? \ + (((int) (x))-(int)'0'): \ + ((int) 'a'<= ((int) (x)) && ((int) (x))<= (int) 'f')? \ + (((int) (x)) - (int)'a'+10): \ + (((int) (x)) - (int)'A'+10) ) +#define bin2hex(x) \ + ( (((int) (x)) >= 10)? (((int) (x))-10 + (int) 'a'): (((int) (x)) + (int) '0') ) + +#else /* not _KANJI_C_ */ + +extern char* (*_dos_to_unix) (const char *str, BOOL overwrite); +extern char* (*_unix_to_dos) (const char *str, BOOL overwrite); + +#define unix_to_dos (*_unix_to_dos) +#define dos_to_unix (*_dos_to_unix) + +extern char *sj_strtok (char *s1, const char *s2); +extern char *sj_strchr (const char *s, int c); +extern char *sj_strrchr (const char *s, int c); +extern char *sj_strstr (const char *s1, const char *s2); + +#define strchr sj_strchr +#define strrchr sj_strrchr +#define strstr sj_strstr +#define strtok sj_strtok + +#endif /* _KANJI_C_ */ + +#define UNKNOWN_CODE (-1) +#define SJIS_CODE (0) +#define EUC_CODE (1) +#define JIS7_CODE (2) +#define JIS8_CODE (3) +#define JUNET_CODE (4) +#define HEX_CODE (5) +#define CAP_CODE (6) +#define DOSV_CODE SJIS_CODE + +int interpret_coding_system (char *str, int def); + +#else + +#define unix_to_dos(x,y) (x) +#define dos_to_unix(x,y) (x) + +#endif /* not KANJI */ + +#endif /* _KANJI_H_ */ diff --git a/source3/include/local.h b/source3/include/local.h new file mode 100644 index 0000000000..2775453e15 --- /dev/null +++ b/source3/include/local.h @@ -0,0 +1,167 @@ +/* local definitions for file server */ +#ifndef _LOCAL_H +#define _LOCAL_H + +/* This defines the section name in the configuration file that will contain */ +/* global parameters - that is, parameters relating to the whole server, not */ +/* just services. This name is then reserved, and may not be used as a */ +/* a service name. It will default to "global" if not defined here. */ +#define GLOBAL_NAME "global" +#define GLOBAL_NAME2 "globals" + +/* This defines the section name in the configuration file that will + refer to the special "homes" service */ +#define HOMES_NAME "homes" + +/* This defines the section name in the configuration file that will + refer to the special "printers" service */ +#define PRINTERS_NAME "printers" + +/* This defines the name of the printcap file. It is MOST UNLIKELY that + this will change BUT! Specifying a file with the format of a printcap + file but containing only a subset of the printers actually in your real + printcap file is a quick-n-dirty way to allow dynamic access to a subset + of available printers. +*/ +#define PRINTCAP_NAME "/etc/printcap" + +/* set these to define the limits of the server. NOTE These are on a + per-client basis. Thus any one machine can't connect to more than + MAX_CONNECTIONS services, but any number of machines may connect at + one time. */ +#define MAX_CONNECTIONS 127 +#define MAX_OPEN_FILES 100 + +/* the max number of connections that the smbstatus program will show */ +#define MAXSTATUS 1000 + +/* max number of directories open at once */ +/* note that with the new directory code this no longer requires a + file handle per directory, but large numbers do use more memory */ +#define MAXDIR 64 + +#define WORDMAX 0xFFFF + + +/* separators for lists */ +#define LIST_SEP " \t,;:\n\r" + +#ifndef LOCKDIR +#define LOCKDIR "/tmp/samba" +#endif + +/* this is where browse lists are kept in the lock dir */ +#define SERVER_LIST "browse.dat" + +/* the print command on the server, %s is replaced with the filename */ +/* note that the -r removes the file after printing - you'll run out */ +/* of disk pretty quickly if you don't. This command is only used as */ +/* the default - it can be overridden in the configuration file. */ +#define PRINT_COMMAND "lpr -r %s" + +/* the lpq command on the server. the printername is passed as an argument */ +#ifndef LPQ_COMMAND +#define LPQ_COMMAND "lpq -P" +#endif + +/* shall guest entries in printer queues get changed to user entries, + so they can be deleted using the windows print manager? */ +#define LPQ_GUEST_TO_USER + +/* shall filenames with illegal chars in them get mangled in long + filename listings? */ +#define MANGLE_LONG_FILENAMES + +/* define this if you want to stop spoofing with .. and soft links + NOTE: This also slows down the server considerably */ +#define REDUCE_PATHS + +/* the size of the directory cache */ +#define DIRCACHESIZE 20 + +/* what type of filesystem do we want this to show up as in a NT file + manager window? */ +#define FSTYPE_STRING "Samba" + +/* we have two time standards - local and GMT. This will try to sort them out. + */ + +#define LOCAL_TO_GMT 1 +#define GMT_TO_LOCAL (-1) + +/* do you want smbd to send a 1 byte packet to nmbd to trigger it to start + when smbd starts? */ +#ifndef PRIME_NMBD +#define PRIME_NMBD 1 +#endif + +/* do you want session setups at user level security with a invalid + password to be rejected or allowed in as guest? WinNT rejects them + but it can be a pain as it means "net view" needs to use a password + + You have 3 choices: + + GUEST_SESSSETUP = 0 means session setups with an invalid password + are rejected. + + GUEST_SESSSETUP = 1 means session setups with an invalid password + are rejected, unless the username does not exist, in which case it + is treated as a guest login + + GUEST_SESSSETUP = 2 means session setups with an invalid password + are treated as a guest login + + Note that GUEST_SESSSETUP only has an effect in user or server + level security. + */ +#ifndef GUEST_SESSSETUP +#define GUEST_SESSSETUP 0 +#endif + +/* the default pager to use for the client "more" command. Users can + override this with the PAGER environment variable */ +#ifndef PAGER +#define PAGER "more" +#endif + +/* the size of the uid cache used to reduce valid user checks */ +#define UID_CACHE_SIZE 4 + +/* the following control timings of various actions. Don't change + them unless you know what you are doing. These are all in seconds */ +#define DEFAULT_SMBD_TIMEOUT (60*60*24*7) +#define SMBD_RELOAD_CHECK (10) +#define SHARE_MODES_CHECK (10) +#define SHARE_MODES_CLEAN (300) +#define IDLE_CLOSED_TIMEOUT (60) +#define DPTR_IDLE_TIMEOUT (120) +#define SMBD_SELECT_LOOP (10) +#define NMBD_SELECT_LOOP (10) +#define BROWSE_INTERVAL (60) +#define REGISTRATION_INTERVAL (10*60) +#define NMBD_INETD_TIMEOUT (120) +#define NMBD_MAX_TTL (24*60*60) +#define LPQ_LOCK_TIMEOUT (5) + +/* the following are in milliseconds */ +#define LOCK_RETRY_TIMEOUT (100) + +/* do you want to dump core (carefully!) when an internal error is + encountered? Samba will be careful to make the core file only + accessible to root */ +#define DUMP_CORE 1 + +/* what is the longest significant password available on your system? + Knowing this speeds up password searches a lot */ +#ifndef PASSWORD_LENGTH +#define PASSWORD_LENGTH 8 +#endif + +#define SMB_ALIGNMENT 1 + + +/* shall we support browse requests via a FIFO to nmbd? */ +#define ENABLE_FIFO 1 + + +#endif diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h new file mode 100644 index 0000000000..168dd4ba86 --- /dev/null +++ b/source3/include/nameserv.h @@ -0,0 +1,184 @@ +/* + Unix SMB/Netbios implementation. + Version 1.9. + NBT netbios header - version 2 + Copyright (C) Andrew Tridgell 1994-1995 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#define MAX_DGRAM_SIZE 576 +#define MIN_DGRAM_SIZE 12 + +#define NMB_PORT 137 +#define DGRAM_PORT 138 +#define SMB_PORT 139 + +enum name_source {LMHOSTS, REGISTER, SELF, DNS, DNSFAIL}; +enum node_type {B_NODE=0, P_NODE=1, M_NODE=2, NBDD_NODE=3}; +enum packet_type {NMB_PACKET, DGRAM_PACKET}; + +/* a netbios name structure */ +struct nmb_name { + char name[17]; + char scope[64]; + int name_type; +}; + +/* this is the structure used for the local netbios name list */ +struct name_record +{ + struct name_record *next; + struct name_record *prev; + struct nmb_name name; + time_t death_time; + struct in_addr ip; + BOOL unique; + enum name_source source; +}; + +/* this is used by the list of domains */ +struct domain_record +{ + struct domain_record *next; + struct domain_record *prev; + fstring name; + time_t lastannounce_time; + int announce_interval; + struct in_addr bcast_ip; +}; + +/* this is used to hold the list of servers in my domain */ +struct server_record +{ + struct server_record *next; + struct server_record *prev; + fstring name; + fstring comment; + uint32 servertype; + time_t death_time; +}; + +/* a resource record */ +struct res_rec { + struct nmb_name rr_name; + int rr_type; + int rr_class; + int ttl; + int rdlength; + char rdata[MAX_DGRAM_SIZE]; +}; + +/* define a nmb packet. */ +struct nmb_packet +{ + struct { + int name_trn_id; + int opcode; + BOOL response; + struct { + BOOL bcast; + BOOL recursion_available; + BOOL recursion_desired; + BOOL trunc; + BOOL authoritative; + } nm_flags; + int rcode; + int qdcount; + int ancount; + int nscount; + int arcount; + } header; + + struct { + struct nmb_name question_name; + int question_type; + int question_class; + } question; + + struct res_rec *answers; + struct res_rec *nsrecs; + struct res_rec *additional; +}; + + +/* a datagram - this normally contains SMB data in the data[] array */ +struct dgram_packet { + struct { + int msg_type; + struct { + enum node_type node_type; + BOOL first; + BOOL more; + } flags; + int dgm_id; + struct in_addr source_ip; + int source_port; + int dgm_length; + int packet_offset; + } header; + struct nmb_name source_name; + struct nmb_name dest_name; + int datasize; + char data[MAX_DGRAM_SIZE]; +}; + +/* define a structure used to queue packets. this will be a linked + list of nmb packets */ +struct packet_struct +{ + struct packet_struct *next; + struct packet_struct *prev; + struct in_addr ip; + int port; + int fd; + time_t timestamp; + enum packet_type packet_type; + union { + struct nmb_packet nmb; + struct dgram_packet dgram; + } packet; +}; + + +/* this defines a list of network interfaces */ +struct net_interface { + struct net_interface *next; + struct in_addr ip; + struct in_addr bcast; + struct in_addr netmask; +}; + + +/* prototypes */ +void free_nmb_packet(struct nmb_packet *nmb); +void free_packet(struct packet_struct *packet); +struct packet_struct *read_packet(int fd,enum packet_type packet_type); +BOOL send_packet(struct packet_struct *p); +struct packet_struct *receive_packet(int fd,enum packet_type type,int timeout); +void make_nmb_name(struct nmb_name *n,char *name,int type,char *this_scope); +BOOL name_query(int fd,char *name,int name_type, + BOOL bcast,BOOL recurse, + struct in_addr to_ip, struct in_addr *ip,void (*fn)()); +BOOL name_status(int fd,char *name,int name_type,BOOL recurse, + struct in_addr to_ip,char *master,char *rname, + void (*fn)()); +BOOL send_mailslot_reply(char *mailslot,int fd,char *buf,int len, + char *srcname,char *dstname, + int src_type,int dest_type, + struct in_addr dest_ip, + struct in_addr src_ip); +char *namestr(struct nmb_name *n); diff --git a/source3/include/smb.h b/source3/include/smb.h new file mode 100644 index 0000000000..b7faffa9e9 --- /dev/null +++ b/source3/include/smb.h @@ -0,0 +1,1006 @@ +/* + Unix SMB/Netbios implementation. + Version 1.9. + SMB parameters and setup + Copyright (C) Andrew Tridgell 1992-1995 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +#ifndef _SMB_H +#define _SMB_H + +#ifndef MAX_CONNECTIONS +#define MAX_CONNECTIONS 127 +#endif + +#ifndef MAX_OPEN_FILES +#define MAX_OPEN_FILES 50 +#endif + +#ifndef GUEST_ACCOUNT +#define GUEST_ACCOUNT "nobody" +#endif + +#define BUFFER_SIZE (0xFFFF) +#define SAFETY_MARGIN 1024 + +#ifndef EXTERN +# define EXTERN extern +#endif + +#define False (0) +#define True (1) +#define BOOLSTR(b) ((b) ? "Yes" : "No") +#define BITSETB(ptr,bit) ((((char *)ptr)[0] & (1<<(bit)))!=0) +#define BITSETW(ptr,bit) ((SVAL(ptr,0) & (1<<(bit)))!=0) +#define PTR_DIFF(p1,p2) ((ptrdiff_t)(((char *)(p1)) - (char *)(p2))) + +typedef int BOOL; + +/* + Samba needs type definitions for int16, int32, uint16 and uint32. + + Normally these are signed and unsigned 16 and 32 bit integers, but + they actually only need to be at least 16 and 32 bits + respectively. Thus if your word size is 8 bytes just defining them + as signed and unsigned int will work. +*/ + +/* afs/stds.h defines int16 and int32 */ +#ifndef AFS_AUTH +typedef short int16; +typedef int int32; +#endif + +#ifndef uint16 +typedef unsigned short uint16; +#endif + +#ifndef uint32 +typedef unsigned int uint32; +#endif + +#define SIZEOFWORD 2 + +#ifndef DEF_CREATE_MASK +#define DEF_CREATE_MASK (0755) +#endif + +#ifndef DEFAULT_PIPE_TIMEOUT +#define DEFAULT_PIPE_TIMEOUT 10000000 /* Ten seconds */ +#endif + +/* debugging code */ +#ifndef SYSLOG +#define DEBUG(level,body) ((DEBUGLEVEL>=(level))?(Debug1 body):0) +#else +EXTERN int syslog_level; + +#define DEBUG(level,body) ((DEBUGLEVEL>=(level))? \ + (syslog_level = (level), Debug1 body):0) +#endif + +#define DIR_STRUCT_SIZE 43 + +/* these define all the command types recognised by the server - there +are lots of gaps so probably there are some rare commands that are not +implemented */ + +#define pSETDIR '\377' + +/* these define the attribute byte as seen by DOS */ +#define aRONLY (1L<<0) +#define aHIDDEN (1L<<1) +#define aSYSTEM (1L<<2) +#define aVOLID (1L<<3) +#define aDIR (1L<<4) +#define aARCH (1L<<5) + +/* deny modes */ +#define DENY_DOS 0 +#define DENY_ALL 1 +#define DENY_WRITE 2 +#define DENY_READ 3 +#define DENY_NONE 4 +#define DENY_FCB 7 + +/* share types */ +#define STYPE_DISKTREE 0 /* Disk drive */ +#define STYPE_PRINTQ 1 /* Spooler queue */ +#define STYPE_DEVICE 2 /* Serial device */ +#define STYPE_IPC 3 /* Interprocess communication (IPC) */ + +/* SMB X/Open error codes for the ERRdos error class */ +#define ERRbadfunc 1 /* Invalid function (or system call) */ +#define ERRbadfile 2 /* File not found (pathname error) */ +#define ERRbadpath 3 /* Directory not found */ +#define ERRnofids 4 /* Too many open files */ +#define ERRnoaccess 5 /* Access denied */ +#define ERRbadfid 6 /* Invalid fid */ +#define ERRnomem 8 /* Out of memory */ +#define ERRbadmem 9 /* Invalid memory block address */ +#define ERRbadenv 10 /* Invalid environment */ +#define ERRbadaccess 12 /* Invalid open mode */ +#define ERRbaddata 13 /* Invalid data (only from ioctl call) */ +#define ERRres 14 /* reserved */ +#define ERRbaddrive 15 /* Invalid drive */ +#define ERRremcd 16 /* Attempt to delete current directory */ +#define ERRdiffdevice 17 /* rename/move across different filesystems */ +#define ERRnofiles 18 /* no more files found in file search */ +#define ERRbadshare 32 /* Share mode on file conflict with open mode */ +#define ERRlock 33 /* Lock request conflicts with existing lock */ +#define ERRfilexists 80 /* File in operation already exists */ +#define ERRbadpipe 230 /* Named pipe invalid */ +#define ERRpipebusy 231 /* All instances of pipe are busy */ +#define ERRpipeclosing 232 /* named pipe close in progress */ +#define ERRnotconnected 233 /* No process on other end of named pipe */ +#define ERRmoredata 234 /* More data to be returned */ +#define ERROR_EAS_DIDNT_FIT 275 /* Extended attributes didn't fit */ +#define ERROR_EAS_NOT_SUPPORTED 282 /* Extended attributes not suppored */ +#define ERRunknownlevel 124 +#define ERRunknownipc 2142 + + +/* here's a special one from observing NT */ +#define ERRnoipc 66 /* don't support ipc */ + +/* Error codes for the ERRSRV class */ + +#define ERRerror 1 /* Non specific error code */ +#define ERRbadpw 2 /* Bad password */ +#define ERRbadtype 3 /* reserved */ +#define ERRaccess 4 /* No permissions to do the requested operation */ +#define ERRinvnid 5 /* tid invalid */ +#define ERRinvnetname 6 /* Invalid servername */ +#define ERRinvdevice 7 /* Invalid device */ +#define ERRqfull 49 /* Print queue full */ +#define ERRqtoobig 50 /* Queued item too big */ +#define ERRinvpfid 52 /* Invalid print file in smb_fid */ +#define ERRsmbcmd 64 /* Unrecognised command */ +#define ERRsrverror 65 /* smb server internal error */ +#define ERRfilespecs 67 /* fid and pathname invalid combination */ +#define ERRbadlink 68 /* reserved */ +#define ERRbadpermits 69 /* Access specified for a file is not valid */ +#define ERRbadpid 70 /* reserved */ +#define ERRsetattrmode 71 /* attribute mode invalid */ +#define ERRpaused 81 /* Message server paused */ +#define ERRmsgoff 82 /* Not receiving messages */ +#define ERRnoroom 83 /* No room for message */ +#define ERRrmuns 87 /* too many remote usernames */ +#define ERRtimeout 88 /* operation timed out */ +#define ERRnoresource 89 /* No resources currently available for request. */ +#define ERRtoomanyuids 90 /* too many userids */ +#define ERRbaduid 91 /* bad userid */ +#define ERRuseMPX 250 /* temporarily unable to use raw mode, use MPX mode */ +#define ERRuseSTD 251 /* temporarily unable to use raw mode, use standard mode */ +#define ERRcontMPX 252 /* resume MPX mode */ +#define ERRbadPW /* reserved */ +#define ERRnosupport 0xFFFF +#define ERRunknownsmb 22 /* from NT 3.5 response */ + + +/* Error codes for the ERRHRD class */ + +#define ERRnowrite 19 /* read only media */ +#define ERRbadunit 20 /* Unknown device */ +#define ERRnotready 21 /* Drive not ready */ +#define ERRbadcmd 22 /* Unknown command */ +#define ERRdata 23 /* Data (CRC) error */ +#define ERRbadreq 24 /* Bad request structure length */ +#define ERRseek 25 +#define ERRbadmedia 26 +#define ERRbadsector 27 +#define ERRnopaper 28 +#define ERRwrite 29 /* write fault */ +#define ERRread 30 /* read fault */ +#define ERRgeneral 31 /* General hardware failure */ +#define ERRwrongdisk 34 +#define ERRFCBunavail 35 +#define ERRsharebufexc 36 /* share buffer exceeded */ +#define ERRdiskfull 39 + + +typedef char pstring[1024]; +typedef char fstring[128]; +typedef fstring string; + +typedef struct +{ + int size; + int mode; + int uid; + int gid; + /* these times are normally kept in GMT */ + time_t mtime; + time_t atime; + time_t ctime; + pstring name; +} file_info; + + +/* Structure used when SMBwritebmpx is active */ +typedef struct + { + int wr_total_written; /* So we know when to discard this */ + int32 wr_timeout; + int32 wr_errclass; + int32 wr_error; /* Cached errors */ + BOOL wr_mode; /* write through mode) */ + BOOL wr_discard; /* discard all further data */ + } write_bmpx_struct; + +typedef struct +{ + int cnum; + int fd; + int pos; + int size; + int mode; + char *mmap_ptr; + int mmap_size; + write_bmpx_struct *wbmpx_ptr; + time_t open_time; + BOOL open; + BOOL can_lock; + BOOL can_read; + BOOL can_write; + BOOL share_mode; + BOOL share_pending; + BOOL print_file; + BOOL modified; + char *name; +} files_struct; + + +struct uid_cache { + int entries; + int list[UID_CACHE_SIZE]; +}; + +typedef struct +{ + int service; + BOOL force_user; + int uid; /* uid of user who *opened* this connection */ + int gid; /* gid of user who *opened* this connection */ + struct uid_cache uid_cache; + void *dirptr; + BOOL open; + BOOL printer; + BOOL ipc; + BOOL read_only; + BOOL admin_user; + char *dirpath; + char *connectpath; + char *origpath; + char *user; /* name of user who *opened* this connection */ + /* following groups stuff added by ih */ + /* This groups info is valid for the user that *opened* the connection */ + int ngroups; + gid_t *groups; + int *igroups; /* an integer version - some OSes are broken :-( */ + time_t lastused; + BOOL used; + int num_files_open; +} connection_struct; + + +typedef struct +{ + int uid; /* uid of a validated user */ + int gid; /* gid of a validated user */ + fstring name; /* name of a validated user */ + BOOL guest; + /* following groups stuff added by ih */ + /* This groups info is needed for when we become_user() for this uid */ + int user_ngroups; + gid_t *user_groups; + int *user_igroups; /* an integer version - some OSes are broken :-( */ +} user_struct; + + +enum {LPQ_QUEUED,LPQ_PAUSED,LPQ_SPOOLING,LPQ_PRINTING}; + +typedef struct +{ + int job; + int size; + int status; + int priority; + time_t time; + char user[30]; + char file[100]; +} print_queue_struct; + +enum {LPSTAT_OK, LPSTAT_STOPPED, LPSTAT_ERROR}; + +typedef struct +{ + fstring message; + int status; +} print_status_struct; + + +/* this is used for smbstatus */ +struct connect_record +{ + int magic; + int pid; + int cnum; + int uid; + int gid; + char name[24]; + char addr[24]; + char machine[128]; + time_t start; +}; + + +#define LOCKING_VERSION 2 + +/* these are useful macros for checking validity of handles */ +#define VALID_FNUM(fnum) (((fnum) >= 0) && ((fnum) < MAX_OPEN_FILES)) +#define OPEN_FNUM(fnum) (VALID_FNUM(fnum) && Files[fnum].open) +#define VALID_CNUM(cnum) (((cnum) >= 0) && ((cnum) < MAX_CONNECTIONS)) +#define OPEN_CNUM(cnum) (VALID_CNUM(cnum) && Connections[cnum].open) +#define IS_IPC(cnum) (VALID_CNUM(cnum) && Connections[cnum].ipc) +#define FNUM_OK(fnum,c) (OPEN_FNUM(fnum) && (c)==Files[fnum].cnum) + +#define CHECK_FNUM(fnum,c) if (!FNUM_OK(fnum,c)) \ + return(ERROR(ERRDOS,ERRbadfid)) +#define CHECK_READ(fnum) if (!Files[fnum].can_read) \ + return(ERROR(ERRDOS,ERRbadaccess)) +#define CHECK_WRITE(fnum) if (!Files[fnum].can_write) \ + return(ERROR(ERRDOS,ERRbadaccess)) +#define CHECK_ERROR(fnum) if (HAS_CACHED_ERROR(fnum)) \ + return(CACHED_ERROR(fnum)) + +/* translates a connection number into a service number */ +#define SNUM(cnum) (Connections[cnum].service) + +/* access various service details */ +#define SERVICE(snum) (lp_servicename(snum)) +#define PRINTCAP (lp_printcapname()) +#define PRINTCOMMAND(snum) (lp_printcommand(snum)) +#define PRINTERNAME(snum) (lp_printername(snum)) +#define CAN_WRITE(cnum) (OPEN_CNUM(cnum) && !Connections[cnum].read_only) +#define VALID_SNUM(snum) (lp_snum_ok(snum)) +#define GUEST_OK(snum) (VALID_SNUM(snum) && lp_guest_ok(snum)) +#define GUEST_ONLY(snum) (VALID_SNUM(snum) && lp_guest_only(snum)) +#define CAN_SETDIR(snum) (!lp_no_set_dir(snum)) +#define CAN_PRINT(cnum) (OPEN_CNUM(cnum) && lp_print_ok(SNUM(cnum))) +#define POSTSCRIPT(cnum) (OPEN_CNUM(cnum) && lp_postscript(SNUM(cnum))) +#define MAP_HIDDEN(cnum) (OPEN_CNUM(cnum) && lp_map_hidden(SNUM(cnum))) +#define MAP_SYSTEM(cnum) (OPEN_CNUM(cnum) && lp_map_system(SNUM(cnum))) +#define MAP_ARCHIVE(cnum) (OPEN_CNUM(cnum) && lp_map_archive(SNUM(cnum))) +#define CREATE_MODE(cnum) (lp_create_mode(SNUM(cnum)) | 0700) +#ifdef SMB_PASSWD +#define SMBENCRYPT() (lp_encrypted_passwords()) +#else +#define SMBENCRYPT() (False) +#endif + +/* the basic packet size, assuming no words or bytes */ +#define smb_size 39 + +/* offsets into message for common items */ +#define smb_com 8 +#define smb_rcls 9 +#define smb_reh 10 +#define smb_err 11 +#define smb_flg 13 +#define smb_flg2 14 +#define smb_reb 13 +#define smb_tid 28 +#define smb_pid 30 +#define smb_uid 32 +#define smb_mid 34 +#define smb_wct 36 +#define smb_vwv 37 +#define smb_vwv0 37 +#define smb_vwv1 39 +#define smb_vwv2 41 +#define smb_vwv3 43 +#define smb_vwv4 45 +#define smb_vwv5 47 +#define smb_vwv6 49 +#define smb_vwv7 51 +#define smb_vwv8 53 +#define smb_vwv9 55 +#define smb_vwv10 57 +#define smb_vwv11 59 +#define smb_vwv12 61 +#define smb_vwv13 63 +#define smb_vwv14 65 +#define smb_vwv15 67 +#define smb_vwv16 69 +#define smb_vwv17 71 + + +/* the complete */ +#define SMBmkdir 0x00 /* create directory */ +#define SMBrmdir 0x01 /* delete directory */ +#define SMBopen 0x02 /* open file */ +#define SMBcreate 0x03 /* create file */ +#define SMBclose 0x04 /* close file */ +#define SMBflush 0x05 /* flush file */ +#define SMBunlink 0x06 /* delete file */ +#define SMBmv 0x07 /* rename file */ +#define SMBgetatr 0x08 /* get file attributes */ +#define SMBsetatr 0x09 /* set file attributes */ +#define SMBread 0x0A /* read from file */ +#define SMBwrite 0x0B /* write to file */ +#define SMBlock 0x0C /* lock byte range */ +#define SMBunlock 0x0D /* unlock byte range */ +#define SMBctemp 0x0E /* create temporary file */ +#define SMBmknew 0x0F /* make new file */ +#define SMBchkpth 0x10 /* check directory path */ +#define SMBexit 0x11 /* process exit */ +#define SMBlseek 0x12 /* seek */ +#define SMBtcon 0x70 /* tree connect */ +#define SMBtconX 0x75 /* tree connect and X*/ +#define SMBtdis 0x71 /* tree disconnect */ +#define SMBnegprot 0x72 /* negotiate protocol */ +#define SMBdskattr 0x80 /* get disk attributes */ +#define SMBsearch 0x81 /* search directory */ +#define SMBsplopen 0xC0 /* open print spool file */ +#define SMBsplwr 0xC1 /* write to print spool file */ +#define SMBsplclose 0xC2 /* close print spool file */ +#define SMBsplretq 0xC3 /* return print queue */ +#define SMBsends 0xD0 /* send single block message */ +#define SMBsendb 0xD1 /* send broadcast message */ +#define SMBfwdname 0xD2 /* forward user name */ +#define SMBcancelf 0xD3 /* cancel forward */ +#define SMBgetmac 0xD4 /* get machine name */ +#define SMBsendstrt 0xD5 /* send start of multi-block message */ +#define SMBsendend 0xD6 /* send end of multi-block message */ +#define SMBsendtxt 0xD7 /* send text of multi-block message */ + +/* Core+ protocol */ +#define SMBlockread 0x13 /* Lock a range and read */ +#define SMBwriteunlock 0x14 /* Unlock a range then write */ +#define SMBreadbraw 0x1a /* read a block of data with no smb header */ +#define SMBwritebraw 0x1d /* write a block of data with no smb header */ +#define SMBwritec 0x20 /* secondary write request */ +#define SMBwriteclose 0x2c /* write a file then close it */ + +/* dos extended protocol */ +#define SMBreadBraw 0x1A /* read block raw */ +#define SMBreadBmpx 0x1B /* read block multiplexed */ +#define SMBreadBs 0x1C /* read block (secondary response) */ +#define SMBwriteBraw 0x1D /* write block raw */ +#define SMBwriteBmpx 0x1E /* write block multiplexed */ +#define SMBwriteBs 0x1F /* write block (secondary request) */ +#define SMBwriteC 0x20 /* write complete response */ +#define SMBsetattrE 0x22 /* set file attributes expanded */ +#define SMBgetattrE 0x23 /* get file attributes expanded */ +#define SMBlockingX 0x24 /* lock/unlock byte ranges and X */ +#define SMBtrans 0x25 /* transaction - name, bytes in/out */ +#define SMBtranss 0x26 /* transaction (secondary request/response) */ +#define SMBioctl 0x27 /* IOCTL */ +#define SMBioctls 0x28 /* IOCTL (secondary request/response) */ +#define SMBcopy 0x29 /* copy */ +#define SMBmove 0x2A /* move */ +#define SMBecho 0x2B /* echo */ +#define SMBopenX 0x2D /* open and X */ +#define SMBreadX 0x2E /* read and X */ +#define SMBwriteX 0x2F /* write and X */ +#define SMBsesssetupX 0x73 /* Session Set Up & X (including User Logon) */ +#define SMBffirst 0x82 /* find first */ +#define SMBfunique 0x83 /* find unique */ +#define SMBfclose 0x84 /* find close */ +#define SMBinvalid 0xFE /* invalid command */ + +/* Extended 2.0 protocol */ +#define SMBtrans2 0x32 /* TRANS2 protocol set */ +#define SMBtranss2 0x33 /* TRANS2 protocol set, secondary command */ +#define SMBfindclose 0x34 /* Terminate a TRANSACT2_FINDFIRST */ +#define SMBfindnclose 0x35 /* Terminate a TRANSACT2_FINDNOTIFYFIRST */ +#define SMBulogoffX 0x74 /* user logoff */ + + +/* these are the TRANS2 sub commands */ +#define TRANSACT2_OPEN 0 +#define TRANSACT2_FINDFIRST 1 +#define TRANSACT2_FINDNEXT 2 +#define TRANSACT2_QFSINFO 3 +#define TRANSACT2_SETFSINFO 4 +#define TRANSACT2_QPATHINFO 5 +#define TRANSACT2_SETPATHINFO 6 +#define TRANSACT2_QFILEINFO 7 +#define TRANSACT2_SETFILEINFO 8 +#define TRANSACT2_FSCTL 9 +#define TRANSACT2_IOCTL 10 +#define TRANSACT2_FINDNOTIFYFIRST 11 +#define TRANSACT2_FINDNOTIFYNEXT 12 +#define TRANSACT2_MKDIR 13 + + +/* these are the trans2 sub fields for primary requests */ +#define smb_tpscnt smb_vwv0 +#define smb_tdscnt smb_vwv1 +#define smb_mprcnt smb_vwv2 +#define smb_mdrcnt smb_vwv3 +#define smb_msrcnt smb_vwv4 +#define smb_flags smb_vwv5 +#define smb_timeout smb_vwv6 +#define smb_pscnt smb_vwv9 +#define smb_psoff smb_vwv10 +#define smb_dscnt smb_vwv11 +#define smb_dsoff smb_vwv12 +#define smb_suwcnt smb_vwv13 +#define smb_setup smb_vwv14 +#define smb_setup0 smb_setup +#define smb_setup1 (smb_setup+2) +#define smb_setup2 (smb_setup+4) + +/* these are for the secondary requests */ +#define smb_spscnt smb_vwv2 +#define smb_spsoff smb_vwv3 +#define smb_spsdisp smb_vwv4 +#define smb_sdscnt smb_vwv5 +#define smb_sdsoff smb_vwv6 +#define smb_sdsdisp smb_vwv7 +#define smb_sfid smb_vwv8 + +/* and these for responses */ +#define smb_tprcnt smb_vwv0 +#define smb_tdrcnt smb_vwv1 +#define smb_prcnt smb_vwv3 +#define smb_proff smb_vwv4 +#define smb_prdisp smb_vwv5 +#define smb_drcnt smb_vwv6 +#define smb_droff smb_vwv7 +#define smb_drdisp smb_vwv8 + +/* where to find the base of the SMB packet proper */ +#define smb_base(buf) (((char *)(buf))+4) + + +#define SUCCESS 0 /* The request was successful. */ +#define ERRDOS 0x01 /* Error is from the core DOS operating system set. */ +#define ERRSRV 0x02 /* Error is generated by the server network file manager.*/ +#define ERRHRD 0x03 /* Error is an hardware error. */ +#define ERRCMD 0xFF /* Command was not in the "SMB" format. */ + +/* structure used to hold the incoming hosts info */ +struct from_host { + char *name; /* host name */ + char *addr; /* host address */ + struct sockaddr_in *sin; /* their side of the link */ +}; + +/* and a few prototypes */ +BOOL user_ok(char *user,int snum); +int sys_rename(char *from, char *to); +int sys_select(fd_set *fds,struct timeval *tval); +int sys_unlink(char *fname); +int sys_open(char *fname,int flags,int mode); +DIR *sys_opendir(char *dname); +int sys_stat(char *fname,struct stat *sbuf); +int sys_lstat(char *fname,struct stat *sbuf); +int sys_mkdir(char *dname,int mode); +int sys_rmdir(char *dname); +int sys_chdir(char *dname); +int sys_utime(char *fname,struct utimbuf *times); +int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); +void lpq_reset(int); +void status_printjob(int cnum,int snum,int jobid,int status); +void DirCacheAdd(char *path,char *name,char *dname,int snum); +char *DirCacheCheck(char *path,char *name,int snum); +void DirCacheFlush(int snum); +int interpret_character_set(char *str, int def); +char *dos2unix_format(char *, BOOL); +char *unix2dos_format(char *, BOOL); +BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); +void BlockSignals(BOOL block); +void msleep(int t); +int file_lock(char *name,int timeout); +void file_unlock(int fd); +int find_service(char *service); +int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew); +int smb_offset(char *p,char *buf); +void sync_file(int fnum); +int PutUniCode(char *dst,char *src); +void map_username(char *user); +void close_low_fds(void); +void clean_share_files(void); +int write_socket(int fd,char *buf,int len); +char *readdirname(void *p); +int dos_chmod(int cnum,char *fname,int mode,struct stat *st); +int smb_numwords(char *buf); +int get_share_mode(int cnum,struct stat *sbuf,int *pid); +void del_share_mode(int fnum); +BOOL set_share_mode(int fnum,int mode); +int DSTDiff(time_t t); +void TimeInit(void); +void put_long_date(char *p,time_t t); +time_t interpret_long_date(char *p); +void dptr_idlecnum(int cnum); +void dptr_closecnum(int cnum); +void init_dptrs(void); +void fault_setup(); +void set_socket_options(int fd, char *options); +void putip(void *dest,void *src); +void standard_sub_basic(char *s); +void *OpenDir(char *name); +void CloseDir(void *p); +char *ReadDirName(void *p); +BOOL SeekDir(void *p,int pos); +int TellDir(void *p); +int write_data(int fd,char *buffer,int N); +BOOL server_cryptkey(char *buf); +BOOL server_validate(char *buf); +BOOL become_service(int cnum,BOOL do_chdir); +BOOL snum_used(int snum); +BOOL reload_services(BOOL test); +void reopen_logs(void); +int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align); +int str_checksum(char *s); +time_t file_modtime(char *fname); +BOOL do_match(char *str, char *regexp, int case_sig); +BOOL is_a_socket(int fd); +void _smb_setlen(char *buf,int len); +void valid_initialise(void); +BOOL is_8_3(char *fname); +BOOL is_mangled(char *s); +void standard_sub(int cnum,char *s); +void del_printqueue(int cnum,int snum,int jobid); +BOOL strisnormal(char *s); +BOOL check_mangled_stack(char *s); +int sys_chown(char *fname,int uid,int gid); +int sys_chroot(char *dname); +BOOL next_token(char **ptr,char *buff,char *sep); +void invalidate_uid(int uid); +char *fgets_slash(char *s,int maxlen,FILE *f); +int read_udp_socket(int fd,char *buf,int len); +void exit_server(char *reason); +BOOL process_exists(int pid); +BOOL chgpasswd(char *name,char *oldpass,char *newpass); +void array_promote(char *array,int elsize,int element); +void string_replace(char *s,char oldc,char newc); +BOOL user_in_list(char *user,char *list); +BOOL string_sub(char *s,char *pattern,char *insert); +char *StrnCpy(char *dest,const char *src,int n); +char *validated_username(int vuid); +BOOL set_user_password(char *user,char *oldpass,char *newpass); +int smb_buf_ofs(char *buf); +char *skip_string(char *buf,int n); +BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset); +int read_file(int fnum,char *data,int pos,int mincnt,int maxcnt,int timeout,BOOL exact); +int write_file(int fnum,char *data,int n); +BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); +int seek_file(int fnum,int pos); +BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); +int get_printqueue(int snum,int cnum,print_queue_struct **queue,print_status_struct *status); +void parse_connect(char *buf,char *service,char *user,char *password,int *pwlen,char *dev); +int setup_groups(char *user,int uid, int gid, int *p_ngroups, + int **p_igroups, gid_t **p_groups); +int make_connection(char *service,char *user,char *password, int pwlen, char *dev,int vuid); +char *dptr_path(int key); +char *dptr_wcard(int key); +BOOL dptr_set_wcard(int key, char *wcard); +BOOL dptr_set_attr(int key, uint16 attr); +uint16 dptr_attr(int key); +void dptr_close(int key); +void dptr_closepath(char *path,int pid); +int dptr_create(int cnum,char *path, BOOL expect_close,int pid); +BOOL dptr_fill(char *buf,unsigned int key); +BOOL dptr_zero(char *buf); +void *dptr_fetch(char *buf,int *num); +void *dptr_fetch_lanman2(char *params,int dptr_num); +BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend); +void open_file(int fnum,int cnum,char *fname,int flags,int mode); +void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun,int mode,int *Access,int *action); +void close_file(int fnum); +int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize); +int reply_trans(char *inbuf,char *outbuf); +char *ufc_crypt(char *key,char *salt); +BOOL authorise_login(int snum,char *user,char *password, int pwlen, + BOOL *guest,BOOL *force,int vuid); +void add_session_user(char *user); +int valid_uid(int uid); +user_struct *get_valid_user_struct(int uid); +BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd, BOOL nt_password); +void register_uid(int uid,int gid,char *name,BOOL guest); +BOOL fromhost(int sock,struct from_host *f); +BOOL strhasupper(char *s); +BOOL strhaslower(char *s); +int disk_free(char *path,int *bsize,int *dfree,int *dsize); +char *uidtoname(int uid); +char *gidtoname(int gid); +int get_share_mode_byname(int cnum,char *fname,int *pid); +int get_share_mode_by_fnum(int cnum,int fnum,int *pid); +BOOL check_file_sharing(int cnum,char *fname); +char *StrCpy(char *dest,char *src); +int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line); +time_t make_unix_date2(void *date_ptr); +int cached_error_packet(char *inbuf,char *outbuf,int fnum,int line); +mode_t unix_mode(int cnum,int dosmode); +BOOL check_name(char *name,int cnum); +int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int line); +int find_free_file(void ); +BOOL unix_convert(char *name,int cnum); +void unix_convert_lanman2(char *s,char *home,BOOL case_is_sig); +void print_file(int fnum); +int read_smb_length(int fd,char *inbuf,int timeout); +int read_predict(int fd,int offset,char *buf,char **ptr,int num); +void invalidate_read_prediction(int fd); +void do_read_prediction(); +BOOL claim_connection(int cnum,char *name,int max_connections,BOOL Clear); +BOOL yield_connection(int cnum,char *name,int max_connections); +int count_chars(char *s,char c); +int smbrun(char *,char *); +BOOL name_map_mangle(char *OutName,BOOL need83,int snum); +struct hostent *Get_Hostbyname(char *name); +struct passwd *Get_Pwnam(char *user,BOOL allow_change); +void Abort(void); +void *Realloc(void *p,int size); +void smb_setlen(char *buf,int len); +int set_message(char *buf,int num_words,int num_bytes,BOOL zero); +BOOL check_access(int snum); +BOOL in_group(gid_t group, int current_gid, int ngroups, int *groups); +BOOL string_set(char **dest,char *src); +BOOL string_init(char **dest,char *src); +void string_free(char **s); +char *attrib_string(int mode); +void unix_format(char *fname); +BOOL directory_exist(char *dname,struct stat *st); +time_t make_unix_date3(void *date_ptr); +void put_dos_date3(char *buf,int offset,time_t unixdate); +void make_dir_struct(char *buf,char *mask,char *fname,unsigned int size,int mode,time_t date); +BOOL in_list(char *s,char *list,BOOL case_sensitive); +void strupper(char *s); +BOOL file_exist(char *fname,struct stat *sbuf); +int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt, long time_out, BOOL exact); +void close_sockets(void ); +BOOL send_smb(int fd,char *buffer); +BOOL send_keepalive(int client); +int read_data(int fd,char *buffer,int N); +int smb_len(char *buf); +BOOL receive_smb(int fd,char *buffer,int timeout); +void show_msg(char *buf); +BOOL big_endian(void ); +BOOL become_user(int cnum, int uid); +BOOL unbecome_user(void); +void become_daemon(void); +BOOL reduce_name(char *s,char *dir,BOOL widelinks); +void strlower(char *s); +void strnorm(char *s); +char *smb_buf(char *buf); +char *smb_trans2_param(char *buf); +char *smb_trans2_data(char *buf); +BOOL strequal(char *,char *); +BOOL strnequal(char *,char *,int n); +BOOL strcsequal(char *,char *); +BOOL mask_match( char *str, char *regexp, int case_sig, BOOL trans2); +int dos_mode(int ,char *,struct stat *); +char *timestring(); +BOOL ip_equal(struct in_addr ip1,struct in_addr ip2); +BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type); +char *get_home_dir(char *); +int set_filelen(int fd, long len); +void put_dos_date(char *buf,int offset,time_t unixdate); +void put_dos_date2(char *buf,int offset,time_t unixdate); +int lp_keepalive(void); +int name_len(char *s); +void dos_clean_name(char *s); +void unix_clean_name(char *s); +time_t make_unix_date(void *date_ptr); +BOOL lanman2_match( char *str, char *regexp, int case_sig, BOOL autoext); +BOOL trim_string(char *s,char *front,char *back); +int byte_checksum(char *buf,int len); +BOOL yesno(char *p); +uint32 file_size(char *file_name); +void dos_format(char *fname); +char *GetWd(char *s); +int name_mangle(char *in,char *out,char name_type); +int name_len(char *s); +void create_mangled_stack(int size); +int name_extract(char *buf,int ofs,char *name); +void get_broadcast(struct in_addr *if_ipaddr, struct in_addr *if_bcast, struct in_addr *if_nmask); +BOOL allow_access(char *deny_list,char *allow_list,struct from_host *client); +#ifdef __STDC__ +int Debug1(char *, ...); +#else +int Debug1(); +#endif +BOOL check_hosts_equiv(char *user); +int chain_reply(int type,char *inbuf,char *inbuf2,char *outbuf,char *outbuf2,int size,int bufsize); +void close_cnum(int cnum,int uid); +char *smb_errstr(char *inbuf); +void GetTimeOfDay(struct timeval *tval); +struct tm *LocalTime(time_t *t,int); +int TimeDiff(time_t t); +BOOL set_filetime(char *fname,time_t mtime); +char *dirname_dos(char *path,char *buf); +BOOL get_myname(char *myname,struct in_addr *ip); +void expand_mask(char *Mask, BOOL); +BOOL sane_unix_date(time_t unixdate); +time_t start_of_month(void); +char *smb_fn_name(int cnum); +void get_machine_info(void); +int open_socket_in(int type, int port, int dlevel); +int open_socket_out(int type,struct in_addr *addr, int port ); +struct in_addr *interpret_addr2(char *str); +BOOL zero_ip(struct in_addr ip); +int read_max_udp(int fd,char *buffer,int bufsize,int maxtime); +int interpret_protocol(char *str,int def); +int interpret_security(char *str,int def); +int ChDir(char *path); +int smb_buflen(char *buf); +unsigned long interpret_addr(char *str); +void mangle_name_83(char *s); +BOOL lp_casesignames(void); +void setup_logging(char *pname,BOOL interactive); +#ifdef DFS_AUTH +void dfs_unlogin(void); +extern int dcelogin_atmost_once; +#endif +#if AJT +void ajt_panic(void); +#endif +#ifdef NOSTRDUP +char *strdup(char *s); +#endif +#ifdef REPLACE_STRLEN +int Strlen(char *); +#endif +#ifdef REPLACE_STRSTR +char *Strstr(char *s, char *p); +#endif + +#ifndef MIN +#define MIN(a,b) ((a)<(b)?(a):(b)) +#endif +#ifndef MAX +#define MAX(a,b) ((a)>(b)?(a):(b)) +#endif + +#ifndef ABS +#define ABS(a) ((a)>0?(a):(-(a))) +#endif + +#ifndef SIGNAL_CAST +#define SIGNAL_CAST +#endif + +#ifndef SELECT_CAST +#define SELECT_CAST +#endif + + +/* Some POSIX definitions for those without */ + +#ifndef S_IFDIR +#define S_IFDIR 0x4000 +#endif +#ifndef S_ISDIR +#define S_ISDIR(mode) ((mode & 0xF000) == S_IFDIR) +#endif +#ifndef S_IRWXU +#define S_IRWXU 00700 /* read, write, execute: owner */ +#endif +#ifndef S_IRUSR +#define S_IRUSR 00400 /* read permission: owner */ +#endif +#ifndef S_IWUSR +#define S_IWUSR 00200 /* write permission: owner */ +#endif +#ifndef S_IXUSR +#define S_IXUSR 00100 /* execute permission: owner */ +#endif +#ifndef S_IRWXG +#define S_IRWXG 00070 /* read, write, execute: group */ +#endif +#ifndef S_IRGRP +#define S_IRGRP 00040 /* read permission: group */ +#endif +#ifndef S_IWGRP +#define S_IWGRP 00020 /* write permission: group */ +#endif +#ifndef S_IXGRP +#define S_IXGRP 00010 /* execute permission: group */ +#endif +#ifndef S_IRWXO +#define S_IRWXO 00007 /* read, write, execute: other */ +#endif +#ifndef S_IROTH +#define S_IROTH 00004 /* read permission: other */ +#endif +#ifndef S_IWOTH +#define S_IWOTH 00002 /* write permission: other */ +#endif +#ifndef S_IXOTH +#define S_IXOTH 00001 /* execute permission: other */ +#endif + + +/* these are used in NetServerEnum to choose what to receive */ +#define SV_TYPE_WORKSTATION 0x00000001 +#define SV_TYPE_SERVER 0x00000002 +#define SV_TYPE_SQLSERVER 0x00000004 +#define SV_TYPE_DOMAIN_CTRL 0x00000008 +#define SV_TYPE_DOMAIN_BAKCTRL 0x00000010 +#define SV_TYPE_TIME_SOURCE 0x00000020 +#define SV_TYPE_AFP 0x00000040 +#define SV_TYPE_NOVELL 0x00000080 +#define SV_TYPE_DOMAIN_MEMBER 0x00000100 +#define SV_TYPE_PRINTQ_SERVER 0x00000200 +#define SV_TYPE_DIALIN_SERVER 0x00000400 +#define SV_TYPE_SERVER_UNIX 0x00000800 +#define SV_TYPE_NT 0x00001000 +#define SV_TYPE_WFW 0x00002000 +#define SV_TYPE_SERVER_MFPN 0x00004000 +#define SV_TYPE_SERVER_NT 0x00008000 +#define SV_TYPE_POTENTIAL_BROWSER 0x00010000 +#define SV_TYPE_BACKUP_BROWSER 0x00020000 +#define SV_TYPE_MASTER_BROWSER 0x00040000 +#define SV_TYPE_DOMAIN_MASTER 0x00080000 +#define SV_TYPE_SERVER_OSF 0x00100000 +#define SV_TYPE_SERVER_VMS 0x00200000 +#define SV_TYPE_ALTERNATE_XPORT 0x20000000 +#define SV_TYPE_LOCAL_LIST_ONLY 0x40000000 +#define SV_TYPE_DOMAIN_ENUM 0x80000000 +#define SV_TYPE_ALL 0xFFFFFFFF + + + +/* protocol types. It assumes that higher protocols include lower protocols + as subsets */ +enum protocol_types {PROTOCOL_NONE,PROTOCOL_CORE,PROTOCOL_COREPLUS,PROTOCOL_LANMAN1,PROTOCOL_LANMAN2,PROTOCOL_NT1}; + +/* security levels */ +enum security_types {SEC_SHARE,SEC_USER,SEC_SERVER}; + +/* printing types */ +enum printing_types {PRINT_BSD,PRINT_SYSV,PRINT_AIX,PRINT_HPUX,PRINT_QNX}; + + +/* case handling */ +enum case_handling {CASE_LOWER,CASE_UPPER}; + + +/* Macros to get at offsets within smb_lkrng and smb_unlkrng + structures. We cannot define these as actual structures + due to possible differences in structure packing + on different machines/compilers. */ + +#define SMB_LPID_OFFSET(indx) (10 * (indx)) +#define SMB_LKOFF_OFFSET(indx) ( 2 + (10 * (indx))) +#define SMB_LKLEN_OFFSET(indx) ( 6 + (10 * (indx))) + +/* Macro to cache an error in a write_bmpx_struct */ +#define CACHE_ERROR(w,c,e) ((w)->wr_errclass = (c), (w)->wr_error = (e), \ + w->wr_discard = True, -1) +/* Macro to test if an error has been cached for this fnum */ +#define HAS_CACHED_ERROR(fnum) (Files[(fnum)].open && \ + Files[(fnum)].wbmpx_ptr && \ + Files[(fnum)].wbmpx_ptr->wr_discard) +/* Macro to turn the cached error into an error packet */ +#define CACHED_ERROR(fnum) cached_error_packet(inbuf,outbuf,fnum,__LINE__) + +/* these are the datagram types */ +#define DGRAM_DIRECT_UNIQUE 0x10 + +#define ERROR(class,x) error_packet(inbuf,outbuf,class,x,__LINE__) + +/* this is how errors are generated */ +#define UNIXERROR(defclass,deferror) unix_error_packet(inbuf,outbuf,defclass,deferror,__LINE__) + +#define ROUNDUP(x,g) (((x)+((g)-1))&~((g)-1)) + +#endif +/* _SMB_H */ diff --git a/source3/include/trans2.h b/source3/include/trans2.h new file mode 100644 index 0000000000..cc366ccaea --- /dev/null +++ b/source3/include/trans2.h @@ -0,0 +1,241 @@ +/* + Unix SMB/Netbios implementation. + Version 1.9. + SMB transaction2 handling + Copyright (C) Jeremy Allison 1994 + + Extensively modified by Andrew Tridgell, 1995 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _TRANS2_H_ +#define _TRANS2_H_ + +/* Define the structures needed for the trans2 calls. */ + +/******************************************************* + For DosFindFirst/DosFindNext - level 1 + +MAXFILENAMELEN = 255; +FDATE == uint16 +FTIME == uint16 +ULONG == uint32 +USHORT == uint16 + +typedef struct _FILEFINDBUF { +Byte offset Type name description +-------------+-------+-------------------+-------------- +0 FDATE fdateCreation; +2 FTIME ftimeCreation; +4 FDATE fdateLastAccess; +6 FTIME ftimeLastAccess; +8 FDATE fdateLastWrite; +10 FTIME ftimeLastWrite; +12 ULONG cbFile file length in bytes +16 ULONG cbFileAlloc size of file allocation unit +20 USHORT attrFile +22 UCHAR cchName length of name to follow (not including zero) +23 UCHAR achName[MAXFILENAMELEN]; Null terminated name +} FILEFINDBUF; +*********************************************************/ + +#define l1_fdateCreation 0 +#define l1_fdateLastAccess 4 +#define l1_fdateLastWrite 8 +#define l1_cbFile 12 +#define l1_cbFileAlloc 16 +#define l1_attrFile 20 +#define l1_cchName 22 +#define l1_achName 23 + +/********************************************************** +For DosFindFirst/DosFindNext - level 2 + +typedef struct _FILEFINDBUF2 { +Byte offset Type name description +-------------+-------+-------------------+-------------- +0 FDATE fdateCreation; +2 FTIME ftimeCreation; +4 FDATE fdateLastAccess; +6 FTIME ftimeLastAccess; +8 FDATE fdateLastWrite; +10 FTIME ftimeLastWrite; +12 ULONG cbFile file length in bytes +16 ULONG cbFileAlloc size of file allocation unit +20 USHORT attrFile +22 ULONG cbList Extended attribute list (always 0) +26 UCHAR cchName length of name to follow (not including zero) +27 UCHAR achName[MAXFILENAMELEN]; Null terminated name +} FILEFINDBUF2; +*************************************************************/ + +#define l2_fdateCreation 0 +#define l2_fdateLastAccess 4 +#define l2_fdateLastWrite 8 +#define l2_cbFile 12 +#define l2_cbFileAlloc 16 +#define l2_attrFile 20 +#define l2_cbList 22 +#define l2_cchName 26 +#define l2_achName 27 + + +/********************************************************** +For DosFindFirst/DosFindNext - level 260 + +typedef struct _FILEFINDBUF260 { +Byte offset Type name description +-------------+-------+-------------------+-------------- +0 ULONG NextEntryOffset; +4 ULONG FileIndex; +8 LARGE_INTEGER CreationTime; +16 LARGE_INTEGER LastAccessTime; +24 LARGE_INTEGER LastWriteTime; +32 LARGE_INTEGER ChangeTime; +40 LARGE_INTEGER EndOfFile; +48 LARGE_INTEGER AllocationSize; +56 ULONG FileAttributes; +60 ULONG FileNameLength; +64 ULONG EaSize; +68 CHAR ShortNameLength; +70 UNICODE ShortName[12]; +94 UNICODE FileName[]; +*************************************************************/ + +#define l260_achName 94 + + +/********************************************************** +For DosQueryPathInfo/DosQueryFileInfo/DosSetPathInfo/ +DosSetFileInfo - level 1 + +typedef struct _FILESTATUS { +Byte offset Type name description +-------------+-------+-------------------+-------------- +0 FDATE fdateCreation; +2 FTIME ftimeCreation; +4 FDATE fdateLastAccess; +6 FTIME ftimeLastAccess; +8 FDATE fdateLastWrite; +10 FTIME ftimeLastWrite; +12 ULONG cbFile file length in bytes +16 ULONG cbFileAlloc size of file allocation unit +20 USHORT attrFile +} FILESTATUS; +*************************************************************/ + +/* Use the l1_ defines from DosFindFirst */ + +/********************************************************** +For DosQueryPathInfo/DosQueryFileInfo/DosSetPathInfo/ +DosSetFileInfo - level 2 + +typedef struct _FILESTATUS2 { +Byte offset Type name description +-------------+-------+-------------------+-------------- +0 FDATE fdateCreation; +2 FTIME ftimeCreation; +4 FDATE fdateLastAccess; +6 FTIME ftimeLastAccess; +8 FDATE fdateLastWrite; +10 FTIME ftimeLastWrite; +12 ULONG cbFile file length in bytes +16 ULONG cbFileAlloc size of file allocation unit +20 USHORT attrFile +22 ULONG cbList Length of EA's (0) +} FILESTATUS2; +*************************************************************/ + +/* Use the l2_ #defines from DosFindFirst */ + +/********************************************************** +For DosQFSInfo/DosSetFSInfo - level 1 + +typedef struct _FSALLOCATE { +Byte offset Type name description +-------------+-------+-------------------+-------------- +0 ULONG idFileSystem id of file system +4 ULONG cSectorUnit number of sectors per allocation unit +8 ULONG cUnit number of allocation units +12 ULONG cUnitAvail Available allocation units +16 USHORT cbSector bytes per sector +} FSALLOCATE; +*************************************************************/ + +#define l1_idFileSystem 0 +#define l1_cSectorUnit 4 +#define l1_cUnit 8 +#define l1_cUnitAvail 12 +#define l1_cbSector 16 + +/********************************************************** +For DosQFSInfo/DosSetFSInfo - level 2 + +typedef struct _FSINFO { +Byte offset Type name description +-------------+-------+-------------------+-------------- +0 FDATE vol_fdateCreation +2 FTIME vol_ftimeCreation +4 UCHAR vol_cch length of volume name (excluding NULL) +5 UCHAR vol_szVolLabel[12] volume name +} FSINFO; +*************************************************************/ + +#define SMB_QUERY_FS_LABEL_INFO 0x101 +#define SMB_QUERY_FS_VOLUME_INFO 0x102 +#define SMB_QUERY_FS_SIZE_INFO 0x103 +#define SMB_QUERY_FS_DEVICE_INFO 0x104 +#define SMB_QUERY_FS_ATTRIBUTE_INFO 0x105 + + +#define l2_vol_fdateCreation 0 +#define l2_vol_cch 4 +#define l2_vol_szVolLabel 5 + + +#define SMB_QUERY_FILE_BASIC_INFO 0x101 +#define SMB_QUERY_FILE_STANDARD_INFO 0x102 +#define SMB_QUERY_FILE_EA_INFO 0x103 +#define SMB_QUERY_FILE_NAME_INFO 0x104 +#define SMB_QUERY_FILE_ALLOCATION_INFO 0x105 +#define SMB_QUERY_FILE_END_OF_FILEINFO 0x106 +#define SMB_QUERY_FILE_ALL_INFO 0x107 +#define SMB_QUERY_FILE_ALT_NAME_INFO 0x108 +#define SMB_QUERY_FILE_STREAM_INFO 0x109 + +#define SMB_FIND_FILE_DIRECTORY_INFO 0x101 +#define SMB_FIND_FILE_FULL_DIRECTORY_INFO 0x102 +#define SMB_FIND_FILE_NAMES_INFO 0x103 +#define SMB_FIND_FILE_BOTH_DIRECTORY_INFO 0x104 + +#define SMB_SET_FILE_BASIC_INFO 0x101 +#define SMB_SET_FILE_DISPOSITION_INFO 0x102 +#define SMB_SET_FILE_ALLOCATION_INFO 0x103 +#define SMB_SET_FILE_END_OF_FILE_INFO 0x104 + +#define DIRLEN_GUESS (45+MAX(l1_achName,l2_achName)) + +/* Function prototypes */ + + +int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize); + +int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize); + +#endif + + + diff --git a/source3/include/version.h b/source3/include/version.h new file mode 100644 index 0000000000..9ad8b7d44b --- /dev/null +++ b/source3/include/version.h @@ -0,0 +1 @@ +#define VERSION "1.9.16alpha1" diff --git a/source3/include/vt_mode.h b/source3/include/vt_mode.h new file mode 100644 index 0000000000..85b481122e --- /dev/null +++ b/source3/include/vt_mode.h @@ -0,0 +1,48 @@ +/* vt_mode.h */ +/* +support vtp-sessions + +written by Christian A. Lademann +*/ + +/* +02.05.95:cal:ported to samba-1.9.13 +*/ + +#ifndef __vt_mode_h__ +# define __vt_mode_h__ + +# define VT_CLOSED 0 +# define VT_OPEN 1 + +# define MS_NONE 0 +# define MS_PTY 1 +# define MS_STREAM 2 +# define MS_VTY 3 + +# define VT_MAXREAD 32 + + +# undef EXTERN + +# ifndef __vt_mode_c__ +# define EXTERN extern +# define DEFAULT(v) +# else +# define EXTERN +# define DEFAULT(v) =(v) +# endif + + EXTERN int VT_Status DEFAULT(VT_CLOSED), + VT_Fd DEFAULT(-1), + VT_ChildPID DEFAULT(-1); + + EXTERN BOOL VT_Mode DEFAULT(False), + VT_ChildDied DEFAULT(False); + + EXTERN char *VT_Line DEFAULT(NULL); + +# undef EXTERN + + +#endif /* __vt_mode_h__ */ -- cgit From 09960b3d1fb706c821a3bc19b867f6e4a82da81c Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sat, 4 May 1996 10:19:55 +0000 Subject: added issafe() define for "safe" characters (This used to be commit 1d7fc598cd56fe6c85b2a75ab7c3cead61fc23ad) --- source3/include/charset.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/charset.h b/source3/include/charset.h index 7091732223..14b6ec2020 100644 --- a/source3/include/charset.h +++ b/source3/include/charset.h @@ -57,5 +57,9 @@ extern void charset_initialise(void); #define islower(c) (((char)(c)) != toupper(c)) #define isdoschar(c) (dos_char_map[(char)(c)] != 0) #define isspace(c) ((c)==' ' || (c) == '\t') + +/* this is used to determine if a character is safe to use in + something that may be put on a command line */ +#define issafe(c) (isalnum(c) || strchr("-._",c)) #endif -- cgit From d5cd0b3ac0d6631b986cc99acbbd249479227fdd Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sat, 4 May 1996 10:23:27 +0000 Subject: upped version number (This used to be commit 3e2239aa59f1af438e812860bfdc0247f3ce1754) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 9ad8b7d44b..5dd6013151 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16alpha1" +#define VERSION "1.9.16p1" -- cgit From beee1b280f3a0f2884b78d9afa7ad1506e43e997 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sat, 4 May 1996 10:32:30 +0000 Subject: added sequent fixes (This used to be commit 21c7f21fd59b592023c16734731f61cff6f04aee) --- source3/include/includes.h | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index cc2bbbfad7..2408b3c194 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -481,7 +481,6 @@ char *mktemp(char *); /* No standard include */ #include #define SIGNAL_CAST (void (*)()) #define USE_DIRECT -#define REPLACE_INNETGR #endif @@ -548,6 +547,32 @@ char *mktemp(char *); /* No standard include */ #define USE_DIRECT #endif +#ifdef SEQUENT_PTX4 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define SYSV +#define USE_WAITPID +#define SIGNAL_CAST (void (*)(int)) +#define USE_STATVFS +#define USE_GETCWD +#ifndef seteuid +#define seteuid(uid) setreuid(-1,uid) +#endif +#ifndef setegid +#define setegid(gid) setregid(-1,gid) +#endif +#endif + + #ifdef NEXT2 #include #include @@ -734,7 +759,6 @@ char *strdup (char *); #endif /* DNIX */ #ifdef CONVEX -#define SIGNAL_CAST (void (*)(int)) #include #include #include -- cgit From f9014ae98d206f81b0e1ccbb016fa5bf7f896710 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 5 May 1996 03:04:51 +0000 Subject: change version number to 1.9.16p2 (This used to be commit 03f93941b39a7135a7801a9108fe4e4bd8c6991d) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 5dd6013151..dd02bf425e 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16p1" +#define VERSION "1.9.16p2" -- cgit From 11f7553c7495ecae3e918d8329107174c2ce0149 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 5 May 1996 11:25:07 +0000 Subject: turn on KEEP_PASSWORD_SERVER_OPEN by default (This used to be commit d2676cdd0b44fc4fc825118e510bac2c3f1e40d9) --- source3/include/local.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index 2775453e15..fba7955902 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -163,5 +163,8 @@ /* shall we support browse requests via a FIFO to nmbd? */ #define ENABLE_FIFO 1 +/* keep the password server open, this uses up a aocket, but is needed + by many apps */ +#define KEEP_PASSWORD_SERVER_OPEN 1 #endif -- cgit From 839ddb871c6c3c447c98d837ef9bed55694ed5cb Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 5 May 1996 11:35:35 +0000 Subject: fixed version number (again!) (This used to be commit 52b5148221e57c122f0c4ed3f0b49d6d9b7fd789) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index dd02bf425e..7a31d9d932 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16p2" +#define VERSION "1.9.16alpha2" -- cgit From fd2a6d67e25c25e8a96b3a9d764ef61328f0b10f Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 29 May 1996 07:55:29 +0000 Subject: preparing for release of 1.9.16alpha3 (This used to be commit 071c7690a259c76c7fd70608af22b81d0481d7de) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 7a31d9d932..5858fccf2f 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16alpha2" +#define VERSION "1.9.16alpha3" -- cgit From 58734631b4233ec08b7a262587e400792f31f185 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 31 May 1996 15:13:29 +0000 Subject: Lots of changes! - add faq info on NT printer handling - add "delete readonly" option to help rcs users - add stuff to man pages on new printer options - add "proxy name resolution" option - add "command string" -c option to smbclient (thanks Ken) - split time functions into time.c - rearrange the quotas stuff a bit and fix some bugs - complete rehash of the time handling code thanks to Paul Eggert - fix nmblookup output a bit - add plp print queue parsing from Bertrand Wallrich (This used to be commit 635b56f19c817527c52e9bbde31faa6a8a47777b) --- source3/include/includes.h | 23 ++--------------------- source3/include/local.h | 6 ------ source3/include/smb.h | 8 +++----- 3 files changed, 5 insertions(+), 32 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 2408b3c194..dc1fe57e71 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -198,27 +198,6 @@ #include #endif -/* this might be different on different systems */ -#ifdef QUOTAS -#ifdef LINUX -#ifdef __KERNEL__ -#undef __KERNEL__ -#include -#define __KERNEL__ -#else -#include -#endif -#include -#else -#include -#ifndef CRAY -#include -#else -#include -#endif -#endif -#endif - #ifdef SYSLOG #include #endif @@ -499,6 +478,8 @@ char *mktemp(char *); /* No standard include */ #define USE_WAITPID #define SIGNAL_CAST (void (*)()) #define DEFAULT_PRINTING PRINT_AIX +/* we undef this because sys/param.h is broken in aix. uggh. */ +#undef MAXHOSTNAMELEN #endif diff --git a/source3/include/local.h b/source3/include/local.h index fba7955902..9572243e73 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -83,12 +83,6 @@ manager window? */ #define FSTYPE_STRING "Samba" -/* we have two time standards - local and GMT. This will try to sort them out. - */ - -#define LOCAL_TO_GMT 1 -#define GMT_TO_LOCAL (-1) - /* do you want smbd to send a 1 byte packet to nmbd to trigger it to start when smbd starts? */ #ifndef PRIME_NMBD diff --git a/source3/include/smb.h b/source3/include/smb.h index b7faffa9e9..4d99529ef6 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -624,7 +624,6 @@ int smb_numwords(char *buf); int get_share_mode(int cnum,struct stat *sbuf,int *pid); void del_share_mode(int fnum); BOOL set_share_mode(int fnum,int mode); -int DSTDiff(time_t t); void TimeInit(void); void put_long_date(char *p,time_t t); time_t interpret_long_date(char *p); @@ -822,14 +821,12 @@ int chain_reply(int type,char *inbuf,char *inbuf2,char *outbuf,char *outbuf2,int void close_cnum(int cnum,int uid); char *smb_errstr(char *inbuf); void GetTimeOfDay(struct timeval *tval); -struct tm *LocalTime(time_t *t,int); +struct tm *LocalTime(time_t *t); int TimeDiff(time_t t); BOOL set_filetime(char *fname,time_t mtime); char *dirname_dos(char *path,char *buf); BOOL get_myname(char *myname,struct in_addr *ip); void expand_mask(char *Mask, BOOL); -BOOL sane_unix_date(time_t unixdate); -time_t start_of_month(void); char *smb_fn_name(int cnum); void get_machine_info(void); int open_socket_in(int type, int port, int dlevel); @@ -966,7 +963,8 @@ enum protocol_types {PROTOCOL_NONE,PROTOCOL_CORE,PROTOCOL_COREPLUS,PROTOCOL_LANM enum security_types {SEC_SHARE,SEC_USER,SEC_SERVER}; /* printing types */ -enum printing_types {PRINT_BSD,PRINT_SYSV,PRINT_AIX,PRINT_HPUX,PRINT_QNX}; +enum printing_types {PRINT_BSD,PRINT_SYSV,PRINT_AIX,PRINT_HPUX, + PRINT_QNX,PRINT_PLP}; /* case handling */ -- cgit From 0966bf7fb7702b78e80ad3656581eda2091c930f Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Fri, 31 May 1996 15:16:22 +0000 Subject: preparing for release of 1.9.16alpha4 (This used to be commit 8a0a06cba939e91e2379d0c5367b8817e7328077) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 5858fccf2f..e72c2b11fc 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16alpha3" +#define VERSION "1.9.16alpha4" -- cgit From 81e398963dbaed9c6661c336fe98329098576b94 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 1 Jun 1996 15:25:30 +0000 Subject: - moved the uid handling to uid.c - added setfsuid() support (for Linux) - started adding some of Lukes changes, just the loadparm and ipc ones so far (This used to be commit 72543810ce3eb5ea7b141f957edf38b4c46b1ea4) --- source3/include/includes.h | 1 + source3/include/smb.h | 2 ++ 2 files changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index dc1fe57e71..8b2821948c 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -223,6 +223,7 @@ Here come some platform specific sections #define USE_SETSID #define HAVE_BZERO #define HAVE_MEMMOVE +#define USE_SETFS #ifdef SHADOW_PWD #ifndef crypt #define crypt pw_encrypt diff --git a/source3/include/smb.h b/source3/include/smb.h index 4d99529ef6..3e38f4c37e 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -583,6 +583,8 @@ struct from_host { }; /* and a few prototypes */ +BOOL become_guest(void); +void init_uid(void); BOOL user_ok(char *user,int snum); int sys_rename(char *from, char *to); int sys_select(fd_set *fds,struct timeval *tval); -- cgit From a2c1623827406667a4f2f058c24f1d971f6627f8 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 4 Jun 1996 06:42:03 +0000 Subject: a huge pile of changes :-) The biggest thing is the integration of Lukes new nmbd. Its still largely untested, so we will really need some feedback I've also added auto prototype generation and cleaned up a lot of minor things as a result (This used to be commit 0d8dcfa13c527ec2c8aca39ba49c09e4e694b26c) --- source3/include/includes.h | 2 + source3/include/local.h | 2 +- source3/include/nameserv.h | 161 ++++++++++----- source3/include/proto.h | 506 +++++++++++++++++++++++++++++++++++++++++++++ source3/include/smb.h | 298 ++++---------------------- 5 files changed, 664 insertions(+), 305 deletions(-) create mode 100644 source3/include/proto.h (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 8b2821948c..ad65bcc607 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -983,6 +983,8 @@ extern char *sys_errlist[]; #include "version.h" #include "smb.h" +#include "nameserv.h" +#include "proto.h" #include "byteorder.h" #ifdef SMB_PASSWD #include "smbpass.h" diff --git a/source3/include/local.h b/source3/include/local.h index 9572243e73..2cfacd66b3 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -130,7 +130,7 @@ #define IDLE_CLOSED_TIMEOUT (60) #define DPTR_IDLE_TIMEOUT (120) #define SMBD_SELECT_LOOP (10) -#define NMBD_SELECT_LOOP (10) +#define NMBD_SELECT_LOOP (2) #define BROWSE_INTERVAL (60) #define REGISTRATION_INTERVAL (10*60) #define NMBD_INETD_TIMEOUT (120) diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 168dd4ba86..81079fabe0 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -20,16 +20,51 @@ */ -#define MAX_DGRAM_SIZE 576 +#define MAX_DGRAM_SIZE (80*18+64) #define MIN_DGRAM_SIZE 12 -#define NMB_PORT 137 -#define DGRAM_PORT 138 -#define SMB_PORT 139 - -enum name_source {LMHOSTS, REGISTER, SELF, DNS, DNSFAIL}; +#define NMB_QUERY 0x20 +#define NMB_STATUS 0x21 +#define NMB_REG 0x05 +#define NMB_REL 0x06 + +#define NB_GROUP 0x80 +#define NB_PERM 0x02 +#define NB_ACTIVE 0x04 +#define NB_CONFL 0x08 +#define NB_DEREG 0x10 +#define NB_BFLAG 0x00 +#define NB_PFLAG 0x20 +#define NB_MFLAG 0x40 +#define NB__FLAG 0x60 +#define NB_FLGMSK 0x60 + +#define NAME_PERMANENT(p) ((p) & NB_PERM) +#define NAME_ACTIVE(p) ((p) & NB_ACTIVE) +#define NAME_CONFLICT(p) ((p) & NB_CONFL) +#define NAME_DEREG(p) ((p) & NB_DEREG) +#define NAME_GROUP(p) ((p) & NB_GROUP) + +#define NAME_BFLAG(p) (((p) & NB_FLGMSK) == NB_BFLAG) +#define NAME_PFLAG(p) (((p) & NB_FLGMSK) == NB_PFLAG) +#define NAME_MFLAG(p) (((p) & NB_FLGMSK) == NB_MFLAG) +#define NAME__FLAG(p) (((p) & NB_FLGMSK) == NB__FLAG) + +enum name_source {STATUS_QUERY, LMHOSTS, REGISTER, SELF, DNS, DNSFAIL}; enum node_type {B_NODE=0, P_NODE=1, M_NODE=2, NBDD_NODE=3}; enum packet_type {NMB_PACKET, DGRAM_PACKET}; +enum cmd_type +{ + NAME_STATUS_MASTER_CHECK, + NAME_STATUS_CHECK, + MASTER_SERVER_CHECK, + SERVER_CHECK, + FIND_MASTER, + CHECK_MASTER, + NAME_REGISTER, + NAME_RELEASE, + NAME_CONFIRM_QUERY +}; /* a netbios name structure */ struct nmb_name { @@ -46,32 +81,73 @@ struct name_record struct nmb_name name; time_t death_time; struct in_addr ip; - BOOL unique; + int nb_flags; enum name_source source; }; -/* this is used by the list of domains */ -struct domain_record +/* browse and backup server cache for synchronising browse list */ +struct browse_cache_record { - struct domain_record *next; - struct domain_record *prev; - fstring name; - time_t lastannounce_time; - int announce_interval; - struct in_addr bcast_ip; + struct browse_cache_record *next; + struct browse_cache_record *prev; + + pstring name; + int type; + pstring group; + struct in_addr ip; + time_t sync_time; + BOOL synced; }; -/* this is used to hold the list of servers in my domain */ +/* this is used to hold the list of servers in my domain, and is */ +/* contained within lists of domains */ struct server_record { struct server_record *next; struct server_record *prev; - fstring name; - fstring comment; - uint32 servertype; + + struct server_info_struct serv; time_t death_time; }; +/* a workgroup structure. it contains a list of servers */ +struct work_record +{ + struct work_record *next; + struct work_record *prev; + + struct server_record *serverlist; + + /* work group info */ + fstring work_group; + int token; /* used when communicating with backup browsers */ + int ServerType; + + /* announce info */ + time_t lastannounce_time; + int announce_interval; + BOOL needannounce; + + /* election info */ + BOOL RunningElection; + BOOL needelection; + int ElectionCount; + uint32 ElectionCriterion; +}; + +/* a domain structure. it contains a list of workgroups */ +struct domain_record +{ + struct domain_record *next; + struct domain_record *prev; + + struct work_record *workgrouplist; + + struct in_addr bcast_ip; + struct in_addr mask_ip; + struct in_addr myip; +}; + /* a resource record */ struct res_rec { struct nmb_name rr_name; @@ -115,6 +191,25 @@ struct nmb_packet }; +/* initiated name queries recorded in this list to track any responses... */ +struct name_response_record +{ + struct name_response_record *next; + struct name_response_record *prev; + + uint16 response_id; + enum cmd_type cmd_type; + + int fd; + struct nmb_name name; + BOOL bcast; + BOOL recurse; + struct in_addr to_ip; + + time_t start_time; + int num_msgs; +}; + /* a datagram - this normally contains SMB data in the data[] array */ struct dgram_packet { struct { @@ -154,31 +249,3 @@ struct packet_struct }; -/* this defines a list of network interfaces */ -struct net_interface { - struct net_interface *next; - struct in_addr ip; - struct in_addr bcast; - struct in_addr netmask; -}; - - -/* prototypes */ -void free_nmb_packet(struct nmb_packet *nmb); -void free_packet(struct packet_struct *packet); -struct packet_struct *read_packet(int fd,enum packet_type packet_type); -BOOL send_packet(struct packet_struct *p); -struct packet_struct *receive_packet(int fd,enum packet_type type,int timeout); -void make_nmb_name(struct nmb_name *n,char *name,int type,char *this_scope); -BOOL name_query(int fd,char *name,int name_type, - BOOL bcast,BOOL recurse, - struct in_addr to_ip, struct in_addr *ip,void (*fn)()); -BOOL name_status(int fd,char *name,int name_type,BOOL recurse, - struct in_addr to_ip,char *master,char *rname, - void (*fn)()); -BOOL send_mailslot_reply(char *mailslot,int fd,char *buf,int len, - char *srcname,char *dstname, - int src_type,int dest_type, - struct in_addr dest_ip, - struct in_addr src_ip); -char *namestr(struct nmb_name *n); diff --git a/source3/include/proto.h b/source3/include/proto.h new file mode 100644 index 0000000000..face79d255 --- /dev/null +++ b/source3/include/proto.h @@ -0,0 +1,506 @@ +BOOL check_access(int snum); +BOOL allow_access(char *deny_list,char *allow_list,struct from_host *client); +BOOL fromhost(int sock,struct from_host *f); +char *unix2dos_format(char *str,BOOL overwrite); +char *dos2unix_format(char *str, BOOL overwrite); +int interpret_character_set(char *str, int def); +void charset_initialise(void); +void add_char_string(char *s); +BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence); +BOOL chgpasswd(char *name,char *oldpass,char *newpass); +BOOL chgpasswd(char *name,char *oldpass,char *newpass); +void setup_pkt(char *outbuf); +void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(),BOOL recurse_dir); +void cmd_help(void); +BOOL reopen_connection(char *inbuf,char *outbuf); +char *smb_errstr(char *inbuf); +void cli_setup_pkt(char *outbuf); +BOOL cli_receive_trans_response(char *inbuf,int trans,int *data_len, + int *param_len, char **data,char **param); +BOOL cli_send_session_request(char *inbuf, char *outbuf); +BOOL cli_send_login(char *inbuf, char *outbuf, BOOL start_session, BOOL use_setup); +void cli_send_logout(void); +BOOL cli_call_api(int prcnt,int drcnt,int mprcnt,int mdrcnt,int *rprcnt, + int *rdrcnt, char *param,char *data, char **rparam,char **rdata); +BOOL cli_send_trans_request(char *outbuf, int trans, char *name, int fid, int flags, + char *data,char *param,uint16 *setup, int ldata,int lparam, + int lsetup,int mdata,int mparam,int msetup); +BOOL cli_open_sockets(int port); +BOOL cli_reopen_connection(char *inbuf,char *outbuf); +char *smb_errstr(char *inbuf); +int strslashcmp(const char *s1, const char *s2); +void cmd_block(void); +void cmd_tarmode(void); +void cmd_setmode(void); +void cmd_tar(char *inbuf, char *outbuf); +int process_tar(char *inbuf, char *outbuf); +int clipfind(char **aret, int ret, char *tok); +int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind); +void init_dptrs(void); +char *dptr_path(int key); +char *dptr_wcard(int key); +BOOL dptr_set_wcard(int key, char *wcard); +BOOL dptr_set_attr(int key, uint16 attr); +uint16 dptr_attr(int key); +void dptr_close(int key); +void dptr_closecnum(int cnum); +void dptr_idlecnum(int cnum); +void dptr_closepath(char *path,int pid); +int dptr_create(int cnum,char *path, BOOL expect_close,int pid); +BOOL dptr_fill(char *buf1,unsigned int key); +BOOL dptr_zero(char *buf); +void *dptr_fetch(char *buf,int *num); +void *dptr_fetch_lanman2(char *params,int dptr_num); +BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend); +void *OpenDir(char *name); +void CloseDir(void *p); +char *ReadDirName(void *p); +BOOL SeekDir(void *p,int pos); +int TellDir(void *p); +void DirCacheAdd(char *path,char *name,char *dname,int snum); +char *DirCacheCheck(char *path,char *name,int snum); +void DirCacheFlush(int snum); +void fault_setup(void (*fn)()); +char *getsmbpass(char *prompt) ; +int reply_trans(char *inbuf,char *outbuf); +int interpret_coding_system(char *str, int def); +char *lp_string(char *s); +BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir); +int lp_add_service(char *pszService, int iDefaultService); +BOOL lp_add_printer(char *pszPrintername, int iDefaultService); +BOOL lp_file_list_changed(void); +BOOL lp_snum_ok(int iService); +BOOL lp_loaded(void); +void lp_killunused(BOOL (*snumused)(int )); +BOOL lp_load(char *pszFname,BOOL global_only); +int lp_numservices(void); +void lp_dump(void); +int lp_servicenumber(char *pszServiceName); +char *my_workgroup(void); +char *volume_label(int snum); +BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset); +BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); +BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); +int get_share_mode_by_fnum(int cnum,int fnum,int *pid); +int get_share_mode_byname(int cnum,char *fname,int *pid); +int get_share_mode(int cnum,struct stat *sbuf,int *pid); +void del_share_mode(int fnum); +BOOL set_share_mode(int fnum,int mode); +void clean_share_files(void); +int str_checksum(char *s); +BOOL is_8_3(char *fname); +void create_mangled_stack(int size); +BOOL check_mangled_stack(char *s); +BOOL is_mangled(char *s); +void mangle_name_83(char *s); +BOOL name_map_mangle(char *OutName,BOOL need83,int snum); +int reply_sends(char *inbuf,char *outbuf); +int reply_sendstrt(char *inbuf,char *outbuf); +int reply_sendtxt(char *inbuf,char *outbuf); +int reply_sendend(char *inbuf,char *outbuf); +void announce_request(struct work_record *work, struct in_addr ip); +void do_announce_request(char *info, char *to_name, int announce_type, int from, + int to, struct in_addr dest_ip); +void announce_backup(void); +void announce_host(void); +void announce_master(void); +struct work_record *remove_workgroup(struct domain_record *d, struct work_record *work); +void expire_browse_cache(time_t t); +struct work_record *find_workgroupstruct(struct domain_record *d, fstring name, BOOL add); +struct domain_record *find_domain(struct in_addr source_ip); +struct domain_record *add_domain_entry(struct in_addr source_ip, struct in_addr source_mask, + char *name, BOOL add); +struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, + time_t ttl, struct in_addr ip); +struct server_record *add_server_entry(struct domain_record *d, struct work_record *work, + char *name,int servertype, int ttl,char *comment, + BOOL replace); +void write_browse_list(void); +void expire_servers(time_t t); +void check_master_browser(void); +void browser_gone(char *work_name, struct in_addr ip); +void send_election(struct domain_record *d, char *group,uint32 criterion, + int timeup,char *name); +void become_nonmaster(struct domain_record *d, struct work_record *work); +void run_elections(void); +void process_election(struct packet_struct *p,char *buf); +BOOL check_elections(void); +BOOL name_status(int fd,char *name,int name_type,BOOL recurse, + struct in_addr to_ip,char *master,char *rname, + void (*fn)()); +BOOL name_query(int fd,char *name,int name_type, + BOOL bcast,BOOL recurse, + struct in_addr to_ip, struct in_addr *ip,void (*fn)()); +void expire_netbios_response_entries(time_t t); +void reply_netbios_packet(struct packet_struct *p1,int trn_id,int rcode,int opcode, + struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, + char *data,int len); +uint16 initiate_netbios_packet(int fd,int quest_type,char *name,int name_type, + int nb_flags,BOOL bcast,BOOL recurse,struct in_addr to_ip); +void send_name_reg(void); +void queue_netbios_pkt_wins(int fd,int quest_type,enum cmd_type cmd, + char *name,int name_type,int nb_flags, + BOOL bcast,BOOL recurse,struct in_addr to_ip); +void queue_netbios_packet(int fd,int quest_type,enum cmd_type cmd,char *name, + int name_type,int nb_flags,BOOL bcast,BOOL recurse, + struct in_addr to_ip); +struct name_response_record *find_name_query(uint16 id); +void queue_packet(struct packet_struct *packet); +void run_packet_queue(); +void listen_for_packets(BOOL run_election); +BOOL interpret_node_status(char *p, struct nmb_name *name,int t, + char *serv_name, struct in_addr ip); +BOOL send_mailslot_reply(char *mailslot,int fd,char *buf,int len,char *srcname, + char *dstname,int src_type,int dest_type, + struct in_addr dest_ip,struct in_addr src_ip); +void remove_name(struct name_record *n); +void dump_names(void); +void remove_netbios_name(char *name,int type, enum name_source source, + struct in_addr ip); +struct name_record *add_netbios_entry(char *name, int type, int nb_flags, int ttl, + enum name_source source, struct in_addr ip); +void remove_name_entry(char *name,int type); +void add_name_entry(char *name,int type,int nb_flags); +void add_my_names(void); +void expire_names(time_t t); +void response_name_release(struct packet_struct *p); +void reply_name_release(struct packet_struct *p); +void response_name_reg(struct packet_struct *p); +void reply_name_reg(struct packet_struct *p); +void reply_name_status(struct packet_struct *p); +struct name_record *search_for_name(struct nmb_name *question, + struct in_addr ip, int Time, int search); +void process_nmb(struct packet_struct *p); +void reset_server(char *name, int state, struct in_addr ip); +void tell_become_backup(void); +void do_browser_lists(void); +void sync_server(enum cmd_type cmd, char *serv_name, char *work_name, int name_type, + struct in_addr ip); +void update_from_reg(char *name, int type, struct in_addr ip); +void add_my_domains(void); +BOOL same_context(struct dgram_packet *dgram); +BOOL listening_name(struct work_record *work, struct nmb_name *n); +void process_logon_packet(struct packet_struct *p,char *buf,int len); +BOOL listening_type(struct packet_struct *p, int command); +void process_browse_packet(struct packet_struct *p,char *buf,int len); +void process_dgram(struct packet_struct *p); +BOOL reload_services(BOOL test); +void debug_nmb_packet(struct packet_struct *p); +char *namestr(struct nmb_name *n); +void free_nmb_packet(struct nmb_packet *nmb); +void free_packet(struct packet_struct *packet); +struct packet_struct *read_packet(int fd,enum packet_type packet_type); +void make_nmb_name(struct nmb_name *n,char *name,int type,char *this_scope); +BOOL send_packet(struct packet_struct *p); +struct packet_struct *receive_packet(int fd,enum packet_type type,int t); +int main(int argc,char *argv[]); +char *getsmbpass(char *pass); +void sync_browse_lists(struct work_record *work, char *name, int nm_type, + struct in_addr ip); +BOOL pm_process(char *pszFileName,BOOL (*sfunc)(char *),BOOL (*pfunc)(char *,char *)); +void generate_next_challenge(char *challenge); +BOOL set_challenge(char *challenge); +BOOL last_challenge(char *challenge); +int valid_uid(int uid); +user_struct *get_valid_user_struct(int uid); +void invalidate_uid(int uid); +char *validated_username(int vuid); +void register_uid(int uid,int gid, char *name,BOOL guest); +void add_session_user(char *user); +void dfs_unlogin(void); +BOOL password_check(char *password); +BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8); +BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd, BOOL is_nt_password); +BOOL user_ok(char *user,int snum); +BOOL authorise_login(int snum,char *user,char *password, int pwlen, + BOOL *guest,BOOL *force,int vuid); +BOOL check_hosts_equiv(char *user); +BOOL server_cryptkey(char *buf); +BOOL server_validate(char *buf); +BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); +void pcap_printer_fn(void (*fn)()); +void lpq_reset(int snum); +void print_file(int fnum); +int get_printqueue(int snum,int cnum,print_queue_struct **queue, + print_status_struct *status); +void del_printqueue(int cnum,int snum,int jobid); +void status_printjob(int cnum,int snum,int jobid,int status); +int reply_special(char *inbuf,char *outbuf); +int reply_tcon(char *inbuf,char *outbuf); +int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_unknown(char *inbuf,char *outbuf); +int reply_ioctl(char *inbuf,char *outbuf); +int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_chkpth(char *inbuf,char *outbuf); +int reply_getatr(char *inbuf,char *outbuf); +int reply_setatr(char *inbuf,char *outbuf); +int reply_dskattr(char *inbuf,char *outbuf); +int reply_search(char *inbuf,char *outbuf); +int reply_fclose(char *inbuf,char *outbuf); +int reply_open(char *inbuf,char *outbuf); +int reply_open_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_ulogoffX(char *inbuf,char *outbuf,int length,int bufsize); +int reply_mknew(char *inbuf,char *outbuf); +int reply_ctemp(char *inbuf,char *outbuf); +int reply_unlink(char *inbuf,char *outbuf); +int reply_readbraw(char *inbuf, char *outbuf); +int reply_lockread(char *inbuf,char *outbuf); +int reply_read(char *inbuf,char *outbuf); +int reply_read_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_writebraw(char *inbuf,char *outbuf); +int reply_writeunlock(char *inbuf,char *outbuf); +int reply_write(char *inbuf,char *outbuf,int dum1,int dum2); +int reply_write_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_lseek(char *inbuf,char *outbuf); +int reply_flush(char *inbuf,char *outbuf); +int reply_exit(char *inbuf,char *outbuf); +int reply_close(char *inbuf,char *outbuf); +int reply_writeclose(char *inbuf,char *outbuf); +int reply_lock(char *inbuf,char *outbuf); +int reply_unlock(char *inbuf,char *outbuf); +int reply_tdis(char *inbuf,char *outbuf); +int reply_echo(char *inbuf,char *outbuf); +int reply_printopen(char *inbuf,char *outbuf); +int reply_printclose(char *inbuf,char *outbuf); +int reply_printqueue(char *inbuf,char *outbuf); +int reply_printwrite(char *inbuf,char *outbuf); +int reply_mkdir(char *inbuf,char *outbuf); +int reply_rmdir(char *inbuf,char *outbuf); +int reply_mv(char *inbuf,char *outbuf); +int reply_copy(char *inbuf,char *outbuf); +int reply_setdir(char *inbuf,char *outbuf); +int reply_lockingX(char *inbuf,char *outbuf,int length,int bufsize); +int reply_readbmpx(char *inbuf,char *outbuf,int length,int bufsize); +int reply_writebmpx(char *inbuf,char *outbuf); +int reply_writebs(char *inbuf,char *outbuf); +int reply_setattrE(char *inbuf,char *outbuf); +int reply_getattrE(char *inbuf,char *outbuf); +mode_t unix_mode(int cnum,int dosmode); +int dos_mode(int cnum,char *path,struct stat *sbuf); +int dos_chmod(int cnum,char *fname,int dosmode,struct stat *st); +BOOL unix_convert(char *name,int cnum); +int disk_free(char *path,int *bsize,int *dfree,int *dsize); +int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); +BOOL check_name(char *name,int cnum); +void open_file(int fnum,int cnum,char *fname1,int flags,int mode); +void sync_file(int fnum); +void close_file(int fnum); +BOOL check_file_sharing(int cnum,char *fname); +void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun, + int mode,int *Access,int *action); +int seek_file(int fnum,int pos); +int read_file(int fnum,char *data,int pos,int mincnt,int maxcnt,int timeout,BOOL exact); +int write_file(int fnum,char *data,int n); +BOOL become_service(int cnum,BOOL do_chdir); +int find_service(char *service); +int cached_error_packet(char *inbuf,char *outbuf,int fnum,int line); +int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line); +int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int line); +BOOL snum_used(int snum); +BOOL reload_services(BOOL test); +int setup_groups(char *user, int uid, int gid, int *p_ngroups, + int **p_igroups, gid_t **p_groups); +int make_connection(char *service,char *user,char *password, int pwlen, char *dev,int vuid); +int find_free_file(void ); +int reply_corep(char *outbuf); +int reply_coreplus(char *outbuf); +int reply_lanman1(char *outbuf); +int reply_lanman2(char *outbuf); +int reply_nt1(char *outbuf); +void parse_connect(char *buf,char *service,char *user,char *password,int *pwlen,char *dev); +void close_cnum(int cnum, int uid); +BOOL yield_connection(int cnum,char *name,int max_connections); +BOOL claim_connection(int cnum,char *name,int max_connections,BOOL Clear); +void exit_server(char *reason); +void standard_sub(int cnum,char *s); +char *smb_fn_name(int type); +int chain_reply(int type,char *inbuf,char *inbuf2,char *outbuf,char *outbuf2,int size,int bufsize); +int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); +void str_to_key(uchar *str,uchar *key); +void D1(uchar *k, uchar *d, uchar *out); +void E1(uchar *k, uchar *d, uchar *out); +void E_P16(uchar *p14,uchar *p16); +void E_P24(uchar *p21, uchar *c8, uchar *p24); +void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); +void E_md4hash(uchar *passwd, uchar *p16); +void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); +void Ucrit_addUsername(pstring username); +unsigned int Ucrit_checkUsername(pstring username); +void Ucrit_addPid(int pid); +unsigned int Ucrit_checkPid(int pid); +int sys_select(fd_set *fds,struct timeval *tval); +int sys_select(fd_set *fds,struct timeval *tval); +int sys_unlink(char *fname); +int sys_open(char *fname,int flags,int mode); +DIR *sys_opendir(char *dname); +int sys_stat(char *fname,struct stat *sbuf); +int sys_lstat(char *fname,struct stat *sbuf); +int sys_mkdir(char *dname,int mode); +int sys_rmdir(char *dname); +int sys_chdir(char *dname); +int sys_utime(char *fname,struct utimbuf *times); +int sys_rename(char *from, char *to); +int sys_chown(char *fname,int uid,int gid); +int sys_chroot(char *dname); +int main(int argc, char *argv[]); +void GetTimeOfDay(struct timeval *tval); +void TimeInit(void); +int TimeDiff(time_t t); +struct tm *LocalTime(time_t *t); +time_t interpret_long_date(char *p); +void put_long_date(char *p,time_t t); +void put_dos_date(char *buf,int offset,time_t unixdate); +void put_dos_date2(char *buf,int offset,time_t unixdate); +void put_dos_date3(char *buf,int offset,time_t unixdate); +time_t make_unix_date(void *date_ptr); +time_t make_unix_date2(void *date_ptr); +time_t make_unix_date3(void *date_ptr); +BOOL set_filetime(char *fname,time_t mtime); +char *timestring(void ); +int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize); +int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize); +int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize); +int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize); +char *ufc_crypt(char *key,char *salt); +void init_uid(void); +BOOL become_guest(void); +BOOL become_user(int cnum, int uid); +BOOL unbecome_user(void ); +int smbrun(char *cmd,char *outfile); +char *get_home_dir(char *user); +void map_username(char *user); +struct passwd *Get_Pwnam(char *user,BOOL allow_change); +BOOL user_in_list(char *user,char *list); +void setup_logging(char *pname,BOOL interactive); +void reopen_logs(void); +BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); +int file_lock(char *name,int timeout); +void file_unlock(int fd); +BOOL is_a_socket(int fd); +BOOL next_token(char **ptr,char *buff,char *sep); +char **toktocliplist(int *ctok, char *sep); +void *MemMove(void *dest,void *src,int size); +void array_promote(char *array,int elsize,int element); +void set_socket_options(int fd, char *options); +void close_sockets(void ); +BOOL in_group(gid_t group, int current_gid, int ngroups, int *groups); +char *StrCpy(char *dest,char *src); +char *StrnCpy(char *dest,const char *src,int n); +void putip(void *dest,void *src); +int name_mangle(char *In,char *Out,char name_type); +BOOL file_exist(char *fname,struct stat *sbuf); +time_t file_modtime(char *fname); +BOOL directory_exist(char *dname,struct stat *st); +uint32 file_size(char *file_name); +char *attrib_string(int mode); +int StrCaseCmp(char *s, char *t); +int StrnCaseCmp(char *s, char *t, int n); +BOOL strequal(char *s1,char *s2); +BOOL strnequal(char *s1,char *s2,int n); +BOOL strcsequal(char *s1,char *s2); +void strlower(char *s); +void strupper(char *s); +void strnorm(char *s); +BOOL strisnormal(char *s); +void string_replace(char *s,char oldc,char newc); +void unix_format(char *fname); +void dos_format(char *fname); +void show_msg(char *buf); +int smb_len(char *buf); +void _smb_setlen(char *buf,int len); +void smb_setlen(char *buf,int len); +int set_message(char *buf,int num_words,int num_bytes,BOOL zero); +int smb_numwords(char *buf); +int smb_buflen(char *buf); +int smb_buf_ofs(char *buf); +char *smb_buf(char *buf); +int smb_offset(char *p,char *buf); +char *skip_string(char *buf,int n); +BOOL trim_string(char *s,char *front,char *back); +void dos_clean_name(char *s); +void unix_clean_name(char *s); +int ChDir(char *path); +char *GetWd(char *str); +BOOL reduce_name(char *s,char *dir,BOOL widelinks); +void expand_mask(char *Mask,BOOL doext); +BOOL strhasupper(char *s); +BOOL strhaslower(char *s); +int count_chars(char *s,char c); +void make_dir_struct(char *buf,char *mask,char *fname,unsigned int size,int mode,time_t date); +void close_low_fds(void); +int write_socket(int fd,char *buf,int len); +int read_udp_socket(int fd,char *buf,int len); +int set_blocking(int fd, BOOL set); +int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out,BOOL exact); +int read_max_udp(int fd,char *buffer,int bufsize,int maxtime); +int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew); +BOOL send_keepalive(int client); +int read_data(int fd,char *buffer,int N); +int write_data(int fd,char *buffer,int N); +int read_predict(int fd,int offset,char *buf,char **ptr,int num); +void do_read_prediction(); +void invalidate_read_prediction(int fd); +int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align); +int read_smb_length(int fd,char *inbuf,int timeout); +BOOL receive_smb(int fd,char *buffer,int timeout); +BOOL send_smb(int fd,char *buffer); +char *name_ptr(char *buf,int ofs); +int name_extract(char *buf,int ofs,char *name); +int name_len(char *s); +BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type); +void msleep(int t); +BOOL in_list(char *s,char *list,BOOL casesensitive); +BOOL string_init(char **dest,char *src); +void string_free(char **s); +BOOL string_set(char **dest,char *src); +BOOL string_sub(char *s,char *pattern,char *insert); +BOOL do_match(char *str, char *regexp, int case_sig); +BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2); +void become_daemon(void); +void get_broadcast(struct in_addr *if_ipaddr, + struct in_addr *if_bcast, + struct in_addr *if_nmask); +BOOL yesno(char *p); +char *fgets_slash(char *s2,int maxlen,FILE *f); +int set_filelen(int fd, long len); +int byte_checksum(char *buf,int len); +void setbuffer(FILE *f,char *buf,int bufsize); +char *dirname_dos(char *path,char *buf); +void *Realloc(void *p,int size); +void Abort(void ); +BOOL get_myname(char *myname,struct in_addr *ip); +BOOL ip_equal(struct in_addr ip1,struct in_addr ip2); +int open_socket_in(int type, int port, int dlevel); +int open_socket_out(int type, struct in_addr *addr, int port ); +int interpret_protocol(char *str,int def); +int interpret_security(char *str,int def); +unsigned long interpret_addr(char *str); +struct in_addr *interpret_addr2(char *str); +BOOL zero_ip(struct in_addr ip); +void standard_sub_basic(char *s); +BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask); +int PutUniCode(char *dst,char *src); +struct hostent *Get_Hostbyname(char *name); +BOOL process_exists(int pid); +char *uidtoname(int uid); +char *gidtoname(int gid); +void BlockSignals(BOOL block); +void ajt_panic(void); +char *readdirname(void *p); +void *malloc_wrapped(int size,char *file,int line); +void *realloc_wrapped(void *ptr,int size,char *file,int line); +void free_wrapped(void *ptr,char *file,int line); +char *Strstr(char *s, char *p); +time_t Mktime(struct tm *t); +int InNetGr(char *group,char *host,char *user,char *dom); +void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line); +int VT_Check(char *buffer); +int VT_Start_utmp(void); +int VT_Stop_utmp(void); +void VT_AtExit(void); +void VT_SigCLD(int sig); +void VT_SigEXIT(int sig); +int VT_Start(void); +int VT_Output(char *Buffer); +int VT_Input(char *Buffer,int Size); +void VT_Process(void); diff --git a/source3/include/smb.h b/source3/include/smb.h index 3e38f4c37e..0be860d6a3 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -40,6 +40,10 @@ # define EXTERN extern #endif +#define NMB_PORT 137 +#define DGRAM_PORT 138 +#define SMB_PORT 139 + #define False (0) #define True (1) #define BOOLSTR(b) ((b) ? "Yes" : "No") @@ -72,6 +76,19 @@ typedef unsigned short uint16; typedef unsigned int uint32; #endif +#ifndef uchar +#define uchar unsigned char +#endif +#ifndef int16 +#define int16 short +#endif +#ifndef uint16 +#define uint16 unsigned short +#endif +#ifndef uint32 +#define uint32 unsigned int +#endif + #define SIZEOFWORD 2 #ifndef DEF_CREATE_MASK @@ -216,6 +233,15 @@ typedef char pstring[1024]; typedef char fstring[128]; typedef fstring string; + +struct current_user { + int cnum, id; + int uid, gid; + int ngroups; + gid_t *groups; + int *igroups; +}; + typedef struct { int size; @@ -332,6 +358,16 @@ typedef struct int status; } print_status_struct; +/* used for server information: client, nameserv and ipc */ +struct server_info_struct +{ + fstring name; + uint32 type; + fstring comment; + fstring domain; /* used ONLY in ipc.c NOT namework.c */ + BOOL server_added; /* used ONLY in ipc.c NOT namework.c */ +}; + /* this is used for smbstatus */ struct connect_record @@ -582,281 +618,29 @@ struct from_host { struct sockaddr_in *sin; /* their side of the link */ }; -/* and a few prototypes */ -BOOL become_guest(void); -void init_uid(void); -BOOL user_ok(char *user,int snum); -int sys_rename(char *from, char *to); -int sys_select(fd_set *fds,struct timeval *tval); -int sys_unlink(char *fname); -int sys_open(char *fname,int flags,int mode); -DIR *sys_opendir(char *dname); -int sys_stat(char *fname,struct stat *sbuf); -int sys_lstat(char *fname,struct stat *sbuf); -int sys_mkdir(char *dname,int mode); -int sys_rmdir(char *dname); -int sys_chdir(char *dname); -int sys_utime(char *fname,struct utimbuf *times); -int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); -void lpq_reset(int); -void status_printjob(int cnum,int snum,int jobid,int status); -void DirCacheAdd(char *path,char *name,char *dname,int snum); -char *DirCacheCheck(char *path,char *name,int snum); -void DirCacheFlush(int snum); -int interpret_character_set(char *str, int def); -char *dos2unix_format(char *, BOOL); -char *unix2dos_format(char *, BOOL); -BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); -void BlockSignals(BOOL block); -void msleep(int t); -int file_lock(char *name,int timeout); -void file_unlock(int fd); -int find_service(char *service); -int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew); -int smb_offset(char *p,char *buf); -void sync_file(int fnum); -int PutUniCode(char *dst,char *src); -void map_username(char *user); -void close_low_fds(void); -void clean_share_files(void); -int write_socket(int fd,char *buf,int len); -char *readdirname(void *p); -int dos_chmod(int cnum,char *fname,int mode,struct stat *st); -int smb_numwords(char *buf); -int get_share_mode(int cnum,struct stat *sbuf,int *pid); -void del_share_mode(int fnum); -BOOL set_share_mode(int fnum,int mode); -void TimeInit(void); -void put_long_date(char *p,time_t t); -time_t interpret_long_date(char *p); -void dptr_idlecnum(int cnum); -void dptr_closecnum(int cnum); -void init_dptrs(void); -void fault_setup(); -void set_socket_options(int fd, char *options); -void putip(void *dest,void *src); -void standard_sub_basic(char *s); -void *OpenDir(char *name); -void CloseDir(void *p); -char *ReadDirName(void *p); -BOOL SeekDir(void *p,int pos); -int TellDir(void *p); -int write_data(int fd,char *buffer,int N); -BOOL server_cryptkey(char *buf); -BOOL server_validate(char *buf); -BOOL become_service(int cnum,BOOL do_chdir); -BOOL snum_used(int snum); -BOOL reload_services(BOOL test); -void reopen_logs(void); -int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align); -int str_checksum(char *s); -time_t file_modtime(char *fname); -BOOL do_match(char *str, char *regexp, int case_sig); -BOOL is_a_socket(int fd); -void _smb_setlen(char *buf,int len); -void valid_initialise(void); -BOOL is_8_3(char *fname); -BOOL is_mangled(char *s); -void standard_sub(int cnum,char *s); -void del_printqueue(int cnum,int snum,int jobid); -BOOL strisnormal(char *s); -BOOL check_mangled_stack(char *s); -int sys_chown(char *fname,int uid,int gid); -int sys_chroot(char *dname); -BOOL next_token(char **ptr,char *buff,char *sep); -void invalidate_uid(int uid); -char *fgets_slash(char *s,int maxlen,FILE *f); -int read_udp_socket(int fd,char *buf,int len); -void exit_server(char *reason); -BOOL process_exists(int pid); -BOOL chgpasswd(char *name,char *oldpass,char *newpass); -void array_promote(char *array,int elsize,int element); -void string_replace(char *s,char oldc,char newc); -BOOL user_in_list(char *user,char *list); -BOOL string_sub(char *s,char *pattern,char *insert); -char *StrnCpy(char *dest,const char *src,int n); -char *validated_username(int vuid); -BOOL set_user_password(char *user,char *oldpass,char *newpass); -int smb_buf_ofs(char *buf); -char *skip_string(char *buf,int n); -BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset); -int read_file(int fnum,char *data,int pos,int mincnt,int maxcnt,int timeout,BOOL exact); -int write_file(int fnum,char *data,int n); -BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); -int seek_file(int fnum,int pos); -BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); -int get_printqueue(int snum,int cnum,print_queue_struct **queue,print_status_struct *status); -void parse_connect(char *buf,char *service,char *user,char *password,int *pwlen,char *dev); -int setup_groups(char *user,int uid, int gid, int *p_ngroups, - int **p_igroups, gid_t **p_groups); -int make_connection(char *service,char *user,char *password, int pwlen, char *dev,int vuid); -char *dptr_path(int key); -char *dptr_wcard(int key); -BOOL dptr_set_wcard(int key, char *wcard); -BOOL dptr_set_attr(int key, uint16 attr); -uint16 dptr_attr(int key); -void dptr_close(int key); -void dptr_closepath(char *path,int pid); -int dptr_create(int cnum,char *path, BOOL expect_close,int pid); -BOOL dptr_fill(char *buf,unsigned int key); -BOOL dptr_zero(char *buf); -void *dptr_fetch(char *buf,int *num); -void *dptr_fetch_lanman2(char *params,int dptr_num); -BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend); -void open_file(int fnum,int cnum,char *fname,int flags,int mode); -void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun,int mode,int *Access,int *action); -void close_file(int fnum); -int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize); -int reply_trans(char *inbuf,char *outbuf); -char *ufc_crypt(char *key,char *salt); -BOOL authorise_login(int snum,char *user,char *password, int pwlen, - BOOL *guest,BOOL *force,int vuid); -void add_session_user(char *user); -int valid_uid(int uid); -user_struct *get_valid_user_struct(int uid); -BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd, BOOL nt_password); -void register_uid(int uid,int gid,char *name,BOOL guest); -BOOL fromhost(int sock,struct from_host *f); -BOOL strhasupper(char *s); -BOOL strhaslower(char *s); -int disk_free(char *path,int *bsize,int *dfree,int *dsize); -char *uidtoname(int uid); -char *gidtoname(int gid); -int get_share_mode_byname(int cnum,char *fname,int *pid); -int get_share_mode_by_fnum(int cnum,int fnum,int *pid); -BOOL check_file_sharing(int cnum,char *fname); -char *StrCpy(char *dest,char *src); -int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line); -time_t make_unix_date2(void *date_ptr); -int cached_error_packet(char *inbuf,char *outbuf,int fnum,int line); -mode_t unix_mode(int cnum,int dosmode); -BOOL check_name(char *name,int cnum); -int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int line); -int find_free_file(void ); -BOOL unix_convert(char *name,int cnum); -void unix_convert_lanman2(char *s,char *home,BOOL case_is_sig); -void print_file(int fnum); -int read_smb_length(int fd,char *inbuf,int timeout); -int read_predict(int fd,int offset,char *buf,char **ptr,int num); -void invalidate_read_prediction(int fd); -void do_read_prediction(); -BOOL claim_connection(int cnum,char *name,int max_connections,BOOL Clear); -BOOL yield_connection(int cnum,char *name,int max_connections); -int count_chars(char *s,char c); -int smbrun(char *,char *); -BOOL name_map_mangle(char *OutName,BOOL need83,int snum); -struct hostent *Get_Hostbyname(char *name); -struct passwd *Get_Pwnam(char *user,BOOL allow_change); -void Abort(void); -void *Realloc(void *p,int size); -void smb_setlen(char *buf,int len); -int set_message(char *buf,int num_words,int num_bytes,BOOL zero); -BOOL check_access(int snum); -BOOL in_group(gid_t group, int current_gid, int ngroups, int *groups); -BOOL string_set(char **dest,char *src); -BOOL string_init(char **dest,char *src); -void string_free(char **s); -char *attrib_string(int mode); -void unix_format(char *fname); -BOOL directory_exist(char *dname,struct stat *st); -time_t make_unix_date3(void *date_ptr); -void put_dos_date3(char *buf,int offset,time_t unixdate); -void make_dir_struct(char *buf,char *mask,char *fname,unsigned int size,int mode,time_t date); -BOOL in_list(char *s,char *list,BOOL case_sensitive); -void strupper(char *s); -BOOL file_exist(char *fname,struct stat *sbuf); -int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt, long time_out, BOOL exact); -void close_sockets(void ); -BOOL send_smb(int fd,char *buffer); -BOOL send_keepalive(int client); -int read_data(int fd,char *buffer,int N); -int smb_len(char *buf); -BOOL receive_smb(int fd,char *buffer,int timeout); -void show_msg(char *buf); -BOOL big_endian(void ); -BOOL become_user(int cnum, int uid); -BOOL unbecome_user(void); -void become_daemon(void); -BOOL reduce_name(char *s,char *dir,BOOL widelinks); -void strlower(char *s); -void strnorm(char *s); -char *smb_buf(char *buf); -char *smb_trans2_param(char *buf); -char *smb_trans2_data(char *buf); -BOOL strequal(char *,char *); -BOOL strnequal(char *,char *,int n); -BOOL strcsequal(char *,char *); -BOOL mask_match( char *str, char *regexp, int case_sig, BOOL trans2); -int dos_mode(int ,char *,struct stat *); -char *timestring(); -BOOL ip_equal(struct in_addr ip1,struct in_addr ip2); -BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type); -char *get_home_dir(char *); -int set_filelen(int fd, long len); -void put_dos_date(char *buf,int offset,time_t unixdate); -void put_dos_date2(char *buf,int offset,time_t unixdate); -int lp_keepalive(void); -int name_len(char *s); -void dos_clean_name(char *s); -void unix_clean_name(char *s); -time_t make_unix_date(void *date_ptr); -BOOL lanman2_match( char *str, char *regexp, int case_sig, BOOL autoext); -BOOL trim_string(char *s,char *front,char *back); -int byte_checksum(char *buf,int len); -BOOL yesno(char *p); -uint32 file_size(char *file_name); -void dos_format(char *fname); -char *GetWd(char *s); -int name_mangle(char *in,char *out,char name_type); -int name_len(char *s); -void create_mangled_stack(int size); -int name_extract(char *buf,int ofs,char *name); -void get_broadcast(struct in_addr *if_ipaddr, struct in_addr *if_bcast, struct in_addr *if_nmask); -BOOL allow_access(char *deny_list,char *allow_list,struct from_host *client); #ifdef __STDC__ int Debug1(char *, ...); #else int Debug1(); #endif -BOOL check_hosts_equiv(char *user); -int chain_reply(int type,char *inbuf,char *inbuf2,char *outbuf,char *outbuf2,int size,int bufsize); -void close_cnum(int cnum,int uid); -char *smb_errstr(char *inbuf); -void GetTimeOfDay(struct timeval *tval); -struct tm *LocalTime(time_t *t); -int TimeDiff(time_t t); -BOOL set_filetime(char *fname,time_t mtime); -char *dirname_dos(char *path,char *buf); -BOOL get_myname(char *myname,struct in_addr *ip); -void expand_mask(char *Mask, BOOL); -char *smb_fn_name(int cnum); -void get_machine_info(void); -int open_socket_in(int type, int port, int dlevel); -int open_socket_out(int type,struct in_addr *addr, int port ); -struct in_addr *interpret_addr2(char *str); -BOOL zero_ip(struct in_addr ip); -int read_max_udp(int fd,char *buffer,int bufsize,int maxtime); -int interpret_protocol(char *str,int def); -int interpret_security(char *str,int def); -int ChDir(char *path); -int smb_buflen(char *buf); -unsigned long interpret_addr(char *str); -void mangle_name_83(char *s); -BOOL lp_casesignames(void); -void setup_logging(char *pname,BOOL interactive); + #ifdef DFS_AUTH void dfs_unlogin(void); extern int dcelogin_atmost_once; #endif + #if AJT void ajt_panic(void); #endif + #ifdef NOSTRDUP char *strdup(char *s); #endif + #ifdef REPLACE_STRLEN int Strlen(char *); #endif + #ifdef REPLACE_STRSTR char *Strstr(char *s, char *p); #endif -- cgit From a2641cfe00b7857056fd8fd1e020aae7ea817690 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 4 Jun 1996 15:14:47 +0000 Subject: Did more integration of Lukes code ready for the first release. I've now got WINS registration working, and refresh working. Its looking pretty good so far, but needs lots of testing. (This used to be commit 045014aa57721b9701ca379bcab055b908773184) --- source3/include/nameserv.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 81079fabe0..51f5ec8479 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -20,6 +20,10 @@ */ +/* NTAS uses 2, NT uses 1, WfWg uses 0 */ +#define MAINTAIN_LIST 2 +#define ELECTION_VERSION 2 + #define MAX_DGRAM_SIZE (80*18+64) #define MIN_DGRAM_SIZE 12 @@ -39,6 +43,8 @@ #define NB__FLAG 0x60 #define NB_FLGMSK 0x60 +#define REFRESH_TIME (15*60) + #define NAME_PERMANENT(p) ((p) & NB_PERM) #define NAME_ACTIVE(p) ((p) & NB_ACTIVE) #define NAME_CONFLICT(p) ((p) & NB_CONFL) -- cgit From 526cc39e432682afe57a1eb2607e1a3f261f4e8f Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 4 Jun 1996 15:20:14 +0000 Subject: preparing for release of 1.9.16alpha5 (This used to be commit f5c493192eb744c8cd015a828b5fba311bee0093) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index e72c2b11fc..807b727bed 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16alpha4" +#define VERSION "1.9.16alpha5" -- cgit From e38afbf38210b8cf30c5b13dc5ea96a6dda433f7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 5 Jun 1996 15:16:09 +0000 Subject: - changed some debug levels in clientutil.c - added dir_check_ftype() to clean up the file type checking a bit - added check for libc version >= 5 for setfsuid() for Linux - moved the AM_MASTER() and related macros to nameserv.h - added proper defines for the various netbios announce types - don't call the announce_backup() code, as I'm pretty sure its wrong it sent ANN_GetBackupListReq packets as broadcasts, they are supposed to be used only by clients to the master browser to find a list of available backup servers to remote a netserverenum to, I don't think nmbd should ever send one. - fixed a bug in the browse list writing - minor debug cleanups - put in the code to discard our own broadcasts (it won't work for multi-homed hosts though) - changed ELECTION_VERSION to 1 so we can be beaten by a NT 3.51 server by lowering the os level. - only do sync_browse_lists() if we are the master browser, otherwise we'll cause network overload - don't call tell_become_backup() as it appears to be badly broken, it should only be used when the machine being told has its MAINTAIN_LIST to to auto. Not calling it does no great harm anyway - fix a nasty bug where becomebackup was confused with reset browser! - make setbuffer() not get caught by the auto protototypes (This used to be commit cfbad9b08242962f41595273de08a7293fe432b1) --- source3/include/includes.h | 2 ++ source3/include/nameserv.h | 18 +++++++++++++++++- source3/include/proto.h | 22 ++++++++++++++-------- 3 files changed, 33 insertions(+), 9 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index ad65bcc607..5b29b27547 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -223,7 +223,9 @@ Here come some platform specific sections #define USE_SETSID #define HAVE_BZERO #define HAVE_MEMMOVE +#if _LINUX_C_LIB_VERSION_MAJOR >= 5 #define USE_SETFS +#endif #ifdef SHADOW_PWD #ifndef crypt #define crypt pw_encrypt diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 51f5ec8479..32ee625fa4 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -22,7 +22,7 @@ /* NTAS uses 2, NT uses 1, WfWg uses 0 */ #define MAINTAIN_LIST 2 -#define ELECTION_VERSION 2 +#define ELECTION_VERSION 1 #define MAX_DGRAM_SIZE (80*18+64) #define MIN_DGRAM_SIZE 12 @@ -255,3 +255,19 @@ struct packet_struct }; +#define AM_MASTER(work) (work->ServerType & SV_TYPE_MASTER_BROWSER) +#define AM_BACKUP(work) (work->ServerType & SV_TYPE_BACKUP_BROWSER) +#define AM_DOMCTL(work) (work->ServerType & SV_TYPE_DOMAIN_CTRL) + + +#define ANN_HostAnnouncement 1 +#define ANN_AnnouncementRequest 2 +#define ANN_Election 8 +#define ANN_GetBackupListReq 9 +#define ANN_GetBackupListResp 10 +#define ANN_BecomeBackup 11 +#define ANN_DomainAnnouncement 12 +#define ANN_MasterAnnouncement 13 +#define ANN_ResetBrowserState 14 +#define ANN_LocalMasterAnnouncement 15 + diff --git a/source3/include/proto.h b/source3/include/proto.h index face79d255..a3f522b274 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -51,6 +51,7 @@ BOOL dptr_fill(char *buf1,unsigned int key); BOOL dptr_zero(char *buf); void *dptr_fetch(char *buf,int *num); void *dptr_fetch_lanman2(char *params,int dptr_num); +BOOL dir_check_ftype(int cnum,int mode,struct stat *st,int dirtype); BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend); void *OpenDir(char *name); void CloseDir(void *p); @@ -99,21 +100,26 @@ int reply_sendstrt(char *inbuf,char *outbuf); int reply_sendtxt(char *inbuf,char *outbuf); int reply_sendend(char *inbuf,char *outbuf); void announce_request(struct work_record *work, struct in_addr ip); -void do_announce_request(char *info, char *to_name, int announce_type, int from, +void do_announce_request(char *info, char *to_name, int announce_type, + int from, int to, struct in_addr dest_ip); void announce_backup(void); void announce_host(void); void announce_master(void); -struct work_record *remove_workgroup(struct domain_record *d, struct work_record *work); +struct work_record *remove_workgroup(struct domain_record *d, + struct work_record *work); void expire_browse_cache(time_t t); struct work_record *find_workgroupstruct(struct domain_record *d, fstring name, BOOL add); struct domain_record *find_domain(struct in_addr source_ip); -struct domain_record *add_domain_entry(struct in_addr source_ip, struct in_addr source_mask, +struct domain_record *add_domain_entry(struct in_addr source_ip, + struct in_addr source_mask, char *name, BOOL add); struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, time_t ttl, struct in_addr ip); -struct server_record *add_server_entry(struct domain_record *d, struct work_record *work, - char *name,int servertype, int ttl,char *comment, +struct server_record *add_server_entry(struct domain_record *d, + struct work_record *work, + char *name,int servertype, + int ttl,char *comment, BOOL replace); void write_browse_list(void); void expire_servers(time_t t); @@ -137,7 +143,6 @@ void reply_netbios_packet(struct packet_struct *p1,int trn_id,int rcode,int opco char *data,int len); uint16 initiate_netbios_packet(int fd,int quest_type,char *name,int name_type, int nb_flags,BOOL bcast,BOOL recurse,struct in_addr to_ip); -void send_name_reg(void); void queue_netbios_pkt_wins(int fd,int quest_type,enum cmd_type cmd, char *name,int name_type,int nb_flags, BOOL bcast,BOOL recurse,struct in_addr to_ip); @@ -162,6 +167,7 @@ struct name_record *add_netbios_entry(char *name, int type, int nb_flags, int tt void remove_name_entry(char *name,int type); void add_name_entry(char *name,int type,int nb_flags); void add_my_names(void); +void refresh_my_names(time_t t); void expire_names(time_t t); void response_name_release(struct packet_struct *p); void reply_name_release(struct packet_struct *p); @@ -174,7 +180,8 @@ void process_nmb(struct packet_struct *p); void reset_server(char *name, int state, struct in_addr ip); void tell_become_backup(void); void do_browser_lists(void); -void sync_server(enum cmd_type cmd, char *serv_name, char *work_name, int name_type, +void sync_server(enum cmd_type cmd, char *serv_name, char *work_name, + int name_type, struct in_addr ip); void update_from_reg(char *name, int type, struct in_addr ip); void add_my_domains(void); @@ -464,7 +471,6 @@ BOOL yesno(char *p); char *fgets_slash(char *s2,int maxlen,FILE *f); int set_filelen(int fd, long len); int byte_checksum(char *buf,int len); -void setbuffer(FILE *f,char *buf,int bufsize); char *dirname_dos(char *path,char *buf); void *Realloc(void *p,int size); void Abort(void ); -- cgit From 4ccb55ff7df30f269e94d16cb03e2c7f67515293 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 5 Jun 1996 15:46:41 +0000 Subject: preparing for release of 1.9.16alpha6 (This used to be commit ee330d60458c8f056b32dc3aa54a54ce6643186b) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 807b727bed..5244a1d919 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16alpha5" +#define VERSION "1.9.16alpha6" -- cgit From 19d1b1eb5fdb3aa466e0195db38c046c44a0ce9a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 6 Jun 1996 00:29:22 +0000 Subject: fix a bug that meant alpha6 couldn't compile. (This used to be commit 07288091c322fdb9f63889e84cfc57fa6cb5f613) --- source3/include/proto.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index a3f522b274..8b39c4437b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -111,6 +111,7 @@ struct work_record *remove_workgroup(struct domain_record *d, void expire_browse_cache(time_t t); struct work_record *find_workgroupstruct(struct domain_record *d, fstring name, BOOL add); struct domain_record *find_domain(struct in_addr source_ip); +void dump_workgroups(void); struct domain_record *add_domain_entry(struct in_addr source_ip, struct in_addr source_mask, char *name, BOOL add); @@ -142,7 +143,8 @@ void reply_netbios_packet(struct packet_struct *p1,int trn_id,int rcode,int opco struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, char *data,int len); uint16 initiate_netbios_packet(int fd,int quest_type,char *name,int name_type, - int nb_flags,BOOL bcast,BOOL recurse,struct in_addr to_ip); + int nb_flags,BOOL bcast,BOOL recurse, + struct in_addr to_ip); void queue_netbios_pkt_wins(int fd,int quest_type,enum cmd_type cmd, char *name,int name_type,int nb_flags, BOOL bcast,BOOL recurse,struct in_addr to_ip); -- cgit From f6733fe3cf73945035fff9eea4a2d24ee1bd9751 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 6 Jun 1996 00:30:18 +0000 Subject: preparing for release of 1.9.16alpha7 (This used to be commit dfb7fa3ae405f4e23f3cc9e4bbe93029981c99dc) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 5244a1d919..1d0cfc2384 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16alpha6" +#define VERSION "1.9.16alpha7" -- cgit From b9ae225b28f4707609e6436dad4be7ebdd7e181f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 6 Jun 1996 11:43:09 +0000 Subject: - added interface.c and removed all the references to myip, bcast_ip and Netmask, instead replacing them with calls to routines in interface.c - got rid of old MAXINT define - added code to ensure we only return one entry for each name in the ipc enum routines - added new_only option to add_netbios_entry() to prevent overwriting of important names - minor time handling fixup (This used to be commit 7ed71b73ae745da099072eee36fc2700d1d91407) --- source3/include/includes.h | 4 ---- source3/include/proto.h | 20 ++++++++++++++------ 2 files changed, 14 insertions(+), 10 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 5b29b27547..549407bc9e 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -899,10 +899,6 @@ extern char *getsmbpass(char *); #define FD_SETSIZE 255 #endif -#ifndef MAXINT -#define MAXINT ((((unsigned)1)<<(sizeof(int)*8-1))-1) -#endif - #ifndef __STDC__ #define const #endif diff --git a/source3/include/proto.h b/source3/include/proto.h index 8b39c4437b..2c7cb8a126 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -63,6 +63,13 @@ char *DirCacheCheck(char *path,char *name,int snum); void DirCacheFlush(int snum); void fault_setup(void (*fn)()); char *getsmbpass(char *prompt) ; +void load_interfaces(void); +void iface_set_default(char *ip,char *bcast,char *nmask); +BOOL ismyip(struct in_addr ip); +BOOL ismybcast(struct in_addr bcast); +struct in_addr *iface_bcast(struct in_addr ip); +struct in_addr *iface_nmask(struct in_addr ip); +struct in_addr *iface_ip(struct in_addr ip); int reply_trans(char *inbuf,char *outbuf); int interpret_coding_system(char *str, int def); char *lp_string(char *s); @@ -109,7 +116,8 @@ void announce_master(void); struct work_record *remove_workgroup(struct domain_record *d, struct work_record *work); void expire_browse_cache(time_t t); -struct work_record *find_workgroupstruct(struct domain_record *d, fstring name, BOOL add); +struct work_record *find_workgroupstruct(struct domain_record *d, + fstring name, BOOL add); struct domain_record *find_domain(struct in_addr source_ip); void dump_workgroups(void); struct domain_record *add_domain_entry(struct in_addr source_ip, @@ -164,8 +172,11 @@ void remove_name(struct name_record *n); void dump_names(void); void remove_netbios_name(char *name,int type, enum name_source source, struct in_addr ip); -struct name_record *add_netbios_entry(char *name, int type, int nb_flags, int ttl, - enum name_source source, struct in_addr ip); +struct name_record *add_netbios_entry(char *name, int type, int nb_flags, + int ttl, + enum name_source source, + struct in_addr ip, + BOOL new_only); void remove_name_entry(char *name,int type); void add_name_entry(char *name,int type,int nb_flags); void add_my_names(void); @@ -466,9 +477,6 @@ BOOL string_sub(char *s,char *pattern,char *insert); BOOL do_match(char *str, char *regexp, int case_sig); BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2); void become_daemon(void); -void get_broadcast(struct in_addr *if_ipaddr, - struct in_addr *if_bcast, - struct in_addr *if_nmask); BOOL yesno(char *p); char *fgets_slash(char *s2,int maxlen,FILE *f); int set_filelen(int fd, long len); -- cgit From bb0a9664f56c168e11e6b127909f558e3b4f313d Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 6 Jun 1996 11:58:12 +0000 Subject: preparing for release of 1.9.16alpha8 (This used to be commit 5a0d016b2432da9299d92b33d723534d91c8dcf4) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 1d0cfc2384..f0e9a596c4 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16alpha7" +#define VERSION "1.9.16alpha8" -- cgit From d160d93d8fad563400aa1e1274437df1fbd4ecbf Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 7 Jun 1996 03:34:22 +0000 Subject: - added predict.c, moving the routines from util.c - added iface_count() and iface_n_ip() routines so its easy to loop over the local interface list - made readsize a normal loadparm global - check for null w in add_domain_entry() - set the deathtime to time()-1 for doamin entries with servertype==0 This allows servers that are shutting down to be removed - add the 0x1c name at startup if we are a WINS server. Previously we added it only if we were a master - loop over interfaces in add_my_domains(), so people don't have to have a lmhosts file to get lp_workgroup() on all interfaces - set add to True for find_workgroupstruct() in nmbsync, and check for null return - remove some ugly "errno = EBADF" bits. they just confused things. (This used to be commit 88b191b48836eeb7937f25b37d0bdd4a2276e5a7) --- source3/include/proto.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 2c7cb8a126..77c7129b2a 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -67,6 +67,8 @@ void load_interfaces(void); void iface_set_default(char *ip,char *bcast,char *nmask); BOOL ismyip(struct in_addr ip); BOOL ismybcast(struct in_addr bcast); +int iface_count(void); +struct in_addr *iface_n_ip(int n); struct in_addr *iface_bcast(struct in_addr ip); struct in_addr *iface_nmask(struct in_addr ip); struct in_addr *iface_ip(struct in_addr ip); @@ -197,7 +199,7 @@ void sync_server(enum cmd_type cmd, char *serv_name, char *work_name, int name_type, struct in_addr ip); void update_from_reg(char *name, int type, struct in_addr ip); -void add_my_domains(void); +void add_my_domains(char *group); BOOL same_context(struct dgram_packet *dgram); BOOL listening_name(struct work_record *work, struct nmb_name *n); void process_logon_packet(struct packet_struct *p,char *buf,int len); @@ -239,6 +241,9 @@ BOOL server_cryptkey(char *buf); BOOL server_validate(char *buf); BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); void pcap_printer_fn(void (*fn)()); +int read_predict(int fd,int offset,char *buf,char **ptr,int num); +void do_read_prediction(); +void invalidate_read_prediction(int fd); void lpq_reset(int snum); void print_file(int fnum); int get_printqueue(int snum,int cnum,print_queue_struct **queue, @@ -457,9 +462,6 @@ int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew); BOOL send_keepalive(int client); int read_data(int fd,char *buffer,int N); int write_data(int fd,char *buffer,int N); -int read_predict(int fd,int offset,char *buf,char **ptr,int num); -void do_read_prediction(); -void invalidate_read_prediction(int fd); int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align); int read_smb_length(int fd,char *inbuf,int timeout); BOOL receive_smb(int fd,char *buffer,int timeout); -- cgit From 4eba893b02334953b0f1bc082dcba6f930f9ff80 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 8 Jun 1996 04:33:37 +0000 Subject: - added comments to byteorder.h explaining how it works. - fixed problem with installscripts if srcdir is not set - fixed ptr init bug in interface.c - changed default lookup type in nmblookup to match nbtstat under NT - new quotas fixes for sunos and solaris (This used to be commit e775576f026d282473256aeac6fef65a85acd98e) --- source3/include/byteorder.h | 64 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) (limited to 'source3/include') diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h index 899cd6c499..51f368e61b 100644 --- a/source3/include/byteorder.h +++ b/source3/include/byteorder.h @@ -22,6 +22,70 @@ /* This file implements macros for machine independent short and int manipulation + +Here is a description of this file that I emailed to the samba list once: + +> I am confused about the way that byteorder.h works in Samba. I have +> looked at it, and I would have thought that you might make a distinction +> between LE and BE machines, but you only seem to distinguish between 386 +> and all other architectures. +> +> Can you give me a clue? + +sure. + +The distinction between 386 and other architectures is only there as +an optimisation. You can take it out completely and it will make no +difference. The routines (macros) in byteorder.h are totally byteorder +independent. The 386 optimsation just takes advantage of the fact that +the x86 processors don't care about alignment, so we don't have to +align ints on int boundaries etc. If there are other processors out +there that aren't alignment sensitive then you could also define +CAREFUL_ALIGNMENT=0 on those processors as well. + +Ok, now to the macros themselves. I'll take a simple example, say we +want to extract a 2 byte integer from a SMB packet and put it into a +type called uint16 that is in the local machines byte order, and you +want to do it with only the assumption that uint16 is _at_least_ 16 +bits long (this last condition is very important for architectures +that don't have any int types that are 2 bytes long) + +You do this: + +#define CVAL(buf,pos) (((unsigned char *)(buf))[pos]) +#define PVAL(buf,pos) ((unsigned)CVAL(buf,pos)) +#define SVAL(buf,pos) (PVAL(buf,pos)|PVAL(buf,(pos)+1)<<8) + +then to extract a uint16 value at offset 25 in a buffer you do this: + +char *buffer = foo_bar(); +uint16 xx = SVAL(buffer,25); + +We are using the byteoder independence of the ANSI C bitshifts to do +the work. A good optimising compiler should turn this into efficient +code, especially if it happens to have the right byteorder :-) + +I know these macros can be made a bit tidier by removing some of the +casts, but you need to look at byteorder.h as a whole to see the +reasoning behind them. byteorder.h defines the following macros: + +SVAL(buf,pos) - extract a 2 byte SMB value +IVAL(buf,pos) - extract a 4 byte SMB value +SVALS(buf,pos) signed version of SVAL() +IVALS(buf,pos) signed version of IVAL() + +SSVAL(buf,pos,val) - put a 2 byte SMB value into a buffer +SIVAL(buf,pos,val) - put a 4 byte SMB value into a buffer +SSVALS(buf,pos,val) - signed version of SSVAL() +SIVALS(buf,pos,val) - signed version of SIVAL() + +RSVAL(buf,pos) - like SVAL() but for NMB byte ordering +RIVAL(buf,pos) - like IVAL() but for NMB byte ordering +RSSVAL(buf,pos,val) - like SSVAL() but for NMB ordering +RSIVAL(buf,pos,val) - like SIVAL() but for NMB ordering + +it also defines lots of intermediate macros, just ignore those :-) + */ #undef CAREFUL_ALIGNMENT -- cgit From bfbca5ac7706d03056366b84b679faeab904ecae Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 8 Jun 1996 04:41:51 +0000 Subject: changes from Luke (This used to be commit 5269aa277c635cfda65a27fd1b2e587ac181e1c3) --- source3/include/nameserv.h | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 32ee625fa4..25934c23f7 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -56,6 +56,9 @@ #define NAME_MFLAG(p) (((p) & NB_FLGMSK) == NB_MFLAG) #define NAME__FLAG(p) (((p) & NB_FLGMSK) == NB__FLAG) +#define MSBROWSE "\001\002__MSBROWSE__\002" + +enum name_search { FIND_SELF, FIND_GLOBAL }; enum name_source {STATUS_QUERY, LMHOSTS, REGISTER, SELF, DNS, DNSFAIL}; enum node_type {B_NODE=0, P_NODE=1, M_NODE=2, NBDD_NODE=3}; enum packet_type {NMB_PACKET, DGRAM_PACKET}; @@ -260,14 +263,32 @@ struct packet_struct #define AM_DOMCTL(work) (work->ServerType & SV_TYPE_DOMAIN_CTRL) -#define ANN_HostAnnouncement 1 -#define ANN_AnnouncementRequest 2 -#define ANN_Election 8 -#define ANN_GetBackupListReq 9 -#define ANN_GetBackupListResp 10 -#define ANN_BecomeBackup 11 -#define ANN_DomainAnnouncement 12 -#define ANN_MasterAnnouncement 13 -#define ANN_ResetBrowserState 14 +/* ids for netbios packet types */ +#define ANN_HostAnnouncement 1 +#define ANN_AnnouncementRequest 2 +#define ANN_Election 8 +#define ANN_GetBackupListReq 9 +#define ANN_GetBackupListResp 10 +#define ANN_BecomeBackup 11 +#define ANN_DomainAnnouncement 12 +#define ANN_MasterAnnouncement 13 +#define ANN_ResetBrowserState 14 #define ANN_LocalMasterAnnouncement 15 + +/* broadcast packet announcement intervals, in minutes */ + +/* search for master browsers of workgroups samba knows about, + except default */ +#define CHECK_TIME_MST_BROWSE 5 + +/* request backup browser announcements from other servers */ +#define CHECK_TIME_ANNOUNCE_BACKUP 15 + +/* request host announcements from other servers: min and max of interval */ +#define CHECK_TIME_MIN_HOST_ANNCE 3 +#define CHECK_TIME_MAX_HOST_ANNCE 12 + +/* announce as master to WINS server and any Primary Domain Controllers */ +#define CHECK_TIME_MST_ANNOUNCE 15 + -- cgit From 3f6fb647e707d1c919f7942135e3225b78fb5b6c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 8 Jun 1996 05:37:33 +0000 Subject: more changes from Luke (This used to be commit df44f10d7492679dabe3b998e7bacfebbc49ea5e) --- source3/include/proto.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 77c7129b2a..bb2bff241e 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -149,9 +149,9 @@ BOOL name_query(int fd,char *name,int name_type, BOOL bcast,BOOL recurse, struct in_addr to_ip, struct in_addr *ip,void (*fn)()); void expire_netbios_response_entries(time_t t); -void reply_netbios_packet(struct packet_struct *p1,int trn_id,int rcode,int opcode, - struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, - char *data,int len); +void reply_netbios_packet(struct packet_struct *p1,int trn_id,int rcode, + int opcode,BOOL recurse,struct nmb_name *rr_name, + int rr_type,int rr_class,int ttl,char *data,int len); uint16 initiate_netbios_packet(int fd,int quest_type,char *name,int name_type, int nb_flags,BOOL bcast,BOOL recurse, struct in_addr to_ip); @@ -182,6 +182,7 @@ struct name_record *add_netbios_entry(char *name, int type, int nb_flags, void remove_name_entry(char *name,int type); void add_name_entry(char *name,int type,int nb_flags); void add_my_names(void); +void remove_my_names(); void refresh_my_names(time_t t); void expire_names(time_t t); void response_name_release(struct packet_struct *p); @@ -189,8 +190,7 @@ void reply_name_release(struct packet_struct *p); void response_name_reg(struct packet_struct *p); void reply_name_reg(struct packet_struct *p); void reply_name_status(struct packet_struct *p); -struct name_record *search_for_name(struct nmb_name *question, - struct in_addr ip, int Time, int search); +void reply_name_query(struct packet_struct *p); void process_nmb(struct packet_struct *p); void reset_server(char *name, int state, struct in_addr ip); void tell_become_backup(void); @@ -250,6 +250,10 @@ int get_printqueue(int snum,int cnum,print_queue_struct **queue, print_status_struct *status); void del_printqueue(int cnum,int snum,int jobid); void status_printjob(int cnum,int snum,int jobid,int status); +BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); +BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); +BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); +BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); int reply_special(char *inbuf,char *outbuf); int reply_tcon(char *inbuf,char *outbuf); int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize); -- cgit From 97c01f6114c3151ecb69d350620dedfc521e5ee1 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sat, 8 Jun 1996 05:39:06 +0000 Subject: preparing for release of 1.9.16alpha9 (This used to be commit 32053cfa78fee6b549742ec1f6d240781b162a72) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index f0e9a596c4..5fbb619e1e 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16alpha8" +#define VERSION "1.9.16alpha9" -- cgit From e2eac352b1c6534031ad89a5565d3668833a2bf1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 10 Jun 1996 03:38:08 +0000 Subject: updates from Luke to rename "domains" more accurately to "subnets" (This used to be commit 0a044c25abc363d8b202ff5d148259d624b92ea7) --- source3/include/nameserv.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 25934c23f7..8882948ff4 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -144,17 +144,19 @@ struct work_record uint32 ElectionCriterion; }; -/* a domain structure. it contains a list of workgroups */ -struct domain_record +/* a subnet structure. it contains a list of workgroups */ +struct subnet_record { - struct domain_record *next; - struct domain_record *prev; + struct subnet_record *next; + struct subnet_record *prev; struct work_record *workgrouplist; struct in_addr bcast_ip; struct in_addr mask_ip; struct in_addr myip; + + BOOL my_interface; }; /* a resource record */ -- cgit From de411c701ed79c02875807dc60ef035d8d08334d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 10 Jun 1996 03:39:58 +0000 Subject: moved some more locking routines to locking.c, and moved replacement routines for broken OSes from util.c to replace.c. (This used to be commit 3ee9d45426a9b3b584d1ffb9f81af26790a83b4c) --- source3/include/proto.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index bb2bff241e..b8b178bf70 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -88,6 +88,9 @@ void lp_dump(void); int lp_servicenumber(char *pszServiceName); char *my_workgroup(void); char *volume_label(int snum); +BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); +int file_lock(char *name,int timeout); +void file_unlock(int fd); BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset); BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); @@ -115,19 +118,19 @@ void do_announce_request(char *info, char *to_name, int announce_type, void announce_backup(void); void announce_host(void); void announce_master(void); -struct work_record *remove_workgroup(struct domain_record *d, +struct work_record *remove_workgroup(struct subnet_record *d, struct work_record *work); void expire_browse_cache(time_t t); -struct work_record *find_workgroupstruct(struct domain_record *d, +struct work_record *find_workgroupstruct(struct subnet_record *d, fstring name, BOOL add); -struct domain_record *find_domain(struct in_addr source_ip); +struct subnet_record *find_domain(struct in_addr ip); void dump_workgroups(void); -struct domain_record *add_domain_entry(struct in_addr source_ip, +struct subnet_record *add_subnet_entry(struct in_addr source_ip, struct in_addr source_mask, char *name, BOOL add); struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, time_t ttl, struct in_addr ip); -struct server_record *add_server_entry(struct domain_record *d, +struct server_record *add_server_entry(struct subnet_record *d, struct work_record *work, char *name,int servertype, int ttl,char *comment, @@ -136,9 +139,9 @@ void write_browse_list(void); void expire_servers(time_t t); void check_master_browser(void); void browser_gone(char *work_name, struct in_addr ip); -void send_election(struct domain_record *d, char *group,uint32 criterion, +void send_election(struct subnet_record *d, char *group,uint32 criterion, int timeup,char *name); -void become_nonmaster(struct domain_record *d, struct work_record *work); +void become_nonmaster(struct subnet_record *d, struct work_record *work); void run_elections(void); void process_election(struct packet_struct *p,char *buf); BOOL check_elections(void); @@ -254,6 +257,13 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); +char *Strstr(char *s, char *p); +time_t Mktime(struct tm *t); +int InNetGr(char *group,char *host,char *user,char *dom); +void *malloc_wrapped(int size,char *file,int line); +void *realloc_wrapped(void *ptr,int size,char *file,int line); +void free_wrapped(void *ptr,char *file,int line); +void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line); int reply_special(char *inbuf,char *outbuf); int reply_tcon(char *inbuf,char *outbuf); int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize); @@ -402,9 +412,6 @@ struct passwd *Get_Pwnam(char *user,BOOL allow_change); BOOL user_in_list(char *user,char *list); void setup_logging(char *pname,BOOL interactive); void reopen_logs(void); -BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); -int file_lock(char *name,int timeout); -void file_unlock(int fd); BOOL is_a_socket(int fd); BOOL next_token(char **ptr,char *buff,char *sep); char **toktocliplist(int *ctok, char *sep); @@ -509,13 +516,6 @@ char *gidtoname(int gid); void BlockSignals(BOOL block); void ajt_panic(void); char *readdirname(void *p); -void *malloc_wrapped(int size,char *file,int line); -void *realloc_wrapped(void *ptr,int size,char *file,int line); -void free_wrapped(void *ptr,char *file,int line); -char *Strstr(char *s, char *p); -time_t Mktime(struct tm *t); -int InNetGr(char *group,char *host,char *user,char *dom); -void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line); int VT_Check(char *buffer); int VT_Start_utmp(void); int VT_Stop_utmp(void); -- cgit From 7e3b4a1c0df1434eb3d02f93c736ce065f9898d8 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 10 Jun 1996 04:38:24 +0000 Subject: got rid of a lot of redundent header files as we now globally generate prototypes automatically using "make proto". This is much less prone to error than the old method of manually adding prototypes (This used to be commit b551dc98f7cc194a5fc2e67a4ebae7fd67a01bbc) --- source3/include/proto.h | 118 ++++++++++++++++++++++++++++++++++++++++++++++++ source3/include/smb.h | 9 ++++ 2 files changed, 127 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index b8b178bf70..ffd8254aaa 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1,3 +1,4 @@ +/* This file is automatically generated with "make proto". DO NOT EDIT */ BOOL check_access(int snum); BOOL allow_access(char *deny_list,char *allow_list,struct from_host *client); BOOL fromhost(int sock,struct from_host *f); @@ -75,6 +76,123 @@ struct in_addr *iface_ip(struct in_addr ip); int reply_trans(char *inbuf,char *outbuf); int interpret_coding_system(char *str, int def); char *lp_string(char *s); +char *lp_logfile(void); +char *lp_smbrun(void); +char *lp_configfile(void); +char *lp_smb_passwd_file(void); +char *lp_serverstring(void); +char *lp_printcapname(void); +char *lp_lockdir(void); +char *lp_rootdir(void); +char *lp_defaultservice(void); +char *lp_msg_command(void); +char *lp_dfree_command(void); +char *lp_hosts_equiv(void); +char *lp_auto_services(void); +char *lp_passwd_program(void); +char *lp_passwd_chat(void); +char *lp_passwordserver(void); +char *lp_workgroup(void); +char *lp_domain_controller(void); +char *lp_username_map(void); +char *lp_character_set(void); +char *lp_logon_script(void); +char *lp_wins_server(void); +char *lp_interfaces(void); +BOOL lp_wins_support(void); +BOOL lp_wins_proxy(void); +BOOL lp_domain_master(void); +BOOL lp_domain_logons(void); +BOOL lp_preferred_master(void); +BOOL lp_load_printers(void); +BOOL lp_use_rhosts(void); +BOOL lp_getwdcache(void); +BOOL lp_readprediction(void); +BOOL lp_readbmpx(void); +BOOL lp_readraw(void); +BOOL lp_writeraw(void); +BOOL lp_null_passwords(void); +BOOL lp_strip_dot(void); +BOOL lp_encrypted_passwords(void); +BOOL lp_syslog_only(void); +BOOL lp_browse_list(void); +int lp_os_level(void); +int lp_max_ttl(void); +int lp_max_log_size(void); +int lp_mangledstack(void); +int lp_maxxmit(void); +int lp_maxmux(void); +int lp_maxpacket(void); +int lp_keepalive(void); +int lp_passwordlevel(void); +int lp_readsize(void); +int lp_deadtime(void); +int lp_maxprotocol(void); +int lp_security(void); +int lp_printing(void); +int lp_maxdisksize(void); +int lp_lpqcachetime(void); +int lp_syslog(void); +char *lp_preexec(int ); +char *lp_postexec(int ); +char *lp_rootpreexec(int ); +char *lp_rootpostexec(int ); +char *lp_servicename(int ); +char *lp_pathname(int ); +char *lp_dontdescend(int ); +char *lp_username(int ); +char *lp_guestaccount(int ); +char *lp_invalid_users(int ); +char *lp_valid_users(int ); +char *lp_admin_users(int ); +char *lp_printcommand(int ); +char *lp_lpqcommand(int ); +char *lp_lprmcommand(int ); +char *lp_lppausecommand(int ); +char *lp_lpresumecommand(int ); +char *lp_printername(int ); +char *lp_hostsallow(int ); +char *lp_hostsdeny(int ); +char *lp_magicscript(int ); +char *lp_magicoutput(int ); +char *lp_comment(int ); +char *lp_force_user(int ); +char *lp_force_group(int ); +char *lp_readlist(int ); +char *lp_writelist(int ); +char *lp_volume(int ); +char *lp_mangled_map(int ); +BOOL lp_alternate_permissions(int ); +BOOL lp_revalidate(int ); +BOOL lp_casesensitive(int ); +BOOL lp_preservecase(int ); +BOOL lp_shortpreservecase(int ); +BOOL lp_casemangle(int ); +BOOL lp_status(int ); +BOOL lp_hide_dot_files(int ); +BOOL lp_browseable(int ); +BOOL lp_readonly(int ); +BOOL lp_no_set_dir(int ); +BOOL lp_guest_ok(int ); +BOOL lp_guest_only(int ); +BOOL lp_print_ok(int ); +BOOL lp_postscript(int ); +BOOL lp_map_hidden(int ); +BOOL lp_map_archive(int ); +BOOL lp_locking(int ); +BOOL lp_strict_locking(int ); +BOOL lp_share_modes(int ); +BOOL lp_onlyuser(int ); +BOOL lp_manglednames(int ); +BOOL lp_widelinks(int ); +BOOL lp_syncalways(int ); +BOOL lp_map_system(int ); +BOOL lp_delete_readonly(int ); +int lp_create_mode(int ); +int lp_max_connections(int ); +int lp_defaultcase(int ); +int lp_minprintspace(int ); +char lp_magicchar(int ); BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir); int lp_add_service(char *pszService, int iDefaultService); BOOL lp_add_printer(char *pszPrintername, int iDefaultService); diff --git a/source3/include/smb.h b/source3/include/smb.h index 0be860d6a3..5fd2e0846b 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -234,6 +234,15 @@ typedef char fstring[128]; typedef fstring string; +struct smb_passwd { + int smb_userid; + char *smb_name; + unsigned char *smb_passwd; /* Null if no password */ + unsigned char *smb_nt_passwd; /* Null if no password */ + /* Other fields / flags may be added later */ +}; + + struct current_user { int cnum, id; int uid, gid; -- cgit From a521fe8a274c8a043cf77641dd4160fdef803533 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 10 Jun 1996 05:16:19 +0000 Subject: a cleanup of the receive_smb() usage, adding timeouts in some places also added paranoid code in the main process() loop of smbd to detect when smbd is looping uselessly. This should stop the "smbd is chewing lots of cpu" reports (This used to be commit 8e9dce34d50d673cb50531f0c4c7672ce2522cef) --- source3/include/smb.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 5fd2e0846b..b9dd13a802 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -99,6 +99,9 @@ typedef unsigned int uint32; #define DEFAULT_PIPE_TIMEOUT 10000000 /* Ten seconds */ #endif +/* how long to wait for secondary SMB packets (seconds) */ +#define SMB_SECONDARY_WAIT 30 + /* debugging code */ #ifndef SYSLOG #define DEBUG(level,body) ((DEBUGLEVEL>=(level))?(Debug1 body):0) -- cgit From 53409e5e34fce56bc18880ba59b3caf60dcbc3be Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Mon, 10 Jun 1996 05:20:35 +0000 Subject: preparing for release of 1.9.16alpha10 (This used to be commit a82ffca73e490f0fb9dbad43783ab55ac317a460) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 5fbb619e1e..964411164d 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16alpha9" +#define VERSION "1.9.16alpha10" -- cgit From 851ee418b499df481b765286405cd761e91dcaaf Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 19 Jun 1996 13:23:46 +0000 Subject: Basic doc changes to keep up to date. Dan (This used to be commit 6d81d56f929e763bcf6b1f7a61aabaf884c4aad4) --- source3/include/proto.h | 646 ------------------------------------------------ 1 file changed, 646 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index ffd8254aaa..e69de29bb2 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1,646 +0,0 @@ -/* This file is automatically generated with "make proto". DO NOT EDIT */ -BOOL check_access(int snum); -BOOL allow_access(char *deny_list,char *allow_list,struct from_host *client); -BOOL fromhost(int sock,struct from_host *f); -char *unix2dos_format(char *str,BOOL overwrite); -char *dos2unix_format(char *str, BOOL overwrite); -int interpret_character_set(char *str, int def); -void charset_initialise(void); -void add_char_string(char *s); -BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence); -BOOL chgpasswd(char *name,char *oldpass,char *newpass); -BOOL chgpasswd(char *name,char *oldpass,char *newpass); -void setup_pkt(char *outbuf); -void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(),BOOL recurse_dir); -void cmd_help(void); -BOOL reopen_connection(char *inbuf,char *outbuf); -char *smb_errstr(char *inbuf); -void cli_setup_pkt(char *outbuf); -BOOL cli_receive_trans_response(char *inbuf,int trans,int *data_len, - int *param_len, char **data,char **param); -BOOL cli_send_session_request(char *inbuf, char *outbuf); -BOOL cli_send_login(char *inbuf, char *outbuf, BOOL start_session, BOOL use_setup); -void cli_send_logout(void); -BOOL cli_call_api(int prcnt,int drcnt,int mprcnt,int mdrcnt,int *rprcnt, - int *rdrcnt, char *param,char *data, char **rparam,char **rdata); -BOOL cli_send_trans_request(char *outbuf, int trans, char *name, int fid, int flags, - char *data,char *param,uint16 *setup, int ldata,int lparam, - int lsetup,int mdata,int mparam,int msetup); -BOOL cli_open_sockets(int port); -BOOL cli_reopen_connection(char *inbuf,char *outbuf); -char *smb_errstr(char *inbuf); -int strslashcmp(const char *s1, const char *s2); -void cmd_block(void); -void cmd_tarmode(void); -void cmd_setmode(void); -void cmd_tar(char *inbuf, char *outbuf); -int process_tar(char *inbuf, char *outbuf); -int clipfind(char **aret, int ret, char *tok); -int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind); -void init_dptrs(void); -char *dptr_path(int key); -char *dptr_wcard(int key); -BOOL dptr_set_wcard(int key, char *wcard); -BOOL dptr_set_attr(int key, uint16 attr); -uint16 dptr_attr(int key); -void dptr_close(int key); -void dptr_closecnum(int cnum); -void dptr_idlecnum(int cnum); -void dptr_closepath(char *path,int pid); -int dptr_create(int cnum,char *path, BOOL expect_close,int pid); -BOOL dptr_fill(char *buf1,unsigned int key); -BOOL dptr_zero(char *buf); -void *dptr_fetch(char *buf,int *num); -void *dptr_fetch_lanman2(char *params,int dptr_num); -BOOL dir_check_ftype(int cnum,int mode,struct stat *st,int dirtype); -BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend); -void *OpenDir(char *name); -void CloseDir(void *p); -char *ReadDirName(void *p); -BOOL SeekDir(void *p,int pos); -int TellDir(void *p); -void DirCacheAdd(char *path,char *name,char *dname,int snum); -char *DirCacheCheck(char *path,char *name,int snum); -void DirCacheFlush(int snum); -void fault_setup(void (*fn)()); -char *getsmbpass(char *prompt) ; -void load_interfaces(void); -void iface_set_default(char *ip,char *bcast,char *nmask); -BOOL ismyip(struct in_addr ip); -BOOL ismybcast(struct in_addr bcast); -int iface_count(void); -struct in_addr *iface_n_ip(int n); -struct in_addr *iface_bcast(struct in_addr ip); -struct in_addr *iface_nmask(struct in_addr ip); -struct in_addr *iface_ip(struct in_addr ip); -int reply_trans(char *inbuf,char *outbuf); -int interpret_coding_system(char *str, int def); -char *lp_string(char *s); -char *lp_logfile(void); -char *lp_smbrun(void); -char *lp_configfile(void); -char *lp_smb_passwd_file(void); -char *lp_serverstring(void); -char *lp_printcapname(void); -char *lp_lockdir(void); -char *lp_rootdir(void); -char *lp_defaultservice(void); -char *lp_msg_command(void); -char *lp_dfree_command(void); -char *lp_hosts_equiv(void); -char *lp_auto_services(void); -char *lp_passwd_program(void); -char *lp_passwd_chat(void); -char *lp_passwordserver(void); -char *lp_workgroup(void); -char *lp_domain_controller(void); -char *lp_username_map(void); -char *lp_character_set(void); -char *lp_logon_script(void); -char *lp_wins_server(void); -char *lp_interfaces(void); -BOOL lp_wins_support(void); -BOOL lp_wins_proxy(void); -BOOL lp_domain_master(void); -BOOL lp_domain_logons(void); -BOOL lp_preferred_master(void); -BOOL lp_load_printers(void); -BOOL lp_use_rhosts(void); -BOOL lp_getwdcache(void); -BOOL lp_readprediction(void); -BOOL lp_readbmpx(void); -BOOL lp_readraw(void); -BOOL lp_writeraw(void); -BOOL lp_null_passwords(void); -BOOL lp_strip_dot(void); -BOOL lp_encrypted_passwords(void); -BOOL lp_syslog_only(void); -BOOL lp_browse_list(void); -int lp_os_level(void); -int lp_max_ttl(void); -int lp_max_log_size(void); -int lp_mangledstack(void); -int lp_maxxmit(void); -int lp_maxmux(void); -int lp_maxpacket(void); -int lp_keepalive(void); -int lp_passwordlevel(void); -int lp_readsize(void); -int lp_deadtime(void); -int lp_maxprotocol(void); -int lp_security(void); -int lp_printing(void); -int lp_maxdisksize(void); -int lp_lpqcachetime(void); -int lp_syslog(void); -char *lp_preexec(int ); -char *lp_postexec(int ); -char *lp_rootpreexec(int ); -char *lp_rootpostexec(int ); -char *lp_servicename(int ); -char *lp_pathname(int ); -char *lp_dontdescend(int ); -char *lp_username(int ); -char *lp_guestaccount(int ); -char *lp_invalid_users(int ); -char *lp_valid_users(int ); -char *lp_admin_users(int ); -char *lp_printcommand(int ); -char *lp_lpqcommand(int ); -char *lp_lprmcommand(int ); -char *lp_lppausecommand(int ); -char *lp_lpresumecommand(int ); -char *lp_printername(int ); -char *lp_hostsallow(int ); -char *lp_hostsdeny(int ); -char *lp_magicscript(int ); -char *lp_magicoutput(int ); -char *lp_comment(int ); -char *lp_force_user(int ); -char *lp_force_group(int ); -char *lp_readlist(int ); -char *lp_writelist(int ); -char *lp_volume(int ); -char *lp_mangled_map(int ); -BOOL lp_alternate_permissions(int ); -BOOL lp_revalidate(int ); -BOOL lp_casesensitive(int ); -BOOL lp_preservecase(int ); -BOOL lp_shortpreservecase(int ); -BOOL lp_casemangle(int ); -BOOL lp_status(int ); -BOOL lp_hide_dot_files(int ); -BOOL lp_browseable(int ); -BOOL lp_readonly(int ); -BOOL lp_no_set_dir(int ); -BOOL lp_guest_ok(int ); -BOOL lp_guest_only(int ); -BOOL lp_print_ok(int ); -BOOL lp_postscript(int ); -BOOL lp_map_hidden(int ); -BOOL lp_map_archive(int ); -BOOL lp_locking(int ); -BOOL lp_strict_locking(int ); -BOOL lp_share_modes(int ); -BOOL lp_onlyuser(int ); -BOOL lp_manglednames(int ); -BOOL lp_widelinks(int ); -BOOL lp_syncalways(int ); -BOOL lp_map_system(int ); -BOOL lp_delete_readonly(int ); -int lp_create_mode(int ); -int lp_max_connections(int ); -int lp_defaultcase(int ); -int lp_minprintspace(int ); -char lp_magicchar(int ); -BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir); -int lp_add_service(char *pszService, int iDefaultService); -BOOL lp_add_printer(char *pszPrintername, int iDefaultService); -BOOL lp_file_list_changed(void); -BOOL lp_snum_ok(int iService); -BOOL lp_loaded(void); -void lp_killunused(BOOL (*snumused)(int )); -BOOL lp_load(char *pszFname,BOOL global_only); -int lp_numservices(void); -void lp_dump(void); -int lp_servicenumber(char *pszServiceName); -char *my_workgroup(void); -char *volume_label(int snum); -BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); -int file_lock(char *name,int timeout); -void file_unlock(int fd); -BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset); -BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); -BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); -int get_share_mode_by_fnum(int cnum,int fnum,int *pid); -int get_share_mode_byname(int cnum,char *fname,int *pid); -int get_share_mode(int cnum,struct stat *sbuf,int *pid); -void del_share_mode(int fnum); -BOOL set_share_mode(int fnum,int mode); -void clean_share_files(void); -int str_checksum(char *s); -BOOL is_8_3(char *fname); -void create_mangled_stack(int size); -BOOL check_mangled_stack(char *s); -BOOL is_mangled(char *s); -void mangle_name_83(char *s); -BOOL name_map_mangle(char *OutName,BOOL need83,int snum); -int reply_sends(char *inbuf,char *outbuf); -int reply_sendstrt(char *inbuf,char *outbuf); -int reply_sendtxt(char *inbuf,char *outbuf); -int reply_sendend(char *inbuf,char *outbuf); -void announce_request(struct work_record *work, struct in_addr ip); -void do_announce_request(char *info, char *to_name, int announce_type, - int from, - int to, struct in_addr dest_ip); -void announce_backup(void); -void announce_host(void); -void announce_master(void); -struct work_record *remove_workgroup(struct subnet_record *d, - struct work_record *work); -void expire_browse_cache(time_t t); -struct work_record *find_workgroupstruct(struct subnet_record *d, - fstring name, BOOL add); -struct subnet_record *find_domain(struct in_addr ip); -void dump_workgroups(void); -struct subnet_record *add_subnet_entry(struct in_addr source_ip, - struct in_addr source_mask, - char *name, BOOL add); -struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, - time_t ttl, struct in_addr ip); -struct server_record *add_server_entry(struct subnet_record *d, - struct work_record *work, - char *name,int servertype, - int ttl,char *comment, - BOOL replace); -void write_browse_list(void); -void expire_servers(time_t t); -void check_master_browser(void); -void browser_gone(char *work_name, struct in_addr ip); -void send_election(struct subnet_record *d, char *group,uint32 criterion, - int timeup,char *name); -void become_nonmaster(struct subnet_record *d, struct work_record *work); -void run_elections(void); -void process_election(struct packet_struct *p,char *buf); -BOOL check_elections(void); -BOOL name_status(int fd,char *name,int name_type,BOOL recurse, - struct in_addr to_ip,char *master,char *rname, - void (*fn)()); -BOOL name_query(int fd,char *name,int name_type, - BOOL bcast,BOOL recurse, - struct in_addr to_ip, struct in_addr *ip,void (*fn)()); -void expire_netbios_response_entries(time_t t); -void reply_netbios_packet(struct packet_struct *p1,int trn_id,int rcode, - int opcode,BOOL recurse,struct nmb_name *rr_name, - int rr_type,int rr_class,int ttl,char *data,int len); -uint16 initiate_netbios_packet(int fd,int quest_type,char *name,int name_type, - int nb_flags,BOOL bcast,BOOL recurse, - struct in_addr to_ip); -void queue_netbios_pkt_wins(int fd,int quest_type,enum cmd_type cmd, - char *name,int name_type,int nb_flags, - BOOL bcast,BOOL recurse,struct in_addr to_ip); -void queue_netbios_packet(int fd,int quest_type,enum cmd_type cmd,char *name, - int name_type,int nb_flags,BOOL bcast,BOOL recurse, - struct in_addr to_ip); -struct name_response_record *find_name_query(uint16 id); -void queue_packet(struct packet_struct *packet); -void run_packet_queue(); -void listen_for_packets(BOOL run_election); -BOOL interpret_node_status(char *p, struct nmb_name *name,int t, - char *serv_name, struct in_addr ip); -BOOL send_mailslot_reply(char *mailslot,int fd,char *buf,int len,char *srcname, - char *dstname,int src_type,int dest_type, - struct in_addr dest_ip,struct in_addr src_ip); -void remove_name(struct name_record *n); -void dump_names(void); -void remove_netbios_name(char *name,int type, enum name_source source, - struct in_addr ip); -struct name_record *add_netbios_entry(char *name, int type, int nb_flags, - int ttl, - enum name_source source, - struct in_addr ip, - BOOL new_only); -void remove_name_entry(char *name,int type); -void add_name_entry(char *name,int type,int nb_flags); -void add_my_names(void); -void remove_my_names(); -void refresh_my_names(time_t t); -void expire_names(time_t t); -void response_name_release(struct packet_struct *p); -void reply_name_release(struct packet_struct *p); -void response_name_reg(struct packet_struct *p); -void reply_name_reg(struct packet_struct *p); -void reply_name_status(struct packet_struct *p); -void reply_name_query(struct packet_struct *p); -void process_nmb(struct packet_struct *p); -void reset_server(char *name, int state, struct in_addr ip); -void tell_become_backup(void); -void do_browser_lists(void); -void sync_server(enum cmd_type cmd, char *serv_name, char *work_name, - int name_type, - struct in_addr ip); -void update_from_reg(char *name, int type, struct in_addr ip); -void add_my_domains(char *group); -BOOL same_context(struct dgram_packet *dgram); -BOOL listening_name(struct work_record *work, struct nmb_name *n); -void process_logon_packet(struct packet_struct *p,char *buf,int len); -BOOL listening_type(struct packet_struct *p, int command); -void process_browse_packet(struct packet_struct *p,char *buf,int len); -void process_dgram(struct packet_struct *p); -BOOL reload_services(BOOL test); -void debug_nmb_packet(struct packet_struct *p); -char *namestr(struct nmb_name *n); -void free_nmb_packet(struct nmb_packet *nmb); -void free_packet(struct packet_struct *packet); -struct packet_struct *read_packet(int fd,enum packet_type packet_type); -void make_nmb_name(struct nmb_name *n,char *name,int type,char *this_scope); -BOOL send_packet(struct packet_struct *p); -struct packet_struct *receive_packet(int fd,enum packet_type type,int t); -int main(int argc,char *argv[]); -char *getsmbpass(char *pass); -void sync_browse_lists(struct work_record *work, char *name, int nm_type, - struct in_addr ip); -BOOL pm_process(char *pszFileName,BOOL (*sfunc)(char *),BOOL (*pfunc)(char *,char *)); -void generate_next_challenge(char *challenge); -BOOL set_challenge(char *challenge); -BOOL last_challenge(char *challenge); -int valid_uid(int uid); -user_struct *get_valid_user_struct(int uid); -void invalidate_uid(int uid); -char *validated_username(int vuid); -void register_uid(int uid,int gid, char *name,BOOL guest); -void add_session_user(char *user); -void dfs_unlogin(void); -BOOL password_check(char *password); -BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8); -BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd, BOOL is_nt_password); -BOOL user_ok(char *user,int snum); -BOOL authorise_login(int snum,char *user,char *password, int pwlen, - BOOL *guest,BOOL *force,int vuid); -BOOL check_hosts_equiv(char *user); -BOOL server_cryptkey(char *buf); -BOOL server_validate(char *buf); -BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); -void pcap_printer_fn(void (*fn)()); -int read_predict(int fd,int offset,char *buf,char **ptr,int num); -void do_read_prediction(); -void invalidate_read_prediction(int fd); -void lpq_reset(int snum); -void print_file(int fnum); -int get_printqueue(int snum,int cnum,print_queue_struct **queue, - print_status_struct *status); -void del_printqueue(int cnum,int snum,int jobid); -void status_printjob(int cnum,int snum,int jobid,int status); -BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); -BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); -BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); -BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); -char *Strstr(char *s, char *p); -time_t Mktime(struct tm *t); -int InNetGr(char *group,char *host,char *user,char *dom); -void *malloc_wrapped(int size,char *file,int line); -void *realloc_wrapped(void *ptr,int size,char *file,int line); -void free_wrapped(void *ptr,char *file,int line); -void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line); -int reply_special(char *inbuf,char *outbuf); -int reply_tcon(char *inbuf,char *outbuf); -int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_unknown(char *inbuf,char *outbuf); -int reply_ioctl(char *inbuf,char *outbuf); -int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_chkpth(char *inbuf,char *outbuf); -int reply_getatr(char *inbuf,char *outbuf); -int reply_setatr(char *inbuf,char *outbuf); -int reply_dskattr(char *inbuf,char *outbuf); -int reply_search(char *inbuf,char *outbuf); -int reply_fclose(char *inbuf,char *outbuf); -int reply_open(char *inbuf,char *outbuf); -int reply_open_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_ulogoffX(char *inbuf,char *outbuf,int length,int bufsize); -int reply_mknew(char *inbuf,char *outbuf); -int reply_ctemp(char *inbuf,char *outbuf); -int reply_unlink(char *inbuf,char *outbuf); -int reply_readbraw(char *inbuf, char *outbuf); -int reply_lockread(char *inbuf,char *outbuf); -int reply_read(char *inbuf,char *outbuf); -int reply_read_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_writebraw(char *inbuf,char *outbuf); -int reply_writeunlock(char *inbuf,char *outbuf); -int reply_write(char *inbuf,char *outbuf,int dum1,int dum2); -int reply_write_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_lseek(char *inbuf,char *outbuf); -int reply_flush(char *inbuf,char *outbuf); -int reply_exit(char *inbuf,char *outbuf); -int reply_close(char *inbuf,char *outbuf); -int reply_writeclose(char *inbuf,char *outbuf); -int reply_lock(char *inbuf,char *outbuf); -int reply_unlock(char *inbuf,char *outbuf); -int reply_tdis(char *inbuf,char *outbuf); -int reply_echo(char *inbuf,char *outbuf); -int reply_printopen(char *inbuf,char *outbuf); -int reply_printclose(char *inbuf,char *outbuf); -int reply_printqueue(char *inbuf,char *outbuf); -int reply_printwrite(char *inbuf,char *outbuf); -int reply_mkdir(char *inbuf,char *outbuf); -int reply_rmdir(char *inbuf,char *outbuf); -int reply_mv(char *inbuf,char *outbuf); -int reply_copy(char *inbuf,char *outbuf); -int reply_setdir(char *inbuf,char *outbuf); -int reply_lockingX(char *inbuf,char *outbuf,int length,int bufsize); -int reply_readbmpx(char *inbuf,char *outbuf,int length,int bufsize); -int reply_writebmpx(char *inbuf,char *outbuf); -int reply_writebs(char *inbuf,char *outbuf); -int reply_setattrE(char *inbuf,char *outbuf); -int reply_getattrE(char *inbuf,char *outbuf); -mode_t unix_mode(int cnum,int dosmode); -int dos_mode(int cnum,char *path,struct stat *sbuf); -int dos_chmod(int cnum,char *fname,int dosmode,struct stat *st); -BOOL unix_convert(char *name,int cnum); -int disk_free(char *path,int *bsize,int *dfree,int *dsize); -int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); -BOOL check_name(char *name,int cnum); -void open_file(int fnum,int cnum,char *fname1,int flags,int mode); -void sync_file(int fnum); -void close_file(int fnum); -BOOL check_file_sharing(int cnum,char *fname); -void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun, - int mode,int *Access,int *action); -int seek_file(int fnum,int pos); -int read_file(int fnum,char *data,int pos,int mincnt,int maxcnt,int timeout,BOOL exact); -int write_file(int fnum,char *data,int n); -BOOL become_service(int cnum,BOOL do_chdir); -int find_service(char *service); -int cached_error_packet(char *inbuf,char *outbuf,int fnum,int line); -int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line); -int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int line); -BOOL snum_used(int snum); -BOOL reload_services(BOOL test); -int setup_groups(char *user, int uid, int gid, int *p_ngroups, - int **p_igroups, gid_t **p_groups); -int make_connection(char *service,char *user,char *password, int pwlen, char *dev,int vuid); -int find_free_file(void ); -int reply_corep(char *outbuf); -int reply_coreplus(char *outbuf); -int reply_lanman1(char *outbuf); -int reply_lanman2(char *outbuf); -int reply_nt1(char *outbuf); -void parse_connect(char *buf,char *service,char *user,char *password,int *pwlen,char *dev); -void close_cnum(int cnum, int uid); -BOOL yield_connection(int cnum,char *name,int max_connections); -BOOL claim_connection(int cnum,char *name,int max_connections,BOOL Clear); -void exit_server(char *reason); -void standard_sub(int cnum,char *s); -char *smb_fn_name(int type); -int chain_reply(int type,char *inbuf,char *inbuf2,char *outbuf,char *outbuf2,int size,int bufsize); -int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); -void str_to_key(uchar *str,uchar *key); -void D1(uchar *k, uchar *d, uchar *out); -void E1(uchar *k, uchar *d, uchar *out); -void E_P16(uchar *p14,uchar *p16); -void E_P24(uchar *p21, uchar *c8, uchar *p24); -void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); -void E_md4hash(uchar *passwd, uchar *p16); -void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); -void Ucrit_addUsername(pstring username); -unsigned int Ucrit_checkUsername(pstring username); -void Ucrit_addPid(int pid); -unsigned int Ucrit_checkPid(int pid); -int sys_select(fd_set *fds,struct timeval *tval); -int sys_select(fd_set *fds,struct timeval *tval); -int sys_unlink(char *fname); -int sys_open(char *fname,int flags,int mode); -DIR *sys_opendir(char *dname); -int sys_stat(char *fname,struct stat *sbuf); -int sys_lstat(char *fname,struct stat *sbuf); -int sys_mkdir(char *dname,int mode); -int sys_rmdir(char *dname); -int sys_chdir(char *dname); -int sys_utime(char *fname,struct utimbuf *times); -int sys_rename(char *from, char *to); -int sys_chown(char *fname,int uid,int gid); -int sys_chroot(char *dname); -int main(int argc, char *argv[]); -void GetTimeOfDay(struct timeval *tval); -void TimeInit(void); -int TimeDiff(time_t t); -struct tm *LocalTime(time_t *t); -time_t interpret_long_date(char *p); -void put_long_date(char *p,time_t t); -void put_dos_date(char *buf,int offset,time_t unixdate); -void put_dos_date2(char *buf,int offset,time_t unixdate); -void put_dos_date3(char *buf,int offset,time_t unixdate); -time_t make_unix_date(void *date_ptr); -time_t make_unix_date2(void *date_ptr); -time_t make_unix_date3(void *date_ptr); -BOOL set_filetime(char *fname,time_t mtime); -char *timestring(void ); -int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize); -int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize); -int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize); -int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize); -char *ufc_crypt(char *key,char *salt); -void init_uid(void); -BOOL become_guest(void); -BOOL become_user(int cnum, int uid); -BOOL unbecome_user(void ); -int smbrun(char *cmd,char *outfile); -char *get_home_dir(char *user); -void map_username(char *user); -struct passwd *Get_Pwnam(char *user,BOOL allow_change); -BOOL user_in_list(char *user,char *list); -void setup_logging(char *pname,BOOL interactive); -void reopen_logs(void); -BOOL is_a_socket(int fd); -BOOL next_token(char **ptr,char *buff,char *sep); -char **toktocliplist(int *ctok, char *sep); -void *MemMove(void *dest,void *src,int size); -void array_promote(char *array,int elsize,int element); -void set_socket_options(int fd, char *options); -void close_sockets(void ); -BOOL in_group(gid_t group, int current_gid, int ngroups, int *groups); -char *StrCpy(char *dest,char *src); -char *StrnCpy(char *dest,const char *src,int n); -void putip(void *dest,void *src); -int name_mangle(char *In,char *Out,char name_type); -BOOL file_exist(char *fname,struct stat *sbuf); -time_t file_modtime(char *fname); -BOOL directory_exist(char *dname,struct stat *st); -uint32 file_size(char *file_name); -char *attrib_string(int mode); -int StrCaseCmp(char *s, char *t); -int StrnCaseCmp(char *s, char *t, int n); -BOOL strequal(char *s1,char *s2); -BOOL strnequal(char *s1,char *s2,int n); -BOOL strcsequal(char *s1,char *s2); -void strlower(char *s); -void strupper(char *s); -void strnorm(char *s); -BOOL strisnormal(char *s); -void string_replace(char *s,char oldc,char newc); -void unix_format(char *fname); -void dos_format(char *fname); -void show_msg(char *buf); -int smb_len(char *buf); -void _smb_setlen(char *buf,int len); -void smb_setlen(char *buf,int len); -int set_message(char *buf,int num_words,int num_bytes,BOOL zero); -int smb_numwords(char *buf); -int smb_buflen(char *buf); -int smb_buf_ofs(char *buf); -char *smb_buf(char *buf); -int smb_offset(char *p,char *buf); -char *skip_string(char *buf,int n); -BOOL trim_string(char *s,char *front,char *back); -void dos_clean_name(char *s); -void unix_clean_name(char *s); -int ChDir(char *path); -char *GetWd(char *str); -BOOL reduce_name(char *s,char *dir,BOOL widelinks); -void expand_mask(char *Mask,BOOL doext); -BOOL strhasupper(char *s); -BOOL strhaslower(char *s); -int count_chars(char *s,char c); -void make_dir_struct(char *buf,char *mask,char *fname,unsigned int size,int mode,time_t date); -void close_low_fds(void); -int write_socket(int fd,char *buf,int len); -int read_udp_socket(int fd,char *buf,int len); -int set_blocking(int fd, BOOL set); -int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out,BOOL exact); -int read_max_udp(int fd,char *buffer,int bufsize,int maxtime); -int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew); -BOOL send_keepalive(int client); -int read_data(int fd,char *buffer,int N); -int write_data(int fd,char *buffer,int N); -int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align); -int read_smb_length(int fd,char *inbuf,int timeout); -BOOL receive_smb(int fd,char *buffer,int timeout); -BOOL send_smb(int fd,char *buffer); -char *name_ptr(char *buf,int ofs); -int name_extract(char *buf,int ofs,char *name); -int name_len(char *s); -BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type); -void msleep(int t); -BOOL in_list(char *s,char *list,BOOL casesensitive); -BOOL string_init(char **dest,char *src); -void string_free(char **s); -BOOL string_set(char **dest,char *src); -BOOL string_sub(char *s,char *pattern,char *insert); -BOOL do_match(char *str, char *regexp, int case_sig); -BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2); -void become_daemon(void); -BOOL yesno(char *p); -char *fgets_slash(char *s2,int maxlen,FILE *f); -int set_filelen(int fd, long len); -int byte_checksum(char *buf,int len); -char *dirname_dos(char *path,char *buf); -void *Realloc(void *p,int size); -void Abort(void ); -BOOL get_myname(char *myname,struct in_addr *ip); -BOOL ip_equal(struct in_addr ip1,struct in_addr ip2); -int open_socket_in(int type, int port, int dlevel); -int open_socket_out(int type, struct in_addr *addr, int port ); -int interpret_protocol(char *str,int def); -int interpret_security(char *str,int def); -unsigned long interpret_addr(char *str); -struct in_addr *interpret_addr2(char *str); -BOOL zero_ip(struct in_addr ip); -void standard_sub_basic(char *s); -BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask); -int PutUniCode(char *dst,char *src); -struct hostent *Get_Hostbyname(char *name); -BOOL process_exists(int pid); -char *uidtoname(int uid); -char *gidtoname(int gid); -void BlockSignals(BOOL block); -void ajt_panic(void); -char *readdirname(void *p); -int VT_Check(char *buffer); -int VT_Start_utmp(void); -int VT_Stop_utmp(void); -void VT_AtExit(void); -void VT_SigCLD(int sig); -void VT_SigEXIT(int sig); -int VT_Start(void); -int VT_Output(char *Buffer); -int VT_Input(char *Buffer,int Size); -void VT_Process(void); -- cgit From ed2639ebe21dde49af816a96ec6ea1e40f76e768 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sat, 29 Jun 1996 18:49:20 +0000 Subject: luke's first attempt at using cvs accidentally updated the Makefile updated the name database structure (again!). this time, there is one name database per local interface. there is also a pseudo-interface on ip 255.255.255.255. its purpose is to store WINS name entries. all the local interface name databases store SELF names only. the WINS name database stores non-special browser names. added wins.dat file: records WINS entries in ascii format. this is reloaded when nmbd restarts. added repeating code for response packets. timer is in seconds only at the moment. updated the response queue code to deal with samba registering with a WINS server a bit better (added more cases when a response isn't received). tidied up the response packet processing code and expire_response_queue() code. added cross references between response received and await-response expired code. added over-zealous code that checks all machines that register with samba as a WINS server (every 10 minutes i think): to see whether they are still alive or not (see rfc1001.txt) bug reported by terry@ren.pc.athabascau.ca: DNSFAILed names _stay_ as DNSFAIL, even though the machine may come back up and REGISTER. removed update_from_reg() function. it's not necessary, and it does too much. added code that announces on each local interface samba's ttl as zero and servertype as zero when nmbd is kill -TERMed first attempt at putting the first functionality of samba browsing back in (remote subnets should have samba appear in a workgroup specified through the lmhosts file) lots of other miscellaneous tidying up / chopping about. (This used to be commit 7e8c60cfe54060860e5ce20b1c3b8ec6aa5c54da) --- source3/include/nameserv.h | 109 +++++--- source3/include/proto.h | 659 +++++++++++++++++++++++++++++++++++++++++++++ source3/include/smb.h | 9 + 3 files changed, 743 insertions(+), 34 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 8882948ff4..03bb521558 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -29,8 +29,12 @@ #define NMB_QUERY 0x20 #define NMB_STATUS 0x21 -#define NMB_REG 0x05 -#define NMB_REL 0x06 + +#define NMB_REG 0x05 /* see rfc1002.txt 4.2.2,3,5,6,7,8 */ +#define NMB_REG_REFRESH 0x09 /* see rfc1002.txt 4.2.4 */ +#define NMB_REL 0x06 /* see rfc1002.txt 4.2.9,10,11 */ +#define NMB_WAIT_ACK 0x07 /* see rfc1002.txt 4.2.17 */ +/* XXXX what about all the other types?? 0x1, 0x2, 0x3, 0x4, 0x8? */ #define NB_GROUP 0x80 #define NB_PERM 0x02 @@ -44,6 +48,8 @@ #define NB_FLGMSK 0x60 #define REFRESH_TIME (15*60) +#define NAME_POLL_REFRESH_TIME (5*60) +#define NAME_POLL_INTERVAL 15 #define NAME_PERMANENT(p) ((p) & NB_PERM) #define NAME_ACTIVE(p) ((p) & NB_ACTIVE) @@ -58,7 +64,6 @@ #define MSBROWSE "\001\002__MSBROWSE__\002" -enum name_search { FIND_SELF, FIND_GLOBAL }; enum name_source {STATUS_QUERY, LMHOSTS, REGISTER, SELF, DNS, DNSFAIL}; enum node_type {B_NODE=0, P_NODE=1, M_NODE=2, NBDD_NODE=3}; enum packet_type {NMB_PACKET, DGRAM_PACKET}; @@ -66,13 +71,14 @@ enum cmd_type { NAME_STATUS_MASTER_CHECK, NAME_STATUS_CHECK, - MASTER_SERVER_CHECK, - SERVER_CHECK, - FIND_MASTER, - CHECK_MASTER, NAME_REGISTER, NAME_RELEASE, - NAME_CONFIRM_QUERY + NAME_QUERY_CONFIRM, + NAME_QUERY_SYNC, + NAME_QUERY_MST_SRV_CHK, + NAME_QUERY_SRV_CHK, + NAME_QUERY_FIND_MST, + NAME_QUERY_MST_CHK }; /* a netbios name structure */ @@ -87,11 +93,15 @@ struct name_record { struct name_record *next; struct name_record *prev; - struct nmb_name name; - time_t death_time; - struct in_addr ip; - int nb_flags; - enum name_source source; + + struct nmb_name name; /* the netbios name */ + struct in_addr ip; /* ip address of host that owns this name */ + int nb_flags; /* netbios flags */ + + enum name_source source; /* where the name came from */ + + time_t death_time; /* time record must be removed (do not remove if 0) */ + time_t refresh_time; /* time record should be refreshed */ }; /* browse and backup server cache for synchronising browse list */ @@ -144,13 +154,63 @@ struct work_record uint32 ElectionCriterion; }; -/* a subnet structure. it contains a list of workgroups */ +/* initiated name queries recorded in this list to track any responses... */ +struct response_record +{ + struct response_record *next; + struct response_record *prev; + + uint16 response_id; + enum cmd_type cmd_type; + + int fd; + int quest_type; + struct nmb_name name; + int nb_flags; + time_t ttl; + + BOOL bcast; + BOOL recurse; + struct in_addr to_ip; + + int num_msgs; + + time_t repeat_time; + time_t repeat_interval; + int repeat_count; +}; + +/* a subnet structure. it contains a list of workgroups and netbios names*/ + +/* note that a subnet of 255.255.255.255 contains all the WINS netbios names. + all communication from such nodes are on a non-broadcast basis: they + are point-to-point (P nodes) or mixed point-to-point and broadcast + (M nodes). M nodes use point-to-point as a preference, and will use + broadcasting for certain activities, or will resort to broadcasting as a + last resort, if the WINS server fails (users of wfwg will notice that their + machine often freezes for 30 seconds at a time intermittently, if the WINS + server is down). + + B nodes will have their own, totally separate subnet record, with their + own netbios name set. these do NOT interact with other subnet records' + netbios names, INCLUDING the WINS one (with an ip "address", so called, + of 255.255.255.255) + + there is a separate response list for each subnet record. in the case of + the 255.255.255.255 subnet record (WINS), the WINS server will be able to + use this to poll (infrequently!) each of its entries, to ensure that the + names are still in use. + XXXX this polling is a planned feature for a really over-cautious WINS server +*/ + struct subnet_record { struct subnet_record *next; struct subnet_record *prev; - struct work_record *workgrouplist; + struct work_record *workgrouplist; /* list of workgroups */ + struct name_record *namelist; /* list of netbios names */ + struct response_record *responselist; /* list of responses expected */ struct in_addr bcast_ip; struct in_addr mask_ip; @@ -202,25 +262,6 @@ struct nmb_packet }; -/* initiated name queries recorded in this list to track any responses... */ -struct name_response_record -{ - struct name_response_record *next; - struct name_response_record *prev; - - uint16 response_id; - enum cmd_type cmd_type; - - int fd; - struct nmb_name name; - BOOL bcast; - BOOL recurse; - struct in_addr to_ip; - - time_t start_time; - int num_msgs; -}; - /* a datagram - this normally contains SMB data in the data[] array */ struct dgram_packet { struct { diff --git a/source3/include/proto.h b/source3/include/proto.h index e69de29bb2..ce02be129f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -0,0 +1,659 @@ +/* This file is automatically generated with "make proto". DO NOT EDIT */ +BOOL check_access(int snum); +BOOL allow_access(char *deny_list,char *allow_list,struct from_host *client); +BOOL fromhost(int sock,struct from_host *f); +char *unix2dos_format(char *str,BOOL overwrite); +char *dos2unix_format(char *str, BOOL overwrite); +int interpret_character_set(char *str, int def); +void charset_initialise(void); +void add_char_string(char *s); +BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence); +BOOL chgpasswd(char *name,char *oldpass,char *newpass); +BOOL chgpasswd(char *name,char *oldpass,char *newpass); +void setup_pkt(char *outbuf); +void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(),BOOL recurse_dir); +void cmd_help(void); +BOOL reopen_connection(char *inbuf,char *outbuf); +char *smb_errstr(char *inbuf); +void cli_setup_pkt(char *outbuf); +BOOL cli_receive_trans_response(char *inbuf,int trans,int *data_len, + int *param_len, char **data,char **param); +BOOL cli_send_session_request(char *inbuf, char *outbuf); +BOOL cli_send_login(char *inbuf, char *outbuf, BOOL start_session, BOOL use_setup); +void cli_send_logout(void); +BOOL cli_call_api(int prcnt,int drcnt,int mprcnt,int mdrcnt,int *rprcnt, + int *rdrcnt, char *param,char *data, char **rparam,char **rdata); +BOOL cli_send_trans_request(char *outbuf, int trans, char *name, int fid, int flags, + char *data,char *param,uint16 *setup, int ldata,int lparam, + int lsetup,int mdata,int mparam,int msetup); +BOOL cli_open_sockets(int port); +BOOL cli_reopen_connection(char *inbuf,char *outbuf); +char *smb_errstr(char *inbuf); +int strslashcmp(const char *s1, const char *s2); +void cmd_block(void); +void cmd_tarmode(void); +void cmd_setmode(void); +void cmd_tar(char *inbuf, char *outbuf); +int process_tar(char *inbuf, char *outbuf); +int clipfind(char **aret, int ret, char *tok); +int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind); +void init_dptrs(void); +char *dptr_path(int key); +char *dptr_wcard(int key); +BOOL dptr_set_wcard(int key, char *wcard); +BOOL dptr_set_attr(int key, uint16 attr); +uint16 dptr_attr(int key); +void dptr_close(int key); +void dptr_closecnum(int cnum); +void dptr_idlecnum(int cnum); +void dptr_closepath(char *path,int pid); +int dptr_create(int cnum,char *path, BOOL expect_close,int pid); +BOOL dptr_fill(char *buf1,unsigned int key); +BOOL dptr_zero(char *buf); +void *dptr_fetch(char *buf,int *num); +void *dptr_fetch_lanman2(char *params,int dptr_num); +BOOL dir_check_ftype(int cnum,int mode,struct stat *st,int dirtype); +BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend); +void *OpenDir(char *name); +void CloseDir(void *p); +char *ReadDirName(void *p); +BOOL SeekDir(void *p,int pos); +int TellDir(void *p); +void DirCacheAdd(char *path,char *name,char *dname,int snum); +char *DirCacheCheck(char *path,char *name,int snum); +void DirCacheFlush(int snum); +void fault_setup(void (*fn)()); +char *getsmbpass(char *prompt) ; +void load_interfaces(void); +void add_subnet_interfaces(void); +void iface_set_default(char *ip,char *bcast,char *nmask); +BOOL ismyip(struct in_addr ip); +BOOL ismybcast(struct in_addr bcast); +int iface_count(void); +struct in_addr *iface_n_ip(int n); +struct in_addr *iface_bcast(struct in_addr ip); +struct in_addr *iface_nmask(struct in_addr ip); +struct in_addr *iface_ip(struct in_addr ip); +int reply_trans(char *inbuf,char *outbuf); +int interpret_coding_system(char *str, int def); +char *lp_string(char *s); +char *lp_logfile(void); +char *lp_smbrun(void); +char *lp_configfile(void); +char *lp_smb_passwd_file(void); +char *lp_serverstring(void); +char *lp_printcapname(void); +char *lp_lockdir(void); +char *lp_rootdir(void); +char *lp_defaultservice(void); +char *lp_msg_command(void); +char *lp_dfree_command(void); +char *lp_hosts_equiv(void); +char *lp_auto_services(void); +char *lp_passwd_program(void); +char *lp_passwd_chat(void); +char *lp_passwordserver(void); +char *lp_workgroup(void); +char *lp_domain_controller(void); +char *lp_username_map(void); +char *lp_character_set(void); +char *lp_logon_script(void); +char *lp_wins_server(void); +char *lp_interfaces(void); +char *lp_remote_interfaces(void); +BOOL lp_wins_support(void); +BOOL lp_wins_proxy(void); +BOOL lp_domain_master(void); +BOOL lp_domain_logons(void); +BOOL lp_preferred_master(void); +BOOL lp_load_printers(void); +BOOL lp_use_rhosts(void); +BOOL lp_getwdcache(void); +BOOL lp_readprediction(void); +BOOL lp_readbmpx(void); +BOOL lp_readraw(void); +BOOL lp_writeraw(void); +BOOL lp_null_passwords(void); +BOOL lp_strip_dot(void); +BOOL lp_encrypted_passwords(void); +BOOL lp_syslog_only(void); +BOOL lp_browse_list(void); +int lp_os_level(void); +int lp_max_ttl(void); +int lp_max_log_size(void); +int lp_mangledstack(void); +int lp_maxxmit(void); +int lp_maxmux(void); +int lp_maxpacket(void); +int lp_keepalive(void); +int lp_passwordlevel(void); +int lp_readsize(void); +int lp_deadtime(void); +int lp_maxprotocol(void); +int lp_security(void); +int lp_printing(void); +int lp_maxdisksize(void); +int lp_lpqcachetime(void); +int lp_syslog(void); +char *lp_preexec(int ); +char *lp_postexec(int ); +char *lp_rootpreexec(int ); +char *lp_rootpostexec(int ); +char *lp_servicename(int ); +char *lp_pathname(int ); +char *lp_dontdescend(int ); +char *lp_username(int ); +char *lp_guestaccount(int ); +char *lp_invalid_users(int ); +char *lp_valid_users(int ); +char *lp_admin_users(int ); +char *lp_printcommand(int ); +char *lp_lpqcommand(int ); +char *lp_lprmcommand(int ); +char *lp_lppausecommand(int ); +char *lp_lpresumecommand(int ); +char *lp_printername(int ); +char *lp_hostsallow(int ); +char *lp_hostsdeny(int ); +char *lp_magicscript(int ); +char *lp_magicoutput(int ); +char *lp_comment(int ); +char *lp_force_user(int ); +char *lp_force_group(int ); +char *lp_readlist(int ); +char *lp_writelist(int ); +char *lp_volume(int ); +char *lp_mangled_map(int ); +BOOL lp_alternate_permissions(int ); +BOOL lp_revalidate(int ); +BOOL lp_casesensitive(int ); +BOOL lp_preservecase(int ); +BOOL lp_shortpreservecase(int ); +BOOL lp_casemangle(int ); +BOOL lp_status(int ); +BOOL lp_hide_dot_files(int ); +BOOL lp_browseable(int ); +BOOL lp_readonly(int ); +BOOL lp_no_set_dir(int ); +BOOL lp_guest_ok(int ); +BOOL lp_guest_only(int ); +BOOL lp_print_ok(int ); +BOOL lp_postscript(int ); +BOOL lp_map_hidden(int ); +BOOL lp_map_archive(int ); +BOOL lp_locking(int ); +BOOL lp_strict_locking(int ); +BOOL lp_share_modes(int ); +BOOL lp_onlyuser(int ); +BOOL lp_manglednames(int ); +BOOL lp_widelinks(int ); +BOOL lp_syncalways(int ); +BOOL lp_map_system(int ); +BOOL lp_delete_readonly(int ); +int lp_create_mode(int ); +int lp_max_connections(int ); +int lp_defaultcase(int ); +int lp_minprintspace(int ); +char lp_magicchar(int ); +BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir); +int lp_add_service(char *pszService, int iDefaultService); +BOOL lp_add_printer(char *pszPrintername, int iDefaultService); +BOOL lp_file_list_changed(void); +BOOL lp_snum_ok(int iService); +BOOL lp_loaded(void); +void lp_killunused(BOOL (*snumused)(int )); +BOOL lp_load(char *pszFname,BOOL global_only); +int lp_numservices(void); +void lp_dump(void); +int lp_servicenumber(char *pszServiceName); +char *my_workgroup(void); +char *volume_label(int snum); +BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); +int file_lock(char *name,int timeout); +void file_unlock(int fd); +BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset); +BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); +BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); +int get_share_mode_by_fnum(int cnum,int fnum,int *pid); +int get_share_mode_byname(int cnum,char *fname,int *pid); +int get_share_mode(int cnum,struct stat *sbuf,int *pid); +void del_share_mode(int fnum); +BOOL set_share_mode(int fnum,int mode); +void clean_share_files(void); +int str_checksum(char *s); +BOOL is_8_3(char *fname); +void create_mangled_stack(int size); +BOOL check_mangled_stack(char *s); +BOOL is_mangled(char *s); +void mangle_name_83(char *s); +BOOL name_map_mangle(char *OutName,BOOL need83,int snum); +int reply_sends(char *inbuf,char *outbuf); +int reply_sendstrt(char *inbuf,char *outbuf); +int reply_sendtxt(char *inbuf,char *outbuf); +int reply_sendend(char *inbuf,char *outbuf); +void announce_request(struct work_record *work, struct in_addr ip); +void do_announce_request(char *info, char *to_name, int announce_type, + int from, + int to, struct in_addr dest_ip); +void announce_backup(void); +void announce_host(void); +void announce_master(void); +struct work_record *remove_workgroup(struct subnet_record *d, + struct work_record *work); +void expire_browse_cache(time_t t); +struct work_record *find_workgroupstruct(struct subnet_record *d, + fstring name, BOOL add); +struct subnet_record *find_subnet(struct in_addr source_ip); +void dump_workgroups(void); +struct subnet_record *add_subnet_entry(struct in_addr source_ip, + struct in_addr source_mask, + char *name, BOOL add, BOOL lmhosts); +struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, + time_t ttl, struct in_addr ip); +void remove_server(struct work_record *work, char *name); +struct server_record *add_server_entry(struct subnet_record *d, + struct work_record *work, + char *name,int servertype, + int ttl,char *comment, + BOOL replace); +void write_browse_list(void); +void expire_servers(time_t t); +void query_refresh_names(void); +void check_master_browser(void); +void browser_gone(char *work_name, struct in_addr ip); +void send_election(struct subnet_record *d, char *group,uint32 criterion, + int timeup,char *name); +void become_nonmaster(struct subnet_record *d, struct work_record *work, + int remove_type); +void run_elections(void); +void process_election(struct packet_struct *p,char *buf); +BOOL check_elections(void); +BOOL name_status(int fd,char *name,int name_type,BOOL recurse, + struct in_addr to_ip,char *master,char *rname, + void (*fn)()); +BOOL name_query(int fd,char *name,int name_type, + BOOL bcast,BOOL recurse, + struct in_addr to_ip, struct in_addr *ip,void (*fn)()); +void expire_netbios_response_entries(void); +void reply_netbios_packet(struct packet_struct *p1,int trn_id, + int rcode,int opcode,BOOL recurse, + struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, + char *data,int len); +void queue_netbios_pkt_wins(struct subnet_record *d, + int fd,int quest_type,enum cmd_type cmd, + char *name,int name_type, int nb_flags, time_t ttl, + BOOL bcast,BOOL recurse,struct in_addr to_ip); +void queue_netbios_packet(struct subnet_record *d, + int fd,int quest_type,enum cmd_type cmd,char *name, + int name_type,int nb_flags,time_t ttl, + BOOL bcast,BOOL recurse, struct in_addr to_ip); +struct response_record *find_response_record(struct subnet_record *d, + uint16 id); +void queue_packet(struct packet_struct *packet); +void run_packet_queue(); +void listen_for_packets(BOOL run_election); +BOOL interpret_node_status(struct subnet_record *d, + char *p, struct nmb_name *name,int t, + char *serv_name, struct in_addr ip, BOOL bcast); +BOOL send_mailslot_reply(char *mailslot,int fd,char *buf,int len,char *srcname, + char *dstname,int src_type,int dest_type, + struct in_addr dest_ip,struct in_addr src_ip); +void remove_name(struct subnet_record *d, struct name_record *n); +void dump_names(void); +void remove_netbios_name(struct subnet_record *d, char *name,int type, + enum name_source source, + struct in_addr ip); +struct name_record *add_netbios_entry(struct subnet_record *d, char *name, + int type, int nb_flags, int ttl, + enum name_source source, + struct in_addr ip, + BOOL new_only, BOOL wins); +void remove_name_entry(struct subnet_record *d, char *name,int type); +void add_my_name_entry(struct subnet_record *d, char *name,int type,int nb_flags); +void do_announce_host(int command, + char *from, int from_type, struct in_addr from_ip, + char *to , int to_type , struct in_addr to_ip, + int update_count, time_t announce_interval, + char *server_name, int server_type, char *server_comment); +void load_netbios_names(void); +void add_my_names(void); +void remove_my_names(void); +void remove_my_servers(void); +void announce_server(struct subnet_record *d, struct work_record *work, + char *name, char *comment, time_t ttl, int server_type); +void refresh_my_names(time_t t); +void expire_names(time_t t); +void response_name_release(struct subnet_record *d,struct packet_struct *p); +void reply_name_release(struct packet_struct *p); +void response_name_reg(struct subnet_record *d,struct packet_struct *p); +void reply_name_reg(struct packet_struct *p); +void reply_name_status(struct packet_struct *p); +void reply_name_query(struct packet_struct *p); +void process_nmb(struct packet_struct *p); +void reset_server(char *name, int state, struct in_addr ip); +void tell_become_backup(void); +void do_browser_lists(void); +void sync_server(enum cmd_type cmd, char *serv_name, char *work_name, + int name_type, + struct in_addr ip); +void add_my_subnets(char *group); +BOOL same_context(struct dgram_packet *dgram); +BOOL listening_name(struct work_record *work, struct nmb_name *n); +void process_logon_packet(struct packet_struct *p,char *buf,int len); +BOOL listening_type(struct packet_struct *p, int command); +void process_browse_packet(struct packet_struct *p,char *buf,int len); +void process_dgram(struct packet_struct *p); +BOOL reload_services(BOOL test); +void debug_nmb_packet(struct packet_struct *p); +char *namestr(struct nmb_name *n); +void free_nmb_packet(struct nmb_packet *nmb); +void free_packet(struct packet_struct *packet); +struct packet_struct *read_packet(int fd,enum packet_type packet_type); +void make_nmb_name(struct nmb_name *n,char *name,int type,char *this_scope); +BOOL send_packet(struct packet_struct *p); +struct packet_struct *receive_packet(int fd,enum packet_type type,int t); +int main(int argc,char *argv[]); +char *getsmbpass(char *pass); +void sync_browse_lists(struct subnet_record *d, struct work_record *work, + char *name, int nm_type, struct in_addr ip); +BOOL pm_process(char *pszFileName,BOOL (*sfunc)(char *),BOOL (*pfunc)(char *,char *)); +void generate_next_challenge(char *challenge); +BOOL set_challenge(char *challenge); +BOOL last_challenge(char *challenge); +int valid_uid(int uid); +user_struct *get_valid_user_struct(int uid); +void invalidate_uid(int uid); +char *validated_username(int vuid); +void register_uid(int uid,int gid, char *name,BOOL guest); +void add_session_user(char *user); +void dfs_unlogin(void); +BOOL password_check(char *password); +BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8); +BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd, BOOL is_nt_password); +BOOL user_ok(char *user,int snum); +BOOL authorise_login(int snum,char *user,char *password, int pwlen, + BOOL *guest,BOOL *force,int vuid); +BOOL check_hosts_equiv(char *user); +BOOL server_cryptkey(char *buf); +BOOL server_validate(char *buf); +BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); +void pcap_printer_fn(void (*fn)()); +int read_predict(int fd,int offset,char *buf,char **ptr,int num); +void do_read_prediction(); +void invalidate_read_prediction(int fd); +void lpq_reset(int snum); +void print_file(int fnum); +int get_printqueue(int snum,int cnum,print_queue_struct **queue, + print_status_struct *status); +void del_printqueue(int cnum,int snum,int jobid); +void status_printjob(int cnum,int snum,int jobid,int status); +BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); +char *Strstr(char *s, char *p); +time_t Mktime(struct tm *t); +int InNetGr(char *group,char *host,char *user,char *dom); +void *malloc_wrapped(int size,char *file,int line); +void *realloc_wrapped(void *ptr,int size,char *file,int line); +void free_wrapped(void *ptr,char *file,int line); +void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line); +int reply_special(char *inbuf,char *outbuf); +int reply_tcon(char *inbuf,char *outbuf); +int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_unknown(char *inbuf,char *outbuf); +int reply_ioctl(char *inbuf,char *outbuf); +int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_chkpth(char *inbuf,char *outbuf); +int reply_getatr(char *inbuf,char *outbuf); +int reply_setatr(char *inbuf,char *outbuf); +int reply_dskattr(char *inbuf,char *outbuf); +int reply_search(char *inbuf,char *outbuf); +int reply_fclose(char *inbuf,char *outbuf); +int reply_open(char *inbuf,char *outbuf); +int reply_open_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_ulogoffX(char *inbuf,char *outbuf,int length,int bufsize); +int reply_mknew(char *inbuf,char *outbuf); +int reply_ctemp(char *inbuf,char *outbuf); +int reply_unlink(char *inbuf,char *outbuf); +int reply_readbraw(char *inbuf, char *outbuf); +int reply_lockread(char *inbuf,char *outbuf); +int reply_read(char *inbuf,char *outbuf); +int reply_read_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_writebraw(char *inbuf,char *outbuf); +int reply_writeunlock(char *inbuf,char *outbuf); +int reply_write(char *inbuf,char *outbuf,int dum1,int dum2); +int reply_write_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_lseek(char *inbuf,char *outbuf); +int reply_flush(char *inbuf,char *outbuf); +int reply_exit(char *inbuf,char *outbuf); +int reply_close(char *inbuf,char *outbuf); +int reply_writeclose(char *inbuf,char *outbuf); +int reply_lock(char *inbuf,char *outbuf); +int reply_unlock(char *inbuf,char *outbuf); +int reply_tdis(char *inbuf,char *outbuf); +int reply_echo(char *inbuf,char *outbuf); +int reply_printopen(char *inbuf,char *outbuf); +int reply_printclose(char *inbuf,char *outbuf); +int reply_printqueue(char *inbuf,char *outbuf); +int reply_printwrite(char *inbuf,char *outbuf); +int reply_mkdir(char *inbuf,char *outbuf); +int reply_rmdir(char *inbuf,char *outbuf); +int reply_mv(char *inbuf,char *outbuf); +int reply_copy(char *inbuf,char *outbuf); +int reply_setdir(char *inbuf,char *outbuf); +int reply_lockingX(char *inbuf,char *outbuf,int length,int bufsize); +int reply_readbmpx(char *inbuf,char *outbuf,int length,int bufsize); +int reply_writebmpx(char *inbuf,char *outbuf); +int reply_writebs(char *inbuf,char *outbuf); +int reply_setattrE(char *inbuf,char *outbuf); +int reply_getattrE(char *inbuf,char *outbuf); +mode_t unix_mode(int cnum,int dosmode); +int dos_mode(int cnum,char *path,struct stat *sbuf); +int dos_chmod(int cnum,char *fname,int dosmode,struct stat *st); +BOOL unix_convert(char *name,int cnum); +int disk_free(char *path,int *bsize,int *dfree,int *dsize); +int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); +BOOL check_name(char *name,int cnum); +void open_file(int fnum,int cnum,char *fname1,int flags,int mode); +void sync_file(int fnum); +void close_file(int fnum); +BOOL check_file_sharing(int cnum,char *fname); +void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun, + int mode,int *Access,int *action); +int seek_file(int fnum,int pos); +int read_file(int fnum,char *data,int pos,int mincnt,int maxcnt,int timeout,BOOL exact); +int write_file(int fnum,char *data,int n); +BOOL become_service(int cnum,BOOL do_chdir); +int find_service(char *service); +int cached_error_packet(char *inbuf,char *outbuf,int fnum,int line); +int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line); +int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int line); +BOOL snum_used(int snum); +BOOL reload_services(BOOL test); +int setup_groups(char *user, int uid, int gid, int *p_ngroups, + int **p_igroups, gid_t **p_groups); +int make_connection(char *service,char *user,char *password, int pwlen, char *dev,int vuid); +int find_free_file(void ); +int reply_corep(char *outbuf); +int reply_coreplus(char *outbuf); +int reply_lanman1(char *outbuf); +int reply_lanman2(char *outbuf); +int reply_nt1(char *outbuf); +void parse_connect(char *buf,char *service,char *user,char *password,int *pwlen,char *dev); +void close_cnum(int cnum, int uid); +BOOL yield_connection(int cnum,char *name,int max_connections); +BOOL claim_connection(int cnum,char *name,int max_connections,BOOL Clear); +void exit_server(char *reason); +void standard_sub(int cnum,char *s); +char *smb_fn_name(int type); +int chain_reply(int type,char *inbuf,char *inbuf2,char *outbuf,char *outbuf2,int size,int bufsize); +int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); +void str_to_key(uchar *str,uchar *key); +void D1(uchar *k, uchar *d, uchar *out); +void E1(uchar *k, uchar *d, uchar *out); +void E_P16(uchar *p14,uchar *p16); +void E_P24(uchar *p21, uchar *c8, uchar *p24); +void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); +void E_md4hash(uchar *passwd, uchar *p16); +void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); +void Ucrit_addUsername(pstring username); +unsigned int Ucrit_checkUsername(pstring username); +void Ucrit_addPid(int pid); +unsigned int Ucrit_checkPid(int pid); +int sys_select(fd_set *fds,struct timeval *tval); +int sys_select(fd_set *fds,struct timeval *tval); +int sys_unlink(char *fname); +int sys_open(char *fname,int flags,int mode); +DIR *sys_opendir(char *dname); +int sys_stat(char *fname,struct stat *sbuf); +int sys_lstat(char *fname,struct stat *sbuf); +int sys_mkdir(char *dname,int mode); +int sys_rmdir(char *dname); +int sys_chdir(char *dname); +int sys_utime(char *fname,struct utimbuf *times); +int sys_rename(char *from, char *to); +int sys_chown(char *fname,int uid,int gid); +int sys_chroot(char *dname); +int main(int argc, char *argv[]); +void GetTimeOfDay(struct timeval *tval); +void TimeInit(void); +int TimeDiff(time_t t); +struct tm *LocalTime(time_t *t); +time_t interpret_long_date(char *p); +void put_long_date(char *p,time_t t); +void put_dos_date(char *buf,int offset,time_t unixdate); +void put_dos_date2(char *buf,int offset,time_t unixdate); +void put_dos_date3(char *buf,int offset,time_t unixdate); +time_t make_unix_date(void *date_ptr); +time_t make_unix_date2(void *date_ptr); +time_t make_unix_date3(void *date_ptr); +BOOL set_filetime(char *fname,time_t mtime); +char *timestring(void ); +int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize); +int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize); +int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize); +int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize); +char *ufc_crypt(char *key,char *salt); +void init_uid(void); +BOOL become_guest(void); +BOOL become_user(int cnum, int uid); +BOOL unbecome_user(void ); +int smbrun(char *cmd,char *outfile); +char *get_home_dir(char *user); +void map_username(char *user); +struct passwd *Get_Pwnam(char *user,BOOL allow_change); +BOOL user_in_list(char *user,char *list); +void setup_logging(char *pname,BOOL interactive); +void reopen_logs(void); +BOOL is_a_socket(int fd); +BOOL next_token(char **ptr,char *buff,char *sep); +char **toktocliplist(int *ctok, char *sep); +void *MemMove(void *dest,void *src,int size); +void array_promote(char *array,int elsize,int element); +void set_socket_options(int fd, char *options); +void close_sockets(void ); +BOOL in_group(gid_t group, int current_gid, int ngroups, int *groups); +char *StrCpy(char *dest,char *src); +char *StrnCpy(char *dest,const char *src,int n); +void putip(void *dest,void *src); +int name_mangle(char *In,char *Out,char name_type); +BOOL file_exist(char *fname,struct stat *sbuf); +time_t file_modtime(char *fname); +BOOL directory_exist(char *dname,struct stat *st); +uint32 file_size(char *file_name); +char *attrib_string(int mode); +int StrCaseCmp(char *s, char *t); +int StrnCaseCmp(char *s, char *t, int n); +BOOL strequal(char *s1,char *s2); +BOOL strnequal(char *s1,char *s2,int n); +BOOL strcsequal(char *s1,char *s2); +void strlower(char *s); +void strupper(char *s); +void strnorm(char *s); +BOOL strisnormal(char *s); +void string_replace(char *s,char oldc,char newc); +void unix_format(char *fname); +void dos_format(char *fname); +void show_msg(char *buf); +int smb_len(char *buf); +void _smb_setlen(char *buf,int len); +void smb_setlen(char *buf,int len); +int set_message(char *buf,int num_words,int num_bytes,BOOL zero); +int smb_numwords(char *buf); +int smb_buflen(char *buf); +int smb_buf_ofs(char *buf); +char *smb_buf(char *buf); +int smb_offset(char *p,char *buf); +char *skip_string(char *buf,int n); +BOOL trim_string(char *s,char *front,char *back); +void dos_clean_name(char *s); +void unix_clean_name(char *s); +int ChDir(char *path); +char *GetWd(char *str); +BOOL reduce_name(char *s,char *dir,BOOL widelinks); +void expand_mask(char *Mask,BOOL doext); +BOOL strhasupper(char *s); +BOOL strhaslower(char *s); +int count_chars(char *s,char c); +void make_dir_struct(char *buf,char *mask,char *fname,unsigned int size,int mode,time_t date); +void close_low_fds(void); +int write_socket(int fd,char *buf,int len); +int read_udp_socket(int fd,char *buf,int len); +int set_blocking(int fd, BOOL set); +int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out,BOOL exact); +int read_max_udp(int fd,char *buffer,int bufsize,int maxtime); +int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew); +BOOL send_keepalive(int client); +int read_data(int fd,char *buffer,int N); +int write_data(int fd,char *buffer,int N); +int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align); +int read_smb_length(int fd,char *inbuf,int timeout); +BOOL receive_smb(int fd,char *buffer,int timeout); +BOOL send_smb(int fd,char *buffer); +char *name_ptr(char *buf,int ofs); +int name_extract(char *buf,int ofs,char *name); +int name_len(char *s); +BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type); +void msleep(int t); +BOOL in_list(char *s,char *list,BOOL casesensitive); +BOOL string_init(char **dest,char *src); +void string_free(char **s); +BOOL string_set(char **dest,char *src); +BOOL string_sub(char *s,char *pattern,char *insert); +BOOL do_match(char *str, char *regexp, int case_sig); +BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2); +void become_daemon(void); +BOOL yesno(char *p); +char *fgets_slash(char *s2,int maxlen,FILE *f); +int set_filelen(int fd, long len); +int byte_checksum(char *buf,int len); +char *dirname_dos(char *path,char *buf); +void *Realloc(void *p,int size); +void Abort(void ); +BOOL get_myname(char *myname,struct in_addr *ip); +BOOL ip_equal(struct in_addr ip1,struct in_addr ip2); +int open_socket_in(int type, int port, int dlevel); +int open_socket_out(int type, struct in_addr *addr, int port ); +int interpret_protocol(char *str,int def); +int interpret_security(char *str,int def); +unsigned long interpret_addr(char *str); +struct in_addr *interpret_addr2(char *str); +BOOL zero_ip(struct in_addr ip); +void standard_sub_basic(char *s); +BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask); +int PutUniCode(char *dst,char *src); +struct hostent *Get_Hostbyname(char *name); +BOOL process_exists(int pid); +char *uidtoname(int uid); +char *gidtoname(int gid); +void BlockSignals(BOOL block); +void ajt_panic(void); +char *readdirname(void *p); +int VT_Check(char *buffer); +int VT_Start_utmp(void); +int VT_Stop_utmp(void); +void VT_AtExit(void); +void VT_SigCLD(int sig); +void VT_SigEXIT(int sig); +int VT_Start(void); +int VT_Output(char *Buffer); +int VT_Input(char *Buffer,int Size); +void VT_Process(void); diff --git a/source3/include/smb.h b/source3/include/smb.h index b9dd13a802..0e9c9983d2 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -381,6 +381,15 @@ struct server_info_struct }; +/* used for network interfaces */ +struct interface +{ + struct interface *next; + struct in_addr ip; + struct in_addr bcast; + struct in_addr nmask; +}; + /* this is used for smbstatus */ struct connect_record { -- cgit From 7a804a2e838846715f036e5e93630a4436a4ec4b Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Mon, 1 Jul 1996 18:29:21 +0000 Subject: updated the NetBIOS code due to some bugs found by writing the first draft of the low level design docs. (This used to be commit 103012e5f2fac09598d60c4263c3a30992680729) --- source3/include/proto.h | 238 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 201 insertions(+), 37 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index ce02be129f..8dc3df0183 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1,20 +1,39 @@ /* This file is automatically generated with "make proto". DO NOT EDIT */ + + +/*The following definitions come from access.c */ + BOOL check_access(int snum); BOOL allow_access(char *deny_list,char *allow_list,struct from_host *client); BOOL fromhost(int sock,struct from_host *f); + +/*The following definitions come from charcnv.c */ + char *unix2dos_format(char *str,BOOL overwrite); char *dos2unix_format(char *str, BOOL overwrite); int interpret_character_set(char *str, int def); + +/*The following definitions come from charset.c */ + void charset_initialise(void); void add_char_string(char *s); + +/*The following definitions come from chgpasswd.c */ + BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence); BOOL chgpasswd(char *name,char *oldpass,char *newpass); BOOL chgpasswd(char *name,char *oldpass,char *newpass); + +/*The following definitions come from client.c */ + void setup_pkt(char *outbuf); void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(),BOOL recurse_dir); void cmd_help(void); BOOL reopen_connection(char *inbuf,char *outbuf); char *smb_errstr(char *inbuf); + +/*The following definitions come from clientutil.c */ + void cli_setup_pkt(char *outbuf); BOOL cli_receive_trans_response(char *inbuf,int trans,int *data_len, int *param_len, char **data,char **param); @@ -29,6 +48,9 @@ BOOL cli_send_trans_request(char *outbuf, int trans, char *name, int fid, int fl BOOL cli_open_sockets(int port); BOOL cli_reopen_connection(char *inbuf,char *outbuf); char *smb_errstr(char *inbuf); + +/*The following definitions come from clitar.c */ + int strslashcmp(const char *s1, const char *s2); void cmd_block(void); void cmd_tarmode(void); @@ -37,6 +59,9 @@ void cmd_tar(char *inbuf, char *outbuf); int process_tar(char *inbuf, char *outbuf); int clipfind(char **aret, int ret, char *tok); int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind); + +/*The following definitions come from dir.c */ + void init_dptrs(void); char *dptr_path(int key); char *dptr_wcard(int key); @@ -62,10 +87,18 @@ int TellDir(void *p); void DirCacheAdd(char *path,char *name,char *dname,int snum); char *DirCacheCheck(char *path,char *name,int snum); void DirCacheFlush(int snum); + +/*The following definitions come from fault.c */ + void fault_setup(void (*fn)()); + +/*The following definitions come from getsmbpass.c */ + char *getsmbpass(char *prompt) ; + +/*The following definitions come from interface.c */ + void load_interfaces(void); -void add_subnet_interfaces(void); void iface_set_default(char *ip,char *bcast,char *nmask); BOOL ismyip(struct in_addr ip); BOOL ismybcast(struct in_addr bcast); @@ -74,8 +107,17 @@ struct in_addr *iface_n_ip(int n); struct in_addr *iface_bcast(struct in_addr ip); struct in_addr *iface_nmask(struct in_addr ip); struct in_addr *iface_ip(struct in_addr ip); + +/*The following definitions come from ipc.c */ + int reply_trans(char *inbuf,char *outbuf); + +/*The following definitions come from kanji.c */ + int interpret_coding_system(char *str, int def); + +/*The following definitions come from loadparm.c */ + char *lp_string(char *s); char *lp_logfile(void); char *lp_smbrun(void); @@ -208,6 +250,9 @@ void lp_dump(void); int lp_servicenumber(char *pszServiceName); char *my_workgroup(void); char *volume_label(int snum); + +/*The following definitions come from locking.c */ + BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); int file_lock(char *name,int timeout); void file_unlock(int fd); @@ -220,6 +265,9 @@ int get_share_mode(int cnum,struct stat *sbuf,int *pid); void del_share_mode(int fnum); BOOL set_share_mode(int fnum,int mode); void clean_share_files(void); + +/*The following definitions come from mangle.c */ + int str_checksum(char *s); BOOL is_8_3(char *fname); void create_mangled_stack(int size); @@ -227,30 +275,50 @@ BOOL check_mangled_stack(char *s); BOOL is_mangled(char *s); void mangle_name_83(char *s); BOOL name_map_mangle(char *OutName,BOOL need83,int snum); + +/*The following definitions come from md4.c */ + + +/*The following definitions come from message.c */ + int reply_sends(char *inbuf,char *outbuf); int reply_sendstrt(char *inbuf,char *outbuf); int reply_sendtxt(char *inbuf,char *outbuf); int reply_sendend(char *inbuf,char *outbuf); + +/*The following definitions come from nameannounce.c */ + void announce_request(struct work_record *work, struct in_addr ip); void do_announce_request(char *info, char *to_name, int announce_type, int from, int to, struct in_addr dest_ip); void announce_backup(void); +void do_announce_host(int command, + char *from_name, int from_type, struct in_addr from_ip, + char *to_name , int to_type , struct in_addr to_ip, + int updatecount, time_t announce_interval, + char *server_name, int server_type, char *server_comment); +void announce_server(struct subnet_record *d, struct work_record *work, + char *name, char *comment, time_t ttl, int server_type); void announce_host(void); void announce_master(void); + +/*The following definitions come from namedb.c */ + struct work_record *remove_workgroup(struct subnet_record *d, struct work_record *work); void expire_browse_cache(time_t t); struct work_record *find_workgroupstruct(struct subnet_record *d, fstring name, BOOL add); -struct subnet_record *find_subnet(struct in_addr source_ip); +struct subnet_record *find_subnet(struct in_addr bcast_ip); void dump_workgroups(void); -struct subnet_record *add_subnet_entry(struct in_addr source_ip, - struct in_addr source_mask, +void add_subnet_interfaces(void); +struct subnet_record *add_subnet_entry(struct in_addr bcast_ip, + struct in_addr mask_ip, char *name, BOOL add, BOOL lmhosts); struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, time_t ttl, struct in_addr ip); -void remove_server(struct work_record *work, char *name); +void remove_my_servers(void); struct server_record *add_server_entry(struct subnet_record *d, struct work_record *work, char *name,int servertype, @@ -258,36 +326,44 @@ struct server_record *add_server_entry(struct subnet_record *d, BOOL replace); void write_browse_list(void); void expire_servers(time_t t); -void query_refresh_names(void); + +/*The following definitions come from nameelect.c */ + void check_master_browser(void); void browser_gone(char *work_name, struct in_addr ip); void send_election(struct subnet_record *d, char *group,uint32 criterion, int timeup,char *name); void become_nonmaster(struct subnet_record *d, struct work_record *work, - int remove_type); + int remove_type); void run_elections(void); void process_election(struct packet_struct *p,char *buf); BOOL check_elections(void); + +/*The following definitions come from namequery.c */ + BOOL name_status(int fd,char *name,int name_type,BOOL recurse, struct in_addr to_ip,char *master,char *rname, void (*fn)()); BOOL name_query(int fd,char *name,int name_type, BOOL bcast,BOOL recurse, struct in_addr to_ip, struct in_addr *ip,void (*fn)()); -void expire_netbios_response_entries(void); + +/*The following definitions come from nameresp.c */ + +void expire_netbios_response_entries(); void reply_netbios_packet(struct packet_struct *p1,int trn_id, - int rcode,int opcode,BOOL recurse, - struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, - char *data,int len); + int rcode,int opcode, BOOL recurse, + struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, + char *data,int len); void queue_netbios_pkt_wins(struct subnet_record *d, int fd,int quest_type,enum cmd_type cmd, - char *name,int name_type, int nb_flags, time_t ttl, + char *name,int name_type,int nb_flags, time_t ttl, BOOL bcast,BOOL recurse,struct in_addr to_ip); void queue_netbios_packet(struct subnet_record *d, - int fd,int quest_type,enum cmd_type cmd,char *name, - int name_type,int nb_flags,time_t ttl, - BOOL bcast,BOOL recurse, struct in_addr to_ip); -struct response_record *find_response_record(struct subnet_record *d, + int fd,int quest_type,enum cmd_type cmd,char *name, + int name_type,int nb_flags, time_t ttl, + BOOL bcast,BOOL recurse, struct in_addr to_ip); +struct response_record *find_response_record(struct subnet_record **d, uint16 id); void queue_packet(struct packet_struct *packet); void run_packet_queue(); @@ -298,38 +374,39 @@ BOOL interpret_node_status(struct subnet_record *d, BOOL send_mailslot_reply(char *mailslot,int fd,char *buf,int len,char *srcname, char *dstname,int src_type,int dest_type, struct in_addr dest_ip,struct in_addr src_ip); + +/*The following definitions come from nameserv.c */ + void remove_name(struct subnet_record *d, struct name_record *n); void dump_names(void); -void remove_netbios_name(struct subnet_record *d, char *name,int type, - enum name_source source, +void load_netbios_names(void); +void remove_netbios_name(struct subnet_record *d, + char *name,int type, enum name_source source, struct in_addr ip); -struct name_record *add_netbios_entry(struct subnet_record *d, char *name, - int type, int nb_flags, int ttl, - enum name_source source, - struct in_addr ip, - BOOL new_only, BOOL wins); +struct name_record *add_netbios_entry(struct subnet_record *d, + char *name, int type, int nb_flags, + int ttl, enum name_source source, struct in_addr ip, + BOOL new_only,BOOL wins); void remove_name_entry(struct subnet_record *d, char *name,int type); -void add_my_name_entry(struct subnet_record *d, char *name,int type,int nb_flags); -void do_announce_host(int command, - char *from, int from_type, struct in_addr from_ip, - char *to , int to_type , struct in_addr to_ip, - int update_count, time_t announce_interval, - char *server_name, int server_type, char *server_comment); -void load_netbios_names(void); +void add_my_name_entry(struct subnet_record *d,char *name,int type,int nb_flags); void add_my_names(void); -void remove_my_names(void); -void remove_my_servers(void); -void announce_server(struct subnet_record *d, struct work_record *work, - char *name, char *comment, time_t ttl, int server_type); +void remove_my_names(); void refresh_my_names(time_t t); +void query_refresh_names(void); void expire_names(time_t t); -void response_name_release(struct subnet_record *d,struct packet_struct *p); +void response_name_release(struct subnet_record *d, struct packet_struct *p); void reply_name_release(struct packet_struct *p); -void response_name_reg(struct subnet_record *d,struct packet_struct *p); +void response_name_reg(struct subnet_record *d, struct packet_struct *p); void reply_name_reg(struct packet_struct *p); void reply_name_status(struct packet_struct *p); +struct name_record *search_for_name(struct subnet_record **d, + struct nmb_name *question, + struct in_addr ip, int Time, int search); void reply_name_query(struct packet_struct *p); void process_nmb(struct packet_struct *p); + +/*The following definitions come from namework.c */ + void reset_server(char *name, int state, struct in_addr ip); void tell_become_backup(void); void do_browser_lists(void); @@ -343,7 +420,13 @@ void process_logon_packet(struct packet_struct *p,char *buf,int len); BOOL listening_type(struct packet_struct *p, int command); void process_browse_packet(struct packet_struct *p,char *buf,int len); void process_dgram(struct packet_struct *p); + +/*The following definitions come from nmbd.c */ + BOOL reload_services(BOOL test); + +/*The following definitions come from nmblib.c */ + void debug_nmb_packet(struct packet_struct *p); char *namestr(struct nmb_name *n); void free_nmb_packet(struct nmb_packet *nmb); @@ -352,11 +435,23 @@ struct packet_struct *read_packet(int fd,enum packet_type packet_type); void make_nmb_name(struct nmb_name *n,char *name,int type,char *this_scope); BOOL send_packet(struct packet_struct *p); struct packet_struct *receive_packet(int fd,enum packet_type type,int t); + +/*The following definitions come from nmblookup.c */ + int main(int argc,char *argv[]); + +/*The following definitions come from nmbsync.c */ + char *getsmbpass(char *pass); void sync_browse_lists(struct subnet_record *d, struct work_record *work, - char *name, int nm_type, struct in_addr ip); + char *name, int nm_type, struct in_addr ip); + +/*The following definitions come from params.c */ + BOOL pm_process(char *pszFileName,BOOL (*sfunc)(char *),BOOL (*pfunc)(char *,char *)); + +/*The following definitions come from password.c */ + void generate_next_challenge(char *challenge); BOOL set_challenge(char *challenge); BOOL last_challenge(char *challenge); @@ -376,18 +471,36 @@ BOOL authorise_login(int snum,char *user,char *password, int pwlen, BOOL check_hosts_equiv(char *user); BOOL server_cryptkey(char *buf); BOOL server_validate(char *buf); + +/*The following definitions come from pcap.c */ + BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); void pcap_printer_fn(void (*fn)()); + +/*The following definitions come from predict.c */ + int read_predict(int fd,int offset,char *buf,char **ptr,int num); void do_read_prediction(); void invalidate_read_prediction(int fd); + +/*The following definitions come from printing.c */ + void lpq_reset(int snum); void print_file(int fnum); int get_printqueue(int snum,int cnum,print_queue_struct **queue, print_status_struct *status); void del_printqueue(int cnum,int snum,int jobid); void status_printjob(int cnum,int snum,int jobid,int status); + +/*The following definitions come from quotas.c */ + +BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); +BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); +BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); + +/*The following definitions come from replace.c */ + char *Strstr(char *s, char *p); time_t Mktime(struct tm *t); int InNetGr(char *group,char *host,char *user,char *dom); @@ -395,6 +508,9 @@ void *malloc_wrapped(int size,char *file,int line); void *realloc_wrapped(void *ptr,int size,char *file,int line); void free_wrapped(void *ptr,char *file,int line); void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line); + +/*The following definitions come from reply.c */ + int reply_special(char *inbuf,char *outbuf); int reply_tcon(char *inbuf,char *outbuf); int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize); @@ -445,6 +561,9 @@ int reply_writebmpx(char *inbuf,char *outbuf); int reply_writebs(char *inbuf,char *outbuf); int reply_setattrE(char *inbuf,char *outbuf); int reply_getattrE(char *inbuf,char *outbuf); + +/*The following definitions come from server.c */ + mode_t unix_mode(int cnum,int dosmode); int dos_mode(int cnum,char *path,struct stat *sbuf); int dos_chmod(int cnum,char *fname,int dosmode,struct stat *st); @@ -486,6 +605,9 @@ void standard_sub(int cnum,char *s); char *smb_fn_name(int type); int chain_reply(int type,char *inbuf,char *inbuf2,char *outbuf,char *outbuf2,int size,int bufsize); int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); + +/*The following definitions come from smbencrypt.c */ + void str_to_key(uchar *str,uchar *key); void D1(uchar *k, uchar *d, uchar *out); void E1(uchar *k, uchar *d, uchar *out); @@ -494,10 +616,25 @@ void E_P24(uchar *p21, uchar *c8, uchar *p24); void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); void E_md4hash(uchar *passwd, uchar *p16); void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); + +/*The following definitions come from smbpass.c */ + + +/*The following definitions come from smbpasswd.c */ + + +/*The following definitions come from smbrun.c */ + + +/*The following definitions come from status.c */ + void Ucrit_addUsername(pstring username); unsigned int Ucrit_checkUsername(pstring username); void Ucrit_addPid(int pid); unsigned int Ucrit_checkPid(int pid); + +/*The following definitions come from system.c */ + int sys_select(fd_set *fds,struct timeval *tval); int sys_select(fd_set *fds,struct timeval *tval); int sys_unlink(char *fname); @@ -512,7 +649,16 @@ int sys_utime(char *fname,struct utimbuf *times); int sys_rename(char *from, char *to); int sys_chown(char *fname,int uid,int gid); int sys_chroot(char *dname); + +/*The following definitions come from testparm.c */ + + +/*The following definitions come from testprns.c */ + int main(int argc, char *argv[]); + +/*The following definitions come from time.c */ + void GetTimeOfDay(struct timeval *tval); void TimeInit(void); int TimeDiff(time_t t); @@ -527,20 +673,35 @@ time_t make_unix_date2(void *date_ptr); time_t make_unix_date3(void *date_ptr); BOOL set_filetime(char *fname,time_t mtime); char *timestring(void ); + +/*The following definitions come from trans2.c */ + int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize); int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize); int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize); int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize); + +/*The following definitions come from ufc.c */ + char *ufc_crypt(char *key,char *salt); + +/*The following definitions come from uid.c */ + void init_uid(void); BOOL become_guest(void); BOOL become_user(int cnum, int uid); BOOL unbecome_user(void ); int smbrun(char *cmd,char *outfile); + +/*The following definitions come from username.c */ + char *get_home_dir(char *user); void map_username(char *user); struct passwd *Get_Pwnam(char *user,BOOL allow_change); BOOL user_in_list(char *user,char *list); + +/*The following definitions come from util.c */ + void setup_logging(char *pname,BOOL interactive); void reopen_logs(void); BOOL is_a_socket(int fd); @@ -647,6 +808,9 @@ char *gidtoname(int gid); void BlockSignals(BOOL block); void ajt_panic(void); char *readdirname(void *p); + +/*The following definitions come from vt_mode.c */ + int VT_Check(char *buffer); int VT_Start_utmp(void); int VT_Stop_utmp(void); -- cgit From 7ca58ce114b4eafb2bb05d9e9699fe9effd8d9ec Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 2 Jul 1996 15:31:33 +0000 Subject: as a result of the writing of namework.doc, namework.c has been tidied up, some bugs fixed / documented and some discrepancies noted down (in namework.c as well as namework.doc) namebrowse.c and namelogon.c contain functions that were inappropriately placed in namework.c. namebrowse.c contains browse sync queue management functions that were inappropriately placed in namedb.c the 'cmd_type' member of response_record has been renamed to 'state' because that more accurately reflects it purpose (not entirely. sigh). fixed a bug in nameserv.c that meant the previous version wouldn't compile. there's probably a bit more... lkcl (This used to be commit a66417ebe871a1c1366c395ea4c7099852975e65) --- source3/include/nameserv.h | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 03bb521558..9e4145213b 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -24,7 +24,7 @@ #define MAINTAIN_LIST 2 #define ELECTION_VERSION 1 -#define MAX_DGRAM_SIZE (80*18+64) +#define MAX_DGRAM_SIZE (576) /* tcp/ip datagram limit is 576 bytes */ #define MIN_DGRAM_SIZE 12 #define NMB_QUERY 0x20 @@ -36,6 +36,7 @@ #define NMB_WAIT_ACK 0x07 /* see rfc1002.txt 4.2.17 */ /* XXXX what about all the other types?? 0x1, 0x2, 0x3, 0x4, 0x8? */ +/* NetBIOS flags */ #define NB_GROUP 0x80 #define NB_PERM 0x02 #define NB_ACTIVE 0x04 @@ -51,6 +52,7 @@ #define NAME_POLL_REFRESH_TIME (5*60) #define NAME_POLL_INTERVAL 15 +/* NetBIOS flag identifier */ #define NAME_PERMANENT(p) ((p) & NB_PERM) #define NAME_ACTIVE(p) ((p) & NB_ACTIVE) #define NAME_CONFLICT(p) ((p) & NB_CONFL) @@ -62,12 +64,22 @@ #define NAME_MFLAG(p) (((p) & NB_FLGMSK) == NB_MFLAG) #define NAME__FLAG(p) (((p) & NB_FLGMSK) == NB__FLAG) +/* server type identifiers */ +#define AM_MASTER(work) (work->ServerType & SV_TYPE_MASTER_BROWSER) +#define AM_BACKUP(work) (work->ServerType & SV_TYPE_BACKUP_BROWSER) +#define AM_DOMCTL(work) (work->ServerType & SV_TYPE_DOMAIN_CTRL) + +/* microsoft browser NetBIOS name */ #define MSBROWSE "\001\002__MSBROWSE__\002" +/* mail slots */ +#define BROWSE_MAILSLOT "\\MAILSLOT\\BROWSE" +#define NET_LOGON_MAILSLOT "\\MAILSLOT\\NET\\NETLOGON" + enum name_source {STATUS_QUERY, LMHOSTS, REGISTER, SELF, DNS, DNSFAIL}; enum node_type {B_NODE=0, P_NODE=1, M_NODE=2, NBDD_NODE=3}; enum packet_type {NMB_PACKET, DGRAM_PACKET}; -enum cmd_type +enum state_type { NAME_STATUS_MASTER_CHECK, NAME_STATUS_CHECK, @@ -161,7 +173,7 @@ struct response_record struct response_record *prev; uint16 response_id; - enum cmd_type cmd_type; + enum state_type state; int fd; int quest_type; @@ -301,11 +313,6 @@ struct packet_struct }; -#define AM_MASTER(work) (work->ServerType & SV_TYPE_MASTER_BROWSER) -#define AM_BACKUP(work) (work->ServerType & SV_TYPE_BACKUP_BROWSER) -#define AM_DOMCTL(work) (work->ServerType & SV_TYPE_DOMAIN_CTRL) - - /* ids for netbios packet types */ #define ANN_HostAnnouncement 1 #define ANN_AnnouncementRequest 2 -- cgit From a7f497c6d6360d05bc557d1512ac312846a70cc4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 3 Jul 1996 02:39:49 +0000 Subject: fix Makefile - remove Lukes private stuff :-) rerun proto generator (This used to be commit 98568862ca5f9f48b389a42633732de831331189) --- source3/include/proto.h | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 8dc3df0183..87df5e3fd4 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -292,6 +292,9 @@ void announce_request(struct work_record *work, struct in_addr ip); void do_announce_request(char *info, char *to_name, int announce_type, int from, int to, struct in_addr dest_ip); +void sync_server(enum state_type state, char *serv_name, char *work_name, + int name_type, + struct in_addr ip); void announce_backup(void); void do_announce_host(int command, char *from_name, int from_type, struct in_addr from_ip, @@ -303,11 +306,17 @@ void announce_server(struct subnet_record *d, struct work_record *work, void announce_host(void); void announce_master(void); +/*The following definitions come from namebrowse.c */ + +void expire_browse_cache(time_t t); +struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, + time_t ttl, struct in_addr ip); +void do_browser_lists(void); + /*The following definitions come from namedb.c */ struct work_record *remove_workgroup(struct subnet_record *d, struct work_record *work); -void expire_browse_cache(time_t t); struct work_record *find_workgroupstruct(struct subnet_record *d, fstring name, BOOL add); struct subnet_record *find_subnet(struct in_addr bcast_ip); @@ -316,14 +325,13 @@ void add_subnet_interfaces(void); struct subnet_record *add_subnet_entry(struct in_addr bcast_ip, struct in_addr mask_ip, char *name, BOOL add, BOOL lmhosts); -struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, - time_t ttl, struct in_addr ip); void remove_my_servers(void); struct server_record *add_server_entry(struct subnet_record *d, struct work_record *work, char *name,int servertype, int ttl,char *comment, BOOL replace); +void add_my_subnets(char *group); void write_browse_list(void); void expire_servers(time_t t); @@ -339,6 +347,10 @@ void run_elections(void); void process_election(struct packet_struct *p,char *buf); BOOL check_elections(void); +/*The following definitions come from namelogon.c */ + +void process_logon_packet(struct packet_struct *p,char *buf,int len); + /*The following definitions come from namequery.c */ BOOL name_status(int fd,char *name,int name_type,BOOL recurse, @@ -356,11 +368,11 @@ void reply_netbios_packet(struct packet_struct *p1,int trn_id, struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, char *data,int len); void queue_netbios_pkt_wins(struct subnet_record *d, - int fd,int quest_type,enum cmd_type cmd, + int fd,int quest_type,enum state_type state, char *name,int name_type,int nb_flags, time_t ttl, BOOL bcast,BOOL recurse,struct in_addr to_ip); void queue_netbios_packet(struct subnet_record *d, - int fd,int quest_type,enum cmd_type cmd,char *name, + int fd,int quest_type,enum state_type state,char *name, int name_type,int nb_flags, time_t ttl, BOOL bcast,BOOL recurse, struct in_addr to_ip); struct response_record *find_response_record(struct subnet_record **d, @@ -409,14 +421,8 @@ void process_nmb(struct packet_struct *p); void reset_server(char *name, int state, struct in_addr ip); void tell_become_backup(void); -void do_browser_lists(void); -void sync_server(enum cmd_type cmd, char *serv_name, char *work_name, - int name_type, - struct in_addr ip); -void add_my_subnets(char *group); BOOL same_context(struct dgram_packet *dgram); BOOL listening_name(struct work_record *work, struct nmb_name *n); -void process_logon_packet(struct packet_struct *p,char *buf,int len); BOOL listening_type(struct packet_struct *p, int command); void process_browse_packet(struct packet_struct *p,char *buf,int len); void process_dgram(struct packet_struct *p); -- cgit From ddbdce7018ecf1d613a5a7885bcdf1ed0eca9bd4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 3 Jul 1996 02:59:01 +0000 Subject: generated new proto.h (This used to be commit 05107be5660c31a7c07dee467d61c44ffdffaf3e) --- source3/include/proto.h | 169 +----------------------------------------------- 1 file changed, 1 insertion(+), 168 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 87df5e3fd4..3c51382ff7 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1,39 +1,24 @@ /* This file is automatically generated with "make proto". DO NOT EDIT */ -/*The following definitions come from access.c */ +/*The following definitions come from - */ BOOL check_access(int snum); BOOL allow_access(char *deny_list,char *allow_list,struct from_host *client); BOOL fromhost(int sock,struct from_host *f); - -/*The following definitions come from charcnv.c */ - char *unix2dos_format(char *str,BOOL overwrite); char *dos2unix_format(char *str, BOOL overwrite); int interpret_character_set(char *str, int def); - -/*The following definitions come from charset.c */ - void charset_initialise(void); void add_char_string(char *s); - -/*The following definitions come from chgpasswd.c */ - BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence); BOOL chgpasswd(char *name,char *oldpass,char *newpass); BOOL chgpasswd(char *name,char *oldpass,char *newpass); - -/*The following definitions come from client.c */ - void setup_pkt(char *outbuf); void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(),BOOL recurse_dir); void cmd_help(void); BOOL reopen_connection(char *inbuf,char *outbuf); char *smb_errstr(char *inbuf); - -/*The following definitions come from clientutil.c */ - void cli_setup_pkt(char *outbuf); BOOL cli_receive_trans_response(char *inbuf,int trans,int *data_len, int *param_len, char **data,char **param); @@ -48,9 +33,6 @@ BOOL cli_send_trans_request(char *outbuf, int trans, char *name, int fid, int fl BOOL cli_open_sockets(int port); BOOL cli_reopen_connection(char *inbuf,char *outbuf); char *smb_errstr(char *inbuf); - -/*The following definitions come from clitar.c */ - int strslashcmp(const char *s1, const char *s2); void cmd_block(void); void cmd_tarmode(void); @@ -59,9 +41,6 @@ void cmd_tar(char *inbuf, char *outbuf); int process_tar(char *inbuf, char *outbuf); int clipfind(char **aret, int ret, char *tok); int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind); - -/*The following definitions come from dir.c */ - void init_dptrs(void); char *dptr_path(int key); char *dptr_wcard(int key); @@ -87,17 +66,8 @@ int TellDir(void *p); void DirCacheAdd(char *path,char *name,char *dname,int snum); char *DirCacheCheck(char *path,char *name,int snum); void DirCacheFlush(int snum); - -/*The following definitions come from fault.c */ - void fault_setup(void (*fn)()); - -/*The following definitions come from getsmbpass.c */ - char *getsmbpass(char *prompt) ; - -/*The following definitions come from interface.c */ - void load_interfaces(void); void iface_set_default(char *ip,char *bcast,char *nmask); BOOL ismyip(struct in_addr ip); @@ -107,17 +77,8 @@ struct in_addr *iface_n_ip(int n); struct in_addr *iface_bcast(struct in_addr ip); struct in_addr *iface_nmask(struct in_addr ip); struct in_addr *iface_ip(struct in_addr ip); - -/*The following definitions come from ipc.c */ - int reply_trans(char *inbuf,char *outbuf); - -/*The following definitions come from kanji.c */ - int interpret_coding_system(char *str, int def); - -/*The following definitions come from loadparm.c */ - char *lp_string(char *s); char *lp_logfile(void); char *lp_smbrun(void); @@ -250,9 +211,6 @@ void lp_dump(void); int lp_servicenumber(char *pszServiceName); char *my_workgroup(void); char *volume_label(int snum); - -/*The following definitions come from locking.c */ - BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); int file_lock(char *name,int timeout); void file_unlock(int fd); @@ -265,9 +223,6 @@ int get_share_mode(int cnum,struct stat *sbuf,int *pid); void del_share_mode(int fnum); BOOL set_share_mode(int fnum,int mode); void clean_share_files(void); - -/*The following definitions come from mangle.c */ - int str_checksum(char *s); BOOL is_8_3(char *fname); void create_mangled_stack(int size); @@ -275,19 +230,10 @@ BOOL check_mangled_stack(char *s); BOOL is_mangled(char *s); void mangle_name_83(char *s); BOOL name_map_mangle(char *OutName,BOOL need83,int snum); - -/*The following definitions come from md4.c */ - - -/*The following definitions come from message.c */ - int reply_sends(char *inbuf,char *outbuf); int reply_sendstrt(char *inbuf,char *outbuf); int reply_sendtxt(char *inbuf,char *outbuf); int reply_sendend(char *inbuf,char *outbuf); - -/*The following definitions come from nameannounce.c */ - void announce_request(struct work_record *work, struct in_addr ip); void do_announce_request(char *info, char *to_name, int announce_type, int from, @@ -296,25 +242,14 @@ void sync_server(enum state_type state, char *serv_name, char *work_name, int name_type, struct in_addr ip); void announce_backup(void); -void do_announce_host(int command, - char *from_name, int from_type, struct in_addr from_ip, - char *to_name , int to_type , struct in_addr to_ip, - int updatecount, time_t announce_interval, - char *server_name, int server_type, char *server_comment); void announce_server(struct subnet_record *d, struct work_record *work, char *name, char *comment, time_t ttl, int server_type); void announce_host(void); void announce_master(void); - -/*The following definitions come from namebrowse.c */ - void expire_browse_cache(time_t t); struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, time_t ttl, struct in_addr ip); void do_browser_lists(void); - -/*The following definitions come from namedb.c */ - struct work_record *remove_workgroup(struct subnet_record *d, struct work_record *work); struct work_record *find_workgroupstruct(struct subnet_record *d, @@ -334,9 +269,6 @@ struct server_record *add_server_entry(struct subnet_record *d, void add_my_subnets(char *group); void write_browse_list(void); void expire_servers(time_t t); - -/*The following definitions come from nameelect.c */ - void check_master_browser(void); void browser_gone(char *work_name, struct in_addr ip); void send_election(struct subnet_record *d, char *group,uint32 criterion, @@ -346,22 +278,13 @@ void become_nonmaster(struct subnet_record *d, struct work_record *work, void run_elections(void); void process_election(struct packet_struct *p,char *buf); BOOL check_elections(void); - -/*The following definitions come from namelogon.c */ - void process_logon_packet(struct packet_struct *p,char *buf,int len); - -/*The following definitions come from namequery.c */ - BOOL name_status(int fd,char *name,int name_type,BOOL recurse, struct in_addr to_ip,char *master,char *rname, void (*fn)()); BOOL name_query(int fd,char *name,int name_type, BOOL bcast,BOOL recurse, struct in_addr to_ip, struct in_addr *ip,void (*fn)()); - -/*The following definitions come from nameresp.c */ - void expire_netbios_response_entries(); void reply_netbios_packet(struct packet_struct *p1,int trn_id, int rcode,int opcode, BOOL recurse, @@ -386,9 +309,6 @@ BOOL interpret_node_status(struct subnet_record *d, BOOL send_mailslot_reply(char *mailslot,int fd,char *buf,int len,char *srcname, char *dstname,int src_type,int dest_type, struct in_addr dest_ip,struct in_addr src_ip); - -/*The following definitions come from nameserv.c */ - void remove_name(struct subnet_record *d, struct name_record *n); void dump_names(void); void load_netbios_names(void); @@ -416,9 +336,6 @@ struct name_record *search_for_name(struct subnet_record **d, struct in_addr ip, int Time, int search); void reply_name_query(struct packet_struct *p); void process_nmb(struct packet_struct *p); - -/*The following definitions come from namework.c */ - void reset_server(char *name, int state, struct in_addr ip); void tell_become_backup(void); BOOL same_context(struct dgram_packet *dgram); @@ -426,13 +343,7 @@ BOOL listening_name(struct work_record *work, struct nmb_name *n); BOOL listening_type(struct packet_struct *p, int command); void process_browse_packet(struct packet_struct *p,char *buf,int len); void process_dgram(struct packet_struct *p); - -/*The following definitions come from nmbd.c */ - BOOL reload_services(BOOL test); - -/*The following definitions come from nmblib.c */ - void debug_nmb_packet(struct packet_struct *p); char *namestr(struct nmb_name *n); void free_nmb_packet(struct nmb_packet *nmb); @@ -441,23 +352,11 @@ struct packet_struct *read_packet(int fd,enum packet_type packet_type); void make_nmb_name(struct nmb_name *n,char *name,int type,char *this_scope); BOOL send_packet(struct packet_struct *p); struct packet_struct *receive_packet(int fd,enum packet_type type,int t); - -/*The following definitions come from nmblookup.c */ - int main(int argc,char *argv[]); - -/*The following definitions come from nmbsync.c */ - char *getsmbpass(char *pass); void sync_browse_lists(struct subnet_record *d, struct work_record *work, char *name, int nm_type, struct in_addr ip); - -/*The following definitions come from params.c */ - BOOL pm_process(char *pszFileName,BOOL (*sfunc)(char *),BOOL (*pfunc)(char *,char *)); - -/*The following definitions come from password.c */ - void generate_next_challenge(char *challenge); BOOL set_challenge(char *challenge); BOOL last_challenge(char *challenge); @@ -477,36 +376,21 @@ BOOL authorise_login(int snum,char *user,char *password, int pwlen, BOOL check_hosts_equiv(char *user); BOOL server_cryptkey(char *buf); BOOL server_validate(char *buf); - -/*The following definitions come from pcap.c */ - BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); void pcap_printer_fn(void (*fn)()); - -/*The following definitions come from predict.c */ - int read_predict(int fd,int offset,char *buf,char **ptr,int num); void do_read_prediction(); void invalidate_read_prediction(int fd); - -/*The following definitions come from printing.c */ - void lpq_reset(int snum); void print_file(int fnum); int get_printqueue(int snum,int cnum,print_queue_struct **queue, print_status_struct *status); void del_printqueue(int cnum,int snum,int jobid); void status_printjob(int cnum,int snum,int jobid,int status); - -/*The following definitions come from quotas.c */ - BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); - -/*The following definitions come from replace.c */ - char *Strstr(char *s, char *p); time_t Mktime(struct tm *t); int InNetGr(char *group,char *host,char *user,char *dom); @@ -514,9 +398,6 @@ void *malloc_wrapped(int size,char *file,int line); void *realloc_wrapped(void *ptr,int size,char *file,int line); void free_wrapped(void *ptr,char *file,int line); void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line); - -/*The following definitions come from reply.c */ - int reply_special(char *inbuf,char *outbuf); int reply_tcon(char *inbuf,char *outbuf); int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize); @@ -567,9 +448,6 @@ int reply_writebmpx(char *inbuf,char *outbuf); int reply_writebs(char *inbuf,char *outbuf); int reply_setattrE(char *inbuf,char *outbuf); int reply_getattrE(char *inbuf,char *outbuf); - -/*The following definitions come from server.c */ - mode_t unix_mode(int cnum,int dosmode); int dos_mode(int cnum,char *path,struct stat *sbuf); int dos_chmod(int cnum,char *fname,int dosmode,struct stat *st); @@ -611,9 +489,6 @@ void standard_sub(int cnum,char *s); char *smb_fn_name(int type); int chain_reply(int type,char *inbuf,char *inbuf2,char *outbuf,char *outbuf2,int size,int bufsize); int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); - -/*The following definitions come from smbencrypt.c */ - void str_to_key(uchar *str,uchar *key); void D1(uchar *k, uchar *d, uchar *out); void E1(uchar *k, uchar *d, uchar *out); @@ -622,25 +497,10 @@ void E_P24(uchar *p21, uchar *c8, uchar *p24); void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); void E_md4hash(uchar *passwd, uchar *p16); void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); - -/*The following definitions come from smbpass.c */ - - -/*The following definitions come from smbpasswd.c */ - - -/*The following definitions come from smbrun.c */ - - -/*The following definitions come from status.c */ - void Ucrit_addUsername(pstring username); unsigned int Ucrit_checkUsername(pstring username); void Ucrit_addPid(int pid); unsigned int Ucrit_checkPid(int pid); - -/*The following definitions come from system.c */ - int sys_select(fd_set *fds,struct timeval *tval); int sys_select(fd_set *fds,struct timeval *tval); int sys_unlink(char *fname); @@ -655,16 +515,7 @@ int sys_utime(char *fname,struct utimbuf *times); int sys_rename(char *from, char *to); int sys_chown(char *fname,int uid,int gid); int sys_chroot(char *dname); - -/*The following definitions come from testparm.c */ - - -/*The following definitions come from testprns.c */ - int main(int argc, char *argv[]); - -/*The following definitions come from time.c */ - void GetTimeOfDay(struct timeval *tval); void TimeInit(void); int TimeDiff(time_t t); @@ -679,35 +530,20 @@ time_t make_unix_date2(void *date_ptr); time_t make_unix_date3(void *date_ptr); BOOL set_filetime(char *fname,time_t mtime); char *timestring(void ); - -/*The following definitions come from trans2.c */ - int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize); int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize); int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize); int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize); - -/*The following definitions come from ufc.c */ - char *ufc_crypt(char *key,char *salt); - -/*The following definitions come from uid.c */ - void init_uid(void); BOOL become_guest(void); BOOL become_user(int cnum, int uid); BOOL unbecome_user(void ); int smbrun(char *cmd,char *outfile); - -/*The following definitions come from username.c */ - char *get_home_dir(char *user); void map_username(char *user); struct passwd *Get_Pwnam(char *user,BOOL allow_change); BOOL user_in_list(char *user,char *list); - -/*The following definitions come from util.c */ - void setup_logging(char *pname,BOOL interactive); void reopen_logs(void); BOOL is_a_socket(int fd); @@ -814,9 +650,6 @@ char *gidtoname(int gid); void BlockSignals(BOOL block); void ajt_panic(void); char *readdirname(void *p); - -/*The following definitions come from vt_mode.c */ - int VT_Check(char *buffer); int VT_Start_utmp(void); int VT_Stop_utmp(void); -- cgit From 7812ff08135318e74f5c286fe4773de8d1423969 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 4 Jul 1996 19:19:26 +0000 Subject: modified become_master() to a state-based system. becoming a master is now performed in stages: wait for each NetBIOS name to be successfully registered before proceeding to the next stage. tied implicit name registration and release (broadcast method) to the same piece of code as explicit method (via WINS server). created special_browser_name() function that checks __MSBROWSE__ name: this name is ignored by WINS servers apparently. fixed likely incompatibility between refresh_my_names() and add_my_names(). (netbios entries were unlikely to be refreshed). NOTE: none of these changes have been tested. at all. lkcl (This used to be commit 7719fb06524a66ce5e3f30f3152ddb1e200c97f3) --- source3/include/nameserv.h | 6 ++++++ source3/include/proto.h | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 9e4145213b..64a71b89ba 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -79,6 +79,8 @@ enum name_source {STATUS_QUERY, LMHOSTS, REGISTER, SELF, DNS, DNSFAIL}; enum node_type {B_NODE=0, P_NODE=1, M_NODE=2, NBDD_NODE=3}; enum packet_type {NMB_PACKET, DGRAM_PACKET}; +enum master_state { MST_NONE, MST_WON, MST_MSB, MST_BROWSER, MST_DOMAIN }; + enum state_type { NAME_STATUS_MASTER_CHECK, @@ -149,6 +151,9 @@ struct work_record struct server_record *serverlist; + /* stage of development from non-master to master browser / domain master */ + enum master_state state; + /* work group info */ fstring work_group; int token; /* used when communicating with backup browsers */ @@ -159,6 +164,7 @@ struct work_record int announce_interval; BOOL needannounce; + /* election info */ BOOL RunningElection; BOOL needelection; diff --git a/source3/include/proto.h b/source3/include/proto.h index 3c51382ff7..fa04e284d3 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1,8 +1,5 @@ /* This file is automatically generated with "make proto". DO NOT EDIT */ - -/*The following definitions come from - */ - BOOL check_access(int snum); BOOL allow_access(char *deny_list,char *allow_list,struct from_host *client); BOOL fromhost(int sock,struct from_host *f); @@ -273,6 +270,10 @@ void check_master_browser(void); void browser_gone(char *work_name, struct in_addr ip); void send_election(struct subnet_record *d, char *group,uint32 criterion, int timeup,char *name); +void name_unregister_work(struct subnet_record *d, char *name, int name_type); +void name_register_work(struct subnet_record *d, char *name, int name_type, + int nb_flags, time_t ttl, struct in_addr ip, BOOL bcast); +void become_master(struct subnet_record *d, struct work_record *work); void become_nonmaster(struct subnet_record *d, struct work_record *work, int remove_type); void run_elections(void); @@ -309,6 +310,7 @@ BOOL interpret_node_status(struct subnet_record *d, BOOL send_mailslot_reply(char *mailslot,int fd,char *buf,int len,char *srcname, char *dstname,int src_type,int dest_type, struct in_addr dest_ip,struct in_addr src_ip); +BOOL special_browser_name(char *name, int type); void remove_name(struct subnet_record *d, struct name_record *n); void dump_names(void); void load_netbios_names(void); -- cgit From 94b935c974b71a22a052ec7d78c4871a1a299bf6 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 4 Jul 1996 19:41:16 +0000 Subject: namebrowse.c was using variable work uninitialised. remkproto'd proto.h lkcl (This used to be commit 166d70eba30a4b2773620f7cd9f0b84307b25472) --- source3/include/proto.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index fa04e284d3..6f92de8586 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1,5 +1,8 @@ /* This file is automatically generated with "make proto". DO NOT EDIT */ + +/*The following definitions come from - */ + BOOL check_access(int snum); BOOL allow_access(char *deny_list,char *allow_list,struct from_host *client); BOOL fromhost(int sock,struct from_host *f); -- cgit From b338bce94f47780c74b2db3608a767c5b957b61a Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sun, 7 Jul 1996 12:36:18 +0000 Subject: tidied up: code shuffling and documentation. created namedb*.c nameservresp.c nameservreply.c and namepacket.c added modules to Makefile, downloading dan's current version first :-) shuffled docs to match source created more docs fixed bug in announce_backup() discovered when going nameannounce.doc: backup list requests to the master browser should be used when samba is not a master browser; backup list requests to the primary domain controller should be used when samba is not a primary domain controller. fixed bug in sync_server: it would never send MasterAnnounce packets. removed the code that ignored special browser names: these should only be ignored (except 0x1b names) when broadcasted name queries are sent, not when directed registration or directed queries are sent samba as a WINS server. (note: exactly what's going on is still uncertain). renamed NAME_QUERY_MST_SRV_CHK to NAME_QUERY_PDC_SRV_CHK (more accurate). renamed NAME_STATUS_MST_SRV_CHK to NAME_STATUS_PDC_SRV_CHK (more accurate). added secured WINS name registration: a new 'state' NAME_REGISTER_CHALLENGE; functions send_name_response(), response_name_query_register(); added sending of WAIT ACKNOWLEDGEMENT packet; added a reply_to_ip field to the response record structure so that after the name query challenge, you know who to inform of the outcome of that challenge. note: these are all currently untested modifications (yikes!) lkcl (This used to be commit b50ff657ddc29b81b4aa02a597e5affab197e4f2) --- source3/include/nameserv.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 64a71b89ba..de5e492644 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -20,6 +20,8 @@ */ +#define GET_TTL(ttl) ((ttl)?MIN(ttl,lp_max_ttl()):lp_max_ttl()) + /* NTAS uses 2, NT uses 1, WfWg uses 0 */ #define MAINTAIN_LIST 2 #define ELECTION_VERSION 1 @@ -33,9 +35,13 @@ #define NMB_REG 0x05 /* see rfc1002.txt 4.2.2,3,5,6,7,8 */ #define NMB_REG_REFRESH 0x09 /* see rfc1002.txt 4.2.4 */ #define NMB_REL 0x06 /* see rfc1002.txt 4.2.9,10,11 */ -#define NMB_WAIT_ACK 0x07 /* see rfc1002.txt 4.2.17 */ +#define NMB_WAIT_ACK 0x07 /* see rfc1002.txt 4.2.16 */ /* XXXX what about all the other types?? 0x1, 0x2, 0x3, 0x4, 0x8? */ +#define FIND_SELF 0x01 +#define FIND_WINS 0x02 +#define FIND_LOCAL 0x04 + /* NetBIOS flags */ #define NB_GROUP 0x80 #define NB_PERM 0x02 @@ -83,13 +89,14 @@ enum master_state { MST_NONE, MST_WON, MST_MSB, MST_BROWSER, MST_DOMAIN }; enum state_type { - NAME_STATUS_MASTER_CHECK, - NAME_STATUS_CHECK, + NAME_STATUS_PDC_SRV_CHK, + NAME_STATUS_SRV_CHK, + NAME_REGISTER_CHALLENGE, NAME_REGISTER, NAME_RELEASE, NAME_QUERY_CONFIRM, NAME_QUERY_SYNC, - NAME_QUERY_MST_SRV_CHK, + NAME_QUERY_PDC_SRV_CHK, NAME_QUERY_SRV_CHK, NAME_QUERY_FIND_MST, NAME_QUERY_MST_CHK @@ -189,7 +196,8 @@ struct response_record BOOL bcast; BOOL recurse; - struct in_addr to_ip; + struct in_addr send_ip; + struct in_addr reply_to_ip; int num_msgs; -- cgit From 3545a9b8734bfabdff760253dd73216aad25b925 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sun, 7 Jul 1996 13:29:56 +0000 Subject: added the recently shuffled and updated source files missed in the previous commit (see previous log message for details) fixed bug in nameservreply.c: wrong macro in use (RSSVAL not IVAL!). did another make proto lkcl (This used to be commit d78b319062144d14a54408fce77ccc313ad58ee3) --- source3/include/proto.h | 120 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 82 insertions(+), 38 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 6f92de8586..437a7e25b9 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -242,6 +242,7 @@ void sync_server(enum state_type state, char *serv_name, char *work_name, int name_type, struct in_addr ip); void announce_backup(void); +void remove_my_servers(void); void announce_server(struct subnet_record *d, struct work_record *work, char *name, char *comment, time_t ttl, int server_type); void announce_host(void); @@ -250,6 +251,7 @@ void expire_browse_cache(time_t t); struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, time_t ttl, struct in_addr ip); void do_browser_lists(void); +void remove_old_servers(struct work_record *work, time_t t); struct work_record *remove_workgroup(struct subnet_record *d, struct work_record *work); struct work_record *find_workgroupstruct(struct subnet_record *d, @@ -269,6 +271,59 @@ struct server_record *add_server_entry(struct subnet_record *d, void add_my_subnets(char *group); void write_browse_list(void); void expire_servers(time_t t); +BOOL name_equal(struct nmb_name *n1,struct nmb_name *n2); +BOOL ms_browser_name(char *name, int type); +void remove_name(struct subnet_record *d, struct name_record *n); +struct name_record *find_name(struct name_record *n, + struct nmb_name *name, + int search, struct in_addr ip); +struct name_record *find_name_search(struct subnet_record **d, + struct nmb_name *name, + int search, struct in_addr ip); +void dump_names(void); +void load_netbios_names(void); +void remove_netbios_name(struct subnet_record *d, + char *name,int type, enum name_source source, + struct in_addr ip); +struct name_record *add_netbios_entry(struct subnet_record *d, + char *name, int type, int nb_flags, + int ttl, enum name_source source, struct in_addr ip, + BOOL new_only,BOOL wins); +void expire_names(time_t t); +struct name_record *search_for_name(struct subnet_record **d, + struct nmb_name *question, + struct in_addr ip, int Time, int search); +void add_response_record(struct subnet_record *d, + struct response_record *n); +void remove_response_record(struct subnet_record *d, + struct response_record *n); +struct response_record *make_response_queue_record(enum state_type state, + int id,int fd, + int quest_type, char *name,int type, int nb_flags, time_t ttl, + BOOL bcast,BOOL recurse, + struct in_addr send_ip, struct in_addr reply_to_ip); +struct response_record *find_response_record(struct subnet_record **d, + uint16 id); +void remove_old_servers(struct work_record *work, time_t t); +struct server_record *add_server_entry(struct subnet_record *d, + struct work_record *work, + char *name,int servertype, + int ttl,char *comment, + BOOL replace); +void expire_servers(time_t t); +struct subnet_record *find_subnet(struct in_addr bcast_ip); +struct subnet_record *find_req_subnet(struct in_addr ip, BOOL bcast); +void add_subnet_interfaces(void); +void add_my_subnets(char *group); +struct subnet_record *add_subnet_entry(struct in_addr bcast_ip, + struct in_addr mask_ip, + char *name, BOOL add, BOOL lmhosts); +void write_browse_list(void); +struct work_record *remove_workgroup(struct subnet_record *d, + struct work_record *work); +struct work_record *find_workgroupstruct(struct subnet_record *d, + fstring name, BOOL add); +void dump_workgroups(void); void check_master_browser(void); void browser_gone(char *work_name, struct in_addr ip); void send_election(struct subnet_record *d, char *group,uint32 criterion, @@ -283,6 +338,20 @@ void run_elections(void); void process_election(struct packet_struct *p,char *buf); BOOL check_elections(void); void process_logon_packet(struct packet_struct *p,char *buf,int len); +void initiate_netbios_packet(uint16 *id, + int fd,int quest_type,char *name,int name_type, + int nb_flags,BOOL bcast,BOOL recurse, + struct in_addr to_ip); +void reply_netbios_packet(struct packet_struct *p1,int trn_id, + int rcode,int opcode, BOOL recurse, + struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, + char *data,int len); +void queue_packet(struct packet_struct *packet); +void run_packet_queue(); +void listen_for_packets(BOOL run_election); +BOOL send_mailslot_reply(char *mailslot,int fd,char *buf,int len,char *srcname, + char *dstname,int src_type,int dest_type, + struct in_addr dest_ip,struct in_addr src_ip); BOOL name_status(int fd,char *name,int name_type,BOOL recurse, struct in_addr to_ip,char *master,char *rname, void (*fn)()); @@ -290,64 +359,39 @@ BOOL name_query(int fd,char *name,int name_type, BOOL bcast,BOOL recurse, struct in_addr to_ip, struct in_addr *ip,void (*fn)()); void expire_netbios_response_entries(); -void reply_netbios_packet(struct packet_struct *p1,int trn_id, - int rcode,int opcode, BOOL recurse, - struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, - char *data,int len); -void queue_netbios_pkt_wins(struct subnet_record *d, +struct response_record *queue_netbios_pkt_wins(struct subnet_record *d, int fd,int quest_type,enum state_type state, char *name,int name_type,int nb_flags, time_t ttl, - BOOL bcast,BOOL recurse,struct in_addr to_ip); -void queue_netbios_packet(struct subnet_record *d, + BOOL bcast,BOOL recurse, + struct in_addr send_ip, struct in_addr reply_to_ip); +struct response_record *queue_netbios_packet(struct subnet_record *d, int fd,int quest_type,enum state_type state,char *name, int name_type,int nb_flags, time_t ttl, - BOOL bcast,BOOL recurse, struct in_addr to_ip); -struct response_record *find_response_record(struct subnet_record **d, - uint16 id); -void queue_packet(struct packet_struct *packet); -void run_packet_queue(); -void listen_for_packets(BOOL run_election); -BOOL interpret_node_status(struct subnet_record *d, - char *p, struct nmb_name *name,int t, - char *serv_name, struct in_addr ip, BOOL bcast); -BOOL send_mailslot_reply(char *mailslot,int fd,char *buf,int len,char *srcname, - char *dstname,int src_type,int dest_type, - struct in_addr dest_ip,struct in_addr src_ip); -BOOL special_browser_name(char *name, int type); -void remove_name(struct subnet_record *d, struct name_record *n); -void dump_names(void); -void load_netbios_names(void); -void remove_netbios_name(struct subnet_record *d, - char *name,int type, enum name_source source, - struct in_addr ip); -struct name_record *add_netbios_entry(struct subnet_record *d, - char *name, int type, int nb_flags, - int ttl, enum name_source source, struct in_addr ip, - BOOL new_only,BOOL wins); + BOOL bcast,BOOL recurse, + struct in_addr send_ip, struct in_addr reply_to_ip); void remove_name_entry(struct subnet_record *d, char *name,int type); void add_my_name_entry(struct subnet_record *d,char *name,int type,int nb_flags); void add_my_names(void); void remove_my_names(); void refresh_my_names(time_t t); void query_refresh_names(void); -void expire_names(time_t t); -void response_name_release(struct subnet_record *d, struct packet_struct *p); void reply_name_release(struct packet_struct *p); -void response_name_reg(struct subnet_record *d, struct packet_struct *p); +void send_name_response(int fd, + int name_trn_id, int opcode, BOOL success, BOOL recurse, + struct nmb_name *reply_name, int nb_flags, int ttl, + struct in_addr ip); void reply_name_reg(struct packet_struct *p); void reply_name_status(struct packet_struct *p); -struct name_record *search_for_name(struct subnet_record **d, - struct nmb_name *question, - struct in_addr ip, int Time, int search); void reply_name_query(struct packet_struct *p); -void process_nmb(struct packet_struct *p); +void response_name_release(struct subnet_record *d, struct packet_struct *p); +void response_name_reg(struct subnet_record *d, struct packet_struct *p); +void response_netbios_packet(struct packet_struct *p); void reset_server(char *name, int state, struct in_addr ip); void tell_become_backup(void); BOOL same_context(struct dgram_packet *dgram); BOOL listening_name(struct work_record *work, struct nmb_name *n); BOOL listening_type(struct packet_struct *p, int command); void process_browse_packet(struct packet_struct *p,char *buf,int len); -void process_dgram(struct packet_struct *p); BOOL reload_services(BOOL test); void debug_nmb_packet(struct packet_struct *p); char *namestr(struct nmb_name *n); -- cgit From 9d59ce1d5715f64105643b01aea8b5b9cba8d5a2 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 9 Jul 1996 18:11:47 +0000 Subject: missed nmbd.c in previous update. did a make proto lkcl (This used to be commit 4ccc84989efc0875dfec95d38be4a8fe746c8795) --- source3/include/proto.h | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 437a7e25b9..af5ed8bf41 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -251,26 +251,6 @@ void expire_browse_cache(time_t t); struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, time_t ttl, struct in_addr ip); void do_browser_lists(void); -void remove_old_servers(struct work_record *work, time_t t); -struct work_record *remove_workgroup(struct subnet_record *d, - struct work_record *work); -struct work_record *find_workgroupstruct(struct subnet_record *d, - fstring name, BOOL add); -struct subnet_record *find_subnet(struct in_addr bcast_ip); -void dump_workgroups(void); -void add_subnet_interfaces(void); -struct subnet_record *add_subnet_entry(struct in_addr bcast_ip, - struct in_addr mask_ip, - char *name, BOOL add, BOOL lmhosts); -void remove_my_servers(void); -struct server_record *add_server_entry(struct subnet_record *d, - struct work_record *work, - char *name,int servertype, - int ttl,char *comment, - BOOL replace); -void add_my_subnets(char *group); -void write_browse_list(void); -void expire_servers(time_t t); BOOL name_equal(struct nmb_name *n1,struct nmb_name *n2); BOOL ms_browser_name(char *name, int type); void remove_name(struct subnet_record *d, struct name_record *n); @@ -298,13 +278,14 @@ void add_response_record(struct subnet_record *d, void remove_response_record(struct subnet_record *d, struct response_record *n); struct response_record *make_response_queue_record(enum state_type state, - int id,int fd, + int id,uint16 fd, int quest_type, char *name,int type, int nb_flags, time_t ttl, BOOL bcast,BOOL recurse, struct in_addr send_ip, struct in_addr reply_to_ip); struct response_record *find_response_record(struct subnet_record **d, uint16 id); -void remove_old_servers(struct work_record *work, time_t t); +void remove_old_servers(struct work_record *work, time_t t, + BOOL remove_all); struct server_record *add_server_entry(struct subnet_record *d, struct work_record *work, char *name,int servertype, @@ -320,7 +301,8 @@ struct subnet_record *add_subnet_entry(struct in_addr bcast_ip, char *name, BOOL add, BOOL lmhosts); void write_browse_list(void); struct work_record *remove_workgroup(struct subnet_record *d, - struct work_record *work); + struct work_record *work, + BOOL remove_all_servers); struct work_record *find_workgroupstruct(struct subnet_record *d, fstring name, BOOL add); void dump_workgroups(void); -- cgit From e5a0619c2839d45b00446c3af3f30599f3f3c5fa Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 10 Jul 1996 18:48:49 +0000 Subject: updated docs to match code mods from last two or three updates. done some more commenting of code to match docs. sorted some bugs. ipc BOOL domains was uninitialised. lkcl (This used to be commit cb43ce7bc08fa43a6ce49e0937f13afec5dce67b) --- source3/include/proto.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index af5ed8bf41..2286b93a6d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -357,16 +357,18 @@ void add_my_names(void); void remove_my_names(); void refresh_my_names(time_t t); void query_refresh_names(void); -void reply_name_release(struct packet_struct *p); +void add_name_respond(struct subnet_record *d, int fd, uint16 response_id, + struct nmb_name *name, + int nb_flags, int ttl, struct in_addr register_ip, + BOOL new_owner, struct in_addr reply_to_ip); void send_name_response(int fd, int name_trn_id, int opcode, BOOL success, BOOL recurse, struct nmb_name *reply_name, int nb_flags, int ttl, struct in_addr ip); +void reply_name_release(struct packet_struct *p); void reply_name_reg(struct packet_struct *p); void reply_name_status(struct packet_struct *p); void reply_name_query(struct packet_struct *p); -void response_name_release(struct subnet_record *d, struct packet_struct *p); -void response_name_reg(struct subnet_record *d, struct packet_struct *p); void response_netbios_packet(struct packet_struct *p); void reset_server(char *name, int state, struct in_addr ip); void tell_become_backup(void); -- cgit From 25b30c08dce8c04b7b98c02ac1de61d7aa76798f Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 17 Jul 1996 18:33:36 +0000 Subject: lots of changes to nmbd lkcl (This used to be commit 45d3b2644733333c657c48a69719fec72881f7df) --- source3/include/nameserv.h | 12 +++++++++++- source3/include/proto.h | 12 ++++++++---- source3/include/version.h | 2 +- 3 files changed, 20 insertions(+), 6 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index de5e492644..b634250c81 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -85,7 +85,17 @@ enum name_source {STATUS_QUERY, LMHOSTS, REGISTER, SELF, DNS, DNSFAIL}; enum node_type {B_NODE=0, P_NODE=1, M_NODE=2, NBDD_NODE=3}; enum packet_type {NMB_PACKET, DGRAM_PACKET}; -enum master_state { MST_NONE, MST_WON, MST_MSB, MST_BROWSER, MST_DOMAIN }; +enum master_state +{ + MST_NONE, + MST_WON, + MST_MSB, + MST_BROWSER, + MST_DOMAIN_NONE, + MST_DOMAIN_MEM, + MST_DOMAIN_TST, + MST_DOMAIN +}; enum state_type { diff --git a/source3/include/proto.h b/source3/include/proto.h index 2286b93a6d..e7225a7271 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -256,7 +256,7 @@ BOOL ms_browser_name(char *name, int type); void remove_name(struct subnet_record *d, struct name_record *n); struct name_record *find_name(struct name_record *n, struct nmb_name *name, - int search, struct in_addr ip); + int search); struct name_record *find_name_search(struct subnet_record **d, struct nmb_name *name, int search, struct in_addr ip); @@ -286,6 +286,7 @@ struct response_record *find_response_record(struct subnet_record **d, uint16 id); void remove_old_servers(struct work_record *work, time_t t, BOOL remove_all); +struct server_record *find_server(struct work_record *work, char *name); struct server_record *add_server_entry(struct subnet_record *d, struct work_record *work, char *name,int servertype, @@ -320,12 +321,13 @@ void run_elections(void); void process_election(struct packet_struct *p,char *buf); BOOL check_elections(void); void process_logon_packet(struct packet_struct *p,char *buf,int len); +void debug_browse_data(char *outbuf, int len); void initiate_netbios_packet(uint16 *id, int fd,int quest_type,char *name,int name_type, int nb_flags,BOOL bcast,BOOL recurse, struct in_addr to_ip); void reply_netbios_packet(struct packet_struct *p1,int trn_id, - int rcode,int opcode, BOOL recurse, + int rcode, int rcv_code, int opcode, BOOL recurse, struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, char *data,int len); void queue_packet(struct packet_struct *packet); @@ -357,11 +359,12 @@ void add_my_names(void); void remove_my_names(); void refresh_my_names(time_t t); void query_refresh_names(void); -void add_name_respond(struct subnet_record *d, int fd, uint16 response_id, +void add_name_respond(struct subnet_record *d, int fd, struct in_addr from_ip, + uint16 response_id, struct nmb_name *name, int nb_flags, int ttl, struct in_addr register_ip, BOOL new_owner, struct in_addr reply_to_ip); -void send_name_response(int fd, +void send_name_response(int fd, struct in_addr from_ip, int name_trn_id, int opcode, BOOL success, BOOL recurse, struct nmb_name *reply_name, int nb_flags, int ttl, struct in_addr ip); @@ -369,6 +372,7 @@ void reply_name_release(struct packet_struct *p); void reply_name_reg(struct packet_struct *p); void reply_name_status(struct packet_struct *p); void reply_name_query(struct packet_struct *p); +void debug_state_type(int state); void response_netbios_packet(struct packet_struct *p); void reset_server(char *name, int state, struct in_addr ip); void tell_become_backup(void); diff --git a/source3/include/version.h b/source3/include/version.h index 964411164d..7bde637b18 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16alpha10" +#define VERSION "1.9.16a10" -- cgit From b6037f01a01e040e518eca0ea75c53a475e36b0c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 18 Jul 1996 10:20:51 +0000 Subject: minor cleanups ready for another release (This used to be commit 153d324c7be345ae87f99e62123e9a7dbaf74aee) --- source3/include/includes.h | 3 - source3/include/proto.h | 186 ++++++++++++++++++++++++++++++++++++++++++++- source3/include/smb.h | 10 ++- 3 files changed, 193 insertions(+), 6 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 549407bc9e..55423dc431 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -984,9 +984,6 @@ extern char *sys_errlist[]; #include "nameserv.h" #include "proto.h" #include "byteorder.h" -#ifdef SMB_PASSWD -#include "smbpass.h" -#endif #include "kanji.h" #include "charset.h" diff --git a/source3/include/proto.h b/source3/include/proto.h index e7225a7271..66c21ebfaf 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1,24 +1,39 @@ /* This file is automatically generated with "make proto". DO NOT EDIT */ -/*The following definitions come from - */ +/*The following definitions come from access.c */ BOOL check_access(int snum); BOOL allow_access(char *deny_list,char *allow_list,struct from_host *client); BOOL fromhost(int sock,struct from_host *f); + +/*The following definitions come from charcnv.c */ + char *unix2dos_format(char *str,BOOL overwrite); char *dos2unix_format(char *str, BOOL overwrite); int interpret_character_set(char *str, int def); + +/*The following definitions come from charset.c */ + void charset_initialise(void); void add_char_string(char *s); + +/*The following definitions come from chgpasswd.c */ + BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence); BOOL chgpasswd(char *name,char *oldpass,char *newpass); BOOL chgpasswd(char *name,char *oldpass,char *newpass); + +/*The following definitions come from client.c */ + void setup_pkt(char *outbuf); void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(),BOOL recurse_dir); void cmd_help(void); BOOL reopen_connection(char *inbuf,char *outbuf); char *smb_errstr(char *inbuf); + +/*The following definitions come from clientutil.c */ + void cli_setup_pkt(char *outbuf); BOOL cli_receive_trans_response(char *inbuf,int trans,int *data_len, int *param_len, char **data,char **param); @@ -33,6 +48,9 @@ BOOL cli_send_trans_request(char *outbuf, int trans, char *name, int fid, int fl BOOL cli_open_sockets(int port); BOOL cli_reopen_connection(char *inbuf,char *outbuf); char *smb_errstr(char *inbuf); + +/*The following definitions come from clitar.c */ + int strslashcmp(const char *s1, const char *s2); void cmd_block(void); void cmd_tarmode(void); @@ -41,6 +59,9 @@ void cmd_tar(char *inbuf, char *outbuf); int process_tar(char *inbuf, char *outbuf); int clipfind(char **aret, int ret, char *tok); int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind); + +/*The following definitions come from dir.c */ + void init_dptrs(void); char *dptr_path(int key); char *dptr_wcard(int key); @@ -66,8 +87,17 @@ int TellDir(void *p); void DirCacheAdd(char *path,char *name,char *dname,int snum); char *DirCacheCheck(char *path,char *name,int snum); void DirCacheFlush(int snum); + +/*The following definitions come from fault.c */ + void fault_setup(void (*fn)()); + +/*The following definitions come from getsmbpass.c */ + char *getsmbpass(char *prompt) ; + +/*The following definitions come from interface.c */ + void load_interfaces(void); void iface_set_default(char *ip,char *bcast,char *nmask); BOOL ismyip(struct in_addr ip); @@ -77,8 +107,17 @@ struct in_addr *iface_n_ip(int n); struct in_addr *iface_bcast(struct in_addr ip); struct in_addr *iface_nmask(struct in_addr ip); struct in_addr *iface_ip(struct in_addr ip); + +/*The following definitions come from ipc.c */ + int reply_trans(char *inbuf,char *outbuf); + +/*The following definitions come from kanji.c */ + int interpret_coding_system(char *str, int def); + +/*The following definitions come from loadparm.c */ + char *lp_string(char *s); char *lp_logfile(void); char *lp_smbrun(void); @@ -211,6 +250,9 @@ void lp_dump(void); int lp_servicenumber(char *pszServiceName); char *my_workgroup(void); char *volume_label(int snum); + +/*The following definitions come from locking.c */ + BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); int file_lock(char *name,int timeout); void file_unlock(int fd); @@ -223,6 +265,9 @@ int get_share_mode(int cnum,struct stat *sbuf,int *pid); void del_share_mode(int fnum); BOOL set_share_mode(int fnum,int mode); void clean_share_files(void); + +/*The following definitions come from mangle.c */ + int str_checksum(char *s); BOOL is_8_3(char *fname); void create_mangled_stack(int size); @@ -230,10 +275,19 @@ BOOL check_mangled_stack(char *s); BOOL is_mangled(char *s); void mangle_name_83(char *s); BOOL name_map_mangle(char *OutName,BOOL need83,int snum); + +/*The following definitions come from md4.c */ + + +/*The following definitions come from message.c */ + int reply_sends(char *inbuf,char *outbuf); int reply_sendstrt(char *inbuf,char *outbuf); int reply_sendtxt(char *inbuf,char *outbuf); int reply_sendend(char *inbuf,char *outbuf); + +/*The following definitions come from nameannounce.c */ + void announce_request(struct work_record *work, struct in_addr ip); void do_announce_request(char *info, char *to_name, int announce_type, int from, @@ -247,10 +301,16 @@ void announce_server(struct subnet_record *d, struct work_record *work, char *name, char *comment, time_t ttl, int server_type); void announce_host(void); void announce_master(void); + +/*The following definitions come from namebrowse.c */ + void expire_browse_cache(time_t t); struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, time_t ttl, struct in_addr ip); void do_browser_lists(void); + +/*The following definitions come from namedbname.c */ + BOOL name_equal(struct nmb_name *n1,struct nmb_name *n2); BOOL ms_browser_name(char *name, int type); void remove_name(struct subnet_record *d, struct name_record *n); @@ -273,6 +333,9 @@ void expire_names(time_t t); struct name_record *search_for_name(struct subnet_record **d, struct nmb_name *question, struct in_addr ip, int Time, int search); + +/*The following definitions come from namedbresp.c */ + void add_response_record(struct subnet_record *d, struct response_record *n); void remove_response_record(struct subnet_record *d, @@ -284,6 +347,9 @@ struct response_record *make_response_queue_record(enum state_type state, struct in_addr send_ip, struct in_addr reply_to_ip); struct response_record *find_response_record(struct subnet_record **d, uint16 id); + +/*The following definitions come from namedbserver.c */ + void remove_old_servers(struct work_record *work, time_t t, BOOL remove_all); struct server_record *find_server(struct work_record *work, char *name); @@ -293,6 +359,9 @@ struct server_record *add_server_entry(struct subnet_record *d, int ttl,char *comment, BOOL replace); void expire_servers(time_t t); + +/*The following definitions come from namedbsubnet.c */ + struct subnet_record *find_subnet(struct in_addr bcast_ip); struct subnet_record *find_req_subnet(struct in_addr ip, BOOL bcast); void add_subnet_interfaces(void); @@ -301,12 +370,18 @@ struct subnet_record *add_subnet_entry(struct in_addr bcast_ip, struct in_addr mask_ip, char *name, BOOL add, BOOL lmhosts); void write_browse_list(void); + +/*The following definitions come from namedbwork.c */ + struct work_record *remove_workgroup(struct subnet_record *d, struct work_record *work, BOOL remove_all_servers); struct work_record *find_workgroupstruct(struct subnet_record *d, fstring name, BOOL add); void dump_workgroups(void); + +/*The following definitions come from nameelect.c */ + void check_master_browser(void); void browser_gone(char *work_name, struct in_addr ip); void send_election(struct subnet_record *d, char *group,uint32 criterion, @@ -320,7 +395,13 @@ void become_nonmaster(struct subnet_record *d, struct work_record *work, void run_elections(void); void process_election(struct packet_struct *p,char *buf); BOOL check_elections(void); + +/*The following definitions come from namelogon.c */ + void process_logon_packet(struct packet_struct *p,char *buf,int len); + +/*The following definitions come from namepacket.c */ + void debug_browse_data(char *outbuf, int len); void initiate_netbios_packet(uint16 *id, int fd,int quest_type,char *name,int name_type, @@ -336,12 +417,18 @@ void listen_for_packets(BOOL run_election); BOOL send_mailslot_reply(char *mailslot,int fd,char *buf,int len,char *srcname, char *dstname,int src_type,int dest_type, struct in_addr dest_ip,struct in_addr src_ip); + +/*The following definitions come from namequery.c */ + BOOL name_status(int fd,char *name,int name_type,BOOL recurse, struct in_addr to_ip,char *master,char *rname, void (*fn)()); BOOL name_query(int fd,char *name,int name_type, BOOL bcast,BOOL recurse, struct in_addr to_ip, struct in_addr *ip,void (*fn)()); + +/*The following definitions come from nameresp.c */ + void expire_netbios_response_entries(); struct response_record *queue_netbios_pkt_wins(struct subnet_record *d, int fd,int quest_type,enum state_type state, @@ -353,12 +440,18 @@ struct response_record *queue_netbios_packet(struct subnet_record *d, int name_type,int nb_flags, time_t ttl, BOOL bcast,BOOL recurse, struct in_addr send_ip, struct in_addr reply_to_ip); + +/*The following definitions come from nameserv.c */ + void remove_name_entry(struct subnet_record *d, char *name,int type); void add_my_name_entry(struct subnet_record *d,char *name,int type,int nb_flags); void add_my_names(void); void remove_my_names(); void refresh_my_names(time_t t); void query_refresh_names(void); + +/*The following definitions come from nameservreply.c */ + void add_name_respond(struct subnet_record *d, int fd, struct in_addr from_ip, uint16 response_id, struct nmb_name *name, @@ -372,15 +465,27 @@ void reply_name_release(struct packet_struct *p); void reply_name_reg(struct packet_struct *p); void reply_name_status(struct packet_struct *p); void reply_name_query(struct packet_struct *p); + +/*The following definitions come from nameservresp.c */ + void debug_state_type(int state); void response_netbios_packet(struct packet_struct *p); + +/*The following definitions come from namework.c */ + void reset_server(char *name, int state, struct in_addr ip); void tell_become_backup(void); BOOL same_context(struct dgram_packet *dgram); BOOL listening_name(struct work_record *work, struct nmb_name *n); BOOL listening_type(struct packet_struct *p, int command); void process_browse_packet(struct packet_struct *p,char *buf,int len); + +/*The following definitions come from nmbd.c */ + BOOL reload_services(BOOL test); + +/*The following definitions come from nmblib.c */ + void debug_nmb_packet(struct packet_struct *p); char *namestr(struct nmb_name *n); void free_nmb_packet(struct nmb_packet *nmb); @@ -389,11 +494,23 @@ struct packet_struct *read_packet(int fd,enum packet_type packet_type); void make_nmb_name(struct nmb_name *n,char *name,int type,char *this_scope); BOOL send_packet(struct packet_struct *p); struct packet_struct *receive_packet(int fd,enum packet_type type,int t); + +/*The following definitions come from nmblookup.c */ + int main(int argc,char *argv[]); + +/*The following definitions come from nmbsync.c */ + char *getsmbpass(char *pass); void sync_browse_lists(struct subnet_record *d, struct work_record *work, char *name, int nm_type, struct in_addr ip); + +/*The following definitions come from params.c */ + BOOL pm_process(char *pszFileName,BOOL (*sfunc)(char *),BOOL (*pfunc)(char *,char *)); + +/*The following definitions come from password.c */ + void generate_next_challenge(char *challenge); BOOL set_challenge(char *challenge); BOOL last_challenge(char *challenge); @@ -413,21 +530,36 @@ BOOL authorise_login(int snum,char *user,char *password, int pwlen, BOOL check_hosts_equiv(char *user); BOOL server_cryptkey(char *buf); BOOL server_validate(char *buf); + +/*The following definitions come from pcap.c */ + BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); void pcap_printer_fn(void (*fn)()); + +/*The following definitions come from predict.c */ + int read_predict(int fd,int offset,char *buf,char **ptr,int num); void do_read_prediction(); void invalidate_read_prediction(int fd); + +/*The following definitions come from printing.c */ + void lpq_reset(int snum); void print_file(int fnum); int get_printqueue(int snum,int cnum,print_queue_struct **queue, print_status_struct *status); void del_printqueue(int cnum,int snum,int jobid); void status_printjob(int cnum,int snum,int jobid,int status); + +/*The following definitions come from quotas.c */ + BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); + +/*The following definitions come from replace.c */ + char *Strstr(char *s, char *p); time_t Mktime(struct tm *t); int InNetGr(char *group,char *host,char *user,char *dom); @@ -435,6 +567,9 @@ void *malloc_wrapped(int size,char *file,int line); void *realloc_wrapped(void *ptr,int size,char *file,int line); void free_wrapped(void *ptr,char *file,int line); void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line); + +/*The following definitions come from reply.c */ + int reply_special(char *inbuf,char *outbuf); int reply_tcon(char *inbuf,char *outbuf); int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize); @@ -485,6 +620,9 @@ int reply_writebmpx(char *inbuf,char *outbuf); int reply_writebs(char *inbuf,char *outbuf); int reply_setattrE(char *inbuf,char *outbuf); int reply_getattrE(char *inbuf,char *outbuf); + +/*The following definitions come from server.c */ + mode_t unix_mode(int cnum,int dosmode); int dos_mode(int cnum,char *path,struct stat *sbuf); int dos_chmod(int cnum,char *fname,int dosmode,struct stat *st); @@ -526,6 +664,9 @@ void standard_sub(int cnum,char *s); char *smb_fn_name(int type); int chain_reply(int type,char *inbuf,char *inbuf2,char *outbuf,char *outbuf2,int size,int bufsize); int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); + +/*The following definitions come from smbencrypt.c */ + void str_to_key(uchar *str,uchar *key); void D1(uchar *k, uchar *d, uchar *out); void E1(uchar *k, uchar *d, uchar *out); @@ -534,10 +675,26 @@ void E_P24(uchar *p21, uchar *c8, uchar *p24); void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); void E_md4hash(uchar *passwd, uchar *p16); void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); + +/*The following definitions come from smbpass.c */ + +struct smb_passwd *get_smbpwnam(char *name); + +/*The following definitions come from smbpasswd.c */ + + +/*The following definitions come from smbrun.c */ + + +/*The following definitions come from status.c */ + void Ucrit_addUsername(pstring username); unsigned int Ucrit_checkUsername(pstring username); void Ucrit_addPid(int pid); unsigned int Ucrit_checkPid(int pid); + +/*The following definitions come from system.c */ + int sys_select(fd_set *fds,struct timeval *tval); int sys_select(fd_set *fds,struct timeval *tval); int sys_unlink(char *fname); @@ -552,7 +709,16 @@ int sys_utime(char *fname,struct utimbuf *times); int sys_rename(char *from, char *to); int sys_chown(char *fname,int uid,int gid); int sys_chroot(char *dname); + +/*The following definitions come from testparm.c */ + + +/*The following definitions come from testprns.c */ + int main(int argc, char *argv[]); + +/*The following definitions come from time.c */ + void GetTimeOfDay(struct timeval *tval); void TimeInit(void); int TimeDiff(time_t t); @@ -567,20 +733,35 @@ time_t make_unix_date2(void *date_ptr); time_t make_unix_date3(void *date_ptr); BOOL set_filetime(char *fname,time_t mtime); char *timestring(void ); + +/*The following definitions come from trans2.c */ + int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize); int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize); int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize); int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize); + +/*The following definitions come from ufc.c */ + char *ufc_crypt(char *key,char *salt); + +/*The following definitions come from uid.c */ + void init_uid(void); BOOL become_guest(void); BOOL become_user(int cnum, int uid); BOOL unbecome_user(void ); int smbrun(char *cmd,char *outfile); + +/*The following definitions come from username.c */ + char *get_home_dir(char *user); void map_username(char *user); struct passwd *Get_Pwnam(char *user,BOOL allow_change); BOOL user_in_list(char *user,char *list); + +/*The following definitions come from util.c */ + void setup_logging(char *pname,BOOL interactive); void reopen_logs(void); BOOL is_a_socket(int fd); @@ -687,6 +868,9 @@ char *gidtoname(int gid); void BlockSignals(BOOL block); void ajt_panic(void); char *readdirname(void *p); + +/*The following definitions come from vt_mode.c */ + int VT_Check(char *buffer); int VT_Start_utmp(void); int VT_Stop_utmp(void); diff --git a/source3/include/smb.h b/source3/include/smb.h index 0e9c9983d2..05924de35e 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -108,10 +108,16 @@ typedef unsigned int uint32; #else EXTERN int syslog_level; -#define DEBUG(level,body) ((DEBUGLEVEL>=(level))? \ - (syslog_level = (level), Debug1 body):0) +#define DEBUG(level,body) ((DEBUGLEVEL>=(level))? (syslog_level = (level), Debug1 body):0) #endif +/* this defines the error codes that receive_smb can put in smberrcode */ +#define SMBERR_OK 0 +#define SMBERR_TIMEOUT 1 +#define SMBERR_EOF 2 +#define SMBERR_ERROR 3 + + #define DIR_STRUCT_SIZE 43 /* these define all the command types recognised by the server - there -- cgit From 90357bb3b0a9cc65308800c7a483975fdb384637 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 18 Jul 1996 10:54:15 +0000 Subject: preparing for release of 1.9.16alpha11 (This used to be commit b9d7b458b901ffb5ccf62c0e5bf461090ed6e0dd) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 7bde637b18..09f8a104e1 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16a10" +#define VERSION "1.9.16alpha11" -- cgit From bcfba000df14c5178fb761cf8ceb08b337b52b79 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 18 Jul 1996 17:09:22 +0000 Subject: NeXT needs #define pid_t int in includes.h namedbname.c:find_name_search() needed search capability on both local subnet records and WINS records. it used to return NULL if the name was not found in the local subnet records even if you asked it to search the WINS name records as well. (This used to be commit 96c2efded884ce4390c5da68afaccca9acc17558) --- source3/include/includes.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 55423dc431..56a63d46ae 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -584,6 +584,7 @@ char *mktemp(char *); /* No standard include */ #define mode_t int #define GID_TYPE int #define gid_t int +#define pid_t int #define SIGNAL_CAST (void (*)(int)) #define WAIT3_CAST1 (union wait *) #define HAVE_GMTOFF -- cgit From 847fe7e4568d196f45b860f0d5b921d694b55298 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Fri, 19 Jul 1996 09:34:54 +0000 Subject: preparing for release of 1.9.16alpha12 (This used to be commit eae670a7ca9e233f778c84323af861a47eec6ad7) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 09f8a104e1..2376ca9939 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16alpha11" +#define VERSION "1.9.16alpha12" -- cgit From 234b8c602209d966c5b82148b521d9711e08c4b3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 22 Jul 1996 14:32:38 +0000 Subject: removed the remote interfaces stuff. (This used to be commit 51e5a1a546adf6ba36c7e4c3298c651cff7e15b9) --- source3/include/nameserv.h | 2 -- source3/include/proto.h | 1 - 2 files changed, 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index b634250c81..7a97097e78 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -251,8 +251,6 @@ struct subnet_record struct in_addr bcast_ip; struct in_addr mask_ip; struct in_addr myip; - - BOOL my_interface; }; /* a resource record */ diff --git a/source3/include/proto.h b/source3/include/proto.h index 66c21ebfaf..1f3a251fec 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -142,7 +142,6 @@ char *lp_character_set(void); char *lp_logon_script(void); char *lp_wins_server(void); char *lp_interfaces(void); -char *lp_remote_interfaces(void); BOOL lp_wins_support(void); BOOL lp_wins_proxy(void); BOOL lp_domain_master(void); -- cgit From 6b680bb89c05f4c67e78b927cab4231b647406d7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 24 Jul 1996 06:14:51 +0000 Subject: minor cleanups (This used to be commit 7c8fd43b4e78f439406c3bb4478adf99ae17172f) --- source3/include/proto.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 1f3a251fec..faddbc6a49 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -677,6 +677,8 @@ void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); /*The following definitions come from smbpass.c */ +int pw_file_lock(char *name, int type, int secs); +int pw_file_unlock(int fd); struct smb_passwd *get_smbpwnam(char *name); /*The following definitions come from smbpasswd.c */ -- cgit From 2b4b7b4e1adbd2aac9aab89b28df82fc145a6d87 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 30 Jul 1996 15:47:30 +0000 Subject: fix a bug that we've had for a long time where we don't handle EOF properly from clients, and end up looping like mad. At least I _hope_ this is fixed. (This used to be commit a7c7d7afe2ef81f4a74584ce9b71e54442f7e484) --- source3/include/proto.h | 5 ++--- source3/include/smb.h | 9 ++++----- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index faddbc6a49..60b8eed59a 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -636,7 +636,7 @@ BOOL check_file_sharing(int cnum,char *fname); void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun, int mode,int *Access,int *action); int seek_file(int fnum,int pos); -int read_file(int fnum,char *data,int pos,int mincnt,int maxcnt,int timeout,BOOL exact); +int read_file(int fnum,char *data,int pos,int n); int write_file(int fnum,char *data,int n); BOOL become_service(int cnum,BOOL do_chdir); int find_service(char *service); @@ -819,8 +819,7 @@ void make_dir_struct(char *buf,char *mask,char *fname,unsigned int size,int mode void close_low_fds(void); int write_socket(int fd,char *buf,int len); int read_udp_socket(int fd,char *buf,int len); -int set_blocking(int fd, BOOL set); -int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out,BOOL exact); +int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out); int read_max_udp(int fd,char *buffer,int bufsize,int maxtime); int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew); BOOL send_keepalive(int client); diff --git a/source3/include/smb.h b/source3/include/smb.h index 05924de35e..317f31b19e 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -111,11 +111,10 @@ EXTERN int syslog_level; #define DEBUG(level,body) ((DEBUGLEVEL>=(level))? (syslog_level = (level), Debug1 body):0) #endif -/* this defines the error codes that receive_smb can put in smberrcode */ -#define SMBERR_OK 0 -#define SMBERR_TIMEOUT 1 -#define SMBERR_EOF 2 -#define SMBERR_ERROR 3 +/* this defines the error codes that receive_smb can put in smb_read_error */ +#define READ_TIMEOUT 1 +#define READ_EOF 2 +#define READ_ERROR 3 #define DIR_STRUCT_SIZE 43 -- cgit From 9bf446124b5ad991e071f92eeabcbb838eb9f50b Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 30 Jul 1996 15:48:22 +0000 Subject: preparing for release of 1.9.16alpha13 (This used to be commit 801fe1066e7bae8b49e7396b04efe1d7135bbb05) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 2376ca9939..668878a74f 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16alpha12" +#define VERSION "1.9.16alpha13" -- cgit From 3ffb30e8be5bcddca9d0489e1993085a4995c3af Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 1 Aug 1996 17:49:40 +0000 Subject: local_only NetServerEnum syncs can now be issued. bug spotted in nameservresp.c - arguments to test subnet the response is received on (same_net()) were the wrong way round (ccm@shentel.net) samba was adding WORKGROUP(1e) as a unique not a group name: fixed this bug in reply_name_status() and reply_name_query(): WINS entries weren't being looked up. name status reply adds local SELF entries to WINS SELF entries: some SELF entries are only added locally, while others are only added via WINS. name status needs to have both, combined. a sync will only occur when an ANN_LocalMasterAnnouncement is received, NOT an ANN_HostAnnouncement or an ANN_DomainAnnouncement. when samba is a member of a workgroup, it looks for (using a wins server) and announces to its domain master. NAME_QUERY_ANNOUNCE_HOST - yet another 'state' - has been created to do this: do the name query on the wins server and send the announce host to the answer to this query. jeremy @ vantive wrote the original code to do this, which used the name_query() function. i'm trying to avoid name_query: it times out and generally messes things up, but using queue_netbios_packet() and queue_netbios_pkt_wins() is... not intuitive? lkcl with help from jra (This used to be commit 6e932e4bae8b46e7ff4a55a75484bad78308336a) --- source3/include/nameserv.h | 25 +++++++++++++++++-------- source3/include/proto.h | 20 ++++++++++++++++---- 2 files changed, 33 insertions(+), 12 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 7a97097e78..582378e183 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -48,10 +48,10 @@ #define NB_ACTIVE 0x04 #define NB_CONFL 0x08 #define NB_DEREG 0x10 -#define NB_BFLAG 0x00 -#define NB_PFLAG 0x20 -#define NB_MFLAG 0x40 -#define NB__FLAG 0x60 +#define NB_BFLAG 0x00 /* broadcast node type */ +#define NB_PFLAG 0x20 /* point-to-point node type */ +#define NB_MFLAG 0x40 /* mixed bcast & p-p node type */ +#define NB_HFLAG 0x60 /* microsoft 'hybrid' node type */ #define NB_FLGMSK 0x60 #define REFRESH_TIME (15*60) @@ -68,7 +68,7 @@ #define NAME_BFLAG(p) (((p) & NB_FLGMSK) == NB_BFLAG) #define NAME_PFLAG(p) (((p) & NB_FLGMSK) == NB_PFLAG) #define NAME_MFLAG(p) (((p) & NB_FLGMSK) == NB_MFLAG) -#define NAME__FLAG(p) (((p) & NB_FLGMSK) == NB__FLAG) +#define NAME_HFLAG(p) (((p) & NB_FLGMSK) == NB_HFLAG) /* server type identifiers */ #define AM_MASTER(work) (work->ServerType & SV_TYPE_MASTER_BROWSER) @@ -99,14 +99,16 @@ enum master_state enum state_type { - NAME_STATUS_PDC_SRV_CHK, + NAME_STATUS_DOM_SRV_CHK, NAME_STATUS_SRV_CHK, NAME_REGISTER_CHALLENGE, NAME_REGISTER, NAME_RELEASE, NAME_QUERY_CONFIRM, - NAME_QUERY_SYNC, - NAME_QUERY_PDC_SRV_CHK, + NAME_QUERY_ANNOUNCE_HOST, + NAME_QUERY_SYNC_LOCAL, + NAME_QUERY_SYNC_REMOTE, + NAME_QUERY_DOM_SRV_CHK, NAME_QUERY_SRV_CHK, NAME_QUERY_FIND_MST, NAME_QUERY_MST_CHK @@ -147,6 +149,7 @@ struct browse_cache_record struct in_addr ip; time_t sync_time; BOOL synced; + BOOL local; }; /* this is used to hold the list of servers in my domain, and is */ @@ -190,6 +193,8 @@ struct work_record }; /* initiated name queries recorded in this list to track any responses... */ +/* sadly, we need to group everything together. i suppose that if this + gets unwieldy, then a union ought to be considered. oh for c++... */ struct response_record { struct response_record *next; @@ -204,6 +209,10 @@ struct response_record int nb_flags; time_t ttl; + int server_type; + fstring my_name; + fstring my_comment; + BOOL bcast; BOOL recurse; struct in_addr send_ip; diff --git a/source3/include/proto.h b/source3/include/proto.h index 60b8eed59a..10f2bc3325 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -295,6 +295,11 @@ void sync_server(enum state_type state, char *serv_name, char *work_name, int name_type, struct in_addr ip); void announce_backup(void); +void do_announce_host(int command, + char *from_name, int from_type, struct in_addr from_ip, + char *to_name , int to_type , struct in_addr to_ip, + time_t announce_interval, + char *server_name, int server_type, char *server_comment); void remove_my_servers(void); void announce_server(struct subnet_record *d, struct work_record *work, char *name, char *comment, time_t ttl, int server_type); @@ -305,11 +310,15 @@ void announce_master(void); void expire_browse_cache(time_t t); struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, - time_t ttl, struct in_addr ip); + time_t ttl, struct in_addr ip, BOOL local); void do_browser_lists(void); +/*The following definitions come from namedb.c */ + + /*The following definitions come from namedbname.c */ +void set_samba_nb_type(void); BOOL name_equal(struct nmb_name *n1,struct nmb_name *n2); BOOL ms_browser_name(char *name, int type); void remove_name(struct subnet_record *d, struct name_record *n); @@ -342,6 +351,7 @@ void remove_response_record(struct subnet_record *d, struct response_record *make_response_queue_record(enum state_type state, int id,uint16 fd, int quest_type, char *name,int type, int nb_flags, time_t ttl, + int server_type, char *my_name, char *my_comment, BOOL bcast,BOOL recurse, struct in_addr send_ip, struct in_addr reply_to_ip); struct response_record *find_response_record(struct subnet_record **d, @@ -432,13 +442,15 @@ void expire_netbios_response_entries(); struct response_record *queue_netbios_pkt_wins(struct subnet_record *d, int fd,int quest_type,enum state_type state, char *name,int name_type,int nb_flags, time_t ttl, + int server_type, char *my_name, char *my_comment, BOOL bcast,BOOL recurse, struct in_addr send_ip, struct in_addr reply_to_ip); struct response_record *queue_netbios_packet(struct subnet_record *d, int fd,int quest_type,enum state_type state,char *name, int name_type,int nb_flags, time_t ttl, - BOOL bcast,BOOL recurse, - struct in_addr send_ip, struct in_addr reply_to_ip); + int server_type, char *my_name, char *my_comment, + BOOL bcast,BOOL recurse, + struct in_addr send_ip, struct in_addr reply_to_ip); /*The following definitions come from nameserv.c */ @@ -502,7 +514,7 @@ int main(int argc,char *argv[]); char *getsmbpass(char *pass); void sync_browse_lists(struct subnet_record *d, struct work_record *work, - char *name, int nm_type, struct in_addr ip); + char *name, int nm_type, struct in_addr ip, BOOL local); /*The following definitions come from params.c */ -- cgit From 26c4a63580f2542952537f362032452a9f9b12bb Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sat, 3 Aug 1996 00:25:05 +0000 Subject: preparing for release of 1.9.16alpha15 (This used to be commit 043898aa851bfda3db23f558719a7aab2df478de) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 668878a74f..807a7c6651 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16alpha13" +#define VERSION "1.9.16alpha15" -- cgit From d2e0d9d7e3ba3121ed135ff881b6320a159de116 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Mon, 5 Aug 1996 18:23:10 +0000 Subject: preparing for release of 1.9.16alpha14 (This used to be commit 32f495cf2261925ca3f0971eca6a6798584af653) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 807a7c6651..0568e3075f 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16alpha15" +#define VERSION "1.9.16alpha14" -- cgit From 6d3eb881e284659262fd78c6ad269d6882e1f8cd Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 6 Aug 1996 09:52:41 +0000 Subject: preparing for release of 1.9.16alpha16 (This used to be commit 6567bac5d13f32729fe51eba1e904268c6ee00be) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 0568e3075f..b9d03689c5 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16alpha14" +#define VERSION "1.9.16alpha16" -- cgit From 396311075cc808278e6dd8469e3ac7eb7e7498c7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 13 Aug 1996 08:57:55 +0000 Subject: - sequent-ptx support from bressler@iftccu.ca.boeing.com (Rick Bressler) - machten support from Trevor Strohman (trev@figment.tenon.com) - added qinfo command to client as part of drag-and-drop printer support for win95 from David Chappell He also added the "printer driver" option - use sigblock() on more systems and use sigsetmask(0) instead of sigunblock() as its more portable. This beats a problem with zombies on heavilily loaded systems. - added internals.doc written by David Chappell into the source tree - get rid of PRINT_COMMAND options from local.h as they are no longer relevent - new kanji code from Fujita - don't set the recursion_available flag on queries in nmbd - fix a potential bug with pointer subtraction in printing.c - got rid of error_count code as the real fix (the EOF problem) is now in (This used to be commit aa6f8b04d125b5bc00f267abf72b800228aabf7d) --- source3/include/includes.h | 9 +++++++++ source3/include/local.h | 11 ----------- source3/include/proto.h | 5 ++--- 3 files changed, 11 insertions(+), 14 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 56a63d46ae..bcf79ac79a 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -223,6 +223,7 @@ Here come some platform specific sections #define USE_SETSID #define HAVE_BZERO #define HAVE_MEMMOVE +#define USE_SIGBLOCK #if _LINUX_C_LIB_VERSION_MAJOR >= 5 #define USE_SETFS #endif @@ -255,6 +256,7 @@ typedef unsigned short mode_t; #endif #define REPLACE_GETPASS #define BSD_TERMIO +#define USE_SIGBLOCK #endif @@ -288,6 +290,7 @@ extern int innetgr (const char *, const char *, const char *, const char *); #define USE_GETCWD #define USE_SETSID #define REPLACE_GETPASS +#define USE_SIGBLOCK #endif @@ -479,6 +482,7 @@ char *mktemp(char *); /* No standard include */ #include #define SYSV #define USE_WAITPID +#define USE_SIGBLOCK #define SIGNAL_CAST (void (*)()) #define DEFAULT_PRINTING PRINT_AIX /* we undef this because sys/param.h is broken in aix. uggh. */ @@ -529,7 +533,12 @@ char *mktemp(char *); /* No standard include */ #define NO_EID #define STATFS4 #define USE_DIRECT +#ifdef PTX4 +#undef USE_DIRECT #endif +#endif + + #ifdef SEQUENT_PTX4 #include diff --git a/source3/include/local.h b/source3/include/local.h index 2cfacd66b3..5a577909e1 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -53,17 +53,6 @@ /* this is where browse lists are kept in the lock dir */ #define SERVER_LIST "browse.dat" -/* the print command on the server, %s is replaced with the filename */ -/* note that the -r removes the file after printing - you'll run out */ -/* of disk pretty quickly if you don't. This command is only used as */ -/* the default - it can be overridden in the configuration file. */ -#define PRINT_COMMAND "lpr -r %s" - -/* the lpq command on the server. the printername is passed as an argument */ -#ifndef LPQ_COMMAND -#define LPQ_COMMAND "lpq -P" -#endif - /* shall guest entries in printer queues get changed to user entries, so they can be deleted using the windows print manager? */ #define LPQ_GUEST_TO_USER diff --git a/source3/include/proto.h b/source3/include/proto.h index 10f2bc3325..4d1c4bf6f9 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -194,6 +194,7 @@ char *lp_lprmcommand(int ); char *lp_lppausecommand(int ); char *lp_lpresumecommand(int ); char *lp_printername(int ); +char *lp_printerdriver(int ); char *lp_hostsallow(int ); char *lp_hostsdeny(int ); char *lp_magicscript(int ); @@ -313,9 +314,6 @@ struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, time_t ttl, struct in_addr ip, BOOL local); void do_browser_lists(void); -/*The following definitions come from namedb.c */ - - /*The following definitions come from namedbname.c */ void set_samba_nb_type(void); @@ -720,6 +718,7 @@ int sys_rmdir(char *dname); int sys_chdir(char *dname); int sys_utime(char *fname,struct utimbuf *times); int sys_rename(char *from, char *to); +int sys_chmod(char *fname,int mode); int sys_chown(char *fname,int uid,int gid); int sys_chroot(char *dname); -- cgit From fcbd379d34a43660c9dc29eb880327508c7ef6fc Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 13 Aug 1996 12:36:58 +0000 Subject: preparing for release of 1.9.16alpha17 (This used to be commit 16f10b333da0956cc501f77777957753d7e156b2) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index b9d03689c5..891d626693 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16alpha16" +#define VERSION "1.9.16alpha17" -- cgit From d2be32ca09b13a4c1c572e06235f64fd55ee8afd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 14 Aug 1996 15:00:00 +0000 Subject: disabled SETFS (which was only enabled for Linux) until we resolve a couple of bug reports that may be caused by it. Andrew (This used to be commit 424814bed710a96d87786763b851a11ea1103026) --- source3/include/includes.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index bcf79ac79a..3057531f7f 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -224,9 +224,12 @@ Here come some platform specific sections #define HAVE_BZERO #define HAVE_MEMMOVE #define USE_SIGBLOCK +#if 0 +/* SETFS disabled until we can check on some bug reports */ #if _LINUX_C_LIB_VERSION_MAJOR >= 5 #define USE_SETFS #endif +#endif #ifdef SHADOW_PWD #ifndef crypt #define crypt pw_encrypt -- cgit From ebc96b7309dbce110ae63bcb91dd8ad5a2cadbbf Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 14 Aug 1996 15:02:28 +0000 Subject: changed "unsigned long" to "uint32" in several places (for IP addresses) to keep 64 bit machines happy. (This used to be commit b4aaec504ae66dc6a0f05d12529100cb62d47afd) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 4d1c4bf6f9..dd9413605f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -866,7 +866,7 @@ int open_socket_in(int type, int port, int dlevel); int open_socket_out(int type, struct in_addr *addr, int port ); int interpret_protocol(char *str,int def); int interpret_security(char *str,int def); -unsigned long interpret_addr(char *str); +uint32 interpret_addr(char *str); struct in_addr *interpret_addr2(char *str); BOOL zero_ip(struct in_addr ip); void standard_sub_basic(char *s); -- cgit From 47673b32ed4a907b380b70d5f4f366ba8be301d2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 15 Aug 1996 15:11:34 +0000 Subject: - added FAST_SHARE_MODES code - added some named pipe code from Jim (This used to be commit c94866e9e44ea1eb72da06bc65ef1c032ae8e0c9) --- source3/include/includes.h | 8 ++++---- source3/include/proto.h | 34 ++++++++++++++++++++++++++++++++-- source3/include/smb.h | 26 +++++++++++++++++++++++--- 3 files changed, 59 insertions(+), 9 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 3057531f7f..fd468abc07 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -183,7 +183,7 @@ #endif #endif -#if USE_MMAP +#if defined(USE_MMAP) || defined(FAST_SHARE_MODES) #include #endif @@ -223,7 +223,7 @@ Here come some platform specific sections #define USE_SETSID #define HAVE_BZERO #define HAVE_MEMMOVE -#define USE_SIGBLOCK +#define USE_SIGPROCMASK #if 0 /* SETFS disabled until we can check on some bug reports */ #if _LINUX_C_LIB_VERSION_MAJOR >= 5 @@ -259,7 +259,7 @@ typedef unsigned short mode_t; #endif #define REPLACE_GETPASS #define BSD_TERMIO -#define USE_SIGBLOCK +#define USE_SIGPROCMASK #endif @@ -293,7 +293,7 @@ extern int innetgr (const char *, const char *, const char *, const char *); #define USE_GETCWD #define USE_SETSID #define REPLACE_GETPASS -#define USE_SIGBLOCK +#define USE_SIGPROCMASK #endif diff --git a/source3/include/proto.h b/source3/include/proto.h index dd9413605f..04f5ef158d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -259,12 +259,14 @@ void file_unlock(int fd); BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset); BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); +BOOL start_share_mode_mgmt(void); +BOOL stop_share_mode_mgmt(void); int get_share_mode_by_fnum(int cnum,int fnum,int *pid); int get_share_mode_byname(int cnum,char *fname,int *pid); int get_share_mode(int cnum,struct stat *sbuf,int *pid); void del_share_mode(int fnum); BOOL set_share_mode(int fnum,int mode); -void clean_share_files(void); +void clean_share_modes(void); /*The following definitions come from mangle.c */ @@ -545,6 +547,18 @@ BOOL server_validate(char *buf); BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); void pcap_printer_fn(void (*fn)()); +/*The following definitions come from pipes.c */ + +int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize); +BOOL api_LsarpcSNPHS(int cnum,int uid, char *param,char *data, + int mdrcnt,int mprcnt, + char **rdata,char **rparam, + int *rdata_len,int *rparam_len); +BOOL api_LsarpcTNP(int cnum,int uid, char *param,char *data, + int mdrcnt,int mprcnt, + char **rdata,char **rparam, + int *rdata_len,int *rparam_len); + /*The following definitions come from predict.c */ int read_predict(int fd,int offset,char *buf,char **ptr,int num); @@ -674,6 +688,22 @@ char *smb_fn_name(int type); int chain_reply(int type,char *inbuf,char *inbuf2,char *outbuf,char *outbuf2,int size,int bufsize); int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); +/*The following definitions come from shmem.c */ + +BOOL shm_open( char *file_name, int size); +BOOL shm_close( void ); +shm_offset_t shm_alloc(int size); +BOOL shm_free(shm_offset_t offset); +shm_offset_t shm_get_userdef_off(void); +BOOL shm_set_userdef_off(shm_offset_t userdef_off); +void * shm_offset2addr(shm_offset_t offset); +shm_offset_t shm_addr2offset(void *addr); +BOOL shm_lock(void); +BOOL shm_unlock(void); +BOOL shm_get_usage(int *bytes_free, + int *bytes_used, + int *bytes_overhead); + /*The following definitions come from smbencrypt.c */ void str_to_key(uchar *str,uchar *key); @@ -876,7 +906,7 @@ struct hostent *Get_Hostbyname(char *name); BOOL process_exists(int pid); char *uidtoname(int uid); char *gidtoname(int gid); -void BlockSignals(BOOL block); +void BlockSignals(BOOL block,int signum); void ajt_panic(void); char *readdirname(void *p); diff --git a/source3/include/smb.h b/source3/include/smb.h index 317f31b19e..c9180dd50c 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -36,8 +36,9 @@ #define BUFFER_SIZE (0xFFFF) #define SAFETY_MARGIN 1024 -#ifndef EXTERN -# define EXTERN extern +/* size of shared memory used for share mode locking */ +#ifndef SHMEM_SIZE +#define SHMEM_SIZE 102400 #endif #define NMB_PORT 137 @@ -53,6 +54,11 @@ typedef int BOOL; +/* offset in shared memory */ +typedef int shm_offset_t; +#define NULL_OFFSET (shm_offset_t)(0) + + /* Samba needs type definitions for int16, int32, uint16 and uint32. @@ -106,7 +112,7 @@ typedef unsigned int uint32; #ifndef SYSLOG #define DEBUG(level,body) ((DEBUGLEVEL>=(level))?(Debug1 body):0) #else -EXTERN int syslog_level; +extern int syslog_level; #define DEBUG(level,body) ((DEBUGLEVEL>=(level))? (syslog_level = (level), Debug1 body):0) #endif @@ -395,6 +401,20 @@ struct interface struct in_addr nmask; }; +/* share mode record in shared memory */ +typedef struct +{ + shm_offset_t next_offset; /* offset of next record in list in shared mem */ + int locking_version; + int share_mode; + time_t time; + int pid; + dev_t st_dev; + ino_t st_ino; + char file_name[1]; /* dynamically allocated with correct size */ +} share_mode_record; + + /* this is used for smbstatus */ struct connect_record { -- cgit From 8508c953b128a3aecf99cb003d7773a3d40be789 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 16 Aug 1996 07:39:46 +0000 Subject: added support for the Bull Operating System (BOS) (This used to be commit 46277e64a1bcfeff3715ebca3657ef4103ac4664) --- source3/include/includes.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index fd468abc07..79400683fe 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -891,6 +891,20 @@ typedef int mode_t; #endif +#ifdef BOS +#define SIGNAL_CAST (void (*)(int)) +#include +#include +#include +#include +#include +#include +#include +#include +#endif + + + /******************************************************************* end of the platform specific sections ********************************************************************/ -- cgit From f63d4c830aa88d20ababe4c3543bff7becc3a506 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 16 Aug 1996 13:03:26 +0000 Subject: - added the "remote announce" option - made the lp_string() code able to handle any length string - got rid of the obsolete lmhosts code, instead users should use "interfaces" and "remote announce". lmhosts now is just used as a IP to netbios name map - cleanup the inet_address() code (This used to be commit be2b67940302b2e63890cb865fe3948c2206ea91) --- source3/include/nameserv.h | 2 ++ source3/include/proto.h | 2 ++ 2 files changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 582378e183..5162ebe2d7 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -373,3 +373,5 @@ struct packet_struct /* announce as master to WINS server and any Primary Domain Controllers */ #define CHECK_TIME_MST_ANNOUNCE 15 +/* do all remote announcements this often */ +#define REMOTE_ANNOUNCE_INTERVAL 180 diff --git a/source3/include/proto.h b/source3/include/proto.h index 04f5ef158d..d3e9f42ae8 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -140,6 +140,7 @@ char *lp_domain_controller(void); char *lp_username_map(void); char *lp_character_set(void); char *lp_logon_script(void); +char *lp_remote_announce(void); char *lp_wins_server(void); char *lp_interfaces(void); BOOL lp_wins_support(void); @@ -308,6 +309,7 @@ void announce_server(struct subnet_record *d, struct work_record *work, char *name, char *comment, time_t ttl, int server_type); void announce_host(void); void announce_master(void); +void announce_remote(void); /*The following definitions come from namebrowse.c */ -- cgit From 6afac1c3a6fe9530008b91867ff3d364ea415a43 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Fri, 16 Aug 1996 13:15:55 +0000 Subject: preparing for release of 1.9.16alpha18 (This used to be commit 15c1c848506cdb9e8d19ee9f7c250b90b60b76da) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 891d626693..329f3c1b2e 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16alpha17" +#define VERSION "1.9.16alpha18" -- cgit From 28177ca73bdbe3f8fb17a608db3df1a39e0e37a4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 17 Aug 1996 11:37:44 +0000 Subject: - added support for Amiga-unix (based on BSD I think) - changed the order of PROGS and SPROGS in Makefile (SPROGS first) - another 64 bit cleanup (for INADDR_NONE) - added paranoia code in DirCacheAdd() to detect looping - fixed important DirCache flush bug - rewrote the NetServerEnum code after I found it could return servers from multiple workgroups at once, and this could cause browsing havoc. Now a null workgroup query is equivalent to a query for the servers primary workgroup - got rid of my_workgroup() - got rid of "workgroup = *" comment in Makefile. We no longer support a workgroup of *, users must set the workgroup explicitly - the wins.dat file was being stored in a different format to what it was being loaded in - this could cause havoc. fixed. - uppercase our netbios name and the workgroup name at startup - if accept fails in main loop when running as a daemon then continue, don't just exit! - don't use ./ on smbclient in smbtar - better code to detect if a process exists (This used to be commit ec3d53963064b50ff33e8eff47812aac82f164ba) --- source3/include/proto.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index d3e9f42ae8..c1697dc641 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -249,7 +249,6 @@ BOOL lp_load(char *pszFname,BOOL global_only); int lp_numservices(void); void lp_dump(void); int lp_servicenumber(char *pszServiceName); -char *my_workgroup(void); char *volume_label(int snum); /*The following definitions come from locking.c */ -- cgit From 82d718317cac27430b0be43a5d7ddc59c26fca22 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sat, 17 Aug 1996 13:17:45 +0000 Subject: - started on support for 'Internet Group names' - type 0x1c NetBIOS names - 0x1d name query to a WINS server should always return FAIL (see WINS server help on nt/as) (This used to be commit a7330127a261f814c56e860b6de658dbef24c33f) --- source3/include/nameserv.h | 12 ++++++++++-- source3/include/proto.h | 5 +++++ 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 5162ebe2d7..a505f403ca 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -121,6 +121,14 @@ struct nmb_name { int name_type; }; +/* a netbios flags + ip address structure */ +/* this is used for multi-homed systems and for internet group names */ +struct nmb_ip +{ + struct in_addr ip; /* ip address of host that owns this name */ + int nb_flags; /* netbios flags */ +}; + /* this is the structure used for the local netbios name list */ struct name_record { @@ -128,8 +136,8 @@ struct name_record struct name_record *prev; struct nmb_name name; /* the netbios name */ - struct in_addr ip; /* ip address of host that owns this name */ - int nb_flags; /* netbios flags */ + struct nmb_ip *ip_flgs; /* the ip + flags */ + int num_ips; /* number of ip+flags entries */ enum name_source source; /* where the name came from */ diff --git a/source3/include/proto.h b/source3/include/proto.h index c1697dc641..87ad286df3 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -796,6 +796,11 @@ BOOL become_user(int cnum, int uid); BOOL unbecome_user(void ); int smbrun(char *cmd,char *outfile); +/*The following definitions come from unxlog.c */ + +void write_utmp(int dologin, int connection, int pid, + char *from_addr, char *username); + /*The following definitions come from username.c */ char *get_home_dir(char *user); -- cgit From efb8113d00a4513c1115640004c0905465d3b673 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 17 Aug 1996 14:27:12 +0000 Subject: - made FAST_SHARE_MODES standard for Linux - you can now press enter after a password prompt with "smbclient -L hostname" and it will use a blank username and password, the same as if you used -U% - changed the wins.dat store code to not go via a string variable (just use fprintf instead) - removed a "unsigned long" that luke put back in, changing it to uint32 to keep 64 bit machines happy. Naughtly luke! - allow guest non-connnected print queue listings so ms client 3 can work (This used to be commit 917160dee69bbc198985b6f3232ca2dcda809d8a) --- source3/include/includes.h | 9 +++++---- source3/include/proto.h | 5 ----- 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 79400683fe..35ef18055c 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -183,10 +183,6 @@ #endif #endif -#if defined(USE_MMAP) || defined(FAST_SHARE_MODES) -#include -#endif - #if defined(GETPWANAM) #include #include @@ -224,6 +220,7 @@ Here come some platform specific sections #define HAVE_BZERO #define HAVE_MEMMOVE #define USE_SIGPROCMASK +#define FAST_SHARE_MODES 1 #if 0 /* SETFS disabled until we can check on some bug reports */ #if _LINUX_C_LIB_VERSION_MAJOR >= 5 @@ -909,6 +906,10 @@ typedef int mode_t; end of the platform specific sections ********************************************************************/ +#if defined(USE_MMAP) || FAST_SHARE_MODES +#include +#endif + #ifdef SecureWare #define NEED_AUTH_PARAMETERS #endif diff --git a/source3/include/proto.h b/source3/include/proto.h index 87ad286df3..c1697dc641 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -796,11 +796,6 @@ BOOL become_user(int cnum, int uid); BOOL unbecome_user(void ); int smbrun(char *cmd,char *outfile); -/*The following definitions come from unxlog.c */ - -void write_utmp(int dologin, int connection, int pid, - char *from_addr, char *username); - /*The following definitions come from username.c */ char *get_home_dir(char *user); -- cgit From 1aedda6160e0748d82a68bcd64f661ea1b80af9d Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sat, 17 Aug 1996 15:14:24 +0000 Subject: - fixed wins.dat reloading (it wasn't happening!) - made nb_flags an unsigned 16 bit int in nameserv.h - nmbd was calling add_my_subnets() with an uninitialised parameter group. removed it. lkcl (This used to be commit 3d55e541569e7ab887bddc284bddcafdf86c4d22) --- source3/include/nameserv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index a505f403ca..8dc737bdb0 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -126,7 +126,7 @@ struct nmb_name { struct nmb_ip { struct in_addr ip; /* ip address of host that owns this name */ - int nb_flags; /* netbios flags */ + uint16 nb_flags; /* netbios flags */ }; /* this is the structure used for the local netbios name list */ -- cgit From db70768da6149fc5b4b894e46dab0e62dc19c681 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sat, 17 Aug 1996 15:18:56 +0000 Subject: preparing for release of 1.9.16alpha19 (This used to be commit 6e87add16f116e55880657c7723442ece35f79da) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 329f3c1b2e..1bcbad0f1a 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16alpha18" +#define VERSION "1.9.16alpha19" -- cgit From 0c33046a0aa0461a5e932dd7b0b6e38ab9708867 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 19 Aug 1996 11:17:29 +0000 Subject: - added "netbios name" option in smb.conf to make controlling the name that samba uses possible - added "socket address" option to allow virtual SMB servers (on systems with IP aliasing line Linux) - disabled FAST_SHARE_MODES by default in Linux as older Linux boxes can't do shared writeable mappings. We really need autoconf ... - added new option types in loadparm so a string type can be specified ot be uppercase only, this is used for the workgroup and netbios name options - auto-create the lock directory if it doesn't exist in shared mem startup - get rid of announce_backup() - change a few comments in nmbd code - rewrote the chaining code completely. Hopefully it will handle any depth chains now. - added LPRng support (This used to be commit e9eac6cd49c352349580ddb13d720cb201aecc48) --- source3/include/includes.h | 1 - source3/include/proto.h | 10 +++++----- source3/include/smb.h | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 35ef18055c..c7acbddc2b 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -220,7 +220,6 @@ Here come some platform specific sections #define HAVE_BZERO #define HAVE_MEMMOVE #define USE_SIGPROCMASK -#define FAST_SHARE_MODES 1 #if 0 /* SETFS disabled until we can check on some bug reports */ #if _LINUX_C_LIB_VERSION_MAJOR >= 5 diff --git a/source3/include/proto.h b/source3/include/proto.h index c1697dc641..9ddf7cb1fd 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -143,6 +143,7 @@ char *lp_logon_script(void); char *lp_remote_announce(void); char *lp_wins_server(void); char *lp_interfaces(void); +char *lp_socket_address(void); BOOL lp_wins_support(void); BOOL lp_wins_proxy(void); BOOL lp_domain_master(void); @@ -297,7 +298,6 @@ void do_announce_request(char *info, char *to_name, int announce_type, void sync_server(enum state_type state, char *serv_name, char *work_name, int name_type, struct in_addr ip); -void announce_backup(void); void do_announce_host(int command, char *from_name, int from_type, struct in_addr from_ip, char *to_name , int to_type , struct in_addr to_ip, @@ -305,7 +305,7 @@ void do_announce_host(int command, char *server_name, int server_type, char *server_comment); void remove_my_servers(void); void announce_server(struct subnet_record *d, struct work_record *work, - char *name, char *comment, time_t ttl, int server_type); + char *name, char *comment, time_t ttl, int server_type); void announce_host(void); void announce_master(void); void announce_remote(void); @@ -686,7 +686,7 @@ BOOL claim_connection(int cnum,char *name,int max_connections,BOOL Clear); void exit_server(char *reason); void standard_sub(int cnum,char *s); char *smb_fn_name(int type); -int chain_reply(int type,char *inbuf,char *inbuf2,char *outbuf,char *outbuf2,int size,int bufsize); +int chain_reply(char *inbuf,char *outbuf,int size,int bufsize); int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); /*The following definitions come from shmem.c */ @@ -891,9 +891,9 @@ int byte_checksum(char *buf,int len); char *dirname_dos(char *path,char *buf); void *Realloc(void *p,int size); void Abort(void ); -BOOL get_myname(char *myname,struct in_addr *ip); +BOOL get_myname(char *my_name,struct in_addr *ip); BOOL ip_equal(struct in_addr ip1,struct in_addr ip2); -int open_socket_in(int type, int port, int dlevel); +int open_socket_in(int type, int port, int dlevel,uint32 socket_addr); int open_socket_out(int type, struct in_addr *addr, int port ); int interpret_protocol(char *str,int def); int interpret_security(char *str,int def); diff --git a/source3/include/smb.h b/source3/include/smb.h index c9180dd50c..349d406b49 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -796,7 +796,7 @@ enum security_types {SEC_SHARE,SEC_USER,SEC_SERVER}; /* printing types */ enum printing_types {PRINT_BSD,PRINT_SYSV,PRINT_AIX,PRINT_HPUX, - PRINT_QNX,PRINT_PLP}; + PRINT_QNX,PRINT_PLP,PRINT_LPRNG}; /* case handling */ -- cgit From e04c08565c843f9eb46f69bbf9c174bc8d5bfa32 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Mon, 19 Aug 1996 11:28:02 +0000 Subject: preparing for release of 1.9.16alpha20 (This used to be commit ced17fd3cbea7c6490f0e7b0949cb60acc644ef8) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 1bcbad0f1a..171a003c27 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16alpha19" +#define VERSION "1.9.16alpha20" -- cgit From cbfdcb4941e2bd28998d2f9ed53f98c5b75994c0 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Mon, 19 Aug 1996 13:56:26 +0000 Subject: preparing for release of 1.9.16alpha21 (This used to be commit 07be656d3ed46dd4cd9cfaefff90300242984301) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 171a003c27..cad94c725d 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16alpha20" +#define VERSION "1.9.16alpha21" -- cgit From 748d65a4ac898708dc7d2fd6f2bdee41489fee86 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 20 Aug 1996 15:45:16 +0000 Subject: - fix a bug in NetServerEnum where counted and total were not counted correctly if there were multiple instances of a name. This led to the infamous "not enough memory" error when browsing (but this isn't the only cause of that message) - fix a triple-chaining bug which affected OpenX following a TconX - fix a serious nmbd bug that meant nmdb would answer packets that it wasn't supposed to, causing havoc with browse lists. - never time out SELF packets. This is an interim fix until I find out why nmbd thought they should be timed out. (This used to be commit 2960c3908c2c3b01a1f2b77def60350018d298e1) --- source3/include/includes.h | 2 ++ source3/include/proto.h | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index c7acbddc2b..5d5fd7fd55 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -227,11 +227,13 @@ Here come some platform specific sections #endif #endif #ifdef SHADOW_PWD +#if _LINUX_C_LIB_VERSION_MAJOR < 5 #ifndef crypt #define crypt pw_encrypt #endif #endif #endif +#endif #ifdef SUNOS4 #define SIGNAL_CAST (void (*)(int)) diff --git a/source3/include/proto.h b/source3/include/proto.h index 9ddf7cb1fd..f257ac0048 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -679,7 +679,6 @@ int reply_coreplus(char *outbuf); int reply_lanman1(char *outbuf); int reply_lanman2(char *outbuf); int reply_nt1(char *outbuf); -void parse_connect(char *buf,char *service,char *user,char *password,int *pwlen,char *dev); void close_cnum(int cnum, int uid); BOOL yield_connection(int cnum,char *name,int max_connections); BOOL claim_connection(int cnum,char *name,int max_connections,BOOL Clear); -- cgit From 1073bd65414d1e436e833c2e32bed129c72e1910 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 20 Aug 1996 16:09:41 +0000 Subject: - removed ServerComment and instead set the comment string in nmbd using the "server string" option. This replaces the -C option to nmbd (This used to be commit 9e0fab2ee6c89155e6ba6b2401a25de37cb89333) --- source3/include/proto.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index f257ac0048..f8685d21ea 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -488,8 +488,6 @@ void response_netbios_packet(struct packet_struct *p); void reset_server(char *name, int state, struct in_addr ip); void tell_become_backup(void); BOOL same_context(struct dgram_packet *dgram); -BOOL listening_name(struct work_record *work, struct nmb_name *n); -BOOL listening_type(struct packet_struct *p, int command); void process_browse_packet(struct packet_struct *p,char *buf,int len); /*The following definitions come from nmbd.c */ -- cgit From 9a52c24a1911d0edced7f77461b5ff37e63577d6 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 20 Aug 1996 16:13:58 +0000 Subject: preparing for release of 1.9.16alpha22 (This used to be commit e1d5205595eec8dcfe2b32e0e31722a902e0ed05) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index cad94c725d..38a4530ee7 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16alpha21" +#define VERSION "1.9.16alpha22" -- cgit From cb6708c9789de17176b0cd3e35b86d9024439b0e Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 20 Aug 1996 16:43:59 +0000 Subject: preparing for release of 1.9.16alpha23 (This used to be commit 50eb07559f750c458dcdf04a4068cd19c40a757d) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 38a4530ee7..8c5512d3b5 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16alpha22" +#define VERSION "1.9.16alpha23" -- cgit From b5a64bb74056fad43afedcb05d29000618170ef4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 21 Aug 1996 06:09:00 +0000 Subject: - new handling of ST_TYPE bits, they are now consolidated much more in DFLT_SERVER_TYPE in nameserv.h - got rid of a lot of spurious domain controller stuff. Samba is not a domain controller yet, but it can be a domain master. We were claiming to be a domain controller in some packets which may have caused problems - don't do preferred master startups on the WINS pseudo-net - don't do election requests on the WINS pseudo-net - fix a nasty bug in become_non_master() which wiped out the bits in remove_type before using them. The result was that samba didn't like losing its master status. - changed the logic in the election packet handling to enable us to become a non-master whenever we receive a winning election frame, even if we aren't expecting it - get another packet from the socket in nmbd when we reject one of our own packets, this stops us from going into the packet reading code too often and makes nmbd much snappier - always remove a name immediately when we try to release it, don't wait for the lack of response from the network, otherwise we will end up replying to name that we don't really own. We still send the dereg packets, we just don't wait for them to time out. (This used to be commit eb84f2f342375439d94481a0ccf47c9593544e32) --- source3/include/nameserv.h | 6 ++++++ source3/include/smb.h | 1 + 2 files changed, 7 insertions(+) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 8dc737bdb0..e4876bac57 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -383,3 +383,9 @@ struct packet_struct /* do all remote announcements this often */ #define REMOTE_ANNOUNCE_INTERVAL 180 + +#define DFLT_SERVER_TYPE (SV_TYPE_WORKSTATION | SV_TYPE_SERVER | \ + SV_TYPE_TIME_SOURCE | SV_TYPE_SERVER_UNIX | \ + SV_TYPE_PRINTQ_SERVER | SV_TYPE_SERVER_NT | \ + SV_TYPE_NT) + diff --git a/source3/include/smb.h b/source3/include/smb.h index 349d406b49..7e002122cc 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -785,6 +785,7 @@ char *Strstr(char *s, char *p); #define SV_TYPE_DOMAIN_ENUM 0x80000000 #define SV_TYPE_ALL 0xFFFFFFFF +/* what server type are we currently */ /* protocol types. It assumes that higher protocols include lower protocols -- cgit From dd7aec877a217f6953715423bbeaa56a36feab48 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 21 Aug 1996 06:10:24 +0000 Subject: preparing for release of 1.9.16alpha24 (This used to be commit feca8d27ec8c63d7daa8e7e9cf13594c55086e28) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 8c5512d3b5..1353f00219 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16alpha23" +#define VERSION "1.9.16alpha24" -- cgit From 4e67124eaa318d8a4efb3850e1028795ca2c2611 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 21 Aug 1996 08:53:53 +0000 Subject: preparing for release of 1.9.16alpha25 (This used to be commit eece931f6753b1a6506c67657c3c24459c7cab1e) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 1353f00219..88cea66b56 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16alpha24" +#define VERSION "1.9.16alpha25" -- cgit From 3d088fd65e3e49949dfd98b464ad6e08f6115099 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 21 Aug 1996 14:15:09 +0000 Subject: - fix a bug handling readraw packets that caused the timeout to be 30 milliseconds instead of 30 seconds as was intended. Thanks to Paul Nelson for finding this bug. (This used to be commit 78f62c83be5df6b66aa0b5e83b2d290f97ce53c2) --- source3/include/smb.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 7e002122cc..f5d35d5261 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -101,12 +101,8 @@ typedef unsigned int uint32; #define DEF_CREATE_MASK (0755) #endif -#ifndef DEFAULT_PIPE_TIMEOUT -#define DEFAULT_PIPE_TIMEOUT 10000000 /* Ten seconds */ -#endif - -/* how long to wait for secondary SMB packets (seconds) */ -#define SMB_SECONDARY_WAIT 30 +/* how long to wait for secondary SMB packets (milli-seconds) */ +#define SMB_SECONDARY_WAIT (60*1000) /* debugging code */ #ifndef SYSLOG -- cgit From 27b2510f1503f1a93a9474bf6b99a0f16f593c90 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 21 Aug 1996 14:16:34 +0000 Subject: preparing for release of 1.9.16alpha26 (This used to be commit 03aaf9a705d190ac040aca82ffcd37d58b9b5bc3) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 88cea66b56..d2a33aef45 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16alpha25" +#define VERSION "1.9.16alpha26" -- cgit From 9155889092ac9ff476d950a0c1b624ebad3cdad6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 22 Aug 1996 06:32:03 +0000 Subject: - add timeouts to connect() for password server connections. This makes multiple password servers practical. (This used to be commit 5c3e8326cc45d3cbd076475e445ce461a2bf7560) --- source3/include/local.h | 4 ++++ source3/include/proto.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index 5a577909e1..3f8572e73d 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -150,4 +150,8 @@ by many apps */ #define KEEP_PASSWORD_SERVER_OPEN 1 +/* how long to wait for a socket connect to happen */ +#define LONG_CONNECT_TIMEOUT 30 +#define SHORT_CONNECT_TIMEOUT 5 + #endif diff --git a/source3/include/proto.h b/source3/include/proto.h index f8685d21ea..e20238fee4 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -856,6 +856,7 @@ BOOL strhaslower(char *s); int count_chars(char *s,char c); void make_dir_struct(char *buf,char *mask,char *fname,unsigned int size,int mode,time_t date); void close_low_fds(void); +int set_blocking(int fd, int set); int write_socket(int fd,char *buf,int len); int read_udp_socket(int fd,char *buf,int len); int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out); @@ -891,7 +892,7 @@ void Abort(void ); BOOL get_myname(char *my_name,struct in_addr *ip); BOOL ip_equal(struct in_addr ip1,struct in_addr ip2); int open_socket_in(int type, int port, int dlevel,uint32 socket_addr); -int open_socket_out(int type, struct in_addr *addr, int port ); +int open_socket_out(int type, struct in_addr *addr, int port ,int timeout); int interpret_protocol(char *str,int def); int interpret_security(char *str,int def); uint32 interpret_addr(char *str); -- cgit From 135d4f5739cedf61998896d6f02ac1f379c9a377 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 22 Aug 1996 06:35:29 +0000 Subject: preparing for release of 1.9.16 (This used to be commit 7e26006cc38594373d6baee41d3e20c30babe9c0) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index d2a33aef45..9cc9c65798 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16alpha26" +#define VERSION "1.9.16" -- cgit From ea1a09af136d58cd5dbcee23c16c7966dd0074c3 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 22 Aug 1996 16:10:42 +0000 Subject: preparing for release of 1.9.16p1 (This used to be commit 6df471f6636694bcd741b61df8615858c5445f81) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 9cc9c65798..5dd6013151 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16" +#define VERSION "1.9.16p1" -- cgit From 5945be9718b8ea56c8dde99729c0ec0e56080fee Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Fri, 23 Aug 1996 10:17:30 +0000 Subject: - fixed bugs in nmb response packet checking. - added multiple workgroup code - samba can register under different (unique) NetBIOS aliases, one per workgroup it joins. lkcl (This used to be commit f24e341e7e4d8726b98d3a0f83b24f61817fe536) --- source3/include/nameserv.h | 58 ++++---- source3/include/proto.h | 349 ++++++++++++--------------------------------- 2 files changed, 124 insertions(+), 283 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index e4876bac57..404c0531e5 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -99,19 +99,19 @@ enum master_state enum state_type { - NAME_STATUS_DOM_SRV_CHK, - NAME_STATUS_SRV_CHK, - NAME_REGISTER_CHALLENGE, - NAME_REGISTER, - NAME_RELEASE, - NAME_QUERY_CONFIRM, - NAME_QUERY_ANNOUNCE_HOST, - NAME_QUERY_SYNC_LOCAL, - NAME_QUERY_SYNC_REMOTE, - NAME_QUERY_DOM_SRV_CHK, - NAME_QUERY_SRV_CHK, - NAME_QUERY_FIND_MST, - NAME_QUERY_MST_CHK + NAME_STATUS_DOM_SRV_CHK, + NAME_STATUS_SRV_CHK, + NAME_REGISTER_CHALLENGE, + NAME_REGISTER, + NAME_RELEASE, + NAME_QUERY_CONFIRM, + NAME_QUERY_ANNOUNCE_HOST, + NAME_QUERY_SYNC_LOCAL, + NAME_QUERY_SYNC_REMOTE, + NAME_QUERY_DOM_SRV_CHK, + NAME_QUERY_SRV_CHK, + NAME_QUERY_FIND_MST, + NAME_QUERY_MST_CHK }; /* a netbios name structure */ @@ -121,6 +121,14 @@ struct nmb_name { int name_type; }; +/* A server name and comment. */ +struct server_identity +{ + char *name; + char *comment; + struct server_identity *next; +}; + /* a netbios flags + ip address structure */ /* this is used for multi-homed systems and for internet group names */ struct nmb_ip @@ -148,16 +156,16 @@ struct name_record /* browse and backup server cache for synchronising browse list */ struct browse_cache_record { - struct browse_cache_record *next; - struct browse_cache_record *prev; - - pstring name; - int type; - pstring group; - struct in_addr ip; - time_t sync_time; - BOOL synced; - BOOL local; + struct browse_cache_record *next; + struct browse_cache_record *prev; + + pstring name; + int type; + pstring group; + struct in_addr ip; + time_t sync_time; + BOOL synced; + BOOL local; }; /* this is used to hold the list of servers in my domain, and is */ @@ -214,9 +222,10 @@ struct response_record int fd; int quest_type; struct nmb_name name; - int nb_flags; + struct nmb_ip reply; time_t ttl; + int token; /* unique workgroup token id */ int server_type; fstring my_name; fstring my_comment; @@ -224,7 +233,6 @@ struct response_record BOOL bcast; BOOL recurse; struct in_addr send_ip; - struct in_addr reply_to_ip; int num_msgs; diff --git a/source3/include/proto.h b/source3/include/proto.h index e20238fee4..293179d4ab 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1,39 +1,24 @@ /* This file is automatically generated with "make proto". DO NOT EDIT */ -/*The following definitions come from access.c */ +/*The following definitions come from - */ BOOL check_access(int snum); BOOL allow_access(char *deny_list,char *allow_list,struct from_host *client); BOOL fromhost(int sock,struct from_host *f); - -/*The following definitions come from charcnv.c */ - char *unix2dos_format(char *str,BOOL overwrite); char *dos2unix_format(char *str, BOOL overwrite); int interpret_character_set(char *str, int def); - -/*The following definitions come from charset.c */ - void charset_initialise(void); void add_char_string(char *s); - -/*The following definitions come from chgpasswd.c */ - BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence); BOOL chgpasswd(char *name,char *oldpass,char *newpass); BOOL chgpasswd(char *name,char *oldpass,char *newpass); - -/*The following definitions come from client.c */ - void setup_pkt(char *outbuf); void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(),BOOL recurse_dir); void cmd_help(void); BOOL reopen_connection(char *inbuf,char *outbuf); char *smb_errstr(char *inbuf); - -/*The following definitions come from clientutil.c */ - void cli_setup_pkt(char *outbuf); BOOL cli_receive_trans_response(char *inbuf,int trans,int *data_len, int *param_len, char **data,char **param); @@ -48,9 +33,6 @@ BOOL cli_send_trans_request(char *outbuf, int trans, char *name, int fid, int fl BOOL cli_open_sockets(int port); BOOL cli_reopen_connection(char *inbuf,char *outbuf); char *smb_errstr(char *inbuf); - -/*The following definitions come from clitar.c */ - int strslashcmp(const char *s1, const char *s2); void cmd_block(void); void cmd_tarmode(void); @@ -59,9 +41,6 @@ void cmd_tar(char *inbuf, char *outbuf); int process_tar(char *inbuf, char *outbuf); int clipfind(char **aret, int ret, char *tok); int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind); - -/*The following definitions come from dir.c */ - void init_dptrs(void); char *dptr_path(int key); char *dptr_wcard(int key); @@ -87,17 +66,8 @@ int TellDir(void *p); void DirCacheAdd(char *path,char *name,char *dname,int snum); char *DirCacheCheck(char *path,char *name,int snum); void DirCacheFlush(int snum); - -/*The following definitions come from fault.c */ - void fault_setup(void (*fn)()); - -/*The following definitions come from getsmbpass.c */ - char *getsmbpass(char *prompt) ; - -/*The following definitions come from interface.c */ - void load_interfaces(void); void iface_set_default(char *ip,char *bcast,char *nmask); BOOL ismyip(struct in_addr ip); @@ -107,23 +77,15 @@ struct in_addr *iface_n_ip(int n); struct in_addr *iface_bcast(struct in_addr ip); struct in_addr *iface_nmask(struct in_addr ip); struct in_addr *iface_ip(struct in_addr ip); - -/*The following definitions come from ipc.c */ - int reply_trans(char *inbuf,char *outbuf); - -/*The following definitions come from kanji.c */ - int interpret_coding_system(char *str, int def); - -/*The following definitions come from loadparm.c */ - char *lp_string(char *s); char *lp_logfile(void); char *lp_smbrun(void); char *lp_configfile(void); char *lp_smb_passwd_file(void); char *lp_serverstring(void); +char *lp_server_comment(void); char *lp_printcapname(void); char *lp_lockdir(void); char *lp_rootdir(void); @@ -146,6 +108,7 @@ char *lp_interfaces(void); char *lp_socket_address(void); BOOL lp_wins_support(void); BOOL lp_wins_proxy(void); +BOOL lp_local_master(void); BOOL lp_domain_master(void); BOOL lp_domain_logons(void); BOOL lp_preferred_master(void); @@ -251,9 +214,6 @@ int lp_numservices(void); void lp_dump(void); int lp_servicenumber(char *pszServiceName); char *volume_label(int snum); - -/*The following definitions come from locking.c */ - BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); int file_lock(char *name,int timeout); void file_unlock(int fd); @@ -268,9 +228,6 @@ int get_share_mode(int cnum,struct stat *sbuf,int *pid); void del_share_mode(int fnum); BOOL set_share_mode(int fnum,int mode); void clean_share_modes(void); - -/*The following definitions come from mangle.c */ - int str_checksum(char *s); BOOL is_8_3(char *fname); void create_mangled_stack(int size); @@ -278,192 +235,157 @@ BOOL check_mangled_stack(char *s); BOOL is_mangled(char *s); void mangle_name_83(char *s); BOOL name_map_mangle(char *OutName,BOOL need83,int snum); - -/*The following definitions come from md4.c */ - - -/*The following definitions come from message.c */ - int reply_sends(char *inbuf,char *outbuf); int reply_sendstrt(char *inbuf,char *outbuf); int reply_sendtxt(char *inbuf,char *outbuf); int reply_sendend(char *inbuf,char *outbuf); - -/*The following definitions come from nameannounce.c */ - void announce_request(struct work_record *work, struct in_addr ip); -void do_announce_request(char *info, char *to_name, int announce_type, - int from, - int to, struct in_addr dest_ip); +void do_announce_request(char *info, char *from_name, char *to_name, + int announce_type, int from, int to, struct in_addr dest_ip); void sync_server(enum state_type state, char *serv_name, char *work_name, - int name_type, - struct in_addr ip); + int name_type, + struct in_addr ip); void do_announce_host(int command, - char *from_name, int from_type, struct in_addr from_ip, - char *to_name , int to_type , struct in_addr to_ip, - time_t announce_interval, - char *server_name, int server_type, char *server_comment); + char *from_name, int from_type, struct in_addr from_ip, + char *to_name , int to_type , struct in_addr to_ip, + time_t announce_interval, + char *server_name, int server_type, char *server_comment); void remove_my_servers(void); void announce_server(struct subnet_record *d, struct work_record *work, - char *name, char *comment, time_t ttl, int server_type); + char *name, char *comment, time_t ttl, int server_type); void announce_host(void); void announce_master(void); void announce_remote(void); - -/*The following definitions come from namebrowse.c */ - void expire_browse_cache(time_t t); struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, - time_t ttl, struct in_addr ip, BOOL local); + time_t ttl, struct in_addr ip, BOOL local); void do_browser_lists(void); - -/*The following definitions come from namedbname.c */ - +int get_num_workgroups(void); +int conf_workgroup_name_to_token(const char *workgroup_name, + const char *default_name); +char *conf_workgroup_name(int token); +int conf_should_workgroup_member(int token); +int conf_should_local_master(int token); +int conf_should_domain_master(int token); +char *conf_browsing_alias(int token); +char *conf_browsing_alias_comment(int token); +char *conf_alias_to_workgroup(const char *alias); +int conf_alias_to_token(const char *alias); +void read_smbbrowse_conf(char *default_name); void set_samba_nb_type(void); BOOL name_equal(struct nmb_name *n1,struct nmb_name *n2); BOOL ms_browser_name(char *name, int type); void remove_name(struct subnet_record *d, struct name_record *n); struct name_record *find_name(struct name_record *n, - struct nmb_name *name, - int search); + struct nmb_name *name, + int search); struct name_record *find_name_search(struct subnet_record **d, - struct nmb_name *name, - int search, struct in_addr ip); + struct nmb_name *name, + int search, struct in_addr ip); void dump_names(void); void load_netbios_names(void); void remove_netbios_name(struct subnet_record *d, - char *name,int type, enum name_source source, - struct in_addr ip); + char *name,int type, enum name_source source, + struct in_addr ip); struct name_record *add_netbios_entry(struct subnet_record *d, - char *name, int type, int nb_flags, - int ttl, enum name_source source, struct in_addr ip, - BOOL new_only,BOOL wins); -void expire_names(time_t t); + char *name, int type, int nb_flags, + int ttl, enum name_source source, struct in_addr ip, + BOOL new_only,BOOL wins); +void check_expire_names(time_t t); struct name_record *search_for_name(struct subnet_record **d, - struct nmb_name *question, - struct in_addr ip, int Time, int search); - -/*The following definitions come from namedbresp.c */ - + struct nmb_name *question, + struct in_addr ip, int Time, int search); void add_response_record(struct subnet_record *d, struct response_record *n); void remove_response_record(struct subnet_record *d, struct response_record *n); struct response_record *make_response_queue_record(enum state_type state, - int id,uint16 fd, - int quest_type, char *name,int type, int nb_flags, time_t ttl, + int id,uint16 fd, int quest_type, + int token, char *name,int type, int nb_flags, time_t ttl, int server_type, char *my_name, char *my_comment, BOOL bcast,BOOL recurse, struct in_addr send_ip, struct in_addr reply_to_ip); struct response_record *find_response_record(struct subnet_record **d, uint16 id); - -/*The following definitions come from namedbserver.c */ - void remove_old_servers(struct work_record *work, time_t t, - BOOL remove_all); + BOOL remove_all); struct server_record *find_server(struct work_record *work, char *name); struct server_record *add_server_entry(struct subnet_record *d, - struct work_record *work, - char *name,int servertype, - int ttl,char *comment, - BOOL replace); + struct work_record *work, + char *name,int servertype, + int ttl,char *comment, + BOOL replace); void expire_servers(time_t t); - -/*The following definitions come from namedbsubnet.c */ - struct subnet_record *find_subnet(struct in_addr bcast_ip); struct subnet_record *find_req_subnet(struct in_addr ip, BOOL bcast); void add_subnet_interfaces(void); void add_my_subnets(char *group); struct subnet_record *add_subnet_entry(struct in_addr bcast_ip, - struct in_addr mask_ip, - char *name, BOOL add, BOOL lmhosts); + struct in_addr mask_ip, + char *name, BOOL add, BOOL lmhosts); void write_browse_list(void); - -/*The following definitions come from namedbwork.c */ - struct work_record *remove_workgroup(struct subnet_record *d, - struct work_record *work, - BOOL remove_all_servers); + struct work_record *work, + BOOL remove_all_servers); struct work_record *find_workgroupstruct(struct subnet_record *d, - fstring name, BOOL add); + fstring name, BOOL add); void dump_workgroups(void); - -/*The following definitions come from nameelect.c */ - void check_master_browser(void); void browser_gone(char *work_name, struct in_addr ip); void send_election(struct subnet_record *d, char *group,uint32 criterion, - int timeup,char *name); + int timeup,char *name); void name_unregister_work(struct subnet_record *d, char *name, int name_type); -void name_register_work(struct subnet_record *d, char *name, int name_type, - int nb_flags, time_t ttl, struct in_addr ip, BOOL bcast); +void name_register_work(struct subnet_record *d, int token, + char *name, int name_type, + struct nmb_ip *data, time_t ttl, struct in_addr ip, BOOL bcast); void become_master(struct subnet_record *d, struct work_record *work); void become_nonmaster(struct subnet_record *d, struct work_record *work, - int remove_type); + int remove_type); void run_elections(void); void process_election(struct packet_struct *p,char *buf); BOOL check_elections(void); - -/*The following definitions come from namelogon.c */ - void process_logon_packet(struct packet_struct *p,char *buf,int len); - -/*The following definitions come from namepacket.c */ - void debug_browse_data(char *outbuf, int len); -void initiate_netbios_packet(uint16 *id, - int fd,int quest_type,char *name,int name_type, - int nb_flags,BOOL bcast,BOOL recurse, - struct in_addr to_ip); +BOOL initiate_netbios_packet(uint16 id, + int fd,int quest_type,char *name,int name_type, + int nb_flags,BOOL bcast,BOOL recurse, + struct in_addr to_ip); void reply_netbios_packet(struct packet_struct *p1,int trn_id, - int rcode, int rcv_code, int opcode, BOOL recurse, - struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, - char *data,int len); + int rcode, int rcv_code, int opcode, BOOL recurse, + struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, + char *data,int len); void queue_packet(struct packet_struct *packet); void run_packet_queue(); void listen_for_packets(BOOL run_election); BOOL send_mailslot_reply(char *mailslot,int fd,char *buf,int len,char *srcname, - char *dstname,int src_type,int dest_type, - struct in_addr dest_ip,struct in_addr src_ip); - -/*The following definitions come from namequery.c */ - + char *dstname,int src_type,int dest_type, + struct in_addr dest_ip,struct in_addr src_ip); BOOL name_status(int fd,char *name,int name_type,BOOL recurse, struct in_addr to_ip,char *master,char *rname, void (*fn)()); BOOL name_query(int fd,char *name,int name_type, BOOL bcast,BOOL recurse, struct in_addr to_ip, struct in_addr *ip,void (*fn)()); - -/*The following definitions come from nameresp.c */ - +void update_name_trn_id(void); void expire_netbios_response_entries(); -struct response_record *queue_netbios_pkt_wins(struct subnet_record *d, - int fd,int quest_type,enum state_type state, - char *name,int name_type,int nb_flags, time_t ttl, - int server_type, char *my_name, char *my_comment, - BOOL bcast,BOOL recurse, - struct in_addr send_ip, struct in_addr reply_to_ip); -struct response_record *queue_netbios_packet(struct subnet_record *d, - int fd,int quest_type,enum state_type state,char *name, - int name_type,int nb_flags, time_t ttl, - int server_type, char *my_name, char *my_comment, - BOOL bcast,BOOL recurse, - struct in_addr send_ip, struct in_addr reply_to_ip); - -/*The following definitions come from nameserv.c */ - -void remove_name_entry(struct subnet_record *d, char *name,int type); -void add_my_name_entry(struct subnet_record *d,char *name,int type,int nb_flags); +void queue_netbios_pkt_wins(struct subnet_record *d, + int fd,int quest_type,enum state_type state, + int token, char *name,int name_type,int nb_flags, time_t ttl, + int server_type, char *my_name, char *my_comment, + BOOL bcast,BOOL recurse, + struct in_addr send_ip, struct in_addr reply_to_ip); +void queue_netbios_packet(struct subnet_record *d, + int fd,int quest_type,enum state_type state, + int token, char *name, int name_type,int nb_flags, time_t ttl, + int server_type, char *my_name, char *my_comment, + BOOL bcast,BOOL recurse, + struct in_addr send_ip, struct in_addr reply_to_ip); +void remove_name_entry(struct subnet_record *d, int token, char *name,int type); +void add_my_name_entry(struct subnet_record *d, int token, + char *name,int type,int nb_flags); void add_my_names(void); void remove_my_names(); -void refresh_my_names(time_t t); void query_refresh_names(void); - -/*The following definitions come from nameservreply.c */ - void add_name_respond(struct subnet_record *d, int fd, struct in_addr from_ip, uint16 response_id, struct nmb_name *name, @@ -477,25 +399,18 @@ void reply_name_release(struct packet_struct *p); void reply_name_reg(struct packet_struct *p); void reply_name_status(struct packet_struct *p); void reply_name_query(struct packet_struct *p); - -/*The following definitions come from nameservresp.c */ - void debug_state_type(int state); +void response_process(struct in_addr ip, struct subnet_record *d, + struct response_record *n, + int rcode, char *nmb_data, struct nmb_name *q_name, + time_t ttl, BOOL bcast, struct nmb_name *ans_name); void response_netbios_packet(struct packet_struct *p); - -/*The following definitions come from namework.c */ - -void reset_server(char *name, int state, struct in_addr ip); +void reset_server(struct work_record *work, char *name, int state, struct in_addr ip); void tell_become_backup(void); BOOL same_context(struct dgram_packet *dgram); +BOOL listening_name(struct work_record *work, struct nmb_name *n); void process_browse_packet(struct packet_struct *p,char *buf,int len); - -/*The following definitions come from nmbd.c */ - BOOL reload_services(BOOL test); - -/*The following definitions come from nmblib.c */ - void debug_nmb_packet(struct packet_struct *p); char *namestr(struct nmb_name *n); void free_nmb_packet(struct nmb_packet *nmb); @@ -504,23 +419,11 @@ struct packet_struct *read_packet(int fd,enum packet_type packet_type); void make_nmb_name(struct nmb_name *n,char *name,int type,char *this_scope); BOOL send_packet(struct packet_struct *p); struct packet_struct *receive_packet(int fd,enum packet_type type,int t); - -/*The following definitions come from nmblookup.c */ - int main(int argc,char *argv[]); - -/*The following definitions come from nmbsync.c */ - char *getsmbpass(char *pass); void sync_browse_lists(struct subnet_record *d, struct work_record *work, - char *name, int nm_type, struct in_addr ip, BOOL local); - -/*The following definitions come from params.c */ - + char *name, int nm_type, struct in_addr ip, BOOL local); BOOL pm_process(char *pszFileName,BOOL (*sfunc)(char *),BOOL (*pfunc)(char *,char *)); - -/*The following definitions come from password.c */ - void generate_next_challenge(char *challenge); BOOL set_challenge(char *challenge); BOOL last_challenge(char *challenge); @@ -540,14 +443,8 @@ BOOL authorise_login(int snum,char *user,char *password, int pwlen, BOOL check_hosts_equiv(char *user); BOOL server_cryptkey(char *buf); BOOL server_validate(char *buf); - -/*The following definitions come from pcap.c */ - BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); void pcap_printer_fn(void (*fn)()); - -/*The following definitions come from pipes.c */ - int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize); BOOL api_LsarpcSNPHS(int cnum,int uid, char *param,char *data, int mdrcnt,int mprcnt, @@ -557,31 +454,19 @@ BOOL api_LsarpcTNP(int cnum,int uid, char *param,char *data, int mdrcnt,int mprcnt, char **rdata,char **rparam, int *rdata_len,int *rparam_len); - -/*The following definitions come from predict.c */ - int read_predict(int fd,int offset,char *buf,char **ptr,int num); void do_read_prediction(); void invalidate_read_prediction(int fd); - -/*The following definitions come from printing.c */ - void lpq_reset(int snum); void print_file(int fnum); int get_printqueue(int snum,int cnum,print_queue_struct **queue, print_status_struct *status); void del_printqueue(int cnum,int snum,int jobid); void status_printjob(int cnum,int snum,int jobid,int status); - -/*The following definitions come from quotas.c */ - BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); - -/*The following definitions come from replace.c */ - char *Strstr(char *s, char *p); time_t Mktime(struct tm *t); int InNetGr(char *group,char *host,char *user,char *dom); @@ -589,9 +474,6 @@ void *malloc_wrapped(int size,char *file,int line); void *realloc_wrapped(void *ptr,int size,char *file,int line); void free_wrapped(void *ptr,char *file,int line); void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line); - -/*The following definitions come from reply.c */ - int reply_special(char *inbuf,char *outbuf); int reply_tcon(char *inbuf,char *outbuf); int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize); @@ -642,9 +524,6 @@ int reply_writebmpx(char *inbuf,char *outbuf); int reply_writebs(char *inbuf,char *outbuf); int reply_setattrE(char *inbuf,char *outbuf); int reply_getattrE(char *inbuf,char *outbuf); - -/*The following definitions come from server.c */ - mode_t unix_mode(int cnum,int dosmode); int dos_mode(int cnum,char *path,struct stat *sbuf); int dos_chmod(int cnum,char *fname,int dosmode,struct stat *st); @@ -685,9 +564,6 @@ void standard_sub(int cnum,char *s); char *smb_fn_name(int type); int chain_reply(char *inbuf,char *outbuf,int size,int bufsize); int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); - -/*The following definitions come from shmem.c */ - BOOL shm_open( char *file_name, int size); BOOL shm_close( void ); shm_offset_t shm_alloc(int size); @@ -701,9 +577,6 @@ BOOL shm_unlock(void); BOOL shm_get_usage(int *bytes_free, int *bytes_used, int *bytes_overhead); - -/*The following definitions come from smbencrypt.c */ - void str_to_key(uchar *str,uchar *key); void D1(uchar *k, uchar *d, uchar *out); void E1(uchar *k, uchar *d, uchar *out); @@ -712,28 +585,13 @@ void E_P24(uchar *p21, uchar *c8, uchar *p24); void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); void E_md4hash(uchar *passwd, uchar *p16); void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); - -/*The following definitions come from smbpass.c */ - int pw_file_lock(char *name, int type, int secs); int pw_file_unlock(int fd); struct smb_passwd *get_smbpwnam(char *name); - -/*The following definitions come from smbpasswd.c */ - - -/*The following definitions come from smbrun.c */ - - -/*The following definitions come from status.c */ - void Ucrit_addUsername(pstring username); unsigned int Ucrit_checkUsername(pstring username); void Ucrit_addPid(int pid); unsigned int Ucrit_checkPid(int pid); - -/*The following definitions come from system.c */ - int sys_select(fd_set *fds,struct timeval *tval); int sys_select(fd_set *fds,struct timeval *tval); int sys_unlink(char *fname); @@ -749,16 +607,7 @@ int sys_rename(char *from, char *to); int sys_chmod(char *fname,int mode); int sys_chown(char *fname,int uid,int gid); int sys_chroot(char *dname); - -/*The following definitions come from testparm.c */ - - -/*The following definitions come from testprns.c */ - int main(int argc, char *argv[]); - -/*The following definitions come from time.c */ - void GetTimeOfDay(struct timeval *tval); void TimeInit(void); int TimeDiff(time_t t); @@ -773,35 +622,22 @@ time_t make_unix_date2(void *date_ptr); time_t make_unix_date3(void *date_ptr); BOOL set_filetime(char *fname,time_t mtime); char *timestring(void ); - -/*The following definitions come from trans2.c */ - int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize); int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize); int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize); int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize); - -/*The following definitions come from ufc.c */ - char *ufc_crypt(char *key,char *salt); - -/*The following definitions come from uid.c */ - void init_uid(void); BOOL become_guest(void); BOOL become_user(int cnum, int uid); BOOL unbecome_user(void ); int smbrun(char *cmd,char *outfile); - -/*The following definitions come from username.c */ - +void write_utmp(int dologin, int connection, int pid, + char *from_addr, char *username); char *get_home_dir(char *user); void map_username(char *user); struct passwd *Get_Pwnam(char *user,BOOL allow_change); BOOL user_in_list(char *user,char *list); - -/*The following definitions come from util.c */ - void setup_logging(char *pname,BOOL interactive); void reopen_logs(void); BOOL is_a_socket(int fd); @@ -821,9 +657,9 @@ time_t file_modtime(char *fname); BOOL directory_exist(char *dname,struct stat *st); uint32 file_size(char *file_name); char *attrib_string(int mode); -int StrCaseCmp(char *s, char *t); -int StrnCaseCmp(char *s, char *t, int n); -BOOL strequal(char *s1,char *s2); +int StrCaseCmp(const char *s, const char *t); +int StrnCaseCmp(const char *s, const char *t, int n); +BOOL strequal(const char *s1, const char *s2); BOOL strnequal(char *s1,char *s2,int n); BOOL strcsequal(char *s1,char *s2); void strlower(char *s); @@ -908,9 +744,6 @@ char *gidtoname(int gid); void BlockSignals(BOOL block,int signum); void ajt_panic(void); char *readdirname(void *p); - -/*The following definitions come from vt_mode.c */ - int VT_Check(char *buffer); int VT_Start_utmp(void); int VT_Stop_utmp(void); -- cgit From 9ad5a3fe36ac2b32bcb7a50c608ec586629f2125 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sat, 24 Aug 1996 01:41:46 +0000 Subject: removed all of lukes recent changes. I need to do a p2 release but can't test the multi group changes. I also found that some of lukes changes wiped out some recent bug fixes. Is your CVS tree ok luke? (This used to be commit 8b7fe224bce64803d55ae279fa61ef3ebbbb0241) --- source3/include/nameserv.h | 58 ++++---- source3/include/proto.h | 349 +++++++++++++++++++++++++++++++++------------ source3/include/version.h | 2 +- 3 files changed, 284 insertions(+), 125 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 404c0531e5..e4876bac57 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -99,19 +99,19 @@ enum master_state enum state_type { - NAME_STATUS_DOM_SRV_CHK, - NAME_STATUS_SRV_CHK, - NAME_REGISTER_CHALLENGE, - NAME_REGISTER, - NAME_RELEASE, - NAME_QUERY_CONFIRM, - NAME_QUERY_ANNOUNCE_HOST, - NAME_QUERY_SYNC_LOCAL, - NAME_QUERY_SYNC_REMOTE, - NAME_QUERY_DOM_SRV_CHK, - NAME_QUERY_SRV_CHK, - NAME_QUERY_FIND_MST, - NAME_QUERY_MST_CHK + NAME_STATUS_DOM_SRV_CHK, + NAME_STATUS_SRV_CHK, + NAME_REGISTER_CHALLENGE, + NAME_REGISTER, + NAME_RELEASE, + NAME_QUERY_CONFIRM, + NAME_QUERY_ANNOUNCE_HOST, + NAME_QUERY_SYNC_LOCAL, + NAME_QUERY_SYNC_REMOTE, + NAME_QUERY_DOM_SRV_CHK, + NAME_QUERY_SRV_CHK, + NAME_QUERY_FIND_MST, + NAME_QUERY_MST_CHK }; /* a netbios name structure */ @@ -121,14 +121,6 @@ struct nmb_name { int name_type; }; -/* A server name and comment. */ -struct server_identity -{ - char *name; - char *comment; - struct server_identity *next; -}; - /* a netbios flags + ip address structure */ /* this is used for multi-homed systems and for internet group names */ struct nmb_ip @@ -156,16 +148,16 @@ struct name_record /* browse and backup server cache for synchronising browse list */ struct browse_cache_record { - struct browse_cache_record *next; - struct browse_cache_record *prev; - - pstring name; - int type; - pstring group; - struct in_addr ip; - time_t sync_time; - BOOL synced; - BOOL local; + struct browse_cache_record *next; + struct browse_cache_record *prev; + + pstring name; + int type; + pstring group; + struct in_addr ip; + time_t sync_time; + BOOL synced; + BOOL local; }; /* this is used to hold the list of servers in my domain, and is */ @@ -222,10 +214,9 @@ struct response_record int fd; int quest_type; struct nmb_name name; - struct nmb_ip reply; + int nb_flags; time_t ttl; - int token; /* unique workgroup token id */ int server_type; fstring my_name; fstring my_comment; @@ -233,6 +224,7 @@ struct response_record BOOL bcast; BOOL recurse; struct in_addr send_ip; + struct in_addr reply_to_ip; int num_msgs; diff --git a/source3/include/proto.h b/source3/include/proto.h index 293179d4ab..e20238fee4 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1,24 +1,39 @@ /* This file is automatically generated with "make proto". DO NOT EDIT */ -/*The following definitions come from - */ +/*The following definitions come from access.c */ BOOL check_access(int snum); BOOL allow_access(char *deny_list,char *allow_list,struct from_host *client); BOOL fromhost(int sock,struct from_host *f); + +/*The following definitions come from charcnv.c */ + char *unix2dos_format(char *str,BOOL overwrite); char *dos2unix_format(char *str, BOOL overwrite); int interpret_character_set(char *str, int def); + +/*The following definitions come from charset.c */ + void charset_initialise(void); void add_char_string(char *s); + +/*The following definitions come from chgpasswd.c */ + BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence); BOOL chgpasswd(char *name,char *oldpass,char *newpass); BOOL chgpasswd(char *name,char *oldpass,char *newpass); + +/*The following definitions come from client.c */ + void setup_pkt(char *outbuf); void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(),BOOL recurse_dir); void cmd_help(void); BOOL reopen_connection(char *inbuf,char *outbuf); char *smb_errstr(char *inbuf); + +/*The following definitions come from clientutil.c */ + void cli_setup_pkt(char *outbuf); BOOL cli_receive_trans_response(char *inbuf,int trans,int *data_len, int *param_len, char **data,char **param); @@ -33,6 +48,9 @@ BOOL cli_send_trans_request(char *outbuf, int trans, char *name, int fid, int fl BOOL cli_open_sockets(int port); BOOL cli_reopen_connection(char *inbuf,char *outbuf); char *smb_errstr(char *inbuf); + +/*The following definitions come from clitar.c */ + int strslashcmp(const char *s1, const char *s2); void cmd_block(void); void cmd_tarmode(void); @@ -41,6 +59,9 @@ void cmd_tar(char *inbuf, char *outbuf); int process_tar(char *inbuf, char *outbuf); int clipfind(char **aret, int ret, char *tok); int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind); + +/*The following definitions come from dir.c */ + void init_dptrs(void); char *dptr_path(int key); char *dptr_wcard(int key); @@ -66,8 +87,17 @@ int TellDir(void *p); void DirCacheAdd(char *path,char *name,char *dname,int snum); char *DirCacheCheck(char *path,char *name,int snum); void DirCacheFlush(int snum); + +/*The following definitions come from fault.c */ + void fault_setup(void (*fn)()); + +/*The following definitions come from getsmbpass.c */ + char *getsmbpass(char *prompt) ; + +/*The following definitions come from interface.c */ + void load_interfaces(void); void iface_set_default(char *ip,char *bcast,char *nmask); BOOL ismyip(struct in_addr ip); @@ -77,15 +107,23 @@ struct in_addr *iface_n_ip(int n); struct in_addr *iface_bcast(struct in_addr ip); struct in_addr *iface_nmask(struct in_addr ip); struct in_addr *iface_ip(struct in_addr ip); + +/*The following definitions come from ipc.c */ + int reply_trans(char *inbuf,char *outbuf); + +/*The following definitions come from kanji.c */ + int interpret_coding_system(char *str, int def); + +/*The following definitions come from loadparm.c */ + char *lp_string(char *s); char *lp_logfile(void); char *lp_smbrun(void); char *lp_configfile(void); char *lp_smb_passwd_file(void); char *lp_serverstring(void); -char *lp_server_comment(void); char *lp_printcapname(void); char *lp_lockdir(void); char *lp_rootdir(void); @@ -108,7 +146,6 @@ char *lp_interfaces(void); char *lp_socket_address(void); BOOL lp_wins_support(void); BOOL lp_wins_proxy(void); -BOOL lp_local_master(void); BOOL lp_domain_master(void); BOOL lp_domain_logons(void); BOOL lp_preferred_master(void); @@ -214,6 +251,9 @@ int lp_numservices(void); void lp_dump(void); int lp_servicenumber(char *pszServiceName); char *volume_label(int snum); + +/*The following definitions come from locking.c */ + BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); int file_lock(char *name,int timeout); void file_unlock(int fd); @@ -228,6 +268,9 @@ int get_share_mode(int cnum,struct stat *sbuf,int *pid); void del_share_mode(int fnum); BOOL set_share_mode(int fnum,int mode); void clean_share_modes(void); + +/*The following definitions come from mangle.c */ + int str_checksum(char *s); BOOL is_8_3(char *fname); void create_mangled_stack(int size); @@ -235,157 +278,192 @@ BOOL check_mangled_stack(char *s); BOOL is_mangled(char *s); void mangle_name_83(char *s); BOOL name_map_mangle(char *OutName,BOOL need83,int snum); + +/*The following definitions come from md4.c */ + + +/*The following definitions come from message.c */ + int reply_sends(char *inbuf,char *outbuf); int reply_sendstrt(char *inbuf,char *outbuf); int reply_sendtxt(char *inbuf,char *outbuf); int reply_sendend(char *inbuf,char *outbuf); + +/*The following definitions come from nameannounce.c */ + void announce_request(struct work_record *work, struct in_addr ip); -void do_announce_request(char *info, char *from_name, char *to_name, - int announce_type, int from, int to, struct in_addr dest_ip); +void do_announce_request(char *info, char *to_name, int announce_type, + int from, + int to, struct in_addr dest_ip); void sync_server(enum state_type state, char *serv_name, char *work_name, - int name_type, - struct in_addr ip); + int name_type, + struct in_addr ip); void do_announce_host(int command, - char *from_name, int from_type, struct in_addr from_ip, - char *to_name , int to_type , struct in_addr to_ip, - time_t announce_interval, - char *server_name, int server_type, char *server_comment); + char *from_name, int from_type, struct in_addr from_ip, + char *to_name , int to_type , struct in_addr to_ip, + time_t announce_interval, + char *server_name, int server_type, char *server_comment); void remove_my_servers(void); void announce_server(struct subnet_record *d, struct work_record *work, - char *name, char *comment, time_t ttl, int server_type); + char *name, char *comment, time_t ttl, int server_type); void announce_host(void); void announce_master(void); void announce_remote(void); + +/*The following definitions come from namebrowse.c */ + void expire_browse_cache(time_t t); struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, - time_t ttl, struct in_addr ip, BOOL local); + time_t ttl, struct in_addr ip, BOOL local); void do_browser_lists(void); -int get_num_workgroups(void); -int conf_workgroup_name_to_token(const char *workgroup_name, - const char *default_name); -char *conf_workgroup_name(int token); -int conf_should_workgroup_member(int token); -int conf_should_local_master(int token); -int conf_should_domain_master(int token); -char *conf_browsing_alias(int token); -char *conf_browsing_alias_comment(int token); -char *conf_alias_to_workgroup(const char *alias); -int conf_alias_to_token(const char *alias); -void read_smbbrowse_conf(char *default_name); + +/*The following definitions come from namedbname.c */ + void set_samba_nb_type(void); BOOL name_equal(struct nmb_name *n1,struct nmb_name *n2); BOOL ms_browser_name(char *name, int type); void remove_name(struct subnet_record *d, struct name_record *n); struct name_record *find_name(struct name_record *n, - struct nmb_name *name, - int search); + struct nmb_name *name, + int search); struct name_record *find_name_search(struct subnet_record **d, - struct nmb_name *name, - int search, struct in_addr ip); + struct nmb_name *name, + int search, struct in_addr ip); void dump_names(void); void load_netbios_names(void); void remove_netbios_name(struct subnet_record *d, - char *name,int type, enum name_source source, - struct in_addr ip); + char *name,int type, enum name_source source, + struct in_addr ip); struct name_record *add_netbios_entry(struct subnet_record *d, - char *name, int type, int nb_flags, - int ttl, enum name_source source, struct in_addr ip, - BOOL new_only,BOOL wins); -void check_expire_names(time_t t); + char *name, int type, int nb_flags, + int ttl, enum name_source source, struct in_addr ip, + BOOL new_only,BOOL wins); +void expire_names(time_t t); struct name_record *search_for_name(struct subnet_record **d, - struct nmb_name *question, - struct in_addr ip, int Time, int search); + struct nmb_name *question, + struct in_addr ip, int Time, int search); + +/*The following definitions come from namedbresp.c */ + void add_response_record(struct subnet_record *d, struct response_record *n); void remove_response_record(struct subnet_record *d, struct response_record *n); struct response_record *make_response_queue_record(enum state_type state, - int id,uint16 fd, int quest_type, - int token, char *name,int type, int nb_flags, time_t ttl, + int id,uint16 fd, + int quest_type, char *name,int type, int nb_flags, time_t ttl, int server_type, char *my_name, char *my_comment, BOOL bcast,BOOL recurse, struct in_addr send_ip, struct in_addr reply_to_ip); struct response_record *find_response_record(struct subnet_record **d, uint16 id); + +/*The following definitions come from namedbserver.c */ + void remove_old_servers(struct work_record *work, time_t t, - BOOL remove_all); + BOOL remove_all); struct server_record *find_server(struct work_record *work, char *name); struct server_record *add_server_entry(struct subnet_record *d, - struct work_record *work, - char *name,int servertype, - int ttl,char *comment, - BOOL replace); + struct work_record *work, + char *name,int servertype, + int ttl,char *comment, + BOOL replace); void expire_servers(time_t t); + +/*The following definitions come from namedbsubnet.c */ + struct subnet_record *find_subnet(struct in_addr bcast_ip); struct subnet_record *find_req_subnet(struct in_addr ip, BOOL bcast); void add_subnet_interfaces(void); void add_my_subnets(char *group); struct subnet_record *add_subnet_entry(struct in_addr bcast_ip, - struct in_addr mask_ip, - char *name, BOOL add, BOOL lmhosts); + struct in_addr mask_ip, + char *name, BOOL add, BOOL lmhosts); void write_browse_list(void); + +/*The following definitions come from namedbwork.c */ + struct work_record *remove_workgroup(struct subnet_record *d, - struct work_record *work, - BOOL remove_all_servers); + struct work_record *work, + BOOL remove_all_servers); struct work_record *find_workgroupstruct(struct subnet_record *d, - fstring name, BOOL add); + fstring name, BOOL add); void dump_workgroups(void); + +/*The following definitions come from nameelect.c */ + void check_master_browser(void); void browser_gone(char *work_name, struct in_addr ip); void send_election(struct subnet_record *d, char *group,uint32 criterion, - int timeup,char *name); + int timeup,char *name); void name_unregister_work(struct subnet_record *d, char *name, int name_type); -void name_register_work(struct subnet_record *d, int token, - char *name, int name_type, - struct nmb_ip *data, time_t ttl, struct in_addr ip, BOOL bcast); +void name_register_work(struct subnet_record *d, char *name, int name_type, + int nb_flags, time_t ttl, struct in_addr ip, BOOL bcast); void become_master(struct subnet_record *d, struct work_record *work); void become_nonmaster(struct subnet_record *d, struct work_record *work, - int remove_type); + int remove_type); void run_elections(void); void process_election(struct packet_struct *p,char *buf); BOOL check_elections(void); + +/*The following definitions come from namelogon.c */ + void process_logon_packet(struct packet_struct *p,char *buf,int len); + +/*The following definitions come from namepacket.c */ + void debug_browse_data(char *outbuf, int len); -BOOL initiate_netbios_packet(uint16 id, - int fd,int quest_type,char *name,int name_type, - int nb_flags,BOOL bcast,BOOL recurse, - struct in_addr to_ip); +void initiate_netbios_packet(uint16 *id, + int fd,int quest_type,char *name,int name_type, + int nb_flags,BOOL bcast,BOOL recurse, + struct in_addr to_ip); void reply_netbios_packet(struct packet_struct *p1,int trn_id, - int rcode, int rcv_code, int opcode, BOOL recurse, - struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, - char *data,int len); + int rcode, int rcv_code, int opcode, BOOL recurse, + struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, + char *data,int len); void queue_packet(struct packet_struct *packet); void run_packet_queue(); void listen_for_packets(BOOL run_election); BOOL send_mailslot_reply(char *mailslot,int fd,char *buf,int len,char *srcname, - char *dstname,int src_type,int dest_type, - struct in_addr dest_ip,struct in_addr src_ip); + char *dstname,int src_type,int dest_type, + struct in_addr dest_ip,struct in_addr src_ip); + +/*The following definitions come from namequery.c */ + BOOL name_status(int fd,char *name,int name_type,BOOL recurse, struct in_addr to_ip,char *master,char *rname, void (*fn)()); BOOL name_query(int fd,char *name,int name_type, BOOL bcast,BOOL recurse, struct in_addr to_ip, struct in_addr *ip,void (*fn)()); -void update_name_trn_id(void); + +/*The following definitions come from nameresp.c */ + void expire_netbios_response_entries(); -void queue_netbios_pkt_wins(struct subnet_record *d, - int fd,int quest_type,enum state_type state, - int token, char *name,int name_type,int nb_flags, time_t ttl, - int server_type, char *my_name, char *my_comment, - BOOL bcast,BOOL recurse, - struct in_addr send_ip, struct in_addr reply_to_ip); -void queue_netbios_packet(struct subnet_record *d, - int fd,int quest_type,enum state_type state, - int token, char *name, int name_type,int nb_flags, time_t ttl, - int server_type, char *my_name, char *my_comment, - BOOL bcast,BOOL recurse, - struct in_addr send_ip, struct in_addr reply_to_ip); -void remove_name_entry(struct subnet_record *d, int token, char *name,int type); -void add_my_name_entry(struct subnet_record *d, int token, - char *name,int type,int nb_flags); +struct response_record *queue_netbios_pkt_wins(struct subnet_record *d, + int fd,int quest_type,enum state_type state, + char *name,int name_type,int nb_flags, time_t ttl, + int server_type, char *my_name, char *my_comment, + BOOL bcast,BOOL recurse, + struct in_addr send_ip, struct in_addr reply_to_ip); +struct response_record *queue_netbios_packet(struct subnet_record *d, + int fd,int quest_type,enum state_type state,char *name, + int name_type,int nb_flags, time_t ttl, + int server_type, char *my_name, char *my_comment, + BOOL bcast,BOOL recurse, + struct in_addr send_ip, struct in_addr reply_to_ip); + +/*The following definitions come from nameserv.c */ + +void remove_name_entry(struct subnet_record *d, char *name,int type); +void add_my_name_entry(struct subnet_record *d,char *name,int type,int nb_flags); void add_my_names(void); void remove_my_names(); +void refresh_my_names(time_t t); void query_refresh_names(void); + +/*The following definitions come from nameservreply.c */ + void add_name_respond(struct subnet_record *d, int fd, struct in_addr from_ip, uint16 response_id, struct nmb_name *name, @@ -399,18 +477,25 @@ void reply_name_release(struct packet_struct *p); void reply_name_reg(struct packet_struct *p); void reply_name_status(struct packet_struct *p); void reply_name_query(struct packet_struct *p); + +/*The following definitions come from nameservresp.c */ + void debug_state_type(int state); -void response_process(struct in_addr ip, struct subnet_record *d, - struct response_record *n, - int rcode, char *nmb_data, struct nmb_name *q_name, - time_t ttl, BOOL bcast, struct nmb_name *ans_name); void response_netbios_packet(struct packet_struct *p); -void reset_server(struct work_record *work, char *name, int state, struct in_addr ip); + +/*The following definitions come from namework.c */ + +void reset_server(char *name, int state, struct in_addr ip); void tell_become_backup(void); BOOL same_context(struct dgram_packet *dgram); -BOOL listening_name(struct work_record *work, struct nmb_name *n); void process_browse_packet(struct packet_struct *p,char *buf,int len); + +/*The following definitions come from nmbd.c */ + BOOL reload_services(BOOL test); + +/*The following definitions come from nmblib.c */ + void debug_nmb_packet(struct packet_struct *p); char *namestr(struct nmb_name *n); void free_nmb_packet(struct nmb_packet *nmb); @@ -419,11 +504,23 @@ struct packet_struct *read_packet(int fd,enum packet_type packet_type); void make_nmb_name(struct nmb_name *n,char *name,int type,char *this_scope); BOOL send_packet(struct packet_struct *p); struct packet_struct *receive_packet(int fd,enum packet_type type,int t); + +/*The following definitions come from nmblookup.c */ + int main(int argc,char *argv[]); + +/*The following definitions come from nmbsync.c */ + char *getsmbpass(char *pass); void sync_browse_lists(struct subnet_record *d, struct work_record *work, - char *name, int nm_type, struct in_addr ip, BOOL local); + char *name, int nm_type, struct in_addr ip, BOOL local); + +/*The following definitions come from params.c */ + BOOL pm_process(char *pszFileName,BOOL (*sfunc)(char *),BOOL (*pfunc)(char *,char *)); + +/*The following definitions come from password.c */ + void generate_next_challenge(char *challenge); BOOL set_challenge(char *challenge); BOOL last_challenge(char *challenge); @@ -443,8 +540,14 @@ BOOL authorise_login(int snum,char *user,char *password, int pwlen, BOOL check_hosts_equiv(char *user); BOOL server_cryptkey(char *buf); BOOL server_validate(char *buf); + +/*The following definitions come from pcap.c */ + BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); void pcap_printer_fn(void (*fn)()); + +/*The following definitions come from pipes.c */ + int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize); BOOL api_LsarpcSNPHS(int cnum,int uid, char *param,char *data, int mdrcnt,int mprcnt, @@ -454,19 +557,31 @@ BOOL api_LsarpcTNP(int cnum,int uid, char *param,char *data, int mdrcnt,int mprcnt, char **rdata,char **rparam, int *rdata_len,int *rparam_len); + +/*The following definitions come from predict.c */ + int read_predict(int fd,int offset,char *buf,char **ptr,int num); void do_read_prediction(); void invalidate_read_prediction(int fd); + +/*The following definitions come from printing.c */ + void lpq_reset(int snum); void print_file(int fnum); int get_printqueue(int snum,int cnum,print_queue_struct **queue, print_status_struct *status); void del_printqueue(int cnum,int snum,int jobid); void status_printjob(int cnum,int snum,int jobid,int status); + +/*The following definitions come from quotas.c */ + BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); + +/*The following definitions come from replace.c */ + char *Strstr(char *s, char *p); time_t Mktime(struct tm *t); int InNetGr(char *group,char *host,char *user,char *dom); @@ -474,6 +589,9 @@ void *malloc_wrapped(int size,char *file,int line); void *realloc_wrapped(void *ptr,int size,char *file,int line); void free_wrapped(void *ptr,char *file,int line); void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line); + +/*The following definitions come from reply.c */ + int reply_special(char *inbuf,char *outbuf); int reply_tcon(char *inbuf,char *outbuf); int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize); @@ -524,6 +642,9 @@ int reply_writebmpx(char *inbuf,char *outbuf); int reply_writebs(char *inbuf,char *outbuf); int reply_setattrE(char *inbuf,char *outbuf); int reply_getattrE(char *inbuf,char *outbuf); + +/*The following definitions come from server.c */ + mode_t unix_mode(int cnum,int dosmode); int dos_mode(int cnum,char *path,struct stat *sbuf); int dos_chmod(int cnum,char *fname,int dosmode,struct stat *st); @@ -564,6 +685,9 @@ void standard_sub(int cnum,char *s); char *smb_fn_name(int type); int chain_reply(char *inbuf,char *outbuf,int size,int bufsize); int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); + +/*The following definitions come from shmem.c */ + BOOL shm_open( char *file_name, int size); BOOL shm_close( void ); shm_offset_t shm_alloc(int size); @@ -577,6 +701,9 @@ BOOL shm_unlock(void); BOOL shm_get_usage(int *bytes_free, int *bytes_used, int *bytes_overhead); + +/*The following definitions come from smbencrypt.c */ + void str_to_key(uchar *str,uchar *key); void D1(uchar *k, uchar *d, uchar *out); void E1(uchar *k, uchar *d, uchar *out); @@ -585,13 +712,28 @@ void E_P24(uchar *p21, uchar *c8, uchar *p24); void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); void E_md4hash(uchar *passwd, uchar *p16); void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); + +/*The following definitions come from smbpass.c */ + int pw_file_lock(char *name, int type, int secs); int pw_file_unlock(int fd); struct smb_passwd *get_smbpwnam(char *name); + +/*The following definitions come from smbpasswd.c */ + + +/*The following definitions come from smbrun.c */ + + +/*The following definitions come from status.c */ + void Ucrit_addUsername(pstring username); unsigned int Ucrit_checkUsername(pstring username); void Ucrit_addPid(int pid); unsigned int Ucrit_checkPid(int pid); + +/*The following definitions come from system.c */ + int sys_select(fd_set *fds,struct timeval *tval); int sys_select(fd_set *fds,struct timeval *tval); int sys_unlink(char *fname); @@ -607,7 +749,16 @@ int sys_rename(char *from, char *to); int sys_chmod(char *fname,int mode); int sys_chown(char *fname,int uid,int gid); int sys_chroot(char *dname); + +/*The following definitions come from testparm.c */ + + +/*The following definitions come from testprns.c */ + int main(int argc, char *argv[]); + +/*The following definitions come from time.c */ + void GetTimeOfDay(struct timeval *tval); void TimeInit(void); int TimeDiff(time_t t); @@ -622,22 +773,35 @@ time_t make_unix_date2(void *date_ptr); time_t make_unix_date3(void *date_ptr); BOOL set_filetime(char *fname,time_t mtime); char *timestring(void ); + +/*The following definitions come from trans2.c */ + int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize); int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize); int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize); int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize); + +/*The following definitions come from ufc.c */ + char *ufc_crypt(char *key,char *salt); + +/*The following definitions come from uid.c */ + void init_uid(void); BOOL become_guest(void); BOOL become_user(int cnum, int uid); BOOL unbecome_user(void ); int smbrun(char *cmd,char *outfile); -void write_utmp(int dologin, int connection, int pid, - char *from_addr, char *username); + +/*The following definitions come from username.c */ + char *get_home_dir(char *user); void map_username(char *user); struct passwd *Get_Pwnam(char *user,BOOL allow_change); BOOL user_in_list(char *user,char *list); + +/*The following definitions come from util.c */ + void setup_logging(char *pname,BOOL interactive); void reopen_logs(void); BOOL is_a_socket(int fd); @@ -657,9 +821,9 @@ time_t file_modtime(char *fname); BOOL directory_exist(char *dname,struct stat *st); uint32 file_size(char *file_name); char *attrib_string(int mode); -int StrCaseCmp(const char *s, const char *t); -int StrnCaseCmp(const char *s, const char *t, int n); -BOOL strequal(const char *s1, const char *s2); +int StrCaseCmp(char *s, char *t); +int StrnCaseCmp(char *s, char *t, int n); +BOOL strequal(char *s1,char *s2); BOOL strnequal(char *s1,char *s2,int n); BOOL strcsequal(char *s1,char *s2); void strlower(char *s); @@ -744,6 +908,9 @@ char *gidtoname(int gid); void BlockSignals(BOOL block,int signum); void ajt_panic(void); char *readdirname(void *p); + +/*The following definitions come from vt_mode.c */ + int VT_Check(char *buffer); int VT_Start_utmp(void); int VT_Stop_utmp(void); diff --git a/source3/include/version.h b/source3/include/version.h index 5dd6013151..dd02bf425e 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16p1" +#define VERSION "1.9.16p2" -- cgit From 5a2f52b79e28530c454cb488a44588147640f061 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 2 Oct 1996 14:09:22 +0000 Subject: - a huge pile of changes from Luke which implement the browse.conf stuff and also fix a pile of nmbd bugs. Unfortunately I found it very hard to disentangle the new features from the bug fixes so I am putting in the new code. I hope this is the last big pile of changes to the 1.9.16 series! (This used to be commit 20b6203dac4bbb43e4e7bea0b214496d76d679d9) --- source3/include/nameserv.h | 80 +++++++++++++-------- source3/include/proto.h | 171 +++++++++++++++++++++++++++------------------ source3/include/smb.h | 6 +- 3 files changed, 156 insertions(+), 101 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index e4876bac57..1d1cf85962 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -54,6 +54,19 @@ #define NB_HFLAG 0x60 /* microsoft 'hybrid' node type */ #define NB_FLGMSK 0x60 + +#define WG_BROWSE_SIGNATURE 0x017e +#define WG_BROWSE_VERSION 0xff08 + +#define HOST_BROWSE_SIGNATURE 0xaa55 +#define HOST_BROWSE_VERSION 0x010f + +#define WG_MAJOR_VERSION 0x03 +#define WG_MINOR_VERSION 0x0a + +#define HOST_MAJOR_VERSION 0x04 /* nt/as host version */ +#define HOST_MINOR_VERSION 0x01 /* one better than current nt/as version */ + #define REFRESH_TIME (15*60) #define NAME_POLL_REFRESH_TIME (5*60) #define NAME_POLL_INTERVAL 15 @@ -73,7 +86,7 @@ /* server type identifiers */ #define AM_MASTER(work) (work->ServerType & SV_TYPE_MASTER_BROWSER) #define AM_BACKUP(work) (work->ServerType & SV_TYPE_BACKUP_BROWSER) -#define AM_DOMCTL(work) (work->ServerType & SV_TYPE_DOMAIN_CTRL) +#define AM_DMBRSE(work) (work->ServerType & SV_TYPE_DOMAIN_MASTER) /* microsoft browser NetBIOS name */ #define MSBROWSE "\001\002__MSBROWSE__\002" @@ -99,19 +112,19 @@ enum master_state enum state_type { - NAME_STATUS_DOM_SRV_CHK, - NAME_STATUS_SRV_CHK, - NAME_REGISTER_CHALLENGE, - NAME_REGISTER, - NAME_RELEASE, - NAME_QUERY_CONFIRM, - NAME_QUERY_ANNOUNCE_HOST, - NAME_QUERY_SYNC_LOCAL, - NAME_QUERY_SYNC_REMOTE, - NAME_QUERY_DOM_SRV_CHK, - NAME_QUERY_SRV_CHK, - NAME_QUERY_FIND_MST, - NAME_QUERY_MST_CHK + NAME_STATUS_DOM_SRV_CHK, + NAME_STATUS_SRV_CHK, + NAME_REGISTER_CHALLENGE, + NAME_REGISTER, + NAME_RELEASE, + NAME_QUERY_CONFIRM, + NAME_QUERY_ANNOUNCE_HOST, + NAME_QUERY_SYNC_LOCAL, + NAME_QUERY_SYNC_REMOTE, + NAME_QUERY_DOM_SRV_CHK, + NAME_QUERY_SRV_CHK, + NAME_QUERY_FIND_MST, + NAME_QUERY_MST_CHK }; /* a netbios name structure */ @@ -121,6 +134,14 @@ struct nmb_name { int name_type; }; +/* A server name and comment. */ +struct server_identity +{ + char *name; + char *comment; + struct server_identity *next; +}; + /* a netbios flags + ip address structure */ /* this is used for multi-homed systems and for internet group names */ struct nmb_ip @@ -148,16 +169,16 @@ struct name_record /* browse and backup server cache for synchronising browse list */ struct browse_cache_record { - struct browse_cache_record *next; - struct browse_cache_record *prev; - - pstring name; - int type; - pstring group; - struct in_addr ip; - time_t sync_time; - BOOL synced; - BOOL local; + struct browse_cache_record *next; + struct browse_cache_record *prev; + + char name[17]; + int type; + char group[17]; + struct in_addr ip; + time_t sync_time; + BOOL synced; + BOOL local; }; /* this is used to hold the list of servers in my domain, and is */ @@ -183,7 +204,7 @@ struct work_record enum master_state state; /* work group info */ - fstring work_group; + char work_group[17]; int token; /* used when communicating with backup browsers */ int ServerType; @@ -214,17 +235,18 @@ struct response_record int fd; int quest_type; struct nmb_name name; - int nb_flags; + struct nmb_ip reply; time_t ttl; + enum name_source source; + int token; /* unique workgroup token id */ int server_type; - fstring my_name; - fstring my_comment; + char my_name[17]; + char my_comment[50]; BOOL bcast; BOOL recurse; struct in_addr send_ip; - struct in_addr reply_to_ip; int num_msgs; diff --git a/source3/include/proto.h b/source3/include/proto.h index e20238fee4..5f18c488ce 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -51,7 +51,7 @@ char *smb_errstr(char *inbuf); /*The following definitions come from clitar.c */ -int strslashcmp(const char *s1, const char *s2); +int strslashcmp(char *s1,char *s2); void cmd_block(void); void cmd_tarmode(void); void cmd_setmode(void); @@ -124,6 +124,7 @@ char *lp_smbrun(void); char *lp_configfile(void); char *lp_smb_passwd_file(void); char *lp_serverstring(void); +char *lp_server_comment(void); char *lp_printcapname(void); char *lp_lockdir(void); char *lp_rootdir(void); @@ -146,6 +147,7 @@ char *lp_interfaces(void); char *lp_socket_address(void); BOOL lp_wins_support(void); BOOL lp_wins_proxy(void); +BOOL lp_local_master(void); BOOL lp_domain_master(void); BOOL lp_domain_logons(void); BOOL lp_preferred_master(void); @@ -292,20 +294,22 @@ int reply_sendend(char *inbuf,char *outbuf); /*The following definitions come from nameannounce.c */ void announce_request(struct work_record *work, struct in_addr ip); -void do_announce_request(char *info, char *to_name, int announce_type, - int from, - int to, struct in_addr dest_ip); +void do_announce_request(char *info, char *from_name, char *to_name, + int announce_type, int from, int to, struct in_addr dest_ip); void sync_server(enum state_type state, char *serv_name, char *work_name, - int name_type, - struct in_addr ip); + int name_type, + struct in_addr ip); void do_announce_host(int command, - char *from_name, int from_type, struct in_addr from_ip, - char *to_name , int to_type , struct in_addr to_ip, - time_t announce_interval, - char *server_name, int server_type, char *server_comment); + char *from_name, int from_type, struct in_addr from_ip, + char *to_name , int to_type , struct in_addr to_ip, + time_t announce_interval, + char *server_name, int server_type, + char major_version, char minor_version, + uint16 browse_version, uint16 browse_sig, + char *server_comment); void remove_my_servers(void); void announce_server(struct subnet_record *d, struct work_record *work, - char *name, char *comment, time_t ttl, int server_type); + char *name, char *comment, time_t ttl, int server_type); void announce_host(void); void announce_master(void); void announce_remote(void); @@ -314,9 +318,25 @@ void announce_remote(void); void expire_browse_cache(time_t t); struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, - time_t ttl, struct in_addr ip, BOOL local); + time_t ttl, struct in_addr ip, BOOL local); void do_browser_lists(void); +/*The following definitions come from nameconf.c */ + +int get_num_workgroups(void); +int conf_workgroup_name_to_token(char *workgroup_name,char *default_name); +char *conf_workgroup_name(int token); +int conf_should_preferred_master(int token); +int conf_should_workgroup_member(int token); +int conf_should_local_master(int token); +int conf_should_domain_logon(int token); +int conf_should_domain_master(int token); +char *conf_browsing_alias(int token); +char *conf_browsing_alias_comment(int token); +char *conf_alias_to_workgroup(char *alias); +int conf_alias_to_token(char *alias); +void read_smbbrowse_conf(char *default_name); + /*The following definitions come from namedbname.c */ void set_samba_nb_type(void); @@ -324,24 +344,24 @@ BOOL name_equal(struct nmb_name *n1,struct nmb_name *n2); BOOL ms_browser_name(char *name, int type); void remove_name(struct subnet_record *d, struct name_record *n); struct name_record *find_name(struct name_record *n, - struct nmb_name *name, - int search); + struct nmb_name *name, + int search); struct name_record *find_name_search(struct subnet_record **d, - struct nmb_name *name, - int search, struct in_addr ip); + struct nmb_name *name, + int search, struct in_addr ip); void dump_names(void); void load_netbios_names(void); void remove_netbios_name(struct subnet_record *d, - char *name,int type, enum name_source source, - struct in_addr ip); + char *name,int type, enum name_source source, + struct in_addr ip); struct name_record *add_netbios_entry(struct subnet_record *d, - char *name, int type, int nb_flags, - int ttl, enum name_source source, struct in_addr ip, - BOOL new_only,BOOL wins); -void expire_names(time_t t); + char *name, int type, int nb_flags, + int ttl, enum name_source source, struct in_addr ip, + BOOL new_only,BOOL wins); +void check_expire_names(time_t t); struct name_record *search_for_name(struct subnet_record **d, - struct nmb_name *question, - struct in_addr ip, int Time, int search); + struct nmb_name *question, + struct in_addr ip, int Time, int search); /*The following definitions come from namedbresp.c */ @@ -350,8 +370,9 @@ void add_response_record(struct subnet_record *d, void remove_response_record(struct subnet_record *d, struct response_record *n); struct response_record *make_response_queue_record(enum state_type state, - int id,uint16 fd, - int quest_type, char *name,int type, int nb_flags, time_t ttl, + int id,uint16 fd, int quest_type, + int token, char *name,int type, + enum name_source source, int nb_flags, time_t ttl, int server_type, char *my_name, char *my_comment, BOOL bcast,BOOL recurse, struct in_addr send_ip, struct in_addr reply_to_ip); @@ -361,13 +382,13 @@ struct response_record *find_response_record(struct subnet_record **d, /*The following definitions come from namedbserver.c */ void remove_old_servers(struct work_record *work, time_t t, - BOOL remove_all); + BOOL remove_all); struct server_record *find_server(struct work_record *work, char *name); struct server_record *add_server_entry(struct subnet_record *d, - struct work_record *work, - char *name,int servertype, - int ttl,char *comment, - BOOL replace); + struct work_record *work, + char *name,int servertype, + int ttl,char *comment, + BOOL replace); void expire_servers(time_t t); /*The following definitions come from namedbsubnet.c */ @@ -375,19 +396,21 @@ void expire_servers(time_t t); struct subnet_record *find_subnet(struct in_addr bcast_ip); struct subnet_record *find_req_subnet(struct in_addr ip, BOOL bcast); void add_subnet_interfaces(void); -void add_my_subnets(char *group); +void add_workgroup_to_subnet(char *group, struct in_addr bcast_ip, + struct in_addr mask_ip); +void add_workgroups_to_subnets(); struct subnet_record *add_subnet_entry(struct in_addr bcast_ip, - struct in_addr mask_ip, - char *name, BOOL add, BOOL lmhosts); + struct in_addr mask_ip, + char *name, BOOL add, BOOL lmhosts); void write_browse_list(void); /*The following definitions come from namedbwork.c */ struct work_record *remove_workgroup(struct subnet_record *d, - struct work_record *work, - BOOL remove_all_servers); + struct work_record *work, + BOOL remove_all_servers); struct work_record *find_workgroupstruct(struct subnet_record *d, - fstring name, BOOL add); + fstring name, BOOL add); void dump_workgroups(void); /*The following definitions come from nameelect.c */ @@ -395,13 +418,14 @@ void dump_workgroups(void); void check_master_browser(void); void browser_gone(char *work_name, struct in_addr ip); void send_election(struct subnet_record *d, char *group,uint32 criterion, - int timeup,char *name); + int timeup,char *name); void name_unregister_work(struct subnet_record *d, char *name, int name_type); -void name_register_work(struct subnet_record *d, char *name, int name_type, - int nb_flags, time_t ttl, struct in_addr ip, BOOL bcast); +void name_register_work(struct subnet_record *d, int token, + char *name, int name_type, enum name_source source, + struct nmb_ip *data, time_t ttl, struct in_addr ip, BOOL bcast); void become_master(struct subnet_record *d, struct work_record *work); void become_nonmaster(struct subnet_record *d, struct work_record *work, - int remove_type); + int remove_type); void run_elections(void); void process_election(struct packet_struct *p,char *buf); BOOL check_elections(void); @@ -413,20 +437,20 @@ void process_logon_packet(struct packet_struct *p,char *buf,int len); /*The following definitions come from namepacket.c */ void debug_browse_data(char *outbuf, int len); -void initiate_netbios_packet(uint16 *id, - int fd,int quest_type,char *name,int name_type, - int nb_flags,BOOL bcast,BOOL recurse, - struct in_addr to_ip); +BOOL initiate_netbios_packet(uint16 id, + int fd,int quest_type,char *name,int name_type, + int nb_flags,BOOL bcast,BOOL recurse, + struct in_addr to_ip); void reply_netbios_packet(struct packet_struct *p1,int trn_id, - int rcode, int rcv_code, int opcode, BOOL recurse, - struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, - char *data,int len); + int rcode, int rcv_code, int opcode, BOOL recurse, + struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, + char *data,int len); void queue_packet(struct packet_struct *packet); void run_packet_queue(); void listen_for_packets(BOOL run_election); BOOL send_mailslot_reply(char *mailslot,int fd,char *buf,int len,char *srcname, - char *dstname,int src_type,int dest_type, - struct in_addr dest_ip,struct in_addr src_ip); + char *dstname,int src_type,int dest_type, + struct in_addr dest_ip,struct in_addr src_ip); /*The following definitions come from namequery.c */ @@ -439,27 +463,30 @@ BOOL name_query(int fd,char *name,int name_type, /*The following definitions come from nameresp.c */ +void update_name_trn_id(void); void expire_netbios_response_entries(); -struct response_record *queue_netbios_pkt_wins(struct subnet_record *d, - int fd,int quest_type,enum state_type state, - char *name,int name_type,int nb_flags, time_t ttl, - int server_type, char *my_name, char *my_comment, - BOOL bcast,BOOL recurse, - struct in_addr send_ip, struct in_addr reply_to_ip); -struct response_record *queue_netbios_packet(struct subnet_record *d, - int fd,int quest_type,enum state_type state,char *name, - int name_type,int nb_flags, time_t ttl, - int server_type, char *my_name, char *my_comment, - BOOL bcast,BOOL recurse, - struct in_addr send_ip, struct in_addr reply_to_ip); +void queue_netbios_pkt_wins(struct subnet_record *d, + int fd,int quest_type,enum state_type state, + int token, char *name,int name_type, + enum name_source source, int nb_flags, time_t ttl, + int server_type, char *my_name, char *my_comment, + BOOL bcast,BOOL recurse, + struct in_addr send_ip, struct in_addr reply_to_ip); +void queue_netbios_packet(struct subnet_record *d, + int fd,int quest_type,enum state_type state, + int token, char *name, int name_type, + enum name_source source, int nb_flags, time_t ttl, + int server_type, char *my_name, char *my_comment, + BOOL bcast,BOOL recurse, + struct in_addr send_ip, struct in_addr reply_to_ip); /*The following definitions come from nameserv.c */ -void remove_name_entry(struct subnet_record *d, char *name,int type); -void add_my_name_entry(struct subnet_record *d,char *name,int type,int nb_flags); +void remove_name_entry(struct subnet_record *d, int token, char *name,int type); +void add_my_name_entry(struct subnet_record *d, int token, + char *name,int type,int nb_flags); void add_my_names(void); void remove_my_names(); -void refresh_my_names(time_t t); void query_refresh_names(void); /*The following definitions come from nameservreply.c */ @@ -481,13 +508,18 @@ void reply_name_query(struct packet_struct *p); /*The following definitions come from nameservresp.c */ void debug_state_type(int state); +void response_process(struct in_addr ip, struct subnet_record *d, + struct response_record *n, + int rcode, char *nmb_data, struct nmb_name *q_name, + time_t ttl, BOOL bcast, struct nmb_name *ans_name); void response_netbios_packet(struct packet_struct *p); /*The following definitions come from namework.c */ -void reset_server(char *name, int state, struct in_addr ip); +void reset_server(struct work_record *work, char *name, int state, struct in_addr ip); void tell_become_backup(void); BOOL same_context(struct dgram_packet *dgram); +BOOL listening_name(struct work_record *work, struct nmb_name *n); void process_browse_packet(struct packet_struct *p,char *buf,int len); /*The following definitions come from nmbd.c */ @@ -513,7 +545,7 @@ int main(int argc,char *argv[]); char *getsmbpass(char *pass); void sync_browse_lists(struct subnet_record *d, struct work_record *work, - char *name, int nm_type, struct in_addr ip, BOOL local); + char *name, int nm_type, struct in_addr ip, BOOL local); /*The following definitions come from params.c */ @@ -533,7 +565,7 @@ void add_session_user(char *user); void dfs_unlogin(void); BOOL password_check(char *password); BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8); -BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd, BOOL is_nt_password); +BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd); BOOL user_ok(char *user,int snum); BOOL authorise_login(int snum,char *user,char *password, int pwlen, BOOL *guest,BOOL *force,int vuid); @@ -737,6 +769,7 @@ unsigned int Ucrit_checkPid(int pid); int sys_select(fd_set *fds,struct timeval *tval); int sys_select(fd_set *fds,struct timeval *tval); int sys_unlink(char *fname); +unsigned int sys_random(int max_range); int sys_open(char *fname,int flags,int mode); DIR *sys_opendir(char *dname); int sys_stat(char *fname,struct stat *sbuf); @@ -813,7 +846,7 @@ void set_socket_options(int fd, char *options); void close_sockets(void ); BOOL in_group(gid_t group, int current_gid, int ngroups, int *groups); char *StrCpy(char *dest,char *src); -char *StrnCpy(char *dest,const char *src,int n); +char *StrnCpy(char *dest,char *src,int n); void putip(void *dest,void *src); int name_mangle(char *In,char *Out,char name_type); BOOL file_exist(char *fname,struct stat *sbuf); diff --git a/source3/include/smb.h b/source3/include/smb.h index f5d35d5261..56ad8cbacd 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -380,10 +380,10 @@ typedef struct /* used for server information: client, nameserv and ipc */ struct server_info_struct { - fstring name; + char name[17]; uint32 type; - fstring comment; - fstring domain; /* used ONLY in ipc.c NOT namework.c */ + char comment[50]; + char domain[17]; /* used ONLY in ipc.c NOT namework.c */ BOOL server_added; /* used ONLY in ipc.c NOT namework.c */ }; -- cgit From afd08462ad5ff6b3c4bf621e39c55853a608175e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 2 Oct 1996 15:41:30 +0000 Subject: backout all the changes to nmbd. The 1.9.16 tree is now back to 1.9.16p2 as far as nmbd is concerned apart from a small change that fixes the announce type in two places. (This used to be commit 45e66a69d320024877c8b13f12b21bf895e04410) --- source3/include/nameserv.h | 80 +++++++++--------------- source3/include/proto.h | 151 ++++++++++++++++++++------------------------- source3/include/smb.h | 6 +- 3 files changed, 98 insertions(+), 139 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 1d1cf85962..e4876bac57 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -54,19 +54,6 @@ #define NB_HFLAG 0x60 /* microsoft 'hybrid' node type */ #define NB_FLGMSK 0x60 - -#define WG_BROWSE_SIGNATURE 0x017e -#define WG_BROWSE_VERSION 0xff08 - -#define HOST_BROWSE_SIGNATURE 0xaa55 -#define HOST_BROWSE_VERSION 0x010f - -#define WG_MAJOR_VERSION 0x03 -#define WG_MINOR_VERSION 0x0a - -#define HOST_MAJOR_VERSION 0x04 /* nt/as host version */ -#define HOST_MINOR_VERSION 0x01 /* one better than current nt/as version */ - #define REFRESH_TIME (15*60) #define NAME_POLL_REFRESH_TIME (5*60) #define NAME_POLL_INTERVAL 15 @@ -86,7 +73,7 @@ /* server type identifiers */ #define AM_MASTER(work) (work->ServerType & SV_TYPE_MASTER_BROWSER) #define AM_BACKUP(work) (work->ServerType & SV_TYPE_BACKUP_BROWSER) -#define AM_DMBRSE(work) (work->ServerType & SV_TYPE_DOMAIN_MASTER) +#define AM_DOMCTL(work) (work->ServerType & SV_TYPE_DOMAIN_CTRL) /* microsoft browser NetBIOS name */ #define MSBROWSE "\001\002__MSBROWSE__\002" @@ -112,19 +99,19 @@ enum master_state enum state_type { - NAME_STATUS_DOM_SRV_CHK, - NAME_STATUS_SRV_CHK, - NAME_REGISTER_CHALLENGE, - NAME_REGISTER, - NAME_RELEASE, - NAME_QUERY_CONFIRM, - NAME_QUERY_ANNOUNCE_HOST, - NAME_QUERY_SYNC_LOCAL, - NAME_QUERY_SYNC_REMOTE, - NAME_QUERY_DOM_SRV_CHK, - NAME_QUERY_SRV_CHK, - NAME_QUERY_FIND_MST, - NAME_QUERY_MST_CHK + NAME_STATUS_DOM_SRV_CHK, + NAME_STATUS_SRV_CHK, + NAME_REGISTER_CHALLENGE, + NAME_REGISTER, + NAME_RELEASE, + NAME_QUERY_CONFIRM, + NAME_QUERY_ANNOUNCE_HOST, + NAME_QUERY_SYNC_LOCAL, + NAME_QUERY_SYNC_REMOTE, + NAME_QUERY_DOM_SRV_CHK, + NAME_QUERY_SRV_CHK, + NAME_QUERY_FIND_MST, + NAME_QUERY_MST_CHK }; /* a netbios name structure */ @@ -134,14 +121,6 @@ struct nmb_name { int name_type; }; -/* A server name and comment. */ -struct server_identity -{ - char *name; - char *comment; - struct server_identity *next; -}; - /* a netbios flags + ip address structure */ /* this is used for multi-homed systems and for internet group names */ struct nmb_ip @@ -169,16 +148,16 @@ struct name_record /* browse and backup server cache for synchronising browse list */ struct browse_cache_record { - struct browse_cache_record *next; - struct browse_cache_record *prev; - - char name[17]; - int type; - char group[17]; - struct in_addr ip; - time_t sync_time; - BOOL synced; - BOOL local; + struct browse_cache_record *next; + struct browse_cache_record *prev; + + pstring name; + int type; + pstring group; + struct in_addr ip; + time_t sync_time; + BOOL synced; + BOOL local; }; /* this is used to hold the list of servers in my domain, and is */ @@ -204,7 +183,7 @@ struct work_record enum master_state state; /* work group info */ - char work_group[17]; + fstring work_group; int token; /* used when communicating with backup browsers */ int ServerType; @@ -235,18 +214,17 @@ struct response_record int fd; int quest_type; struct nmb_name name; - struct nmb_ip reply; + int nb_flags; time_t ttl; - enum name_source source; - int token; /* unique workgroup token id */ int server_type; - char my_name[17]; - char my_comment[50]; + fstring my_name; + fstring my_comment; BOOL bcast; BOOL recurse; struct in_addr send_ip; + struct in_addr reply_to_ip; int num_msgs; diff --git a/source3/include/proto.h b/source3/include/proto.h index 5f18c488ce..1b76591abd 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -124,7 +124,6 @@ char *lp_smbrun(void); char *lp_configfile(void); char *lp_smb_passwd_file(void); char *lp_serverstring(void); -char *lp_server_comment(void); char *lp_printcapname(void); char *lp_lockdir(void); char *lp_rootdir(void); @@ -147,7 +146,6 @@ char *lp_interfaces(void); char *lp_socket_address(void); BOOL lp_wins_support(void); BOOL lp_wins_proxy(void); -BOOL lp_local_master(void); BOOL lp_domain_master(void); BOOL lp_domain_logons(void); BOOL lp_preferred_master(void); @@ -294,22 +292,20 @@ int reply_sendend(char *inbuf,char *outbuf); /*The following definitions come from nameannounce.c */ void announce_request(struct work_record *work, struct in_addr ip); -void do_announce_request(char *info, char *from_name, char *to_name, - int announce_type, int from, int to, struct in_addr dest_ip); +void do_announce_request(char *info, char *to_name, int announce_type, + int from, + int to, struct in_addr dest_ip); void sync_server(enum state_type state, char *serv_name, char *work_name, - int name_type, - struct in_addr ip); + int name_type, + struct in_addr ip); void do_announce_host(int command, - char *from_name, int from_type, struct in_addr from_ip, - char *to_name , int to_type , struct in_addr to_ip, - time_t announce_interval, - char *server_name, int server_type, - char major_version, char minor_version, - uint16 browse_version, uint16 browse_sig, - char *server_comment); + char *from_name, int from_type, struct in_addr from_ip, + char *to_name , int to_type , struct in_addr to_ip, + time_t announce_interval, + char *server_name, int server_type, char *server_comment); void remove_my_servers(void); void announce_server(struct subnet_record *d, struct work_record *work, - char *name, char *comment, time_t ttl, int server_type); + char *name, char *comment, time_t ttl, int server_type); void announce_host(void); void announce_master(void); void announce_remote(void); @@ -318,7 +314,7 @@ void announce_remote(void); void expire_browse_cache(time_t t); struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, - time_t ttl, struct in_addr ip, BOOL local); + time_t ttl, struct in_addr ip, BOOL local); void do_browser_lists(void); /*The following definitions come from nameconf.c */ @@ -326,10 +322,8 @@ void do_browser_lists(void); int get_num_workgroups(void); int conf_workgroup_name_to_token(char *workgroup_name,char *default_name); char *conf_workgroup_name(int token); -int conf_should_preferred_master(int token); int conf_should_workgroup_member(int token); int conf_should_local_master(int token); -int conf_should_domain_logon(int token); int conf_should_domain_master(int token); char *conf_browsing_alias(int token); char *conf_browsing_alias_comment(int token); @@ -344,24 +338,24 @@ BOOL name_equal(struct nmb_name *n1,struct nmb_name *n2); BOOL ms_browser_name(char *name, int type); void remove_name(struct subnet_record *d, struct name_record *n); struct name_record *find_name(struct name_record *n, - struct nmb_name *name, - int search); + struct nmb_name *name, + int search); struct name_record *find_name_search(struct subnet_record **d, - struct nmb_name *name, - int search, struct in_addr ip); + struct nmb_name *name, + int search, struct in_addr ip); void dump_names(void); void load_netbios_names(void); void remove_netbios_name(struct subnet_record *d, - char *name,int type, enum name_source source, - struct in_addr ip); + char *name,int type, enum name_source source, + struct in_addr ip); struct name_record *add_netbios_entry(struct subnet_record *d, - char *name, int type, int nb_flags, - int ttl, enum name_source source, struct in_addr ip, - BOOL new_only,BOOL wins); -void check_expire_names(time_t t); + char *name, int type, int nb_flags, + int ttl, enum name_source source, struct in_addr ip, + BOOL new_only,BOOL wins); +void expire_names(time_t t); struct name_record *search_for_name(struct subnet_record **d, - struct nmb_name *question, - struct in_addr ip, int Time, int search); + struct nmb_name *question, + struct in_addr ip, int Time, int search); /*The following definitions come from namedbresp.c */ @@ -370,9 +364,8 @@ void add_response_record(struct subnet_record *d, void remove_response_record(struct subnet_record *d, struct response_record *n); struct response_record *make_response_queue_record(enum state_type state, - int id,uint16 fd, int quest_type, - int token, char *name,int type, - enum name_source source, int nb_flags, time_t ttl, + int id,uint16 fd, + int quest_type, char *name,int type, int nb_flags, time_t ttl, int server_type, char *my_name, char *my_comment, BOOL bcast,BOOL recurse, struct in_addr send_ip, struct in_addr reply_to_ip); @@ -382,13 +375,13 @@ struct response_record *find_response_record(struct subnet_record **d, /*The following definitions come from namedbserver.c */ void remove_old_servers(struct work_record *work, time_t t, - BOOL remove_all); + BOOL remove_all); struct server_record *find_server(struct work_record *work, char *name); struct server_record *add_server_entry(struct subnet_record *d, - struct work_record *work, - char *name,int servertype, - int ttl,char *comment, - BOOL replace); + struct work_record *work, + char *name,int servertype, + int ttl,char *comment, + BOOL replace); void expire_servers(time_t t); /*The following definitions come from namedbsubnet.c */ @@ -396,21 +389,19 @@ void expire_servers(time_t t); struct subnet_record *find_subnet(struct in_addr bcast_ip); struct subnet_record *find_req_subnet(struct in_addr ip, BOOL bcast); void add_subnet_interfaces(void); -void add_workgroup_to_subnet(char *group, struct in_addr bcast_ip, - struct in_addr mask_ip); -void add_workgroups_to_subnets(); +void add_my_subnets(char *group); struct subnet_record *add_subnet_entry(struct in_addr bcast_ip, - struct in_addr mask_ip, - char *name, BOOL add, BOOL lmhosts); + struct in_addr mask_ip, + char *name, BOOL add, BOOL lmhosts); void write_browse_list(void); /*The following definitions come from namedbwork.c */ struct work_record *remove_workgroup(struct subnet_record *d, - struct work_record *work, - BOOL remove_all_servers); + struct work_record *work, + BOOL remove_all_servers); struct work_record *find_workgroupstruct(struct subnet_record *d, - fstring name, BOOL add); + fstring name, BOOL add); void dump_workgroups(void); /*The following definitions come from nameelect.c */ @@ -418,14 +409,13 @@ void dump_workgroups(void); void check_master_browser(void); void browser_gone(char *work_name, struct in_addr ip); void send_election(struct subnet_record *d, char *group,uint32 criterion, - int timeup,char *name); + int timeup,char *name); void name_unregister_work(struct subnet_record *d, char *name, int name_type); -void name_register_work(struct subnet_record *d, int token, - char *name, int name_type, enum name_source source, - struct nmb_ip *data, time_t ttl, struct in_addr ip, BOOL bcast); +void name_register_work(struct subnet_record *d, char *name, int name_type, + int nb_flags, time_t ttl, struct in_addr ip, BOOL bcast); void become_master(struct subnet_record *d, struct work_record *work); void become_nonmaster(struct subnet_record *d, struct work_record *work, - int remove_type); + int remove_type); void run_elections(void); void process_election(struct packet_struct *p,char *buf); BOOL check_elections(void); @@ -437,20 +427,20 @@ void process_logon_packet(struct packet_struct *p,char *buf,int len); /*The following definitions come from namepacket.c */ void debug_browse_data(char *outbuf, int len); -BOOL initiate_netbios_packet(uint16 id, - int fd,int quest_type,char *name,int name_type, - int nb_flags,BOOL bcast,BOOL recurse, - struct in_addr to_ip); +void initiate_netbios_packet(uint16 *id, + int fd,int quest_type,char *name,int name_type, + int nb_flags,BOOL bcast,BOOL recurse, + struct in_addr to_ip); void reply_netbios_packet(struct packet_struct *p1,int trn_id, - int rcode, int rcv_code, int opcode, BOOL recurse, - struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, - char *data,int len); + int rcode, int rcv_code, int opcode, BOOL recurse, + struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, + char *data,int len); void queue_packet(struct packet_struct *packet); void run_packet_queue(); void listen_for_packets(BOOL run_election); BOOL send_mailslot_reply(char *mailslot,int fd,char *buf,int len,char *srcname, - char *dstname,int src_type,int dest_type, - struct in_addr dest_ip,struct in_addr src_ip); + char *dstname,int src_type,int dest_type, + struct in_addr dest_ip,struct in_addr src_ip); /*The following definitions come from namequery.c */ @@ -463,30 +453,27 @@ BOOL name_query(int fd,char *name,int name_type, /*The following definitions come from nameresp.c */ -void update_name_trn_id(void); void expire_netbios_response_entries(); -void queue_netbios_pkt_wins(struct subnet_record *d, - int fd,int quest_type,enum state_type state, - int token, char *name,int name_type, - enum name_source source, int nb_flags, time_t ttl, - int server_type, char *my_name, char *my_comment, - BOOL bcast,BOOL recurse, - struct in_addr send_ip, struct in_addr reply_to_ip); -void queue_netbios_packet(struct subnet_record *d, - int fd,int quest_type,enum state_type state, - int token, char *name, int name_type, - enum name_source source, int nb_flags, time_t ttl, - int server_type, char *my_name, char *my_comment, - BOOL bcast,BOOL recurse, - struct in_addr send_ip, struct in_addr reply_to_ip); +struct response_record *queue_netbios_pkt_wins(struct subnet_record *d, + int fd,int quest_type,enum state_type state, + char *name,int name_type,int nb_flags, time_t ttl, + int server_type, char *my_name, char *my_comment, + BOOL bcast,BOOL recurse, + struct in_addr send_ip, struct in_addr reply_to_ip); +struct response_record *queue_netbios_packet(struct subnet_record *d, + int fd,int quest_type,enum state_type state,char *name, + int name_type,int nb_flags, time_t ttl, + int server_type, char *my_name, char *my_comment, + BOOL bcast,BOOL recurse, + struct in_addr send_ip, struct in_addr reply_to_ip); /*The following definitions come from nameserv.c */ -void remove_name_entry(struct subnet_record *d, int token, char *name,int type); -void add_my_name_entry(struct subnet_record *d, int token, - char *name,int type,int nb_flags); +void remove_name_entry(struct subnet_record *d, char *name,int type); +void add_my_name_entry(struct subnet_record *d,char *name,int type,int nb_flags); void add_my_names(void); void remove_my_names(); +void refresh_my_names(time_t t); void query_refresh_names(void); /*The following definitions come from nameservreply.c */ @@ -508,18 +495,13 @@ void reply_name_query(struct packet_struct *p); /*The following definitions come from nameservresp.c */ void debug_state_type(int state); -void response_process(struct in_addr ip, struct subnet_record *d, - struct response_record *n, - int rcode, char *nmb_data, struct nmb_name *q_name, - time_t ttl, BOOL bcast, struct nmb_name *ans_name); void response_netbios_packet(struct packet_struct *p); /*The following definitions come from namework.c */ -void reset_server(struct work_record *work, char *name, int state, struct in_addr ip); +void reset_server(char *name, int state, struct in_addr ip); void tell_become_backup(void); BOOL same_context(struct dgram_packet *dgram); -BOOL listening_name(struct work_record *work, struct nmb_name *n); void process_browse_packet(struct packet_struct *p,char *buf,int len); /*The following definitions come from nmbd.c */ @@ -545,7 +527,7 @@ int main(int argc,char *argv[]); char *getsmbpass(char *pass); void sync_browse_lists(struct subnet_record *d, struct work_record *work, - char *name, int nm_type, struct in_addr ip, BOOL local); + char *name, int nm_type, struct in_addr ip, BOOL local); /*The following definitions come from params.c */ @@ -769,7 +751,6 @@ unsigned int Ucrit_checkPid(int pid); int sys_select(fd_set *fds,struct timeval *tval); int sys_select(fd_set *fds,struct timeval *tval); int sys_unlink(char *fname); -unsigned int sys_random(int max_range); int sys_open(char *fname,int flags,int mode); DIR *sys_opendir(char *dname); int sys_stat(char *fname,struct stat *sbuf); diff --git a/source3/include/smb.h b/source3/include/smb.h index 56ad8cbacd..f5d35d5261 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -380,10 +380,10 @@ typedef struct /* used for server information: client, nameserv and ipc */ struct server_info_struct { - char name[17]; + fstring name; uint32 type; - char comment[50]; - char domain[17]; /* used ONLY in ipc.c NOT namework.c */ + fstring comment; + fstring domain; /* used ONLY in ipc.c NOT namework.c */ BOOL server_added; /* used ONLY in ipc.c NOT namework.c */ }; -- cgit From e23f2b9cef8428bda51b413642d9720ba5c590d5 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 4 Oct 1996 09:31:07 +0000 Subject: - changed the umask handling. We now set the umask to 0 and explicitly set the mode on all created files. I think this is a better policy. - change the debug levels on some items - fix a charset handling bug which affected foreign and extended charset users - no longer switch back to the original directory when idle, instead switch to / as the original directory may not be readable by ordinary users. - fix some bugs where the create mode of files was not being explicitly set (it was relying on the umask and using fopen). Not a big bug as it only affected obscure commands like the messaging ops. - got rid of the lock code in the lpq cache as its no longer needed - rewrote smbrun to be faster and to remove the security hole. We now don't actually need a external smbrun binary, its all done by smbd. - add a more explicit warning about uids and gids of -1 or 65535 (This used to be commit 5aa735c940ccdb6acae5f28449d484181c912e49) --- source3/include/local.h | 4 ++++ source3/include/proto.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index 3f8572e73d..115617094c 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -154,4 +154,8 @@ #define LONG_CONNECT_TIMEOUT 30 #define SHORT_CONNECT_TIMEOUT 5 + +/* the directory to sit in when idle */ +#define IDLE_DIR "/" + #endif diff --git a/source3/include/proto.h b/source3/include/proto.h index 1b76591abd..8b26aa062f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -805,7 +805,7 @@ void init_uid(void); BOOL become_guest(void); BOOL become_user(int cnum, int uid); BOOL unbecome_user(void ); -int smbrun(char *cmd,char *outfile); +int smbrun(char *cmd,char *outfile,BOOL shared); /*The following definitions come from username.c */ -- cgit From 38087ccb4071bfff29801026e2bf5c47565305b4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 5 Oct 1996 02:54:37 +0000 Subject: - use workgroup from smb.conf in smbclient - change debug level on clitar stuff - define MAP_FILE if not defined - ensure we never set authoritative on queries in nmbd - fake a positive response to SMBioctl, apparently this is needed for some WfWg printer drivers - deny file access for non-fcbopen queries when (access_allowed == AREAD && flags == O_RDWR) - add sys_waitpid() (This used to be commit 61e3116e573637d6b5a878eeb8db72831e3c5bd1) --- source3/include/includes.h | 6 ++++++ source3/include/proto.h | 1 + 2 files changed, 7 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 5d5fd7fd55..90358ce49a 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -220,6 +220,7 @@ Here come some platform specific sections #define HAVE_BZERO #define HAVE_MEMMOVE #define USE_SIGPROCMASK +#define USE_WAITPID #if 0 /* SETFS disabled until we can check on some bug reports */ #if _LINUX_C_LIB_VERSION_MAJOR >= 5 @@ -258,6 +259,7 @@ typedef unsigned short mode_t; #define REPLACE_GETPASS #define BSD_TERMIO #define USE_SIGPROCMASK +#define USE_WAITPID #endif @@ -1080,6 +1082,10 @@ it works and getting lots of bug reports */ #define SIGCLD SIGCHLD #endif +#ifndef MAP_FILE +#define MAP_FILE 0 +#endif + #ifndef HAVE_FCNTL_LOCK #define HAVE_FCNTL_LOCK 1 #endif diff --git a/source3/include/proto.h b/source3/include/proto.h index 8b26aa062f..779f6bd87e 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -754,6 +754,7 @@ int sys_unlink(char *fname); int sys_open(char *fname,int flags,int mode); DIR *sys_opendir(char *dname); int sys_stat(char *fname,struct stat *sbuf); +int sys_waitpid(pid_t pid,int *status,int options); int sys_lstat(char *fname,struct stat *sbuf); int sys_mkdir(char *dname,int mode); int sys_rmdir(char *dname); -- cgit From e5893bdfbef0ac16772199d7ec6fac7d3e4f8431 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 5 Oct 1996 10:41:13 +0000 Subject: I have fixed quite a few important bugs in this commit. Luke, can you take special note of the bug fixes to nmbd so you can propogate them to your new code. - rewrote the code that used to use fromhost(). We now call gethostbyaddr() only if necessary and a maximum of once per connection. Calling gethostbyaddr() causes problems on some systems so avoiding it if possible is a good thing :-) - added the "fake oplocks" option. See the docs in smb.conf(5) and Speed.txt - fixed a serious bug in nmbd where it would try a DNS lookup on FIND_SELF queries. This caused a lot of unnecessary (and incorrect) DNS lookups to happen. FIND_SELF queries should only go to the internal name tables. - don't set FIND_SELF for name queries if we are a wins proxy, as we are supposed to be answering queries for other hosts. - fixed a bug in nmbd which had "if (search | FIND_LOCAL)" instead of "if (search & FIND_LOCAL)". Luke, this was in nameservreply.c - the above 3 bugs together meant that DNS queries were being cached, but the cache wasn't being used, so every query was going to DNS, no wonder nmbd has been chewing so much CPU time! Another side effect was that queries on names in lmhosts weren't being answered for bcast queries with "wins proxy" set. - ignore the maxxmit for seconday session setups (see CIFS spec) - close user opened files in a uLogoffX for user level security (see CIFS spec) - added uid into the files struct to support the above change (This used to be commit ea472b7217b7693627a13a7b1e428a0a6a3d8755) --- source3/include/proto.h | 6 ++++-- source3/include/smb.h | 8 +------- 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 779f6bd87e..8c082a6140 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -4,8 +4,7 @@ /*The following definitions come from access.c */ BOOL check_access(int snum); -BOOL allow_access(char *deny_list,char *allow_list,struct from_host *client); -BOOL fromhost(int sock,struct from_host *f); +BOOL allow_access(char *deny_list,char *allow_list,char *cname,char *caddr); /*The following definitions come from charcnv.c */ @@ -234,6 +233,7 @@ BOOL lp_widelinks(int ); BOOL lp_syncalways(int ); BOOL lp_map_system(int ); BOOL lp_delete_readonly(int ); +BOOL lp_fake_oplocks(int ); int lp_create_mode(int ); int lp_max_connections(int ); int lp_defaultcase(int ); @@ -913,6 +913,8 @@ int interpret_security(char *str,int def); uint32 interpret_addr(char *str); struct in_addr *interpret_addr2(char *str); BOOL zero_ip(struct in_addr ip); +char *client_name(void); +char *client_addr(void); void standard_sub_basic(char *s); BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask); int PutUniCode(char *dst,char *src); diff --git a/source3/include/smb.h b/source3/include/smb.h index f5d35d5261..af6e24c4ab 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -293,6 +293,7 @@ typedef struct int pos; int size; int mode; + int uid; char *mmap_ptr; int mmap_size; write_bmpx_struct *wbmpx_ptr; @@ -653,13 +654,6 @@ struct connect_record #define ERRHRD 0x03 /* Error is an hardware error. */ #define ERRCMD 0xFF /* Command was not in the "SMB" format. */ -/* structure used to hold the incoming hosts info */ -struct from_host { - char *name; /* host name */ - char *addr; /* host address */ - struct sockaddr_in *sin; /* their side of the link */ -}; - #ifdef __STDC__ int Debug1(char *, ...); #else -- cgit From f6c9fed7acaef5ff532a9cdf8d7f8a470fa7f73f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 5 Oct 1996 13:38:29 +0000 Subject: - use waitpid for ultrix - don't use wait4 (This used to be commit 2aa612d676e634a892fdc50349f5b72732f0e91f) --- source3/include/includes.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 90358ce49a..9d6bde5197 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -311,6 +311,7 @@ char *getwd(char *); #define SIGNAL_CAST (void(*)(int)) #endif #define USE_DIRECT +#define USE_WAITPID #endif #ifdef SGI -- cgit From 799172e830a5680eb6a0b6ed15b8346709cd9b95 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sat, 5 Oct 1996 14:28:39 +0000 Subject: preparing for release of 1.9.16p3 (This used to be commit 47212791c2e71ddd57018a4bc01c2c8931d32cd8) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index dd02bf425e..08b63085a7 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16p2" +#define VERSION "1.9.16p3" -- cgit From 8781e4d787763a6b50d7b3819b33ace208ff7784 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 7 Oct 1996 01:56:21 +0000 Subject: - changed the default nmbd loop timout to 10 seconds (2 seconds was much too short) - got rid of many unnecessary calls to time(NULL) in nmbd. They were causing it to chew too much CPU time when idle. Now we pass a time value in from the top level. (This used to be commit 3cd7303dbc2118db7084a6d8872403d825c52323) --- source3/include/local.h | 2 +- source3/include/proto.h | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index 115617094c..465e0029b6 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -119,7 +119,7 @@ #define IDLE_CLOSED_TIMEOUT (60) #define DPTR_IDLE_TIMEOUT (120) #define SMBD_SELECT_LOOP (10) -#define NMBD_SELECT_LOOP (2) +#define NMBD_SELECT_LOOP (10) #define BROWSE_INTERVAL (60) #define REGISTRATION_INTERVAL (10*60) #define NMBD_INETD_TIMEOUT (120) diff --git a/source3/include/proto.h b/source3/include/proto.h index 8c082a6140..2c6047954e 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -306,16 +306,16 @@ void do_announce_host(int command, void remove_my_servers(void); void announce_server(struct subnet_record *d, struct work_record *work, char *name, char *comment, time_t ttl, int server_type); -void announce_host(void); -void announce_master(void); -void announce_remote(void); +void announce_host(time_t t); +void announce_master(time_t t); +void announce_remote(time_t t); /*The following definitions come from namebrowse.c */ void expire_browse_cache(time_t t); struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, time_t ttl, struct in_addr ip, BOOL local); -void do_browser_lists(void); +void do_browser_lists(time_t t); /*The following definitions come from nameconf.c */ @@ -354,7 +354,7 @@ struct name_record *add_netbios_entry(struct subnet_record *d, BOOL new_only,BOOL wins); void expire_names(time_t t); struct name_record *search_for_name(struct subnet_record **d, - struct nmb_name *question, + struct nmb_name *question, struct in_addr ip, int Time, int search); /*The following definitions come from namedbresp.c */ @@ -393,7 +393,7 @@ void add_my_subnets(char *group); struct subnet_record *add_subnet_entry(struct in_addr bcast_ip, struct in_addr mask_ip, char *name, BOOL add, BOOL lmhosts); -void write_browse_list(void); +void write_browse_list(time_t t); /*The following definitions come from namedbwork.c */ @@ -406,7 +406,7 @@ void dump_workgroups(void); /*The following definitions come from nameelect.c */ -void check_master_browser(void); +void check_master_browser(time_t t); void browser_gone(char *work_name, struct in_addr ip); void send_election(struct subnet_record *d, char *group,uint32 criterion, int timeup,char *name); @@ -416,7 +416,7 @@ void name_register_work(struct subnet_record *d, char *name, int name_type, void become_master(struct subnet_record *d, struct work_record *work); void become_nonmaster(struct subnet_record *d, struct work_record *work, int remove_type); -void run_elections(void); +void run_elections(time_t t); void process_election(struct packet_struct *p,char *buf); BOOL check_elections(void); @@ -453,7 +453,7 @@ BOOL name_query(int fd,char *name,int name_type, /*The following definitions come from nameresp.c */ -void expire_netbios_response_entries(); +void expire_netbios_response_entries(time_t t); struct response_record *queue_netbios_pkt_wins(struct subnet_record *d, int fd,int quest_type,enum state_type state, char *name,int name_type,int nb_flags, time_t ttl, @@ -474,7 +474,7 @@ void add_my_name_entry(struct subnet_record *d,char *name,int type,int nb_flags) void add_my_names(void); void remove_my_names(); void refresh_my_names(time_t t); -void query_refresh_names(void); +void query_refresh_names(time_t t); /*The following definitions come from nameservreply.c */ -- cgit From 426d930adb9f816053b6cb3ea0696c1a8ad38d3c Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Mon, 7 Oct 1996 11:14:29 +0000 Subject: preparing for release of 1.9.16p4 (This used to be commit 13c3a05093ab49908f8357017051d680dbc633eb) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 08b63085a7..c93190cd2b 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16p3" +#define VERSION "1.9.16p4" -- cgit From ec85f2e53d18a818440cf716ad6b6892594cae85 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 7 Oct 1996 15:04:48 +0000 Subject: - revert to old idle dir code (marty pointed out a problem with the new code) - handle server level security in the new "detect NT password length stuffups" code (This used to be commit 7c135d499409d4ddedb978f681559dae90ac4288) --- source3/include/local.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index 465e0029b6..12d3fb9e88 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -156,6 +156,6 @@ /* the directory to sit in when idle */ -#define IDLE_DIR "/" +/* #define IDLE_DIR "/" */ #endif -- cgit From 2bb84baa5bb5791f17368c7c17570210218bf016 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Mon, 7 Oct 1996 15:06:26 +0000 Subject: preparing for release of 1.9.16p5 (This used to be commit 952918bdd5fa05453dfa78f911c8d00110ab98cd) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index c93190cd2b..d2735650a1 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16p4" +#define VERSION "1.9.16p5" -- cgit From 0b031a3f41158c421f64d2da41645b0c5ec7540d Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 9 Oct 1996 15:10:16 +0000 Subject: preparing for release of 1.9.16p6 (This used to be commit fca0c5dc8e65e2f64a4b93a231603c4e2d091b2c) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index d2735650a1..79ef0edfaf 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16p5" +#define VERSION "1.9.16p6" -- cgit From 280525df33b497013704154662c171de69f060d8 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Fri, 11 Oct 1996 17:56:42 +0000 Subject: preparing for release of 1.9.16p7 (This used to be commit 998f8bae7234b39fa9aefcaa09795183911ec866) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 79ef0edfaf..bb2a7062ab 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16p6" +#define VERSION "1.9.16p7" -- cgit From 7ccb388e3fb89cd6200d12c2c2edb9ea90e01074 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 23 Oct 1996 18:44:19 +0000 Subject: preparing for release of 1.9.16p8 (This used to be commit 09588edfec5ea29728a0166aaa109562cf3f1eca) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index bb2a7062ab..3f0af76d27 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16p7" +#define VERSION "1.9.16p8" -- cgit From 08d00eb68ee93eaead0f3bbaabc3d89540e0818e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 24 Oct 1996 00:09:08 +0000 Subject: - added support for TMPDIR env variable - fixed fault.c for linux 2.1 - put back in the FIND_SELF failing code - cleaned up casts in encryption (This used to be commit 3af04f1580b2569c0a4f2549bf6352c7a25afa0d) --- source3/include/local.h | 1 + source3/include/proto.h | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index 12d3fb9e88..01eac55652 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -47,6 +47,7 @@ #define LIST_SEP " \t,;:\n\r" #ifndef LOCKDIR +/* this should have been set in the Makefile */ #define LOCKDIR "/tmp/samba" #endif diff --git a/source3/include/proto.h b/source3/include/proto.h index 2c6047954e..803ceba688 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -739,6 +739,9 @@ struct smb_passwd *get_smbpwnam(char *name); /*The following definitions come from smbrun.c */ +/*The following definitions come from smbwizard.c */ + + /*The following definitions come from status.c */ void Ucrit_addUsername(pstring username); @@ -819,6 +822,7 @@ BOOL user_in_list(char *user,char *list); void setup_logging(char *pname,BOOL interactive); void reopen_logs(void); +char *tmpdir(void); BOOL is_a_socket(int fd); BOOL next_token(char **ptr,char *buff,char *sep); char **toktocliplist(int *ctok, char *sep); -- cgit From 8a7c1bd3353c03ac7d3dec656772295a7d93b3f0 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 24 Oct 1996 00:11:14 +0000 Subject: preparing for release of 1.9.16p9 (This used to be commit 526e597d3c7c3b05bb7a8584457ee0731c494ed8) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 3f0af76d27..ff567e4e59 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16p8" +#define VERSION "1.9.16p9" -- cgit From e010ad006ea1c4754f357951be648b8f45458613 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 24 Oct 1996 17:48:06 +0000 Subject: dealing with name queries and dns lookups etc. lkcl (This used to be commit 98cb371244fcb048ad13514140a4ea7243b2b039) --- source3/include/proto.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 803ceba688..c2fab68429 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -353,9 +353,8 @@ struct name_record *add_netbios_entry(struct subnet_record *d, int ttl, enum name_source source, struct in_addr ip, BOOL new_only,BOOL wins); void expire_names(time_t t); -struct name_record *search_for_name(struct subnet_record **d, - struct nmb_name *question, - struct in_addr ip, int Time, int search); +struct name_record *dns_name_search(struct nmb_name *question, + int Time, int search); /*The following definitions come from namedbresp.c */ @@ -739,9 +738,6 @@ struct smb_passwd *get_smbpwnam(char *name); /*The following definitions come from smbrun.c */ -/*The following definitions come from smbwizard.c */ - - /*The following definitions come from status.c */ void Ucrit_addUsername(pstring username); -- cgit From 57d880235614a5d04b817dd38fd6ae500a1a05c3 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Fri, 25 Oct 1996 19:31:48 +0000 Subject: debugging the dns lookup changes lkcl (This used to be commit 3f63dd6771ee1c4cd30049478ea053caefdc262f) --- source3/include/proto.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index c2fab68429..655b0fd360 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -338,8 +338,7 @@ BOOL name_equal(struct nmb_name *n1,struct nmb_name *n2); BOOL ms_browser_name(char *name, int type); void remove_name(struct subnet_record *d, struct name_record *n); struct name_record *find_name(struct name_record *n, - struct nmb_name *name, - int search); + struct nmb_name *name, int search); struct name_record *find_name_search(struct subnet_record **d, struct nmb_name *name, int search, struct in_addr ip); @@ -353,8 +352,7 @@ struct name_record *add_netbios_entry(struct subnet_record *d, int ttl, enum name_source source, struct in_addr ip, BOOL new_only,BOOL wins); void expire_names(time_t t); -struct name_record *dns_name_search(struct nmb_name *question, - int Time, int search); +struct name_record *dns_name_search(struct nmb_name *question, int Time); /*The following definitions come from namedbresp.c */ -- cgit From 9467fec29522eb4c8fa5441643845ea7ae312512 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Fri, 25 Oct 1996 20:20:17 +0000 Subject: Changed prototypes for accesses into validated_users structure. Ensured all smb_uid accesses are uint16's. jra@cygnus.com (This used to be commit b5e2d87179d0cd347da6feedb9ed9f3605f5a6c3) --- source3/include/proto.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 655b0fd360..ac2cc1572d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -536,10 +536,10 @@ void generate_next_challenge(char *challenge); BOOL set_challenge(char *challenge); BOOL last_challenge(char *challenge); int valid_uid(int uid); -user_struct *get_valid_user_struct(int uid); -void invalidate_uid(int uid); -char *validated_username(int vuid); -void register_uid(int uid,int gid, char *name,BOOL guest); +user_struct *get_valid_user_struct(uint16 vuid); +void invalidate_vuid(uint16 vuid); +char *validated_username(uint16 vuid); +uint16 register_vuid(int uid,int gid, char *name,BOOL guest); void add_session_user(char *user); void dfs_unlogin(void); BOOL password_check(char *password); @@ -547,7 +547,7 @@ BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned cha BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd); BOOL user_ok(char *user,int snum); BOOL authorise_login(int snum,char *user,char *password, int pwlen, - BOOL *guest,BOOL *force,int vuid); + BOOL *guest,BOOL *force,uint16 vuid); BOOL check_hosts_equiv(char *user); BOOL server_cryptkey(char *buf); BOOL server_validate(char *buf); @@ -681,14 +681,14 @@ BOOL snum_used(int snum); BOOL reload_services(BOOL test); int setup_groups(char *user, int uid, int gid, int *p_ngroups, int **p_igroups, gid_t **p_groups); -int make_connection(char *service,char *user,char *password, int pwlen, char *dev,int vuid); +int make_connection(char *service,char *user,char *password, int pwlen, char *dev,uint16 vuid); int find_free_file(void ); int reply_corep(char *outbuf); int reply_coreplus(char *outbuf); int reply_lanman1(char *outbuf); int reply_lanman2(char *outbuf); int reply_nt1(char *outbuf); -void close_cnum(int cnum, int uid); +void close_cnum(int cnum, uint16 vuid); BOOL yield_connection(int cnum,char *name,int max_connections); BOOL claim_connection(int cnum,char *name,int max_connections,BOOL Clear); void exit_server(char *reason); @@ -801,7 +801,7 @@ char *ufc_crypt(char *key,char *salt); void init_uid(void); BOOL become_guest(void); -BOOL become_user(int cnum, int uid); +BOOL become_user(int cnum, uint16 vuid); BOOL unbecome_user(void ); int smbrun(char *cmd,char *outfile,BOOL shared); -- cgit From 134c804497c24891fd7d75c07086cab131e91af9 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Fri, 25 Oct 1996 20:48:25 +0000 Subject: Added definitions for vuid offset and invalid user smb_uid. Added vuid to connections struct. jra@cygnus.com (This used to be commit 555f6cda319559ebcb0b566f7f4042cf6a734e01) --- source3/include/smb.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index af6e24c4ab..f499459f98 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -319,8 +319,6 @@ typedef struct { int service; BOOL force_user; - int uid; /* uid of user who *opened* this connection */ - int gid; /* gid of user who *opened* this connection */ struct uid_cache uid_cache; void *dirptr; BOOL open; @@ -332,6 +330,9 @@ typedef struct char *connectpath; char *origpath; char *user; /* name of user who *opened* this connection */ + int uid; /* uid of user who *opened* this connection */ + int gid; /* gid of user who *opened* this connection */ + uint16 vuid; /* vuid of user who *opened* this connection, or UID_FIELD_INVALID */ /* following groups stuff added by ih */ /* This groups info is valid for the user that *opened* the connection */ int ngroups; @@ -823,5 +824,13 @@ enum case_handling {CASE_LOWER,CASE_UPPER}; #define ROUNDUP(x,g) (((x)+((g)-1))&~((g)-1)) +/* + * Global value meaing that the smb_uid field should be + * ingored (in share level security and protocol level == CORE) + */ + +#define UID_FIELD_INVALID 0 +#define VUID_OFFSET 100 /* Amount to bias returned vuid numbers */ + #endif /* _SMB_H */ -- cgit From 0f22ee6976c2eb6d699f86c0fd0ae7b795524848 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 10 Dec 1996 17:50:28 +0000 Subject: Added in changes for FreeBsd. jra@cygnus.com (This used to be commit 074d28fcb61045891191b007b19a099301a94d16) --- source3/include/includes.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 9d6bde5197..25d112ccfb 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -190,7 +190,7 @@ #include #endif -#if defined(SHADOW_PWD) && !defined(NETBSD) && !defined(CONVEX) +#if defined(SHADOW_PWD) && !defined(NETBSD) && !defined(FreeBSD) && !defined(CONVEX) #include #endif @@ -469,7 +469,16 @@ char *mktemp(char *); /* No standard include */ #include #include #define SIGNAL_CAST (void (*)()) +#define USE_SETVBUF +#define USE_SETSID +#define USE_GETCWD +#define USE_WAITPID #define USE_DIRECT +#define HAVE_MEMMOVE +#define HAVE_BZERO +#define HAVE_GETTIMEOFDAY +#define HAVE_PATHCONF +#define HAVE_GETGRNAM 1 #endif -- cgit From 3eb2945910aa64bb5062ee58252174ee28c750ab Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 10 Dec 1996 17:56:40 +0000 Subject: Added veto calls. jra@cygnus.com (This used to be commit 8167becd333dc0fd4327e4c3f29e4d4fd1302bdb) --- source3/include/proto.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index ac2cc1572d..3ba06116ed 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -251,6 +251,9 @@ int lp_numservices(void); void lp_dump(void); int lp_servicenumber(char *pszServiceName); char *volume_label(int snum); +BOOL is_vetoed_name(char *name); +BOOL is_vetoed_path(char *name); +char *lp_veto_files(); /*The following definitions come from locking.c */ -- cgit From 4bf19abcad1dde50a930a7d8feab1a6808a954ed Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 2 Jan 1997 04:50:59 +0000 Subject: JHT => Modified for RedHat Linux for DEC Alpha platform includes. (This used to be commit 40fa8d4be629ccffa93ba7d969f2684907a058fa) --- source3/include/includes.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 25d112ccfb..0b989df20d 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -139,6 +139,9 @@ #endif #include +#ifdef AXPROC +#include +#endif #include #include #ifdef POSIX_H -- cgit From 8bc7d6bebd4fcf8c95cb6d58da14404a5e46de91 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 9 Jan 1997 18:02:17 +0000 Subject: Makefile: Changes to split Solaris into Solaris2.3 and previous, and 2.4 and after from Paul Eggert. Makefile: Added AMIGA changes from Rask Ingemann Lambertsen . charset.c: Patch for Western European Languages from Josef Hinteregger charset.h: Patch for Western European Languages from Josef Hinteregger clitar.c: Patch to re-sync after read fail from (lost contributor name, sorry). includes.h: Patch for AMIGA from Rask Ingemann Lambertsen includes.h: Patch for SunOS atexit by Jeremy (jra@cygnus.com) interface.c: Patch for AMIGA from Rask Ingemann Lambertsen kanji.h: Patch for Western European Languages from Josef Hinteregger locking.c: Patch to fix file locking from Jeremy (jra@cygnus.com) locking.c: Patch to add granularity of lock files to usec by Jeremy (jra@cygnus.com) pipes.c: Patch to fix file locking from Jeremy (jra@cygnus.com) proto.h: Patch to fix file locking from Jeremy (jra@cygnus.com) reply.c: Patch to fix file locking from Jeremy (jra@cygnus.com) server.c: Patch to fix file locking from Jeremy (jra@cygnus.com) server.c: Patch for FAST_SHARE_MODE fix from (lost contributor name, sorry). smb.h: Patch to fix file locking from Jeremy (jra@cygnus.com) smb.h: Patch to add granularity of lock files to usec by Jeremy (jra@cygnus.com) status.c: Patch to fix file locking from Jeremy (jra@cygnus.com) statuc.c: Patch to add granularity of lock files to usec by Jeremy (jra@cygnus.com) system.c: Patch for Western European Languages from Josef Hinteregger trans2.c: Patch to fix file locking from Jeremy (jra@cygnus.com) trans2.c: Patch to fix volume name reported to Win95 from Jeremy (jra@cygnus.com) util.c: Patch for Western European Languages from Josef Hinteregger util.c: Patch to fix client_name from continuously returning UNKNOWN (from various contributors). version.h: Update to 1.9.16p10. (This used to be commit 03d28fa32eb094affa33133ebe2602fdb70f6361) --- source3/include/charset.h | 12 ++++++------ source3/include/includes.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ source3/include/kanji.h | 4 ++-- source3/include/proto.h | 2 +- source3/include/smb.h | 25 +++++++++++++++++++++---- source3/include/version.h | 2 +- 6 files changed, 75 insertions(+), 14 deletions(-) (limited to 'source3/include') diff --git a/source3/include/charset.h b/source3/include/charset.h index 14b6ec2020..72a8810e42 100644 --- a/source3/include/charset.h +++ b/source3/include/charset.h @@ -51,15 +51,15 @@ extern void charset_initialise(void); #undef isspace #endif -#define toupper(c) upper_char_map[(char)(c)] -#define tolower(c) lower_char_map[(char)(c)] -#define isupper(c) (((char)(c)) != tolower(c)) -#define islower(c) (((char)(c)) != toupper(c)) -#define isdoschar(c) (dos_char_map[(char)(c)] != 0) +#define toupper(c) (upper_char_map[(c&0xff)] & 0xff) +#define tolower(c) (lower_char_map[(c&0xff)] & 0xff) +#define isupper(c) ((c&0xff) != tolower(c&0xff)) +#define islower(c) ((c&0xff) != toupper(c&0xff)) +#define isdoschar(c) (dos_char_map[(c&0xff)] != 0) #define isspace(c) ((c)==' ' || (c) == '\t') /* this is used to determine if a character is safe to use in something that may be put on a command line */ -#define issafe(c) (isalnum(c) || strchr("-._",c)) +#define issafe(c) (isalnum((c&0xff)) || strchr("-._",c)) #endif diff --git a/source3/include/includes.h b/source3/include/includes.h index 0b989df20d..0e93df35fd 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -259,11 +259,21 @@ typedef unsigned short mode_t; #include #define NO_STRERROR #endif +#ifndef REPLACE_GETPASS #define REPLACE_GETPASS +#endif +#ifndef BSD_TERMIO #define BSD_TERMIO +#endif +#ifndef USE_SIGPROCMASK #define USE_SIGPROCMASK +#endif +#ifndef USE_WAITPID #define USE_WAITPID #endif +/* SunOS doesn't have POSIX atexit */ +#define atexit on_exit +#endif #ifdef SUNOS5 @@ -496,6 +506,7 @@ char *mktemp(char *); /* No standard include */ #include #include #include +#include #define SYSV #define USE_WAITPID #define USE_SIGBLOCK @@ -642,6 +653,7 @@ char *mktemp(char *); /* No standard include */ #include #include #include +#include #ifdef EVEREST #include #endif @@ -916,6 +928,38 @@ typedef int mode_t; #include #endif +#ifdef AMIGA +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define SIGNAL_CAST (void (*)(int)) +#define USE_GETCWD +#define HAVE_BZERO +#define HAVE_MEMMOVE +#define USE_SIGPROCMASK +#define USE_WAITPID +#define USE_DIRECT +#define USE_F_FSIZE +#define HAVE_FCNTL_LOCK 0 +#define HAVE_GETTIMEOFDAY +#define HAVE_PATHCONF + +#define HAVE_NO_PROC +#define NO_FORK_DEBUG +#define HAVE_FORK 0 +#define HAVE_VFORK 1 +#endif /******************************************************************* diff --git a/source3/include/kanji.h b/source3/include/kanji.h index 4f18305c63..6bc88b704d 100644 --- a/source3/include/kanji.h +++ b/source3/include/kanji.h @@ -122,8 +122,8 @@ int interpret_coding_system (char *str, int def); #else -#define unix_to_dos(x,y) (x) -#define dos_to_unix(x,y) (x) +#define unix_to_dos(x,y) unix2dos_format(x,y) +#define dos_to_unix(x,y) dos2unix_format(x,y) #endif /* not KANJI */ diff --git a/source3/include/proto.h b/source3/include/proto.h index 3ba06116ed..bbe74e3270 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -666,7 +666,7 @@ BOOL unix_convert(char *name,int cnum); int disk_free(char *path,int *bsize,int *dfree,int *dsize); int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); BOOL check_name(char *name,int cnum); -void open_file(int fnum,int cnum,char *fname1,int flags,int mode); +void open_file(int fnum,int cnum,char *fname1,int flags,int mode, struct stat *st); void sync_file(int fnum); void close_file(int fnum); BOOL check_file_sharing(int cnum,char *fname); diff --git a/source3/include/smb.h b/source3/include/smb.h index f499459f98..bbb477f5f7 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -286,10 +286,27 @@ typedef struct BOOL wr_discard; /* discard all further data */ } write_bmpx_struct; +/* + * Structure used to indirect fd's from the files_struct. + * Needed as POSIX locking is based on file and process, not + * file descriptor and process. + */ + typedef struct { - int cnum; + uint16 ref_count; + int32 dev; + int32 inode; int fd; + int fd_readonly; + int fd_writeonly; + int real_open_flags; +} file_fd_struct; + +typedef struct +{ + int cnum; + file_fd_struct *fd_ptr; int pos; int size; int mode; @@ -297,7 +314,7 @@ typedef struct char *mmap_ptr; int mmap_size; write_bmpx_struct *wbmpx_ptr; - time_t open_time; + struct timeval open_time; BOOL open; BOOL can_lock; BOOL can_read; @@ -405,7 +422,7 @@ typedef struct shm_offset_t next_offset; /* offset of next record in list in shared mem */ int locking_version; int share_mode; - time_t time; + struct timeval time; int pid; dev_t st_dev; ino_t st_ino; @@ -428,7 +445,7 @@ struct connect_record }; -#define LOCKING_VERSION 2 +#define LOCKING_VERSION 3 /* these are useful macros for checking validity of handles */ #define VALID_FNUM(fnum) (((fnum) >= 0) && ((fnum) < MAX_OPEN_FILES)) diff --git a/source3/include/version.h b/source3/include/version.h index ff567e4e59..9bad7178c4 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16p9" +#define VERSION "1.9.16p10" -- cgit From 586c6276ec78c9ee276e3d01ba017db14c30e0ce Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Mon, 13 Jan 1997 19:41:08 +0000 Subject: Added an extra parameter for unix_convert. If present this is the last component of the modified pathname before modification. This is needed due to an exceptional condition in reply_mv when the filesystem is case preserving, but not case sensitive and the user wants to change the case of a filename. Code for this is also added to reply.c Jeremy (jra@cygnus.com). (This used to be commit cdafa35f9dba6eb0073700e3a214348c432a3e84) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index bbe74e3270..7f6c7d3892 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -662,7 +662,7 @@ int reply_getattrE(char *inbuf,char *outbuf); mode_t unix_mode(int cnum,int dosmode); int dos_mode(int cnum,char *path,struct stat *sbuf); int dos_chmod(int cnum,char *fname,int dosmode,struct stat *st); -BOOL unix_convert(char *name,int cnum); +BOOL unix_convert(char *name,int cnum,char *); int disk_free(char *path,int *bsize,int *dfree,int *dsize); int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); BOOL check_name(char *name,int cnum); -- cgit From 869f24e0b1915ec8d3e14f8850417474200e687e Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 15 Jan 1997 01:53:25 +0000 Subject: locking.c proto.h shmem.c smb.h status.c : Changed shm_ prefixes to smb_shm_ prefixes as shm_ is a POSIX.4 prefix. Updated fd code in FAST_SHARE_MODE code to work with new fd indirection. quotas.c: Fixed #ifdef not on position zero. Jeremy. (jra@cygnus.com). (This used to be commit c9a9d56642cc34369a42f48a28116e466240d303) --- source3/include/proto.h | 22 +++++++++++----------- source3/include/smb.h | 6 +++--- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 7f6c7d3892..8c7a8a47fe 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -702,17 +702,17 @@ int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); /*The following definitions come from shmem.c */ -BOOL shm_open( char *file_name, int size); -BOOL shm_close( void ); -shm_offset_t shm_alloc(int size); -BOOL shm_free(shm_offset_t offset); -shm_offset_t shm_get_userdef_off(void); -BOOL shm_set_userdef_off(shm_offset_t userdef_off); -void * shm_offset2addr(shm_offset_t offset); -shm_offset_t shm_addr2offset(void *addr); -BOOL shm_lock(void); -BOOL shm_unlock(void); -BOOL shm_get_usage(int *bytes_free, +BOOL smb_shm_open( char *file_name, int size); +BOOL smb_shm_close( void ); +smb_shm_offset_t smb_shm_alloc(int size); +BOOL smb_shm_free(smb_shm_offset_t offset); +smb_shm_offset_t smb_shm_get_userdef_off(void); +BOOL smb_shm_set_userdef_off(smb_shm_offset_t userdef_off); +void * smb_shm_offset2addr(smb_shm_offset_t offset); +smb_shm_offset_t shm_addr2offset(void *addr); +BOOL smb_shm_lock(void); +BOOL smb_shm_unlock(void); +BOOL smb_shm_get_usage(int *bytes_free, int *bytes_used, int *bytes_overhead); diff --git a/source3/include/smb.h b/source3/include/smb.h index bbb477f5f7..543cc73adb 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -55,8 +55,8 @@ typedef int BOOL; /* offset in shared memory */ -typedef int shm_offset_t; -#define NULL_OFFSET (shm_offset_t)(0) +typedef int smb_shm_offset_t; +#define NULL_OFFSET (smb_shm_offset_t)(0) /* @@ -419,7 +419,7 @@ struct interface /* share mode record in shared memory */ typedef struct { - shm_offset_t next_offset; /* offset of next record in list in shared mem */ + smb_shm_offset_t next_offset; /* offset of next record in list in shared mem */ int locking_version; int share_mode; struct timeval time; -- cgit From 9e83cac78e683cc88f0ab8cdd4a64a062d2b56ea Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 29 Jan 1997 21:53:26 +0000 Subject: Fixed proto problem with lp_veto_files(). Jeremy (This used to be commit c43d192a361000f306622a28584cc87490070d48) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 8c7a8a47fe..70a715cc04 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -253,7 +253,7 @@ int lp_servicenumber(char *pszServiceName); char *volume_label(int snum); BOOL is_vetoed_name(char *name); BOOL is_vetoed_path(char *name); -char *lp_veto_files(); +char *lp_veto_files(void); /*The following definitions come from locking.c */ -- cgit From 98bf10bc5df6eb1c3b71d51cc60ef4bf25f57d97 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sun, 2 Feb 1997 18:12:36 +0000 Subject: util.c: StrCaseCmp and StrnCaseCmp terminated incorrectly, giving false answers when a string was partially identical. this issue is still outstanding, and needs to be investigated further. loadparm.c: added lp_logon_path() parameter. ipc.c: in NetUserGetInfo, lp_logon_path() can be returned instead of always specifying \\SAMBA_SERVER\HOMES (which may not necessarily exist). it is now possible to specify lp_logon_path() as \\ARBITRARY_SERVER\%U, just like NT server can. the default is \\SAMBA_SERVER\HOMES, just like it used to be. lkcl (This used to be commit d5b6ad7cb87d6b1a9342f027ac4f57ffdb54b4f3) --- source3/include/proto.h | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 70a715cc04..17fadc27e1 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -51,6 +51,7 @@ char *smb_errstr(char *inbuf); /*The following definitions come from clitar.c */ int strslashcmp(char *s1,char *s2); +int padit(char *buf, int bufsize, int padsize); void cmd_block(void); void cmd_tarmode(void); void cmd_setmode(void); @@ -139,6 +140,8 @@ char *lp_domain_controller(void); char *lp_username_map(void); char *lp_character_set(void); char *lp_logon_script(void); +char *lp_logon_path(void); +char *lp_veto_files(void); char *lp_remote_announce(void); char *lp_wins_server(void); char *lp_interfaces(void); @@ -251,15 +254,9 @@ int lp_numservices(void); void lp_dump(void); int lp_servicenumber(char *pszServiceName); char *volume_label(int snum); -BOOL is_vetoed_name(char *name); -BOOL is_vetoed_path(char *name); -char *lp_veto_files(void); /*The following definitions come from locking.c */ -BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); -int file_lock(char *name,int timeout); -void file_unlock(int fd); BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset); BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); @@ -538,7 +535,6 @@ BOOL pm_process(char *pszFileName,BOOL (*sfunc)(char *),BOOL (*pfunc)(char *,cha void generate_next_challenge(char *challenge); BOOL set_challenge(char *challenge); BOOL last_challenge(char *challenge); -int valid_uid(int uid); user_struct *get_valid_user_struct(uint16 vuid); void invalidate_vuid(uint16 vuid); char *validated_username(uint16 vuid); @@ -659,14 +655,19 @@ int reply_getattrE(char *inbuf,char *outbuf); /*The following definitions come from server.c */ +void *dflt_sig(void); +void killkids(void); mode_t unix_mode(int cnum,int dosmode); int dos_mode(int cnum,char *path,struct stat *sbuf); int dos_chmod(int cnum,char *fname,int dosmode,struct stat *st); -BOOL unix_convert(char *name,int cnum,char *); +BOOL unix_convert(char *name,int cnum,pstring saved_last_component); int disk_free(char *path,int *bsize,int *dfree,int *dsize); int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); BOOL check_name(char *name,int cnum); -void open_file(int fnum,int cnum,char *fname1,int flags,int mode, struct stat *st); +int fd_attempt_open(char *fname, int flags, int mode); +void fd_attempt_reopen(char *fname, int mode, file_fd_struct *fd_ptr); +int fd_attempt_close(file_fd_struct *fd_ptr); +void open_file(int fnum,int cnum,char *fname1,int flags,int mode, struct stat *sbuf); void sync_file(int fnum); void close_file(int fnum); BOOL check_file_sharing(int cnum,char *fname); @@ -704,12 +705,9 @@ int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); BOOL smb_shm_open( char *file_name, int size); BOOL smb_shm_close( void ); -smb_shm_offset_t smb_shm_alloc(int size); BOOL smb_shm_free(smb_shm_offset_t offset); -smb_shm_offset_t smb_shm_get_userdef_off(void); BOOL smb_shm_set_userdef_off(smb_shm_offset_t userdef_off); void * smb_shm_offset2addr(smb_shm_offset_t offset); -smb_shm_offset_t shm_addr2offset(void *addr); BOOL smb_shm_lock(void); BOOL smb_shm_unlock(void); BOOL smb_shm_get_usage(int *bytes_free, @@ -926,6 +924,11 @@ char *gidtoname(int gid); void BlockSignals(BOOL block,int signum); void ajt_panic(void); char *readdirname(void *p); +BOOL is_vetoed_name(char *name); +BOOL is_vetoed_path(char *name); +BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); +int file_lock(char *name,int timeout); +void file_unlock(int fd); /*The following definitions come from vt_mode.c */ -- cgit From ab1b1855bdfe44c07ab32b469d97dd4c5f872315 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Mon, 3 Feb 1997 19:41:59 +0000 Subject: Fixed const definitions for StrCaseXXX calls. jra@cygnus.com (This used to be commit cbb59639659476054571d4bd18b5df55b0e11a2e) --- source3/include/proto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 17fadc27e1..cd1340dbd5 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -835,8 +835,8 @@ time_t file_modtime(char *fname); BOOL directory_exist(char *dname,struct stat *st); uint32 file_size(char *file_name); char *attrib_string(int mode); -int StrCaseCmp(char *s, char *t); -int StrnCaseCmp(char *s, char *t, int n); +int StrCaseCmp(const char *s, const char *t); +int StrnCaseCmp(const char *s, const char *t, int n); BOOL strequal(char *s1,char *s2); BOOL strnequal(char *s1,char *s2,int n); BOOL strcsequal(char *s1,char *s2); -- cgit From 5c63dbb6fe7180a90b6bce1577fcccbbed443a24 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 4 Feb 1997 11:21:19 +0000 Subject: JHT ===> **** WARNING **** Only updated version to 1.9.16p11 so I can test RedHat RPM builds. (This used to be commit fa1dff05d4a01be84638b4427ddc0e26b9c6166d) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 9bad7178c4..9cdf4c3e1a 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16p10" +#define VERSION "1.9.16p11" -- cgit From 8bd0dbb1af535466018b7ae3e4f7f042d493e145 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 11 Feb 1997 22:53:29 +0000 Subject: Replaced YOST code with more functionally equivalent code that changes a bit less. Also added fix to tricky reply_mv case. jra@cygnus.com (This used to be commit f22ac13b1423186d463c9fc5b3588a3dcbd7bc1c) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index cd1340dbd5..5993e1d67b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -272,7 +272,7 @@ void clean_share_modes(void); /*The following definitions come from mangle.c */ int str_checksum(char *s); -BOOL is_8_3(char *fname); +BOOL is_8_3(char *fname, BOOL check_case); void create_mangled_stack(int size); BOOL check_mangled_stack(char *s); BOOL is_mangled(char *s); -- cgit From cbc6c3faf207a14c2c47fc8781d1316c2312fdd5 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 13 Feb 1997 20:49:12 +0000 Subject: Fixed inclusion of crypt.h bug when libdes is being used on Solaris only. jra@cygnus.com (This used to be commit c189ef38455653334b8414f30d0aeaa3ecefa202) --- source3/include/includes.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 0e93df35fd..a8653d0978 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -290,8 +290,10 @@ typedef unsigned short mode_t; #include #include #include -#include #include +#ifndef USE_LIBDES +#include +#endif /* USE_LIBDES */ extern int gettimeofday (struct timeval *, void *); extern int gethostname (char *name, int namelen); extern int innetgr (const char *, const char *, const char *, const char *); -- cgit From f1a494b74eab45311153d43d75829985a1ba744f Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sat, 22 Feb 1997 15:24:31 +0000 Subject: JHT ===> Updated SV_TYPE defines in smb.h (added WIN95 entry) nameserv.h returned to original state. (This used to be commit e313de4619dcfde53db49ca4f7d6f78603504040) --- source3/include/nameserv.h | 2 +- source3/include/smb.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index e4876bac57..7302f09e5d 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -387,5 +387,5 @@ struct packet_struct #define DFLT_SERVER_TYPE (SV_TYPE_WORKSTATION | SV_TYPE_SERVER | \ SV_TYPE_TIME_SOURCE | SV_TYPE_SERVER_UNIX | \ SV_TYPE_PRINTQ_SERVER | SV_TYPE_SERVER_NT | \ - SV_TYPE_NT) + SV_TYPE_NT ) diff --git a/source3/include/smb.h b/source3/include/smb.h index 543cc73adb..eea5b5bc8c 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -788,6 +788,7 @@ char *Strstr(char *s, char *p); #define SV_TYPE_DOMAIN_MASTER 0x00080000 #define SV_TYPE_SERVER_OSF 0x00100000 #define SV_TYPE_SERVER_VMS 0x00200000 +#define SV_TYPE_WIN95_PLUS 0x00400000 #define SV_TYPE_ALTERNATE_XPORT 0x20000000 #define SV_TYPE_LOCAL_LIST_ONLY 0x40000000 #define SV_TYPE_DOMAIN_ENUM 0x80000000 -- cgit From df42b0a7bcdaae96035ecb1d434a66735358fd95 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sun, 23 Feb 1997 05:18:09 +0000 Subject: Makefile: Added cleandir target. chgpasswd.c: Added patch from Roland Haag to allow password changes to be done more than once. loadparm.c: Added entries for the "directory mode/directory mask parameters". Changed default file mode to 644. proto.h: Added sys_gethostbyname. server.c: Added directory mode changes. system.c: Added sys_gethostbyname. trans2.c: Added NT_FILE_ATTRIBUTE_NORMAL patch from Roger Orr trans2.h: Defined NT_FILE_ATTRIBUTE_NORMAL for above patch. util.c: Changes calls to gethostbyname to sys_gethostbyname. jra@cygnus.com (This used to be commit d8d8a7ee00971fca7a8d079bfb547af107df35a4) --- source3/include/proto.h | 2 ++ source3/include/trans2.h | 5 +++++ 2 files changed, 7 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 5993e1d67b..2cd8cfe2a8 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -238,6 +238,7 @@ BOOL lp_map_system(int ); BOOL lp_delete_readonly(int ); BOOL lp_fake_oplocks(int ); int lp_create_mode(int ); +int lp_dir_mode(int ); int lp_max_connections(int ); int lp_defaultcase(int ); int lp_minprintspace(int ); @@ -762,6 +763,7 @@ int sys_rename(char *from, char *to); int sys_chmod(char *fname,int mode); int sys_chown(char *fname,int uid,int gid); int sys_chroot(char *dname); +struct hostent *sys_gethostbyname(char *name); /*The following definitions come from testparm.c */ diff --git a/source3/include/trans2.h b/source3/include/trans2.h index cc366ccaea..b99f1e6028 100644 --- a/source3/include/trans2.h +++ b/source3/include/trans2.h @@ -228,6 +228,11 @@ Byte offset Type name description #define DIRLEN_GUESS (45+MAX(l1_achName,l2_achName)) +/* NT uses a FILE_ATTRIBUTE_NORMAL when no other attributes + are set. */ + +#define NT_FILE_ATTRIBUTE_NORMAL 0x80 + /* Function prototypes */ -- cgit From 0fb433564c6c8959ccd788f19012348634416ec1 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sun, 23 Feb 1997 07:00:44 +0000 Subject: JHT ===> Set to 1.9.16p12alpha until someone thinks it's Beta prime time. To be set to 1.9.16p12 just before release. (This used to be commit 09d81adb9ef365003b1d9a8b5629a2a83fc27665) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 9cdf4c3e1a..1641109454 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16p11" +#define VERSION "1.9.16p12alpha" -- cgit From b581d0324098f12a5bcb1941e698339a84e44a93 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sun, 9 Mar 1997 14:58:22 +0000 Subject: 1) updated ipc.c NetUserGetInfo - load \\%L\%U instead of \\%L\HOMES because the share must be browseable by a w95 client 2) send_mailslot_reply - unique or group datagram argument added. 3) netlogon.c - rewrote response packet to do the right thing for w95. 4) server.c reply_nt1() - added OEMDomainstring to the end. 5) (deep breath) reworked the nmbd-browsing code a little bit. i discovered two months ago that becoming a primary domain controller (and domain master browser) is done independently of becoming a backup domain controller (logon server) is done independently of becoming a local master browser. therefore, three sets of state-machines (instead of just one) are in place - each of which is responsible for taking samba through the required stages to become: a logon server; a domain master browser; and a local master browser. each of these three things can occur independently on each interface, _including_ the wins pseudo-interface. the only slight caveat is that the wins pseudo-interface, by virtue of _not_ being a broadcast interface, does _not_ register as a local master browser with the wins server, as this doesn't make sense. lkcl (This used to be commit 88c6a00c3c1b430307f512986185b5ed7aea7181) --- source3/include/nameserv.h | 41 +++++++++++++++++++++++++++++++---------- source3/include/proto.h | 14 +++++++++++--- source3/include/smb.h | 15 +++++++++++++++ 3 files changed, 57 insertions(+), 13 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 7302f09e5d..75461ce5e6 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -73,7 +73,8 @@ /* server type identifiers */ #define AM_MASTER(work) (work->ServerType & SV_TYPE_MASTER_BROWSER) #define AM_BACKUP(work) (work->ServerType & SV_TYPE_BACKUP_BROWSER) -#define AM_DOMCTL(work) (work->ServerType & SV_TYPE_DOMAIN_CTRL) +#define AM_DOMMST(work) (work->ServerType & SV_TYPE_DOMAIN_MASTER) +#define AM_DOMMEM(work) (work->ServerType & SV_TYPE_DOMAIN_MEMBER) /* microsoft browser NetBIOS name */ #define MSBROWSE "\001\002__MSBROWSE__\002" @@ -85,16 +86,27 @@ enum name_source {STATUS_QUERY, LMHOSTS, REGISTER, SELF, DNS, DNSFAIL}; enum node_type {B_NODE=0, P_NODE=1, M_NODE=2, NBDD_NODE=3}; enum packet_type {NMB_PACKET, DGRAM_PACKET}; + enum master_state { - MST_NONE, - MST_WON, + MST_POTENTIAL, + MST_BACK, MST_MSB, - MST_BROWSER, - MST_DOMAIN_NONE, - MST_DOMAIN_MEM, - MST_DOMAIN_TST, - MST_DOMAIN + MST_BROWSER +}; + +enum domain_state +{ + DOMAIN_NONE, + DOMAIN_WAIT, + DOMAIN_MST +}; + +enum logon_state +{ + LOGON_NONE, + LOGON_WAIT, + LOGON_SRV }; enum state_type @@ -179,8 +191,14 @@ struct work_record struct server_record *serverlist; - /* stage of development from non-master to master browser / domain master */ - enum master_state state; + /* stage of development from non-local-master up to local-master browser */ + enum master_state mst_state; + + /* stage of development from non-domain-master to domain master browser */ + enum domain_state dom_state; + + /* stage of development from non-logon-server to logon server */ + enum logon_state log_state; /* work group info */ fstring work_group; @@ -367,6 +385,9 @@ struct packet_struct /* broadcast packet announcement intervals, in minutes */ +/* attempt to add domain logon and domain master names */ +#define CHECK_TIME_ADD_DOM_NAMES 5 + /* search for master browsers of workgroups samba knows about, except default */ #define CHECK_TIME_MST_BROWSE 5 diff --git a/source3/include/proto.h b/source3/include/proto.h index 2cd8cfe2a8..bbfcad78f9 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -411,8 +411,14 @@ void send_election(struct subnet_record *d, char *group,uint32 criterion, void name_unregister_work(struct subnet_record *d, char *name, int name_type); void name_register_work(struct subnet_record *d, char *name, int name_type, int nb_flags, time_t ttl, struct in_addr ip, BOOL bcast); -void become_master(struct subnet_record *d, struct work_record *work); -void become_nonmaster(struct subnet_record *d, struct work_record *work, +void become_local_master(struct subnet_record *d, struct work_record *work); +void become_domain_master(struct subnet_record *d, struct work_record *work); +void become_logon_server(struct subnet_record *d, struct work_record *work); +void unbecome_local_master(struct subnet_record *d, struct work_record *work, + int remove_type); +void unbecome_domain_master(struct subnet_record *d, struct work_record *work, + int remove_type); +void unbecome_logon_server(struct subnet_record *d, struct work_record *work, int remove_type); void run_elections(time_t t); void process_election(struct packet_struct *p,char *buf); @@ -436,7 +442,8 @@ void reply_netbios_packet(struct packet_struct *p1,int trn_id, void queue_packet(struct packet_struct *packet); void run_packet_queue(); void listen_for_packets(BOOL run_election); -BOOL send_mailslot_reply(char *mailslot,int fd,char *buf,int len,char *srcname, +BOOL send_mailslot_reply(BOOL unique, char *mailslot,int fd, + char *buf,int len,char *srcname, char *dstname,int src_type,int dest_type, struct in_addr dest_ip,struct in_addr src_ip); @@ -469,6 +476,7 @@ struct response_record *queue_netbios_packet(struct subnet_record *d, void remove_name_entry(struct subnet_record *d, char *name,int type); void add_my_name_entry(struct subnet_record *d,char *name,int type,int nb_flags); +void add_domain_names(time_t t); void add_my_names(void); void remove_my_names(); void refresh_my_names(time_t t); diff --git a/source3/include/smb.h b/source3/include/smb.h index eea5b5bc8c..e9d74befc2 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -797,6 +797,21 @@ char *Strstr(char *s, char *p); /* what server type are we currently */ +/* Capabilities. see ftp.microsoft.com/developr/drg/cifs/cifs/cifs4.txt */ + +#define CAP_RAW_MODE 0x0001 +#define CAP_MPX_MODE 0x0002 +#define CAP_UNICODE 0x0004 +#define CAP_LARGE_FILES 0x0008 +#define CAP_NT_SMBS 0x0010 +#define CAP_RPC_REMOTE_APIS 0x0020 +#define CAP_STATUS32 0x0040 +#define CAP_LEVEL_II_OPLOCKS 0x0080 +#define CAP_LOCK_AND_READ 0x0100 +#define CAP_NT_FIND 0x0200 +#define CAP_DFS 0x1000 +#define CAP_LARGE_READX 0x4000 + /* protocol types. It assumes that higher protocols include lower protocols as subsets */ enum protocol_types {PROTOCOL_NONE,PROTOCOL_CORE,PROTOCOL_COREPLUS,PROTOCOL_LANMAN1,PROTOCOL_LANMAN2,PROTOCOL_NT1}; -- cgit From 5f178fc18ac07eeeb579a23c6cbf8519ce44b60b Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 12 Mar 1997 20:21:11 +0000 Subject: added code that checks whether the DOMAIN<1b> name is claimed on the local subnet _before_ going and registering it. the reason for this is that i don't want to cause chaos by registering the name twice. it's ok to register DOMAIN<1b> with the WINS server, because the WINS server's job is to check a) _if_ there's a current owner of the name b) if the current owner exists c) if the current owner still wants the name. if they don't, the WINS server responds by saying, 'yes, you can have it'. lkcl (This used to be commit 0d51899b59204b99d5aeb9542c8adfff42167fec) --- source3/include/nameserv.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 75461ce5e6..027931f9e6 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -123,7 +123,8 @@ enum state_type NAME_QUERY_DOM_SRV_CHK, NAME_QUERY_SRV_CHK, NAME_QUERY_FIND_MST, - NAME_QUERY_MST_CHK + NAME_QUERY_MST_CHK, + NAME_QUERY_DOMAIN, }; /* a netbios name structure */ -- cgit From aaba4712c8dbf61043d9fe6e1d6773bbd835e3b2 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sat, 15 Mar 1997 14:47:00 +0000 Subject: JHT ===> Moved MAJOR_VERSION and MINOR_VERSION defines to smb.h Made version info consistent in ipc.c and nameannounce.c Added define for BROWSER_ELECTION_VALUE and BROWSER_CONSTANT (see do_announce_host() in nameannounce.c). Sniffing with the latest bloodhound I found that the byte range occupied by the BROWSER_ELECTION_VALUE is interpreted depending on the type of announcement being made. In a Local_Master_Announcement it is BROWSER_ELECTION_VALUE but in both Workgroup_Announcement and Host_Announcement this is seen as Comment_String_Pointer. What does this mean? We need to know? (This used to be commit 86b0018cc7e246910a9a621b2bf379f782506a08) --- source3/include/smb.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index e9d74befc2..506bbb9b16 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -794,7 +794,15 @@ char *Strstr(char *s, char *p); #define SV_TYPE_DOMAIN_ENUM 0x80000000 #define SV_TYPE_ALL 0xFFFFFFFF -/* what server type are we currently */ +/* what server type are we currently - JHT Says we ARE 4.10 */ +/* this was set by JHT in liaison with Andrew Tridgell early 1996 */ +/* setting to 4.10 at same time as announcing ourselves as NT Server */ +#define MAJOR_VERSION 0x04 +#define MINOR_VERSION 0x01 + +/* Browser Election Values */ +#define BROWSER_ELECT_VERSION 0x010f +#define BROWSER_CONSTANT 0xaa55 /* Capabilities. see ftp.microsoft.com/developr/drg/cifs/cifs/cifs4.txt */ -- cgit From 9f1d339309406a2beb8469a3190a10e4f3dbdd0d Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sat, 15 Mar 1997 14:58:30 +0000 Subject: JHT ===> Blasted typos. BROWSER_ELECT_VERSION in smb.h should have been BROWSER_ELECTION_VERSION. (This used to be commit 377bfdecfcf618322004bfdcbdf9e520c0ebe8b5) --- source3/include/smb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 506bbb9b16..50a778ad7e 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -801,7 +801,7 @@ char *Strstr(char *s, char *p); #define MINOR_VERSION 0x01 /* Browser Election Values */ -#define BROWSER_ELECT_VERSION 0x010f +#define BROWSER_ELECTION_VERSION 0x010f #define BROWSER_CONSTANT 0xaa55 -- cgit From 20b5dea237916902437ce3dcdb7c253fd1ad3585 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 9 Apr 1997 01:19:25 +0000 Subject: Large changes from jra@cygnus.com. Mainly browser updates. access.c: Fixed crash if yp domain unavailable. includes.h: Moved ifdefs for minor platform. interface.c: Changed name of ipgrp to wins_ip to make it clearer. loadparm.c: Changed default of wins support to 'no'. nameannounce.c: Many changes to fix cross subnet browsing. namebrowse.c: Many changes to fix cross subnet browsing. namedbname.c: Many changes to fix cross subnet browsing. namedbresp.c: Many changes to fix cross subnet browsing. namedbsubnet.c: Many changes to fix cross subnet browsing. namedbwork.c: Many changes to fix cross subnet browsing. nameelect.c: Many changes to fix cross subnet browsing. namelogon.c: Many changes to fix cross subnet browsing. namepacket.c: Many changes to fix cross subnet browsing. nameresp.c: Many changes to fix cross subnet browsing. nameserv.c: Many changes to fix cross subnet browsing. nameserv.h: Many changes to fix cross subnet browsing. nameservreply.c: Many changes to fix cross subnet browsing. nameservresp.c: Many changes to fix cross subnet browsing. namework.c: Many changes to fix cross subnet browsing. nmbd.c: Change to search wins subnet. nmbsync.c: Change to check if we are any master before proceeding. proto.h: Added find_subnet_all() and check_work_servertype(). util.c: Moved 'done' settings on name resolution. (This used to be commit a82476eee2c521e5eed092bc367da0a7cef23de1) --- source3/include/includes.h | 2 ++ source3/include/nameserv.h | 7 +++++-- source3/include/proto.h | 5 ++--- 3 files changed, 9 insertions(+), 5 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index a8653d0978..249e4940a9 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -344,6 +344,7 @@ char *getwd(char *); #endif #ifdef SGI5 +#include #include #include #include @@ -427,6 +428,7 @@ char *mktemp(char *); /* No standard include */ #define SIGNAL_CAST ( void (*) (int) ) #define STATFS3 #define USE_F_FSIZE +#define USE_SETSID #include #ifdef OSF1_ENH_SEC #include diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 027931f9e6..17ae085bc6 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -75,6 +75,8 @@ #define AM_BACKUP(work) (work->ServerType & SV_TYPE_BACKUP_BROWSER) #define AM_DOMMST(work) (work->ServerType & SV_TYPE_DOMAIN_MASTER) #define AM_DOMMEM(work) (work->ServerType & SV_TYPE_DOMAIN_MEMBER) +#define AM_ANY_MASTER(work) (check_work_servertype(work->work_group, \ +SV_TYPE_MASTER_BROWSER|SV_TYPE_DOMAIN_MASTER)) /* microsoft browser NetBIOS name */ #define MSBROWSE "\001\002__MSBROWSE__\002" @@ -124,7 +126,7 @@ enum state_type NAME_QUERY_SRV_CHK, NAME_QUERY_FIND_MST, NAME_QUERY_MST_CHK, - NAME_QUERY_DOMAIN, + NAME_QUERY_DOMAIN }; /* a netbios name structure */ @@ -401,7 +403,8 @@ struct packet_struct #define CHECK_TIME_MAX_HOST_ANNCE 12 /* announce as master to WINS server and any Primary Domain Controllers */ -#define CHECK_TIME_MST_ANNOUNCE 15 +/* ORIGINAL - changed for test by JRA #define CHECK_TIME_MST_ANNOUNCE 15 */ +#define CHECK_TIME_MST_ANNOUNCE 1 /* do all remote announcements this often */ #define REMOTE_ANNOUNCE_INTERVAL 180 diff --git a/source3/include/proto.h b/source3/include/proto.h index bbfcad78f9..cfc05c1c6b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -386,11 +386,9 @@ void expire_servers(time_t t); struct subnet_record *find_subnet(struct in_addr bcast_ip); struct subnet_record *find_req_subnet(struct in_addr ip, BOOL bcast); +struct subnet_record *find_subnet_all(struct in_addr bcast_ip); void add_subnet_interfaces(void); void add_my_subnets(char *group); -struct subnet_record *add_subnet_entry(struct in_addr bcast_ip, - struct in_addr mask_ip, - char *name, BOOL add, BOOL lmhosts); void write_browse_list(time_t t); /*The following definitions come from namedbwork.c */ @@ -401,6 +399,7 @@ struct work_record *remove_workgroup(struct subnet_record *d, struct work_record *find_workgroupstruct(struct subnet_record *d, fstring name, BOOL add); void dump_workgroups(void); +int check_work_servertype(const char *work_name, int type_mask); /*The following definitions come from nameelect.c */ -- cgit From c1da1bfc1ef20737a2bdbaf271f9277d70c90940 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 9 Apr 1997 01:21:04 +0000 Subject: jra@cygnus.com: Changed CHECK_TIME_MST_ANNOUNCE back to 15 from 1 (from test). (This used to be commit 0294ab7cbb2d3fa45c413d7caac86020f9806026) --- source3/include/nameserv.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 17ae085bc6..42bfe83dcc 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -403,8 +403,7 @@ struct packet_struct #define CHECK_TIME_MAX_HOST_ANNCE 12 /* announce as master to WINS server and any Primary Domain Controllers */ -/* ORIGINAL - changed for test by JRA #define CHECK_TIME_MST_ANNOUNCE 15 */ -#define CHECK_TIME_MST_ANNOUNCE 1 +#define CHECK_TIME_MST_ANNOUNCE 15 /* do all remote announcements this often */ #define REMOTE_ANNOUNCE_INTERVAL 180 -- cgit From 121c81e3d68f1748f114a2530a9eb67f7f658fda Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 7 May 1997 17:56:46 +0000 Subject: added automount home directory support. contributed by simeon@bangor.co.uk and a mini bug-fix by rob.nacarrato@sheridanc.on.ca reads in an entry from the auto.home file for the user when they log in, and mounts their home directory as the default path for the [homes] service. i might add this as to the %substitution system, so that you can specify subdirectories for the user profiles, mainly. lkcl (This used to be commit 0bb6acc358243c49e19de9d5cc95f5124ac11b7c) --- source3/include/proto.h | 14 ++++++++------ source3/include/smb.h | 4 ++++ 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index cfc05c1c6b..63f5622803 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -146,6 +146,7 @@ char *lp_remote_announce(void); char *lp_wins_server(void); char *lp_interfaces(void); char *lp_socket_address(void); +char *lp_nis_home_map_name(void); BOOL lp_wins_support(void); BOOL lp_wins_proxy(void); BOOL lp_domain_master(void); @@ -163,6 +164,8 @@ BOOL lp_strip_dot(void); BOOL lp_encrypted_passwords(void); BOOL lp_syslog_only(void); BOOL lp_browse_list(void); +BOOL lp_unix_realname(void); +BOOL lp_nis_home_map(void); int lp_os_level(void); int lp_max_ttl(void); int lp_max_log_size(void); @@ -431,9 +434,9 @@ void process_logon_packet(struct packet_struct *p,char *buf,int len); void debug_browse_data(char *outbuf, int len); void initiate_netbios_packet(uint16 *id, - int fd,int quest_type,char *name,int name_type, - int nb_flags,BOOL bcast,BOOL recurse, - struct in_addr to_ip); + int fd,int quest_type,char *name,int name_type, + int nb_flags,BOOL bcast,BOOL recurse, + struct in_addr to_ip); void reply_netbios_packet(struct packet_struct *p1,int trn_id, int rcode, int rcv_code, int opcode, BOOL recurse, struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, @@ -441,8 +444,7 @@ void reply_netbios_packet(struct packet_struct *p1,int trn_id, void queue_packet(struct packet_struct *packet); void run_packet_queue(); void listen_for_packets(BOOL run_election); -BOOL send_mailslot_reply(BOOL unique, char *mailslot,int fd, - char *buf,int len,char *srcname, +BOOL send_mailslot_reply(BOOL unique, char *mailslot,int fd,char *buf,int len,char *srcname, char *dstname,int src_type,int dest_type, struct in_addr dest_ip,struct in_addr src_ip); @@ -468,7 +470,7 @@ struct response_record *queue_netbios_packet(struct subnet_record *d, int fd,int quest_type,enum state_type state,char *name, int name_type,int nb_flags, time_t ttl, int server_type, char *my_name, char *my_comment, - BOOL bcast,BOOL recurse, + BOOL bcast,BOOL recurse, struct in_addr send_ip, struct in_addr reply_to_ip); /*The following definitions come from nameserv.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index 50a778ad7e..fc9ac2048e 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -372,6 +372,10 @@ typedef struct int user_ngroups; gid_t *user_groups; int *user_igroups; /* an integer version - some OSes are broken :-( */ +#if (defined(NETGROUP) && defined(AUTOMOUNT)) + char *home_share; /* to store NIS home of a user - simeon */ +#endif + char *real_name; /* to store real name from password file - simeon */ } user_struct; -- cgit From 0f1f0ceb9519368188f695e18e2341ccfd1b2d15 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 8 May 1997 01:14:17 +0000 Subject: 'The mother of all checkins' :-). Jeremy Allison (jallison@whistle.com) Wed May 7 1997: Update for 1.9.17alpha1 release - 'browsefix release' designed to make browsing across subnets work. byteorder.h: Updated copyright to 1997. charcnv.c: Updated copyright to 1997. charset.c Updated copyright to 1997. charset.h Updated copyright to 1997. client.c Updated copyright to 1997. clientutil.c Updated copyright to 1997. dir.c Updated copyright to 1997. fault.c Updated copyright to 1997. includes.h Updated copyright to 1997. interface.c Updated copyright to 1997. ipc.c Updated copyright to 1997. kanji.c Updated copyright to 1997. kanji.h Updated copyright to 1997. loadparm.c Updated copyright to 1997. locking.c Updated copyright to 1997. mangle.c Updated copyright to 1997. message.c Updated copyright to 1997. nameannounce.c Made use of WINS subnet explicit. Added reset_announce_timer() so announcement can be made immediately when we become a master. Expanded code to do sync with dmb. namebrowse.c Removed redundent checks for AM_MASTER in sync code. Made use of WINS subnet explicit. namedbname.c Made use of WINS subnet explicit. namedbresp.c Made use of WINS subnet explicit. namedbserver.c Made use of WINS subnet explicit. namedbsubnet.c Explicitly add workgroup to WINS subnet when we become a dmb. Made use of WINS subnet explicit. namedbwork.c Made use of WINS subnet explicit. Removed redundent check_work_servertype() function. nameelect.c Explicitly add workgroup to WINS subnet when we become a master browser. Made use of WINS subnet explicit. namelogon.c Updated copyright to 1997. namepacket.c Updated copyright to 1997. namequery.c Updated copyright to 1997. nameresp.c Made use of WINS subnet explicit. Made nmbd fail if configured as master browser and one exists already. nameserv.c Made use of WINS subnet explicit. Remove redundent logon server and domain master code. nameserv.h Add emumerate subnet macros. nameservreply.c Made use of WINS subnet explicit. nameservresp.c Updated copyright to 1997. namework.c Made use of WINS subnet explicit. Updated code to add sync browser entries to add subnet parameter. nmbd.c Added sanity check for misconfigured nmbd. nmblib.c Updated copyright to 1997. nmblookup.c Updated copyright to 1997. nmbsync.c Removed redundent AM_ANY_MASTER check. params.c Updated copyright to 1997. password.c Updated copyright to 1997. pipes.c Updated copyright to 1997. predict.c Updated copyright to 1997. printing.c Updated copyright to 1997. proto.h Changed protos for new nmbd code. quotas.c Updated copyright to 1997. replace.c Updated copyright to 1997. reply.c Updated copyright to 1997. server.c Updated copyright to 1997. shmem.c Updated copyright to 1997. smb.h Updated copyright to 1997. smbencrypt.c Updated copyright to 1997. smbpasswd.c Updated copyright to 1997. smbrun.c Updated copyright to 1997. status.c Updated copyright to 1997. system.c Updated copyright to 1997. testparm.c Updated copyright to 1997. testprns.c Updated copyright to 1997. time.c Updated copyright to 1997. trans2.c Updated copyright to 1997. trans2.h Updated copyright to 1997. uid.c Updated copyright to 1997. username.c Updated copyright to 1997. util.c Updated copyright to 1997. version.h Changed to 1.9.17alpha1. (This used to be commit cf23a155a1315f50d488794a2caf88402bf3e3e6) --- source3/include/byteorder.h | 2 +- source3/include/charset.h | 2 +- source3/include/includes.h | 2 +- source3/include/kanji.h | 2 +- source3/include/nameserv.h | 19 ++++++++++++++++--- source3/include/proto.h | 8 ++++++-- source3/include/smb.h | 2 +- source3/include/trans2.h | 2 +- source3/include/version.h | 2 +- 9 files changed, 29 insertions(+), 12 deletions(-) (limited to 'source3/include') diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h index 51f368e61b..a55789a403 100644 --- a/source3/include/byteorder.h +++ b/source3/include/byteorder.h @@ -2,7 +2,7 @@ Unix SMB/Netbios implementation. Version 1.9. SMB Byte handling - Copyright (C) Andrew Tridgell 1992-1995 + Copyright (C) Andrew Tridgell 1992-1997 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/source3/include/charset.h b/source3/include/charset.h index 72a8810e42..5f5e2016ee 100644 --- a/source3/include/charset.h +++ b/source3/include/charset.h @@ -2,7 +2,7 @@ Unix SMB/Netbios implementation. Version 1.9. Character set handling - Copyright (C) Andrew Tridgell 1992-1995 + Copyright (C) Andrew Tridgell 1992-1997 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/source3/include/includes.h b/source3/include/includes.h index 249e4940a9..e1ed3a5816 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -4,7 +4,7 @@ Unix SMB/Netbios implementation. Version 1.9. Machine customisation and include handling - Copyright (C) Andrew Tridgell 1994-1995 + Copyright (C) Andrew Tridgell 1994-1997 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/source3/include/kanji.h b/source3/include/kanji.h index 6bc88b704d..ee3ba7e09a 100644 --- a/source3/include/kanji.h +++ b/source3/include/kanji.h @@ -2,7 +2,7 @@ Unix SMB/Netbios implementation. Version 1.9. Kanji Extensions - Copyright (C) Andrew Tridgell 1992-1994 + Copyright (C) Andrew Tridgell 1992-1997 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 42bfe83dcc..12ddd033c8 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -2,7 +2,7 @@ Unix SMB/Netbios implementation. Version 1.9. NBT netbios header - version 2 - Copyright (C) Andrew Tridgell 1994-1995 + Copyright (C) Andrew Tridgell 1994-1997 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -75,8 +75,6 @@ #define AM_BACKUP(work) (work->ServerType & SV_TYPE_BACKUP_BROWSER) #define AM_DOMMST(work) (work->ServerType & SV_TYPE_DOMAIN_MASTER) #define AM_DOMMEM(work) (work->ServerType & SV_TYPE_DOMAIN_MEMBER) -#define AM_ANY_MASTER(work) (check_work_servertype(work->work_group, \ -SV_TYPE_MASTER_BROWSER|SV_TYPE_DOMAIN_MASTER)) /* microsoft browser NetBIOS name */ #define MSBROWSE "\001\002__MSBROWSE__\002" @@ -160,6 +158,8 @@ struct name_record time_t refresh_time; /* time record should be refreshed */ }; +struct subnet_record; + /* browse and backup server cache for synchronising browse list */ struct browse_cache_record { @@ -173,6 +173,7 @@ struct browse_cache_record time_t sync_time; BOOL synced; BOOL local; + struct subnet_record *subnet; }; /* this is used to hold the list of servers in my domain, and is */ @@ -413,3 +414,15 @@ struct packet_struct SV_TYPE_PRINTQ_SERVER | SV_TYPE_SERVER_NT | \ SV_TYPE_NT ) +/* Macro's to enumerate subnets either with or without + the WINS subnet. */ + +extern struct subnet_record *subnetlist; +extern struct subnet_record *wins_subnet; + +#define FIRST_SUBNET subnetlist +#define NEXT_SUBNET_EXCLUDING_WINS(x) ((x)->next) +#define NEXT_SUBNET_INCLUDING_WINS(x) ( ((x) == wins_subnet) ? 0 : \ + (((x)->next == 0) ? wins_subnet : \ + (x)->next)) + diff --git a/source3/include/proto.h b/source3/include/proto.h index 63f5622803..973b1a15f3 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -295,12 +295,14 @@ int reply_sendend(char *inbuf,char *outbuf); /*The following definitions come from nameannounce.c */ +void reset_announce_timer(); void announce_request(struct work_record *work, struct in_addr ip); void do_announce_request(char *info, char *to_name, int announce_type, int from, int to, struct in_addr dest_ip); void sync_server(enum state_type state, char *serv_name, char *work_name, int name_type, + struct subnet_record *d, struct in_addr ip); void do_announce_host(int command, char *from_name, int from_type, struct in_addr from_ip, @@ -318,7 +320,9 @@ void announce_remote(time_t t); void expire_browse_cache(time_t t); struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, - time_t ttl, struct in_addr ip, BOOL local); + time_t ttl, + struct subnet_record *d, + struct in_addr ip, BOOL local); void do_browser_lists(time_t t); /*The following definitions come from nameconf.c */ @@ -460,7 +464,7 @@ BOOL name_query(int fd,char *name,int name_type, /*The following definitions come from nameresp.c */ void expire_netbios_response_entries(time_t t); -struct response_record *queue_netbios_pkt_wins(struct subnet_record *d, +struct response_record *queue_netbios_pkt_wins( int fd,int quest_type,enum state_type state, char *name,int name_type,int nb_flags, time_t ttl, int server_type, char *my_name, char *my_comment, diff --git a/source3/include/smb.h b/source3/include/smb.h index fc9ac2048e..a6be0f16d5 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -2,7 +2,7 @@ Unix SMB/Netbios implementation. Version 1.9. SMB parameters and setup - Copyright (C) Andrew Tridgell 1992-1995 + Copyright (C) Andrew Tridgell 1992-1997 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/source3/include/trans2.h b/source3/include/trans2.h index b99f1e6028..70285358bc 100644 --- a/source3/include/trans2.h +++ b/source3/include/trans2.h @@ -2,7 +2,7 @@ Unix SMB/Netbios implementation. Version 1.9. SMB transaction2 handling - Copyright (C) Jeremy Allison 1994 + Copyright (C) Jeremy Allison 1994-1997 Extensively modified by Andrew Tridgell, 1995 diff --git a/source3/include/version.h b/source3/include/version.h index 1641109454..cc69bef521 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.16p12alpha" +#define VERSION "1.9.17alpha1" -- cgit From ad30487281463b3afaf7382d3290202b58bd7df4 Mon Sep 17 00:00:00 2001 From: John Terpstra Date: Sun, 11 May 1997 12:21:44 +0000 Subject: Updated Samba minor version so it announces itself as NT Server version 4.20. This indicates that the browsing code has been updated (changed). (This used to be commit 7d106024f172c8e6ffd3f355aceb0d867d74b3f8) --- source3/include/smb.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index a6be0f16d5..7cd2f5b0fe 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -798,11 +798,14 @@ char *Strstr(char *s, char *p); #define SV_TYPE_DOMAIN_ENUM 0x80000000 #define SV_TYPE_ALL 0xFFFFFFFF -/* what server type are we currently - JHT Says we ARE 4.10 */ -/* this was set by JHT in liaison with Andrew Tridgell early 1996 */ -/* setting to 4.10 at same time as announcing ourselves as NT Server */ +/* What server type are we currently - JHT Says we ARE 4.20 */ +/* History: */ +/* Version 4.0 - never made public */ +/* Version 4.10 - New to 1.9.16p2, lost in space 1.9.16p3 to 1.9.16p9 */ +/* - Reappeared in 1.9.16p11 with fixed smbd services */ +/* Version 4.20 - To indicate that nmbd and browsing now works better */ #define MAJOR_VERSION 0x04 -#define MINOR_VERSION 0x01 +#define MINOR_VERSION 0x02 /* Browser Election Values */ #define BROWSER_ELECTION_VERSION 0x010f -- cgit From e896730fe71c984f41e3cd62d2f7eadb1cf3d51b Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Mon, 12 May 1997 14:24:59 +0000 Subject: use NULL instead of 0 lkcl (This used to be commit 5582e448c94a733a1fee479ed93984314cc42a25) --- source3/include/nameserv.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 12ddd033c8..1aa1075543 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -422,7 +422,7 @@ extern struct subnet_record *wins_subnet; #define FIRST_SUBNET subnetlist #define NEXT_SUBNET_EXCLUDING_WINS(x) ((x)->next) -#define NEXT_SUBNET_INCLUDING_WINS(x) ( ((x) == wins_subnet) ? 0 : \ - (((x)->next == 0) ? wins_subnet : \ +#define NEXT_SUBNET_INCLUDING_WINS(x) ( ((x) == wins_subnet) ? NULL : \ + (((x)->next == NULL) ? wins_subnet : \ (x)->next)) -- cgit From aa864415c5183c948fe9ae221023d40265c38013 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 20 May 1997 00:32:51 +0000 Subject: dir.c: Fixed double slash issue. includes.h: Changed to ifdef FAST_SHARE_MODES. ipc.c: Changed lp_workgroup() to myworkgroup. loadparm.c: Added new shared mem parameters. Added Luke's fix. locking.c: Rewrite to do share modes better (both fast and slow modes). nameannounce.c: Changed lp_workgroup() to myworkgroup. Added Luke's fix. nameconf.c: Changed lp_workgroup() to myworkgroup. namedbname.c: Improved debug. namedbserver.c: Changed lp_workgroup() to myworkgroup. namedbsubnet.c: Added Luke's fix - rewritten somewhat. namedbwork.c: Changed lp_workgroup() to myworkgroup. nameelect.c: Added Luke's fix - rewritten somewhat. nameresp.c: Stoped shadowing global. nameserv.c: Added Luke's fix - Improved debug. nameservreply.c: Improved debug. namework.c: Changed lp_workgroup() to myworkgroup. nmbd.c: Added Luke's fix - Changed lp_workgroup() to myworkgroup. pipes.c: Changed lp_workgroup() to myworkgroup. proto.h: Added Luke's fix, added smb_shm_ proto's. reply.c: Changed lp_workgroup() to myworkgroup. server.c: Rewrite to do share modes better (both fast and slow modes). shmem.c: Rewrite to do share modes better (both fast and slow modes). smb.h: Rewrite to do share modes better (both fast and slow modes). status.c: Rewrite to do share modes better (both fast and slow modes). trans2.c: Fixed double slash issue. util.c: Tidied up, created myworkgroup. Jeremy Allison (jallison@whistle.com). (This used to be commit 2a1711eaaf08bb6776770cd3c96b3010f431a677) --- source3/include/includes.h | 3 ++- source3/include/proto.h | 25 ++++++++++++++--------- source3/include/smb.h | 50 ++++++++++++++++++++++++++++++++++++---------- 3 files changed, 57 insertions(+), 21 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index e1ed3a5816..265e838be0 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -481,6 +481,7 @@ char *mktemp(char *); /* No standard include */ #ifdef FreeBSD +#include #include #include #include @@ -970,7 +971,7 @@ typedef int mode_t; end of the platform specific sections ********************************************************************/ -#if defined(USE_MMAP) || FAST_SHARE_MODES +#if defined(USE_MMAP) || defined(FAST_SHARE_MODES) #include #endif diff --git a/source3/include/proto.h b/source3/include/proto.h index 973b1a15f3..1fa8c1d95e 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -149,6 +149,7 @@ char *lp_socket_address(void); char *lp_nis_home_map_name(void); BOOL lp_wins_support(void); BOOL lp_wins_proxy(void); +BOOL lp_local_master(void); BOOL lp_domain_master(void); BOOL lp_domain_logons(void); BOOL lp_preferred_master(void); @@ -176,6 +177,8 @@ int lp_maxpacket(void); int lp_keepalive(void); int lp_passwordlevel(void); int lp_readsize(void); +int lp_shmem_size(void); +int lp_shmem_hash_size(void); int lp_deadtime(void); int lp_maxprotocol(void); int lp_security(void); @@ -266,12 +269,12 @@ BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ec BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); BOOL start_share_mode_mgmt(void); BOOL stop_share_mode_mgmt(void); -int get_share_mode_by_fnum(int cnum,int fnum,int *pid); -int get_share_mode_byname(int cnum,char *fname,int *pid); -int get_share_mode(int cnum,struct stat *sbuf,int *pid); -void del_share_mode(int fnum); -BOOL set_share_mode(int fnum,int mode); -void clean_share_modes(void); +BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *); +BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token); +int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, + min_share_mode_entry **old_shares); +void del_share_mode(share_lock_token token, int fnum); +BOOL set_share_mode(share_lock_token token, int fnum); /*The following definitions come from mangle.c */ @@ -309,7 +312,7 @@ void do_announce_host(int command, char *to_name , int to_type , struct in_addr to_ip, time_t announce_interval, char *server_name, int server_type, char *server_comment); -void remove_my_servers(void); +void announce_my_servers_removed(void); void announce_server(struct subnet_record *d, struct work_record *work, char *name, char *comment, time_t ttl, int server_type); void announce_host(time_t t); @@ -394,7 +397,7 @@ void expire_servers(time_t t); struct subnet_record *find_subnet(struct in_addr bcast_ip); struct subnet_record *find_req_subnet(struct in_addr ip, BOOL bcast); struct subnet_record *find_subnet_all(struct in_addr bcast_ip); -void add_subnet_interfaces(void); +void add_workgroup_to_subnet( struct subnet_record *d, char *group); void add_my_subnets(char *group); void write_browse_list(time_t t); @@ -406,7 +409,6 @@ struct work_record *remove_workgroup(struct subnet_record *d, struct work_record *find_workgroupstruct(struct subnet_record *d, fstring name, BOOL add); void dump_workgroups(void); -int check_work_servertype(const char *work_name, int type_mask); /*The following definitions come from nameelect.c */ @@ -724,6 +726,11 @@ BOOL smb_shm_set_userdef_off(smb_shm_offset_t userdef_off); void * smb_shm_offset2addr(smb_shm_offset_t offset); BOOL smb_shm_lock(void); BOOL smb_shm_unlock(void); +smb_shm_offset_t smb_shm_alloc(int size); +smb_shm_offset_t smb_shm_addr2offset(void *addr); +smb_shm_offset_t smb_shm_get_userdef_off(void); +BOOL smb_shm_lock_hash_entry( unsigned int entry); +BOOL smb_shm_unlock_hash_entry( unsigned int entry ); BOOL smb_shm_get_usage(int *bytes_free, int *bytes_used, int *bytes_overhead); diff --git a/source3/include/smb.h b/source3/include/smb.h index 7cd2f5b0fe..e0c08183db 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -36,11 +36,16 @@ #define BUFFER_SIZE (0xFFFF) #define SAFETY_MARGIN 1024 -/* size of shared memory used for share mode locking */ +/* Default size of shared memory used for share mode locking */ #ifndef SHMEM_SIZE #define SHMEM_SIZE 102400 #endif +/* Default number of hash buckets used in shared memory share mode */ +#ifndef SHMEM_HASH_SIZE +#define SHMEM_HASH_SIZE 113 +#endif + #define NMB_PORT 137 #define DGRAM_PORT 138 #define SMB_PORT 139 @@ -295,8 +300,8 @@ typedef struct typedef struct { uint16 ref_count; - int32 dev; - int32 inode; + uint32 dev; + uint32 inode; int fd; int fd_readonly; int fd_writeonly; @@ -320,7 +325,6 @@ typedef struct BOOL can_read; BOOL can_write; BOOL share_mode; - BOOL share_pending; BOOL print_file; BOOL modified; char *name; @@ -420,19 +424,40 @@ struct interface struct in_addr nmask; }; -/* share mode record in shared memory */ +/* share mode record pointed to in shared memory hash bucket */ typedef struct { - smb_shm_offset_t next_offset; /* offset of next record in list in shared mem */ + smb_shm_offset_t next_offset; /* offset of next record in chain from hash bucket */ int locking_version; + int32 st_dev; + int32 st_ino; + int num_share_mode_entries; + smb_shm_offset_t share_mode_entries; /* Chain of share mode entries for this file */ + char file_name[1]; +} share_mode_record; + +/* share mode entry pointed to by share_mode_record struct */ +typedef struct +{ + smb_shm_offset_t next_share_mode_entry; + int pid; int share_mode; struct timeval time; +} share_mode_entry; + +/* struct returned by get_share_modes */ +typedef struct +{ int pid; - dev_t st_dev; - ino_t st_ino; - char file_name[1]; /* dynamically allocated with correct size */ -} share_mode_record; + int share_mode; + struct timeval time; +} min_share_mode_entry; + +/* Token returned by lock_share_entry (actually ignored by FAST_SHARE_MODES code) */ +typedef int share_lock_token; +/* Conversion to hash entry index from device and inode numbers. */ +#define HASH_ENTRY(dev,ino) ((( (uint32)(dev) )* ( (uint32)(ino) )) % lp_shmem_hash_size()) /* this is used for smbstatus */ struct connect_record @@ -798,12 +823,15 @@ char *Strstr(char *s, char *p); #define SV_TYPE_DOMAIN_ENUM 0x80000000 #define SV_TYPE_ALL 0xFFFFFFFF -/* What server type are we currently - JHT Says we ARE 4.20 */ +/* what server type are we currently - JHT Says we ARE 4.20 */ +/* this was set by JHT in liaison with Jeremy Allison early 1997 */ +/* setting to 4.20 at same time as announcing ourselves as NT Server */ /* History: */ /* Version 4.0 - never made public */ /* Version 4.10 - New to 1.9.16p2, lost in space 1.9.16p3 to 1.9.16p9 */ /* - Reappeared in 1.9.16p11 with fixed smbd services */ /* Version 4.20 - To indicate that nmbd and browsing now works better */ + #define MAJOR_VERSION 0x04 #define MINOR_VERSION 0x02 -- cgit From ccf4314fe73fb035f6941f00ce952ba3a308c2da Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 27 May 1997 20:28:45 +0000 Subject: loadparm.c: Ensure printer services cannot be read only and don't use share mode locking. locking.c: Changed aborts to returns so not so drastic on PANIC errors. proto.h: Removed definition of open_file as this is now never externally called. reply.c: Changed reply_mknew, reply_ctemp, reply_printopen to go through open_file_shared. server.c: Modified open_file_shared to be more robust and be useful for printer & temp files. Removed truncate option from open_file (now all truncates are done in open_file_shared). util.c: Added EAGAIN to errors checked in open_socket_out(). version.h: Updated to 1.9.17alpha2. jallison@whistle.com (This used to be commit d8471909b79fd591be2b789485b65d2e636d4745) --- source3/include/proto.h | 1 - source3/include/version.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 1fa8c1d95e..04202dd88c 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -683,7 +683,6 @@ BOOL check_name(char *name,int cnum); int fd_attempt_open(char *fname, int flags, int mode); void fd_attempt_reopen(char *fname, int mode, file_fd_struct *fd_ptr); int fd_attempt_close(file_fd_struct *fd_ptr); -void open_file(int fnum,int cnum,char *fname1,int flags,int mode, struct stat *sbuf); void sync_file(int fnum); void close_file(int fnum); BOOL check_file_sharing(int cnum,char *fname); diff --git a/source3/include/version.h b/source3/include/version.h index cc69bef521..2f7596f41d 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.17alpha1" +#define VERSION "1.9.17alpha2" -- cgit From 3ab97ebe6db1a5a4a0573c7c8482c94876bbce9a Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Fri, 30 May 1997 20:40:48 +0000 Subject: charcnv.c: Fixed silly bugs detected on IRIX. client.c: Fixed silly bugs detected on IRIX. namedbname.c: Stopped 1d names from being registered in WINS db. namedbsubnet.c: Only register 1e names on broadcast subnet. nameelect.c: Changed add_my_name entries. Forced host announces if we have less than 10 servers listed. Fixed registering 1b domain name issues. namepacket.c: Added error message when dgram discarded. nameserv.c: Added notion of 'direct' names that are not registered on the network. Needed to get around bugs in earlier nmbd handling of DOMAIN(1b) names. nameservreply.c:Tidied up debug message. nameservresp.c: Added response_name_query_domain() code. Deals with re-registering DOMAIN(1b) name. nmbd.c: Fixed silly bugs detected on IRIX. nmblib.c: Added paranoia debugs. proto.h: Updated remove_name_entry(), add_my_name_entry(). server.c: Fixed silly bugs detected on IRIX. trans2.c: Fixed silly bugs detected on IRIX. uid.c: Fixed silly bugs detected on IRIX. version.h: Updated to alpha3. Jeremy (jallison@whistle.com). (This used to be commit f08222bd8b86a061c52d22015f946a4737eb47fd) --- source3/include/proto.h | 4 ++-- source3/include/version.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 04202dd88c..e6d39c3a3f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -481,8 +481,8 @@ struct response_record *queue_netbios_packet(struct subnet_record *d, /*The following definitions come from nameserv.c */ -void remove_name_entry(struct subnet_record *d, char *name,int type); -void add_my_name_entry(struct subnet_record *d,char *name,int type,int nb_flags); +void remove_name_entry(struct subnet_record *d, char *name,int type, BOOL direct); +void add_my_name_entry(struct subnet_record *d,char *name,int type,int nb_flags, BOOL direct); void add_domain_names(time_t t); void add_my_names(void); void remove_my_names(); diff --git a/source3/include/version.h b/source3/include/version.h index 2f7596f41d..37e26dd65e 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.17alpha2" +#define VERSION "1.9.17alpha3" -- cgit From 094f7ce427dba7299c8b08c695812d191e382d06 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Mon, 2 Jun 1997 19:51:56 +0000 Subject: nameannounce.c: Made sure recurse flag set correctly. namedbname.c: Made sure wins.dat updated when list changes. Changed to returning 255.255.255.255 when 1e name queried. namepacket.c: Made sure recurse flags set correctly. nameserv.c: Made sure recurse flags set correctly. nameservreply.c: Made send_name_response() static, Made sure recurse flags set correctly. Changed to returning 255.255.255.255 when 1e name queried. proto.h: Removed send_name_response(). Jeremy jallison@whistle.com (This used to be commit 4e9fd24f65971bbbda5f76499e5d14f90eef8038) --- source3/include/proto.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index e6d39c3a3f..2b30b7174e 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -496,10 +496,6 @@ void add_name_respond(struct subnet_record *d, int fd, struct in_addr from_ip, struct nmb_name *name, int nb_flags, int ttl, struct in_addr register_ip, BOOL new_owner, struct in_addr reply_to_ip); -void send_name_response(int fd, struct in_addr from_ip, - int name_trn_id, int opcode, BOOL success, BOOL recurse, - struct nmb_name *reply_name, int nb_flags, int ttl, - struct in_addr ip); void reply_name_release(struct packet_struct *p); void reply_name_reg(struct packet_struct *p); void reply_name_status(struct packet_struct *p); -- cgit From 3f067df49514c821eec5e9be132e6bd42c268506 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 3 Jun 1997 17:14:48 +0000 Subject: includes.h: Added USE_SETSID for SGI. nameelect.c: Added debug 0 comments so you know when you have become a master/domain master. nameservreply.c:Stopped SELF names from being remotely released. This still needs work. nmbsync.c: Added debug 0 comments so you know when a sync is being done. Jeremy jallison@whistle.com (This used to be commit b40d3bede60c8e040ee30c72d605a4950e1a8c8b) --- source3/include/includes.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 265e838be0..7403fc4b64 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -341,6 +341,7 @@ char *getwd(char *); #define STATFS4 #define USE_WAITPID #define USE_DIRECT +#define USE_SETSID #endif #ifdef SGI5 @@ -358,6 +359,7 @@ char *getwd(char *); #define SIGNAL_CAST (void (*)()) #define USE_STATVFS #define USE_WAITPID +#define USE_SETSID #endif -- cgit From 548196362bf5f81de823a075e86bb9ac10e6b14b Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Fri, 6 Jun 1997 16:14:17 +0000 Subject: loadparm.c: Made explicit max packet now ignored. namedbwork.c: Don't announce potential browser if local master = False. nameelect.c: Raise debug level of comment to 2. proto.h: Added reset_globals_after_fork(). server.c: Call reset_globals_after_fork() after forking child. util.c: Added reset_globals_after_fork() - should stop problems with % substitutions in children. (This used to be commit 77be0f710cc96441d966ab7b026a0d591b01ffb0) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 2b30b7174e..66e626487e 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -929,6 +929,7 @@ int interpret_security(char *str,int def); uint32 interpret_addr(char *str); struct in_addr *interpret_addr2(char *str); BOOL zero_ip(struct in_addr ip); +void reset_globals_after_fork(); char *client_name(void); char *client_addr(void); void standard_sub_basic(char *s); -- cgit From c6e63aa896a10656f6205828e744b722fc72f8ac Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 11 Jun 1997 01:03:06 +0000 Subject: Makefile: Added quoata changes for Linux from Thorvald Natvig Makefile.RPM: Added quoata changes for Linux from Thorvald Natvig charset.c: Large changes to add multiple client code pages. charset.h: Changed charset_initialise() proto. client.c: Fixed message sending bug. Changed charset_initialise(). ipc.c: Fixed #ifdef compile problems. loadparm.c: Added "client code page" option. nmbd.c: Changed charset_initialise(). Fixed lmhosts read. nmblookup.c: Changed charset_initialise(). proto.h: Added lp_client_code_page(void). quotas.c: Added quoata changes for Linux from Thorvald Natvig reply.c: Changed debug level. Made SMBecho ignore tid. server.c: Changed charset_initialise(). smb.h: Added DEFAULT_CLIENT_CODE_PAGE as 850. smbpasswd.c: Changed charset_initialise(). status.c: Changed charset_initialise(). testparm.c: Changed charset_initialise(). testprns.c: Changed charset_initialise(). Jeremy Allison (jallison@whistle.com) (This used to be commit 957025bace1bcff34d21a6caeca498e85abccb23) --- source3/include/charset.h | 2 +- source3/include/proto.h | 3 ++- source3/include/smb.h | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/charset.h b/source3/include/charset.h index 5f5e2016ee..25544fb621 100644 --- a/source3/include/charset.h +++ b/source3/include/charset.h @@ -25,7 +25,7 @@ extern char *dos_char_map; extern char *upper_char_map; extern char *lower_char_map; extern void add_char_string(char *s); -extern void charset_initialise(void); +extern void charset_initialise(int); #ifdef toupper #undef toupper diff --git a/source3/include/proto.h b/source3/include/proto.h index 66e626487e..fd4e2dd23c 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -14,7 +14,7 @@ int interpret_character_set(char *str, int def); /*The following definitions come from charset.c */ -void charset_initialise(void); +void charset_initialise(int client_codepage); void add_char_string(char *s); /*The following definitions come from chgpasswd.c */ @@ -186,6 +186,7 @@ int lp_printing(void); int lp_maxdisksize(void); int lp_lpqcachetime(void); int lp_syslog(void); +int lp_client_code_page(void); char *lp_preexec(int ); char *lp_postexec(int ); char *lp_rootpreexec(int ); diff --git a/source3/include/smb.h b/source3/include/smb.h index e0c08183db..9af653220a 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -909,4 +909,8 @@ enum case_handling {CASE_LOWER,CASE_UPPER}; #define VUID_OFFSET 100 /* Amount to bias returned vuid numbers */ #endif + +/* Default client code page - 850 - Western European */ +#define DEFAULT_CLIENT_CODE_PAGE 850 + /* _SMB_H */ -- cgit From 2a33e58d18f400a05aeef00ba27f2b3c12ac315c Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Mon, 16 Jun 1997 20:49:15 +0000 Subject: charset.c: Dropped debug message to level 6. loadparm.c: Added "time server" parameter. nameserv.h: Added "time server" parameter. proto.h: Added lp_time_server(). server.c: Removed incorrect | 0700 - this was a whistle specific change. Jeremy (jallison@whistle.com). (This used to be commit 54dcca1240ec0a7f107f8a77e0893855015f9d29) --- source3/include/nameserv.h | 3 ++- source3/include/proto.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 1aa1075543..ae59f95252 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -410,7 +410,8 @@ struct packet_struct #define REMOTE_ANNOUNCE_INTERVAL 180 #define DFLT_SERVER_TYPE (SV_TYPE_WORKSTATION | SV_TYPE_SERVER | \ - SV_TYPE_TIME_SOURCE | SV_TYPE_SERVER_UNIX | \ + (lp_time_server() ? SV_TYPE_TIME_SOURCE : 0) | \ + SV_TYPE_SERVER_UNIX | \ SV_TYPE_PRINTQ_SERVER | SV_TYPE_SERVER_NT | \ SV_TYPE_NT ) diff --git a/source3/include/proto.h b/source3/include/proto.h index fd4e2dd23c..92feccf384 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -167,6 +167,7 @@ BOOL lp_syslog_only(void); BOOL lp_browse_list(void); BOOL lp_unix_realname(void); BOOL lp_nis_home_map(void); +BOOL lp_time_server(void); int lp_os_level(void); int lp_max_ttl(void); int lp_max_log_size(void); -- cgit From 434d26acfe3bea62217b5ceaafc8b7b9cbe6e914 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 19 Jun 1997 00:18:23 +0000 Subject: loadparm.c: Added "force create mode" and "force directory mode" params. proto.h: Added lp_force_create_mode() and lp_force_dir_mode(). server.c: Fixed application of mode bits to be regular across files and directories. smb.h: Removed unused CREATE_MODE macro. Jeremy (jallison@whistle.com) (This used to be commit 2c928212500e1de27550d9fccb0939fd2e450515) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source3/include/proto.h | 2 ++ source3/include/smb.h | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 92feccf384..3929348da6 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -246,7 +246,9 @@ BOOL lp_map_system(int ); BOOL lp_delete_readonly(int ); BOOL lp_fake_oplocks(int ); int lp_create_mode(int ); +int lp_force_create_mode(int ); int lp_dir_mode(int ); +int lp_force_dir_mode(int ); int lp_max_connections(int ); int lp_defaultcase(int ); int lp_minprintspace(int ); diff --git a/source3/include/smb.h b/source3/include/smb.h index 9af653220a..2dc2624566 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -511,7 +511,6 @@ struct connect_record #define MAP_HIDDEN(cnum) (OPEN_CNUM(cnum) && lp_map_hidden(SNUM(cnum))) #define MAP_SYSTEM(cnum) (OPEN_CNUM(cnum) && lp_map_system(SNUM(cnum))) #define MAP_ARCHIVE(cnum) (OPEN_CNUM(cnum) && lp_map_archive(SNUM(cnum))) -#define CREATE_MODE(cnum) (lp_create_mode(SNUM(cnum)) | 0700) #ifdef SMB_PASSWD #define SMBENCRYPT() (lp_encrypted_passwords()) #else -- cgit From fb1429c1970bc123e191f0cb7cc764faf4b86998 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 1 Jul 1997 01:19:13 +0000 Subject: client.c: New print queue query code from Jeff C. Foster " ipc.c: Added code for returning restricted lists of servers. loadparm.c: Changed default for force create mode to 000. Changed default maxmux to 50 to comply with NT. locking.c: Fixed silly crash bug with slow share mode code. nameannounce.c: Added code for returning restricted lists of servers. namedbserver.c: Added code for returning restricted lists of servers. nameelect.c: Added code for returning restricted lists of servers. namework.c: Added code for returning restricted lists of servers. nmbsync.c: Added code for returning restricted lists of servers. server.c: Added quota fix Albrecht Gebhardt smb.h: Added define for COPYBUF_SIZE. system.c: Rename across filesystems Patch from Warren Birnbaum util.c: Minor fix for warning. (This used to be commit 1c6e433caa22813a699c9766847886eb59755f8b) --- source3/include/smb.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 2dc2624566..ddbd05792d 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -912,4 +912,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER}; /* Default client code page - 850 - Western European */ #define DEFAULT_CLIENT_CODE_PAGE 850 +/* Size of buffer to use when moving files across filesystems. */ +#define COPYBUF_SIZE (8*1024) + /* _SMB_H */ -- cgit From 738d29667f9cd1ce312ec011f5e37ce584d7173d Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 1 Jul 1997 19:02:43 +0000 Subject: added "hide files" option. lkcl (This used to be commit 6e594ce0e5a3af5e7311380d18ff0d19ba9698a7) --- source3/include/proto.h | 25 ++++++++++++++----------- source3/include/smb.h | 7 +++++++ 2 files changed, 21 insertions(+), 11 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 3929348da6..bbfd0835b7 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -142,6 +142,7 @@ char *lp_character_set(void); char *lp_logon_script(void); char *lp_logon_path(void); char *lp_veto_files(void); +char *lp_hide_files(void); char *lp_remote_announce(void); char *lp_wins_server(void); char *lp_interfaces(void); @@ -273,12 +274,18 @@ BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ec BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); BOOL start_share_mode_mgmt(void); BOOL stop_share_mode_mgmt(void); -BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *); -BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token); +BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *ptok); +BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token token); int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, min_share_mode_entry **old_shares); void del_share_mode(share_lock_token token, int fnum); BOOL set_share_mode(share_lock_token token, int fnum); +BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *ptok); +BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token token); +int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, + min_share_mode_entry **old_shares); +void del_share_mode(share_lock_token token, int fnum); +BOOL set_share_mode(share_lock_token token,int fnum); /*The following definitions come from mangle.c */ @@ -302,7 +309,6 @@ int reply_sendend(char *inbuf,char *outbuf); /*The following definitions come from nameannounce.c */ -void reset_announce_timer(); void announce_request(struct work_record *work, struct in_addr ip); void do_announce_request(char *info, char *to_name, int announce_type, int from, @@ -320,6 +326,7 @@ void announce_my_servers_removed(void); void announce_server(struct subnet_record *d, struct work_record *work, char *name, char *comment, time_t ttl, int server_type); void announce_host(time_t t); +void reset_announce_timer(); void announce_master(time_t t); void announce_remote(time_t t); @@ -327,8 +334,7 @@ void announce_remote(time_t t); void expire_browse_cache(time_t t); struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, - time_t ttl, - struct subnet_record *d, + time_t ttl, struct subnet_record *d, struct in_addr ip, BOOL local); void do_browser_lists(time_t t); @@ -718,16 +724,12 @@ int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); /*The following definitions come from shmem.c */ +BOOL smb_shm_create_hash_table( unsigned int size ); BOOL smb_shm_open( char *file_name, int size); BOOL smb_shm_close( void ); BOOL smb_shm_free(smb_shm_offset_t offset); BOOL smb_shm_set_userdef_off(smb_shm_offset_t userdef_off); void * smb_shm_offset2addr(smb_shm_offset_t offset); -BOOL smb_shm_lock(void); -BOOL smb_shm_unlock(void); -smb_shm_offset_t smb_shm_alloc(int size); -smb_shm_offset_t smb_shm_addr2offset(void *addr); -smb_shm_offset_t smb_shm_get_userdef_off(void); BOOL smb_shm_lock_hash_entry( unsigned int entry); BOOL smb_shm_unlock_hash_entry( unsigned int entry ); BOOL smb_shm_get_usage(int *bytes_free, @@ -947,7 +949,8 @@ void BlockSignals(BOOL block,int signum); void ajt_panic(void); char *readdirname(void *p); BOOL is_vetoed_name(char *name); -BOOL is_vetoed_path(char *name); +BOOL is_hidden_path(char *path); +BOOL is_vetoed_path(char *path); BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); int file_lock(char *name,int timeout); void file_unlock(int fd); diff --git a/source3/include/smb.h b/source3/include/smb.h index ddbd05792d..b36943bfe2 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -915,4 +915,11 @@ enum case_handling {CASE_LOWER,CASE_UPPER}; /* Size of buffer to use when moving files across filesystems. */ #define COPYBUF_SIZE (8*1024) +/* Default files that will be hidden, but accessible. intended + to replace the "hide dot files" parameter if the "hide files" + parameter moves to the service section instead of the global + section. + */ +#define DEFAULT_FILES_TO_HIDE ".*" + /* _SMB_H */ -- cgit From ce9baa3bac6eba5f7a468557572f342d3ba918ec Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 1 Jul 1997 19:42:42 +0000 Subject: made "hide files" and "veto files" into per-service parameter sections, instead of just [global]. this makes it easier to decide whether to remove the "hide dot files" per-service parameter, and supercede it with a default "hide files" value of ".*". lkcl (This used to be commit f3ee4620ea7b93e4a00e77f9d787a118fd11ccaa) --- source3/include/proto.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index bbfd0835b7..a8db4500e1 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -73,13 +73,13 @@ void dptr_closecnum(int cnum); void dptr_idlecnum(int cnum); void dptr_closepath(char *path,int pid); int dptr_create(int cnum,char *path, BOOL expect_close,int pid); -BOOL dptr_fill(char *buf1,unsigned int key); +BOOL dptr_fill(int cnum, char *buf1,unsigned int key); BOOL dptr_zero(char *buf); -void *dptr_fetch(char *buf,int *num); -void *dptr_fetch_lanman2(char *params,int dptr_num); +void *dptr_fetch(int cnum, char *buf,int *num); +void *dptr_fetch_lanman2(int cnum, char *params,int dptr_num); BOOL dir_check_ftype(int cnum,int mode,struct stat *st,int dirtype); BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend); -void *OpenDir(char *name); +void *OpenDir(int cnum, char *name); void CloseDir(void *p); char *ReadDirName(void *p); BOOL SeekDir(void *p,int pos); @@ -141,8 +141,6 @@ char *lp_username_map(void); char *lp_character_set(void); char *lp_logon_script(void); char *lp_logon_path(void); -char *lp_veto_files(void); -char *lp_hide_files(void); char *lp_remote_announce(void); char *lp_wins_server(void); char *lp_interfaces(void); @@ -219,6 +217,8 @@ char *lp_readlist(int ); char *lp_writelist(int ); char *lp_volume(int ); char *lp_mangled_map(int ); +char *lp_veto_files(int ); +char *lp_hide_files(int ); BOOL lp_alternate_permissions(int ); BOOL lp_revalidate(int ); BOOL lp_casesensitive(int ); @@ -948,9 +948,9 @@ char *gidtoname(int gid); void BlockSignals(BOOL block,int signum); void ajt_panic(void); char *readdirname(void *p); -BOOL is_vetoed_name(char *name); -BOOL is_hidden_path(char *path); -BOOL is_vetoed_path(char *path); +BOOL is_vetoed_name(int snum, char *name); +BOOL is_hidden_path(int cnum, char *path); +BOOL is_vetoed_path(int cnum, char *path); BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); int file_lock(char *name,int timeout); void file_unlock(int fd); -- cgit From 1599e41ec42998fdf05a3b22c3f3a93f8b4832ed Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 1 Jul 1997 20:50:57 +0000 Subject: Rolled back Lukes changes. Not quite ready for prime time. Jeremy (jallison@whistle.com) (This used to be commit ed04ec7ab8b8e73b5442bdef03d5a3c994247b4e) --- source3/include/proto.h | 37 +++++++++++++++++-------------------- source3/include/smb.h | 7 ------- 2 files changed, 17 insertions(+), 27 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index a8db4500e1..3929348da6 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -73,13 +73,13 @@ void dptr_closecnum(int cnum); void dptr_idlecnum(int cnum); void dptr_closepath(char *path,int pid); int dptr_create(int cnum,char *path, BOOL expect_close,int pid); -BOOL dptr_fill(int cnum, char *buf1,unsigned int key); +BOOL dptr_fill(char *buf1,unsigned int key); BOOL dptr_zero(char *buf); -void *dptr_fetch(int cnum, char *buf,int *num); -void *dptr_fetch_lanman2(int cnum, char *params,int dptr_num); +void *dptr_fetch(char *buf,int *num); +void *dptr_fetch_lanman2(char *params,int dptr_num); BOOL dir_check_ftype(int cnum,int mode,struct stat *st,int dirtype); BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend); -void *OpenDir(int cnum, char *name); +void *OpenDir(char *name); void CloseDir(void *p); char *ReadDirName(void *p); BOOL SeekDir(void *p,int pos); @@ -141,6 +141,7 @@ char *lp_username_map(void); char *lp_character_set(void); char *lp_logon_script(void); char *lp_logon_path(void); +char *lp_veto_files(void); char *lp_remote_announce(void); char *lp_wins_server(void); char *lp_interfaces(void); @@ -217,8 +218,6 @@ char *lp_readlist(int ); char *lp_writelist(int ); char *lp_volume(int ); char *lp_mangled_map(int ); -char *lp_veto_files(int ); -char *lp_hide_files(int ); BOOL lp_alternate_permissions(int ); BOOL lp_revalidate(int ); BOOL lp_casesensitive(int ); @@ -274,18 +273,12 @@ BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ec BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); BOOL start_share_mode_mgmt(void); BOOL stop_share_mode_mgmt(void); -BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *ptok); -BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token token); +BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *); +BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token); int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, min_share_mode_entry **old_shares); void del_share_mode(share_lock_token token, int fnum); BOOL set_share_mode(share_lock_token token, int fnum); -BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *ptok); -BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token token); -int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, - min_share_mode_entry **old_shares); -void del_share_mode(share_lock_token token, int fnum); -BOOL set_share_mode(share_lock_token token,int fnum); /*The following definitions come from mangle.c */ @@ -309,6 +302,7 @@ int reply_sendend(char *inbuf,char *outbuf); /*The following definitions come from nameannounce.c */ +void reset_announce_timer(); void announce_request(struct work_record *work, struct in_addr ip); void do_announce_request(char *info, char *to_name, int announce_type, int from, @@ -326,7 +320,6 @@ void announce_my_servers_removed(void); void announce_server(struct subnet_record *d, struct work_record *work, char *name, char *comment, time_t ttl, int server_type); void announce_host(time_t t); -void reset_announce_timer(); void announce_master(time_t t); void announce_remote(time_t t); @@ -334,7 +327,8 @@ void announce_remote(time_t t); void expire_browse_cache(time_t t); struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, - time_t ttl, struct subnet_record *d, + time_t ttl, + struct subnet_record *d, struct in_addr ip, BOOL local); void do_browser_lists(time_t t); @@ -724,12 +718,16 @@ int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); /*The following definitions come from shmem.c */ -BOOL smb_shm_create_hash_table( unsigned int size ); BOOL smb_shm_open( char *file_name, int size); BOOL smb_shm_close( void ); BOOL smb_shm_free(smb_shm_offset_t offset); BOOL smb_shm_set_userdef_off(smb_shm_offset_t userdef_off); void * smb_shm_offset2addr(smb_shm_offset_t offset); +BOOL smb_shm_lock(void); +BOOL smb_shm_unlock(void); +smb_shm_offset_t smb_shm_alloc(int size); +smb_shm_offset_t smb_shm_addr2offset(void *addr); +smb_shm_offset_t smb_shm_get_userdef_off(void); BOOL smb_shm_lock_hash_entry( unsigned int entry); BOOL smb_shm_unlock_hash_entry( unsigned int entry ); BOOL smb_shm_get_usage(int *bytes_free, @@ -948,9 +946,8 @@ char *gidtoname(int gid); void BlockSignals(BOOL block,int signum); void ajt_panic(void); char *readdirname(void *p); -BOOL is_vetoed_name(int snum, char *name); -BOOL is_hidden_path(int cnum, char *path); -BOOL is_vetoed_path(int cnum, char *path); +BOOL is_vetoed_name(char *name); +BOOL is_vetoed_path(char *name); BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); int file_lock(char *name,int timeout); void file_unlock(int fd); diff --git a/source3/include/smb.h b/source3/include/smb.h index b36943bfe2..ddbd05792d 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -915,11 +915,4 @@ enum case_handling {CASE_LOWER,CASE_UPPER}; /* Size of buffer to use when moving files across filesystems. */ #define COPYBUF_SIZE (8*1024) -/* Default files that will be hidden, but accessible. intended - to replace the "hide dot files" parameter if the "hide files" - parameter moves to the service section instead of the global - section. - */ -#define DEFAULT_FILES_TO_HIDE ".*" - /* _SMB_H */ -- cgit From fc3901122d51b76b5dd5d6a798dace35760590ad Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 3 Jul 1997 17:19:46 +0000 Subject: Fixes for UnixWare 2.x with shadow passwords from Warren Young . (This used to be commit 885b42b44752249c85bb924c9ceefa5b710225da) --- source3/include/includes.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 7403fc4b64..44707673ee 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -968,6 +968,12 @@ typedef int mode_t; #define HAVE_VFORK 1 #endif +/* For UnixWare 2.x's ia_uinfo routines. (tangent@cyberport.com) */ +#ifdef IA_UINFO +#include +#include +#endif + /******************************************************************* end of the platform specific sections -- cgit From f6384eca672565bf820f86721de5cf25a5e5e9fe Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 3 Jul 1997 19:44:06 +0000 Subject: Fix for deleting directories that contain only veto files. Needed for interoperability with netatalk volumes. Jeremy (jallison@whistle.com) (This used to be commit e72a8513bccf77177f6fb6002057fee608947a32) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 3929348da6..ef9382279e 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -79,7 +79,7 @@ void *dptr_fetch(char *buf,int *num); void *dptr_fetch_lanman2(char *params,int dptr_num); BOOL dir_check_ftype(int cnum,int mode,struct stat *st,int dirtype); BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend); -void *OpenDir(char *name); +void *OpenDir(char *name, BOOL use_veto); void CloseDir(void *p); char *ReadDirName(void *p); BOOL SeekDir(void *p,int pos); -- cgit From 4a2cc7bb2b5b4485d91f5ef7a7c88d7520f8ad28 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 3 Jul 1997 19:55:04 +0000 Subject: preparing for release of 1.9.17alpha4 (This used to be commit 16f6bf700f99357c7467d52b65de42ecff533636) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 37e26dd65e..9211793166 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.17alpha3" +#define VERSION "1.9.17alpha4" -- cgit From 3e37f8f70f67d441582f84021ce185ced5e6baaf Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 3 Jul 1997 20:45:06 +0000 Subject: Makefile: Added DGUX changes for intel. namedbwork.c: Minor tidyup for election flah. util.c: Fix for broken readdir detectino code. version.h: Back to 1.9.17alpha3 - will be updated by release script. Jeremy jallison@whistle.com (This used to be commit 26635733a746dee2435da7ce228def5f2f292bba) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 9211793166..37e26dd65e 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.17alpha4" +#define VERSION "1.9.17alpha3" -- cgit From c9914c98f08d01034ba4ed68e2458554296128e7 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 3 Jul 1997 20:51:44 +0000 Subject: preparing for release of 1.9.17alpha4 (This used to be commit ef5ccde4760a5545c5dedf4721cb28cbe0163661) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 37e26dd65e..9211793166 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.17alpha3" +#define VERSION "1.9.17alpha4" -- cgit From b4863b07f4d659fe37531f04621a80180c014e0a Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sun, 6 Jul 1997 12:06:23 +0000 Subject: replaced the "wins proxy" to treat NetBIOS names as DNS names with new "dns proxy" option. the "wins proxy" option should be used for broadcast only hosts, and isn't properly implemented anyway. the new "dns proxy" option can be disabled if the (blocking) dns resolution takes up a significant amount of time. this _will_ occur if gethostbyname does external DNS lookups, instead of just (immediately) returning entries in /etc/hosts. lkcl (This used to be commit 350dfc57dd3001ba27519000a2ab9dd541a66ac7) --- source3/include/proto.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index ef9382279e..8aecf7907a 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -147,6 +147,7 @@ char *lp_wins_server(void); char *lp_interfaces(void); char *lp_socket_address(void); char *lp_nis_home_map_name(void); +BOOL lp_dns_proxy(void); BOOL lp_wins_support(void); BOOL lp_wins_proxy(void); BOOL lp_local_master(void); @@ -273,12 +274,18 @@ BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ec BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); BOOL start_share_mode_mgmt(void); BOOL stop_share_mode_mgmt(void); -BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *); -BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token); +BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *ptok); +BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token token); int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, min_share_mode_entry **old_shares); void del_share_mode(share_lock_token token, int fnum); BOOL set_share_mode(share_lock_token token, int fnum); +BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *ptok); +BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token token); +int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, + min_share_mode_entry **old_shares); +void del_share_mode(share_lock_token token, int fnum); +BOOL set_share_mode(share_lock_token token,int fnum); /*The following definitions come from mangle.c */ @@ -302,7 +309,6 @@ int reply_sendend(char *inbuf,char *outbuf); /*The following definitions come from nameannounce.c */ -void reset_announce_timer(); void announce_request(struct work_record *work, struct in_addr ip); void do_announce_request(char *info, char *to_name, int announce_type, int from, @@ -320,6 +326,7 @@ void announce_my_servers_removed(void); void announce_server(struct subnet_record *d, struct work_record *work, char *name, char *comment, time_t ttl, int server_type); void announce_host(time_t t); +void reset_announce_timer(); void announce_master(time_t t); void announce_remote(time_t t); @@ -327,8 +334,7 @@ void announce_remote(time_t t); void expire_browse_cache(time_t t); struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, - time_t ttl, - struct subnet_record *d, + time_t ttl, struct subnet_record *d, struct in_addr ip, BOOL local); void do_browser_lists(time_t t); @@ -718,16 +724,12 @@ int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); /*The following definitions come from shmem.c */ +BOOL smb_shm_create_hash_table( unsigned int size ); BOOL smb_shm_open( char *file_name, int size); BOOL smb_shm_close( void ); BOOL smb_shm_free(smb_shm_offset_t offset); BOOL smb_shm_set_userdef_off(smb_shm_offset_t userdef_off); void * smb_shm_offset2addr(smb_shm_offset_t offset); -BOOL smb_shm_lock(void); -BOOL smb_shm_unlock(void); -smb_shm_offset_t smb_shm_alloc(int size); -smb_shm_offset_t smb_shm_addr2offset(void *addr); -smb_shm_offset_t smb_shm_get_userdef_off(void); BOOL smb_shm_lock_hash_entry( unsigned int entry); BOOL smb_shm_unlock_hash_entry( unsigned int entry ); BOOL smb_shm_get_usage(int *bytes_free, -- cgit From 1fe89d0b716ccd9fca4abe4daf89df063b38f4b3 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sun, 6 Jul 1997 13:48:10 +0000 Subject: added, tested and debugged new "hide files" option. lkcl (This used to be commit 60af320a436c3a26230fd7ac71856e67ef64e819) --- source3/include/proto.h | 16 +++++++++------- source3/include/smb.h | 3 +++ 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 8aecf7907a..aae5b3a63b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -73,13 +73,13 @@ void dptr_closecnum(int cnum); void dptr_idlecnum(int cnum); void dptr_closepath(char *path,int pid); int dptr_create(int cnum,char *path, BOOL expect_close,int pid); -BOOL dptr_fill(char *buf1,unsigned int key); +BOOL dptr_fill(int snum, char *buf1,unsigned int key); BOOL dptr_zero(char *buf); -void *dptr_fetch(char *buf,int *num); -void *dptr_fetch_lanman2(char *params,int dptr_num); +void *dptr_fetch(int snum, char *buf,int *num); +void *dptr_fetch_lanman2(int snum, char *params,int dptr_num); BOOL dir_check_ftype(int cnum,int mode,struct stat *st,int dirtype); BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend); -void *OpenDir(char *name, BOOL use_veto); +void *OpenDir(int snum, char *name, BOOL use_veto); void CloseDir(void *p); char *ReadDirName(void *p); BOOL SeekDir(void *p,int pos); @@ -141,7 +141,6 @@ char *lp_username_map(void); char *lp_character_set(void); char *lp_logon_script(void); char *lp_logon_path(void); -char *lp_veto_files(void); char *lp_remote_announce(void); char *lp_wins_server(void); char *lp_interfaces(void); @@ -219,6 +218,8 @@ char *lp_readlist(int ); char *lp_writelist(int ); char *lp_volume(int ); char *lp_mangled_map(int ); +char *lp_veto_files(int ); +char *lp_hide_files(int ); BOOL lp_alternate_permissions(int ); BOOL lp_revalidate(int ); BOOL lp_casesensitive(int ); @@ -948,8 +949,9 @@ char *gidtoname(int gid); void BlockSignals(BOOL block,int signum); void ajt_panic(void); char *readdirname(void *p); -BOOL is_vetoed_name(char *name); -BOOL is_vetoed_path(char *name); +BOOL is_hidden_path(int snum, char *name); +BOOL is_vetoed_name(int snum, char *name); +BOOL is_in_path(char *name, char *namelist); BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); int file_lock(char *name,int timeout); void file_unlock(int fd); diff --git a/source3/include/smb.h b/source3/include/smb.h index ddbd05792d..d4ad9105fe 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -915,4 +915,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER}; /* Size of buffer to use when moving files across filesystems. */ #define COPYBUF_SIZE (8*1024) +/* service-based parameter - files are not visible, but are accessible */ +#define DEFAULT_FILES_TO_HIDE "*/.*" + /* _SMB_H */ -- cgit From 25eae02948b40667495fbb021dd130180180a05e Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 8 Jul 1997 16:54:44 +0000 Subject: Makefile: Added AIX targets from Ole Holm Nielsen chgpasswd.c: Added Samba/GPL notice (for obvious reasons). clitar.c: Updated Copyright date to include 1997 (for obvious reasons). getsmbpass.c: Updated Copyright date to include 1997 (for obvious reasons). includes.h: Added stropts for solaris. loadparm.c: Changed comment for hide files option. nameconf.c: Updated Copyright date to include 1997 (for obvious reasons). nmbd.c: Updated Copyright date to include 1997 (for obvious reasons). pcap.c: Updated Copyright date to include 1997 (for obvious reasons). proto.h: Re-added accidentaly deleted smb_shm_ calls. quotas.c: Added AIX quota patch from Ole Holm Nielsen server.c: Optimization on calling is_hidden_path. Updated Copyrights. smb.h: Changed DEFAULT_FILES_TO_HIDE from "*/.*" to ".*". smbpass.c: Updated Copyright date to include 1997 (for obvious reasons). ufc.c: Updated Copyright date to include 1997 (for obvious reasons). util.c: Added last component code to is_in_path(). Jeremy (jallison@whistle.com) (This used to be commit 9385ae1005f13c8ed51f1319e3949b5c8571e62d) --- source3/include/includes.h | 1 + source3/include/proto.h | 4 +++- source3/include/smb.h | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 44707673ee..a5adb35077 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -291,6 +291,7 @@ typedef unsigned short mode_t; #include #include #include +#include #ifndef USE_LIBDES #include #endif /* USE_LIBDES */ diff --git a/source3/include/proto.h b/source3/include/proto.h index aae5b3a63b..5ba308561f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -736,6 +736,9 @@ BOOL smb_shm_unlock_hash_entry( unsigned int entry ); BOOL smb_shm_get_usage(int *bytes_free, int *bytes_used, int *bytes_overhead); +smb_shm_offset_t smb_shm_alloc(int size); +smb_shm_offset_t smb_shm_addr2offset(void *addr); +smb_shm_offset_t smb_shm_get_userdef_off(void); /*The following definitions come from smbencrypt.c */ @@ -951,7 +954,6 @@ void ajt_panic(void); char *readdirname(void *p); BOOL is_hidden_path(int snum, char *name); BOOL is_vetoed_name(int snum, char *name); -BOOL is_in_path(char *name, char *namelist); BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); int file_lock(char *name,int timeout); void file_unlock(int fd); diff --git a/source3/include/smb.h b/source3/include/smb.h index d4ad9105fe..463dcb1373 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -916,6 +916,6 @@ enum case_handling {CASE_LOWER,CASE_UPPER}; #define COPYBUF_SIZE (8*1024) /* service-based parameter - files are not visible, but are accessible */ -#define DEFAULT_FILES_TO_HIDE "*/.*" +#define DEFAULT_FILES_TO_HIDE ".*" /* _SMB_H */ -- cgit From cec799512da39b880a80449952a30c255d7eb972 Mon Sep 17 00:00:00 2001 From: John Terpstra Date: Wed, 9 Jul 1997 11:04:45 +0000 Subject: JHT ==> Added copyright notations for my works. This is regretably needed! (This used to be commit c80111cdf54218f23b230dc91bd6d814e6a4afcc) --- source3/include/smb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 463dcb1373..1d53942fa7 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -3,6 +3,7 @@ Version 1.9. SMB parameters and setup Copyright (C) Andrew Tridgell 1992-1997 + Copyright (C) John H Terpstra 1996-1997 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -- cgit From f7f1be32757c386ea08f6dbf65a74457b2d4c6a9 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Mon, 14 Jul 1997 18:19:26 +0000 Subject: CIFS definitions for SMB_INFO_xxx etc. lkcl (This used to be commit 9fda8a6fefd66a1c9f239e0dd41888af3555a22b) --- source3/include/trans2.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/include') diff --git a/source3/include/trans2.h b/source3/include/trans2.h index 70285358bc..9a2de63109 100644 --- a/source3/include/trans2.h +++ b/source3/include/trans2.h @@ -194,6 +194,11 @@ Byte offset Type name description } FSINFO; *************************************************************/ +#define SMB_INFO_STANDARD 1 +#define SMB_INFO_QUERY_EA_SIZE 2 +#define SMB_INFO_QUERY_EAS_FROM_LIST 3 +#define SMB_INFO_QUERY_ALL_EAS 4 +#define SMB_INFO_IS_NAME_VALID 6 #define SMB_QUERY_FS_LABEL_INFO 0x101 #define SMB_QUERY_FS_VOLUME_INFO 0x102 #define SMB_QUERY_FS_SIZE_INFO 0x103 -- cgit From 0776dea81fbf353669714a5e3ff6d62ff6303ed6 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Mon, 14 Jul 1997 19:45:34 +0000 Subject: local.h: Removed ununsed SHARE_MODES_XXX defines. Upped SMBD_RELOAD_CHECK from 10 to 60. server.c: Removed unused code (was If 0'ed out). trans2.c: Backed out Luke's ctime->mtime change. I don't think it is correct. Left the other fixes, though. util.c: Changed veto/hide files separator back to '/'. Jeremy (jallison@whistle.com) (This used to be commit b47121624c8824d3e1d8992cb950ebad52ba5c58) --- source3/include/local.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index 01eac55652..fc589d7ac0 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -114,9 +114,7 @@ /* the following control timings of various actions. Don't change them unless you know what you are doing. These are all in seconds */ #define DEFAULT_SMBD_TIMEOUT (60*60*24*7) -#define SMBD_RELOAD_CHECK (10) -#define SHARE_MODES_CHECK (10) -#define SHARE_MODES_CLEAN (300) +#define SMBD_RELOAD_CHECK (60) #define IDLE_CLOSED_TIMEOUT (60) #define DPTR_IDLE_TIMEOUT (120) #define SMBD_SELECT_LOOP (10) -- cgit From 8b904f4ecc7b6bd6558d40fda4184112bbb10366 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 17 Jul 1997 20:11:58 +0000 Subject: Makefile: Added krb5 option from Nathan Neulinger includes.h: Added krb5 option from Nathan Neulinger , added SGI5 fix. password.c: Added krb5 option from Nathan Neulinger quotas.c: Added inode quote fix. reply.c: removed redundent code. server.c: Changed error debug to 0, removed redundent check. util.c: Added close_low_fd() to become_daemon - fix for rsh from Johnathan Knight. Jeremy (jallison@whistle.com) (This used to be commit 256afb764828b0a6dad5529d62501bc9ea2807ee) --- source3/include/includes.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index a5adb35077..7dcff54286 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -348,6 +348,8 @@ char *getwd(char *); #ifdef SGI5 #include #include +#include +#include #include #include #include @@ -1059,6 +1061,10 @@ struct spwd { /* fake shadow password structure */ #include #endif +#ifdef KRB5_AUTH +#include +#endif + #ifdef NO_UTIMBUF struct utimbuf { time_t actime; -- cgit From 612111c7a1a048d19e24b5e2e4d426247d320d1e Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Fri, 18 Jul 1997 20:21:32 +0000 Subject: charset.c: Split charset_initialise() into 2 - a charset_initialise() and a codepage_initialise(). Fixes problem with initialising dos map twice. charset.h: Changes to support charset changes. client.c: Changes to support charset changes. loadparm.c: follow symlinks parameter from David Clerc nmbd.c: Changes to support charset changes. nmblookup.c:Changes to support charset changes. proto.h: Changes to support charset changes. reply.c: Don't call security=server with no user/no password guest. Fix from Stefaan A Eeckels server.c: follow symlinks code from David Clerc smbpasswd.c:Changes to support charset changes. status.c: Changes to support charset changes. testparm.c: Changes to support charset changes. testprns.c: Changes to support charset changes. uid.c: Fixed log message with no \n. Jeremy (jallison@whistle.com) (This used to be commit 2a28a6e5e461aca7fe6c19cd01d287010056cffb) --- source3/include/charset.h | 2 +- source3/include/proto.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/charset.h b/source3/include/charset.h index 25544fb621..5f5e2016ee 100644 --- a/source3/include/charset.h +++ b/source3/include/charset.h @@ -25,7 +25,7 @@ extern char *dos_char_map; extern char *upper_char_map; extern char *lower_char_map; extern void add_char_string(char *s); -extern void charset_initialise(int); +extern void charset_initialise(void); #ifdef toupper #undef toupper diff --git a/source3/include/proto.h b/source3/include/proto.h index 5ba308561f..e9994214fb 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -14,7 +14,8 @@ int interpret_character_set(char *str, int def); /*The following definitions come from charset.c */ -void charset_initialise(int client_codepage); +void charset_initialise(void); +void codepage_initialise(int client_codepage); void add_char_string(char *s); /*The following definitions come from chgpasswd.c */ @@ -243,6 +244,7 @@ BOOL lp_share_modes(int ); BOOL lp_onlyuser(int ); BOOL lp_manglednames(int ); BOOL lp_widelinks(int ); +BOOL lp_symlinks(int ); BOOL lp_syncalways(int ); BOOL lp_map_system(int ); BOOL lp_delete_readonly(int ); -- cgit From 7020afbd03402f68113dfd60ec078b2a68b5be6f Mon Sep 17 00:00:00 2001 From: John Terpstra Date: Wed, 23 Jul 1997 10:54:00 +0000 Subject: JHT ===> Getting ready for release of 1.9.17alpha5 Please note that version.h has been updated!!!!!!!!!! (This used to be commit 271d12b5ddc372500feea8fec5678191ba4ebcf8) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 9211793166..20486854f5 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.17alpha4" +#define VERSION "1.9.17alpha5" -- cgit From 15ae50ca5203bc4c04567e400ba041a4d1757b2b Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 24 Jul 1997 17:25:11 +0000 Subject: Makefile: Added UNIXWARE 2.x with shadow passwords from fja@extratech.com client.c: Made prompt appear at debug level 0. Fixed strcasecmp redefinition. Caused client to use set_blocking rather than making fcntl calls itself. dir.c: Removed redundent snum parameters. includes.h: Added SCO fixes. loadparm.c: Made default 'files to hide' a null string. nmbd.c: Removed O_NONBLOCK from pid file open for platforms that dont have it. proto.h: Changed snum to cnum where needed. Changed is_xx_path to is_in_path (now called via MACRO). quotas.c: Swapped setuid/seteuid calls when restoring uid. reply.c: Removed redundent snum parameters. server.c: Changed snum to cnum where needed. Setup new veto_list, hide_list namelists. Added standard_sub changes from Stefaan A Eeckels and Paul Rippin shmem.c: Changed cast for sizeof to be int before negating. smb.h: Added new veto_list, hide_list entries to connections. Added IS_PRINT, IS_HIDDEN_PATH, IS_VETO_PATH macros. trans2.c: Removed redundent snum parameters. util.c: Added standard_sub_basic changes from Stefaan A Eeckels and Paul Rippin Fixed up veto/hidden path processing so the paths are pres-parsed and checked for wildcards (for speed). Jeremy (jallison@whistle.com) (This used to be commit 9afa36f7874cfd527aa6ef1e7965c1d35d46ab1f) --- source3/include/includes.h | 25 +++++++++++-------------- source3/include/proto.h | 15 ++++++++------- source3/include/smb.h | 15 ++++++++++++--- 3 files changed, 31 insertions(+), 24 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 7dcff54286..35112ff70b 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -666,38 +666,35 @@ char *mktemp(char *); /* No standard include */ #include #ifdef EVEREST #include -#endif +#endif /* EVEREST */ #ifdef NETGROUP #include -#endif +#endif /* NETGROUP */ #ifdef SecureWare #include #include #include #define crypt bigcrypt -#endif -#ifndef EVEREST - #define ftruncate(f,l) syscall(0x0a28,f,l) -#endif +#endif /* SecureWare */ #define SIGNAL_CAST (void (*)(int)) #define USE_WAITPID #define USE_GETCWD #define USE_SETSID #ifdef SCO3_2_2 -#define NO_EID -#else +#define setuid(u) setreuid(u,-1) +#define seteuid(u) setreuid(-1,u) +#else /* SCO3_2_2 */ #ifndef EVEREST +#define ftruncate(f,l) syscall(0x0a28,f,l) #define USE_IFREQ -#endif -#endif +#define NO_INITGROUPS +#endif /* EVEREST */ +#endif /* SCO3_2_2 */ #define STATFS4 #define NO_FSYNC -#ifndef EVEREST -#define NO_INITGROUPS -#endif #define HAVE_PATHCONF #define NO_GETRLIMIT -#endif +#endif /* SCO */ diff --git a/source3/include/proto.h b/source3/include/proto.h index e9994214fb..6d248e2333 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -74,13 +74,13 @@ void dptr_closecnum(int cnum); void dptr_idlecnum(int cnum); void dptr_closepath(char *path,int pid); int dptr_create(int cnum,char *path, BOOL expect_close,int pid); -BOOL dptr_fill(int snum, char *buf1,unsigned int key); +BOOL dptr_fill(char *buf1,unsigned int key); BOOL dptr_zero(char *buf); -void *dptr_fetch(int snum, char *buf,int *num); -void *dptr_fetch_lanman2(int snum, char *params,int dptr_num); -BOOL dir_check_ftype(int cnum,int mode,struct stat *st,int dirtype); +void *dptr_fetch(char *buf,int *num); +void *dptr_fetch_lanman2(char *params,int dptr_num); +BOOL dir_check_ftype(int cnum, int mode,struct stat *st,int dirtype); BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend); -void *OpenDir(int snum, char *name, BOOL use_veto); +void *OpenDir(int cnum, char *name, BOOL use_veto); void CloseDir(void *p); char *ReadDirName(void *p); BOOL SeekDir(void *p,int pos); @@ -954,8 +954,9 @@ char *gidtoname(int gid); void BlockSignals(BOOL block,int signum); void ajt_panic(void); char *readdirname(void *p); -BOOL is_hidden_path(int snum, char *name); -BOOL is_vetoed_name(int snum, char *name); +BOOL is_in_path(char *name, name_compare_entry *namelist); +void set_namearray(name_compare_entry **ppname_array, char *namelist); +void free_namearray(name_compare_entry *name_array); BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); int file_lock(char *name,int timeout); void file_unlock(int fd); diff --git a/source3/include/smb.h b/source3/include/smb.h index 1d53942fa7..c7ff549fe5 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -337,6 +337,12 @@ struct uid_cache { int list[UID_CACHE_SIZE]; }; +typedef struct +{ + char *name; + BOOL is_wild; +} name_compare_entry; + typedef struct { int service; @@ -363,6 +369,8 @@ typedef struct time_t lastused; BOOL used; int num_files_open; + name_compare_entry *hide_list; /* Per-share list of files to return as hidden. */ + name_compare_entry *veto_list; /* Per-share list of files to veto (never show). */ } connection_struct; @@ -483,6 +491,7 @@ struct connect_record #define VALID_CNUM(cnum) (((cnum) >= 0) && ((cnum) < MAX_CONNECTIONS)) #define OPEN_CNUM(cnum) (VALID_CNUM(cnum) && Connections[cnum].open) #define IS_IPC(cnum) (VALID_CNUM(cnum) && Connections[cnum].ipc) +#define IS_PRINT(cnum) (VALID_CNUM(cnum) && Connections[cnum].printer) #define FNUM_OK(fnum,c) (OPEN_FNUM(fnum) && (c)==Files[fnum].cnum) #define CHECK_FNUM(fnum,c) if (!FNUM_OK(fnum,c)) \ @@ -512,6 +521,9 @@ struct connect_record #define MAP_HIDDEN(cnum) (OPEN_CNUM(cnum) && lp_map_hidden(SNUM(cnum))) #define MAP_SYSTEM(cnum) (OPEN_CNUM(cnum) && lp_map_system(SNUM(cnum))) #define MAP_ARCHIVE(cnum) (OPEN_CNUM(cnum) && lp_map_archive(SNUM(cnum))) +#define IS_HIDDEN_PATH(cnum,path) (is_in_path((path),Connections[(cnum)].hide_list)) +#define IS_VETO_PATH(cnum,path) (is_in_path((path),Connections[(cnum)].veto_list)) + #ifdef SMB_PASSWD #define SMBENCRYPT() (lp_encrypted_passwords()) #else @@ -916,7 +928,4 @@ enum case_handling {CASE_LOWER,CASE_UPPER}; /* Size of buffer to use when moving files across filesystems. */ #define COPYBUF_SIZE (8*1024) -/* service-based parameter - files are not visible, but are accessible */ -#define DEFAULT_FILES_TO_HIDE ".*" - /* _SMB_H */ -- cgit From 1fa6244b2972ee4e440d02c5005e440b275ae2a2 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 24 Jul 1997 20:16:07 +0000 Subject: removed definition of strslashcmp - now a static in clitar.c. Jeremy (jallison@whistle.com) (This used to be commit 83448e7a1176b68ed90532a69b4408cd579db8d8) --- source3/include/proto.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 6d248e2333..bcd3a426dc 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -51,7 +51,6 @@ char *smb_errstr(char *inbuf); /*The following definitions come from clitar.c */ -int strslashcmp(char *s1,char *s2); int padit(char *buf, int bufsize, int padsize); void cmd_block(void); void cmd_tarmode(void); -- cgit From 7950c5e87082f4292780b0b1571c5111b291e39e Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 24 Jul 1997 20:39:30 +0000 Subject: nameserv.c: split add_domain_names() into three functions: add_domain_logon_names() - adds <1c> names on WINS and broadcast. add_domain_master_wins() - adds <1b> name only with WINS server add_domain_master_bcast() - adds <1b> names only by bcast. : made add_domain_names() add <1c> names, unconditionally, and add <1b> name with the WINS server if using a WINS server, or add <1b> name by broadcast if _not_ using a WINS server, but _not_ both. : removed the direct parameter from remove_name_entry() and add_my_name_entry(). nameelect.c: made become_domain_master(), on successful registration of the <1b> name with the WINS server, go ahead and register the <1b> names by broadcast. if the <1b> name is _not_ successfully registered with the WINS server, the broadcast registration of <1b> names will _not_ proceed. namedbsubnet.c: sorted out calls to add_my_name_entry() and remove_my_name() which no longer has a direct parameter. this is all added because... in order to fix a compatibility bug with 1.9.16p2->p11, jeremy had added a feature that got the <1b> broadcast registered names _directly_ into the nmbd netbios lists, undefended. the aim was to get round the aggressive netbios registration of <1b> names of 1.9.16p2->p11. however, because 1.9.16p2->p11 don't properly _provide_ netlogon services, it is better that an error message appears in 1.9.17 logs, and that administrators are made aware of the problems with 1.9.16p2->p11, and replace 1.9.16p2->p11 servers, rather than attempt to run 1.9.16 alonside 1.9.17. (these warning messages will need to be added...) in _addition_, they shouldn't _be_ getting two samba servers to provide domain logon / domain master services for the same workgroup in the same WINS scope! lkcl (This used to be commit 5a668ff7ba83433b5eaa9f7d03a42573ee26caf9) --- source3/include/proto.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index bcd3a426dc..7b634d15f5 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -14,7 +14,7 @@ int interpret_character_set(char *str, int def); /*The following definitions come from charset.c */ -void charset_initialise(void); +void charset_initialise(); void codepage_initialise(int client_codepage); void add_char_string(char *s); @@ -51,6 +51,7 @@ char *smb_errstr(char *inbuf); /*The following definitions come from clitar.c */ +int strslashcmp(char *s1, char *s2); int padit(char *buf, int bufsize, int padsize); void cmd_block(void); void cmd_tarmode(void); @@ -77,7 +78,7 @@ BOOL dptr_fill(char *buf1,unsigned int key); BOOL dptr_zero(char *buf); void *dptr_fetch(char *buf,int *num); void *dptr_fetch_lanman2(char *params,int dptr_num); -BOOL dir_check_ftype(int cnum, int mode,struct stat *st,int dirtype); +BOOL dir_check_ftype(int cnum,int mode,struct stat *st,int dirtype); BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend); void *OpenDir(int cnum, char *name, BOOL use_veto); void CloseDir(void *p); @@ -493,8 +494,11 @@ struct response_record *queue_netbios_packet(struct subnet_record *d, /*The following definitions come from nameserv.c */ -void remove_name_entry(struct subnet_record *d, char *name,int type, BOOL direct); -void add_my_name_entry(struct subnet_record *d,char *name,int type,int nb_flags, BOOL direct); +void remove_name_entry(struct subnet_record *d, char *name,int type); +void add_my_name_entry(struct subnet_record *d,char *name,int type,int nb_flags); +void add_domain_logon_names(void); +void add_domain_master_bcast(void); +void add_domain_master_wins(void); void add_domain_names(time_t t); void add_my_names(void); void remove_my_names(); @@ -719,7 +723,7 @@ void close_cnum(int cnum, uint16 vuid); BOOL yield_connection(int cnum,char *name,int max_connections); BOOL claim_connection(int cnum,char *name,int max_connections,BOOL Clear); void exit_server(char *reason); -void standard_sub(int cnum,char *s); +void standard_sub(int cnum,char *string); char *smb_fn_name(int type); int chain_reply(char *inbuf,char *outbuf,int size,int bufsize); int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); @@ -737,9 +741,6 @@ BOOL smb_shm_unlock_hash_entry( unsigned int entry ); BOOL smb_shm_get_usage(int *bytes_free, int *bytes_used, int *bytes_overhead); -smb_shm_offset_t smb_shm_alloc(int size); -smb_shm_offset_t smb_shm_addr2offset(void *addr); -smb_shm_offset_t smb_shm_get_userdef_off(void); /*The following definitions come from smbencrypt.c */ @@ -898,7 +899,7 @@ BOOL strhaslower(char *s); int count_chars(char *s,char c); void make_dir_struct(char *buf,char *mask,char *fname,unsigned int size,int mode,time_t date); void close_low_fds(void); -int set_blocking(int fd, int set); +int set_blocking(int fd, BOOL set); int write_socket(int fd,char *buf,int len); int read_udp_socket(int fd,char *buf,int len); int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out); @@ -943,7 +944,7 @@ BOOL zero_ip(struct in_addr ip); void reset_globals_after_fork(); char *client_name(void); char *client_addr(void); -void standard_sub_basic(char *s); +void standard_sub_basic(char *string); BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask); int PutUniCode(char *dst,char *src); struct hostent *Get_Hostbyname(char *name); -- cgit From da0ca0a7cb21d1de8a37d28ac9872078ca4489e9 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 24 Jul 1997 23:29:52 +0000 Subject: Re-added shm stuff - keeps getting lost. Jeremy (jallison@whistle.com) (This used to be commit 4fad0a63aa6712775610f7d341ba243e6353ce3b) --- source3/include/proto.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 7b634d15f5..4b7b48f50b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -51,7 +51,6 @@ char *smb_errstr(char *inbuf); /*The following definitions come from clitar.c */ -int strslashcmp(char *s1, char *s2); int padit(char *buf, int bufsize, int padsize); void cmd_block(void); void cmd_tarmode(void); @@ -730,6 +729,9 @@ int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); /*The following definitions come from shmem.c */ +smb_shm_offset_t smb_shm_alloc(int size); +smb_shm_offset_t smb_shm_addr2offset(void *addr); +smb_shm_offset_t smb_shm_get_userdef_off(void); BOOL smb_shm_create_hash_table( unsigned int size ); BOOL smb_shm_open( char *file_name, int size); BOOL smb_shm_close( void ); -- cgit From 7314126d9e1d84997d818166f27e2076d55ff04e Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Mon, 28 Jul 1997 18:59:57 +0000 Subject: client.c: Added amanda fixes. clitar.c: Added amanda fixes. nameannounce.c: Removed redundent code. nameelect.c: Removed redundent code. nameserv.h: Removed redundent code. nameservresp.c: Removed redundent code. namework.c: Removed redundent code. password.c: Prevented crash if getpwnam fails. Jeremy (jallison@whistle.com) (This used to be commit 760fe30353de66e8e6571f8ff4ec1064261b5428) --- source3/include/nameserv.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index ae59f95252..8482fa8d2c 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -117,7 +117,6 @@ enum state_type NAME_REGISTER, NAME_RELEASE, NAME_QUERY_CONFIRM, - NAME_QUERY_ANNOUNCE_HOST, NAME_QUERY_SYNC_LOCAL, NAME_QUERY_SYNC_REMOTE, NAME_QUERY_DOM_SRV_CHK, -- cgit From 75bbf35a8626ea30ac31546d0ceb9e2801ab7eae Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 30 Jul 1997 19:17:51 +0000 Subject: client.c: Minor change to cast parameters for DEC unix. clientutil.c: Minor change to cast parameters for DEC unix. ipc.c: Fixes to parameterise the stuff John wants. loadparm.c: Fixes to parameterise the stuff John wants. nameannounce.c: Fixes to parameterise the stuff John wants. namedbwork.c: Fixes to parameterise the stuff John wants. nameserv.h: Fixes to parameterise the stuff John wants. proto.h: Fixes to parameterise the stuff John wants. smb.h: Fixes to parameterise the stuff John wants. util.c: tidy. Jeremy (jallison@whistle.com) (This used to be commit 9fbca2594ba775450d5dca13cbce257b4362ca66) --- source3/include/nameserv.h | 9 ++++----- source3/include/proto.h | 3 +++ source3/include/smb.h | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 8482fa8d2c..83f3a3c524 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -408,11 +408,10 @@ struct packet_struct /* do all remote announcements this often */ #define REMOTE_ANNOUNCE_INTERVAL 180 -#define DFLT_SERVER_TYPE (SV_TYPE_WORKSTATION | SV_TYPE_SERVER | \ - (lp_time_server() ? SV_TYPE_TIME_SOURCE : 0) | \ - SV_TYPE_SERVER_UNIX | \ - SV_TYPE_PRINTQ_SERVER | SV_TYPE_SERVER_NT | \ - SV_TYPE_NT ) +/* Types of machine we can announce as */ +#define ANNOUNCE_AS_NT 1 +#define ANNOUNCE_AS_WIN95 2 +#define ANNOUNCE_AS_WFW 3 /* Macro's to enumerate subnets either with or without the WINS subnet. */ diff --git a/source3/include/proto.h b/source3/include/proto.h index 4b7b48f50b..23f7f191fb 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -267,6 +267,9 @@ BOOL lp_load(char *pszFname,BOOL global_only); int lp_numservices(void); void lp_dump(void); int lp_servicenumber(char *pszServiceName); +int lp_default_server_announce(void); +int lp_major_announce_version(void); +int lp_minor_announce_version(void); char *volume_label(int snum); /*The following definitions come from locking.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index c7ff549fe5..2b6888b8a7 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -844,8 +844,8 @@ char *Strstr(char *s, char *p); /* - Reappeared in 1.9.16p11 with fixed smbd services */ /* Version 4.20 - To indicate that nmbd and browsing now works better */ -#define MAJOR_VERSION 0x04 -#define MINOR_VERSION 0x02 +#define DEFAULT_MAJOR_VERSION 0x04 +#define DEFAULT_MINOR_VERSION 0x02 /* Browser Election Values */ #define BROWSER_ELECTION_VERSION 0x010f -- cgit From 363b9a2739e9e39d1f69625e6647c6c9047a901a Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 31 Jul 1997 18:47:26 +0000 Subject: loadparm.c: Added new netbios aliases parameter (code from Cisco) nameannounce.c: Code to announce aliases as well as our own names. namedbsubnet.c: Code to add the aliases to the server list. nameserv.c: Code to defend our aliases on the namelist. namework.c: Code to check it's one of our aliases. nmbd.c: Code to initialise the aliases. proto.h: Fixup protos. util.c: Code to check it's one of our aliases. All above code based on code for 1.9.16p11 donated by Cisco from Ben Woodard Jeremy (jallison@whistle.com) (This used to be commit a2ce1c0cb1331551ff728dcfe3260fab4cd827e5) --- source3/include/proto.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 23f7f191fb..0fa4251b82 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -146,6 +146,7 @@ char *lp_wins_server(void); char *lp_interfaces(void); char *lp_socket_address(void); char *lp_nis_home_map_name(void); +char *lp_netbios_aliases(void); BOOL lp_dns_proxy(void); BOOL lp_wins_support(void); BOOL lp_wins_proxy(void); @@ -871,8 +872,8 @@ uint32 file_size(char *file_name); char *attrib_string(int mode); int StrCaseCmp(const char *s, const char *t); int StrnCaseCmp(const char *s, const char *t, int n); -BOOL strequal(char *s1,char *s2); -BOOL strnequal(char *s1,char *s2,int n); +BOOL strequal(const char *s1,const char *s2); +BOOL strnequal(const char *s1,const char *s2,int n); BOOL strcsequal(char *s1,char *s2); void strlower(char *s); void strupper(char *s); @@ -965,6 +966,7 @@ void free_namearray(name_compare_entry *name_array); BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); int file_lock(char *name,int timeout); void file_unlock(int fd); +BOOL is_myname(const char *s); /*The following definitions come from vt_mode.c */ -- cgit From b65fdef1ba6a9a0a27da724a8324a6f2804759cf Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 13 Aug 1997 20:16:32 +0000 Subject: includes.h: Fixed S_IFLNK for old DEC ultrix. ipc.c: Finally :-) fixed responses to NetServerEnum2 when SV_TYPE_ALL given. Jeremy (jallison@whistle.com) (This used to be commit 1dc37c83506a434840a04c49e423cd9d2223fab4) --- source3/include/includes.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 35112ff70b..03c2d461e6 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -1105,6 +1105,10 @@ extern char *sys_errlist[]; #define S_ISDIR(x) ((S_IFDIR & x)!=0) #endif +#if !defined(S_ISLNK) && defined(S_IFLNK) +#define S_ISLNK(x) ((S_IFLNK & x)!=0) +#endif + #ifdef UFC_CRYPT #define crypt ufc_crypt #endif -- cgit From 8df30387b56c406037c15fcb10b38351a414884f Mon Sep 17 00:00:00 2001 From: John Terpstra Date: Mon, 18 Aug 1997 04:32:17 +0000 Subject: JHT ===> Just making sure any new tests do not announce as the last alpha! (This used to be commit f75e7ab927deebcf67626329f6233b87a779fbf3) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 20486854f5..4057b4b774 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.17alpha5" +#define VERSION "1.9.17alpha6" -- cgit From e9269c67a59ffa741123cb2ce3ab8dfb97136dec Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 19 Aug 1997 19:22:26 +0000 Subject: Makefile: Changed for HPUX10 tidyup. includes.h: Changed for HPUX10 tidyup. ipc.c: Fixed bug where getting local server list from NT browsers would fail. nmbsync.c: Fixed bug where getting local server list from NT browsers would fail. proto.h: Changed for crash bug on SCO with USE_MMAP. quotas.c: Added OSF quotas (patch from Bret Giddings ). Rolled back solaris uid change - I think it was wrong. reply.c: Changed for crash bug on SCO with USE_MMAP. server.c: Removed Lukes changes. Changed for crash bug on SCO with USE_MMAP. smb.h: Changed for crash bug on SCO with USE_MMAP. smbpasswd.c:Fixed crash bug with Lukes changes. uid.c: Removed Lukes changes. util.c: Fixed I18N bug with extended char filenames and widelinks = no. Jeremy (jallison@whistle.com) (This used to be commit bf1c79f7fd7f9beec4f9f4e58337cadceeb1cb38) --- source3/include/includes.h | 4 +++- source3/include/proto.h | 4 ++-- source3/include/smb.h | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 03c2d461e6..15a5e74e46 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -541,7 +541,9 @@ char *mktemp(char *); /* No standard include */ #define NEED_AUTH_PARAMETERS #endif #define SIGNAL_CAST (void (*)(__harg)) +#ifndef HPUX10 /* This is only needed for HPUX 9.x */ #define SELECT_CAST (int *) +#endif /* HPUX10 */ #define SYSV #define USE_WAITPID #define WAIT3_CAST2 (int *) @@ -550,7 +552,7 @@ char *mktemp(char *); /* No standard include */ #define USE_SETRES #define DEFAULT_PRINTING PRINT_HPUX #define SIGCLD_IGNORE -#endif +#endif /* HPUX */ #ifdef SEQUENT diff --git a/source3/include/proto.h b/source3/include/proto.h index 0fa4251b82..56bdbfe865 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -703,8 +703,8 @@ void close_file(int fnum); BOOL check_file_sharing(int cnum,char *fname); void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun, int mode,int *Access,int *action); -int seek_file(int fnum,int pos); -int read_file(int fnum,char *data,int pos,int n); +int seek_file(int fnum,uint32 pos); +int read_file(int fnum,char *data,uint32 pos,int n); int write_file(int fnum,char *data,int n); BOOL become_service(int cnum,BOOL do_chdir); int find_service(char *service); diff --git a/source3/include/smb.h b/source3/include/smb.h index 2b6888b8a7..0f2dc01865 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -314,11 +314,11 @@ typedef struct int cnum; file_fd_struct *fd_ptr; int pos; - int size; + uint32 size; int mode; int uid; char *mmap_ptr; - int mmap_size; + uint32 mmap_size; write_bmpx_struct *wbmpx_ptr; struct timeval open_time; BOOL open; -- cgit From 46dbd8c06009ad9e64251ae844fb16f2a30f5ab7 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 20 Aug 1997 20:32:23 +0000 Subject: Changes to allow Samba to return the same error code as Windows NT. Takes care of the cases where a Windows program is parsing a pathname component by component and expects 2 different errors. ERRbadpath - if a component in the path doesn't exist. ERRbaddirectory - if a component in the path exists but is not a directory. Extra error code added to smb.h to support this. Code based on suggestions from "Christian Groessler" . Jeremy (jallison@whistle.com) (This used to be commit 28b3c6db8a81b41b448a4f3cd98e9cd2c4b5fb2e) --- source3/include/proto.h | 2 +- source3/include/smb.h | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 56bdbfe865..f716c1f9a9 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -691,7 +691,7 @@ void killkids(void); mode_t unix_mode(int cnum,int dosmode); int dos_mode(int cnum,char *path,struct stat *sbuf); int dos_chmod(int cnum,char *fname,int dosmode,struct stat *st); -BOOL unix_convert(char *name,int cnum,pstring saved_last_component); +BOOL unix_convert(char *name,int cnum,pstring saved_last_component, BOOL *bad_path); int disk_free(char *path,int *bsize,int *dfree,int *dsize); int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); BOOL check_name(char *name,int cnum); diff --git a/source3/include/smb.h b/source3/include/smb.h index 0f2dc01865..1dbe04abc8 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -175,14 +175,15 @@ implemented */ #define ERRbadshare 32 /* Share mode on file conflict with open mode */ #define ERRlock 33 /* Lock request conflicts with existing lock */ #define ERRfilexists 80 /* File in operation already exists */ +#define ERRunknownlevel 124 #define ERRbadpipe 230 /* Named pipe invalid */ #define ERRpipebusy 231 /* All instances of pipe are busy */ #define ERRpipeclosing 232 /* named pipe close in progress */ #define ERRnotconnected 233 /* No process on other end of named pipe */ #define ERRmoredata 234 /* More data to be returned */ +#define ERRbaddirectory 267 /* Invalid directory name in a path. */ #define ERROR_EAS_DIDNT_FIT 275 /* Extended attributes didn't fit */ #define ERROR_EAS_NOT_SUPPORTED 282 /* Extended attributes not suppored */ -#define ERRunknownlevel 124 #define ERRunknownipc 2142 @@ -928,4 +929,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER}; /* Size of buffer to use when moving files across filesystems. */ #define COPYBUF_SIZE (8*1024) +/* Integers used to override error codes. */ +extern int unix_ERR_class; +extern int unix_ERR_code; /* _SMB_H */ -- cgit From bce14d3642ca510c2237d3b39da47099207752c8 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 21 Aug 1997 20:03:45 +0000 Subject: Kanji fixes for upper/lower case conversion with sjis characters. Code from Takashi Fujita . Jeremy (jallison@whistle.com) (This used to be commit 07f7e378c4839d0ca4bb79c8755481f4bf5637de) --- source3/include/kanji.h | 17 +++++++++++++++++ source3/include/proto.h | 1 + 2 files changed, 18 insertions(+) (limited to 'source3/include') diff --git a/source3/include/kanji.h b/source3/include/kanji.h index ee3ba7e09a..865ac3b2c9 100644 --- a/source3/include/kanji.h +++ b/source3/include/kanji.h @@ -22,6 +22,7 @@ and extend coding system to EUC/SJIS/JIS/HEX at 1994.10.11 and add all jis codes sequence at 1995.8.16 Notes: Hexadecimal code by + and add upper/lower case conversion 1997.8.21 */ #ifndef _KANJI_H_ #define _KANJI_H_ @@ -37,6 +38,22 @@ && ((unsigned char) (c)) != 0x7f) #define is_kana(c) ((0xa0 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0xdf)) +/* case conversion */ +#define is_sj_upper2(c) \ + ((0x60 <= (unsigned char) (c)) && ((unsigned char) (c) <= 0x79)) +#define is_sj_lower2(c) \ + ((0x81 <= (unsigned char) (c)) && ((unsigned char) (c) <= 0x9A)) +#define sjis_alph 0x82 +#define is_sj_alph(c) (sjis_alph == (unsigned char) (c)) +#define is_sj_upper(c1, c2) (is_sj_alph (c1) && is_sj_upper2 (c2)) +#define is_sj_lower(c1, c2) (is_sj_alph (c1) && is_sj_lower2 (c2)) +#define sj_toupper2(c) \ + (is_sj_lower2 (c) ? ((int) ((unsigned char) (c) - 0x81 + 0x60)) : \ + ((int) (unsigned char) (c))) +#define sj_tolower2(c) \ + (is_sj_upper2 (c) ? ((int) ((unsigned char) (c) - 0x60 + 0x81)) : \ + ((int) (unsigned char) (c))) + #ifdef _KANJI_C_ /* FOR EUC CODE */ #define euc_kana (0x8e) diff --git a/source3/include/proto.h b/source3/include/proto.h index f716c1f9a9..9f05e5bbff 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -794,6 +794,7 @@ int sys_chdir(char *dname); int sys_utime(char *fname,struct utimbuf *times); int sys_rename(char *from, char *to); int sys_chmod(char *fname,int mode); +char *sys_getwd(char *s); int sys_chown(char *fname,int uid,int gid); int sys_chroot(char *dname); struct hostent *sys_gethostbyname(char *name); -- cgit From 4c319ad04699b236d038d141323c7586c5bf0983 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Mon, 25 Aug 1997 22:18:31 +0000 Subject: charset.c : Add mapping for code page 932 (KANJI). client.c : Fix crash bug. Add code to use BUFFER_SIZE for NetServerEnum calls. namepacket.c: Fixed cast. nmbsync.c : Add code to use BUFFER_SIZE for NetServerEnum calls. smb.h : Set default client code page to 932 for KANJI. system.c : Remove vendor specific code that crept in :-). util.c : Added #define to allow Samba to behave as Win95 when doing KANJI case insensitivity tests. Jeremy (jallison@whistle.com) (This used to be commit 7f7d2faa07b81ad435b2acc9318bc39d813020c6) --- source3/include/smb.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 1dbe04abc8..540aa0798d 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -923,8 +923,13 @@ enum case_handling {CASE_LOWER,CASE_UPPER}; #endif +#ifdef KANJI +/* Default client code page - 932 - Japanese */ +#define DEFAULT_CLIENT_CODE_PAGE 932 +#else /* KANJI */ /* Default client code page - 850 - Western European */ #define DEFAULT_CLIENT_CODE_PAGE 850 +#endif /* KANJI */ /* Size of buffer to use when moving files across filesystems. */ #define COPYBUF_SIZE (8*1024) -- cgit From 41bbc5e21fbac555b26bd751dd93d09969715199 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 26 Aug 1997 01:28:27 +0000 Subject: smb.h: Added error code used for OS2 WPS. trans2.c: Added OS2 WPS fix - but ifdefed out for now. Will turn on after 1.9.17 release. Jeremy (jallison@whistle.com) (This used to be commit 9d5d347686ca1c8a25088b882dcc5065b6d9c564) --- source3/include/smb.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 540aa0798d..f0390230e5 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -175,6 +175,7 @@ implemented */ #define ERRbadshare 32 /* Share mode on file conflict with open mode */ #define ERRlock 33 /* Lock request conflicts with existing lock */ #define ERRfilexists 80 /* File in operation already exists */ +#define ERRcannotopen 110 /* Cannot open the file specified */ #define ERRunknownlevel 124 #define ERRbadpipe 230 /* Named pipe invalid */ #define ERRpipebusy 231 /* All instances of pipe are busy */ @@ -183,7 +184,7 @@ implemented */ #define ERRmoredata 234 /* More data to be returned */ #define ERRbaddirectory 267 /* Invalid directory name in a path. */ #define ERROR_EAS_DIDNT_FIT 275 /* Extended attributes didn't fit */ -#define ERROR_EAS_NOT_SUPPORTED 282 /* Extended attributes not suppored */ +#define ERROR_EAS_NOT_SUPPORTED 282 /* Extended attributes not supported */ #define ERRunknownipc 2142 -- cgit From c416e6766c8ffe3a2b360432eff6b1993246dbb1 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 26 Aug 1997 01:55:56 +0000 Subject: preparing for release of 1.9.17 (This used to be commit d84c84641b14ad264c33fc37aa9a1abdf3e04254) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 4057b4b774..56ee92c13f 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.17alpha6" +#define VERSION "1.9.17" -- cgit From 38dc53828e6e9a3ba9589c722fba40a4df167d75 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 27 Aug 1997 19:27:25 +0000 Subject: doing that irritating compiler clash warning with the protos for standard_sub and standard_sub_basic. again. lkcl (This used to be commit b60ef755cf594ee9751660467709ea4f7a669a2c) --- source3/include/proto.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 9f05e5bbff..b9600e0b1e 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -51,6 +51,7 @@ char *smb_errstr(char *inbuf); /*The following definitions come from clitar.c */ +int strslashcmp(char *s1, char *s2); int padit(char *buf, int bufsize, int padsize); void cmd_block(void); void cmd_tarmode(void); @@ -146,6 +147,7 @@ char *lp_wins_server(void); char *lp_interfaces(void); char *lp_socket_address(void); char *lp_nis_home_map_name(void); +char *lp_announce_version(void); char *lp_netbios_aliases(void); BOOL lp_dns_proxy(void); BOOL lp_wins_support(void); @@ -189,6 +191,7 @@ int lp_maxdisksize(void); int lp_lpqcachetime(void); int lp_syslog(void); int lp_client_code_page(void); +int lp_announce_as(void); char *lp_preexec(int ); char *lp_postexec(int ); char *lp_rootpreexec(int ); @@ -268,10 +271,10 @@ BOOL lp_load(char *pszFname,BOOL global_only); int lp_numservices(void); void lp_dump(void); int lp_servicenumber(char *pszServiceName); +char *volume_label(int snum); int lp_default_server_announce(void); int lp_major_announce_version(void); int lp_minor_announce_version(void); -char *volume_label(int snum); /*The following definitions come from locking.c */ @@ -620,6 +623,7 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); +BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); /*The following definitions come from replace.c */ @@ -726,16 +730,13 @@ void close_cnum(int cnum, uint16 vuid); BOOL yield_connection(int cnum,char *name,int max_connections); BOOL claim_connection(int cnum,char *name,int max_connections,BOOL Clear); void exit_server(char *reason); -void standard_sub(int cnum,char *string); +void standard_sub(int cnum,char *str); char *smb_fn_name(int type); int chain_reply(char *inbuf,char *outbuf,int size,int bufsize); int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); /*The following definitions come from shmem.c */ -smb_shm_offset_t smb_shm_alloc(int size); -smb_shm_offset_t smb_shm_addr2offset(void *addr); -smb_shm_offset_t smb_shm_get_userdef_off(void); BOOL smb_shm_create_hash_table( unsigned int size ); BOOL smb_shm_open( char *file_name, int size); BOOL smb_shm_close( void ); @@ -873,7 +874,7 @@ uint32 file_size(char *file_name); char *attrib_string(int mode); int StrCaseCmp(const char *s, const char *t); int StrnCaseCmp(const char *s, const char *t, int n); -BOOL strequal(const char *s1,const char *s2); +BOOL strequal(const char *s1, const char *s2); BOOL strnequal(const char *s1,const char *s2,int n); BOOL strcsequal(char *s1,char *s2); void strlower(char *s); @@ -951,7 +952,7 @@ BOOL zero_ip(struct in_addr ip); void reset_globals_after_fork(); char *client_name(void); char *client_addr(void); -void standard_sub_basic(char *string); +void standard_sub_basic(char *str); BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask); int PutUniCode(char *dst,char *src); struct hostent *Get_Hostbyname(char *name); -- cgit From 7df4b93bed4f4e8e96d44fed7daa9985ebab8862 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 27 Aug 1997 19:53:03 +0000 Subject: Put back the smb_shm_ proto's that Luke keeps breaking ! Jeremy (jallison@whistle.com) (This used to be commit 660a3ef70c36e6675c8cc63b97e9d251428f9b40) --- source3/include/proto.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index b9600e0b1e..8faa3201dc 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -748,6 +748,9 @@ BOOL smb_shm_unlock_hash_entry( unsigned int entry ); BOOL smb_shm_get_usage(int *bytes_free, int *bytes_used, int *bytes_overhead); +smb_shm_offset_t smb_shm_alloc(int size); +smb_shm_offset_t smb_shm_addr2offset(void *addr); +smb_shm_offset_t smb_shm_get_userdef_off(void); /*The following definitions come from smbencrypt.c */ -- cgit From 7971fb1febc67a845cde6bbb9b92842aa0a283ce Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 27 Aug 1997 20:20:58 +0000 Subject: charset.c: Added patch for client code page 852 (Eastern European) from Leos Bitto . clitar.c: proto.h: Fixed proto mismatch for strslashcmp(). Jermey (jallison@netcom.com) (This used to be commit c7a4647b7a84641f5fed6b67d45c241fff19c2b3) --- source3/include/proto.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 8faa3201dc..65287ff595 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -51,7 +51,6 @@ char *smb_errstr(char *inbuf); /*The following definitions come from clitar.c */ -int strslashcmp(char *s1, char *s2); int padit(char *buf, int bufsize, int padsize); void cmd_block(void); void cmd_tarmode(void); -- cgit From 473c42a194d07581941d61cf30aaf0122213cfd7 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 28 Aug 1997 20:59:51 +0000 Subject: includes.h: Make sure REPLACE_GETPASS are wrapped with #ifdefs. nmbsync.c: Make sure REPLACE_GETPASS is defined before including includes.h clientutil.c: Catch null passwords. Fixes for a nmbd crash bug found by Herb Lewis @ SGI. Jermey(jallison@whistle.com) (This used to be commit 45c266baaea8755f1a3c0c4c7a87eb0752848ca2) --- source3/include/includes.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 15a5e74e46..a63f8f8597 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -308,7 +308,9 @@ extern int innetgr (const char *, const char *, const char *, const char *); #define USE_STATVFS #define USE_GETCWD #define USE_SETSID +#ifndef REPLACE_GETPASS #define REPLACE_GETPASS +#endif /* REPLACE_GETPASS */ #define USE_SIGPROCMASK #endif @@ -459,7 +461,9 @@ char *mktemp(char *); /* No standard include */ #define NO_FSYNC #define USE_GETCWD #define USE_SETSID +#ifndef REPLACE_GETPASS #define REPLACE_GETPASS +#endif /* REPLACE_GETPASS */ #define NO_GETRLIMIT #endif /* CLIX */ -- cgit From 06dc98f220dba6d602010df235679c6584cba279 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 30 Aug 1997 01:30:25 +0000 Subject: Makefile: New program and support for dynamic codepage loading. charset.c: Dynamic codepage loading code. charset.h: Defines for file format. proto.h: Updated. Jeremy (jallison@whistle.com) (This used to be commit 550e98f2d49a101654b3abde278a7f7edf347ed8) --- source3/include/charset.h | 10 ++++++++++ source3/include/proto.h | 20 ++++++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/charset.h b/source3/include/charset.h index 5f5e2016ee..fb184897c0 100644 --- a/source3/include/charset.h +++ b/source3/include/charset.h @@ -63,3 +63,13 @@ extern void charset_initialise(void); #define issafe(c) (isalnum((c&0xff)) || strchr("-._",c)) #endif +/* Dynamic codepage files defines. */ + +/* Version id for dynamically loadable codepage files. */ +#define CODEPAGE_FILE_VERSION_ID 0x1 +/* Version 1 codepage file header size. */ +#define CODEPAGE_HEADER_SIZE 8 +/* Offsets for codepage file header entries. */ +#define CODEPAGE_VERSION_OFFSET 0 +#define CODEPAGE_CLIENT_CODEPAGE_OFFSET 2 +#define CODEPAGE_LENGTH_OFFSET 4 diff --git a/source3/include/proto.h b/source3/include/proto.h index 65287ff595..3a012d379a 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -295,6 +295,18 @@ int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, void del_share_mode(share_lock_token token, int fnum); BOOL set_share_mode(share_lock_token token,int fnum); +/*The following definitions come from make_smbcodepage.c */ + +void codepage_usage(const char *progname); +void read_line( char **buf, char *line_buf, int size); +int clean_data( char **buf, uint32 *size); +BOOL parse_byte(char *buf, unsigned char *bp); +BOOL parse_bool(char *buf, unsigned char *bp); +void parse_error(char *buf, char *msg); +int do_compile(int codepage, const char *input_file, const char *output_file); +int do_decompile( int codepage, const char *input_file, const char *output_file); +int main(int argc, char **argv); + /*The following definitions come from mangle.c */ int str_checksum(char *s); @@ -739,17 +751,17 @@ int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); BOOL smb_shm_create_hash_table( unsigned int size ); BOOL smb_shm_open( char *file_name, int size); BOOL smb_shm_close( void ); +smb_shm_offset_t smb_shm_alloc(int size); BOOL smb_shm_free(smb_shm_offset_t offset); +smb_shm_offset_t smb_shm_get_userdef_off(void); BOOL smb_shm_set_userdef_off(smb_shm_offset_t userdef_off); -void * smb_shm_offset2addr(smb_shm_offset_t offset); +void *smb_shm_offset2addr(smb_shm_offset_t offset); +smb_shm_offset_t smb_shm_addr2offset(void *addr); BOOL smb_shm_lock_hash_entry( unsigned int entry); BOOL smb_shm_unlock_hash_entry( unsigned int entry ); BOOL smb_shm_get_usage(int *bytes_free, int *bytes_used, int *bytes_overhead); -smb_shm_offset_t smb_shm_alloc(int size); -smb_shm_offset_t smb_shm_addr2offset(void *addr); -smb_shm_offset_t smb_shm_get_userdef_off(void); /*The following definitions come from smbencrypt.c */ -- cgit From 918cc5f033360508da21d61ca1358ba8c7f0700d Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 1 Sep 1997 18:34:00 +0000 Subject: use of recursion_available and recursion_desired flag in netbios responses. (This used to be commit 8235db6b4fbeced750c4c30edc84a61a35b39278) --- source3/include/proto.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 3a012d379a..5c770d7fcc 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -474,7 +474,9 @@ void initiate_netbios_packet(uint16 *id, int nb_flags,BOOL bcast,BOOL recurse, struct in_addr to_ip); void reply_netbios_packet(struct packet_struct *p1,int trn_id, - int rcode, int rcv_code, int opcode, BOOL recurse, + int rcode, int rcv_code, int opcode, + BOOL recursion_available, + BOOL recursion_desired, struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, char *data,int len); void queue_packet(struct packet_struct *packet); @@ -627,6 +629,8 @@ int get_printqueue(int snum,int cnum,print_queue_struct **queue, print_status_struct *status); void del_printqueue(int cnum,int snum,int jobid); void status_printjob(int cnum,int snum,int jobid,int status); +int printjob_encode(int snum, int job); +void printjob_decode(int jobid, int *snum, int *job); /*The following definitions come from quotas.c */ -- cgit From 82290216ad827c9f8f74ffd3aa6a37dca28174e1 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 3 Sep 1997 20:15:40 +0000 Subject: nameannounce.c nameresp.c nameserv.c nameservreply.c proto.h : Removed broadcast and recurse parameters in the queue_netbios_pkt_wins() call - they are not needed as they should always be 'false' and 'true' respectively. Also fixed a bug with secure name registration (WINS server code). server.c: Finally fixed problem with error 267 being returned to Win95. It is needed by NT. This is a horrid fix and I would appreciate a better one :-). Jeremy (jallison@whistle.com) (This used to be commit fa1305d1894a28331ba80d9de038ebf31ba902d6) --- source3/include/proto.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 5c770d7fcc..d1b28c860d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -502,7 +502,6 @@ struct response_record *queue_netbios_pkt_wins( int fd,int quest_type,enum state_type state, char *name,int name_type,int nb_flags, time_t ttl, int server_type, char *my_name, char *my_comment, - BOOL bcast,BOOL recurse, struct in_addr send_ip, struct in_addr reply_to_ip); struct response_record *queue_netbios_packet(struct subnet_record *d, int fd,int quest_type,enum state_type state,char *name, -- cgit From f5302af621d91536a72b437ae2b80f9dedb46920 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 4 Sep 1997 20:26:07 +0000 Subject: Fixed up determination of client type for PROTOCOL_NT1. Uses client capabilities bits in session_setup_and_X to decide. Made remote_arch an enum as well as a string, for easier use. Jeremy (jallison@whistle.com) (This used to be commit 99080705a2d0adcb25e1eecbe517a2fac2779baa) --- source3/include/proto.h | 2 ++ source3/include/smb.h | 2 ++ 2 files changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index d1b28c860d..15c9fa590b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -986,6 +986,8 @@ BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); int file_lock(char *name,int timeout); void file_unlock(int fd); BOOL is_myname(const char *s); +void set_remote_arch(enum remote_arch_types type); +enum remote_arch_types get_remote_arch(); /*The following definitions come from vt_mode.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index f0390230e5..b55c180f36 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -880,6 +880,8 @@ enum security_types {SEC_SHARE,SEC_USER,SEC_SERVER}; enum printing_types {PRINT_BSD,PRINT_SYSV,PRINT_AIX,PRINT_HPUX, PRINT_QNX,PRINT_PLP,PRINT_LPRNG}; +/* Remote architectures we know about. */ +enum remote_arch_types {RA_UNKNOWN, RA_WFWG, RA_OS2, RA_WIN95, RA_WINNT, RA_SAMBA}; /* case handling */ enum case_handling {CASE_LOWER,CASE_UPPER}; -- cgit From e81c4e902d33f1e1903d2ac1f285c7aa1840e5bc Mon Sep 17 00:00:00 2001 From: John Terpstra Date: Fri, 5 Sep 1997 22:18:16 +0000 Subject: JHT ===> Just setting version to 1.9.18alpha1 (This used to be commit e462cf2f1b498ba9eb00d3d2f9c299e7624a62fd) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 56ee92c13f..33c9d240ba 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.17" +#define VERSION "1.9.18alpha1" -- cgit From 6da700d77c85b25d181358c5b63222ac178f3c12 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 11 Sep 1997 02:19:35 +0000 Subject: prototype updates for new functions (This used to be commit dbf662436031759b205f0140223da6a1d08c16df) --- source3/include/proto.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 15c9fa590b..755ead7a52 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6,6 +6,12 @@ BOOL check_access(int snum); BOOL allow_access(char *deny_list,char *allow_list,char *cname,char *caddr); +/*The following definitions come from cgi.c */ + +void cgi_load_variables(void); +char *cgi_variable(char *name); +int cgi_boolean(char *name, int def); + /*The following definitions come from charcnv.c */ char *unix2dos_format(char *str,BOOL overwrite); @@ -263,14 +269,20 @@ BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir); int lp_add_service(char *pszService, int iDefaultService); BOOL lp_add_printer(char *pszPrintername, int iDefaultService); BOOL lp_file_list_changed(void); +BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue); +int lp_next_parameter(int snum, int *i, char *label, + char *value, int allparameters); BOOL lp_snum_ok(int iService); BOOL lp_loaded(void); void lp_killunused(BOOL (*snumused)(int )); BOOL lp_load(char *pszFname,BOOL global_only); int lp_numservices(void); -void lp_dump(void); +void lp_dump(FILE *f); int lp_servicenumber(char *pszServiceName); char *volume_label(int snum); +void lp_rename_service(int snum, char *new_name); +void lp_remove_service(int snum); +void lp_copy_service(int snum, char *new_name); int lp_default_server_announce(void); int lp_major_announce_version(void); int lp_minor_announce_version(void); @@ -1001,3 +1013,11 @@ int VT_Start(void); int VT_Output(char *Buffer); int VT_Input(char *Buffer,int Size); void VT_Process(void); + +/*The following definitions come from wsmbconf.c */ + +int main(int argc, char *argv[]); + +/*The following definitions come from wsmbstatus.c */ + +int main(int argc, char *argv[]); -- cgit From 30416c0b8a0f54f6cc1179c2e00860eaf5f58401 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 11 Sep 1997 20:17:32 +0000 Subject: charcnv.c client.c clitar.c kanji.c kanji.h loadparm.c mangle.c smb.h util.c: Big merge to allow KANJI support to be in the main binary without explicitly compiling with it. locking.c: Fix for smbstatus not being able to read files. namepacket.c: Removed unneccesary debug statement. trans2.c: Added Luke's proposed fix (ifdefed out until further testing). nmblookup.c: Fixed bug where query fails and status is done on bogus IP. Jeremy (jallison@whistle.com) (This used to be commit 9196255022ae8c51b527412747b324819bea2c13) --- source3/include/kanji.h | 9 --------- source3/include/smb.h | 8 +++++--- 2 files changed, 5 insertions(+), 12 deletions(-) (limited to 'source3/include') diff --git a/source3/include/kanji.h b/source3/include/kanji.h index 865ac3b2c9..1d2359baa9 100644 --- a/source3/include/kanji.h +++ b/source3/include/kanji.h @@ -27,8 +27,6 @@ #ifndef _KANJI_H_ #define _KANJI_H_ -#ifdef KANJI - /* FOR SHIFT JIS CODE */ #define is_shift_jis(c) \ ((0x81 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0x9f) \ @@ -110,9 +108,6 @@ extern char* (*_dos_to_unix) (const char *str, BOOL overwrite); extern char* (*_unix_to_dos) (const char *str, BOOL overwrite); -#define unix_to_dos (*_unix_to_dos) -#define dos_to_unix (*_dos_to_unix) - extern char *sj_strtok (char *s1, const char *s2); extern char *sj_strchr (const char *s, int c); extern char *sj_strrchr (const char *s, int c); @@ -137,11 +132,7 @@ extern char *sj_strstr (const char *s1, const char *s2); int interpret_coding_system (char *str, int def); -#else - #define unix_to_dos(x,y) unix2dos_format(x,y) #define dos_to_unix(x,y) dos2unix_format(x,y) -#endif /* not KANJI */ - #endif /* _KANJI_H_ */ diff --git a/source3/include/smb.h b/source3/include/smb.h index b55c180f36..47fbf32f83 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -926,14 +926,16 @@ enum case_handling {CASE_LOWER,CASE_UPPER}; #endif +/* Defines needed for multi-codepage support. */ +#define KANJI_CODEPAGE 932 + #ifdef KANJI -/* Default client code page - 932 - Japanese */ -#define DEFAULT_CLIENT_CODE_PAGE 932 +/* Default client code page - Japanese */ +#define DEFAULT_CLIENT_CODE_PAGE KANJI_CODEPAGE #else /* KANJI */ /* Default client code page - 850 - Western European */ #define DEFAULT_CLIENT_CODE_PAGE 850 #endif /* KANJI */ - /* Size of buffer to use when moving files across filesystems. */ #define COPYBUF_SIZE (8*1024) -- cgit From 33a003de4056532be0c9a199d4857b9da1b18034 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 14 Sep 1997 16:37:18 +0000 Subject: This commit does 3 main things: 1) put the encryption code in by default, with no #ifdef. It is still disabled by default so you need to add "encrypt passwords = yes" in smb.conf but at least all binaries will have it. 2) cleanup the kanji code so it compiles with no warnings 3) get rid of lots of uses of ugly non-portable C code. The main offender being things like "register" but also remove uses of the "const" keyword as there are compilers out there that don't support it and even those that do often complain about its usage. Users don't like warnings :-( There is still some work to do. We need to replace the md4 code with our own implementation. The current code (from rfc1186) is PD but is not very portable. The new RFC (rfc1320) is more portable but adds copyright restrictions. I'll do a from-scratch MD4 soon. We also need to test that what I've implemented is portable. It should be, but I'm too tired right now to test it on anything other than intel linux. (This used to be commit db917c62c14315afe6f0745a8097c1bca25cbf07) --- source3/include/kanji.h | 9 ++------- source3/include/proto.h | 30 ++++++++++++++++++++---------- source3/include/smb.h | 4 ---- 3 files changed, 22 insertions(+), 21 deletions(-) (limited to 'source3/include') diff --git a/source3/include/kanji.h b/source3/include/kanji.h index 1d2359baa9..cf30365920 100644 --- a/source3/include/kanji.h +++ b/source3/include/kanji.h @@ -105,13 +105,8 @@ #else /* not _KANJI_C_ */ -extern char* (*_dos_to_unix) (const char *str, BOOL overwrite); -extern char* (*_unix_to_dos) (const char *str, BOOL overwrite); - -extern char *sj_strtok (char *s1, const char *s2); -extern char *sj_strchr (const char *s, int c); -extern char *sj_strrchr (const char *s, int c); -extern char *sj_strstr (const char *s1, const char *s2); +extern char *(*_dos_to_unix)(char *str, BOOL overwrite); +extern char *(*_unix_to_dos)(char *str, BOOL overwrite); #define strchr sj_strchr #define strrchr sj_strrchr diff --git a/source3/include/proto.h b/source3/include/proto.h index 755ead7a52..12aae2b2d2 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -120,6 +120,10 @@ int reply_trans(char *inbuf,char *outbuf); /*The following definitions come from kanji.c */ +char *sj_strtok(char *s1, char *s2); +char *sj_strstr(char *s1, char *s2); +char *sj_strchr (char *s, int c); +char *sj_strrchr(char *s, int c); int interpret_coding_system(char *str, int def); /*The following definitions come from loadparm.c */ @@ -309,14 +313,14 @@ BOOL set_share_mode(share_lock_token token,int fnum); /*The following definitions come from make_smbcodepage.c */ -void codepage_usage(const char *progname); +void codepage_usage(char *progname); void read_line( char **buf, char *line_buf, int size); int clean_data( char **buf, uint32 *size); BOOL parse_byte(char *buf, unsigned char *bp); BOOL parse_bool(char *buf, unsigned char *bp); void parse_error(char *buf, char *msg); -int do_compile(int codepage, const char *input_file, const char *output_file); -int do_decompile( int codepage, const char *input_file, const char *output_file); +int do_compile(int codepage, char *input_file, char *output_file); +int do_decompile( int codepage, char *input_file, char *output_file); int main(int argc, char **argv); /*The following definitions come from mangle.c */ @@ -565,6 +569,7 @@ BOOL reload_services(BOOL test); /*The following definitions come from nmblib.c */ +char *lookup_opcode_name( int opcode ); void debug_nmb_packet(struct packet_struct *p); char *namestr(struct nmb_name *n); void free_nmb_packet(struct nmb_packet *nmb); @@ -778,10 +783,12 @@ BOOL smb_shm_get_usage(int *bytes_free, int *bytes_used, int *bytes_overhead); +/*The following definitions come from smbdes.c */ + +void smbdes(unsigned char *out, unsigned char *in, unsigned char *key); + /*The following definitions come from smbencrypt.c */ -void str_to_key(uchar *str,uchar *key); -void D1(uchar *k, uchar *d, uchar *out); void E1(uchar *k, uchar *d, uchar *out); void E_P16(uchar *p14,uchar *p16); void E_P24(uchar *p21, uchar *c8, uchar *p24); @@ -801,6 +808,9 @@ struct smb_passwd *get_smbpwnam(char *name); /*The following definitions come from smbrun.c */ +/*The following definitions come from smbwizard.c */ + + /*The following definitions come from status.c */ void Ucrit_addUsername(pstring username); @@ -901,10 +911,10 @@ time_t file_modtime(char *fname); BOOL directory_exist(char *dname,struct stat *st); uint32 file_size(char *file_name); char *attrib_string(int mode); -int StrCaseCmp(const char *s, const char *t); -int StrnCaseCmp(const char *s, const char *t, int n); -BOOL strequal(const char *s1, const char *s2); -BOOL strnequal(const char *s1,const char *s2,int n); +int StrCaseCmp(char *s, char *t); +int StrnCaseCmp(char *s, char *t, int n); +BOOL strequal(char *s1, char *s2); +BOOL strnequal(char *s1,char *s2,int n); BOOL strcsequal(char *s1,char *s2); void strlower(char *s); void strupper(char *s); @@ -997,7 +1007,7 @@ void free_namearray(name_compare_entry *name_array); BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); int file_lock(char *name,int timeout); void file_unlock(int fd); -BOOL is_myname(const char *s); +BOOL is_myname(char *s); void set_remote_arch(enum remote_arch_types type); enum remote_arch_types get_remote_arch(); diff --git a/source3/include/smb.h b/source3/include/smb.h index 47fbf32f83..6ef0e6f9d0 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -526,11 +526,7 @@ struct connect_record #define IS_HIDDEN_PATH(cnum,path) (is_in_path((path),Connections[(cnum)].hide_list)) #define IS_VETO_PATH(cnum,path) (is_in_path((path),Connections[(cnum)].veto_list)) -#ifdef SMB_PASSWD #define SMBENCRYPT() (lp_encrypted_passwords()) -#else -#define SMBENCRYPT() (False) -#endif /* the basic packet size, assuming no words or bytes */ #define smb_size 39 -- cgit From ddb2ce9d8100bd2c0475032b99869624db36304c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 15 Sep 1997 02:49:38 +0000 Subject: rewrote md4.c from scratch. This implementation should be portable and doesn't have any worries about RSA copyright. (This used to be commit a1569971663f01c245c145b18290d9dba965dc36) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 12aae2b2d2..2f6878eaf4 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -335,6 +335,7 @@ BOOL name_map_mangle(char *OutName,BOOL need83,int snum); /*The following definitions come from md4.c */ +void mdfour(unsigned char *out, unsigned char *in, int n); /*The following definitions come from message.c */ -- cgit From 57c2578cb2b7e02acc6c04d07adc11a77c40aa9c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 16 Sep 1997 04:41:16 +0000 Subject: - change generate_challenge() to use md4 instead of des - move routines about a bit between smbencrypt.c and smbdes.c. Ensure that there is no entry point for normal DES operation - add the following comment: This code is NOT a complete DES implementation. It implements only the minimum necessary for SMB authentication, as used by all SMB products (including every copy of Microsoft Windows95 ever sold) In particular, it can only do a unchained forward DES pass. This means it is not possible to use this code for encryption/decryption of data, instead it is only useful as a "hash" algorithm. There is no entry point into this code that allows normal DES operation. I believe this means that this code does not come under ITAR regulations but this is NOT a legal opinion. If you are concerned about the applicability of ITAR regulations to this code then you should confirm it for yourself (and maybe let me know if you come up with a different answer to the one above) (This used to be commit 35b92e725f351c9a9f2846a6b55f71c234f187c7) --- source3/include/proto.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 2f6878eaf4..8163777137 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -786,13 +786,11 @@ BOOL smb_shm_get_usage(int *bytes_free, /*The following definitions come from smbdes.c */ -void smbdes(unsigned char *out, unsigned char *in, unsigned char *key); +void E_P16(unsigned char *p14,unsigned char *p16); +void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24); /*The following definitions come from smbencrypt.c */ -void E1(uchar *k, uchar *d, uchar *out); -void E_P16(uchar *p14,uchar *p16); -void E_P24(uchar *p21, uchar *c8, uchar *p24); void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); void E_md4hash(uchar *passwd, uchar *p16); void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); -- cgit From 1590983eb0849130962cb0a08198cf8ad3d49380 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 17 Sep 1997 01:29:53 +0000 Subject: Added 'delete veto files' paremeter. Ugly - but the only way to allow Samba client users to delete directories containing Mac metafile information (.AppleDouble directories). Needed for clean integration with netatalk. Jeremy (jallison@whistle.com) (This used to be commit 29c6c037dc62e44784e9d127d1e7ef3dd1506733) --- source3/include/proto.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 8163777137..3ea589565c 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -261,6 +261,7 @@ BOOL lp_syncalways(int ); BOOL lp_map_system(int ); BOOL lp_delete_readonly(int ); BOOL lp_fake_oplocks(int ); +BOOL lp_recursive_veto_delete(int ); int lp_create_mode(int ); int lp_force_create_mode(int ); int lp_dir_mode(int ); @@ -807,9 +808,6 @@ struct smb_passwd *get_smbpwnam(char *name); /*The following definitions come from smbrun.c */ -/*The following definitions come from smbwizard.c */ - - /*The following definitions come from status.c */ void Ucrit_addUsername(pstring username); -- cgit From a2d2206cc941f39df8713d9cee26099f603af82f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 19 Sep 1997 17:12:08 +0000 Subject: Makefile: Changed proto: target to not include c files not used currently. Caused proto.h to be from a sorted list of C files. arcfour.h: Added prototypes. client.c: Added username%password in environment patch from John Blair loadparm.c: Added username manipulation code from Peter McCool [SMTP:peter@qimr.edu.au] username.c: Added username manipulation code from Peter McCool [SMTP:peter@qimr.edu.au] mkproto.awk: Added arc4_key type. proto.h: Updated & sorted. Jeremy (jallison@whistle.com) (This used to be commit 97ed4fea67095dfb83227e7b5fffc236ff277e02) --- source3/include/proto.h | 1521 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 1283 insertions(+), 238 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 3ea589565c..0e6a90a8f3 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5,21 +5,35 @@ BOOL check_access(int snum); BOOL allow_access(char *deny_list,char *allow_list,char *cname,char *caddr); - -/*The following definitions come from cgi.c */ - -void cgi_load_variables(void); -char *cgi_variable(char *name); -int cgi_boolean(char *name, int def); +BOOL check_access(int snum); +BOOL allow_access(char *deny_list,char *allow_list,char *cname,char *caddr); /*The following definitions come from charcnv.c */ +char *unix2dos_format(char *str,BOOL overwrite); +char *dos2unix_format(char *str, BOOL overwrite); +int interpret_character_set(char *str, int def); +char *unix2dos_format(char *str,BOOL overwrite); +char *dos2unix_format(char *str, BOOL overwrite); +int interpret_character_set(char *str, int def); +char *unix2dos_format(char *str,BOOL overwrite); +char *dos2unix_format(char *str, BOOL overwrite); +int interpret_character_set(char *str, int def); char *unix2dos_format(char *str,BOOL overwrite); char *dos2unix_format(char *str, BOOL overwrite); int interpret_character_set(char *str, int def); /*The following definitions come from charset.c */ +void charset_initialise(); +void codepage_initialise(int client_codepage); +void add_char_string(char *s); +void charset_initialise(); +void codepage_initialise(int client_codepage); +void add_char_string(char *s); +void charset_initialise(); +void codepage_initialise(int client_codepage); +void add_char_string(char *s); void charset_initialise(); void codepage_initialise(int client_codepage); void add_char_string(char *s); @@ -96,6 +110,9 @@ void DirCacheFlush(int snum); /*The following definitions come from fault.c */ +void fault_setup(void (*fn)()); +void fault_setup(void (*fn)()); +void fault_setup(void (*fn)()); void fault_setup(void (*fn)()); /*The following definitions come from getsmbpass.c */ @@ -104,6 +121,33 @@ char *getsmbpass(char *prompt) ; /*The following definitions come from interface.c */ +void load_interfaces(void); +void iface_set_default(char *ip,char *bcast,char *nmask); +BOOL ismyip(struct in_addr ip); +BOOL ismybcast(struct in_addr bcast); +int iface_count(void); +struct in_addr *iface_n_ip(int n); +struct in_addr *iface_bcast(struct in_addr ip); +struct in_addr *iface_nmask(struct in_addr ip); +struct in_addr *iface_ip(struct in_addr ip); +void load_interfaces(void); +void iface_set_default(char *ip,char *bcast,char *nmask); +BOOL ismyip(struct in_addr ip); +BOOL ismybcast(struct in_addr bcast); +int iface_count(void); +struct in_addr *iface_n_ip(int n); +struct in_addr *iface_bcast(struct in_addr ip); +struct in_addr *iface_nmask(struct in_addr ip); +struct in_addr *iface_ip(struct in_addr ip); +void load_interfaces(void); +void iface_set_default(char *ip,char *bcast,char *nmask); +BOOL ismyip(struct in_addr ip); +BOOL ismybcast(struct in_addr bcast); +int iface_count(void); +struct in_addr *iface_n_ip(int n); +struct in_addr *iface_bcast(struct in_addr ip); +struct in_addr *iface_nmask(struct in_addr ip); +struct in_addr *iface_ip(struct in_addr ip); void load_interfaces(void); void iface_set_default(char *ip,char *bcast,char *nmask); BOOL ismyip(struct in_addr ip); @@ -120,6 +164,21 @@ int reply_trans(char *inbuf,char *outbuf); /*The following definitions come from kanji.c */ +char *sj_strtok(char *s1, char *s2); +char *sj_strstr(char *s1, char *s2); +char *sj_strchr (char *s, int c); +char *sj_strrchr(char *s, int c); +int interpret_coding_system(char *str, int def); +char *sj_strtok(char *s1, char *s2); +char *sj_strstr(char *s1, char *s2); +char *sj_strchr (char *s, int c); +char *sj_strrchr(char *s, int c); +int interpret_coding_system(char *str, int def); +char *sj_strtok(char *s1, char *s2); +char *sj_strstr(char *s1, char *s2); +char *sj_strchr (char *s, int c); +char *sj_strrchr(char *s, int c); +int interpret_coding_system(char *str, int def); char *sj_strtok(char *s1, char *s2); char *sj_strstr(char *s1, char *s2); char *sj_strchr (char *s, int c); @@ -189,6 +248,7 @@ int lp_maxmux(void); int lp_maxpacket(void); int lp_keepalive(void); int lp_passwordlevel(void); +int lp_usernamelevel(void); int lp_readsize(void); int lp_shmem_size(void); int lp_shmem_hash_size(void); @@ -291,217 +351,686 @@ void lp_copy_service(int snum, char *new_name); int lp_default_server_announce(void); int lp_major_announce_version(void); int lp_minor_announce_version(void); - -/*The following definitions come from locking.c */ - -BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset); -BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); -BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); -BOOL start_share_mode_mgmt(void); -BOOL stop_share_mode_mgmt(void); -BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *ptok); -BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token token); -int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, - min_share_mode_entry **old_shares); -void del_share_mode(share_lock_token token, int fnum); -BOOL set_share_mode(share_lock_token token, int fnum); -BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *ptok); -BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token token); -int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, - min_share_mode_entry **old_shares); -void del_share_mode(share_lock_token token, int fnum); -BOOL set_share_mode(share_lock_token token,int fnum); - -/*The following definitions come from make_smbcodepage.c */ - -void codepage_usage(char *progname); -void read_line( char **buf, char *line_buf, int size); -int clean_data( char **buf, uint32 *size); -BOOL parse_byte(char *buf, unsigned char *bp); -BOOL parse_bool(char *buf, unsigned char *bp); -void parse_error(char *buf, char *msg); -int do_compile(int codepage, char *input_file, char *output_file); -int do_decompile( int codepage, char *input_file, char *output_file); -int main(int argc, char **argv); - -/*The following definitions come from mangle.c */ - -int str_checksum(char *s); -BOOL is_8_3(char *fname, BOOL check_case); -void create_mangled_stack(int size); -BOOL check_mangled_stack(char *s); -BOOL is_mangled(char *s); -void mangle_name_83(char *s); -BOOL name_map_mangle(char *OutName,BOOL need83,int snum); - -/*The following definitions come from md4.c */ - -void mdfour(unsigned char *out, unsigned char *in, int n); - -/*The following definitions come from message.c */ - -int reply_sends(char *inbuf,char *outbuf); -int reply_sendstrt(char *inbuf,char *outbuf); -int reply_sendtxt(char *inbuf,char *outbuf); -int reply_sendend(char *inbuf,char *outbuf); - -/*The following definitions come from nameannounce.c */ - -void announce_request(struct work_record *work, struct in_addr ip); -void do_announce_request(char *info, char *to_name, int announce_type, - int from, - int to, struct in_addr dest_ip); -void sync_server(enum state_type state, char *serv_name, char *work_name, - int name_type, - struct subnet_record *d, - struct in_addr ip); -void do_announce_host(int command, - char *from_name, int from_type, struct in_addr from_ip, - char *to_name , int to_type , struct in_addr to_ip, - time_t announce_interval, - char *server_name, int server_type, char *server_comment); -void announce_my_servers_removed(void); -void announce_server(struct subnet_record *d, struct work_record *work, - char *name, char *comment, time_t ttl, int server_type); -void announce_host(time_t t); -void reset_announce_timer(); -void announce_master(time_t t); -void announce_remote(time_t t); - -/*The following definitions come from namebrowse.c */ - -void expire_browse_cache(time_t t); -struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, - time_t ttl, struct subnet_record *d, - struct in_addr ip, BOOL local); -void do_browser_lists(time_t t); - -/*The following definitions come from nameconf.c */ - -int get_num_workgroups(void); -int conf_workgroup_name_to_token(char *workgroup_name,char *default_name); -char *conf_workgroup_name(int token); -int conf_should_workgroup_member(int token); -int conf_should_local_master(int token); -int conf_should_domain_master(int token); -char *conf_browsing_alias(int token); -char *conf_browsing_alias_comment(int token); -char *conf_alias_to_workgroup(char *alias); -int conf_alias_to_token(char *alias); -void read_smbbrowse_conf(char *default_name); - -/*The following definitions come from namedbname.c */ - -void set_samba_nb_type(void); -BOOL name_equal(struct nmb_name *n1,struct nmb_name *n2); -BOOL ms_browser_name(char *name, int type); -void remove_name(struct subnet_record *d, struct name_record *n); -struct name_record *find_name(struct name_record *n, - struct nmb_name *name, int search); -struct name_record *find_name_search(struct subnet_record **d, - struct nmb_name *name, - int search, struct in_addr ip); -void dump_names(void); -void load_netbios_names(void); -void remove_netbios_name(struct subnet_record *d, - char *name,int type, enum name_source source, - struct in_addr ip); -struct name_record *add_netbios_entry(struct subnet_record *d, - char *name, int type, int nb_flags, - int ttl, enum name_source source, struct in_addr ip, - BOOL new_only,BOOL wins); -void expire_names(time_t t); -struct name_record *dns_name_search(struct nmb_name *question, int Time); - -/*The following definitions come from namedbresp.c */ - -void add_response_record(struct subnet_record *d, - struct response_record *n); -void remove_response_record(struct subnet_record *d, - struct response_record *n); -struct response_record *make_response_queue_record(enum state_type state, - int id,uint16 fd, - int quest_type, char *name,int type, int nb_flags, time_t ttl, - int server_type, char *my_name, char *my_comment, - BOOL bcast,BOOL recurse, - struct in_addr send_ip, struct in_addr reply_to_ip); -struct response_record *find_response_record(struct subnet_record **d, - uint16 id); - -/*The following definitions come from namedbserver.c */ - -void remove_old_servers(struct work_record *work, time_t t, - BOOL remove_all); -struct server_record *find_server(struct work_record *work, char *name); -struct server_record *add_server_entry(struct subnet_record *d, - struct work_record *work, - char *name,int servertype, - int ttl,char *comment, - BOOL replace); -void expire_servers(time_t t); - -/*The following definitions come from namedbsubnet.c */ - -struct subnet_record *find_subnet(struct in_addr bcast_ip); -struct subnet_record *find_req_subnet(struct in_addr ip, BOOL bcast); -struct subnet_record *find_subnet_all(struct in_addr bcast_ip); -void add_workgroup_to_subnet( struct subnet_record *d, char *group); -void add_my_subnets(char *group); -void write_browse_list(time_t t); - -/*The following definitions come from namedbwork.c */ - -struct work_record *remove_workgroup(struct subnet_record *d, - struct work_record *work, - BOOL remove_all_servers); -struct work_record *find_workgroupstruct(struct subnet_record *d, - fstring name, BOOL add); -void dump_workgroups(void); - -/*The following definitions come from nameelect.c */ - -void check_master_browser(time_t t); -void browser_gone(char *work_name, struct in_addr ip); -void send_election(struct subnet_record *d, char *group,uint32 criterion, - int timeup,char *name); -void name_unregister_work(struct subnet_record *d, char *name, int name_type); -void name_register_work(struct subnet_record *d, char *name, int name_type, - int nb_flags, time_t ttl, struct in_addr ip, BOOL bcast); -void become_local_master(struct subnet_record *d, struct work_record *work); -void become_domain_master(struct subnet_record *d, struct work_record *work); -void become_logon_server(struct subnet_record *d, struct work_record *work); -void unbecome_local_master(struct subnet_record *d, struct work_record *work, - int remove_type); -void unbecome_domain_master(struct subnet_record *d, struct work_record *work, - int remove_type); -void unbecome_logon_server(struct subnet_record *d, struct work_record *work, - int remove_type); -void run_elections(time_t t); -void process_election(struct packet_struct *p,char *buf); -BOOL check_elections(void); - -/*The following definitions come from namelogon.c */ - -void process_logon_packet(struct packet_struct *p,char *buf,int len); - -/*The following definitions come from namepacket.c */ - -void debug_browse_data(char *outbuf, int len); -void initiate_netbios_packet(uint16 *id, - int fd,int quest_type,char *name,int name_type, - int nb_flags,BOOL bcast,BOOL recurse, - struct in_addr to_ip); -void reply_netbios_packet(struct packet_struct *p1,int trn_id, - int rcode, int rcv_code, int opcode, - BOOL recursion_available, - BOOL recursion_desired, - struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, - char *data,int len); -void queue_packet(struct packet_struct *packet); -void run_packet_queue(); -void listen_for_packets(BOOL run_election); -BOOL send_mailslot_reply(BOOL unique, char *mailslot,int fd,char *buf,int len,char *srcname, - char *dstname,int src_type,int dest_type, +char *lp_string(char *s); +char *lp_logfile(void); +char *lp_smbrun(void); +char *lp_configfile(void); +char *lp_smb_passwd_file(void); +char *lp_serverstring(void); +char *lp_printcapname(void); +char *lp_lockdir(void); +char *lp_rootdir(void); +char *lp_defaultservice(void); +char *lp_msg_command(void); +char *lp_dfree_command(void); +char *lp_hosts_equiv(void); +char *lp_auto_services(void); +char *lp_passwd_program(void); +char *lp_passwd_chat(void); +char *lp_passwordserver(void); +char *lp_workgroup(void); +char *lp_domain_controller(void); +char *lp_username_map(void); +char *lp_character_set(void); +char *lp_logon_script(void); +char *lp_logon_path(void); +char *lp_remote_announce(void); +char *lp_wins_server(void); +char *lp_interfaces(void); +char *lp_socket_address(void); +char *lp_nis_home_map_name(void); +char *lp_announce_version(void); +char *lp_netbios_aliases(void); +BOOL lp_dns_proxy(void); +BOOL lp_wins_support(void); +BOOL lp_wins_proxy(void); +BOOL lp_local_master(void); +BOOL lp_domain_master(void); +BOOL lp_domain_logons(void); +BOOL lp_preferred_master(void); +BOOL lp_load_printers(void); +BOOL lp_use_rhosts(void); +BOOL lp_getwdcache(void); +BOOL lp_readprediction(void); +BOOL lp_readbmpx(void); +BOOL lp_readraw(void); +BOOL lp_writeraw(void); +BOOL lp_null_passwords(void); +BOOL lp_strip_dot(void); +BOOL lp_encrypted_passwords(void); +BOOL lp_syslog_only(void); +BOOL lp_browse_list(void); +BOOL lp_unix_realname(void); +BOOL lp_nis_home_map(void); +BOOL lp_time_server(void); +int lp_os_level(void); +int lp_max_ttl(void); +int lp_max_log_size(void); +int lp_mangledstack(void); +int lp_maxxmit(void); +int lp_maxmux(void); +int lp_maxpacket(void); +int lp_keepalive(void); +int lp_passwordlevel(void); +int lp_usernamelevel(void); +int lp_readsize(void); +int lp_shmem_size(void); +int lp_shmem_hash_size(void); +int lp_deadtime(void); +int lp_maxprotocol(void); +int lp_security(void); +int lp_printing(void); +int lp_maxdisksize(void); +int lp_lpqcachetime(void); +int lp_syslog(void); +int lp_client_code_page(void); +int lp_announce_as(void); +char *lp_preexec(int ); +char *lp_postexec(int ); +char *lp_rootpreexec(int ); +char *lp_rootpostexec(int ); +char *lp_servicename(int ); +char *lp_pathname(int ); +char *lp_dontdescend(int ); +char *lp_username(int ); +char *lp_guestaccount(int ); +char *lp_invalid_users(int ); +char *lp_valid_users(int ); +char *lp_admin_users(int ); +char *lp_printcommand(int ); +char *lp_lpqcommand(int ); +char *lp_lprmcommand(int ); +char *lp_lppausecommand(int ); +char *lp_lpresumecommand(int ); +char *lp_printername(int ); +char *lp_printerdriver(int ); +char *lp_hostsallow(int ); +char *lp_hostsdeny(int ); +char *lp_magicscript(int ); +char *lp_magicoutput(int ); +char *lp_comment(int ); +char *lp_force_user(int ); +char *lp_force_group(int ); +char *lp_readlist(int ); +char *lp_writelist(int ); +char *lp_volume(int ); +char *lp_mangled_map(int ); +char *lp_veto_files(int ); +char *lp_hide_files(int ); +BOOL lp_alternate_permissions(int ); +BOOL lp_revalidate(int ); +BOOL lp_casesensitive(int ); +BOOL lp_preservecase(int ); +BOOL lp_shortpreservecase(int ); +BOOL lp_casemangle(int ); +BOOL lp_status(int ); +BOOL lp_hide_dot_files(int ); +BOOL lp_browseable(int ); +BOOL lp_readonly(int ); +BOOL lp_no_set_dir(int ); +BOOL lp_guest_ok(int ); +BOOL lp_guest_only(int ); +BOOL lp_print_ok(int ); +BOOL lp_postscript(int ); +BOOL lp_map_hidden(int ); +BOOL lp_map_archive(int ); +BOOL lp_locking(int ); +BOOL lp_strict_locking(int ); +BOOL lp_share_modes(int ); +BOOL lp_onlyuser(int ); +BOOL lp_manglednames(int ); +BOOL lp_widelinks(int ); +BOOL lp_symlinks(int ); +BOOL lp_syncalways(int ); +BOOL lp_map_system(int ); +BOOL lp_delete_readonly(int ); +BOOL lp_fake_oplocks(int ); +BOOL lp_recursive_veto_delete(int ); +int lp_create_mode(int ); +int lp_force_create_mode(int ); +int lp_dir_mode(int ); +int lp_force_dir_mode(int ); +int lp_max_connections(int ); +int lp_defaultcase(int ); +int lp_minprintspace(int ); +char lp_magicchar(int ); +BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir); +int lp_add_service(char *pszService, int iDefaultService); +BOOL lp_add_printer(char *pszPrintername, int iDefaultService); +BOOL lp_file_list_changed(void); +BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue); +int lp_next_parameter(int snum, int *i, char *label, + char *value, int allparameters); +BOOL lp_snum_ok(int iService); +BOOL lp_loaded(void); +void lp_killunused(BOOL (*snumused)(int )); +BOOL lp_load(char *pszFname,BOOL global_only); +int lp_numservices(void); +void lp_dump(FILE *f); +int lp_servicenumber(char *pszServiceName); +char *volume_label(int snum); +void lp_rename_service(int snum, char *new_name); +void lp_remove_service(int snum); +void lp_copy_service(int snum, char *new_name); +int lp_default_server_announce(void); +int lp_major_announce_version(void); +int lp_minor_announce_version(void); +char *lp_string(char *s); +char *lp_logfile(void); +char *lp_smbrun(void); +char *lp_configfile(void); +char *lp_smb_passwd_file(void); +char *lp_serverstring(void); +char *lp_printcapname(void); +char *lp_lockdir(void); +char *lp_rootdir(void); +char *lp_defaultservice(void); +char *lp_msg_command(void); +char *lp_dfree_command(void); +char *lp_hosts_equiv(void); +char *lp_auto_services(void); +char *lp_passwd_program(void); +char *lp_passwd_chat(void); +char *lp_passwordserver(void); +char *lp_workgroup(void); +char *lp_domain_controller(void); +char *lp_username_map(void); +char *lp_character_set(void); +char *lp_logon_script(void); +char *lp_logon_path(void); +char *lp_remote_announce(void); +char *lp_wins_server(void); +char *lp_interfaces(void); +char *lp_socket_address(void); +char *lp_nis_home_map_name(void); +char *lp_announce_version(void); +char *lp_netbios_aliases(void); +BOOL lp_dns_proxy(void); +BOOL lp_wins_support(void); +BOOL lp_wins_proxy(void); +BOOL lp_local_master(void); +BOOL lp_domain_master(void); +BOOL lp_domain_logons(void); +BOOL lp_preferred_master(void); +BOOL lp_load_printers(void); +BOOL lp_use_rhosts(void); +BOOL lp_getwdcache(void); +BOOL lp_readprediction(void); +BOOL lp_readbmpx(void); +BOOL lp_readraw(void); +BOOL lp_writeraw(void); +BOOL lp_null_passwords(void); +BOOL lp_strip_dot(void); +BOOL lp_encrypted_passwords(void); +BOOL lp_syslog_only(void); +BOOL lp_browse_list(void); +BOOL lp_unix_realname(void); +BOOL lp_nis_home_map(void); +BOOL lp_time_server(void); +int lp_os_level(void); +int lp_max_ttl(void); +int lp_max_log_size(void); +int lp_mangledstack(void); +int lp_maxxmit(void); +int lp_maxmux(void); +int lp_maxpacket(void); +int lp_keepalive(void); +int lp_passwordlevel(void); +int lp_usernamelevel(void); +int lp_readsize(void); +int lp_shmem_size(void); +int lp_shmem_hash_size(void); +int lp_deadtime(void); +int lp_maxprotocol(void); +int lp_security(void); +int lp_printing(void); +int lp_maxdisksize(void); +int lp_lpqcachetime(void); +int lp_syslog(void); +int lp_client_code_page(void); +int lp_announce_as(void); +char *lp_preexec(int ); +char *lp_postexec(int ); +char *lp_rootpreexec(int ); +char *lp_rootpostexec(int ); +char *lp_servicename(int ); +char *lp_pathname(int ); +char *lp_dontdescend(int ); +char *lp_username(int ); +char *lp_guestaccount(int ); +char *lp_invalid_users(int ); +char *lp_valid_users(int ); +char *lp_admin_users(int ); +char *lp_printcommand(int ); +char *lp_lpqcommand(int ); +char *lp_lprmcommand(int ); +char *lp_lppausecommand(int ); +char *lp_lpresumecommand(int ); +char *lp_printername(int ); +char *lp_printerdriver(int ); +char *lp_hostsallow(int ); +char *lp_hostsdeny(int ); +char *lp_magicscript(int ); +char *lp_magicoutput(int ); +char *lp_comment(int ); +char *lp_force_user(int ); +char *lp_force_group(int ); +char *lp_readlist(int ); +char *lp_writelist(int ); +char *lp_volume(int ); +char *lp_mangled_map(int ); +char *lp_veto_files(int ); +char *lp_hide_files(int ); +BOOL lp_alternate_permissions(int ); +BOOL lp_revalidate(int ); +BOOL lp_casesensitive(int ); +BOOL lp_preservecase(int ); +BOOL lp_shortpreservecase(int ); +BOOL lp_casemangle(int ); +BOOL lp_status(int ); +BOOL lp_hide_dot_files(int ); +BOOL lp_browseable(int ); +BOOL lp_readonly(int ); +BOOL lp_no_set_dir(int ); +BOOL lp_guest_ok(int ); +BOOL lp_guest_only(int ); +BOOL lp_print_ok(int ); +BOOL lp_postscript(int ); +BOOL lp_map_hidden(int ); +BOOL lp_map_archive(int ); +BOOL lp_locking(int ); +BOOL lp_strict_locking(int ); +BOOL lp_share_modes(int ); +BOOL lp_onlyuser(int ); +BOOL lp_manglednames(int ); +BOOL lp_widelinks(int ); +BOOL lp_symlinks(int ); +BOOL lp_syncalways(int ); +BOOL lp_map_system(int ); +BOOL lp_delete_readonly(int ); +BOOL lp_fake_oplocks(int ); +BOOL lp_recursive_veto_delete(int ); +int lp_create_mode(int ); +int lp_force_create_mode(int ); +int lp_dir_mode(int ); +int lp_force_dir_mode(int ); +int lp_max_connections(int ); +int lp_defaultcase(int ); +int lp_minprintspace(int ); +char lp_magicchar(int ); +BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir); +int lp_add_service(char *pszService, int iDefaultService); +BOOL lp_add_printer(char *pszPrintername, int iDefaultService); +BOOL lp_file_list_changed(void); +BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue); +int lp_next_parameter(int snum, int *i, char *label, + char *value, int allparameters); +BOOL lp_snum_ok(int iService); +BOOL lp_loaded(void); +void lp_killunused(BOOL (*snumused)(int )); +BOOL lp_load(char *pszFname,BOOL global_only); +int lp_numservices(void); +void lp_dump(FILE *f); +int lp_servicenumber(char *pszServiceName); +char *volume_label(int snum); +void lp_rename_service(int snum, char *new_name); +void lp_remove_service(int snum); +void lp_copy_service(int snum, char *new_name); +int lp_default_server_announce(void); +int lp_major_announce_version(void); +int lp_minor_announce_version(void); +char *lp_string(char *s); +char *lp_logfile(void); +char *lp_smbrun(void); +char *lp_configfile(void); +char *lp_smb_passwd_file(void); +char *lp_serverstring(void); +char *lp_printcapname(void); +char *lp_lockdir(void); +char *lp_rootdir(void); +char *lp_defaultservice(void); +char *lp_msg_command(void); +char *lp_dfree_command(void); +char *lp_hosts_equiv(void); +char *lp_auto_services(void); +char *lp_passwd_program(void); +char *lp_passwd_chat(void); +char *lp_passwordserver(void); +char *lp_workgroup(void); +char *lp_domain_controller(void); +char *lp_username_map(void); +char *lp_character_set(void); +char *lp_logon_script(void); +char *lp_logon_path(void); +char *lp_remote_announce(void); +char *lp_wins_server(void); +char *lp_interfaces(void); +char *lp_socket_address(void); +char *lp_nis_home_map_name(void); +char *lp_announce_version(void); +char *lp_netbios_aliases(void); +BOOL lp_dns_proxy(void); +BOOL lp_wins_support(void); +BOOL lp_wins_proxy(void); +BOOL lp_local_master(void); +BOOL lp_domain_master(void); +BOOL lp_domain_logons(void); +BOOL lp_preferred_master(void); +BOOL lp_load_printers(void); +BOOL lp_use_rhosts(void); +BOOL lp_getwdcache(void); +BOOL lp_readprediction(void); +BOOL lp_readbmpx(void); +BOOL lp_readraw(void); +BOOL lp_writeraw(void); +BOOL lp_null_passwords(void); +BOOL lp_strip_dot(void); +BOOL lp_encrypted_passwords(void); +BOOL lp_syslog_only(void); +BOOL lp_browse_list(void); +BOOL lp_unix_realname(void); +BOOL lp_nis_home_map(void); +BOOL lp_time_server(void); +int lp_os_level(void); +int lp_max_ttl(void); +int lp_max_log_size(void); +int lp_mangledstack(void); +int lp_maxxmit(void); +int lp_maxmux(void); +int lp_maxpacket(void); +int lp_keepalive(void); +int lp_passwordlevel(void); +int lp_usernamelevel(void); +int lp_readsize(void); +int lp_shmem_size(void); +int lp_shmem_hash_size(void); +int lp_deadtime(void); +int lp_maxprotocol(void); +int lp_security(void); +int lp_printing(void); +int lp_maxdisksize(void); +int lp_lpqcachetime(void); +int lp_syslog(void); +int lp_client_code_page(void); +int lp_announce_as(void); +char *lp_preexec(int ); +char *lp_postexec(int ); +char *lp_rootpreexec(int ); +char *lp_rootpostexec(int ); +char *lp_servicename(int ); +char *lp_pathname(int ); +char *lp_dontdescend(int ); +char *lp_username(int ); +char *lp_guestaccount(int ); +char *lp_invalid_users(int ); +char *lp_valid_users(int ); +char *lp_admin_users(int ); +char *lp_printcommand(int ); +char *lp_lpqcommand(int ); +char *lp_lprmcommand(int ); +char *lp_lppausecommand(int ); +char *lp_lpresumecommand(int ); +char *lp_printername(int ); +char *lp_printerdriver(int ); +char *lp_hostsallow(int ); +char *lp_hostsdeny(int ); +char *lp_magicscript(int ); +char *lp_magicoutput(int ); +char *lp_comment(int ); +char *lp_force_user(int ); +char *lp_force_group(int ); +char *lp_readlist(int ); +char *lp_writelist(int ); +char *lp_volume(int ); +char *lp_mangled_map(int ); +char *lp_veto_files(int ); +char *lp_hide_files(int ); +BOOL lp_alternate_permissions(int ); +BOOL lp_revalidate(int ); +BOOL lp_casesensitive(int ); +BOOL lp_preservecase(int ); +BOOL lp_shortpreservecase(int ); +BOOL lp_casemangle(int ); +BOOL lp_status(int ); +BOOL lp_hide_dot_files(int ); +BOOL lp_browseable(int ); +BOOL lp_readonly(int ); +BOOL lp_no_set_dir(int ); +BOOL lp_guest_ok(int ); +BOOL lp_guest_only(int ); +BOOL lp_print_ok(int ); +BOOL lp_postscript(int ); +BOOL lp_map_hidden(int ); +BOOL lp_map_archive(int ); +BOOL lp_locking(int ); +BOOL lp_strict_locking(int ); +BOOL lp_share_modes(int ); +BOOL lp_onlyuser(int ); +BOOL lp_manglednames(int ); +BOOL lp_widelinks(int ); +BOOL lp_symlinks(int ); +BOOL lp_syncalways(int ); +BOOL lp_map_system(int ); +BOOL lp_delete_readonly(int ); +BOOL lp_fake_oplocks(int ); +BOOL lp_recursive_veto_delete(int ); +int lp_create_mode(int ); +int lp_force_create_mode(int ); +int lp_dir_mode(int ); +int lp_force_dir_mode(int ); +int lp_max_connections(int ); +int lp_defaultcase(int ); +int lp_minprintspace(int ); +char lp_magicchar(int ); +BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir); +int lp_add_service(char *pszService, int iDefaultService); +BOOL lp_add_printer(char *pszPrintername, int iDefaultService); +BOOL lp_file_list_changed(void); +BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue); +int lp_next_parameter(int snum, int *i, char *label, + char *value, int allparameters); +BOOL lp_snum_ok(int iService); +BOOL lp_loaded(void); +void lp_killunused(BOOL (*snumused)(int )); +BOOL lp_load(char *pszFname,BOOL global_only); +int lp_numservices(void); +void lp_dump(FILE *f); +int lp_servicenumber(char *pszServiceName); +char *volume_label(int snum); +void lp_rename_service(int snum, char *new_name); +void lp_remove_service(int snum); +void lp_copy_service(int snum, char *new_name); +int lp_default_server_announce(void); +int lp_major_announce_version(void); +int lp_minor_announce_version(void); + +/*The following definitions come from locking.c */ + +BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset); +BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); +BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); +BOOL start_share_mode_mgmt(void); +BOOL stop_share_mode_mgmt(void); +BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *ptok); +BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token token); +int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, + min_share_mode_entry **old_shares); +void del_share_mode(share_lock_token token, int fnum); +BOOL set_share_mode(share_lock_token token, int fnum); +BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *ptok); +BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token token); +int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, + min_share_mode_entry **old_shares); +void del_share_mode(share_lock_token token, int fnum); +BOOL set_share_mode(share_lock_token token,int fnum); + +/*The following definitions come from mangle.c */ + +int str_checksum(char *s); +BOOL is_8_3(char *fname, BOOL check_case); +void create_mangled_stack(int size); +BOOL check_mangled_stack(char *s); +BOOL is_mangled(char *s); +void mangle_name_83(char *s); +BOOL name_map_mangle(char *OutName,BOOL need83,int snum); + +/*The following definitions come from md4.c */ + +void mdfour(unsigned char *out, unsigned char *in, int n); +void mdfour(unsigned char *out, unsigned char *in, int n); +void mdfour(unsigned char *out, unsigned char *in, int n); +void mdfour(unsigned char *out, unsigned char *in, int n); + +/*The following definitions come from message.c */ + +int reply_sends(char *inbuf,char *outbuf); +int reply_sendstrt(char *inbuf,char *outbuf); +int reply_sendtxt(char *inbuf,char *outbuf); +int reply_sendend(char *inbuf,char *outbuf); + +/*The following definitions come from nameannounce.c */ + +void announce_request(struct work_record *work, struct in_addr ip); +void do_announce_request(char *info, char *to_name, int announce_type, + int from, + int to, struct in_addr dest_ip); +void sync_server(enum state_type state, char *serv_name, char *work_name, + int name_type, + struct subnet_record *d, + struct in_addr ip); +void do_announce_host(int command, + char *from_name, int from_type, struct in_addr from_ip, + char *to_name , int to_type , struct in_addr to_ip, + time_t announce_interval, + char *server_name, int server_type, char *server_comment); +void announce_my_servers_removed(void); +void announce_server(struct subnet_record *d, struct work_record *work, + char *name, char *comment, time_t ttl, int server_type); +void announce_host(time_t t); +void reset_announce_timer(); +void announce_master(time_t t); +void announce_remote(time_t t); + +/*The following definitions come from namebrowse.c */ + +void expire_browse_cache(time_t t); +struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, + time_t ttl, struct subnet_record *d, + struct in_addr ip, BOOL local); +void do_browser_lists(time_t t); + +/*The following definitions come from namedbname.c */ + +void set_samba_nb_type(void); +BOOL name_equal(struct nmb_name *n1,struct nmb_name *n2); +BOOL ms_browser_name(char *name, int type); +void remove_name(struct subnet_record *d, struct name_record *n); +struct name_record *find_name(struct name_record *n, + struct nmb_name *name, int search); +struct name_record *find_name_search(struct subnet_record **d, + struct nmb_name *name, + int search, struct in_addr ip); +void dump_names(void); +void load_netbios_names(void); +void remove_netbios_name(struct subnet_record *d, + char *name,int type, enum name_source source, + struct in_addr ip); +struct name_record *add_netbios_entry(struct subnet_record *d, + char *name, int type, int nb_flags, + int ttl, enum name_source source, struct in_addr ip, + BOOL new_only,BOOL wins); +void expire_names(time_t t); +struct name_record *dns_name_search(struct nmb_name *question, int Time); + +/*The following definitions come from namedbresp.c */ + +void add_response_record(struct subnet_record *d, + struct response_record *n); +void remove_response_record(struct subnet_record *d, + struct response_record *n); +struct response_record *make_response_queue_record(enum state_type state, + int id,uint16 fd, + int quest_type, char *name,int type, int nb_flags, time_t ttl, + int server_type, char *my_name, char *my_comment, + BOOL bcast,BOOL recurse, + struct in_addr send_ip, struct in_addr reply_to_ip); +struct response_record *find_response_record(struct subnet_record **d, + uint16 id); + +/*The following definitions come from namedbserver.c */ + +void remove_old_servers(struct work_record *work, time_t t, + BOOL remove_all); +struct server_record *find_server(struct work_record *work, char *name); +struct server_record *add_server_entry(struct subnet_record *d, + struct work_record *work, + char *name,int servertype, + int ttl,char *comment, + BOOL replace); +void expire_servers(time_t t); + +/*The following definitions come from namedbsubnet.c */ + +struct subnet_record *find_subnet(struct in_addr bcast_ip); +struct subnet_record *find_req_subnet(struct in_addr ip, BOOL bcast); +struct subnet_record *find_subnet_all(struct in_addr bcast_ip); +void add_workgroup_to_subnet( struct subnet_record *d, char *group); +void add_my_subnets(char *group); +void write_browse_list(time_t t); + +/*The following definitions come from namedbwork.c */ + +struct work_record *remove_workgroup(struct subnet_record *d, + struct work_record *work, + BOOL remove_all_servers); +struct work_record *find_workgroupstruct(struct subnet_record *d, + fstring name, BOOL add); +void dump_workgroups(void); + +/*The following definitions come from nameelect.c */ + +void check_master_browser(time_t t); +void browser_gone(char *work_name, struct in_addr ip); +void send_election(struct subnet_record *d, char *group,uint32 criterion, + int timeup,char *name); +void name_unregister_work(struct subnet_record *d, char *name, int name_type); +void name_register_work(struct subnet_record *d, char *name, int name_type, + int nb_flags, time_t ttl, struct in_addr ip, BOOL bcast); +void become_local_master(struct subnet_record *d, struct work_record *work); +void become_domain_master(struct subnet_record *d, struct work_record *work); +void become_logon_server(struct subnet_record *d, struct work_record *work); +void unbecome_local_master(struct subnet_record *d, struct work_record *work, + int remove_type); +void unbecome_domain_master(struct subnet_record *d, struct work_record *work, + int remove_type); +void unbecome_logon_server(struct subnet_record *d, struct work_record *work, + int remove_type); +void run_elections(time_t t); +void process_election(struct packet_struct *p,char *buf); +BOOL check_elections(void); + +/*The following definitions come from namelogon.c */ + +void process_logon_packet(struct packet_struct *p,char *buf,int len); + +/*The following definitions come from namepacket.c */ + +void debug_browse_data(char *outbuf, int len); +void initiate_netbios_packet(uint16 *id, + int fd,int quest_type,char *name,int name_type, + int nb_flags,BOOL bcast,BOOL recurse, + struct in_addr to_ip); +void reply_netbios_packet(struct packet_struct *p1,int trn_id, + int rcode, int rcv_code, int opcode, + BOOL recursion_available, + BOOL recursion_desired, + struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, + char *data,int len); +void queue_packet(struct packet_struct *packet); +void run_packet_queue(); +void listen_for_packets(BOOL run_election); +BOOL send_mailslot_reply(BOOL unique, char *mailslot,int fd,char *buf,int len,char *srcname, + char *dstname,int src_type,int dest_type, struct in_addr dest_ip,struct in_addr src_ip); /*The following definitions come from namequery.c */ @@ -571,6 +1100,15 @@ BOOL reload_services(BOOL test); /*The following definitions come from nmblib.c */ +char *lookup_opcode_name( int opcode ); +void debug_nmb_packet(struct packet_struct *p); +char *namestr(struct nmb_name *n); +void free_nmb_packet(struct nmb_packet *nmb); +void free_packet(struct packet_struct *packet); +struct packet_struct *read_packet(int fd,enum packet_type packet_type); +void make_nmb_name(struct nmb_name *n,char *name,int type,char *this_scope); +BOOL send_packet(struct packet_struct *p); +struct packet_struct *receive_packet(int fd,enum packet_type type,int t); char *lookup_opcode_name( int opcode ); void debug_nmb_packet(struct packet_struct *p); char *namestr(struct nmb_name *n); @@ -593,6 +1131,9 @@ void sync_browse_lists(struct subnet_record *d, struct work_record *work, /*The following definitions come from params.c */ +BOOL pm_process(char *pszFileName,BOOL (*sfunc)(char *),BOOL (*pfunc)(char *,char *)); +BOOL pm_process(char *pszFileName,BOOL (*sfunc)(char *),BOOL (*pfunc)(char *,char *)); +BOOL pm_process(char *pszFileName,BOOL (*sfunc)(char *),BOOL (*pfunc)(char *,char *)); BOOL pm_process(char *pszFileName,BOOL (*sfunc)(char *),BOOL (*pfunc)(char *,char *)); /*The following definitions come from password.c */ @@ -618,6 +1159,12 @@ BOOL server_validate(char *buf); /*The following definitions come from pcap.c */ +BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); +void pcap_printer_fn(void (*fn)()); +BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); +void pcap_printer_fn(void (*fn)()); +BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); +void pcap_printer_fn(void (*fn)()); BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); void pcap_printer_fn(void (*fn)()); @@ -660,6 +1207,27 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); /*The following definitions come from replace.c */ +char *Strstr(char *s, char *p); +time_t Mktime(struct tm *t); +int InNetGr(char *group,char *host,char *user,char *dom); +void *malloc_wrapped(int size,char *file,int line); +void *realloc_wrapped(void *ptr,int size,char *file,int line); +void free_wrapped(void *ptr,char *file,int line); +void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line); +char *Strstr(char *s, char *p); +time_t Mktime(struct tm *t); +int InNetGr(char *group,char *host,char *user,char *dom); +void *malloc_wrapped(int size,char *file,int line); +void *realloc_wrapped(void *ptr,int size,char *file,int line); +void free_wrapped(void *ptr,char *file,int line); +void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line); +char *Strstr(char *s, char *p); +time_t Mktime(struct tm *t); +int InNetGr(char *group,char *host,char *user,char *dom); +void *malloc_wrapped(int size,char *file,int line); +void *realloc_wrapped(void *ptr,int size,char *file,int line); +void free_wrapped(void *ptr,char *file,int line); +void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line); char *Strstr(char *s, char *p); time_t Mktime(struct tm *t); int InNetGr(char *group,char *host,char *user,char *dom); @@ -770,6 +1338,20 @@ int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); /*The following definitions come from shmem.c */ +BOOL smb_shm_create_hash_table( unsigned int size ); +BOOL smb_shm_open( char *file_name, int size); +BOOL smb_shm_close( void ); +smb_shm_offset_t smb_shm_alloc(int size); +BOOL smb_shm_free(smb_shm_offset_t offset); +smb_shm_offset_t smb_shm_get_userdef_off(void); +BOOL smb_shm_set_userdef_off(smb_shm_offset_t userdef_off); +void *smb_shm_offset2addr(smb_shm_offset_t offset); +smb_shm_offset_t smb_shm_addr2offset(void *addr); +BOOL smb_shm_lock_hash_entry( unsigned int entry); +BOOL smb_shm_unlock_hash_entry( unsigned int entry ); +BOOL smb_shm_get_usage(int *bytes_free, + int *bytes_used, + int *bytes_overhead); BOOL smb_shm_create_hash_table( unsigned int size ); BOOL smb_shm_open( char *file_name, int size); BOOL smb_shm_close( void ); @@ -787,17 +1369,35 @@ BOOL smb_shm_get_usage(int *bytes_free, /*The following definitions come from smbdes.c */ +void E_P16(unsigned char *p14,unsigned char *p16); +void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24); +void E_P16(unsigned char *p14,unsigned char *p16); +void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24); +void E_P16(unsigned char *p14,unsigned char *p16); +void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24); void E_P16(unsigned char *p14,unsigned char *p16); void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24); /*The following definitions come from smbencrypt.c */ +void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); +void E_md4hash(uchar *passwd, uchar *p16); +void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); +void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); +void E_md4hash(uchar *passwd, uchar *p16); +void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); +void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); +void E_md4hash(uchar *passwd, uchar *p16); +void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); void E_md4hash(uchar *passwd, uchar *p16); void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); /*The following definitions come from smbpass.c */ +int pw_file_lock(char *name, int type, int secs); +int pw_file_unlock(int fd); +struct smb_passwd *get_smbpwnam(char *name); int pw_file_lock(char *name, int type, int secs); int pw_file_unlock(int fd); struct smb_passwd *get_smbpwnam(char *name); @@ -817,6 +1417,60 @@ unsigned int Ucrit_checkPid(int pid); /*The following definitions come from system.c */ +int sys_select(fd_set *fds,struct timeval *tval); +int sys_select(fd_set *fds,struct timeval *tval); +int sys_unlink(char *fname); +int sys_open(char *fname,int flags,int mode); +DIR *sys_opendir(char *dname); +int sys_stat(char *fname,struct stat *sbuf); +int sys_waitpid(pid_t pid,int *status,int options); +int sys_lstat(char *fname,struct stat *sbuf); +int sys_mkdir(char *dname,int mode); +int sys_rmdir(char *dname); +int sys_chdir(char *dname); +int sys_utime(char *fname,struct utimbuf *times); +int sys_rename(char *from, char *to); +int sys_chmod(char *fname,int mode); +char *sys_getwd(char *s); +int sys_chown(char *fname,int uid,int gid); +int sys_chroot(char *dname); +struct hostent *sys_gethostbyname(char *name); +int sys_select(fd_set *fds,struct timeval *tval); +int sys_select(fd_set *fds,struct timeval *tval); +int sys_unlink(char *fname); +int sys_open(char *fname,int flags,int mode); +DIR *sys_opendir(char *dname); +int sys_stat(char *fname,struct stat *sbuf); +int sys_waitpid(pid_t pid,int *status,int options); +int sys_lstat(char *fname,struct stat *sbuf); +int sys_mkdir(char *dname,int mode); +int sys_rmdir(char *dname); +int sys_chdir(char *dname); +int sys_utime(char *fname,struct utimbuf *times); +int sys_rename(char *from, char *to); +int sys_chmod(char *fname,int mode); +char *sys_getwd(char *s); +int sys_chown(char *fname,int uid,int gid); +int sys_chroot(char *dname); +struct hostent *sys_gethostbyname(char *name); +int sys_select(fd_set *fds,struct timeval *tval); +int sys_select(fd_set *fds,struct timeval *tval); +int sys_unlink(char *fname); +int sys_open(char *fname,int flags,int mode); +DIR *sys_opendir(char *dname); +int sys_stat(char *fname,struct stat *sbuf); +int sys_waitpid(pid_t pid,int *status,int options); +int sys_lstat(char *fname,struct stat *sbuf); +int sys_mkdir(char *dname,int mode); +int sys_rmdir(char *dname); +int sys_chdir(char *dname); +int sys_utime(char *fname,struct utimbuf *times); +int sys_rename(char *from, char *to); +int sys_chmod(char *fname,int mode); +char *sys_getwd(char *s); +int sys_chown(char *fname,int uid,int gid); +int sys_chroot(char *dname); +struct hostent *sys_gethostbyname(char *name); int sys_select(fd_set *fds,struct timeval *tval); int sys_select(fd_set *fds,struct timeval *tval); int sys_unlink(char *fname); @@ -845,6 +1499,48 @@ int main(int argc, char *argv[]); /*The following definitions come from time.c */ +void GetTimeOfDay(struct timeval *tval); +void TimeInit(void); +int TimeDiff(time_t t); +struct tm *LocalTime(time_t *t); +time_t interpret_long_date(char *p); +void put_long_date(char *p,time_t t); +void put_dos_date(char *buf,int offset,time_t unixdate); +void put_dos_date2(char *buf,int offset,time_t unixdate); +void put_dos_date3(char *buf,int offset,time_t unixdate); +time_t make_unix_date(void *date_ptr); +time_t make_unix_date2(void *date_ptr); +time_t make_unix_date3(void *date_ptr); +BOOL set_filetime(char *fname,time_t mtime); +char *timestring(void ); +void GetTimeOfDay(struct timeval *tval); +void TimeInit(void); +int TimeDiff(time_t t); +struct tm *LocalTime(time_t *t); +time_t interpret_long_date(char *p); +void put_long_date(char *p,time_t t); +void put_dos_date(char *buf,int offset,time_t unixdate); +void put_dos_date2(char *buf,int offset,time_t unixdate); +void put_dos_date3(char *buf,int offset,time_t unixdate); +time_t make_unix_date(void *date_ptr); +time_t make_unix_date2(void *date_ptr); +time_t make_unix_date3(void *date_ptr); +BOOL set_filetime(char *fname,time_t mtime); +char *timestring(void ); +void GetTimeOfDay(struct timeval *tval); +void TimeInit(void); +int TimeDiff(time_t t); +struct tm *LocalTime(time_t *t); +time_t interpret_long_date(char *p); +void put_long_date(char *p,time_t t); +void put_dos_date(char *buf,int offset,time_t unixdate); +void put_dos_date2(char *buf,int offset,time_t unixdate); +void put_dos_date3(char *buf,int offset,time_t unixdate); +time_t make_unix_date(void *date_ptr); +time_t make_unix_date2(void *date_ptr); +time_t make_unix_date3(void *date_ptr); +BOOL set_filetime(char *fname,time_t mtime); +char *timestring(void ); void GetTimeOfDay(struct timeval *tval); void TimeInit(void); int TimeDiff(time_t t); @@ -869,6 +1565,7 @@ int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize); /*The following definitions come from ufc.c */ +char *ufc_crypt(char *key,char *salt); char *ufc_crypt(char *key,char *salt); /*The following definitions come from uid.c */ @@ -881,6 +1578,18 @@ int smbrun(char *cmd,char *outfile,BOOL shared); /*The following definitions come from username.c */ +char *get_home_dir(char *user); +void map_username(char *user); +struct passwd *Get_Pwnam(char *user,BOOL allow_change); +BOOL user_in_list(char *user,char *list); +char *get_home_dir(char *user); +void map_username(char *user); +struct passwd *Get_Pwnam(char *user,BOOL allow_change); +BOOL user_in_list(char *user,char *list); +char *get_home_dir(char *user); +void map_username(char *user); +struct passwd *Get_Pwnam(char *user,BOOL allow_change); +BOOL user_in_list(char *user,char *list); char *get_home_dir(char *user); void map_username(char *user); struct passwd *Get_Pwnam(char *user,BOOL allow_change); @@ -1007,24 +1716,360 @@ void file_unlock(int fd); BOOL is_myname(char *s); void set_remote_arch(enum remote_arch_types type); enum remote_arch_types get_remote_arch(); - -/*The following definitions come from vt_mode.c */ - -int VT_Check(char *buffer); -int VT_Start_utmp(void); -int VT_Stop_utmp(void); -void VT_AtExit(void); -void VT_SigCLD(int sig); -void VT_SigEXIT(int sig); -int VT_Start(void); -int VT_Output(char *Buffer); -int VT_Input(char *Buffer,int Size); -void VT_Process(void); - -/*The following definitions come from wsmbconf.c */ - -int main(int argc, char *argv[]); - -/*The following definitions come from wsmbstatus.c */ - -int main(int argc, char *argv[]); +void setup_logging(char *pname,BOOL interactive); +void reopen_logs(void); +char *tmpdir(void); +BOOL is_a_socket(int fd); +BOOL next_token(char **ptr,char *buff,char *sep); +char **toktocliplist(int *ctok, char *sep); +void *MemMove(void *dest,void *src,int size); +void array_promote(char *array,int elsize,int element); +void set_socket_options(int fd, char *options); +void close_sockets(void ); +BOOL in_group(gid_t group, int current_gid, int ngroups, int *groups); +char *StrCpy(char *dest,char *src); +char *StrnCpy(char *dest,char *src,int n); +void putip(void *dest,void *src); +int name_mangle(char *In,char *Out,char name_type); +BOOL file_exist(char *fname,struct stat *sbuf); +time_t file_modtime(char *fname); +BOOL directory_exist(char *dname,struct stat *st); +uint32 file_size(char *file_name); +char *attrib_string(int mode); +int StrCaseCmp(char *s, char *t); +int StrnCaseCmp(char *s, char *t, int n); +BOOL strequal(char *s1, char *s2); +BOOL strnequal(char *s1,char *s2,int n); +BOOL strcsequal(char *s1,char *s2); +void strlower(char *s); +void strupper(char *s); +void strnorm(char *s); +BOOL strisnormal(char *s); +void string_replace(char *s,char oldc,char newc); +void unix_format(char *fname); +void dos_format(char *fname); +void show_msg(char *buf); +int smb_len(char *buf); +void _smb_setlen(char *buf,int len); +void smb_setlen(char *buf,int len); +int set_message(char *buf,int num_words,int num_bytes,BOOL zero); +int smb_numwords(char *buf); +int smb_buflen(char *buf); +int smb_buf_ofs(char *buf); +char *smb_buf(char *buf); +int smb_offset(char *p,char *buf); +char *skip_string(char *buf,int n); +BOOL trim_string(char *s,char *front,char *back); +void dos_clean_name(char *s); +void unix_clean_name(char *s); +int ChDir(char *path); +char *GetWd(char *str); +BOOL reduce_name(char *s,char *dir,BOOL widelinks); +void expand_mask(char *Mask,BOOL doext); +BOOL strhasupper(char *s); +BOOL strhaslower(char *s); +int count_chars(char *s,char c); +void make_dir_struct(char *buf,char *mask,char *fname,unsigned int size,int mode,time_t date); +void close_low_fds(void); +int set_blocking(int fd, BOOL set); +int write_socket(int fd,char *buf,int len); +int read_udp_socket(int fd,char *buf,int len); +int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out); +int read_max_udp(int fd,char *buffer,int bufsize,int maxtime); +int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew); +BOOL send_keepalive(int client); +int read_data(int fd,char *buffer,int N); +int write_data(int fd,char *buffer,int N); +int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align); +int read_smb_length(int fd,char *inbuf,int timeout); +BOOL receive_smb(int fd,char *buffer,int timeout); +BOOL send_smb(int fd,char *buffer); +char *name_ptr(char *buf,int ofs); +int name_extract(char *buf,int ofs,char *name); +int name_len(char *s); +BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type); +void msleep(int t); +BOOL in_list(char *s,char *list,BOOL casesensitive); +BOOL string_init(char **dest,char *src); +void string_free(char **s); +BOOL string_set(char **dest,char *src); +BOOL string_sub(char *s,char *pattern,char *insert); +BOOL do_match(char *str, char *regexp, int case_sig); +BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2); +void become_daemon(void); +BOOL yesno(char *p); +char *fgets_slash(char *s2,int maxlen,FILE *f); +int set_filelen(int fd, long len); +int byte_checksum(char *buf,int len); +char *dirname_dos(char *path,char *buf); +void *Realloc(void *p,int size); +void Abort(void ); +BOOL get_myname(char *my_name,struct in_addr *ip); +BOOL ip_equal(struct in_addr ip1,struct in_addr ip2); +int open_socket_in(int type, int port, int dlevel,uint32 socket_addr); +int open_socket_out(int type, struct in_addr *addr, int port ,int timeout); +int interpret_protocol(char *str,int def); +int interpret_security(char *str,int def); +uint32 interpret_addr(char *str); +struct in_addr *interpret_addr2(char *str); +BOOL zero_ip(struct in_addr ip); +void reset_globals_after_fork(); +char *client_name(void); +char *client_addr(void); +void standard_sub_basic(char *str); +BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask); +int PutUniCode(char *dst,char *src); +struct hostent *Get_Hostbyname(char *name); +BOOL process_exists(int pid); +char *uidtoname(int uid); +char *gidtoname(int gid); +void BlockSignals(BOOL block,int signum); +void ajt_panic(void); +char *readdirname(void *p); +BOOL is_in_path(char *name, name_compare_entry *namelist); +void set_namearray(name_compare_entry **ppname_array, char *namelist); +void free_namearray(name_compare_entry *name_array); +BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); +int file_lock(char *name,int timeout); +void file_unlock(int fd); +BOOL is_myname(char *s); +void set_remote_arch(enum remote_arch_types type); +enum remote_arch_types get_remote_arch(); +void setup_logging(char *pname,BOOL interactive); +void reopen_logs(void); +char *tmpdir(void); +BOOL is_a_socket(int fd); +BOOL next_token(char **ptr,char *buff,char *sep); +char **toktocliplist(int *ctok, char *sep); +void *MemMove(void *dest,void *src,int size); +void array_promote(char *array,int elsize,int element); +void set_socket_options(int fd, char *options); +void close_sockets(void ); +BOOL in_group(gid_t group, int current_gid, int ngroups, int *groups); +char *StrCpy(char *dest,char *src); +char *StrnCpy(char *dest,char *src,int n); +void putip(void *dest,void *src); +int name_mangle(char *In,char *Out,char name_type); +BOOL file_exist(char *fname,struct stat *sbuf); +time_t file_modtime(char *fname); +BOOL directory_exist(char *dname,struct stat *st); +uint32 file_size(char *file_name); +char *attrib_string(int mode); +int StrCaseCmp(char *s, char *t); +int StrnCaseCmp(char *s, char *t, int n); +BOOL strequal(char *s1, char *s2); +BOOL strnequal(char *s1,char *s2,int n); +BOOL strcsequal(char *s1,char *s2); +void strlower(char *s); +void strupper(char *s); +void strnorm(char *s); +BOOL strisnormal(char *s); +void string_replace(char *s,char oldc,char newc); +void unix_format(char *fname); +void dos_format(char *fname); +void show_msg(char *buf); +int smb_len(char *buf); +void _smb_setlen(char *buf,int len); +void smb_setlen(char *buf,int len); +int set_message(char *buf,int num_words,int num_bytes,BOOL zero); +int smb_numwords(char *buf); +int smb_buflen(char *buf); +int smb_buf_ofs(char *buf); +char *smb_buf(char *buf); +int smb_offset(char *p,char *buf); +char *skip_string(char *buf,int n); +BOOL trim_string(char *s,char *front,char *back); +void dos_clean_name(char *s); +void unix_clean_name(char *s); +int ChDir(char *path); +char *GetWd(char *str); +BOOL reduce_name(char *s,char *dir,BOOL widelinks); +void expand_mask(char *Mask,BOOL doext); +BOOL strhasupper(char *s); +BOOL strhaslower(char *s); +int count_chars(char *s,char c); +void make_dir_struct(char *buf,char *mask,char *fname,unsigned int size,int mode,time_t date); +void close_low_fds(void); +int set_blocking(int fd, BOOL set); +int write_socket(int fd,char *buf,int len); +int read_udp_socket(int fd,char *buf,int len); +int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out); +int read_max_udp(int fd,char *buffer,int bufsize,int maxtime); +int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew); +BOOL send_keepalive(int client); +int read_data(int fd,char *buffer,int N); +int write_data(int fd,char *buffer,int N); +int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align); +int read_smb_length(int fd,char *inbuf,int timeout); +BOOL receive_smb(int fd,char *buffer,int timeout); +BOOL send_smb(int fd,char *buffer); +char *name_ptr(char *buf,int ofs); +int name_extract(char *buf,int ofs,char *name); +int name_len(char *s); +BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type); +void msleep(int t); +BOOL in_list(char *s,char *list,BOOL casesensitive); +BOOL string_init(char **dest,char *src); +void string_free(char **s); +BOOL string_set(char **dest,char *src); +BOOL string_sub(char *s,char *pattern,char *insert); +BOOL do_match(char *str, char *regexp, int case_sig); +BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2); +void become_daemon(void); +BOOL yesno(char *p); +char *fgets_slash(char *s2,int maxlen,FILE *f); +int set_filelen(int fd, long len); +int byte_checksum(char *buf,int len); +char *dirname_dos(char *path,char *buf); +void *Realloc(void *p,int size); +void Abort(void ); +BOOL get_myname(char *my_name,struct in_addr *ip); +BOOL ip_equal(struct in_addr ip1,struct in_addr ip2); +int open_socket_in(int type, int port, int dlevel,uint32 socket_addr); +int open_socket_out(int type, struct in_addr *addr, int port ,int timeout); +int interpret_protocol(char *str,int def); +int interpret_security(char *str,int def); +uint32 interpret_addr(char *str); +struct in_addr *interpret_addr2(char *str); +BOOL zero_ip(struct in_addr ip); +void reset_globals_after_fork(); +char *client_name(void); +char *client_addr(void); +void standard_sub_basic(char *str); +BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask); +int PutUniCode(char *dst,char *src); +struct hostent *Get_Hostbyname(char *name); +BOOL process_exists(int pid); +char *uidtoname(int uid); +char *gidtoname(int gid); +void BlockSignals(BOOL block,int signum); +void ajt_panic(void); +char *readdirname(void *p); +BOOL is_in_path(char *name, name_compare_entry *namelist); +void set_namearray(name_compare_entry **ppname_array, char *namelist); +void free_namearray(name_compare_entry *name_array); +BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); +int file_lock(char *name,int timeout); +void file_unlock(int fd); +BOOL is_myname(char *s); +void set_remote_arch(enum remote_arch_types type); +enum remote_arch_types get_remote_arch(); +void setup_logging(char *pname,BOOL interactive); +void reopen_logs(void); +char *tmpdir(void); +BOOL is_a_socket(int fd); +BOOL next_token(char **ptr,char *buff,char *sep); +char **toktocliplist(int *ctok, char *sep); +void *MemMove(void *dest,void *src,int size); +void array_promote(char *array,int elsize,int element); +void set_socket_options(int fd, char *options); +void close_sockets(void ); +BOOL in_group(gid_t group, int current_gid, int ngroups, int *groups); +char *StrCpy(char *dest,char *src); +char *StrnCpy(char *dest,char *src,int n); +void putip(void *dest,void *src); +int name_mangle(char *In,char *Out,char name_type); +BOOL file_exist(char *fname,struct stat *sbuf); +time_t file_modtime(char *fname); +BOOL directory_exist(char *dname,struct stat *st); +uint32 file_size(char *file_name); +char *attrib_string(int mode); +int StrCaseCmp(char *s, char *t); +int StrnCaseCmp(char *s, char *t, int n); +BOOL strequal(char *s1, char *s2); +BOOL strnequal(char *s1,char *s2,int n); +BOOL strcsequal(char *s1,char *s2); +void strlower(char *s); +void strupper(char *s); +void strnorm(char *s); +BOOL strisnormal(char *s); +void string_replace(char *s,char oldc,char newc); +void unix_format(char *fname); +void dos_format(char *fname); +void show_msg(char *buf); +int smb_len(char *buf); +void _smb_setlen(char *buf,int len); +void smb_setlen(char *buf,int len); +int set_message(char *buf,int num_words,int num_bytes,BOOL zero); +int smb_numwords(char *buf); +int smb_buflen(char *buf); +int smb_buf_ofs(char *buf); +char *smb_buf(char *buf); +int smb_offset(char *p,char *buf); +char *skip_string(char *buf,int n); +BOOL trim_string(char *s,char *front,char *back); +void dos_clean_name(char *s); +void unix_clean_name(char *s); +int ChDir(char *path); +char *GetWd(char *str); +BOOL reduce_name(char *s,char *dir,BOOL widelinks); +void expand_mask(char *Mask,BOOL doext); +BOOL strhasupper(char *s); +BOOL strhaslower(char *s); +int count_chars(char *s,char c); +void make_dir_struct(char *buf,char *mask,char *fname,unsigned int size,int mode,time_t date); +void close_low_fds(void); +int set_blocking(int fd, BOOL set); +int write_socket(int fd,char *buf,int len); +int read_udp_socket(int fd,char *buf,int len); +int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out); +int read_max_udp(int fd,char *buffer,int bufsize,int maxtime); +int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew); +BOOL send_keepalive(int client); +int read_data(int fd,char *buffer,int N); +int write_data(int fd,char *buffer,int N); +int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align); +int read_smb_length(int fd,char *inbuf,int timeout); +BOOL receive_smb(int fd,char *buffer,int timeout); +BOOL send_smb(int fd,char *buffer); +char *name_ptr(char *buf,int ofs); +int name_extract(char *buf,int ofs,char *name); +int name_len(char *s); +BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type); +void msleep(int t); +BOOL in_list(char *s,char *list,BOOL casesensitive); +BOOL string_init(char **dest,char *src); +void string_free(char **s); +BOOL string_set(char **dest,char *src); +BOOL string_sub(char *s,char *pattern,char *insert); +BOOL do_match(char *str, char *regexp, int case_sig); +BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2); +void become_daemon(void); +BOOL yesno(char *p); +char *fgets_slash(char *s2,int maxlen,FILE *f); +int set_filelen(int fd, long len); +int byte_checksum(char *buf,int len); +char *dirname_dos(char *path,char *buf); +void *Realloc(void *p,int size); +void Abort(void ); +BOOL get_myname(char *my_name,struct in_addr *ip); +BOOL ip_equal(struct in_addr ip1,struct in_addr ip2); +int open_socket_in(int type, int port, int dlevel,uint32 socket_addr); +int open_socket_out(int type, struct in_addr *addr, int port ,int timeout); +int interpret_protocol(char *str,int def); +int interpret_security(char *str,int def); +uint32 interpret_addr(char *str); +struct in_addr *interpret_addr2(char *str); +BOOL zero_ip(struct in_addr ip); +void reset_globals_after_fork(); +char *client_name(void); +char *client_addr(void); +void standard_sub_basic(char *str); +BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask); +int PutUniCode(char *dst,char *src); +struct hostent *Get_Hostbyname(char *name); +BOOL process_exists(int pid); +char *uidtoname(int uid); +char *gidtoname(int gid); +void BlockSignals(BOOL block,int signum); +void ajt_panic(void); +char *readdirname(void *p); +BOOL is_in_path(char *name, name_compare_entry *namelist); +void set_namearray(name_compare_entry **ppname_array, char *namelist); +void free_namearray(name_compare_entry *name_array); +BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); +int file_lock(char *name,int timeout); +void file_unlock(int fd); +BOOL is_myname(char *s); +void set_remote_arch(enum remote_arch_types type); +enum remote_arch_types get_remote_arch(); -- cgit From b3c610541b7284cbd59827b13af86a457268ae96 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 23 Sep 1997 16:09:12 +0000 Subject: added code from Philip A Prindeville which expands the interfaces option to this: "interfaces = le0 le1" or "interfaces = all". it uses SIOCGIFxxxx ioctl calls. (This used to be commit 39071415ba6f8a00e2909e443261d0059fe27e82) --- source3/include/smb.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 6ef0e6f9d0..05f73f7f45 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -433,6 +433,9 @@ struct interface struct in_addr ip; struct in_addr bcast; struct in_addr nmask; + char *name; + size_t mtu; /* may be useful in future... */ + short flags; }; /* share mode record pointed to in shared memory hash bucket */ -- cgit From 81eb442e88e8231b8e9c556c1ee393e99269af78 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 23 Sep 1997 19:19:06 +0000 Subject: Checkin to sync up oplock development code so that NT domain development code won't diverge. Makefile: Fixed make proto (again). Added GLIBC2 fixes for Linux. includes.h: Added GLIBC2 fixes for Linux. proto.h: Much tidier. quotas.c: OSF/1 quota fix. reply.c: Fix from Ray Frush for zero NT timestamps. server.c util.c: First oplock checkin - nowhere near finished so bracketed with #ifdef USE_OPLOCKS. Done to make sync with NT domain code easier. Jeremy (jallison@whistle.com) (This used to be commit 7dce7d84473beb5663b14a8ab32781970819c19d) --- source3/include/includes.h | 8 + source3/include/proto.h | 2242 ++++++++++++-------------------------------- 2 files changed, 582 insertions(+), 1668 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index a63f8f8597..e66ceb2d70 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -217,6 +217,14 @@ Here come some platform specific sections #ifndef NO_ASMSIGNALH #include #endif +#ifdef GLIBC2 +#define _LINUX_C_LIB_VERSION_MAJOR 6 +#include +#include +#include +#include +#include +#endif #define SIGNAL_CAST (__sighandler_t) #define USE_GETCWD #define USE_SETSID diff --git a/source3/include/proto.h b/source3/include/proto.h index 0e6a90a8f3..9c6cccb370 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -3,37 +3,17 @@ /*The following definitions come from access.c */ -BOOL check_access(int snum); -BOOL allow_access(char *deny_list,char *allow_list,char *cname,char *caddr); BOOL check_access(int snum); BOOL allow_access(char *deny_list,char *allow_list,char *cname,char *caddr); /*The following definitions come from charcnv.c */ -char *unix2dos_format(char *str,BOOL overwrite); -char *dos2unix_format(char *str, BOOL overwrite); -int interpret_character_set(char *str, int def); -char *unix2dos_format(char *str,BOOL overwrite); -char *dos2unix_format(char *str, BOOL overwrite); -int interpret_character_set(char *str, int def); -char *unix2dos_format(char *str,BOOL overwrite); -char *dos2unix_format(char *str, BOOL overwrite); -int interpret_character_set(char *str, int def); char *unix2dos_format(char *str,BOOL overwrite); char *dos2unix_format(char *str, BOOL overwrite); int interpret_character_set(char *str, int def); /*The following definitions come from charset.c */ -void charset_initialise(); -void codepage_initialise(int client_codepage); -void add_char_string(char *s); -void charset_initialise(); -void codepage_initialise(int client_codepage); -void add_char_string(char *s); -void charset_initialise(); -void codepage_initialise(int client_codepage); -void add_char_string(char *s); void charset_initialise(); void codepage_initialise(int client_codepage); void add_char_string(char *s); @@ -110,9 +90,6 @@ void DirCacheFlush(int snum); /*The following definitions come from fault.c */ -void fault_setup(void (*fn)()); -void fault_setup(void (*fn)()); -void fault_setup(void (*fn)()); void fault_setup(void (*fn)()); /*The following definitions come from getsmbpass.c */ @@ -121,33 +98,6 @@ char *getsmbpass(char *prompt) ; /*The following definitions come from interface.c */ -void load_interfaces(void); -void iface_set_default(char *ip,char *bcast,char *nmask); -BOOL ismyip(struct in_addr ip); -BOOL ismybcast(struct in_addr bcast); -int iface_count(void); -struct in_addr *iface_n_ip(int n); -struct in_addr *iface_bcast(struct in_addr ip); -struct in_addr *iface_nmask(struct in_addr ip); -struct in_addr *iface_ip(struct in_addr ip); -void load_interfaces(void); -void iface_set_default(char *ip,char *bcast,char *nmask); -BOOL ismyip(struct in_addr ip); -BOOL ismybcast(struct in_addr bcast); -int iface_count(void); -struct in_addr *iface_n_ip(int n); -struct in_addr *iface_bcast(struct in_addr ip); -struct in_addr *iface_nmask(struct in_addr ip); -struct in_addr *iface_ip(struct in_addr ip); -void load_interfaces(void); -void iface_set_default(char *ip,char *bcast,char *nmask); -BOOL ismyip(struct in_addr ip); -BOOL ismybcast(struct in_addr bcast); -int iface_count(void); -struct in_addr *iface_n_ip(int n); -struct in_addr *iface_bcast(struct in_addr ip); -struct in_addr *iface_nmask(struct in_addr ip); -struct in_addr *iface_ip(struct in_addr ip); void load_interfaces(void); void iface_set_default(char *ip,char *bcast,char *nmask); BOOL ismyip(struct in_addr ip); @@ -164,21 +114,6 @@ int reply_trans(char *inbuf,char *outbuf); /*The following definitions come from kanji.c */ -char *sj_strtok(char *s1, char *s2); -char *sj_strstr(char *s1, char *s2); -char *sj_strchr (char *s, int c); -char *sj_strrchr(char *s, int c); -int interpret_coding_system(char *str, int def); -char *sj_strtok(char *s1, char *s2); -char *sj_strstr(char *s1, char *s2); -char *sj_strchr (char *s, int c); -char *sj_strrchr(char *s, int c); -int interpret_coding_system(char *str, int def); -char *sj_strtok(char *s1, char *s2); -char *sj_strstr(char *s1, char *s2); -char *sj_strchr (char *s, int c); -char *sj_strrchr(char *s, int c); -int interpret_coding_system(char *str, int def); char *sj_strtok(char *s1, char *s2); char *sj_strstr(char *s1, char *s2); char *sj_strchr (char *s, int c); @@ -351,1609 +286,577 @@ void lp_copy_service(int snum, char *new_name); int lp_default_server_announce(void); int lp_major_announce_version(void); int lp_minor_announce_version(void); -char *lp_string(char *s); -char *lp_logfile(void); -char *lp_smbrun(void); -char *lp_configfile(void); -char *lp_smb_passwd_file(void); -char *lp_serverstring(void); -char *lp_printcapname(void); -char *lp_lockdir(void); -char *lp_rootdir(void); -char *lp_defaultservice(void); -char *lp_msg_command(void); -char *lp_dfree_command(void); -char *lp_hosts_equiv(void); -char *lp_auto_services(void); -char *lp_passwd_program(void); -char *lp_passwd_chat(void); -char *lp_passwordserver(void); -char *lp_workgroup(void); -char *lp_domain_controller(void); -char *lp_username_map(void); -char *lp_character_set(void); -char *lp_logon_script(void); -char *lp_logon_path(void); -char *lp_remote_announce(void); -char *lp_wins_server(void); -char *lp_interfaces(void); -char *lp_socket_address(void); -char *lp_nis_home_map_name(void); -char *lp_announce_version(void); -char *lp_netbios_aliases(void); -BOOL lp_dns_proxy(void); -BOOL lp_wins_support(void); -BOOL lp_wins_proxy(void); -BOOL lp_local_master(void); -BOOL lp_domain_master(void); -BOOL lp_domain_logons(void); -BOOL lp_preferred_master(void); -BOOL lp_load_printers(void); -BOOL lp_use_rhosts(void); -BOOL lp_getwdcache(void); -BOOL lp_readprediction(void); -BOOL lp_readbmpx(void); -BOOL lp_readraw(void); -BOOL lp_writeraw(void); -BOOL lp_null_passwords(void); -BOOL lp_strip_dot(void); -BOOL lp_encrypted_passwords(void); -BOOL lp_syslog_only(void); -BOOL lp_browse_list(void); -BOOL lp_unix_realname(void); -BOOL lp_nis_home_map(void); -BOOL lp_time_server(void); -int lp_os_level(void); -int lp_max_ttl(void); -int lp_max_log_size(void); -int lp_mangledstack(void); -int lp_maxxmit(void); -int lp_maxmux(void); -int lp_maxpacket(void); -int lp_keepalive(void); -int lp_passwordlevel(void); -int lp_usernamelevel(void); -int lp_readsize(void); -int lp_shmem_size(void); -int lp_shmem_hash_size(void); -int lp_deadtime(void); -int lp_maxprotocol(void); -int lp_security(void); -int lp_printing(void); -int lp_maxdisksize(void); -int lp_lpqcachetime(void); -int lp_syslog(void); -int lp_client_code_page(void); -int lp_announce_as(void); -char *lp_preexec(int ); -char *lp_postexec(int ); -char *lp_rootpreexec(int ); -char *lp_rootpostexec(int ); -char *lp_servicename(int ); -char *lp_pathname(int ); -char *lp_dontdescend(int ); -char *lp_username(int ); -char *lp_guestaccount(int ); -char *lp_invalid_users(int ); -char *lp_valid_users(int ); -char *lp_admin_users(int ); -char *lp_printcommand(int ); -char *lp_lpqcommand(int ); -char *lp_lprmcommand(int ); -char *lp_lppausecommand(int ); -char *lp_lpresumecommand(int ); -char *lp_printername(int ); -char *lp_printerdriver(int ); -char *lp_hostsallow(int ); -char *lp_hostsdeny(int ); -char *lp_magicscript(int ); -char *lp_magicoutput(int ); -char *lp_comment(int ); -char *lp_force_user(int ); -char *lp_force_group(int ); -char *lp_readlist(int ); -char *lp_writelist(int ); -char *lp_volume(int ); -char *lp_mangled_map(int ); -char *lp_veto_files(int ); -char *lp_hide_files(int ); -BOOL lp_alternate_permissions(int ); -BOOL lp_revalidate(int ); -BOOL lp_casesensitive(int ); -BOOL lp_preservecase(int ); -BOOL lp_shortpreservecase(int ); -BOOL lp_casemangle(int ); -BOOL lp_status(int ); -BOOL lp_hide_dot_files(int ); -BOOL lp_browseable(int ); -BOOL lp_readonly(int ); -BOOL lp_no_set_dir(int ); -BOOL lp_guest_ok(int ); -BOOL lp_guest_only(int ); -BOOL lp_print_ok(int ); -BOOL lp_postscript(int ); -BOOL lp_map_hidden(int ); -BOOL lp_map_archive(int ); -BOOL lp_locking(int ); -BOOL lp_strict_locking(int ); -BOOL lp_share_modes(int ); -BOOL lp_onlyuser(int ); -BOOL lp_manglednames(int ); -BOOL lp_widelinks(int ); -BOOL lp_symlinks(int ); -BOOL lp_syncalways(int ); -BOOL lp_map_system(int ); -BOOL lp_delete_readonly(int ); -BOOL lp_fake_oplocks(int ); -BOOL lp_recursive_veto_delete(int ); -int lp_create_mode(int ); -int lp_force_create_mode(int ); -int lp_dir_mode(int ); -int lp_force_dir_mode(int ); -int lp_max_connections(int ); -int lp_defaultcase(int ); -int lp_minprintspace(int ); -char lp_magicchar(int ); -BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir); -int lp_add_service(char *pszService, int iDefaultService); -BOOL lp_add_printer(char *pszPrintername, int iDefaultService); -BOOL lp_file_list_changed(void); -BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue); -int lp_next_parameter(int snum, int *i, char *label, - char *value, int allparameters); -BOOL lp_snum_ok(int iService); -BOOL lp_loaded(void); -void lp_killunused(BOOL (*snumused)(int )); -BOOL lp_load(char *pszFname,BOOL global_only); -int lp_numservices(void); -void lp_dump(FILE *f); -int lp_servicenumber(char *pszServiceName); -char *volume_label(int snum); -void lp_rename_service(int snum, char *new_name); -void lp_remove_service(int snum); -void lp_copy_service(int snum, char *new_name); -int lp_default_server_announce(void); -int lp_major_announce_version(void); -int lp_minor_announce_version(void); -char *lp_string(char *s); -char *lp_logfile(void); -char *lp_smbrun(void); -char *lp_configfile(void); -char *lp_smb_passwd_file(void); -char *lp_serverstring(void); -char *lp_printcapname(void); -char *lp_lockdir(void); -char *lp_rootdir(void); -char *lp_defaultservice(void); -char *lp_msg_command(void); -char *lp_dfree_command(void); -char *lp_hosts_equiv(void); -char *lp_auto_services(void); -char *lp_passwd_program(void); -char *lp_passwd_chat(void); -char *lp_passwordserver(void); -char *lp_workgroup(void); -char *lp_domain_controller(void); -char *lp_username_map(void); -char *lp_character_set(void); -char *lp_logon_script(void); -char *lp_logon_path(void); -char *lp_remote_announce(void); -char *lp_wins_server(void); -char *lp_interfaces(void); -char *lp_socket_address(void); -char *lp_nis_home_map_name(void); -char *lp_announce_version(void); -char *lp_netbios_aliases(void); -BOOL lp_dns_proxy(void); -BOOL lp_wins_support(void); -BOOL lp_wins_proxy(void); -BOOL lp_local_master(void); -BOOL lp_domain_master(void); -BOOL lp_domain_logons(void); -BOOL lp_preferred_master(void); -BOOL lp_load_printers(void); -BOOL lp_use_rhosts(void); -BOOL lp_getwdcache(void); -BOOL lp_readprediction(void); -BOOL lp_readbmpx(void); -BOOL lp_readraw(void); -BOOL lp_writeraw(void); -BOOL lp_null_passwords(void); -BOOL lp_strip_dot(void); -BOOL lp_encrypted_passwords(void); -BOOL lp_syslog_only(void); -BOOL lp_browse_list(void); -BOOL lp_unix_realname(void); -BOOL lp_nis_home_map(void); -BOOL lp_time_server(void); -int lp_os_level(void); -int lp_max_ttl(void); -int lp_max_log_size(void); -int lp_mangledstack(void); -int lp_maxxmit(void); -int lp_maxmux(void); -int lp_maxpacket(void); -int lp_keepalive(void); -int lp_passwordlevel(void); -int lp_usernamelevel(void); -int lp_readsize(void); -int lp_shmem_size(void); -int lp_shmem_hash_size(void); -int lp_deadtime(void); -int lp_maxprotocol(void); -int lp_security(void); -int lp_printing(void); -int lp_maxdisksize(void); -int lp_lpqcachetime(void); -int lp_syslog(void); -int lp_client_code_page(void); -int lp_announce_as(void); -char *lp_preexec(int ); -char *lp_postexec(int ); -char *lp_rootpreexec(int ); -char *lp_rootpostexec(int ); -char *lp_servicename(int ); -char *lp_pathname(int ); -char *lp_dontdescend(int ); -char *lp_username(int ); -char *lp_guestaccount(int ); -char *lp_invalid_users(int ); -char *lp_valid_users(int ); -char *lp_admin_users(int ); -char *lp_printcommand(int ); -char *lp_lpqcommand(int ); -char *lp_lprmcommand(int ); -char *lp_lppausecommand(int ); -char *lp_lpresumecommand(int ); -char *lp_printername(int ); -char *lp_printerdriver(int ); -char *lp_hostsallow(int ); -char *lp_hostsdeny(int ); -char *lp_magicscript(int ); -char *lp_magicoutput(int ); -char *lp_comment(int ); -char *lp_force_user(int ); -char *lp_force_group(int ); -char *lp_readlist(int ); -char *lp_writelist(int ); -char *lp_volume(int ); -char *lp_mangled_map(int ); -char *lp_veto_files(int ); -char *lp_hide_files(int ); -BOOL lp_alternate_permissions(int ); -BOOL lp_revalidate(int ); -BOOL lp_casesensitive(int ); -BOOL lp_preservecase(int ); -BOOL lp_shortpreservecase(int ); -BOOL lp_casemangle(int ); -BOOL lp_status(int ); -BOOL lp_hide_dot_files(int ); -BOOL lp_browseable(int ); -BOOL lp_readonly(int ); -BOOL lp_no_set_dir(int ); -BOOL lp_guest_ok(int ); -BOOL lp_guest_only(int ); -BOOL lp_print_ok(int ); -BOOL lp_postscript(int ); -BOOL lp_map_hidden(int ); -BOOL lp_map_archive(int ); -BOOL lp_locking(int ); -BOOL lp_strict_locking(int ); -BOOL lp_share_modes(int ); -BOOL lp_onlyuser(int ); -BOOL lp_manglednames(int ); -BOOL lp_widelinks(int ); -BOOL lp_symlinks(int ); -BOOL lp_syncalways(int ); -BOOL lp_map_system(int ); -BOOL lp_delete_readonly(int ); -BOOL lp_fake_oplocks(int ); -BOOL lp_recursive_veto_delete(int ); -int lp_create_mode(int ); -int lp_force_create_mode(int ); -int lp_dir_mode(int ); -int lp_force_dir_mode(int ); -int lp_max_connections(int ); -int lp_defaultcase(int ); -int lp_minprintspace(int ); -char lp_magicchar(int ); -BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir); -int lp_add_service(char *pszService, int iDefaultService); -BOOL lp_add_printer(char *pszPrintername, int iDefaultService); -BOOL lp_file_list_changed(void); -BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue); -int lp_next_parameter(int snum, int *i, char *label, - char *value, int allparameters); -BOOL lp_snum_ok(int iService); -BOOL lp_loaded(void); -void lp_killunused(BOOL (*snumused)(int )); -BOOL lp_load(char *pszFname,BOOL global_only); -int lp_numservices(void); -void lp_dump(FILE *f); -int lp_servicenumber(char *pszServiceName); -char *volume_label(int snum); -void lp_rename_service(int snum, char *new_name); -void lp_remove_service(int snum); -void lp_copy_service(int snum, char *new_name); -int lp_default_server_announce(void); -int lp_major_announce_version(void); -int lp_minor_announce_version(void); -char *lp_string(char *s); -char *lp_logfile(void); -char *lp_smbrun(void); -char *lp_configfile(void); -char *lp_smb_passwd_file(void); -char *lp_serverstring(void); -char *lp_printcapname(void); -char *lp_lockdir(void); -char *lp_rootdir(void); -char *lp_defaultservice(void); -char *lp_msg_command(void); -char *lp_dfree_command(void); -char *lp_hosts_equiv(void); -char *lp_auto_services(void); -char *lp_passwd_program(void); -char *lp_passwd_chat(void); -char *lp_passwordserver(void); -char *lp_workgroup(void); -char *lp_domain_controller(void); -char *lp_username_map(void); -char *lp_character_set(void); -char *lp_logon_script(void); -char *lp_logon_path(void); -char *lp_remote_announce(void); -char *lp_wins_server(void); -char *lp_interfaces(void); -char *lp_socket_address(void); -char *lp_nis_home_map_name(void); -char *lp_announce_version(void); -char *lp_netbios_aliases(void); -BOOL lp_dns_proxy(void); -BOOL lp_wins_support(void); -BOOL lp_wins_proxy(void); -BOOL lp_local_master(void); -BOOL lp_domain_master(void); -BOOL lp_domain_logons(void); -BOOL lp_preferred_master(void); -BOOL lp_load_printers(void); -BOOL lp_use_rhosts(void); -BOOL lp_getwdcache(void); -BOOL lp_readprediction(void); -BOOL lp_readbmpx(void); -BOOL lp_readraw(void); -BOOL lp_writeraw(void); -BOOL lp_null_passwords(void); -BOOL lp_strip_dot(void); -BOOL lp_encrypted_passwords(void); -BOOL lp_syslog_only(void); -BOOL lp_browse_list(void); -BOOL lp_unix_realname(void); -BOOL lp_nis_home_map(void); -BOOL lp_time_server(void); -int lp_os_level(void); -int lp_max_ttl(void); -int lp_max_log_size(void); -int lp_mangledstack(void); -int lp_maxxmit(void); -int lp_maxmux(void); -int lp_maxpacket(void); -int lp_keepalive(void); -int lp_passwordlevel(void); -int lp_usernamelevel(void); -int lp_readsize(void); -int lp_shmem_size(void); -int lp_shmem_hash_size(void); -int lp_deadtime(void); -int lp_maxprotocol(void); -int lp_security(void); -int lp_printing(void); -int lp_maxdisksize(void); -int lp_lpqcachetime(void); -int lp_syslog(void); -int lp_client_code_page(void); -int lp_announce_as(void); -char *lp_preexec(int ); -char *lp_postexec(int ); -char *lp_rootpreexec(int ); -char *lp_rootpostexec(int ); -char *lp_servicename(int ); -char *lp_pathname(int ); -char *lp_dontdescend(int ); -char *lp_username(int ); -char *lp_guestaccount(int ); -char *lp_invalid_users(int ); -char *lp_valid_users(int ); -char *lp_admin_users(int ); -char *lp_printcommand(int ); -char *lp_lpqcommand(int ); -char *lp_lprmcommand(int ); -char *lp_lppausecommand(int ); -char *lp_lpresumecommand(int ); -char *lp_printername(int ); -char *lp_printerdriver(int ); -char *lp_hostsallow(int ); -char *lp_hostsdeny(int ); -char *lp_magicscript(int ); -char *lp_magicoutput(int ); -char *lp_comment(int ); -char *lp_force_user(int ); -char *lp_force_group(int ); -char *lp_readlist(int ); -char *lp_writelist(int ); -char *lp_volume(int ); -char *lp_mangled_map(int ); -char *lp_veto_files(int ); -char *lp_hide_files(int ); -BOOL lp_alternate_permissions(int ); -BOOL lp_revalidate(int ); -BOOL lp_casesensitive(int ); -BOOL lp_preservecase(int ); -BOOL lp_shortpreservecase(int ); -BOOL lp_casemangle(int ); -BOOL lp_status(int ); -BOOL lp_hide_dot_files(int ); -BOOL lp_browseable(int ); -BOOL lp_readonly(int ); -BOOL lp_no_set_dir(int ); -BOOL lp_guest_ok(int ); -BOOL lp_guest_only(int ); -BOOL lp_print_ok(int ); -BOOL lp_postscript(int ); -BOOL lp_map_hidden(int ); -BOOL lp_map_archive(int ); -BOOL lp_locking(int ); -BOOL lp_strict_locking(int ); -BOOL lp_share_modes(int ); -BOOL lp_onlyuser(int ); -BOOL lp_manglednames(int ); -BOOL lp_widelinks(int ); -BOOL lp_symlinks(int ); -BOOL lp_syncalways(int ); -BOOL lp_map_system(int ); -BOOL lp_delete_readonly(int ); -BOOL lp_fake_oplocks(int ); -BOOL lp_recursive_veto_delete(int ); -int lp_create_mode(int ); -int lp_force_create_mode(int ); -int lp_dir_mode(int ); -int lp_force_dir_mode(int ); -int lp_max_connections(int ); -int lp_defaultcase(int ); -int lp_minprintspace(int ); -char lp_magicchar(int ); -BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir); -int lp_add_service(char *pszService, int iDefaultService); -BOOL lp_add_printer(char *pszPrintername, int iDefaultService); -BOOL lp_file_list_changed(void); -BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue); -int lp_next_parameter(int snum, int *i, char *label, - char *value, int allparameters); -BOOL lp_snum_ok(int iService); -BOOL lp_loaded(void); -void lp_killunused(BOOL (*snumused)(int )); -BOOL lp_load(char *pszFname,BOOL global_only); -int lp_numservices(void); -void lp_dump(FILE *f); -int lp_servicenumber(char *pszServiceName); -char *volume_label(int snum); -void lp_rename_service(int snum, char *new_name); -void lp_remove_service(int snum); -void lp_copy_service(int snum, char *new_name); -int lp_default_server_announce(void); -int lp_major_announce_version(void); -int lp_minor_announce_version(void); - -/*The following definitions come from locking.c */ - -BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset); -BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); -BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); -BOOL start_share_mode_mgmt(void); -BOOL stop_share_mode_mgmt(void); -BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *ptok); -BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token token); -int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, - min_share_mode_entry **old_shares); -void del_share_mode(share_lock_token token, int fnum); -BOOL set_share_mode(share_lock_token token, int fnum); -BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *ptok); -BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token token); -int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, - min_share_mode_entry **old_shares); -void del_share_mode(share_lock_token token, int fnum); -BOOL set_share_mode(share_lock_token token,int fnum); - -/*The following definitions come from mangle.c */ - -int str_checksum(char *s); -BOOL is_8_3(char *fname, BOOL check_case); -void create_mangled_stack(int size); -BOOL check_mangled_stack(char *s); -BOOL is_mangled(char *s); -void mangle_name_83(char *s); -BOOL name_map_mangle(char *OutName,BOOL need83,int snum); - -/*The following definitions come from md4.c */ - -void mdfour(unsigned char *out, unsigned char *in, int n); -void mdfour(unsigned char *out, unsigned char *in, int n); -void mdfour(unsigned char *out, unsigned char *in, int n); -void mdfour(unsigned char *out, unsigned char *in, int n); - -/*The following definitions come from message.c */ - -int reply_sends(char *inbuf,char *outbuf); -int reply_sendstrt(char *inbuf,char *outbuf); -int reply_sendtxt(char *inbuf,char *outbuf); -int reply_sendend(char *inbuf,char *outbuf); - -/*The following definitions come from nameannounce.c */ - -void announce_request(struct work_record *work, struct in_addr ip); -void do_announce_request(char *info, char *to_name, int announce_type, - int from, - int to, struct in_addr dest_ip); -void sync_server(enum state_type state, char *serv_name, char *work_name, - int name_type, - struct subnet_record *d, - struct in_addr ip); -void do_announce_host(int command, - char *from_name, int from_type, struct in_addr from_ip, - char *to_name , int to_type , struct in_addr to_ip, - time_t announce_interval, - char *server_name, int server_type, char *server_comment); -void announce_my_servers_removed(void); -void announce_server(struct subnet_record *d, struct work_record *work, - char *name, char *comment, time_t ttl, int server_type); -void announce_host(time_t t); -void reset_announce_timer(); -void announce_master(time_t t); -void announce_remote(time_t t); - -/*The following definitions come from namebrowse.c */ - -void expire_browse_cache(time_t t); -struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, - time_t ttl, struct subnet_record *d, - struct in_addr ip, BOOL local); -void do_browser_lists(time_t t); - -/*The following definitions come from namedbname.c */ - -void set_samba_nb_type(void); -BOOL name_equal(struct nmb_name *n1,struct nmb_name *n2); -BOOL ms_browser_name(char *name, int type); -void remove_name(struct subnet_record *d, struct name_record *n); -struct name_record *find_name(struct name_record *n, - struct nmb_name *name, int search); -struct name_record *find_name_search(struct subnet_record **d, - struct nmb_name *name, - int search, struct in_addr ip); -void dump_names(void); -void load_netbios_names(void); -void remove_netbios_name(struct subnet_record *d, - char *name,int type, enum name_source source, - struct in_addr ip); -struct name_record *add_netbios_entry(struct subnet_record *d, - char *name, int type, int nb_flags, - int ttl, enum name_source source, struct in_addr ip, - BOOL new_only,BOOL wins); -void expire_names(time_t t); -struct name_record *dns_name_search(struct nmb_name *question, int Time); - -/*The following definitions come from namedbresp.c */ - -void add_response_record(struct subnet_record *d, - struct response_record *n); -void remove_response_record(struct subnet_record *d, - struct response_record *n); -struct response_record *make_response_queue_record(enum state_type state, - int id,uint16 fd, - int quest_type, char *name,int type, int nb_flags, time_t ttl, - int server_type, char *my_name, char *my_comment, - BOOL bcast,BOOL recurse, - struct in_addr send_ip, struct in_addr reply_to_ip); -struct response_record *find_response_record(struct subnet_record **d, - uint16 id); - -/*The following definitions come from namedbserver.c */ - -void remove_old_servers(struct work_record *work, time_t t, - BOOL remove_all); -struct server_record *find_server(struct work_record *work, char *name); -struct server_record *add_server_entry(struct subnet_record *d, - struct work_record *work, - char *name,int servertype, - int ttl,char *comment, - BOOL replace); -void expire_servers(time_t t); - -/*The following definitions come from namedbsubnet.c */ - -struct subnet_record *find_subnet(struct in_addr bcast_ip); -struct subnet_record *find_req_subnet(struct in_addr ip, BOOL bcast); -struct subnet_record *find_subnet_all(struct in_addr bcast_ip); -void add_workgroup_to_subnet( struct subnet_record *d, char *group); -void add_my_subnets(char *group); -void write_browse_list(time_t t); - -/*The following definitions come from namedbwork.c */ - -struct work_record *remove_workgroup(struct subnet_record *d, - struct work_record *work, - BOOL remove_all_servers); -struct work_record *find_workgroupstruct(struct subnet_record *d, - fstring name, BOOL add); -void dump_workgroups(void); - -/*The following definitions come from nameelect.c */ - -void check_master_browser(time_t t); -void browser_gone(char *work_name, struct in_addr ip); -void send_election(struct subnet_record *d, char *group,uint32 criterion, - int timeup,char *name); -void name_unregister_work(struct subnet_record *d, char *name, int name_type); -void name_register_work(struct subnet_record *d, char *name, int name_type, - int nb_flags, time_t ttl, struct in_addr ip, BOOL bcast); -void become_local_master(struct subnet_record *d, struct work_record *work); -void become_domain_master(struct subnet_record *d, struct work_record *work); -void become_logon_server(struct subnet_record *d, struct work_record *work); -void unbecome_local_master(struct subnet_record *d, struct work_record *work, - int remove_type); -void unbecome_domain_master(struct subnet_record *d, struct work_record *work, - int remove_type); -void unbecome_logon_server(struct subnet_record *d, struct work_record *work, - int remove_type); -void run_elections(time_t t); -void process_election(struct packet_struct *p,char *buf); -BOOL check_elections(void); - -/*The following definitions come from namelogon.c */ - -void process_logon_packet(struct packet_struct *p,char *buf,int len); - -/*The following definitions come from namepacket.c */ - -void debug_browse_data(char *outbuf, int len); -void initiate_netbios_packet(uint16 *id, - int fd,int quest_type,char *name,int name_type, - int nb_flags,BOOL bcast,BOOL recurse, - struct in_addr to_ip); -void reply_netbios_packet(struct packet_struct *p1,int trn_id, - int rcode, int rcv_code, int opcode, - BOOL recursion_available, - BOOL recursion_desired, - struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, - char *data,int len); -void queue_packet(struct packet_struct *packet); -void run_packet_queue(); -void listen_for_packets(BOOL run_election); -BOOL send_mailslot_reply(BOOL unique, char *mailslot,int fd,char *buf,int len,char *srcname, - char *dstname,int src_type,int dest_type, - struct in_addr dest_ip,struct in_addr src_ip); - -/*The following definitions come from namequery.c */ - -BOOL name_status(int fd,char *name,int name_type,BOOL recurse, - struct in_addr to_ip,char *master,char *rname, - void (*fn)()); -BOOL name_query(int fd,char *name,int name_type, - BOOL bcast,BOOL recurse, - struct in_addr to_ip, struct in_addr *ip,void (*fn)()); - -/*The following definitions come from nameresp.c */ - -void expire_netbios_response_entries(time_t t); -struct response_record *queue_netbios_pkt_wins( - int fd,int quest_type,enum state_type state, - char *name,int name_type,int nb_flags, time_t ttl, - int server_type, char *my_name, char *my_comment, - struct in_addr send_ip, struct in_addr reply_to_ip); -struct response_record *queue_netbios_packet(struct subnet_record *d, - int fd,int quest_type,enum state_type state,char *name, - int name_type,int nb_flags, time_t ttl, - int server_type, char *my_name, char *my_comment, - BOOL bcast,BOOL recurse, - struct in_addr send_ip, struct in_addr reply_to_ip); - -/*The following definitions come from nameserv.c */ - -void remove_name_entry(struct subnet_record *d, char *name,int type); -void add_my_name_entry(struct subnet_record *d,char *name,int type,int nb_flags); -void add_domain_logon_names(void); -void add_domain_master_bcast(void); -void add_domain_master_wins(void); -void add_domain_names(time_t t); -void add_my_names(void); -void remove_my_names(); -void refresh_my_names(time_t t); -void query_refresh_names(time_t t); - -/*The following definitions come from nameservreply.c */ - -void add_name_respond(struct subnet_record *d, int fd, struct in_addr from_ip, - uint16 response_id, - struct nmb_name *name, - int nb_flags, int ttl, struct in_addr register_ip, - BOOL new_owner, struct in_addr reply_to_ip); -void reply_name_release(struct packet_struct *p); -void reply_name_reg(struct packet_struct *p); -void reply_name_status(struct packet_struct *p); -void reply_name_query(struct packet_struct *p); - -/*The following definitions come from nameservresp.c */ - -void debug_state_type(int state); -void response_netbios_packet(struct packet_struct *p); - -/*The following definitions come from namework.c */ - -void reset_server(char *name, int state, struct in_addr ip); -void tell_become_backup(void); -BOOL same_context(struct dgram_packet *dgram); -void process_browse_packet(struct packet_struct *p,char *buf,int len); - -/*The following definitions come from nmbd.c */ - -BOOL reload_services(BOOL test); - -/*The following definitions come from nmblib.c */ - -char *lookup_opcode_name( int opcode ); -void debug_nmb_packet(struct packet_struct *p); -char *namestr(struct nmb_name *n); -void free_nmb_packet(struct nmb_packet *nmb); -void free_packet(struct packet_struct *packet); -struct packet_struct *read_packet(int fd,enum packet_type packet_type); -void make_nmb_name(struct nmb_name *n,char *name,int type,char *this_scope); -BOOL send_packet(struct packet_struct *p); -struct packet_struct *receive_packet(int fd,enum packet_type type,int t); -char *lookup_opcode_name( int opcode ); -void debug_nmb_packet(struct packet_struct *p); -char *namestr(struct nmb_name *n); -void free_nmb_packet(struct nmb_packet *nmb); -void free_packet(struct packet_struct *packet); -struct packet_struct *read_packet(int fd,enum packet_type packet_type); -void make_nmb_name(struct nmb_name *n,char *name,int type,char *this_scope); -BOOL send_packet(struct packet_struct *p); -struct packet_struct *receive_packet(int fd,enum packet_type type,int t); - -/*The following definitions come from nmblookup.c */ - -int main(int argc,char *argv[]); - -/*The following definitions come from nmbsync.c */ - -char *getsmbpass(char *pass); -void sync_browse_lists(struct subnet_record *d, struct work_record *work, - char *name, int nm_type, struct in_addr ip, BOOL local); - -/*The following definitions come from params.c */ - -BOOL pm_process(char *pszFileName,BOOL (*sfunc)(char *),BOOL (*pfunc)(char *,char *)); -BOOL pm_process(char *pszFileName,BOOL (*sfunc)(char *),BOOL (*pfunc)(char *,char *)); -BOOL pm_process(char *pszFileName,BOOL (*sfunc)(char *),BOOL (*pfunc)(char *,char *)); -BOOL pm_process(char *pszFileName,BOOL (*sfunc)(char *),BOOL (*pfunc)(char *,char *)); - -/*The following definitions come from password.c */ - -void generate_next_challenge(char *challenge); -BOOL set_challenge(char *challenge); -BOOL last_challenge(char *challenge); -user_struct *get_valid_user_struct(uint16 vuid); -void invalidate_vuid(uint16 vuid); -char *validated_username(uint16 vuid); -uint16 register_vuid(int uid,int gid, char *name,BOOL guest); -void add_session_user(char *user); -void dfs_unlogin(void); -BOOL password_check(char *password); -BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8); -BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd); -BOOL user_ok(char *user,int snum); -BOOL authorise_login(int snum,char *user,char *password, int pwlen, - BOOL *guest,BOOL *force,uint16 vuid); -BOOL check_hosts_equiv(char *user); -BOOL server_cryptkey(char *buf); -BOOL server_validate(char *buf); - -/*The following definitions come from pcap.c */ - -BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); -void pcap_printer_fn(void (*fn)()); -BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); -void pcap_printer_fn(void (*fn)()); -BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); -void pcap_printer_fn(void (*fn)()); -BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); -void pcap_printer_fn(void (*fn)()); - -/*The following definitions come from pipes.c */ - -int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize); -BOOL api_LsarpcSNPHS(int cnum,int uid, char *param,char *data, - int mdrcnt,int mprcnt, - char **rdata,char **rparam, - int *rdata_len,int *rparam_len); -BOOL api_LsarpcTNP(int cnum,int uid, char *param,char *data, - int mdrcnt,int mprcnt, - char **rdata,char **rparam, - int *rdata_len,int *rparam_len); - -/*The following definitions come from predict.c */ - -int read_predict(int fd,int offset,char *buf,char **ptr,int num); -void do_read_prediction(); -void invalidate_read_prediction(int fd); - -/*The following definitions come from printing.c */ - -void lpq_reset(int snum); -void print_file(int fnum); -int get_printqueue(int snum,int cnum,print_queue_struct **queue, - print_status_struct *status); -void del_printqueue(int cnum,int snum,int jobid); -void status_printjob(int cnum,int snum,int jobid,int status); -int printjob_encode(int snum, int job); -void printjob_decode(int jobid, int *snum, int *job); - -/*The following definitions come from quotas.c */ - -BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); -BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); -BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); -BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); -BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); - -/*The following definitions come from replace.c */ - -char *Strstr(char *s, char *p); -time_t Mktime(struct tm *t); -int InNetGr(char *group,char *host,char *user,char *dom); -void *malloc_wrapped(int size,char *file,int line); -void *realloc_wrapped(void *ptr,int size,char *file,int line); -void free_wrapped(void *ptr,char *file,int line); -void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line); -char *Strstr(char *s, char *p); -time_t Mktime(struct tm *t); -int InNetGr(char *group,char *host,char *user,char *dom); -void *malloc_wrapped(int size,char *file,int line); -void *realloc_wrapped(void *ptr,int size,char *file,int line); -void free_wrapped(void *ptr,char *file,int line); -void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line); -char *Strstr(char *s, char *p); -time_t Mktime(struct tm *t); -int InNetGr(char *group,char *host,char *user,char *dom); -void *malloc_wrapped(int size,char *file,int line); -void *realloc_wrapped(void *ptr,int size,char *file,int line); -void free_wrapped(void *ptr,char *file,int line); -void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line); -char *Strstr(char *s, char *p); -time_t Mktime(struct tm *t); -int InNetGr(char *group,char *host,char *user,char *dom); -void *malloc_wrapped(int size,char *file,int line); -void *realloc_wrapped(void *ptr,int size,char *file,int line); -void free_wrapped(void *ptr,char *file,int line); -void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line); - -/*The following definitions come from reply.c */ - -int reply_special(char *inbuf,char *outbuf); -int reply_tcon(char *inbuf,char *outbuf); -int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_unknown(char *inbuf,char *outbuf); -int reply_ioctl(char *inbuf,char *outbuf); -int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_chkpth(char *inbuf,char *outbuf); -int reply_getatr(char *inbuf,char *outbuf); -int reply_setatr(char *inbuf,char *outbuf); -int reply_dskattr(char *inbuf,char *outbuf); -int reply_search(char *inbuf,char *outbuf); -int reply_fclose(char *inbuf,char *outbuf); -int reply_open(char *inbuf,char *outbuf); -int reply_open_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_ulogoffX(char *inbuf,char *outbuf,int length,int bufsize); -int reply_mknew(char *inbuf,char *outbuf); -int reply_ctemp(char *inbuf,char *outbuf); -int reply_unlink(char *inbuf,char *outbuf); -int reply_readbraw(char *inbuf, char *outbuf); -int reply_lockread(char *inbuf,char *outbuf); -int reply_read(char *inbuf,char *outbuf); -int reply_read_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_writebraw(char *inbuf,char *outbuf); -int reply_writeunlock(char *inbuf,char *outbuf); -int reply_write(char *inbuf,char *outbuf,int dum1,int dum2); -int reply_write_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_lseek(char *inbuf,char *outbuf); -int reply_flush(char *inbuf,char *outbuf); -int reply_exit(char *inbuf,char *outbuf); -int reply_close(char *inbuf,char *outbuf); -int reply_writeclose(char *inbuf,char *outbuf); -int reply_lock(char *inbuf,char *outbuf); -int reply_unlock(char *inbuf,char *outbuf); -int reply_tdis(char *inbuf,char *outbuf); -int reply_echo(char *inbuf,char *outbuf); -int reply_printopen(char *inbuf,char *outbuf); -int reply_printclose(char *inbuf,char *outbuf); -int reply_printqueue(char *inbuf,char *outbuf); -int reply_printwrite(char *inbuf,char *outbuf); -int reply_mkdir(char *inbuf,char *outbuf); -int reply_rmdir(char *inbuf,char *outbuf); -int reply_mv(char *inbuf,char *outbuf); -int reply_copy(char *inbuf,char *outbuf); -int reply_setdir(char *inbuf,char *outbuf); -int reply_lockingX(char *inbuf,char *outbuf,int length,int bufsize); -int reply_readbmpx(char *inbuf,char *outbuf,int length,int bufsize); -int reply_writebmpx(char *inbuf,char *outbuf); -int reply_writebs(char *inbuf,char *outbuf); -int reply_setattrE(char *inbuf,char *outbuf); -int reply_getattrE(char *inbuf,char *outbuf); - -/*The following definitions come from server.c */ - -void *dflt_sig(void); -void killkids(void); -mode_t unix_mode(int cnum,int dosmode); -int dos_mode(int cnum,char *path,struct stat *sbuf); -int dos_chmod(int cnum,char *fname,int dosmode,struct stat *st); -BOOL unix_convert(char *name,int cnum,pstring saved_last_component, BOOL *bad_path); -int disk_free(char *path,int *bsize,int *dfree,int *dsize); -int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); -BOOL check_name(char *name,int cnum); -int fd_attempt_open(char *fname, int flags, int mode); -void fd_attempt_reopen(char *fname, int mode, file_fd_struct *fd_ptr); -int fd_attempt_close(file_fd_struct *fd_ptr); -void sync_file(int fnum); -void close_file(int fnum); -BOOL check_file_sharing(int cnum,char *fname); -void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun, - int mode,int *Access,int *action); -int seek_file(int fnum,uint32 pos); -int read_file(int fnum,char *data,uint32 pos,int n); -int write_file(int fnum,char *data,int n); -BOOL become_service(int cnum,BOOL do_chdir); -int find_service(char *service); -int cached_error_packet(char *inbuf,char *outbuf,int fnum,int line); -int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line); -int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int line); -BOOL snum_used(int snum); -BOOL reload_services(BOOL test); -int setup_groups(char *user, int uid, int gid, int *p_ngroups, - int **p_igroups, gid_t **p_groups); -int make_connection(char *service,char *user,char *password, int pwlen, char *dev,uint16 vuid); -int find_free_file(void ); -int reply_corep(char *outbuf); -int reply_coreplus(char *outbuf); -int reply_lanman1(char *outbuf); -int reply_lanman2(char *outbuf); -int reply_nt1(char *outbuf); -void close_cnum(int cnum, uint16 vuid); -BOOL yield_connection(int cnum,char *name,int max_connections); -BOOL claim_connection(int cnum,char *name,int max_connections,BOOL Clear); -void exit_server(char *reason); -void standard_sub(int cnum,char *str); -char *smb_fn_name(int type); -int chain_reply(char *inbuf,char *outbuf,int size,int bufsize); -int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); - -/*The following definitions come from shmem.c */ - -BOOL smb_shm_create_hash_table( unsigned int size ); -BOOL smb_shm_open( char *file_name, int size); -BOOL smb_shm_close( void ); -smb_shm_offset_t smb_shm_alloc(int size); -BOOL smb_shm_free(smb_shm_offset_t offset); -smb_shm_offset_t smb_shm_get_userdef_off(void); -BOOL smb_shm_set_userdef_off(smb_shm_offset_t userdef_off); -void *smb_shm_offset2addr(smb_shm_offset_t offset); -smb_shm_offset_t smb_shm_addr2offset(void *addr); -BOOL smb_shm_lock_hash_entry( unsigned int entry); -BOOL smb_shm_unlock_hash_entry( unsigned int entry ); -BOOL smb_shm_get_usage(int *bytes_free, - int *bytes_used, - int *bytes_overhead); -BOOL smb_shm_create_hash_table( unsigned int size ); -BOOL smb_shm_open( char *file_name, int size); -BOOL smb_shm_close( void ); -smb_shm_offset_t smb_shm_alloc(int size); -BOOL smb_shm_free(smb_shm_offset_t offset); -smb_shm_offset_t smb_shm_get_userdef_off(void); -BOOL smb_shm_set_userdef_off(smb_shm_offset_t userdef_off); -void *smb_shm_offset2addr(smb_shm_offset_t offset); -smb_shm_offset_t smb_shm_addr2offset(void *addr); -BOOL smb_shm_lock_hash_entry( unsigned int entry); -BOOL smb_shm_unlock_hash_entry( unsigned int entry ); -BOOL smb_shm_get_usage(int *bytes_free, - int *bytes_used, - int *bytes_overhead); - -/*The following definitions come from smbdes.c */ - -void E_P16(unsigned char *p14,unsigned char *p16); -void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24); -void E_P16(unsigned char *p14,unsigned char *p16); -void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24); -void E_P16(unsigned char *p14,unsigned char *p16); -void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24); -void E_P16(unsigned char *p14,unsigned char *p16); -void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24); - -/*The following definitions come from smbencrypt.c */ - -void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); -void E_md4hash(uchar *passwd, uchar *p16); -void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); -void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); -void E_md4hash(uchar *passwd, uchar *p16); -void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); -void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); -void E_md4hash(uchar *passwd, uchar *p16); -void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); -void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); -void E_md4hash(uchar *passwd, uchar *p16); -void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); - -/*The following definitions come from smbpass.c */ - -int pw_file_lock(char *name, int type, int secs); -int pw_file_unlock(int fd); -struct smb_passwd *get_smbpwnam(char *name); -int pw_file_lock(char *name, int type, int secs); -int pw_file_unlock(int fd); -struct smb_passwd *get_smbpwnam(char *name); - -/*The following definitions come from smbpasswd.c */ - - -/*The following definitions come from smbrun.c */ - - -/*The following definitions come from status.c */ - -void Ucrit_addUsername(pstring username); -unsigned int Ucrit_checkUsername(pstring username); -void Ucrit_addPid(int pid); -unsigned int Ucrit_checkPid(int pid); - -/*The following definitions come from system.c */ - -int sys_select(fd_set *fds,struct timeval *tval); -int sys_select(fd_set *fds,struct timeval *tval); -int sys_unlink(char *fname); -int sys_open(char *fname,int flags,int mode); -DIR *sys_opendir(char *dname); -int sys_stat(char *fname,struct stat *sbuf); -int sys_waitpid(pid_t pid,int *status,int options); -int sys_lstat(char *fname,struct stat *sbuf); -int sys_mkdir(char *dname,int mode); -int sys_rmdir(char *dname); -int sys_chdir(char *dname); -int sys_utime(char *fname,struct utimbuf *times); -int sys_rename(char *from, char *to); -int sys_chmod(char *fname,int mode); -char *sys_getwd(char *s); -int sys_chown(char *fname,int uid,int gid); -int sys_chroot(char *dname); -struct hostent *sys_gethostbyname(char *name); -int sys_select(fd_set *fds,struct timeval *tval); -int sys_select(fd_set *fds,struct timeval *tval); -int sys_unlink(char *fname); -int sys_open(char *fname,int flags,int mode); -DIR *sys_opendir(char *dname); -int sys_stat(char *fname,struct stat *sbuf); -int sys_waitpid(pid_t pid,int *status,int options); -int sys_lstat(char *fname,struct stat *sbuf); -int sys_mkdir(char *dname,int mode); -int sys_rmdir(char *dname); -int sys_chdir(char *dname); -int sys_utime(char *fname,struct utimbuf *times); -int sys_rename(char *from, char *to); -int sys_chmod(char *fname,int mode); -char *sys_getwd(char *s); -int sys_chown(char *fname,int uid,int gid); -int sys_chroot(char *dname); -struct hostent *sys_gethostbyname(char *name); -int sys_select(fd_set *fds,struct timeval *tval); -int sys_select(fd_set *fds,struct timeval *tval); -int sys_unlink(char *fname); -int sys_open(char *fname,int flags,int mode); -DIR *sys_opendir(char *dname); -int sys_stat(char *fname,struct stat *sbuf); -int sys_waitpid(pid_t pid,int *status,int options); -int sys_lstat(char *fname,struct stat *sbuf); -int sys_mkdir(char *dname,int mode); -int sys_rmdir(char *dname); -int sys_chdir(char *dname); -int sys_utime(char *fname,struct utimbuf *times); -int sys_rename(char *from, char *to); -int sys_chmod(char *fname,int mode); -char *sys_getwd(char *s); -int sys_chown(char *fname,int uid,int gid); -int sys_chroot(char *dname); -struct hostent *sys_gethostbyname(char *name); -int sys_select(fd_set *fds,struct timeval *tval); -int sys_select(fd_set *fds,struct timeval *tval); -int sys_unlink(char *fname); -int sys_open(char *fname,int flags,int mode); -DIR *sys_opendir(char *dname); -int sys_stat(char *fname,struct stat *sbuf); -int sys_waitpid(pid_t pid,int *status,int options); -int sys_lstat(char *fname,struct stat *sbuf); -int sys_mkdir(char *dname,int mode); -int sys_rmdir(char *dname); -int sys_chdir(char *dname); -int sys_utime(char *fname,struct utimbuf *times); -int sys_rename(char *from, char *to); -int sys_chmod(char *fname,int mode); -char *sys_getwd(char *s); -int sys_chown(char *fname,int uid,int gid); -int sys_chroot(char *dname); -struct hostent *sys_gethostbyname(char *name); - -/*The following definitions come from testparm.c */ - - -/*The following definitions come from testprns.c */ - -int main(int argc, char *argv[]); - -/*The following definitions come from time.c */ - -void GetTimeOfDay(struct timeval *tval); -void TimeInit(void); -int TimeDiff(time_t t); -struct tm *LocalTime(time_t *t); -time_t interpret_long_date(char *p); -void put_long_date(char *p,time_t t); -void put_dos_date(char *buf,int offset,time_t unixdate); -void put_dos_date2(char *buf,int offset,time_t unixdate); -void put_dos_date3(char *buf,int offset,time_t unixdate); -time_t make_unix_date(void *date_ptr); -time_t make_unix_date2(void *date_ptr); -time_t make_unix_date3(void *date_ptr); -BOOL set_filetime(char *fname,time_t mtime); -char *timestring(void ); -void GetTimeOfDay(struct timeval *tval); -void TimeInit(void); -int TimeDiff(time_t t); -struct tm *LocalTime(time_t *t); -time_t interpret_long_date(char *p); -void put_long_date(char *p,time_t t); -void put_dos_date(char *buf,int offset,time_t unixdate); -void put_dos_date2(char *buf,int offset,time_t unixdate); -void put_dos_date3(char *buf,int offset,time_t unixdate); -time_t make_unix_date(void *date_ptr); -time_t make_unix_date2(void *date_ptr); -time_t make_unix_date3(void *date_ptr); -BOOL set_filetime(char *fname,time_t mtime); -char *timestring(void ); -void GetTimeOfDay(struct timeval *tval); -void TimeInit(void); -int TimeDiff(time_t t); -struct tm *LocalTime(time_t *t); -time_t interpret_long_date(char *p); -void put_long_date(char *p,time_t t); -void put_dos_date(char *buf,int offset,time_t unixdate); -void put_dos_date2(char *buf,int offset,time_t unixdate); -void put_dos_date3(char *buf,int offset,time_t unixdate); -time_t make_unix_date(void *date_ptr); -time_t make_unix_date2(void *date_ptr); -time_t make_unix_date3(void *date_ptr); -BOOL set_filetime(char *fname,time_t mtime); -char *timestring(void ); -void GetTimeOfDay(struct timeval *tval); -void TimeInit(void); -int TimeDiff(time_t t); -struct tm *LocalTime(time_t *t); -time_t interpret_long_date(char *p); -void put_long_date(char *p,time_t t); -void put_dos_date(char *buf,int offset,time_t unixdate); -void put_dos_date2(char *buf,int offset,time_t unixdate); -void put_dos_date3(char *buf,int offset,time_t unixdate); -time_t make_unix_date(void *date_ptr); -time_t make_unix_date2(void *date_ptr); -time_t make_unix_date3(void *date_ptr); -BOOL set_filetime(char *fname,time_t mtime); -char *timestring(void ); - -/*The following definitions come from trans2.c */ - -int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize); -int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize); -int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize); -int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize); - -/*The following definitions come from ufc.c */ - -char *ufc_crypt(char *key,char *salt); -char *ufc_crypt(char *key,char *salt); - -/*The following definitions come from uid.c */ - -void init_uid(void); -BOOL become_guest(void); -BOOL become_user(int cnum, uint16 vuid); -BOOL unbecome_user(void ); -int smbrun(char *cmd,char *outfile,BOOL shared); - -/*The following definitions come from username.c */ - -char *get_home_dir(char *user); -void map_username(char *user); -struct passwd *Get_Pwnam(char *user,BOOL allow_change); -BOOL user_in_list(char *user,char *list); -char *get_home_dir(char *user); -void map_username(char *user); -struct passwd *Get_Pwnam(char *user,BOOL allow_change); -BOOL user_in_list(char *user,char *list); -char *get_home_dir(char *user); -void map_username(char *user); -struct passwd *Get_Pwnam(char *user,BOOL allow_change); -BOOL user_in_list(char *user,char *list); -char *get_home_dir(char *user); -void map_username(char *user); -struct passwd *Get_Pwnam(char *user,BOOL allow_change); -BOOL user_in_list(char *user,char *list); - -/*The following definitions come from util.c */ - -void setup_logging(char *pname,BOOL interactive); -void reopen_logs(void); -char *tmpdir(void); -BOOL is_a_socket(int fd); -BOOL next_token(char **ptr,char *buff,char *sep); -char **toktocliplist(int *ctok, char *sep); -void *MemMove(void *dest,void *src,int size); -void array_promote(char *array,int elsize,int element); -void set_socket_options(int fd, char *options); -void close_sockets(void ); -BOOL in_group(gid_t group, int current_gid, int ngroups, int *groups); -char *StrCpy(char *dest,char *src); -char *StrnCpy(char *dest,char *src,int n); -void putip(void *dest,void *src); -int name_mangle(char *In,char *Out,char name_type); -BOOL file_exist(char *fname,struct stat *sbuf); -time_t file_modtime(char *fname); -BOOL directory_exist(char *dname,struct stat *st); -uint32 file_size(char *file_name); -char *attrib_string(int mode); -int StrCaseCmp(char *s, char *t); -int StrnCaseCmp(char *s, char *t, int n); -BOOL strequal(char *s1, char *s2); -BOOL strnequal(char *s1,char *s2,int n); -BOOL strcsequal(char *s1,char *s2); -void strlower(char *s); -void strupper(char *s); -void strnorm(char *s); -BOOL strisnormal(char *s); -void string_replace(char *s,char oldc,char newc); -void unix_format(char *fname); -void dos_format(char *fname); -void show_msg(char *buf); -int smb_len(char *buf); -void _smb_setlen(char *buf,int len); -void smb_setlen(char *buf,int len); -int set_message(char *buf,int num_words,int num_bytes,BOOL zero); -int smb_numwords(char *buf); -int smb_buflen(char *buf); -int smb_buf_ofs(char *buf); -char *smb_buf(char *buf); -int smb_offset(char *p,char *buf); -char *skip_string(char *buf,int n); -BOOL trim_string(char *s,char *front,char *back); -void dos_clean_name(char *s); -void unix_clean_name(char *s); -int ChDir(char *path); -char *GetWd(char *str); -BOOL reduce_name(char *s,char *dir,BOOL widelinks); -void expand_mask(char *Mask,BOOL doext); -BOOL strhasupper(char *s); -BOOL strhaslower(char *s); -int count_chars(char *s,char c); -void make_dir_struct(char *buf,char *mask,char *fname,unsigned int size,int mode,time_t date); -void close_low_fds(void); -int set_blocking(int fd, BOOL set); -int write_socket(int fd,char *buf,int len); -int read_udp_socket(int fd,char *buf,int len); -int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out); -int read_max_udp(int fd,char *buffer,int bufsize,int maxtime); -int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew); -BOOL send_keepalive(int client); -int read_data(int fd,char *buffer,int N); -int write_data(int fd,char *buffer,int N); -int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align); -int read_smb_length(int fd,char *inbuf,int timeout); -BOOL receive_smb(int fd,char *buffer,int timeout); -BOOL send_smb(int fd,char *buffer); -char *name_ptr(char *buf,int ofs); -int name_extract(char *buf,int ofs,char *name); -int name_len(char *s); -BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type); -void msleep(int t); -BOOL in_list(char *s,char *list,BOOL casesensitive); -BOOL string_init(char **dest,char *src); -void string_free(char **s); -BOOL string_set(char **dest,char *src); -BOOL string_sub(char *s,char *pattern,char *insert); -BOOL do_match(char *str, char *regexp, int case_sig); -BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2); -void become_daemon(void); -BOOL yesno(char *p); -char *fgets_slash(char *s2,int maxlen,FILE *f); -int set_filelen(int fd, long len); -int byte_checksum(char *buf,int len); -char *dirname_dos(char *path,char *buf); -void *Realloc(void *p,int size); -void Abort(void ); -BOOL get_myname(char *my_name,struct in_addr *ip); -BOOL ip_equal(struct in_addr ip1,struct in_addr ip2); -int open_socket_in(int type, int port, int dlevel,uint32 socket_addr); -int open_socket_out(int type, struct in_addr *addr, int port ,int timeout); -int interpret_protocol(char *str,int def); -int interpret_security(char *str,int def); -uint32 interpret_addr(char *str); -struct in_addr *interpret_addr2(char *str); -BOOL zero_ip(struct in_addr ip); -void reset_globals_after_fork(); -char *client_name(void); -char *client_addr(void); -void standard_sub_basic(char *str); -BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask); -int PutUniCode(char *dst,char *src); -struct hostent *Get_Hostbyname(char *name); -BOOL process_exists(int pid); -char *uidtoname(int uid); -char *gidtoname(int gid); -void BlockSignals(BOOL block,int signum); -void ajt_panic(void); -char *readdirname(void *p); -BOOL is_in_path(char *name, name_compare_entry *namelist); -void set_namearray(name_compare_entry **ppname_array, char *namelist); -void free_namearray(name_compare_entry *name_array); -BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); -int file_lock(char *name,int timeout); -void file_unlock(int fd); -BOOL is_myname(char *s); -void set_remote_arch(enum remote_arch_types type); -enum remote_arch_types get_remote_arch(); -void setup_logging(char *pname,BOOL interactive); -void reopen_logs(void); -char *tmpdir(void); -BOOL is_a_socket(int fd); -BOOL next_token(char **ptr,char *buff,char *sep); -char **toktocliplist(int *ctok, char *sep); -void *MemMove(void *dest,void *src,int size); -void array_promote(char *array,int elsize,int element); -void set_socket_options(int fd, char *options); -void close_sockets(void ); -BOOL in_group(gid_t group, int current_gid, int ngroups, int *groups); -char *StrCpy(char *dest,char *src); -char *StrnCpy(char *dest,char *src,int n); -void putip(void *dest,void *src); -int name_mangle(char *In,char *Out,char name_type); -BOOL file_exist(char *fname,struct stat *sbuf); -time_t file_modtime(char *fname); -BOOL directory_exist(char *dname,struct stat *st); -uint32 file_size(char *file_name); -char *attrib_string(int mode); -int StrCaseCmp(char *s, char *t); -int StrnCaseCmp(char *s, char *t, int n); -BOOL strequal(char *s1, char *s2); -BOOL strnequal(char *s1,char *s2,int n); -BOOL strcsequal(char *s1,char *s2); -void strlower(char *s); -void strupper(char *s); -void strnorm(char *s); -BOOL strisnormal(char *s); -void string_replace(char *s,char oldc,char newc); -void unix_format(char *fname); -void dos_format(char *fname); -void show_msg(char *buf); -int smb_len(char *buf); -void _smb_setlen(char *buf,int len); -void smb_setlen(char *buf,int len); -int set_message(char *buf,int num_words,int num_bytes,BOOL zero); -int smb_numwords(char *buf); -int smb_buflen(char *buf); -int smb_buf_ofs(char *buf); -char *smb_buf(char *buf); -int smb_offset(char *p,char *buf); -char *skip_string(char *buf,int n); -BOOL trim_string(char *s,char *front,char *back); -void dos_clean_name(char *s); -void unix_clean_name(char *s); -int ChDir(char *path); -char *GetWd(char *str); -BOOL reduce_name(char *s,char *dir,BOOL widelinks); -void expand_mask(char *Mask,BOOL doext); -BOOL strhasupper(char *s); -BOOL strhaslower(char *s); -int count_chars(char *s,char c); -void make_dir_struct(char *buf,char *mask,char *fname,unsigned int size,int mode,time_t date); -void close_low_fds(void); -int set_blocking(int fd, BOOL set); -int write_socket(int fd,char *buf,int len); -int read_udp_socket(int fd,char *buf,int len); -int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out); -int read_max_udp(int fd,char *buffer,int bufsize,int maxtime); -int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew); -BOOL send_keepalive(int client); -int read_data(int fd,char *buffer,int N); -int write_data(int fd,char *buffer,int N); -int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align); -int read_smb_length(int fd,char *inbuf,int timeout); -BOOL receive_smb(int fd,char *buffer,int timeout); -BOOL send_smb(int fd,char *buffer); -char *name_ptr(char *buf,int ofs); -int name_extract(char *buf,int ofs,char *name); -int name_len(char *s); -BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type); -void msleep(int t); -BOOL in_list(char *s,char *list,BOOL casesensitive); -BOOL string_init(char **dest,char *src); -void string_free(char **s); -BOOL string_set(char **dest,char *src); -BOOL string_sub(char *s,char *pattern,char *insert); -BOOL do_match(char *str, char *regexp, int case_sig); -BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2); -void become_daemon(void); -BOOL yesno(char *p); -char *fgets_slash(char *s2,int maxlen,FILE *f); -int set_filelen(int fd, long len); -int byte_checksum(char *buf,int len); -char *dirname_dos(char *path,char *buf); -void *Realloc(void *p,int size); -void Abort(void ); -BOOL get_myname(char *my_name,struct in_addr *ip); -BOOL ip_equal(struct in_addr ip1,struct in_addr ip2); -int open_socket_in(int type, int port, int dlevel,uint32 socket_addr); -int open_socket_out(int type, struct in_addr *addr, int port ,int timeout); -int interpret_protocol(char *str,int def); -int interpret_security(char *str,int def); -uint32 interpret_addr(char *str); -struct in_addr *interpret_addr2(char *str); -BOOL zero_ip(struct in_addr ip); -void reset_globals_after_fork(); -char *client_name(void); -char *client_addr(void); -void standard_sub_basic(char *str); -BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask); -int PutUniCode(char *dst,char *src); -struct hostent *Get_Hostbyname(char *name); -BOOL process_exists(int pid); -char *uidtoname(int uid); -char *gidtoname(int gid); -void BlockSignals(BOOL block,int signum); -void ajt_panic(void); -char *readdirname(void *p); -BOOL is_in_path(char *name, name_compare_entry *namelist); -void set_namearray(name_compare_entry **ppname_array, char *namelist); -void free_namearray(name_compare_entry *name_array); -BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); -int file_lock(char *name,int timeout); -void file_unlock(int fd); -BOOL is_myname(char *s); -void set_remote_arch(enum remote_arch_types type); -enum remote_arch_types get_remote_arch(); -void setup_logging(char *pname,BOOL interactive); -void reopen_logs(void); -char *tmpdir(void); -BOOL is_a_socket(int fd); -BOOL next_token(char **ptr,char *buff,char *sep); -char **toktocliplist(int *ctok, char *sep); -void *MemMove(void *dest,void *src,int size); -void array_promote(char *array,int elsize,int element); -void set_socket_options(int fd, char *options); -void close_sockets(void ); -BOOL in_group(gid_t group, int current_gid, int ngroups, int *groups); -char *StrCpy(char *dest,char *src); -char *StrnCpy(char *dest,char *src,int n); -void putip(void *dest,void *src); -int name_mangle(char *In,char *Out,char name_type); -BOOL file_exist(char *fname,struct stat *sbuf); -time_t file_modtime(char *fname); -BOOL directory_exist(char *dname,struct stat *st); -uint32 file_size(char *file_name); -char *attrib_string(int mode); -int StrCaseCmp(char *s, char *t); -int StrnCaseCmp(char *s, char *t, int n); -BOOL strequal(char *s1, char *s2); -BOOL strnequal(char *s1,char *s2,int n); -BOOL strcsequal(char *s1,char *s2); -void strlower(char *s); -void strupper(char *s); -void strnorm(char *s); -BOOL strisnormal(char *s); -void string_replace(char *s,char oldc,char newc); -void unix_format(char *fname); -void dos_format(char *fname); -void show_msg(char *buf); -int smb_len(char *buf); -void _smb_setlen(char *buf,int len); -void smb_setlen(char *buf,int len); -int set_message(char *buf,int num_words,int num_bytes,BOOL zero); -int smb_numwords(char *buf); -int smb_buflen(char *buf); -int smb_buf_ofs(char *buf); -char *smb_buf(char *buf); -int smb_offset(char *p,char *buf); -char *skip_string(char *buf,int n); -BOOL trim_string(char *s,char *front,char *back); -void dos_clean_name(char *s); -void unix_clean_name(char *s); -int ChDir(char *path); -char *GetWd(char *str); -BOOL reduce_name(char *s,char *dir,BOOL widelinks); -void expand_mask(char *Mask,BOOL doext); -BOOL strhasupper(char *s); -BOOL strhaslower(char *s); -int count_chars(char *s,char c); -void make_dir_struct(char *buf,char *mask,char *fname,unsigned int size,int mode,time_t date); -void close_low_fds(void); -int set_blocking(int fd, BOOL set); -int write_socket(int fd,char *buf,int len); -int read_udp_socket(int fd,char *buf,int len); -int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out); -int read_max_udp(int fd,char *buffer,int bufsize,int maxtime); -int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew); -BOOL send_keepalive(int client); -int read_data(int fd,char *buffer,int N); -int write_data(int fd,char *buffer,int N); -int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align); -int read_smb_length(int fd,char *inbuf,int timeout); -BOOL receive_smb(int fd,char *buffer,int timeout); -BOOL send_smb(int fd,char *buffer); -char *name_ptr(char *buf,int ofs); -int name_extract(char *buf,int ofs,char *name); -int name_len(char *s); -BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type); -void msleep(int t); -BOOL in_list(char *s,char *list,BOOL casesensitive); -BOOL string_init(char **dest,char *src); -void string_free(char **s); -BOOL string_set(char **dest,char *src); -BOOL string_sub(char *s,char *pattern,char *insert); -BOOL do_match(char *str, char *regexp, int case_sig); -BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2); -void become_daemon(void); -BOOL yesno(char *p); -char *fgets_slash(char *s2,int maxlen,FILE *f); -int set_filelen(int fd, long len); -int byte_checksum(char *buf,int len); -char *dirname_dos(char *path,char *buf); -void *Realloc(void *p,int size); -void Abort(void ); -BOOL get_myname(char *my_name,struct in_addr *ip); -BOOL ip_equal(struct in_addr ip1,struct in_addr ip2); -int open_socket_in(int type, int port, int dlevel,uint32 socket_addr); -int open_socket_out(int type, struct in_addr *addr, int port ,int timeout); -int interpret_protocol(char *str,int def); -int interpret_security(char *str,int def); -uint32 interpret_addr(char *str); -struct in_addr *interpret_addr2(char *str); -BOOL zero_ip(struct in_addr ip); -void reset_globals_after_fork(); -char *client_name(void); -char *client_addr(void); -void standard_sub_basic(char *str); -BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask); -int PutUniCode(char *dst,char *src); -struct hostent *Get_Hostbyname(char *name); -BOOL process_exists(int pid); -char *uidtoname(int uid); -char *gidtoname(int gid); -void BlockSignals(BOOL block,int signum); -void ajt_panic(void); -char *readdirname(void *p); -BOOL is_in_path(char *name, name_compare_entry *namelist); -void set_namearray(name_compare_entry **ppname_array, char *namelist); -void free_namearray(name_compare_entry *name_array); -BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); -int file_lock(char *name,int timeout); -void file_unlock(int fd); -BOOL is_myname(char *s); -void set_remote_arch(enum remote_arch_types type); -enum remote_arch_types get_remote_arch(); + +/*The following definitions come from locking.c */ + +BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset); +BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); +BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); +BOOL start_share_mode_mgmt(void); +BOOL stop_share_mode_mgmt(void); +BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *ptok); +BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token token); +int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, + min_share_mode_entry **old_shares); +void del_share_mode(share_lock_token token, int fnum); +BOOL set_share_mode(share_lock_token token, int fnum); +BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *ptok); +BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token token); +int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, + min_share_mode_entry **old_shares); +void del_share_mode(share_lock_token token, int fnum); +BOOL set_share_mode(share_lock_token token,int fnum); + +/*The following definitions come from mangle.c */ + +int str_checksum(char *s); +BOOL is_8_3(char *fname, BOOL check_case); +void create_mangled_stack(int size); +BOOL check_mangled_stack(char *s); +BOOL is_mangled(char *s); +void mangle_name_83(char *s); +BOOL name_map_mangle(char *OutName,BOOL need83,int snum); + +/*The following definitions come from md4.c */ + +void mdfour(unsigned char *out, unsigned char *in, int n); + +/*The following definitions come from message.c */ + +int reply_sends(char *inbuf,char *outbuf); +int reply_sendstrt(char *inbuf,char *outbuf); +int reply_sendtxt(char *inbuf,char *outbuf); +int reply_sendend(char *inbuf,char *outbuf); + +/*The following definitions come from nameannounce.c */ + +void announce_request(struct work_record *work, struct in_addr ip); +void do_announce_request(char *info, char *to_name, int announce_type, + int from, + int to, struct in_addr dest_ip); +void sync_server(enum state_type state, char *serv_name, char *work_name, + int name_type, + struct subnet_record *d, + struct in_addr ip); +void do_announce_host(int command, + char *from_name, int from_type, struct in_addr from_ip, + char *to_name , int to_type , struct in_addr to_ip, + time_t announce_interval, + char *server_name, int server_type, char *server_comment); +void announce_my_servers_removed(void); +void announce_server(struct subnet_record *d, struct work_record *work, + char *name, char *comment, time_t ttl, int server_type); +void announce_host(time_t t); +void reset_announce_timer(); +void announce_master(time_t t); +void announce_remote(time_t t); + +/*The following definitions come from namebrowse.c */ + +void expire_browse_cache(time_t t); +struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, + time_t ttl, struct subnet_record *d, + struct in_addr ip, BOOL local); +void do_browser_lists(time_t t); + +/*The following definitions come from namedbname.c */ + +void set_samba_nb_type(void); +BOOL name_equal(struct nmb_name *n1,struct nmb_name *n2); +BOOL ms_browser_name(char *name, int type); +void remove_name(struct subnet_record *d, struct name_record *n); +struct name_record *find_name(struct name_record *n, + struct nmb_name *name, int search); +struct name_record *find_name_search(struct subnet_record **d, + struct nmb_name *name, + int search, struct in_addr ip); +void dump_names(void); +void load_netbios_names(void); +void remove_netbios_name(struct subnet_record *d, + char *name,int type, enum name_source source, + struct in_addr ip); +struct name_record *add_netbios_entry(struct subnet_record *d, + char *name, int type, int nb_flags, + int ttl, enum name_source source, struct in_addr ip, + BOOL new_only,BOOL wins); +void expire_names(time_t t); +struct name_record *dns_name_search(struct nmb_name *question, int Time); + +/*The following definitions come from namedbresp.c */ + +void add_response_record(struct subnet_record *d, + struct response_record *n); +void remove_response_record(struct subnet_record *d, + struct response_record *n); +struct response_record *make_response_queue_record(enum state_type state, + int id,uint16 fd, + int quest_type, char *name,int type, int nb_flags, time_t ttl, + int server_type, char *my_name, char *my_comment, + BOOL bcast,BOOL recurse, + struct in_addr send_ip, struct in_addr reply_to_ip); +struct response_record *find_response_record(struct subnet_record **d, + uint16 id); + +/*The following definitions come from namedbserver.c */ + +void remove_old_servers(struct work_record *work, time_t t, + BOOL remove_all); +struct server_record *find_server(struct work_record *work, char *name); +struct server_record *add_server_entry(struct subnet_record *d, + struct work_record *work, + char *name,int servertype, + int ttl,char *comment, + BOOL replace); +void expire_servers(time_t t); + +/*The following definitions come from namedbsubnet.c */ + +struct subnet_record *find_subnet(struct in_addr bcast_ip); +struct subnet_record *find_req_subnet(struct in_addr ip, BOOL bcast); +struct subnet_record *find_subnet_all(struct in_addr bcast_ip); +void add_workgroup_to_subnet( struct subnet_record *d, char *group); +void add_my_subnets(char *group); +void write_browse_list(time_t t); + +/*The following definitions come from namedbwork.c */ + +struct work_record *remove_workgroup(struct subnet_record *d, + struct work_record *work, + BOOL remove_all_servers); +struct work_record *find_workgroupstruct(struct subnet_record *d, + fstring name, BOOL add); +void dump_workgroups(void); + +/*The following definitions come from nameelect.c */ + +void check_master_browser(time_t t); +void browser_gone(char *work_name, struct in_addr ip); +void send_election(struct subnet_record *d, char *group,uint32 criterion, + int timeup,char *name); +void name_unregister_work(struct subnet_record *d, char *name, int name_type); +void name_register_work(struct subnet_record *d, char *name, int name_type, + int nb_flags, time_t ttl, struct in_addr ip, BOOL bcast); +void become_local_master(struct subnet_record *d, struct work_record *work); +void become_domain_master(struct subnet_record *d, struct work_record *work); +void become_logon_server(struct subnet_record *d, struct work_record *work); +void unbecome_local_master(struct subnet_record *d, struct work_record *work, + int remove_type); +void unbecome_domain_master(struct subnet_record *d, struct work_record *work, + int remove_type); +void unbecome_logon_server(struct subnet_record *d, struct work_record *work, + int remove_type); +void run_elections(time_t t); +void process_election(struct packet_struct *p,char *buf); +BOOL check_elections(void); + +/*The following definitions come from namelogon.c */ + +void process_logon_packet(struct packet_struct *p,char *buf,int len); + +/*The following definitions come from namepacket.c */ + +void debug_browse_data(char *outbuf, int len); +void initiate_netbios_packet(uint16 *id, + int fd,int quest_type,char *name,int name_type, + int nb_flags,BOOL bcast,BOOL recurse, + struct in_addr to_ip); +void reply_netbios_packet(struct packet_struct *p1,int trn_id, + int rcode, int rcv_code, int opcode, + BOOL recursion_available, + BOOL recursion_desired, + struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, + char *data,int len); +void queue_packet(struct packet_struct *packet); +void run_packet_queue(); +void listen_for_packets(BOOL run_election); +BOOL send_mailslot_reply(BOOL unique, char *mailslot,int fd,char *buf,int len,char *srcname, + char *dstname,int src_type,int dest_type, + struct in_addr dest_ip,struct in_addr src_ip); + +/*The following definitions come from namequery.c */ + +BOOL name_status(int fd,char *name,int name_type,BOOL recurse, + struct in_addr to_ip,char *master,char *rname, + void (*fn)()); +BOOL name_query(int fd,char *name,int name_type, + BOOL bcast,BOOL recurse, + struct in_addr to_ip, struct in_addr *ip,void (*fn)()); + +/*The following definitions come from nameresp.c */ + +void expire_netbios_response_entries(time_t t); +struct response_record *queue_netbios_pkt_wins( + int fd,int quest_type,enum state_type state, + char *name,int name_type,int nb_flags, time_t ttl, + int server_type, char *my_name, char *my_comment, + struct in_addr send_ip, struct in_addr reply_to_ip); +struct response_record *queue_netbios_packet(struct subnet_record *d, + int fd,int quest_type,enum state_type state,char *name, + int name_type,int nb_flags, time_t ttl, + int server_type, char *my_name, char *my_comment, + BOOL bcast,BOOL recurse, + struct in_addr send_ip, struct in_addr reply_to_ip); + +/*The following definitions come from nameserv.c */ + +void remove_name_entry(struct subnet_record *d, char *name,int type); +void add_my_name_entry(struct subnet_record *d,char *name,int type,int nb_flags); +void add_domain_logon_names(void); +void add_domain_master_bcast(void); +void add_domain_master_wins(void); +void add_domain_names(time_t t); +void add_my_names(void); +void remove_my_names(); +void refresh_my_names(time_t t); +void query_refresh_names(time_t t); + +/*The following definitions come from nameservreply.c */ + +void add_name_respond(struct subnet_record *d, int fd, struct in_addr from_ip, + uint16 response_id, + struct nmb_name *name, + int nb_flags, int ttl, struct in_addr register_ip, + BOOL new_owner, struct in_addr reply_to_ip); +void reply_name_release(struct packet_struct *p); +void reply_name_reg(struct packet_struct *p); +void reply_name_status(struct packet_struct *p); +void reply_name_query(struct packet_struct *p); + +/*The following definitions come from nameservresp.c */ + +void debug_state_type(int state); +void response_netbios_packet(struct packet_struct *p); + +/*The following definitions come from namework.c */ + +void reset_server(char *name, int state, struct in_addr ip); +void tell_become_backup(void); +BOOL same_context(struct dgram_packet *dgram); +void process_browse_packet(struct packet_struct *p,char *buf,int len); + +/*The following definitions come from nmbd.c */ + +BOOL reload_services(BOOL test); + +/*The following definitions come from nmblib.c */ + +char *lookup_opcode_name( int opcode ); +void debug_nmb_packet(struct packet_struct *p); +char *namestr(struct nmb_name *n); +void free_nmb_packet(struct nmb_packet *nmb); +void free_packet(struct packet_struct *packet); +struct packet_struct *read_packet(int fd,enum packet_type packet_type); +void make_nmb_name(struct nmb_name *n,char *name,int type,char *this_scope); +BOOL send_packet(struct packet_struct *p); +struct packet_struct *receive_packet(int fd,enum packet_type type,int t); + +/*The following definitions come from nmblookup.c */ + +int main(int argc,char *argv[]); + +/*The following definitions come from nmbsync.c */ + +char *getsmbpass(char *pass); +void sync_browse_lists(struct subnet_record *d, struct work_record *work, + char *name, int nm_type, struct in_addr ip, BOOL local); + +/*The following definitions come from params.c */ + +BOOL pm_process(char *pszFileName,BOOL (*sfunc)(char *),BOOL (*pfunc)(char *,char *)); + +/*The following definitions come from password.c */ + +void generate_next_challenge(char *challenge); +BOOL set_challenge(char *challenge); +BOOL last_challenge(char *challenge); +user_struct *get_valid_user_struct(uint16 vuid); +void invalidate_vuid(uint16 vuid); +char *validated_username(uint16 vuid); +uint16 register_vuid(int uid,int gid, char *name,BOOL guest); +void add_session_user(char *user); +void dfs_unlogin(void); +BOOL password_check(char *password); +BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8); +BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd); +BOOL user_ok(char *user,int snum); +BOOL authorise_login(int snum,char *user,char *password, int pwlen, + BOOL *guest,BOOL *force,uint16 vuid); +BOOL check_hosts_equiv(char *user); +BOOL server_cryptkey(char *buf); +BOOL server_validate(char *buf); + +/*The following definitions come from pcap.c */ + +BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); +void pcap_printer_fn(void (*fn)()); + +/*The following definitions come from pipes.c */ + +int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize); +BOOL api_LsarpcSNPHS(int cnum,int uid, char *param,char *data, + int mdrcnt,int mprcnt, + char **rdata,char **rparam, + int *rdata_len,int *rparam_len); +BOOL api_LsarpcTNP(int cnum,int uid, char *param,char *data, + int mdrcnt,int mprcnt, + char **rdata,char **rparam, + int *rdata_len,int *rparam_len); + +/*The following definitions come from predict.c */ + +int read_predict(int fd,int offset,char *buf,char **ptr,int num); +void do_read_prediction(); +void invalidate_read_prediction(int fd); + +/*The following definitions come from printing.c */ + +void lpq_reset(int snum); +void print_file(int fnum); +int get_printqueue(int snum,int cnum,print_queue_struct **queue, + print_status_struct *status); +void del_printqueue(int cnum,int snum,int jobid); +void status_printjob(int cnum,int snum,int jobid,int status); +int printjob_encode(int snum, int job); +void printjob_decode(int jobid, int *snum, int *job); + +/*The following definitions come from quotas.c */ + +BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); +BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); +BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); +BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); +BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); + +/*The following definitions come from replace.c */ + +char *Strstr(char *s, char *p); +time_t Mktime(struct tm *t); +int InNetGr(char *group,char *host,char *user,char *dom); +void *malloc_wrapped(int size,char *file,int line); +void *realloc_wrapped(void *ptr,int size,char *file,int line); +void free_wrapped(void *ptr,char *file,int line); +void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line); + +/*The following definitions come from reply.c */ + +int reply_special(char *inbuf,char *outbuf); +int reply_tcon(char *inbuf,char *outbuf); +int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_unknown(char *inbuf,char *outbuf); +int reply_ioctl(char *inbuf,char *outbuf); +int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_chkpth(char *inbuf,char *outbuf); +int reply_getatr(char *inbuf,char *outbuf); +int reply_setatr(char *inbuf,char *outbuf); +int reply_dskattr(char *inbuf,char *outbuf); +int reply_search(char *inbuf,char *outbuf); +int reply_fclose(char *inbuf,char *outbuf); +int reply_open(char *inbuf,char *outbuf); +int reply_open_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_ulogoffX(char *inbuf,char *outbuf,int length,int bufsize); +int reply_mknew(char *inbuf,char *outbuf); +int reply_ctemp(char *inbuf,char *outbuf); +int reply_unlink(char *inbuf,char *outbuf); +int reply_readbraw(char *inbuf, char *outbuf); +int reply_lockread(char *inbuf,char *outbuf); +int reply_read(char *inbuf,char *outbuf); +int reply_read_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_writebraw(char *inbuf,char *outbuf); +int reply_writeunlock(char *inbuf,char *outbuf); +int reply_write(char *inbuf,char *outbuf,int dum1,int dum2); +int reply_write_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_lseek(char *inbuf,char *outbuf); +int reply_flush(char *inbuf,char *outbuf); +int reply_exit(char *inbuf,char *outbuf); +int reply_close(char *inbuf,char *outbuf); +int reply_writeclose(char *inbuf,char *outbuf); +int reply_lock(char *inbuf,char *outbuf); +int reply_unlock(char *inbuf,char *outbuf); +int reply_tdis(char *inbuf,char *outbuf); +int reply_echo(char *inbuf,char *outbuf); +int reply_printopen(char *inbuf,char *outbuf); +int reply_printclose(char *inbuf,char *outbuf); +int reply_printqueue(char *inbuf,char *outbuf); +int reply_printwrite(char *inbuf,char *outbuf); +int reply_mkdir(char *inbuf,char *outbuf); +int reply_rmdir(char *inbuf,char *outbuf); +int reply_mv(char *inbuf,char *outbuf); +int reply_copy(char *inbuf,char *outbuf); +int reply_setdir(char *inbuf,char *outbuf); +int reply_lockingX(char *inbuf,char *outbuf,int length,int bufsize); +int reply_readbmpx(char *inbuf,char *outbuf,int length,int bufsize); +int reply_writebmpx(char *inbuf,char *outbuf); +int reply_writebs(char *inbuf,char *outbuf); +int reply_setattrE(char *inbuf,char *outbuf); +int reply_getattrE(char *inbuf,char *outbuf); + +/*The following definitions come from server.c */ + +void *dflt_sig(void); +void killkids(void); +mode_t unix_mode(int cnum,int dosmode); +int dos_mode(int cnum,char *path,struct stat *sbuf); +int dos_chmod(int cnum,char *fname,int dosmode,struct stat *st); +BOOL unix_convert(char *name,int cnum,pstring saved_last_component, BOOL *bad_path); +int disk_free(char *path,int *bsize,int *dfree,int *dsize); +int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); +BOOL check_name(char *name,int cnum); +int fd_attempt_open(char *fname, int flags, int mode); +void fd_attempt_reopen(char *fname, int mode, file_fd_struct *fd_ptr); +int fd_attempt_close(file_fd_struct *fd_ptr); +void sync_file(int fnum); +void close_file(int fnum); +BOOL check_file_sharing(int cnum,char *fname); +void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun, + int mode,int *Access,int *action); +int seek_file(int fnum,uint32 pos); +int read_file(int fnum,char *data,uint32 pos,int n); +int write_file(int fnum,char *data,int n); +BOOL become_service(int cnum,BOOL do_chdir); +int find_service(char *service); +int cached_error_packet(char *inbuf,char *outbuf,int fnum,int line); +int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line); +int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int line); +BOOL snum_used(int snum); +BOOL reload_services(BOOL test); +int setup_groups(char *user, int uid, int gid, int *p_ngroups, + int **p_igroups, gid_t **p_groups); +int make_connection(char *service,char *user,char *password, int pwlen, char *dev,uint16 vuid); +int find_free_file(void ); +int reply_corep(char *outbuf); +int reply_coreplus(char *outbuf); +int reply_lanman1(char *outbuf); +int reply_lanman2(char *outbuf); +int reply_nt1(char *outbuf); +void close_cnum(int cnum, uint16 vuid); +BOOL yield_connection(int cnum,char *name,int max_connections); +BOOL claim_connection(int cnum,char *name,int max_connections,BOOL Clear); +void exit_server(char *reason); +void standard_sub(int cnum,char *str); +char *smb_fn_name(int type); +int chain_reply(char *inbuf,char *outbuf,int size,int bufsize); +int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); + +/*The following definitions come from shmem.c */ + +BOOL smb_shm_create_hash_table( unsigned int size ); +BOOL smb_shm_open( char *file_name, int size); +BOOL smb_shm_close( void ); +smb_shm_offset_t smb_shm_alloc(int size); +BOOL smb_shm_free(smb_shm_offset_t offset); +smb_shm_offset_t smb_shm_get_userdef_off(void); +BOOL smb_shm_set_userdef_off(smb_shm_offset_t userdef_off); +void *smb_shm_offset2addr(smb_shm_offset_t offset); +smb_shm_offset_t smb_shm_addr2offset(void *addr); +BOOL smb_shm_lock_hash_entry( unsigned int entry); +BOOL smb_shm_unlock_hash_entry( unsigned int entry ); +BOOL smb_shm_get_usage(int *bytes_free, + int *bytes_used, + int *bytes_overhead); + +/*The following definitions come from smbdes.c */ + +void E_P16(unsigned char *p14,unsigned char *p16); +void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24); + +/*The following definitions come from smbencrypt.c */ + +void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); +void E_md4hash(uchar *passwd, uchar *p16); +void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); + +/*The following definitions come from smbpass.c */ + +int pw_file_lock(char *name, int type, int secs); +int pw_file_unlock(int fd); +struct smb_passwd *get_smbpwnam(char *name); + +/*The following definitions come from smbpasswd.c */ + + +/*The following definitions come from smbrun.c */ + + +/*The following definitions come from status.c */ + +void Ucrit_addUsername(pstring username); +unsigned int Ucrit_checkUsername(pstring username); +void Ucrit_addPid(int pid); +unsigned int Ucrit_checkPid(int pid); + +/*The following definitions come from system.c */ + +int sys_select(fd_set *fds,struct timeval *tval); +int sys_select(fd_set *fds,struct timeval *tval); +int sys_unlink(char *fname); +int sys_open(char *fname,int flags,int mode); +DIR *sys_opendir(char *dname); +int sys_stat(char *fname,struct stat *sbuf); +int sys_waitpid(pid_t pid,int *status,int options); +int sys_lstat(char *fname,struct stat *sbuf); +int sys_mkdir(char *dname,int mode); +int sys_rmdir(char *dname); +int sys_chdir(char *dname); +int sys_utime(char *fname,struct utimbuf *times); +int sys_rename(char *from, char *to); +int sys_chmod(char *fname,int mode); +char *sys_getwd(char *s); +int sys_chown(char *fname,int uid,int gid); +int sys_chroot(char *dname); +struct hostent *sys_gethostbyname(char *name); + +/*The following definitions come from testparm.c */ + + +/*The following definitions come from testprns.c */ + +int main(int argc, char *argv[]); + +/*The following definitions come from time.c */ + +void GetTimeOfDay(struct timeval *tval); +void TimeInit(void); +int TimeDiff(time_t t); +struct tm *LocalTime(time_t *t); +time_t interpret_long_date(char *p); +void put_long_date(char *p,time_t t); +void put_dos_date(char *buf,int offset,time_t unixdate); +void put_dos_date2(char *buf,int offset,time_t unixdate); +void put_dos_date3(char *buf,int offset,time_t unixdate); +time_t make_unix_date(void *date_ptr); +time_t make_unix_date2(void *date_ptr); +time_t make_unix_date3(void *date_ptr); +BOOL set_filetime(char *fname,time_t mtime); +char *timestring(void ); + +/*The following definitions come from trans2.c */ + +int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize); +int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize); +int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize); +int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize); + +/*The following definitions come from ufc.c */ + +char *ufc_crypt(char *key,char *salt); + +/*The following definitions come from uid.c */ + +void init_uid(void); +BOOL become_guest(void); +BOOL become_user(int cnum, uint16 vuid); +BOOL unbecome_user(void ); +int smbrun(char *cmd,char *outfile,BOOL shared); + +/*The following definitions come from username.c */ + +char *get_home_dir(char *user); +void map_username(char *user); +struct passwd *Get_Pwnam(char *user,BOOL allow_change); +BOOL user_in_list(char *user,char *list); + +/*The following definitions come from util.c */ + void setup_logging(char *pname,BOOL interactive); void reopen_logs(void); char *tmpdir(void); @@ -2021,6 +924,9 @@ int write_data(int fd,char *buffer,int N); int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align); int read_smb_length(int fd,char *inbuf,int timeout); BOOL receive_smb(int fd,char *buffer,int timeout); +BOOL receive_message_or_smb(int smbfd, int oplock_fd, + char *buffer, int buffer_len, + int timeout, BOOL *got_smb); BOOL send_smb(int fd,char *buffer); char *name_ptr(char *buf,int ofs); int name_extract(char *buf,int ofs,char *name); -- cgit From 6dd6b1383c0ed10c0897dea44f247befc15b03cc Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 25 Sep 1997 00:25:44 +0000 Subject: Makefile: Removed earlier errors. includes.h: Added INADDR_LOOPBACK define. locking.c: More code to support oplocks. proto.h: Updated. server.c: More code to support oplocks. Moved processing of an SMB out of process() into a separate function so it is easier to call from an oplock break. smb.h: Added oplock fields. Jeremy (jallison@whistle.com) (This used to be commit f46dbaf08eb8e06a7545d2c19dce9e2dda9dcc78) --- source3/include/includes.h | 4 ++++ source3/include/proto.h | 4 ++-- source3/include/smb.h | 16 ++++++++++++---- 3 files changed, 18 insertions(+), 6 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index e66ceb2d70..2329553d23 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -1194,6 +1194,10 @@ it works and getting lots of bug reports */ #define QSORT_CAST (int (*)()) #endif +#ifndef INADDR_LOOPBACK +#define INADDR_LOOPBACK 0x7f000001 +#endif /* INADDR_LOOPBACK */ + /* this is a rough check to see if this machine has a lstat() call. it is not guaranteed to work */ #if !(defined(S_ISLNK) || defined(S_IFLNK)) diff --git a/source3/include/proto.h b/source3/include/proto.h index 9c6cccb370..46a96a8bef 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -299,13 +299,13 @@ BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token tok int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, min_share_mode_entry **old_shares); void del_share_mode(share_lock_token token, int fnum); -BOOL set_share_mode(share_lock_token token, int fnum); +BOOL set_share_mode(share_lock_token token, int fnum, uint16 port); BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *ptok); BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token token); int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, min_share_mode_entry **old_shares); void del_share_mode(share_lock_token token, int fnum); -BOOL set_share_mode(share_lock_token token,int fnum); +BOOL set_share_mode(share_lock_token token,int fnum, uint16 port); /*The following definitions come from mangle.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index 05f73f7f45..a67b3c02c9 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -433,9 +433,6 @@ struct interface struct in_addr ip; struct in_addr bcast; struct in_addr nmask; - char *name; - size_t mtu; /* may be useful in future... */ - short flags; }; /* share mode record pointed to in shared memory hash bucket */ @@ -455,6 +452,9 @@ typedef struct { smb_shm_offset_t next_share_mode_entry; int pid; +#ifdef USE_OPLOCKS + uint16 op_port; +#endif /* USE_OPLOCKS */ int share_mode; struct timeval time; } share_mode_entry; @@ -463,6 +463,9 @@ typedef struct typedef struct { int pid; +#ifdef USE_OPLOCKS + uint16 op_port; +#endif /* USE_OPLOCKS */ int share_mode; struct timeval time; } min_share_mode_entry; @@ -487,8 +490,13 @@ struct connect_record time_t start; }; - +#ifndef LOCKING_VERSION +#ifdef USE_OPLOCKS +#define LOCKING_VERSION 4 +#else /* USE_OPLOCKS */ #define LOCKING_VERSION 3 +#endif /* USE_OPLOCKS */ +#endif /* LOCKING_VERSION */ /* these are useful macros for checking validity of handles */ #define VALID_FNUM(fnum) (((fnum) >= 0) && ((fnum) < MAX_OPEN_FILES)) -- cgit From 776674812b426609958f5802c1573ba812f7426c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 25 Sep 1997 17:36:21 +0000 Subject: Added missing slow share mode offset defines. Somehow they got lost. Jeremy (jallison@whistle.com). (This used to be commit ce9cdc2f6175e4a6195f8875360cd945ae60052c) --- source3/include/smb.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index a67b3c02c9..435b71f4db 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -498,6 +498,40 @@ struct connect_record #endif /* USE_OPLOCKS */ #endif /* LOCKING_VERSION */ +#if !defined(FAST_SHARE_MODES) +/* + * Defines for slow share modes. + */ + +/* + * Locking file header lengths & offsets. + */ +#define SMF_VERSION_OFFSET 0 +#define SMF_NUM_ENTRIES_OFFSET 4 +#define SMF_FILENAME_LEN_OFFSET 8 +#define SMF_HEADER_LENGTH 10 + +#ifdef USE_OPLOCKS +#define SMF_ENTRY_LENGTH 16 +#else /* USE_OPLOCKS */ +#define SMF_ENTRY_LENGTH 18 +#endif /* USE_OPLOCKS */ + +/* + * Share mode record offsets. + */ + +#define SME_SEC_OFFSET 0 +#define SME_USEC_OFFSET 4 +#define SME_SHAREMODE_OFFSET 8 +#define SME_PID_OFFSET 12 + +#ifdef USE_OPLOCKS +#define SME_PORT_OFFSET 16 +#endif /* USE_OPLOCKS */ + +#endif /* FAST_SHARE_MODES */ + /* these are useful macros for checking validity of handles */ #define VALID_FNUM(fnum) (((fnum) >= 0) && ((fnum) < MAX_OPEN_FILES)) #define OPEN_FNUM(fnum) (VALID_FNUM(fnum) && Files[fnum].open) -- cgit From cef59090bb2fd3f8a9efd1a453cb90264b891d58 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 26 Sep 1997 18:55:29 +0000 Subject: Adding Andrews buffer overflow fixes into the main branch. Jeremy (jallison@whistle.com) (This used to be commit e7eb1f044d3101679dc7a118820ea5efe0cd837c) --- source3/include/local.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index fc589d7ac0..9548bf74b6 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -42,6 +42,8 @@ #define WORDMAX 0xFFFF +/* the maximum password length before we declare a likely attack */ +#define MAX_PASSWORD_LENGTH 200 /* separators for lists */ #define LIST_SEP " \t,;:\n\r" -- cgit From dff16872ca39c007d32d114af82d3ccd97f9d47a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 26 Sep 1997 19:26:56 +0000 Subject: Syncing up current oplock work in progress. #ifdef'ed out so should have no effect on other work. Jeremy (jallison@whistle.com) (This used to be commit 7e3d4c8b21f63a06d32605d230129e36883ad08c) --- source3/include/proto.h | 10 +++++++--- source3/include/smb.h | 50 ++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 52 insertions(+), 8 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 46a96a8bef..8903437d00 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -299,13 +299,13 @@ BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token tok int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, min_share_mode_entry **old_shares); void del_share_mode(share_lock_token token, int fnum); -BOOL set_share_mode(share_lock_token token, int fnum, uint16 port); +BOOL set_share_mode(share_lock_token token, int fnum, uint16 port, uint16 op_type); BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *ptok); BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token token); int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, min_share_mode_entry **old_shares); void del_share_mode(share_lock_token token, int fnum); -BOOL set_share_mode(share_lock_token token,int fnum, uint16 port); +BOOL set_share_mode(share_lock_token token,int fnum, uint16 port, uint16 op_type); /*The following definitions come from mangle.c */ @@ -707,8 +707,10 @@ int fd_attempt_close(file_fd_struct *fd_ptr); void sync_file(int fnum); void close_file(int fnum); BOOL check_file_sharing(int cnum,char *fname); +int check_share_mode( min_share_mode_entry *share, int deny_mode, char *fname, + BOOL fcbopen, int *flags); void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun, - int mode,int *Access,int *action); + int mode,int oplock_request, int *Access,int *action); int seek_file(int fnum,uint32 pos); int read_file(int fnum,char *data,uint32 pos,int n); int write_file(int fnum,char *data,int n); @@ -979,3 +981,5 @@ void file_unlock(int fd); BOOL is_myname(char *s); void set_remote_arch(enum remote_arch_types type); enum remote_arch_types get_remote_arch(); +void fstrcpy(char *dest, char *src); +void pstrcpy(char *dest, char *src); diff --git a/source3/include/smb.h b/source3/include/smb.h index 435b71f4db..07614194f7 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -330,6 +330,7 @@ typedef struct BOOL share_mode; BOOL print_file; BOOL modified; + BOOL granted_oplock; char *name; } files_struct; @@ -454,6 +455,7 @@ typedef struct int pid; #ifdef USE_OPLOCKS uint16 op_port; + uint16 op_type; #endif /* USE_OPLOCKS */ int share_mode; struct timeval time; @@ -465,6 +467,7 @@ typedef struct int pid; #ifdef USE_OPLOCKS uint16 op_port; + uint16 op_type; #endif /* USE_OPLOCKS */ int share_mode; struct timeval time; @@ -514,7 +517,7 @@ struct connect_record #ifdef USE_OPLOCKS #define SMF_ENTRY_LENGTH 16 #else /* USE_OPLOCKS */ -#define SMF_ENTRY_LENGTH 18 +#define SMF_ENTRY_LENGTH 20 #endif /* USE_OPLOCKS */ /* @@ -528,6 +531,7 @@ struct connect_record #ifdef USE_OPLOCKS #define SME_PORT_OFFSET 16 +#define SME_OPLOCK_TYPE_OFFSET 18 #endif /* USE_OPLOCKS */ #endif /* FAST_SHARE_MODES */ @@ -971,16 +975,52 @@ enum case_handling {CASE_LOWER,CASE_UPPER}; #define KANJI_CODEPAGE 932 #ifdef KANJI -/* Default client code page - Japanese */ +/* + * Default client code page - Japanese + */ #define DEFAULT_CLIENT_CODE_PAGE KANJI_CODEPAGE #else /* KANJI */ -/* Default client code page - 850 - Western European */ +/* + * Default client code page - 850 - Western European + */ #define DEFAULT_CLIENT_CODE_PAGE 850 #endif /* KANJI */ -/* Size of buffer to use when moving files across filesystems. */ + +/* + * Size of buffer to use when moving files across filesystems. + */ #define COPYBUF_SIZE (8*1024) -/* Integers used to override error codes. */ +/* + * Integers used to override error codes. + */ extern int unix_ERR_class; extern int unix_ERR_code; + +/* + * Map the Core and Extended Oplock requesst bits down + * to common bits (EXCLUSIVE_OPLOCK & BATCH_OPLOCK). + */ + +/* + * Core protocol. + */ +#define CORE_OPLOCK_REQUEST(inbuf) (((CVAL(inbuf,smb_flg)|(1<<5))>>5) | \ + ((CVAL(inbuf,smb_flg)|(1<<6))>>5)) + +/* + * Extended protocol. + */ +#define EXTENDED_OPLOCK_REQUEST(inbuf) (((SVAL(inbuf,smb_vwv2)|(1<<1))>>1) | \ + ((SVAL(inbuf,smb_vwv2)|(1<<2))>>1)) + +/* + * Bits we test with. + */ +#define EXCLUSIVE_OPLOCK 1 +#define BATCH_OPLOCK 2 + +#define CORE_OPLOCK_GRANTED (1<<5) +#define EXTENDED_OPLOCK_GRANTED (1<<15) + /* _SMB_H */ -- cgit From a0cd12e221af54e00aa7dd971c080881da8b32ac Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 30 Sep 1997 02:38:19 +0000 Subject: dir.c: more pstrcpys. local.h: Add OPLOCK_BREAK_TIMEOUT. password.c: Fix for paranoia password server security bug. proto.h: Updated. reply.c: Oplock changes. server.c: Massive oplock changes - nearly there.... smb.h: oplock definitions. util.c: Add local message processing queues for oplocks. Jeremy (jallison@whistle.com) (This used to be commit 92f1553db2cdf6f32881eb984a87050cf3e4760b) --- source3/include/local.h | 5 +++++ source3/include/proto.h | 7 ++++++- source3/include/smb.h | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index 9548bf74b6..e7eff2a300 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -159,4 +159,9 @@ /* the directory to sit in when idle */ /* #define IDLE_DIR "/" */ +/* Timout (in seconds) to wait for an oplock breal + message to return. */ + +#define OPLOCK_BREAK_TIMEOUT 120 + #endif diff --git a/source3/include/proto.h b/source3/include/proto.h index 8903437d00..7a1ccc626f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -719,6 +719,9 @@ int find_service(char *service); int cached_error_packet(char *inbuf,char *outbuf,int fnum,int line); int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line); int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int line); +BOOL oplock_break(uint32 dev, uint32 inode); +BOOL request_oplock_break(min_share_mode_entry *share_entry, + uint32 dev, uint32 inode); BOOL snum_used(int snum); BOOL reload_services(BOOL test); int setup_groups(char *user, int uid, int gid, int *p_ngroups, @@ -925,7 +928,9 @@ int read_data(int fd,char *buffer,int N); int write_data(int fd,char *buffer,int N); int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align); int read_smb_length(int fd,char *inbuf,int timeout); -BOOL receive_smb(int fd,char *buffer,int timeout); +BOOL receive_smb(int fd,char *buffer, int timeout); +BOOL receive_local_message(int fd, char *buffer, int buffer_len, int timeout); +BOOL push_local_message(char *buf, int msg_len); BOOL receive_message_or_smb(int smbfd, int oplock_fd, char *buffer, int buffer_len, int timeout, BOOL *got_smb); diff --git a/source3/include/smb.h b/source3/include/smb.h index 07614194f7..c8de001fda 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1014,6 +1014,17 @@ extern int unix_ERR_code; #define EXTENDED_OPLOCK_REQUEST(inbuf) (((SVAL(inbuf,smb_vwv2)|(1<<1))>>1) | \ ((SVAL(inbuf,smb_vwv2)|(1<<2))>>1)) +/* Lock types. */ +#define LOCKING_ANDX_SHARED_LOCK 0x1 +#define LOCKING_ANDX_OPLOCK_RELEASE 0x2 +#define LOCKING_ANDX_CHANGE_LOCKTYPE 0x4 +#define LOCKING_ANDX_CANCEL_LOCK 0x8 +#define LOCKING_ANDX_LARGE_FILES 0x10 + +/* Oplock levels */ +#define OPLOCKLEVEL_NONE 0 +#define OPLOCKLEVEL_II 1 + /* * Bits we test with. */ @@ -1023,4 +1034,34 @@ extern int unix_ERR_code; #define CORE_OPLOCK_GRANTED (1<<5) #define EXTENDED_OPLOCK_GRANTED (1<<15) +/* + * Loopback command offsets. + */ + +#define UDP_CMD_LEN_OFFSET 0 +#define UDP_CMD_PORT_OFFSET 4 +#define UDP_CMD_HEADER_LEN 6 + +#define UDP_MESSAGE_CMD_OFFSET 0 + +/* + * Oplock break command code to send over the udp socket. + * + * Form of this is : + * + * 0 2 6 10 + * +----+--------+--------+--------+ + * | cmd| pid | dev | inode | + * +----+--------+--------+--------+ + */ + +#define OPLOCK_BREAK_CMD 0x1 +#define OPLOCK_BREAK_PID_OFFSET 2 +#define OPLOCK_BREAK_DEV_OFFSET 6 +#define OPLOCK_BREAK_INODE_OFFSET 10 +#define OPLOCK_BREAK_MSG_LEN 14 + + +#define CMD_REPLY 0x8000 + /* _SMB_H */ -- cgit From 5864551aef50295addd1c8aa690a52870f70626d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 1 Oct 1997 23:32:22 +0000 Subject: OPLOCK CHECK-IN - oplocks are now *OPERATIONAL* !!!! Yipeee. At least as far as I can check in a short time :-). local.h: Changed OPLOCK_BREAK_TIMEOUT to 30 seconds. locking.c: Big changes to delete oplocks on a share mode entry. proto.h: updated. reply.c: Added oplock break code in lockingX reply & readbraw reply. server.c: Add batch oplock code. Force server shutdown if client fails to respond to oplock break. smb.h: Fix silly slow share mode oplock define bug. status.c: Add oplock status info. Jeremy (jallison@whistle.com) (This used to be commit 4c83d37239f15f855fc10f01d7b4bf4217fb9eda) --- source3/include/local.h | 2 +- source3/include/proto.h | 2 ++ source3/include/smb.h | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index e7eff2a300..3ce75eeb4e 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -162,6 +162,6 @@ /* Timout (in seconds) to wait for an oplock breal message to return. */ -#define OPLOCK_BREAK_TIMEOUT 120 +#define OPLOCK_BREAK_TIMEOUT 30 #endif diff --git a/source3/include/proto.h b/source3/include/proto.h index 7a1ccc626f..ac81f8cb37 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -300,12 +300,14 @@ int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, min_share_mode_entry **old_shares); void del_share_mode(share_lock_token token, int fnum); BOOL set_share_mode(share_lock_token token, int fnum, uint16 port, uint16 op_type); +BOOL remove_share_oplock(int fnum, share_lock_token token); BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *ptok); BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token token); int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, min_share_mode_entry **old_shares); void del_share_mode(share_lock_token token, int fnum); BOOL set_share_mode(share_lock_token token,int fnum, uint16 port, uint16 op_type); +BOOL remove_share_oplock(int fnum, share_lock_token token); /*The following definitions come from mangle.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index c8de001fda..509c1e1cf1 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -515,9 +515,9 @@ struct connect_record #define SMF_HEADER_LENGTH 10 #ifdef USE_OPLOCKS -#define SMF_ENTRY_LENGTH 16 -#else /* USE_OPLOCKS */ #define SMF_ENTRY_LENGTH 20 +#else /* USE_OPLOCKS */ +#define SMF_ENTRY_LENGTH 16 #endif /* USE_OPLOCKS */ /* -- cgit From 85097a7c177977c3e0cb9b2ad41642dba5f917ac Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 2 Oct 1997 03:14:32 +0000 Subject: change the semantics of hosts allow/hosts deny so that a global setting applies to all shares regardless of any settings on other shares. This allows us to immediately drop a connection if it does not come from a allowed host, without even parsing the first SMB packet. The next time we get a nasty security hole we can offer people the option of just setting their hosts allow line. If we drop a connection in this way we generate a "Not listening for calling name" response and then exit. add a per share "oplocks" option in smb.conf. I think its important to be able to disable oplocks on a per-share basis as there are occasions then they are definately not wanted, for example when sharing data between a windows box and a unix application. This also allows us to tell people "try disabling oplocks" when diagnosing problems. fix a bug in process_smb(). It was taking the length of the packet from outbuf, not inbuf (this bug was introduced with the oplocks code). Jeremy, I assume this wasn't deliberate? (This used to be commit 44bc9f239aa0b3cdf6cf9ad8d3911e397eba7335) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index ac81f8cb37..51433333c5 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -248,6 +248,7 @@ BOOL lp_map_archive(int ); BOOL lp_locking(int ); BOOL lp_strict_locking(int ); BOOL lp_share_modes(int ); +BOOL lp_oplocks(int ); BOOL lp_onlyuser(int ); BOOL lp_manglednames(int ); BOOL lp_widelinks(int ); -- cgit From 4438d7b57e459e091017fcbe18547a8b69be4d80 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 3 Oct 1997 03:15:24 +0000 Subject: proto.h: Updated. server.c: Updated after netbench observation. Oplocks must be broken *before* share modes are checked, not after. Netbench seems to be working now. smb.h: Added offsets for oplock break time fields. trans2.c: Upped debug messages. util.c: Upped debug messages. Jeremy (jallison@whistle.com) (This used to be commit bc4b70c566ed5fa926441fb64a0f756a6137d8d0) --- source3/include/proto.h | 2 +- source3/include/smb.h | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 51433333c5..35d43afe0c 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -722,7 +722,7 @@ int find_service(char *service); int cached_error_packet(char *inbuf,char *outbuf,int fnum,int line); int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line); int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int line); -BOOL oplock_break(uint32 dev, uint32 inode); +BOOL oplock_break(uint32 dev, uint32 inode, struct timeval *tval); BOOL request_oplock_break(min_share_mode_entry *share_entry, uint32 dev, uint32 inode); BOOL snum_used(int snum); diff --git a/source3/include/smb.h b/source3/include/smb.h index 509c1e1cf1..66da2099c7 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1049,17 +1049,19 @@ extern int unix_ERR_code; * * Form of this is : * - * 0 2 6 10 - * +----+--------+--------+--------+ - * | cmd| pid | dev | inode | - * +----+--------+--------+--------+ + * 0 2 6 10 14 18 22 + * +----+--------+--------+--------+-------+--------+ + * | cmd| pid | dev | inode | sec | usec | + * +----+--------+--------+--------+-------+--------+ */ #define OPLOCK_BREAK_CMD 0x1 #define OPLOCK_BREAK_PID_OFFSET 2 #define OPLOCK_BREAK_DEV_OFFSET 6 #define OPLOCK_BREAK_INODE_OFFSET 10 -#define OPLOCK_BREAK_MSG_LEN 14 +#define OPLOCK_BREAK_SEC_OFFSET 14 +#define OPLOCK_BREAK_USEC_OFFSET 18 +#define OPLOCK_BREAK_MSG_LEN 22 #define CMD_REPLY 0x8000 -- cgit From 2534e0688ba703423c9d18b3296b00c097aa351d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 3 Oct 1997 03:34:19 +0000 Subject: add "static" to a couple of functions that are only used locally. set granted_oplock=False at the start of open_file(). This is paranoia. (This used to be commit c7f09ffd4a00ef7266e3f54536ee6aaca9335fb8) --- source3/include/proto.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 35d43afe0c..8818b9b527 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -704,9 +704,6 @@ BOOL unix_convert(char *name,int cnum,pstring saved_last_component, BOOL *bad_pa int disk_free(char *path,int *bsize,int *dfree,int *dsize); int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); BOOL check_name(char *name,int cnum); -int fd_attempt_open(char *fname, int flags, int mode); -void fd_attempt_reopen(char *fname, int mode, file_fd_struct *fd_ptr); -int fd_attempt_close(file_fd_struct *fd_ptr); void sync_file(int fnum); void close_file(int fnum); BOOL check_file_sharing(int cnum,char *fname); -- cgit From 553093c344a4de519b7b267ac38493fe76319b51 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 4 Oct 1997 05:19:24 +0000 Subject: This is all the NT error codes less than 1000. I extracted them using smbclient+netmon If we want to start supporting NT error codes in Samba (which may be forced upon us by buggy apps) then this is a good start. (This used to be commit 20bfde40b20f43cf8c6714ab9fb5a3fd17bc1575) --- source3/include/nterr.h | 505 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 505 insertions(+) create mode 100644 source3/include/nterr.h (limited to 'source3/include') diff --git a/source3/include/nterr.h b/source3/include/nterr.h new file mode 100644 index 0000000000..92f02612db --- /dev/null +++ b/source3/include/nterr.h @@ -0,0 +1,505 @@ +/* these are the NT error codes less than 1000. They are here for when + we start supporting NT error codes in Samba. They were extracted + using a loop in smbclient then printing a netmon sniff to a file */ + +#define NT_STATUS_UNSUCCESSFUL (1) +#define NT_STATUS_NOT_IMPLEMENTED (2) +#define NT_STATUS_INVALID_INFO_CLASS (3) +#define NT_STATUS_INFO_LENGTH_MISMATCH (4) +#define NT_STATUS_ACCESS_VIOLATION (5) +#define NT_STATUS_IN_PAGE_ERROR (6) +#define NT_STATUS_PAGEFILE_QUOTA (7) +#define NT_STATUS_INVALID_HANDLE (8) +#define NT_STATUS_BAD_INITIAL_STACK (9) +#define NT_STATUS_BAD_INITIAL_PC (10) +#define NT_STATUS_INVALID_CID (11) +#define NT_STATUS_TIMER_NOT_CANCELED (12) +#define NT_STATUS_INVALID_PARAMETER (13) +#define NT_STATUS_NO_SUCH_DEVICE (14) +#define NT_STATUS_NO_SUCH_FILE (15) +#define NT_STATUS_INVALID_DEVICE_REQUEST (16) +#define NT_STATUS_END_OF_FILE (17) +#define NT_STATUS_WRONG_VOLUME (18) +#define NT_STATUS_NO_MEDIA_IN_DEVICE (19) +#define NT_STATUS_UNRECOGNIZED_MEDIA (20) +#define NT_STATUS_NONEXISTENT_SECTOR (21) +#define NT_STATUS_MORE_PROCESSING_REQUIRED (22) +#define NT_STATUS_NO_MEMORY (23) +#define NT_STATUS_CONFLICTING_ADDRESSES (24) +#define NT_STATUS_NOT_MAPPED_VIEW (25) +#define NT_STATUS_UNABLE_TO_FREE_VM (26) +#define NT_STATUS_UNABLE_TO_DELETE_SECTION (27) +#define NT_STATUS_INVALID_SYSTEM_SERVICE (28) +#define NT_STATUS_ILLEGAL_INSTRUCTION (29) +#define NT_STATUS_INVALID_LOCK_SEQUENCE (30) +#define NT_STATUS_INVALID_VIEW_SIZE (31) +#define NT_STATUS_INVALID_FILE_FOR_SECTION (32) +#define NT_STATUS_ALREADY_COMMITTED (33) +#define NT_STATUS_ACCESS_DENIED (34) +#define NT_STATUS_BUFFER_TOO_SMALL (35) +#define NT_STATUS_OBJECT_TYPE_MISMATCH (36) +#define NT_STATUS_NONCONTINUABLE_EXCEPTION (37) +#define NT_STATUS_INVALID_DISPOSITION (38) +#define NT_STATUS_UNWIND (39) +#define NT_STATUS_BAD_STACK (40) +#define NT_STATUS_INVALID_UNWIND_TARGET (41) +#define NT_STATUS_NOT_LOCKED (42) +#define NT_STATUS_PARITY_ERROR (43) +#define NT_STATUS_UNABLE_TO_DECOMMIT_VM (44) +#define NT_STATUS_NOT_COMMITTED (45) +#define NT_STATUS_INVALID_PORT_ATTRIBUTES (46) +#define NT_STATUS_PORT_MESSAGE_TOO_LONG (47) +#define NT_STATUS_INVALID_PARAMETER_MIX (48) +#define NT_STATUS_INVALID_QUOTA_LOWER (49) +#define NT_STATUS_DISK_CORRUPT_ERROR (50) +#define NT_STATUS_OBJECT_NAME_INVALID (51) +#define NT_STATUS_OBJECT_NAME_NOT_FOUND (52) +#define NT_STATUS_OBJECT_NAME_COLLISION (53) +#define NT_STATUS_HANDLE_NOT_WAITABLE (54) +#define NT_STATUS_PORT_DISCONNECTED (55) +#define NT_STATUS_DEVICE_ALREADY_ATTACHED (56) +#define NT_STATUS_OBJECT_PATH_INVALID (57) +#define NT_STATUS_OBJECT_PATH_NOT_FOUND (58) +#define NT_STATUS_OBJECT_PATH_SYNTAX_BAD (59) +#define NT_STATUS_DATA_OVERRUN (60) +#define NT_STATUS_DATA_LATE_ERROR (61) +#define NT_STATUS_DATA_ERROR (62) +#define NT_STATUS_CRC_ERROR (63) +#define NT_STATUS_SECTION_TOO_BIG (64) +#define NT_STATUS_PORT_CONNECTION_REFUSED (65) +#define NT_STATUS_INVALID_PORT_HANDLE (66) +#define NT_STATUS_SHARING_VIOLATION (67) +#define NT_STATUS_QUOTA_EXCEEDED (68) +#define NT_STATUS_INVALID_PAGE_PROTECTION (69) +#define NT_STATUS_MUTANT_NOT_OWNED (70) +#define NT_STATUS_SEMAPHORE_LIMIT_EXCEEDED (71) +#define NT_STATUS_PORT_ALREADY_SET (72) +#define NT_STATUS_SECTION_NOT_IMAGE (73) +#define NT_STATUS_SUSPEND_COUNT_EXCEEDED (74) +#define NT_STATUS_THREAD_IS_TERMINATING (75) +#define NT_STATUS_BAD_WORKING_SET_LIMIT (76) +#define NT_STATUS_INCOMPATIBLE_FILE_MAP (77) +#define NT_STATUS_SECTION_PROTECTION (78) +#define NT_STATUS_EAS_NOT_SUPPORTED (79) +#define NT_STATUS_EA_TOO_LARGE (80) +#define NT_STATUS_NONEXISTENT_EA_ENTRY (81) +#define NT_STATUS_NO_EAS_ON_FILE (82) +#define NT_STATUS_EA_CORRUPT_ERROR (83) +#define NT_STATUS_FILE_LOCK_CONFLICT (84) +#define NT_STATUS_LOCK_NOT_GRANTED (85) +#define NT_STATUS_DELETE_PENDING (86) +#define NT_STATUS_CTL_FILE_NOT_SUPPORTED (87) +#define NT_STATUS_UNKNOWN_REVISION (88) +#define NT_STATUS_REVISION_MISMATCH (89) +#define NT_STATUS_INVALID_OWNER (90) +#define NT_STATUS_INVALID_PRIMARY_GROUP (91) +#define NT_STATUS_NO_IMPERSONATION_TOKEN (92) +#define NT_STATUS_CANT_DISABLE_MANDATORY (93) +#define NT_STATUS_NO_LOGON_SERVERS (94) +#define NT_STATUS_NO_SUCH_LOGON_SESSION (95) +#define NT_STATUS_NO_SUCH_PRIVILEGE (96) +#define NT_STATUS_PRIVILEGE_NOT_HELD (97) +#define NT_STATUS_INVALID_ACCOUNT_NAME (98) +#define NT_STATUS_USER_EXISTS (99) +#define NT_STATUS_NO_SUCH_USER (100) +#define NT_STATUS_GROUP_EXISTS (101) +#define NT_STATUS_NO_SUCH_GROUP (102) +#define NT_STATUS_MEMBER_IN_GROUP (103) +#define NT_STATUS_MEMBER_NOT_IN_GROUP (104) +#define NT_STATUS_LAST_ADMIN (105) +#define NT_STATUS_WRONG_PASSWORD (106) +#define NT_STATUS_ILL_FORMED_PASSWORD (107) +#define NT_STATUS_PASSWORD_RESTRICTION (108) +#define NT_STATUS_LOGON_FAILURE (109) +#define NT_STATUS_ACCOUNT_RESTRICTION (110) +#define NT_STATUS_INVALID_LOGON_HOURS (111) +#define NT_STATUS_INVALID_WORKSTATION (112) +#define NT_STATUS_PASSWORD_EXPIRED (113) +#define NT_STATUS_ACCOUNT_DISABLED (114) +#define NT_STATUS_NONE_MAPPED (115) +#define NT_STATUS_TOO_MANY_LUIDS_REQUESTED (116) +#define NT_STATUS_LUIDS_EXHAUSTED (117) +#define NT_STATUS_INVALID_SUB_AUTHORITY (118) +#define NT_STATUS_INVALID_ACL (119) +#define NT_STATUS_INVALID_SID (120) +#define NT_STATUS_INVALID_SECURITY_DESCR (121) +#define NT_STATUS_PROCEDURE_NOT_FOUND (122) +#define NT_STATUS_INVALID_IMAGE_FORMAT (123) +#define NT_STATUS_NO_TOKEN (124) +#define NT_STATUS_BAD_INHERITANCE_ACL (125) +#define NT_STATUS_RANGE_NOT_LOCKED (126) +#define NT_STATUS_DISK_FULL (127) +#define NT_STATUS_SERVER_DISABLED (128) +#define NT_STATUS_SERVER_NOT_DISABLED (129) +#define NT_STATUS_TOO_MANY_GUIDS_REQUESTED (130) +#define NT_STATUS_GUIDS_EXHAUSTED (131) +#define NT_STATUS_INVALID_ID_AUTHORITY (132) +#define NT_STATUS_AGENTS_EXHAUSTED (133) +#define NT_STATUS_INVALID_VOLUME_LABEL (134) +#define NT_STATUS_SECTION_NOT_EXTENDED (135) +#define NT_STATUS_NOT_MAPPED_DATA (136) +#define NT_STATUS_RESOURCE_DATA_NOT_FOUND (137) +#define NT_STATUS_RESOURCE_TYPE_NOT_FOUND (138) +#define NT_STATUS_RESOURCE_NAME_NOT_FOUND (139) +#define NT_STATUS_ARRAY_BOUNDS_EXCEEDED (140) +#define NT_STATUS_FLOAT_DENORMAL_OPERAND (141) +#define NT_STATUS_FLOAT_DIVIDE_BY_ZERO (142) +#define NT_STATUS_FLOAT_INEXACT_RESULT (143) +#define NT_STATUS_FLOAT_INVALID_OPERATION (144) +#define NT_STATUS_FLOAT_OVERFLOW (145) +#define NT_STATUS_FLOAT_STACK_CHECK (146) +#define NT_STATUS_FLOAT_UNDERFLOW (147) +#define NT_STATUS_INTEGER_DIVIDE_BY_ZERO (148) +#define NT_STATUS_INTEGER_OVERFLOW (149) +#define NT_STATUS_PRIVILEGED_INSTRUCTION (150) +#define NT_STATUS_TOO_MANY_PAGING_FILES (151) +#define NT_STATUS_FILE_INVALID (152) +#define NT_STATUS_ALLOTTED_SPACE_EXCEEDED (153) +#define NT_STATUS_INSUFFICIENT_RESOURCES (154) +#define NT_STATUS_DFS_EXIT_PATH_FOUND (155) +#define NT_STATUS_DEVICE_DATA_ERROR (156) +#define NT_STATUS_DEVICE_NOT_CONNECTED (157) +#define NT_STATUS_DEVICE_POWER_FAILURE (158) +#define NT_STATUS_FREE_VM_NOT_AT_BASE (159) +#define NT_STATUS_MEMORY_NOT_ALLOCATED (160) +#define NT_STATUS_WORKING_SET_QUOTA (161) +#define NT_STATUS_MEDIA_WRITE_PROTECTED (162) +#define NT_STATUS_DEVICE_NOT_READY (163) +#define NT_STATUS_INVALID_GROUP_ATTRIBUTES (164) +#define NT_STATUS_BAD_IMPERSONATION_LEVEL (165) +#define NT_STATUS_CANT_OPEN_ANONYMOUS (166) +#define NT_STATUS_BAD_VALIDATION_CLASS (167) +#define NT_STATUS_BAD_TOKEN_TYPE (168) +#define NT_STATUS_BAD_MASTER_BOOT_RECORD (169) +#define NT_STATUS_INSTRUCTION_MISALIGNMENT (170) +#define NT_STATUS_INSTANCE_NOT_AVAILABLE (171) +#define NT_STATUS_PIPE_NOT_AVAILABLE (172) +#define NT_STATUS_INVALID_PIPE_STATE (173) +#define NT_STATUS_PIPE_BUSY (174) +#define NT_STATUS_ILLEGAL_FUNCTION (175) +#define NT_STATUS_PIPE_DISCONNECTED (176) +#define NT_STATUS_PIPE_CLOSING (177) +#define NT_STATUS_PIPE_CONNECTED (178) +#define NT_STATUS_PIPE_LISTENING (179) +#define NT_STATUS_INVALID_READ_MODE (180) +#define NT_STATUS_IO_TIMEOUT (181) +#define NT_STATUS_FILE_FORCED_CLOSED (182) +#define NT_STATUS_PROFILING_NOT_STARTED (183) +#define NT_STATUS_PROFILING_NOT_STOPPED (184) +#define NT_STATUS_COULD_NOT_INTERPRET (185) +#define NT_STATUS_FILE_IS_A_DIRECTORY (186) +#define NT_STATUS_NOT_SUPPORTED (187) +#define NT_STATUS_REMOTE_NOT_LISTENING (188) +#define NT_STATUS_DUPLICATE_NAME (189) +#define NT_STATUS_BAD_NETWORK_PATH (190) +#define NT_STATUS_NETWORK_BUSY (191) +#define NT_STATUS_DEVICE_DOES_NOT_EXIST (192) +#define NT_STATUS_TOO_MANY_COMMANDS (193) +#define NT_STATUS_ADAPTER_HARDWARE_ERROR (194) +#define NT_STATUS_INVALID_NETWORK_RESPONSE (195) +#define NT_STATUS_UNEXPECTED_NETWORK_ERROR (196) +#define NT_STATUS_BAD_REMOTE_ADAPTER (197) +#define NT_STATUS_PRINT_QUEUE_FULL (198) +#define NT_STATUS_NO_SPOOL_SPACE (199) +#define NT_STATUS_PRINT_CANCELLED (200) +#define NT_STATUS_NETWORK_NAME_DELETED (201) +#define NT_STATUS_NETWORK_ACCESS_DENIED (202) +#define NT_STATUS_BAD_DEVICE_TYPE (203) +#define NT_STATUS_BAD_NETWORK_NAME (204) +#define NT_STATUS_TOO_MANY_NAMES (205) +#define NT_STATUS_TOO_MANY_SESSIONS (206) +#define NT_STATUS_SHARING_PAUSED (207) +#define NT_STATUS_REQUEST_NOT_ACCEPTED (208) +#define NT_STATUS_REDIRECTOR_PAUSED (209) +#define NT_STATUS_NET_WRITE_FAULT (210) +#define NT_STATUS_PROFILING_AT_LIMIT (211) +#define NT_STATUS_NOT_SAME_DEVICE (212) +#define NT_STATUS_FILE_RENAMED (213) +#define NT_STATUS_VIRTUAL_CIRCUIT_CLOSED (214) +#define NT_STATUS_NO_SECURITY_ON_OBJECT (215) +#define NT_STATUS_CANT_WAIT (216) +#define NT_STATUS_PIPE_EMPTY (217) +#define NT_STATUS_CANT_ACCESS_DOMAIN_INFO (218) +#define NT_STATUS_CANT_TERMINATE_SELF (219) +#define NT_STATUS_INVALID_SERVER_STATE (220) +#define NT_STATUS_INVALID_DOMAIN_STATE (221) +#define NT_STATUS_INVALID_DOMAIN_ROLE (222) +#define NT_STATUS_NO_SUCH_DOMAIN (223) +#define NT_STATUS_DOMAIN_EXISTS (224) +#define NT_STATUS_DOMAIN_LIMIT_EXCEEDED (225) +#define NT_STATUS_OPLOCK_NOT_GRANTED (226) +#define NT_STATUS_INVALID_OPLOCK_PROTOCOL (227) +#define NT_STATUS_INTERNAL_DB_CORRUPTION (228) +#define NT_STATUS_INTERNAL_ERROR (229) +#define NT_STATUS_GENERIC_NOT_MAPPED (230) +#define NT_STATUS_BAD_DESCRIPTOR_FORMAT (231) +#define NT_STATUS_INVALID_USER_BUFFER (232) +#define NT_STATUS_UNEXPECTED_IO_ERROR (233) +#define NT_STATUS_UNEXPECTED_MM_CREATE_ERR (234) +#define NT_STATUS_UNEXPECTED_MM_MAP_ERROR (235) +#define NT_STATUS_UNEXPECTED_MM_EXTEND_ERR (236) +#define NT_STATUS_NOT_LOGON_PROCESS (237) +#define NT_STATUS_LOGON_SESSION_EXISTS (238) +#define NT_STATUS_INVALID_PARAMETER_1 (239) +#define NT_STATUS_INVALID_PARAMETER_2 (240) +#define NT_STATUS_INVALID_PARAMETER_3 (241) +#define NT_STATUS_INVALID_PARAMETER_4 (242) +#define NT_STATUS_INVALID_PARAMETER_5 (243) +#define NT_STATUS_INVALID_PARAMETER_6 (244) +#define NT_STATUS_INVALID_PARAMETER_7 (245) +#define NT_STATUS_INVALID_PARAMETER_8 (246) +#define NT_STATUS_INVALID_PARAMETER_9 (247) +#define NT_STATUS_INVALID_PARAMETER_10 (248) +#define NT_STATUS_INVALID_PARAMETER_11 (249) +#define NT_STATUS_INVALID_PARAMETER_12 (250) +#define NT_STATUS_REDIRECTOR_NOT_STARTED (251) +#define NT_STATUS_REDIRECTOR_STARTED (252) +#define NT_STATUS_STACK_OVERFLOW (253) +#define NT_STATUS_NO_SUCH_PACKAGE (254) +#define NT_STATUS_BAD_FUNCTION_TABLE (255) +#define NT_STATUS_DIRECTORY_NOT_EMPTY (257) +#define NT_STATUS_FILE_CORRUPT_ERROR (258) +#define NT_STATUS_NOT_A_DIRECTORY (259) +#define NT_STATUS_BAD_LOGON_SESSION_STATE (260) +#define NT_STATUS_LOGON_SESSION_COLLISION (261) +#define NT_STATUS_NAME_TOO_LONG (262) +#define NT_STATUS_FILES_OPEN (263) +#define NT_STATUS_CONNECTION_IN_USE (264) +#define NT_STATUS_MESSAGE_NOT_FOUND (265) +#define NT_STATUS_PROCESS_IS_TERMINATING (266) +#define NT_STATUS_INVALID_LOGON_TYPE (267) +#define NT_STATUS_NO_GUID_TRANSLATION (268) +#define NT_STATUS_CANNOT_IMPERSONATE (269) +#define NT_STATUS_IMAGE_ALREADY_LOADED (270) +#define NT_STATUS_ABIOS_NOT_PRESENT (271) +#define NT_STATUS_ABIOS_LID_NOT_EXIST (272) +#define NT_STATUS_ABIOS_LID_ALREADY_OWNED (273) +#define NT_STATUS_ABIOS_NOT_LID_OWNER (274) +#define NT_STATUS_ABIOS_INVALID_COMMAND (275) +#define NT_STATUS_ABIOS_INVALID_LID (276) +#define NT_STATUS_ABIOS_SELECTOR_NOT_AVAILABLE (277) +#define NT_STATUS_ABIOS_INVALID_SELECTOR (278) +#define NT_STATUS_NO_LDT (279) +#define NT_STATUS_INVALID_LDT_SIZE (280) +#define NT_STATUS_INVALID_LDT_OFFSET (281) +#define NT_STATUS_INVALID_LDT_DESCRIPTOR (282) +#define NT_STATUS_INVALID_IMAGE_NE_FORMAT (283) +#define NT_STATUS_RXACT_INVALID_STATE (284) +#define NT_STATUS_RXACT_COMMIT_FAILURE (285) +#define NT_STATUS_MAPPED_FILE_SIZE_ZERO (286) +#define NT_STATUS_TOO_MANY_OPENED_FILES (287) +#define NT_STATUS_CANCELLED (288) +#define NT_STATUS_CANNOT_DELETE (289) +#define NT_STATUS_INVALID_COMPUTER_NAME (290) +#define NT_STATUS_FILE_DELETED (291) +#define NT_STATUS_SPECIAL_ACCOUNT (292) +#define NT_STATUS_SPECIAL_GROUP (293) +#define NT_STATUS_SPECIAL_USER (294) +#define NT_STATUS_MEMBERS_PRIMARY_GROUP (295) +#define NT_STATUS_FILE_CLOSED (296) +#define NT_STATUS_TOO_MANY_THREADS (297) +#define NT_STATUS_THREAD_NOT_IN_PROCESS (298) +#define NT_STATUS_TOKEN_ALREADY_IN_USE (299) +#define NT_STATUS_PAGEFILE_QUOTA_EXCEEDED (300) +#define NT_STATUS_COMMITMENT_LIMIT (301) +#define NT_STATUS_INVALID_IMAGE_LE_FORMAT (302) +#define NT_STATUS_INVALID_IMAGE_NOT_MZ (303) +#define NT_STATUS_INVALID_IMAGE_PROTECT (304) +#define NT_STATUS_INVALID_IMAGE_WIN_16 (305) +#define NT_STATUS_LOGON_SERVER_CONFLICT (306) +#define NT_STATUS_TIME_DIFFERENCE_AT_DC (307) +#define NT_STATUS_SYNCHRONIZATION_REQUIRED (308) +#define NT_STATUS_DLL_NOT_FOUND (309) +#define NT_STATUS_OPEN_FAILED (310) +#define NT_STATUS_IO_PRIVILEGE_FAILED (311) +#define NT_STATUS_ORDINAL_NOT_FOUND (312) +#define NT_STATUS_ENTRYPOINT_NOT_FOUND (313) +#define NT_STATUS_CONTROL_C_EXIT (314) +#define NT_STATUS_LOCAL_DISCONNECT (315) +#define NT_STATUS_REMOTE_DISCONNECT (316) +#define NT_STATUS_REMOTE_RESOURCES (317) +#define NT_STATUS_LINK_FAILED (318) +#define NT_STATUS_LINK_TIMEOUT (319) +#define NT_STATUS_INVALID_CONNECTION (320) +#define NT_STATUS_INVALID_ADDRESS (321) +#define NT_STATUS_DLL_INIT_FAILED (322) +#define NT_STATUS_MISSING_SYSTEMFILE (323) +#define NT_STATUS_UNHANDLED_EXCEPTION (324) +#define NT_STATUS_APP_INIT_FAILURE (325) +#define NT_STATUS_PAGEFILE_CREATE_FAILED (326) +#define NT_STATUS_NO_PAGEFILE (327) +#define NT_STATUS_INVALID_LEVEL (328) +#define NT_STATUS_WRONG_PASSWORD_CORE (329) +#define NT_STATUS_ILLEGAL_FLOAT_CONTEXT (330) +#define NT_STATUS_PIPE_BROKEN (331) +#define NT_STATUS_REGISTRY_CORRUPT (332) +#define NT_STATUS_REGISTRY_IO_FAILED (333) +#define NT_STATUS_NO_EVENT_PAIR (334) +#define NT_STATUS_UNRECOGNIZED_VOLUME (335) +#define NT_STATUS_SERIAL_NO_DEVICE_INITED (336) +#define NT_STATUS_NO_SUCH_ALIAS (337) +#define NT_STATUS_MEMBER_NOT_IN_ALIAS (338) +#define NT_STATUS_MEMBER_IN_ALIAS (339) +#define NT_STATUS_ALIAS_EXISTS (340) +#define NT_STATUS_LOGON_NOT_GRANTED (341) +#define NT_STATUS_TOO_MANY_SECRETS (342) +#define NT_STATUS_SECRET_TOO_LONG (343) +#define NT_STATUS_INTERNAL_DB_ERROR (344) +#define NT_STATUS_FULLSCREEN_MODE (345) +#define NT_STATUS_TOO_MANY_CONTEXT_IDS (346) +#define NT_STATUS_LOGON_TYPE_NOT_GRANTED (347) +#define NT_STATUS_NOT_REGISTRY_FILE (348) +#define NT_STATUS_NT_CROSS_ENCRYPTION_REQUIRED (349) +#define NT_STATUS_DOMAIN_CTRLR_CONFIG_ERROR (350) +#define NT_STATUS_FT_MISSING_MEMBER (351) +#define NT_STATUS_ILL_FORMED_SERVICE_ENTRY (352) +#define NT_STATUS_ILLEGAL_CHARACTER (353) +#define NT_STATUS_UNMAPPABLE_CHARACTER (354) +#define NT_STATUS_UNDEFINED_CHARACTER (355) +#define NT_STATUS_FLOPPY_VOLUME (356) +#define NT_STATUS_FLOPPY_ID_MARK_NOT_FOUND (357) +#define NT_STATUS_FLOPPY_WRONG_CYLINDER (358) +#define NT_STATUS_FLOPPY_UNKNOWN_ERROR (359) +#define NT_STATUS_FLOPPY_BAD_REGISTERS (360) +#define NT_STATUS_DISK_RECALIBRATE_FAILED (361) +#define NT_STATUS_DISK_OPERATION_FAILED (362) +#define NT_STATUS_DISK_RESET_FAILED (363) +#define NT_STATUS_SHARED_IRQ_BUSY (364) +#define NT_STATUS_FT_ORPHANING (365) +#define NT_STATUS_PARTITION_FAILURE (370) +#define NT_STATUS_INVALID_BLOCK_LENGTH (371) +#define NT_STATUS_DEVICE_NOT_PARTITIONED (372) +#define NT_STATUS_UNABLE_TO_LOCK_MEDIA (373) +#define NT_STATUS_UNABLE_TO_UNLOAD_MEDIA (374) +#define NT_STATUS_EOM_OVERFLOW (375) +#define NT_STATUS_NO_MEDIA (376) +#define NT_STATUS_NO_SUCH_MEMBER (378) +#define NT_STATUS_INVALID_MEMBER (379) +#define NT_STATUS_KEY_DELETED (380) +#define NT_STATUS_NO_LOG_SPACE (381) +#define NT_STATUS_TOO_MANY_SIDS (382) +#define NT_STATUS_LM_CROSS_ENCRYPTION_REQUIRED (383) +#define NT_STATUS_KEY_HAS_CHILDREN (384) +#define NT_STATUS_CHILD_MUST_BE_VOLATILE (385) +#define NT_STATUS_DEVICE_CONFIGURATION_ERROR (386) +#define NT_STATUS_DRIVER_INTERNAL_ERROR (387) +#define NT_STATUS_INVALID_DEVICE_STATE (388) +#define NT_STATUS_IO_DEVICE_ERROR (389) +#define NT_STATUS_DEVICE_PROTOCOL_ERROR (390) +#define NT_STATUS_BACKUP_CONTROLLER (391) +#define NT_STATUS_LOG_FILE_FULL (392) +#define NT_STATUS_TOO_LATE (393) +#define NT_STATUS_NO_TRUST_LSA_SECRET (394) +#define NT_STATUS_NO_TRUST_SAM_ACCOUNT (395) +#define NT_STATUS_TRUSTED_DOMAIN_FAILURE (396) +#define NT_STATUS_TRUSTED_RELATIONSHIP_FAILURE (397) +#define NT_STATUS_EVENTLOG_FILE_CORRUPT (398) +#define NT_STATUS_EVENTLOG_CANT_START (399) +#define NT_STATUS_TRUST_FAILURE (400) +#define NT_STATUS_MUTANT_LIMIT_EXCEEDED (401) +#define NT_STATUS_NETLOGON_NOT_STARTED (402) +#define NT_STATUS_ACCOUNT_EXPIRED (403) +#define NT_STATUS_POSSIBLE_DEADLOCK (404) +#define NT_STATUS_NETWORK_CREDENTIAL_CONFLICT (405) +#define NT_STATUS_REMOTE_SESSION_LIMIT (406) +#define NT_STATUS_EVENTLOG_FILE_CHANGED (407) +#define NT_STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT (408) +#define NT_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT (409) +#define NT_STATUS_NOLOGON_SERVER_TRUST_ACCOUNT (410) +#define NT_STATUS_DOMAIN_TRUST_INCONSISTENT (411) +#define NT_STATUS_FS_DRIVER_REQUIRED (412) +#define NT_STATUS_NO_USER_SESSION_KEY (514) +#define NT_STATUS_USER_SESSION_DELETED (515) +#define NT_STATUS_RESOURCE_LANG_NOT_FOUND (516) +#define NT_STATUS_INSUFF_SERVER_RESOURCES (517) +#define NT_STATUS_INVALID_BUFFER_SIZE (518) +#define NT_STATUS_INVALID_ADDRESS_COMPONENT (519) +#define NT_STATUS_INVALID_ADDRESS_WILDCARD (520) +#define NT_STATUS_TOO_MANY_ADDRESSES (521) +#define NT_STATUS_ADDRESS_ALREADY_EXISTS (522) +#define NT_STATUS_ADDRESS_CLOSED (523) +#define NT_STATUS_CONNECTION_DISCONNECTED (524) +#define NT_STATUS_CONNECTION_RESET (525) +#define NT_STATUS_TOO_MANY_NODES (526) +#define NT_STATUS_TRANSACTION_ABORTED (527) +#define NT_STATUS_TRANSACTION_TIMED_OUT (528) +#define NT_STATUS_TRANSACTION_NO_RELEASE (529) +#define NT_STATUS_TRANSACTION_NO_MATCH (530) +#define NT_STATUS_TRANSACTION_RESPONDED (531) +#define NT_STATUS_TRANSACTION_INVALID_ID (532) +#define NT_STATUS_TRANSACTION_INVALID_TYPE (533) +#define NT_STATUS_NOT_SERVER_SESSION (534) +#define NT_STATUS_NOT_CLIENT_SESSION (535) +#define NT_STATUS_CANNOT_LOAD_REGISTRY_FILE (536) +#define NT_STATUS_DEBUG_ATTACH_FAILED (537) +#define NT_STATUS_SYSTEM_PROCESS_TERMINATED (538) +#define NT_STATUS_DATA_NOT_ACCEPTED (539) +#define NT_STATUS_NO_BROWSER_SERVERS_FOUND (540) +#define NT_STATUS_VDM_HARD_ERROR (541) +#define NT_STATUS_DRIVER_CANCEL_TIMEOUT (542) +#define NT_STATUS_REPLY_MESSAGE_MISMATCH (543) +#define NT_STATUS_MAPPED_ALIGNMENT (544) +#define NT_STATUS_IMAGE_CHECKSUM_MISMATCH (545) +#define NT_STATUS_LOST_WRITEBEHIND_DATA (546) +#define NT_STATUS_CLIENT_SERVER_PARAMETERS_INVALID (547) +#define NT_STATUS_PASSWORD_MUST_CHANGE (548) +#define NT_STATUS_NOT_FOUND (549) +#define NT_STATUS_NOT_TINY_STREAM (550) +#define NT_STATUS_RECOVERY_FAILURE (551) +#define NT_STATUS_STACK_OVERFLOW_READ (552) +#define NT_STATUS_FAIL_CHECK (553) +#define NT_STATUS_DUPLICATE_OBJECTID (554) +#define NT_STATUS_OBJECTID_EXISTS (555) +#define NT_STATUS_CONVERT_TO_LARGE (556) +#define NT_STATUS_RETRY (557) +#define NT_STATUS_FOUND_OUT_OF_SCOPE (558) +#define NT_STATUS_ALLOCATE_BUCKET (559) +#define NT_STATUS_PROPSET_NOT_FOUND (560) +#define NT_STATUS_MARSHALL_OVERFLOW (561) +#define NT_STATUS_INVALID_VARIANT (562) +#define NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND (563) +#define NT_STATUS_ACCOUNT_LOCKED_OUT (564) +#define NT_STATUS_HANDLE_NOT_CLOSABLE (565) +#define NT_STATUS_CONNECTION_REFUSED (566) +#define NT_STATUS_GRACEFUL_DISCONNECT (567) +#define NT_STATUS_ADDRESS_ALREADY_ASSOCIATED (568) +#define NT_STATUS_ADDRESS_NOT_ASSOCIATED (569) +#define NT_STATUS_CONNECTION_INVALID (570) +#define NT_STATUS_CONNECTION_ACTIVE (571) +#define NT_STATUS_NETWORK_UNREACHABLE (572) +#define NT_STATUS_HOST_UNREACHABLE (573) +#define NT_STATUS_PROTOCOL_UNREACHABLE (574) +#define NT_STATUS_PORT_UNREACHABLE (575) +#define NT_STATUS_REQUEST_ABORTED (576) +#define NT_STATUS_CONNECTION_ABORTED (577) +#define NT_STATUS_BAD_COMPRESSION_BUFFER (578) +#define NT_STATUS_USER_MAPPED_FILE (579) +#define NT_STATUS_AUDIT_FAILED (580) +#define NT_STATUS_TIMER_RESOLUTION_NOT_SET (581) +#define NT_STATUS_CONNECTION_COUNT_LIMIT (582) +#define NT_STATUS_LOGIN_TIME_RESTRICTION (583) +#define NT_STATUS_LOGIN_WKSTA_RESTRICTION (584) +#define NT_STATUS_IMAGE_MP_UP_MISMATCH (585) +#define NT_STATUS_INSUFFICIENT_LOGON_INFO (592) +#define NT_STATUS_BAD_DLL_ENTRYPOINT (593) +#define NT_STATUS_BAD_SERVICE_ENTRYPOINT (594) +#define NT_STATUS_LPC_REPLY_LOST (595) +#define NT_STATUS_IP_ADDRESS_CONFLICT1 (596) +#define NT_STATUS_IP_ADDRESS_CONFLICT2 (597) +#define NT_STATUS_REGISTRY_QUOTA_LIMIT (598) +#define NT_STATUS_PATH_NOT_COVERED (599) +#define NT_STATUS_NO_CALLBACK_ACTIVE (600) +#define NT_STATUS_LICENSE_QUOTA_EXCEEDED (601) +#define NT_STATUS_PWD_TOO_SHORT (602) +#define NT_STATUS_PWD_TOO_RECENT (603) +#define NT_STATUS_PWD_HISTORY_CONFLICT (604) +#define NT_STATUS_PLUGPLAY_NO_DEVICE (606) +#define NT_STATUS_UNSUPPORTED_COMPRESSION (607) +#define NT_STATUS_INVALID_HW_PROFILE (608) +#define NT_STATUS_INVALID_PLUGPLAY_DEVICE_PATH (609) +#define NT_STATUS_DRIVER_ORDINAL_NOT_FOUND (610) +#define NT_STATUS_DRIVER_ENTRYPOINT_NOT_FOUND (611) +#define NT_STATUS_RESOURCE_NOT_OWNED (612) +#define NT_STATUS_TOO_MANY_LINKS (613) +#define NT_STATUS_QUOTA_LIST_INCONSISTENT (614) +#define NT_STATUS_FILE_IS_OFFLINE (615) -- cgit From 87a3971233c684081ababc826958a917b1c5c4bd Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sat, 4 Oct 1997 16:26:02 +0000 Subject: added structures readable and writeable by smbparse.c routines into and out of SMB or Mailslot packets. (This used to be commit 4b3f9b281b3b1c1064992d19fef1d782dc6f1ff1) --- source3/include/smb.h | 182 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 182 insertions(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 66da2099c7..37474436ca 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -252,6 +252,188 @@ typedef char fstring[128]; typedef fstring string; +/* 32 bit time (sec) since 01jan1970 - cifs6.txt, section 3.5, page 30 */ +typedef uint32 UTIME; + +/* 64 bit time (100usec) since ????? - cifs6.txt, section 3.5, page 30 */ +typedef struct nttime +{ + uint32 low; + uint32 high; + +} NTTIME; + + +#define MAXSUBAUTHS 10 /* max sub authorities in a SID */ + +/* DOM_SID - security id */ +typedef struct sid_info +{ + uint8 sid_no; /* SID revision number */ + uint8 num_auths; /* number of sub-authorities */ + uint8 id_auth[6]; /* Identifier Authority */ + uint16 sub_auths[MAXSUBAUTHS]; /* pointer to sub-authorities. */ + +} DOM_SID; + +/* UNIHDR - unicode string header */ +typedef struct unihdr_info +{ + uint16 uni_max_len; + uint16 uni_str_len; + uint32 undoc; /* usually has a value of 4 */ + +} UNIHDR; + +/* UNIHDR2 - unicode string header and undocumented buffer */ +typedef struct unihdr2_info +{ + UNIHDR unihdr; + uint32 undoc_buffer; /* undocumented 32 bit buffer pointer */ + +} UNIHDR2; + +/* clueless as to what maximum length should be */ +#define MAX_UNISTRLEN 1024 + +/* UNISTR - unicode string size and buffer */ +typedef struct unistr_info +{ + uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. ***MUST*** be null-terminated */ + +} UNISTR; + +/* UNISTR2 - unicode string size and buffer */ +typedef struct unistr2_info +{ + uint32 uni_max_len; + uint32 undoc; + uint32 uni_str_len; + uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. **NOT** necessarily null-terminated */ + +} UNISTR2; + +/* DOM_SID2 - domain SID structure - SIDs stored in unicode */ +typedef struct domsid2_info +{ + uint32 type; /* value is 5 */ + uint32 undoc; /* value is 0 */ + UNIHDR2 hdr; /* XXXX conflict between hdr and str for length */ + UNISTR str; /* XXXX conflict between hdr and str for length */ + +} DOM_SID2; + +/* DOM_RID2 - domain RID structure */ +typedef struct domrid2_info +{ + uint32 type; /* value is 5 */ + uint32 undoc; /* value is 5 */ + uint32 rid; + uint32 rid_idx; /* don't know what this is */ + +} DOM_RID2; + +/* DOM_LOG_INFO - login info */ +typedef struct log_info +{ + uint32 undoc_buffer; /* undocumented 32 bit buffer pointer */ + UNISTR2 uni_logon_srv; /* logon server name */ + UNISTR2 uni_acct_name; /* account name */ + uint16 sec_chan; /* secure channel type */ + UNISTR2 uni_comp_name; /* client machine name */ + +} DOM_LOG_INFO; + +/* DOM_CREDs - client or server credentials */ +typedef struct cred_info +{ + uint8 data[8]; /* credentials */ + UTIME timestamp; /* credential time-stamp */ + +} DOM_CRED; + +/* DOM_CLNT_INFO - client info */ +typedef struct clnt_info +{ + DOM_LOG_INFO login; + DOM_CRED cred; + +} DOM_CLNT_INFO; + +/* DOM_LOGON_ID - logon id */ +typedef struct logon_info +{ + uint32 low; + uint32 high; + +} DOM_LOGON_ID; + +/* RC4_OWF */ +typedef struct rc4_owf_info +{ + uint8 data[16]; + +} RC4_OWF; + + +/* DOM_ID_INFO_1 */ +typedef struct id_info_1 +{ + UNIHDR hdr_domain_name; /* domain name unicode header */ + uint32 param; /* param control */ + DOM_LOGON_ID logon_id; /* logon ID */ + UNIHDR hdr_user_name; /* user name unicode header */ + UNIHDR hdr_workgroup_name; /* workgroup name unicode header */ + RC4_OWF rc4_lm_owf; /* rc4 LM OWF Password */ + RC4_OWF rc4_nt_owf; /* rc4 NT OWF Password */ + UNISTR2 uni_domain_name; /* domain name unicode string */ + UNISTR2 uni_user_name; /* user name unicode string */ + UNISTR2 uni_workgroup_name; /* workgroup name unicode string */ + +} DOM_ID_INFO_1; + +/* SAM_INFO - sam logon/off id structure */ +typedef struct sam_info +{ + DOM_CLNT_INFO client; + DOM_CRED rtn_cred; /* return credentials */ + uint16 logon_level; + uint32 auth_level; /* undocumented */ + + union + { + DOM_ID_INFO_1 id1; /* auth-level 1 */ + + } auth; + +} DOM_SAM_INFO; + +/* DOM_GID - group id + user attributes */ +typedef struct gid_info +{ + uint32 gid; /* group id */ + uint32 attr; + +} DOM_GID; + +/* RPC_HEADER - ms rpc header */ +typedef struct rpc_hdr_info +{ + uint8 major; /* 5 - RPC major version */ + uint8 minor; /* 0 - RPC minor version */ + uint8 pkt_type; /* 2 - RPC response packet */ + uint8 frag; /* 3 - first frag + last frag */ + uint32 pack_type; /* 0x0000 0010 - packed data representation */ + uint16 frag_len; /* fragment length - data size (bytes) inc header and tail. */ + uint16 auth_len; /* 0 - authentication length */ + uint32 call_id; /* call identifier. matches 12th uint32 of incoming RPC data. */ + uint32 alloc_hint; /* allocation hint - data size (bytes) minus header and tail. */ + uint16 context_id; /* 0 - presentation context identifier */ + uint8 cancel_count; /* 0 - cancel count */ + uint8 reserved; /* 0 - reserved */ +} RPC_HEADER; + + struct smb_passwd { int smb_userid; char *smb_name; -- cgit From a193401384a0e861c1857d256963c9178644c301 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sat, 4 Oct 1997 16:42:09 +0000 Subject: added some RW_XXXX wrapper macros with an extra i/o argument, to call XXXX or SXXXX as appropriate. added some for-loop pointer macros that will do a batch of data into a (fixed length) buffer. no length validation is done in the macro itself. note: there are some CAREFUL_ALIGNMENT macros missing. i think. (This used to be commit b0ffd75acfd3660512cccecdf50a183c3abccfcb) --- source3/include/byteorder.h | 49 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'source3/include') diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h index a55789a403..4991338f26 100644 --- a/source3/include/byteorder.h +++ b/source3/include/byteorder.h @@ -88,6 +88,28 @@ it also defines lots of intermediate macros, just ignore those :-) */ +/* some switch macros that do both store and read to and from SMB buffers */ + +#define RW_PCVAL(read,inbuf,outbuf,len) \ + if (read) { PCVAL (inbuf,0,outbuf,len) } \ + else { PSCVAL(inbuf,0,outbuf,len) } + +#define RW_PSVAL(read,inbuf,outbuf,len) \ + if (read) { PSVAL (inbuf,0,outbuf,len) } \ + else { PSSVAL(inbuf,0,outbuf,len) } + +#define RW_CVAL(read, inbuf, outbuf, offset) \ + if (read) (outbuf) = CVAL (inbuf,offset); \ + else SCVAL(inbuf,offset,outbuf); + +#define RW_IVAL(read, inbuf, outbuf, offset) \ + if (read) (outbuf)= IVAL (inbuf,offset); \ + else SIVAL(inbuf,offset,outbuf); + +#define RW_SVAL(read, inbuf, outbuf, offset) \ + if (read) (outbuf)= SVAL (inbuf,offset); \ + else SSVAL(inbuf,offset,outbuf); + #undef CAREFUL_ALIGNMENT /* we know that the 386 can handle misalignment and has the "right" @@ -123,14 +145,41 @@ it also defines lots of intermediate macros, just ignore those :-) WARNING: This section is dependent on the length of int16 and int32 being correct */ + +/* get single value from an SMB buffer */ #define SVAL(buf,pos) (*(uint16 *)((char *)(buf) + (pos))) #define IVAL(buf,pos) (*(uint32 *)((char *)(buf) + (pos))) #define SVALS(buf,pos) (*(int16 *)((char *)(buf) + (pos))) #define IVALS(buf,pos) (*(int32 *)((char *)(buf) + (pos))) + +/* store single value in an SMB buffer */ #define SSVAL(buf,pos,val) SVAL(buf,pos)=((uint16)(val)) #define SIVAL(buf,pos,val) IVAL(buf,pos)=((uint32)(val)) #define SSVALS(buf,pos,val) SVALS(buf,pos)=((int16)(val)) #define SIVALS(buf,pos,val) IVALS(buf,pos)=((int32)(val)) + +#define SMBMACRO(macro,buf,pos,val,len,size) \ +{ int l; for (l = 0; l < (len); l++) (val)[l] = macro((buf), (pos) + (size)*l); } + +#define SSMBMACRO(macro,buf,pos,val,len,size) \ +{ int l; for (l = 0; l < (len); l++) macro((buf), (pos) + (size)*l, (val)[l]); } + +/* reads multiple data from an SMB buffer */ +#define PCVAL(buf,pos,val,len) SMBMACRO(CVAL,buf,pos,val,len,1) +#define PSVAL(buf,pos,val,len) SMBMACRO(SVAL,buf,pos,val,len,2) +#define PIVAL(buf,pos,val,len) SMBMACRO(IVAL,buf,pos,val,len,4) +#define PCVALS(buf,pos,val,len) SMBMACRO(CVALS,buf,pos,val,len,1) +#define PSVALS(buf,pos,val,len) SMBMACRO(SVALS,buf,pos,val,len,2) +#define PIVALS(buf,pos,val,len) SMBMACRO(IVALS,buf,pos,val,len,4) + +/* stores multiple data in an SMB buffer */ +#define PSCVAL(buf,pos,val,len) SSMBMACRO(SCVAL,buf,pos,val,len,1) +#define PSSVAL(buf,pos,val,len) SSMBMACRO(SSVAL,buf,pos,val,len,2) +#define PSIVAL(buf,pos,val,len) SSMBMACRO(SIVAL,buf,pos,val,len,4) +#define PSCVALS(buf,pos,val,len) SSMBMACRO(SCVALS,buf,pos,val,len,1) +#define PSSVALS(buf,pos,val,len) SSMBMACRO(SSVALS,buf,pos,val,len,2) +#define PSIVALS(buf,pos,val,len) SSMBMACRO(SIVALS,buf,pos,val,len,4) + #endif -- cgit From 07cc8fd8e8edd58110800f3b6b7aaec94687b579 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sat, 4 Oct 1997 16:51:43 +0000 Subject: proto.h: - recreated, as usual. smb.h: - added RPC_HDR structure - the 18 byte MSRPC header smbparse.c: - added smb_io_rpc_hdr() function to read/write the RPC_HDR structure. util.c: - added align2, align4, align_offset functions. - added skip_unicode_string, unistrcpy, unistrncpy functions. - modified unistrcpy and unistrncpy to return the number of unicode characters returned, effectively making skip_unicode_string redundant. (This used to be commit b0ad811cda3dcffed5b24104229813cdb17b014f) --- source3/include/proto.h | 11 ++++++++++- source3/include/smb.h | 8 ++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 8818b9b527..4ec4a42f2a 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -565,7 +565,9 @@ void sync_browse_lists(struct subnet_record *d, struct work_record *work, /*The following definitions come from params.c */ -BOOL pm_process(char *pszFileName,BOOL (*sfunc)(char *),BOOL (*pfunc)(char *,char *)); +BOOL pm_process( char *FileName, + BOOL (*sfunc)(char *), + BOOL (*pfunc)(char *, char *) ); /*The following definitions come from password.c */ @@ -986,5 +988,12 @@ void file_unlock(int fd); BOOL is_myname(char *s); void set_remote_arch(enum remote_arch_types type); enum remote_arch_types get_remote_arch(); +char *skip_unicode_string(char *buf,int n); +char *unistr(char *buf); +int unistrncpy(char *dst, char *src, int len); +int unistrcpy(char *dst, char *src); void fstrcpy(char *dest, char *src); void pstrcpy(char *dest, char *src); +char *align4(char *q, char *base); +char *align2(char *q, char *base); +char *align_offset(char *q, char *base, int align_offset); diff --git a/source3/include/smb.h b/source3/include/smb.h index 37474436ca..b999c13667 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -80,6 +80,10 @@ typedef short int16; typedef int int32; #endif +#ifndef uint8 +typedef unsigned char uint8; +#endif + #ifndef uint16 typedef unsigned short uint16; #endif @@ -416,7 +420,7 @@ typedef struct gid_info } DOM_GID; -/* RPC_HEADER - ms rpc header */ +/* RPC_HDR - ms rpc header */ typedef struct rpc_hdr_info { uint8 major; /* 5 - RPC major version */ @@ -431,7 +435,7 @@ typedef struct rpc_hdr_info uint16 context_id; /* 0 - presentation context identifier */ uint8 cancel_count; /* 0 - cancel count */ uint8 reserved; /* 0 - reserved */ -} RPC_HEADER; +} RPC_HDR; struct smb_passwd { -- cgit From 29dfcb86e05144029f976ef187b875daa9811c59 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sun, 5 Oct 1997 11:56:08 +0000 Subject: smb.h: added more structures, this time for the use in the query and response of the LSA_XXXX functions. next target: the NTLOGON mailslots (10 minutes work). smbparse.c: tidying. adding some more sub-structure functions. (This used to be commit 095edfca783a6f99eb7897d4c925ce8bc1ea0a3e) --- source3/include/smb.h | 377 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 373 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index b999c13667..eb20a16cd3 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -257,10 +257,14 @@ typedef fstring string; /* 32 bit time (sec) since 01jan1970 - cifs6.txt, section 3.5, page 30 */ -typedef uint32 UTIME; +typedef struct time_info +{ + uint32 time; + +} UTIME; /* 64 bit time (100usec) since ????? - cifs6.txt, section 3.5, page 30 */ -typedef struct nttime +typedef struct nttime_info { uint32 low; uint32 high; @@ -348,10 +352,17 @@ typedef struct log_info } DOM_LOG_INFO; -/* DOM_CREDs - client or server credentials */ -typedef struct cred_info +/* DOM_CHAL - challenge info */ +typedef struct chal_info { uint8 data[8]; /* credentials */ + +} DOM_CHAL; + +/* DOM_CREDs - timestamped client or server credentials */ +typedef struct cred_info +{ + DOM_CHAL challenge; /* credentials */ UTIME timestamp; /* credential time-stamp */ } DOM_CRED; @@ -437,6 +448,364 @@ typedef struct rpc_hdr_info uint8 reserved; /* 0 - reserved */ } RPC_HDR; +/* DOM_QUERY_5 - info class 5 LSA Query response */ +typedef struct dom_query_5_info +{ + uint16 uni_dom_max_len; /* domain name string length * 2 */ + uint16 uni_dom_str_len; /* domain name string length * 2 */ + uint32 buffer_dom_name; /* undocumented domain name string buffer pointer */ + uint32 buffer_dom_sid; /* undocumented domain SID string buffer pointer */ + UNISTR uni_domain_name; /* domain name (unicode string) */ + DOM_SID dom_sid; /* domain SID */ + +} DOM_QUERY_5; + +/* level 5 is same as level 3. we hope. */ +typedef DOM_QUERY_5 DOM_QUERY_3; + +/* LSA_POL_HND */ +typedef struct lsa_policy_info +{ + uint8 data[20]; /* policy handle */ + +} LSA_POL_HND; + + +/* LSA_Q_QUERY_INFO - LSA query info policy */ +typedef struct lsa_query_info +{ + uint16 info_class; /* info class (also a policy handle?) */ + +} LSA_Q_QUERY_INFO; + +/* LSA_R_QUERY_INFO - response to LSA query info policy */ +typedef struct lsa_r_query_info +{ + uint32 undoc_buffer; /* undocumented buffer pointer */ + uint16 info_class; /* info class (same as info class in request) */ + + union + { + DOM_QUERY_3 id3; + DOM_QUERY_5 id5; + } dom; + +} LSA_R_QUERY_INFO; + +#define MAX_REF_DOMAINS 10 + +/* DOM_R_REF */ +typedef struct dom_ref_info +{ + uint32 undoc_buffer; /* undocumented buffer pointer. */ + uint32 num_ref_doms_1; /* num referenced domains? */ + uint32 buffer_dom_name; /* undocumented domain name buffer pointer. */ + uint32 max_entries; /* 32 - max number of entries */ + uint32 num_ref_doms_2; /* 4 - num referenced domains? */ + + UNIHDR2 hdr_dom_name; /* domain name unicode string header */ + UNIHDR2 hdr_ref_dom[MAX_REF_DOMAINS]; /* referenced domain unicode string headers */ + + UNISTR uni_dom_name; /* domain name unicode string */ + DOM_SID uni_dom_sid; /* domain SID */ + DOM_SID uni_ref_dom[MAX_REF_DOMAINS]; /* referenced domain SIDs */ + +} DOM_R_REF; + +#define MAX_LOOKUP_SIDS 10 + +/* LSA_Q_LOOKUP_SIDS - LSA Lookup SIDs */ +typedef struct lsa_q_lookup_sids +{ + + LSA_POL_HND pol_hnd; /* policy handle */ + uint32 num_entries; + uint32 buffer_dom_sid; /* undocumented domain SID buffer pointer */ + uint32 buffer_dom_name; /* undocumented domain name buffer pointer */ + uint32 buffer_lookup_sids[MAX_LOOKUP_SIDS]; /* undocumented domain SID pointers to be looked up. */ + DOM_SID dom_sids[MAX_LOOKUP_SIDS]; /* domain SIDs to be looked up. */ + uint8 undoc[16]; /* completely undocumented 16 bytes */ + +} LSA_Q_LOOKUP_SIDS; + +/* LSA_R_LOOKUP_SIDS - response to LSA Lookup SIDs */ +typedef struct lsa_r_lookup_sids +{ + DOM_R_REF dom_ref; /* domain reference info */ + + uint32 num_entries; + uint32 undoc_buffer2; /* undocumented buffer pointer */ + uint32 num_entries2; + + DOM_SID2 dom_sid[MAX_LOOKUP_SIDS]; /* domain SIDs being looked up */ + + uint32 num_entries3; + +} LSA_R_LOOKUP_SIDS; + +/* DOM_NAME - XXXX not sure about this structure */ +typedef struct dom_name_info +{ + uint32 uni_str_len; + uint16 buffer[MAX_UNISTRLEN]; + +} DOM_NAME; + + +#define UNKNOWN_LEN 1 + +/* LSA_Q_LOOKUP_RIDS - LSA Lookup RIDs */ +typedef struct lsa_q_lookup_rids +{ + + LSA_POL_HND pol_hnd; /* policy handle */ + uint32 num_entries; + uint32 num_entries2; + uint32 buffer_dom_sid; /* undocumented domain SID buffer pointer */ + uint32 buffer_dom_name; /* undocumented domain name buffer pointer */ + DOM_NAME lookup_name[MAX_LOOKUP_SIDS]; /* names to be looked up */ + uint8 undoc[UNKNOWN_LEN]; /* completely undocumented bytes of unknown length */ + +} LSA_Q_LOOKUP_RIDS; + +/* LSA_R_LOOKUP_RIDS - response to LSA Lookup Names */ +typedef struct lsa_r_lookup_rids +{ + + uint32 num_entries; + uint32 undoc_buffer2; /* undocumented buffer pointer */ + + uint32 num_entries2; + DOM_RID2 dom_rid[MAX_LOOKUP_SIDS]; /* domain RIDs being looked up */ + + uint32 num_entries3; + +} LSA_R_LOOKUP_RIDS; + + + +/* NEG_FLAGS */ +typedef struct lsa_neg_flags_info +{ + uint32 neg_flags; /* negotiated flags */ + +} NEG_FLAGS; + + +/* LSA_Q_REQ_CHAL */ +typedef struct lsa_q_req_chal_info +{ + uint32 undoc_buffer; /* undocumented buffer pointer */ + UNISTR2 uni_logon_srv; /* logon server unicode string */ + UNISTR2 uni_logon_clnt; /* logon client unicode string */ + DOM_CHAL clnt_chal; /* client challenge */ + +} LSA_Q_REQ_CHAL; + + +/* LSA_R_REQ_CHAL */ +typedef struct lsa_r_req_chal_info +{ + DOM_CHAL srv_chal; /* server challenge */ + +} LSA_R_REQ_CHAL; + + + +/* LSA_Q_AUTH_2 */ +typedef struct lsa_q_auth2_info +{ + DOM_LOG_INFO clnt_id; /* client identification info */ + DOM_CHAL clnt_chal; /* client-calculated credentials */ + + NEG_FLAGS clnt_flgs; /* usually 0x0000 01ff */ + +} LSA_Q_AUTH_2; + + +/* LSA_R_AUTH_2 */ +typedef struct lsa_r_auth2_info +{ + DOM_CHAL srv_chal; /* server-calculated credentials */ + NEG_FLAGS srv_flgs; /* usually 0x0000 01ff */ + +} LSA_R_AUTH_2; + + +/* LSA_Q_SRV_PWSET */ +typedef struct lsa_q_srv_pwset_info +{ + DOM_CLNT_INFO clnt_id; /* client identification/authentication info */ + char pwd[16]; /* new password - undocumented. */ + +} LSA_Q_SRV_PWSET; + +/* LSA_R_SRV_PWSET */ +typedef struct lsa_r_srv_pwset_info +{ + DOM_CHAL srv_chal; /* server-calculated credentials */ + +} LSA_R_SRV_PWSET; + +#define LSA_MAX_GROUPS 32 + +/* LSA_USER_INFO */ +typedef struct lsa_q_user_info +{ + uint32 undoc_buffer; + + NTTIME logon_time; /* logon time */ + NTTIME logoff_time; /* logoff time */ + NTTIME kickoff_time; /* kickoff time */ + NTTIME pass_last_set_time; /* password last set time */ + NTTIME pass_can_change_time; /* password can change time */ + NTTIME pass_must_change_time; /* password must change time */ + + UNIHDR hdr_user_name; /* username unicode string header */ + UNIHDR hdr_full_name; /* user's full name unicode string header */ + UNIHDR hdr_logon_script; /* logon script unicode string header */ + UNIHDR hdr_profile_path; /* profile path unicode string header */ + UNIHDR hdr_home_dir; /* home directory unicode string header */ + UNIHDR hdr_dir_drive; /* home directory drive unicode string header */ + + uint16 logon_count; /* logon count */ + uint16 bad_pw_count; /* bad password count */ + + uint32 user_id; /* User ID */ + uint32 group_id; /* Group ID */ + uint32 num_groups; /* num groups */ + uint32 buffer_groups; /* undocumented buffer pointer to groups. */ + uint32 user_flgs; /* user flags */ + + char sess_key[16]; /* unused user session key */ + + UNIHDR hdr_logon_srv; /* logon server unicode string header */ + UNIHDR hdr_logon_dom; /* logon domain unicode string header */ + + uint32 buffer_dom_id; /* undocumented logon domain id pointer */ + char padding[40]; /* unused padding bytes? */ + + uint32 num_sids; /* 0 - num_sids */ + uint32 buffer_sids; /* NULL - undocumented pointer to SIDs. */ + + UNISTR2 uni_user_name; /* username unicode string */ + UNISTR2 uni_full_name; /* user's full name unicode string */ + UNISTR2 uni_logon_script; /* logon script unicode string */ + UNISTR2 uni_profile_path; /* profile path unicode string */ + UNISTR2 uni_home_dir; /* home directory unicode string */ + UNISTR2 uni_dir_drive; /* home directory drive unicode string */ + + uint32 num_groups2; /* num groups */ + DOM_GID gids[LSA_MAX_GROUPS]; /* group info */ + + UNISTR2 uni_logon_srv; /* logon server unicode string */ + UNISTR2 uni_logon_dom; /* logon domain unicode string */ + + DOM_SID undoc_dom_sids[2]; /* undocumented - domain SIDs */ + DOM_SID dom_sid; /* domain SID */ + +} LSA_USER_INFO; + + +/* LSA_Q_SAM_LOGON */ +typedef struct lsa_q_sam_logon_info +{ + DOM_SAM_INFO sam_id; + +} LSA_Q_SAM_LOGON; + +/* LSA_R_SAM_LOGON */ +typedef struct lsa_r_sam_logon_info +{ + uint32 buffer_creds; /* undocumented buffer pointer */ + DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */ + + uint32 buffer_user; + LSA_USER_INFO user; + + uint32 auth_resp; /* 1 - Authoritative response; 0 - Non-Auth? */ + +} LSA_R_SAM_LOGON; + + +/* LSA_Q_SAM_LOGOFF */ +typedef struct lsa_q_sam_logoff_info +{ + DOM_SAM_INFO sam_id; + +} LSA_Q_SAM_LOGOFF; + +/* LSA_R_SAM_LOGOFF */ +typedef struct lsa_r_sam_logoff_info +{ + uint32 buffer_creds; /* undocumented buffer pointer */ + DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */ + +} LSA_R_SAM_LOGOFF; + +/* + +Yet to be turned into structures: + +6) \\MAILSLOT\NET\NTLOGON +------------------------- + +6.1) Query for PDC +------------------ + +Request: + + uint16 0x0007 - Query for PDC + STR machine name + STR response mailslot + uint8[] padding to 2-byte align with start of mailslot. + UNISTR machine name + uint32 NTversion + uint16 LMNTtoken + uint16 LM20token + +Response: + + uint16 0x000A - Respose to Query for PDC + STR machine name (in uppercase) + uint8[] padding to 2-byte align with start of mailslot. + UNISTR machine name + UNISTR domain name + uint32 NTversion (same as received in request) + uint16 LMNTtoken (same as received in request) + uint16 LM20token (same as received in request) + + +6.2) SAM Logon +-------------- + +Request: + + uint16 0x0012 - SAM Logon + uint16 request count + UNISTR machine name + UNISTR user name + STR response mailslot + uint32 alloweable account + uint32 domain SID size + char[sid_size] domain SID, of sid_size bytes. + uint8[] ???? padding to 4? 2? -byte align with start of mailslot. + uint32 NTversion + uint16 LMNTtoken + uint16 LM20token + +Response: + + uint16 0x0013 - Response to SAM Logon + UNISTR machine name + UNISTR user name - workstation trust account + UNISTR domain name + uint32 NTversion + uint16 LMNTtoken + uint16 LM20token + +*/ + struct smb_passwd { int smb_userid; -- cgit From 84e362dd132e250ddb5ca0223e2b27dc484b3ff7 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sun, 5 Oct 1997 14:17:53 +0000 Subject: updating lsa and smb parsing routines and structures. (This used to be commit 2f722fe289051558dbe77aeb0a830bb3ded10a83) --- source3/include/proto.h | 32 ++++++++++++++++++++++++++++++++ source3/include/smb.h | 23 +++++++++++++++++------ 2 files changed, 49 insertions(+), 6 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 4ec4a42f2a..705b08b633 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -310,6 +310,11 @@ void del_share_mode(share_lock_token token, int fnum); BOOL set_share_mode(share_lock_token token,int fnum, uint16 port, uint16 op_type); BOOL remove_share_oplock(int fnum, share_lock_token token); +/*The following definitions come from lsaparse.c */ + +char* lsa_io_q_query(BOOL io, LSA_Q_QUERY_INFO *q_q, char *q, char *base, int align); +char* lsa_io_r_query(BOOL io, LSA_R_QUERY_INFO *r_q, char *q, char *base, int align); + /*The following definitions come from mangle.c */ int str_checksum(char *s); @@ -772,6 +777,33 @@ void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); void E_md4hash(uchar *passwd, uchar *p16); void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); +/*The following definitions come from smbparse.c */ + +char* smb_io_utime(BOOL io, UTIME *t, char *q, char *base, int align); +char* smb_io_time(BOOL io, NTTIME *nttime, char *q, char *base, int align); +char* smb_io_dom_sid(BOOL io, DOM_SID *sid, char *q, char *base, int align); +char* smb_io_unihdr(BOOL io, UNIHDR *hdr, char *q, char *base, int align); +char* smb_io_unihdr2(BOOL io, UNIHDR2 *hdr2, char *q, char *base, int align); +char* smb_io_unistr(BOOL io, UNISTR *uni, char *q, char *base, int align); +char* smb_io_unistr2(BOOL io, UNISTR2 *uni2, char *q, char *base, int align); +char* smb_io_dom_sid2(BOOL io, DOM_SID2 *sid2, char *q, char *base, int align); +char* smb_io_dom_rid2(BOOL io, DOM_RID2 *rid2, char *q, char *base, int align); +char* smb_io_log_info(BOOL io, DOM_LOG_INFO *log, char *q, char *base, int align); +char* smb_io_chal(BOOL io, DOM_CHAL *chal, char *q, char *base, int align); +char* smb_io_cred(BOOL io, DOM_CRED *cred, char *q, char *base, int align); +char* smb_io_clnt_info(BOOL io, DOM_CLNT_INFO *clnt, char *q, char *base, int align); +char* smb_io_logon_id(BOOL io, DOM_LOGON_ID *log, char *q, char *base, int align); +char* smb_io_rc4_owf(BOOL io, RC4_OWF *hash, char *q, char *base, int align); +char* smb_io_id_info1(BOOL io, DOM_ID_INFO_1 *id, char *q, char *base, int align); +char* smb_io_sam_info(BOOL io, DOM_SAM_INFO *sam, char *q, char *base, int align); +char* smb_io_gid(BOOL io, DOM_GID *gid, char *q, char *base, int align); +char* smb_io_rpc_hdr(BOOL io, RPC_HDR *rpc, char *q, char *base, int align); +char* smb_io_pol_hnd(BOOL io, LSA_POL_HND *pol, char *q, char *base, int align); +char* smb_io_dom_query_3(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align); +char* smb_io_dom_query_5(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align); +char* smb_io_dom_query(BOOL io, DOM_QUERY *d_q, char *q, char *base, int align); +char* smb_io_dom_r_ref(BOOL io, DOM_R_REF *r_r, char *q, char *base, int align); + /*The following definitions come from smbpass.c */ int pw_file_lock(char *name, int type, int secs); diff --git a/source3/include/smb.h b/source3/include/smb.h index eb20a16cd3..a3a6d326e0 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -331,6 +331,16 @@ typedef struct domsid2_info } DOM_SID2; +/* DOM_SID3 - domain SID structure - SIDs stored in unicode */ +typedef struct domsid3_info +{ + UNISTR str; /* domain SID unicode string */ + uint32 undoc; /* value is 0 */ + uint32 type1; /* value is 1 */ + uint32 type2; /* value is 5 or 3 */ + +} DOM_SID3; + /* DOM_RID2 - domain RID structure */ typedef struct domrid2_info { @@ -446,10 +456,11 @@ typedef struct rpc_hdr_info uint16 context_id; /* 0 - presentation context identifier */ uint8 cancel_count; /* 0 - cancel count */ uint8 reserved; /* 0 - reserved */ + } RPC_HDR; -/* DOM_QUERY_5 - info class 5 LSA Query response */ -typedef struct dom_query_5_info +/* DOM_QUERY - info class 3 and 5 LSA Query response */ +typedef struct dom_query_info { uint16 uni_dom_max_len; /* domain name string length * 2 */ uint16 uni_dom_str_len; /* domain name string length * 2 */ @@ -458,10 +469,11 @@ typedef struct dom_query_5_info UNISTR uni_domain_name; /* domain name (unicode string) */ DOM_SID dom_sid; /* domain SID */ -} DOM_QUERY_5; +} DOM_QUERY; /* level 5 is same as level 3. we hope. */ -typedef DOM_QUERY_5 DOM_QUERY_3; +typedef DOM_QUERY DOM_QUERY_3; +typedef DOM_QUERY DOM_QUERY_5; /* LSA_POL_HND */ typedef struct lsa_policy_info @@ -507,8 +519,7 @@ typedef struct dom_ref_info UNIHDR2 hdr_ref_dom[MAX_REF_DOMAINS]; /* referenced domain unicode string headers */ UNISTR uni_dom_name; /* domain name unicode string */ - DOM_SID uni_dom_sid; /* domain SID */ - DOM_SID uni_ref_dom[MAX_REF_DOMAINS]; /* referenced domain SIDs */ + DOM_SID ref_dom[MAX_REF_DOMAINS]; /* referenced domain SIDs */ } DOM_R_REF; -- cgit From 0e151792c3289ce2253d1940d07f6caa12774118 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 6 Oct 1997 13:30:54 +0000 Subject: Makefile: added lsaparse.c and smbparse.c lsaparse.c, smbparse.c, smb.h: more functions / structures. proto.h: the usual. (This used to be commit a1c718728c46ebf8916af8985b4dae4d099f4ec2) --- source3/include/proto.h | 13 +++++++++++++ source3/include/smb.h | 9 +++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 705b08b633..a6250ca56c 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -314,6 +314,17 @@ BOOL remove_share_oplock(int fnum, share_lock_token token); char* lsa_io_q_query(BOOL io, LSA_Q_QUERY_INFO *q_q, char *q, char *base, int align); char* lsa_io_r_query(BOOL io, LSA_R_QUERY_INFO *r_q, char *q, char *base, int align); +char* lsa_io_q_lookup_sids(BOOL io, LSA_Q_LOOKUP_SIDS *q_s, char *q, char *base, int align); +char* lsa_io_r_lookup_sids(BOOL io, LSA_R_LOOKUP_SIDS *r_s, char *q, char *base, int align); +char* lsa_io_q_lookup_rids(BOOL io, LSA_Q_LOOKUP_RIDS *q_r, char *q, char *base, int align); +char* lsa_io_r_lookup_rids(BOOL io, LSA_R_LOOKUP_RIDS *r_r, char *q, char *base, int align); +char* lsa_io_q_req_chal(BOOL io, LSA_Q_REQ_CHAL *q_c, char *q, char *base, int align); +char* lsa_io_r_req_chal(BOOL io, LSA_R_REQ_CHAL *r_c, char *q, char *base, int align); +char* lsa_io_q_auth2(BOOL io, LSA_Q_AUTH_2 *q_a, char *q, char *base, int align); +char* lsa_io_r_auth_2(BOOL io, LSA_R_AUTH_2 *r_a, char *q, char *base, int align); +char* lsa_io_q_srv_pwset(BOOL io, LSA_Q_SRV_PWSET *q_s, char *q, char *base, int align); +char* lsa_io_r_srv_pwset(BOOL io, LSA_R_SRV_PWSET *r_s, char *q, char *base, int align); +char* lsa_io_user_info(BOOL io, LSA_USER_INFO *usr, char *q, char *base, int align); /*The following definitions come from mangle.c */ @@ -803,6 +814,8 @@ char* smb_io_dom_query_3(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int ali char* smb_io_dom_query_5(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align); char* smb_io_dom_query(BOOL io, DOM_QUERY *d_q, char *q, char *base, int align); char* smb_io_dom_r_ref(BOOL io, DOM_R_REF *r_r, char *q, char *base, int align); +char* smb_io_dom_name(BOOL io, DOM_NAME *name, char *q, char *base, int align); +char* smb_io_neg_flags(BOOL io, NEG_FLAGS *neg, char *q, char *base, int align); /*The following definitions come from smbpass.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index a3a6d326e0..280147b41f 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -545,7 +545,7 @@ typedef struct lsa_r_lookup_sids DOM_R_REF dom_ref; /* domain reference info */ uint32 num_entries; - uint32 undoc_buffer2; /* undocumented buffer pointer */ + uint32 undoc_buffer; /* undocumented buffer pointer */ uint32 num_entries2; DOM_SID2 dom_sid[MAX_LOOKUP_SIDS]; /* domain SIDs being looked up */ @@ -558,7 +558,11 @@ typedef struct lsa_r_lookup_sids typedef struct dom_name_info { uint32 uni_str_len; +#if 1 /* don't know if buffer is null-terminated */ + UNISTR buffer; +#else /* or length indicated by uni_str_len member */ uint16 buffer[MAX_UNISTRLEN]; +#endif } DOM_NAME; @@ -582,9 +586,10 @@ typedef struct lsa_q_lookup_rids /* LSA_R_LOOKUP_RIDS - response to LSA Lookup Names */ typedef struct lsa_r_lookup_rids { + DOM_R_REF dom_ref; /* domain reference info */ uint32 num_entries; - uint32 undoc_buffer2; /* undocumented buffer pointer */ + uint32 undoc_buffer; /* undocumented buffer pointer */ uint32 num_entries2; DOM_RID2 dom_rid[MAX_LOOKUP_SIDS]; /* domain RIDs being looked up */ -- cgit From 8429cec72ff15efdd5ab742ba71ede36db43ef14 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 6 Oct 1997 14:52:26 +0000 Subject: lsaparse.c smb.h: added 32 bit "return status" to the response structures. (This used to be commit 5bc75c6c626251dc8ba04ff4a83e81b92d93d2d6) --- source3/include/proto.h | 4 ++++ source3/include/smb.h | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index a6250ca56c..9faecd3a00 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -325,6 +325,10 @@ char* lsa_io_r_auth_2(BOOL io, LSA_R_AUTH_2 *r_a, char *q, char *base, int align char* lsa_io_q_srv_pwset(BOOL io, LSA_Q_SRV_PWSET *q_s, char *q, char *base, int align); char* lsa_io_r_srv_pwset(BOOL io, LSA_R_SRV_PWSET *r_s, char *q, char *base, int align); char* lsa_io_user_info(BOOL io, LSA_USER_INFO *usr, char *q, char *base, int align); +char* lsa_io_q_sam_logon(BOOL io, LSA_Q_SAM_LOGON *q_l, char *q, char *base, int align); +char* lsa_io_r_sam_logon(BOOL io, LSA_R_SAM_LOGON *r_l, char *q, char *base, int align); +char* lsa_io_q_sam_logoff(BOOL io, LSA_Q_SAM_LOGOFF *q_l, char *q, char *base, int align); +char* lsa_io_r_sam_logoff(BOOL io, LSA_R_SAM_LOGOFF *r_l, char *q, char *base, int align); /*The following definitions come from mangle.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index 280147b41f..1b8f04f02e 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -502,6 +502,8 @@ typedef struct lsa_r_query_info DOM_QUERY_5 id5; } dom; + uint32 status; /* return code */ + } LSA_R_QUERY_INFO; #define MAX_REF_DOMAINS 10 @@ -552,6 +554,8 @@ typedef struct lsa_r_lookup_sids uint32 num_entries3; + uint32 status; /* return code */ + } LSA_R_LOOKUP_SIDS; /* DOM_NAME - XXXX not sure about this structure */ @@ -596,6 +600,8 @@ typedef struct lsa_r_lookup_rids uint32 num_entries3; + uint32 status; /* return code */ + } LSA_R_LOOKUP_RIDS; @@ -624,6 +630,8 @@ typedef struct lsa_r_req_chal_info { DOM_CHAL srv_chal; /* server challenge */ + uint32 status; /* return code */ + } LSA_R_REQ_CHAL; @@ -645,6 +653,8 @@ typedef struct lsa_r_auth2_info DOM_CHAL srv_chal; /* server-calculated credentials */ NEG_FLAGS srv_flgs; /* usually 0x0000 01ff */ + uint32 status; /* return code */ + } LSA_R_AUTH_2; @@ -661,6 +671,8 @@ typedef struct lsa_r_srv_pwset_info { DOM_CHAL srv_chal; /* server-calculated credentials */ + uint32 status; /* return code */ + } LSA_R_SRV_PWSET; #define LSA_MAX_GROUPS 32 @@ -741,6 +753,8 @@ typedef struct lsa_r_sam_logon_info uint32 auth_resp; /* 1 - Authoritative response; 0 - Non-Auth? */ + uint32 status; /* return code */ + } LSA_R_SAM_LOGON; @@ -757,6 +771,8 @@ typedef struct lsa_r_sam_logoff_info uint32 buffer_creds; /* undocumented buffer pointer */ DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */ + uint32 status; /* return code */ + } LSA_R_SAM_LOGOFF; /* -- cgit From 2e92be3aaf01c574d32d1a10e1359888638b68bc Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 6 Oct 1997 17:52:25 +0000 Subject: client.c: Changed shadowed variable. locking.c: Removed USE_OPLOCKS - now the default. params.c: Removed unused variable. proto.h: Updated. reply.c: Removed USE_OPLOCKS - now the default. server.c: Removed USE_OPLOCKS - now the default. smb.h: Removed USE_OPLOCKS - now the default. smbparse.c: Changed shadowed variable. status.c: Removed USE_OPLOCKS - now the default. util.c: Removed USE_OPLOCKS - now the default. Jeremy (jallison@whistle.com) (This used to be commit b93509846d6291771787af457500eec8984ee6bd) --- source3/include/proto.h | 4 ++-- source3/include/smb.h | 24 +++++------------------- 2 files changed, 7 insertions(+), 21 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 9faecd3a00..202b151150 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -808,7 +808,7 @@ char* smb_io_chal(BOOL io, DOM_CHAL *chal, char *q, char *base, int align); char* smb_io_cred(BOOL io, DOM_CRED *cred, char *q, char *base, int align); char* smb_io_clnt_info(BOOL io, DOM_CLNT_INFO *clnt, char *q, char *base, int align); char* smb_io_logon_id(BOOL io, DOM_LOGON_ID *log, char *q, char *base, int align); -char* smb_io_rc4_owf(BOOL io, RC4_OWF *hash, char *q, char *base, int align); +char* smb_io_arc4_owf(BOOL io, ARC4_OWF *hash, char *q, char *base, int align); char* smb_io_id_info1(BOOL io, DOM_ID_INFO_1 *id, char *q, char *base, int align); char* smb_io_sam_info(BOOL io, DOM_SAM_INFO *sam, char *q, char *base, int align); char* smb_io_gid(BOOL io, DOM_GID *gid, char *q, char *base, int align); @@ -1045,4 +1045,4 @@ void fstrcpy(char *dest, char *src); void pstrcpy(char *dest, char *src); char *align4(char *q, char *base); char *align2(char *q, char *base); -char *align_offset(char *q, char *base, int align_offset); +char *align_offset(char *q, char *base, int align_offset_len); diff --git a/source3/include/smb.h b/source3/include/smb.h index 1b8f04f02e..43e402359f 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -393,12 +393,12 @@ typedef struct logon_info } DOM_LOGON_ID; -/* RC4_OWF */ -typedef struct rc4_owf_info +/* ARC4_OWF */ +typedef struct arc4_owf_info { uint8 data[16]; -} RC4_OWF; +} ARC4_OWF; /* DOM_ID_INFO_1 */ @@ -409,8 +409,8 @@ typedef struct id_info_1 DOM_LOGON_ID logon_id; /* logon ID */ UNIHDR hdr_user_name; /* user name unicode header */ UNIHDR hdr_workgroup_name; /* workgroup name unicode header */ - RC4_OWF rc4_lm_owf; /* rc4 LM OWF Password */ - RC4_OWF rc4_nt_owf; /* rc4 NT OWF Password */ + ARC4_OWF arc4_lm_owf; /* arc4 LM OWF Password */ + ARC4_OWF arc4_nt_owf; /* arc4 NT OWF Password */ UNISTR2 uni_domain_name; /* domain name unicode string */ UNISTR2 uni_user_name; /* user name unicode string */ UNISTR2 uni_workgroup_name; /* workgroup name unicode string */ @@ -1040,10 +1040,8 @@ typedef struct { smb_shm_offset_t next_share_mode_entry; int pid; -#ifdef USE_OPLOCKS uint16 op_port; uint16 op_type; -#endif /* USE_OPLOCKS */ int share_mode; struct timeval time; } share_mode_entry; @@ -1052,10 +1050,8 @@ typedef struct typedef struct { int pid; -#ifdef USE_OPLOCKS uint16 op_port; uint16 op_type; -#endif /* USE_OPLOCKS */ int share_mode; struct timeval time; } min_share_mode_entry; @@ -1081,11 +1077,7 @@ struct connect_record }; #ifndef LOCKING_VERSION -#ifdef USE_OPLOCKS #define LOCKING_VERSION 4 -#else /* USE_OPLOCKS */ -#define LOCKING_VERSION 3 -#endif /* USE_OPLOCKS */ #endif /* LOCKING_VERSION */ #if !defined(FAST_SHARE_MODES) @@ -1101,11 +1093,7 @@ struct connect_record #define SMF_FILENAME_LEN_OFFSET 8 #define SMF_HEADER_LENGTH 10 -#ifdef USE_OPLOCKS #define SMF_ENTRY_LENGTH 20 -#else /* USE_OPLOCKS */ -#define SMF_ENTRY_LENGTH 16 -#endif /* USE_OPLOCKS */ /* * Share mode record offsets. @@ -1116,10 +1104,8 @@ struct connect_record #define SME_SHAREMODE_OFFSET 8 #define SME_PID_OFFSET 12 -#ifdef USE_OPLOCKS #define SME_PORT_OFFSET 16 #define SME_OPLOCK_TYPE_OFFSET 18 -#endif /* USE_OPLOCKS */ #endif /* FAST_SHARE_MODES */ -- cgit From 89042c146eaefac41d6df99eeb2d2847ed3a3067 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 7 Oct 1997 11:14:27 +0000 Subject: get rid of SIGCLD_IGNORE for HPUX. A user reported it causing lots of defunct smbd processes. Andrew (This used to be commit bf1f8b1567cb46e3e73ae8dbb26f6228cf519c1f) --- source3/include/includes.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 2329553d23..d1afc34de9 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -563,7 +563,9 @@ char *mktemp(char *); /* No standard include */ #define USE_SETSID #define USE_SETRES #define DEFAULT_PRINTING PRINT_HPUX -#define SIGCLD_IGNORE +/* Ken Weiss tells us that SIGCLD_IGNORE is + not good for HPUX */ +/* #define SIGCLD_IGNORE */ #endif /* HPUX */ -- cgit From a3b7bdd7b997fd6d41b8b96676eb58471112d931 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 7 Oct 1997 14:58:07 +0000 Subject: pipes.c: some routines to create LSA RPC packets. none of them are used. lsaparse.c: smbparse.c: smb.h: more tidy-up. (This used to be commit b37e21273e81b875876e8e8ddf6804714044ffd8) --- source3/include/proto.h | 1 + source3/include/smb.h | 47 +++++++++++++++++++++++++++++++---------------- 2 files changed, 32 insertions(+), 16 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 202b151150..8f8ec5aa8a 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -312,6 +312,7 @@ BOOL remove_share_oplock(int fnum, share_lock_token token); /*The following definitions come from lsaparse.c */ +char* lsa_io_r_open_pol(BOOL io, LSA_R_OPEN_POL *r_p, char *q, char *base, int align); char* lsa_io_q_query(BOOL io, LSA_Q_QUERY_INFO *q_q, char *q, char *base, int align); char* lsa_io_r_query(BOOL io, LSA_R_QUERY_INFO *r_q, char *q, char *base, int align); char* lsa_io_q_lookup_sids(BOOL io, LSA_Q_LOOKUP_SIDS *q_s, char *q, char *base, int align); diff --git a/source3/include/smb.h b/source3/include/smb.h index 43e402359f..4850b33e49 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -331,16 +331,6 @@ typedef struct domsid2_info } DOM_SID2; -/* DOM_SID3 - domain SID structure - SIDs stored in unicode */ -typedef struct domsid3_info -{ - UNISTR str; /* domain SID unicode string */ - uint32 undoc; /* value is 0 */ - uint32 type1; /* value is 1 */ - uint32 type2; /* value is 5 or 3 */ - -} DOM_SID3; - /* DOM_RID2 - domain RID structure */ typedef struct domrid2_info { @@ -409,8 +399,8 @@ typedef struct id_info_1 DOM_LOGON_ID logon_id; /* logon ID */ UNIHDR hdr_user_name; /* user name unicode header */ UNIHDR hdr_workgroup_name; /* workgroup name unicode header */ - ARC4_OWF arc4_lm_owf; /* arc4 LM OWF Password */ - ARC4_OWF arc4_nt_owf; /* arc4 NT OWF Password */ + ARC4_OWF arc4_lm_owf; /* rc4 LM OWF Password */ + ARC4_OWF arc4_nt_owf; /* rc4 NT OWF Password */ UNISTR2 uni_domain_name; /* domain name unicode string */ UNISTR2 uni_user_name; /* user name unicode string */ UNISTR2 uni_workgroup_name; /* workgroup name unicode string */ @@ -463,10 +453,11 @@ typedef struct rpc_hdr_info typedef struct dom_query_info { uint16 uni_dom_max_len; /* domain name string length * 2 */ + uint16 padding; /* 2 padding bytes? */ uint16 uni_dom_str_len; /* domain name string length * 2 */ uint32 buffer_dom_name; /* undocumented domain name string buffer pointer */ uint32 buffer_dom_sid; /* undocumented domain SID string buffer pointer */ - UNISTR uni_domain_name; /* domain name (unicode string) */ + UNISTR2 uni_domain_name; /* domain name (unicode string) */ DOM_SID dom_sid; /* domain SID */ } DOM_QUERY; @@ -475,14 +466,25 @@ typedef struct dom_query_info typedef DOM_QUERY DOM_QUERY_3; typedef DOM_QUERY DOM_QUERY_5; +#define POL_HND_SIZE 20 + /* LSA_POL_HND */ typedef struct lsa_policy_info { - uint8 data[20]; /* policy handle */ + uint8 data[POL_HND_SIZE]; /* policy handle */ } LSA_POL_HND; +/* LSA_R_OPEN_POL - response to LSA Open Policy */ +typedef struct lsa_r_open_pol_info +{ + LSA_POL_HND pol; /* policy handle */ + + uint32 status; /* return code */ + +} LSA_R_OPEN_POL; + /* LSA_Q_QUERY_INFO - LSA query info policy */ typedef struct lsa_query_info { @@ -530,7 +532,6 @@ typedef struct dom_ref_info /* LSA_Q_LOOKUP_SIDS - LSA Lookup SIDs */ typedef struct lsa_q_lookup_sids { - LSA_POL_HND pol_hnd; /* policy handle */ uint32 num_entries; uint32 buffer_dom_sid; /* undocumented domain SID buffer pointer */ @@ -669,7 +670,7 @@ typedef struct lsa_q_srv_pwset_info /* LSA_R_SRV_PWSET */ typedef struct lsa_r_srv_pwset_info { - DOM_CHAL srv_chal; /* server-calculated credentials */ + DOM_CRED srv_cred; /* server-calculated credentials */ uint32 status; /* return code */ @@ -1040,8 +1041,10 @@ typedef struct { smb_shm_offset_t next_share_mode_entry; int pid; +#ifdef USE_OPLOCKS uint16 op_port; uint16 op_type; +#endif /* USE_OPLOCKS */ int share_mode; struct timeval time; } share_mode_entry; @@ -1050,8 +1053,10 @@ typedef struct typedef struct { int pid; +#ifdef USE_OPLOCKS uint16 op_port; uint16 op_type; +#endif /* USE_OPLOCKS */ int share_mode; struct timeval time; } min_share_mode_entry; @@ -1077,7 +1082,11 @@ struct connect_record }; #ifndef LOCKING_VERSION +#ifdef USE_OPLOCKS #define LOCKING_VERSION 4 +#else /* USE_OPLOCKS */ +#define LOCKING_VERSION 3 +#endif /* USE_OPLOCKS */ #endif /* LOCKING_VERSION */ #if !defined(FAST_SHARE_MODES) @@ -1093,7 +1102,11 @@ struct connect_record #define SMF_FILENAME_LEN_OFFSET 8 #define SMF_HEADER_LENGTH 10 +#ifdef USE_OPLOCKS #define SMF_ENTRY_LENGTH 20 +#else /* USE_OPLOCKS */ +#define SMF_ENTRY_LENGTH 16 +#endif /* USE_OPLOCKS */ /* * Share mode record offsets. @@ -1104,8 +1117,10 @@ struct connect_record #define SME_SHAREMODE_OFFSET 8 #define SME_PID_OFFSET 12 +#ifdef USE_OPLOCKS #define SME_PORT_OFFSET 16 #define SME_OPLOCK_TYPE_OFFSET 18 +#endif /* USE_OPLOCKS */ #endif /* FAST_SHARE_MODES */ -- cgit From 577ae65ca562ec05849a2e9e79689d00e0a0bcf2 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 7 Oct 1997 18:18:10 +0000 Subject: pipes.c: more static unused functions in pipes.c for the LSA RPC stream. smb.h: corrections and altercations over the documentation lsaparse.c: reflecting alterations in LSA structures... (This used to be commit bef12478d212a950578843d6d4dece1f153bfd25) --- source3/include/smb.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 4850b33e49..3adb3e5a4c 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -677,6 +677,7 @@ typedef struct lsa_r_srv_pwset_info } LSA_R_SRV_PWSET; #define LSA_MAX_GROUPS 32 +#define LSA_MAX_SIDS 32 /* LSA_USER_INFO */ typedef struct lsa_q_user_info @@ -714,8 +715,8 @@ typedef struct lsa_q_user_info uint32 buffer_dom_id; /* undocumented logon domain id pointer */ char padding[40]; /* unused padding bytes? */ - uint32 num_sids; /* 0 - num_sids */ - uint32 buffer_sids; /* NULL - undocumented pointer to SIDs. */ + uint32 num_other_sids; /* 0 - num_sids */ + uint32 buffer_other_sids; /* NULL - undocumented pointer to SIDs. */ UNISTR2 uni_user_name; /* username unicode string */ UNISTR2 uni_full_name; /* user's full name unicode string */ @@ -730,8 +731,8 @@ typedef struct lsa_q_user_info UNISTR2 uni_logon_srv; /* logon server unicode string */ UNISTR2 uni_logon_dom; /* logon domain unicode string */ - DOM_SID undoc_dom_sids[2]; /* undocumented - domain SIDs */ DOM_SID dom_sid; /* domain SID */ + DOM_SID other_sids[LSA_MAX_SIDS]; /* undocumented - domain SIDs */ } LSA_USER_INFO; @@ -750,7 +751,7 @@ typedef struct lsa_r_sam_logon_info DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */ uint32 buffer_user; - LSA_USER_INFO user; + LSA_USER_INFO *user; uint32 auth_resp; /* 1 - Authoritative response; 0 - Non-Auth? */ -- cgit From fb27bc139f8d321e50471c595b65b277ee114801 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 7 Oct 1997 18:46:19 +0000 Subject: locking.c: Added fix for race condition in slow share mode code. lsaparse.c: #ifdef'ed out code so this will compile - LUKE PLEASE CHECK THIS. pipes.c: #ifdef'ed out code so this will compile - LUKE PLEASE CHECK THIS. server.c: Fixed last known oplock race condition. smb.h: Re-removed USE_OPLOCK defines - someone checked in an old version. smbparse.c: #ifdef'ed out code so this will compile - LUKE PLEASE CHECK THIS. Jeremy (jallison@whistle.com) (This used to be commit 1e1366ddc5542283a37debdf830ca139bbade1b0) --- source3/include/smb.h | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 3adb3e5a4c..c347202743 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1042,10 +1042,8 @@ typedef struct { smb_shm_offset_t next_share_mode_entry; int pid; -#ifdef USE_OPLOCKS uint16 op_port; uint16 op_type; -#endif /* USE_OPLOCKS */ int share_mode; struct timeval time; } share_mode_entry; @@ -1054,10 +1052,8 @@ typedef struct typedef struct { int pid; -#ifdef USE_OPLOCKS uint16 op_port; uint16 op_type; -#endif /* USE_OPLOCKS */ int share_mode; struct timeval time; } min_share_mode_entry; @@ -1083,11 +1079,7 @@ struct connect_record }; #ifndef LOCKING_VERSION -#ifdef USE_OPLOCKS #define LOCKING_VERSION 4 -#else /* USE_OPLOCKS */ -#define LOCKING_VERSION 3 -#endif /* USE_OPLOCKS */ #endif /* LOCKING_VERSION */ #if !defined(FAST_SHARE_MODES) @@ -1103,11 +1095,7 @@ struct connect_record #define SMF_FILENAME_LEN_OFFSET 8 #define SMF_HEADER_LENGTH 10 -#ifdef USE_OPLOCKS #define SMF_ENTRY_LENGTH 20 -#else /* USE_OPLOCKS */ -#define SMF_ENTRY_LENGTH 16 -#endif /* USE_OPLOCKS */ /* * Share mode record offsets. @@ -1117,11 +1105,8 @@ struct connect_record #define SME_USEC_OFFSET 4 #define SME_SHAREMODE_OFFSET 8 #define SME_PID_OFFSET 12 - -#ifdef USE_OPLOCKS #define SME_PORT_OFFSET 16 #define SME_OPLOCK_TYPE_OFFSET 18 -#endif /* USE_OPLOCKS */ #endif /* FAST_SHARE_MODES */ -- cgit From 8871297885050911aaa802c4e90e282c44e49b84 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 8 Oct 1997 17:12:07 +0000 Subject: loadparm.c proto.h: added lp_domainsid() lsaparse.c smb.h: debugging structures and parsing functions pipes.c: finally got to the functions that will go into the RPC switch statement. (This used to be commit d15aed8a9c58a7cc90befaee2d5a2752708f9327) --- source3/include/proto.h | 5 +++-- source3/include/smb.h | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 8f8ec5aa8a..fab69de3d1 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -152,6 +152,7 @@ char *lp_socket_address(void); char *lp_nis_home_map_name(void); char *lp_announce_version(void); char *lp_netbios_aliases(void); +char *lp_domainsid(void); BOOL lp_dns_proxy(void); BOOL lp_wins_support(void); BOOL lp_wins_proxy(void); @@ -928,7 +929,7 @@ BOOL in_group(gid_t group, int current_gid, int ngroups, int *groups); char *StrCpy(char *dest,char *src); char *StrnCpy(char *dest,char *src,int n); void putip(void *dest,void *src); -int name_mangle(char *In,char *Out,char name_type); +int name_mangle( char *In, char *Out, char name_type ); BOOL file_exist(char *fname,struct stat *sbuf); time_t file_modtime(char *fname); BOOL directory_exist(char *dname,struct stat *st); @@ -989,7 +990,7 @@ BOOL receive_message_or_smb(int smbfd, int oplock_fd, BOOL send_smb(int fd,char *buffer); char *name_ptr(char *buf,int ofs); int name_extract(char *buf,int ofs,char *name); -int name_len(char *s); +int name_len( char *s ); BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type); void msleep(int t); BOOL in_list(char *s,char *list,BOOL casesensitive); diff --git a/source3/include/smb.h b/source3/include/smb.h index c347202743..9f5279fca0 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -326,6 +326,7 @@ typedef struct domsid2_info { uint32 type; /* value is 5 */ uint32 undoc; /* value is 0 */ + UNIHDR2 hdr; /* XXXX conflict between hdr and str for length */ UNISTR str; /* XXXX conflict between hdr and str for length */ @@ -488,7 +489,8 @@ typedef struct lsa_r_open_pol_info /* LSA_Q_QUERY_INFO - LSA query info policy */ typedef struct lsa_query_info { - uint16 info_class; /* info class (also a policy handle?) */ + LSA_POL_HND pol; /* policy handle */ + uint16 info_class; /* info class */ } LSA_Q_QUERY_INFO; -- cgit From 74113cd60ecceaf73fce83e84dbcd58b498f2cb1 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 8 Oct 1997 20:34:13 +0000 Subject: Makefile: Split definitions for SGI4,5,6. includes.h: Split definitions for SGI4,5,6. pipes.c: Moved Luke's #ifdef to remove warnings. quotas.c: Two changes for FreeBSD and SGI. server.c: Quota changes for large filesystems. Jeremy (jallison@whistle.com) (This used to be commit b8ff5543b9fa45095caa9f24aeb22a1dcc1cd308) --- source3/include/includes.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index d1afc34de9..4ca1d4c3b0 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -340,7 +340,7 @@ char *getwd(char *); #define USE_WAITPID #endif -#ifdef SGI +#ifdef SGI4 #include #include #include @@ -355,7 +355,7 @@ char *getwd(char *); #define USE_SETSID #endif -#ifdef SGI5 +#if defined(SGI5) || defined(SGI6) #include #include #include -- cgit From e5494e2c093fecd4b493ab925f7c7d30b79bc98d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 9 Oct 1997 06:36:04 +0000 Subject: bracket some macros change MAX_PASSWORD_LENGTH to MAX_PASS_LEN to prevent conflict on some systems add #ifdef around soft link dependent code (for systems that don't have soft links) (This used to be commit e10ba4b97a219e87b62d32834bf15ed2e323ed2e) --- source3/include/includes.h | 8 ++++---- source3/include/local.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 4ca1d4c3b0..a877f1ffb3 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -1114,15 +1114,15 @@ extern char *sys_errlist[]; #endif #ifndef S_ISREG -#define S_ISREG(x) ((S_IFREG & x)!=0) +#define S_ISREG(x) ((S_IFREG & (x))!=0) #endif #ifndef S_ISDIR -#define S_ISDIR(x) ((S_IFDIR & x)!=0) +#define S_ISDIR(x) ((S_IFDIR & (x))!=0) #endif #if !defined(S_ISLNK) && defined(S_IFLNK) -#define S_ISLNK(x) ((S_IFLNK & x)!=0) +#define S_ISLNK(x) ((S_IFLNK & (x))!=0) #endif #ifdef UFC_CRYPT @@ -1202,7 +1202,7 @@ it works and getting lots of bug reports */ /* this is a rough check to see if this machine has a lstat() call. it is not guaranteed to work */ -#if !(defined(S_ISLNK) || defined(S_IFLNK)) +#if !defined(S_ISLNK) #define lstat stat #endif diff --git a/source3/include/local.h b/source3/include/local.h index 3ce75eeb4e..22d1b2a08e 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -43,7 +43,7 @@ #define WORDMAX 0xFFFF /* the maximum password length before we declare a likely attack */ -#define MAX_PASSWORD_LENGTH 200 +#define MAX_PASS_LEN 200 /* separators for lists */ #define LIST_SEP " \t,;:\n\r" -- cgit From ad54a5671405374b6308929154c6922bc6a7d0d7 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 9 Oct 1997 14:40:46 +0000 Subject: credentials.c: use UTIME structure (defined and commented in smb.h to be time, secs, since 01jan1970) pipes.c: another sub-function. util.c: added char *unistr2(uint16 *buff) function. same as unistr except it takes uint16* instead of char*. smbparse.c smb.h: more structure sorting. proto.h: the usual. (This used to be commit 72a86f514f0c92b69499718e63f5dd73ebece56e) --- source3/include/proto.h | 3 +++ source3/include/smb.h | 6 +----- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index fab69de3d1..b0589ede19 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -628,6 +628,7 @@ BOOL api_LsarpcTNP(int cnum,int uid, char *param,char *data, int mdrcnt,int mprcnt, char **rdata,char **rparam, int *rdata_len,int *rparam_len); +char *dom_sid_to_string(DOM_SID *sid); /*The following definitions come from predict.c */ @@ -653,6 +654,7 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); +BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); /*The following definitions come from replace.c */ @@ -1040,6 +1042,7 @@ BOOL is_myname(char *s); void set_remote_arch(enum remote_arch_types type); enum remote_arch_types get_remote_arch(); char *skip_unicode_string(char *buf,int n); +char *unistr2(uint16 *buf); char *unistr(char *buf); int unistrncpy(char *dst, char *src, int len); int unistrcpy(char *dst, char *src); diff --git a/source3/include/smb.h b/source3/include/smb.h index 9f5279fca0..7d7677b3fc 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -565,11 +565,7 @@ typedef struct lsa_r_lookup_sids typedef struct dom_name_info { uint32 uni_str_len; -#if 1 /* don't know if buffer is null-terminated */ - UNISTR buffer; -#else /* or length indicated by uni_str_len member */ - uint16 buffer[MAX_UNISTRLEN]; -#endif + UNISTR str; } DOM_NAME; -- cgit From 5a3ea52d4a567a341c8f2243783afdb392991ea2 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 9 Oct 1997 15:48:40 +0000 Subject: pipes.c: added api_ntlsarpcTNP() function. hooray! smb.h: added LSA #defines needed by above function. (This used to be commit 5437f666987918516032cf8a5dada107e5d14d25) --- source3/include/smb.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 7d7677b3fc..d0baa66992 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -4,6 +4,8 @@ SMB parameters and setup Copyright (C) Andrew Tridgell 1992-1997 Copyright (C) John H Terpstra 1996-1997 + Copyright (C) Luke Kenneth Casson Leighton 1996-1997 + Copyright (C) Paul Ashton 1997 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -256,6 +258,42 @@ typedef char fstring[128]; typedef fstring string; +/* NETLOGON opcodes and data structures */ + +#define NET_QUERYFORPDC 7 /* Query for PDC */ +#define NET_QUERYFORPDC_R 12 /* Response to Query for PDC */ +#define NET_SAMLOGON 18 +#define NET_SAMLOGON_R 19 + +/* Allowable account control bits */ +#define ACB_DISABLED 1 /* 1 = User account disabled */ +#define ACB_HOMDIRREQ 2 /* 1 = Home directory required */ +#define ACB_PWNOTREQ 4 /* 1 = User password not required */ +#define ACB_TEMPDUP /* 1 = Temporary duplicate account */ +#define ACB_NORMAL /* 1 = Normal user account */ +#define ACB_MNS /* 1 = MNS logon user account */ +#define ACB_DOMTRUST /* 1 = Interdomain trust account */ +#define ACB_WSTRUST /* 1 = Workstation trust account */ +#define ACB_SVRTRUST /* 1 = Server trust account */ +#define ACB_PWNOEXP /* 1 = User password does not expire */ +#define ACB_AUTOLOCK /* 1 = Account auto locked */ + +#define LSA_OPENPOLICY 0x2c +#define LSA_QUERYINFOPOLICY 0x07 +#define LSA_ENUMTRUSTDOM 0x0d +#define LSA_REQCHAL 0x04 +#define LSA_SVRPWSET 0x06 +#define LSA_SAMLOGON 0x02 +#define LSA_AUTH2 0x0f +#define LSA_CLOSE 0x00 + +/* unknown .... */ +#define LSA_OPENSECRET 0xFF +#define LSA_LOOKUPSIDS 0xFE +#define LSA_LOOKUPNAMES 0xFD +#define LSA_SAMLOGOFF 0xFC + + /* 32 bit time (sec) since 01jan1970 - cifs6.txt, section 3.5, page 30 */ typedef struct time_info { -- cgit From 7d82c240e27e921a859441669a15a095a2e5bff5 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 9 Oct 1997 15:51:43 +0000 Subject: moved the array macros outside of the CAREFUL_ALIGNMENT define. (This used to be commit d9fcf11aa04ff04dcbccd628322240f8324ae51d) --- source3/include/byteorder.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h index 4991338f26..0664a33817 100644 --- a/source3/include/byteorder.h +++ b/source3/include/byteorder.h @@ -128,6 +128,7 @@ it also defines lots of intermediate macros, just ignore those :-) #if CAREFUL_ALIGNMENT + #define SVAL(buf,pos) (PVAL(buf,pos)|PVAL(buf,(pos)+1)<<8) #define IVAL(buf,pos) (SVAL(buf,pos)|SVAL(buf,(pos)+2)<<16) #define SSVALX(buf,pos,val) (CVAL(buf,pos)=(val)&0xFF,CVAL(buf,pos+1)=(val)>>8) @@ -138,7 +139,9 @@ it also defines lots of intermediate macros, just ignore those :-) #define SIVAL(buf,pos,val) SIVALX((buf),(pos),((uint32)(val))) #define SSVALS(buf,pos,val) SSVALX((buf),(pos),((int16)(val))) #define SIVALS(buf,pos,val) SIVALX((buf),(pos),((int32)(val))) + #else + /* this handles things for architectures like the 386 that can handle alignment errors */ /* @@ -158,6 +161,11 @@ it also defines lots of intermediate macros, just ignore those :-) #define SSVALS(buf,pos,val) SVALS(buf,pos)=((int16)(val)) #define SIVALS(buf,pos,val) IVALS(buf,pos)=((int32)(val)) +#endif + + +/* macros for reading / writing arrays */ + #define SMBMACRO(macro,buf,pos,val,len,size) \ { int l; for (l = 0; l < (len); l++) (val)[l] = macro((buf), (pos) + (size)*l); } @@ -180,8 +188,6 @@ it also defines lots of intermediate macros, just ignore those :-) #define PSSVALS(buf,pos,val,len) SSMBMACRO(SSVALS,buf,pos,val,len,2) #define PSIVALS(buf,pos,val,len) SSMBMACRO(SIVALS,buf,pos,val,len,4) -#endif - /* now the reverse routines - these are used in nmb packets (mostly) */ #define SREV(x) ((((x)&0xFF)<<8) | (((x)>>8)&0xFF)) @@ -191,3 +197,4 @@ it also defines lots of intermediate macros, just ignore those :-) #define RIVAL(buf,pos) IREV(IVAL(buf,pos)) #define RSSVAL(buf,pos,val) SSVAL(buf,pos,SREV(val)) #define RSIVAL(buf,pos,val) SIVAL(buf,pos,IREV(val)) + -- cgit From 3dd03e4bb7af903eae162648bbf51da04fa68200 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 9 Oct 1997 16:14:53 +0000 Subject: added #ifdef NTDOMAIN. added call to api_ntLsarpc instead of api_Lsarpc in ipc.c iff NTDOMAIN is defined. (This used to be commit 7bc4c4c27bf18ce3f632d230dc919ea341b5abb0) --- source3/include/proto.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index b0589ede19..009d83db5c 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -629,6 +629,10 @@ BOOL api_LsarpcTNP(int cnum,int uid, char *param,char *data, char **rdata,char **rparam, int *rdata_len,int *rparam_len); char *dom_sid_to_string(DOM_SID *sid); +BOOL api_ntlsarpcTNP(int cnum,int uid, char *param,char *data, + int mdrcnt,int mprcnt, + char **rdata,char **rparam, + int *rdata_len,int *rparam_len); /*The following definitions come from predict.c */ -- cgit From f3f44f7dbbc360733da329ef55bb0353ae0a8443 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 9 Oct 1997 18:40:52 +0000 Subject: local.h: Fix spelling mistake :-). namedbsubnet.c: Stop registering 1x name unless we can be a local master. reply.c: Remove ERRbaddirectory code. server.c: Remove abort() - use exit_server() instead. trans2.c: Remove ERRbaddirectory code. Jeremy (jallison@whistle.com) (This used to be commit 76247228896d39312ba896fa229076be3271e2e4) --- source3/include/local.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index 22d1b2a08e..97857727c7 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -159,7 +159,7 @@ /* the directory to sit in when idle */ /* #define IDLE_DIR "/" */ -/* Timout (in seconds) to wait for an oplock breal +/* Timout (in seconds) to wait for an oplock break message to return. */ #define OPLOCK_BREAK_TIMEOUT 30 -- cgit From 805749baab4e79fbdb9897f22b2c801d9dd9efc2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 10 Oct 1997 01:32:26 +0000 Subject: nmblookup.c: Added -A ability to do status on ip address. smb.h: Added defines we will need for NT SMB calls. trans2.c: Fixed SMB_QUERY_FILE_ALT_NAME_INFO return - this is only for short name returns (and only used when you negotiate NT SMB calls to boot !). Jeremy (jallison@whistle.com) (This used to be commit 53915bd160eda8c099482ddcef74d1d7606e752b) --- source3/include/smb.h | 53 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 19 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index d0baa66992..54ce9e88e8 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -438,8 +438,8 @@ typedef struct id_info_1 DOM_LOGON_ID logon_id; /* logon ID */ UNIHDR hdr_user_name; /* user name unicode header */ UNIHDR hdr_workgroup_name; /* workgroup name unicode header */ - ARC4_OWF arc4_lm_owf; /* rc4 LM OWF Password */ - ARC4_OWF arc4_nt_owf; /* rc4 NT OWF Password */ + ARC4_OWF arc4_lm_owf; /* arc4 LM OWF Password */ + ARC4_OWF arc4_nt_owf; /* arc4 NT OWF Password */ UNISTR2 uni_domain_name; /* domain name unicode string */ UNISTR2 uni_user_name; /* user name unicode string */ UNISTR2 uni_workgroup_name; /* workgroup name unicode string */ @@ -1305,23 +1305,38 @@ struct connect_record #define SMBfindnclose 0x35 /* Terminate a TRANSACT2_FINDNOTIFYFIRST */ #define SMBulogoffX 0x74 /* user logoff */ - -/* these are the TRANS2 sub commands */ -#define TRANSACT2_OPEN 0 -#define TRANSACT2_FINDFIRST 1 -#define TRANSACT2_FINDNEXT 2 -#define TRANSACT2_QFSINFO 3 -#define TRANSACT2_SETFSINFO 4 -#define TRANSACT2_QPATHINFO 5 -#define TRANSACT2_SETPATHINFO 6 -#define TRANSACT2_QFILEINFO 7 -#define TRANSACT2_SETFILEINFO 8 -#define TRANSACT2_FSCTL 9 -#define TRANSACT2_IOCTL 10 -#define TRANSACT2_FINDNOTIFYFIRST 11 -#define TRANSACT2_FINDNOTIFYNEXT 12 -#define TRANSACT2_MKDIR 13 - +/* NT SMB extensions. */ +#define SMBnttrans 0xA0 /* NT transact */ +#define SMBnttranss 0xA1 /* NT transact secondary */ +#define SMBntcreateX 0xA2 /* NT create and X */ +#define SMBntcancel 0xA4 /* NT cancel */ + +/* These are the TRANS2 sub commands */ +#define TRANSACT2_OPEN 0 +#define TRANSACT2_FINDFIRST 1 +#define TRANSACT2_FINDNEXT 2 +#define TRANSACT2_QFSINFO 3 +#define TRANSACT2_SETFSINFO 4 +#define TRANSACT2_QPATHINFO 5 +#define TRANSACT2_SETPATHINFO 6 +#define TRANSACT2_QFILEINFO 7 +#define TRANSACT2_SETFILEINFO 8 +#define TRANSACT2_FSCTL 9 +#define TRANSACT2_IOCTL 0xA +#define TRANSACT2_FINDNOTIFYFIRST 0xB +#define TRANSACT2_FINDNOTIFYNEXT 0xC +#define TRANSACT2_MKDIR 0xD +#define TRANSACT2_SESSION_SETUP 0xE +#define TRANSACT2_GET_DFS_REFERRAL 0x10 +#define TRANSACT2_REPORT_DFS_INCONSISTANCY 0x11 + +/* These are the NT transact sub commands. */ +#define NT_TRANSACT_CREATE 1 +#define NT_TRANSACT_IOCTL 2 +#define NT_TRANSACT_SET_SECURITY_DESC 3 +#define NT_TRANSACT_NOTIFY_CHANGE 4 +#define NT_TRANSACT_RENAME 5 +#define NT_TRANSACT_QUERY_SECURITY_DESC 6 /* these are the trans2 sub fields for primary requests */ #define smb_tpscnt smb_vwv0 -- cgit From c5e739febe5ab3bcc5d147fe791c788ec72531a3 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 10 Oct 1997 14:48:05 +0000 Subject: Makefile: added credentials.c to smbd credentials.c: using credential structures instead of char* password.c uid.c server.c: added sid and attr to user_struct. smbdes.c: smbhash and str_to_key make public instead of private. pipes.c smb.h: lsa structures, sub-functions. proto.h: usual. (This used to be commit 87a0a944855a673d693d934e446bdc231b1c7f02) --- source3/include/proto.h | 17 +++++++++++++++-- source3/include/smb.h | 43 +++++++++++++++++++++++++++++++++++++------ 2 files changed, 52 insertions(+), 8 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 009d83db5c..94937daade 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -60,6 +60,15 @@ int process_tar(char *inbuf, char *outbuf); int clipfind(char **aret, int ret, char *tok); int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind); +/*The following definitions come from credentials.c */ + +void cred_session_key(DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal, char *pass, + char *session_key); +void cred_create(char *session_key, DOM_CHAL *stored_cred, UTIME timestamp, + DOM_CHAL *cred); +int cred_assert(DOM_CHAL *cred, char *session_key, DOM_CHAL *stored_cred, + UTIME timestamp); + /*The following definitions come from dir.c */ void init_dptrs(void); @@ -629,10 +638,11 @@ BOOL api_LsarpcTNP(int cnum,int uid, char *param,char *data, char **rdata,char **rparam, int *rdata_len,int *rparam_len); char *dom_sid_to_string(DOM_SID *sid); -BOOL api_ntlsarpcTNP(int cnum,int uid, char *param,char *data, +BOOL api_ntLsarpcTNP(int cnum,int uid, char *param,char *data, int mdrcnt,int mprcnt, char **rdata,char **rparam, int *rdata_len,int *rparam_len); +void no_fn(uint uid); /*The following definitions come from predict.c */ @@ -755,7 +765,8 @@ BOOL request_oplock_break(min_share_mode_entry *share_entry, BOOL snum_used(int snum); BOOL reload_services(BOOL test); int setup_groups(char *user, int uid, int gid, int *p_ngroups, - int **p_igroups, gid_t **p_groups); + int **p_igroups, gid_t **p_groups, + int **p_attrs); int make_connection(char *service,char *user,char *password, int pwlen, char *dev,uint16 vuid); int find_free_file(void ); int reply_corep(char *outbuf); @@ -791,6 +802,8 @@ BOOL smb_shm_get_usage(int *bytes_free, /*The following definitions come from smbdes.c */ +void str_to_key(unsigned char *str,unsigned char *key); +void smbhash(unsigned char *out, unsigned char *in, unsigned char *key); void E_P16(unsigned char *p14,unsigned char *p16); void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24); diff --git a/source3/include/smb.h b/source3/include/smb.h index 54ce9e88e8..87fcb22cac 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -877,7 +877,8 @@ Response: */ -struct smb_passwd { +struct smb_passwd +{ int smb_userid; char *smb_name; unsigned char *smb_passwd; /* Null if no password */ @@ -886,12 +887,14 @@ struct smb_passwd { }; -struct current_user { +struct current_user +{ int cnum, id; int uid, gid; int ngroups; gid_t *groups; int *igroups; + int *attrs; }; typedef struct @@ -988,35 +991,63 @@ typedef struct char *user; /* name of user who *opened* this connection */ int uid; /* uid of user who *opened* this connection */ int gid; /* gid of user who *opened* this connection */ + uint16 vuid; /* vuid of user who *opened* this connection, or UID_FIELD_INVALID */ + /* following groups stuff added by ih */ + /* This groups info is valid for the user that *opened* the connection */ int ngroups; gid_t *groups; int *igroups; /* an integer version - some OSes are broken :-( */ + int *attrs; + time_t lastused; BOOL used; int num_files_open; name_compare_entry *hide_list; /* Per-share list of files to return as hidden. */ name_compare_entry *veto_list; /* Per-share list of files to veto (never show). */ + } connection_struct; +/* Domain controller authentication protocol info */ +struct dcinfo +{ + DOM_CHAL clnt_chal; /* Initial challenge received from client */ + DOM_CHAL srv_chal; /* Initial server challenge */ + DOM_CHAL clnt_cred; /* Last client credential */ + DOM_CHAL srv_cred; /* Last server credential */ + + char sess_key[8]; /* Session key */ + uchar md4pw[16]; /* md4(machine password) */ +}; typedef struct { int uid; /* uid of a validated user */ int gid; /* gid of a validated user */ + fstring name; /* name of a validated user */ + fstring real_name; /* to store real name from password file - simeon */ BOOL guest; + /* following groups stuff added by ih */ /* This groups info is needed for when we become_user() for this uid */ - int user_ngroups; - gid_t *user_groups; - int *user_igroups; /* an integer version - some OSes are broken :-( */ + int n_groups; + gid_t *groups; + int *igroups; /* an integer version - some OSes are broken :-( */ + int *attrs; /* attributes associated with each gid */ + #if (defined(NETGROUP) && defined(AUTOMOUNT)) char *home_share; /* to store NIS home of a user - simeon */ #endif - char *real_name; /* to store real name from password file - simeon */ + + int n_sids; + int *sids; + + /* per-user authentication information on NT RPCs */ + struct dcinfo dc; + } user_struct; -- cgit From b94ddf082d73249e3ad1590ee24a5c9c33a15e94 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 10 Oct 1997 16:40:23 +0000 Subject: ipc.c : #if NTDOMAIN call to api_netlogRPC #endif lsaparse.c : renamed lsa_io_q_auth2 to lsa_io_q_auth_2. pipes.c : added api_lsa_reply_auth_2() and api_netlogRPC. proto.h : the usual. (This used to be commit e2e1979b6215080593728942d414a273505877df) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 94937daade..0ed52bc6fd 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -331,7 +331,7 @@ char* lsa_io_q_lookup_rids(BOOL io, LSA_Q_LOOKUP_RIDS *q_r, char *q, char *base, char* lsa_io_r_lookup_rids(BOOL io, LSA_R_LOOKUP_RIDS *r_r, char *q, char *base, int align); char* lsa_io_q_req_chal(BOOL io, LSA_Q_REQ_CHAL *q_c, char *q, char *base, int align); char* lsa_io_r_req_chal(BOOL io, LSA_R_REQ_CHAL *r_c, char *q, char *base, int align); -char* lsa_io_q_auth2(BOOL io, LSA_Q_AUTH_2 *q_a, char *q, char *base, int align); +char* lsa_io_q_auth_2(BOOL io, LSA_Q_AUTH_2 *q_a, char *q, char *base, int align); char* lsa_io_r_auth_2(BOOL io, LSA_R_AUTH_2 *r_a, char *q, char *base, int align); char* lsa_io_q_srv_pwset(BOOL io, LSA_Q_SRV_PWSET *q_s, char *q, char *base, int align); char* lsa_io_r_srv_pwset(BOOL io, LSA_R_SRV_PWSET *r_s, char *q, char *base, int align); -- cgit From 7f296a8f905cc40972ed249567e5d985c0ce3825 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 10 Oct 1997 18:03:30 +0000 Subject: added lsa_reply_srv_pwset() (This used to be commit 0d043cfef289ee82287bb6014a164ba83ca87f30) --- source3/include/smb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 87fcb22cac..62351da187 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -282,7 +282,7 @@ typedef fstring string; #define LSA_QUERYINFOPOLICY 0x07 #define LSA_ENUMTRUSTDOM 0x0d #define LSA_REQCHAL 0x04 -#define LSA_SVRPWSET 0x06 +#define LSA_SRVPWSET 0x06 #define LSA_SAMLOGON 0x02 #define LSA_AUTH2 0x0f #define LSA_CLOSE 0x00 -- cgit From 7fcc737ae954131f5c7cc90b9dd69c79e0436554 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 10 Oct 1997 19:49:17 +0000 Subject: the usual (This used to be commit 2ade5b2706b884fbca2a5794912280a58bc41a08) --- source3/include/proto.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 0ed52bc6fd..93458bcaf9 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -642,7 +642,10 @@ BOOL api_ntLsarpcTNP(int cnum,int uid, char *param,char *data, int mdrcnt,int mprcnt, char **rdata,char **rparam, int *rdata_len,int *rparam_len); -void no_fn(uint uid); +BOOL api_netlogrpcTNP(int cnum,int uid, char *param,char *data, + int mdrcnt,int mprcnt, + char **rdata,char **rparam, + int *rdata_len,int *rparam_len); /*The following definitions come from predict.c */ -- cgit From 9160c85a78b66dab5318e2c9c922f00b6b3560f5 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sat, 11 Oct 1997 15:10:57 +0000 Subject: namelogon.c : added NTLOGON. (fixed the case 0:) namepacket.c: call to NTLOGON mailslot nameserv.h defines for NETLOGON and NTLOGON mailslot util.c: added andrew's dump_data() function. (This used to be commit 1eaad1c99463dcd42eb8ff4ea5686ad9ec6fc42e) --- source3/include/nameserv.h | 7 +++++++ source3/include/proto.h | 1 + 2 files changed, 8 insertions(+) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 83f3a3c524..593c101d92 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -82,6 +82,7 @@ /* mail slots */ #define BROWSE_MAILSLOT "\\MAILSLOT\\BROWSE" #define NET_LOGON_MAILSLOT "\\MAILSLOT\\NET\\NETLOGON" +#define NT_LOGON_MAILSLOT "\\MAILSLOT\\NET\\NTLOGON" enum name_source {STATUS_QUERY, LMHOSTS, REGISTER, SELF, DNS, DNSFAIL}; enum node_type {B_NODE=0, P_NODE=1, M_NODE=2, NBDD_NODE=3}; @@ -372,6 +373,12 @@ struct packet_struct } packet; }; +/* NETLOGON opcodes */ +#define QUERYFORPDC 7 /* Query for PDC */ +#define QUERYFORPDC_R 12 /* Response to Query for PDC */ +#define SAMLOGON 18 +#define SAMLOGON_R 19 + /* ids for netbios packet types */ #define ANN_HostAnnouncement 1 diff --git a/source3/include/proto.h b/source3/include/proto.h index 93458bcaf9..f859e9bfa2 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1071,3 +1071,4 @@ void pstrcpy(char *dest, char *src); char *align4(char *q, char *base); char *align2(char *q, char *base); char *align_offset(char *q, char *base, int align_offset_len); +void dump_data(int level,unsigned char *buf,int len); -- cgit From a26037ac7c1ac218863f9d674dcf85293eb2f085 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sun, 12 Oct 1997 11:46:42 +0000 Subject: added debugging macros (suitable eventually for use in tcpdump, hopefully) (This used to be commit 946d73cf838976b905550288cac3aea7c43959f6) --- source3/include/byteorder.h | 29 +++++++++++++++++++++++++++++ source3/include/proto.h | 37 +++++++++++++++++++------------------ 2 files changed, 48 insertions(+), 18 deletions(-) (limited to 'source3/include') diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h index 0664a33817..e8989ee7e4 100644 --- a/source3/include/byteorder.h +++ b/source3/include/byteorder.h @@ -198,3 +198,32 @@ it also defines lots of intermediate macros, just ignore those :-) #define RSSVAL(buf,pos,val) SSVAL(buf,pos,SREV(val)) #define RSIVAL(buf,pos,val) SIVAL(buf,pos,IREV(val)) +#define DBG_RW_PCVAL(string,depth,base,read,inbuf,outbuf,len) \ + RW_PCVAL(read,inbuf,outbuf,len) \ + DEBUG(5,("%s %04x %s: ", \ + tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ + { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%d ", (inbuf)[idx])); } } \ + DEBUG(5,("\n")); + +#define DBG_RW_PSVAL(string,depth,base,read,inbuf,outbuf,len) \ + RW_PSVAL(read,inbuf,outbuf,len) \ + DEBUG(5,("%s %04x %s: ", \ + tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ + { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%d ", (inbuf)[idx])); } } \ + DEBUG(5,("\n")); + +#define DBG_RW_CVAL(string,depth,base,read,inbuf,outbuf) \ + RW_CVAL(read,inbuf,outbuf,0) \ + DEBUG(5,("%s %04x %s: %02x\n", \ + tab_depth(depth), PTR_DIFF(inbuf,base),string, (unsigned int)*(inbuf))); + +#define DBG_RW_SVAL(string,depth,base,read,inbuf,outbuf) \ + RW_SVAL(read,inbuf,outbuf,0) \ + DEBUG(5,("%s %04x %s: %04x\n", \ + tab_depth(depth), PTR_DIFF(inbuf,base),string, (unsigned int)*(inbuf))); + +#define DBG_RW_IVAL(string,depth,base,read,inbuf,outbuf) \ + RW_IVAL(read,inbuf,outbuf,0) \ + DEBUG(5,("%s %04x %s: %08x\n", \ + tab_depth(depth), PTR_DIFF(inbuf,base),string, (unsigned int)*(inbuf))); + diff --git a/source3/include/proto.h b/source3/include/proto.h index f859e9bfa2..d9b6ca157b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -322,24 +322,24 @@ BOOL remove_share_oplock(int fnum, share_lock_token token); /*The following definitions come from lsaparse.c */ -char* lsa_io_r_open_pol(BOOL io, LSA_R_OPEN_POL *r_p, char *q, char *base, int align); -char* lsa_io_q_query(BOOL io, LSA_Q_QUERY_INFO *q_q, char *q, char *base, int align); -char* lsa_io_r_query(BOOL io, LSA_R_QUERY_INFO *r_q, char *q, char *base, int align); -char* lsa_io_q_lookup_sids(BOOL io, LSA_Q_LOOKUP_SIDS *q_s, char *q, char *base, int align); -char* lsa_io_r_lookup_sids(BOOL io, LSA_R_LOOKUP_SIDS *r_s, char *q, char *base, int align); -char* lsa_io_q_lookup_rids(BOOL io, LSA_Q_LOOKUP_RIDS *q_r, char *q, char *base, int align); -char* lsa_io_r_lookup_rids(BOOL io, LSA_R_LOOKUP_RIDS *r_r, char *q, char *base, int align); -char* lsa_io_q_req_chal(BOOL io, LSA_Q_REQ_CHAL *q_c, char *q, char *base, int align); -char* lsa_io_r_req_chal(BOOL io, LSA_R_REQ_CHAL *r_c, char *q, char *base, int align); -char* lsa_io_q_auth_2(BOOL io, LSA_Q_AUTH_2 *q_a, char *q, char *base, int align); -char* lsa_io_r_auth_2(BOOL io, LSA_R_AUTH_2 *r_a, char *q, char *base, int align); -char* lsa_io_q_srv_pwset(BOOL io, LSA_Q_SRV_PWSET *q_s, char *q, char *base, int align); -char* lsa_io_r_srv_pwset(BOOL io, LSA_R_SRV_PWSET *r_s, char *q, char *base, int align); -char* lsa_io_user_info(BOOL io, LSA_USER_INFO *usr, char *q, char *base, int align); -char* lsa_io_q_sam_logon(BOOL io, LSA_Q_SAM_LOGON *q_l, char *q, char *base, int align); -char* lsa_io_r_sam_logon(BOOL io, LSA_R_SAM_LOGON *r_l, char *q, char *base, int align); -char* lsa_io_q_sam_logoff(BOOL io, LSA_Q_SAM_LOGOFF *q_l, char *q, char *base, int align); -char* lsa_io_r_sam_logoff(BOOL io, LSA_R_SAM_LOGOFF *r_l, char *q, char *base, int align); +char* lsa_io_r_open_pol(BOOL io, LSA_R_OPEN_POL *r_p, char *q, char *base, int align, int depth); +char* lsa_io_q_query(BOOL io, LSA_Q_QUERY_INFO *q_q, char *q, char *base, int align, int depth); +char* lsa_io_r_query(BOOL io, LSA_R_QUERY_INFO *r_q, char *q, char *base, int align, int depth); +char* lsa_io_q_lookup_sids(BOOL io, LSA_Q_LOOKUP_SIDS *q_s, char *q, char *base, int align, int depth); +char* lsa_io_r_lookup_sids(BOOL io, LSA_R_LOOKUP_SIDS *r_s, char *q, char *base, int align, int depth); +char* lsa_io_q_lookup_rids(BOOL io, LSA_Q_LOOKUP_RIDS *q_r, char *q, char *base, int align, int depth); +char* lsa_io_r_lookup_rids(BOOL io, LSA_R_LOOKUP_RIDS *r_r, char *q, char *base, int align, int depth); +char* lsa_io_q_req_chal(BOOL io, LSA_Q_REQ_CHAL *q_c, char *q, char *base, int align, int depth); +char* lsa_io_r_req_chal(BOOL io, LSA_R_REQ_CHAL *r_c, char *q, char *base, int align, int depth); +char* lsa_io_q_auth_2(BOOL io, LSA_Q_AUTH_2 *q_a, char *q, char *base, int align, int depth); +char* lsa_io_r_auth_2(BOOL io, LSA_R_AUTH_2 *r_a, char *q, char *base, int align, int depth); +char* lsa_io_q_srv_pwset(BOOL io, LSA_Q_SRV_PWSET *q_s, char *q, char *base, int align, int depth); +char* lsa_io_r_srv_pwset(BOOL io, LSA_R_SRV_PWSET *r_s, char *q, char *base, int align, int depth); +char* lsa_io_user_info(BOOL io, LSA_USER_INFO *usr, char *q, char *base, int align, int depth); +char* lsa_io_q_sam_logon(BOOL io, LSA_Q_SAM_LOGON *q_l, char *q, char *base, int align, int depth); +char* lsa_io_r_sam_logon(BOOL io, LSA_R_SAM_LOGON *r_l, char *q, char *base, int align, int depth); +char* lsa_io_q_sam_logoff(BOOL io, LSA_Q_SAM_LOGOFF *q_l, char *q, char *base, int align, int depth); +char* lsa_io_r_sam_logoff(BOOL io, LSA_R_SAM_LOGOFF *r_l, char *q, char *base, int align, int depth); /*The following definitions come from mangle.c */ @@ -1072,3 +1072,4 @@ char *align4(char *q, char *base); char *align2(char *q, char *base); char *align_offset(char *q, char *base, int align_offset_len); void dump_data(int level,unsigned char *buf,int len); +char *tab_depth(int depth); -- cgit From 60575a888aebec898fdaf0f6c0c8269607b2571f Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sun, 12 Oct 1997 14:17:55 +0000 Subject: ipc.c: debugging info. found that data = NULL because of short packet length indicated from the ntlsaRPC pipe _royally_ stuffs NT's packet handling. maybe this should go down as a service denial bug to the ntbugtraq list. pipes.c lsaparse.c smbparse.c : added more debug stuff. added length of header to data_len in MSRPC fragment_length field (0x18 bytes short) which caused the above bug from NT 4.0. oops. (This used to be commit a6f8de6815e0b85bb23b302980730501ac0b87e5) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index d9b6ca157b..1ac4132807 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -837,7 +837,7 @@ char* smb_io_id_info1(BOOL io, DOM_ID_INFO_1 *id, char *q, char *base, int align char* smb_io_sam_info(BOOL io, DOM_SAM_INFO *sam, char *q, char *base, int align); char* smb_io_gid(BOOL io, DOM_GID *gid, char *q, char *base, int align); char* smb_io_rpc_hdr(BOOL io, RPC_HDR *rpc, char *q, char *base, int align); -char* smb_io_pol_hnd(BOOL io, LSA_POL_HND *pol, char *q, char *base, int align); +char* smb_io_pol_hnd(BOOL io, LSA_POL_HND *pol, char *q, char *base, int align, int depth); char* smb_io_dom_query_3(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align); char* smb_io_dom_query_5(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align); char* smb_io_dom_query(BOOL io, DOM_QUERY *d_q, char *q, char *base, int align); -- cgit From 78f6bc4eba9f6d68c31b1c7e35243a1b81619b0d Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sun, 12 Oct 1997 17:07:35 +0000 Subject: updated rpc header reply: callid wrong; alloc hint a uint32 not a uint16. still doesn't get rid of the netlogon trans2 request with zero data. (This used to be commit 0cf67955f09d99c452bfc3fdde00dcea98e21db1) --- source3/include/smb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 62351da187..58dfc141bd 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -477,7 +477,7 @@ typedef struct rpc_hdr_info uint8 minor; /* 0 - RPC minor version */ uint8 pkt_type; /* 2 - RPC response packet */ uint8 frag; /* 3 - first frag + last frag */ - uint32 pack_type; /* 0x0000 0010 - packed data representation */ + uint32 pack_type; /* 0x1000 0000 - packed data representation */ uint16 frag_len; /* fragment length - data size (bytes) inc header and tail. */ uint16 auth_len; /* 0 - authentication length */ uint32 call_id; /* call identifier. matches 12th uint32 of incoming RPC data. */ -- cgit From db20ab9bbdcc8fbfa81883c2d0c952386820de4c Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sun, 12 Oct 1997 19:02:55 +0000 Subject: getting somewhere. ipc.c : removed srvsvc pipe reference: have to do that. pipes.c lsaparse.c smbparse.c : more debugging info. looks a bit like netmon output. (This used to be commit e02aa88e25ae6d4da7953aaff04ff2ae9a656d05) --- source3/include/byteorder.h | 6 +++--- source3/include/proto.h | 50 ++++++++++++++++++++++----------------------- 2 files changed, 28 insertions(+), 28 deletions(-) (limited to 'source3/include') diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h index e8989ee7e4..c0e38adc2b 100644 --- a/source3/include/byteorder.h +++ b/source3/include/byteorder.h @@ -215,15 +215,15 @@ it also defines lots of intermediate macros, just ignore those :-) #define DBG_RW_CVAL(string,depth,base,read,inbuf,outbuf) \ RW_CVAL(read,inbuf,outbuf,0) \ DEBUG(5,("%s %04x %s: %02x\n", \ - tab_depth(depth), PTR_DIFF(inbuf,base),string, (unsigned int)*(inbuf))); + tab_depth(depth), PTR_DIFF(inbuf,base),string, *(inbuf))); #define DBG_RW_SVAL(string,depth,base,read,inbuf,outbuf) \ RW_SVAL(read,inbuf,outbuf,0) \ DEBUG(5,("%s %04x %s: %04x\n", \ - tab_depth(depth), PTR_DIFF(inbuf,base),string, (unsigned int)*(inbuf))); + tab_depth(depth), PTR_DIFF(inbuf,base),string, *(inbuf))); #define DBG_RW_IVAL(string,depth,base,read,inbuf,outbuf) \ RW_IVAL(read,inbuf,outbuf,0) \ DEBUG(5,("%s %04x %s: %08x\n", \ - tab_depth(depth), PTR_DIFF(inbuf,base),string, (unsigned int)*(inbuf))); + tab_depth(depth), PTR_DIFF(inbuf,base),string, *(inbuf))); diff --git a/source3/include/proto.h b/source3/include/proto.h index 1ac4132807..72b15173ec 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -818,32 +818,32 @@ void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); /*The following definitions come from smbparse.c */ -char* smb_io_utime(BOOL io, UTIME *t, char *q, char *base, int align); -char* smb_io_time(BOOL io, NTTIME *nttime, char *q, char *base, int align); -char* smb_io_dom_sid(BOOL io, DOM_SID *sid, char *q, char *base, int align); -char* smb_io_unihdr(BOOL io, UNIHDR *hdr, char *q, char *base, int align); -char* smb_io_unihdr2(BOOL io, UNIHDR2 *hdr2, char *q, char *base, int align); -char* smb_io_unistr(BOOL io, UNISTR *uni, char *q, char *base, int align); -char* smb_io_unistr2(BOOL io, UNISTR2 *uni2, char *q, char *base, int align); -char* smb_io_dom_sid2(BOOL io, DOM_SID2 *sid2, char *q, char *base, int align); -char* smb_io_dom_rid2(BOOL io, DOM_RID2 *rid2, char *q, char *base, int align); -char* smb_io_log_info(BOOL io, DOM_LOG_INFO *log, char *q, char *base, int align); -char* smb_io_chal(BOOL io, DOM_CHAL *chal, char *q, char *base, int align); -char* smb_io_cred(BOOL io, DOM_CRED *cred, char *q, char *base, int align); -char* smb_io_clnt_info(BOOL io, DOM_CLNT_INFO *clnt, char *q, char *base, int align); -char* smb_io_logon_id(BOOL io, DOM_LOGON_ID *log, char *q, char *base, int align); -char* smb_io_arc4_owf(BOOL io, ARC4_OWF *hash, char *q, char *base, int align); -char* smb_io_id_info1(BOOL io, DOM_ID_INFO_1 *id, char *q, char *base, int align); -char* smb_io_sam_info(BOOL io, DOM_SAM_INFO *sam, char *q, char *base, int align); -char* smb_io_gid(BOOL io, DOM_GID *gid, char *q, char *base, int align); -char* smb_io_rpc_hdr(BOOL io, RPC_HDR *rpc, char *q, char *base, int align); +char* smb_io_utime(BOOL io, UTIME *t, char *q, char *base, int align, int depth); +char* smb_io_time(BOOL io, NTTIME *nttime, char *q, char *base, int align, int depth); +char* smb_io_dom_sid(BOOL io, DOM_SID *sid, char *q, char *base, int align, int depth); +char* smb_io_unihdr(BOOL io, UNIHDR *hdr, char *q, char *base, int align, int depth); +char* smb_io_unihdr2(BOOL io, UNIHDR2 *hdr2, char *q, char *base, int align, int depth); +char* smb_io_unistr(BOOL io, UNISTR *uni, char *q, char *base, int align, int depth); +char* smb_io_unistr2(BOOL io, UNISTR2 *uni2, char *q, char *base, int align, int depth); +char* smb_io_dom_sid2(BOOL io, DOM_SID2 *sid2, char *q, char *base, int align, int depth); +char* smb_io_dom_rid2(BOOL io, DOM_RID2 *rid2, char *q, char *base, int align, int depth); +char* smb_io_log_info(BOOL io, DOM_LOG_INFO *log, char *q, char *base, int align, int depth); +char* smb_io_chal(BOOL io, DOM_CHAL *chal, char *q, char *base, int align, int depth); +char* smb_io_cred(BOOL io, DOM_CRED *cred, char *q, char *base, int align, int depth); +char* smb_io_clnt_info(BOOL io, DOM_CLNT_INFO *clnt, char *q, char *base, int align, int depth); +char* smb_io_logon_id(BOOL io, DOM_LOGON_ID *log, char *q, char *base, int align, int depth); +char* smb_io_arc4_owf(BOOL io, ARC4_OWF *hash, char *q, char *base, int align, int depth); +char* smb_io_id_info1(BOOL io, DOM_ID_INFO_1 *id, char *q, char *base, int align, int depth); +char* smb_io_sam_info(BOOL io, DOM_SAM_INFO *sam, char *q, char *base, int align, int depth); +char* smb_io_gid(BOOL io, DOM_GID *gid, char *q, char *base, int align, int depth); +char* smb_io_rpc_hdr(BOOL io, RPC_HDR *rpc, char *q, char *base, int align, int depth); char* smb_io_pol_hnd(BOOL io, LSA_POL_HND *pol, char *q, char *base, int align, int depth); -char* smb_io_dom_query_3(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align); -char* smb_io_dom_query_5(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align); -char* smb_io_dom_query(BOOL io, DOM_QUERY *d_q, char *q, char *base, int align); -char* smb_io_dom_r_ref(BOOL io, DOM_R_REF *r_r, char *q, char *base, int align); -char* smb_io_dom_name(BOOL io, DOM_NAME *name, char *q, char *base, int align); -char* smb_io_neg_flags(BOOL io, NEG_FLAGS *neg, char *q, char *base, int align); +char* smb_io_dom_query_3(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align, int depth); +char* smb_io_dom_query_5(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align, int depth); +char* smb_io_dom_query(BOOL io, DOM_QUERY *d_q, char *q, char *base, int align, int depth); +char* smb_io_dom_r_ref(BOOL io, DOM_R_REF *r_r, char *q, char *base, int align, int depth); +char* smb_io_dom_name(BOOL io, DOM_NAME *name, char *q, char *base, int align, int depth); +char* smb_io_neg_flags(BOOL io, NEG_FLAGS *neg, char *q, char *base, int align, int depth); /*The following definitions come from smbpass.c */ -- cgit From 2259e56a947104b19a1196154af4e43ab15e4b7c Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 13 Oct 1997 12:21:56 +0000 Subject: byteorder.h : debugging output wasn't (still isn't) perfect. credentials.c lsaparse.c smbparse.c : added DEBUG strings. pipes.c : lost some changes, to do with setup of RPC headers. arg. (This used to be commit 9fdd697d17b68293bb95fd68f44c24f0f5b97f5f) --- source3/include/byteorder.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h index c0e38adc2b..808026f9db 100644 --- a/source3/include/byteorder.h +++ b/source3/include/byteorder.h @@ -202,14 +202,14 @@ it also defines lots of intermediate macros, just ignore those :-) RW_PCVAL(read,inbuf,outbuf,len) \ DEBUG(5,("%s %04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ - { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%d ", (inbuf)[idx])); } } \ + { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%d ", (outbuf)[idx])); } } \ DEBUG(5,("\n")); #define DBG_RW_PSVAL(string,depth,base,read,inbuf,outbuf,len) \ RW_PSVAL(read,inbuf,outbuf,len) \ DEBUG(5,("%s %04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ - { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%d ", (inbuf)[idx])); } } \ + { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%d ", (outbuf)[idx])); } } \ DEBUG(5,("\n")); #define DBG_RW_CVAL(string,depth,base,read,inbuf,outbuf) \ -- cgit From 2225fe13766ae07a44e27cc4a1fb665cf5afc804 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 13 Oct 1997 13:35:37 +0000 Subject: debug info added (This used to be commit a3f96555b47265b8cd4d1f735af58375e2591d56) --- source3/include/byteorder.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source3/include') diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h index 808026f9db..a6f826b518 100644 --- a/source3/include/byteorder.h +++ b/source3/include/byteorder.h @@ -200,30 +200,30 @@ it also defines lots of intermediate macros, just ignore those :-) #define DBG_RW_PCVAL(string,depth,base,read,inbuf,outbuf,len) \ RW_PCVAL(read,inbuf,outbuf,len) \ - DEBUG(5,("%s %04x %s: ", \ + DEBUG(5,("%s%04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ - { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%d ", (outbuf)[idx])); } } \ + { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%x ", (outbuf)[idx])); } } \ DEBUG(5,("\n")); #define DBG_RW_PSVAL(string,depth,base,read,inbuf,outbuf,len) \ RW_PSVAL(read,inbuf,outbuf,len) \ - DEBUG(5,("%s %04x %s: ", \ + DEBUG(5,("%s%04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ - { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%d ", (outbuf)[idx])); } } \ + { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%02x ", (outbuf)[idx])); } } \ DEBUG(5,("\n")); #define DBG_RW_CVAL(string,depth,base,read,inbuf,outbuf) \ RW_CVAL(read,inbuf,outbuf,0) \ - DEBUG(5,("%s %04x %s: %02x\n", \ + DEBUG(5,("%s%04x %s: %02x\n", \ tab_depth(depth), PTR_DIFF(inbuf,base),string, *(inbuf))); #define DBG_RW_SVAL(string,depth,base,read,inbuf,outbuf) \ RW_SVAL(read,inbuf,outbuf,0) \ - DEBUG(5,("%s %04x %s: %04x\n", \ + DEBUG(5,("%s%04x %s: %04x\n", \ tab_depth(depth), PTR_DIFF(inbuf,base),string, *(inbuf))); #define DBG_RW_IVAL(string,depth,base,read,inbuf,outbuf) \ RW_IVAL(read,inbuf,outbuf,0) \ - DEBUG(5,("%s %04x %s: %08x\n", \ + DEBUG(5,("%s%04x %s: %08x\n", \ tab_depth(depth), PTR_DIFF(inbuf,base),string, *(inbuf))); -- cgit From 1035aa9c73bd26e0b01781e6b9b8af51b2013a25 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 13 Oct 1997 15:55:54 +0000 Subject: split pipes.c down into util, netlog and ntlsa. (This used to be commit 8fe02c239d70497af449ed0cdf1a32de10021ba1) --- source3/include/proto.h | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 72b15173ec..324431e2b3 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -626,27 +626,49 @@ BOOL server_validate(char *buf); BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); void pcap_printer_fn(void (*fn)()); -/*The following definitions come from pipes.c */ +/*The following definitions come from pipenetlog.c */ -int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize); -BOOL api_LsarpcSNPHS(int cnum,int uid, char *param,char *data, +BOOL api_netlogrpcTNP(int cnum,int uid, char *param,char *data, int mdrcnt,int mprcnt, char **rdata,char **rparam, int *rdata_len,int *rparam_len); -BOOL api_LsarpcTNP(int cnum,int uid, char *param,char *data, + +/*The following definitions come from pipentlsa.c */ + +BOOL api_ntLsarpcTNP(int cnum,int uid, char *param,char *data, int mdrcnt,int mprcnt, char **rdata,char **rparam, int *rdata_len,int *rparam_len); -char *dom_sid_to_string(DOM_SID *sid); -BOOL api_ntLsarpcTNP(int cnum,int uid, char *param,char *data, + +/*The following definitions come from pipes.c */ + +int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize); +BOOL api_LsarpcSNPHS(int cnum,int uid, char *param,char *data, int mdrcnt,int mprcnt, char **rdata,char **rparam, int *rdata_len,int *rparam_len); -BOOL api_netlogrpcTNP(int cnum,int uid, char *param,char *data, +void LsarpcTNP1(char *data,char **rdata, int *rdata_len); +BOOL api_LsarpcTNP(int cnum,int uid, char *param,char *data, int mdrcnt,int mprcnt, char **rdata,char **rparam, int *rdata_len,int *rparam_len); +/*The following definitions come from pipeutil.c */ + +void initrpcreply(char *inbuf, char *q); +void endrpcreply(char *inbuf, char *q, int datalen, int rtnval, int *rlen); +uint32 name_to_rid(char *user_name); +char *dom_sid_to_string(DOM_SID *sid); +void make_dom_sid(DOM_SID *sid, char *domsid); +void create_rpc_reply(RPC_HDR *hdr, uint32 call_id, int data_len); +int make_rpc_reply(char *inbuf, char *q, int data_len); +void make_uni_hdr(UNIHDR *hdr, int max_len, int len, uint16 terminate); +void make_uni_hdr2(UNIHDR2 *hdr, int max_len, int len, uint16 terminate); +void make_unistr(UNISTR *str, char *buf); +void make_unistr2(UNISTR2 *str, char *buf, int len, char terminate); +void make_dom_rid2(DOM_RID2 *rid2, uint32 rid); +void make_dom_sid2(DOM_SID2 *sid2, char *sid_str); + /*The following definitions come from predict.c */ int read_predict(int fd,int offset,char *buf,char **ptr,int num); -- cgit From 6084046eede3652d7cabafb33227e940f00f92a8 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 14 Oct 1997 17:01:43 +0000 Subject: credentials, query info reply. (This used to be commit 9b095887df204393090d7da9a47508685ddd5163) --- source3/include/byteorder.h | 4 ++-- source3/include/proto.h | 8 ++++---- source3/include/smb.h | 7 +++---- 3 files changed, 9 insertions(+), 10 deletions(-) (limited to 'source3/include') diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h index a6f826b518..06337b91a2 100644 --- a/source3/include/byteorder.h +++ b/source3/include/byteorder.h @@ -220,10 +220,10 @@ it also defines lots of intermediate macros, just ignore those :-) #define DBG_RW_SVAL(string,depth,base,read,inbuf,outbuf) \ RW_SVAL(read,inbuf,outbuf,0) \ DEBUG(5,("%s%04x %s: %04x\n", \ - tab_depth(depth), PTR_DIFF(inbuf,base),string, *(inbuf))); + tab_depth(depth), PTR_DIFF(inbuf,base),string, *((uint16*)(inbuf)))); #define DBG_RW_IVAL(string,depth,base,read,inbuf,outbuf) \ RW_IVAL(read,inbuf,outbuf,0) \ DEBUG(5,("%s%04x %s: %08x\n", \ - tab_depth(depth), PTR_DIFF(inbuf,base),string, *(inbuf))); + tab_depth(depth), PTR_DIFF(inbuf,base),string, *((uint32*)(inbuf)))); diff --git a/source3/include/proto.h b/source3/include/proto.h index 324431e2b3..ca60239412 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -63,10 +63,10 @@ int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind); /*The following definitions come from credentials.c */ void cred_session_key(DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal, char *pass, - char *session_key); -void cred_create(char *session_key, DOM_CHAL *stored_cred, UTIME timestamp, + uint32 session_key[2]); +void cred_create(uint32 session_key[2], DOM_CHAL *stor_cred, UTIME timestamp, DOM_CHAL *cred); -int cred_assert(DOM_CHAL *cred, char *session_key, DOM_CHAL *stored_cred, +int cred_assert(DOM_CHAL *cred, uint32 session_key[2], DOM_CHAL *stored_cred, UTIME timestamp); /*The following definitions come from dir.c */ @@ -665,7 +665,7 @@ int make_rpc_reply(char *inbuf, char *q, int data_len); void make_uni_hdr(UNIHDR *hdr, int max_len, int len, uint16 terminate); void make_uni_hdr2(UNIHDR2 *hdr, int max_len, int len, uint16 terminate); void make_unistr(UNISTR *str, char *buf); -void make_unistr2(UNISTR2 *str, char *buf, int len, char terminate); +void make_unistr2(UNISTR2 *str, char *buf, int len); void make_dom_rid2(DOM_RID2 *rid2, uint32 rid); void make_dom_sid2(DOM_SID2 *sid2, char *sid_str); diff --git a/source3/include/smb.h b/source3/include/smb.h index 58dfc141bd..8e34b06359 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -394,7 +394,7 @@ typedef struct log_info /* DOM_CHAL - challenge info */ typedef struct chal_info { - uint8 data[8]; /* credentials */ + uint32 data[2]; /* credentials */ } DOM_CHAL; @@ -492,7 +492,6 @@ typedef struct rpc_hdr_info typedef struct dom_query_info { uint16 uni_dom_max_len; /* domain name string length * 2 */ - uint16 padding; /* 2 padding bytes? */ uint16 uni_dom_str_len; /* domain name string length * 2 */ uint32 buffer_dom_name; /* undocumented domain name string buffer pointer */ uint32 buffer_dom_sid; /* undocumented domain SID string buffer pointer */ @@ -1018,8 +1017,8 @@ struct dcinfo DOM_CHAL clnt_cred; /* Last client credential */ DOM_CHAL srv_cred; /* Last server credential */ - char sess_key[8]; /* Session key */ - uchar md4pw[16]; /* md4(machine password) */ + uint32 sess_key[2]; /* Session key */ + uchar md4pw[16]; /* md4(machine password) */ }; typedef struct -- cgit From 8fe499f7752ec2d7f2c1bd71e73077b1f1675125 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 14 Oct 1997 18:37:55 +0000 Subject: byteorder.h: created a RW_PIVAL macro which was missing. smbparse.c: smb_io_dom_sid() was storing its sub-authorities as uint16s instead of uint32s. used the DBG_RW_PIVAL macro instead of DBG_RW_PSVAL. pipentlsa.c: not sure. something to do with the Query Info reply. pipeutil.c: make_rpc_reply() had the packed representation field set to 0x0100 0000 instead of 0x1000 0000, which had the interesting result of turning all uint32 and uint16 field byte ordering the other way round! (This used to be commit eafd6e9e797c5badb07059d7eddabd6a8947c830) --- source3/include/byteorder.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h index 06337b91a2..e11771c3ab 100644 --- a/source3/include/byteorder.h +++ b/source3/include/byteorder.h @@ -94,6 +94,10 @@ it also defines lots of intermediate macros, just ignore those :-) if (read) { PCVAL (inbuf,0,outbuf,len) } \ else { PSCVAL(inbuf,0,outbuf,len) } +#define RW_PIVAL(read,inbuf,outbuf,len) \ + if (read) { PIVAL (inbuf,0,outbuf,len) } \ + else { PSIVAL(inbuf,0,outbuf,len) } + #define RW_PSVAL(read,inbuf,outbuf,len) \ if (read) { PSVAL (inbuf,0,outbuf,len) } \ else { PSSVAL(inbuf,0,outbuf,len) } @@ -202,14 +206,21 @@ it also defines lots of intermediate macros, just ignore those :-) RW_PCVAL(read,inbuf,outbuf,len) \ DEBUG(5,("%s%04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ - { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%x ", (outbuf)[idx])); } } \ + { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%02x ", (outbuf)[idx])); } } \ DEBUG(5,("\n")); #define DBG_RW_PSVAL(string,depth,base,read,inbuf,outbuf,len) \ RW_PSVAL(read,inbuf,outbuf,len) \ DEBUG(5,("%s%04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ - { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%02x ", (outbuf)[idx])); } } \ + { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%04x ", (outbuf)[idx])); } } \ + DEBUG(5,("\n")); + +#define DBG_RW_PIVAL(string,depth,base,read,inbuf,outbuf,len) \ + RW_PIVAL(read,inbuf,outbuf,len) \ + DEBUG(5,("%s%04x %s: ", \ + tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ + { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%08x ", (outbuf)[idx])); } } \ DEBUG(5,("\n")); #define DBG_RW_CVAL(string,depth,base,read,inbuf,outbuf) \ -- cgit From 9d3cce7c68723954bf3e97ba5681aa60c31eb835 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 15 Oct 1997 09:15:45 +0000 Subject: fixed the freeze on logout bug. The fix has several parts: 1) add a new parameter to queue_netbios_packet(), the "reply_id", this is the id that should be used when sending a further response to the packet (such as a response after we get back a reply to a name query after senidnga WACK). reply_id is 0 (meaning unused) in most cases. 2) fix the id used in the reply in add_name_respond() from response_name_query_register() 3) remember to remove the response record at the end of response_name_query_register() 4) get the right IP address (it was 0.0.0.0) in response_name_query_register() 5) add a new field reply_id to struct response_record (This used to be commit e1e86c1a160c8302004ea58e4f0f5874dd179dae) --- source3/include/nameserv.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 593c101d92..81487e9ce9 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -247,6 +247,7 @@ struct response_record BOOL recurse; struct in_addr send_ip; struct in_addr reply_to_ip; + int reply_id; int num_msgs; -- cgit From 1860d62d0d6be42c7770e010ea2066db312c874b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 15 Oct 1997 09:18:39 +0000 Subject: the usual proto.h update (This used to be commit bdf3155418be02e2fe4daa1d2538f236be414e98) --- source3/include/proto.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index ca60239412..1ed8539ab5 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -427,7 +427,8 @@ struct response_record *make_response_queue_record(enum state_type state, int quest_type, char *name,int type, int nb_flags, time_t ttl, int server_type, char *my_name, char *my_comment, BOOL bcast,BOOL recurse, - struct in_addr send_ip, struct in_addr reply_to_ip); + struct in_addr send_ip, struct in_addr reply_to_ip, + int reply_id); struct response_record *find_response_record(struct subnet_record **d, uint16 id); @@ -529,7 +530,8 @@ struct response_record *queue_netbios_packet(struct subnet_record *d, int name_type,int nb_flags, time_t ttl, int server_type, char *my_name, char *my_comment, BOOL bcast,BOOL recurse, - struct in_addr send_ip, struct in_addr reply_to_ip); + struct in_addr send_ip, struct in_addr reply_to_ip, + int reply_id); /*The following definitions come from nameserv.c */ -- cgit From df4afea583a8b53aca46e15dcc75bba1af731f9f Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 15 Oct 1997 16:51:03 +0000 Subject: added srvsvc basic pipe, straight from paul's code. does NETSHAREENUM and NETSERVERGETINFO. (This used to be commit 96b17b829fc787c15cd366eca604c09d68b5b900) --- source3/include/proto.h | 4 ++++ source3/include/smb.h | 3 +++ 2 files changed, 7 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 1ed8539ab5..6baa945e8b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -654,6 +654,10 @@ BOOL api_LsarpcTNP(int cnum,int uid, char *param,char *data, int mdrcnt,int mprcnt, char **rdata,char **rparam, int *rdata_len,int *rparam_len); +BOOL api_srvsvcTNP(int cnum,int uid, char *param,char *data, + int mdrcnt,int mprcnt, + char **rdata,char **rparam, + int *rdata_len,int *rparam_len); /*The following definitions come from pipeutil.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index 8e34b06359..c733f29521 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -293,6 +293,9 @@ typedef fstring string; #define LSA_LOOKUPNAMES 0xFD #define LSA_SAMLOGOFF 0xFC +/* srvsvc pipe */ +#define NETSERVERGETINFO 0x15 +#define NETSHAREENUM 0x0f /* 32 bit time (sec) since 01jan1970 - cifs6.txt, section 3.5, page 30 */ typedef struct time_info -- cgit From d83845241381fb6ff86890d1d43c3d3bf6522a2b Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 15 Oct 1997 19:16:38 +0000 Subject: smb.h smbparse.c pipenetlog.c : whoops, the SAM Logon structure was wrong. updated this, and cifsntdomain.txt. more debug info in pipenetlog.c. the crash is somewhere around deal_with_credentials(). byteorder.h : put in uint8, uint16 and uint32 typecasts around debug info, because sign extending was resulting in ffffffe8 being displayed instead of e8. credentials.c : some debugging info, because i'm tracking a coredump. without gdb. nothing like making things difficult. reply.c : whoops, missed this (important) bit from paul's code, which tells the NT workstation that the MACHINE$ entry doesn't already exist, and we're going to create a default entry with a password "machine" right now. proto.h: the usual. (This used to be commit ed606bc7d4e6fb1091e527ea70a3e950d50a1db4) --- source3/include/byteorder.h | 8 ++++---- source3/include/proto.h | 2 ++ source3/include/smb.h | 26 ++++++++++++++++++++++---- 3 files changed, 28 insertions(+), 8 deletions(-) (limited to 'source3/include') diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h index e11771c3ab..f43159ecf4 100644 --- a/source3/include/byteorder.h +++ b/source3/include/byteorder.h @@ -206,27 +206,27 @@ it also defines lots of intermediate macros, just ignore those :-) RW_PCVAL(read,inbuf,outbuf,len) \ DEBUG(5,("%s%04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ - { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%02x ", (outbuf)[idx])); } } \ + { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%02x ", (uint8)((outbuf)[idx]))); } } \ DEBUG(5,("\n")); #define DBG_RW_PSVAL(string,depth,base,read,inbuf,outbuf,len) \ RW_PSVAL(read,inbuf,outbuf,len) \ DEBUG(5,("%s%04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ - { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%04x ", (outbuf)[idx])); } } \ + { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%04x ", (uint16)((outbuf)[idx]))); } } \ DEBUG(5,("\n")); #define DBG_RW_PIVAL(string,depth,base,read,inbuf,outbuf,len) \ RW_PIVAL(read,inbuf,outbuf,len) \ DEBUG(5,("%s%04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ - { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%08x ", (outbuf)[idx])); } } \ + { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%08x ", (uint32)((outbuf)[idx]))); } } \ DEBUG(5,("\n")); #define DBG_RW_CVAL(string,depth,base,read,inbuf,outbuf) \ RW_CVAL(read,inbuf,outbuf,0) \ DEBUG(5,("%s%04x %s: %02x\n", \ - tab_depth(depth), PTR_DIFF(inbuf,base),string, *(inbuf))); + tab_depth(depth), PTR_DIFF(inbuf,base),string, *((uint8*)(inbuf)))); #define DBG_RW_SVAL(string,depth,base,read,inbuf,outbuf) \ RW_SVAL(read,inbuf,outbuf,0) \ diff --git a/source3/include/proto.h b/source3/include/proto.h index 6baa945e8b..70a9873d34 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -855,9 +855,11 @@ char* smb_io_unistr(BOOL io, UNISTR *uni, char *q, char *base, int align, int de char* smb_io_unistr2(BOOL io, UNISTR2 *uni2, char *q, char *base, int align, int depth); char* smb_io_dom_sid2(BOOL io, DOM_SID2 *sid2, char *q, char *base, int align, int depth); char* smb_io_dom_rid2(BOOL io, DOM_RID2 *rid2, char *q, char *base, int align, int depth); +char* smb_io_clnt_srv(BOOL io, DOM_CLNT_SRV *log, char *q, char *base, int align, int depth); char* smb_io_log_info(BOOL io, DOM_LOG_INFO *log, char *q, char *base, int align, int depth); char* smb_io_chal(BOOL io, DOM_CHAL *chal, char *q, char *base, int align, int depth); char* smb_io_cred(BOOL io, DOM_CRED *cred, char *q, char *base, int align, int depth); +char* smb_io_clnt_info2(BOOL io, DOM_CLNT_INFO2 *clnt, char *q, char *base, int align, int depth); char* smb_io_clnt_info(BOOL io, DOM_CLNT_INFO *clnt, char *q, char *base, int align, int depth); char* smb_io_logon_id(BOOL io, DOM_LOGON_ID *log, char *q, char *base, int align, int depth); char* smb_io_arc4_owf(BOOL io, ARC4_OWF *hash, char *q, char *base, int align, int depth); diff --git a/source3/include/smb.h b/source3/include/smb.h index c733f29521..03cdc78e03 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -383,6 +383,16 @@ typedef struct domrid2_info } DOM_RID2; +/* DOM_CLNT_SRV - client / server names */ +typedef struct clnt_srv_info +{ + uint32 undoc_buffer; /* undocumented 32 bit buffer pointer */ + UNISTR2 uni_logon_srv; /* logon server name */ + uint32 undoc_buffer2; /* undocumented 32 bit buffer pointer */ + UNISTR2 uni_comp_name; /* client machine name */ + +} DOM_CLNT_SRV; + /* DOM_LOG_INFO - login info */ typedef struct log_info { @@ -417,6 +427,14 @@ typedef struct clnt_info } DOM_CLNT_INFO; +/* DOM_CLNT_INFO2 - client info */ +typedef struct clnt_info2 +{ + DOM_CLNT_SRV login; + DOM_CRED cred; + +} DOM_CLNT_INFO2; + /* DOM_LOGON_ID - logon id */ typedef struct logon_info { @@ -452,10 +470,10 @@ typedef struct id_info_1 /* SAM_INFO - sam logon/off id structure */ typedef struct sam_info { - DOM_CLNT_INFO client; - DOM_CRED rtn_cred; /* return credentials */ - uint16 logon_level; - uint32 auth_level; /* undocumented */ + DOM_CLNT_INFO2 client; + DOM_CRED rtn_cred; /* return credentials */ + uint16 logon_level; + uint32 auth_level; /* undocumented */ union { -- cgit From 359d42c08d012b3e1c1bc6ac1071f8add706ba35 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 15 Oct 1997 21:53:59 +0000 Subject: ipc.c: Adding Andrews become_root code to the main branch. locking.c: Adding Andrews become_root code to the main branch. pipes.c: Fixing the close_file issue. proto.h: The usual. reply.c: Move smb_pass into NTDOMAIN defined code. Fixing the close_file issue. server.c: Fixing the close_file issue. trans2.c: Fixing the close_file issue. uid.c: Adding Andrews become_root code to the main branch. Jeremy (jallison@whistle.com) (This used to be commit 16fd4337f79ce33f91050c96c4a566221c5d9126) --- source3/include/proto.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 70a9873d34..85ef094340 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -776,7 +776,7 @@ int disk_free(char *path,int *bsize,int *dfree,int *dsize); int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); BOOL check_name(char *name,int cnum); void sync_file(int fnum); -void close_file(int fnum); +void close_file(int fnum, BOOL normal_close); BOOL check_file_sharing(int cnum,char *fname); int check_share_mode( min_share_mode_entry *share, int deny_mode, char *fname, BOOL fcbopen, int *flags); @@ -957,6 +957,8 @@ BOOL become_guest(void); BOOL become_user(int cnum, uint16 vuid); BOOL unbecome_user(void ); int smbrun(char *cmd,char *outfile,BOOL shared); +void become_root(BOOL save_dir) ; +void unbecome_root(BOOL restore_dir); /*The following definitions come from username.c */ -- cgit From eb7f4cb0e24f48bd4a093846ad228f2534a44410 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 16 Oct 1997 16:01:25 +0000 Subject: smb.h : id_info_1 has a pointer at the front of it. so does return credentials, and so does the client credentials. these are all from the sam logon. auth_level is 16 bytes not 32 and is actually called a switch_level. smbparse.c : smb_io_unihdr() - uni_max_len and uni_str_len are 16 bytes not 32. this may have a knock-on effect on smb_in_unihdr2() but we'll see... (This used to be commit ce36bfb3e4ad4b72a9f9759a3c49d2a73175d249) --- source3/include/smb.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 03cdc78e03..e4c2823a19 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -431,6 +431,7 @@ typedef struct clnt_info typedef struct clnt_info2 { DOM_CLNT_SRV login; + uint32 ptr_cred; DOM_CRED cred; } DOM_CLNT_INFO2; @@ -454,8 +455,9 @@ typedef struct arc4_owf_info /* DOM_ID_INFO_1 */ typedef struct id_info_1 { + uint32 ptr_id_info1; /* pointer to id_info_1 */ UNIHDR hdr_domain_name; /* domain name unicode header */ - uint32 param; /* param control */ + uint32 param_ctrl; /* param control */ DOM_LOGON_ID logon_id; /* logon ID */ UNIHDR hdr_user_name; /* user name unicode header */ UNIHDR hdr_workgroup_name; /* workgroup name unicode header */ @@ -471,9 +473,10 @@ typedef struct id_info_1 typedef struct sam_info { DOM_CLNT_INFO2 client; + uint32 ptr_rtn_cred; /* pointer to return credentials */ DOM_CRED rtn_cred; /* return credentials */ uint16 logon_level; - uint32 auth_level; /* undocumented */ + uint16 switch_value; union { -- cgit From f3c37f925ee06bbc76a89035b28dae0cf8c38088 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 17 Oct 1997 13:43:01 +0000 Subject: smbparse.c smb.h : uni_max_len and uni_str_len are the other way round, in UNIHDR. util.c : increased the show_msg() data size from 256 bytes to 512 bytes: the LSA SAM Logon response can be about 500 bytes long. pipenetlog.c : forgot to set the authoritative field to 1. (This used to be commit 71c6678cd7ffe30a5da27766cf99147e1921feae) --- source3/include/smb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index e4c2823a19..80b2f28f4a 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -772,7 +772,7 @@ typedef struct lsa_q_user_info UNIHDR hdr_logon_dom; /* logon domain unicode string header */ uint32 buffer_dom_id; /* undocumented logon domain id pointer */ - char padding[40]; /* unused padding bytes? */ + char padding[40]; /* unused padding bytes. expansion room */ uint32 num_other_sids; /* 0 - num_sids */ uint32 buffer_other_sids; /* NULL - undocumented pointer to SIDs. */ -- cgit From 9e4626593f59ba4f5a678fc6d8d6e239cdff9c39 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 17 Oct 1997 16:46:56 +0000 Subject: pipenetlog.c lsaparse.c smb.h : SAM logon sorting. too many buffer pointers. added in the missing switch value (value of 3). dealing with the buffer pointers to the user info structure in a slightly different way. (This used to be commit 7993e17c9a1edddae6407d3f12790c461def705a) --- source3/include/smb.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 80b2f28f4a..11ec6940a6 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -741,7 +741,7 @@ typedef struct lsa_r_srv_pwset_info /* LSA_USER_INFO */ typedef struct lsa_q_user_info { - uint32 undoc_buffer; + uint32 ptr_user_info; NTTIME logon_time; /* logon time */ NTTIME logoff_time; /* logoff time */ @@ -809,7 +809,7 @@ typedef struct lsa_r_sam_logon_info uint32 buffer_creds; /* undocumented buffer pointer */ DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */ - uint32 buffer_user; + uint16 switch_value; /* 3 - indicates type of USER INFO */ LSA_USER_INFO *user; uint32 auth_resp; /* 1 - Authoritative response; 0 - Non-Auth? */ -- cgit From 10087a663bfda233d3e18137f469f0cc7e769a0a Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Fri, 17 Oct 1997 21:06:20 +0000 Subject: Simply moved the #include for ubi_dLinkList.h from within dir.c to includes.h. More consistent with current practice. (This used to be commit cb51c860b352fb9d07fb3298d0317274ba6c9925) --- source3/include/includes.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index a877f1ffb3..ce02b8a02a 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -117,6 +117,7 @@ by the previous section */ #include "local.h" +#include "ubi_dLinkList.h" #include #ifdef POSIX_STDLIBH #include -- cgit From c336a2f08183f63031b0a08b2111669bc36a5f30 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 17 Oct 1997 23:08:07 +0000 Subject: .cvsignore: Added make_smbcodepage interface.c: Added is_local_net(). locking.c: Added Fix for zero length share files from Gerald Werner plus a race condition fix for the fix. nameannounce.c: Made function static. namedbresp.c: extern int ClientDGRAM removed - not used. namedbserver.c: extern int ClientDGRAM removed - not used. namedbsubnet.c: Added code to make sockets per subnet. namepacket.c: Added code to read from all sockets & filter. nameresp.c: extern int ClientDGRAM removed - not used. nameserv.c: Indentation tidyup :-). nameserv.h: Added sockets to struct subnet. nameservresp.c: Improved debug message. nmbd.c: Changed to terminte on listen_for_packets exiting. nmbsync.c: extern int ClientDGRAM & ClientNMB removed - not used. proto.h: The usual. util.c: Fixed debug message. Jeremy (jallison@whistle.com) (This used to be commit 6904c2de080b2a9702800e9e4126386ced20569d) --- source3/include/nameserv.h | 2 ++ source3/include/proto.h | 17 ++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 81487e9ce9..ecd19b9563 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -291,6 +291,8 @@ struct subnet_record struct in_addr bcast_ip; struct in_addr mask_ip; struct in_addr myip; + int nmb_sock; /* socket to listen for unicast 137. */ + int dgram_sock; /* socket to listen for unicast 138. */ }; /* a resource record */ diff --git a/source3/include/proto.h b/source3/include/proto.h index 85ef094340..fa689d1c90 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -93,9 +93,9 @@ void CloseDir(void *p); char *ReadDirName(void *p); BOOL SeekDir(void *p,int pos); int TellDir(void *p); -void DirCacheAdd(char *path,char *name,char *dname,int snum); -char *DirCacheCheck(char *path,char *name,int snum); -void DirCacheFlush(int snum); +void DirCacheAdd( char *path, char *name, char *dname, int snum ); +char *DirCacheCheck( char *path, char *name, int snum ); +void DirCacheFlush( int snum ); /*The following definitions come from fault.c */ @@ -111,6 +111,7 @@ void load_interfaces(void); void iface_set_default(char *ip,char *bcast,char *nmask); BOOL ismyip(struct in_addr ip); BOOL ismybcast(struct in_addr bcast); +BOOL is_local_net(struct in_addr from); int iface_count(void); struct in_addr *iface_n_ip(int n); struct in_addr *iface_bcast(struct in_addr ip); @@ -372,11 +373,6 @@ void sync_server(enum state_type state, char *serv_name, char *work_name, int name_type, struct subnet_record *d, struct in_addr ip); -void do_announce_host(int command, - char *from_name, int from_type, struct in_addr from_ip, - char *to_name , int to_type , struct in_addr to_ip, - time_t announce_interval, - char *server_name, int server_type, char *server_comment); void announce_my_servers_removed(void); void announce_server(struct subnet_record *d, struct work_record *work, char *name, char *comment, time_t ttl, int server_type); @@ -503,7 +499,7 @@ void reply_netbios_packet(struct packet_struct *p1,int trn_id, char *data,int len); void queue_packet(struct packet_struct *packet); void run_packet_queue(); -void listen_for_packets(BOOL run_election); +BOOL listen_for_packets(BOOL run_election); BOOL send_mailslot_reply(BOOL unique, char *mailslot,int fd,char *buf,int len,char *srcname, char *dstname,int src_type,int dest_type, struct in_addr dest_ip,struct in_addr src_ip); @@ -946,6 +942,9 @@ int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize); int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize); int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize); +/*The following definitions come from ubi_dLinkList.c */ + + /*The following definitions come from ufc.c */ char *ufc_crypt(char *key,char *salt); -- cgit From 07c507728b6d3f5521e74aa14aedd5b37dea8c57 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 18 Oct 1997 00:22:04 +0000 Subject: After talking with Andrew added "interfaces only" parameter that turns off the filtering on the broadcast socket by default. Jeremy (jallison@whistle.com) (This used to be commit db9aad07481f48c0fe2108d4ab0b2bc9b632816c) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index fa689d1c90..e0ddee8943 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -185,6 +185,7 @@ BOOL lp_browse_list(void); BOOL lp_unix_realname(void); BOOL lp_nis_home_map(void); BOOL lp_time_server(void); +BOOL lp_interfaces_only(void); int lp_os_level(void); int lp_max_ttl(void); int lp_max_log_size(void); -- cgit From b0c148793b8ac4b62e9a66ce7e269ab50b90bf8d Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sun, 19 Oct 1997 14:36:27 +0000 Subject: added the following structures: SH_INFO_1 SH_INFO_1_STR SHARE_INFO_1_CTR SRV_Q_NET_SHARE_ENUM SRV_R_NET_SHARE_ENUM the share info1 container can handle a maximum of 32 shares. the share info1 string structures contain two unicode strings, with 1024 uint16 characters _each_. we're going to _have_ to dynamically allocate the unicode strings, else we'll run out of stack space. rapidly. (This used to be commit e8bedb18bf249d2f06834b0f151ea22df86e2602) --- source3/include/smb.h | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 11ec6940a6..facb059f36 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -836,6 +836,72 @@ typedef struct lsa_r_sam_logoff_info } LSA_R_SAM_LOGOFF; + +/* SH_INFO_1 (pointers to level 1 share info strings) */ +typedef struct ptr_share_info1 +{ + uint32 ptr_shi1_netname; /* pointer to net name. */ + uint32 shi1_type; /* type of share. 0 - undocumented. */ + uint32 ptr_shi1_remark; /* pointer to comment. */ + +} SH_INFO_1; + +/* SH_INFO_1_STR (level 1 share info strings) */ +typedef struct str_share_info1 +{ + UNISTR2 uni_shi1_netname; /* unicode string of net name */ + UNISTR2 uni_shi1_remark; /* unicode string of comment. */ + +} SH_INFO_1_STR; + +/* oops - this is going to take up a *massive* amount of stack. */ +/* the UNISTR2s already have 1024 uint16 chars in them... */ +#define MAX_SHARE_ENTRIES 32 + +/* SHARE_INFO_1_CONTAINER */ +typedef struct share_info_ctr +{ + uint32 num_entries_read; /* EntriesRead */ + uint32 ptr_share_info; /* Buffer */ + SH_INFO_1 info_1 [MAX_SHARE_ENTRIES]; /* share entry pointers */ + SH_INFO_1_STR info_1_str[MAX_SHARE_ENTRIES]; /* share entry strings */ + uint32 num_entries_read2; /* EntriesRead2 */ + +} SHARE_INFO_1_CTR; + + +/* SRV_Q_NET_SHARE_ENUM */ +typedef struct q_net_share_enum_info +{ + uint32 ptr_srv_name; /* pointer (to server name?) */ + UNISTR2 uni_srv_name; /* server name */ + + uint32 share_level; /* share level */ + uint32 switch_value; /* switch value */ + + uint32* ptr_share_info; /* pointer to SHARE_INFO_1_CTR */ + SHARE_INFO_1_CTR share_info; /* share info with 0 entries */ + + uint32 preferred_len; /* preferred maximum length (0xffff ffff) */ + +} SRV_Q_NET_SHARE_ENUM; + + +/* SRV_R_NET_SHARE_ENUM */ +typedef struct r_net_share_enum_info +{ + uint32 share_level; /* share level */ + uint32 switch_value; /* switch value */ + + uint32* ptr_share_info; /* pointer to SHARE_INFO_1_CTR */ + SHARE_INFO_1_CTR share_info; /* share info with 0 entries */ + + uint32 status; /* return status */ + +} SRV_R_NET_SHARE_ENUM; + + + /* Yet to be turned into structures: @@ -931,6 +997,7 @@ typedef struct time_t atime; time_t ctime; pstring name; + } file_info; -- cgit From 54ffd7f5c9251382874d9c47611d5c666f782f6b Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sun, 19 Oct 1997 15:33:25 +0000 Subject: Makefile : added srvparse.o and pipesrvsvc.o smb.h : mods to the Net Share Enum stuff srvparse.c : Net Share Enum parsing support. more srvsvc pipe parsing to go here... pipenetlog.c util.c: modified standard_sub_basic() so that you can set a global boolean and use a different string for the %U username substitution. proto.h: the usual. (This used to be commit 22b86b6499b2680d16cb4180a736b4e750147409) --- source3/include/proto.h | 9 +++++++++ source3/include/smb.h | 28 +++++++++++++++++++--------- 2 files changed, 28 insertions(+), 9 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index e0ddee8943..aee8a86d05 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -651,6 +651,9 @@ BOOL api_LsarpcTNP(int cnum,int uid, char *param,char *data, int mdrcnt,int mprcnt, char **rdata,char **rparam, int *rdata_len,int *rparam_len); + +/*The following definitions come from pipesrvsvc.c */ + BOOL api_srvsvcTNP(int cnum,int uid, char *param,char *data, int mdrcnt,int mprcnt, char **rdata,char **rparam, @@ -884,6 +887,12 @@ struct smb_passwd *get_smbpwnam(char *name); /*The following definitions come from smbrun.c */ +/*The following definitions come from srvparse.c */ + +char* srv_io_q_net_share_enum(BOOL io, SRV_Q_NET_SHARE_ENUM *q_n, char *q, char *base, int align, int depth); +char* srv_io_r_net_share_enum(BOOL io, SRV_R_NET_SHARE_ENUM *r_n, char *q, char *base, int align, int depth); +char* srv_io_q_net_share_enum(BOOL io, SRV_Q_NET_SHARE_ENUM *q_n, char *q, char *base, int align, int depth); + /*The following definitions come from status.c */ void Ucrit_addUsername(pstring username); diff --git a/source3/include/smb.h b/source3/include/smb.h index facb059f36..d847c6f342 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -565,6 +565,7 @@ typedef struct lsa_r_query_info { DOM_QUERY_3 id3; DOM_QUERY_5 id5; + } dom; uint32 status; /* return code */ @@ -840,17 +841,17 @@ typedef struct lsa_r_sam_logoff_info /* SH_INFO_1 (pointers to level 1 share info strings) */ typedef struct ptr_share_info1 { - uint32 ptr_shi1_netname; /* pointer to net name. */ - uint32 shi1_type; /* type of share. 0 - undocumented. */ - uint32 ptr_shi1_remark; /* pointer to comment. */ + uint32 ptr_netname; /* pointer to net name. */ + uint32 type; /* type of share. 0 - undocumented. */ + uint32 ptr_remark; /* pointer to comment. */ } SH_INFO_1; /* SH_INFO_1_STR (level 1 share info strings) */ typedef struct str_share_info1 { - UNISTR2 uni_shi1_netname; /* unicode string of net name */ - UNISTR2 uni_shi1_remark; /* unicode string of comment. */ + UNISTR2 uni_netname; /* unicode string of net name */ + UNISTR2 uni_remark; /* unicode string of comment. */ } SH_INFO_1_STR; @@ -879,8 +880,13 @@ typedef struct q_net_share_enum_info uint32 share_level; /* share level */ uint32 switch_value; /* switch value */ - uint32* ptr_share_info; /* pointer to SHARE_INFO_1_CTR */ - SHARE_INFO_1_CTR share_info; /* share info with 0 entries */ + uint32 ptr_share_info; /* pointer to SHARE_INFO_1_CTR */ + + union + { + SHARE_INFO_1_CTR info1; /* share info with 0 entries */ + + } share; uint32 preferred_len; /* preferred maximum length (0xffff ffff) */ @@ -893,8 +899,12 @@ typedef struct r_net_share_enum_info uint32 share_level; /* share level */ uint32 switch_value; /* switch value */ - uint32* ptr_share_info; /* pointer to SHARE_INFO_1_CTR */ - SHARE_INFO_1_CTR share_info; /* share info with 0 entries */ + uint32 ptr_share_info; /* pointer to SHARE_INFO_1_CTR */ + union + { + SHARE_INFO_1_CTR info1; /* share info container */ + + } share; uint32 status; /* return status */ -- cgit From 7aa5495c18f21eaa1397e8b0751b71810ccf38b7 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sun, 19 Oct 1997 17:01:06 +0000 Subject: creating NetShareEnum parsing / reply creation. compiles, but untested. (This used to be commit 0a191ee5047b2c81c7adb0554c39ec43d8690230) --- source3/include/smb.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index d847c6f342..7fa19eaa19 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -156,10 +156,11 @@ implemented */ #define DENY_FCB 7 /* share types */ -#define STYPE_DISKTREE 0 /* Disk drive */ -#define STYPE_PRINTQ 1 /* Spooler queue */ -#define STYPE_DEVICE 2 /* Serial device */ -#define STYPE_IPC 3 /* Interprocess communication (IPC) */ +#define STYPE_DISKTREE 0 /* Disk drive */ +#define STYPE_PRINTQ 1 /* Spooler queue */ +#define STYPE_DEVICE 2 /* Serial device */ +#define STYPE_IPC 3 /* Interprocess communication (IPC) */ +#define STYPE_HIDDEN 0x80000000 /* share is a hidden one (ends with $) */ /* SMB X/Open error codes for the ERRdos error class */ #define ERRbadfunc 1 /* Invalid function (or system call) */ -- cgit From 0c1d45dfa4d2bd780a4d5c8f2b804018c8b4939b Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sun, 19 Oct 1997 17:54:13 +0000 Subject: debugging the srvsvc Net Share Enum. some padding issues; some string length issues. it works! (This used to be commit 80523a3e83191c9e0b930fc71bd502a94a6f1b19) --- source3/include/smb.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 7fa19eaa19..0d10bd5895 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -865,9 +865,11 @@ typedef struct share_info_ctr { uint32 num_entries_read; /* EntriesRead */ uint32 ptr_share_info; /* Buffer */ + uint32 num_entries_read2; /* EntriesRead */ SH_INFO_1 info_1 [MAX_SHARE_ENTRIES]; /* share entry pointers */ SH_INFO_1_STR info_1_str[MAX_SHARE_ENTRIES]; /* share entry strings */ - uint32 num_entries_read2; /* EntriesRead2 */ + uint32 num_entries_read3; /* EntriesRead2 */ + uint32 padding; /* padding */ } SHARE_INFO_1_CTR; -- cgit From 62b73f0913894ce7cf6e327cb9928a283f305403 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 20 Oct 1997 01:00:08 +0000 Subject: move calls to smbhash() inside smbdes.c (for legal reasons) (This used to be commit 9dfab27da3634539e99eb48c85dd5a64212e7005) --- source3/include/proto.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index aee8a86d05..29252f16e3 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -834,9 +834,10 @@ BOOL smb_shm_get_usage(int *bytes_free, /*The following definitions come from smbdes.c */ void str_to_key(unsigned char *str,unsigned char *key); -void smbhash(unsigned char *out, unsigned char *in, unsigned char *key); void E_P16(unsigned char *p14,unsigned char *p16); void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24); +void cred_hash1(char *out, char *in, char *key); +void cred_hash2(char *out, char *in, char *key); /*The following definitions come from smbencrypt.c */ @@ -889,9 +890,11 @@ struct smb_passwd *get_smbpwnam(char *name); /*The following definitions come from srvparse.c */ +char* srv_io_share_info1_str(BOOL io, SH_INFO_1_STR *sh1, char *q, char *base, int align, int depth); +char* srv_io_share_info1(BOOL io, SH_INFO_1 *sh1, char *q, char *base, int align, int depth); +char* srv_io_share_1_ctr(BOOL io, SHARE_INFO_1_CTR *ctr, char *q, char *base, int align, int depth); char* srv_io_q_net_share_enum(BOOL io, SRV_Q_NET_SHARE_ENUM *q_n, char *q, char *base, int align, int depth); char* srv_io_r_net_share_enum(BOOL io, SRV_R_NET_SHARE_ENUM *r_n, char *q, char *base, int align, int depth); -char* srv_io_q_net_share_enum(BOOL io, SRV_Q_NET_SHARE_ENUM *q_n, char *q, char *base, int align, int depth); /*The following definitions come from status.c */ -- cgit From f4b4b3e6e35916dc5e280542f5f914e40b25dd21 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 20 Oct 1997 02:50:12 +0000 Subject: casting cleanups (This used to be commit ab849a97821c9e1f199eea8ea2ec477687bed947) --- source3/include/proto.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 29252f16e3..224aaa5a79 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -833,11 +833,10 @@ BOOL smb_shm_get_usage(int *bytes_free, /*The following definitions come from smbdes.c */ -void str_to_key(unsigned char *str,unsigned char *key); void E_P16(unsigned char *p14,unsigned char *p16); void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24); -void cred_hash1(char *out, char *in, char *key); -void cred_hash2(char *out, char *in, char *key); +void cred_hash1(unsigned char *out,unsigned char *in,unsigned char *key); +void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key); /*The following definitions come from smbencrypt.c */ @@ -1115,5 +1114,5 @@ void pstrcpy(char *dest, char *src); char *align4(char *q, char *base); char *align2(char *q, char *base); char *align_offset(char *q, char *base, int align_offset_len); -void dump_data(int level,unsigned char *buf,int len); +void dump_data(int level,char *buf1,int len); char *tab_depth(int depth); -- cgit From 3e670e4057321911c6674b8abe3c0bdcd684fd09 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 20 Oct 1997 08:46:00 +0000 Subject: a major share modes reorganisation. The shares modes code is now split into separate files. The shared memory implementation is in locking_shm.c. The slow implementation is in locking_slow.c It is all controlled by a struct share_ops structure that has function pointers to the implementation of all the functions needed by a share modes implementation. An initialisation function sets up this structure. This will make adding new implementations easy and clean. This also allowed me to get rid of the ugly code in smbstatus. Now status.c links to the locking code and calls methods in share_ops. I also renamed some things and generally organised things in a much cleaner fashion. Defines and structures specific to each implementation have been moved to the appropriate file and out of smb.h. (This used to be commit 65ab9adaa0d356b8041ed8a507ea52117f2a284e) --- source3/include/proto.h | 39 +++++++++++++++------------- source3/include/smb.h | 69 +++++++++++-------------------------------------- 2 files changed, 36 insertions(+), 72 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 224aaa5a79..024917a0d8 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -305,22 +305,25 @@ int lp_minor_announce_version(void); BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset); BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); -BOOL start_share_mode_mgmt(void); -BOOL stop_share_mode_mgmt(void); -BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *ptok); -BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token token); -int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, - min_share_mode_entry **old_shares); -void del_share_mode(share_lock_token token, int fnum); -BOOL set_share_mode(share_lock_token token, int fnum, uint16 port, uint16 op_type); -BOOL remove_share_oplock(int fnum, share_lock_token token); -BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *ptok); -BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token token); -int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode, - min_share_mode_entry **old_shares); -void del_share_mode(share_lock_token token, int fnum); -BOOL set_share_mode(share_lock_token token,int fnum, uint16 port, uint16 op_type); -BOOL remove_share_oplock(int fnum, share_lock_token token); +BOOL locking_init(void); +BOOL locking_end(void); +BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, int *ptok); +BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, int token); +int get_share_modes(int cnum, int token, uint32 dev, uint32 inode, + share_mode_entry **shares); +void del_share_mode(int token, int fnum); +BOOL set_share_mode(int token, int fnum, uint16 port, uint16 op_type); +BOOL remove_share_oplock(int fnum, int token); +int share_mode_forall(void (*fn)(share_mode_entry *, char *)); +void share_status(FILE *f); + +/*The following definitions come from locking_shm.c */ + +struct share_ops *locking_shm_init(void); + +/*The following definitions come from locking_slow.c */ + +struct share_ops *locking_slow_init(void); /*The following definitions come from lsaparse.c */ @@ -778,7 +781,7 @@ BOOL check_name(char *name,int cnum); void sync_file(int fnum); void close_file(int fnum, BOOL normal_close); BOOL check_file_sharing(int cnum,char *fname); -int check_share_mode( min_share_mode_entry *share, int deny_mode, char *fname, +int check_share_mode( share_mode_entry *share, int deny_mode, char *fname, BOOL fcbopen, int *flags); void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun, int mode,int oplock_request, int *Access,int *action); @@ -791,7 +794,7 @@ int cached_error_packet(char *inbuf,char *outbuf,int fnum,int line); int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line); int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int line); BOOL oplock_break(uint32 dev, uint32 inode, struct timeval *tval); -BOOL request_oplock_break(min_share_mode_entry *share_entry, +BOOL request_oplock_break(share_mode_entry *share_entry, uint32 dev, uint32 inode); BOOL snum_used(int snum); BOOL reload_services(BOOL test); diff --git a/source3/include/smb.h b/source3/include/smb.h index 0d10bd5895..ff6cc7eb25 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1195,29 +1195,6 @@ struct interface struct in_addr nmask; }; -/* share mode record pointed to in shared memory hash bucket */ -typedef struct -{ - smb_shm_offset_t next_offset; /* offset of next record in chain from hash bucket */ - int locking_version; - int32 st_dev; - int32 st_ino; - int num_share_mode_entries; - smb_shm_offset_t share_mode_entries; /* Chain of share mode entries for this file */ - char file_name[1]; -} share_mode_record; - -/* share mode entry pointed to by share_mode_record struct */ -typedef struct -{ - smb_shm_offset_t next_share_mode_entry; - int pid; - uint16 op_port; - uint16 op_type; - int share_mode; - struct timeval time; -} share_mode_entry; - /* struct returned by get_share_modes */ typedef struct { @@ -1226,14 +1203,26 @@ typedef struct uint16 op_type; int share_mode; struct timeval time; -} min_share_mode_entry; +} share_mode_entry; -/* Token returned by lock_share_entry (actually ignored by FAST_SHARE_MODES code) */ -typedef int share_lock_token; /* Conversion to hash entry index from device and inode numbers. */ #define HASH_ENTRY(dev,ino) ((( (uint32)(dev) )* ( (uint32)(ino) )) % lp_shmem_hash_size()) +/* each implementation of the share mode code needs + to support the following operations */ +struct share_ops { + BOOL (*stop_mgmt)(void); + BOOL (*lock_entry)(int , uint32 , uint32 , int *); + BOOL (*unlock_entry)(int , uint32 , uint32 , int ); + BOOL (*get_entries)(int , int , uint32 , uint32 , share_mode_entry **); + void (*del_entry)(int , int ); + BOOL (*set_entry)(int , int , uint16 , uint16 ); + BOOL (*remove_oplock)(int , int); + int (*forall)(void (*)(share_mode_entry *, char *)); + void (*status)(FILE *); +}; + /* this is used for smbstatus */ struct connect_record { @@ -1252,34 +1241,6 @@ struct connect_record #define LOCKING_VERSION 4 #endif /* LOCKING_VERSION */ -#if !defined(FAST_SHARE_MODES) -/* - * Defines for slow share modes. - */ - -/* - * Locking file header lengths & offsets. - */ -#define SMF_VERSION_OFFSET 0 -#define SMF_NUM_ENTRIES_OFFSET 4 -#define SMF_FILENAME_LEN_OFFSET 8 -#define SMF_HEADER_LENGTH 10 - -#define SMF_ENTRY_LENGTH 20 - -/* - * Share mode record offsets. - */ - -#define SME_SEC_OFFSET 0 -#define SME_USEC_OFFSET 4 -#define SME_SHAREMODE_OFFSET 8 -#define SME_PID_OFFSET 12 -#define SME_PORT_OFFSET 16 -#define SME_OPLOCK_TYPE_OFFSET 18 - -#endif /* FAST_SHARE_MODES */ - /* these are useful macros for checking validity of handles */ #define VALID_FNUM(fnum) (((fnum) >= 0) && ((fnum) < MAX_OPEN_FILES)) #define OPEN_FNUM(fnum) (VALID_FNUM(fnum) && Files[fnum].open) -- cgit From 423a7c417136af3f6d09b3c1763336dd0a401d4f Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 20 Oct 1997 12:10:58 +0000 Subject: util.c password.c : added automount_server() function which, if -DAUTOMOUNT is in use, returns the server name of the NIS auto.map entry. otherwise, it returns local_server. added use of automount_server() for a new substitution %N for NIS home server. this defaults, via automount_server(), to the same functionality as %L if -DAUTOMOUNT is not used. removed vuser->home_share. moved code that grabbed the servername into the separate function automount_server(). loadparm.c : created "logon drive" (default of "") created "logon home" (default of "\\%N\%U") changed default of "logon path" from NULL to "\\%N\%U\profile". ipc.c pipenetlog.c : use lp_logon_drive(), lp_logon_home() and lp_logon_path() in their now easier-to-use form (don't have to check if *lp_logon_path() and manually substitute a default of \\%L\%U and do a standard_sub_basic() on the result, because the default automatically does this. (This used to be commit c6c28a4c3c9010ff9d5eac4bad091189a786d5a0) --- source3/include/proto.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 024917a0d8..e12ea4002d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -155,6 +155,8 @@ char *lp_username_map(void); char *lp_character_set(void); char *lp_logon_script(void); char *lp_logon_path(void); +char *lp_logon_drive(void); +char *lp_logon_home(void); char *lp_remote_announce(void); char *lp_wins_server(void); char *lp_interfaces(void); @@ -1088,6 +1090,7 @@ BOOL zero_ip(struct in_addr ip); void reset_globals_after_fork(); char *client_name(void); char *client_addr(void); +char *automount_server(char *username); void standard_sub_basic(char *str); BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask); int PutUniCode(char *dst,char *src); -- cgit From dc9999ebd0ac568ee8a175cb6ece069603115bd2 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 20 Oct 1997 12:13:04 +0000 Subject: removed home_share from user_info structure. (This used to be commit c59b8cee4721eeeb79f07f48ac17492530d4cdb1) --- source3/include/smb.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index ff6cc7eb25..2b0fc44d24 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1141,10 +1141,6 @@ typedef struct int *igroups; /* an integer version - some OSes are broken :-( */ int *attrs; /* attributes associated with each gid */ -#if (defined(NETGROUP) && defined(AUTOMOUNT)) - char *home_share; /* to store NIS home of a user - simeon */ -#endif - int n_sids; int *sids; -- cgit From 77a93855259fe29c8b37575aba5f07dbb70d3510 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 20 Oct 1997 16:25:19 +0000 Subject: added "domain groups" parameter, allowing you to specify the groups that the user belongs to. it would be nice to know exactly what the domain groups _are_.... (This used to be commit c6e37d8db0cd89a84a54a0cedfeacf50fb3f7a4c) --- source3/include/proto.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index e12ea4002d..97212ff74d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -165,6 +165,7 @@ char *lp_nis_home_map_name(void); char *lp_announce_version(void); char *lp_netbios_aliases(void); char *lp_domainsid(void); +char *lp_domain_groups(void); BOOL lp_dns_proxy(void); BOOL lp_wins_support(void); BOOL lp_wins_proxy(void); @@ -1090,7 +1091,7 @@ BOOL zero_ip(struct in_addr ip); void reset_globals_after_fork(); char *client_name(void); char *client_addr(void); -char *automount_server(char *username); +char *automount_server(char *user_name); void standard_sub_basic(char *str); BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask); int PutUniCode(char *dst,char *src); @@ -1122,3 +1123,4 @@ char *align2(char *q, char *base); char *align_offset(char *q, char *base, int align_offset_len); void dump_data(int level,char *buf1,int len); char *tab_depth(int depth); +int make_domain_gids(char *gids_str, DOM_GID *gids); -- cgit From 79f4fb52c1ed56fd843f81b4eb0cdd2991d4d0f4 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 20 Oct 1997 18:52:04 +0000 Subject: loadparm.c: Changed 'interfaces only' parameter to 'bind interfaces only'. Added 'dos filetimes' parameter for UTIME fix. locking_shm.c: Fixed typo (sorry Andrew :-). namepacket.c: Changed lp_interfaces_only() to lp_bind_interfaces_only(). proto.h: The usual. reply.c: Made filetime calls use new file_utime call (wrapper for sys_utime). server.c: Made filetime calls use new file_utime call (wrapper for sys_utime). system.c: Added Andrew's sanity checks to times in sys_utime(). time.c: Moved set_filetime() to server.c. Made null_mtime() global. trans2.c: Made filetime calls use new file_utime call (wrapper for sys_utime). Jeremy (jallison@whistle.com) (This used to be commit 41a1d81c112a82ad2ae1b3c4ee81051f133ce1ed) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source3/include/proto.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 97212ff74d..8e81954313 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -188,7 +188,7 @@ BOOL lp_browse_list(void); BOOL lp_unix_realname(void); BOOL lp_nis_home_map(void); BOOL lp_time_server(void); -BOOL lp_interfaces_only(void); +BOOL lp_bind_interfaces_only(void); int lp_os_level(void); int lp_max_ttl(void); int lp_max_log_size(void); @@ -273,6 +273,7 @@ BOOL lp_map_system(int ); BOOL lp_delete_readonly(int ); BOOL lp_fake_oplocks(int ); BOOL lp_recursive_veto_delete(int ); +BOOL lp_dos_filetimes(int ); int lp_create_mode(int ); int lp_force_create_mode(int ); int lp_dir_mode(int ); @@ -777,6 +778,8 @@ void killkids(void); mode_t unix_mode(int cnum,int dosmode); int dos_mode(int cnum,char *path,struct stat *sbuf); int dos_chmod(int cnum,char *fname,int dosmode,struct stat *st); +int file_utime(int cnum, char *fname, struct utimbuf *times); +BOOL set_filetime(int cnum, char *fname, time_t mtime); BOOL unix_convert(char *name,int cnum,pstring saved_last_component, BOOL *bad_path); int disk_free(char *path,int *bsize,int *dfree,int *dsize); int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); @@ -944,13 +947,13 @@ int TimeDiff(time_t t); struct tm *LocalTime(time_t *t); time_t interpret_long_date(char *p); void put_long_date(char *p,time_t t); +BOOL null_mtime(time_t mtime); void put_dos_date(char *buf,int offset,time_t unixdate); void put_dos_date2(char *buf,int offset,time_t unixdate); void put_dos_date3(char *buf,int offset,time_t unixdate); time_t make_unix_date(void *date_ptr); time_t make_unix_date2(void *date_ptr); time_t make_unix_date3(void *date_ptr); -BOOL set_filetime(char *fname,time_t mtime); char *timestring(void ); /*The following definitions come from trans2.c */ -- cgit From ac219021786268533540009b8d8598f87568338f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 21 Oct 1997 09:11:19 +0000 Subject: get rid of the KEEP_PASSWORD_SERVER_OPEN define (This used to be commit ed484d4501e855f467ce2b3cfa63855acfe5e516) --- source3/include/local.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index 97857727c7..a218dd8fc6 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -147,10 +147,6 @@ /* shall we support browse requests via a FIFO to nmbd? */ #define ENABLE_FIFO 1 -/* keep the password server open, this uses up a aocket, but is needed - by many apps */ -#define KEEP_PASSWORD_SERVER_OPEN 1 - /* how long to wait for a socket connect to happen */ #define LONG_CONNECT_TIMEOUT 30 #define SHORT_CONNECT_TIMEOUT 5 -- cgit From 0891bb6a910841455162876be09a92107cd9df00 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 21 Oct 1997 09:34:33 +0000 Subject: rewrote the password server code using the new clientgen.c client interface The new code uses a source netbios name equal to the Samba servers name, not the client name. It also uses NetWkstaUserLogon to do a full network logon. This means it will honour the servers logon restrictions (such as login times etc). (This used to be commit 11de90f972f6d83974425e80014f54e15d495413) --- source3/include/smb.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 2b0fc44d24..7921e77108 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -989,6 +989,32 @@ struct smb_passwd }; +struct cli_state { + int fd; + int cnum; + int pid; + int mid; + int uid; + int protocol; + int sec_mode; + int error; + int privilages; + fstring eff_name; + fstring desthost; + char cryptkey[8]; + uint32 sesskey; + int serverzone; + uint32 servertime; + int readbraw_supported; + int writebraw_supported; + int timeout; + int max_xmit; + char *outbuf; + char *inbuf; + int bufsize; + int initialised; +}; + struct current_user { int cnum, id; -- cgit From c9ab32cebb6a788e96695ae63962ea9a812ae7c8 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 21 Oct 1997 09:39:45 +0000 Subject: prototype updates (This used to be commit 2b976cb7ecf50c118bd15923f6500bb8d2e058b7) --- source3/include/proto.h | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 8e81954313..5bd1745958 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -32,19 +32,31 @@ void cmd_help(void); BOOL reopen_connection(char *inbuf,char *outbuf); char *smb_errstr(char *inbuf); +/*The following definitions come from clientgen.c */ + +BOOL cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation); +BOOL cli_session_setup(struct cli_state *cli, + char *user, + char *pass, int passlen, + char *ntpass, int ntpasslen, + char *workgroup); +BOOL cli_send_tconX(struct cli_state *cli, + char *share, char *dev, char *pword, int passlen); +BOOL cli_tdis(struct cli_state *cli); +BOOL cli_negprot(struct cli_state *cli); +BOOL cli_session_request(struct cli_state *cli, char *host, int name_type, + char *myname); +BOOL cli_connect(struct cli_state *cli, char *host, struct in_addr *ip); +BOOL cli_initialise(struct cli_state *cli); +void cli_shutdown(struct cli_state *cli); + /*The following definitions come from clientutil.c */ -void cli_setup_pkt(char *outbuf); -BOOL cli_receive_trans_response(char *inbuf,int trans,int *data_len, - int *param_len, char **data,char **param); -BOOL cli_send_session_request(char *inbuf, char *outbuf); BOOL cli_send_login(char *inbuf, char *outbuf, BOOL start_session, BOOL use_setup); void cli_send_logout(void); BOOL cli_call_api(int prcnt,int drcnt,int mprcnt,int mdrcnt,int *rprcnt, - int *rdrcnt, char *param,char *data, char **rparam,char **rdata); -BOOL cli_send_trans_request(char *outbuf, int trans, char *name, int fid, int flags, - char *data,char *param,uint16 *setup, int ldata,int lparam, - int lsetup,int mdata,int mparam,int msetup); + int *rdrcnt, char *param,char *data, + char **rparam, char **rdata); BOOL cli_open_sockets(int port); BOOL cli_reopen_connection(char *inbuf,char *outbuf); char *smb_errstr(char *inbuf); @@ -624,8 +636,11 @@ BOOL user_ok(char *user,int snum); BOOL authorise_login(int snum,char *user,char *password, int pwlen, BOOL *guest,BOOL *force,uint16 vuid); BOOL check_hosts_equiv(char *user); -BOOL server_cryptkey(char *buf); -BOOL server_validate(char *buf); +struct cli_state *server_client(void); +struct cli_state *server_cryptkey(void); +BOOL server_validate(char *user, char *domain, + char *pass, int passlen, + char *ntpass, int ntpasslen); /*The following definitions come from pcap.c */ -- cgit From efe9b26a7b08cc9ea02cad32a847f71773a6edc4 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 21 Oct 1997 18:25:14 +0000 Subject: loadparm.c : added "domain admin users" parameter added "domain guest users" parameter these two complement the "domain groups" parameter. the "domain groups" parameter should be for your own groups, and well-known aliases. util.c : added ability to do "domain groups = power_users admin_users backup_ops" which are well-known RID aliases, not well-known RID groups. pipenetlog.c : combine the "domain admin users"; "domain guest users" and "domain groups" parameters to give an array of RID groups to include in the SAM Logon response. ipc.c smb.h : moved REALLOC() into smb.h added RID #defines. proto.h: usual. (This used to be commit f2554f231d1f59f30224adcc02b2b3ca4c24e0dd) --- source3/include/proto.h | 2 ++ source3/include/smb.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 5bd1745958..4613137d0d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -178,6 +178,8 @@ char *lp_announce_version(void); char *lp_netbios_aliases(void); char *lp_domainsid(void); char *lp_domain_groups(void); +char *lp_domain_admin_users(void); +char *lp_domain_guest_users(void); BOOL lp_dns_proxy(void); BOOL lp_wins_support(void); BOOL lp_wins_proxy(void); diff --git a/source3/include/smb.h b/source3/include/smb.h index 7921e77108..0965b6b90b 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -66,6 +66,8 @@ typedef int BOOL; typedef int smb_shm_offset_t; #define NULL_OFFSET (smb_shm_offset_t)(0) +/* limiting size of ipc replies */ +#define REALLOC(ptr,size) Realloc(ptr,MAX((size),4*1024)) /* Samba needs type definitions for int16, int32, uint16 and uint32. @@ -298,6 +300,32 @@ typedef fstring string; #define NETSERVERGETINFO 0x15 #define NETSHAREENUM 0x0f +/* well-known RIDs - Relative IDs */ + +/* RIDs - Well-known users ... */ +#define DOMAIN_USER_RID_ADMIN (0x000001F4L) +#define DOMAIN_USER_RID_GUEST (0x000001F5L) + +/* RIDs - well-known groups ... */ +#define DOMAIN_GROUP_RID_ADMINS (0x00000200L) +#define DOMAIN_GROUP_RID_USERS (0x00000201L) +#define DOMAIN_GROUP_RID_GUESTS (0x00000202L) + +/* RIDs - well-known aliases ... */ +#define DOMAIN_ALIAS_RID_ADMINS (0x00000220L) +#define DOMAIN_ALIAS_RID_USERS (0x00000221L) +#define DOMAIN_ALIAS_RID_GUESTS (0x00000222L) +#define DOMAIN_ALIAS_RID_POWER_USERS (0x00000223L) + +#define DOMAIN_ALIAS_RID_ACCOUNT_OPS (0x00000224L) +#define DOMAIN_ALIAS_RID_SYSTEM_OPS (0x00000225L) +#define DOMAIN_ALIAS_RID_PRINT_OPS (0x00000226L) +#define DOMAIN_ALIAS_RID_BACKUP_OPS (0x00000227L) + +#define DOMAIN_ALIAS_RID_REPLICATOR (0x00000228L) + + + /* 32 bit time (sec) since 01jan1970 - cifs6.txt, section 3.5, page 30 */ typedef struct time_info { -- cgit From 79b314447bdcda65cffdd3dd495932c417b545f7 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 21 Oct 1997 18:27:55 +0000 Subject: chgpasswd.c: includes.h: SCO changes. server.c: Added code in open_sockets to allow 'bind interfaces only' to work as documented. Jeremy (jallison@whistle.com) (This used to be commit 46ac5928d9069af1dc60e9724f38e228dd578937) --- source3/include/includes.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index ce02b8a02a..09c687aed5 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -676,6 +676,7 @@ char *mktemp(char *); /* No standard include */ #include #include #include +#include #include #include #include -- cgit From 7985bcfe0c65292eddfb7c9449101852ebfbe3d9 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 21 Oct 1997 19:55:34 +0000 Subject: WHATSNEW.txt: Preparing for 1.9.18alpha2 release. smb.conf.5: Added 'bind interfaces only' parameter. version.h: Updated to 1.9.18alpha2. Jeremy (jallison@whistle.com) (This used to be commit 7221e19d5ef4a242ce29d3148957c3e481456934) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 33c9d240ba..129c695d8b 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.18alpha1" +#define VERSION "1.9.18alpha2" -- cgit From 325738bd277648135815c99165fc8b72d1b1859c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 21 Oct 1997 22:51:21 +0000 Subject: WHATSNEW.txt: Updated for alpha3. server.c: int16 -> uint16 fix for port comparisons in oplock code. Needed for Solaris. version.h: Updated to alpha3. Jeremy (jallison@whistle.com) (This used to be commit 2d9645e99ba30a5cce4372ff80d1bd26c516ac34) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 129c695d8b..dae7bc7776 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.18alpha2" +#define VERSION "1.9.18alpha3" -- cgit From e5c319186d079eeef55a7ee62fac2a993e932938 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 22 Oct 1997 11:02:00 +0000 Subject: Implemented asynchronous DNS lookups in nmbd. I realised this afternoon just how easy it is to add this, so I thought I'd implement it while the idea was fresh. nmbd forks at startup and uses a pipe to talk to its child. The child does the DNS lookups and the file descriptor of the child is added to the main select loop. While I was doing this I discovered a bug in nmbd that explains why the dns proxy option has been so expensive. The DNS cache entries in the WINS list were never being checked, which means we always did a DNS lookup even if we have done it before and it is in cache. I'm sure this used to work (I tested the DNS cache when I added it) so someone broke it :-( Anyway, the async DNS gets rid of the problem completely. I'll commit just the fix to the DNS cache bug to the 1.9.17 tree. You can disable async DNS by adding -DSYNC_DNS to the compile flags. (This used to be commit 178e27de0791c1ff3268cb456ed5c5efc9ac2a01) --- source3/include/nameserv.h | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index ecd19b9563..5c8ec1e4eb 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -363,17 +363,18 @@ struct dgram_packet { list of nmb packets */ struct packet_struct { - struct packet_struct *next; - struct packet_struct *prev; - struct in_addr ip; - int port; - int fd; - time_t timestamp; - enum packet_type packet_type; - union { - struct nmb_packet nmb; - struct dgram_packet dgram; - } packet; + struct packet_struct *next; + struct packet_struct *prev; + BOOL locked; + struct in_addr ip; + int port; + int fd; + time_t timestamp; + enum packet_type packet_type; + union { + struct nmb_packet nmb; + struct dgram_packet dgram; + } packet; }; /* NETLOGON opcodes */ -- cgit From f20e6f6b261c3976b412845000b3f170f8ad6a9f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 22 Oct 1997 11:15:14 +0000 Subject: shared memory code cleanups (partly preparing for a possible sysV shared memory implementation) (This used to be commit 8d1993c71a5d5d32636f62ba9b9a9009ec74d730) --- source3/include/proto.h | 29 ++++++++++++++++++----------- source3/include/smb.h | 19 +++++++++++++++++-- 2 files changed, 35 insertions(+), 13 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 4613137d0d..149009685e 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6,6 +6,16 @@ BOOL check_access(int snum); BOOL allow_access(char *deny_list,char *allow_list,char *cname,char *caddr); +/*The following definitions come from asyncdns.c */ + +int asyncdns_fd(void); +void start_async_dns(void); +void run_dns_queue(void); +BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question, + struct name_record **n); +BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question, + struct name_record **n); + /*The following definitions come from charcnv.c */ char *unix2dos_format(char *str,BOOL overwrite); @@ -420,8 +430,8 @@ void remove_name(struct subnet_record *d, struct name_record *n); struct name_record *find_name(struct name_record *n, struct nmb_name *name, int search); struct name_record *find_name_search(struct subnet_record **d, - struct nmb_name *name, - int search, struct in_addr ip); + struct nmb_name *name, + int search, struct in_addr ip); void dump_names(void); void load_netbios_names(void); void remove_netbios_name(struct subnet_record *d, @@ -432,7 +442,6 @@ struct name_record *add_netbios_entry(struct subnet_record *d, int ttl, enum name_source source, struct in_addr ip, BOOL new_only,BOOL wins); void expire_names(time_t t); -struct name_record *dns_name_search(struct nmb_name *question, int Time); /*The following definitions come from namedbresp.c */ @@ -842,15 +851,13 @@ int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); /*The following definitions come from shmem.c */ -BOOL smb_shm_create_hash_table( unsigned int size ); -BOOL smb_shm_open( char *file_name, int size); +BOOL smb_shm_open(char *file_name, int size); BOOL smb_shm_close( void ); -smb_shm_offset_t smb_shm_alloc(int size); -BOOL smb_shm_free(smb_shm_offset_t offset); -smb_shm_offset_t smb_shm_get_userdef_off(void); -BOOL smb_shm_set_userdef_off(smb_shm_offset_t userdef_off); -void *smb_shm_offset2addr(smb_shm_offset_t offset); -smb_shm_offset_t smb_shm_addr2offset(void *addr); +int smb_shm_alloc(int size); +BOOL smb_shm_free(int offset); +int smb_shm_get_userdef_off(void); +void *smb_shm_offset2addr(int offset); +int smb_shm_addr2offset(void *addr); BOOL smb_shm_lock_hash_entry( unsigned int entry); BOOL smb_shm_unlock_hash_entry( unsigned int entry ); BOOL smb_shm_get_usage(int *bytes_free, diff --git a/source3/include/smb.h b/source3/include/smb.h index 0965b6b90b..c982e3e78d 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -63,8 +63,7 @@ typedef int BOOL; /* offset in shared memory */ -typedef int smb_shm_offset_t; -#define NULL_OFFSET (smb_shm_offset_t)(0) +#define NULL_OFFSET (int)(0) /* limiting size of ipc replies */ #define REALLOC(ptr,size) Realloc(ptr,MAX((size),4*1024)) @@ -1273,6 +1272,22 @@ struct share_ops { void (*status)(FILE *); }; +/* each implementation of the shared memory code needs + to support the following operations */ +struct shmem_ops { + BOOL (*open)(char *, int ); + BOOL (*close)( void ); + int (*alloc)(int ); + BOOL (*free)(int ); + int (*get_userdef_off)(void); + void *(*offset2addr)(int ); + int (*addr2offset)(void *addr); + BOOL (*lock_hash_entry)(unsigned int); + BOOL (*unlock_hash_entry)( unsigned int ); + BOOL (*get_usage)(int *,int *,int *); +}; + + /* this is used for smbstatus */ struct connect_record { -- cgit From 2e8cedba6480d0c1f89d3490888cadac769d09ca Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 22 Oct 1997 11:31:37 +0000 Subject: loadparm.c : added "domain other sids" parameter pipenetlog.c : using "domain other sids" parameter in SAM Logon response. using new name_to_rid() function for r_uid and r_gid. pipentlsa.c : minor mods to do with new name_to_rid() function. pipesrvsvc.c : in the "net share enum" response, allocate some more space for the buffer. there can be only 32 share entries in the response anyway. this needs to be dealt with. pipeutil.c : modified name_to_rid() function to use new parameters "domain admin users" and "domain guest users", but will otherwise do unix uid + 1000. moved make_dom_gids() here. proto.h: the usual. smb.h smbparse.c : renamed sid_no to sid_rev_num in DOM_SID, and gid to r_gid in DOM_GID. util.c : moved make_dom_gids() from here. created char *unistrn2(uint16* uni_buffer, int max_len) (This used to be commit ec60e48d7982240b7755d246b2f1e8989467f66f) --- source3/include/proto.h | 9 ++++++--- source3/include/smb.h | 8 ++++---- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 149009685e..6bab787be9 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -186,7 +186,8 @@ char *lp_socket_address(void); char *lp_nis_home_map_name(void); char *lp_announce_version(void); char *lp_netbios_aliases(void); -char *lp_domainsid(void); +char *lp_domain_sid(void); +char *lp_domain_other_sids(void); char *lp_domain_groups(void); char *lp_domain_admin_users(void); char *lp_domain_guest_users(void); @@ -696,9 +697,11 @@ BOOL api_srvsvcTNP(int cnum,int uid, char *param,char *data, void initrpcreply(char *inbuf, char *q); void endrpcreply(char *inbuf, char *q, int datalen, int rtnval, int *rlen); -uint32 name_to_rid(char *user_name); +BOOL name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); char *dom_sid_to_string(DOM_SID *sid); void make_dom_sid(DOM_SID *sid, char *domsid); +int make_dom_sids(char *sids_str, DOM_SID *sids, int max_sids); +int make_dom_gids(char *gids_str, DOM_GID *gids); void create_rpc_reply(RPC_HDR *hdr, uint32 call_id, int data_len); int make_rpc_reply(char *inbuf, char *q, int data_len); void make_uni_hdr(UNIHDR *hdr, int max_len, int len, uint16 terminate); @@ -1139,6 +1142,7 @@ BOOL is_myname(char *s); void set_remote_arch(enum remote_arch_types type); enum remote_arch_types get_remote_arch(); char *skip_unicode_string(char *buf,int n); +char *unistrn2(uint16 *buf, int len); char *unistr2(uint16 *buf); char *unistr(char *buf); int unistrncpy(char *dst, char *src, int len); @@ -1150,4 +1154,3 @@ char *align2(char *q, char *base); char *align_offset(char *q, char *base, int align_offset_len); void dump_data(int level,char *buf1,int len); char *tab_depth(int depth); -int make_domain_gids(char *gids_str, DOM_GID *gids); diff --git a/source3/include/smb.h b/source3/include/smb.h index c982e3e78d..913f5607b7 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -341,15 +341,15 @@ typedef struct nttime_info } NTTIME; -#define MAXSUBAUTHS 10 /* max sub authorities in a SID */ +#define MAXSUBAUTHS 15 /* max sub authorities in a SID */ /* DOM_SID - security id */ typedef struct sid_info { - uint8 sid_no; /* SID revision number */ + uint8 sid_rev_num; /* SID revision number */ uint8 num_auths; /* number of sub-authorities */ uint8 id_auth[6]; /* Identifier Authority */ - uint16 sub_auths[MAXSUBAUTHS]; /* pointer to sub-authorities. */ + uint16 sub_auths[MAXSUBAUTHS]; /* pointer to sub-authorities. */ } DOM_SID; @@ -517,7 +517,7 @@ typedef struct sam_info /* DOM_GID - group id + user attributes */ typedef struct gid_info { - uint32 gid; /* group id */ + uint32 g_rid; /* a group RID */ uint32 attr; } DOM_GID; -- cgit From 5897f0493d0665ae53ea181e122c467faa0c7642 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 22 Oct 1997 14:28:19 +0000 Subject: Makefile client.c clientutil.c clitar.c nmbsync.c : redid the split that i did a year ago, taking the functions in client.c out into clientutil.c. guess what? we could now do encrypted password NetServerEnum2 calls in nmbd, if we wanted to. i can now use cli_call_api() to send to different pipes. i hope. pipenetlog.c: allow adding to users group _and_ to admin group. if adding to guest group, don't allow adding to users or admin as well. smb.h : added some pipe #defines (\PIPE\NETLOGON \PIPE\srvsvc ...) proto.h : usual. (This used to be commit 6ee065ce6e099acfc7e83ad399ef6e60b4c625c1) --- source3/include/proto.h | 27 ++++++++++++++++++--------- source3/include/smb.h | 6 ++++++ 2 files changed, 24 insertions(+), 9 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 6bab787be9..636b99e646 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -36,11 +36,8 @@ BOOL chgpasswd(char *name,char *oldpass,char *newpass); /*The following definitions come from client.c */ -void setup_pkt(char *outbuf); void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(),BOOL recurse_dir); void cmd_help(void); -BOOL reopen_connection(char *inbuf,char *outbuf); -char *smb_errstr(char *inbuf); /*The following definitions come from clientgen.c */ @@ -62,12 +59,24 @@ void cli_shutdown(struct cli_state *cli); /*The following definitions come from clientutil.c */ -BOOL cli_send_login(char *inbuf, char *outbuf, BOOL start_session, BOOL use_setup); -void cli_send_logout(void); -BOOL cli_call_api(int prcnt,int drcnt,int mprcnt,int mdrcnt,int *rprcnt, - int *rdrcnt, char *param,char *data, - char **rparam, char **rdata); -BOOL cli_open_sockets(int port); +void cli_setup_pkt(char *outbuf); +BOOL cli_call_api(char *pipe_name, int prcnt,int drcnt, + int mprcnt,int mdrcnt, + int *rprcnt,int *rdrcnt, + char *param,char *data, + char **rparam,char **rdata); +BOOL cli_receive_trans_response(char *inbuf,int trans, + int *data_len,int *param_len, + char **data,char **param); +BOOL cli_send_trans_request(char *outbuf,int trans, + char *name,int fid,int flags, + char *data,char *param,uint16 *setup, + int ldata,int lparam,int lsetup, + int mdata,int mparam,int msetup); +BOOL cli_send_session_request(char *inbuf,char *outbuf); +BOOL cli_send_login(char *inbuf,char *outbuf,BOOL start_session,BOOL use_setup); +void cli_send_logout(void ); +BOOL cli_open_sockets(int port ); BOOL cli_reopen_connection(char *inbuf,char *outbuf); char *smb_errstr(char *inbuf); diff --git a/source3/include/smb.h b/source3/include/smb.h index 913f5607b7..d10b449e6f 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -260,6 +260,12 @@ typedef char fstring[128]; typedef fstring string; +/* pipe strings */ +#define PIPE_LANMAN "\\PIPE\\LANMAN" +#define PIPE_SRVSVC "\\PIPE\\srvsvc" +#define PIPE_NETLOGON "\\PIPE\\NETLOGON" +#define PIPE_NTLSA "\\PIPE\\ntlsa" + /* NETLOGON opcodes and data structures */ #define NET_QUERYFORPDC 7 /* Query for PDC */ -- cgit From a947dff4c001023d0f7c2f6f13c3a4b594c88139 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 22 Oct 1997 17:51:02 +0000 Subject: Makefile client.c : adding start of undocumented options to do NT domain logons, client-side. starting with LSA_REQCHAL. the code here happily crashes smbd: i'll investigate this further... :-) smbparse.c pipeutil.c lsaparse.c : moved some of the common make_xxxx() functions out of pipeutil.c so that the make_xxxx and (smb/lsa)_io_xxxx functions now sit together. makes sense, really... added a make_q_req_chal() function. restructured make_rpc_reply() and called it make_rpc_hdr(). created functions create_rpc_reply() and create_rpc_response(). pipenetlog.c pipentlsa.c pipesrvsvc.c calling new create_rpc_reply() function instead of old make_rpc_reply(). proto.h : usual. smb.h: added enum for RPC_PACKET_TYPE (This used to be commit b88ee3e16c6b671069f53ca2e9c5694ec8b1c030) --- source3/include/proto.h | 23 ++++++++++++++--------- source3/include/smb.h | 8 ++++++++ 2 files changed, 22 insertions(+), 9 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 636b99e646..d62adb9f84 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -372,6 +372,9 @@ char* lsa_io_q_lookup_sids(BOOL io, LSA_Q_LOOKUP_SIDS *q_s, char *q, char *base, char* lsa_io_r_lookup_sids(BOOL io, LSA_R_LOOKUP_SIDS *r_s, char *q, char *base, int align, int depth); char* lsa_io_q_lookup_rids(BOOL io, LSA_Q_LOOKUP_RIDS *q_r, char *q, char *base, int align, int depth); char* lsa_io_r_lookup_rids(BOOL io, LSA_R_LOOKUP_RIDS *r_r, char *q, char *base, int align, int depth); +void make_q_req_chal(LSA_Q_REQ_CHAL *q_c, + char *logon_srv, char *logon_clnt, + DOM_CHAL *clnt_chal); char* lsa_io_q_req_chal(BOOL io, LSA_Q_REQ_CHAL *q_c, char *q, char *base, int align, int depth); char* lsa_io_r_req_chal(BOOL io, LSA_R_REQ_CHAL *r_c, char *q, char *base, int align, int depth); char* lsa_io_q_auth_2(BOOL io, LSA_Q_AUTH_2 *q_a, char *q, char *base, int align, int depth); @@ -708,17 +711,10 @@ void initrpcreply(char *inbuf, char *q); void endrpcreply(char *inbuf, char *q, int datalen, int rtnval, int *rlen); BOOL name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); char *dom_sid_to_string(DOM_SID *sid); -void make_dom_sid(DOM_SID *sid, char *domsid); int make_dom_sids(char *sids_str, DOM_SID *sids, int max_sids); int make_dom_gids(char *gids_str, DOM_GID *gids); -void create_rpc_reply(RPC_HDR *hdr, uint32 call_id, int data_len); -int make_rpc_reply(char *inbuf, char *q, int data_len); -void make_uni_hdr(UNIHDR *hdr, int max_len, int len, uint16 terminate); -void make_uni_hdr2(UNIHDR2 *hdr, int max_len, int len, uint16 terminate); -void make_unistr(UNISTR *str, char *buf); -void make_unistr2(UNISTR2 *str, char *buf, int len); -void make_dom_rid2(DOM_RID2 *rid2, uint32 rid); -void make_dom_sid2(DOM_SID2 *sid2, char *sid_str); +int create_rpc_request(uint32 call_id, uint16 op_num, char *q, int data_len); +int create_rpc_reply(uint32 call_id, char *q, int data_len); /*The following definitions come from predict.c */ @@ -893,12 +889,19 @@ void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); char* smb_io_utime(BOOL io, UTIME *t, char *q, char *base, int align, int depth); char* smb_io_time(BOOL io, NTTIME *nttime, char *q, char *base, int align, int depth); +void make_dom_sid(DOM_SID *sid, char *domsid); char* smb_io_dom_sid(BOOL io, DOM_SID *sid, char *q, char *base, int align, int depth); +void make_uni_hdr(UNIHDR *hdr, int max_len, int len, uint16 terminate); char* smb_io_unihdr(BOOL io, UNIHDR *hdr, char *q, char *base, int align, int depth); +void make_uni_hdr2(UNIHDR2 *hdr, int max_len, int len, uint16 terminate); char* smb_io_unihdr2(BOOL io, UNIHDR2 *hdr2, char *q, char *base, int align, int depth); +void make_unistr(UNISTR *str, char *buf); char* smb_io_unistr(BOOL io, UNISTR *uni, char *q, char *base, int align, int depth); +void make_unistr2(UNISTR2 *str, char *buf, int len); char* smb_io_unistr2(BOOL io, UNISTR2 *uni2, char *q, char *base, int align, int depth); +void make_dom_sid2(DOM_SID2 *sid2, char *sid_str); char* smb_io_dom_sid2(BOOL io, DOM_SID2 *sid2, char *q, char *base, int align, int depth); +void make_dom_rid2(DOM_RID2 *rid2, uint32 rid); char* smb_io_dom_rid2(BOOL io, DOM_RID2 *rid2, char *q, char *base, int align, int depth); char* smb_io_clnt_srv(BOOL io, DOM_CLNT_SRV *log, char *q, char *base, int align, int depth); char* smb_io_log_info(BOOL io, DOM_LOG_INFO *log, char *q, char *base, int align, int depth); @@ -911,6 +914,8 @@ char* smb_io_arc4_owf(BOOL io, ARC4_OWF *hash, char *q, char *base, int align, i char* smb_io_id_info1(BOOL io, DOM_ID_INFO_1 *id, char *q, char *base, int align, int depth); char* smb_io_sam_info(BOOL io, DOM_SAM_INFO *sam, char *q, char *base, int align, int depth); char* smb_io_gid(BOOL io, DOM_GID *gid, char *q, char *base, int align, int depth); +void make_rpc_header(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, + uint32 call_id, int data_len, int opnum); char* smb_io_rpc_hdr(BOOL io, RPC_HDR *rpc, char *q, char *base, int align, int depth); char* smb_io_pol_hnd(BOOL io, LSA_POL_HND *pol, char *q, char *base, int align, int depth); char* smb_io_dom_query_3(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align, int depth); diff --git a/source3/include/smb.h b/source3/include/smb.h index d10b449e6f..83ed54c998 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -268,6 +268,14 @@ typedef fstring string; /* NETLOGON opcodes and data structures */ +enum RPC_PKT_TYPE +{ + RPC_REQUEST = 0x00, + RPC_RESPONSE = 0x02, + RPC_BIND = 0x0B, + RPC_BINDACK = 0x0C +}; + #define NET_QUERYFORPDC 7 /* Query for PDC */ #define NET_QUERYFORPDC_R 12 /* Response to Query for PDC */ #define NET_SAMLOGON 18 -- cgit From 5cd52a56a4846d6a720e63e723d3777b207e0724 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 23 Oct 1997 13:38:46 +0000 Subject: playing about, trying to SMBopenX a \PIPE\NETLOGON (should be a SMBopen) and then send a LSA_REQ_CHAL down it. (This used to be commit 473f21071fad603865358821b83df6b58c9a06a5) --- source3/include/proto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index d62adb9f84..a86a4999d9 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -60,10 +60,10 @@ void cli_shutdown(struct cli_state *cli); /*The following definitions come from clientutil.c */ void cli_setup_pkt(char *outbuf); -BOOL cli_call_api(char *pipe_name, int prcnt,int drcnt, +BOOL cli_call_api(char *pipe_name, int prcnt,int drcnt, int srcnt, int mprcnt,int mdrcnt, int *rprcnt,int *rdrcnt, - char *param,char *data, + char *param,char *data, uint16 *setup, char **rparam,char **rdata); BOOL cli_receive_trans_response(char *inbuf,int trans, int *data_len,int *param_len, -- cgit From 203c93e9221bfa71a00165f251695cafb92f035b Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 23 Oct 1997 16:17:07 +0000 Subject: general sorting out, from crashes generated by do_lsa_req_chal() in client.c trying to set up the data parameters etc and not understanding what's going on. in api_netlogTNP, added smb_io_rpc_hdr() call to decode the header received (and in this instance, generated by do_lsa_req_chal()). and then noticed that it's two bytes out. but i don't know how to do "byte parameters" and it's not the same format as the LSA_REQCHAL received from nt workstations. agh! (This used to be commit 0cc8ce43e1d54b44237bb525f4cf6b77e7ca3ced) --- source3/include/proto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index a86a4999d9..96c4779e62 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -713,7 +713,7 @@ BOOL name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); char *dom_sid_to_string(DOM_SID *sid); int make_dom_sids(char *sids_str, DOM_SID *sids, int max_sids); int make_dom_gids(char *gids_str, DOM_GID *gids); -int create_rpc_request(uint32 call_id, uint16 op_num, char *q, int data_len); +int create_rpc_request(uint32 call_id, uint8 op_num, char *q, int data_len); int create_rpc_reply(uint32 call_id, char *q, int data_len); /*The following definitions come from predict.c */ @@ -915,7 +915,7 @@ char* smb_io_id_info1(BOOL io, DOM_ID_INFO_1 *id, char *q, char *base, int align char* smb_io_sam_info(BOOL io, DOM_SAM_INFO *sam, char *q, char *base, int align, int depth); char* smb_io_gid(BOOL io, DOM_GID *gid, char *q, char *base, int align, int depth); void make_rpc_header(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, - uint32 call_id, int data_len, int opnum); + uint32 call_id, int data_len, uint8 opnum); char* smb_io_rpc_hdr(BOOL io, RPC_HDR *rpc, char *q, char *base, int align, int depth); char* smb_io_pol_hnd(BOOL io, LSA_POL_HND *pol, char *q, char *base, int align, int depth); char* smb_io_dom_query_3(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align, int depth); -- cgit From abb255cfe674a39c6a42f5083af9c5facdbcca05 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 23 Oct 1997 22:30:57 +0000 Subject: Big change to make nmbd code more readable/understandable. Main change is removal of find_name_search() confusion. This has been replaced with find_name_on_subnet() which makes it explicit what is being searched. Also changed wins_subnet to be wins_client_subnet in preparation for splitting the wins subnet into client and server pieces. This is a big nmbd change and I'd appreciate any bug reports. Specific changes follow : asyncdns.c: Removed wins entry from add_netbios_entry(). This is now explicit in the subnet_record parameter. interface.c: iface_bcast(), iface_nmask(), iface_ip() return the default interface if none can be found. Made this behavior explicit - some code in nmbd incorrectly depended upon this (reply_name_status() for instance). nameannounce.c: find_name_search changes to find_name_on_subnet. namebrowse.c: wins_subnet renamed to wins_client_subnet. namedbname.c: find_name_search removed. find_name_on_subnet added. add_netbios_entry - wins parameter removed. namedbsubnet.c: find_req_subnet removed - not explicit enough. nameelect.c: wins_subnet renamed to wins_client_subnet. namepacket.c: listening() simplified. nameresp.c: wins_subnet renamed to wins_client_subnet. nameserv.c: find_name_search moved to find_name_on_subnet. nameserv.h: FIND_XXX -> changed to FIND_SELF_NAME, FIND_ANY_NAME. nameservreply.c: find_name_search moved to find_name_on_subnet. Debug entries changed. nameservresp.c: wins_subnet renamed to wins_client_subnet. namework.c: wins_subnet renamed to wins_client_subnet. nmbd.c: wins parameter removed from add_netbios_entry. nmbsync: wins_subnet renamed to wins_client_subnet. proto.h: The usual. server.c: remove accepted fd from fd_set. Jeremy (jallison@whistle.com) (This used to be commit 2c97b33fc0b5ef181dbf51a50cb61074935165bf) --- source3/include/nameserv.h | 11 +++++------ source3/include/proto.h | 20 +++++++------------- 2 files changed, 12 insertions(+), 19 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 5c8ec1e4eb..2a7bb29070 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -38,9 +38,8 @@ #define NMB_WAIT_ACK 0x07 /* see rfc1002.txt 4.2.16 */ /* XXXX what about all the other types?? 0x1, 0x2, 0x3, 0x4, 0x8? */ -#define FIND_SELF 0x01 -#define FIND_WINS 0x02 -#define FIND_LOCAL 0x04 +#define FIND_ANY_NAME 0 +#define FIND_SELF_NAME 1 /* NetBIOS flags */ #define NB_GROUP 0x80 @@ -428,11 +427,11 @@ struct packet_struct the WINS subnet. */ extern struct subnet_record *subnetlist; -extern struct subnet_record *wins_subnet; +extern struct subnet_record *wins_client_subnet; #define FIRST_SUBNET subnetlist #define NEXT_SUBNET_EXCLUDING_WINS(x) ((x)->next) -#define NEXT_SUBNET_INCLUDING_WINS(x) ( ((x) == wins_subnet) ? NULL : \ - (((x)->next == NULL) ? wins_subnet : \ +#define NEXT_SUBNET_INCLUDING_WINS(x) ( ((x) == wins_client_subnet) ? NULL : \ + (((x)->next == NULL) ? wins_client_subnet : \ (x)->next)) diff --git a/source3/include/proto.h b/source3/include/proto.h index 96c4779e62..603399758f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -440,20 +440,15 @@ void set_samba_nb_type(void); BOOL name_equal(struct nmb_name *n1,struct nmb_name *n2); BOOL ms_browser_name(char *name, int type); void remove_name(struct subnet_record *d, struct name_record *n); -struct name_record *find_name(struct name_record *n, - struct nmb_name *name, int search); -struct name_record *find_name_search(struct subnet_record **d, - struct nmb_name *name, - int search, struct in_addr ip); +struct name_record *find_name_on_subnet(struct subnet_record *d, + struct nmb_name *name, BOOL self_only); void dump_names(void); void load_netbios_names(void); void remove_netbios_name(struct subnet_record *d, - char *name,int type, enum name_source source, - struct in_addr ip); + char *name,int type, enum name_source source); struct name_record *add_netbios_entry(struct subnet_record *d, - char *name, int type, int nb_flags, - int ttl, enum name_source source, struct in_addr ip, - BOOL new_only,BOOL wins); + char *name, int type, int nb_flags, int ttl, + enum name_source source, struct in_addr ip, BOOL new_only); void expire_names(time_t t); /*The following definitions come from namedbresp.c */ @@ -486,9 +481,8 @@ void expire_servers(time_t t); /*The following definitions come from namedbsubnet.c */ -struct subnet_record *find_subnet(struct in_addr bcast_ip); -struct subnet_record *find_req_subnet(struct in_addr ip, BOOL bcast); -struct subnet_record *find_subnet_all(struct in_addr bcast_ip); +struct subnet_record *find_subnet(struct in_addr ip); +struct subnet_record *find_subnet_all(struct in_addr ip); void add_workgroup_to_subnet( struct subnet_record *d, char *group); void add_my_subnets(char *group); void write_browse_list(time_t t); -- cgit From a12f04753348e6d52df1f9a2359794deacfc9007 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 24 Oct 1997 13:15:34 +0000 Subject: nterr.c : added a structure that wraps nt errors as strings and enums, so we can do a smb_nt_error() function. Makefile ntclient.c : added ntclient.c, broken out nt domain stuff into a separate file. getting fed up of compile-times and size of client.c. fixed the do_lsa_req_chal() function. made it read the response, and return the challenge credentials received from the server. next stop: do_lsa_auth_2(). client.c : removed nt domain logon functions into a separate file. pipenetlog.c pipentlsa.c pipesrvsvc.c smbparse.c : i'd broken the offsets of the RPC_HDR while trying to sort out the nt client code. fixed it again. added some robustness stuff. util.c : the unistrn2() function was null-terminating the string at one character too many. (This used to be commit 39cec7f698c4461aee05cfbb213879fbd486117d) --- source3/include/proto.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 603399758f..03c3eaf6a5 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -36,6 +36,7 @@ BOOL chgpasswd(char *name,char *oldpass,char *newpass); /*The following definitions come from client.c */ +void cli_smb_close(char *inbuf, char *outbuf, int clnt_fd, int c_num, int f_num); void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(),BOOL recurse_dir); void cmd_help(void); @@ -630,6 +631,11 @@ char *getsmbpass(char *pass); void sync_browse_lists(struct subnet_record *d, struct work_record *work, char *name, int nm_type, struct in_addr ip, BOOL local); +/*The following definitions come from ntclient.c */ + +BOOL cli_lsa_req_chal(DOM_CHAL *srv_chal, char *desthost, char *myhostname, + int Client, int cnum); + /*The following definitions come from params.c */ BOOL pm_process( char *FileName, -- cgit From 78095482be25e0894baa11c915a91be5006b4cfa Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Fri, 24 Oct 1997 14:39:28 +0000 Subject: preparing for release of samba-1.9.18alpha4 (This used to be commit e24465890a2fd87fce4f88b97f7ad84a4cc34d7b) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index dae7bc7776..00192a3a1b 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.18alpha3" +#define VERSION "samba-1.9.18alpha4" -- cgit From 1bdf2d8fa57c9471ab38d67e07c92a9421973f0f Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Fri, 24 Oct 1997 14:40:37 +0000 Subject: preparing for release of 1.9.18alpha4 (This used to be commit bf5b060bd9d210efe95b3529dfba98c5c49716e0) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 00192a3a1b..4ecdcc8039 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "samba-1.9.18alpha4" +#define VERSION "1.9.18alpha4" -- cgit From 390c1f3c4d3136b454fa5eb8681fa9ca34eaacc2 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sat, 25 Oct 1997 10:58:18 +0000 Subject: Makefile : adding bits for new nt domain code byteorder.h : trying to get macros right, and not to crash on SUNOS5... client.c : added #ifdef NTDOMAIN, and created do_nt_login() function. don't want to have to recompile client.c unless absolutely necessary. credentials.c : moved deal_with_creds() [possibly inappropriately] into credentials.c ipc.c reply.c server.c uid.c : attempting to make (un)become_root() functions calleable from smbclient. this is a little tricky: smbclient might have to be another setuid root program, immediately setuid'ing to non-root, so that we can reset-uid to root to get at the smbpasswd file. or, have a secure pipe mechanism to smbd to grab smbpasswd entries. or the like. smbdes.c smbencrypt.c : created a function to generate lm and nt owf hashes. lsaparse.c ntclient.c smbparse.c : added nt client LSA_AUTH2 code. it works, too! pipenetlog.c pipentlsa.c pipesrvsvc.c : simplification. code-shuffling. getting that damn offset right for the opcode in RPC_HDR. smb.h : changed dcinfo xxx_creds to DOM_CRED structures instead of DOM_CHAL. we might need to store the server times as well. proto.h : the usual. (This used to be commit 82436a3d99d4bdce249ce9ff27fd2ca4b2447e07) --- source3/include/byteorder.h | 6 +++--- source3/include/proto.h | 13 +++++++++++-- source3/include/smb.h | 6 +++--- 3 files changed, 17 insertions(+), 8 deletions(-) (limited to 'source3/include') diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h index f43159ecf4..147d20d26d 100644 --- a/source3/include/byteorder.h +++ b/source3/include/byteorder.h @@ -226,15 +226,15 @@ it also defines lots of intermediate macros, just ignore those :-) #define DBG_RW_CVAL(string,depth,base,read,inbuf,outbuf) \ RW_CVAL(read,inbuf,outbuf,0) \ DEBUG(5,("%s%04x %s: %02x\n", \ - tab_depth(depth), PTR_DIFF(inbuf,base),string, *((uint8*)(inbuf)))); + tab_depth(depth), PTR_DIFF(inbuf,base),string, CVAL(inbuf, 0))); #define DBG_RW_SVAL(string,depth,base,read,inbuf,outbuf) \ RW_SVAL(read,inbuf,outbuf,0) \ DEBUG(5,("%s%04x %s: %04x\n", \ - tab_depth(depth), PTR_DIFF(inbuf,base),string, *((uint16*)(inbuf)))); + tab_depth(depth), PTR_DIFF(inbuf,base),string, SVAL(inbuf, 0))); #define DBG_RW_IVAL(string,depth,base,read,inbuf,outbuf) \ RW_IVAL(read,inbuf,outbuf,0) \ DEBUG(5,("%s%04x %s: %08x\n", \ - tab_depth(depth), PTR_DIFF(inbuf,base),string, *((uint32*)(inbuf)))); + tab_depth(depth), PTR_DIFF(inbuf,base),string, IVAL(inbuf, 0))); diff --git a/source3/include/proto.h b/source3/include/proto.h index 03c3eaf6a5..5321eb4187 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -100,6 +100,8 @@ void cred_create(uint32 session_key[2], DOM_CHAL *stor_cred, UTIME timestamp, DOM_CHAL *cred); int cred_assert(DOM_CHAL *cred, uint32 session_key[2], DOM_CHAL *stored_cred, UTIME timestamp); +BOOL srv_deal_with_creds(struct dcinfo *dc, DOM_CRED *clnt_cred, DOM_CRED *srv_cred); +BOOL clnt_deal_with_creds(struct dcinfo *dc, DOM_CRED *srv_cred, DOM_CRED *clnt_cred); /*The following definitions come from dir.c */ @@ -378,6 +380,9 @@ void make_q_req_chal(LSA_Q_REQ_CHAL *q_c, DOM_CHAL *clnt_chal); char* lsa_io_q_req_chal(BOOL io, LSA_Q_REQ_CHAL *q_c, char *q, char *base, int align, int depth); char* lsa_io_r_req_chal(BOOL io, LSA_R_REQ_CHAL *r_c, char *q, char *base, int align, int depth); +void make_q_auth_2(LSA_Q_AUTH_2 *q_a, + char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name, + DOM_CHAL *clnt_chal, uint32 clnt_flgs); char* lsa_io_q_auth_2(BOOL io, LSA_Q_AUTH_2 *q_a, char *q, char *base, int align, int depth); char* lsa_io_r_auth_2(BOOL io, LSA_R_AUTH_2 *r_a, char *q, char *base, int align, int depth); char* lsa_io_q_srv_pwset(BOOL io, LSA_Q_SRV_PWSET *q_s, char *q, char *base, int align, int depth); @@ -633,7 +638,7 @@ void sync_browse_lists(struct subnet_record *d, struct work_record *work, /*The following definitions come from ntclient.c */ -BOOL cli_lsa_req_chal(DOM_CHAL *srv_chal, char *desthost, char *myhostname, +BOOL do_nt_login(char *desthost, char *myhostname, int Client, int cnum); /*The following definitions come from params.c */ @@ -673,6 +678,7 @@ void pcap_printer_fn(void (*fn)()); /*The following definitions come from pipenetlog.c */ +BOOL get_md4pw(char *md4pw, char *mach_acct); BOOL api_netlogrpcTNP(int cnum,int uid, char *param,char *data, int mdrcnt,int mprcnt, char **rdata,char **rparam, @@ -884,6 +890,7 @@ void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key); void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); void E_md4hash(uchar *passwd, uchar *p16); void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); +void nt_lm_owf_gen(char *pwd, char nt_p16[16], char p16[16]); /*The following definitions come from smbparse.c */ @@ -904,6 +911,8 @@ char* smb_io_dom_sid2(BOOL io, DOM_SID2 *sid2, char *q, char *base, int align, i void make_dom_rid2(DOM_RID2 *rid2, uint32 rid); char* smb_io_dom_rid2(BOOL io, DOM_RID2 *rid2, char *q, char *base, int align, int depth); char* smb_io_clnt_srv(BOOL io, DOM_CLNT_SRV *log, char *q, char *base, int align, int depth); +void make_log_info(DOM_LOG_INFO *log, char *logon_srv, char *acct_name, + uint16 sec_chan, char *comp_name); char* smb_io_log_info(BOOL io, DOM_LOG_INFO *log, char *q, char *base, int align, int depth); char* smb_io_chal(BOOL io, DOM_CHAL *chal, char *q, char *base, int align, int depth); char* smb_io_cred(BOOL io, DOM_CRED *cred, char *q, char *base, int align, int depth); @@ -1015,7 +1024,7 @@ char *ufc_crypt(char *key,char *salt); void init_uid(void); BOOL become_guest(void); -BOOL become_user(int cnum, uint16 vuid); +BOOL become_user(connection_struct *conn, int cnum, uint16 vuid); BOOL unbecome_user(void ); int smbrun(char *cmd,char *outfile,BOOL shared); void become_root(BOOL save_dir) ; diff --git a/source3/include/smb.h b/source3/include/smb.h index 83ed54c998..b6b9d177a1 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -550,7 +550,7 @@ typedef struct rpc_hdr_info uint32 alloc_hint; /* allocation hint - data size (bytes) minus header and tail. */ uint16 context_id; /* 0 - presentation context identifier */ uint8 cancel_count; /* 0 - cancel count */ - uint8 reserved; /* 0 - reserved */ + uint8 opnum; /* request: 0 - reserved. response: opnum */ } RPC_HDR; @@ -1185,8 +1185,8 @@ struct dcinfo { DOM_CHAL clnt_chal; /* Initial challenge received from client */ DOM_CHAL srv_chal; /* Initial server challenge */ - DOM_CHAL clnt_cred; /* Last client credential */ - DOM_CHAL srv_cred; /* Last server credential */ + DOM_CRED clnt_cred; /* Last client credential */ + DOM_CRED srv_cred; /* Last server credential */ uint32 sess_key[2]; /* Session key */ uchar md4pw[16]; /* md4(machine password) */ -- cgit From 027630f9ff79ae97d62012e6ca1c703425046778 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sat, 25 Oct 1997 13:15:52 +0000 Subject: sam logon query creation functions. written twice because i deleted it. (This used to be commit 9eee8c2007bf4f7756f6d645a61055101d280316) --- source3/include/proto.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 5321eb4187..037438f97d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -910,17 +910,31 @@ void make_dom_sid2(DOM_SID2 *sid2, char *sid_str); char* smb_io_dom_sid2(BOOL io, DOM_SID2 *sid2, char *q, char *base, int align, int depth); void make_dom_rid2(DOM_RID2 *rid2, uint32 rid); char* smb_io_dom_rid2(BOOL io, DOM_RID2 *rid2, char *q, char *base, int align, int depth); +void make_clnt_srv(DOM_CLNT_SRV *log, char *logon_srv, char *comp_name); char* smb_io_clnt_srv(BOOL io, DOM_CLNT_SRV *log, char *q, char *base, int align, int depth); void make_log_info(DOM_LOG_INFO *log, char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name); char* smb_io_log_info(BOOL io, DOM_LOG_INFO *log, char *q, char *base, int align, int depth); char* smb_io_chal(BOOL io, DOM_CHAL *chal, char *q, char *base, int align, int depth); char* smb_io_cred(BOOL io, DOM_CRED *cred, char *q, char *base, int align, int depth); +void make_clnt_info2(DOM_CLNT_INFO2 *clnt, + char *logon_srv, char *comp_name, + DOM_CRED *clnt_cred); char* smb_io_clnt_info2(BOOL io, DOM_CLNT_INFO2 *clnt, char *q, char *base, int align, int depth); char* smb_io_clnt_info(BOOL io, DOM_CLNT_INFO *clnt, char *q, char *base, int align, int depth); +void make_logon_id(DOM_LOGON_ID *log, uint32 log_id_low, uint32 log_id_high); char* smb_io_logon_id(BOOL io, DOM_LOGON_ID *log, char *q, char *base, int align, int depth); +void make_arc4_owf(ARC4_OWF *hash, char data[16]); char* smb_io_arc4_owf(BOOL io, ARC4_OWF *hash, char *q, char *base, int align, int depth); +void make_id_info1(DOM_ID_INFO_1 *id, char *domain_name, + uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high, + char *user_name, char *workgroup_name, + char arc4_lm_owf[16], char arc4_nt_owf[16]); char* smb_io_id_info1(BOOL io, DOM_ID_INFO_1 *id, char *q, char *base, int align, int depth); +void make_sam_info(DOM_SAM_INFO *sam, + char *logon_srv, char *comp_name, DOM_CRED *clnt_cred, + DOM_CRED *rtn_cred, uint16 switch_value, uint16 logon_level, + DOM_ID_INFO_1 *id1); char* smb_io_sam_info(BOOL io, DOM_SAM_INFO *sam, char *q, char *base, int align, int depth); char* smb_io_gid(BOOL io, DOM_GID *gid, char *q, char *base, int align, int depth); void make_rpc_header(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, -- cgit From 54932934421e8a34d190604122bc22d676e4c7ea Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sat, 25 Oct 1997 15:49:27 +0000 Subject: got the SAM logon request generated, and received a SAM logon response back. YEAH! need to add: - client-side credential calculation - client-side parsing of the SAM logon response. (This used to be commit 349677de3f06bb0892862de0e11172adeffda18a) --- source3/include/smb.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index b6b9d177a1..b19fbfb4ca 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -502,12 +502,12 @@ typedef struct id_info_1 uint32 param_ctrl; /* param control */ DOM_LOGON_ID logon_id; /* logon ID */ UNIHDR hdr_user_name; /* user name unicode header */ - UNIHDR hdr_workgroup_name; /* workgroup name unicode header */ + UNIHDR hdr_wksta_name; /* workgroup name unicode header */ ARC4_OWF arc4_lm_owf; /* arc4 LM OWF Password */ ARC4_OWF arc4_nt_owf; /* arc4 NT OWF Password */ UNISTR2 uni_domain_name; /* domain name unicode string */ UNISTR2 uni_user_name; /* user name unicode string */ - UNISTR2 uni_workgroup_name; /* workgroup name unicode string */ + UNISTR2 uni_wksta_name; /* workgroup name unicode string */ } DOM_ID_INFO_1; @@ -522,7 +522,7 @@ typedef struct sam_info union { - DOM_ID_INFO_1 id1; /* auth-level 1 */ + DOM_ID_INFO_1 *id1; /* auth-level 1 */ } auth; -- cgit From 7e56b5a173df10acfad9c99d59211a0432b2a28e Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sat, 25 Oct 1997 17:38:37 +0000 Subject: added correct client-side credential generation / checking to the LSA SAM Logon query. i think i even got the client-side checking of the response credentials right! (This used to be commit f14c111835e18e361468cc6a1666a02654afe743) --- source3/include/smb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index b19fbfb4ca..1869020c0d 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -809,7 +809,7 @@ typedef struct lsa_q_user_info uint32 buffer_groups; /* undocumented buffer pointer to groups. */ uint32 user_flgs; /* user flags */ - char sess_key[16]; /* unused user session key */ + char user_sess_key[16]; /* unused user session key */ UNIHDR hdr_logon_srv; /* logon server unicode string header */ UNIHDR hdr_logon_dom; /* logon domain unicode string header */ -- cgit From 326da272da002677c48e3ee7caae3c0b00da1bde Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sat, 25 Oct 1997 19:13:07 +0000 Subject: preparing for release of 1.9.18alpha5 (This used to be commit 1b17455066098104b9b0907a58195328c6467d71) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 4ecdcc8039..35b0546c51 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.18alpha4" +#define VERSION "1.9.18alpha5" -- cgit From a342ff5bf407679918a1a5d0c2faaf0a3465d303 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 26 Oct 1997 07:32:02 +0000 Subject: The browse synchronisation code in nmbsync.c now uses the clientgen.c code, which means we don't have to link with a fake getpass routine and we don't have a whole pile of global variables that really have nothing to do with nmbd and were there to keep the client code happy. The code should function identically to what it did before (hopefully it was correct) The only thing that now uses the horrible clientutil.c code is smbclient. (This used to be commit 4bf5c03b18f88b566f3ac12cc4b3a9c5c96fd35d) --- source3/include/proto.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 037438f97d..6489e87561 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -43,6 +43,8 @@ void cmd_help(void); /*The following definitions come from clientgen.c */ BOOL cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation); +BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype, + void (*fn)(char *, uint32, char *)); BOOL cli_session_setup(struct cli_state *cli, char *user, char *pass, int passlen, @@ -632,9 +634,8 @@ int main(int argc,char *argv[]); /*The following definitions come from nmbsync.c */ -char *getsmbpass(char *pass); void sync_browse_lists(struct subnet_record *d, struct work_record *work, - char *name, int nm_type, struct in_addr ip, BOOL local); + char *name, int nm_type, struct in_addr ip, BOOL local); /*The following definitions come from ntclient.c */ @@ -928,12 +929,12 @@ void make_arc4_owf(ARC4_OWF *hash, char data[16]); char* smb_io_arc4_owf(BOOL io, ARC4_OWF *hash, char *q, char *base, int align, int depth); void make_id_info1(DOM_ID_INFO_1 *id, char *domain_name, uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high, - char *user_name, char *workgroup_name, + char *user_name, char *wksta_name, char arc4_lm_owf[16], char arc4_nt_owf[16]); char* smb_io_id_info1(BOOL io, DOM_ID_INFO_1 *id, char *q, char *base, int align, int depth); void make_sam_info(DOM_SAM_INFO *sam, char *logon_srv, char *comp_name, DOM_CRED *clnt_cred, - DOM_CRED *rtn_cred, uint16 switch_value, uint16 logon_level, + DOM_CRED *rtn_cred, uint16 logon_level, uint16 switch_value, DOM_ID_INFO_1 *id1); char* smb_io_sam_info(BOOL io, DOM_SAM_INFO *sam, char *q, char *base, int align, int depth); char* smb_io_gid(BOOL io, DOM_GID *gid, char *q, char *base, int align, int depth); -- cgit From 95b3b1473f84cd48ec3d0333c89e3280e1e10678 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sun, 26 Oct 1997 18:42:47 +0000 Subject: hooray. hooray some more. hooray a lot. got the client-side working. Q/R LSA_REQ_CHAL; Q/R LSA_AUTH2; Q/R LSA_SAMLOGON; Q/R LSA_SAMLOGOFF. the last (non-essential right now) bit is the LSA_SRV_PWSET. the next stage is to do LSA_OPENPOLICY; add the pipe binds (missing right now); then we can test against an NT Server. (This used to be commit 0a549e62fbf11a3ff1f1de663176e30006553e08) --- source3/include/proto.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 6489e87561..f0c855c689 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -102,8 +102,11 @@ void cred_create(uint32 session_key[2], DOM_CHAL *stor_cred, UTIME timestamp, DOM_CHAL *cred); int cred_assert(DOM_CHAL *cred, uint32 session_key[2], DOM_CHAL *stored_cred, UTIME timestamp); -BOOL srv_deal_with_creds(struct dcinfo *dc, DOM_CRED *clnt_cred, DOM_CRED *srv_cred); -BOOL clnt_deal_with_creds(struct dcinfo *dc, DOM_CRED *srv_cred, DOM_CRED *clnt_cred); +BOOL clnt_deal_with_creds(uint32 sess_key[2], + DOM_CRED *sto_clnt_cred, DOM_CRED *rcv_srv_cred); +BOOL deal_with_creds(uint32 sess_key[2], + DOM_CRED *sto_clnt_cred, + DOM_CRED *rcv_clnt_cred, DOM_CRED *rtn_srv_cred); /*The following definitions come from dir.c */ @@ -891,7 +894,7 @@ void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key); void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); void E_md4hash(uchar *passwd, uchar *p16); void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); -void nt_lm_owf_gen(char *pwd, char nt_p16[16], char p16[16]); +void nt_lm_owf_gen(char *pwd, char *nt_p16, char *p16); /*The following definitions come from smbparse.c */ -- cgit From 8047228db4d3545da13d87d7b370a38ed0b4c4bb Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 27 Oct 1997 12:02:34 +0000 Subject: Fixed 2 oplock bugs: 1) the oplock macros in smb.h used | where they should have used &. This means that smbd thought that all clients were always requesting oplocks. This would have _really_ confused smbclient and smbfs when they started receiving async oplock break requests when they don't even know what an oplock is! 2) an oplock break request from a client can be embedded in a normal lockingX request, and will be if the client has batched any lock requests internally. The smbd code assumed that all oplock break requests had num_locks==num_ulocks==0 which is not true. The only thing special about a oplock break request with num_locks==num_ulocks==0 is that no reply is sent. Otherwise it is processed as a normal locking request in addition to the oplock break processing. These two fixes get the MS mail system in Win98 working on a Samba 1.9.18 network drive. Andrew (This used to be commit ed71534df56d0296280dbde1859597fb42002088) --- source3/include/smb.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 1869020c0d..7019d41de0 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1804,14 +1804,12 @@ extern int unix_ERR_code; /* * Core protocol. */ -#define CORE_OPLOCK_REQUEST(inbuf) (((CVAL(inbuf,smb_flg)|(1<<5))>>5) | \ - ((CVAL(inbuf,smb_flg)|(1<<6))>>5)) +#define CORE_OPLOCK_REQUEST(inbuf) ((CVAL(inbuf,smb_flg)&((1<<5)|(1<<6)))>>5) /* * Extended protocol. */ -#define EXTENDED_OPLOCK_REQUEST(inbuf) (((SVAL(inbuf,smb_vwv2)|(1<<1))>>1) | \ - ((SVAL(inbuf,smb_vwv2)|(1<<2))>>1)) +#define EXTENDED_OPLOCK_REQUEST(inbuf) ((SVAL(inbuf,smb_vwv2)&((1<<1)|(1<<2)))>>1) /* Lock types. */ #define LOCKING_ANDX_SHARED_LOCK 0x1 -- cgit From 464dc5433641566abeeabd07f46ab569c986a3b0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 27 Oct 1997 13:38:07 +0000 Subject: also disable read prediction in 1.9.18 (This used to be commit 0f15558efb26b7215540a588dfe8733e9346d407) --- source3/include/local.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index a218dd8fc6..c1f1de2132 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -160,4 +160,9 @@ #define OPLOCK_BREAK_TIMEOUT 30 + +/* the read preciction code has been disabled until some problems with + it are worked out */ +#define USE_READ_PREDICTION 0 + #endif -- cgit From 71d648cdb431ecf984196a7e480208a94fcdf390 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 27 Oct 1997 14:27:17 +0000 Subject: change the default file permissions on the SHARE_MEM_FILE* to 0644. smbstatus now gets only read permission on the share files and does no locking. also get rid of some unnecessary umask(0) calls. smbd always runs with umask(0) (This used to be commit c6ac10170dbba57dfebc54c50d79cb29d13bb442) --- source3/include/proto.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index f0c855c689..cdecd1ec88 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -351,7 +351,7 @@ int lp_minor_announce_version(void); BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset); BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); -BOOL locking_init(void); +BOOL locking_init(int read_only); BOOL locking_end(void); BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, int *ptok); BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, int token); @@ -365,11 +365,11 @@ void share_status(FILE *f); /*The following definitions come from locking_shm.c */ -struct share_ops *locking_shm_init(void); +struct share_ops *locking_shm_init(int ronly); /*The following definitions come from locking_slow.c */ -struct share_ops *locking_slow_init(void); +struct share_ops *locking_slow_init(int ronly); /*The following definitions come from lsaparse.c */ @@ -869,7 +869,7 @@ int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); /*The following definitions come from shmem.c */ -BOOL smb_shm_open(char *file_name, int size); +BOOL smb_shm_open(char *file_name, int size, int ronly); BOOL smb_shm_close( void ); int smb_shm_alloc(int size); BOOL smb_shm_free(int offset); -- cgit From 8586dda29b79f041cac2879ecff0afa3283dfca1 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 27 Oct 1997 15:09:23 +0000 Subject: added LSA Open Policy query and response processing to smbclient (This used to be commit 16cc27852bf54999db4b0a3665b0743d9fe0e74a) --- source3/include/proto.h | 6 ++++++ source3/include/smb.h | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index cdecd1ec88..6bb91e8c1f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -373,6 +373,10 @@ struct share_ops *locking_slow_init(int ronly); /*The following definitions come from lsaparse.c */ +void make_q_open_pol(LSA_Q_OPEN_POL *r_q, char *server_name, + uint32 attributes, uint32 sec_qos, + uint16 desired_access); +char* lsa_io_q_open_pol(BOOL io, LSA_Q_OPEN_POL *r_q, char *q, char *base, int align, int depth); char* lsa_io_r_open_pol(BOOL io, LSA_R_OPEN_POL *r_p, char *q, char *base, int align, int depth); char* lsa_io_q_query(BOOL io, LSA_Q_QUERY_INFO *q_q, char *q, char *base, int align, int depth); char* lsa_io_r_query(BOOL io, LSA_R_QUERY_INFO *r_q, char *q, char *base, int align, int depth); @@ -944,6 +948,8 @@ char* smb_io_gid(BOOL io, DOM_GID *gid, char *q, char *base, int align, int dept void make_rpc_header(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint32 call_id, int data_len, uint8 opnum); char* smb_io_rpc_hdr(BOOL io, RPC_HDR *rpc, char *q, char *base, int align, int depth); +void make_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, uint32 sec_qos); +char* smb_io_obj_attr(BOOL io, LSA_OBJ_ATTR *attr, char *q, char *base, int align, int depth); char* smb_io_pol_hnd(BOOL io, LSA_POL_HND *pol, char *q, char *base, int align, int depth); char* smb_io_dom_query_3(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align, int depth); char* smb_io_dom_query_5(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align, int depth); diff --git a/source3/include/smb.h b/source3/include/smb.h index 7019d41de0..e9734f379d 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -265,6 +265,7 @@ typedef fstring string; #define PIPE_SRVSVC "\\PIPE\\srvsvc" #define PIPE_NETLOGON "\\PIPE\\NETLOGON" #define PIPE_NTLSA "\\PIPE\\ntlsa" +#define PIPE_LSARPC "\\PIPE\\lsarpc" /* NETLOGON opcodes and data structures */ @@ -579,6 +580,27 @@ typedef struct lsa_policy_info } LSA_POL_HND; +/* OBJ_ATTR (object attributes) */ +typedef struct object_attributes_info +{ + uint32 len; /* 0x18 - length (in bytes) inc. the length field. */ + uint32 ptr_root_dir; /* 0 - root directory (pointer) */ + uint32 ptr_obj_name; /* 0 - object name (pointer) */ + uint32 attributes; /* 0 - attributes (undocumented) */ + uint32 ptr_sec_desc; /* 0 - security descriptior (pointer) */ + uint32 sec_qos; /* 0 - security quality of service */ + +} LSA_OBJ_ATTR; + +/* LSA_Q_OPEN_POL - LSA Query Open Policy */ +typedef struct lsa_q_open_pol_info +{ + UNISTR2 uni_server_name; /* server name, starting with two '\'s */ + LSA_OBJ_ATTR attr ; /* object attributes */ + + uint32 des_access; /* desired access attributes */ + +} LSA_Q_OPEN_POL; /* LSA_R_OPEN_POL - response to LSA Open Policy */ typedef struct lsa_r_open_pol_info -- cgit From 13291ce01db2469db7c3f80f7e59ce3702170e7c Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 27 Oct 1997 17:04:15 +0000 Subject: added LSA Query Info Policy. fixed a problem with byte ordering (doing an SIVAL of the setup parameters which was _also_ being done in the creation of the SMB header. oops). (This used to be commit 541fb82895008cc30477019cdcafed9fdbbeac43) --- source3/include/byteorder.h | 12 ++++++------ source3/include/proto.h | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'source3/include') diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h index 147d20d26d..b0dc1b1941 100644 --- a/source3/include/byteorder.h +++ b/source3/include/byteorder.h @@ -206,35 +206,35 @@ it also defines lots of intermediate macros, just ignore those :-) RW_PCVAL(read,inbuf,outbuf,len) \ DEBUG(5,("%s%04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ - { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%02x ", (uint8)((outbuf)[idx]))); } } \ + { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%02x ", CVAL(&((outbuf)[idx]), 0))); } } \ DEBUG(5,("\n")); #define DBG_RW_PSVAL(string,depth,base,read,inbuf,outbuf,len) \ RW_PSVAL(read,inbuf,outbuf,len) \ DEBUG(5,("%s%04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ - { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%04x ", (uint16)((outbuf)[idx]))); } } \ + { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%04x ", SVAL(&((outbuf)[idx]), 0))); } } \ DEBUG(5,("\n")); #define DBG_RW_PIVAL(string,depth,base,read,inbuf,outbuf,len) \ RW_PIVAL(read,inbuf,outbuf,len) \ DEBUG(5,("%s%04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ - { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%08x ", (uint32)((outbuf)[idx]))); } } \ + { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%08x ", IVAL(&((outbuf)[idx]), 0))); } } \ DEBUG(5,("\n")); #define DBG_RW_CVAL(string,depth,base,read,inbuf,outbuf) \ RW_CVAL(read,inbuf,outbuf,0) \ DEBUG(5,("%s%04x %s: %02x\n", \ - tab_depth(depth), PTR_DIFF(inbuf,base),string, CVAL(inbuf, 0))); + tab_depth(depth), PTR_DIFF(inbuf,base), string, outbuf)); #define DBG_RW_SVAL(string,depth,base,read,inbuf,outbuf) \ RW_SVAL(read,inbuf,outbuf,0) \ DEBUG(5,("%s%04x %s: %04x\n", \ - tab_depth(depth), PTR_DIFF(inbuf,base),string, SVAL(inbuf, 0))); + tab_depth(depth), PTR_DIFF(inbuf,base), string, outbuf)); #define DBG_RW_IVAL(string,depth,base,read,inbuf,outbuf) \ RW_IVAL(read,inbuf,outbuf,0) \ DEBUG(5,("%s%04x %s: %08x\n", \ - tab_depth(depth), PTR_DIFF(inbuf,base),string, IVAL(inbuf, 0))); + tab_depth(depth), PTR_DIFF(inbuf,base), string, outbuf)); diff --git a/source3/include/proto.h b/source3/include/proto.h index 6bb91e8c1f..e0d5d31f40 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -378,6 +378,7 @@ void make_q_open_pol(LSA_Q_OPEN_POL *r_q, char *server_name, uint16 desired_access); char* lsa_io_q_open_pol(BOOL io, LSA_Q_OPEN_POL *r_q, char *q, char *base, int align, int depth); char* lsa_io_r_open_pol(BOOL io, LSA_R_OPEN_POL *r_p, char *q, char *base, int align, int depth); +void make_q_query(LSA_Q_QUERY_INFO *q_q, LSA_POL_HND *hnd, uint16 info_class); char* lsa_io_q_query(BOOL io, LSA_Q_QUERY_INFO *q_q, char *q, char *base, int align, int depth); char* lsa_io_r_query(BOOL io, LSA_R_QUERY_INFO *r_q, char *q, char *base, int align, int depth); char* lsa_io_q_lookup_sids(BOOL io, LSA_Q_LOOKUP_SIDS *q_s, char *q, char *base, int align, int depth); -- cgit From e6ee5fc2d97e28d350d35778dba016345322cad4 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Mon, 27 Oct 1997 17:18:51 +0000 Subject: preparing for release of 1.9.18alpha6 (This used to be commit 28ef0df30efd4011e6a782dc02474b6d4082d6de) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 35b0546c51..9e7e289294 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.18alpha5" +#define VERSION "1.9.18alpha6" -- cgit From aee261e784915df4283e3bffaadac54ee36ec49e Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 27 Oct 1997 19:00:38 +0000 Subject: added LSA_Q_CLOSE and LSA_R_CLOSE (also to smb.h). implemented in smbclient. updated Query Info Policy to report domain name and domain sid for info levels 3 and 5. fixed bug in dom_sid_to_string (idauths decoded wrong). fixed bug in DOM_SID: subauths are 32 bit not 16. (This used to be commit 2f3cca23e2465ca6a3a31fda005af1fd74f6af92) --- source3/include/proto.h | 4 ++++ source3/include/smb.h | 21 +++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index e0d5d31f40..669ed5fd8d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -380,6 +380,10 @@ char* lsa_io_q_open_pol(BOOL io, LSA_Q_OPEN_POL *r_q, char *q, char *base, int a char* lsa_io_r_open_pol(BOOL io, LSA_R_OPEN_POL *r_p, char *q, char *base, int align, int depth); void make_q_query(LSA_Q_QUERY_INFO *q_q, LSA_POL_HND *hnd, uint16 info_class); char* lsa_io_q_query(BOOL io, LSA_Q_QUERY_INFO *q_q, char *q, char *base, int align, int depth); +void make_q_close(LSA_Q_CLOSE *q_c, LSA_POL_HND *hnd); +char* lsa_io_q_close(BOOL io, LSA_Q_CLOSE *q_c, char *q, char *base, int align, int depth); +void make_r_close(LSA_R_CLOSE *q_r, LSA_POL_HND *hnd); +char* lsa_io_r_close(BOOL io, LSA_R_CLOSE *r_c, char *q, char *base, int align, int depth); char* lsa_io_r_query(BOOL io, LSA_R_QUERY_INFO *r_q, char *q, char *base, int align, int depth); char* lsa_io_q_lookup_sids(BOOL io, LSA_Q_LOOKUP_SIDS *q_s, char *q, char *base, int align, int depth); char* lsa_io_r_lookup_sids(BOOL io, LSA_R_LOOKUP_SIDS *r_s, char *q, char *base, int align, int depth); diff --git a/source3/include/smb.h b/source3/include/smb.h index e9734f379d..057a0b7550 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -364,7 +364,7 @@ typedef struct sid_info uint8 sid_rev_num; /* SID revision number */ uint8 num_auths; /* number of sub-authorities */ uint8 id_auth[6]; /* Identifier Authority */ - uint16 sub_auths[MAXSUBAUTHS]; /* pointer to sub-authorities. */ + uint32 sub_auths[MAXSUBAUTHS]; /* pointer to sub-authorities. */ } DOM_SID; @@ -632,10 +632,27 @@ typedef struct lsa_r_query_info } dom; - uint32 status; /* return code */ + uint32 status; /* return code */ } LSA_R_QUERY_INFO; +/* LSA_Q_CLOSE */ +typedef struct lsa_q_close_info +{ + LSA_POL_HND pol; /* policy handle */ + +} LSA_Q_CLOSE; + +/* LSA_R_CLOSE */ +typedef struct lsa_r_close_info +{ + LSA_POL_HND pol; /* policy handle. should be all zeros. */ + + uint32 status; /* return code */ + +} LSA_R_CLOSE; + + #define MAX_REF_DOMAINS 10 /* DOM_R_REF */ -- cgit From c9fa24b7a8809a7963f0970cf2dd21f6804e31a4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 28 Oct 1997 14:19:54 +0000 Subject: SYSV IPC implementation of fast share modes. It will try sysv IPC first, then if that fails it will try mmap(), then after that it will try share files. I have defined USE_SYSV_IPC for Linux, Solaris and HPUX at the moment. Probably a lot more could have it defined. In fact, the vast majority of systems support it. Need autoconf again :-) It should actually be faster than the mmap() version, and doesn't need any lock files. This means the problem of the share mem file being on a NFS drive will be gone. (This used to be commit cc8fe0f0629eea9acc39e30d8d76d5890a5b6978) --- source3/include/includes.h | 12 ++++++++++++ source3/include/proto.h | 17 +++++------------ source3/include/smb.h | 5 ++++- 3 files changed, 21 insertions(+), 13 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 09c687aed5..91a2ec5c67 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -214,6 +214,9 @@ Here come some platform specific sections #include #include #include +#include +#include +#include #include #ifndef NO_ASMSIGNALH #include @@ -233,6 +236,7 @@ Here come some platform specific sections #define HAVE_MEMMOVE #define USE_SIGPROCMASK #define USE_WAITPID +#define USE_SYSV_IPC #if 0 /* SETFS disabled until we can check on some bug reports */ #if _LINUX_C_LIB_VERSION_MAJOR >= 5 @@ -293,6 +297,9 @@ typedef unsigned short mode_t; #include #include #include +#include +#include +#include #include #include #include @@ -317,6 +324,7 @@ extern int innetgr (const char *, const char *, const char *, const char *); #define USE_STATVFS #define USE_GETCWD #define USE_SETSID +#define USE_SYSV_IPC #ifndef REPLACE_GETPASS #define REPLACE_GETPASS #endif /* REPLACE_GETPASS */ @@ -548,6 +556,9 @@ char *mktemp(char *); /* No standard include */ #include #include #include +#include +#include +#include #ifdef HPUX_10_TRUSTED #include #include @@ -563,6 +574,7 @@ char *mktemp(char *); /* No standard include */ #define USE_GETCWD #define USE_SETSID #define USE_SETRES +#define USE_SYSV_IPC #define DEFAULT_PRINTING PRINT_HPUX /* Ken Weiss tells us that SIGCLD_IGNORE is not good for HPUX */ diff --git a/source3/include/proto.h b/source3/include/proto.h index 669ed5fd8d..13368c873d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -878,18 +878,11 @@ int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); /*The following definitions come from shmem.c */ -BOOL smb_shm_open(char *file_name, int size, int ronly); -BOOL smb_shm_close( void ); -int smb_shm_alloc(int size); -BOOL smb_shm_free(int offset); -int smb_shm_get_userdef_off(void); -void *smb_shm_offset2addr(int offset); -int smb_shm_addr2offset(void *addr); -BOOL smb_shm_lock_hash_entry( unsigned int entry); -BOOL smb_shm_unlock_hash_entry( unsigned int entry ); -BOOL smb_shm_get_usage(int *bytes_free, - int *bytes_used, - int *bytes_overhead); +struct shmem_ops *smb_shm_open(char *file_name, int size, int ronly); + +/*The following definitions come from shmem_sysv.c */ + +struct shmem_ops *sysv_shm_open(int size, int ronly); /*The following definitions come from smbdes.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index 057a0b7550..d7a576de85 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -46,8 +46,12 @@ /* Default number of hash buckets used in shared memory share mode */ #ifndef SHMEM_HASH_SIZE +#ifdef SEMMSL +#define SHMEM_HASH_SIZE (SEMMSL-1) +#else #define SHMEM_HASH_SIZE 113 #endif +#endif #define NMB_PORT 137 #define DGRAM_PORT 138 @@ -1328,7 +1332,6 @@ struct share_ops { /* each implementation of the shared memory code needs to support the following operations */ struct shmem_ops { - BOOL (*open)(char *, int ); BOOL (*close)( void ); int (*alloc)(int ); BOOL (*free)(int ); -- cgit From e06da92b377111a3c2931cf693ce14c40b054672 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 28 Oct 1997 14:22:50 +0000 Subject: define USE_SYSV_IPC on a bunch more systems. Needs some testing though. (This used to be commit 8f2366e57d29458f2bb63d9a0033de5c730a1b94) --- source3/include/includes.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 91a2ec5c67..6f3450c4fd 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -214,9 +214,6 @@ Here come some platform specific sections #include #include #include -#include -#include -#include #include #ifndef NO_ASMSIGNALH #include @@ -297,9 +294,6 @@ typedef unsigned short mode_t; #include #include #include -#include -#include -#include #include #include #include @@ -362,6 +356,7 @@ char *getwd(char *); #define USE_WAITPID #define USE_DIRECT #define USE_SETSID +#define USE_SYSV_IPC #endif #if defined(SGI5) || defined(SGI6) @@ -382,6 +377,7 @@ char *getwd(char *); #define USE_STATVFS #define USE_WAITPID #define USE_SETSID +#define USE_SYSV_IPC #endif @@ -438,6 +434,7 @@ extern struct passwd *getpwnam(); #define USE_STATVFS #define USE_GETCWD #define USE_SETSID +#define USE_SYSV_IPC #endif @@ -556,9 +553,6 @@ char *mktemp(char *); /* No standard include */ #include #include #include -#include -#include -#include #ifdef HPUX_10_TRUSTED #include #include @@ -1077,6 +1071,11 @@ struct spwd { /* fake shadow password structure */ #endif #endif +#ifdef USE_SYSV_IPC +#include +#include +#include +#endif #ifdef AFS_AUTH #include -- cgit From ba4d965fc0f78086171a5441545e561a0c4d044d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 28 Oct 1997 14:25:26 +0000 Subject: define USE_SYSV_IPC on sunos4 (This used to be commit 6388da22eb95c8bfd3f17f5645bdaa16cfca0c6b) --- source3/include/includes.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 6f3450c4fd..da736fb225 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -281,6 +281,7 @@ typedef unsigned short mode_t; #ifndef USE_WAITPID #define USE_WAITPID #endif +#define USE_SYSV_IPC /* SunOS doesn't have POSIX atexit */ #define atexit on_exit #endif -- cgit From e75de8adc6918cc16ad84d2fa32cbc185d5b7fdb Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 28 Oct 1997 14:40:31 +0000 Subject: lower the default hash size if SEMMSL isn't defined (This used to be commit 9f0be847fdbcf0f8bbd69de6cdf277ae0440bcda) --- source3/include/smb.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index d7a576de85..cdd7bcac7a 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -49,7 +49,7 @@ #ifdef SEMMSL #define SHMEM_HASH_SIZE (SEMMSL-1) #else -#define SHMEM_HASH_SIZE 113 +#define SHMEM_HASH_SIZE 15 #endif #endif @@ -1312,9 +1312,6 @@ typedef struct } share_mode_entry; -/* Conversion to hash entry index from device and inode numbers. */ -#define HASH_ENTRY(dev,ino) ((( (uint32)(dev) )* ( (uint32)(ino) )) % lp_shmem_hash_size()) - /* each implementation of the share mode code needs to support the following operations */ struct share_ops { -- cgit From d6739a10d0f7ef3c6034bb2690446e6575b8085b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 28 Oct 1997 14:55:22 +0000 Subject: define semun for broken solaris sysvipc (This used to be commit 4db076e08bec525ee908a391b22fdc12cc66bc27) --- source3/include/includes.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index da736fb225..48e79b4292 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -320,6 +320,14 @@ extern int innetgr (const char *, const char *, const char *, const char *); #define USE_GETCWD #define USE_SETSID #define USE_SYSV_IPC + +union semun { + int val; + struct semid_ds *buf; + ushort *array; +}; + + #ifndef REPLACE_GETPASS #define REPLACE_GETPASS #endif /* REPLACE_GETPASS */ -- cgit From 79f670128fc5f377182d81c0f353138ab3923a45 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 28 Oct 1997 15:07:01 +0000 Subject: enable sysv ipc and fast share modes on OSF1 (This used to be commit 3480524e15aba50dd459ac5979eabb8974898e35) --- source3/include/includes.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 48e79b4292..4c7ec56367 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -469,6 +469,7 @@ char *mktemp(char *); /* No standard include */ #define PASSWORD_LENGTH 16 #define NEED_AUTH_PARAMETERS #endif /* OSF1_ENH_SEC */ +#define USE_SYSV_IPC #endif -- cgit From d8e79427c98fdd5eb5a8d57fc6d9b10464fd9882 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 28 Oct 1997 17:54:10 +0000 Subject: smb.h smbparse.c pipeutil.c : added bind and bind ack structures and parsing functions. restructured rpc header stuff. ntclient.c pipenetlog.c pipentlsa.c pipesrvsvc.c : having to deal with restructuring above. (This used to be commit 9f2c4f1fee7e411adba8f529b7666a7325584457) --- source3/include/proto.h | 29 ++++++++++++++-- source3/include/smb.h | 91 ++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 117 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 13368c873d..db8674a5a1 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -943,11 +943,36 @@ void make_sam_info(DOM_SAM_INFO *sam, DOM_ID_INFO_1 *id1); char* smb_io_sam_info(BOOL io, DOM_SAM_INFO *sam, char *q, char *base, int align, int depth); char* smb_io_gid(BOOL io, DOM_GID *gid, char *q, char *base, int align, int depth); -void make_rpc_header(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, - uint32 call_id, int data_len, uint8 opnum); +void make_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, + uint32 call_id, int data_len); char* smb_io_rpc_hdr(BOOL io, RPC_HDR *rpc, char *q, char *base, int align, int depth); +void make_rpc_iface(RPC_IFACE *ifc, char data[16], uint32 version); +char* smb_io_rpc_iface(BOOL io, RPC_IFACE *ifc, char *q, char *base, int align, int depth); +void make_rpc_addr_str(RPC_ADDR_STR *str, char *name); +char* smb_io_rpc_addr_str(BOOL io, RPC_ADDR_STR *str, char *q, char *base, int align, int depth); +void make_rpc_hdr_bba(RPC_HDR_BBA *bba, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid); +char* smb_io_rpc_hdr_bba(BOOL io, RPC_HDR_BBA *rpc, char *q, char *base, int align, int depth); +void make_rpc_hdr_rb(RPC_HDR_RB *rpc, enum RPC_PKT_TYPE pkt_type, + uint32 call_id, int data_len, + uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, + uint32 num_elements, uint16 context_id, uint8 num_syntaxes, + RPC_IFACE *abstract, RPC_IFACE *transfer); +char* smb_io_rpc_hdr_rb(BOOL io, RPC_HDR_RB *rpc, char *q, char *base, int align, int depth); +void make_rpc_results(RPC_RESULTS *res, + uint8 num_results, uint16 result, uint16 reason); +char* smb_io_rpc_results(BOOL io, RPC_RESULTS *res, char *q, char *base, int align, int depth); +void make_rpc_hdr_ba(RPC_HDR_BA *rpc, enum RPC_PKT_TYPE pkt_type, + uint32 call_id, int data_len, + uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, + char *pipe_addr, + uint8 num_results, uint16 result, uint16 reason, + RPC_IFACE *transfer); +char* smb_io_rpc_hdr_ba(BOOL io, RPC_HDR_BA *rpc, char *q, char *base, int align, int depth); void make_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, uint32 sec_qos); char* smb_io_obj_attr(BOOL io, LSA_OBJ_ATTR *attr, char *q, char *base, int align, int depth); +void make_rpc_hdr_rr(RPC_HDR_RR *hdr, enum RPC_PKT_TYPE pkt_type, + uint32 call_id, int data_len, uint8 opnum); +char* smb_io_rpc_hdr_rr(BOOL io, RPC_HDR_RR *rpc, char *q, char *base, int align, int depth); char* smb_io_pol_hnd(BOOL io, LSA_POL_HND *pol, char *q, char *base, int align, int depth); char* smb_io_dom_query_3(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align, int depth); char* smb_io_dom_query_5(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align, int depth); diff --git a/source3/include/smb.h b/source3/include/smb.h index cdd7bcac7a..f0ab45fb37 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -552,12 +552,101 @@ typedef struct rpc_hdr_info uint16 frag_len; /* fragment length - data size (bytes) inc header and tail. */ uint16 auth_len; /* 0 - authentication length */ uint32 call_id; /* call identifier. matches 12th uint32 of incoming RPC data. */ + +} RPC_HDR; + +/* RPC_HDR_RR - ms request / response rpc header */ +typedef struct rpc_hdr_rr_info +{ + RPC_HDR hdr; + uint32 alloc_hint; /* allocation hint - data size (bytes) minus header and tail. */ uint16 context_id; /* 0 - presentation context identifier */ uint8 cancel_count; /* 0 - cancel count */ uint8 opnum; /* request: 0 - reserved. response: opnum */ -} RPC_HDR; +} RPC_HDR_RR; + +/* the interfaces are numbered. as yet I haven't seen more than one interface + * used on the same pipe name + * srvsvc + * abstract (0x4B324FC8, 0x01D31670, 0x475A7812, 0x88E16EBF, 0x00000003) + * transfer (0x8A885D04, 0x11C91CEB, 0x0008E89F, 0x6048102B, 0x00000002) + */ +/* RPC_IFACE */ +typedef struct rpc_iface_info +{ + uint8 data[16]; /* 16 bytes of number */ + uint32 version; /* the interface number */ + +} RPC_IFACE; + + +/* this seems to be the same string name depending on the name of the pipe, + * but is more likely to be linked to the interface name + * "srvsvc", "\\PIPE\\ntsvcs" + * "samr", "\\PIPE\\lsass" + * "wkssvc", "\\PIPE\\wksvcs" + * "NETLOGON", "\\PIPE\\NETLOGON" + */ +/* RPC_ADDR_STR */ +typedef struct rpc_addr_info +{ + uint16 len; /* length of the string including null terminator */ + fstring addr; /* the string above in single byte, null terminated form */ + +} RPC_ADDR_STR; + +/* RPC_HDR_BBA */ +typedef struct rpc_hdr_bba_info +{ + uint16 max_tsize; /* maximum transmission fragment size (0x1630) */ + uint16 max_rsize; /* max receive fragment size (0x1630) */ + uint32 assoc_gid; /* associated group id (0x0) */ + +} RPC_HDR_BBA; + +/* RPC_HDR_RB - ms req bind header */ +typedef struct rpc_hdr_rb_info +{ + RPC_HDR hdr; + RPC_HDR_BBA bba; + + uint32 num_elements; /* the number of elements (0x1) */ + uint16 context_id; /* presentation context identifier (0x0) */ + uint8 num_syntaxes; /* the number of syntaxes (has always been 1?)(0x1) */ + + RPC_IFACE abstract; /* num and vers. of interface client is using */ + RPC_IFACE transfer; /* num and vers. of interface to use for replies */ + +} RPC_HDR_RB; + +/* RPC_RESULTS - can only cope with one reason, right now... */ +typedef struct rpc_results_info +{ +/* uint8[] # 4-byte alignment padding, against SMB header */ + + uint8 num_results; /* the number of results (0x01) */ + +/* uint8[] # 4-byte alignment padding, against SMB header */ + + uint16 result; /* result (0x00 = accept) */ + uint16 reason; /* reason (0x00 = no reason specified) */ + +} RPC_RESULTS; + +/* RPC_HDR_BA */ +typedef struct rpc_hdr_ba_info +{ + RPC_HDR hdr; + RPC_HDR_BBA bba; + + RPC_ADDR_STR addr ; /* the secondary address string, as described earlier */ + RPC_RESULTS res ; /* results and reasons */ + RPC_IFACE transfer; /* the transfer syntax from the request */ + +} RPC_HDR_BA; + /* DOM_QUERY - info class 3 and 5 LSA Query response */ typedef struct dom_query_info -- cgit From 8f0316bdbcba996d40ac152a9ac076a18b5dd7ec Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 28 Oct 1997 19:32:59 +0000 Subject: Adding Windows 95 printer driver code donated by Jean-Francois.Micouleau@utc.fr. New program, make_printerdef, plus two new parameters : [global] "printer driver file" [local] "printer driver location" Jeremy. (This used to be commit 9a5b42e6b3e7a35d56f81e9428fc747246e2fc5c) --- source3/include/proto.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index db8674a5a1..9ebe15e99a 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -159,6 +159,7 @@ struct in_addr *iface_ip(struct in_addr ip); /*The following definitions come from ipc.c */ +int get_printerdrivernumber(int snum); int reply_trans(char *inbuf,char *outbuf); /*The following definitions come from kanji.c */ @@ -203,6 +204,7 @@ char *lp_socket_address(void); char *lp_nis_home_map_name(void); char *lp_announce_version(void); char *lp_netbios_aliases(void); +char *lp_driverfile(void); char *lp_domain_sid(void); char *lp_domain_other_sids(void); char *lp_domain_groups(void); @@ -285,6 +287,7 @@ char *lp_volume(int ); char *lp_mangled_map(int ); char *lp_veto_files(int ); char *lp_hide_files(int ); +char *lp_driverlocation(int ); BOOL lp_alternate_permissions(int ); BOOL lp_revalidate(int ); BOOL lp_casesensitive(int ); -- cgit From fe0a702322bdf3c76a517e2fd7e92a05219c49dd Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 29 Oct 1997 00:04:14 +0000 Subject: byteorder.h : added mode for printing debug array data as chars not uint8/16/32s. only really useful for (uint8) strings or (uint16) unicode strings lsaparse.c smbparse.c smb.h : rpc bind and rpc bind ack structures and parsing and creation functions. ipc.c pipes.c pipenetlog.c pipentlsa.c pipesrvsvc.c : using rpc bind / bind ack parsing routines instead of incorrect use of api_LsarpcTNP1 function. ntclient.c : creation of do_rpc_bind() function. THAT'S IT, FOLKS! (This used to be commit 21c89e2f17c51939fd6b53dddbe3072419eb0db2) --- source3/include/byteorder.h | 9 ++++++--- source3/include/proto.h | 8 +++----- source3/include/smb.h | 6 ++---- 3 files changed, 11 insertions(+), 12 deletions(-) (limited to 'source3/include') diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h index b0dc1b1941..7326ec2abe 100644 --- a/source3/include/byteorder.h +++ b/source3/include/byteorder.h @@ -202,24 +202,27 @@ it also defines lots of intermediate macros, just ignore those :-) #define RSSVAL(buf,pos,val) SSVAL(buf,pos,SREV(val)) #define RSIVAL(buf,pos,val) SIVAL(buf,pos,IREV(val)) -#define DBG_RW_PCVAL(string,depth,base,read,inbuf,outbuf,len) \ +#define DBG_RW_PCVAL(charmode,string,depth,base,read,inbuf,outbuf,len) \ RW_PCVAL(read,inbuf,outbuf,len) \ DEBUG(5,("%s%04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ + if (charmode) print_asc(5, (char*)(outbuf), (len)); else \ { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%02x ", CVAL(&((outbuf)[idx]), 0))); } } \ DEBUG(5,("\n")); -#define DBG_RW_PSVAL(string,depth,base,read,inbuf,outbuf,len) \ +#define DBG_RW_PSVAL(charmode,string,depth,base,read,inbuf,outbuf,len) \ RW_PSVAL(read,inbuf,outbuf,len) \ DEBUG(5,("%s%04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ + if (charmode) print_asc(5, (char*)(outbuf), 2*(len)); else \ { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%04x ", SVAL(&((outbuf)[idx]), 0))); } } \ DEBUG(5,("\n")); -#define DBG_RW_PIVAL(string,depth,base,read,inbuf,outbuf,len) \ +#define DBG_RW_PIVAL(charmode,string,depth,base,read,inbuf,outbuf,len) \ RW_PIVAL(read,inbuf,outbuf,len) \ DEBUG(5,("%s%04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ + if (charmode) print_asc(5, (char*)(outbuf), 4*(len)); else \ { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%08x ", IVAL(&((outbuf)[idx]), 0))); } } \ DEBUG(5,("\n")); diff --git a/source3/include/proto.h b/source3/include/proto.h index 9ebe15e99a..fe35c3592e 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -714,7 +714,6 @@ BOOL api_LsarpcSNPHS(int cnum,int uid, char *param,char *data, int mdrcnt,int mprcnt, char **rdata,char **rparam, int *rdata_len,int *rparam_len); -void LsarpcTNP1(char *data,char **rdata, int *rdata_len); BOOL api_LsarpcTNP(int cnum,int uid, char *param,char *data, int mdrcnt,int mprcnt, char **rdata,char **rparam, @@ -955,8 +954,7 @@ void make_rpc_addr_str(RPC_ADDR_STR *str, char *name); char* smb_io_rpc_addr_str(BOOL io, RPC_ADDR_STR *str, char *q, char *base, int align, int depth); void make_rpc_hdr_bba(RPC_HDR_BBA *bba, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid); char* smb_io_rpc_hdr_bba(BOOL io, RPC_HDR_BBA *rpc, char *q, char *base, int align, int depth); -void make_rpc_hdr_rb(RPC_HDR_RB *rpc, enum RPC_PKT_TYPE pkt_type, - uint32 call_id, int data_len, +void make_rpc_hdr_rb(RPC_HDR_RB *rpc, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, uint32 num_elements, uint16 context_id, uint8 num_syntaxes, RPC_IFACE *abstract, RPC_IFACE *transfer); @@ -964,8 +962,7 @@ char* smb_io_rpc_hdr_rb(BOOL io, RPC_HDR_RB *rpc, char *q, char *base, int align void make_rpc_results(RPC_RESULTS *res, uint8 num_results, uint16 result, uint16 reason); char* smb_io_rpc_results(BOOL io, RPC_RESULTS *res, char *q, char *base, int align, int depth); -void make_rpc_hdr_ba(RPC_HDR_BA *rpc, enum RPC_PKT_TYPE pkt_type, - uint32 call_id, int data_len, +void make_rpc_hdr_ba(RPC_HDR_BA *rpc, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, char *pipe_addr, uint8 num_results, uint16 result, uint16 reason, @@ -1225,5 +1222,6 @@ void pstrcpy(char *dest, char *src); char *align4(char *q, char *base); char *align2(char *q, char *base); char *align_offset(char *q, char *base, int align_offset_len); +void print_asc(int level, unsigned char *buf,int len); void dump_data(int level,char *buf1,int len); char *tab_depth(int depth); diff --git a/source3/include/smb.h b/source3/include/smb.h index f0ab45fb37..24cb279f43 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -606,10 +606,9 @@ typedef struct rpc_hdr_bba_info } RPC_HDR_BBA; -/* RPC_HDR_RB - ms req bind header */ -typedef struct rpc_hdr_rb_info +/* RPC_BIND_REQ - ms req bind */ +typedef struct rpc_bind_req_info { - RPC_HDR hdr; RPC_HDR_BBA bba; uint32 num_elements; /* the number of elements (0x1) */ @@ -638,7 +637,6 @@ typedef struct rpc_results_info /* RPC_HDR_BA */ typedef struct rpc_hdr_ba_info { - RPC_HDR hdr; RPC_HDR_BBA bba; RPC_ADDR_STR addr ; /* the secondary address string, as described earlier */ -- cgit From b925b3d20c8e85c7b65a0ad599248443ae12905c Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 29 Oct 1997 01:05:46 +0000 Subject: added frag field to make_rpc_hdr() function (This used to be commit 6b0e51929495582bc48a4d5fba24aa7c1f7caaf6) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index fe35c3592e..10b0f0b796 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -945,7 +945,7 @@ void make_sam_info(DOM_SAM_INFO *sam, DOM_ID_INFO_1 *id1); char* smb_io_sam_info(BOOL io, DOM_SAM_INFO *sam, char *q, char *base, int align, int depth); char* smb_io_gid(BOOL io, DOM_GID *gid, char *q, char *base, int align, int depth); -void make_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, +void make_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 frag, uint32 call_id, int data_len); char* smb_io_rpc_hdr(BOOL io, RPC_HDR *rpc, char *q, char *base, int align, int depth); void make_rpc_iface(RPC_IFACE *ifc, char data[16], uint32 version); -- cgit From 4fd96fddd2b13f60c4eb13263bac2a62a2795dcc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 29 Oct 1997 01:59:54 +0000 Subject: clean up the hash entry code a bit. Got rid of lp_shmem_hash_size() and made it private to the 2 shmem implementations. Added new shmops->hash_size() function. Added code to handle the IPC system limits by looping decreasing the size of the resources (semaphores and shared memory) that we request until we get under the system limits, which can be quite low on some systems! Added checks that the creator of the IPC objects is root. Otherwise we would be open to a security hole where someone pre-creates the shared memory segment and attaches. (This used to be commit 6b6f624b63137d4750200e8cb4961b1402513632) --- source3/include/proto.h | 5 ++--- source3/include/smb.h | 10 +--------- 2 files changed, 3 insertions(+), 12 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 10b0f0b796..944e92e450 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -245,7 +245,6 @@ int lp_passwordlevel(void); int lp_usernamelevel(void); int lp_readsize(void); int lp_shmem_size(void); -int lp_shmem_hash_size(void); int lp_deadtime(void); int lp_maxprotocol(void); int lp_security(void); @@ -880,11 +879,11 @@ int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); /*The following definitions come from shmem.c */ -struct shmem_ops *smb_shm_open(char *file_name, int size, int ronly); +struct shmem_ops *smb_shm_open(int ronly); /*The following definitions come from shmem_sysv.c */ -struct shmem_ops *sysv_shm_open(int size, int ronly); +struct shmem_ops *sysv_shm_open(int ronly); /*The following definitions come from smbdes.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index 24cb279f43..ab1ff0557f 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -44,15 +44,6 @@ #define SHMEM_SIZE 102400 #endif -/* Default number of hash buckets used in shared memory share mode */ -#ifndef SHMEM_HASH_SIZE -#ifdef SEMMSL -#define SHMEM_HASH_SIZE (SEMMSL-1) -#else -#define SHMEM_HASH_SIZE 15 -#endif -#endif - #define NMB_PORT 137 #define DGRAM_PORT 138 #define SMB_PORT 139 @@ -1425,6 +1416,7 @@ struct shmem_ops { BOOL (*lock_hash_entry)(unsigned int); BOOL (*unlock_hash_entry)( unsigned int ); BOOL (*get_usage)(int *,int *,int *); + unsigned (*hash_size)(void); }; -- cgit From a2cbf43a6d6166ac35513e2cc78b98736345181e Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 29 Oct 1997 13:24:42 +0000 Subject: split ntclient.c down into appropriate modules. (This used to be commit 50d7e4d6f6b5d770742ee83523d6146cf51f8259) --- source3/include/proto.h | 38 ++++++++++++++++++++++++++++++++++++++ source3/include/smb.h | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 944e92e450..a02fa86bb9 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -656,6 +656,44 @@ void sync_browse_lists(struct subnet_record *d, struct work_record *work, BOOL do_nt_login(char *desthost, char *myhostname, int Client, int cnum); +/*The following definitions come from ntclientlsa.c */ + +BOOL do_lsa_open_policy(uint16 fnum, uint32 call_id, + char *server_name, LSA_POL_HND *hnd); +BOOL do_lsa_query_info_pol(uint16 fnum, uint32 call_id, + LSA_POL_HND *hnd, uint16 info_class, + fstring domain_name, pstring domain_sid); +BOOL do_lsa_close(uint16 fnum, uint32 call_id, + LSA_POL_HND *hnd); + +/*The following definitions come from ntclientnet.c */ + +BOOL do_lsa_req_chal(uint16 fnum, uint32 call_id, + char *desthost, char *myhostname, + DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal); +BOOL do_lsa_auth2(uint16 fnum, uint32 call_id, + char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name, + DOM_CHAL *clnt_chal, uint32 neg_flags, DOM_CHAL *srv_chal); +BOOL do_lsa_sam_logon(uint16 fnum, uint32 call_id, + uint32 sess_key[2], DOM_CRED *sto_clnt_cred, + char *logon_srv, char *comp_name, + DOM_CRED *clnt_cred, DOM_CRED *rtn_cred, + uint16 logon_level, uint16 switch_value, DOM_ID_INFO_1 *id1, + LSA_USER_INFO *user_info, + DOM_CRED *srv_cred); +BOOL do_lsa_sam_logoff(uint16 fnum, uint32 call_id, + uint32 sess_key[2], DOM_CRED *sto_clnt_cred, + char *logon_srv, char *comp_name, + DOM_CRED *clnt_cred, DOM_CRED *rtn_cred, + uint16 logon_level, uint16 switch_value, DOM_ID_INFO_1 *id1, + DOM_CRED *srv_cred); + +/*The following definitions come from ntclientpipe.c */ + +uint16 open_rpc_pipe(char *inbuf, char *outbuf, char *rname, int Client, int cnum); +BOOL bind_rpc_pipe(char *pipe_name, uint16 fnum, uint32 call_id, + RPC_IFACE *abstract, RPC_IFACE *transfer); + /*The following definitions come from params.c */ BOOL pm_process( char *FileName, diff --git a/source3/include/smb.h b/source3/include/smb.h index ab1ff0557f..62c3fec19d 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -584,7 +584,7 @@ typedef struct rpc_iface_info typedef struct rpc_addr_info { uint16 len; /* length of the string including null terminator */ - fstring addr; /* the string above in single byte, null terminated form */ + fstring str; /* the string above in single byte, null terminated form */ } RPC_ADDR_STR; -- cgit From 26f5e4f25cdfe41d77662224ec942cfffbb5a6fe Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 29 Oct 1997 15:38:31 +0000 Subject: preparing for release of 1.9.18alpha7 (This used to be commit dceace804ea3efa8de6ab31fb44acdc10d46ed73) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 9e7e289294..790f173de3 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.18alpha6" +#define VERSION "1.9.18alpha7" -- cgit From 520878fd1f440a7313cedb4827bdc81454d94d20 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 29 Oct 1997 19:05:34 +0000 Subject: ipc.c ntclientpipe.c: response to Bind Acknowledgment needs a lookup table for the PIPE string (secondary address in RPC_HDR_BA structure). smbparse.c util.c : interesting problem, i think caused by us typecasting a uint16* buffer to char*. found on a SPARC. (This used to be commit 420408ee83902faa6cf871f26e93ad5efb483727) --- source3/include/proto.h | 1 + source3/include/smb.h | 1 + 2 files changed, 2 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index a02fa86bb9..ee7bd41dbd 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1251,6 +1251,7 @@ enum remote_arch_types get_remote_arch(); char *skip_unicode_string(char *buf,int n); char *unistrn2(uint16 *buf, int len); char *unistr2(uint16 *buf); +int struni2(uint16 *p, char *buf); char *unistr(char *buf); int unistrncpy(char *dst, char *src, int len); int unistrcpy(char *dst, char *src); diff --git a/source3/include/smb.h b/source3/include/smb.h index 62c3fec19d..9b54385eee 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -260,6 +260,7 @@ typedef fstring string; #define PIPE_SRVSVC "\\PIPE\\srvsvc" #define PIPE_NETLOGON "\\PIPE\\NETLOGON" #define PIPE_NTLSA "\\PIPE\\ntlsa" +#define PIPE_LSASS "\\PIPE\\lsass" #define PIPE_LSARPC "\\PIPE\\lsarpc" /* NETLOGON opcodes and data structures */ -- cgit From 77cc0d6bac0db80caded81bee90ac7b8e3c9f67c Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 29 Oct 1997 19:58:20 +0000 Subject: typecast in calls to print_asc() wrong (This used to be commit 4088683ee046783678d4f748ddb03b5907d00506) --- source3/include/byteorder.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h index 7326ec2abe..823b75567b 100644 --- a/source3/include/byteorder.h +++ b/source3/include/byteorder.h @@ -206,7 +206,7 @@ it also defines lots of intermediate macros, just ignore those :-) RW_PCVAL(read,inbuf,outbuf,len) \ DEBUG(5,("%s%04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ - if (charmode) print_asc(5, (char*)(outbuf), (len)); else \ + if (charmode) print_asc(5, (unsigned char*)(outbuf), (len)); else \ { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%02x ", CVAL(&((outbuf)[idx]), 0))); } } \ DEBUG(5,("\n")); @@ -214,7 +214,7 @@ it also defines lots of intermediate macros, just ignore those :-) RW_PSVAL(read,inbuf,outbuf,len) \ DEBUG(5,("%s%04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ - if (charmode) print_asc(5, (char*)(outbuf), 2*(len)); else \ + if (charmode) print_asc(5, (unsigned char*)(outbuf), 2*(len)); else \ { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%04x ", SVAL(&((outbuf)[idx]), 0))); } } \ DEBUG(5,("\n")); @@ -222,7 +222,7 @@ it also defines lots of intermediate macros, just ignore those :-) RW_PIVAL(read,inbuf,outbuf,len) \ DEBUG(5,("%s%04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ - if (charmode) print_asc(5, (char*)(outbuf), 4*(len)); else \ + if (charmode) print_asc(5, (unsigned char*)(outbuf), 4*(len)); else \ { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%08x ", IVAL(&((outbuf)[idx]), 0))); } } \ DEBUG(5,("\n")); -- cgit From 21fda98dc9412eaff34c54762f3c56fa3e099458 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 29 Oct 1997 20:23:01 +0000 Subject: byteorder.h : have another go at reporting stuff the right way round (on SPARCs) srvparse.c : copyright messages (This used to be commit 4b54d22d59d3f6719e7ce8bbbf3e40da31cd270e) --- source3/include/byteorder.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h index 823b75567b..4d972a5cac 100644 --- a/source3/include/byteorder.h +++ b/source3/include/byteorder.h @@ -207,7 +207,7 @@ it also defines lots of intermediate macros, just ignore those :-) DEBUG(5,("%s%04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ if (charmode) print_asc(5, (unsigned char*)(outbuf), (len)); else \ - { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%02x ", CVAL(&((outbuf)[idx]), 0))); } } \ + { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%02x ", (outbuf)[idx])); } } \ DEBUG(5,("\n")); #define DBG_RW_PSVAL(charmode,string,depth,base,read,inbuf,outbuf,len) \ @@ -215,7 +215,7 @@ it also defines lots of intermediate macros, just ignore those :-) DEBUG(5,("%s%04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ if (charmode) print_asc(5, (unsigned char*)(outbuf), 2*(len)); else \ - { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%04x ", SVAL(&((outbuf)[idx]), 0))); } } \ + { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%04x ", (outbuf)[idx])); } } \ DEBUG(5,("\n")); #define DBG_RW_PIVAL(charmode,string,depth,base,read,inbuf,outbuf,len) \ @@ -223,7 +223,7 @@ it also defines lots of intermediate macros, just ignore those :-) DEBUG(5,("%s%04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ if (charmode) print_asc(5, (unsigned char*)(outbuf), 4*(len)); else \ - { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%08x ", IVAL(&((outbuf)[idx]), 0))); } } \ + { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%08x ", (outbuf)[idx])); } } \ DEBUG(5,("\n")); #define DBG_RW_CVAL(string,depth,base,read,inbuf,outbuf) \ -- cgit From 4da6236108d131b8e26b8fab1f468f506af04aa3 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 29 Oct 1997 21:20:34 +0000 Subject: preparing for release of 1.9.18alpha8 (This used to be commit 48548526e8bef3cdc6f5d202bb6c7849e7862e48) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 790f173de3..b32566cc2f 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.18alpha7" +#define VERSION "1.9.18alpha8" -- cgit From a275e5d4e16142a9924f8b97980f364a80df3b64 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 30 Oct 1997 01:05:13 +0000 Subject: removed mechanism that created actual files NETLOGON, lsarpc and the like, which are pipes on the IPC$ connection. created mechanism to record pipe names in a separate pipes_struct. it is planned to expand this, to return sensible things like interface structures, and policy handles (RPC_IFACE and LSA_POL_HND). and the like. (This used to be commit 33cce5fac0e2f818a19a6c4e6a797ef44f3b5c75) --- source3/include/proto.h | 2 ++ source3/include/smb.h | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index ee7bd41dbd..00c95587ba 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -746,7 +746,9 @@ BOOL api_ntLsarpcTNP(int cnum,int uid, char *param,char *data, /*The following definitions come from pipes.c */ +char *get_pipe_name(int pnum); int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_pipe_close(char *inbuf,char *outbuf); BOOL api_LsarpcSNPHS(int cnum,int uid, char *param,char *data, int mdrcnt,int mprcnt, char **rdata,char **rparam, diff --git a/source3/include/smb.h b/source3/include/smb.h index 9b54385eee..8f0bd31bf4 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -297,6 +297,7 @@ enum RPC_PKT_TYPE #define LSA_REQCHAL 0x04 #define LSA_SRVPWSET 0x06 #define LSA_SAMLOGON 0x02 +#define LSA_SAMLOGOFF 0x03 #define LSA_AUTH2 0x0f #define LSA_CLOSE 0x00 @@ -304,7 +305,6 @@ enum RPC_PKT_TYPE #define LSA_OPENSECRET 0xFF #define LSA_LOOKUPSIDS 0xFE #define LSA_LOOKUPNAMES 0xFD -#define LSA_SAMLOGOFF 0xFC /* srvsvc pipe */ #define NETSERVERGETINFO 0x15 @@ -678,6 +678,7 @@ typedef struct object_attributes_info /* LSA_Q_OPEN_POL - LSA Query Open Policy */ typedef struct lsa_q_open_pol_info { + uint32 ptr; /* undocumented buffer pointer */ UNISTR2 uni_server_name; /* server name, starting with two '\'s */ LSA_OBJ_ATTR attr ; /* object attributes */ -- cgit From 6f3623285e4b7933121673f7649bdc2ea80e0ec7 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 30 Oct 1997 01:13:34 +0000 Subject: preparing for release of 1.9.18alpha9 (This used to be commit 9212c93beefa83be349b250fe98b65e07d842038) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index b32566cc2f..8e8b31b3c3 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.18alpha8" +#define VERSION "1.9.18alpha9" -- cgit From 628d7993d52dff920f52fdbc8e672ae840b9a607 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 30 Oct 1997 08:44:29 +0000 Subject: moved ubi_ modules back into the ubiqx directory. I've added a very simple (and portable) method for having separate source directories. This should also help when we add directories for the various ports. A unix directory would make sense. (This used to be commit dc8998b1d3c119665538eb5e0b133a47f89fed19) --- source3/include/includes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 4c7ec56367..518f6249e9 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -117,7 +117,6 @@ by the previous section */ #include "local.h" -#include "ubi_dLinkList.h" #include #ifdef POSIX_STDLIBH #include @@ -1126,6 +1125,7 @@ extern char *sys_errlist[]; #include "version.h" #include "smb.h" #include "nameserv.h" +#include "ubiqx/ubi_dLinkList.h" #include "proto.h" #include "byteorder.h" -- cgit From 397e1d64d7cfe7381b561ebae57dbceeb87b07ea Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 30 Oct 1997 08:50:18 +0000 Subject: Chris will be pleased to know that mkproto.awk no longer runs on the ubiqx files :-) (This used to be commit 13d90255928711c05d8e147081afa309b8abf1af) --- source3/include/proto.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 00c95587ba..07011b2256 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1099,9 +1099,6 @@ int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize); int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize); int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize); -/*The following definitions come from ubi_dLinkList.c */ - - /*The following definitions come from ufc.c */ char *ufc_crypt(char *key,char *salt); -- cgit From f1093ad693d1650bcc50b5c7dd9b5a0356088cde Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 30 Oct 1997 15:42:40 +0000 Subject: Makefiles for libraries. the dependencies aren't quite right, and i don't know how to sort them. make proto in each library directory. over-ride the make proto for ubiqx, so that it doesn't happen, but throws up a warning instead. (This used to be commit 93df2c62cc32191e88c0c4e615ac6077ec2b07c3) --- source3/include/includes.h | 8 +- source3/include/proto.h | 210 --------------------------------------------- 2 files changed, 7 insertions(+), 211 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 518f6249e9..055e633846 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -1126,12 +1126,18 @@ extern char *sys_errlist[]; #include "smb.h" #include "nameserv.h" #include "ubiqx/ubi_dLinkList.h" -#include "proto.h" + #include "byteorder.h" #include "kanji.h" #include "charset.h" +/***** automatically generated prototypes *****/ +#include "rpc_pipes/rpc_proto.h" +#include "proto.h" + + + #ifndef S_IFREG #define S_IFREG 0100000 #endif diff --git a/source3/include/proto.h b/source3/include/proto.h index 07011b2256..c6f98875bc 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -373,42 +373,6 @@ struct share_ops *locking_shm_init(int ronly); struct share_ops *locking_slow_init(int ronly); -/*The following definitions come from lsaparse.c */ - -void make_q_open_pol(LSA_Q_OPEN_POL *r_q, char *server_name, - uint32 attributes, uint32 sec_qos, - uint16 desired_access); -char* lsa_io_q_open_pol(BOOL io, LSA_Q_OPEN_POL *r_q, char *q, char *base, int align, int depth); -char* lsa_io_r_open_pol(BOOL io, LSA_R_OPEN_POL *r_p, char *q, char *base, int align, int depth); -void make_q_query(LSA_Q_QUERY_INFO *q_q, LSA_POL_HND *hnd, uint16 info_class); -char* lsa_io_q_query(BOOL io, LSA_Q_QUERY_INFO *q_q, char *q, char *base, int align, int depth); -void make_q_close(LSA_Q_CLOSE *q_c, LSA_POL_HND *hnd); -char* lsa_io_q_close(BOOL io, LSA_Q_CLOSE *q_c, char *q, char *base, int align, int depth); -void make_r_close(LSA_R_CLOSE *q_r, LSA_POL_HND *hnd); -char* lsa_io_r_close(BOOL io, LSA_R_CLOSE *r_c, char *q, char *base, int align, int depth); -char* lsa_io_r_query(BOOL io, LSA_R_QUERY_INFO *r_q, char *q, char *base, int align, int depth); -char* lsa_io_q_lookup_sids(BOOL io, LSA_Q_LOOKUP_SIDS *q_s, char *q, char *base, int align, int depth); -char* lsa_io_r_lookup_sids(BOOL io, LSA_R_LOOKUP_SIDS *r_s, char *q, char *base, int align, int depth); -char* lsa_io_q_lookup_rids(BOOL io, LSA_Q_LOOKUP_RIDS *q_r, char *q, char *base, int align, int depth); -char* lsa_io_r_lookup_rids(BOOL io, LSA_R_LOOKUP_RIDS *r_r, char *q, char *base, int align, int depth); -void make_q_req_chal(LSA_Q_REQ_CHAL *q_c, - char *logon_srv, char *logon_clnt, - DOM_CHAL *clnt_chal); -char* lsa_io_q_req_chal(BOOL io, LSA_Q_REQ_CHAL *q_c, char *q, char *base, int align, int depth); -char* lsa_io_r_req_chal(BOOL io, LSA_R_REQ_CHAL *r_c, char *q, char *base, int align, int depth); -void make_q_auth_2(LSA_Q_AUTH_2 *q_a, - char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name, - DOM_CHAL *clnt_chal, uint32 clnt_flgs); -char* lsa_io_q_auth_2(BOOL io, LSA_Q_AUTH_2 *q_a, char *q, char *base, int align, int depth); -char* lsa_io_r_auth_2(BOOL io, LSA_R_AUTH_2 *r_a, char *q, char *base, int align, int depth); -char* lsa_io_q_srv_pwset(BOOL io, LSA_Q_SRV_PWSET *q_s, char *q, char *base, int align, int depth); -char* lsa_io_r_srv_pwset(BOOL io, LSA_R_SRV_PWSET *r_s, char *q, char *base, int align, int depth); -char* lsa_io_user_info(BOOL io, LSA_USER_INFO *usr, char *q, char *base, int align, int depth); -char* lsa_io_q_sam_logon(BOOL io, LSA_Q_SAM_LOGON *q_l, char *q, char *base, int align, int depth); -char* lsa_io_r_sam_logon(BOOL io, LSA_R_SAM_LOGON *r_l, char *q, char *base, int align, int depth); -char* lsa_io_q_sam_logoff(BOOL io, LSA_Q_SAM_LOGOFF *q_l, char *q, char *base, int align, int depth); -char* lsa_io_r_sam_logoff(BOOL io, LSA_R_SAM_LOGOFF *r_l, char *q, char *base, int align, int depth); - /*The following definitions come from mangle.c */ int str_checksum(char *s); @@ -656,44 +620,6 @@ void sync_browse_lists(struct subnet_record *d, struct work_record *work, BOOL do_nt_login(char *desthost, char *myhostname, int Client, int cnum); -/*The following definitions come from ntclientlsa.c */ - -BOOL do_lsa_open_policy(uint16 fnum, uint32 call_id, - char *server_name, LSA_POL_HND *hnd); -BOOL do_lsa_query_info_pol(uint16 fnum, uint32 call_id, - LSA_POL_HND *hnd, uint16 info_class, - fstring domain_name, pstring domain_sid); -BOOL do_lsa_close(uint16 fnum, uint32 call_id, - LSA_POL_HND *hnd); - -/*The following definitions come from ntclientnet.c */ - -BOOL do_lsa_req_chal(uint16 fnum, uint32 call_id, - char *desthost, char *myhostname, - DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal); -BOOL do_lsa_auth2(uint16 fnum, uint32 call_id, - char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name, - DOM_CHAL *clnt_chal, uint32 neg_flags, DOM_CHAL *srv_chal); -BOOL do_lsa_sam_logon(uint16 fnum, uint32 call_id, - uint32 sess_key[2], DOM_CRED *sto_clnt_cred, - char *logon_srv, char *comp_name, - DOM_CRED *clnt_cred, DOM_CRED *rtn_cred, - uint16 logon_level, uint16 switch_value, DOM_ID_INFO_1 *id1, - LSA_USER_INFO *user_info, - DOM_CRED *srv_cred); -BOOL do_lsa_sam_logoff(uint16 fnum, uint32 call_id, - uint32 sess_key[2], DOM_CRED *sto_clnt_cred, - char *logon_srv, char *comp_name, - DOM_CRED *clnt_cred, DOM_CRED *rtn_cred, - uint16 logon_level, uint16 switch_value, DOM_ID_INFO_1 *id1, - DOM_CRED *srv_cred); - -/*The following definitions come from ntclientpipe.c */ - -uint16 open_rpc_pipe(char *inbuf, char *outbuf, char *rname, int Client, int cnum); -BOOL bind_rpc_pipe(char *pipe_name, uint16 fnum, uint32 call_id, - RPC_IFACE *abstract, RPC_IFACE *transfer); - /*The following definitions come from params.c */ BOOL pm_process( char *FileName, @@ -729,53 +655,6 @@ BOOL server_validate(char *user, char *domain, BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); void pcap_printer_fn(void (*fn)()); -/*The following definitions come from pipenetlog.c */ - -BOOL get_md4pw(char *md4pw, char *mach_acct); -BOOL api_netlogrpcTNP(int cnum,int uid, char *param,char *data, - int mdrcnt,int mprcnt, - char **rdata,char **rparam, - int *rdata_len,int *rparam_len); - -/*The following definitions come from pipentlsa.c */ - -BOOL api_ntLsarpcTNP(int cnum,int uid, char *param,char *data, - int mdrcnt,int mprcnt, - char **rdata,char **rparam, - int *rdata_len,int *rparam_len); - -/*The following definitions come from pipes.c */ - -char *get_pipe_name(int pnum); -int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_pipe_close(char *inbuf,char *outbuf); -BOOL api_LsarpcSNPHS(int cnum,int uid, char *param,char *data, - int mdrcnt,int mprcnt, - char **rdata,char **rparam, - int *rdata_len,int *rparam_len); -BOOL api_LsarpcTNP(int cnum,int uid, char *param,char *data, - int mdrcnt,int mprcnt, - char **rdata,char **rparam, - int *rdata_len,int *rparam_len); - -/*The following definitions come from pipesrvsvc.c */ - -BOOL api_srvsvcTNP(int cnum,int uid, char *param,char *data, - int mdrcnt,int mprcnt, - char **rdata,char **rparam, - int *rdata_len,int *rparam_len); - -/*The following definitions come from pipeutil.c */ - -void initrpcreply(char *inbuf, char *q); -void endrpcreply(char *inbuf, char *q, int datalen, int rtnval, int *rlen); -BOOL name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); -char *dom_sid_to_string(DOM_SID *sid); -int make_dom_sids(char *sids_str, DOM_SID *sids, int max_sids); -int make_dom_gids(char *gids_str, DOM_GID *gids); -int create_rpc_request(uint32 call_id, uint8 op_num, char *q, int data_len); -int create_rpc_reply(uint32 call_id, char *q, int data_len); - /*The following definitions come from predict.c */ int read_predict(int fd,int offset,char *buf,char **ptr,int num); @@ -939,87 +818,6 @@ void E_md4hash(uchar *passwd, uchar *p16); void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); void nt_lm_owf_gen(char *pwd, char *nt_p16, char *p16); -/*The following definitions come from smbparse.c */ - -char* smb_io_utime(BOOL io, UTIME *t, char *q, char *base, int align, int depth); -char* smb_io_time(BOOL io, NTTIME *nttime, char *q, char *base, int align, int depth); -void make_dom_sid(DOM_SID *sid, char *domsid); -char* smb_io_dom_sid(BOOL io, DOM_SID *sid, char *q, char *base, int align, int depth); -void make_uni_hdr(UNIHDR *hdr, int max_len, int len, uint16 terminate); -char* smb_io_unihdr(BOOL io, UNIHDR *hdr, char *q, char *base, int align, int depth); -void make_uni_hdr2(UNIHDR2 *hdr, int max_len, int len, uint16 terminate); -char* smb_io_unihdr2(BOOL io, UNIHDR2 *hdr2, char *q, char *base, int align, int depth); -void make_unistr(UNISTR *str, char *buf); -char* smb_io_unistr(BOOL io, UNISTR *uni, char *q, char *base, int align, int depth); -void make_unistr2(UNISTR2 *str, char *buf, int len); -char* smb_io_unistr2(BOOL io, UNISTR2 *uni2, char *q, char *base, int align, int depth); -void make_dom_sid2(DOM_SID2 *sid2, char *sid_str); -char* smb_io_dom_sid2(BOOL io, DOM_SID2 *sid2, char *q, char *base, int align, int depth); -void make_dom_rid2(DOM_RID2 *rid2, uint32 rid); -char* smb_io_dom_rid2(BOOL io, DOM_RID2 *rid2, char *q, char *base, int align, int depth); -void make_clnt_srv(DOM_CLNT_SRV *log, char *logon_srv, char *comp_name); -char* smb_io_clnt_srv(BOOL io, DOM_CLNT_SRV *log, char *q, char *base, int align, int depth); -void make_log_info(DOM_LOG_INFO *log, char *logon_srv, char *acct_name, - uint16 sec_chan, char *comp_name); -char* smb_io_log_info(BOOL io, DOM_LOG_INFO *log, char *q, char *base, int align, int depth); -char* smb_io_chal(BOOL io, DOM_CHAL *chal, char *q, char *base, int align, int depth); -char* smb_io_cred(BOOL io, DOM_CRED *cred, char *q, char *base, int align, int depth); -void make_clnt_info2(DOM_CLNT_INFO2 *clnt, - char *logon_srv, char *comp_name, - DOM_CRED *clnt_cred); -char* smb_io_clnt_info2(BOOL io, DOM_CLNT_INFO2 *clnt, char *q, char *base, int align, int depth); -char* smb_io_clnt_info(BOOL io, DOM_CLNT_INFO *clnt, char *q, char *base, int align, int depth); -void make_logon_id(DOM_LOGON_ID *log, uint32 log_id_low, uint32 log_id_high); -char* smb_io_logon_id(BOOL io, DOM_LOGON_ID *log, char *q, char *base, int align, int depth); -void make_arc4_owf(ARC4_OWF *hash, char data[16]); -char* smb_io_arc4_owf(BOOL io, ARC4_OWF *hash, char *q, char *base, int align, int depth); -void make_id_info1(DOM_ID_INFO_1 *id, char *domain_name, - uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high, - char *user_name, char *wksta_name, - char arc4_lm_owf[16], char arc4_nt_owf[16]); -char* smb_io_id_info1(BOOL io, DOM_ID_INFO_1 *id, char *q, char *base, int align, int depth); -void make_sam_info(DOM_SAM_INFO *sam, - char *logon_srv, char *comp_name, DOM_CRED *clnt_cred, - DOM_CRED *rtn_cred, uint16 logon_level, uint16 switch_value, - DOM_ID_INFO_1 *id1); -char* smb_io_sam_info(BOOL io, DOM_SAM_INFO *sam, char *q, char *base, int align, int depth); -char* smb_io_gid(BOOL io, DOM_GID *gid, char *q, char *base, int align, int depth); -void make_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 frag, - uint32 call_id, int data_len); -char* smb_io_rpc_hdr(BOOL io, RPC_HDR *rpc, char *q, char *base, int align, int depth); -void make_rpc_iface(RPC_IFACE *ifc, char data[16], uint32 version); -char* smb_io_rpc_iface(BOOL io, RPC_IFACE *ifc, char *q, char *base, int align, int depth); -void make_rpc_addr_str(RPC_ADDR_STR *str, char *name); -char* smb_io_rpc_addr_str(BOOL io, RPC_ADDR_STR *str, char *q, char *base, int align, int depth); -void make_rpc_hdr_bba(RPC_HDR_BBA *bba, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid); -char* smb_io_rpc_hdr_bba(BOOL io, RPC_HDR_BBA *rpc, char *q, char *base, int align, int depth); -void make_rpc_hdr_rb(RPC_HDR_RB *rpc, - uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, - uint32 num_elements, uint16 context_id, uint8 num_syntaxes, - RPC_IFACE *abstract, RPC_IFACE *transfer); -char* smb_io_rpc_hdr_rb(BOOL io, RPC_HDR_RB *rpc, char *q, char *base, int align, int depth); -void make_rpc_results(RPC_RESULTS *res, - uint8 num_results, uint16 result, uint16 reason); -char* smb_io_rpc_results(BOOL io, RPC_RESULTS *res, char *q, char *base, int align, int depth); -void make_rpc_hdr_ba(RPC_HDR_BA *rpc, - uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, - char *pipe_addr, - uint8 num_results, uint16 result, uint16 reason, - RPC_IFACE *transfer); -char* smb_io_rpc_hdr_ba(BOOL io, RPC_HDR_BA *rpc, char *q, char *base, int align, int depth); -void make_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, uint32 sec_qos); -char* smb_io_obj_attr(BOOL io, LSA_OBJ_ATTR *attr, char *q, char *base, int align, int depth); -void make_rpc_hdr_rr(RPC_HDR_RR *hdr, enum RPC_PKT_TYPE pkt_type, - uint32 call_id, int data_len, uint8 opnum); -char* smb_io_rpc_hdr_rr(BOOL io, RPC_HDR_RR *rpc, char *q, char *base, int align, int depth); -char* smb_io_pol_hnd(BOOL io, LSA_POL_HND *pol, char *q, char *base, int align, int depth); -char* smb_io_dom_query_3(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align, int depth); -char* smb_io_dom_query_5(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align, int depth); -char* smb_io_dom_query(BOOL io, DOM_QUERY *d_q, char *q, char *base, int align, int depth); -char* smb_io_dom_r_ref(BOOL io, DOM_R_REF *r_r, char *q, char *base, int align, int depth); -char* smb_io_dom_name(BOOL io, DOM_NAME *name, char *q, char *base, int align, int depth); -char* smb_io_neg_flags(BOOL io, NEG_FLAGS *neg, char *q, char *base, int align, int depth); - /*The following definitions come from smbpass.c */ int pw_file_lock(char *name, int type, int secs); @@ -1032,14 +830,6 @@ struct smb_passwd *get_smbpwnam(char *name); /*The following definitions come from smbrun.c */ -/*The following definitions come from srvparse.c */ - -char* srv_io_share_info1_str(BOOL io, SH_INFO_1_STR *sh1, char *q, char *base, int align, int depth); -char* srv_io_share_info1(BOOL io, SH_INFO_1 *sh1, char *q, char *base, int align, int depth); -char* srv_io_share_1_ctr(BOOL io, SHARE_INFO_1_CTR *ctr, char *q, char *base, int align, int depth); -char* srv_io_q_net_share_enum(BOOL io, SRV_Q_NET_SHARE_ENUM *q_n, char *q, char *base, int align, int depth); -char* srv_io_r_net_share_enum(BOOL io, SRV_R_NET_SHARE_ENUM *r_n, char *q, char *base, int align, int depth); - /*The following definitions come from status.c */ void Ucrit_addUsername(pstring username); -- cgit From 739a730637b8320dce85c12686a4d4647990824d Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 30 Oct 1997 17:08:42 +0000 Subject: Makefile: simply adding pipes.o to SMBDOBJ3. rpc_pipes/pipe_hnd.c : created pipe handles module. pipes.c server.c : use of pipe_hnd functions in SMBopenX and SMBclose, on the IPC$ pipe. (This used to be commit ada256b5e3b9fb0db988e3be7d47943e7c19b3fb) --- source3/include/proto.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index c6f98875bc..f9d1044505 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -655,6 +655,19 @@ BOOL server_validate(char *user, char *domain, BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); void pcap_printer_fn(void (*fn)()); +/*The following definitions come from pipes.c */ + +int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_pipe_close(char *inbuf,char *outbuf); +BOOL api_LsarpcSNPHS(int cnum,int uid, char *param,char *data, + int mdrcnt,int mprcnt, + char **rdata,char **rparam, + int *rdata_len,int *rparam_len); +BOOL api_LsarpcTNP(int cnum,int uid, char *param,char *data, + int mdrcnt,int mprcnt, + char **rdata,char **rparam, + int *rdata_len,int *rparam_len); + /*The following definitions come from predict.c */ int read_predict(int fd,int offset,char *buf,char **ptr,int num); -- cgit From 55e2dc7c6f4378adfdcbd166b2680096a3e4a5a4 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 30 Oct 1997 21:51:15 +0000 Subject: storing pipe name state (from set named pipe handle state call) in the pipes array. (This used to be commit 5335d5cdc4659f4676958f0399e2de29a117c133) --- source3/include/proto.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index f9d1044505..d417d82f93 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -659,10 +659,7 @@ void pcap_printer_fn(void (*fn)()); int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize); int reply_pipe_close(char *inbuf,char *outbuf); -BOOL api_LsarpcSNPHS(int cnum,int uid, char *param,char *data, - int mdrcnt,int mprcnt, - char **rdata,char **rparam, - int *rdata_len,int *rparam_len); +BOOL api_LsarpcSNPHS(int pnum, int cnum, char *param); BOOL api_LsarpcTNP(int cnum,int uid, char *param,char *data, int mdrcnt,int mprcnt, char **rdata,char **rparam, -- cgit From d5fdd84ffa78c1ce8211c2c5794b057c72bf1947 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 31 Oct 1997 02:40:55 +0000 Subject: - cleanup some warnings - redo the prototypes (This used to be commit 31dcb51e05914d49d81a3faef354aaf0ab9fa63f) --- source3/include/proto.h | 226 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 209 insertions(+), 17 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index d417d82f93..949d2472a9 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -606,10 +606,6 @@ void make_nmb_name(struct nmb_name *n,char *name,int type,char *this_scope); BOOL send_packet(struct packet_struct *p); struct packet_struct *receive_packet(int fd,enum packet_type type,int t); -/*The following definitions come from nmblookup.c */ - -int main(int argc,char *argv[]); - /*The following definitions come from nmbsync.c */ void sync_browse_lists(struct subnet_record *d, struct work_record *work, @@ -754,6 +750,212 @@ int reply_writebs(char *inbuf,char *outbuf); int reply_setattrE(char *inbuf,char *outbuf); int reply_getattrE(char *inbuf,char *outbuf); +/*The following definitions come from rpc_pipes/lsaparse.c */ + +void make_q_open_pol(LSA_Q_OPEN_POL *r_q, char *server_name, + uint32 attributes, uint32 sec_qos, + uint16 desired_access); +char* lsa_io_q_open_pol(BOOL io, LSA_Q_OPEN_POL *r_q, char *q, char *base, int align, int depth); +char* lsa_io_r_open_pol(BOOL io, LSA_R_OPEN_POL *r_p, char *q, char *base, int align, int depth); +void make_q_query(LSA_Q_QUERY_INFO *q_q, LSA_POL_HND *hnd, uint16 info_class); +char* lsa_io_q_query(BOOL io, LSA_Q_QUERY_INFO *q_q, char *q, char *base, int align, int depth); +void make_q_close(LSA_Q_CLOSE *q_c, LSA_POL_HND *hnd); +char* lsa_io_q_close(BOOL io, LSA_Q_CLOSE *q_c, char *q, char *base, int align, int depth); +void make_r_close(LSA_R_CLOSE *q_r, LSA_POL_HND *hnd); +char* lsa_io_r_close(BOOL io, LSA_R_CLOSE *r_c, char *q, char *base, int align, int depth); +char* lsa_io_r_query(BOOL io, LSA_R_QUERY_INFO *r_q, char *q, char *base, int align, int depth); +char* lsa_io_q_lookup_sids(BOOL io, LSA_Q_LOOKUP_SIDS *q_s, char *q, char *base, int align, int depth); +char* lsa_io_r_lookup_sids(BOOL io, LSA_R_LOOKUP_SIDS *r_s, char *q, char *base, int align, int depth); +char* lsa_io_q_lookup_rids(BOOL io, LSA_Q_LOOKUP_RIDS *q_r, char *q, char *base, int align, int depth); +char* lsa_io_r_lookup_rids(BOOL io, LSA_R_LOOKUP_RIDS *r_r, char *q, char *base, int align, int depth); +void make_q_req_chal(LSA_Q_REQ_CHAL *q_c, + char *logon_srv, char *logon_clnt, + DOM_CHAL *clnt_chal); +char* lsa_io_q_req_chal(BOOL io, LSA_Q_REQ_CHAL *q_c, char *q, char *base, int align, int depth); +char* lsa_io_r_req_chal(BOOL io, LSA_R_REQ_CHAL *r_c, char *q, char *base, int align, int depth); +void make_q_auth_2(LSA_Q_AUTH_2 *q_a, + char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name, + DOM_CHAL *clnt_chal, uint32 clnt_flgs); +char* lsa_io_q_auth_2(BOOL io, LSA_Q_AUTH_2 *q_a, char *q, char *base, int align, int depth); +char* lsa_io_r_auth_2(BOOL io, LSA_R_AUTH_2 *r_a, char *q, char *base, int align, int depth); +char* lsa_io_q_srv_pwset(BOOL io, LSA_Q_SRV_PWSET *q_s, char *q, char *base, int align, int depth); +char* lsa_io_r_srv_pwset(BOOL io, LSA_R_SRV_PWSET *r_s, char *q, char *base, int align, int depth); +char* lsa_io_user_info(BOOL io, LSA_USER_INFO *usr, char *q, char *base, int align, int depth); +char* lsa_io_q_sam_logon(BOOL io, LSA_Q_SAM_LOGON *q_l, char *q, char *base, int align, int depth); +char* lsa_io_r_sam_logon(BOOL io, LSA_R_SAM_LOGON *r_l, char *q, char *base, int align, int depth); +char* lsa_io_q_sam_logoff(BOOL io, LSA_Q_SAM_LOGOFF *q_l, char *q, char *base, int align, int depth); +char* lsa_io_r_sam_logoff(BOOL io, LSA_R_SAM_LOGOFF *r_l, char *q, char *base, int align, int depth); + +/*The following definitions come from rpc_pipes/ntclientlsa.c */ + +BOOL do_lsa_open_policy(uint16 fnum, uint32 call_id, + char *server_name, LSA_POL_HND *hnd); +BOOL do_lsa_query_info_pol(uint16 fnum, uint32 call_id, + LSA_POL_HND *hnd, uint16 info_class, + fstring domain_name, pstring domain_sid); +BOOL do_lsa_close(uint16 fnum, uint32 call_id, + LSA_POL_HND *hnd); + +/*The following definitions come from rpc_pipes/ntclientnet.c */ + +BOOL do_lsa_req_chal(uint16 fnum, uint32 call_id, + char *desthost, char *myhostname, + DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal); +BOOL do_lsa_auth2(uint16 fnum, uint32 call_id, + char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name, + DOM_CHAL *clnt_chal, uint32 neg_flags, DOM_CHAL *srv_chal); +BOOL do_lsa_sam_logon(uint16 fnum, uint32 call_id, + uint32 sess_key[2], DOM_CRED *sto_clnt_cred, + char *logon_srv, char *comp_name, + DOM_CRED *clnt_cred, DOM_CRED *rtn_cred, + uint16 logon_level, uint16 switch_value, DOM_ID_INFO_1 *id1, + LSA_USER_INFO *user_info, + DOM_CRED *srv_cred); +BOOL do_lsa_sam_logoff(uint16 fnum, uint32 call_id, + uint32 sess_key[2], DOM_CRED *sto_clnt_cred, + char *logon_srv, char *comp_name, + DOM_CRED *clnt_cred, DOM_CRED *rtn_cred, + uint16 logon_level, uint16 switch_value, DOM_ID_INFO_1 *id1, + DOM_CRED *srv_cred); + +/*The following definitions come from rpc_pipes/ntclientpipe.c */ + +uint16 rpc_pipe_open(char *inbuf, char *outbuf, char *rname, int Client, int cnum); +BOOL rpc_pipe_set_hnd_state(char *pipe_name, uint16 fnum, uint16 device_state); +BOOL rpc_pipe_bind(char *pipe_name, uint16 fnum, uint32 call_id, + RPC_IFACE *abstract, RPC_IFACE *transfer); + +/*The following definitions come from rpc_pipes/pipe_hnd.c */ + +void init_rpc_pipe_hnd(void); +int open_rpc_pipe_hnd(char *pipe_name, int cnum); +char *get_rpc_pipe_hnd_name(int pnum); +BOOL set_rpc_pipe_hnd_state(int pnum, int cnum, uint16 device_state); +BOOL close_rpc_pipe_hnd(int pnum, int cnum); +int get_rpc_pipe_num(char *buf, int where); + +/*The following definitions come from rpc_pipes/pipenetlog.c */ + +BOOL get_md4pw(char *md4pw, char *mach_acct); +BOOL api_netlogrpcTNP(int cnum,int uid, char *param,char *data, + int mdrcnt,int mprcnt, + char **rdata,char **rparam, + int *rdata_len,int *rparam_len); + +/*The following definitions come from rpc_pipes/pipentlsa.c */ + +BOOL api_ntLsarpcTNP(int cnum,int uid, char *param,char *data, + int mdrcnt,int mprcnt, + char **rdata,char **rparam, + int *rdata_len,int *rparam_len); + +/*The following definitions come from rpc_pipes/pipesrvsvc.c */ + +BOOL api_srvsvcTNP(int cnum,int uid, char *param,char *data, + int mdrcnt,int mprcnt, + char **rdata,char **rparam, + int *rdata_len,int *rparam_len); + +/*The following definitions come from rpc_pipes/pipeutil.c */ + +void initrpcreply(char *inbuf, char *q); +void endrpcreply(char *inbuf, char *q, int datalen, int rtnval, int *rlen); +BOOL name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); +char *dom_sid_to_string(DOM_SID *sid); +int make_dom_sids(char *sids_str, DOM_SID *sids, int max_sids); +int make_dom_gids(char *gids_str, DOM_GID *gids); +int create_rpc_request(uint32 call_id, uint8 op_num, char *q, int data_len); +int create_rpc_reply(uint32 call_id, char *q, int data_len); + +/*The following definitions come from rpc_pipes/smbparse.c */ + +char* smb_io_utime(BOOL io, UTIME *t, char *q, char *base, int align, int depth); +char* smb_io_time(BOOL io, NTTIME *nttime, char *q, char *base, int align, int depth); +void make_dom_sid(DOM_SID *sid, char *domsid); +char* smb_io_dom_sid(BOOL io, DOM_SID *sid, char *q, char *base, int align, int depth); +void make_uni_hdr(UNIHDR *hdr, int max_len, int len, uint16 terminate); +char* smb_io_unihdr(BOOL io, UNIHDR *hdr, char *q, char *base, int align, int depth); +void make_uni_hdr2(UNIHDR2 *hdr, int max_len, int len, uint16 terminate); +char* smb_io_unihdr2(BOOL io, UNIHDR2 *hdr2, char *q, char *base, int align, int depth); +void make_unistr(UNISTR *str, char *buf); +char* smb_io_unistr(BOOL io, UNISTR *uni, char *q, char *base, int align, int depth); +void make_unistr2(UNISTR2 *str, char *buf, int len); +char* smb_io_unistr2(BOOL io, UNISTR2 *uni2, char *q, char *base, int align, int depth); +void make_dom_sid2(DOM_SID2 *sid2, char *sid_str); +char* smb_io_dom_sid2(BOOL io, DOM_SID2 *sid2, char *q, char *base, int align, int depth); +void make_dom_rid2(DOM_RID2 *rid2, uint32 rid); +char* smb_io_dom_rid2(BOOL io, DOM_RID2 *rid2, char *q, char *base, int align, int depth); +void make_clnt_srv(DOM_CLNT_SRV *log, char *logon_srv, char *comp_name); +char* smb_io_clnt_srv(BOOL io, DOM_CLNT_SRV *log, char *q, char *base, int align, int depth); +void make_log_info(DOM_LOG_INFO *log, char *logon_srv, char *acct_name, + uint16 sec_chan, char *comp_name); +char* smb_io_log_info(BOOL io, DOM_LOG_INFO *log, char *q, char *base, int align, int depth); +char* smb_io_chal(BOOL io, DOM_CHAL *chal, char *q, char *base, int align, int depth); +char* smb_io_cred(BOOL io, DOM_CRED *cred, char *q, char *base, int align, int depth); +void make_clnt_info2(DOM_CLNT_INFO2 *clnt, + char *logon_srv, char *comp_name, + DOM_CRED *clnt_cred); +char* smb_io_clnt_info2(BOOL io, DOM_CLNT_INFO2 *clnt, char *q, char *base, int align, int depth); +char* smb_io_clnt_info(BOOL io, DOM_CLNT_INFO *clnt, char *q, char *base, int align, int depth); +void make_logon_id(DOM_LOGON_ID *log, uint32 log_id_low, uint32 log_id_high); +char* smb_io_logon_id(BOOL io, DOM_LOGON_ID *log, char *q, char *base, int align, int depth); +void make_arc4_owf(ARC4_OWF *hash, char data[16]); +char* smb_io_arc4_owf(BOOL io, ARC4_OWF *hash, char *q, char *base, int align, int depth); +void make_id_info1(DOM_ID_INFO_1 *id, char *domain_name, + uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high, + char *user_name, char *wksta_name, + char arc4_lm_owf[16], char arc4_nt_owf[16]); +char* smb_io_id_info1(BOOL io, DOM_ID_INFO_1 *id, char *q, char *base, int align, int depth); +void make_sam_info(DOM_SAM_INFO *sam, + char *logon_srv, char *comp_name, DOM_CRED *clnt_cred, + DOM_CRED *rtn_cred, uint16 logon_level, uint16 switch_value, + DOM_ID_INFO_1 *id1); +char* smb_io_sam_info(BOOL io, DOM_SAM_INFO *sam, char *q, char *base, int align, int depth); +char* smb_io_gid(BOOL io, DOM_GID *gid, char *q, char *base, int align, int depth); +void make_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 frag, + uint32 call_id, int data_len); +char* smb_io_rpc_hdr(BOOL io, RPC_HDR *rpc, char *q, char *base, int align, int depth); +void make_rpc_iface(RPC_IFACE *ifc, char data[16], uint32 version); +char* smb_io_rpc_iface(BOOL io, RPC_IFACE *ifc, char *q, char *base, int align, int depth); +void make_rpc_addr_str(RPC_ADDR_STR *str, char *name); +char* smb_io_rpc_addr_str(BOOL io, RPC_ADDR_STR *str, char *q, char *base, int align, int depth); +void make_rpc_hdr_bba(RPC_HDR_BBA *bba, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid); +char* smb_io_rpc_hdr_bba(BOOL io, RPC_HDR_BBA *rpc, char *q, char *base, int align, int depth); +void make_rpc_hdr_rb(RPC_HDR_RB *rpc, + uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, + uint32 num_elements, uint16 context_id, uint8 num_syntaxes, + RPC_IFACE *abstract, RPC_IFACE *transfer); +char* smb_io_rpc_hdr_rb(BOOL io, RPC_HDR_RB *rpc, char *q, char *base, int align, int depth); +void make_rpc_results(RPC_RESULTS *res, + uint8 num_results, uint16 result, uint16 reason); +char* smb_io_rpc_results(BOOL io, RPC_RESULTS *res, char *q, char *base, int align, int depth); +void make_rpc_hdr_ba(RPC_HDR_BA *rpc, + uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, + char *pipe_addr, + uint8 num_results, uint16 result, uint16 reason, + RPC_IFACE *transfer); +char* smb_io_rpc_hdr_ba(BOOL io, RPC_HDR_BA *rpc, char *q, char *base, int align, int depth); +void make_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, uint32 sec_qos); +char* smb_io_obj_attr(BOOL io, LSA_OBJ_ATTR *attr, char *q, char *base, int align, int depth); +void make_rpc_hdr_rr(RPC_HDR_RR *hdr, enum RPC_PKT_TYPE pkt_type, + uint32 call_id, int data_len, uint8 opnum); +char* smb_io_rpc_hdr_rr(BOOL io, RPC_HDR_RR *rpc, char *q, char *base, int align, int depth); +char* smb_io_pol_hnd(BOOL io, LSA_POL_HND *pol, char *q, char *base, int align, int depth); +char* smb_io_dom_query_3(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align, int depth); +char* smb_io_dom_query_5(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align, int depth); +char* smb_io_dom_query(BOOL io, DOM_QUERY *d_q, char *q, char *base, int align, int depth); +char* smb_io_dom_r_ref(BOOL io, DOM_R_REF *r_r, char *q, char *base, int align, int depth); +char* smb_io_dom_name(BOOL io, DOM_NAME *name, char *q, char *base, int align, int depth); +char* smb_io_neg_flags(BOOL io, NEG_FLAGS *neg, char *q, char *base, int align, int depth); + +/*The following definitions come from rpc_pipes/srvparse.c */ + +char* srv_io_share_info1_str(BOOL io, SH_INFO_1_STR *sh1, char *q, char *base, int align, int depth); +char* srv_io_share_info1(BOOL io, SH_INFO_1 *sh1, char *q, char *base, int align, int depth); +char* srv_io_share_1_ctr(BOOL io, SHARE_INFO_1_CTR *ctr, char *q, char *base, int align, int depth); +char* srv_io_q_net_share_enum(BOOL io, SRV_Q_NET_SHARE_ENUM *q_n, char *q, char *base, int align, int depth); +char* srv_io_r_net_share_enum(BOOL io, SRV_R_NET_SHARE_ENUM *r_n, char *q, char *base, int align, int depth); + /*The following definitions come from server.c */ void *dflt_sig(void); @@ -834,12 +1036,6 @@ int pw_file_lock(char *name, int type, int secs); int pw_file_unlock(int fd); struct smb_passwd *get_smbpwnam(char *name); -/*The following definitions come from smbpasswd.c */ - - -/*The following definitions come from smbrun.c */ - - /*The following definitions come from status.c */ void Ucrit_addUsername(pstring username); @@ -868,13 +1064,6 @@ int sys_chown(char *fname,int uid,int gid); int sys_chroot(char *dname); struct hostent *sys_gethostbyname(char *name); -/*The following definitions come from testparm.c */ - - -/*The following definitions come from testprns.c */ - -int main(int argc, char *argv[]); - /*The following definitions come from time.c */ void GetTimeOfDay(struct timeval *tval); @@ -899,6 +1088,9 @@ int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize); int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize); int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize); +/*The following definitions come from ubiqx/ubi_dLinkList.c */ + + /*The following definitions come from ufc.c */ char *ufc_crypt(char *key,char *salt); -- cgit From 30c046901beb29d1cc3430bfad029ec3a3eaf06c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 31 Oct 1997 04:51:29 +0000 Subject: OSF1 doesn't define union semun either. (This used to be commit af7700aa2e3c736f86ae3217a424dfb0910f5f45) --- source3/include/includes.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 055e633846..92688dd004 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -319,14 +319,7 @@ extern int innetgr (const char *, const char *, const char *, const char *); #define USE_GETCWD #define USE_SETSID #define USE_SYSV_IPC - -union semun { - int val; - struct semid_ds *buf; - ushort *array; -}; - - +#define NO_SEMUN #ifndef REPLACE_GETPASS #define REPLACE_GETPASS #endif /* REPLACE_GETPASS */ @@ -469,6 +462,7 @@ char *mktemp(char *); /* No standard include */ #define NEED_AUTH_PARAMETERS #endif /* OSF1_ENH_SEC */ #define USE_SYSV_IPC +#define NO_SEMUN #endif @@ -1084,6 +1078,13 @@ struct spwd { /* fake shadow password structure */ #include #include #include +#ifdef NO_SEMUN +union semun { + int val; + struct semid_ds *buf; + unsigned short *array; +}; +#endif #endif #ifdef AFS_AUTH -- cgit From 88bd62c9b0c6d7fea06207a1ec160684e8aa0f51 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 31 Oct 1997 05:54:36 +0000 Subject: define NO_SEMUN for svr4 (This used to be commit a43fa71a5fa740ae8757989c4177f21d8193de94) --- source3/include/includes.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 92688dd004..794380d7d4 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -436,6 +436,7 @@ extern struct passwd *getpwnam(); #define USE_GETCWD #define USE_SETSID #define USE_SYSV_IPC +#define NO_SEMUN #endif -- cgit From 264b1e0e75ae63467b6fe51b339e1e5f3c4477bc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 1 Nov 1997 07:33:55 +0000 Subject: some locking code cleanups (This used to be commit 6d77311d6cecabafb86c02e26b30724425ef6208) --- source3/include/smb.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 8f0bd31bf4..8bb1e993cd 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -57,9 +57,6 @@ typedef int BOOL; -/* offset in shared memory */ -#define NULL_OFFSET (int)(0) - /* limiting size of ipc replies */ #define REALLOC(ptr,size) Realloc(ptr,MAX((size),4*1024)) -- cgit From 224c40a52335bf1afc7662183900e143307aa5be Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 1 Nov 1997 13:22:16 +0000 Subject: a simple SMB torture tester. This will allow us to evaluate locking techniques more accurately. (This used to be commit 054e3b2ae3a8cfb98fde72becef9b05de34d2ba7) --- source3/include/proto.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 949d2472a9..7e4ed43aa0 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -51,14 +51,24 @@ BOOL cli_session_setup(struct cli_state *cli, char *ntpass, int ntpasslen, char *workgroup); BOOL cli_send_tconX(struct cli_state *cli, - char *share, char *dev, char *pword, int passlen); + char *share, char *dev, char *pass, int passlen); BOOL cli_tdis(struct cli_state *cli); +BOOL cli_unlink(struct cli_state *cli, char *fname); +int cli_open(struct cli_state *cli, char *fname, int flags, int share_mode); +BOOL cli_close(struct cli_state *cli, int fnum); +BOOL cli_lock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout); +BOOL cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout); +int cli_read(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 size); +int cli_write(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 size); BOOL cli_negprot(struct cli_state *cli); BOOL cli_session_request(struct cli_state *cli, char *host, int name_type, char *myname); BOOL cli_connect(struct cli_state *cli, char *host, struct in_addr *ip); BOOL cli_initialise(struct cli_state *cli); void cli_shutdown(struct cli_state *cli); +char *cli_errstr(struct cli_state *cli); +void cli_error(struct cli_state *cli, int *eclass, int *num); +void cli_sockopt(struct cli_state *cli, char *options); /*The following definitions come from clientutil.c */ @@ -81,7 +91,6 @@ BOOL cli_send_login(char *inbuf,char *outbuf,BOOL start_session,BOOL use_setup); void cli_send_logout(void ); BOOL cli_open_sockets(int port ); BOOL cli_reopen_connection(char *inbuf,char *outbuf); -char *smb_errstr(char *inbuf); /*The following definitions come from clitar.c */ @@ -1030,6 +1039,10 @@ void E_md4hash(uchar *passwd, uchar *p16); void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); void nt_lm_owf_gen(char *pwd, char *nt_p16, char *p16); +/*The following definitions come from smberr.c */ + +char *smb_errstr(char *inbuf); + /*The following definitions come from smbpass.c */ int pw_file_lock(char *name, int type, int secs); -- cgit From c533c0755398219036360cf4131251a146995731 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sat, 1 Nov 1997 19:20:29 +0000 Subject: client.c clientutil.c proto.h rpc_pipes/ntclientlsa.c rpc_pipes/ntclientnet.c rpc_pipes/ntclientpipe.c : added extra argument to cli_call_api() to allow specifying the length of the \PIPE\ name. it appears that, like when the name of the pipe is NULL and OS-2 requires two extra bytes _after_ the NULL name, that NT requires two bytes after the NULL-terminated name "\PIPE\". these two bytes vary, but values seen so far are: 0x72 0x70; 0x63 0x65; 0x44 0x65; 0x4E 0x00. there appears not to be much logic to this. purpose unknown. ntclient.c: put Set Named Pipe Handle State call directly after SMBopenX call. (This used to be commit 54c245be152e5fa8f5b535c93f8d11c5f591e23f) --- source3/include/proto.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 7e4ed43aa0..56bb1eff44 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -73,7 +73,8 @@ void cli_sockopt(struct cli_state *cli, char *options); /*The following definitions come from clientutil.c */ void cli_setup_pkt(char *outbuf); -BOOL cli_call_api(char *pipe_name, int prcnt,int drcnt, int srcnt, +BOOL cli_call_api(char *pipe_name, int pipe_name_len, + int prcnt,int drcnt, int srcnt, int mprcnt,int mdrcnt, int *rprcnt,int *rdrcnt, char *param,char *data, uint16 *setup, @@ -82,7 +83,7 @@ BOOL cli_receive_trans_response(char *inbuf,int trans, int *data_len,int *param_len, char **data,char **param); BOOL cli_send_trans_request(char *outbuf,int trans, - char *name,int fid,int flags, + char *name,int name_len, int fid,int flags, char *data,char *param,uint16 *setup, int ldata,int lparam,int lsetup, int mdata,int mparam,int msetup); -- cgit From 8e873b415b98c20cfe134b98753d6783882f72b8 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sat, 1 Nov 1997 19:36:04 +0000 Subject: preparing for release of 1.9.18alpha10 (This used to be commit fa251b7eba48c9ef2d8d3d798ce5b99c8508c243) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 8e8b31b3c3..bd6d3c6790 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.18alpha9" +#define VERSION "1.9.18alpha10" -- cgit From 56eece129efcd8717cfdc507b7d34a073b024d68 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 2 Nov 1997 03:10:42 +0000 Subject: got rid of redundent rpc_pipes/rpc_proto.h (This used to be commit 1a454f818841bf016ff04fd70cd73a5964d56f2e) --- source3/include/includes.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 794380d7d4..9481c9f24e 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -1135,7 +1135,6 @@ extern char *sys_errlist[]; #include "charset.h" /***** automatically generated prototypes *****/ -#include "rpc_pipes/rpc_proto.h" #include "proto.h" -- cgit From 4012c1cc8f47c7b3271a76a362ed2e4be4e8405c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 2 Nov 1997 04:01:57 +0000 Subject: convert the credentials code back to uchar[8] from uint32[2] This should fix the byte order problems (maybe!) (This used to be commit 21878e7d8628d05786c3c76f2943e31df1096577) --- source3/include/proto.h | 23 ++++++++++++----------- source3/include/smb.h | 5 ++--- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 56bb1eff44..4781b103ce 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -83,7 +83,7 @@ BOOL cli_receive_trans_response(char *inbuf,int trans, int *data_len,int *param_len, char **data,char **param); BOOL cli_send_trans_request(char *outbuf,int trans, - char *name,int name_len, int fid,int flags, + char *name,int namelen, int fid,int flags, char *data,char *param,uint16 *setup, int ldata,int lparam,int lsetup, int mdata,int mparam,int msetup); @@ -106,17 +106,18 @@ int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind); /*The following definitions come from credentials.c */ +char *credstr(uchar *cred); void cred_session_key(DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal, char *pass, - uint32 session_key[2]); -void cred_create(uint32 session_key[2], DOM_CHAL *stor_cred, UTIME timestamp, + uchar session_key[8]); +void cred_create(uchar session_key[8], DOM_CHAL *stor_cred, UTIME timestamp, DOM_CHAL *cred); -int cred_assert(DOM_CHAL *cred, uint32 session_key[2], DOM_CHAL *stored_cred, +int cred_assert(DOM_CHAL *cred, char session_key[8], DOM_CHAL *stored_cred, UTIME timestamp); -BOOL clnt_deal_with_creds(uint32 sess_key[2], - DOM_CRED *sto_clnt_cred, DOM_CRED *rcv_srv_cred); -BOOL deal_with_creds(uint32 sess_key[2], - DOM_CRED *sto_clnt_cred, - DOM_CRED *rcv_clnt_cred, DOM_CRED *rtn_srv_cred); +BOOL clnt_deal_with_creds(char sess_key[8], + DOM_CRED *sto_clnt_cred, DOM_CRED *rcv_srv_cred); +BOOL deal_with_creds(uchar sess_key[8], + DOM_CRED *sto_clnt_cred, + DOM_CRED *rcv_clnt_cred, DOM_CRED *rtn_srv_cred); /*The following definitions come from dir.c */ @@ -815,14 +816,14 @@ BOOL do_lsa_auth2(uint16 fnum, uint32 call_id, char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name, DOM_CHAL *clnt_chal, uint32 neg_flags, DOM_CHAL *srv_chal); BOOL do_lsa_sam_logon(uint16 fnum, uint32 call_id, - uint32 sess_key[2], DOM_CRED *sto_clnt_cred, + uchar sess_key[8], DOM_CRED *sto_clnt_cred, char *logon_srv, char *comp_name, DOM_CRED *clnt_cred, DOM_CRED *rtn_cred, uint16 logon_level, uint16 switch_value, DOM_ID_INFO_1 *id1, LSA_USER_INFO *user_info, DOM_CRED *srv_cred); BOOL do_lsa_sam_logoff(uint16 fnum, uint32 call_id, - uint32 sess_key[2], DOM_CRED *sto_clnt_cred, + uchar sess_key[8], DOM_CRED *sto_clnt_cred, char *logon_srv, char *comp_name, DOM_CRED *clnt_cred, DOM_CRED *rtn_cred, uint16 logon_level, uint16 switch_value, DOM_ID_INFO_1 *id1, diff --git a/source3/include/smb.h b/source3/include/smb.h index 8bb1e993cd..6a7f502286 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -443,8 +443,7 @@ typedef struct log_info /* DOM_CHAL - challenge info */ typedef struct chal_info { - uint32 data[2]; /* credentials */ - + uchar data[8]; /* credentials */ } DOM_CHAL; /* DOM_CREDs - timestamped client or server credentials */ @@ -1308,7 +1307,7 @@ struct dcinfo DOM_CRED clnt_cred; /* Last client credential */ DOM_CRED srv_cred; /* Last server credential */ - uint32 sess_key[2]; /* Session key */ + uchar sess_key[8]; /* Session key */ uchar md4pw[16]; /* md4(machine password) */ }; -- cgit From e67c2e9dc64e8a9f848d2769c33eef1d09fdb3e1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 2 Nov 1997 04:11:05 +0000 Subject: fix some uchar/char conflicts (This used to be commit c164681dfe2ad9623a59f01eea914bf27d4801e5) --- source3/include/proto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 4781b103ce..99a194d5c5 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -111,9 +111,9 @@ void cred_session_key(DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal, char *pass, uchar session_key[8]); void cred_create(uchar session_key[8], DOM_CHAL *stor_cred, UTIME timestamp, DOM_CHAL *cred); -int cred_assert(DOM_CHAL *cred, char session_key[8], DOM_CHAL *stored_cred, +int cred_assert(DOM_CHAL *cred, uchar session_key[8], DOM_CHAL *stored_cred, UTIME timestamp); -BOOL clnt_deal_with_creds(char sess_key[8], +BOOL clnt_deal_with_creds(uchar sess_key[8], DOM_CRED *sto_clnt_cred, DOM_CRED *rcv_srv_cred); BOOL deal_with_creds(uchar sess_key[8], DOM_CRED *sto_clnt_cred, -- cgit From eebb68b92e76c24262128a2d83113d7827198fd5 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sun, 2 Nov 1997 19:27:26 +0000 Subject: loadparm.c : added "domain hosts allow" and "domain hosts deny". these are to be used to specify which workstations can log in to a samba PDC from. it is also used to check whether to add an initial machine password into the smbpasswd database or not smbpass.c : added capability to add a machine password to the smbpasswd database. ***** the default uid is zero ***** rpc_pipes/pipenetlog.c : use of "domain hosts allow/deny" parameters to allow login access. proto.h : usual. (This used to be commit 2e7d3410306640aa6402e0506430a53988cc583e) --- source3/include/proto.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 99a194d5c5..e4601672e0 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -221,6 +221,8 @@ char *lp_domain_other_sids(void); char *lp_domain_groups(void); char *lp_domain_admin_users(void); char *lp_domain_guest_users(void); +char *lp_domain_hostsallow(void); +char *lp_domain_hostsdeny(void); BOOL lp_dns_proxy(void); BOOL lp_wins_support(void); BOOL lp_wins_proxy(void); @@ -847,7 +849,6 @@ int get_rpc_pipe_num(char *buf, int where); /*The following definitions come from rpc_pipes/pipenetlog.c */ -BOOL get_md4pw(char *md4pw, char *mach_acct); BOOL api_netlogrpcTNP(int cnum,int uid, char *param,char *data, int mdrcnt,int mprcnt, char **rdata,char **rparam, @@ -1050,6 +1051,7 @@ char *smb_errstr(char *inbuf); int pw_file_lock(char *name, int type, int secs); int pw_file_unlock(int fd); struct smb_passwd *get_smbpwnam(char *name); +BOOL add_smbpwnam(struct smb_passwd* pwd); /*The following definitions come from status.c */ -- cgit From b26623bc3a8ff5191763c83564453e77edee836a Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sun, 2 Nov 1997 20:35:20 +0000 Subject: Christian Lademann's contribution: new capabilities in smb.conf. '<' and '|' characters indicate read file and execute command respectively, and feed the output into the parameter (!!!). '<$' and '|$' means run standard_sub_basic() on them. this is going to be fun to document in smb.conf.5.... also, Christian created a new "online" service parameter. services can be taken "off-line".... (This used to be commit 15f44d28916cdc1432bffdbb999c7cf7efd8fb86) --- source3/include/proto.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index e4601672e0..d592c94634 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -183,6 +183,8 @@ int interpret_coding_system(char *str, int def); /*The following definitions come from loadparm.c */ +char *chomp(char *s); +char *read_string_external(char *fname); char *lp_string(char *s); char *lp_logfile(void); char *lp_smbrun(void); @@ -329,6 +331,7 @@ BOOL lp_syncalways(int ); BOOL lp_map_system(int ); BOOL lp_delete_readonly(int ); BOOL lp_fake_oplocks(int ); +BOOL lp_online(int ); BOOL lp_recursive_veto_delete(int ); BOOL lp_dos_filetimes(int ); int lp_create_mode(int ); @@ -1271,3 +1274,4 @@ char *align_offset(char *q, char *base, int align_offset_len); void print_asc(int level, unsigned char *buf,int len); void dump_data(int level,char *buf1,int len); char *tab_depth(int depth); +char *string_buffer(int sz); -- cgit From 083a3be7d7170e92d6985be00c4c02c8215b80c2 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Sun, 2 Nov 1997 20:47:35 +0000 Subject: preparing for release of 1.9.18alpha11 (This used to be commit cadd772df72aa13018ea6e909ed0d7e294f24b5e) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index bd6d3c6790..29917b1087 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.18alpha10" +#define VERSION "1.9.18alpha11" -- cgit From 4039df6d4b28064a6e72fbdbcf34cce6f961c4c4 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 3 Nov 1997 15:47:03 +0000 Subject: added code that _uses_ arcfour. arcfour itself, or anything remotely like it, has *not* been added. this is the client and server side of the SAM Logon NT and LM OWF password obfuscation (rc4 with the long-term session key). (This used to be commit 4cf4dd696714492f8e51661cab4736d66ab2916b) --- source3/include/proto.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index d592c94634..4a370e0dac 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -919,7 +919,8 @@ char* smb_io_arc4_owf(BOOL io, ARC4_OWF *hash, char *q, char *base, int align, i void make_id_info1(DOM_ID_INFO_1 *id, char *domain_name, uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high, char *user_name, char *wksta_name, - char arc4_lm_owf[16], char arc4_nt_owf[16]); + char *sess_key, + unsigned char lm_cypher[16], unsigned char nt_cypher[16]); char* smb_io_id_info1(BOOL io, DOM_ID_INFO_1 *id, char *q, char *base, int align, int depth); void make_sam_info(DOM_SAM_INFO *sam, char *logon_srv, char *comp_name, DOM_CRED *clnt_cred, -- cgit From cdc6099647f7a48a8e31f9dfc331fe82dd66acdf Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 3 Nov 1997 19:24:45 +0000 Subject: Rolling back the files loadparm.c : to equivalent to version 1.67 reply.c : to equivalent to version 1.69 server.c : to equivalent to version 1.122 util.c : to equivalent to version 1.98 to remove the incorrect changes. proto.h: The usual. rpc_pipes/smbparse.c : Backeting stuff that SHOULD NOT BE IN THE none-NTDOMAIN build ! Jeremy. (This used to be commit 6064c9d80fd9fcc3ceec528494ba5e2591610098) --- source3/include/proto.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 4a370e0dac..4054a12c19 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -183,8 +183,6 @@ int interpret_coding_system(char *str, int def); /*The following definitions come from loadparm.c */ -char *chomp(char *s); -char *read_string_external(char *fname); char *lp_string(char *s); char *lp_logfile(void); char *lp_smbrun(void); @@ -331,7 +329,6 @@ BOOL lp_syncalways(int ); BOOL lp_map_system(int ); BOOL lp_delete_readonly(int ); BOOL lp_fake_oplocks(int ); -BOOL lp_online(int ); BOOL lp_recursive_veto_delete(int ); BOOL lp_dos_filetimes(int ); int lp_create_mode(int ); @@ -1275,4 +1272,3 @@ char *align_offset(char *q, char *base, int align_offset_len); void print_asc(int level, unsigned char *buf,int len); void dump_data(int level,char *buf1,int len); char *tab_depth(int depth); -char *string_buffer(int sz); -- cgit From 028679f144d5321e0dfa4bc0840b54388b9d59d1 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 4 Nov 1997 20:27:08 +0000 Subject: smb.h : LSA_OPENSECRET and three other unknown #defines are commented as not being the real defines for these!!! rpc_pipes/pipenetlog.c : USE_ARCFOUR for Server Password Set. and then ignore the password (agh!) this will *fail* to do logins, by the way. i need to add a routine to update the smb password (next job). (This used to be commit b9d26344cc9b64ef3578931d099d52eab080fdd3) --- source3/include/smb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 6a7f502286..892c31be97 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -298,7 +298,7 @@ enum RPC_PKT_TYPE #define LSA_AUTH2 0x0f #define LSA_CLOSE 0x00 -/* unknown .... */ +/* XXXX these are just here to get a compile!!! */ #define LSA_OPENSECRET 0xFF #define LSA_LOOKUPSIDS 0xFE #define LSA_LOOKUPNAMES 0xFD -- cgit From bd83f461a1a3f1ed610061681720b8923154c697 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 5 Nov 1997 12:21:45 +0000 Subject: add NO_SEMUN for HP I really wish you could say #ifndef "struct foo_struct" in C :-) (This used to be commit acffb39f1aea9816ece41d66e9369375e9aa7df4) --- source3/include/includes.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 9481c9f24e..6572b583e2 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -573,6 +573,7 @@ char *mktemp(char *); /* No standard include */ #define USE_SETSID #define USE_SETRES #define USE_SYSV_IPC +#define NO_SEMUN #define DEFAULT_PRINTING PRINT_HPUX /* Ken Weiss tells us that SIGCLD_IGNORE is not good for HPUX */ -- cgit From ba5086d03e3ec29e0c866d339d0283b520fc669f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 6 Nov 1997 06:50:21 +0000 Subject: no asm/signal.h for linux as this is not portable add auto username from LOGNAME for smbtorture proto fix in ufc.c (This used to be commit f13dbdf307ccffc15a74e2ffa72da666e53a72b6) --- source3/include/includes.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 6572b583e2..cada77e732 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -214,9 +214,6 @@ Here come some platform specific sections #include #include #include -#ifndef NO_ASMSIGNALH -#include -#endif #ifdef GLIBC2 #define _LINUX_C_LIB_VERSION_MAJOR 6 #include -- cgit From ec35f1c1cc363b84867fea49f6b2b5e3c0b9b889 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 6 Nov 1997 19:11:16 +0000 Subject: local.h: Added OPLOCK_BREAK_TIMEOUT_FUDGEFACTOR. proto.h: The usual. server.c: Added timestring() messages to oplock logs. Added fix to allow file open processing to continue is an oplock break message times out. Jeremy. (This used to be commit c45369217169fac261b32db71469c007db4b4a03) --- source3/include/local.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index c1f1de2132..ae791d84e6 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -156,10 +156,14 @@ /* #define IDLE_DIR "/" */ /* Timout (in seconds) to wait for an oplock break - message to return. */ + message to return from the client. */ #define OPLOCK_BREAK_TIMEOUT 30 +/* Timout (in seconds) to add to the oplock break timeout + to wait for the smbd to smbd message to return. */ + +#define OPLOCK_BREAK_TIMEOUT_FUDGEFACTOR 2 /* the read preciction code has been disabled until some problems with it are worked out */ -- cgit From bd529d7a83c35be233baca09bc79aa911ad443ce Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 6 Nov 1997 23:03:58 +0000 Subject: following a cvs error, i am rewriting this monster-commit. with bad grace. Modified Files: --------------- Makefile: adding extra files ipc.c : send_trans_reply() - alignment issue. this makes the alignment the same as that in NT. this should be looked at by people who understand the SMB stuff better than i. api_fd_commands[] - added samr and wkssvc pipes. loadparm.c : lp_domain_controller() changed to mean "samba is a domain controller". it's a "yes/no" parameter, now. no, it isn't used _anywhere_. namedbwork.c nameelect.c : if "domain controller = yes" then add SV_TYPE_DOMAIN_CTRL to the host _and_ workgroup announcements. yes, you must do both: nt does. namelogon.c : important NETLOGON bug in SAMLOGON request parsing, which may be the source of some people's problems with logging on to the Samba PDC. password.c : get_smbpwnam() renamed to get_smbpwd_entry(). pipes.c : added samr and wkssvc pipes. proto.h : usual. can we actually _remove_ proto.h from the cvs tree, and have it as one of the Makefile dependencies, or something? reply.c : get_smbpwnam() renamed to get_smbpwd_entry() - also changed response error code when logging in from a WORKSTATION$ account. yes, paul is right: we need to know when to return the right error code, and why. server.c : added call to reset_chain_pnum(). #ifdef NTDOMAIN added call to init_lsa_policy_hnd() #endif. jeremy, you'd be proud: i did a compile without NTDOMAIN, and caught a link error for this function. smb.h : defines and structures for samr and wkssvc pipes. smbpass.c : modified get_smbpwnam() to get_smbpwd_entry() and it now takes two arguments. one for the name; if this is null, it looks up by smb_userid instead. oh, by the way, smb_userids are actually domain relative ids (RIDs). concatenate a RID with the domain SID, and you have an internet globally unique way of identifying a user. we're using RIDs in the wrong way.... added mod_smbpwnam() function. this was based on code in smbpasswd.c rpc_pipes/lsaparse.c : added enum trusted domain parsing. this is incomplete: i need a packet trace to write it properly. rpc_pipes/pipe_hnd.c : added reset_chain_pnum() function. rpc_pipes/pipenetlog.c : get_smbpwnam() function renamed to get_smbpwd_entry(). arcfour() issues. removed capability of get_md4pw() function to automatically add workstation accounts. this should either be done using smbpasswd -add MACHINE$, or by using \PIPE\samr. rpc_pipes/pipe_util.c : create_pol_hnd() - creates a unique LSA Policy Handle. overkill function: uses a 64 bit sequence number; current unix time and the smbd pid. rpc_pipes/smbparse.c : arcfour() issues. smb_io_unistr2() should advance by uni_str_len not uni_max_len. smb_io_smb_hdr_rb() - request bind uses uint16 for the context id, and uint8 for the num_syntaxes. oops, i put these both as uint32s. Added Files: ------------ rpc_pipes/lsa_hnd.c : on the samr pipe, allocate and associate an LSA Policy Handle with a SID. you receive queries with the LSA Policy Handle, and have to turn this back into a SID in order to answer the query... rpc_pipes/pipesamr.c rpc_pipes/samrparse.c \PIPE\samr processing. samr i presume is the SAM Replication pipe. rpc_pipes/pipewkssvc.c rpc_pipes/wksparse.c \PIPE\wkssvc processing. the Workstation Service pipe? holy cow. (This used to be commit 1bd084b3e690eb26a1006d616075e53d711ecd2f) --- source3/include/proto.h | 61 +++++++++- source3/include/smb.h | 314 ++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 310 insertions(+), 65 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 4054a12c19..5bb709858f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -201,7 +201,6 @@ char *lp_passwd_program(void); char *lp_passwd_chat(void); char *lp_passwordserver(void); char *lp_workgroup(void); -char *lp_domain_controller(void); char *lp_username_map(void); char *lp_character_set(void); char *lp_logon_script(void); @@ -227,6 +226,7 @@ BOOL lp_dns_proxy(void); BOOL lp_wins_support(void); BOOL lp_wins_proxy(void); BOOL lp_local_master(void); +BOOL lp_domain_controller(void); BOOL lp_domain_master(void); BOOL lp_domain_logons(void); BOOL lp_preferred_master(void); @@ -763,6 +763,14 @@ int reply_writebs(char *inbuf,char *outbuf); int reply_setattrE(char *inbuf,char *outbuf); int reply_getattrE(char *inbuf,char *outbuf); +/*The following definitions come from rpc_pipes/lsa_hnd.c */ + +void init_lsa_policy_hnd(void); +BOOL open_lsa_policy_hnd(LSA_POL_HND *hnd, DOM_SID *sid); +BOOL set_lsa_policy_samr_rid(LSA_POL_HND *hnd, uint32 rid); +uint32 get_lsa_policy_samr_rid(LSA_POL_HND *hnd); +BOOL close_lsa_policy_hnd(LSA_POL_HND *hnd); + /*The following definitions come from rpc_pipes/lsaparse.c */ void make_q_open_pol(LSA_Q_OPEN_POL *r_q, char *server_name, @@ -772,6 +780,9 @@ char* lsa_io_q_open_pol(BOOL io, LSA_Q_OPEN_POL *r_q, char *q, char *base, int a char* lsa_io_r_open_pol(BOOL io, LSA_R_OPEN_POL *r_p, char *q, char *base, int align, int depth); void make_q_query(LSA_Q_QUERY_INFO *q_q, LSA_POL_HND *hnd, uint16 info_class); char* lsa_io_q_query(BOOL io, LSA_Q_QUERY_INFO *q_q, char *q, char *base, int align, int depth); +char* lsa_io_q_enum_trust_dom(BOOL io, LSA_Q_ENUM_TRUST_DOM *q_e, char *q, char *base, int align, int depth); +void make_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM *r_e, LSA_POL_HND *hnd, uint32 status); +char* lsa_io_r_enum_trust_dom(BOOL io, LSA_R_ENUM_TRUST_DOM *r_e, char *q, char *base, int align, int depth); void make_q_close(LSA_Q_CLOSE *q_c, LSA_POL_HND *hnd); char* lsa_io_q_close(BOOL io, LSA_Q_CLOSE *q_c, char *q, char *base, int align, int depth); void make_r_close(LSA_R_CLOSE *q_r, LSA_POL_HND *hnd); @@ -840,6 +851,7 @@ BOOL rpc_pipe_bind(char *pipe_name, uint16 fnum, uint32 call_id, /*The following definitions come from rpc_pipes/pipe_hnd.c */ +void reset_chain_pnum(void); void init_rpc_pipe_hnd(void); int open_rpc_pipe_hnd(char *pipe_name, int cnum); char *get_rpc_pipe_hnd_name(int pnum); @@ -861,6 +873,13 @@ BOOL api_ntLsarpcTNP(int cnum,int uid, char *param,char *data, char **rdata,char **rparam, int *rdata_len,int *rparam_len); +/*The following definitions come from rpc_pipes/pipesamr.c */ + +BOOL api_samrTNP(int cnum,int uid, char *param,char *data, + int mdrcnt,int mprcnt, + char **rdata,char **rparam, + int *rdata_len,int *rparam_len); + /*The following definitions come from rpc_pipes/pipesrvsvc.c */ BOOL api_srvsvcTNP(int cnum,int uid, char *param,char *data, @@ -870,6 +889,7 @@ BOOL api_srvsvcTNP(int cnum,int uid, char *param,char *data, /*The following definitions come from rpc_pipes/pipeutil.c */ +void create_pol_hnd(LSA_POL_HND *hnd); void initrpcreply(char *inbuf, char *q); void endrpcreply(char *inbuf, char *q, int datalen, int rtnval, int *rlen); BOOL name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); @@ -879,6 +899,35 @@ int make_dom_gids(char *gids_str, DOM_GID *gids); int create_rpc_request(uint32 call_id, uint8 op_num, char *q, int data_len); int create_rpc_reply(uint32 call_id, char *q, int data_len); +/*The following definitions come from rpc_pipes/pipewkssvc.c */ + +BOOL api_wkssvcTNP(int cnum,int uid, char *param,char *data, + int mdrcnt,int mprcnt, + char **rdata,char **rparam, + int *rdata_len,int *rparam_len); + +/*The following definitions come from rpc_pipes/samrparse.c */ + +char* samr_io_q_close(BOOL io, SAMR_Q_CLOSE *q_u, char *q, char *base, int align, int depth); +char* samr_io_r_close(BOOL io, SAMR_R_CLOSE *r_u, char *q, char *base, int align, int depth); +char* samr_io_q_open_secret(BOOL io, SAMR_Q_OPEN_SECRET *q_u, char *q, char *base, int align, int depth); +char* samr_io_r_open_secret(BOOL io, SAMR_R_OPEN_SECRET *r_u, char *q, char *base, int align, int depth); +char* samr_io_q_unknown_11(BOOL io, SAMR_Q_UNKNOWN_11 *q_u, char *q, char *base, int align, int depth); +void make_samr_r_unknown_11(SAMR_R_UNKNOWN_11 *r_u, + uint32 switch_value, uint32 unknown_0, uint32 status); +char* samr_io_r_unknown_11(BOOL io, SAMR_R_UNKNOWN_11 *r_u, char *q, char *base, int align, int depth); +char* samr_io_q_unknown_22(BOOL io, SAMR_Q_UNKNOWN_22 *q_u, char *q, char *base, int align, int depth); +char* samr_io_r_unknown_22(BOOL io, SAMR_R_UNKNOWN_22 *r_u, char *q, char *base, int align, int depth); +char* samr_io_q_unknown_24(BOOL io, SAMR_Q_UNKNOWN_24 *q_u, char *q, char *base, int align, int depth); +void make_samr_r_unknown_24(SAMR_R_UNKNOWN_24 *r_u, + uint16 unknown_0, NTTIME *expiry, char *mach_acct, + uint32 unknown_id_0, uint32 status); +char* samr_io_r_unknown_24(BOOL io, SAMR_R_UNKNOWN_24 *r_u, char *q, char *base, int align, int depth); +char* samr_io_q_unknown_32(BOOL io, SAMR_Q_UNKNOWN_32 *q_u, char *q, char *base, int align, int depth); +char* samr_io_r_unknown_32(BOOL io, SAMR_R_UNKNOWN_32 *r_u, char *q, char *base, int align, int depth); +char* samr_io_q_unknown_39(BOOL io, SAMR_Q_UNKNOWN_39 *q_u, char *q, char *base, int align, int depth); +char* samr_io_r_unknown_39(BOOL io, SAMR_R_UNKNOWN_39 *r_u, char *q, char *base, int align, int depth); + /*The following definitions come from rpc_pipes/smbparse.c */ char* smb_io_utime(BOOL io, UTIME *t, char *q, char *base, int align, int depth); @@ -969,6 +1018,11 @@ char* srv_io_share_1_ctr(BOOL io, SHARE_INFO_1_CTR *ctr, char *q, char *base, in char* srv_io_q_net_share_enum(BOOL io, SRV_Q_NET_SHARE_ENUM *q_n, char *q, char *base, int align, int depth); char* srv_io_r_net_share_enum(BOOL io, SRV_R_NET_SHARE_ENUM *r_n, char *q, char *base, int align, int depth); +/*The following definitions come from rpc_pipes/wksparse.c */ + +char* wks_io_q_unknown_0(BOOL io, WKS_Q_UNKNOWN_0 *q_u, char *q, char *base, int align, int depth); +char* wks_io_r_unknown_0(BOOL io, WKS_R_UNKNOWN_0 *r_u, char *q, char *base, int align, int depth); + /*The following definitions come from server.c */ void *dflt_sig(void); @@ -1051,8 +1105,9 @@ char *smb_errstr(char *inbuf); int pw_file_lock(char *name, int type, int secs); int pw_file_unlock(int fd); -struct smb_passwd *get_smbpwnam(char *name); -BOOL add_smbpwnam(struct smb_passwd* pwd); +struct smb_passwd *get_smbpwd_entry(char *name, int smb_userid); +BOOL add_smbpwd_entry(struct smb_passwd* pwd); +BOOL mod_smbpwd_entry(struct smb_passwd* pwd); /*The following definitions come from status.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index 892c31be97..83e1d9f85d 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -255,8 +255,11 @@ typedef fstring string; /* pipe strings */ #define PIPE_LANMAN "\\PIPE\\LANMAN" #define PIPE_SRVSVC "\\PIPE\\srvsvc" +#define PIPE_SAMR "\\PIPE\\samr" +#define PIPE_WKSSVC "\\PIPE\\wkssvc" #define PIPE_NETLOGON "\\PIPE\\NETLOGON" #define PIPE_NTLSA "\\PIPE\\ntlsa" +#define PIPE_NTSVCS "\\PIPE\\ntsvcs" #define PIPE_LSASS "\\PIPE\\lsass" #define PIPE_LSARPC "\\PIPE\\lsarpc" @@ -288,6 +291,15 @@ enum RPC_PKT_TYPE #define ACB_PWNOEXP /* 1 = User password does not expire */ #define ACB_AUTOLOCK /* 1 = Account auto locked */ +#define SAMR_CLOSE 0x01 +#define SAMR_OPEN_SECRET 0x07 +#define SAMR_LOOKUPNAMES 0x11 +#define SAMR_UNKNOWN_3 0x03 +#define SAMR_UNKNOWN_22 0x22 +#define SAMR_UNKNOWN_24 0x24 +#define SAMR_UNKNOWN_34 0x34 +#define SAMR_UNKNOWN_39 0x39 + #define LSA_OPENPOLICY 0x2c #define LSA_QUERYINFOPOLICY 0x07 #define LSA_ENUMTRUSTDOM 0x0d @@ -298,10 +310,12 @@ enum RPC_PKT_TYPE #define LSA_AUTH2 0x0f #define LSA_CLOSE 0x00 -/* XXXX these are just here to get a compile!!! */ +/* XXXX these are here to get a compile! */ + #define LSA_OPENSECRET 0xFF #define LSA_LOOKUPSIDS 0xFE -#define LSA_LOOKUPNAMES 0xFD +#define LSA_LOOKUPRIDS 0xFD +#define LSA_LOOKUPNAMES 0xFC /* srvsvc pipe */ #define NETSERVERGETINFO 0x15 @@ -716,6 +730,24 @@ typedef struct lsa_r_query_info } LSA_R_QUERY_INFO; +/* LSA_Q_ENUM_TRUST_DOM - LSA enumerate trusted domains */ +typedef struct lsa_enum_trust_dom_info +{ + LSA_POL_HND pol; /* policy handle */ + uint32 enum_context; /* enumeration context handle */ + uint32 preferred_len; /* preferred maximum length */ + +} LSA_Q_ENUM_TRUST_DOM; + +/* LSA_R_ENUM_TRUST_DOM - response to LSA enumerate trusted domains */ +typedef struct lsa_r_enum_trust_dom_info +{ + LSA_POL_HND pol; /* policy handle */ + + uint32 status; /* return code */ + +} LSA_R_ENUM_TRUST_DOM; + /* LSA_Q_CLOSE */ typedef struct lsa_q_close_info { @@ -1074,69 +1106,227 @@ typedef struct r_net_share_enum_info } SRV_R_NET_SHARE_ENUM; +/* SAMR_Q_CLOSE - probably a policy handle close */ +typedef struct q_samr_close_info +{ + LSA_POL_HND pol; /* policy handle */ + +} SAMR_Q_CLOSE; -/* -Yet to be turned into structures: - -6) \\MAILSLOT\NET\NTLOGON -------------------------- - -6.1) Query for PDC ------------------- - -Request: - - uint16 0x0007 - Query for PDC - STR machine name - STR response mailslot - uint8[] padding to 2-byte align with start of mailslot. - UNISTR machine name - uint32 NTversion - uint16 LMNTtoken - uint16 LM20token - -Response: - - uint16 0x000A - Respose to Query for PDC - STR machine name (in uppercase) - uint8[] padding to 2-byte align with start of mailslot. - UNISTR machine name - UNISTR domain name - uint32 NTversion (same as received in request) - uint16 LMNTtoken (same as received in request) - uint16 LM20token (same as received in request) - - -6.2) SAM Logon --------------- - -Request: - - uint16 0x0012 - SAM Logon - uint16 request count - UNISTR machine name - UNISTR user name - STR response mailslot - uint32 alloweable account - uint32 domain SID size - char[sid_size] domain SID, of sid_size bytes. - uint8[] ???? padding to 4? 2? -byte align with start of mailslot. - uint32 NTversion - uint16 LMNTtoken - uint16 LM20token - -Response: +/* SAMR_R_CLOSE - probably a policy handle close */ +typedef struct r_samr_close_info +{ + LSA_POL_HND pol; /* policy handle */ + uint32 status; /* return status */ - uint16 0x0013 - Response to SAM Logon - UNISTR machine name - UNISTR user name - workstation trust account - UNISTR domain name - uint32 NTversion - uint16 LMNTtoken - uint16 LM20token +} SAMR_R_CLOSE; -*/ + +/**************************************************************************** +SAMR_Q_OPEN_SECRET - unknown_0 values seen associated with SIDs: + +0x0000 0200 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0 +0x0000 0280 and a well-known domain sid - S-1-5-20 +0x2000 0000 and a well-known domain sid - S-1-5-20 +0x2000 0000 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0 +*****************************************************************************/ + +/* SAMR_Q_OPEN_SECRET - probably an open secret */ +typedef struct q_samr_open_secret_info +{ + LSA_POL_HND pol; /* policy handle */ + uint32 unknown_0; /* 0x2000 0000; 0x0000 0211; 0x0000 0280; 0x0000 0200 - unknown */ + DOM_SID dom_sid; /* domain SID */ + +} SAMR_Q_OPEN_SECRET; + + +/* SAMR_R_OPEN_SECRET - probably an open */ +typedef struct r_samr_open_secret_info +{ + LSA_POL_HND pol; /* policy handle associated with the SID */ + uint32 status; /* return status */ + +} SAMR_R_OPEN_SECRET; + + +/* SAMR_Q_UNKNOWN_11 - probably a "read SAM entry" */ +typedef struct q_samr_unknown_11_info +{ + LSA_POL_HND pol; /* policy handle */ + + uint32 switch_value1; /* 1 - switch value? */ + uint32 unknown_0; /* 0x0000 03E8 - 32 bit unknown */ + uint32 unknown_1; /* 0 - 32 bit unknown */ + uint32 switch_value2; /* 1 - switch value? */ + + UNIHDR hdr_mach_acct; /* unicode machine account name header */ + UNISTR2 uni_mach_acct; /* unicode machine account name */ + +} SAMR_Q_UNKNOWN_11; + + +/* SAMR_R_UNKNOWN_11 - probably an open */ +typedef struct r_samr_unknown_11_info +{ + uint32 switch_value1; /* 1 - switch value? */ + uint32 ptr_0; /* pointer */ + uint32 switch_value2; /* 1 - switch value? */ + uint32 unknown_0; /* 0x000003e8 - 32 bit unknown */ + uint32 switch_value3; /* 1 - switch value? */ + uint32 ptr_1; /* pointer */ + uint32 switch_value4; /* 1 - switch value? */ + uint32 switch_value5; /* 1 - switch value? */ + + uint32 status; /* return status - 0x99: user exists */ + +} SAMR_R_UNKNOWN_11; + + +/* SAMR_Q_UNKNOWN_22 - probably an open */ +typedef struct q_samr_unknown_22_info +{ + LSA_POL_HND pol; /* policy handle */ + uint32 unknown_id_0; /* 0x0000 03E8 - 32 bit unknown id */ + +} SAMR_Q_UNKNOWN_22; + + +/* SAMR_R_UNKNOWN_22 - probably an open */ +typedef struct r_samr_unknown_22_info +{ + LSA_POL_HND pol; /* policy handle associated with unknown id */ + uint32 status; /* return status */ + +} SAMR_R_UNKNOWN_22; + + +/* SAMR_Q_UNKNOWN_24 - probably a get sam info */ +typedef struct q_samr_unknown_24_info +{ + LSA_POL_HND pol; /* policy handle associated with unknown id */ + uint16 unknown_0; /* 0x0015 or 0x0011 - 16 bit unknown */ + +} SAMR_Q_UNKNOWN_24; + + +/* SAMR_R_UNKNOWN_24 - probably a get sam info */ +typedef struct r_samr_unknown_24_info +{ + uint32 ptr; /* pointer */ + uint16 unknown_0; /* 0x0015 or 0x0011 - 16 bit unknown (same as above) */ + uint16 unknown_1; /* 0x8b73 - 16 bit unknown */ + uint8 padding_0[16]; /* 0 - padding 16 bytes */ + NTTIME expiry; /* expiry time or something? */ + uint8 padding_1[24]; /* 0 - padding 24 bytes */ + + UNIHDR hdr_mach_acct; /* unicode header for machine account */ + uint32 padding_2; /* 0 - padding 4 bytes */ + + uint32 ptr_1; /* pointer */ + uint8 padding_3[32]; /* 0 - padding 32 bytes */ + uint32 padding_4; /* 0 - padding 4 bytes */ + + uint32 ptr_2; /* pointer */ + uint32 padding_5; /* 0 - padding 4 bytes */ + + uint32 ptr_3; /* pointer */ + uint8 padding_6[32]; /* 0 - padding 32 bytes */ + + uint32 unknown_id_0; /* unknown id associated with policy handle */ + uint16 unknown_2; /* 0x0201 - 16 bit unknown */ + uint32 unknown_3; /* 0x0000 0080 - 32 bit unknown */ + uint16 unknown_4; /* 0x003f - 16 bit unknown */ + uint16 unknown_5; /* 0x003c - 16 bit unknown */ + + uint8 padding_7[16]; /* 0 - padding 16 bytes */ + uint32 padding_8; /* 0 - padding 4 bytes */ + + UNISTR2 uni_mach_acct; /* unicode string for machine account */ + + uint8 padding_9[48]; /* 0 - padding 48 bytes */ + + uint32 status; /* return status */ + +} SAMR_R_UNKNOWN_24; + + +/* SAMR_Q_UNKNOWN_32 - probably a "create SAM entry" */ +typedef struct q_samr_unknown_32_info +{ + LSA_POL_HND pol; /* policy handle */ + + UNIHDR hdr_mach_acct; /* unicode machine account name header */ + UNISTR2 uni_mach_acct; /* unicode machine account name */ + + uint32 unknown_0; /* 32 bit unknown */ + uint16 unknown_1; /* 16 bit unknown */ + uint16 unknown_2; /* 16 bit unknown */ + +} SAMR_Q_UNKNOWN_32; + + +/* SAMR_R_UNKNOWN_32 - probably a "create SAM entry" */ +typedef struct r_samr_unknown_32_info +{ + LSA_POL_HND pol; /* policy handle */ + uint32 unknown_0; /* 0x0000 0030 - 32 bit unknown */ + uint32 padding; /* 0 - 4 byte padding */ + + uint32 status; /* return status - 0xC000 0099: user exists */ + +} SAMR_R_UNKNOWN_32; + + +/* SAMR_Q_UNKNOWN_39 - probably an open */ +typedef struct q_samr_unknown_39_info +{ + uint32 ptr_srv_name; /* pointer (to server name?) */ + UNISTR2 uni_srv_name; /* unicode server name starting with '\\' */ + + uint32 unknown_0; /* 32 bit unknown */ + +} SAMR_Q_UNKNOWN_39; + + +/* SAMR_R_UNKNOWN_39 - probably an open */ +typedef struct r_samr_unknown_39_info +{ + LSA_POL_HND pol; /* policy handle */ + uint32 status; /* return status */ + +} SAMR_R_UNKNOWN_39; + + +/* WKS_Q_UNKNOWN_0 - probably a capabilities request */ +typedef struct q_wks_unknown_0_info +{ + uint32 ptr_srv_name; /* pointer (to server name?) */ + UNISTR2 uni_srv_name; /* unicode server name starting with '\\' */ + + uint32 unknown_0; /* 0x64 - 32 bit unknown */ + uint16 unknown_1; /* 16 bit unknown */ + +} WKS_Q_UNKNOWN_0; + + +/* WKS_R_UNKNOWN_0 - probably a capabilities request */ +typedef struct r_wks_unknown_0_info +{ + uint32 unknown_0; /* 64 - unknown */ + uint32 ptr_1; /* pointer 1 */ + uint32 unknown_1; /* 0x0000 01f4 - unknown */ + uint32 ptr_srv_name; /* pointer to server name */ + uint32 ptr_dom_name; /* pointer to domain name */ + uint32 unknown_2; /* 4 - unknown */ + uint32 unknown_3; /* 0 - unknown */ + + UNISTR2 uni_srv_name; /* unicode server name */ + UNISTR2 uni_dom_name; /* unicode domainn name */ + uint32 status; /* return status */ + +} WKS_R_UNKNOWN_0; struct smb_passwd @@ -1148,7 +1338,6 @@ struct smb_passwd /* Other fields / flags may be added later */ }; - struct cli_state { int fd; int cnum; @@ -1175,6 +1364,7 @@ struct cli_state { int initialised; }; + struct current_user { int cnum, id; -- cgit From f9bbcb3fb3effdeb9f9f42de77bbde9f2789efdc Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Fri, 7 Nov 1997 03:06:24 +0000 Subject: Modified Files: mangle.c server.c proto.h mangle.c I am planning to replace the mangled_stack array with a proper stack, but found many style inconsistencies (no, really). As you might expect, I have standardized on my own preferences. ;) I also found a potential problem in create_mangled_stack (which I've renamed as reset_mangled_stack). If the stack size were passed into the function as 0 or less, there was the possibility that the array would have been freed twice. I doubt that this ever happens, but I don't like to leave holes. Of course, the fix will be irrelevent once I replace the array with a linked-list-based stack. server.c Changed the call to create_mangled_stack() to a call to reset_mangled_stack(). proto.h Regenerated to match the above changes. (A real comment! How unusual!) (This used to be commit 34d1b3e4fa7a1158f3a3c5c47adf0417c7144095) --- source3/include/proto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 5bb709858f..d8d31bf16f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -390,9 +390,9 @@ struct share_ops *locking_slow_init(int ronly); int str_checksum(char *s); BOOL is_8_3(char *fname, BOOL check_case); -void create_mangled_stack(int size); +void reset_mangled_stack( int size ); BOOL check_mangled_stack(char *s); -BOOL is_mangled(char *s); +BOOL is_mangled( char *s ); void mangle_name_83(char *s); BOOL name_map_mangle(char *OutName,BOOL need83,int snum); -- cgit From b9c6add64536e855156a00e32e5288486114e66e Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 7 Nov 1997 03:28:43 +0000 Subject: ipc.c : added a #define around the alignment thing: it's a way to stop NetMonitor from decoding your packets!!!! proto.h : usual. reply.c : added what i believe to be the correct error messages for getting correct domain joining. smb.h : some guesses at good names of the SAMR_XXXX functions. sorting out the SAMR_LOOKUP_RIDS function. this is *not* the same as the LSA_LOOKUP_RIDS function, unless paul accidentally put it on the ntlsa pipe by mistake, instead of the samr pipe :-) rpc_pipes/lsa_hnd.c rpc_pipes/pipe_hnd.c : moved creation and allocation of unique policy handles into this module. rpc_pipes/pipesamr.c rpc_pipes/samrparse.c rpc_pipes/smbparse.c : SAMR_LOOKUP_RIDS is beginning to look _suspiciously_ like the LSA_LOOKUP_RIDS function. but i know that there are subtle discrepancies. (This used to be commit 6bc07b0b4193e28b13a675fece8d9d6b365a7eb0) --- source3/include/proto.h | 23 ++++++++------- source3/include/smb.h | 76 ++++++++++++++++++++++++++++++------------------- 2 files changed, 59 insertions(+), 40 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index d8d31bf16f..45a9202100 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -390,9 +390,9 @@ struct share_ops *locking_slow_init(int ronly); int str_checksum(char *s); BOOL is_8_3(char *fname, BOOL check_case); -void reset_mangled_stack( int size ); +void create_mangled_stack(int size); BOOL check_mangled_stack(char *s); -BOOL is_mangled( char *s ); +BOOL is_mangled(char *s); void mangle_name_83(char *s); BOOL name_map_mangle(char *OutName,BOOL need83,int snum); @@ -766,8 +766,10 @@ int reply_getattrE(char *inbuf,char *outbuf); /*The following definitions come from rpc_pipes/lsa_hnd.c */ void init_lsa_policy_hnd(void); -BOOL open_lsa_policy_hnd(LSA_POL_HND *hnd, DOM_SID *sid); +BOOL open_lsa_policy_hnd(LSA_POL_HND *hnd); BOOL set_lsa_policy_samr_rid(LSA_POL_HND *hnd, uint32 rid); +BOOL set_lsa_policy_samr_pol_status(LSA_POL_HND *hnd, uint32 pol_status); +BOOL set_lsa_policy_samr_sid(LSA_POL_HND *hnd, DOM_SID *sid); uint32 get_lsa_policy_samr_rid(LSA_POL_HND *hnd); BOOL close_lsa_policy_hnd(LSA_POL_HND *hnd); @@ -889,7 +891,6 @@ BOOL api_srvsvcTNP(int cnum,int uid, char *param,char *data, /*The following definitions come from rpc_pipes/pipeutil.c */ -void create_pol_hnd(LSA_POL_HND *hnd); void initrpcreply(char *inbuf, char *q); void endrpcreply(char *inbuf, char *q, int datalen, int rtnval, int *rlen); BOOL name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); @@ -912,10 +913,10 @@ char* samr_io_q_close(BOOL io, SAMR_Q_CLOSE *q_u, char *q, char *base, int align char* samr_io_r_close(BOOL io, SAMR_R_CLOSE *r_u, char *q, char *base, int align, int depth); char* samr_io_q_open_secret(BOOL io, SAMR_Q_OPEN_SECRET *q_u, char *q, char *base, int align, int depth); char* samr_io_r_open_secret(BOOL io, SAMR_R_OPEN_SECRET *r_u, char *q, char *base, int align, int depth); -char* samr_io_q_unknown_11(BOOL io, SAMR_Q_UNKNOWN_11 *q_u, char *q, char *base, int align, int depth); -void make_samr_r_unknown_11(SAMR_R_UNKNOWN_11 *r_u, - uint32 switch_value, uint32 unknown_0, uint32 status); -char* samr_io_r_unknown_11(BOOL io, SAMR_R_UNKNOWN_11 *r_u, char *q, char *base, int align, int depth); +char* samr_io_q_lookup_rids(BOOL io, SAMR_Q_LOOKUP_RIDS *q_u, char *q, char *base, int align, int depth); +void make_samr_r_lookup_rids(SAMR_R_LOOKUP_RIDS *r_u, + uint32 num_rids, uint32 rid, uint32 status); +char* samr_io_r_lookup_rids(BOOL io, SAMR_R_LOOKUP_RIDS *r_u, char *q, char *base, int align, int depth); char* samr_io_q_unknown_22(BOOL io, SAMR_Q_UNKNOWN_22 *q_u, char *q, char *base, int align, int depth); char* samr_io_r_unknown_22(BOOL io, SAMR_R_UNKNOWN_22 *r_u, char *q, char *base, int align, int depth); char* samr_io_q_unknown_24(BOOL io, SAMR_Q_UNKNOWN_24 *q_u, char *q, char *base, int align, int depth); @@ -925,8 +926,8 @@ void make_samr_r_unknown_24(SAMR_R_UNKNOWN_24 *r_u, char* samr_io_r_unknown_24(BOOL io, SAMR_R_UNKNOWN_24 *r_u, char *q, char *base, int align, int depth); char* samr_io_q_unknown_32(BOOL io, SAMR_Q_UNKNOWN_32 *q_u, char *q, char *base, int align, int depth); char* samr_io_r_unknown_32(BOOL io, SAMR_R_UNKNOWN_32 *r_u, char *q, char *base, int align, int depth); -char* samr_io_q_unknown_39(BOOL io, SAMR_Q_UNKNOWN_39 *q_u, char *q, char *base, int align, int depth); -char* samr_io_r_unknown_39(BOOL io, SAMR_R_UNKNOWN_39 *r_u, char *q, char *base, int align, int depth); +char* samr_io_q_open_policy(BOOL io, SAMR_Q_OPEN_POLICY *q_u, char *q, char *base, int align, int depth); +char* samr_io_r_open_policy(BOOL io, SAMR_R_OPEN_POLICY *r_u, char *q, char *base, int align, int depth); /*The following definitions come from rpc_pipes/smbparse.c */ @@ -946,6 +947,8 @@ void make_dom_sid2(DOM_SID2 *sid2, char *sid_str); char* smb_io_dom_sid2(BOOL io, DOM_SID2 *sid2, char *q, char *base, int align, int depth); void make_dom_rid2(DOM_RID2 *rid2, uint32 rid); char* smb_io_dom_rid2(BOOL io, DOM_RID2 *rid2, char *q, char *base, int align, int depth); +void make_dom_rid3(DOM_RID3 *rid3, uint32 rid); +char* smb_io_dom_rid3(BOOL io, DOM_RID3 *rid3, char *q, char *base, int align, int depth); void make_clnt_srv(DOM_CLNT_SRV *log, char *logon_srv, char *comp_name); char* smb_io_clnt_srv(BOOL io, DOM_CLNT_SRV *log, char *q, char *base, int align, int depth); void make_log_info(DOM_LOG_INFO *log, char *logon_srv, char *acct_name, diff --git a/source3/include/smb.h b/source3/include/smb.h index 83e1d9f85d..afa9e3d9b9 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -293,12 +293,12 @@ enum RPC_PKT_TYPE #define SAMR_CLOSE 0x01 #define SAMR_OPEN_SECRET 0x07 -#define SAMR_LOOKUPNAMES 0x11 +#define SAMR_LOOKUP_RIDS 0x11 #define SAMR_UNKNOWN_3 0x03 #define SAMR_UNKNOWN_22 0x22 #define SAMR_UNKNOWN_24 0x24 #define SAMR_UNKNOWN_34 0x34 -#define SAMR_UNKNOWN_39 0x39 +#define SAMR_OPEN_POLICY 0x39 #define LSA_OPENPOLICY 0x2c #define LSA_QUERYINFOPOLICY 0x07 @@ -423,16 +423,26 @@ typedef struct domsid2_info } DOM_SID2; -/* DOM_RID2 - domain RID structure */ +/* DOM_RID2 - domain RID structure for ntlsa pipe */ typedef struct domrid2_info { uint32 type; /* value is 5 */ - uint32 undoc; /* value is 5 */ + uint32 undoc; /* value is non-zero */ uint32 rid; uint32 rid_idx; /* don't know what this is */ } DOM_RID2; +/* DOM_RID3 - domain RID structure for samr pipe */ +typedef struct domrid3_info +{ + uint32 rid; /* domain-relative (to a SID) id */ + uint32 type1; /* value is 0x1 */ + uint32 ptr_type; /* undocumented pointer */ + uint32 type2; /* value is 0x1 */ + +} DOM_RID3; + /* DOM_CLNT_SRV - client / server names */ typedef struct clnt_srv_info { @@ -841,7 +851,7 @@ typedef struct lsa_q_lookup_rids } LSA_Q_LOOKUP_RIDS; -/* LSA_R_LOOKUP_RIDS - response to LSA Lookup Names */ +/* LSA_R_LOOKUP_RIDS - response to LSA Lookup RIDs by name */ typedef struct lsa_r_lookup_rids { DOM_R_REF dom_ref; /* domain reference info */ @@ -1151,37 +1161,43 @@ typedef struct r_samr_open_secret_info } SAMR_R_OPEN_SECRET; -/* SAMR_Q_UNKNOWN_11 - probably a "read SAM entry" */ -typedef struct q_samr_unknown_11_info +/**************************************************************************** +SAMR_Q_LOOKUP_RIDS - do a conversion (only one!) from name to RID. + +the policy handle allocated by an "samr open secret" call is associated +with a SID. this policy handle is what is queried here, *not* the SID +itself. the response to the lookup rids is relative to this SID. +*****************************************************************************/ +/* SAMR_Q_LOOKUP_RIDS - probably a "read SAM entry" */ +typedef struct q_samr_lookup_names_info { LSA_POL_HND pol; /* policy handle */ - uint32 switch_value1; /* 1 - switch value? */ - uint32 unknown_0; /* 0x0000 03E8 - 32 bit unknown */ - uint32 unknown_1; /* 0 - 32 bit unknown */ - uint32 switch_value2; /* 1 - switch value? */ + uint32 num_rids1; /* 1 - number of rids being looked up */ + uint32 rid; /* 0000 03e8 - RID of the server being queried? */ + uint32 ptr; /* 0 - 32 bit unknown */ + uint32 num_rids2; /* 1 - number of rids being looked up */ UNIHDR hdr_mach_acct; /* unicode machine account name header */ UNISTR2 uni_mach_acct; /* unicode machine account name */ -} SAMR_Q_UNKNOWN_11; +} SAMR_Q_LOOKUP_RIDS; -/* SAMR_R_UNKNOWN_11 - probably an open */ -typedef struct r_samr_unknown_11_info +/* SAMR_R_LOOKUP_RIDS - probably an open */ +typedef struct r_samr_lookup_names_info { - uint32 switch_value1; /* 1 - switch value? */ - uint32 ptr_0; /* pointer */ - uint32 switch_value2; /* 1 - switch value? */ - uint32 unknown_0; /* 0x000003e8 - 32 bit unknown */ - uint32 switch_value3; /* 1 - switch value? */ - uint32 ptr_1; /* pointer */ - uint32 switch_value4; /* 1 - switch value? */ - uint32 switch_value5; /* 1 - switch value? */ + uint32 num_entries; + uint32 undoc_buffer; /* undocumented buffer pointer */ + + uint32 num_entries2; + DOM_RID3 dom_rid[MAX_LOOKUP_SIDS]; /* domain RIDs being looked up */ - uint32 status; /* return status - 0x99: user exists */ + uint32 num_entries3; + + uint32 status; /* return code */ -} SAMR_R_UNKNOWN_11; +} SAMR_R_LOOKUP_RIDS; /* SAMR_Q_UNKNOWN_22 - probably an open */ @@ -1279,24 +1295,24 @@ typedef struct r_samr_unknown_32_info } SAMR_R_UNKNOWN_32; -/* SAMR_Q_UNKNOWN_39 - probably an open */ -typedef struct q_samr_unknown_39_info +/* SAMR_Q_OPEN_POLICY - probably an open */ +typedef struct q_samr_open_policy_info { uint32 ptr_srv_name; /* pointer (to server name?) */ UNISTR2 uni_srv_name; /* unicode server name starting with '\\' */ uint32 unknown_0; /* 32 bit unknown */ -} SAMR_Q_UNKNOWN_39; +} SAMR_Q_OPEN_POLICY; -/* SAMR_R_UNKNOWN_39 - probably an open */ -typedef struct r_samr_unknown_39_info +/* SAMR_R_OPEN_POLICY - probably an open */ +typedef struct r_samr_open_policy_info { LSA_POL_HND pol; /* policy handle */ uint32 status; /* return status */ -} SAMR_R_UNKNOWN_39; +} SAMR_R_OPEN_POLICY; /* WKS_Q_UNKNOWN_0 - probably a capabilities request */ -- cgit From 029904995d27c4e765abf9334df34c399a535bea Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 7 Nov 1997 03:37:18 +0000 Subject: local time discrepancies between the date on my computer and the date on chris' computer (probably about four minutes) meant that chris' commits didn't get downloaded when i did a cvs update. therefore, i did a cvs update; make proto; cvs commit, and still got problems. so, five minutes later, i do a cvs update, and _then_ chris' server.c and mangle.c mods get downloaded, and i have to do another make proto. this particular problem has hit us *really* badly in the past, because i was taking files home (onto a portable that i hadn't reset the time on since i went to the states) and then recopying them back onto the computer here. if i do this, i do a touch *.c *.h; cvs -t update. *then* a cvs commit. (This used to be commit edb9c52948159baa48d9decd253a401737bd5363) --- source3/include/proto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 45a9202100..d3d905481f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -390,9 +390,9 @@ struct share_ops *locking_slow_init(int ronly); int str_checksum(char *s); BOOL is_8_3(char *fname, BOOL check_case); -void create_mangled_stack(int size); +void reset_mangled_stack( int size ); BOOL check_mangled_stack(char *s); -BOOL is_mangled(char *s); +BOOL is_mangled( char *s ); void mangle_name_83(char *s); BOOL name_map_mangle(char *OutName,BOOL need83,int snum); -- cgit From a90d2061316d19c30d9f14c1e78d6f6266183ce0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 8 Nov 1997 04:02:05 +0000 Subject: added two more sets of tests to the smbtorture test. The tests I added are ones that I know Samba fails. They are: 1) correct support for retaining locks over a close (ie. the server must not use posix semantics) 2) support for lock timeouts 3) the server supports multiple locking contexts on the one SMB connection, distinguished by PID. 4) the server correctly fails overlapping locks made by the same PID (this goes against POSIX behaviour, which is why it is tricky to implement) 5) the server denies unlock requests by an incorrect client PID I've been discussing with Jeremy ways that we can re-implement the locking code to handle these correctly. This test code will be useful to see that we have got it right. (This used to be commit 097781e2992f12c545170c82ada2f4023a9784f5) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index d3d905481f..98c671ea86 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -69,6 +69,7 @@ void cli_shutdown(struct cli_state *cli); char *cli_errstr(struct cli_state *cli); void cli_error(struct cli_state *cli, int *eclass, int *num); void cli_sockopt(struct cli_state *cli, char *options); +int cli_setpid(struct cli_state *cli, int pid); /*The following definitions come from clientutil.c */ -- cgit From e357d9106895b165bfa3f8331b9f186004c9a6cd Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sun, 9 Nov 1997 17:30:10 +0000 Subject: attempting to mark up 32 bit error codes, needed for NT domains. separated out smb server-mode password validation into a separate file. added called and calling netbios names to client gen state: referenced section in rfc1002.txt. created workstation trust account checking code in ntclient.c there might be a bug in reply_session_setup_andX. i indented and added { } around single-line if statements: the lm password checking code now doesn't look right (around the GUEST_SESSSETUP bits). *no code semantics have been changed by the indentation process*. (This used to be commit f27966957fa7f16d337a4a58719239d036deab4c) --- source3/include/proto.h | 41 ++++++++++++++++++++++++++++------------ source3/include/smb.h | 50 +++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 73 insertions(+), 18 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 98c671ea86..cffa297413 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -61,13 +61,14 @@ BOOL cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int int cli_read(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 size); int cli_write(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 size); BOOL cli_negprot(struct cli_state *cli); -BOOL cli_session_request(struct cli_state *cli, char *host, int name_type, - char *myname); +BOOL cli_session_request(struct cli_state *cli, + char *called_host_name , int called_name_type, + char calling_netbios_name[16], int calling_name_type); BOOL cli_connect(struct cli_state *cli, char *host, struct in_addr *ip); BOOL cli_initialise(struct cli_state *cli); void cli_shutdown(struct cli_state *cli); char *cli_errstr(struct cli_state *cli); -void cli_error(struct cli_state *cli, int *eclass, int *num); +BOOL cli_error(struct cli_state *cli, uint8 *eclass, uint32 *num); void cli_sockopt(struct cli_state *cli, char *options); int cli_setpid(struct cli_state *cli, int pid); @@ -627,9 +628,16 @@ void sync_browse_lists(struct subnet_record *d, struct work_record *work, /*The following definitions come from ntclient.c */ -BOOL do_nt_login(char *desthost, char *myhostname, +BOOL wksta_trust_account_check(struct in_addr dest_ip, char *dest_host, + char *myhostname, char *domain); +BOOL do_nt_login(struct in_addr dest_ip, char *dest_host, + char *myhostname, int Client, int cnum); +/*The following definitions come from nterr.c */ + +char *get_nt_error_msg(uint16 nt_code); + /*The following definitions come from params.c */ BOOL pm_process( char *FileName, @@ -654,11 +662,6 @@ BOOL user_ok(char *user,int snum); BOOL authorise_login(int snum,char *user,char *password, int pwlen, BOOL *guest,BOOL *force,uint16 vuid); BOOL check_hosts_equiv(char *user); -struct cli_state *server_client(void); -struct cli_state *server_cryptkey(void); -BOOL server_validate(char *user, char *domain, - char *pass, int passlen, - char *ntpass, int ntpasslen); /*The following definitions come from pcap.c */ @@ -692,6 +695,18 @@ void status_printjob(int cnum,int snum,int jobid,int status); int printjob_encode(int snum, int job); void printjob_decode(int jobid, int *snum, int *job); +/*The following definitions come from pwd_validate.c */ + +BOOL server_connect_init(struct cli_state *clnt, char my_netbios_name[16], + struct in_addr dest_ip, char *desthost); +BOOL server_cryptkey(struct cli_state *clnt, char my_netbios_name[16]); +BOOL server_validate2(struct cli_state *clnt, char *user, char *domain, + char *pass, int passlen, + char *ntpass, int ntpasslen); +BOOL server_validate(struct cli_state *clnt, char *user, char *domain, + char *pass, int passlen, + char *ntpass, int ntpasslen); + /*The following definitions come from quotas.c */ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); @@ -1029,6 +1044,7 @@ char* wks_io_r_unknown_0(BOOL io, WKS_R_UNKNOWN_0 *r_u, char *q, char *base, int /*The following definitions come from server.c */ +struct cli_state *pwd_server_connection(void); void *dflt_sig(void); void killkids(void); mode_t unix_mode(int cnum,int dosmode); @@ -1096,10 +1112,11 @@ void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key); /*The following definitions come from smbencrypt.c */ -void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); +void SMBencrypt(uchar *passwd, uchar *c8, uchar p24[24]); void E_md4hash(uchar *passwd, uchar *p16); -void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); -void nt_lm_owf_gen(char *pwd, char *nt_p16, char *p16); +void SMBOWFencrypt(char passwd[16], uchar *c8, uchar p24[24]); +void SMBNTencrypt(uchar *passwd, uchar *c8, uchar p24[24]); +void nt_lm_owf_gen(char *pwd, char nt_p16[16], char p16[16]); /*The following definitions come from smberr.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index afa9e3d9b9..687f14b9ca 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1363,9 +1363,13 @@ struct cli_state { int protocol; int sec_mode; int error; - int privilages; + int privileges; fstring eff_name; - fstring desthost; + + fstring full_dest_host_name; + char called_netbios_name[16]; + char calling_netbios_name[16]; + char cryptkey[8]; uint32 sesskey; int serverzone; @@ -2020,6 +2024,15 @@ char *Strstr(char *s, char *p); #define BROWSER_CONSTANT 0xaa55 +/* NT Flags2 bits - cifs6.txt section 3.1.2 */ + +#define FLAGS2_LONG_PATH_COMPONENTS 0x0001 +#define FLAGS2_EXTENDED_ATTRIBUTES 0x0002 +#define FLAGS2_DFS_PATHNAMES 0x1000 +#define FLAGS2_READ_PERMIT_NO_EXECUTE 0x2000 +#define FLAGS2_32_BIT_ERROR_CODES 0x4000 +#define FLAGS2_UNICODE_STRINGS 0x8000 + /* Capabilities. see ftp.microsoft.com/developr/drg/cifs/cifs/cifs4.txt */ #define CAP_RAW_MODE 0x0001 @@ -2037,14 +2050,39 @@ char *Strstr(char *s, char *p); /* protocol types. It assumes that higher protocols include lower protocols as subsets */ -enum protocol_types {PROTOCOL_NONE,PROTOCOL_CORE,PROTOCOL_COREPLUS,PROTOCOL_LANMAN1,PROTOCOL_LANMAN2,PROTOCOL_NT1}; +enum protocol_types +{ + PROTOCOL_NONE, + PROTOCOL_CORE, + PROTOCOL_COREPLUS, + PROTOCOL_LANMAN1, + PROTOCOL_LANMAN2, + PROTOCOL_NT1 +}; /* security levels */ -enum security_types {SEC_SHARE,SEC_USER,SEC_SERVER}; +enum security_types +{ + SEC_SHARE, + SEC_USER, + SEC_SERVER +}; + +/* bit-masks for security mode. see cifs6.txt Negprot 4.1.1 server response */ +#define USE_USER_LEVEL_SECURITY 1 +#define USE_CHALLENGE_RESPONSE 2 /* printing types */ -enum printing_types {PRINT_BSD,PRINT_SYSV,PRINT_AIX,PRINT_HPUX, - PRINT_QNX,PRINT_PLP,PRINT_LPRNG}; +enum printing_types +{ + PRINT_BSD, + PRINT_SYSV, + PRINT_AIX, + PRINT_HPUX, + PRINT_QNX, + PRINT_PLP, + PRINT_LPRNG +}; /* Remote architectures we know about. */ enum remote_arch_types {RA_UNKNOWN, RA_WFWG, RA_OS2, RA_WIN95, RA_WINNT, RA_SAMBA}; -- cgit From cc512947c9e1744c5541252c7cc934ebcd2e6961 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sun, 9 Nov 1997 20:42:47 +0000 Subject: byteorder.h : typecasting for the debug messages of the data dump. hm. #ifdef NTDOMAIN ntclient.c rpc_pipes/lsaparse.c rpc_pipes/ntclientnet.c rpc_pipes/smbparse.c : adding "Net Server Password Set" functionality to smbclient. #endif (This used to be commit ad43183d2dd62a808c9fba03f81562362d4de713) --- source3/include/byteorder.h | 6 +++--- source3/include/proto.h | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h index 4d972a5cac..46a44bad8c 100644 --- a/source3/include/byteorder.h +++ b/source3/include/byteorder.h @@ -207,7 +207,7 @@ it also defines lots of intermediate macros, just ignore those :-) DEBUG(5,("%s%04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ if (charmode) print_asc(5, (unsigned char*)(outbuf), (len)); else \ - { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%02x ", (outbuf)[idx])); } } \ + { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%02x ", (uint8)((outbuf)[idx]))); } } \ DEBUG(5,("\n")); #define DBG_RW_PSVAL(charmode,string,depth,base,read,inbuf,outbuf,len) \ @@ -215,7 +215,7 @@ it also defines lots of intermediate macros, just ignore those :-) DEBUG(5,("%s%04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ if (charmode) print_asc(5, (unsigned char*)(outbuf), 2*(len)); else \ - { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%04x ", (outbuf)[idx])); } } \ + { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%04x ", (uint16)((outbuf)[idx]))); } } \ DEBUG(5,("\n")); #define DBG_RW_PIVAL(charmode,string,depth,base,read,inbuf,outbuf,len) \ @@ -223,7 +223,7 @@ it also defines lots of intermediate macros, just ignore those :-) DEBUG(5,("%s%04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ if (charmode) print_asc(5, (unsigned char*)(outbuf), 4*(len)); else \ - { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%08x ", (outbuf)[idx])); } } \ + { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%08x ", (uint32)((outbuf)[idx]))); } } \ DEBUG(5,("\n")); #define DBG_RW_CVAL(string,depth,base,read,inbuf,outbuf) \ diff --git a/source3/include/proto.h b/source3/include/proto.h index cffa297413..df7e182848 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -629,7 +629,8 @@ void sync_browse_lists(struct subnet_record *d, struct work_record *work, /*The following definitions come from ntclient.c */ BOOL wksta_trust_account_check(struct in_addr dest_ip, char *dest_host, - char *myhostname, char *domain); + char *myhostname, char *domain, + fstring mach_pwd, fstring new_mach_pwd); BOOL do_nt_login(struct in_addr dest_ip, char *dest_host, char *myhostname, int Client, int cnum); @@ -820,6 +821,9 @@ void make_q_auth_2(LSA_Q_AUTH_2 *q_a, DOM_CHAL *clnt_chal, uint32 clnt_flgs); char* lsa_io_q_auth_2(BOOL io, LSA_Q_AUTH_2 *q_a, char *q, char *base, int align, int depth); char* lsa_io_r_auth_2(BOOL io, LSA_R_AUTH_2 *r_a, char *q, char *base, int align, int depth); +void make_q_srv_pwset(LSA_Q_SRV_PWSET *q_s, char sess_key[8], + char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name, + DOM_CRED *cred, char nt_cypher[16]); char* lsa_io_q_srv_pwset(BOOL io, LSA_Q_SRV_PWSET *q_s, char *q, char *base, int align, int depth); char* lsa_io_r_srv_pwset(BOOL io, LSA_R_SRV_PWSET *r_s, char *q, char *base, int align, int depth); char* lsa_io_user_info(BOOL io, LSA_USER_INFO *usr, char *q, char *base, int align, int depth); @@ -846,6 +850,11 @@ BOOL do_lsa_req_chal(uint16 fnum, uint32 call_id, BOOL do_lsa_auth2(uint16 fnum, uint32 call_id, char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name, DOM_CHAL *clnt_chal, uint32 neg_flags, DOM_CHAL *srv_chal); +BOOL do_lsa_srv_pwset(uint16 fnum, uint32 call_id, + uchar sess_key[8], + char *logon_srv, char *mach_acct, uint16 sec_chan_type, char *comp_name, + DOM_CRED *clnt_cred, DOM_CRED *srv_cred, + char nt_owf_new_mach_pwd[16]); BOOL do_lsa_sam_logon(uint16 fnum, uint32 call_id, uchar sess_key[8], DOM_CRED *sto_clnt_cred, char *logon_srv, char *comp_name, @@ -976,6 +985,10 @@ void make_clnt_info2(DOM_CLNT_INFO2 *clnt, char *logon_srv, char *comp_name, DOM_CRED *clnt_cred); char* smb_io_clnt_info2(BOOL io, DOM_CLNT_INFO2 *clnt, char *q, char *base, int align, int depth); +char* make_clnt_info(DOM_CLNT_INFO *clnt, + char *logon_srv, char *acct_name, + uint16 sec_chan, char *comp_name, + DOM_CRED *cred); char* smb_io_clnt_info(BOOL io, DOM_CLNT_INFO *clnt, char *q, char *base, int align, int depth); void make_logon_id(DOM_LOGON_ID *log, uint32 log_id_low, uint32 log_id_high); char* smb_io_logon_id(BOOL io, DOM_LOGON_ID *log, char *q, char *base, int align, int depth); -- cgit From 77aec4ae6307c0ad0b843bbf23d64ccb1aaf7476 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 10 Nov 1997 19:23:17 +0000 Subject: Rolled back tree state to 11:59pm 8th November 1997 EST to remove problems. Jeremy (This used to be commit 4a36ac236c2ad634f05efcd0179875d09988614a) --- source3/include/byteorder.h | 6 +++--- source3/include/proto.h | 42 +++++++++++-------------------------- source3/include/smb.h | 50 ++++++--------------------------------------- 3 files changed, 21 insertions(+), 77 deletions(-) (limited to 'source3/include') diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h index 46a44bad8c..4d972a5cac 100644 --- a/source3/include/byteorder.h +++ b/source3/include/byteorder.h @@ -207,7 +207,7 @@ it also defines lots of intermediate macros, just ignore those :-) DEBUG(5,("%s%04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ if (charmode) print_asc(5, (unsigned char*)(outbuf), (len)); else \ - { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%02x ", (uint8)((outbuf)[idx]))); } } \ + { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%02x ", (outbuf)[idx])); } } \ DEBUG(5,("\n")); #define DBG_RW_PSVAL(charmode,string,depth,base,read,inbuf,outbuf,len) \ @@ -215,7 +215,7 @@ it also defines lots of intermediate macros, just ignore those :-) DEBUG(5,("%s%04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ if (charmode) print_asc(5, (unsigned char*)(outbuf), 2*(len)); else \ - { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%04x ", (uint16)((outbuf)[idx]))); } } \ + { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%04x ", (outbuf)[idx])); } } \ DEBUG(5,("\n")); #define DBG_RW_PIVAL(charmode,string,depth,base,read,inbuf,outbuf,len) \ @@ -223,7 +223,7 @@ it also defines lots of intermediate macros, just ignore those :-) DEBUG(5,("%s%04x %s: ", \ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \ if (charmode) print_asc(5, (unsigned char*)(outbuf), 4*(len)); else \ - { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%08x ", (uint32)((outbuf)[idx]))); } } \ + { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%08x ", (outbuf)[idx])); } } \ DEBUG(5,("\n")); #define DBG_RW_CVAL(string,depth,base,read,inbuf,outbuf) \ diff --git a/source3/include/proto.h b/source3/include/proto.h index df7e182848..1724c312db 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -61,14 +61,13 @@ BOOL cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int int cli_read(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 size); int cli_write(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 size); BOOL cli_negprot(struct cli_state *cli); -BOOL cli_session_request(struct cli_state *cli, - char *called_host_name , int called_name_type, - char calling_netbios_name[16], int calling_name_type); +BOOL cli_session_request(struct cli_state *cli, char *host, int name_type, + char *myname); BOOL cli_connect(struct cli_state *cli, char *host, struct in_addr *ip); BOOL cli_initialise(struct cli_state *cli); void cli_shutdown(struct cli_state *cli); char *cli_errstr(struct cli_state *cli); -BOOL cli_error(struct cli_state *cli, uint8 *eclass, uint32 *num); +void cli_error(struct cli_state *cli, int *eclass, int *num); void cli_sockopt(struct cli_state *cli, char *options); int cli_setpid(struct cli_state *cli, int pid); @@ -628,17 +627,9 @@ void sync_browse_lists(struct subnet_record *d, struct work_record *work, /*The following definitions come from ntclient.c */ -BOOL wksta_trust_account_check(struct in_addr dest_ip, char *dest_host, - char *myhostname, char *domain, - fstring mach_pwd, fstring new_mach_pwd); -BOOL do_nt_login(struct in_addr dest_ip, char *dest_host, - char *myhostname, +BOOL do_nt_login(char *desthost, char *myhostname, int Client, int cnum); -/*The following definitions come from nterr.c */ - -char *get_nt_error_msg(uint16 nt_code); - /*The following definitions come from params.c */ BOOL pm_process( char *FileName, @@ -663,6 +654,11 @@ BOOL user_ok(char *user,int snum); BOOL authorise_login(int snum,char *user,char *password, int pwlen, BOOL *guest,BOOL *force,uint16 vuid); BOOL check_hosts_equiv(char *user); +struct cli_state *server_client(void); +struct cli_state *server_cryptkey(void); +BOOL server_validate(char *user, char *domain, + char *pass, int passlen, + char *ntpass, int ntpasslen); /*The following definitions come from pcap.c */ @@ -696,18 +692,6 @@ void status_printjob(int cnum,int snum,int jobid,int status); int printjob_encode(int snum, int job); void printjob_decode(int jobid, int *snum, int *job); -/*The following definitions come from pwd_validate.c */ - -BOOL server_connect_init(struct cli_state *clnt, char my_netbios_name[16], - struct in_addr dest_ip, char *desthost); -BOOL server_cryptkey(struct cli_state *clnt, char my_netbios_name[16]); -BOOL server_validate2(struct cli_state *clnt, char *user, char *domain, - char *pass, int passlen, - char *ntpass, int ntpasslen); -BOOL server_validate(struct cli_state *clnt, char *user, char *domain, - char *pass, int passlen, - char *ntpass, int ntpasslen); - /*The following definitions come from quotas.c */ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); @@ -1057,7 +1041,6 @@ char* wks_io_r_unknown_0(BOOL io, WKS_R_UNKNOWN_0 *r_u, char *q, char *base, int /*The following definitions come from server.c */ -struct cli_state *pwd_server_connection(void); void *dflt_sig(void); void killkids(void); mode_t unix_mode(int cnum,int dosmode); @@ -1125,11 +1108,10 @@ void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key); /*The following definitions come from smbencrypt.c */ -void SMBencrypt(uchar *passwd, uchar *c8, uchar p24[24]); +void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); void E_md4hash(uchar *passwd, uchar *p16); -void SMBOWFencrypt(char passwd[16], uchar *c8, uchar p24[24]); -void SMBNTencrypt(uchar *passwd, uchar *c8, uchar p24[24]); -void nt_lm_owf_gen(char *pwd, char nt_p16[16], char p16[16]); +void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); +void nt_lm_owf_gen(char *pwd, char *nt_p16, char *p16); /*The following definitions come from smberr.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index 687f14b9ca..afa9e3d9b9 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1363,13 +1363,9 @@ struct cli_state { int protocol; int sec_mode; int error; - int privileges; + int privilages; fstring eff_name; - - fstring full_dest_host_name; - char called_netbios_name[16]; - char calling_netbios_name[16]; - + fstring desthost; char cryptkey[8]; uint32 sesskey; int serverzone; @@ -2024,15 +2020,6 @@ char *Strstr(char *s, char *p); #define BROWSER_CONSTANT 0xaa55 -/* NT Flags2 bits - cifs6.txt section 3.1.2 */ - -#define FLAGS2_LONG_PATH_COMPONENTS 0x0001 -#define FLAGS2_EXTENDED_ATTRIBUTES 0x0002 -#define FLAGS2_DFS_PATHNAMES 0x1000 -#define FLAGS2_READ_PERMIT_NO_EXECUTE 0x2000 -#define FLAGS2_32_BIT_ERROR_CODES 0x4000 -#define FLAGS2_UNICODE_STRINGS 0x8000 - /* Capabilities. see ftp.microsoft.com/developr/drg/cifs/cifs/cifs4.txt */ #define CAP_RAW_MODE 0x0001 @@ -2050,39 +2037,14 @@ char *Strstr(char *s, char *p); /* protocol types. It assumes that higher protocols include lower protocols as subsets */ -enum protocol_types -{ - PROTOCOL_NONE, - PROTOCOL_CORE, - PROTOCOL_COREPLUS, - PROTOCOL_LANMAN1, - PROTOCOL_LANMAN2, - PROTOCOL_NT1 -}; +enum protocol_types {PROTOCOL_NONE,PROTOCOL_CORE,PROTOCOL_COREPLUS,PROTOCOL_LANMAN1,PROTOCOL_LANMAN2,PROTOCOL_NT1}; /* security levels */ -enum security_types -{ - SEC_SHARE, - SEC_USER, - SEC_SERVER -}; - -/* bit-masks for security mode. see cifs6.txt Negprot 4.1.1 server response */ -#define USE_USER_LEVEL_SECURITY 1 -#define USE_CHALLENGE_RESPONSE 2 +enum security_types {SEC_SHARE,SEC_USER,SEC_SERVER}; /* printing types */ -enum printing_types -{ - PRINT_BSD, - PRINT_SYSV, - PRINT_AIX, - PRINT_HPUX, - PRINT_QNX, - PRINT_PLP, - PRINT_LPRNG -}; +enum printing_types {PRINT_BSD,PRINT_SYSV,PRINT_AIX,PRINT_HPUX, + PRINT_QNX,PRINT_PLP,PRINT_LPRNG}; /* Remote architectures we know about. */ enum remote_arch_types {RA_UNKNOWN, RA_WFWG, RA_OS2, RA_WIN95, RA_WINNT, RA_SAMBA}; -- cgit From 9f804556c4d0bb68f9b7acaf2b679bc0a02ea8f9 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 17 Nov 1997 19:16:38 +0000 Subject: loadparm.c : Added "veto oplock files" parameter. make_printerdef.c: Fixed warning. quotas.c: Fixed irix root errors. server.c: Fixed oplock reference count bug. smb.h: Added IS_VETO_OPLOCK_PATH(). Jeremy. (This used to be commit c28487df63e29bc0f8d2ece876a07a2a076d4c73) --- source3/include/proto.h | 1 + source3/include/smb.h | 2 ++ 2 files changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 1724c312db..fceb83b282 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -300,6 +300,7 @@ char *lp_volume(int ); char *lp_mangled_map(int ); char *lp_veto_files(int ); char *lp_hide_files(int ); +char *lp_veto_oplocks(int ); char *lp_driverlocation(int ); BOOL lp_alternate_permissions(int ); BOOL lp_revalidate(int ); diff --git a/source3/include/smb.h b/source3/include/smb.h index afa9e3d9b9..6056ccd70f 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1502,6 +1502,7 @@ typedef struct int num_files_open; name_compare_entry *hide_list; /* Per-share list of files to return as hidden. */ name_compare_entry *veto_list; /* Per-share list of files to veto (never show). */ + name_compare_entry *veto_oplock_list; /* Per-share list of files to refuse oplocks on. */ } connection_struct; @@ -1680,6 +1681,7 @@ struct connect_record #define MAP_ARCHIVE(cnum) (OPEN_CNUM(cnum) && lp_map_archive(SNUM(cnum))) #define IS_HIDDEN_PATH(cnum,path) (is_in_path((path),Connections[(cnum)].hide_list)) #define IS_VETO_PATH(cnum,path) (is_in_path((path),Connections[(cnum)].veto_list)) +#define IS_VETO_OPLOCK_PATH(cnum,path) (is_in_path((path),Connections[(cnum)].veto_oplock_list)) #define SMBENCRYPT() (lp_encrypted_passwords()) -- cgit From 689ed3481d491e247fac8fb57a0bd78bfa216c2a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 18 Nov 1997 23:30:49 +0000 Subject: ipc.c: Changed reply_trans to use receive_next_smb() to cope with local message processing. reply.c: Added check to reply_lockingX for chain after oplock break. server.c: Added receive_next_smb(). trans2.c: Changed reply_trans2 to use receive_next_smb() to cope with local message processing. (This used to be commit f4ae644e13f2c4479dfc94c77c0a8295edf54086) --- source3/include/proto.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index fceb83b282..9624116f82 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -172,7 +172,7 @@ struct in_addr *iface_ip(struct in_addr ip); /*The following definitions come from ipc.c */ int get_printerdrivernumber(int snum); -int reply_trans(char *inbuf,char *outbuf); +int reply_trans(char *inbuf,char *outbuf, int size, int bufsize); /*The following definitions come from kanji.c */ @@ -1071,6 +1071,7 @@ int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int BOOL oplock_break(uint32 dev, uint32 inode, struct timeval *tval); BOOL request_oplock_break(share_mode_entry *share_entry, uint32 dev, uint32 inode); +BOOL receive_next_smb(int smbfd, int oplockfd, char *inbuf, int bufsize, int timeout); BOOL snum_used(int snum); BOOL reload_services(BOOL test); int setup_groups(char *user, int uid, int gid, int *p_ngroups, -- cgit From 4e92c7d1a3b543e48c2b09f8b78352a702c915aa Mon Sep 17 00:00:00 2001 From: John Terpstra Date: Fri, 21 Nov 1997 14:01:23 +0000 Subject: Added in mods for new smb.conf "remote browse sync" option as posted to the samba-1.9.17 tree moments ago. (This used to be commit 2ee25cd117a116d0304960780d6c197f39d25a3d) --- source3/include/proto.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 9624116f82..090e9830a8 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -209,6 +209,7 @@ char *lp_logon_path(void); char *lp_logon_drive(void); char *lp_logon_home(void); char *lp_remote_announce(void); +char *lp_remote_browse_sync(void); char *lp_wins_server(void); char *lp_interfaces(void); char *lp_socket_address(void); @@ -426,6 +427,7 @@ void announce_host(time_t t); void reset_announce_timer(); void announce_master(time_t t); void announce_remote(time_t t); +void browse_sync_remote(time_t t); /*The following definitions come from namebrowse.c */ -- cgit From 51f20adc6b964bad6e5bfbf69da68e1e6f45b13e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 22 Nov 1997 07:09:12 +0000 Subject: added true enumerated types in loadparm.c. Now we don't need all those "interpret_security" and similar functions. This also means that testparm produces string values for these enumerated types rather than an integer. This was done to make the web interface much cleaner. While I was doing this I found a couple of very nasty bugs in the parm_table code. Someone had added a handle_character_set() function that treated the char** pointer for a P_STRING as an integer! This would have caused memory corruption for anyone using the "character set" option. The loadparm code is delicate - please be careful about using it's more esoteric features! I've also removed the "coding system" global and made it a P_STRING. The integer value was never used anywhere in Samba. (This used to be commit bac6b0daa288e879330e3d585582122bb93a1ffb) --- source3/include/kanji.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/kanji.h b/source3/include/kanji.h index cf30365920..528680d88a 100644 --- a/source3/include/kanji.h +++ b/source3/include/kanji.h @@ -125,8 +125,6 @@ extern char *(*_unix_to_dos)(char *str, BOOL overwrite); #define CAP_CODE (6) #define DOSV_CODE SJIS_CODE -int interpret_coding_system (char *str, int def); - #define unix_to_dos(x,y) unix2dos_format(x,y) #define dos_to_unix(x,y) dos2unix_format(x,y) -- cgit From ab3f4464e88c67d071e348a68aebb8b093f12f1f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 22 Nov 1997 07:10:22 +0000 Subject: the usual :-) (This used to be commit d6467d44b14f4bc683b839d520b4df38719bf2c0) --- source3/include/proto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 090e9830a8..d69aa61e72 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -20,7 +20,7 @@ BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question, char *unix2dos_format(char *str,BOOL overwrite); char *dos2unix_format(char *str, BOOL overwrite); -int interpret_character_set(char *str, int def); +void interpret_character_set(char *str); /*The following definitions come from charset.c */ @@ -180,7 +180,7 @@ char *sj_strtok(char *s1, char *s2); char *sj_strstr(char *s1, char *s2); char *sj_strchr (char *s, int c); char *sj_strrchr(char *s, int c); -int interpret_coding_system(char *str, int def); +int interpret_coding_system(char *str); /*The following definitions come from loadparm.c */ -- cgit From 8bf0f359f3ec440ace0bba6c12ca65d25ba45fd9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 23 Nov 1997 02:41:22 +0000 Subject: added a test for the NT SMBgetatr bug in smbtorture added support for choosing the protocol level in smbtorture (-m option) use -1 for null date in cli_close() get the attributes right in cli_open() (This used to be commit d64d40a6ec57a4a999ae1f39175bcfd86ccb196e) --- source3/include/proto.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index d69aa61e72..81868f5e12 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -16,6 +16,18 @@ BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question, BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question, struct name_record **n); +/*The following definitions come from cgi.c */ + +void cgi_load_variables(FILE *f1); +char *cgi_variable(char *name); +char *cgi_vnum(int i, char **name); +int cgi_boolean(char *name, int def); +char *quotedup(char *s); +char *urlquote(char *s); +char *quotequotes(char *s); +void quote_spaces(char *buf); +void cgi_setup(char *rootdir); + /*The following definitions come from charcnv.c */ char *unix2dos_format(char *str,BOOL overwrite); @@ -60,6 +72,7 @@ BOOL cli_lock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int ti BOOL cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout); int cli_read(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 size); int cli_write(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 size); +BOOL cli_stat(struct cli_state *cli, char *fname, struct stat *st); BOOL cli_negprot(struct cli_state *cli); BOOL cli_session_request(struct cli_state *cli, char *host, int name_type, char *myname); -- cgit From a1c5442abb3bc221157ca3620d35e1a013b26232 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 23 Nov 1997 03:09:59 +0000 Subject: test SMBsetatr as well (This used to be commit 2f29c24ba721e417828efca57011ed45892191a5) --- source3/include/proto.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 81868f5e12..1e8c33be15 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -72,7 +72,9 @@ BOOL cli_lock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int ti BOOL cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout); int cli_read(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 size); int cli_write(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 size); -BOOL cli_stat(struct cli_state *cli, char *fname, struct stat *st); +BOOL cli_getatr(struct cli_state *cli, char *fname, + int *attr, uint32 *size, time_t *t); +BOOL cli_setatr(struct cli_state *cli, char *fname, int attr, time_t t); BOOL cli_negprot(struct cli_state *cli); BOOL cli_session_request(struct cli_state *cli, char *host, int name_type, char *myname); -- cgit From c16d132bf95d96e2aa572cb9ba18a68abfbbeb8d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 23 Nov 1997 05:55:44 +0000 Subject: added some QPATHINFO and QFILEINFO tests into smbtorture. This tests for things like midnight access times, sticky create times and word reversed INFO_STANDARD returns (This used to be commit 89141de14edf9e46ab279d2a74a9b026716a0ba8) --- source3/include/proto.h | 4 ++++ source3/include/trans2.h | 7 ------- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 1e8c33be15..a9ccda3b4a 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -75,6 +75,10 @@ int cli_write(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 BOOL cli_getatr(struct cli_state *cli, char *fname, int *attr, uint32 *size, time_t *t); BOOL cli_setatr(struct cli_state *cli, char *fname, int attr, time_t t); +BOOL cli_qpathinfo(struct cli_state *cli, char *fname, + time_t *c_time, time_t *a_time, time_t *m_time, uint32 *size); +BOOL cli_qfileinfo(struct cli_state *cli, int fnum, + time_t *c_time, time_t *a_time, time_t *m_time, uint32 *size); BOOL cli_negprot(struct cli_state *cli); BOOL cli_session_request(struct cli_state *cli, char *host, int name_type, char *myname); diff --git a/source3/include/trans2.h b/source3/include/trans2.h index 9a2de63109..5218604e0e 100644 --- a/source3/include/trans2.h +++ b/source3/include/trans2.h @@ -238,13 +238,6 @@ Byte offset Type name description #define NT_FILE_ATTRIBUTE_NORMAL 0x80 -/* Function prototypes */ - - -int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize); - -int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize); - #endif -- cgit From ebe7c7a173efa32057908af43a5c3d74d8b3739a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 24 Nov 1997 13:44:52 +0000 Subject: added cli_rmdir and cli_mkdir added test in smbtorture for the server updating the directory modify time when a file is added to a directory cleanup in smbtorture so no garbage files are left on the server (This used to be commit 3a5e07f1e994396853e6340e8ef3f4d12bb0243e) --- source3/include/proto.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index a9ccda3b4a..1b8d5be141 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -66,6 +66,8 @@ BOOL cli_send_tconX(struct cli_state *cli, char *share, char *dev, char *pass, int passlen); BOOL cli_tdis(struct cli_state *cli); BOOL cli_unlink(struct cli_state *cli, char *fname); +BOOL cli_mkdir(struct cli_state *cli, char *dname); +BOOL cli_rmdir(struct cli_state *cli, char *dname); int cli_open(struct cli_state *cli, char *fname, int flags, int share_mode); BOOL cli_close(struct cli_state *cli, int fnum); BOOL cli_lock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout); @@ -77,6 +79,9 @@ BOOL cli_getatr(struct cli_state *cli, char *fname, BOOL cli_setatr(struct cli_state *cli, char *fname, int attr, time_t t); BOOL cli_qpathinfo(struct cli_state *cli, char *fname, time_t *c_time, time_t *a_time, time_t *m_time, uint32 *size); +BOOL cli_qpathinfo2(struct cli_state *cli, char *fname, + time_t *c_time, time_t *a_time, time_t *m_time, + time_t *w_time, uint32 *size); BOOL cli_qfileinfo(struct cli_state *cli, int fnum, time_t *c_time, time_t *a_time, time_t *m_time, uint32 *size); BOOL cli_negprot(struct cli_state *cli); -- cgit From f4e60aab71daaeb23d886097ef473e4b7744c66d Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Fri, 28 Nov 1997 03:46:03 +0000 Subject: preparing for release of 1.9.18alpha12 (This used to be commit 9cac33a13dc7c4890628436b80f6cbd8361deab2) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 29917b1087..f0f6131dc8 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.18alpha11" +#define VERSION "1.9.18alpha12" -- cgit From 7f2cd86196efd218b13b7d0d1f9a2b4fc0811760 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 28 Nov 1997 05:48:48 +0000 Subject: get_entries is an int not a bool (This used to be commit 84215c9b91f3c5130b172a3bbc83c7ddd66c5cb8) --- source3/include/smb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 6056ccd70f..49854a2512 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1601,7 +1601,7 @@ struct share_ops { BOOL (*stop_mgmt)(void); BOOL (*lock_entry)(int , uint32 , uint32 , int *); BOOL (*unlock_entry)(int , uint32 , uint32 , int ); - BOOL (*get_entries)(int , int , uint32 , uint32 , share_mode_entry **); + int (*get_entries)(int , int , uint32 , uint32 , share_mode_entry **); void (*del_entry)(int , int ); BOOL (*set_entry)(int , int , uint16 , uint16 ); BOOL (*remove_oplock)(int , int); -- cgit From 7c025b60ac6a5247ef88ee1d8c6064346c98b5a3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 28 Nov 1997 05:52:31 +0000 Subject: pass the mailslot name to process_logon_packet() - fixed process_logon_packet() to always send the reply to/from the correct netbios name (it should match the query) - only do a NT style QUERYFORPDC if the query came in on a NT_LOGON_MAILSLOT Luke, can you check to see if these changes work in your branch with NT logons? (This used to be commit e89611985b35155770648c8f16ddd19acfb5ee13) --- source3/include/proto.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 1b8d5be141..c47b7582f3 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -547,7 +547,8 @@ BOOL check_elections(void); /*The following definitions come from namelogon.c */ -void process_logon_packet(struct packet_struct *p,char *buf,int len); +void process_logon_packet(struct packet_struct *p,char *buf,int len, + char *mailslot); /*The following definitions come from namepacket.c */ -- cgit From cf9d07cc7d41627a59ea3bec5ba2b9eebb894ab5 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 29 Nov 1997 02:40:31 +0000 Subject: added a sent_oplock_break element to Files[] as a paranoia check so we can't sent a oplock break twice on the same file. changed some debug levels in the oplock code to level 0 so we can track down a bug zero the returned Files[] entry in find_free_file() don't try to overcome client bugs in the handling of non-encrypted passwords if in server level security mode added paranoid null termination of password buffers slight change to my ajt_panic() routine (This used to be commit e360c79c9cec681c4609783019749773d3e79386) --- source3/include/smb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 49854a2512..bd60c1077a 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1454,6 +1454,7 @@ typedef struct BOOL print_file; BOOL modified; BOOL granted_oplock; + BOOL sent_oplock_break; char *name; } files_struct; -- cgit From 15a6097263d4d5179b0eed43ede74fd65a83e090 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sun, 30 Nov 1997 02:58:34 +0000 Subject: clientgen.c: Added cli_mv() (used in a recent torture test). reply.c: Changed reply_open_and_X to split out the oplock request bits from core and extended and if an oplock was granted only set the corresponding bit on reply. server.c: Added code to dynamically allocate i/o buffers in oplock_break (prevents recursion problems) , also made reset of sent_oplock_break explicit. Jeremy. (This used to be commit 16e55ee2b8be9a4210d8cf87691cdf42373759d2) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index c47b7582f3..7302fb4998 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -65,6 +65,7 @@ BOOL cli_session_setup(struct cli_state *cli, BOOL cli_send_tconX(struct cli_state *cli, char *share, char *dev, char *pass, int passlen); BOOL cli_tdis(struct cli_state *cli); +BOOL cli_mv(struct cli_state *cli, char *fname_src, char *fname_dst); BOOL cli_unlink(struct cli_state *cli, char *fname); BOOL cli_mkdir(struct cli_state *cli, char *dname); BOOL cli_rmdir(struct cli_state *cli, char *dname); -- cgit From c65bcc26f7dbe608837eea200a99019aefa06a63 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 2 Dec 1997 23:26:42 +0000 Subject: get rid of some things out of smb.h that are already in local.h (This used to be commit d55df52487ca6786f1635276b2787857a772219a) --- source3/include/smb.h | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index bd60c1077a..e464809fa0 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -24,18 +24,6 @@ #ifndef _SMB_H #define _SMB_H -#ifndef MAX_CONNECTIONS -#define MAX_CONNECTIONS 127 -#endif - -#ifndef MAX_OPEN_FILES -#define MAX_OPEN_FILES 50 -#endif - -#ifndef GUEST_ACCOUNT -#define GUEST_ACCOUNT "nobody" -#endif - #define BUFFER_SIZE (0xFFFF) #define SAFETY_MARGIN 1024 -- cgit From 6a012a815317e2a3a31d2816943ae0750eb15cd5 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 2 Dec 1997 23:28:14 +0000 Subject: the default GUEST_ACCOUNT should be here not in smb.h (This used to be commit 13c2f432d61381a055378d303dfc8806ea4eea42) --- source3/include/local.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index ae791d84e6..2e7fa22354 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -75,6 +75,12 @@ manager window? */ #define FSTYPE_STRING "Samba" + +/* the default guest account - normally set in the Makefile or smb.conf */ +#ifndef GUEST_ACCOUNT +#define GUEST_ACCOUNT "nobody" +#endif + /* do you want smbd to send a 1 byte packet to nmbd to trigger it to start when smbd starts? */ #ifndef PRIME_NMBD -- cgit From cc12fc66d1f958c3c04d6f106b4e9128f6bce925 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 3 Dec 1997 03:21:25 +0000 Subject: I'm slowly getting though the todo list :-) This change allows people to select the SYSLOG_FACILITY in local.h, or add it to the Makefile if they want to. (This used to be commit afe88facbfb85113105bf516e066b6c1e971f6b7) --- source3/include/local.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index 2e7fa22354..9a31032ee6 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -25,6 +25,11 @@ */ #define PRINTCAP_NAME "/etc/printcap" +/* define what facility to use for syslog */ +#ifndef SYSLOG_FACILITY +#define SYSLOG_FACILITY LOG_DAEMON +#endif + /* set these to define the limits of the server. NOTE These are on a per-client basis. Thus any one machine can't connect to more than MAX_CONNECTIONS services, but any number of machines may connect at -- cgit From 11d7f4a2aa01d5bd010fd18934c2516f39a41e3c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 3 Dec 1997 03:37:02 +0000 Subject: make the "printing" option a per share option rather than global. When printing to lots of different sorts of remote printers this is useful (This used to be commit 7a88bed4a5ca8afe1f2836f7f9a019db01bf998e) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 7302fb4998..66704c37ef 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -288,7 +288,6 @@ int lp_shmem_size(void); int lp_deadtime(void); int lp_maxprotocol(void); int lp_security(void); -int lp_printing(void); int lp_maxdisksize(void); int lp_lpqcachetime(void); int lp_syslog(void); @@ -366,6 +365,7 @@ int lp_force_dir_mode(int ); int lp_max_connections(int ); int lp_defaultcase(int ); int lp_minprintspace(int ); +int lp_printing(int ); char lp_magicchar(int ); BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir); int lp_add_service(char *pszService, int iDefaultService); -- cgit From 69460b470f44c82b677a41d65ab4e172fc7b284b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 3 Dec 1997 03:43:05 +0000 Subject: allow users to disable the NetWkstaUserLogon call in server level security by changing a setting in local.h or adding it to their Makefile. See comment in local.h (This used to be commit cc10fdf7583ec644850445ad96afd8b22b71e86f) --- source3/include/local.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index 9a31032ee6..ca8d231dcd 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -25,6 +25,16 @@ */ #define PRINTCAP_NAME "/etc/printcap" +/* this affects server level security. With this set (recommended) + samba will do a full NetWkstaUserLogon to confirm that the client + really should have login rights. This can cause problems with + machines in trust relationships in which case you can disable it + here, but be warned, we have heard that some NT machines will then + allow anyone in with any password! Make sure you test it. */ +#ifndef USE_NETWKSTAUSERLOGON +#define USE_NETWKSTAUSERLOGON 1 +#endif + /* define what facility to use for syslog */ #ifndef SYSLOG_FACILITY #define SYSLOG_FACILITY LOG_DAEMON -- cgit From 0aa493cc0303aa4177f289b9e4c797c8fa180672 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 3 Dec 1997 03:50:05 +0000 Subject: loadparm.c: Added lp_we_are_a_wins_server as an alias for lp_wins_support. Used by the new nmbd and just makes more sense :-). Jeremy. (This used to be commit 7a2a45eae2e9a930d3243498d4e66cc2f5e4d370) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 66704c37ef..64d9d7a3fc 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -251,6 +251,7 @@ char *lp_domain_hostsallow(void); char *lp_domain_hostsdeny(void); BOOL lp_dns_proxy(void); BOOL lp_wins_support(void); +BOOL lp_we_are_a_wins_server(void); BOOL lp_wins_proxy(void); BOOL lp_local_master(void); BOOL lp_domain_controller(void); -- cgit From 7a668a7641cd747455b7a9854dbc208a3e4bc7ef Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 3 Dec 1997 05:08:07 +0000 Subject: applied a patch from Norm Jacobs to allow "printcap name = lpstat" to use lpstat to obtain the printer list on systemV systems. I've now made this the default on all SYSV systems. Jeremy, you were a little worried about the security of this patch. I believe it's OK as the user has no control over the options given to popen() and the pipe is only open for reading. (This used to be commit 6a83de0ae954bb18d3f15382f2b0b3259fedff09) --- source3/include/local.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index ca8d231dcd..c4bdcc80d5 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -23,7 +23,16 @@ printcap file is a quick-n-dirty way to allow dynamic access to a subset of available printers. */ + +#ifndef PRINTCAP_NAME +#ifdef AIX +#define PRINTCAP_NAME "/etc/qconfig" +#elif defined(SYSV) +#define PRINTCAP_NAME "lpstat" +#else #define PRINTCAP_NAME "/etc/printcap" +#endif +#endif /* this affects server level security. With this set (recommended) samba will do a full NetWkstaUserLogon to confirm that the client -- cgit From e94d5632392bb98d026ef2076702ef7b0870aea5 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 3 Dec 1997 05:22:24 +0000 Subject: put the default PRINTCAP_NAME def in includes.h not local.h so that it can see the SYSV definitions (This used to be commit e439115366804982af6faba75714dbe2626edead) --- source3/include/includes.h | 17 +++++++++++++++++ source3/include/local.h | 17 ----------------- 2 files changed, 17 insertions(+), 17 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index cada77e732..5bfe024145 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -1073,6 +1073,23 @@ struct spwd { /* fake shadow password structure */ #endif #endif +/* This defines the name of the printcap file. It is MOST UNLIKELY that + this will change BUT! Specifying a file with the format of a printcap + file but containing only a subset of the printers actually in your real + printcap file is a quick-n-dirty way to allow dynamic access to a subset + of available printers. +*/ +#ifndef PRINTCAP_NAME +#ifdef AIX +#define PRINTCAP_NAME "/etc/qconfig" +#elif defined(SYSV) +#define PRINTCAP_NAME "lpstat" +#else +#define PRINTCAP_NAME "/etc/printcap" +#endif +#endif + + #ifdef USE_SYSV_IPC #include #include diff --git a/source3/include/local.h b/source3/include/local.h index c4bdcc80d5..10906d1ff1 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -17,23 +17,6 @@ refer to the special "printers" service */ #define PRINTERS_NAME "printers" -/* This defines the name of the printcap file. It is MOST UNLIKELY that - this will change BUT! Specifying a file with the format of a printcap - file but containing only a subset of the printers actually in your real - printcap file is a quick-n-dirty way to allow dynamic access to a subset - of available printers. -*/ - -#ifndef PRINTCAP_NAME -#ifdef AIX -#define PRINTCAP_NAME "/etc/qconfig" -#elif defined(SYSV) -#define PRINTCAP_NAME "lpstat" -#else -#define PRINTCAP_NAME "/etc/printcap" -#endif -#endif - /* this affects server level security. With this set (recommended) samba will do a full NetWkstaUserLogon to confirm that the client really should have login rights. This can cause problems with -- cgit From 28f37efd349a3199954060700b3239aed4f3c9e2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 4 Dec 1997 07:41:48 +0000 Subject: don't use free and alloc as structure elements (This used to be commit f7066355b00a169423b4f64f58567e19b52abc1b) --- source3/include/smb.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index e464809fa0..401459becc 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1601,9 +1601,9 @@ struct share_ops { /* each implementation of the shared memory code needs to support the following operations */ struct shmem_ops { - BOOL (*close)( void ); - int (*alloc)(int ); - BOOL (*free)(int ); + BOOL (*shm_close)( void ); + int (*shm_alloc)(int ); + BOOL (*shm_free)(int ); int (*get_userdef_off)(void); void *(*offset2addr)(int ); int (*addr2offset)(void *addr); -- cgit From 500069329a878cdf2173e24cf2419991ee6ce323 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 4 Dec 1997 07:48:06 +0000 Subject: added optonal MEM_MAN code (This used to be commit b524c8da5141e3e030e14b3a0167fa5c7ae91396) --- source3/include/includes.h | 47 ++-------------------------------------------- source3/include/proto.h | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 45 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 5bfe024145..6c2b676b31 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -1285,51 +1285,8 @@ extern int errno; #define strcpy(dest,src) StrCpy(dest,src) #endif - -/* possibly wrap the malloc calls */ -#if WRAP_MALLOC - -/* undo the old malloc def if necessary */ -#ifdef malloc -#define xx_old_malloc malloc -#undef malloc -#endif - -#define malloc(size) malloc_wrapped(size,__FILE__,__LINE__) - -/* undo the old realloc def if necessary */ -#ifdef realloc -#define xx_old_realloc realloc -#undef realloc -#endif - -#define realloc(ptr,size) realloc_wrapped(ptr,size,__FILE__,__LINE__) - -/* undo the old free def if necessary */ -#ifdef free -#define xx_old_free free -#undef free -#endif - -#define free(ptr) free_wrapped(ptr,__FILE__,__LINE__) - -/* and the malloc prototypes */ -void *malloc_wrapped(int,char *,int); -void *realloc_wrapped(void *,int,char *,int); -void free_wrapped(void *,char *,int); - -#endif - - -#if WRAP_MEMCPY -/* undo the old memcpy def if necessary */ -#ifdef memcpy -#define xx_old_memcpy memcpy -#undef memcpy -#endif - -#define memcpy(d,s,l) memcpy_wrapped(d,s,l,__FILE__,__LINE__) -void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line); +#if MEM_MAN +#include "mem_man/mem_man.h" #endif #endif diff --git a/source3/include/proto.h b/source3/include/proto.h index 64d9d7a3fc..ca37799bd7 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -429,6 +429,21 @@ BOOL name_map_mangle(char *OutName,BOOL need83,int snum); void mdfour(unsigned char *out, unsigned char *in, int n); +/*The following definitions come from mem_man/mem_man.c */ + +void *mem_malloc(size_t size,char *file,int line); +char *mem_strdup(char *s, char *file, int line); +int mem_free(void *ptr,char *file,int line); +void mem_write_info(void *ptr,FILE *outfile); +char *mem_query_file(void *ptr); +int mem_query_line(void *ptr); +int mem_test(void *ptr); +void mem_write_status(FILE *outfile); +void mem_write_verbose(FILE *outfile); +void mem_write_errors(FILE *outfile); +void mem_set_multiplier(int multiplier); +void *mem_resize(void *ptr,size_t newsize); + /*The following definitions come from message.c */ int reply_sends(char *inbuf,char *outbuf); @@ -711,6 +726,11 @@ int read_predict(int fd,int offset,char *buf,char **ptr,int num); void do_read_prediction(); void invalidate_read_prediction(int fd); +/*The following definitions come from print_svid.c */ + +void sysv_printer_fn(void (*fn)()); +int sysv_printername_ok(char *name); + /*The following definitions come from printing.c */ void lpq_reset(int snum); -- cgit From 419e8823e9f67d7b738a676e18595ffb26346b1a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 11 Dec 1997 11:07:09 +0000 Subject: kanji.c: Patch from Anders Blomdell for problem with kanji sj_strXXX functions. Jeremy. (This used to be commit bf48151e6ddfa72303be7eac9e156046d4fb5b5e) --- source3/include/proto.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index ca37799bd7..e6a0b1efd7 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -756,9 +756,6 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); char *Strstr(char *s, char *p); time_t Mktime(struct tm *t); int InNetGr(char *group,char *host,char *user,char *dom); -void *malloc_wrapped(int size,char *file,int line); -void *realloc_wrapped(void *ptr,int size,char *file,int line); -void free_wrapped(void *ptr,char *file,int line); void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line); /*The following definitions come from reply.c */ -- cgit From 64f0348a3f994334abe64a4d4896109c3c8c9039 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 13 Dec 1997 14:16:07 +0000 Subject: This is it ! The mega-merge of the JRA_NMBD_REWRITE branch back into the main tree. For the cvs logs of all the files starting nmbd_*.c, look in the JRA_NMBD_REWRITE branch. That branch has now been discontinued. Jeremy. (This used to be commit d80b0cb645f81d16734929a0b27a91c6650499bb) --- source3/include/nameserv.h | 482 ++++++++++++++++++++++++++++----------------- source3/include/proto.h | 478 +++++++++++++++++++++++++++----------------- 2 files changed, 599 insertions(+), 361 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 2a7bb29070..4b7216fef6 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -1,3 +1,5 @@ +#ifndef _NAMESERV_H_ +#define _NAMESERV_H_ /* Unix SMB/Netbios implementation. Version 1.9. @@ -20,7 +22,7 @@ */ -#define GET_TTL(ttl) ((ttl)?MIN(ttl,lp_max_ttl()):lp_max_ttl()) +#define PERMANENT_TTL 0 /* NTAS uses 2, NT uses 1, WfWg uses 0 */ #define MAINTAIN_LIST 2 @@ -29,17 +31,44 @@ #define MAX_DGRAM_SIZE (576) /* tcp/ip datagram limit is 576 bytes */ #define MIN_DGRAM_SIZE 12 -#define NMB_QUERY 0x20 -#define NMB_STATUS 0x21 +/********************************************************* + Types of reply packet. +**********************************************************/ + +enum netbios_reply_type_code { NMB_QUERY, NMB_STATUS, NMB_REG, NMB_REG_REFRESH, + NMB_REL, NMB_WAIT_ACK, NMB_MULTIHOMED_REG, + WINS_REG, WINS_QUERY }; + +/* From rfc1002, 4.2.1.2 */ +/* Question types. */ +#define QUESTION_TYPE_NB_QUERY 0x20 +#define QUESTION_TYPE_NB_STATUS 0x21 + +/* Question class */ +#define QUESTION_CLASS_IN 0x1 + +/* Opcode definitions */ +#define NMB_NAME_QUERY_OPCODE 0x0 +#define NMB_NAME_REG_OPCODE 0x05 /* see rfc1002.txt 4.2.2,3,5,6,7,8 */ +#define NMB_NAME_RELEASE_OPCODE 0x06 /* see rfc1002.txt 4.2.9,10,11 */ +#define NMB_WACK_OPCODE 0x07 /* see rfc1002.txt 4.2.16 */ +/* Ambiguity in rfc1002 about which of these is correct. */ +/* WinNT uses 8 by default but can be made to use 9. */ +#define NMB_NAME_REFRESH_OPCODE_8 0x08 /* see rfc1002.txt 4.2.4 */ +#define NMB_NAME_REFRESH_OPCODE_9 0x09 /* see rfc1002.txt 4.2.4 */ +#define NMB_NAME_MULTIHOMED_REG_OPCODE 0x0F /* Invented by Microsoft. */ -#define NMB_REG 0x05 /* see rfc1002.txt 4.2.2,3,5,6,7,8 */ -#define NMB_REG_REFRESH 0x09 /* see rfc1002.txt 4.2.4 */ -#define NMB_REL 0x06 /* see rfc1002.txt 4.2.9,10,11 */ -#define NMB_WAIT_ACK 0x07 /* see rfc1002.txt 4.2.16 */ /* XXXX what about all the other types?? 0x1, 0x2, 0x3, 0x4, 0x8? */ -#define FIND_ANY_NAME 0 -#define FIND_SELF_NAME 1 +/* Resource record types. rfc1002 4.2.1.3 */ +#define RR_TYPE_A 0x1 +#define RR_TYPE_NS 0x2 +#define RR_TYPE_NULL 0xA +#define RR_TYPE_NB 0x20 +#define RR_TYPE_NBSTAT 0x21 + +/* Resource record class. */ +#define RR_CLASS_IN 0x1 /* NetBIOS flags */ #define NB_GROUP 0x80 @@ -47,206 +76,299 @@ #define NB_ACTIVE 0x04 #define NB_CONFL 0x08 #define NB_DEREG 0x10 -#define NB_BFLAG 0x00 /* broadcast node type */ -#define NB_PFLAG 0x20 /* point-to-point node type */ -#define NB_MFLAG 0x40 /* mixed bcast & p-p node type */ -#define NB_HFLAG 0x60 /* microsoft 'hybrid' node type */ -#define NB_FLGMSK 0x60 +#define NB_BFLAG 0x00 /* Broadcast node type. */ +#define NB_PFLAG 0x20 /* Point-to-point node type. */ +#define NB_MFLAG 0x40 /* Mixed bcast & p-p node type. */ +#define NB_HFLAG 0x60 /* Microsoft 'hybrid' node type. */ +#define NB_NODETYPEMASK 0x60 +/* Mask applied to outgoing NetBIOS flags. */ +#define NB_FLGMSK 0xE0 + +/* NetBIOS flag identifier. */ +#define NAME_GROUP(p) ((p)->nb_flags & NB_GROUP) +#define NAME_BFLAG(p) (((p)->nb_flags & NB_NODETYPEMASK) == NB_BFLAG) +#define NAME_PFLAG(p) (((p)->nb_flags & NB_NODETYPEMASK) == NB_PFLAG) +#define NAME_MFLAG(p) (((p)->nb_flags & NB_NODETYPEMASK) == NB_MFLAG) +#define NAME_HFLAG(p) (((p)->nb_flags & NB_NODETYPEMASK) == NB_HFLAG) + +/* Samba name state for a name in a namelist. */ +#define NAME_IS_ACTIVE(p) ((p)->nb_flags & NB_ACTIVE) +#define NAME_IN_CONFLICT(p) ((p)->nb_flags & NB_CONFL) +#define NAME_IS_DEREGISTERING(p) ((p)->nb_flags & NB_DEREG) + +/* Error codes for NetBIOS requests. */ +#define FMT_ERR 0x1 /* Packet format error. */ +#define SRV_ERR 0x2 /* Internal server error. */ +#define NAM_ERR 0x3 /* Name does not exist. */ +#define IMP_ERR 0x4 /* Request not implemented. */ +#define RFS_ERR 0x5 /* Request refused. */ +#define ACT_ERR 0x6 /* Active error - name owned by another host. */ +#define CFT_ERR 0x7 /* Name in conflict error. */ #define REFRESH_TIME (15*60) #define NAME_POLL_REFRESH_TIME (5*60) #define NAME_POLL_INTERVAL 15 -/* NetBIOS flag identifier */ -#define NAME_PERMANENT(p) ((p) & NB_PERM) -#define NAME_ACTIVE(p) ((p) & NB_ACTIVE) -#define NAME_CONFLICT(p) ((p) & NB_CONFL) -#define NAME_DEREG(p) ((p) & NB_DEREG) -#define NAME_GROUP(p) ((p) & NB_GROUP) - -#define NAME_BFLAG(p) (((p) & NB_FLGMSK) == NB_BFLAG) -#define NAME_PFLAG(p) (((p) & NB_FLGMSK) == NB_PFLAG) -#define NAME_MFLAG(p) (((p) & NB_FLGMSK) == NB_MFLAG) -#define NAME_HFLAG(p) (((p) & NB_FLGMSK) == NB_HFLAG) - -/* server type identifiers */ -#define AM_MASTER(work) (work->ServerType & SV_TYPE_MASTER_BROWSER) -#define AM_BACKUP(work) (work->ServerType & SV_TYPE_BACKUP_BROWSER) -#define AM_DOMMST(work) (work->ServerType & SV_TYPE_DOMAIN_MASTER) -#define AM_DOMMEM(work) (work->ServerType & SV_TYPE_DOMAIN_MEMBER) - -/* microsoft browser NetBIOS name */ +/* Workgroup state identifiers. */ +#define AM_POTENTIAL_MASTER_BROWSER(work) ((work)->mst_state == MST_POTENTIAL) +#define AM_LOCAL_MASTER_BROWSER(work) ((work)->mst_state == MST_BROWSER) +#define AM_DOMAIN_MASTER_BROWSER(work) ((work)->dom_state == DOMAIN_MST) +#define AM_DOMAIN_MEMBER(work) ((work)->log_state == LOGON_SRV) + +/* Microsoft browser NetBIOS name. */ #define MSBROWSE "\001\002__MSBROWSE__\002" -/* mail slots */ +/* Mail slots. */ #define BROWSE_MAILSLOT "\\MAILSLOT\\BROWSE" #define NET_LOGON_MAILSLOT "\\MAILSLOT\\NET\\NETLOGON" #define NT_LOGON_MAILSLOT "\\MAILSLOT\\NET\\NTLOGON" -enum name_source {STATUS_QUERY, LMHOSTS, REGISTER, SELF, DNS, DNSFAIL}; +/* Samba definitions for find_name_on_subnet(). */ +#define FIND_ANY_NAME 0 +#define FIND_SELF_NAME 1 + +/* + * The different name types that can be in namelists. + * + * SELF_NAME should only be on the broadcast and unicast subnets. + * LMHOSTS_NAME should only be in the remote_broadcast_subnet. + * REGISTER_NAME, DNS_NAME, DNSFAIL_NAME should only be in the wins_server_subnet. + * WINS_PROXY_NAME should only be on the broadcast subnets. + * PERMANENT_NAME can be on all subnets except remote_broadcast_subnet. + * + */ + +enum name_source {LMHOSTS_NAME, REGISTER_NAME, SELF_NAME, DNS_NAME, + DNSFAIL_NAME, PERMANENT_NAME, WINS_PROXY_NAME}; enum node_type {B_NODE=0, P_NODE=1, M_NODE=2, NBDD_NODE=3}; enum packet_type {NMB_PACKET, DGRAM_PACKET}; enum master_state { - MST_POTENTIAL, - MST_BACK, - MST_MSB, - MST_BROWSER + MST_NONE, + MST_POTENTIAL, + MST_BACKUP, + MST_MSB, + MST_BROWSER, + MST_UNBECOMING_MASTER }; enum domain_state { - DOMAIN_NONE, - DOMAIN_WAIT, - DOMAIN_MST + DOMAIN_NONE, + DOMAIN_WAIT, + DOMAIN_MST }; enum logon_state { - LOGON_NONE, - LOGON_WAIT, - LOGON_SRV -}; - -enum state_type -{ - NAME_STATUS_DOM_SRV_CHK, - NAME_STATUS_SRV_CHK, - NAME_REGISTER_CHALLENGE, - NAME_REGISTER, - NAME_RELEASE, - NAME_QUERY_CONFIRM, - NAME_QUERY_SYNC_LOCAL, - NAME_QUERY_SYNC_REMOTE, - NAME_QUERY_DOM_SRV_CHK, - NAME_QUERY_SRV_CHK, - NAME_QUERY_FIND_MST, - NAME_QUERY_MST_CHK, - NAME_QUERY_DOMAIN + LOGON_NONE, + LOGON_WAIT, + LOGON_SRV }; -/* a netbios name structure */ +/* A netbios name structure. */ struct nmb_name { char name[17]; char scope[64]; - int name_type; + unsigned int name_type; }; -/* a netbios flags + ip address structure */ -/* this is used for multi-homed systems and for internet group names */ -struct nmb_ip -{ - struct in_addr ip; /* ip address of host that owns this name */ - uint16 nb_flags; /* netbios flags */ -}; - -/* this is the structure used for the local netbios name list */ +/* This is the structure used for the local netbios name list. */ struct name_record { struct name_record *next; struct name_record *prev; - struct nmb_name name; /* the netbios name */ - struct nmb_ip *ip_flgs; /* the ip + flags */ - int num_ips; /* number of ip+flags entries */ + struct subnet_record *subnet; - enum name_source source; /* where the name came from */ + struct nmb_name name; /* The netbios name. */ + uint16 nb_flags; /* Netbios flags. */ + int num_ips; /* Number of ip entries. */ + struct in_addr *ip; /* The ip list for this name. */ - time_t death_time; /* time record must be removed (do not remove if 0) */ - time_t refresh_time; /* time record should be refreshed */ + enum name_source source; /* Where the name came from. */ + + time_t death_time; /* The time the record must be removed (do not remove if 0). */ + time_t refresh_time; /* The time the record should be refreshed. */ }; struct subnet_record; -/* browse and backup server cache for synchronising browse list */ +/* Browser cache for synchronising browse lists. */ struct browse_cache_record { - struct browse_cache_record *next; - struct browse_cache_record *prev; - - pstring name; - int type; - pstring group; - struct in_addr ip; - time_t sync_time; - BOOL synced; - BOOL local; - struct subnet_record *subnet; + struct browse_cache_record *next; + struct browse_cache_record *prev; + + pstring lmb_name; + pstring work_group; + struct in_addr ip; + time_t sync_time; + time_t death_time; /* The time the record must be removed. */ }; -/* this is used to hold the list of servers in my domain, and is */ -/* contained within lists of domains */ +/* This is used to hold the list of servers in my domain, and is + contained within lists of domains. */ + struct server_record { struct server_record *next; struct server_record *prev; + struct subnet_record *subnet; + struct server_info_struct serv; time_t death_time; }; -/* a workgroup structure. it contains a list of servers */ +/* A workgroup structure. It contains a list of servers. */ struct work_record { struct work_record *next; struct work_record *prev; + struct subnet_record *subnet; + struct server_record *serverlist; - /* stage of development from non-local-master up to local-master browser */ + /* Stage of development from non-local-master up to local-master browser. */ enum master_state mst_state; - /* stage of development from non-domain-master to domain master browser */ + /* Stage of development from non-domain-master to domain-master browser. */ enum domain_state dom_state; - /* stage of development from non-logon-server to logon server */ + /* Stage of development from non-logon-server to logon server. */ enum logon_state log_state; - /* work group info */ + /* Work group info. */ fstring work_group; - int token; /* used when communicating with backup browsers */ - int ServerType; + int token; /* Used when communicating with backup browsers. */ + fstring local_master_browser_name; /* Current local master browser. */ - /* announce info */ + /* Announce info. */ time_t lastannounce_time; int announce_interval; BOOL needannounce; + /* Timeout time for this workgroup. 0 means permanent. */ + time_t death_time; - /* election info */ + /* Election info */ BOOL RunningElection; BOOL needelection; int ElectionCount; uint32 ElectionCriterion; + + /* Domain master browser info. Used for efficient syncs. */ + struct nmb_name dmb_name; + struct in_addr dmb_addr; }; -/* initiated name queries recorded in this list to track any responses... */ -/* sadly, we need to group everything together. i suppose that if this - gets unwieldy, then a union ought to be considered. oh for c++... */ +/* typedefs needed to define copy & free functions for userdata. */ +struct userdata_struct; + +typedef struct userdata_struct * (*userdata_copy_fn)(struct userdata_struct *); +typedef void (*userdata_free_fn)(struct userdata_struct *); + +/* Structure to define any userdata passed around. */ + +struct userdata_struct { + userdata_copy_fn copy_fn; + userdata_free_fn free_fn; + unsigned int userdata_len; + char data[1]; +}; + +struct response_record; +struct packet_struct; +struct res_rec; + +/* typedef to define the function called when this response packet comes in. */ +typedef void (*response_function)(struct subnet_record *, struct response_record *, + struct packet_struct *); + +/* typedef to define the function called when this response record times out. */ +typedef void (*timeout_response_function)(struct subnet_record *, + struct response_record *); + +/* typedef to define the function called when the request that caused this + response record to be created is successful. */ +typedef void (*success_function)(struct subnet_record *, struct userdata_struct *, ...); + +/* typedef to define the function called when the request that caused this + response record to be created is unsuccessful. */ +typedef void (*fail_function)(struct subnet_record *, struct response_record *, ...); + +/* List of typedefs for success and fail functions of the different query + types. Used to catch any compile time prototype errors. */ + +typedef void (*register_name_success_function)( struct subnet_record *, + struct userdata_struct *, + struct nmb_name *, + uint16, + int, + struct in_addr); +typedef void (*register_name_fail_function)( struct subnet_record *, + struct response_record *, + struct nmb_name *); + +typedef void (*release_name_success_function)( struct subnet_record *, + struct userdata_struct *, + struct nmb_name *, + struct in_addr); +typedef void (*release_name_fail_function)( struct subnet_record *, + struct response_record *, + struct nmb_name *); + +typedef void (*refresh_name_success_function)( struct subnet_record *, + struct userdata_struct *, + struct nmb_name *, + uint16, + int, + struct in_addr); +typedef void (*refresh_name_fail_function)( struct subnet_record *, + struct response_record *, + struct nmb_name *); + +typedef void (*query_name_success_function)( struct subnet_record *, + struct userdata_struct *, + struct nmb_name *, + struct in_addr, + struct res_rec *answers); + +typedef void (*query_name_fail_function)( struct subnet_record *, + struct response_record *, + struct nmb_name *, + int); + +typedef void (*node_status_success_function)( struct subnet_record *, + struct userdata_struct *, + struct res_rec *, + struct in_addr); +typedef void (*node_status_fail_function)( struct subnet_record *, + struct response_record *); + +/* Initiated name queries are recorded in this list to track any responses. */ + struct response_record { struct response_record *next; struct response_record *prev; uint16 response_id; - enum state_type state; - int fd; - int quest_type; - struct nmb_name name; - int nb_flags; - time_t ttl; + /* Callbacks for packets received or not. */ + response_function resp_fn; + timeout_response_function timeout_fn; - int server_type; - fstring my_name; - fstring my_comment; + /* Callbacks for the request succeeding or not. */ + success_function success_fn; + fail_function fail_fn; + + struct packet_struct *packet; - BOOL bcast; - BOOL recurse; - struct in_addr send_ip; - struct in_addr reply_to_ip; - int reply_id; + struct userdata_struct *userdata; int num_msgs; @@ -255,37 +377,35 @@ struct response_record int repeat_count; }; -/* a subnet structure. it contains a list of workgroups and netbios names*/ - -/* note that a subnet of 255.255.255.255 contains all the WINS netbios names. - all communication from such nodes are on a non-broadcast basis: they - are point-to-point (P nodes) or mixed point-to-point and broadcast - (M nodes). M nodes use point-to-point as a preference, and will use - broadcasting for certain activities, or will resort to broadcasting as a - last resort, if the WINS server fails (users of wfwg will notice that their - machine often freezes for 30 seconds at a time intermittently, if the WINS - server is down). +/* A subnet structure. It contains a list of workgroups and netbios names. */ +/* B nodes will have their own, totally separate subnet record, with their - own netbios name set. these do NOT interact with other subnet records' - netbios names, INCLUDING the WINS one (with an ip "address", so called, - of 255.255.255.255) - - there is a separate response list for each subnet record. in the case of - the 255.255.255.255 subnet record (WINS), the WINS server will be able to - use this to poll (infrequently!) each of its entries, to ensure that the - names are still in use. - XXXX this polling is a planned feature for a really over-cautious WINS server + own netbios name set. These do NOT interact with other subnet records' + netbios names. */ +enum subnet_type { + NORMAL_SUBNET = 0, /* Subnet listed in interfaces list. */ + UNICAST_SUBNET = 1, /* Subnet for unicast packets. */ + REMOTE_BROADCAST_SUBNET = 2, /* Subnet for remote broadcasts. */ + WINS_SERVER_SUBNET = 3 /* Only created if we are a WINS server. */ +}; + struct subnet_record { struct subnet_record *next; struct subnet_record *prev; - struct work_record *workgrouplist; /* list of workgroups */ - struct name_record *namelist; /* list of netbios names */ - struct response_record *responselist; /* list of responses expected */ + char *subnet_name; /* For Debug identification. */ + enum subnet_type type; /* To catagorize the subnet. */ + + struct work_record *workgrouplist; /* List of workgroups. */ + struct name_record *namelist; /* List of netbios names. */ + struct response_record *responselist; /* List of responses expected. */ + + BOOL namelist_changed; + BOOL work_changed; struct in_addr bcast_ip; struct in_addr mask_ip; @@ -294,7 +414,7 @@ struct subnet_record int dgram_sock; /* socket to listen for unicast 138. */ }; -/* a resource record */ +/* A resource record. */ struct res_rec { struct nmb_name rr_name; int rr_type; @@ -304,7 +424,7 @@ struct res_rec { char rdata[MAX_DGRAM_SIZE]; }; -/* define a nmb packet. */ +/* An nmb packet. */ struct nmb_packet { struct { @@ -337,7 +457,8 @@ struct nmb_packet }; -/* a datagram - this normally contains SMB data in the data[] array */ +/* A datagram - this normally contains SMB data in the data[] array. */ + struct dgram_packet { struct { int msg_type; @@ -358,32 +479,35 @@ struct dgram_packet { char data[MAX_DGRAM_SIZE]; }; -/* define a structure used to queue packets. this will be a linked - list of nmb packets */ +/* Define a structure used to queue packets. This will be a linked + list of nmb packets. */ + struct packet_struct { - struct packet_struct *next; - struct packet_struct *prev; - BOOL locked; - struct in_addr ip; - int port; - int fd; - time_t timestamp; - enum packet_type packet_type; - union { - struct nmb_packet nmb; - struct dgram_packet dgram; - } packet; + struct packet_struct *next; + struct packet_struct *prev; + BOOL locked; + struct in_addr ip; + int port; + int fd; + time_t timestamp; + enum packet_type packet_type; + union { + struct nmb_packet nmb; + struct dgram_packet dgram; + } packet; }; /* NETLOGON opcodes */ -#define QUERYFORPDC 7 /* Query for PDC */ -#define QUERYFORPDC_R 12 /* Response to Query for PDC */ + +#define QUERYFORPDC 7 /* Query for PDC. */ +#define QUERYFORPDC_R 12 /* Response to Query for PDC. */ #define SAMLOGON 18 #define SAMLOGON_R 19 -/* ids for netbios packet types */ +/* Ids for netbios packet types. */ + #define ANN_HostAnnouncement 1 #define ANN_AnnouncementRequest 2 #define ANN_Election 8 @@ -396,42 +520,48 @@ struct packet_struct #define ANN_LocalMasterAnnouncement 15 -/* broadcast packet announcement intervals, in minutes */ +/* Broadcast packet announcement intervals, in minutes. */ -/* attempt to add domain logon and domain master names */ +/* Attempt to add domain logon and domain master names. */ #define CHECK_TIME_ADD_DOM_NAMES 5 -/* search for master browsers of workgroups samba knows about, - except default */ +/* Search for master browsers of workgroups samba knows about, + except default. */ #define CHECK_TIME_MST_BROWSE 5 -/* request backup browser announcements from other servers */ +/* Request backup browser announcements from other servers. */ #define CHECK_TIME_ANNOUNCE_BACKUP 15 -/* request host announcements from other servers: min and max of interval */ +/* Request host announcements from other servers: min and max of interval. */ #define CHECK_TIME_MIN_HOST_ANNCE 3 #define CHECK_TIME_MAX_HOST_ANNCE 12 -/* announce as master to WINS server and any Primary Domain Controllers */ +/* Announce as master to WINS server and any Primary Domain Controllers. */ #define CHECK_TIME_MST_ANNOUNCE 15 -/* do all remote announcements this often */ +/* Time between syncs from domain master browser to local master browsers. */ +#define CHECK_TIME_DMB_TO_LMB_SYNC 15 + +/* Do all remote announcements this often. */ #define REMOTE_ANNOUNCE_INTERVAL 180 -/* Types of machine we can announce as */ +/* Types of machine we can announce as. */ #define ANNOUNCE_AS_NT 1 #define ANNOUNCE_AS_WIN95 2 #define ANNOUNCE_AS_WFW 3 /* Macro's to enumerate subnets either with or without - the WINS subnet. */ + the UNICAST subnet. */ extern struct subnet_record *subnetlist; -extern struct subnet_record *wins_client_subnet; +extern struct subnet_record *unicast_subnet; +extern struct subnet_record *wins_server_subnet; +extern struct subnet_record *remote_broadcast_subnet; #define FIRST_SUBNET subnetlist -#define NEXT_SUBNET_EXCLUDING_WINS(x) ((x)->next) -#define NEXT_SUBNET_INCLUDING_WINS(x) ( ((x) == wins_client_subnet) ? NULL : \ - (((x)->next == NULL) ? wins_client_subnet : \ - (x)->next)) +#define NEXT_SUBNET_EXCLUDING_UNICAST(x) ((x)->next) +#define NEXT_SUBNET_INCLUDING_UNICAST(x) (get_next_subnet_maybe_unicast((x))) +/* To be removed. */ +enum state_type { TEST }; +#endif /* _NAMESERV_H_ */ diff --git a/source3/include/proto.h b/source3/include/proto.h index e6a0b1efd7..b249c9cb20 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -189,6 +189,8 @@ BOOL ismyip(struct in_addr ip); BOOL ismybcast(struct in_addr bcast); BOOL is_local_net(struct in_addr from); int iface_count(void); +BOOL we_are_multihomed(); +struct interface *get_interface(int n); struct in_addr *iface_n_ip(int n); struct in_addr *iface_bcast(struct in_addr ip); struct in_addr *iface_nmask(struct in_addr ip); @@ -276,6 +278,8 @@ BOOL lp_time_server(void); BOOL lp_bind_interfaces_only(void); int lp_os_level(void); int lp_max_ttl(void); +int lp_max_wins_ttl(void); +int lp_min_wins_ttl(void); int lp_max_log_size(void); int lp_mangledstack(void); int lp_maxxmit(void); @@ -451,225 +455,329 @@ int reply_sendstrt(char *inbuf,char *outbuf); int reply_sendtxt(char *inbuf,char *outbuf); int reply_sendend(char *inbuf,char *outbuf); -/*The following definitions come from nameannounce.c */ +/*The following definitions come from namequery.c */ -void announce_request(struct work_record *work, struct in_addr ip); -void do_announce_request(char *info, char *to_name, int announce_type, - int from, - int to, struct in_addr dest_ip); -void sync_server(enum state_type state, char *serv_name, char *work_name, - int name_type, - struct subnet_record *d, - struct in_addr ip); -void announce_my_servers_removed(void); -void announce_server(struct subnet_record *d, struct work_record *work, - char *name, char *comment, time_t ttl, int server_type); -void announce_host(time_t t); -void reset_announce_timer(); -void announce_master(time_t t); -void announce_remote(time_t t); -void browse_sync_remote(time_t t); +BOOL name_status(int fd,char *name,int name_type,BOOL recurse, + struct in_addr to_ip,char *master,char *rname, + void (*fn)()); +struct in_addr *name_query(int fd,char *name,int name_type, + BOOL bcast,BOOL recurse, + struct in_addr to_ip, int *count, void (*fn)()); -/*The following definitions come from namebrowse.c */ +/*The following definitions come from nmbd.c */ -void expire_browse_cache(time_t t); -struct browse_cache_record *add_browser_entry(char *name, int type, char *wg, - time_t ttl, struct subnet_record *d, - struct in_addr ip, BOOL local); -void do_browser_lists(time_t t); +BOOL reload_services(BOOL test); +int main(int argc,char *argv[]); -/*The following definitions come from namedbname.c */ +/*The following definitions come from nmbd_become_dmb.c */ -void set_samba_nb_type(void); -BOOL name_equal(struct nmb_name *n1,struct nmb_name *n2); -BOOL ms_browser_name(char *name, int type); -void remove_name(struct subnet_record *d, struct name_record *n); -struct name_record *find_name_on_subnet(struct subnet_record *d, - struct nmb_name *name, BOOL self_only); -void dump_names(void); -void load_netbios_names(void); -void remove_netbios_name(struct subnet_record *d, - char *name,int type, enum name_source source); -struct name_record *add_netbios_entry(struct subnet_record *d, - char *name, int type, int nb_flags, int ttl, - enum name_source source, struct in_addr ip, BOOL new_only); -void expire_names(time_t t); +void unbecome_domain_master(char *workgroup_name); +void add_domain_names(time_t t); -/*The following definitions come from namedbresp.c */ - -void add_response_record(struct subnet_record *d, - struct response_record *n); -void remove_response_record(struct subnet_record *d, - struct response_record *n); -struct response_record *make_response_queue_record(enum state_type state, - int id,uint16 fd, - int quest_type, char *name,int type, int nb_flags, time_t ttl, - int server_type, char *my_name, char *my_comment, - BOOL bcast,BOOL recurse, - struct in_addr send_ip, struct in_addr reply_to_ip, - int reply_id); -struct response_record *find_response_record(struct subnet_record **d, - uint16 id); +/*The following definitions come from nmbd_become_lmb.c */ -/*The following definitions come from namedbserver.c */ - -void remove_old_servers(struct work_record *work, time_t t, - BOOL remove_all); -struct server_record *find_server(struct work_record *work, char *name); -struct server_record *add_server_entry(struct subnet_record *d, - struct work_record *work, - char *name,int servertype, - int ttl,char *comment, - BOOL replace); -void expire_servers(time_t t); - -/*The following definitions come from namedbsubnet.c */ - -struct subnet_record *find_subnet(struct in_addr ip); -struct subnet_record *find_subnet_all(struct in_addr ip); -void add_workgroup_to_subnet( struct subnet_record *d, char *group); -void add_my_subnets(char *group); -void write_browse_list(time_t t); - -/*The following definitions come from namedbwork.c */ - -struct work_record *remove_workgroup(struct subnet_record *d, - struct work_record *work, - BOOL remove_all_servers); -struct work_record *find_workgroupstruct(struct subnet_record *d, - fstring name, BOOL add); -void dump_workgroups(void); +void unbecome_local_master_success(struct subnet_record *subrec, + struct userdata_struct *userdata, + struct nmb_name *released_name, + struct in_addr released_ip); +void unbecome_local_master_fail(struct subnet_record *subrec, struct response_record *rrec, + struct nmb_name *fail_name); +void release_1d_name( struct subnet_record *subrec, char *workgroup_name); +void unbecome_local_master_browser(struct subnet_record *subrec, struct work_record *work); +void become_local_master_browser(struct subnet_record *subrec, struct work_record *work); + +/*The following definitions come from nmbd_browserdb.c */ + +void remove_lmb_browser_entry(struct browse_cache_record *browc); +void update_browser_death_time(struct browse_cache_record *browc); +struct browse_cache_record *create_browser_in_lmb_cache(char *work_name, char *browser_name, + struct in_addr ip); +struct browse_cache_record *find_browser_in_lmb_cache( char *browser_name ); +void expire_lmb_browsers(time_t t); +void remove_workgroup_lmb_browsers(char *work_group); + +/*The following definitions come from nmbd_browsesync.c */ + +void dmb_expire_and_sync_browser_lists(time_t t); +void announce_and_sync_with_domain_master_browser( struct subnet_record *subrec, + struct work_record *work); + +/*The following definitions come from nmbd_elections.c */ -/*The following definitions come from nameelect.c */ - -void check_master_browser(time_t t); -void browser_gone(char *work_name, struct in_addr ip); -void send_election(struct subnet_record *d, char *group,uint32 criterion, - int timeup,char *name); -void name_unregister_work(struct subnet_record *d, char *name, int name_type); -void name_register_work(struct subnet_record *d, char *name, int name_type, - int nb_flags, time_t ttl, struct in_addr ip, BOOL bcast); -void become_local_master(struct subnet_record *d, struct work_record *work); -void become_domain_master(struct subnet_record *d, struct work_record *work); -void become_logon_server(struct subnet_record *d, struct work_record *work); -void unbecome_local_master(struct subnet_record *d, struct work_record *work, - int remove_type); -void unbecome_domain_master(struct subnet_record *d, struct work_record *work, - int remove_type); -void unbecome_logon_server(struct subnet_record *d, struct work_record *work, - int remove_type); +void check_master_browser_exists(time_t t); void run_elections(time_t t); -void process_election(struct packet_struct *p,char *buf); +void process_election(struct subnet_record *subrec, struct packet_struct *p, char *buf); BOOL check_elections(void); -/*The following definitions come from namelogon.c */ +/*The following definitions come from nmbd_incomingdgrams.c */ -void process_logon_packet(struct packet_struct *p,char *buf,int len, - char *mailslot); - -/*The following definitions come from namepacket.c */ - -void debug_browse_data(char *outbuf, int len); -void initiate_netbios_packet(uint16 *id, - int fd,int quest_type,char *name,int name_type, - int nb_flags,BOOL bcast,BOOL recurse, - struct in_addr to_ip); -void reply_netbios_packet(struct packet_struct *p1,int trn_id, - int rcode, int rcv_code, int opcode, - BOOL recursion_available, - BOOL recursion_desired, - struct nmb_name *rr_name,int rr_type,int rr_class,int ttl, - char *data,int len); -void queue_packet(struct packet_struct *packet); -void run_packet_queue(); -BOOL listen_for_packets(BOOL run_election); -BOOL send_mailslot_reply(BOOL unique, char *mailslot,int fd,char *buf,int len,char *srcname, - char *dstname,int src_type,int dest_type, - struct in_addr dest_ip,struct in_addr src_ip); +void tell_become_backup(void); +void process_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf); +void process_workgroup_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf); +void process_local_master_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf); +void process_master_browser_announce(struct subnet_record *subrec, + struct packet_struct *p,char *buf); +void process_get_backup_list_request(struct subnet_record *subrec, + struct packet_struct *p,char *buf); +void process_reset_browser(struct subnet_record *subrec, + struct packet_struct *p,char *buf); +void process_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf); -/*The following definitions come from namequery.c */ +/*The following definitions come from nmbd_incomingrequests.c */ -BOOL name_status(int fd,char *name,int name_type,BOOL recurse, - struct in_addr to_ip,char *master,char *rname, - void (*fn)()); -BOOL name_query(int fd,char *name,int name_type, - BOOL bcast,BOOL recurse, - struct in_addr to_ip, struct in_addr *ip,void (*fn)()); - -/*The following definitions come from nameresp.c */ - -void expire_netbios_response_entries(time_t t); -struct response_record *queue_netbios_pkt_wins( - int fd,int quest_type,enum state_type state, - char *name,int name_type,int nb_flags, time_t ttl, - int server_type, char *my_name, char *my_comment, - struct in_addr send_ip, struct in_addr reply_to_ip); -struct response_record *queue_netbios_packet(struct subnet_record *d, - int fd,int quest_type,enum state_type state,char *name, - int name_type,int nb_flags, time_t ttl, - int server_type, char *my_name, char *my_comment, - BOOL bcast,BOOL recurse, - struct in_addr send_ip, struct in_addr reply_to_ip, - int reply_id); - -/*The following definitions come from nameserv.c */ - -void remove_name_entry(struct subnet_record *d, char *name,int type); -void add_my_name_entry(struct subnet_record *d,char *name,int type,int nb_flags); -void add_domain_logon_names(void); -void add_domain_master_bcast(void); -void add_domain_master_wins(void); -void add_domain_names(time_t t); -void add_my_names(void); -void remove_my_names(); -void refresh_my_names(time_t t); -void query_refresh_names(time_t t); +void process_name_release_request(struct subnet_record *subrec, + struct packet_struct *p); +void process_name_refresh_request(struct subnet_record *subrec, + struct packet_struct *p); +void process_name_registration_request(struct subnet_record *subrec, + struct packet_struct *p); +void process_node_status_request(struct subnet_record *subrec, struct packet_struct *p); +void process_name_query_request(struct subnet_record *subrec, struct packet_struct *p); -/*The following definitions come from nameservreply.c */ +/*The following definitions come from nmbd_lmhosts.c */ -void add_name_respond(struct subnet_record *d, int fd, struct in_addr from_ip, - uint16 response_id, - struct nmb_name *name, - int nb_flags, int ttl, struct in_addr register_ip, - BOOL new_owner, struct in_addr reply_to_ip); -void reply_name_release(struct packet_struct *p); -void reply_name_reg(struct packet_struct *p); -void reply_name_status(struct packet_struct *p); -void reply_name_query(struct packet_struct *p); +void load_lmhosts_file(char *fname); +BOOL find_name_in_lmhosts(struct nmb_name *nmbname, struct name_record **namerecp); -/*The following definitions come from nameservresp.c */ +/*The following definitions come from nmbd_logonnames.c */ -void debug_state_type(int state); -void response_netbios_packet(struct packet_struct *p); +void add_logon_names(void); -/*The following definitions come from namework.c */ +/*The following definitions come from nmbd_mynames.c */ -void reset_server(char *name, int state, struct in_addr ip); -void tell_become_backup(void); -BOOL same_context(struct dgram_packet *dgram); -void process_browse_packet(struct packet_struct *p,char *buf,int len); +BOOL register_my_workgroup_and_names(); +void release_my_names(); +void refresh_my_names(time_t t); -/*The following definitions come from nmbd.c */ +/*The following definitions come from nmbd_namelistdb.c */ -BOOL reload_services(BOOL test); +void set_samba_nb_type(void); +BOOL ms_browser_name(char *name, int type); +void remove_name_from_namelist(struct subnet_record *subrec, + struct name_record *namerec); +struct name_record *find_name_on_subnet(struct subnet_record *subrec, + struct nmb_name *nmbname, BOOL self_only); +struct name_record *find_name_for_remote_broadcast_subnet( struct nmb_name *nmbname, + BOOL self_only); +void update_name_ttl(struct name_record *namerec, int ttl); +struct name_record *add_name_to_subnet(struct subnet_record *subrec, + char *name, int type, uint16 nb_flags, int ttl, + enum name_source source, int num_ips, struct in_addr *iplist); +void standard_success_register(struct subnet_record *subrec, + struct userdata_struct *userdata, + struct nmb_name *nmbname, uint16 nb_flags, int ttl, + struct in_addr registered_ip); +void standard_fail_register(struct subnet_record *subrec, + struct response_record *rrec, struct nmb_name *nmbname); +BOOL find_ip_in_name_record(struct name_record *namerec, struct in_addr ip); +void add_ip_to_name_record(struct name_record *namerec, struct in_addr new_ip); +void remove_ip_from_name_record( struct name_record *namerec, struct in_addr remove_ip); +void standard_success_release(struct subnet_record *subrec, + struct userdata_struct *userdata, + struct nmb_name *nmbname, struct in_addr released_ip); +void expire_names_on_subnet(struct subnet_record *subrec, time_t t); +void expire_names(time_t t); +void add_samba_names_to_subnet(struct subnet_record *subrec); +void dump_all_namelists(); + +/*The following definitions come from nmbd_namequery.c */ + +BOOL query_name(struct subnet_record *subrec, char *name, int type, + query_name_success_function success_fn, + query_name_fail_function fail_fn, + struct userdata_struct *userdata); + +/*The following definitions come from nmbd_nameregister.c */ + +BOOL register_name(struct subnet_record *subrec, + char *name, int type, uint16 nb_flags, + register_name_success_function success_fn, + register_name_fail_function fail_fn, + struct userdata_struct *userdata); +BOOL refresh_name(struct subnet_record *subrec, struct name_record *namerec, + refresh_name_success_function success_fn, + refresh_name_fail_function fail_fn, + struct userdata_struct *userdata); + +/*The following definitions come from nmbd_namerelease.c */ + +BOOL release_name(struct subnet_record *subrec, struct name_record *namerec, + release_name_success_function success_fn, + release_name_fail_function fail_fn, + struct userdata_struct *userdata); + +/*The following definitions come from nmbd_nodestatus.c */ + +BOOL node_status(struct subnet_record *subrec, struct nmb_name *nmbname, + struct in_addr send_ip, node_status_success_function success_fn, + node_status_fail_function fail_fn, struct userdata_struct *userdata); + +/*The following definitions come from nmbd_packets.c */ + +uint16 get_nb_flags(char *buf); +void set_nb_flags(char *buf, uint16 nb_flags); +struct response_record *queue_register_name( struct subnet_record *subrec, + response_function resp_fn, + timeout_response_function timeout_fn, + register_name_success_function success_fn, + register_name_fail_function fail_fn, + struct userdata_struct *userdata, + struct nmb_name *nmbname, + uint16 nb_flags); +struct response_record *queue_register_multihomed_name( struct subnet_record *subrec, + response_function resp_fn, + timeout_response_function timeout_fn, + register_name_success_function success_fn, + register_name_fail_function fail_fn, + struct userdata_struct *userdata, + struct nmb_name *nmbname, + uint16 nb_flags, + struct in_addr register_ip); +struct response_record *queue_release_name( struct subnet_record *subrec, + response_function resp_fn, + timeout_response_function timeout_fn, + release_name_success_function success_fn, + release_name_fail_function fail_fn, + struct userdata_struct *userdata, + struct nmb_name *nmbname, + uint16 nb_flags, + struct in_addr release_ip); +struct response_record *queue_refresh_name( struct subnet_record *subrec, + response_function resp_fn, + timeout_response_function timeout_fn, + refresh_name_success_function success_fn, + refresh_name_fail_function fail_fn, + struct userdata_struct *userdata, + struct name_record *namerec, + struct in_addr refresh_ip); +struct response_record *queue_query_name( struct subnet_record *subrec, + response_function resp_fn, + timeout_response_function timeout_fn, + query_name_success_function success_fn, + query_name_fail_function fail_fn, + struct userdata_struct *userdata, + struct nmb_name *nmbname); +struct response_record *queue_node_status( struct subnet_record *subrec, + response_function resp_fn, + timeout_response_function timeout_fn, + node_status_success_function success_fn, + node_status_fail_function fail_fn, + struct userdata_struct *userdata, + struct nmb_name *nmbname, + struct in_addr send_ip); +void reply_netbios_packet(struct packet_struct *orig_packet, + int rcode, enum netbios_reply_type_code rcv_code, int opcode, + int ttl, char *data,int len); +void queue_packet(struct packet_struct *packet); +void process_browse_packet(struct packet_struct *p, char *buf,int len); +BOOL validate_nmb_response_packet( struct nmb_packet *nmb ); +BOOL validate_nmb_packet( struct nmb_packet *nmb ); +void run_packet_queue(); +void retransmit_or_expire_response_records(time_t t); +BOOL listen_for_packets(BOOL run_election); +BOOL send_mailslot(BOOL unique, char *mailslot,char *buf,int len, + char *srcname, int src_type, + char *dstname, int dest_type, + struct in_addr dest_ip,struct in_addr src_ip); + +/*The following definitions come from nmbd_processlogon.c */ + +void process_logon_packet(struct packet_struct *p,char *buf,int len, + char *mailslot); + +/*The following definitions come from nmbd_responserecordsdb.c */ + +void add_response_record(struct subnet_record *subrec, + struct response_record *rrec); +void remove_response_record(struct subnet_record *subrec, + struct response_record *rrec); +struct response_record *make_response_record( struct subnet_record *subrec, + struct packet_struct *p, + response_function resp_fn, + timeout_response_function timeout_fn, + success_function success_fn, + fail_function fail_fn, + struct userdata_struct *userdata); +struct response_record *find_response_record(struct subnet_record **ppsubrec, + uint16 id); + +/*The following definitions come from nmbd_sendannounce.c */ + +void send_browser_reset(int reset_type, char *to_name, int to_type, struct in_addr to_ip); +void broadcast_announce_request(struct subnet_record *subrec, struct work_record *work); +void announce_my_server_names(time_t t); +void reset_announce_timer(); +void announce_myself_to_domain_master_browser(time_t t); +void announce_my_servers_removed(void); +void announce_remote(time_t t); +void browse_sync_remote(time_t t); + +/*The following definitions come from nmbd_serverlistdb.c */ + +void remove_all_servers(struct work_record *work); +struct server_record *find_server_in_workgroup(struct work_record *work, char *name); +struct server_record *create_server_on_workgroup(struct work_record *work, + char *name,int servertype, + int ttl,char *comment); +void update_server_ttl(struct server_record *servrec, int ttl); +void expire_servers(struct work_record *work, time_t t); +void write_browse_list(time_t t, BOOL force_write); + +/*The following definitions come from nmbd_subnetdb.c */ + +BOOL create_subnets(); +BOOL we_are_a_wins_client(); +struct subnet_record *get_next_subnet_maybe_unicast(struct subnet_record *subrec); + +/*The following definitions come from nmbd_winsproxy.c */ + +void make_wins_proxy_name_query_request( struct subnet_record *subrec, + struct packet_struct *incoming_packet, + struct nmb_name *question_name); + +/*The following definitions come from nmbd_winsserver.c */ + +BOOL packet_is_for_wins_server(struct packet_struct *packet); +BOOL initialise_wins(void); +void wins_process_name_refresh_request(struct subnet_record *subrec, + struct packet_struct *p); +void wins_process_name_registration_request(struct subnet_record *subrec, + struct packet_struct *p); +void wins_process_multihomed_name_registration_request( struct subnet_record *subrec, + struct packet_struct *p); +void send_wins_name_query_response(int rcode, struct packet_struct *p, + struct name_record *namerec); +void wins_process_name_query_request(struct subnet_record *subrec, + struct packet_struct *p); +void wins_process_name_release_request(struct subnet_record *subrec, + struct packet_struct *p); +void initiate_wins_processing(time_t t); +void wins_write_database(void); + +/*The following definitions come from nmbd_workgroupdb.c */ + +struct work_record *find_workgroup_on_subnet(struct subnet_record *subrec, + fstring name); +struct work_record *create_workgroup_on_subnet(struct subnet_record *subrec, + fstring name, int ttl); +void update_workgroup_ttl(struct work_record *work, int ttl); +void initiate_myworkgroup_startup(struct subnet_record *subrec, struct work_record *work); +void dump_workgroups(void); +void expire_workgroups_and_servers(time_t t); /*The following definitions come from nmblib.c */ char *lookup_opcode_name( int opcode ); void debug_nmb_packet(struct packet_struct *p); char *namestr(struct nmb_name *n); -void free_nmb_packet(struct nmb_packet *nmb); +struct packet_struct *copy_packet(struct packet_struct *packet); void free_packet(struct packet_struct *packet); struct packet_struct *read_packet(int fd,enum packet_type packet_type); void make_nmb_name(struct nmb_name *n,char *name,int type,char *this_scope); +BOOL nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2); BOOL send_packet(struct packet_struct *p); struct packet_struct *receive_packet(int fd,enum packet_type type,int t); -/*The following definitions come from nmbsync.c */ - -void sync_browse_lists(struct subnet_record *d, struct work_record *work, - char *name, int nm_type, struct in_addr ip, BOOL local); - /*The following definitions come from ntclient.c */ BOOL do_nt_login(char *desthost, char *myhostname, -- cgit From 16bf14adf1b78f7ec4d3d267d500258fdf399627 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 16 Dec 1997 09:20:34 +0000 Subject: Added Lanman announce patch from Jacco de Leeuw . Also added code to stop old Samba servers that announce the workgroup name as master browser name when they are a local master browser. Jeremy. (This used to be commit 3605da055737e2cc0fbfffe7772721943a5be8bd) --- source3/include/nameserv.h | 1 + source3/include/proto.h | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 4b7216fef6..98a6cb330a 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -122,6 +122,7 @@ enum netbios_reply_type_code { NMB_QUERY, NMB_STATUS, NMB_REG, NMB_REG_REFRESH, #define BROWSE_MAILSLOT "\\MAILSLOT\\BROWSE" #define NET_LOGON_MAILSLOT "\\MAILSLOT\\NET\\NETLOGON" #define NT_LOGON_MAILSLOT "\\MAILSLOT\\NET\\NTLOGON" +#define LANMAN_MAILSLOT "\\MAILSLOT\\LANMAN" /* Samba definitions for find_name_on_subnet(). */ #define FIND_ANY_NAME 0 diff --git a/source3/include/proto.h b/source3/include/proto.h index b249c9cb20..a3fd1d1f0f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -298,6 +298,8 @@ int lp_lpqcachetime(void); int lp_syslog(void); int lp_client_code_page(void); int lp_announce_as(void); +int lp_lm_announce(void); +int lp_lm_interval(void); char *lp_preexec(int ); char *lp_postexec(int ); char *lp_rootpreexec(int ); @@ -485,6 +487,7 @@ void unbecome_local_master_fail(struct subnet_record *subrec, struct response_re void release_1d_name( struct subnet_record *subrec, char *workgroup_name); void unbecome_local_master_browser(struct subnet_record *subrec, struct work_record *work); void become_local_master_browser(struct subnet_record *subrec, struct work_record *work); +void set_workgroup_local_master_browser_name( struct work_record *work, char *newname); /*The following definitions come from nmbd_browserdb.c */ @@ -517,11 +520,13 @@ void process_workgroup_announce(struct subnet_record *subrec, struct packet_stru void process_local_master_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf); void process_master_browser_announce(struct subnet_record *subrec, struct packet_struct *p,char *buf); +void process_lm_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf); void process_get_backup_list_request(struct subnet_record *subrec, struct packet_struct *p,char *buf); void process_reset_browser(struct subnet_record *subrec, struct packet_struct *p,char *buf); void process_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf); +void process_lm_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf); /*The following definitions come from nmbd_incomingrequests.c */ @@ -670,6 +675,7 @@ void reply_netbios_packet(struct packet_struct *orig_packet, int ttl, char *data,int len); void queue_packet(struct packet_struct *packet); void process_browse_packet(struct packet_struct *p, char *buf,int len); +void process_lanman_packet(struct packet_struct *p, char *buf,int len); BOOL validate_nmb_response_packet( struct nmb_packet *nmb ); BOOL validate_nmb_packet( struct nmb_packet *nmb ); void run_packet_queue(); @@ -706,6 +712,7 @@ struct response_record *find_response_record(struct subnet_record **ppsubrec, void send_browser_reset(int reset_type, char *to_name, int to_type, struct in_addr to_ip); void broadcast_announce_request(struct subnet_record *subrec, struct work_record *work); void announce_my_server_names(time_t t); +void announce_my_lm_server_names(time_t t); void reset_announce_timer(); void announce_myself_to_domain_master_browser(time_t t); void announce_my_servers_removed(void); -- cgit From 59fcf1410749f7a233d87374f9d6d98501cd7ef3 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Tue, 16 Dec 1997 12:35:10 +0000 Subject: preparing for release of 1.9.18alpha13 (This used to be commit 90b8675b88aa01ae912b5c8849ffb406ad976b95) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index f0f6131dc8..1d79e7103e 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.18alpha12" +#define VERSION "1.9.18alpha13" -- cgit From b80b6ea3b43a880bb392b8ef8caaff0f11bb80ef Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 18 Dec 1997 11:05:00 +0000 Subject: kanji.h: Fixed problems with re-definitions of strchr and others on AIX. nmbd_nameregister.c: Applied fix found by "Eloy A. Paris" (don't re-use lists after you have freed them :-). Jeremy. (This used to be commit bcfcc39a2752de0fb35b419d005bb1a86fd15fea) --- source3/include/kanji.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'source3/include') diff --git a/source3/include/kanji.h b/source3/include/kanji.h index 528680d88a..5e8173ee14 100644 --- a/source3/include/kanji.h +++ b/source3/include/kanji.h @@ -108,6 +108,30 @@ extern char *(*_dos_to_unix)(char *str, BOOL overwrite); extern char *(*_unix_to_dos)(char *str, BOOL overwrite); +/* + * The following is needed for AIX systems that have + * their own #defines for strchr, strrchr, strstr + * and strtok. + */ + +#ifdef strchr +#undef strchr +#endif /* strchr */ + +#ifdef strrchr +#undef strrchr +#endif /* strrchr */ + +#ifdef strstr +#undef strstr +#endif /* strstr */ + +#ifdef strtok +#undef strtok +#endif /* strtok */ + +/* Ensure we use our definitions. */ + #define strchr sj_strchr #define strrchr sj_strrchr #define strstr sj_strstr -- cgit From be71d43585cf4b42efff7995dbf061fddd6077f5 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 20 Dec 1997 14:36:11 +0000 Subject: client.c: clientgen.c: clientutil.c: clitar.c: Changed usage of receive_smb to new function client_receive_smb except for one use of receive_smb in client.c. This is the receive_smb used to discard packets received whilst in a keyboard wait state. util.c: Created new function client_receive_smb that ignores session keepalives just as the old receive_smb used to do. Created internal function read_smb_length_return_keepalive that is used internally by the changed receive_smb call. Changed read_smb_len to not use an internal buffer - it is never called with a null buffer so such code is redundant. Jeremy. (This used to be commit 1084fb46821cb96702da35439da4a8df9d255698) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index a3fd1d1f0f..6301a7b39d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1433,6 +1433,7 @@ int write_data(int fd,char *buffer,int N); int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align); int read_smb_length(int fd,char *inbuf,int timeout); BOOL receive_smb(int fd,char *buffer, int timeout); +BOOL client_receive_smb(int fd,char *buffer, int timeout); BOOL receive_local_message(int fd, char *buffer, int buffer_len, int timeout); BOOL push_local_message(char *buf, int msg_len); BOOL receive_message_or_smb(int smbfd, int oplock_fd, -- cgit From d1e796d8577a666e5ef14f9bb462c080300dca3e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 23 Dec 1997 07:15:59 +0000 Subject: Fixes to compile under OpenBSD from "Todd T. Fries" Jeremy. (This used to be commit 3c9292505914e2119fa7b1973c9fbbe1742262b2) --- source3/include/includes.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 6c2b676b31..c99880cad3 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -193,7 +193,7 @@ #include #endif -#if defined(SHADOW_PWD) && !defined(NETBSD) && !defined(FreeBSD) && !defined(CONVEX) +#if defined(SHADOW_PWD) && !defined(NETBSD) && !defined(FreeBSD) && !defined(CONVEX) && !defined(__OpenBSD__) #include #endif @@ -523,7 +523,21 @@ char *mktemp(char *); /* No standard include */ #define HAVE_GETGRNAM 1 #endif - +#ifdef __OpenBSD__ +#include +#include +#define NO_GETSPNAM +#define SIGNAL_CAST (void (*)()) +#define USE_DIRECT +#define REPLACE_INNETGR +#define HAVE_BZERO +#define HAVE_PATHCONF +#define HAVE_GETGRNAM 1 +#define HAVE_GETTIMEOFDAY +#define HAVE_MEMMOVE +#define USE_GETCWD +#define USE_SETSID +#endif #ifdef AIX #include -- cgit From 0c0777400fd4a2e0586761514345153c9ee218ed Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 24 Dec 1997 07:10:04 +0000 Subject: Finally added the code Andrew wanted that will allow a Samba domain master browser to use the *<1b> feature of the Samba WINS server to get a full workgroup list. nmbd.c: Added timed call to collect_all_workgroup_names_from_wins_server(). nmbd_browsesync.c: Meat of the code to implement collect_all_workgroup_names_from_wins_server(). nmbd_incomingdgrams.c: Fixed comment typo. Jeremy. (This used to be commit 1a3ab3e84a415a6d0d9b4cafb3f0f6e8cbe3fa69) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 6301a7b39d..df9c146cd9 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -504,6 +504,7 @@ void remove_workgroup_lmb_browsers(char *work_group); void dmb_expire_and_sync_browser_lists(time_t t); void announce_and_sync_with_domain_master_browser( struct subnet_record *subrec, struct work_record *work); +void collect_all_workgroup_names_from_wins_server(time_t t); /*The following definitions come from nmbd_elections.c */ -- cgit From 5cdb60bd93fcf97fa9ee1c42642237eb7d4c2083 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 24 Dec 1997 08:49:44 +0000 Subject: nmbd_elections.c: Added new parameter to dump_workgroups call. nmbd_incomingdgrams.c: Deal with announcements with servertype == 0 - these are announcements that a machine is shutting down and must be treated differently. nmbd_serverlistdb.c: Exposed remove_server_from_workgroup as external. Added code to dump out workgroups on signal correctly. nmbd_workgroupdb.c: Added new parameter to dump_workgroups call. Jeremy. (This used to be commit f7591109b968c66012af5e9fe818bba8e6f1cf23) --- source3/include/proto.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index df9c146cd9..7c2966b64f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -724,6 +724,7 @@ void browse_sync_remote(time_t t); void remove_all_servers(struct work_record *work); struct server_record *find_server_in_workgroup(struct work_record *work, char *name); +void remove_server_from_workgroup(struct work_record *work, struct server_record *servrec); struct server_record *create_server_on_workgroup(struct work_record *work, char *name,int servertype, int ttl,char *comment); @@ -770,7 +771,7 @@ struct work_record *create_workgroup_on_subnet(struct subnet_record *subrec, fstring name, int ttl); void update_workgroup_ttl(struct work_record *work, int ttl); void initiate_myworkgroup_startup(struct subnet_record *subrec, struct work_record *work); -void dump_workgroups(void); +void dump_workgroups(BOOL force_write); void expire_workgroups_and_servers(time_t t); /*The following definitions come from nmblib.c */ -- cgit From aef2c5d69956c72f8b0bd2285283e8879ed8603d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 24 Dec 1997 09:30:56 +0000 Subject: Added SIGUSR1/SIGUSR2 handling. Sending nmbd/smbd a SIGUSR1 will raise the debug level by one (capped at 10) sending a SIGUSR2 will lower it (lower limit at zero). Jeremy. (This used to be commit 6a3cb6f4b46129e4d799a24d34cdb9460ed8910f) --- source3/include/proto.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 7c2966b64f..1245b21039 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1368,6 +1368,8 @@ BOOL user_in_list(char *user,char *list); /*The following definitions come from util.c */ +int sig_usr2(void); +int sig_usr1(void); void setup_logging(char *pname,BOOL interactive); void reopen_logs(void); char *tmpdir(void); -- cgit From 0712d155b31e83834ec7e108d5c53a84adf634f3 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Wed, 24 Dec 1997 10:59:38 +0000 Subject: preparing for release of 1.9.18alpha14 (This used to be commit d3a238e7ac452690bd35f399357b8795100f60a3) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 1d79e7103e..50bc1d553f 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.18alpha13" +#define VERSION "1.9.18alpha14" -- cgit From 8d50079a6e2d25e6a09d4830e140f83c6917acf2 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 5 Jan 1998 22:54:32 +0000 Subject: Added 3 commands: smbmount: This is a stripped down smbclient that communicates with the Linux 2.1.x kernel to supply authenticated smb connections for smbfs mount points. smbmnt/smbumount: setuid commands that do the actual smb mount system call after having done the appropriate security checks (This used to be commit ccbbc4e647ad900b215dae949d5bcd45671c68c8) --- source3/include/proto.h | 2 +- source3/include/smb.h | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 1245b21039..e26c1889a1 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -114,7 +114,7 @@ BOOL cli_send_trans_request(char *outbuf,int trans, int ldata,int lparam,int lsetup, int mdata,int mparam,int msetup); BOOL cli_send_session_request(char *inbuf,char *outbuf); -BOOL cli_send_login(char *inbuf,char *outbuf,BOOL start_session,BOOL use_setup); +BOOL cli_send_login(char *inbuf,char *outbuf,BOOL start_session,BOOL use_setup, struct connection_options *options); void cli_send_logout(void ); BOOL cli_open_sockets(int port ); BOOL cli_reopen_connection(char *inbuf,char *outbuf); diff --git a/source3/include/smb.h b/source3/include/smb.h index 401459becc..ebf0945855 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1628,6 +1628,25 @@ struct connect_record time_t start; }; +/* This is used by smbclient to send it to a smbfs mount point */ +struct connection_options { + int protocol; + /* Connection-Options */ + uint32 max_xmit; + uint16 server_uid; + uint16 tid; + /* The following are LANMAN 1.0 options */ + uint16 sec_mode; + uint16 max_mux; + uint16 max_vcs; + uint16 rawmode; + uint32 sesskey; + /* The following are NT LM 0.12 options */ + uint32 maxraw; + uint32 capabilities; + uint16 serverzone; +}; + #ifndef LOCKING_VERSION #define LOCKING_VERSION 4 #endif /* LOCKING_VERSION */ -- cgit From c23ed625b22bfc765ba95cb7b8addf55625fea44 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 7 Jan 1998 06:21:56 +0000 Subject: includes.h: Added FreeBSD 3.x fixes. Added HPUX10.x fixes. interface.c: Added netmask fix. nmbd_nameregister.c: Fixed unitialised variable warnings. nmbd_winsproxy.c: Fixed unitialised variable warnings. nmbd_winsserver.c: Fixed DEC warnings. print_svid.c: Fixed DEC warnings. printing.c: Added LPRng fixes. Jeremy. (This used to be commit 28aff043c4a3693a0c20e87c7ce11eb4bf285b78) --- source3/include/includes.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index c99880cad3..3dbe6780a5 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -510,12 +510,16 @@ char *mktemp(char *); /* No standard include */ #include #include #include +#if __FreeBSD__ >= 3 +#include +#else +#define USE_DIRECT +#endif #define SIGNAL_CAST (void (*)()) #define USE_SETVBUF #define USE_SETSID #define USE_GETCWD #define USE_WAITPID -#define USE_DIRECT #define HAVE_MEMMOVE #define HAVE_BZERO #define HAVE_GETTIMEOFDAY @@ -568,6 +572,7 @@ char *mktemp(char *); /* No standard include */ #include #include #include +#include /* needed for inet_ntoa proto */ #ifdef HPUX_10_TRUSTED #include #include -- cgit From 7841ba6e8a5e8c5a6409ac6e9bc5a460c18ce7e3 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 8 Jan 1998 06:15:48 +0000 Subject: preparing for release of 1.9.18 (This used to be commit c3f725ad889650147cf5b931ca9f34836daaf942) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 50bc1d553f..2b6537a173 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.18alpha14" +#define VERSION "1.9.18" -- cgit From 0d1933fefc3685cc2d5e48e05a323f5ef81be555 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 9 Jan 1998 05:33:27 +0000 Subject: docs/Support.txt: Removed consultant. source/Makefile: Added Volker's comment. source/nmbd_become_lmb.c: source/nmbd_browsesync.c: source/nmbd_incomingdgrams.c: Fixed userdata alignment problems. source/mem_man/mem_man.c: source/mem_man/mem_man.h: added smb_ prefix to stop namespace collisions. Jeremy. (This used to be commit 4c8af3bc9f43b2427609cbeecb7940b1753a9a1c) --- source3/include/proto.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index e26c1889a1..a8471d0c2d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -437,18 +437,18 @@ void mdfour(unsigned char *out, unsigned char *in, int n); /*The following definitions come from mem_man/mem_man.c */ -void *mem_malloc(size_t size,char *file,int line); -char *mem_strdup(char *s, char *file, int line); -int mem_free(void *ptr,char *file,int line); -void mem_write_info(void *ptr,FILE *outfile); -char *mem_query_file(void *ptr); -int mem_query_line(void *ptr); -int mem_test(void *ptr); -void mem_write_status(FILE *outfile); -void mem_write_verbose(FILE *outfile); -void mem_write_errors(FILE *outfile); -void mem_set_multiplier(int multiplier); -void *mem_resize(void *ptr,size_t newsize); +void *smb_mem_malloc(size_t size,char *file,int line); +char *smb_mem_strdup(char *s, char *file, int line); +int smb_mem_free(void *ptr,char *file,int line); +void smb_mem_write_info(void *ptr,FILE *outfile); +char *smb_mem_query_file(void *ptr); +int smb_mem_query_line(void *ptr); +int smb_mem_test(void *ptr); +void smb_mem_write_status(FILE *outfile); +void smb_mem_write_verbose(FILE *outfile); +void smb_mem_write_errors(FILE *outfile); +void smb_mem_set_multiplier(int multiplier); +void *smb_mem_resize(void *ptr,size_t newsize); /*The following definitions come from message.c */ -- cgit From 221fda2454396fa6c3d2b820d81c56b4cdc48f13 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 12 Jan 1998 00:20:10 +0000 Subject: *** empty log message *** (This used to be commit 7b031586ca33a381eb0e27f3557f43c2550df5f8) --- source3/include/smb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index ebf0945855..e6c0565b05 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1443,6 +1443,7 @@ typedef struct BOOL modified; BOOL granted_oplock; BOOL sent_oplock_break; + BOOL reserved; char *name; } files_struct; -- cgit From fec28f2defa17974b2eaafdd10599cf37850ca16 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 16 Jan 1998 06:29:38 +0000 Subject: Makefile: Added new codepage - 866. charset.c: Supporting code for codepage 866. clientutil.c: Fix compile bug in little-used #define. includes.h: Supporting code for codepage 866. make_smbcodepage.c: Supporting code for codepage 866. pcap.c: Fix bug for lpstat. Jeremy. (This used to be commit 6040d7a39e5d5ab426905aa79b871df815fb9b62) --- source3/include/includes.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 3dbe6780a5..2d2ff63f88 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -1168,6 +1168,10 @@ extern char *sys_errlist[]; #include "kanji.h" #include "charset.h" +#ifndef MAXCODEPAGELINES +#define MAXCODEPAGELINES 256 +#endif + /***** automatically generated prototypes *****/ #include "proto.h" -- cgit From 4f9674d1c85f2e7293874477ae0da15fee1538c7 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 16 Jan 1998 08:58:00 +0000 Subject: reply.c: server.c: Test fix for NT worstation SMBmv oplock bug. smbdes.c: Addition of 'forward' parameter in preparation of allowing password change. Jeremy. (This used to be commit 0b0b1fb122a52e67a8fdc77d013ad0b3bbb90d19) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index a8471d0c2d..d0376fb9fe 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1218,7 +1218,7 @@ int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); BOOL check_name(char *name,int cnum); void sync_file(int fnum); void close_file(int fnum, BOOL normal_close); -BOOL check_file_sharing(int cnum,char *fname); +BOOL check_file_sharing(int cnum,char *fname, BOOL rename_op); int check_share_mode( share_mode_entry *share, int deny_mode, char *fname, BOOL fcbopen, int *flags); void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun, -- cgit From 1ea8ceac458501719a055700902d456304c4ee0a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 17 Jan 1998 07:08:21 +0000 Subject: charcnv.c: Added codepage 866 support onto the file system. Patch from Max Khon . chgpasswd.c: Allow old RAP change password to work with encrypted passwords. Samba can now allow Windows 95/NT clients to securely change the Lanman password ! (But not the NT hash - that gets lost). ipc.c: smbdes.c: smbpass.c: Support for the above. server.c: #ifdef'ed out fix for NT redirector bug. util.c: Fix NIS bug with server name. Jeremy. (This used to be commit cd9fad92d0316e5a0007ba3c5668906dc2f011f1) --- source3/include/proto.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index d0376fb9fe..d6027e3716 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -45,6 +45,9 @@ void add_char_string(char *s); BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence); BOOL chgpasswd(char *name,char *oldpass,char *newpass); BOOL chgpasswd(char *name,char *oldpass,char *newpass); +BOOL check_lanman_password(char *user, unsigned char *pass1, + unsigned char *pass2, struct smb_passwd **psmbpw); +BOOL change_lanman_password(struct smb_passwd *smbpw, char *pass1, char *pass2); /*The following definitions come from client.c */ @@ -1268,6 +1271,7 @@ struct shmem_ops *sysv_shm_open(int ronly); void E_P16(unsigned char *p14,unsigned char *p16); void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24); +void D_P16(unsigned char *p14, unsigned char *in, unsigned char *out); void cred_hash1(unsigned char *out,unsigned char *in,unsigned char *key); void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key); -- cgit From 118213c059501d384be9a6dcaf02d13a681bedc3 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 22 Jan 1998 09:25:05 +0000 Subject: printing.c: Bug fix for lpng reporting. server.c: Large fix for oplock deadlock bug. util.c: Fix for oplock deadlock bug. Jeremy. (This used to be commit 4cae830ab3a942b2f2868173a492d02f6332651d) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index d6027e3716..3d478b9246 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1443,7 +1443,7 @@ int read_smb_length(int fd,char *inbuf,int timeout); BOOL receive_smb(int fd,char *buffer, int timeout); BOOL client_receive_smb(int fd,char *buffer, int timeout); BOOL receive_local_message(int fd, char *buffer, int buffer_len, int timeout); -BOOL push_local_message(char *buf, int msg_len); +BOOL push_smb_message(char *buf, int msg_len); BOOL receive_message_or_smb(int smbfd, int oplock_fd, char *buffer, int buffer_len, int timeout, BOOL *got_smb); -- cgit From 55f400bd84f26027f5ec9b7fa06b22895de7557c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 22 Jan 1998 13:27:43 +0000 Subject: This is *not* a big change (although it looks like one). This is merely updating the Copyright statements from 1997 to 1998. It's a once a year thing :-). NO OTHER CHANGES WERE MADE. Jeremy. (This used to be commit b9c16977231efb274e08856f7f3f4408dad6d96c) --- source3/include/byteorder.h | 2 +- source3/include/charset.h | 2 +- source3/include/includes.h | 2 +- source3/include/kanji.h | 2 +- source3/include/nameserv.h | 2 +- source3/include/smb.h | 8 ++++---- source3/include/trans2.h | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) (limited to 'source3/include') diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h index 4d972a5cac..3371fd24cb 100644 --- a/source3/include/byteorder.h +++ b/source3/include/byteorder.h @@ -2,7 +2,7 @@ Unix SMB/Netbios implementation. Version 1.9. SMB Byte handling - Copyright (C) Andrew Tridgell 1992-1997 + Copyright (C) Andrew Tridgell 1992-1998 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/source3/include/charset.h b/source3/include/charset.h index fb184897c0..b6f79c03dd 100644 --- a/source3/include/charset.h +++ b/source3/include/charset.h @@ -2,7 +2,7 @@ Unix SMB/Netbios implementation. Version 1.9. Character set handling - Copyright (C) Andrew Tridgell 1992-1997 + Copyright (C) Andrew Tridgell 1992-1998 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/source3/include/includes.h b/source3/include/includes.h index 2d2ff63f88..f021fa952e 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -4,7 +4,7 @@ Unix SMB/Netbios implementation. Version 1.9. Machine customisation and include handling - Copyright (C) Andrew Tridgell 1994-1997 + Copyright (C) Andrew Tridgell 1994-1998 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/source3/include/kanji.h b/source3/include/kanji.h index 5e8173ee14..101b98cfa3 100644 --- a/source3/include/kanji.h +++ b/source3/include/kanji.h @@ -2,7 +2,7 @@ Unix SMB/Netbios implementation. Version 1.9. Kanji Extensions - Copyright (C) Andrew Tridgell 1992-1997 + Copyright (C) Andrew Tridgell 1992-1998 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 98a6cb330a..7faad9aff4 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -4,7 +4,7 @@ Unix SMB/Netbios implementation. Version 1.9. NBT netbios header - version 2 - Copyright (C) Andrew Tridgell 1994-1997 + Copyright (C) Andrew Tridgell 1994-1998 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/source3/include/smb.h b/source3/include/smb.h index e6c0565b05..9c55e3f8be 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -2,10 +2,10 @@ Unix SMB/Netbios implementation. Version 1.9. SMB parameters and setup - Copyright (C) Andrew Tridgell 1992-1997 - Copyright (C) John H Terpstra 1996-1997 - Copyright (C) Luke Kenneth Casson Leighton 1996-1997 - Copyright (C) Paul Ashton 1997 + Copyright (C) Andrew Tridgell 1992-1998 + Copyright (C) John H Terpstra 1996-1998 + Copyright (C) Luke Kenneth Casson Leighton 1996-1998 + Copyright (C) Paul Ashton 1998 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/source3/include/trans2.h b/source3/include/trans2.h index 5218604e0e..62b6a1a9bf 100644 --- a/source3/include/trans2.h +++ b/source3/include/trans2.h @@ -2,7 +2,7 @@ Unix SMB/Netbios implementation. Version 1.9. SMB transaction2 handling - Copyright (C) Jeremy Allison 1994-1997 + Copyright (C) Jeremy Allison 1994-1998 Extensively modified by Andrew Tridgell, 1995 -- cgit From 4f650dab6f867bda2beeeda71b2b97e75834853f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 24 Jan 1998 08:49:21 +0000 Subject: Added get_create_time() function to time.c. This gets the minimum timestamp associated with a file. reply.c and trans2.c then return this as the create time. Designed to fix problems with VC++ and others. Jeremy. (This used to be commit e3d5f6196d6eff707c78941696a368216e2a7410) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 3d478b9246..f422b8fc90 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1338,6 +1338,7 @@ time_t make_unix_date(void *date_ptr); time_t make_unix_date2(void *date_ptr); time_t make_unix_date3(void *date_ptr); char *timestring(void ); +time_t get_create_time(struct stat *st); /*The following definitions come from trans2.c */ -- cgit From 89652787c3894c7a79345a2ea67a4de741a0f760 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 29 Jan 1998 08:25:46 +0000 Subject: Makefile: Fix for OSF1 typo. asyncdns.c: Fixes that went into 1.9.18p2 - allow unclocking of sigterm. chgpasswd.c: char -> unsigned char fixes. includes.h: AIX fix to get prototype for inet_ntoa. local.h: Tune size of shared memory based on MAX_OPEN_FILES. nmbd_mynames.c: Fix for nmbd repeated refresh bug. nmbd_responserecordsdb.c: Fix for nmbd repeated refresh bug. nmbd_winsserver.c: Fix for multi-homed registration optimisation. smb.h: Moved default shared memory size to local.h Jeremy. (This used to be commit fa5466805685d461564054d7d9947948fc56ae93) --- source3/include/includes.h | 1 + source3/include/local.h | 5 +++++ source3/include/proto.h | 3 ++- source3/include/smb.h | 5 ----- 4 files changed, 8 insertions(+), 6 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index f021fa952e..218ce19955 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -554,6 +554,7 @@ char *mktemp(char *); /* No standard include */ #include #include #include +#include /* needed for inet_ntoa proto */ #define SYSV #define USE_WAITPID #define USE_SIGBLOCK diff --git a/source3/include/local.h b/source3/include/local.h index 10906d1ff1..0e2a927d2e 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -39,6 +39,11 @@ #define MAX_CONNECTIONS 127 #define MAX_OPEN_FILES 100 +/* Default size of shared memory used for share mode locking */ +#ifndef SHMEM_SIZE +#define SHMEM_SIZE (1024*MAX_OPEN_FILES) +#endif + /* the max number of connections that the smbstatus program will show */ #define MAXSTATUS 1000 diff --git a/source3/include/proto.h b/source3/include/proto.h index f422b8fc90..fd31db7e62 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -47,7 +47,7 @@ BOOL chgpasswd(char *name,char *oldpass,char *newpass); BOOL chgpasswd(char *name,char *oldpass,char *newpass); BOOL check_lanman_password(char *user, unsigned char *pass1, unsigned char *pass2, struct smb_passwd **psmbpw); -BOOL change_lanman_password(struct smb_passwd *smbpw, char *pass1, char *pass2); +BOOL change_lanman_password(struct smb_passwd *smbpw, unsigned char *pass1, unsigned char *pass2); /*The following definitions come from client.c */ @@ -710,6 +710,7 @@ struct response_record *make_response_record( struct subnet_record *subrec, struct userdata_struct *userdata); struct response_record *find_response_record(struct subnet_record **ppsubrec, uint16 id); +BOOL is_refresh_already_queued(struct subnet_record *subrec, struct name_record *namerec); /*The following definitions come from nmbd_sendannounce.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index 9c55e3f8be..9a7278069d 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -27,11 +27,6 @@ #define BUFFER_SIZE (0xFFFF) #define SAFETY_MARGIN 1024 -/* Default size of shared memory used for share mode locking */ -#ifndef SHMEM_SIZE -#define SHMEM_SIZE 102400 -#endif - #define NMB_PORT 137 #define DGRAM_PORT 138 #define SMB_PORT 139 -- cgit From 5546e28e69b1a43dbb48e024e233d8ebf7fa667a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 7 Feb 1998 12:15:20 +0000 Subject: A small raft of changes, I will sync up with 1.9.18 also. chgpasswd.c: Fixed typo in debug message. includes.h: Fix include for aix. kanji.c: Added cap_to_sj as inverse of sj_to_cap. loadparm.c: local.h: password.c: Added code for "networkstation user login" parameter. - patch from Rob Nielsen . printing.c: Added further aix printing fixes. reply.c: Changed access time fetch to a function. trans2.c: Changed access time fetch to a function. time.c: Changed access time fetch to a function. server.c: Made NT redirector workaround final. util.c: Added debug for write_socket failing. Jeremy. (This used to be commit a031404623c22d62f8de035be2239f609af08112) --- source3/include/includes.h | 5 ++++- source3/include/local.h | 12 +----------- source3/include/proto.h | 2 ++ 3 files changed, 7 insertions(+), 12 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 218ce19955..f9c29fd41d 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -552,9 +552,12 @@ char *mktemp(char *); /* No standard include */ #include #include #include +/* According to AIX 4.1 man pages, inet_ntoa needs the following headers */ +#include +#include +#include #include #include -#include /* needed for inet_ntoa proto */ #define SYSV #define USE_WAITPID #define USE_SIGBLOCK diff --git a/source3/include/local.h b/source3/include/local.h index 0e2a927d2e..b2a8f5ec57 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -17,16 +17,6 @@ refer to the special "printers" service */ #define PRINTERS_NAME "printers" -/* this affects server level security. With this set (recommended) - samba will do a full NetWkstaUserLogon to confirm that the client - really should have login rights. This can cause problems with - machines in trust relationships in which case you can disable it - here, but be warned, we have heard that some NT machines will then - allow anyone in with any password! Make sure you test it. */ -#ifndef USE_NETWKSTAUSERLOGON -#define USE_NETWKSTAUSERLOGON 1 -#endif - /* define what facility to use for syslog */ #ifndef SYSLOG_FACILITY #define SYSLOG_FACILITY LOG_DAEMON @@ -37,7 +27,7 @@ MAX_CONNECTIONS services, but any number of machines may connect at one time. */ #define MAX_CONNECTIONS 127 -#define MAX_OPEN_FILES 100 +#define MAX_OPEN_FILES 10 /* Default size of shared memory used for share mode locking */ #ifndef SHMEM_SIZE diff --git a/source3/include/proto.h b/source3/include/proto.h index fd31db7e62..7f6321c869 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -279,6 +279,7 @@ BOOL lp_unix_realname(void); BOOL lp_nis_home_map(void); BOOL lp_time_server(void); BOOL lp_bind_interfaces_only(void); +BOOL lp_net_wksta_user_logon(void); int lp_os_level(void); int lp_max_ttl(void); int lp_max_wins_ttl(void); @@ -1340,6 +1341,7 @@ time_t make_unix_date2(void *date_ptr); time_t make_unix_date3(void *date_ptr); char *timestring(void ); time_t get_create_time(struct stat *st); +time_t get_access_time(struct stat *st); /*The following definitions come from trans2.c */ -- cgit From 99e11e171e40703271ad2a7934708cee66b0bb82 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 11 Feb 1998 11:07:14 +0000 Subject: Makefile: Added AIX 3.2.5. loadparm.c: Added "win95 bug compatibility" parameter. local.h: Replaced MAX_OPEN_FILES back to 100 from 10 (oops). reply.c: Fixed ulogoff check against uid - changed to vuid. server.c: Changed file struct save of uid - changed to vuid. smb.h: Changed id in struct current_user to vuid. Changed file struct uid to vuid. time.c: Added "win95 bug compatibility" atime -> mtime return. trans2.c: Added "win95 bug compatibility" fixes. uid.c: Changed id in struct current_user to vuid - added checks to set/reset it. util.c: Added code to expand environment variables. version.h : still at 1.9.18 (head branch doesn't matter too much at present). Jeremy. (This used to be commit adc903bcf59ad1664babd7f1d43675d3a75bfbc9) --- source3/include/local.h | 2 +- source3/include/proto.h | 1 + source3/include/smb.h | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index b2a8f5ec57..22862a9a1f 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -27,7 +27,7 @@ MAX_CONNECTIONS services, but any number of machines may connect at one time. */ #define MAX_CONNECTIONS 127 -#define MAX_OPEN_FILES 10 +#define MAX_OPEN_FILES 100 /* Default size of shared memory used for share mode locking */ #ifndef SHMEM_SIZE diff --git a/source3/include/proto.h b/source3/include/proto.h index 7f6321c869..306d3a42a0 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -280,6 +280,7 @@ BOOL lp_nis_home_map(void); BOOL lp_time_server(void); BOOL lp_bind_interfaces_only(void); BOOL lp_net_wksta_user_logon(void); +BOOL lp_win95_bug_compatibility(void); int lp_os_level(void); int lp_max_ttl(void); int lp_max_wins_ttl(void); diff --git a/source3/include/smb.h b/source3/include/smb.h index 9a7278069d..77f4006c4a 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1366,7 +1366,7 @@ struct cli_state { struct current_user { - int cnum, id; + int cnum, vuid; int uid, gid; int ngroups; gid_t *groups; @@ -1424,7 +1424,7 @@ typedef struct int pos; uint32 size; int mode; - int uid; + int vuid; char *mmap_ptr; uint32 mmap_size; write_bmpx_struct *wbmpx_ptr; -- cgit From 2beada804a238534628398f62fe4ed9e8d2c3efd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 13 Feb 1998 07:11:58 +0000 Subject: Ding-dong the witch is dead, the witch is dead...... This is the checkin that fixes the infamous Visual C++ 'file has changed' bug. I feel *SO* good about that :-). charset.c: Added (void) to fix Herb's fussy compiler. loadparm.c: Removed "win95 bug compatibility" (didn't like it much anyway :-). Added "dos filetime resolution" instead. reply.c: Added the 2 second timestamp resolution fix that the song above is about. time.c: Removed unneeded get_access_time() function. trans2.c : Removed unneeded "win95 bug compatibility" code. Jeremy. (This used to be commit 10d628e4aeaecc573de27e251fec7b91844cba40) --- source3/include/proto.h | 5 ++--- source3/include/version.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 306d3a42a0..97017e77b0 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -36,7 +36,7 @@ void interpret_character_set(char *str); /*The following definitions come from charset.c */ -void charset_initialise(); +void charset_initialise(void); void codepage_initialise(int client_codepage); void add_char_string(char *s); @@ -280,7 +280,6 @@ BOOL lp_nis_home_map(void); BOOL lp_time_server(void); BOOL lp_bind_interfaces_only(void); BOOL lp_net_wksta_user_logon(void); -BOOL lp_win95_bug_compatibility(void); int lp_os_level(void); int lp_max_ttl(void); int lp_max_wins_ttl(void); @@ -370,6 +369,7 @@ BOOL lp_delete_readonly(int ); BOOL lp_fake_oplocks(int ); BOOL lp_recursive_veto_delete(int ); BOOL lp_dos_filetimes(int ); +BOOL lp_dos_filetime_resolution(int ); int lp_create_mode(int ); int lp_force_create_mode(int ); int lp_dir_mode(int ); @@ -1342,7 +1342,6 @@ time_t make_unix_date2(void *date_ptr); time_t make_unix_date3(void *date_ptr); char *timestring(void ); time_t get_create_time(struct stat *st); -time_t get_access_time(struct stat *st); /*The following definitions come from trans2.c */ diff --git a/source3/include/version.h b/source3/include/version.h index 2b6537a173..758b32209e 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.18" +#define VERSION "1.9.18-HEAD" -- cgit From c16d4aec00230983973be3b827d1209f5db65d9c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 20 Feb 1998 19:48:01 +0000 Subject: nmbd_packets.c: nmbd_subnetdb.c: Patch from Andrey Alekseyev to fix the fact that retransmit_or_expire_response_records() wasn't looking at the WINS subnet. server.c: Patch from jkf@soton.ac.uk to add %p (NIS server path) substitution. smbpass.c: Fix to stop parsing failing on non-valid lines. trans2.c: Fix for volume serial number code. util.c: Patch from jkf@soton.ac.uk to add %p (NIS server path) substitution. Fix for warnings under RH5. gcc 2.8. Jeremy. (This used to be commit e58ab3bbe6e939ba678ad5482e58e0191c8dcbcb) --- source3/include/proto.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 97017e77b0..a5a7ceec69 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -743,6 +743,7 @@ void write_browse_list(time_t t, BOOL force_write); BOOL create_subnets(); BOOL we_are_a_wins_client(); struct subnet_record *get_next_subnet_maybe_unicast(struct subnet_record *subrec); +struct subnet_record *get_next_subnet_maybe_unicast_or_wins_server(struct subnet_record *subrec); /*The following definitions come from nmbd_winsproxy.c */ @@ -1485,6 +1486,7 @@ void reset_globals_after_fork(); char *client_name(void); char *client_addr(void); char *automount_server(char *user_name); +char *automount_path(char *user_name); void standard_sub_basic(char *str); BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask); int PutUniCode(char *dst,char *src); -- cgit From 4680e65bb5a6da5131135a155573e1d2592ed1b0 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 24 Feb 1998 20:05:39 +0000 Subject: Fixed bug reported by Janne.Harju@nmp.nokia.com. When used in broadcast only mode nmbd was not reporting WORKGROUP<0> and WORKGROUP<1e> names to a unicast node status query (although it was registering these names on the network). Also tidied up code in nmbd_mynames.c so that all known IP addresses are registered in the unicast subnet in this case rather than just the first, as was previously done. Jeremy. (This used to be commit eb71c5edcbb983ed4a1b0f57139bd66b671c67fa) --- source3/include/proto.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index a5a7ceec69..6f8edb445e 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -483,6 +483,8 @@ void add_domain_names(time_t t); /*The following definitions come from nmbd_become_lmb.c */ +void insert_permanent_name_into_unicast( struct subnet_record *subrec, + struct nmb_name *nmbname, uint16 nb_type ); void unbecome_local_master_success(struct subnet_record *subrec, struct userdata_struct *userdata, struct nmb_name *released_name, -- cgit From de3badf479eb08c19d4abc0625488effc79dc1fd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 26 Feb 1998 19:53:55 +0000 Subject: Fix for NT redirector bug where deltree fails if the resume key indexes are changed between directory scans. This fix does what NT4.x SP3 does in that it stops using resume keys and returns zero instead. We now use the filename in findnext to continue the search in the correct place (as NT does). Jeremy. (This used to be commit b813fb22c4c1b0ee48667e99e82434d20266bbf2) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 6f8edb445e..802d9973df 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -164,7 +164,7 @@ int dptr_create(int cnum,char *path, BOOL expect_close,int pid); BOOL dptr_fill(char *buf1,unsigned int key); BOOL dptr_zero(char *buf); void *dptr_fetch(char *buf,int *num); -void *dptr_fetch_lanman2(char *params,int dptr_num); +void *dptr_fetch_lanman2(int dptr_num); BOOL dir_check_ftype(int cnum,int mode,struct stat *st,int dirtype); BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend); void *OpenDir(int cnum, char *name, BOOL use_veto); -- cgit From 45dab9f06594777e96be5f4556e6bb386f68f309 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 26 Feb 1998 22:58:21 +0000 Subject: Makefile, password.c, includes.h: Added KRB4 patches from Johan Hedin nmbd_packets.c: Patch for aliased interfaces from Daniel Haun . Jeremy. (This used to be commit 60f6302b1972e49159bf6e1a838e691268e4399c) --- source3/include/includes.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index f9c29fd41d..94bf23cef5 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -299,9 +299,9 @@ typedef unsigned short mode_t; #include #include #include -#ifndef USE_LIBDES +#if !defined(USE_LIBDES) && !defined(KRB4_AUTH) #include -#endif /* USE_LIBDES */ +#endif /* !USE_LIBDES && !KRB4_AUTH */ extern int gettimeofday (struct timeval *, void *); extern int gethostname (char *name, int namelen); extern int innetgr (const char *, const char *, const char *, const char *); @@ -1140,6 +1140,10 @@ union semun { #include #endif +#ifdef KRB4_AUTH +#include +#endif + #ifdef NO_UTIMBUF struct utimbuf { time_t actime; -- cgit From b7fb6c6b38784d25c9c85e9b27b08e30111dbd0c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 3 Mar 1998 20:19:14 +0000 Subject: Change the multibyte character set support so that Kanji support is one case of multibyte character support, rather than being a specific case in single byte character support. This allows us to add Big5 Chinese support (code page 950) and Korean Hangul support (code page 949) at very little cost. Also allows us to easily add future multibyte code pages. Makefile: Added codepages 949, 950 as we now support more multibyte codepages. asyncdns.c: Fixed problem with child being re-spawned when parent killed. charcnv.c charset.c client.c clitar.c kanji.c kanji.h smb.h util.c loadparm.c: Generic multibyte codepage support (adding Big5 Chinese and Korean Hangul). nmbd.c: Fixed problem with child being re-spawned when parent killed. mangle.c: Modified str_checksum so that first 15 characters have more effect on outcome. This helps with short name mangling as most 'long' names are still shorter than 15 chars (bug was foobar_mng and foobar_sum would hash to the same value, with the modified code they hash differently. Jeremy. (This used to be commit 299016338cfb47f0c585875ef9b468121fcee97d) --- source3/include/kanji.h | 34 +++++++++++++++++++++++----------- source3/include/proto.h | 9 ++++----- source3/include/smb.h | 5 ++++- 3 files changed, 31 insertions(+), 17 deletions(-) (limited to 'source3/include') diff --git a/source3/include/kanji.h b/source3/include/kanji.h index 101b98cfa3..302db13a27 100644 --- a/source3/include/kanji.h +++ b/source3/include/kanji.h @@ -103,10 +103,13 @@ #define bin2hex(x) \ ( (((int) (x)) >= 10)? (((int) (x))-10 + (int) 'a'): (((int) (x)) + (int) '0') ) -#else /* not _KANJI_C_ */ +/* For Hangul (Korean - code page 949). */ +#define is_hangul(c) ((0x81 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0xfd)) -extern char *(*_dos_to_unix)(char *str, BOOL overwrite); -extern char *(*_unix_to_dos)(char *str, BOOL overwrite); +/* For traditional Chinese (known as Big5 encoding - code page 950). */ +#define is_big5_c1(c) ((0xa1 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0xf9)) + +#else /* not _KANJI_C_ */ /* * The following is needed for AIX systems that have @@ -130,12 +133,24 @@ extern char *(*_unix_to_dos)(char *str, BOOL overwrite); #undef strtok #endif /* strtok */ -/* Ensure we use our definitions. */ +/* Ensure we use our definitions in all other files than kanji.c. */ -#define strchr sj_strchr -#define strrchr sj_strrchr -#define strstr sj_strstr -#define strtok sj_strtok +/* Function pointers we will replace. */ +extern char *(*multibyte_strchr)(char *s, int c); +extern char *(*multibyte_strrchr)(char *s, int c); +extern char *(*multibyte_strstr)(char *s1, char *s2); +extern char *(*multibyte_strtok)(char *s1, char *s2); +extern char *(*_dos_to_unix)(char *str, BOOL overwrite); +extern char *(*_unix_to_dos)(char *str, BOOL overwrite); +extern BOOL (*is_multibyte_char)(char c); + +#define strchr(s1, c) ((*multibyte_strchr)((s1), (c))) +#define strrchr(s1, c) ((*multibyte_strrchr)((s1), (c))) +#define strstr(s1, s2) ((*multibyte_strstr)((s1), (s2))) +#define strtok(s1, s2) ((*multibyte_strtok)((s1), (s2))) +#define dos_to_unix(x,y) ((*_dos_to_unix)((x), (y))) +#define unix_to_dos(x,y) ((*_unix_to_dos)((x), (y))) +#define skip_multibyte_char(c) ((*is_multibyte_char)((c))) #endif /* _KANJI_C_ */ @@ -149,7 +164,4 @@ extern char *(*_unix_to_dos)(char *str, BOOL overwrite); #define CAP_CODE (6) #define DOSV_CODE SJIS_CODE -#define unix_to_dos(x,y) unix2dos_format(x,y) -#define dos_to_unix(x,y) dos2unix_format(x,y) - #endif /* _KANJI_H_ */ diff --git a/source3/include/proto.h b/source3/include/proto.h index 802d9973df..47ef5812ca 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -9,12 +9,14 @@ BOOL allow_access(char *deny_list,char *allow_list,char *cname,char *caddr); /*The following definitions come from asyncdns.c */ int asyncdns_fd(void); +void kill_async_dns_child(); void start_async_dns(void); void run_dns_queue(void); BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question, struct name_record **n); BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question, struct name_record **n); +void kill_async_dns_child(); /*The following definitions come from cgi.c */ @@ -206,11 +208,8 @@ int reply_trans(char *inbuf,char *outbuf, int size, int bufsize); /*The following definitions come from kanji.c */ -char *sj_strtok(char *s1, char *s2); -char *sj_strstr(char *s1, char *s2); -char *sj_strchr (char *s, int c); -char *sj_strrchr(char *s, int c); -int interpret_coding_system(char *str); +void interpret_coding_system(char *str); +void initialize_multibyte_vectors( int client_codepage); /*The following definitions come from loadparm.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index 77f4006c4a..f7a134d797 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -2099,7 +2099,10 @@ enum case_handling {CASE_LOWER,CASE_UPPER}; #endif /* Defines needed for multi-codepage support. */ +#define MSDOS_LATIN_1_CODEPAGE 850 #define KANJI_CODEPAGE 932 +#define HANGUL_CODEPAGE 949 +#define BIG5_CODEPAGE 950 #ifdef KANJI /* @@ -2110,7 +2113,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER}; /* * Default client code page - 850 - Western European */ -#define DEFAULT_CLIENT_CODE_PAGE 850 +#define DEFAULT_CLIENT_CODE_PAGE MSDOS_LATIN_1_CODEPAGE #endif /* KANJI */ /* -- cgit From 35d67dd80aa3ba72b75683cb1f35c81066e21223 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 8 Mar 1998 14:14:49 +0000 Subject: Jeremy is going to hate me ... These are some hacks on SWAT. Maybe users will actually be able to work out how to use it now. Unfortunately these changes required some editing in loadparm.c and smb.h which will make Jeremys merge job harder. Sorry! (This used to be commit 674c88a6bf4c8009769a482c53f105efdc54bbc8) --- source3/include/proto.h | 5 +++-- source3/include/smb.h | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 47ef5812ca..06b2d4ec78 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -29,6 +29,7 @@ char *urlquote(char *s); char *quotequotes(char *s); void quote_spaces(char *buf); void cgi_setup(char *rootdir); +char *cgi_baseurl(void); /*The following definitions come from charcnv.c */ @@ -382,9 +383,9 @@ BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir); int lp_add_service(char *pszService, int iDefaultService); BOOL lp_add_printer(char *pszPrintername, int iDefaultService); BOOL lp_file_list_changed(void); +void *lp_local_ptr(int snum, void *ptr); BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue); -int lp_next_parameter(int snum, int *i, char *label, - char *value, int allparameters); +struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters); BOOL lp_snum_ok(int iService); BOOL lp_loaded(void); void lp_killunused(BOOL (*snumused)(int )); diff --git a/source3/include/smb.h b/source3/include/smb.h index f7a134d797..ccb3b0424a 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1643,6 +1643,39 @@ struct connection_options { uint16 serverzone; }; +/* the following are used by loadparm for option lists */ +typedef enum +{ + P_BOOL,P_BOOLREV,P_CHAR,P_INTEGER,P_OCTAL, + P_STRING,P_USTRING,P_GSTRING,P_UGSTRING,P_ENUM +} parm_type; + +typedef enum +{ + P_LOCAL,P_GLOBAL,P_NONE +} parm_class; + +struct enum_list { + int value; + char *name; +}; + +struct parm_struct +{ + char *label; + parm_type type; + parm_class class; + void *ptr; + BOOL (*special)(); + struct enum_list *enum_list; + unsigned flags; +}; + + +#define FLAG_BASIC 1 +#define FLAG_HIDE 2 +#define FLAG_PRINT 4 + #ifndef LOCKING_VERSION #define LOCKING_VERSION 4 #endif /* LOCKING_VERSION */ -- cgit From 6a37b245e3894c5a3a62bf38d4eef27be5f209e8 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 8 Mar 1998 14:31:50 +0000 Subject: allow for non-authenticated SWAT for demo purposes (This used to be commit 6e1237568b559c006ee5429308ac47e97cc4a1c4) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 06b2d4ec78..f0591743c0 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -28,7 +28,7 @@ char *quotedup(char *s); char *urlquote(char *s); char *quotequotes(char *s); void quote_spaces(char *buf); -void cgi_setup(char *rootdir); +void cgi_setup(char *rootdir, int auth_required); char *cgi_baseurl(void); /*The following definitions come from charcnv.c */ -- cgit From fdeea341ed1bae670382e45eb731db1b5838ad21 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 11 Mar 1998 21:11:04 +0000 Subject: "For I have laboured mightily on Luke's code, and hath broken all I saw" - the book of Jeremy, chapter 1 :-). So here is the mega-merge of the NTDOM branch server code. It doesn't include the new client side pieces, we'll look at that later. This should give the same functionality, server wise, as the NTDOM branch does, only merged into the main branch. Any fixes to domain controler functionality should be added to the main branch, not the NTDOM branch. This code compiles without warnings on gcc2.8, but will need further testing before we are sure all the working functionality of the NTDOM server branch has been correctly carried over. I hereby declare the server side of the NTDOM branch dead (and all who sail in her :-). Jeremy. (This used to be commit 118ba4d77a33248e762a2cf843fb7cbc906ee6e7) --- source3/include/ntdomain.h | 127 +++++ source3/include/nterr.h | 1 + source3/include/proto.h | 960 +++++++++++++++++++++++----------- source3/include/rpc_dce.h | 211 ++++++++ source3/include/rpc_lsa.h | 288 +++++++++++ source3/include/rpc_misc.h | 272 ++++++++++ source3/include/rpc_netlogon.h | 372 ++++++++++++++ source3/include/rpc_reg.h | 141 +++++ source3/include/rpc_samr.h | 1023 ++++++++++++++++++++++++++++++++++++ source3/include/rpc_srvsvc.h | 540 +++++++++++++++++++ source3/include/rpc_wkssvc.h | 73 +++ source3/include/smb.h | 1114 ++-------------------------------------- 12 files changed, 3766 insertions(+), 1356 deletions(-) create mode 100644 source3/include/ntdomain.h create mode 100644 source3/include/rpc_dce.h create mode 100644 source3/include/rpc_lsa.h create mode 100644 source3/include/rpc_misc.h create mode 100644 source3/include/rpc_netlogon.h create mode 100644 source3/include/rpc_reg.h create mode 100644 source3/include/rpc_samr.h create mode 100644 source3/include/rpc_srvsvc.h create mode 100644 source3/include/rpc_wkssvc.h (limited to 'source3/include') diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h new file mode 100644 index 0000000000..32812aa8b1 --- /dev/null +++ b/source3/include/ntdomain.h @@ -0,0 +1,127 @@ +/* + Unix SMB/Netbios implementation. + Version 1.9. + SMB parameters and setup + Copyright (C) Andrew Tridgell 1992-1997 + Copyright (C) Luke Kenneth Casson Leighton 1996-1997 + Copyright (C) Paul Ashton 1997 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _NT_DOMAIN_H /* _NT_DOMAIN_H */ +#define _NT_DOMAIN_H + + +/* dce/rpc support */ +#include "lib/rpc/include/rpc_dce.h" + +/* miscellaneous structures / defines */ +#include "lib/rpc/include/rpc_misc.h" + +/* different dce/rpc pipes */ +#include "lib/rpc/include/rpc_lsa.h" +#include "lib/rpc/include/rpc_netlogon.h" +#include "lib/rpc/include/rpc_reg.h" +#include "lib/rpc/include/rpc_samr.h" +#include "lib/rpc/include/rpc_srvsvc.h" +#include "lib/rpc/include/rpc_wkssvc.h" + +/* + * A bunch of stuff that was put into smb.h + * in the NTDOM branch - it didn't belong there. + */ + +typedef struct +{ + struct mem_buf *data; /* memory buffer */ + uint32 offset; /* offset currently being accessed in memory buffer */ + uint8 align; /* data alignment */ + BOOL io; /* parsing in or out of data stream */ + +} prs_struct; + +typedef struct +{ + int cnum; + int uid; + BOOL open; /* open connection */ + uint16 device_state; + fstring name; + fstring pipe_srv_name; + + prs_struct rhdr; /* output header */ + prs_struct rdata; /* output data */ + prs_struct rauth; /* output authentication verifier */ + + RPC_HDR hdr; + RPC_HDR_BA hdr_ba; + RPC_HDR_RB hdr_rb; + RPC_HDR_RR hdr_rr; + + RPC_AUTH_NTLMSSP_REQ ntlmssp_req; + RPC_AUTH_NTLMSSP_RESP ntlmssp_resp; + + uint32 max_rdata_len; + uint32 hdr_offsets; + +} pipes_struct; + +struct acct_info +{ + fstring acct_name; /* account name */ + uint32 smb_userid; /* domain-relative RID */ +}; + +struct api_struct +{ + char *name; + uint8 opnum; + void (*fn) (int uid, prs_struct*, prs_struct*); +}; + +struct mem_desc +{ + /* array memory offsets */ + uint32 start; + uint32 end; +}; + +struct mem_buf +{ + BOOL dynamic; /* True iff data has been dynamically allocated + (and therefore can be freed) */ + char *data; + uint32 data_size; + uint32 data_used; + + uint32 margin; /* safety margin when reallocing. */ + /* this can be abused quite nicely */ + uint8 align; /* alignment of data structures (smb, dce/rpc, udp etc) */ + + struct mem_desc offset; + + struct mem_buf *next; +}; + +typedef struct +{ + uint32 rid; + char *name; + +} rid_name; + +#endif /* _NT_DOMAIN_H */ + diff --git a/source3/include/nterr.h b/source3/include/nterr.h index 92f02612db..643d93bc93 100644 --- a/source3/include/nterr.h +++ b/source3/include/nterr.h @@ -7,6 +7,7 @@ #define NT_STATUS_INVALID_INFO_CLASS (3) #define NT_STATUS_INFO_LENGTH_MISMATCH (4) #define NT_STATUS_ACCESS_VIOLATION (5) +#define STATUS_BUFFER_OVERFLOW (5) #define NT_STATUS_IN_PAGE_ERROR (6) #define NT_STATUS_PAGEFILE_QUOTA (7) #define NT_STATUS_INVALID_HANDLE (8) diff --git a/source3/include/proto.h b/source3/include/proto.h index f0591743c0..19274157c6 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -212,6 +212,651 @@ int reply_trans(char *inbuf,char *outbuf, int size, int bufsize); void interpret_coding_system(char *str); void initialize_multibyte_vectors( int client_codepage); +/*The following definitions come from lib/rpc/parse/parse_lsa.c */ + +void make_lsa_trans_name(LSA_TRANS_NAME *trn, uint32 sid_name_use, char *name, uint32 idx); +void lsa_io_trans_name(char *desc, LSA_TRANS_NAME *trn, prs_struct *ps, int depth); +void lsa_io_dom_r_ref(char *desc, DOM_R_REF *r_r, prs_struct *ps, int depth); +void make_lsa_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, uint32 sec_qos); +void lsa_io_obj_attr(char *desc, LSA_OBJ_ATTR *attr, prs_struct *ps, int depth); +void make_q_open_pol(LSA_Q_OPEN_POL *r_q, char *server_name, + uint32 attributes, uint32 sec_qos, + uint32 desired_access); +void lsa_io_q_open_pol(char *desc, LSA_Q_OPEN_POL *r_q, prs_struct *ps, int depth); +void lsa_io_r_open_pol(char *desc, LSA_R_OPEN_POL *r_p, prs_struct *ps, int depth); +void make_q_query(LSA_Q_QUERY_INFO *q_q, POLICY_HND *hnd, uint16 info_class); +void lsa_io_q_query(char *desc, LSA_Q_QUERY_INFO *q_q, prs_struct *ps, int depth); +void lsa_io_q_enum_trust_dom(char *desc, LSA_Q_ENUM_TRUST_DOM *q_e, prs_struct *ps, int depth); +void make_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM *r_e, + uint32 enum_context, char *domain_name, char *domain_sid, + uint32 status); +void lsa_io_r_enum_trust_dom(char *desc, LSA_R_ENUM_TRUST_DOM *r_e, prs_struct *ps, int depth); +void make_lsa_q_close(LSA_Q_CLOSE *q_c, POLICY_HND *hnd); +void lsa_io_q_close(char *desc, LSA_Q_CLOSE *q_c, prs_struct *ps, int depth); +void make_lsa_r_close(LSA_R_CLOSE *q_r, POLICY_HND *hnd); +void lsa_io_r_close(char *desc, LSA_R_CLOSE *r_c, prs_struct *ps, int depth); +void lsa_io_r_query(char *desc, LSA_R_QUERY_INFO *r_q, prs_struct *ps, int depth); +void lsa_io_sid_enum(char *desc, LSA_SID_ENUM *sen, prs_struct *ps, int depth); +void lsa_io_q_lookup_sids(char *desc, LSA_Q_LOOKUP_SIDS *q_s, prs_struct *ps, int depth); +void lsa_io_trans_names(char *desc, LSA_TRANS_NAME_ENUM *trn, prs_struct *ps, int depth); +void lsa_io_r_lookup_sids(char *desc, LSA_R_LOOKUP_SIDS *r_s, prs_struct *ps, int depth); +void lsa_io_q_lookup_rids(char *desc, LSA_Q_LOOKUP_RIDS *q_r, prs_struct *ps, int depth); +void lsa_io_r_lookup_rids(char *desc, LSA_R_LOOKUP_RIDS *r_r, prs_struct *ps, int depth); + +/*The following definitions come from lib/rpc/parse/parse_misc.c */ + +void smb_io_utime(char *desc, UTIME *t, prs_struct *ps, int depth); +void smb_io_time(char *desc, NTTIME *nttime, prs_struct *ps, int depth); +void smb_io_lookup_level(char *desc, LOOKUP_LEVEL *level, prs_struct *ps, int depth); +uint32 get_enum_hnd(ENUM_HND *enh); +void make_enum_hnd(ENUM_HND *enh, uint32 hnd); +void smb_io_enum_hnd(char *desc, ENUM_HND *hnd, prs_struct *ps, int depth); +void make_dom_sid(DOM_SID *sid, char *str_sid); +void smb_io_dom_sid(char *desc, DOM_SID *sid, prs_struct *ps, int depth); +void make_dom_sid2(DOM_SID2 *sid, char *str_sid); +void smb_io_dom_sid2(char *desc, DOM_SID2 *sid, prs_struct *ps, int depth); +void make_str_hdr(STRHDR *hdr, int max_len, int len, uint32 buffer); +void smb_io_strhdr(char *desc, STRHDR *hdr, prs_struct *ps, int depth); +void make_uni_hdr(UNIHDR *hdr, int max_len, int len, uint32 buffer); +void smb_io_unihdr(char *desc, UNIHDR *hdr, prs_struct *ps, int depth); +void make_uni_hdr2(UNIHDR2 *hdr, int max_len, int len, uint16 terminate); +void smb_io_unihdr2(char *desc, UNIHDR2 *hdr2, prs_struct *ps, int depth); +void make_unistr(UNISTR *str, char *buf); +void smb_io_unistr(char *desc, UNISTR *uni, prs_struct *ps, int depth); +void make_uninotstr2(UNINOTSTR2 *str, char *buf, int len); +void smb_io_uninotstr2(char *desc, UNINOTSTR2 *uni2, uint32 buffer, prs_struct *ps, int depth); +void make_buf_unistr2(UNISTR2 *str, uint32 *ptr, char *buf); +void copy_unistr2(UNISTR2 *str, UNISTR2 *from); +void make_string2(STRING2 *str, char *buf, int len); +void smb_io_string2(char *desc, STRING2 *str2, uint32 buffer, prs_struct *ps, int depth); +void make_unistr2(UNISTR2 *str, char *buf, int len); +void smb_io_unistr2(char *desc, UNISTR2 *uni2, uint32 buffer, prs_struct *ps, int depth); +void make_dom_rid2(DOM_RID2 *rid2, uint32 rid); +void smb_io_dom_rid2(char *desc, DOM_RID2 *rid2, prs_struct *ps, int depth); +void make_dom_rid3(DOM_RID3 *rid3, uint32 rid); +void smb_io_dom_rid3(char *desc, DOM_RID3 *rid3, prs_struct *ps, int depth); +void make_dom_rid4(DOM_RID4 *rid4, uint16 unknown, uint16 attr, uint32 rid); +void smb_io_dom_rid4(char *desc, DOM_RID4 *rid4, prs_struct *ps, int depth); +void make_clnt_srv(DOM_CLNT_SRV *log, char *logon_srv, char *comp_name); +void smb_io_clnt_srv(char *desc, DOM_CLNT_SRV *log, prs_struct *ps, int depth); +void make_log_info(DOM_LOG_INFO *log, char *logon_srv, char *acct_name, + uint16 sec_chan, char *comp_name); +void smb_io_log_info(char *desc, DOM_LOG_INFO *log, prs_struct *ps, int depth); +void smb_io_chal(char *desc, DOM_CHAL *chal, prs_struct *ps, int depth); +void smb_io_cred(char *desc, DOM_CRED *cred, prs_struct *ps, int depth); +void make_clnt_info2(DOM_CLNT_INFO2 *clnt, + char *logon_srv, char *comp_name, + DOM_CRED *clnt_cred); +void smb_io_clnt_info2(char *desc, DOM_CLNT_INFO2 *clnt, prs_struct *ps, int depth); +void make_clnt_info(DOM_CLNT_INFO *clnt, + char *logon_srv, char *acct_name, + uint16 sec_chan, char *comp_name, + DOM_CRED *cred); +void smb_io_clnt_info(char *desc, DOM_CLNT_INFO *clnt, prs_struct *ps, int depth); +void make_logon_id(DOM_LOGON_ID *log, uint32 log_id_low, uint32 log_id_high); +void smb_io_logon_id(char *desc, DOM_LOGON_ID *log, prs_struct *ps, int depth); +void make_arc4_owf(ARC4_OWF *hash, uint8 data[16]); +void smb_io_arc4_owf(char *desc, ARC4_OWF *hash, prs_struct *ps, int depth); +void smb_io_gid(char *desc, DOM_GID *gid, prs_struct *ps, int depth); +void smb_io_pol_hnd(char *desc, POLICY_HND *pol, prs_struct *ps, int depth); +void smb_io_dom_query_3(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth); +void smb_io_dom_query_5(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth); +void smb_io_dom_query(char *desc, DOM_QUERY *d_q, prs_struct *ps, int depth); +void smb_io_dom_name(char *desc, DOM_NAME *name, prs_struct *ps, int depth); + +/*The following definitions come from lib/rpc/parse/parse_net.c */ + +void net_io_neg_flags(char *desc, NEG_FLAGS *neg, prs_struct *ps, int depth); +void make_netinfo_3(NETLOGON_INFO_3 *info, uint32 flags, uint32 logon_attempts); +void net_io_netinfo_3(char *desc, NETLOGON_INFO_3 *info, prs_struct *ps, int depth); +void make_netinfo_1(NETLOGON_INFO_1 *info, uint32 flags, uint32 pdc_status); +void net_io_netinfo_1(char *desc, NETLOGON_INFO_1 *info, prs_struct *ps, int depth); +void make_netinfo_2(NETLOGON_INFO_2 *info, uint32 flags, uint32 pdc_status, + uint32 tc_status, char *trusted_dc_name); +void net_io_netinfo_2(char *desc, NETLOGON_INFO_2 *info, prs_struct *ps, int depth); +void make_q_logon_ctrl2(NET_Q_LOGON_CTRL2 *q_l, char *server_name, + uint32 function_code); +void net_io_q_logon_ctrl2(char *desc, NET_Q_LOGON_CTRL2 *q_l, prs_struct *ps, int depth); +void make_r_logon_ctrl2(NET_R_LOGON_CTRL2 *r_l, uint32 query_level, + uint32 flags, uint32 pdc_status, uint32 logon_attempts, + uint32 tc_status, char *trusted_domain_name); +void net_io_r_logon_ctrl2(char *desc, NET_R_LOGON_CTRL2 *r_l, prs_struct *ps, int depth); +void make_r_trust_dom(NET_R_TRUST_DOM_LIST *r_t, + uint32 num_doms, char *dom_name); +void net_io_r_trust_dom(char *desc, NET_R_TRUST_DOM_LIST *r_t, prs_struct *ps, int depth); +void make_q_trust_dom(NET_Q_TRUST_DOM_LIST *q_l, char *server_name, + uint32 function_code); +void net_io_q_trust_dom(char *desc, NET_Q_TRUST_DOM_LIST *q_l, prs_struct *ps, int depth); +void make_q_req_chal(NET_Q_REQ_CHAL *q_c, + char *logon_srv, char *logon_clnt, + DOM_CHAL *clnt_chal); +void net_io_q_req_chal(char *desc, NET_Q_REQ_CHAL *q_c, prs_struct *ps, int depth); +void net_io_r_req_chal(char *desc, NET_R_REQ_CHAL *r_c, prs_struct *ps, int depth); +void make_q_auth_2(NET_Q_AUTH_2 *q_a, + char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name, + DOM_CHAL *clnt_chal, uint32 clnt_flgs); +void net_io_q_auth_2(char *desc, NET_Q_AUTH_2 *q_a, prs_struct *ps, int depth); +void net_io_r_auth_2(char *desc, NET_R_AUTH_2 *r_a, prs_struct *ps, int depth); +void make_q_srv_pwset(NET_Q_SRV_PWSET *q_s, char sess_key[16], + char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name, + DOM_CRED *cred, char nt_cypher[16]); +void net_io_q_srv_pwset(char *desc, NET_Q_SRV_PWSET *q_s, prs_struct *ps, int depth); +void net_io_r_srv_pwset(char *desc, NET_R_SRV_PWSET *r_s, prs_struct *ps, int depth); +void make_id_info1(NET_ID_INFO_1 *id, char *domain_name, + uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high, + char *user_name, char *wksta_name, + char sess_key[16], + unsigned char lm_cypher[16], unsigned char nt_cypher[16]); +void net_io_id_info1(char *desc, NET_ID_INFO_1 *id, prs_struct *ps, int depth); +void make_id_info2(NET_ID_INFO_2 *id, char *domain_name, + uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high, + char *user_name, char *wksta_name, + unsigned char lm_challenge[8], + unsigned char lm_chal_resp[24], + unsigned char nt_chal_resp[24]); +void net_io_id_info2(char *desc, NET_ID_INFO_2 *id, prs_struct *ps, int depth); +void make_sam_info(DOM_SAM_INFO *sam, + char *logon_srv, char *comp_name, DOM_CRED *clnt_cred, + DOM_CRED *rtn_cred, uint16 logon_level, + NET_ID_INFO_CTR *ctr, uint16 validation_level); +void net_io_id_info_ctr(char *desc, NET_ID_INFO_CTR *ctr, prs_struct *ps, int depth); +void smb_io_sam_info(char *desc, DOM_SAM_INFO *sam, prs_struct *ps, int depth); +void make_net_user_info3(NET_USER_INFO_3 *usr, + + NTTIME *logon_time, + NTTIME *logoff_time, + NTTIME *kickoff_time, + NTTIME *pass_last_set_time, + NTTIME *pass_can_change_time, + NTTIME *pass_must_change_time, + + char *user_name, + char *full_name, + char *logon_script, + char *profile_path, + char *home_dir, + char *dir_drive, + + uint16 logon_count, + uint16 bad_pw_count, + + uint32 user_id, + uint32 group_id, + uint32 num_groups, + DOM_GID *gids, + uint32 user_flgs, + + char sess_key[16], + + char *logon_srv, + char *logon_dom, + + char *dom_sid, + char *other_sids); +void net_io_user_info3(char *desc, NET_USER_INFO_3 *usr, prs_struct *ps, int depth); +void net_io_q_sam_logon(char *desc, NET_Q_SAM_LOGON *q_l, prs_struct *ps, int depth); +void net_io_r_sam_logon(char *desc, NET_R_SAM_LOGON *r_l, prs_struct *ps, int depth); +void net_io_q_sam_logoff(char *desc, NET_Q_SAM_LOGOFF *q_l, prs_struct *ps, int depth); +void net_io_r_sam_logoff(char *desc, NET_R_SAM_LOGOFF *r_l, prs_struct *ps, int depth); + +/*The following definitions come from lib/rpc/parse/parse_prs.c */ + +void prs_debug(prs_struct *ps, int depth, char *desc, char *fn_name); +void prs_init(prs_struct *ps, uint32 size, + uint8 align, uint32 margin, + BOOL io); +void prs_mem_free(prs_struct *ps); +void prs_align(prs_struct *ps); +BOOL prs_grow(prs_struct *ps); +BOOL prs_uint8(char *name, prs_struct *ps, int depth, uint8 *data8); +BOOL prs_uint16(char *name, prs_struct *ps, int depth, uint16 *data16); +BOOL prs_uint32(char *name, prs_struct *ps, int depth, uint32 *data32); +BOOL prs_uint8s(BOOL charmode, char *name, prs_struct *ps, int depth, uint8 *data8s, int len); +BOOL prs_uint16s(BOOL charmode, char *name, prs_struct *ps, int depth, uint16 *data16s, int len); +BOOL prs_uint32s(BOOL charmode, char *name, prs_struct *ps, int depth, uint32 *data32s, int len); +BOOL prs_uninotstr2(BOOL charmode, char *name, prs_struct *ps, int depth, UNINOTSTR2 *str); +BOOL prs_string2(BOOL charmode, char *name, prs_struct *ps, int depth, STRING2 *str); +BOOL prs_unistr2(BOOL charmode, char *name, prs_struct *ps, int depth, UNISTR2 *str); +BOOL prs_unistr(char *name, prs_struct *ps, int depth, UNISTR *str); +BOOL prs_string(char *name, prs_struct *ps, int depth, char *str, uint16 len); + +/*The following definitions come from lib/rpc/parse/parse_reg.c */ + +void make_reg_q_open_policy(REG_Q_OPEN_POLICY *r_q, + uint16 unknown_0, uint32 level, uint16 unknown_1); +void reg_io_q_open_policy(char *desc, REG_Q_OPEN_POLICY *r_q, prs_struct *ps, int depth); +void make_reg_r_open_policy(REG_R_OPEN_POLICY *r_r, + POLICY_HND *pol, uint32 status); +void reg_io_r_open_policy(char *desc, REG_R_OPEN_POLICY *r_r, prs_struct *ps, int depth); +void reg_io_q_close(char *desc, REG_Q_CLOSE *q_u, prs_struct *ps, int depth); +void reg_io_r_close(char *desc, REG_R_CLOSE *r_u, prs_struct *ps, int depth); +void make_reg_q_info(REG_Q_INFO *r_q, + POLICY_HND *pol, char *product_type, + NTTIME *prod_time, uint8 major_version, uint8 minor_version, + uint32 unknown); +void reg_io_q_info(char *desc, REG_Q_INFO *r_q, prs_struct *ps, int depth); +void make_reg_r_info(REG_R_INFO *r_r, + uint32 level, char *os_type, + uint32 unknown_0, uint32 unknown_1, + uint32 status); +void reg_io_r_info(char *desc, REG_R_INFO *r_r, prs_struct *ps, int depth); +void make_reg_q_open_entry(REG_Q_OPEN_ENTRY *r_q, + POLICY_HND *pol, char *name, + uint32 unknown_0, uint32 unknown_1, uint16 unknown_2); +void reg_io_q_open_entry(char *desc, REG_Q_OPEN_ENTRY *r_q, prs_struct *ps, int depth); +void make_reg_r_open_entry(REG_R_OPEN_ENTRY *r_r, + POLICY_HND *pol, uint32 status); +void reg_io_r_open_entry(char *desc, REG_R_OPEN_ENTRY *r_r, prs_struct *ps, int depth); + +/*The following definitions come from lib/rpc/parse/parse_rpc.c */ + +void make_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 flags, + uint32 call_id, int data_len, int auth_len); +void smb_io_rpc_hdr(char *desc, RPC_HDR *rpc, prs_struct *ps, int depth); +void make_rpc_iface(RPC_IFACE *ifc, char data[16], uint32 version); +void smb_io_rpc_iface(char *desc, RPC_IFACE *ifc, prs_struct *ps, int depth); +void make_rpc_addr_str(RPC_ADDR_STR *str, char *name); +void smb_io_rpc_addr_str(char *desc, RPC_ADDR_STR *str, prs_struct *ps, int depth); +void make_rpc_hdr_bba(RPC_HDR_BBA *bba, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid); +void smb_io_rpc_hdr_bba(char *desc, RPC_HDR_BBA *rpc, prs_struct *ps, int depth); +void make_rpc_hdr_rb(RPC_HDR_RB *rpc, + uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, + uint32 num_elements, uint16 context_id, uint8 num_syntaxes, + RPC_IFACE *abstract, RPC_IFACE *transfer); +void smb_io_rpc_hdr_rb(char *desc, RPC_HDR_RB *rpc, prs_struct *ps, int depth); +void make_rpc_results(RPC_RESULTS *res, + uint8 num_results, uint16 result, uint16 reason); +void smb_io_rpc_results(char *desc, RPC_RESULTS *res, prs_struct *ps, int depth); +void make_rpc_hdr_ba(RPC_HDR_BA *rpc, + uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, + char *pipe_addr, + uint8 num_results, uint16 result, uint16 reason, + RPC_IFACE *transfer); +void smb_io_rpc_hdr_ba(char *desc, RPC_HDR_BA *rpc, prs_struct *ps, int depth); +void make_rpc_hdr_rr(RPC_HDR_RR *hdr, uint32 data_len, uint8 opnum); +void smb_io_rpc_hdr_rr(char *desc, RPC_HDR_RR *rpc, prs_struct *ps, int depth); +void make_rpc_auth_ntlmssp_req(RPC_AUTH_NTLMSSP_REQ *req, + fstring ntlmssp_str, uint32 ntlmssp_ver, + uint32 unknown_0, fstring myname, fstring domain); +void smb_io_rpc_auth_ntlmssp_req(char *desc, RPC_AUTH_NTLMSSP_REQ *req, prs_struct *ps, int depth); +void make_rpc_auth_ntlmssp_resp(RPC_AUTH_NTLMSSP_RESP *rsp, + uint8 auth_type, uint8 auth_level, uint8 stub_type_len, + fstring ntlmssp_str, uint32 ntlmssp_ver, + uint32 unknown_1, uint32 unknown_2, uint32 unknown_3, + uint8 data[16]); +void smb_io_rpc_auth_ntlmssp_resp(char *desc, RPC_AUTH_NTLMSSP_RESP *rsp, prs_struct *ps, int depth); + +/*The following definitions come from lib/rpc/parse/parse_samr.c */ + +void make_samr_q_close_hnd(SAMR_Q_CLOSE_HND *q_c, POLICY_HND *hnd); +void samr_io_q_close_hnd(char *desc, SAMR_Q_CLOSE_HND *q_u, prs_struct *ps, int depth); +void samr_io_r_close_hnd(char *desc, SAMR_R_CLOSE_HND *r_u, prs_struct *ps, int depth); +void make_samr_q_open_domain(SAMR_Q_OPEN_DOMAIN *q_u, + POLICY_HND *connect_pol, uint32 rid, char *sid); +void samr_io_q_open_domain(char *desc, SAMR_Q_OPEN_DOMAIN *q_u, prs_struct *ps, int depth); +void samr_io_r_open_domain(char *desc, SAMR_R_OPEN_DOMAIN *r_u, prs_struct *ps, int depth); +void make_samr_q_unknown_8(SAMR_Q_UNKNOWN_8 *q_u, + POLICY_HND *domain_pol, uint16 switch_value); +void samr_io_q_unknown_8(char *desc, SAMR_Q_UNKNOWN_8 *q_u, prs_struct *ps, int depth); +void make_samr_q_unknown_3(SAMR_Q_UNKNOWN_3 *q_u, + POLICY_HND *user_pol, uint16 switch_value); +void samr_io_q_unknown_3(char *desc, SAMR_Q_UNKNOWN_3 *q_u, prs_struct *ps, int depth); +void make_dom_sid3(DOM_SID3 *sid3, uint16 unk_0, uint16 unk_1, char *sid); +void sam_io_dom_sid3(char *desc, DOM_SID3 *sid3, prs_struct *ps, int depth); +void make_sam_sid_stuff(SAM_SID_STUFF *stf, + uint16 unknown_2, uint16 unknown_3, + uint32 unknown_4, uint16 unknown_6, uint16 unknown_7, + int num_sid3s, DOM_SID3 sid3[MAX_SAM_SIDS]); +void sam_io_sid_stuff(char *desc, SAM_SID_STUFF *stf, prs_struct *ps, int depth); +void make_samr_r_unknown_3(SAMR_R_UNKNOWN_3 *r_u, + uint16 unknown_2, uint16 unknown_3, + uint32 unknown_4, uint16 unknown_6, uint16 unknown_7, + int num_sid3s, DOM_SID3 sid3[MAX_SAM_SIDS], + uint32 status); +void samr_io_r_unknown_3(char *desc, SAMR_R_UNKNOWN_3 *r_u, prs_struct *ps, int depth); +void make_sam_str1(SAM_STR1 *sam, char *sam_acct, char *sam_name, char *sam_desc); +void sam_io_sam_str1(char *desc, SAM_STR1 *sam, uint32 acct_buf, uint32 name_buf, uint32 desc_buf, prs_struct *ps, int depth); +void make_sam_entry1(SAM_ENTRY1 *sam, uint32 user_idx, + uint32 len_sam_name, uint32 len_sam_full, uint32 len_sam_desc, + uint32 rid_user, uint16 acb_info); +void sam_io_sam_entry1(char *desc, SAM_ENTRY1 *sam, prs_struct *ps, int depth); +void make_sam_str2(SAM_STR2 *sam, char *sam_acct, char *sam_desc); +void sam_io_sam_str2(char *desc, SAM_STR2 *sam, uint32 acct_buf, uint32 desc_buf, prs_struct *ps, int depth); +void make_sam_entry2(SAM_ENTRY2 *sam, uint32 user_idx, + uint32 len_sam_name, uint32 len_sam_desc, + uint32 rid_user, uint16 acb_info); +void sam_io_sam_entry2(char *desc, SAM_ENTRY2 *sam, prs_struct *ps, int depth); +void make_sam_str3(SAM_STR3 *sam, char *grp_acct, char *grp_desc); +void sam_io_sam_str3(char *desc, SAM_STR3 *sam, uint32 acct_buf, uint32 desc_buf, prs_struct *ps, int depth); +void make_sam_entry3(SAM_ENTRY3 *sam, uint32 grp_idx, + uint32 len_grp_name, uint32 len_grp_desc, uint32 rid_grp); +void sam_io_sam_entry3(char *desc, SAM_ENTRY3 *sam, prs_struct *ps, int depth); +void make_sam_entry(SAM_ENTRY *sam, uint32 len_sam_name, uint32 rid); +void sam_io_sam_entry(char *desc, SAM_ENTRY *sam, prs_struct *ps, int depth); +void make_samr_q_enum_dom_users(SAMR_Q_ENUM_DOM_USERS *q_e, POLICY_HND *pol, + uint16 req_num_entries, uint16 unk_0, + uint16 acb_mask, uint16 unk_1, uint32 size); +void samr_io_q_enum_dom_users(char *desc, SAMR_Q_ENUM_DOM_USERS *q_e, prs_struct *ps, int depth); +void make_samr_r_enum_dom_users(SAMR_R_ENUM_DOM_USERS *r_u, + uint16 total_num_entries, uint16 unk_0, + uint32 num_sam_entries, SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES], uint32 status); +void samr_io_r_enum_dom_users(char *desc, SAMR_R_ENUM_DOM_USERS *r_u, prs_struct *ps, int depth); +void make_samr_q_enum_dom_aliases(SAMR_Q_ENUM_DOM_ALIASES *q_e, POLICY_HND *pol, uint32 size); +void samr_io_q_enum_dom_aliases(char *desc, SAMR_Q_ENUM_DOM_ALIASES *q_e, prs_struct *ps, int depth); +void make_samr_r_enum_dom_aliases(SAMR_R_ENUM_DOM_ALIASES *r_u, + uint32 num_sam_entries, SAM_USER_INFO_21 grps[MAX_SAM_ENTRIES], + uint32 status); +void samr_io_r_enum_dom_aliases(char *desc, SAMR_R_ENUM_DOM_ALIASES *r_u, prs_struct *ps, int depth); +void make_samr_q_query_dispinfo(SAMR_Q_QUERY_DISPINFO *q_e, POLICY_HND *pol, + uint16 switch_level, uint32 start_idx, uint32 size); +void samr_io_q_query_dispinfo(char *desc, SAMR_Q_QUERY_DISPINFO *q_e, prs_struct *ps, int depth); +void make_sam_info_2(SAM_INFO_2 *sam, uint32 acb_mask, + uint32 start_idx, uint32 num_sam_entries, + SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]); +void sam_io_sam_info_2(char *desc, SAM_INFO_2 *sam, prs_struct *ps, int depth); +void make_sam_info_1(SAM_INFO_1 *sam, uint32 acb_mask, + uint32 start_idx, uint32 num_sam_entries, + SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]); +void sam_io_sam_info_1(char *desc, SAM_INFO_1 *sam, prs_struct *ps, int depth); +void make_samr_r_query_dispinfo(SAMR_R_QUERY_DISPINFO *r_u, + uint16 switch_level, SAM_INFO_CTR *ctr, uint32 status); +void samr_io_r_query_dispinfo(char *desc, SAMR_R_QUERY_DISPINFO *r_u, prs_struct *ps, int depth); +void make_samr_q_enum_dom_groups(SAMR_Q_ENUM_DOM_GROUPS *q_e, POLICY_HND *pol, + uint16 switch_level, uint32 start_idx, uint32 size); +void samr_io_q_enum_dom_groups(char *desc, SAMR_Q_ENUM_DOM_GROUPS *q_e, prs_struct *ps, int depth); +void make_samr_r_enum_dom_groups(SAMR_R_ENUM_DOM_GROUPS *r_u, + uint32 start_idx, uint32 num_sam_entries, + SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES], + uint32 status); +void samr_io_r_enum_dom_groups(char *desc, SAMR_R_ENUM_DOM_GROUPS *r_u, prs_struct *ps, int depth); +void make_samr_q_query_aliasinfo(SAMR_Q_QUERY_ALIASINFO *q_e, + POLICY_HND *pol, + uint16 switch_level); +void samr_io_q_query_aliasinfo(char *desc, SAMR_Q_QUERY_ALIASINFO *q_e, prs_struct *ps, int depth); +void make_samr_r_query_aliasinfo(SAMR_R_QUERY_ALIASINFO *r_u, + uint16 switch_value, char *acct_desc, + uint32 status); +void samr_io_r_query_aliasinfo(char *desc, SAMR_R_QUERY_ALIASINFO *r_u, prs_struct *ps, int depth); +void samr_io_q_lookup_ids(char *desc, SAMR_Q_LOOKUP_IDS *q_u, prs_struct *ps, int depth); +void make_samr_r_lookup_ids(SAMR_R_LOOKUP_IDS *r_u, + uint32 num_rids, uint32 *rid, uint32 status); +void samr_io_r_lookup_ids(char *desc, SAMR_R_LOOKUP_IDS *r_u, prs_struct *ps, int depth); +void samr_io_q_lookup_names(char *desc, SAMR_Q_LOOKUP_NAMES *q_u, prs_struct *ps, int depth); +void make_samr_r_lookup_names(SAMR_R_LOOKUP_NAMES *r_u, + uint32 num_rids, uint32 *rid, uint32 status); +void samr_io_r_lookup_names(char *desc, SAMR_R_LOOKUP_NAMES *r_u, prs_struct *ps, int depth); +void make_samr_q_unknown_12(SAMR_Q_UNKNOWN_12 *q_u, + POLICY_HND *pol, uint32 rid, + uint32 num_gids, uint32 *gid); +void samr_io_q_unknown_12(char *desc, SAMR_Q_UNKNOWN_12 *q_u, prs_struct *ps, int depth); +void make_samr_r_unknown_12(SAMR_R_UNKNOWN_12 *r_u, + uint32 num_aliases, fstring *als_name, uint32 *num_als_usrs, + uint32 status); +void samr_io_r_unknown_12(char *desc, SAMR_R_UNKNOWN_12 *r_u, prs_struct *ps, int depth); +void make_samr_q_open_user(SAMR_Q_OPEN_USER *q_u, + POLICY_HND *pol, + uint32 unk_0, uint32 rid); +void samr_io_q_open_user(char *desc, SAMR_Q_OPEN_USER *q_u, prs_struct *ps, int depth); +void samr_io_r_open_user(char *desc, SAMR_R_OPEN_USER *r_u, prs_struct *ps, int depth); +void make_samr_q_query_usergroups(SAMR_Q_QUERY_USERGROUPS *q_u, + POLICY_HND *hnd); +void samr_io_q_query_usergroups(char *desc, SAMR_Q_QUERY_USERGROUPS *q_u, prs_struct *ps, int depth); +void make_samr_r_query_usergroups(SAMR_R_QUERY_USERGROUPS *r_u, + uint32 num_gids, DOM_GID *gid, uint32 status); +void samr_io_r_query_usergroups(char *desc, SAMR_R_QUERY_USERGROUPS *r_u, prs_struct *ps, int depth); +void make_samr_q_query_userinfo(SAMR_Q_QUERY_USERINFO *q_u, + POLICY_HND *hnd, uint16 switch_value); +void samr_io_q_query_userinfo(char *desc, SAMR_Q_QUERY_USERINFO *q_u, prs_struct *ps, int depth); +void sam_io_logon_hrs(char *desc, LOGON_HRS *hrs, prs_struct *ps, int depth); +void make_sam_user_info11(SAM_USER_INFO_11 *usr, + NTTIME *expiry, + char *mach_acct, + uint32 rid_user, + uint32 rid_group, + uint16 acct_ctrl); +void sam_io_user_info11(char *desc, SAM_USER_INFO_11 *usr, prs_struct *ps, int depth); +void make_sam_user_info21(SAM_USER_INFO_21 *usr, + + NTTIME *logon_time, + NTTIME *logoff_time, + NTTIME *kickoff_time, + NTTIME *pass_last_set_time, + NTTIME *pass_can_change_time, + NTTIME *pass_must_change_time, + + char *user_name, + char *full_name, + char *home_dir, + char *dir_drive, + char *logon_script, + char *profile_path, + char *description, + char *workstations, + char *unknown_str, + char *munged_dial, + + uint32 user_rid, + uint32 group_rid, + uint16 acb_info, + + uint32 unknown_3, + uint16 logon_divs, + LOGON_HRS *hrs, + uint32 unknown_5, + uint32 unknown_6); +void sam_io_user_info21(char *desc, SAM_USER_INFO_21 *usr, prs_struct *ps, int depth); +void make_samr_r_query_userinfo(SAMR_R_QUERY_USERINFO *r_u, + uint16 switch_value, void *info, uint32 status); +void samr_io_r_query_userinfo(char *desc, SAMR_R_QUERY_USERINFO *r_u, prs_struct *ps, int depth); +void make_samr_q_unknown_21(SAMR_Q_UNKNOWN_21 *q_c, + POLICY_HND *hnd, uint16 unk_1, uint16 unk_2); +void samr_io_q_unknown_21(char *desc, SAMR_Q_UNKNOWN_21 *q_u, prs_struct *ps, int depth); +void make_samr_q_unknown_13(SAMR_Q_UNKNOWN_13 *q_c, + POLICY_HND *hnd, uint16 unk_1, uint16 unk_2); +void samr_io_q_unknown_13(char *desc, SAMR_Q_UNKNOWN_13 *q_u, prs_struct *ps, int depth); +void samr_io_q_unknown_32(char *desc, SAMR_Q_UNKNOWN_32 *q_u, prs_struct *ps, int depth); +void samr_io_r_unknown_32(char *desc, SAMR_R_UNKNOWN_32 *r_u, prs_struct *ps, int depth); +void make_samr_q_connect(SAMR_Q_CONNECT *q_u, + char *srv_name, uint32 unknown_0); +void samr_io_q_connect(char *desc, SAMR_Q_CONNECT *q_u, prs_struct *ps, int depth); +void samr_io_r_connect(char *desc, SAMR_R_CONNECT *r_u, prs_struct *ps, int depth); +void make_samr_q_open_alias(SAMR_Q_OPEN_ALIAS *q_u, + uint32 unknown_0, uint32 rid); +void samr_io_q_open_alias(char *desc, SAMR_Q_OPEN_ALIAS *q_u, prs_struct *ps, int depth); +void samr_io_r_open_alias(char *desc, SAMR_R_OPEN_ALIAS *r_u, prs_struct *ps, int depth); +void make_samr_q_unknown_38(SAMR_Q_UNKNOWN_38 *q_u, char *srv_name); +void samr_io_q_unknown_38(char *desc, SAMR_Q_UNKNOWN_38 *q_u, prs_struct *ps, int depth); +void make_samr_r_unknown_38(SAMR_R_UNKNOWN_38 *r_u, + uint16 level, uint32 status); +void samr_io_r_unknown_38(char *desc, SAMR_R_UNKNOWN_38 *r_u, prs_struct *ps, int depth); +void samr_io_enc_passwd(char *desc, SAMR_ENC_PASSWD *pwd, prs_struct *ps, int depth); +void samr_io_enc_hash(char *desc, SAMR_ENC_HASH *hsh, prs_struct *ps, int depth); + +/*The following definitions come from lib/rpc/parse/parse_srv.c */ + +void make_srv_share_info1_str(SH_INFO_1_STR *sh1, char *net_name, char *remark); +void srv_io_share_info1_str(char *desc, SH_INFO_1_STR *sh1, prs_struct *ps, int depth); +void make_srv_share_info1(SH_INFO_1 *sh1, char *net_name, uint32 type, char *remark); +void srv_io_share_info1(char *desc, SH_INFO_1 *sh1, prs_struct *ps, int depth); +void srv_io_srv_share_info_1(char *desc, SRV_SHARE_INFO_1 *ctr, prs_struct *ps, int depth); +void make_srv_share_info2_str(SH_INFO_2_STR *sh2, + char *net_name, char *remark, + char *path, char *passwd); +void srv_io_share_info2_str(char *desc, SH_INFO_2_STR *sh2, prs_struct *ps, int depth); +void make_srv_share_info2(SH_INFO_2 *sh2, + char *net_name, uint32 type, char *remark, + uint32 perms, uint32 max_uses, uint32 num_uses, + char *path, char *passwd); +void srv_io_share_info2(char *desc, SH_INFO_2 *sh2, prs_struct *ps, int depth); +void srv_io_srv_share_info_2(char *desc, SRV_SHARE_INFO_2 *ctr, prs_struct *ps, int depth); +void srv_io_srv_share_ctr(char *desc, SRV_SHARE_INFO_CTR *ctr, prs_struct *ps, int depth); +void make_srv_q_net_share_enum(SRV_Q_NET_SHARE_ENUM *q_n, + char *srv_name, + uint32 share_level, SRV_SHARE_INFO_CTR *ctr, + uint32 preferred_len, + ENUM_HND *hnd); +void srv_io_q_net_share_enum(char *desc, SRV_Q_NET_SHARE_ENUM *q_n, prs_struct *ps, int depth); +void srv_io_r_net_share_enum(char *desc, SRV_R_NET_SHARE_ENUM *r_n, prs_struct *ps, int depth); +void make_srv_sess_info0_str(SESS_INFO_0_STR *ss0, char *name); +void srv_io_sess_info0_str(char *desc, SESS_INFO_0_STR *ss0, prs_struct *ps, int depth); +void make_srv_sess_info0(SESS_INFO_0 *ss0, char *name); +void srv_io_sess_info0(char *desc, SESS_INFO_0 *ss0, prs_struct *ps, int depth); +void srv_io_srv_sess_info_0(char *desc, SRV_SESS_INFO_0 *ss0, prs_struct *ps, int depth); +void make_srv_sess_info1_str(SESS_INFO_1_STR *ss1, char *name, char *user); +void srv_io_sess_info1_str(char *desc, SESS_INFO_1_STR *ss1, prs_struct *ps, int depth); +void make_srv_sess_info1(SESS_INFO_1 *ss1, + char *name, char *user, + uint32 num_opens, uint32 open_time, uint32 idle_time, + uint32 user_flags); +void srv_io_sess_info1(char *desc, SESS_INFO_1 *ss1, prs_struct *ps, int depth); +void srv_io_srv_sess_info_1(char *desc, SRV_SESS_INFO_1 *ss1, prs_struct *ps, int depth); +void srv_io_srv_sess_ctr(char *desc, SRV_SESS_INFO_CTR *ctr, prs_struct *ps, int depth); +void make_srv_q_net_sess_enum(SRV_Q_NET_SESS_ENUM *q_n, + char *srv_name, char *qual_name, + uint32 sess_level, SRV_SESS_INFO_CTR *ctr, + uint32 preferred_len, + ENUM_HND *hnd); +void srv_io_q_net_sess_enum(char *desc, SRV_Q_NET_SESS_ENUM *q_n, prs_struct *ps, int depth); +void srv_io_r_net_sess_enum(char *desc, SRV_R_NET_SESS_ENUM *r_n, prs_struct *ps, int depth); +void make_srv_conn_info0(CONN_INFO_0 *ss0, uint32 id); +void srv_io_conn_info0(char *desc, CONN_INFO_0 *ss0, prs_struct *ps, int depth); +void srv_io_srv_conn_info_0(char *desc, SRV_CONN_INFO_0 *ss0, prs_struct *ps, int depth); +void make_srv_conn_info1_str(CONN_INFO_1_STR *ss1, char *usr_name, char *net_name); +void srv_io_conn_info1_str(char *desc, CONN_INFO_1_STR *ss1, prs_struct *ps, int depth); +void make_srv_conn_info1(CONN_INFO_1 *ss1, + uint32 id, uint32 type, + uint32 num_opens, uint32 num_users, uint32 open_time, + char *usr_name, char *net_name); +void srv_io_conn_info1(char *desc, CONN_INFO_1 *ss1, prs_struct *ps, int depth); +void srv_io_srv_conn_info_1(char *desc, SRV_CONN_INFO_1 *ss1, prs_struct *ps, int depth); +void srv_io_srv_conn_ctr(char *desc, SRV_CONN_INFO_CTR *ctr, prs_struct *ps, int depth); +void make_srv_q_net_conn_enum(SRV_Q_NET_CONN_ENUM *q_n, + char *srv_name, char *qual_name, + uint32 conn_level, SRV_CONN_INFO_CTR *ctr, + uint32 preferred_len, + ENUM_HND *hnd); +void srv_io_q_net_conn_enum(char *desc, SRV_Q_NET_CONN_ENUM *q_n, prs_struct *ps, int depth); +void srv_io_r_net_conn_enum(char *desc, SRV_R_NET_CONN_ENUM *r_n, prs_struct *ps, int depth); +void make_srv_file_info3_str(FILE_INFO_3_STR *fi3, char *user_name, char *path_name); +void srv_io_file_info3_str(char *desc, FILE_INFO_3_STR *sh1, prs_struct *ps, int depth); +void make_srv_file_info3(FILE_INFO_3 *fl3, + uint32 id, uint32 perms, uint32 num_locks, + char *path_name, char *user_name); +void srv_io_file_info3(char *desc, FILE_INFO_3 *fl3, prs_struct *ps, int depth); +void srv_io_srv_file_info_3(char *desc, SRV_FILE_INFO_3 *fl3, prs_struct *ps, int depth); +void srv_io_srv_file_ctr(char *desc, SRV_FILE_INFO_CTR *ctr, prs_struct *ps, int depth); +void make_srv_q_net_file_enum(SRV_Q_NET_FILE_ENUM *q_n, + char *srv_name, char *qual_name, + uint32 file_level, SRV_FILE_INFO_CTR *ctr, + uint32 preferred_len, + ENUM_HND *hnd); +void srv_io_q_net_file_enum(char *desc, SRV_Q_NET_FILE_ENUM *q_n, prs_struct *ps, int depth); +void srv_io_r_net_file_enum(char *desc, SRV_R_NET_FILE_ENUM *r_n, prs_struct *ps, int depth); +void make_srv_info_101(SRV_INFO_101 *sv101, uint32 platform_id, char *name, + uint32 ver_major, uint32 ver_minor, + uint32 srv_type, char *comment); +void srv_io_info_101(char *desc, SRV_INFO_101 *sv101, prs_struct *ps, int depth); +void make_srv_info_102(SRV_INFO_102 *sv102, uint32 platform_id, char *name, + char *comment, uint32 ver_major, uint32 ver_minor, + uint32 srv_type, uint32 users, uint32 disc, uint32 hidden, + uint32 announce, uint32 ann_delta, uint32 licenses, + char *usr_path); +void srv_io_info_102(char *desc, SRV_INFO_102 *sv102, prs_struct *ps, int depth); +void srv_io_info_ctr(char *desc, SRV_INFO_CTR *ctr, prs_struct *ps, int depth); +void make_srv_q_net_srv_get_info(SRV_Q_NET_SRV_GET_INFO *srv, + char *server_name, uint32 switch_value); +void srv_io_q_net_srv_get_info(char *desc, SRV_Q_NET_SRV_GET_INFO *q_n, prs_struct *ps, int depth); +void make_srv_r_net_srv_get_info(SRV_R_NET_SRV_GET_INFO *srv, + uint32 switch_value, SRV_INFO_CTR *ctr, uint32 status); +void srv_io_r_net_srv_get_info(char *desc, SRV_R_NET_SRV_GET_INFO *r_n, prs_struct *ps, int depth); +void make_srv_q_net_srv_set_info(SRV_Q_NET_SRV_SET_INFO *srv, + uint32 switch_value, SRV_INFO_CTR *ctr); +void srv_io_q_net_srv_set_info(char *desc, SRV_Q_NET_SRV_SET_INFO *q_n, prs_struct *ps, int depth); +void make_srv_r_net_srv_set_info(SRV_R_NET_SRV_SET_INFO *srv, + uint32 switch_value, SRV_INFO_CTR *ctr, uint32 status); +void srv_io_r_net_srv_set_info(char *desc, SRV_R_NET_SRV_SET_INFO *r_n, prs_struct *ps, int depth); + +/*The following definitions come from lib/rpc/parse/parse_wks.c */ + +void make_wks_q_query_info(WKS_Q_QUERY_INFO *q_u, + char *server, uint16 switch_value) ; +void wks_io_q_query_info(char *desc, WKS_Q_QUERY_INFO *q_u, prs_struct *ps, int depth); +void make_wks_info_100(WKS_INFO_100 *inf, + uint32 platform_id, uint32 ver_major, uint32 ver_minor, + char *my_name, char *domain_name); +void wks_io_wks_info_100(char *desc, WKS_INFO_100 *inf, prs_struct *ps, int depth); +void make_wks_r_query_info(WKS_R_QUERY_INFO *r_u, + uint32 switch_value, WKS_INFO_100 *wks100, + int status) ; +void wks_io_r_query_info(char *desc, WKS_R_QUERY_INFO *r_u, prs_struct *ps, int depth); + +/*The following definitions come from lib/rpc/server/srv_lsa.c */ + +BOOL api_ntlsa_rpc(pipes_struct *p, prs_struct *data); + +/*The following definitions come from lib/rpc/server/srv_lsa_hnd.c */ + +void create_pol_hnd(POLICY_HND *hnd); +void init_lsa_policy_hnd(void); +BOOL open_lsa_policy_hnd(POLICY_HND *hnd); +int find_lsa_policy_by_hnd(POLICY_HND *hnd); +BOOL set_lsa_policy_samr_rid(POLICY_HND *hnd, uint32 rid); +BOOL set_lsa_policy_samr_pol_status(POLICY_HND *hnd, uint32 pol_status); +BOOL set_lsa_policy_samr_sid(POLICY_HND *hnd, DOM_SID *sid); +uint32 get_lsa_policy_samr_rid(POLICY_HND *hnd); +BOOL set_lsa_policy_reg_name(POLICY_HND *hnd, fstring name); +BOOL get_lsa_policy_reg_name(POLICY_HND *hnd, fstring name); +BOOL close_lsa_policy_hnd(POLICY_HND *hnd); + +/*The following definitions come from lib/rpc/server/srv_netlog.c */ + +BOOL api_netlog_rpc(pipes_struct *p, prs_struct *data); + +/*The following definitions come from lib/rpc/server/srv_pipe_hnd.c */ + +void reset_chain_pnum(void); +void set_chain_pnum(int new_pnum); +void init_rpc_pipe_hnd(void); +int open_rpc_pipe_hnd(char *pipe_name, int cnum, uint16 vuid); +int read_pipe(uint16 pnum, char *data, uint32 pos, int n); +BOOL get_rpc_pipe(int pnum, pipes_struct **p); +char *get_rpc_pipe_hnd_name(int pnum); +BOOL set_rpc_pipe_hnd_state(pipes_struct *p, uint16 device_state); +BOOL close_rpc_pipe_hnd(int pnum, int cnum); +int get_rpc_pipe_num(char *buf, int where); + +/*The following definitions come from lib/rpc/server/srv_reg.c */ + +BOOL api_reg_rpc(pipes_struct *p, prs_struct *data); + +/*The following definitions come from lib/rpc/server/srv_samr.c */ + +BOOL api_samr_rpc(pipes_struct *p, prs_struct *data); + +/*The following definitions come from lib/rpc/server/srv_srvsvc.c */ + +BOOL api_srvsvc_rpc(pipes_struct *p, prs_struct *data); + +/*The following definitions come from lib/rpc/server/srv_util.c */ + +int make_dom_gids(char *gids_str, DOM_GID *gids); +void get_domain_user_groups(char *domain_groups, char *user); +BOOL create_rpc_reply(pipes_struct *p, + uint32 data_start, uint32 data_end); +BOOL api_rpcTNP(pipes_struct *p, char *rpc_name, struct api_struct *api_rpc_cmds, + prs_struct *data); +uint32 lookup_group_name(uint32 rid, char *group_name, uint32 *type); +uint32 lookup_alias_name(uint32 rid, char *alias_name, uint32 *type); +uint32 lookup_user_name(uint32 rid, char *user_name, uint32 *type); +uint32 lookup_group_rid(char *group_name, uint32 *rid); +uint32 lookup_alias_rid(char *alias_name, uint32 *rid); +uint32 lookup_user_rid(char *user_name, uint32 *rid); +BOOL name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); + +/*The following definitions come from lib/rpc/server/srv_wkssvc.c */ + +BOOL api_wkssvc_rpc(pipes_struct *p, prs_struct *data); + /*The following definitions come from loadparm.c */ char *lp_string(char *s); @@ -455,6 +1100,24 @@ void smb_mem_write_errors(FILE *outfile); void smb_mem_set_multiplier(int multiplier); void *smb_mem_resize(void *ptr,size_t newsize); +/*The following definitions come from membuffer.c */ + +void mem_init(struct mem_buf *buf, int margin); +void mem_create(struct mem_buf *buf, char *data, int size, int margin, BOOL dynamic); +void mem_take(struct mem_buf *mem_to, struct mem_buf *mem_from); +BOOL mem_alloc_data(struct mem_buf *buf, int size); +BOOL mem_buf_copy(char *copy_into, struct mem_buf *buf, + uint32 offset, uint32 len); +BOOL mem_buf_init(struct mem_buf **buf, uint32 margin); +void mem_buf_free(struct mem_buf **buf); +void mem_free_chain(struct mem_buf **buf); +void mem_free_data(struct mem_buf *buf); +BOOL mem_realloc_data(struct mem_buf *buf, int new_size); +BOOL mem_grow_data(struct mem_buf **buf, BOOL io, int new_size); +BOOL mem_find(struct mem_buf **buf, uint32 offset); +uint32 mem_buf_len(struct mem_buf *buf); +char *mem_data(struct mem_buf **buf, uint32 offset); + /*The following definitions come from message.c */ int reply_sends(char *inbuf,char *outbuf); @@ -796,11 +1459,6 @@ BOOL nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2); BOOL send_packet(struct packet_struct *p); struct packet_struct *receive_packet(int fd,enum packet_type type,int t); -/*The following definitions come from ntclient.c */ - -BOOL do_nt_login(char *desthost, char *myhostname, - int Client, int cnum); - /*The following definitions come from params.c */ BOOL pm_process( char *FileName, @@ -820,6 +1478,8 @@ void add_session_user(char *user); void dfs_unlogin(void); BOOL password_check(char *password); BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8); +BOOL smb_password_ok(struct smb_passwd *smb_pass, + uchar lm_pass[24], uchar nt_pass[24]); BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd); BOOL user_ok(char *user,int snum); BOOL authorise_login(int snum,char *user,char *password, int pwlen, @@ -839,12 +1499,8 @@ void pcap_printer_fn(void (*fn)()); /*The following definitions come from pipes.c */ int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_pipe_read_and_X(char *inbuf,char *outbuf,int length,int bufsize); int reply_pipe_close(char *inbuf,char *outbuf); -BOOL api_LsarpcSNPHS(int pnum, int cnum, char *param); -BOOL api_LsarpcTNP(int cnum,int uid, char *param,char *data, - int mdrcnt,int mprcnt, - char **rdata,char **rparam, - int *rdata_len,int *rparam_len); /*The following definitions come from predict.c */ @@ -937,281 +1593,6 @@ int reply_writebs(char *inbuf,char *outbuf); int reply_setattrE(char *inbuf,char *outbuf); int reply_getattrE(char *inbuf,char *outbuf); -/*The following definitions come from rpc_pipes/lsa_hnd.c */ - -void init_lsa_policy_hnd(void); -BOOL open_lsa_policy_hnd(LSA_POL_HND *hnd); -BOOL set_lsa_policy_samr_rid(LSA_POL_HND *hnd, uint32 rid); -BOOL set_lsa_policy_samr_pol_status(LSA_POL_HND *hnd, uint32 pol_status); -BOOL set_lsa_policy_samr_sid(LSA_POL_HND *hnd, DOM_SID *sid); -uint32 get_lsa_policy_samr_rid(LSA_POL_HND *hnd); -BOOL close_lsa_policy_hnd(LSA_POL_HND *hnd); - -/*The following definitions come from rpc_pipes/lsaparse.c */ - -void make_q_open_pol(LSA_Q_OPEN_POL *r_q, char *server_name, - uint32 attributes, uint32 sec_qos, - uint16 desired_access); -char* lsa_io_q_open_pol(BOOL io, LSA_Q_OPEN_POL *r_q, char *q, char *base, int align, int depth); -char* lsa_io_r_open_pol(BOOL io, LSA_R_OPEN_POL *r_p, char *q, char *base, int align, int depth); -void make_q_query(LSA_Q_QUERY_INFO *q_q, LSA_POL_HND *hnd, uint16 info_class); -char* lsa_io_q_query(BOOL io, LSA_Q_QUERY_INFO *q_q, char *q, char *base, int align, int depth); -char* lsa_io_q_enum_trust_dom(BOOL io, LSA_Q_ENUM_TRUST_DOM *q_e, char *q, char *base, int align, int depth); -void make_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM *r_e, LSA_POL_HND *hnd, uint32 status); -char* lsa_io_r_enum_trust_dom(BOOL io, LSA_R_ENUM_TRUST_DOM *r_e, char *q, char *base, int align, int depth); -void make_q_close(LSA_Q_CLOSE *q_c, LSA_POL_HND *hnd); -char* lsa_io_q_close(BOOL io, LSA_Q_CLOSE *q_c, char *q, char *base, int align, int depth); -void make_r_close(LSA_R_CLOSE *q_r, LSA_POL_HND *hnd); -char* lsa_io_r_close(BOOL io, LSA_R_CLOSE *r_c, char *q, char *base, int align, int depth); -char* lsa_io_r_query(BOOL io, LSA_R_QUERY_INFO *r_q, char *q, char *base, int align, int depth); -char* lsa_io_q_lookup_sids(BOOL io, LSA_Q_LOOKUP_SIDS *q_s, char *q, char *base, int align, int depth); -char* lsa_io_r_lookup_sids(BOOL io, LSA_R_LOOKUP_SIDS *r_s, char *q, char *base, int align, int depth); -char* lsa_io_q_lookup_rids(BOOL io, LSA_Q_LOOKUP_RIDS *q_r, char *q, char *base, int align, int depth); -char* lsa_io_r_lookup_rids(BOOL io, LSA_R_LOOKUP_RIDS *r_r, char *q, char *base, int align, int depth); -void make_q_req_chal(LSA_Q_REQ_CHAL *q_c, - char *logon_srv, char *logon_clnt, - DOM_CHAL *clnt_chal); -char* lsa_io_q_req_chal(BOOL io, LSA_Q_REQ_CHAL *q_c, char *q, char *base, int align, int depth); -char* lsa_io_r_req_chal(BOOL io, LSA_R_REQ_CHAL *r_c, char *q, char *base, int align, int depth); -void make_q_auth_2(LSA_Q_AUTH_2 *q_a, - char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name, - DOM_CHAL *clnt_chal, uint32 clnt_flgs); -char* lsa_io_q_auth_2(BOOL io, LSA_Q_AUTH_2 *q_a, char *q, char *base, int align, int depth); -char* lsa_io_r_auth_2(BOOL io, LSA_R_AUTH_2 *r_a, char *q, char *base, int align, int depth); -void make_q_srv_pwset(LSA_Q_SRV_PWSET *q_s, char sess_key[8], - char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name, - DOM_CRED *cred, char nt_cypher[16]); -char* lsa_io_q_srv_pwset(BOOL io, LSA_Q_SRV_PWSET *q_s, char *q, char *base, int align, int depth); -char* lsa_io_r_srv_pwset(BOOL io, LSA_R_SRV_PWSET *r_s, char *q, char *base, int align, int depth); -char* lsa_io_user_info(BOOL io, LSA_USER_INFO *usr, char *q, char *base, int align, int depth); -char* lsa_io_q_sam_logon(BOOL io, LSA_Q_SAM_LOGON *q_l, char *q, char *base, int align, int depth); -char* lsa_io_r_sam_logon(BOOL io, LSA_R_SAM_LOGON *r_l, char *q, char *base, int align, int depth); -char* lsa_io_q_sam_logoff(BOOL io, LSA_Q_SAM_LOGOFF *q_l, char *q, char *base, int align, int depth); -char* lsa_io_r_sam_logoff(BOOL io, LSA_R_SAM_LOGOFF *r_l, char *q, char *base, int align, int depth); - -/*The following definitions come from rpc_pipes/ntclientlsa.c */ - -BOOL do_lsa_open_policy(uint16 fnum, uint32 call_id, - char *server_name, LSA_POL_HND *hnd); -BOOL do_lsa_query_info_pol(uint16 fnum, uint32 call_id, - LSA_POL_HND *hnd, uint16 info_class, - fstring domain_name, pstring domain_sid); -BOOL do_lsa_close(uint16 fnum, uint32 call_id, - LSA_POL_HND *hnd); - -/*The following definitions come from rpc_pipes/ntclientnet.c */ - -BOOL do_lsa_req_chal(uint16 fnum, uint32 call_id, - char *desthost, char *myhostname, - DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal); -BOOL do_lsa_auth2(uint16 fnum, uint32 call_id, - char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name, - DOM_CHAL *clnt_chal, uint32 neg_flags, DOM_CHAL *srv_chal); -BOOL do_lsa_srv_pwset(uint16 fnum, uint32 call_id, - uchar sess_key[8], - char *logon_srv, char *mach_acct, uint16 sec_chan_type, char *comp_name, - DOM_CRED *clnt_cred, DOM_CRED *srv_cred, - char nt_owf_new_mach_pwd[16]); -BOOL do_lsa_sam_logon(uint16 fnum, uint32 call_id, - uchar sess_key[8], DOM_CRED *sto_clnt_cred, - char *logon_srv, char *comp_name, - DOM_CRED *clnt_cred, DOM_CRED *rtn_cred, - uint16 logon_level, uint16 switch_value, DOM_ID_INFO_1 *id1, - LSA_USER_INFO *user_info, - DOM_CRED *srv_cred); -BOOL do_lsa_sam_logoff(uint16 fnum, uint32 call_id, - uchar sess_key[8], DOM_CRED *sto_clnt_cred, - char *logon_srv, char *comp_name, - DOM_CRED *clnt_cred, DOM_CRED *rtn_cred, - uint16 logon_level, uint16 switch_value, DOM_ID_INFO_1 *id1, - DOM_CRED *srv_cred); - -/*The following definitions come from rpc_pipes/ntclientpipe.c */ - -uint16 rpc_pipe_open(char *inbuf, char *outbuf, char *rname, int Client, int cnum); -BOOL rpc_pipe_set_hnd_state(char *pipe_name, uint16 fnum, uint16 device_state); -BOOL rpc_pipe_bind(char *pipe_name, uint16 fnum, uint32 call_id, - RPC_IFACE *abstract, RPC_IFACE *transfer); - -/*The following definitions come from rpc_pipes/pipe_hnd.c */ - -void reset_chain_pnum(void); -void init_rpc_pipe_hnd(void); -int open_rpc_pipe_hnd(char *pipe_name, int cnum); -char *get_rpc_pipe_hnd_name(int pnum); -BOOL set_rpc_pipe_hnd_state(int pnum, int cnum, uint16 device_state); -BOOL close_rpc_pipe_hnd(int pnum, int cnum); -int get_rpc_pipe_num(char *buf, int where); - -/*The following definitions come from rpc_pipes/pipenetlog.c */ - -BOOL api_netlogrpcTNP(int cnum,int uid, char *param,char *data, - int mdrcnt,int mprcnt, - char **rdata,char **rparam, - int *rdata_len,int *rparam_len); - -/*The following definitions come from rpc_pipes/pipentlsa.c */ - -BOOL api_ntLsarpcTNP(int cnum,int uid, char *param,char *data, - int mdrcnt,int mprcnt, - char **rdata,char **rparam, - int *rdata_len,int *rparam_len); - -/*The following definitions come from rpc_pipes/pipesamr.c */ - -BOOL api_samrTNP(int cnum,int uid, char *param,char *data, - int mdrcnt,int mprcnt, - char **rdata,char **rparam, - int *rdata_len,int *rparam_len); - -/*The following definitions come from rpc_pipes/pipesrvsvc.c */ - -BOOL api_srvsvcTNP(int cnum,int uid, char *param,char *data, - int mdrcnt,int mprcnt, - char **rdata,char **rparam, - int *rdata_len,int *rparam_len); - -/*The following definitions come from rpc_pipes/pipeutil.c */ - -void initrpcreply(char *inbuf, char *q); -void endrpcreply(char *inbuf, char *q, int datalen, int rtnval, int *rlen); -BOOL name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); -char *dom_sid_to_string(DOM_SID *sid); -int make_dom_sids(char *sids_str, DOM_SID *sids, int max_sids); -int make_dom_gids(char *gids_str, DOM_GID *gids); -int create_rpc_request(uint32 call_id, uint8 op_num, char *q, int data_len); -int create_rpc_reply(uint32 call_id, char *q, int data_len); - -/*The following definitions come from rpc_pipes/pipewkssvc.c */ - -BOOL api_wkssvcTNP(int cnum,int uid, char *param,char *data, - int mdrcnt,int mprcnt, - char **rdata,char **rparam, - int *rdata_len,int *rparam_len); - -/*The following definitions come from rpc_pipes/samrparse.c */ - -char* samr_io_q_close(BOOL io, SAMR_Q_CLOSE *q_u, char *q, char *base, int align, int depth); -char* samr_io_r_close(BOOL io, SAMR_R_CLOSE *r_u, char *q, char *base, int align, int depth); -char* samr_io_q_open_secret(BOOL io, SAMR_Q_OPEN_SECRET *q_u, char *q, char *base, int align, int depth); -char* samr_io_r_open_secret(BOOL io, SAMR_R_OPEN_SECRET *r_u, char *q, char *base, int align, int depth); -char* samr_io_q_lookup_rids(BOOL io, SAMR_Q_LOOKUP_RIDS *q_u, char *q, char *base, int align, int depth); -void make_samr_r_lookup_rids(SAMR_R_LOOKUP_RIDS *r_u, - uint32 num_rids, uint32 rid, uint32 status); -char* samr_io_r_lookup_rids(BOOL io, SAMR_R_LOOKUP_RIDS *r_u, char *q, char *base, int align, int depth); -char* samr_io_q_unknown_22(BOOL io, SAMR_Q_UNKNOWN_22 *q_u, char *q, char *base, int align, int depth); -char* samr_io_r_unknown_22(BOOL io, SAMR_R_UNKNOWN_22 *r_u, char *q, char *base, int align, int depth); -char* samr_io_q_unknown_24(BOOL io, SAMR_Q_UNKNOWN_24 *q_u, char *q, char *base, int align, int depth); -void make_samr_r_unknown_24(SAMR_R_UNKNOWN_24 *r_u, - uint16 unknown_0, NTTIME *expiry, char *mach_acct, - uint32 unknown_id_0, uint32 status); -char* samr_io_r_unknown_24(BOOL io, SAMR_R_UNKNOWN_24 *r_u, char *q, char *base, int align, int depth); -char* samr_io_q_unknown_32(BOOL io, SAMR_Q_UNKNOWN_32 *q_u, char *q, char *base, int align, int depth); -char* samr_io_r_unknown_32(BOOL io, SAMR_R_UNKNOWN_32 *r_u, char *q, char *base, int align, int depth); -char* samr_io_q_open_policy(BOOL io, SAMR_Q_OPEN_POLICY *q_u, char *q, char *base, int align, int depth); -char* samr_io_r_open_policy(BOOL io, SAMR_R_OPEN_POLICY *r_u, char *q, char *base, int align, int depth); - -/*The following definitions come from rpc_pipes/smbparse.c */ - -char* smb_io_utime(BOOL io, UTIME *t, char *q, char *base, int align, int depth); -char* smb_io_time(BOOL io, NTTIME *nttime, char *q, char *base, int align, int depth); -void make_dom_sid(DOM_SID *sid, char *domsid); -char* smb_io_dom_sid(BOOL io, DOM_SID *sid, char *q, char *base, int align, int depth); -void make_uni_hdr(UNIHDR *hdr, int max_len, int len, uint16 terminate); -char* smb_io_unihdr(BOOL io, UNIHDR *hdr, char *q, char *base, int align, int depth); -void make_uni_hdr2(UNIHDR2 *hdr, int max_len, int len, uint16 terminate); -char* smb_io_unihdr2(BOOL io, UNIHDR2 *hdr2, char *q, char *base, int align, int depth); -void make_unistr(UNISTR *str, char *buf); -char* smb_io_unistr(BOOL io, UNISTR *uni, char *q, char *base, int align, int depth); -void make_unistr2(UNISTR2 *str, char *buf, int len); -char* smb_io_unistr2(BOOL io, UNISTR2 *uni2, char *q, char *base, int align, int depth); -void make_dom_sid2(DOM_SID2 *sid2, char *sid_str); -char* smb_io_dom_sid2(BOOL io, DOM_SID2 *sid2, char *q, char *base, int align, int depth); -void make_dom_rid2(DOM_RID2 *rid2, uint32 rid); -char* smb_io_dom_rid2(BOOL io, DOM_RID2 *rid2, char *q, char *base, int align, int depth); -void make_dom_rid3(DOM_RID3 *rid3, uint32 rid); -char* smb_io_dom_rid3(BOOL io, DOM_RID3 *rid3, char *q, char *base, int align, int depth); -void make_clnt_srv(DOM_CLNT_SRV *log, char *logon_srv, char *comp_name); -char* smb_io_clnt_srv(BOOL io, DOM_CLNT_SRV *log, char *q, char *base, int align, int depth); -void make_log_info(DOM_LOG_INFO *log, char *logon_srv, char *acct_name, - uint16 sec_chan, char *comp_name); -char* smb_io_log_info(BOOL io, DOM_LOG_INFO *log, char *q, char *base, int align, int depth); -char* smb_io_chal(BOOL io, DOM_CHAL *chal, char *q, char *base, int align, int depth); -char* smb_io_cred(BOOL io, DOM_CRED *cred, char *q, char *base, int align, int depth); -void make_clnt_info2(DOM_CLNT_INFO2 *clnt, - char *logon_srv, char *comp_name, - DOM_CRED *clnt_cred); -char* smb_io_clnt_info2(BOOL io, DOM_CLNT_INFO2 *clnt, char *q, char *base, int align, int depth); -char* make_clnt_info(DOM_CLNT_INFO *clnt, - char *logon_srv, char *acct_name, - uint16 sec_chan, char *comp_name, - DOM_CRED *cred); -char* smb_io_clnt_info(BOOL io, DOM_CLNT_INFO *clnt, char *q, char *base, int align, int depth); -void make_logon_id(DOM_LOGON_ID *log, uint32 log_id_low, uint32 log_id_high); -char* smb_io_logon_id(BOOL io, DOM_LOGON_ID *log, char *q, char *base, int align, int depth); -void make_arc4_owf(ARC4_OWF *hash, char data[16]); -char* smb_io_arc4_owf(BOOL io, ARC4_OWF *hash, char *q, char *base, int align, int depth); -void make_id_info1(DOM_ID_INFO_1 *id, char *domain_name, - uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high, - char *user_name, char *wksta_name, - char *sess_key, - unsigned char lm_cypher[16], unsigned char nt_cypher[16]); -char* smb_io_id_info1(BOOL io, DOM_ID_INFO_1 *id, char *q, char *base, int align, int depth); -void make_sam_info(DOM_SAM_INFO *sam, - char *logon_srv, char *comp_name, DOM_CRED *clnt_cred, - DOM_CRED *rtn_cred, uint16 logon_level, uint16 switch_value, - DOM_ID_INFO_1 *id1); -char* smb_io_sam_info(BOOL io, DOM_SAM_INFO *sam, char *q, char *base, int align, int depth); -char* smb_io_gid(BOOL io, DOM_GID *gid, char *q, char *base, int align, int depth); -void make_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 frag, - uint32 call_id, int data_len); -char* smb_io_rpc_hdr(BOOL io, RPC_HDR *rpc, char *q, char *base, int align, int depth); -void make_rpc_iface(RPC_IFACE *ifc, char data[16], uint32 version); -char* smb_io_rpc_iface(BOOL io, RPC_IFACE *ifc, char *q, char *base, int align, int depth); -void make_rpc_addr_str(RPC_ADDR_STR *str, char *name); -char* smb_io_rpc_addr_str(BOOL io, RPC_ADDR_STR *str, char *q, char *base, int align, int depth); -void make_rpc_hdr_bba(RPC_HDR_BBA *bba, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid); -char* smb_io_rpc_hdr_bba(BOOL io, RPC_HDR_BBA *rpc, char *q, char *base, int align, int depth); -void make_rpc_hdr_rb(RPC_HDR_RB *rpc, - uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, - uint32 num_elements, uint16 context_id, uint8 num_syntaxes, - RPC_IFACE *abstract, RPC_IFACE *transfer); -char* smb_io_rpc_hdr_rb(BOOL io, RPC_HDR_RB *rpc, char *q, char *base, int align, int depth); -void make_rpc_results(RPC_RESULTS *res, - uint8 num_results, uint16 result, uint16 reason); -char* smb_io_rpc_results(BOOL io, RPC_RESULTS *res, char *q, char *base, int align, int depth); -void make_rpc_hdr_ba(RPC_HDR_BA *rpc, - uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, - char *pipe_addr, - uint8 num_results, uint16 result, uint16 reason, - RPC_IFACE *transfer); -char* smb_io_rpc_hdr_ba(BOOL io, RPC_HDR_BA *rpc, char *q, char *base, int align, int depth); -void make_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, uint32 sec_qos); -char* smb_io_obj_attr(BOOL io, LSA_OBJ_ATTR *attr, char *q, char *base, int align, int depth); -void make_rpc_hdr_rr(RPC_HDR_RR *hdr, enum RPC_PKT_TYPE pkt_type, - uint32 call_id, int data_len, uint8 opnum); -char* smb_io_rpc_hdr_rr(BOOL io, RPC_HDR_RR *rpc, char *q, char *base, int align, int depth); -char* smb_io_pol_hnd(BOOL io, LSA_POL_HND *pol, char *q, char *base, int align, int depth); -char* smb_io_dom_query_3(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align, int depth); -char* smb_io_dom_query_5(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align, int depth); -char* smb_io_dom_query(BOOL io, DOM_QUERY *d_q, char *q, char *base, int align, int depth); -char* smb_io_dom_r_ref(BOOL io, DOM_R_REF *r_r, char *q, char *base, int align, int depth); -char* smb_io_dom_name(BOOL io, DOM_NAME *name, char *q, char *base, int align, int depth); -char* smb_io_neg_flags(BOOL io, NEG_FLAGS *neg, char *q, char *base, int align, int depth); - -/*The following definitions come from rpc_pipes/srvparse.c */ - -char* srv_io_share_info1_str(BOOL io, SH_INFO_1_STR *sh1, char *q, char *base, int align, int depth); -char* srv_io_share_info1(BOOL io, SH_INFO_1 *sh1, char *q, char *base, int align, int depth); -char* srv_io_share_1_ctr(BOOL io, SHARE_INFO_1_CTR *ctr, char *q, char *base, int align, int depth); -char* srv_io_q_net_share_enum(BOOL io, SRV_Q_NET_SHARE_ENUM *q_n, char *q, char *base, int align, int depth); -char* srv_io_r_net_share_enum(BOOL io, SRV_R_NET_SHARE_ENUM *r_n, char *q, char *base, int align, int depth); - -/*The following definitions come from rpc_pipes/wksparse.c */ - -char* wks_io_q_unknown_0(BOOL io, WKS_Q_UNKNOWN_0 *q_u, char *q, char *base, int align, int depth); -char* wks_io_r_unknown_0(BOOL io, WKS_R_UNKNOWN_0 *r_u, char *q, char *base, int align, int depth); - /*The following definitions come from server.c */ void *dflt_sig(void); @@ -1294,10 +1675,13 @@ char *smb_errstr(char *inbuf); /*The following definitions come from smbpass.c */ -int pw_file_lock(char *name, int type, int secs); +int pw_file_lock(int fd, int type, int secs); int pw_file_unlock(int fd); +FILE *startsmbpwent(BOOL update); +void endsmbpwent(FILE *fp); +struct smb_passwd *getsmbpwent(FILE *fp); struct smb_passwd *get_smbpwd_entry(char *name, int smb_userid); -BOOL add_smbpwd_entry(struct smb_passwd* pwd); +BOOL add_smbpwd_entry(struct smb_passwd *newpwd); BOOL mod_smbpwd_entry(struct smb_passwd* pwd); /*The following definitions come from status.c */ @@ -1343,6 +1727,7 @@ void put_dos_date3(char *buf,int offset,time_t unixdate); time_t make_unix_date(void *date_ptr); time_t make_unix_date2(void *date_ptr); time_t make_unix_date3(void *date_ptr); +char *http_timestring(time_t t); char *timestring(void ); time_t get_create_time(struct stat *st); @@ -1523,3 +1908,4 @@ char *align_offset(char *q, char *base, int align_offset_len); void print_asc(int level, unsigned char *buf,int len); void dump_data(int level,char *buf1,int len); char *tab_depth(int depth); +char *dom_sid_to_string(DOM_SID *sid); diff --git a/source3/include/rpc_dce.h b/source3/include/rpc_dce.h new file mode 100644 index 0000000000..9aacaaab87 --- /dev/null +++ b/source3/include/rpc_dce.h @@ -0,0 +1,211 @@ +/* + Unix SMB/Netbios implementation. + Version 1.9. + SMB parameters and setup + Copyright (C) Andrew Tridgell 1992-1997 + Copyright (C) Luke Kenneth Casson Leighton 1996-1997 + Copyright (C) Paul Ashton 1997 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _DCE_RPC_H /* _DCE_RPC_H */ +#define _DCE_RPC_H + +#include "rpc_misc.h" /* this only pulls in STRHDR */ + + +/* DCE/RPC packet types */ + +enum RPC_PKT_TYPE +{ + RPC_REQUEST = 0x00, + RPC_RESPONSE = 0x02, + RPC_BIND = 0x0B, + RPC_BINDACK = 0x0C +}; + +/* DCE/RPC flags */ +#define RPC_FLG_FIRST 0x01 +#define RPC_FLG_LAST 0x02 + + +/* RPC_IFACE */ +typedef struct rpc_iface_info +{ + uint8 data[16]; /* 16 bytes of rpc interface identification */ + uint32 version; /* the interface version number */ + +} RPC_IFACE; + +struct pipe_id_info +{ + /* the names appear not to matter: the syntaxes _do_ matter */ + + char *client_pipe; + RPC_IFACE abstr_syntax; /* this one is the abstract syntax id */ + + char *server_pipe; /* this one is the secondary syntax name */ + RPC_IFACE trans_syntax; /* this one is the primary syntax id */ +}; + +/* RPC_HDR - dce rpc header */ +typedef struct rpc_hdr_info +{ + uint8 major; /* 5 - RPC major version */ + uint8 minor; /* 0 - RPC minor version */ + uint8 pkt_type; /* RPC_PKT_TYPE - RPC response packet */ + uint8 flags; /* DCE/RPC flags */ + uint32 pack_type; /* 0x1000 0000 - packed data representation */ + uint16 frag_len; /* fragment length - data size (bytes) inc header and tail. */ + uint16 auth_len; /* 0 - authentication length */ + uint32 call_id; /* call identifier. matches 12th uint32 of incoming RPC data. */ + +} RPC_HDR; + +/* RPC_HDR_RR - ms request / response rpc header */ +typedef struct rpc_hdr_rr_info +{ + uint32 alloc_hint; /* allocation hint - data size (bytes) minus header and tail. */ + uint8 context_id; /* 0 - presentation context identifier */ + uint8 cancel_count; /* 0 - cancel count */ + uint8 opnum; /* opnum */ + uint8 reserved; /* 0 - reserved. */ + +} RPC_HDR_RR; + +/* this seems to be the same string name depending on the name of the pipe, + * but is more likely to be linked to the interface name + * "srvsvc", "\\PIPE\\ntsvcs" + * "samr", "\\PIPE\\lsass" + * "wkssvc", "\\PIPE\\wksvcs" + * "NETLOGON", "\\PIPE\\NETLOGON" + */ +/* RPC_ADDR_STR */ +typedef struct rpc_addr_info +{ + uint16 len; /* length of the string including null terminator */ + fstring str; /* the string above in single byte, null terminated form */ + +} RPC_ADDR_STR; + +/* RPC_HDR_BBA */ +typedef struct rpc_hdr_bba_info +{ + uint16 max_tsize; /* maximum transmission fragment size (0x1630) */ + uint16 max_rsize; /* max receive fragment size (0x1630) */ + uint32 assoc_gid; /* associated group id (0x0) */ + +} RPC_HDR_BBA; + +/* RPC_BIND_REQ - ms req bind */ +typedef struct rpc_bind_req_info +{ + RPC_HDR_BBA bba; + + uint32 num_elements; /* the number of elements (0x1) */ + uint16 context_id; /* presentation context identifier (0x0) */ + uint8 num_syntaxes; /* the number of syntaxes (has always been 1?)(0x1) */ + + RPC_IFACE abstract; /* num and vers. of interface client is using */ + RPC_IFACE transfer; /* num and vers. of interface to use for replies */ + +} RPC_HDR_RB; + +/* RPC_RESULTS - can only cope with one reason, right now... */ +typedef struct rpc_results_info +{ +/* uint8[] # 4-byte alignment padding, against SMB header */ + + uint8 num_results; /* the number of results (0x01) */ + +/* uint8[] # 4-byte alignment padding, against SMB header */ + + uint16 result; /* result (0x00 = accept) */ + uint16 reason; /* reason (0x00 = no reason specified) */ + +} RPC_RESULTS; + +/* RPC_HDR_BA */ +typedef struct rpc_hdr_ba_info +{ + RPC_HDR_BBA bba; + + RPC_ADDR_STR addr ; /* the secondary address string, as described earlier */ + RPC_RESULTS res ; /* results and reasons */ + RPC_IFACE transfer; /* the transfer syntax from the request */ + +} RPC_HDR_BA; + +/* this is TEMPORARY */ +/* RPC_AUTH_VERIFIER */ +typedef struct rpc_auth_verif_info +{ + fstring ssp_str; + uint32 ssp_ver; + +} RPC_AUTH_VERIFIER; + +/* this is TEMPORARILY coded up as a specific structure */ +/* this structure comes after the bind request */ +/* RPC_AUTH_NTLMSSP_REQ */ +typedef struct rpc_auth_ntlmssp_req_info +{ + fstring ntlmssp_str; /* "NTLMSSP" */ + uint32 ntlmssp_ver; /* 0x0000 0001 */ + + uint32 unknown_0; /* 0x00b2b3 */ + STRHDR hdr_myname; /* offset is against START of this structure */ + STRHDR hdr_domain; /* offset is against START of this structure */ + + fstring myname; /* calling workstation's name */ + fstring domain; /* calling workstations's domain */ + +} RPC_AUTH_NTLMSSP_REQ; + +/* this is TEMPORARILY coded up as a specific structure */ +/* this structure comes after the bind acknowledgement */ +/* RPC_AUTH_NTLMSSP_RESP */ +typedef struct rpc_auth_ntlmssp_resp_info +{ + uint8 auth_type; /* 0x0a */ + uint8 auth_level; /* 0x06 */ + uint8 stub_type_len; /* don't know */ + uint8 padding; /* padding */ + + uint32 ptr_0; /* non-zero pointer to something */ + + fstring ntlmssp_str; /* "NTLMSSP" */ + uint32 ntlmssp_ver; /* 0x0000 0002 */ + + uint32 unknown_1; /* 0x0000 0000 */ + uint32 unknown_2; /* 0x00b2b3 */ + uint32 unknown_3; /* 0x0082b1 */ + + uint8 data[16]; /* 0x10 bytes of something */ + +} RPC_AUTH_NTLMSSP_RESP; + +/* attached to the end of encrypted rpc requests and responses */ +/* RPC_AUTH_NTLMSSP_CHK */ +typedef struct rpc_auth_ntlmssp_chk_info +{ + uint32 ver; /* 0x1 */ + uint8 data[12]; + +} RPC_AUTH_NTLMSSP_CHK; + +#endif /* _DCE_RPC_H */ + diff --git a/source3/include/rpc_lsa.h b/source3/include/rpc_lsa.h new file mode 100644 index 0000000000..008f8866c0 --- /dev/null +++ b/source3/include/rpc_lsa.h @@ -0,0 +1,288 @@ +/* + Unix SMB/Netbios implementation. + Version 1.9. + SMB parameters and setup + Copyright (C) Andrew Tridgell 1992-1997 + Copyright (C) Luke Kenneth Casson Leighton 1996-1997 + Copyright (C) Paul Ashton 1997 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _RPC_LSA_H /* _RPC_LSA_H */ +#define _RPC_LSA_H + +#include "rpc_misc.h" + +enum SID_NAME_USE +{ + SID_NAME_USER = 1, + SID_NAME_DOM_GRP = 2, /* domain group */ + SID_NAME_WKN_GRP = 5 /* well-known group */ +}; + +/* ntlsa pipe */ +#define LSA_OPENPOLICY 0x2c +#define LSA_QUERYINFOPOLICY 0x07 +#define LSA_ENUMTRUSTDOM 0x0d +#define LSA_CLOSE 0x00 +#define LSA_OPENSECRET 0x1C +#define LSA_LOOKUPSIDS 0x0f + +/* XXXX these are here to get a compile! */ +#define LSA_LOOKUPRIDS 0xFD +#define LSA_LOOKUPNAMES 0xFC + +#define LSA_MAX_GROUPS 32 +#define LSA_MAX_SIDS 32 + +/* DOM_QUERY - info class 3 and 5 LSA Query response */ +typedef struct dom_query_info +{ + uint16 uni_dom_max_len; /* domain name string length * 2 */ + uint16 uni_dom_str_len; /* domain name string length * 2 */ + uint32 buffer_dom_name; /* undocumented domain name string buffer pointer */ + uint32 buffer_dom_sid; /* undocumented domain SID string buffer pointer */ + UNISTR2 uni_domain_name; /* domain name (unicode string) */ + DOM_SID2 dom_sid; /* domain SID */ + +} DOM_QUERY; + +/* level 5 is same as level 3. we hope. */ +typedef DOM_QUERY DOM_QUERY_3; +typedef DOM_QUERY DOM_QUERY_5; + + +typedef struct obj_attr_info +{ + uint32 len; /* 0x18 - length (in bytes) inc. the length field. */ + uint32 ptr_root_dir; /* 0 - root directory (pointer) */ + uint32 ptr_obj_name; /* 0 - object name (pointer) */ + uint32 attributes; /* 0 - attributes (undocumented) */ + uint32 ptr_sec_desc; /* 0 - security descriptior (pointer) */ + uint32 sec_qos; /* 0 - security quality of service */ + +} LSA_OBJ_ATTR; + +/* LSA_Q_OPEN_POL - LSA Query Open Policy */ +typedef struct lsa_q_open_pol_info +{ + uint32 ptr; /* undocumented buffer pointer */ + UNISTR2 uni_server_name; /* server name, starting with two '\'s */ + LSA_OBJ_ATTR attr ; /* object attributes */ + + uint32 des_access; /* desired access attributes */ + +} LSA_Q_OPEN_POL; + +/* LSA_R_OPEN_POL - response to LSA Open Policy */ +typedef struct lsa_r_open_pol_info +{ + POLICY_HND pol; /* policy handle */ + uint32 status; /* return code */ + +} LSA_R_OPEN_POL; + +/* LSA_Q_QUERY_INFO - LSA query info policy */ +typedef struct lsa_query_info +{ + POLICY_HND pol; /* policy handle */ + uint16 info_class; /* info class */ + +} LSA_Q_QUERY_INFO; + +/* LSA_R_QUERY_INFO - response to LSA query info policy */ +typedef struct lsa_r_query_info +{ + uint32 undoc_buffer; /* undocumented buffer pointer */ + uint16 info_class; /* info class (same as info class in request) */ + + union + { + DOM_QUERY_3 id3; + DOM_QUERY_5 id5; + + } dom; + + uint32 status; /* return code */ + +} LSA_R_QUERY_INFO; + +/* LSA_Q_ENUM_TRUST_DOM - LSA enumerate trusted domains */ +typedef struct lsa_enum_trust_dom_info +{ + POLICY_HND pol; /* policy handle */ + uint32 enum_context; /* enumeration context handle */ + uint32 preferred_len; /* preferred maximum length */ + +} LSA_Q_ENUM_TRUST_DOM; + +/* LSA_R_ENUM_TRUST_DOM - response to LSA enumerate trusted domains */ +typedef struct lsa_r_enum_trust_dom_info +{ + uint32 enum_context; /* enumeration context handle */ + uint32 num_domains; /* number of domains */ + uint32 ptr_enum_domains; /* buffer pointer to num domains */ + + /* this lot is only added if ptr_enum_domains is non-NULL */ + uint32 num_domains2; /* number of domains */ + UNIHDR2 hdr_domain_name; + UNISTR2 uni_domain_name; + DOM_SID2 other_domain_sid; + + uint32 status; /* return code */ + +} LSA_R_ENUM_TRUST_DOM; + +/* LSA_Q_CLOSE */ +typedef struct lsa_q_close_info +{ + POLICY_HND pol; /* policy handle */ + +} LSA_Q_CLOSE; + +/* LSA_R_CLOSE */ +typedef struct lsa_r_close_info +{ + POLICY_HND pol; /* policy handle. should be all zeros. */ + + uint32 status; /* return code */ + +} LSA_R_CLOSE; + + +#define MAX_REF_DOMAINS 10 + +/* DOM_R_REF */ +typedef struct dom_ref_info +{ + uint32 undoc_buffer; /* undocumented buffer pointer. */ + uint32 num_ref_doms_1; /* num referenced domains? */ + uint32 buffer_dom_name; /* undocumented domain name buffer pointer. */ + uint32 max_entries; /* 32 - max number of entries */ + uint32 num_ref_doms_2; /* 4 - num referenced domains? */ + + UNIHDR2 hdr_dom_name; /* domain name unicode string header */ + UNIHDR2 hdr_ref_dom[MAX_REF_DOMAINS]; /* referenced domain unicode string headers */ + + UNISTR uni_dom_name; /* domain name unicode string */ + DOM_SID2 ref_dom[MAX_REF_DOMAINS]; /* referenced domain SIDs */ + +} DOM_R_REF; + +/* LSA_TRANS_NAME - translated name */ +typedef struct lsa_trans_name_info +{ + uint32 sid_name_use; /* value is 5 for a well-known group; 2 for a domain group; 1 for a user... */ + + UNIHDR hdr_name; + UNISTR2 uni_name; + + uint32 domain_idx; + +} LSA_TRANS_NAME; + +#define MAX_LOOKUP_SIDS 10 + +/* LSA_TRANS_NAME_ENUM - LSA Translated Name Enumeration container */ +typedef struct lsa_trans_name_enum_info +{ + uint32 num_entries; + uint32 ptr_trans_names; + uint32 num_entries2; + + uint32 ptr_name[MAX_LOOKUP_SIDS]; /* translated name pointers */ + LSA_TRANS_NAME name [MAX_LOOKUP_SIDS]; /* translated names */ + +} LSA_TRANS_NAME_ENUM; + +/* LSA_SID_ENUM - LSA SID enumeration container */ +typedef struct lsa_sid_enum_info +{ + uint32 num_entries; + uint32 ptr_sid_enum; + uint32 num_entries2; + + uint32 ptr_sid[MAX_LOOKUP_SIDS]; /* domain SID pointers to be looked up. */ + DOM_SID2 sid [MAX_LOOKUP_SIDS]; /* domain SIDs to be looked up. */ + +} LSA_SID_ENUM; + +/* LSA_Q_LOOKUP_SIDS - LSA Lookup SIDs */ +typedef struct lsa_q_lookup_sids +{ + POLICY_HND pol_hnd; /* policy handle */ + LSA_SID_ENUM sids; + LSA_TRANS_NAME_ENUM names; + LOOKUP_LEVEL level; + uint32 mapped_count; + +} LSA_Q_LOOKUP_SIDS; + +/* LSA_R_LOOKUP_SIDS - response to LSA Lookup SIDs */ +typedef struct lsa_r_lookup_sids +{ + DOM_R_REF *dom_ref; /* domain reference info */ + LSA_TRANS_NAME_ENUM *names; + uint32 mapped_count; + + uint32 status; /* return code */ + +} LSA_R_LOOKUP_SIDS; + +/* DOM_NAME - XXXX not sure about this structure */ +typedef struct dom_name_info +{ + uint32 uni_str_len; + UNISTR str; + +} DOM_NAME; + + +#define UNKNOWN_LEN 1 + +/* LSA_Q_LOOKUP_RIDS - LSA Lookup RIDs */ +typedef struct lsa_q_lookup_rids +{ + POLICY_HND pol_hnd; /* policy handle */ + uint32 num_entries; + uint32 num_entries2; + uint32 buffer_dom_sid; /* undocumented domain SID buffer pointer */ + uint32 buffer_dom_name; /* undocumented domain name buffer pointer */ + DOM_NAME lookup_name[MAX_LOOKUP_SIDS]; /* names to be looked up */ + uint8 undoc[UNKNOWN_LEN]; /* completely undocumented bytes of unknown length */ + +} LSA_Q_LOOKUP_RIDS; + +/* LSA_R_LOOKUP_RIDS - response to LSA Lookup RIDs by name */ +typedef struct lsa_r_lookup_rids +{ + DOM_R_REF dom_ref; /* domain reference info */ + + uint32 num_entries; + uint32 undoc_buffer; /* undocumented buffer pointer */ + + uint32 num_entries2; + DOM_RID2 dom_rid[MAX_LOOKUP_SIDS]; /* domain RIDs being looked up */ + + uint32 num_entries3; + + uint32 status; /* return code */ + +} LSA_R_LOOKUP_RIDS; + + +#endif /* _RPC_LSA_H */ + diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h new file mode 100644 index 0000000000..5d4e385875 --- /dev/null +++ b/source3/include/rpc_misc.h @@ -0,0 +1,272 @@ +/* + Unix SMB/Netbios implementation. + Version 1.9. + SMB parameters and setup + Copyright (C) Andrew Tridgell 1992-1997 + Copyright (C) Luke Kenneth Casson Leighton 1996-1997 + Copyright (C) Paul Ashton 1997 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _RPC_MISC_H /* _RPC_MISC_H */ +#define _RPC_MISC_H + + +#include "rpc_dce.h" + +/* pipe string names */ +#define PIPE_SRVSVC "\\PIPE\\srvsvc" +#define PIPE_SAMR "\\PIPE\\samr" +#define PIPE_WINREG "\\PIPE\\winreg" +#define PIPE_WKSSVC "\\PIPE\\wkssvc" +#define PIPE_NETLOGON "\\PIPE\\NETLOGON" +#define PIPE_NTLSA "\\PIPE\\ntlsa" +#define PIPE_NTSVCS "\\PIPE\\ntsvcs" +#define PIPE_LSASS "\\PIPE\\lsass" +#define PIPE_LSARPC "\\PIPE\\lsarpc" + +/* well-known RIDs - Relative IDs */ + +/* RIDs - Well-known users ... */ +#define DOMAIN_USER_RID_ADMIN (0x000001F4L) +#define DOMAIN_USER_RID_GUEST (0x000001F5L) + +/* RIDs - well-known groups ... */ +#define DOMAIN_GROUP_RID_ADMINS (0x00000200L) +#define DOMAIN_GROUP_RID_USERS (0x00000201L) +#define DOMAIN_GROUP_RID_GUESTS (0x00000202L) + +/* RIDs - well-known aliases ... */ +#define DOMAIN_ALIAS_RID_ADMINS (0x00000220L) +#define DOMAIN_ALIAS_RID_USERS (0x00000221L) +#define DOMAIN_ALIAS_RID_GUESTS (0x00000222L) +#define DOMAIN_ALIAS_RID_POWER_USERS (0x00000223L) + +#define DOMAIN_ALIAS_RID_ACCOUNT_OPS (0x00000224L) +#define DOMAIN_ALIAS_RID_SYSTEM_OPS (0x00000225L) +#define DOMAIN_ALIAS_RID_PRINT_OPS (0x00000226L) +#define DOMAIN_ALIAS_RID_BACKUP_OPS (0x00000227L) + +#define DOMAIN_ALIAS_RID_REPLICATOR (0x00000228L) + +/* ENUM_HND */ +typedef struct enum_hnd_info +{ + uint32 ptr_hnd; /* pointer to enumeration handle */ + uint32 handle; /* enumeration handle */ + +} ENUM_HND; + +/* LOOKUP_LEVEL - switch value */ +typedef struct lookup_level_info +{ + uint16 value; + +} LOOKUP_LEVEL; + +#define MAXSUBAUTHS 15 /* max sub authorities in a SID */ + +/* DOM_SID - security id */ +typedef struct sid_info +{ + uint8 sid_rev_num; /* SID revision number */ + uint8 num_auths; /* number of sub-authorities */ + uint8 id_auth[6]; /* Identifier Authority */ + uint32 sub_auths[MAXSUBAUTHS]; /* pointer to sub-authorities. */ + +} DOM_SID; + +/* DOM_SID2 - security id */ +typedef struct sid_info_2 +{ + uint32 num_auths; /* length, bytes, including length of len :-) */ + + DOM_SID sid; + +} DOM_SID2; + +/* STRHDR - string header */ +typedef struct header_info +{ + uint16 str_max_len; + uint16 str_str_len; + uint32 buffer; /* non-zero */ + +} STRHDR; + +/* UNIHDR - unicode string header */ +typedef struct unihdr_info +{ + uint16 uni_max_len; + uint16 uni_str_len; + uint32 buffer; /* usually has a value of 4 */ + +} UNIHDR; + +/* UNIHDR2 - unicode string header and undocumented buffer */ +typedef struct unihdr2_info +{ + UNIHDR unihdr; + uint32 buffer; /* 32 bit buffer pointer */ + +} UNIHDR2; + +/* clueless as to what maximum length should be */ +#define MAX_UNISTRLEN 256 +#define MAX_STRINGLEN 256 + +/* UNISTR - unicode string size and buffer */ +typedef struct unistr_info +{ + uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. ***MUST*** be null-terminated */ + +} UNISTR; + +/* UNINOTSTR2 - unicode string, size (in uint8 ascii chars) and buffer */ +/* pathetic. some stupid team of \PIPE\winreg writers got the concept */ +/* of a unicode string different from the other \PIPE\ writers */ +typedef struct uninotstr2_info +{ + uint32 uni_max_len; + uint32 undoc; + uint32 uni_buf_len; + uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. **NOT** necessarily null-terminated */ + +} UNINOTSTR2; + +/* UNISTR2 - unicode string size (in uint16 unicode chars) and buffer */ +typedef struct unistr2_info +{ + uint32 uni_max_len; + uint32 undoc; + uint32 uni_str_len; + uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. **NOT** necessarily null-terminated */ + +} UNISTR2; + +/* STRING2 - string size (in uint8 chars) and buffer */ +typedef struct string2_info +{ + uint32 str_max_len; + uint32 undoc; + uint32 str_str_len; + uint8 buffer[MAX_STRINGLEN]; /* uint8 characters. **NOT** necessarily null-terminated */ + +} STRING2; + + +/* DOM_RID2 - domain RID structure for ntlsa pipe */ +typedef struct domrid2_info +{ + uint32 type; /* value is 5 */ + uint32 undoc; /* value is non-zero */ + uint32 rid; + uint32 rid_idx; /* don't know what this is */ + +} DOM_RID2; + +/* DOM_RID3 - domain RID structure for samr pipe */ +typedef struct domrid3_info +{ + uint32 rid; /* domain-relative (to a SID) id */ + uint32 type1; /* value is 0x1 */ + uint32 ptr_type; /* undocumented pointer */ + uint32 type2; /* value is 0x1 */ + +} DOM_RID3; + +/* DOM_RID4 - rid + user attributes */ +typedef struct domrid4_info +{ + uint32 unknown; + uint16 attr; + uint32 rid; /* user RID */ + +} DOM_RID4; + +/* DOM_CLNT_SRV - client / server names */ +typedef struct clnt_srv_info +{ + uint32 undoc_buffer; /* undocumented 32 bit buffer pointer */ + UNISTR2 uni_logon_srv; /* logon server name */ + uint32 undoc_buffer2; /* undocumented 32 bit buffer pointer */ + UNISTR2 uni_comp_name; /* client machine name */ + +} DOM_CLNT_SRV; + +/* DOM_LOG_INFO - login info */ +typedef struct log_info +{ + uint32 undoc_buffer; /* undocumented 32 bit buffer pointer */ + UNISTR2 uni_logon_srv; /* logon server name */ + UNISTR2 uni_acct_name; /* account name */ + uint16 sec_chan; /* secure channel type */ + UNISTR2 uni_comp_name; /* client machine name */ + +} DOM_LOG_INFO; + +/* DOM_CLNT_INFO - client info */ +typedef struct clnt_info +{ + DOM_LOG_INFO login; + DOM_CRED cred; + +} DOM_CLNT_INFO; + +/* DOM_CLNT_INFO2 - client info */ +typedef struct clnt_info2 +{ + DOM_CLNT_SRV login; + uint32 ptr_cred; + DOM_CRED cred; + +} DOM_CLNT_INFO2; + +/* DOM_LOGON_ID - logon id */ +typedef struct logon_info +{ + uint32 low; + uint32 high; + +} DOM_LOGON_ID; + +/* ARC4_OWF */ +typedef struct arc4_owf_info +{ + uint8 data[16]; + +} ARC4_OWF; + + +/* DOM_GID - group id + user attributes */ +typedef struct gid_info +{ + uint32 g_rid; /* a group RID */ + uint32 attr; + +} DOM_GID; + +#define POL_HND_SIZE 20 + +/* POLICY_HND */ +typedef struct lsa_policy_info +{ + uint8 data[POL_HND_SIZE]; /* policy handle */ + +} POLICY_HND; + +#endif /* _RPC_MISC_H */ + diff --git a/source3/include/rpc_netlogon.h b/source3/include/rpc_netlogon.h new file mode 100644 index 0000000000..1808649328 --- /dev/null +++ b/source3/include/rpc_netlogon.h @@ -0,0 +1,372 @@ +/* + Unix SMB/Netbios implementation. + Version 1.9. + SMB parameters and setup + Copyright (C) Andrew Tridgell 1992-1997 + Copyright (C) Luke Kenneth Casson Leighton 1996-1997 + Copyright (C) Paul Ashton 1997 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _RPC_NETLOGON_H /* _RPC_NETLOGON_H */ +#define _RPC_NETLOGON_H + + +/* NETLOGON pipe */ +#define NET_REQCHAL 0x04 +#define NET_SRVPWSET 0x06 +#define NET_SAMLOGON 0x02 +#define NET_SAMLOGOFF 0x03 +#define NET_AUTH2 0x0f +#define NET_LOGON_CTRL2 0x0e +#define NET_TRUST_DOM_LIST 0x13 + +/* Secure Channel types. used in NetrServerAuthenticate negotiation */ +#define SEC_CHAN_WKSTA 2 +#define SEC_CHAN_DOMAIN 4 + + +/* NET_USER_INFO_3 */ +typedef struct net_user_info_3 +{ + uint32 ptr_user_info; + + NTTIME logon_time; /* logon time */ + NTTIME logoff_time; /* logoff time */ + NTTIME kickoff_time; /* kickoff time */ + NTTIME pass_last_set_time; /* password last set time */ + NTTIME pass_can_change_time; /* password can change time */ + NTTIME pass_must_change_time; /* password must change time */ + + UNIHDR hdr_user_name; /* username unicode string header */ + UNIHDR hdr_full_name; /* user's full name unicode string header */ + UNIHDR hdr_logon_script; /* logon script unicode string header */ + UNIHDR hdr_profile_path; /* profile path unicode string header */ + UNIHDR hdr_home_dir; /* home directory unicode string header */ + UNIHDR hdr_dir_drive; /* home directory drive unicode string header */ + + uint16 logon_count; /* logon count */ + uint16 bad_pw_count; /* bad password count */ + + uint32 user_id; /* User ID */ + uint32 group_id; /* Group ID */ + uint32 num_groups; /* num groups */ + uint32 buffer_groups; /* undocumented buffer pointer to groups. */ + uint32 user_flgs; /* user flags */ + + uint8 user_sess_key[16]; /* unused user session key */ + + UNIHDR hdr_logon_srv; /* logon server unicode string header */ + UNIHDR hdr_logon_dom; /* logon domain unicode string header */ + + uint32 buffer_dom_id; /* undocumented logon domain id pointer */ + uint8 padding[40]; /* unused padding bytes. expansion room */ + + uint32 num_other_sids; /* 0 - num_sids */ + uint32 buffer_other_sids; /* NULL - undocumented pointer to SIDs. */ + + UNISTR2 uni_user_name; /* username unicode string */ + UNISTR2 uni_full_name; /* user's full name unicode string */ + UNISTR2 uni_logon_script; /* logon script unicode string */ + UNISTR2 uni_profile_path; /* profile path unicode string */ + UNISTR2 uni_home_dir; /* home directory unicode string */ + UNISTR2 uni_dir_drive; /* home directory drive unicode string */ + + uint32 num_groups2; /* num groups */ + DOM_GID gids[LSA_MAX_GROUPS]; /* group info */ + + UNISTR2 uni_logon_srv; /* logon server unicode string */ + UNISTR2 uni_logon_dom; /* logon domain unicode string */ + + DOM_SID2 dom_sid; /* domain SID */ + DOM_SID2 other_sids[LSA_MAX_SIDS]; /* undocumented - domain SIDs */ + +} NET_USER_INFO_3; + + +/******************************************************** + Logon Control Query + + query_level 0x1 - pdc status + query_level 0x3 - number of logon attempts. + + ********************************************************/ +/* NET_Q_LOGON_CTRL2 - LSA Netr Logon Control 2*/ +typedef struct net_q_logon_ctrl2_info +{ + uint32 ptr; /* undocumented buffer pointer */ + UNISTR2 uni_server_name; /* server name, starting with two '\'s */ + + uint32 function_code; /* 0x1 */ + uint32 query_level; /* 0x1, 0x3 */ + uint32 switch_value; /* 0x1 */ + +} NET_Q_LOGON_CTRL2; + +/* NETLOGON_INFO_1 - pdc status info, i presume */ +typedef struct netlogon_1_info +{ + uint32 flags; /* 0x0 - undocumented */ + uint32 pdc_status; /* 0x0 - undocumented */ + +} NETLOGON_INFO_1; + +/* NETLOGON_INFO_2 - pdc status info, plus trusted domain info */ +typedef struct netlogon_2_info +{ + uint32 flags; /* 0x0 - undocumented */ + uint32 pdc_status; /* 0x0 - undocumented */ + uint32 ptr_trusted_dc_name; /* pointer to trusted domain controller name */ + uint32 tc_status; /* 0x051f - ERROR_NO_LOGON_SERVERS */ + UNISTR2 uni_trusted_dc_name; /* unicode string - trusted dc name */ + +} NETLOGON_INFO_2; + +/* NETLOGON_INFO_3 - logon status info, i presume */ +typedef struct netlogon_3_info +{ + uint32 flags; /* 0x0 - undocumented */ + uint32 logon_attempts; /* number of logon attempts */ + uint32 reserved_1; /* 0x0 - undocumented */ + uint32 reserved_2; /* 0x0 - undocumented */ + uint32 reserved_3; /* 0x0 - undocumented */ + uint32 reserved_4; /* 0x0 - undocumented */ + uint32 reserved_5; /* 0x0 - undocumented */ + +} NETLOGON_INFO_3; + +/******************************************************* + Logon Control Response + + switch_value is same as query_level in request + *******************************************************/ + +/* NET_R_LOGON_CTRL2 - response to LSA Logon Control2 */ +typedef struct net_r_logon_ctrl2_info +{ + uint32 switch_value; /* 0x1, 0x3 */ + uint32 ptr; + + union + { + NETLOGON_INFO_1 info1; + NETLOGON_INFO_2 info2; + NETLOGON_INFO_3 info3; + + } logon; + + uint32 status; /* return code */ + +} NET_R_LOGON_CTRL2; + +/* NET_Q_TRUST_DOM_LIST - LSA Query Trusted Domains */ +typedef struct net_q_trust_dom_info +{ + uint32 ptr; /* undocumented buffer pointer */ + UNISTR2 uni_server_name; /* server name, starting with two '\'s */ + + uint32 function_code; /* 0x31 */ + +} NET_Q_TRUST_DOM_LIST; + +#define MAX_TRUST_DOMS 1 + +/* NET_R_TRUST_DOM_LIST - response to LSA Trusted Domains */ +typedef struct net_r_trust_dom_info +{ + UNISTR2 uni_trust_dom_name[MAX_TRUST_DOMS]; + + uint32 status; /* return code */ + +} NET_R_TRUST_DOM_LIST; + + +/* NEG_FLAGS */ +typedef struct neg_flags_info +{ + uint32 neg_flags; /* negotiated flags */ + +} NEG_FLAGS; + + +/* NET_Q_REQ_CHAL */ +typedef struct net_q_req_chal_info +{ + uint32 undoc_buffer; /* undocumented buffer pointer */ + UNISTR2 uni_logon_srv; /* logon server unicode string */ + UNISTR2 uni_logon_clnt; /* logon client unicode string */ + DOM_CHAL clnt_chal; /* client challenge */ + +} NET_Q_REQ_CHAL; + + +/* NET_R_REQ_CHAL */ +typedef struct net_r_req_chal_info +{ + DOM_CHAL srv_chal; /* server challenge */ + + uint32 status; /* return code */ + +} NET_R_REQ_CHAL; + + + +/* NET_Q_AUTH_2 */ +typedef struct net_q_auth2_info +{ + DOM_LOG_INFO clnt_id; /* client identification info */ + DOM_CHAL clnt_chal; /* client-calculated credentials */ + + NEG_FLAGS clnt_flgs; /* usually 0x0000 01ff */ + +} NET_Q_AUTH_2; + + +/* NET_R_AUTH_2 */ +typedef struct net_r_auth2_info +{ + DOM_CHAL srv_chal; /* server-calculated credentials */ + NEG_FLAGS srv_flgs; /* usually 0x0000 01ff */ + + uint32 status; /* return code */ + +} NET_R_AUTH_2; + + +/* NET_Q_SRV_PWSET */ +typedef struct net_q_srv_pwset_info +{ + DOM_CLNT_INFO clnt_id; /* client identification/authentication info */ + uint8 pwd[16]; /* new password - undocumented. */ + +} NET_Q_SRV_PWSET; + +/* NET_R_SRV_PWSET */ +typedef struct net_r_srv_pwset_info +{ + DOM_CRED srv_cred; /* server-calculated credentials */ + + uint32 status; /* return code */ + +} NET_R_SRV_PWSET; + +/* NET_ID_INFO_2 */ +typedef struct net_network_info_2 +{ + uint32 ptr_id_info2; /* pointer to id_info_2 */ + UNIHDR hdr_domain_name; /* domain name unicode header */ + uint32 param_ctrl; /* param control (0x2) */ + DOM_LOGON_ID logon_id; /* logon ID */ + UNIHDR hdr_user_name; /* user name unicode header */ + UNIHDR hdr_wksta_name; /* workstation name unicode header */ + uint8 lm_chal[8]; /* lan manager 8 byte challenge */ + STRHDR hdr_nt_chal_resp; /* nt challenge response */ + STRHDR hdr_lm_chal_resp; /* lm challenge response */ + + UNISTR2 uni_domain_name; /* domain name unicode string */ + UNISTR2 uni_user_name; /* user name unicode string */ + UNISTR2 uni_wksta_name; /* workgroup name unicode string */ + STRING2 nt_chal_resp; /* nt challenge response */ + STRING2 lm_chal_resp; /* lm challenge response */ + +} NET_ID_INFO_2; + +/* NET_ID_INFO_1 */ +typedef struct id_info_1 +{ + uint32 ptr_id_info1; /* pointer to id_info_1 */ + UNIHDR hdr_domain_name; /* domain name unicode header */ + uint32 param_ctrl; /* param control */ + DOM_LOGON_ID logon_id; /* logon ID */ + UNIHDR hdr_user_name; /* user name unicode header */ + UNIHDR hdr_wksta_name; /* workstation name unicode header */ + ARC4_OWF arc4_lm_owf; /* arc4 LM OWF Password */ + ARC4_OWF arc4_nt_owf; /* arc4 NT OWF Password */ + UNISTR2 uni_domain_name; /* domain name unicode string */ + UNISTR2 uni_user_name; /* user name unicode string */ + UNISTR2 uni_wksta_name; /* workgroup name unicode string */ + +} NET_ID_INFO_1; + +/* NET_ID_INFO_CTR */ +typedef struct net_id_info_ctr_info +{ + uint16 switch_value; + + union + { + NET_ID_INFO_1 id1; /* auth-level 1 - interactive user login */ + NET_ID_INFO_2 id2; /* auth-level 2 - workstation referred login */ + + } auth; + +} NET_ID_INFO_CTR; + +/* SAM_INFO - sam logon/off id structure */ +typedef struct sam_info +{ + DOM_CLNT_INFO2 client; + uint32 ptr_rtn_cred; /* pointer to return credentials */ + DOM_CRED rtn_cred; /* return credentials */ + uint16 logon_level; + NET_ID_INFO_CTR *ctr; + uint16 validation_level; + +} DOM_SAM_INFO; + +/* NET_Q_SAM_LOGON */ +typedef struct net_q_sam_logon_info +{ + DOM_SAM_INFO sam_id; + +} NET_Q_SAM_LOGON; + +/* NET_R_SAM_LOGON */ +typedef struct net_r_sam_logon_info +{ + uint32 buffer_creds; /* undocumented buffer pointer */ + DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */ + + uint16 switch_value; /* 3 - indicates type of USER INFO */ + NET_USER_INFO_3 *user; + + uint32 auth_resp; /* 1 - Authoritative response; 0 - Non-Auth? */ + + uint32 status; /* return code */ + +} NET_R_SAM_LOGON; + + +/* NET_Q_SAM_LOGOFF */ +typedef struct net_q_sam_logoff_info +{ + DOM_SAM_INFO sam_id; + +} NET_Q_SAM_LOGOFF; + +/* NET_R_SAM_LOGOFF */ +typedef struct net_r_sam_logoff_info +{ + uint32 buffer_creds; /* undocumented buffer pointer */ + DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */ + + uint32 status; /* return code */ + +} NET_R_SAM_LOGOFF; + + +#endif /* _RPC_NETLOGON_H */ + diff --git a/source3/include/rpc_reg.h b/source3/include/rpc_reg.h new file mode 100644 index 0000000000..28d11710cd --- /dev/null +++ b/source3/include/rpc_reg.h @@ -0,0 +1,141 @@ +/* + Unix SMB/Netbios implementation. + Version 1.9. + SMB parameters and setup + Copyright (C) Andrew Tridgell 1992-1997 + Copyright (C) Luke Kenneth Casson Leighton 1996-1997 + Copyright (C) Paul Ashton 1997 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _RPC_REG_H /* _RPC_REG_H */ +#define _RPC_REG_H + + +/* winreg pipe defines */ +#define REG_OPEN_POLICY 0x02 +#define REG_OPEN_ENTRY 0x0f +#define REG_INFO 0x11 +#define REG_CLOSE 0x05 + +/* REG_Q_OPEN_POLICY */ +typedef struct q_reg_open_policy_info +{ + uint32 ptr; + uint16 unknown_0; /* 0x5da0 - 16 bit unknown */ + uint32 level; /* 0x0000 0001 - 32 bit unknown */ + uint16 unknown_1; /* 0x0200 - 16 bit unknown */ + +} REG_Q_OPEN_POLICY; + +/* REG_R_OPEN_POLICY */ +typedef struct r_reg_open_policy_info +{ + POLICY_HND pol; /* policy handle */ + uint32 status; /* return status */ + +} REG_R_OPEN_POLICY; + + +/* REG_Q_CLOSE */ +typedef struct reg_q_close_info +{ + POLICY_HND pol; /* policy handle */ + +} REG_Q_CLOSE; + +/* REG_R_CLOSE */ +typedef struct reg_r_close_info +{ + POLICY_HND pol; /* policy handle. should be all zeros. */ + + uint32 status; /* return code */ + +} REG_R_CLOSE; + + +/* REG_Q_INFO */ +typedef struct q_reg_info_info +{ + POLICY_HND pol; /* policy handle */ + + UNIHDR hdr_type; /* unicode product type header */ + UNISTR2 uni_type; /* unicode product type - "ProductType" */ + + uint32 ptr1; /* pointer */ + NTTIME time; /* current time? */ + uint8 major_version1; /* 0x4 - os major version? */ + uint8 minor_version1; /* 0x1 - os minor version? */ + uint8 pad1[10]; /* padding - zeros */ + + uint32 ptr2; /* pointer */ + uint8 major_version2; /* 0x4 - os major version? */ + uint8 minor_version2; /* 0x1 - os minor version? */ + uint8 pad2[2]; /* padding - zeros */ + + uint32 ptr3; /* pointer */ + uint32 unknown; /* 0x0000 0000 */ + +} REG_Q_INFO; + +/* REG_R_INFO */ +typedef struct r_reg_info_info +{ + uint32 ptr1; /* buffer pointer */ + uint32 level; /* 0x1 - info level? */ + + uint32 ptr_type; /* pointer to o/s type */ + UNINOTSTR2 uni_type; /* unicode string o/s type - "LanmanNT" */ + + uint32 ptr2; /* pointer to unknown_0 */ + uint32 unknown_0; /* 0x12 */ + + uint32 ptr3; /* pointer to unknown_1 */ + uint32 unknown_1; /* 0x12 */ + + uint32 status; /* return status */ + +} REG_R_INFO; + + +/* REG_Q_OPEN_ENTRY */ +typedef struct q_reg_open_entry_info +{ + POLICY_HND pol; /* policy handle */ + + UNIHDR hdr_name; /* unicode registry string header */ + UNISTR2 uni_name; /* unicode registry string name */ + + uint32 unknown_0; /* 32 bit unknown - 0x0000 0000 */ + uint16 unknown_1; /* 16 bit unknown - 0x0000 */ + uint16 unknown_2; /* 16 bit unknown - 0x0200 */ + +} REG_Q_OPEN_ENTRY; + + + +/* REG_R_OPEN_ENTRY */ +typedef struct r_reg_open_entry_info +{ + POLICY_HND pol; /* policy handle */ + uint32 status; /* return status */ + +} REG_R_OPEN_ENTRY; + + + +#endif /* _RPC_REG_H */ + diff --git a/source3/include/rpc_samr.h b/source3/include/rpc_samr.h new file mode 100644 index 0000000000..bcce64b6be --- /dev/null +++ b/source3/include/rpc_samr.h @@ -0,0 +1,1023 @@ +/* + Unix SMB/Netbios implementation. + Version 1.9. + SMB parameters and setup + Copyright (C) Andrew Tridgell 1992-1997 + Copyright (C) Luke Kenneth Casson Leighton 1996-1997 + Copyright (C) Paul Ashton 1997 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _RPC_SAMR_H /* _RPC_SAMR_H */ +#define _RPC_SAMR_H + + +#include "rpc_misc.h" + + +/******************************************************************* + the following information comes from a QuickView on samsrv.dll, + and gives an idea of exactly what is needed: + +SamrAddMemberToAlias +SamrAddMemberToGroup +SamrAddMultipleMembersToAlias +SamrChangePasswordUser +x SamrCloseHandle +x SamrConnect +SamrCreateAliasInDomain +SamrCreateGroupInDomain +SamrCreateUserInDomain +SamrDeleteAlias +SamrDeleteGroup +SamrDeleteUser +x SamrEnumerateAliasesInDomain +SamrEnumerateDomainsInSamServer +x SamrEnumerateGroupsInDomain +x SamrEnumerateUsersInDomain +SamrGetUserDomainPasswordInformation +SamrLookupDomainInSamServer +? SamrLookupIdsInDomain +x SamrLookupNamesInDomain +x SamrOpenAlias +x SamrOpenDomain +SamrOpenGroup +x SamrOpenUser +x SamrQueryDisplayInformation +x SamrQueryInformationAlias +SamrQueryInformationDomain +? SamrQueryInformationUser +SamrQuerySecurityObject +SamrRemoveMemberFromAlias +SamrRemoveMemberFromForiegnDomain +SamrRemoveMemberFromGroup +SamrRemoveMultipleMembersFromAlias +SamrSetInformationAlias +SamrSetInformationDomain +SamrSetInformationGroup +SamrSetInformationUser +SamrSetMemberAttributesOfGroup +SamrSetSecurityObject +SamrShutdownSamServer +SamrTestPrivateFunctionsDomain +SamrTestPrivateFunctionsUser + +********************************************************************/ + +#define SAMR_CLOSE_HND 0x01 +#define SAMR_OPEN_DOMAIN 0x07 +#define SAMR_UNKNOWN_8 0x08 +#define SAMR_LOOKUP_IDS 0x10 +#define SAMR_LOOKUP_NAMES 0x11 +#define SAMR_UNKNOWN_3 0x03 +#define SAMR_QUERY_DISPINFO 0x28 +#define SAMR_OPEN_USER 0x22 +#define SAMR_QUERY_USERINFO 0x24 +#define SAMR_QUERY_USERGROUPS 0x27 +#define SAMR_UNKNOWN_12 0x12 +#define SAMR_UNKNOWN_21 0x21 +#define SAMR_UNKNOWN_32 0x32 +#define SAMR_UNKNOWN_34 0x34 +#define SAMR_CONNECT 0x39 +#define SAMR_OPEN_ALIAS 0x1b +#define SAMR_QUERY_ALIASINFO 0x1c +#define SAMR_ENUM_DOM_USERS 0x0d +#define SAMR_ENUM_DOM_ALIASES 0x0f +#define SAMR_ENUM_DOM_GROUPS 0x30 + + +typedef struct logon_hours_info +{ + uint32 len; /* normally 21 bytes */ + uint8 hours[32]; + +} LOGON_HRS; + +/* SAM_USER_INFO_21 */ +typedef struct sam_user_info_21 +{ + NTTIME logon_time; /* logon time */ + NTTIME logoff_time; /* logoff time */ + NTTIME kickoff_time; /* kickoff time */ + NTTIME pass_last_set_time; /* password last set time */ + NTTIME pass_can_change_time; /* password can change time */ + NTTIME pass_must_change_time; /* password must change time */ + + UNIHDR hdr_user_name; /* username unicode string header */ + UNIHDR hdr_full_name; /* user's full name unicode string header */ + UNIHDR hdr_home_dir; /* home directory unicode string header */ + UNIHDR hdr_dir_drive; /* home drive unicode string header */ + UNIHDR hdr_logon_script; /* logon script unicode string header */ + UNIHDR hdr_profile_path; /* profile path unicode string header */ + UNIHDR hdr_acct_desc ; /* user description */ + UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */ + UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */ + UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */ + + uint8 lm_pwd[16]; /* lm user passwords */ + uint8 nt_pwd[16]; /* nt user passwords */ + + uint32 user_rid; /* Primary User ID */ + uint32 group_rid; /* Primary Group ID */ + + uint16 acb_info; /* account info (ACB_xxxx bit-mask) */ + /* uint8 pad[2] */ + + uint32 unknown_3; /* 0x00ff ffff */ + + uint16 logon_divs; /* 0x0000 00a8 which is 168 which is num hrs in a week */ + /* uint8 pad[2] */ + uint32 ptr_logon_hrs; /* unknown pointer */ + + uint32 unknown_5; /* 0x0002 0000 */ + + uint8 padding1[8]; + + UNISTR2 uni_user_name; /* username unicode string */ + UNISTR2 uni_full_name; /* user's full name unicode string */ + UNISTR2 uni_home_dir; /* home directory unicode string */ + UNISTR2 uni_dir_drive; /* home directory drive unicode string */ + UNISTR2 uni_logon_script; /* logon script unicode string */ + UNISTR2 uni_profile_path; /* profile path unicode string */ + UNISTR2 uni_acct_desc ; /* user description unicode string */ + UNISTR2 uni_workstations; /* login from workstations unicode string */ + UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */ + UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel number */ + + uint32 unknown_6; /* 0x0000 04ec */ + uint32 padding4; + + LOGON_HRS logon_hrs; + +} SAM_USER_INFO_21; + + +/* SAM_USER_INFO_11 */ +typedef struct sam_user_info_11 +{ + uint8 padding_0[16]; /* 0 - padding 16 bytes */ + NTTIME expiry; /* expiry time or something? */ + uint8 padding_1[24]; /* 0 - padding 24 bytes */ + + UNIHDR hdr_mach_acct; /* unicode header for machine account */ + uint32 padding_2; /* 0 - padding 4 bytes */ + + uint32 ptr_1; /* pointer */ + uint8 padding_3[32]; /* 0 - padding 32 bytes */ + uint32 padding_4; /* 0 - padding 4 bytes */ + + uint32 ptr_2; /* pointer */ + uint32 padding_5; /* 0 - padding 4 bytes */ + + uint32 ptr_3; /* pointer */ + uint8 padding_6[32]; /* 0 - padding 32 bytes */ + + uint32 rid_user; /* user RID */ + uint32 rid_group; /* group RID */ + + uint16 acct_ctrl; /* 0080 - ACB_XXXX */ + uint16 unknown_3; /* 16 bit padding */ + + uint16 unknown_4; /* 0x003f - 16 bit unknown */ + uint16 unknown_5; /* 0x003c - 16 bit unknown */ + + uint8 padding_7[16]; /* 0 - padding 16 bytes */ + uint32 padding_8; /* 0 - padding 4 bytes */ + + UNISTR2 uni_mach_acct; /* unicode string for machine account */ + + uint8 padding_9[48]; /* 0 - padding 48 bytes */ + +} SAM_USER_INFO_11; + + +/* SAM_USER_INFO_10 */ +typedef struct sam_user_info_10 +{ + uint32 rid_group; + +} SAM_USER_INFO_10; + + + +/* SAMR_Q_CLOSE_HND - probably a policy handle close */ +typedef struct q_samr_close_hnd_info +{ + POLICY_HND pol; /* policy handle */ + +} SAMR_Q_CLOSE_HND; + + +/* SAMR_R_CLOSE_HND - probably a policy handle close */ +typedef struct r_samr_close_hnd_info +{ + POLICY_HND pol; /* policy handle */ + uint32 status; /* return status */ + +} SAMR_R_CLOSE_HND; + + +/**************************************************************************** +SAMR_Q_UNKNOWN_3 - info level 4. returns SIDs. +*****************************************************************************/ + +/* SAMR_Q_UNKNOWN_3 - probably get domain info... */ +typedef struct q_samr_unknown_3_info +{ + POLICY_HND user_pol; /* policy handle */ + uint16 switch_value; /* 0x0000 0004 */ + /* uint8 pad[2] */ + +} SAMR_Q_UNKNOWN_3; + +/* DOM_SID3 example: + 0x14 0x035b 0x0002 S-1-1 + 0x18 0x07ff 0x000f S-1-5-20-DOMAIN_ALIAS_RID_ADMINS + 0x18 0x07ff 0x000f S-1-5-20-DOMAIN_ALIAS_RID_ACCOUNT_OPS + 0x24 0x0044 0x0002 S-1-5-21-nnn-nnn-nnn-0x03f1 + */ + +/* DOM_SID3 example: + 0x24 0x0044 0x0002 S-1-5-21-nnn-nnn-nnn-0x03ee + 0x18 0x07ff 0x000f S-1-5-20-DOMAIN_ALIAS_RID_ADMINS + 0x14 0x035b 0x0002 S-1-1 + */ + +/* DOM_SID3 - security id */ +typedef struct sid_info_3 +{ + uint16 len; /* length, bytes, including length of len :-) */ + /* uint8 pad[2]; */ + + DOM_SID sid; + +} DOM_SID3; + + +#define MAX_SAM_SIDS 15 + +/* SAM_SID_STUFF */ +typedef struct sid_stuff_info +{ + uint16 unknown_2; /* 0x0001 */ + uint16 unknown_3; /* 0x8004 */ + + uint8 padding1[8]; + + uint32 unknown_4; /* 0x0000 0014 */ + uint32 unknown_5; /* 0x0000 0014 */ + + uint16 unknown_6; /* 0x0002 */ + uint16 unknown_7; /* 0x5800 */ + + uint32 num_sids; + + uint16 padding2; + + DOM_SID3 sid[MAX_SAM_SIDS]; + +} SAM_SID_STUFF; + +/* SAMR_R_UNKNOWN_3 - probably an open */ +typedef struct r_samr_unknown_3_info +{ + uint32 ptr_0; + uint32 sid_stuff_len0; + + uint32 ptr_1; + uint32 sid_stuff_len1; + + SAM_SID_STUFF sid_stuff; + + uint32 status; /* return status */ + +} SAMR_R_UNKNOWN_3; + + +/**************************************************************************** +SAMR_Q_UNKNOWN_8 - probably a query on domain group info. +*****************************************************************************/ + +/* SAMR_Q_UNKNOWN_8 - */ +typedef struct q_samr_unknown_8_info +{ + POLICY_HND domain_pol; /* policy handle */ + uint16 switch_value; /* 0x0002 */ + +} SAMR_Q_UNKNOWN_8; + +typedef struct sam_unkown_info_2_info +{ + uint32 unknown_0; /* 0x0000 0000 */ + uint32 unknown_1; /* 0x0000 0000 */ + uint32 unknown_2; /* 0x8000 0000 */ + uint32 unknown_3; /* 0x0000 0000 */ + + uint32 ptr_0; /* pointer to unknown structure */ + UNIHDR hdr_domain; /* domain name unicode header */ + UNIHDR hdr_server; /* server name unicode header */ + + /* put all the data in here, at the moment, including what the above + pointer is referring to + */ + + uint32 unknown_4; /* 0x0000 0099 */ + uint32 unknown_5; /* 0x0000 0000 */ + + uint32 unknown_6 ; /* 0x0000 0001 */ + uint32 unknown_7 ; /* 0x0000 0003 */ + uint32 unknown_8 ; /* 0x0000 0001 */ + uint32 unknown_9 ; /* 0x0000 0008 */ + uint32 unknown_10; /* 0x0000 0003 */ + + uint8 padding[16]; /* 16 bytes zeros */ + + UNISTR2 uni_domain; /* domain name unicode string */ + UNISTR2 uni_server; /* server name unicode string */ + +} SAM_UNK_INFO_2; + + +typedef struct sam_unknown_ctr_info +{ + union + { + SAM_UNK_INFO_2 inf2; + + } info; + +} SAM_UNK_CTR; + + +/* SAMR_R_UNKNOWN_8 - */ +typedef struct r_samr_unknown_8_info +{ + uint32 ptr_1; + uint16 switch_value; /* same as in query */ + + SAM_UNK_CTR *ctr; + + uint32 status; /* return status */ + +} SAMR_R_UNKNOWN_8; + + +/**************************************************************************** +SAMR_Q_OPEN_DOMAIN - unknown_0 values seen associated with SIDs: + +0x0000 03f1 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0 +0x0000 0200 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0 +*****************************************************************************/ + +/* SAMR_Q_OPEN_DOMAIN */ +typedef struct q_samr_open_domain_info +{ + POLICY_HND connect_pol; /* policy handle */ + uint32 rid; /* 0x2000 0000; 0x0000 0211; 0x0000 0280; 0x0000 0200 - a RID? */ + DOM_SID2 dom_sid; /* domain SID */ + +} SAMR_Q_OPEN_DOMAIN; + + +/* SAMR_R_OPEN_DOMAIN - probably an open */ +typedef struct r_samr_open_domain_info +{ + POLICY_HND domain_pol; /* policy handle associated with the SID */ + uint32 status; /* return status */ + +} SAMR_R_OPEN_DOMAIN; + + +#define MAX_SAM_ENTRIES 250 + +typedef struct samr_entry_info +{ + uint32 rid; + UNIHDR hdr_name; + +} SAM_ENTRY; + +/* SAMR_Q_ENUM_DOM_USERS - SAM rids and names */ +typedef struct q_samr_enum_dom_users_info +{ + POLICY_HND pol; /* policy handle */ + + uint16 req_num_entries; /* number of values (0 indicates unlimited?) */ + uint16 unknown_0; /* enumeration context? */ + uint16 acb_mask; /* 0x0000 indicates all */ + uint16 unknown_1; /* 0x0000 */ + + uint32 max_size; /* 0x0000 ffff */ + +} SAMR_Q_ENUM_DOM_USERS; + + +/* SAMR_R_ENUM_DOM_USERS - SAM rids and names */ +typedef struct r_samr_enum_dom_users_info +{ + uint16 total_num_entries; /* number of entries that match without the acb mask */ + uint16 unknown_0; /* same as unknown_0 (enum context?) in request */ + uint32 ptr_entries1; /* actual number of entries to follow, having masked some out */ + + uint32 num_entries2; + uint32 ptr_entries2; + + uint32 num_entries3; + + SAM_ENTRY sam[MAX_SAM_ENTRIES]; + UNISTR2 uni_acct_name[MAX_SAM_ENTRIES]; + + uint32 num_entries4; + + uint32 status; + +} SAMR_R_ENUM_DOM_USERS; + + +typedef struct samr_entry_info3 +{ + uint32 grp_idx; + + uint32 rid_grp; + uint32 attr; + + UNIHDR hdr_grp_name; + UNIHDR hdr_grp_desc; + +} SAM_ENTRY3; + +typedef struct samr_str_entry_info3 +{ + UNISTR2 uni_grp_name; + UNISTR2 uni_grp_desc; + +} SAM_STR3; + +/* SAMR_Q_ENUM_DOM_GROUPS - SAM rids and names */ +typedef struct q_samr_enum_dom_groups_info +{ + POLICY_HND pol; /* policy handle */ + + /* these are possibly an enumeration context handle... */ + uint16 switch_level; /* 0x0003 */ + uint16 unknown_0; /* 0x0000 */ + uint32 start_idx; /* presumably the start enumeration index */ + uint32 unknown_1; /* 0x0000 07d0 */ + + uint32 max_size; /* 0x0000 7fff */ + +} SAMR_Q_ENUM_DOM_GROUPS; + + +/* SAMR_R_ENUM_DOM_GROUPS - SAM rids and names */ +typedef struct r_samr_enum_dom_groups_info +{ + uint32 unknown_0; /* 0x0000 0492 or 0x0000 00be */ + uint32 unknown_1; /* 0x0000 049a or 0x0000 00be */ + uint32 switch_level; /* 0x0000 0003 */ + + uint32 num_entries; + uint32 ptr_entries; + + uint32 num_entries2; + + SAM_ENTRY3 sam[MAX_SAM_ENTRIES]; + SAM_STR3 str[MAX_SAM_ENTRIES]; + + uint32 status; + +} SAMR_R_ENUM_DOM_GROUPS; + + + +/* SAMR_Q_ENUM_DOM_ALIASES - SAM rids and names */ +typedef struct q_samr_enum_dom_aliases_info +{ + POLICY_HND pol; /* policy handle */ + + /* this is possibly an enumeration context handle... */ + uint32 unknown_0; /* 0x0000 0000 */ + + uint32 max_size; /* 0x0000 ffff */ + +} SAMR_Q_ENUM_DOM_ALIASES; + +/* SAMR_R_ENUM_DOM_ALIASES - SAM rids and names */ +typedef struct r_samr_enum_dom_aliases_info +{ + uint32 num_entries; + uint32 ptr_entries; + + uint32 num_entries2; + uint32 ptr_entries2; + + uint32 num_entries3; + + SAM_ENTRY sam[MAX_SAM_ENTRIES]; + UNISTR2 uni_grp_name[MAX_SAM_ENTRIES]; + + uint32 num_entries4; + + uint32 status; + +} SAMR_R_ENUM_DOM_ALIASES; + + + +/* SAMR_Q_QUERY_DISPINFO - SAM rids, names and descriptions */ +typedef struct q_samr_query_disp_info +{ + POLICY_HND pol; /* policy handle */ + + uint16 switch_level; /* 0x0001 and 0x0002 seen */ + uint16 unknown_0; /* 0x0000 and 0x2000 seen */ + uint32 start_idx; /* presumably the start enumeration index */ + uint32 unknown_1; /* 0x0000 07d0, 0x0000 0400 and 0x0000 0200 seen */ + + uint32 max_size; /* 0x0000 7fff, 0x0000 7ffe and 0x0000 3fff seen*/ + +} SAMR_Q_QUERY_DISPINFO; + +typedef struct samr_entry_info1 +{ + uint32 user_idx; + + uint32 rid_user; + uint16 acb_info; + uint16 pad; + + UNIHDR hdr_acct_name; + UNIHDR hdr_user_name; + UNIHDR hdr_user_desc; + +} SAM_ENTRY1; + +typedef struct samr_str_entry_info1 +{ + UNISTR2 uni_acct_name; + UNISTR2 uni_full_name; + UNISTR2 uni_acct_desc; + +} SAM_STR1; + +typedef struct sam_entry_info_1 +{ + uint32 num_entries; + uint32 ptr_entries; + uint32 num_entries2; + + SAM_ENTRY1 sam[MAX_SAM_ENTRIES]; + SAM_STR1 str[MAX_SAM_ENTRIES]; + + +} SAM_INFO_1; + +typedef struct samr_entry_info2 +{ + uint32 user_idx; + + uint32 rid_user; + uint16 acb_info; + uint16 pad; + + UNIHDR hdr_srv_name; + UNIHDR hdr_srv_desc; + +} SAM_ENTRY2; + +typedef struct samr_str_entry_info2 +{ + UNISTR2 uni_srv_name; + UNISTR2 uni_srv_desc; + +} SAM_STR2; + +typedef struct sam_entry_info_2 +{ + uint32 num_entries; + uint32 ptr_entries; + uint32 num_entries2; + + SAM_ENTRY2 sam[MAX_SAM_ENTRIES]; + SAM_STR2 str[MAX_SAM_ENTRIES]; + +} SAM_INFO_2; + +typedef struct sam_info_ctr_info +{ + union + { + SAM_INFO_1 *info1; /* server info */ + SAM_INFO_2 *info2; /* user info */ + void *info; /* allows assignment without typecasting, */ + + } sam; + +} SAM_INFO_CTR; + +/* SAMR_R_QUERY_DISPINFO - SAM rids, names and descriptions */ +typedef struct r_samr_query_dispinfo_info +{ + uint32 unknown_0; /* container length? 0x0000 0492 or 0x0000 00be */ + uint32 unknown_1; /* container length? 0x0000 049a or 0x0000 00be */ + uint16 switch_level; /* 0x0001 or 0x0002 */ + /*uint8 pad[2] */ + + SAM_INFO_CTR *ctr; + + uint32 status; + +} SAMR_R_QUERY_DISPINFO; + + + +/* SAMR_Q_QUERY_ALIASINFO - SAM Alias Info */ +typedef struct q_samr_enum_alias_info +{ + POLICY_HND pol; /* policy handle */ + + uint16 switch_level; /* 0x0003 seen */ + +} SAMR_Q_QUERY_ALIASINFO; + +typedef struct samr_alias_info3 +{ + UNIHDR hdr_acct_desc; + UNISTR2 uni_acct_desc; + +} ALIAS_INFO3; + +/* SAMR_R_QUERY_ALIASINFO - SAM rids, names and descriptions */ +typedef struct r_samr_query_aliasinfo_info +{ + uint32 ptr; + uint16 switch_value; /* 0x0003 */ + /* uint8[2] padding */ + + union + { + ALIAS_INFO3 info3; + + } alias; + + uint32 status; + +} SAMR_R_QUERY_ALIASINFO; + + +/* SAMR_Q_QUERY_USERGROUPS - */ +typedef struct q_samr_query_usergroup_info +{ + POLICY_HND pol; /* policy handle associated with unknown id */ + +} SAMR_Q_QUERY_USERGROUPS; + +/* SAMR_R_QUERY_USERGROUPS - probably a get sam info */ +typedef struct r_samr_query_usergroup_info +{ + uint32 ptr_0; /* pointer */ + uint32 num_entries; /* number of RID groups */ + uint32 ptr_1; /* pointer */ + uint32 num_entries2; /* number of RID groups */ + + DOM_GID *gid; /* group info */ + + uint32 status; /* return status */ + +} SAMR_R_QUERY_USERGROUPS; + + +/* SAMR_Q_QUERY_USERINFO - probably a get sam info */ +typedef struct q_samr_query_user_info +{ + POLICY_HND pol; /* policy handle associated with unknown id */ + uint16 switch_value; /* 0x0015, 0x0011 or 0x0010 - 16 bit unknown */ + +} SAMR_Q_QUERY_USERINFO; + +/* SAMR_R_QUERY_USERINFO - probably a get sam info */ +typedef struct r_samr_query_user_info +{ + uint32 ptr; /* pointer */ + uint16 switch_value; /* 0x0015, 0x0011 or 0x0010 - same as in query */ + /* uint8[2] padding. */ + + union + { + SAM_USER_INFO_10 *id10; /* auth-level 0x10 */ + SAM_USER_INFO_11 *id11; /* auth-level 0x11 */ + SAM_USER_INFO_21 *id21; /* auth-level 21 */ + void* id; /* to make typecasting easy */ + + } info; + + uint32 status; /* return status */ + +} SAMR_R_QUERY_USERINFO; + + +/**************************************************************************** +SAMR_Q_LOOKUP_IDS - do a conversion from name to RID. + +the policy handle allocated by an "samr open secret" call is associated +with a SID. this policy handle is what is queried here, *not* the SID +itself. the response to the lookup rids is relative to this SID. +*****************************************************************************/ +/* SAMR_Q_LOOKUP_IDS */ +typedef struct q_samr_lookup_ids_info +{ + POLICY_HND pol; /* policy handle */ + + uint32 num_sids1; /* number of rids being looked up */ + uint32 ptr; /* buffer pointer */ + uint32 num_sids2; /* number of rids being looked up */ + + uint32 ptr_sid[MAX_LOOKUP_SIDS]; /* pointers to sids to be looked up */ + DOM_SID2 sid [MAX_LOOKUP_SIDS]; /* sids to be looked up. */ + +} SAMR_Q_LOOKUP_IDS; + + +/* SAMR_R_LOOKUP_IDS */ +typedef struct r_samr_lookup_ids_info +{ + uint32 num_entries; + uint32 ptr; /* undocumented buffer pointer */ + + uint32 num_entries2; + uint32 rid[MAX_LOOKUP_SIDS]; /* domain RIDs being looked up */ + + uint32 status; /* return code */ + +} SAMR_R_LOOKUP_IDS; + + +/**************************************************************************** +SAMR_Q_LOOKUP_NAMES - do a conversion from SID to RID. + +the policy handle allocated by an "samr open secret" call is associated +with a SID. this policy handle is what is queried here, *not* the SID +itself. the response to the lookup rids is relative to this SID. +*****************************************************************************/ +/* SAMR_Q_LOOKUP_NAMES */ +typedef struct q_samr_lookup_names_info +{ + POLICY_HND pol; /* policy handle */ + + uint32 num_rids1; /* number of rids being looked up */ + uint32 rid; /* 0x0000 03e8 - RID of the server doing the query? */ + uint32 ptr; /* 0x0000 0000 - 32 bit unknown */ + uint32 num_rids2; /* number of rids being looked up */ + + UNIHDR hdr_user_name[MAX_LOOKUP_SIDS]; /* unicode account name header */ + UNISTR2 uni_user_name[MAX_LOOKUP_SIDS]; /* unicode account name string */ + +} SAMR_Q_LOOKUP_NAMES; + + +/* SAMR_R_LOOKUP_NAMES */ +typedef struct r_samr_lookup_names_info +{ + uint32 num_entries; + uint32 undoc_buffer; /* undocumented buffer pointer */ + + uint32 num_entries2; + DOM_RID3 dom_rid[MAX_LOOKUP_SIDS]; /* domain RIDs being looked up */ + + uint32 num_entries3; + + uint32 status; /* return code */ + +} SAMR_R_LOOKUP_NAMES; + + +/**************************************************************************** +SAMR_Q_UNKNOWN_12 - do a conversion from RID groups to something. + +called to resolve domain RID groups. +*****************************************************************************/ +/* SAMR_Q_UNKNOWN_12 */ +typedef struct q_samr_unknown_12_info +{ + POLICY_HND pol; /* policy handle */ + + uint32 num_gids1; /* number of rids being looked up */ + uint32 rid; /* 0x0000 03e8 - RID of the server doing the query? */ + uint32 ptr; /* 0x0000 0000 - 32 bit unknown */ + uint32 num_gids2; /* number of rids being looked up */ + + uint32 gid[MAX_LOOKUP_SIDS]; /* domain RIDs being looked up */ + +} SAMR_Q_UNKNOWN_12; + + +/**************************************************************************** +SAMR_R_UNKNOWN_12 - do a conversion from group RID to names + +*****************************************************************************/ +/* SAMR_R_UNKNOWN_12 */ +typedef struct r_samr_unknown_12_info +{ + POLICY_HND pol; /* policy handle */ + + uint32 num_aliases1; /* number of aliases being looked up */ + uint32 ptr_aliases; /* pointer to aliases */ + uint32 num_aliases2; /* number of aliases being looked up */ + + UNIHDR hdr_als_name[MAX_LOOKUP_SIDS]; /* unicode account name header */ + UNISTR2 uni_als_name[MAX_LOOKUP_SIDS]; /* unicode account name string */ + + uint32 num_als_usrs1; /* number of users in aliases being looked up */ + uint32 ptr_als_usrs; /* pointer to users in aliases */ + uint32 num_als_usrs2; /* number of users in aliases being looked up */ + + uint32 num_als_usrs[MAX_LOOKUP_SIDS]; /* number of users per group */ + + uint32 status; + +} SAMR_R_UNKNOWN_12; + + +/* SAMR_Q_OPEN_USER - probably an open */ +typedef struct q_samr_open_user_info +{ + POLICY_HND domain_pol; /* policy handle */ + uint32 unknown_0; /* 32 bit unknown - 0x02011b */ + uint32 user_rid; /* user RID */ + +} SAMR_Q_OPEN_USER; + + +/* SAMR_R_OPEN_USER - probably an open */ +typedef struct r_samr_open_user_info +{ + POLICY_HND user_pol; /* policy handle associated with unknown id */ + uint32 status; /* return status */ + +} SAMR_R_OPEN_USER; + + +/* SAMR_Q_UNKNOWN_13 - probably an open alias in domain */ +typedef struct q_samr_unknown_13_info +{ + POLICY_HND alias_pol; /* policy handle */ + + uint16 unknown_1; /* 16 bit unknown - 0x0200 */ + uint16 unknown_2; /* 16 bit unknown - 0x0000 */ + +} SAMR_Q_UNKNOWN_13; + + +/* SAMR_Q_UNKNOWN_21 - probably an open group in domain */ +typedef struct q_samr_unknown_21_info +{ + POLICY_HND group_pol; /* policy handle */ + + uint16 unknown_1; /* 16 bit unknown - 0x0477 */ + uint16 unknown_2; /* 16 bit unknown - 0x0000 */ + +} SAMR_Q_UNKNOWN_21; + + +/* SAMR_Q_UNKNOWN_32 - probably a "create SAM entry" */ +typedef struct q_samr_unknown_32_info +{ + POLICY_HND pol; /* policy handle */ + + UNIHDR hdr_mach_acct; /* unicode machine account name header */ + UNISTR2 uni_mach_acct; /* unicode machine account name */ + + uint32 acct_ctrl; /* 32 bit ACB_XXXX */ + uint16 unknown_1; /* 16 bit unknown - 0x00B0 */ + uint16 unknown_2; /* 16 bit unknown - 0xe005 */ + +} SAMR_Q_UNKNOWN_32; + + +/* SAMR_R_UNKNOWN_32 - probably a "create SAM entry" */ +typedef struct r_samr_unknown_32_info +{ + POLICY_HND pol; /* policy handle */ + + /* rid4.unknown - fail: 0030 success: 0x03ff */ + DOM_RID4 rid4; /* rid and attributes */ + + uint32 status; /* return status - fail: 0xC000 0099: user exists */ + +} SAMR_R_UNKNOWN_32; + + +/* SAMR_Q_OPEN_ALIAS - probably an open */ +typedef struct q_samr_open_alias_info +{ + uint32 unknown_0; /* 0x0000 0008 */ + uint32 rid_alias; /* rid */ + +} SAMR_Q_OPEN_ALIAS; + + +/* SAMR_R_OPEN_ALIAS - probably an open */ +typedef struct r_samr_open_alias_info +{ + POLICY_HND pol; /* policy handle */ + uint32 status; /* return status */ + +} SAMR_R_OPEN_ALIAS; + + +/* SAMR_Q_CONNECT - probably an open */ +typedef struct q_samr_connect_info +{ + uint32 ptr_srv_name; /* pointer (to server name?) */ + UNISTR2 uni_srv_name; /* unicode server name starting with '\\' */ + + uint32 unknown_0; /* 32 bit unknown */ + +} SAMR_Q_CONNECT; + + +/* SAMR_R_CONNECT - probably an open */ +typedef struct r_samr_connect_info +{ + POLICY_HND connect_pol; /* policy handle */ + uint32 status; /* return status */ + +} SAMR_R_CONNECT; + +/* SAMR_Q_UNKNOWN_38 */ +typedef struct q_samr_unknown_38 +{ + uint32 ptr; + UNIHDR hdr_srv_name; + UNISTR2 uni_srv_name; + +} SAMR_Q_UNKNOWN_38; + +/* SAMR_R_UNKNOWN_38 */ +typedef struct r_samr_unknown_38 +{ + LOOKUP_LEVEL level; /* 0x0006 */ + uint32 ptr_0; /* 0x0000 0000 */ + uint32 status; + +} SAMR_R_UNKNOWN_38; + +/* SAMR_ENC_PASSWD */ +typedef struct enc_passwd_info +{ + uint32 ptr; + uint8 pass[516]; + +} SAMR_ENC_PASSWD; + +/* SAMR_ENC_HASH */ +typedef struct enc_hash_info +{ + uint32 ptr; + uint8 hash[16]; + +} SAMR_ENC_HASH; + +/* SAMR_Q_CHGPASSWD_USER */ +typedef struct q_samr_chgpasswd_user_info +{ + uint32 ptr_0; + + UNIHDR hdr_server; /* server name unicode header */ + UNISTR2 uni_server; /* server name unicode string */ + + UNIHDR hdr_user_name; /* username unicode string header */ + UNISTR2 uni_user_name; /* username unicode string */ + + SAMR_ENC_PASSWD nt_newpass; + SAMR_ENC_HASH nt_oldhash; + + uint32 unknown_1; /* seems to always contain 0001 */ + + SAMR_ENC_PASSWD lm_newpass; + SAMR_ENC_HASH lm_oldhash; + +} SAMR_Q_CHGPASSWD_USER; + +/* SAMR_R_CHGPASSWD_USER */ +typedef struct r_samr_chgpasswd_user_info +{ + uint32 result; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */ + +} SAMR_R_CHGPASSWD_USER; + +#endif /* _RPC_SAMR_H */ + diff --git a/source3/include/rpc_srvsvc.h b/source3/include/rpc_srvsvc.h new file mode 100644 index 0000000000..4d11b915e4 --- /dev/null +++ b/source3/include/rpc_srvsvc.h @@ -0,0 +1,540 @@ +/* + Unix SMB/Netbios implementation. + Version 1.9. + SMB parameters and setup + Copyright (C) Andrew Tridgell 1992-1997 + Copyright (C) Luke Kenneth Casson Leighton 1996-1997 + Copyright (C) Paul Ashton 1997 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _RPC_SRVSVC_H /* _RPC_SRVSVC_H */ +#define _RPC_SRVSVC_H + + +/* srvsvc pipe */ +#define SRV_NETCONNENUM 0x08 +#define SRV_NETFILEENUM 0x09 +#define SRV_NETSESSENUM 0x0c +#define SRV_NETSHAREENUM 0x0f +#define SRV_NET_SRV_GET_INFO 0x15 +#define SRV_NET_SRV_SET_INFO 0x16 + + +/* SESS_INFO_0 (pointers to level 0 session info strings) */ +typedef struct ptr_sess_info0 +{ + uint32 ptr_name; /* pointer to name. */ + +} SESS_INFO_0; + +/* SESS_INFO_0_STR (level 0 session info strings) */ +typedef struct str_sess_info0 +{ + UNISTR2 uni_name; /* unicode string of name */ + +} SESS_INFO_0_STR; + +/* oops - this is going to take up a *massive* amount of stack. */ +/* the UNISTR2s already have 1024 uint16 chars in them... */ +#define MAX_SESS_ENTRIES 32 + +/* SRV_SESS_INFO_0 */ +typedef struct srv_sess_info_0_info +{ + uint32 num_entries_read; /* EntriesRead */ + uint32 ptr_sess_info; /* Buffer */ + uint32 num_entries_read2; /* EntriesRead */ + + SESS_INFO_0 info_0 [MAX_SESS_ENTRIES]; /* session entry pointers */ + SESS_INFO_0_STR info_0_str[MAX_SESS_ENTRIES]; /* session entry strings */ + +} SRV_SESS_INFO_0; + +/* SESS_INFO_1 (pointers to level 1 session info strings) */ +typedef struct ptr_sess_info1 +{ + uint32 ptr_name; /* pointer to name. */ + uint32 ptr_user; /* pointer to user name. */ + + uint32 num_opens; + uint32 open_time; + uint32 idle_time; + uint32 user_flags; + +} SESS_INFO_1; + +/* SESS_INFO_1_STR (level 1 session info strings) */ +typedef struct str_sess_info1 +{ + UNISTR2 uni_name; /* unicode string of name */ + UNISTR2 uni_user; /* unicode string of user */ + +} SESS_INFO_1_STR; + +/* SRV_SESS_INFO_1 */ +typedef struct srv_sess_info_1_info +{ + uint32 num_entries_read; /* EntriesRead */ + uint32 ptr_sess_info; /* Buffer */ + uint32 num_entries_read2; /* EntriesRead */ + + SESS_INFO_1 info_1 [MAX_SESS_ENTRIES]; /* session entry pointers */ + SESS_INFO_1_STR info_1_str[MAX_SESS_ENTRIES]; /* session entry strings */ + +} SRV_SESS_INFO_1; + +/* SRV_SESS_INFO_CTR */ +typedef struct srv_sess_info_ctr_info +{ + uint32 switch_value; /* switch value */ + uint32 ptr_sess_ctr; /* pointer to sess info union */ + union + { + SRV_SESS_INFO_0 info0; /* session info level 0 */ + SRV_SESS_INFO_1 info1; /* session info level 1 */ + + } sess; + +} SRV_SESS_INFO_CTR; + + +/* SRV_Q_NET_SESS_ENUM */ +typedef struct q_net_sess_enum_info +{ + uint32 ptr_srv_name; /* pointer (to server name?) */ + UNISTR2 uni_srv_name; /* server name */ + + uint32 ptr_qual_name; /* pointer (to qualifier name) */ + UNISTR2 uni_qual_name; /* qualifier name "\\qualifier" */ + + uint32 sess_level; /* session level */ + + SRV_SESS_INFO_CTR *ctr; + + uint32 preferred_len; /* preferred maximum length (0xffff ffff) */ + ENUM_HND enum_hnd; + +} SRV_Q_NET_SESS_ENUM; + +/* SRV_R_NET_SESS_ENUM */ +typedef struct r_net_sess_enum_info +{ + uint32 sess_level; /* share level */ + + SRV_SESS_INFO_CTR *ctr; + + uint32 total_entries; /* total number of entries */ + ENUM_HND enum_hnd; + + uint32 status; /* return status */ + +} SRV_R_NET_SESS_ENUM; + +/* CONN_INFO_0 (pointers to level 0 connection info strings) */ +typedef struct ptr_conn_info0 +{ + uint32 id; /* connection id. */ + +} CONN_INFO_0; + +/* oops - this is going to take up a *massive* amount of stack. */ +/* the UNISTR2s already have 1024 uint16 chars in them... */ +#define MAX_CONN_ENTRIES 32 + +/* SRV_CONN_INFO_0 */ +typedef struct srv_conn_info_0_info +{ + uint32 num_entries_read; /* EntriesRead */ + uint32 ptr_conn_info; /* Buffer */ + uint32 num_entries_read2; /* EntriesRead */ + + CONN_INFO_0 info_0 [MAX_CONN_ENTRIES]; /* connection entry pointers */ + +} SRV_CONN_INFO_0; + +/* CONN_INFO_1 (pointers to level 1 connection info strings) */ +typedef struct ptr_conn_info1 +{ + uint32 id; /* connection id */ + uint32 type; /* 0x3 */ + uint32 num_opens; + uint32 num_users; + uint32 open_time; + + uint32 ptr_usr_name; /* pointer to user name. */ + uint32 ptr_net_name; /* pointer to network name (e.g IPC$). */ + +} CONN_INFO_1; + +/* CONN_INFO_1_STR (level 1 connection info strings) */ +typedef struct str_conn_info1 +{ + UNISTR2 uni_usr_name; /* unicode string of user */ + UNISTR2 uni_net_name; /* unicode string of name */ + +} CONN_INFO_1_STR; + +/* SRV_CONN_INFO_1 */ +typedef struct srv_conn_info_1_info +{ + uint32 num_entries_read; /* EntriesRead */ + uint32 ptr_conn_info; /* Buffer */ + uint32 num_entries_read2; /* EntriesRead */ + + CONN_INFO_1 info_1 [MAX_CONN_ENTRIES]; /* connection entry pointers */ + CONN_INFO_1_STR info_1_str[MAX_CONN_ENTRIES]; /* connection entry strings */ + +} SRV_CONN_INFO_1; + +/* SRV_CONN_INFO_CTR */ +typedef struct srv_conn_info_ctr_info +{ + uint32 switch_value; /* switch value */ + uint32 ptr_conn_ctr; /* pointer to conn info union */ + union + { + SRV_CONN_INFO_0 info0; /* connection info level 0 */ + SRV_CONN_INFO_1 info1; /* connection info level 1 */ + + } conn; + +} SRV_CONN_INFO_CTR; + + +/* SRV_Q_NET_CONN_ENUM */ +typedef struct q_net_conn_enum_info +{ + uint32 ptr_srv_name; /* pointer (to server name) */ + UNISTR2 uni_srv_name; /* server name "\\server" */ + + uint32 ptr_qual_name; /* pointer (to qualifier name) */ + UNISTR2 uni_qual_name; /* qualifier name "\\qualifier" */ + + uint32 conn_level; /* connection level */ + + SRV_CONN_INFO_CTR *ctr; + + uint32 preferred_len; /* preferred maximum length (0xffff ffff) */ + ENUM_HND enum_hnd; + +} SRV_Q_NET_CONN_ENUM; + +/* SRV_R_NET_CONN_ENUM */ +typedef struct r_net_conn_enum_info +{ + uint32 conn_level; /* share level */ + + SRV_CONN_INFO_CTR *ctr; + + uint32 total_entries; /* total number of entries */ + ENUM_HND enum_hnd; + + uint32 status; /* return status */ + +} SRV_R_NET_CONN_ENUM; + +/* oops - this is going to take up a *massive* amount of stack. */ +/* the UNISTR2s already have 1024 uint16 chars in them... */ +#define MAX_SHARE_ENTRIES 32 + +/* SH_INFO_1 (pointers to level 1 share info strings) */ +typedef struct ptr_share_info1 +{ + uint32 ptr_netname; /* pointer to net name. */ + uint32 type; /* ipc, print, disk ... */ + uint32 ptr_remark; /* pointer to comment. */ + +} SH_INFO_1; + +/* SH_INFO_1_STR (level 1 share info strings) */ +typedef struct str_share_info1 +{ + UNISTR2 uni_netname; /* unicode string of net name */ + UNISTR2 uni_remark; /* unicode string of comment */ + +} SH_INFO_1_STR; + +/* SRV_SHARE_INFO_1 */ +typedef struct share_info_1_info +{ + uint32 num_entries_read; /* EntriesRead */ + uint32 ptr_share_info; /* Buffer */ + uint32 num_entries_read2; /* EntriesRead */ + + SH_INFO_1 info_1 [MAX_SHARE_ENTRIES]; /* share entry pointers */ + SH_INFO_1_STR info_1_str[MAX_SHARE_ENTRIES]; /* share entry strings */ + +} SRV_SHARE_INFO_1; + +/* SH_INFO_2 (pointers to level 2 share info strings) */ +typedef struct ptr_share_info2 +{ + uint32 ptr_netname; /* pointer to net name. */ + uint32 type; /* ipc, print, disk ... */ + uint32 ptr_remark; /* pointer to comment. */ + uint32 perms; /* permissions */ + uint32 max_uses; /* maximum uses */ + uint32 num_uses; /* current uses */ + uint32 ptr_path; /* pointer to path name */ + uint32 ptr_passwd; /* pointer to password */ + +} SH_INFO_2; + +/* SH_INFO_2_STR (level 2 share info strings) */ +typedef struct str_share_info2 +{ + UNISTR2 uni_netname; /* unicode string of net name (e.g NETLOGON) */ + UNISTR2 uni_remark; /* unicode string of comment (e.g "Logon server share") */ + UNISTR2 uni_path; /* unicode string of local path (e.g c:\winnt\system32\repl\import\scripts) */ + UNISTR2 uni_passwd; /* unicode string of password - presumably for share level security (e.g NULL) */ + +} SH_INFO_2_STR; + +/* SRV_SHARE_INFO_2 */ +typedef struct share_info_2_info +{ + uint32 num_entries_read; /* EntriesRead */ + uint32 ptr_share_info; /* Buffer */ + uint32 num_entries_read2; /* EntriesRead */ + + SH_INFO_2 info_2 [MAX_SHARE_ENTRIES]; /* share entry pointers */ + SH_INFO_2_STR info_2_str[MAX_SHARE_ENTRIES]; /* share entry strings */ + +} SRV_SHARE_INFO_2; + +/* SRV_SHARE_INFO_CTR */ +typedef struct srv_share_info_1_info +{ + uint32 switch_value; /* switch value */ + uint32 ptr_share_ctr; /* pointer to share info union */ + union + { + SRV_SHARE_INFO_1 info1; /* share info level 1 */ + SRV_SHARE_INFO_2 info2; /* share info level 2 */ + + } share; + +} SRV_SHARE_INFO_CTR; + +/* SRV_Q_NET_SHARE_ENUM */ +typedef struct q_net_share_enum_info +{ + uint32 ptr_srv_name; /* pointer (to server name?) */ + UNISTR2 uni_srv_name; /* server name */ + + uint32 share_level; /* share level */ + + SRV_SHARE_INFO_CTR *ctr; /* share info container */ + + uint32 preferred_len; /* preferred maximum length (0xffff ffff) */ + + ENUM_HND enum_hnd; + +} SRV_Q_NET_SHARE_ENUM; + + +/* SRV_R_NET_SHARE_ENUM */ +typedef struct r_net_share_enum_info +{ + uint32 share_level; /* share level */ + SRV_SHARE_INFO_CTR *ctr; /* share info container */ + + uint32 total_entries; /* total number of entries */ + ENUM_HND enum_hnd; + + uint32 status; /* return status */ + +} SRV_R_NET_SHARE_ENUM; + +/* FILE_INFO_3 (level 3 file info strings) */ +typedef struct file_info3_info +{ + uint32 id; /* file index */ + uint32 perms; /* file permissions. don't know what format */ + uint32 num_locks; /* file locks */ + uint32 ptr_path_name; /* file name */ + uint32 ptr_user_name; /* file owner */ + +} FILE_INFO_3; + +/* FILE_INFO_3_STR (level 3 file info strings) */ +typedef struct str_file_info3_info +{ + UNISTR2 uni_path_name; /* unicode string of file name */ + UNISTR2 uni_user_name; /* unicode string of file owner. */ + +} FILE_INFO_3_STR; + +/* oops - this is going to take up a *massive* amount of stack. */ +/* the UNISTR2s already have 1024 uint16 chars in them... */ +#define MAX_FILE_ENTRIES 32 + +/* SRV_FILE_INFO_3 */ +typedef struct srv_file_info_3 +{ + uint32 num_entries_read; /* EntriesRead */ + uint32 ptr_file_info; /* Buffer */ + + uint32 num_entries_read2; /* EntriesRead */ + + FILE_INFO_3 info_3 [MAX_FILE_ENTRIES]; /* file entry details */ + FILE_INFO_3_STR info_3_str[MAX_FILE_ENTRIES]; /* file entry strings */ + +} SRV_FILE_INFO_3; + +/* SRV_FILE_INFO_CTR */ +typedef struct srv_file_info_3_info +{ + uint32 switch_value; /* switch value */ + uint32 ptr_file_ctr; /* pointer to file info union */ + union + { + SRV_FILE_INFO_3 info3; /* file info with 0 entries */ + + } file; + +} SRV_FILE_INFO_CTR; + + +/* SRV_Q_NET_FILE_ENUM */ +typedef struct q_net_file_enum_info +{ + uint32 ptr_srv_name; /* pointer (to server name?) */ + UNISTR2 uni_srv_name; /* server name */ + + uint32 ptr_qual_name; /* pointer (to qualifier name) */ + UNISTR2 uni_qual_name; /* qualifier name "\\qualifier" */ + + uint32 file_level; /* file level */ + + SRV_FILE_INFO_CTR *ctr; + + uint32 preferred_len; /* preferred maximum length (0xffff ffff) */ + ENUM_HND enum_hnd; + +} SRV_Q_NET_FILE_ENUM; + + +/* SRV_R_NET_FILE_ENUM */ +typedef struct r_net_file_enum_info +{ + uint32 file_level; /* file level */ + + SRV_FILE_INFO_CTR *ctr; + + uint32 total_entries; /* total number of files */ + ENUM_HND enum_hnd; + + uint32 status; /* return status */ + +} SRV_R_NET_FILE_ENUM; + +/* SRV_INFO_101 */ +typedef struct srv_info_101_info +{ + uint32 platform_id; /* 0x500 */ + uint32 ptr_name; /* pointer to server name */ + uint32 ver_major; /* 0x4 */ + uint32 ver_minor; /* 0x2 */ + uint32 srv_type; /* browse etc type */ + uint32 ptr_comment; /* pointer to server comment */ + + UNISTR2 uni_name; /* server name "server" */ + UNISTR2 uni_comment; /* server comment "samba x.x.x blah" */ + +} SRV_INFO_101; + +/* SRV_INFO_102 */ +typedef struct srv_info_102_info +{ + uint32 platform_id; /* 0x500 */ + uint32 ptr_name; /* pointer to server name */ + uint32 ver_major; /* 0x4 */ + uint32 ver_minor; /* 0x2 */ + uint32 srv_type; /* browse etc type */ + uint32 ptr_comment; /* pointer to server comment */ + uint32 users; /* 0xffff ffff*/ + uint32 disc; /* 0xf */ + uint32 hidden; /* 0x0 */ + uint32 announce; /* 240 */ + uint32 ann_delta; /* 3000 */ + uint32 licenses; /* 0 */ + uint32 ptr_usr_path; /* pointer to user path */ + + UNISTR2 uni_name; /* server name "server" */ + UNISTR2 uni_comment; /* server comment "samba x.x.x blah" */ + UNISTR2 uni_usr_path; /* "c:\" (eh?) */ + +} SRV_INFO_102; + + +/* SRV_INFO_CTR */ +typedef struct srv_info_ctr_info +{ + uint32 switch_value; /* switch value */ + uint32 ptr_srv_ctr; /* pointer to server info */ + union + { + SRV_INFO_102 sv102; /* server info level 102 */ + SRV_INFO_101 sv101; /* server info level 101 */ + + } srv; + +} SRV_INFO_CTR; + +/* SRV_Q_NET_SRV_GET_INFO */ +typedef struct q_net_srv_get_info +{ + uint32 ptr_srv_name; + UNISTR2 uni_srv_name; /* "\\server" */ + uint32 switch_value; + +} SRV_Q_NET_SRV_GET_INFO; + +/* SRV_R_NET_SRV_GET_INFO */ +typedef struct r_net_srv_get_info +{ + SRV_INFO_CTR *ctr; + + uint32 status; /* return status */ + +} SRV_R_NET_SRV_GET_INFO; + +/* SRV_Q_NET_SRV_SET_INFO */ +typedef struct q_net_srv_set_info +{ + uint32 ptr_srv_name; + UNISTR2 uni_srv_name; /* "\\server" */ + uint32 switch_value; + + SRV_INFO_CTR *ctr; + +} SRV_Q_NET_SRV_SET_INFO; + + +/* SRV_R_NET_SRV_SET_INFO */ +typedef struct r_net_srv_set_info +{ + uint32 switch_value; /* switch value */ + + uint32 status; /* return status */ + +} SRV_R_NET_SRV_SET_INFO; + + +#endif /* _RPC_SRVSVC_H */ + diff --git a/source3/include/rpc_wkssvc.h b/source3/include/rpc_wkssvc.h new file mode 100644 index 0000000000..1483997acb --- /dev/null +++ b/source3/include/rpc_wkssvc.h @@ -0,0 +1,73 @@ +/* + Unix SMB/Netbios implementation. + Version 1.9. + SMB parameters and setup + Copyright (C) Andrew Tridgell 1992-1997 + Copyright (C) Luke Kenneth Casson Leighton 1996-1997 + Copyright (C) Paul Ashton 1997 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _RPC_WKS_H /* _RPC_WKS_H */ +#define _RPC_WKS_H + + +/* wkssvc pipe */ +#define WKS_QUERY_INFO 0x00 + + +/* WKS_Q_QUERY_INFO - probably a capabilities request */ +typedef struct q_wks_query_info_info +{ + uint32 ptr_srv_name; /* pointer (to server name?) */ + UNISTR2 uni_srv_name; /* unicode server name starting with '\\' */ + + uint16 switch_value; /* info level 100 (0x64) */ + +} WKS_Q_QUERY_INFO; + + +/* WKS_INFO_100 - level 100 info */ +typedef struct wks_info_100_info +{ + uint32 platform_id; /* 0x0000 01f4 - unknown */ + uint32 ptr_compname; /* pointer to server name */ + uint32 ptr_lan_grp ; /* pointer to domain name */ + uint32 ver_major; /* 4 - unknown */ + uint32 ver_minor; /* 0 - unknown */ + + UNISTR2 uni_compname; /* unicode server name */ + UNISTR2 uni_lan_grp ; /* unicode domain name */ + +} WKS_INFO_100; + + +/* WKS_R_QUERY_INFO - probably a capabilities request */ +typedef struct r_wks_query_info_info +{ + uint16 switch_value; /* 100 (0x64) - switch value */ + + /* for now, only level 100 is supported. this should be an enum container */ + uint32 ptr_1; /* pointer 1 */ + WKS_INFO_100 *wks100; /* workstation info level 100 */ + + uint32 status; /* return status */ + +} WKS_R_QUERY_INFO; + + +#endif /* _RPC_WKS_H */ + diff --git a/source3/include/smb.h b/source3/include/smb.h index ccb3b0424a..a60b74a835 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -36,6 +36,11 @@ #define BOOLSTR(b) ((b) ? "Yes" : "No") #define BITSETB(ptr,bit) ((((char *)ptr)[0] & (1<<(bit)))!=0) #define BITSETW(ptr,bit) ((SVAL(ptr,0) & (1<<(bit)))!=0) + +#define IS_BITS_SET_ALL(var,bit) (((var)&(bit))==(bit)) +#define IS_BITS_SET_SOME(var,bit) (((var)&(bit))!=0) +#define IS_BITS_CLR_ALL(var,bit) (((var)&(~(bit)))==0) + #define PTR_DIFF(p1,p2) ((ptrdiff_t)(((char *)(p1)) - (char *)(p2))) typedef int BOOL; @@ -246,90 +251,6 @@ typedef fstring string; #define PIPE_LSASS "\\PIPE\\lsass" #define PIPE_LSARPC "\\PIPE\\lsarpc" -/* NETLOGON opcodes and data structures */ - -enum RPC_PKT_TYPE -{ - RPC_REQUEST = 0x00, - RPC_RESPONSE = 0x02, - RPC_BIND = 0x0B, - RPC_BINDACK = 0x0C -}; - -#define NET_QUERYFORPDC 7 /* Query for PDC */ -#define NET_QUERYFORPDC_R 12 /* Response to Query for PDC */ -#define NET_SAMLOGON 18 -#define NET_SAMLOGON_R 19 - -/* Allowable account control bits */ -#define ACB_DISABLED 1 /* 1 = User account disabled */ -#define ACB_HOMDIRREQ 2 /* 1 = Home directory required */ -#define ACB_PWNOTREQ 4 /* 1 = User password not required */ -#define ACB_TEMPDUP /* 1 = Temporary duplicate account */ -#define ACB_NORMAL /* 1 = Normal user account */ -#define ACB_MNS /* 1 = MNS logon user account */ -#define ACB_DOMTRUST /* 1 = Interdomain trust account */ -#define ACB_WSTRUST /* 1 = Workstation trust account */ -#define ACB_SVRTRUST /* 1 = Server trust account */ -#define ACB_PWNOEXP /* 1 = User password does not expire */ -#define ACB_AUTOLOCK /* 1 = Account auto locked */ - -#define SAMR_CLOSE 0x01 -#define SAMR_OPEN_SECRET 0x07 -#define SAMR_LOOKUP_RIDS 0x11 -#define SAMR_UNKNOWN_3 0x03 -#define SAMR_UNKNOWN_22 0x22 -#define SAMR_UNKNOWN_24 0x24 -#define SAMR_UNKNOWN_34 0x34 -#define SAMR_OPEN_POLICY 0x39 - -#define LSA_OPENPOLICY 0x2c -#define LSA_QUERYINFOPOLICY 0x07 -#define LSA_ENUMTRUSTDOM 0x0d -#define LSA_REQCHAL 0x04 -#define LSA_SRVPWSET 0x06 -#define LSA_SAMLOGON 0x02 -#define LSA_SAMLOGOFF 0x03 -#define LSA_AUTH2 0x0f -#define LSA_CLOSE 0x00 - -/* XXXX these are here to get a compile! */ - -#define LSA_OPENSECRET 0xFF -#define LSA_LOOKUPSIDS 0xFE -#define LSA_LOOKUPRIDS 0xFD -#define LSA_LOOKUPNAMES 0xFC - -/* srvsvc pipe */ -#define NETSERVERGETINFO 0x15 -#define NETSHAREENUM 0x0f - -/* well-known RIDs - Relative IDs */ - -/* RIDs - Well-known users ... */ -#define DOMAIN_USER_RID_ADMIN (0x000001F4L) -#define DOMAIN_USER_RID_GUEST (0x000001F5L) - -/* RIDs - well-known groups ... */ -#define DOMAIN_GROUP_RID_ADMINS (0x00000200L) -#define DOMAIN_GROUP_RID_USERS (0x00000201L) -#define DOMAIN_GROUP_RID_GUESTS (0x00000202L) - -/* RIDs - well-known aliases ... */ -#define DOMAIN_ALIAS_RID_ADMINS (0x00000220L) -#define DOMAIN_ALIAS_RID_USERS (0x00000221L) -#define DOMAIN_ALIAS_RID_GUESTS (0x00000222L) -#define DOMAIN_ALIAS_RID_POWER_USERS (0x00000223L) - -#define DOMAIN_ALIAS_RID_ACCOUNT_OPS (0x00000224L) -#define DOMAIN_ALIAS_RID_SYSTEM_OPS (0x00000225L) -#define DOMAIN_ALIAS_RID_PRINT_OPS (0x00000226L) -#define DOMAIN_ALIAS_RID_BACKUP_OPS (0x00000227L) - -#define DOMAIN_ALIAS_RID_REPLICATOR (0x00000228L) - - - /* 32 bit time (sec) since 01jan1970 - cifs6.txt, section 3.5, page 30 */ typedef struct time_info { @@ -344,990 +265,20 @@ typedef struct nttime_info uint32 high; } NTTIME; - - -#define MAXSUBAUTHS 15 /* max sub authorities in a SID */ - -/* DOM_SID - security id */ -typedef struct sid_info -{ - uint8 sid_rev_num; /* SID revision number */ - uint8 num_auths; /* number of sub-authorities */ - uint8 id_auth[6]; /* Identifier Authority */ - uint32 sub_auths[MAXSUBAUTHS]; /* pointer to sub-authorities. */ - -} DOM_SID; - -/* UNIHDR - unicode string header */ -typedef struct unihdr_info -{ - uint16 uni_max_len; - uint16 uni_str_len; - uint32 undoc; /* usually has a value of 4 */ - -} UNIHDR; - -/* UNIHDR2 - unicode string header and undocumented buffer */ -typedef struct unihdr2_info -{ - UNIHDR unihdr; - uint32 undoc_buffer; /* undocumented 32 bit buffer pointer */ - -} UNIHDR2; - -/* clueless as to what maximum length should be */ -#define MAX_UNISTRLEN 1024 - -/* UNISTR - unicode string size and buffer */ -typedef struct unistr_info -{ - uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. ***MUST*** be null-terminated */ - -} UNISTR; - -/* UNISTR2 - unicode string size and buffer */ -typedef struct unistr2_info -{ - uint32 uni_max_len; - uint32 undoc; - uint32 uni_str_len; - uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. **NOT** necessarily null-terminated */ - -} UNISTR2; - -/* DOM_SID2 - domain SID structure - SIDs stored in unicode */ -typedef struct domsid2_info -{ - uint32 type; /* value is 5 */ - uint32 undoc; /* value is 0 */ - - UNIHDR2 hdr; /* XXXX conflict between hdr and str for length */ - UNISTR str; /* XXXX conflict between hdr and str for length */ - -} DOM_SID2; - -/* DOM_RID2 - domain RID structure for ntlsa pipe */ -typedef struct domrid2_info -{ - uint32 type; /* value is 5 */ - uint32 undoc; /* value is non-zero */ - uint32 rid; - uint32 rid_idx; /* don't know what this is */ - -} DOM_RID2; - -/* DOM_RID3 - domain RID structure for samr pipe */ -typedef struct domrid3_info -{ - uint32 rid; /* domain-relative (to a SID) id */ - uint32 type1; /* value is 0x1 */ - uint32 ptr_type; /* undocumented pointer */ - uint32 type2; /* value is 0x1 */ - -} DOM_RID3; - -/* DOM_CLNT_SRV - client / server names */ -typedef struct clnt_srv_info -{ - uint32 undoc_buffer; /* undocumented 32 bit buffer pointer */ - UNISTR2 uni_logon_srv; /* logon server name */ - uint32 undoc_buffer2; /* undocumented 32 bit buffer pointer */ - UNISTR2 uni_comp_name; /* client machine name */ - -} DOM_CLNT_SRV; - -/* DOM_LOG_INFO - login info */ -typedef struct log_info -{ - uint32 undoc_buffer; /* undocumented 32 bit buffer pointer */ - UNISTR2 uni_logon_srv; /* logon server name */ - UNISTR2 uni_acct_name; /* account name */ - uint16 sec_chan; /* secure channel type */ - UNISTR2 uni_comp_name; /* client machine name */ - -} DOM_LOG_INFO; - -/* DOM_CHAL - challenge info */ -typedef struct chal_info -{ - uchar data[8]; /* credentials */ -} DOM_CHAL; - -/* DOM_CREDs - timestamped client or server credentials */ -typedef struct cred_info -{ - DOM_CHAL challenge; /* credentials */ - UTIME timestamp; /* credential time-stamp */ - -} DOM_CRED; - -/* DOM_CLNT_INFO - client info */ -typedef struct clnt_info -{ - DOM_LOG_INFO login; - DOM_CRED cred; - -} DOM_CLNT_INFO; - -/* DOM_CLNT_INFO2 - client info */ -typedef struct clnt_info2 -{ - DOM_CLNT_SRV login; - uint32 ptr_cred; - DOM_CRED cred; - -} DOM_CLNT_INFO2; - -/* DOM_LOGON_ID - logon id */ -typedef struct logon_info -{ - uint32 low; - uint32 high; - -} DOM_LOGON_ID; - -/* ARC4_OWF */ -typedef struct arc4_owf_info -{ - uint8 data[16]; - -} ARC4_OWF; - - -/* DOM_ID_INFO_1 */ -typedef struct id_info_1 -{ - uint32 ptr_id_info1; /* pointer to id_info_1 */ - UNIHDR hdr_domain_name; /* domain name unicode header */ - uint32 param_ctrl; /* param control */ - DOM_LOGON_ID logon_id; /* logon ID */ - UNIHDR hdr_user_name; /* user name unicode header */ - UNIHDR hdr_wksta_name; /* workgroup name unicode header */ - ARC4_OWF arc4_lm_owf; /* arc4 LM OWF Password */ - ARC4_OWF arc4_nt_owf; /* arc4 NT OWF Password */ - UNISTR2 uni_domain_name; /* domain name unicode string */ - UNISTR2 uni_user_name; /* user name unicode string */ - UNISTR2 uni_wksta_name; /* workgroup name unicode string */ - -} DOM_ID_INFO_1; - -/* SAM_INFO - sam logon/off id structure */ -typedef struct sam_info -{ - DOM_CLNT_INFO2 client; - uint32 ptr_rtn_cred; /* pointer to return credentials */ - DOM_CRED rtn_cred; /* return credentials */ - uint16 logon_level; - uint16 switch_value; - - union - { - DOM_ID_INFO_1 *id1; /* auth-level 1 */ - - } auth; - -} DOM_SAM_INFO; - -/* DOM_GID - group id + user attributes */ -typedef struct gid_info -{ - uint32 g_rid; /* a group RID */ - uint32 attr; - -} DOM_GID; - -/* RPC_HDR - ms rpc header */ -typedef struct rpc_hdr_info -{ - uint8 major; /* 5 - RPC major version */ - uint8 minor; /* 0 - RPC minor version */ - uint8 pkt_type; /* 2 - RPC response packet */ - uint8 frag; /* 3 - first frag + last frag */ - uint32 pack_type; /* 0x1000 0000 - packed data representation */ - uint16 frag_len; /* fragment length - data size (bytes) inc header and tail. */ - uint16 auth_len; /* 0 - authentication length */ - uint32 call_id; /* call identifier. matches 12th uint32 of incoming RPC data. */ - -} RPC_HDR; - -/* RPC_HDR_RR - ms request / response rpc header */ -typedef struct rpc_hdr_rr_info -{ - RPC_HDR hdr; - - uint32 alloc_hint; /* allocation hint - data size (bytes) minus header and tail. */ - uint16 context_id; /* 0 - presentation context identifier */ - uint8 cancel_count; /* 0 - cancel count */ - uint8 opnum; /* request: 0 - reserved. response: opnum */ - -} RPC_HDR_RR; - -/* the interfaces are numbered. as yet I haven't seen more than one interface - * used on the same pipe name - * srvsvc - * abstract (0x4B324FC8, 0x01D31670, 0x475A7812, 0x88E16EBF, 0x00000003) - * transfer (0x8A885D04, 0x11C91CEB, 0x0008E89F, 0x6048102B, 0x00000002) - */ -/* RPC_IFACE */ -typedef struct rpc_iface_info -{ - uint8 data[16]; /* 16 bytes of number */ - uint32 version; /* the interface number */ - -} RPC_IFACE; - - -/* this seems to be the same string name depending on the name of the pipe, - * but is more likely to be linked to the interface name - * "srvsvc", "\\PIPE\\ntsvcs" - * "samr", "\\PIPE\\lsass" - * "wkssvc", "\\PIPE\\wksvcs" - * "NETLOGON", "\\PIPE\\NETLOGON" - */ -/* RPC_ADDR_STR */ -typedef struct rpc_addr_info -{ - uint16 len; /* length of the string including null terminator */ - fstring str; /* the string above in single byte, null terminated form */ - -} RPC_ADDR_STR; - -/* RPC_HDR_BBA */ -typedef struct rpc_hdr_bba_info -{ - uint16 max_tsize; /* maximum transmission fragment size (0x1630) */ - uint16 max_rsize; /* max receive fragment size (0x1630) */ - uint32 assoc_gid; /* associated group id (0x0) */ - -} RPC_HDR_BBA; - -/* RPC_BIND_REQ - ms req bind */ -typedef struct rpc_bind_req_info -{ - RPC_HDR_BBA bba; - - uint32 num_elements; /* the number of elements (0x1) */ - uint16 context_id; /* presentation context identifier (0x0) */ - uint8 num_syntaxes; /* the number of syntaxes (has always been 1?)(0x1) */ - - RPC_IFACE abstract; /* num and vers. of interface client is using */ - RPC_IFACE transfer; /* num and vers. of interface to use for replies */ - -} RPC_HDR_RB; - -/* RPC_RESULTS - can only cope with one reason, right now... */ -typedef struct rpc_results_info -{ -/* uint8[] # 4-byte alignment padding, against SMB header */ - - uint8 num_results; /* the number of results (0x01) */ - -/* uint8[] # 4-byte alignment padding, against SMB header */ - - uint16 result; /* result (0x00 = accept) */ - uint16 reason; /* reason (0x00 = no reason specified) */ - -} RPC_RESULTS; - -/* RPC_HDR_BA */ -typedef struct rpc_hdr_ba_info -{ - RPC_HDR_BBA bba; - - RPC_ADDR_STR addr ; /* the secondary address string, as described earlier */ - RPC_RESULTS res ; /* results and reasons */ - RPC_IFACE transfer; /* the transfer syntax from the request */ - -} RPC_HDR_BA; - - -/* DOM_QUERY - info class 3 and 5 LSA Query response */ -typedef struct dom_query_info -{ - uint16 uni_dom_max_len; /* domain name string length * 2 */ - uint16 uni_dom_str_len; /* domain name string length * 2 */ - uint32 buffer_dom_name; /* undocumented domain name string buffer pointer */ - uint32 buffer_dom_sid; /* undocumented domain SID string buffer pointer */ - UNISTR2 uni_domain_name; /* domain name (unicode string) */ - DOM_SID dom_sid; /* domain SID */ - -} DOM_QUERY; - -/* level 5 is same as level 3. we hope. */ -typedef DOM_QUERY DOM_QUERY_3; -typedef DOM_QUERY DOM_QUERY_5; - -#define POL_HND_SIZE 20 - -/* LSA_POL_HND */ -typedef struct lsa_policy_info -{ - uint8 data[POL_HND_SIZE]; /* policy handle */ - -} LSA_POL_HND; - -/* OBJ_ATTR (object attributes) */ -typedef struct object_attributes_info -{ - uint32 len; /* 0x18 - length (in bytes) inc. the length field. */ - uint32 ptr_root_dir; /* 0 - root directory (pointer) */ - uint32 ptr_obj_name; /* 0 - object name (pointer) */ - uint32 attributes; /* 0 - attributes (undocumented) */ - uint32 ptr_sec_desc; /* 0 - security descriptior (pointer) */ - uint32 sec_qos; /* 0 - security quality of service */ - -} LSA_OBJ_ATTR; - -/* LSA_Q_OPEN_POL - LSA Query Open Policy */ -typedef struct lsa_q_open_pol_info -{ - uint32 ptr; /* undocumented buffer pointer */ - UNISTR2 uni_server_name; /* server name, starting with two '\'s */ - LSA_OBJ_ATTR attr ; /* object attributes */ - - uint32 des_access; /* desired access attributes */ - -} LSA_Q_OPEN_POL; - -/* LSA_R_OPEN_POL - response to LSA Open Policy */ -typedef struct lsa_r_open_pol_info -{ - LSA_POL_HND pol; /* policy handle */ - - uint32 status; /* return code */ - -} LSA_R_OPEN_POL; - -/* LSA_Q_QUERY_INFO - LSA query info policy */ -typedef struct lsa_query_info -{ - LSA_POL_HND pol; /* policy handle */ - uint16 info_class; /* info class */ - -} LSA_Q_QUERY_INFO; - -/* LSA_R_QUERY_INFO - response to LSA query info policy */ -typedef struct lsa_r_query_info -{ - uint32 undoc_buffer; /* undocumented buffer pointer */ - uint16 info_class; /* info class (same as info class in request) */ - - union - { - DOM_QUERY_3 id3; - DOM_QUERY_5 id5; - - } dom; - - uint32 status; /* return code */ - -} LSA_R_QUERY_INFO; - -/* LSA_Q_ENUM_TRUST_DOM - LSA enumerate trusted domains */ -typedef struct lsa_enum_trust_dom_info -{ - LSA_POL_HND pol; /* policy handle */ - uint32 enum_context; /* enumeration context handle */ - uint32 preferred_len; /* preferred maximum length */ - -} LSA_Q_ENUM_TRUST_DOM; - -/* LSA_R_ENUM_TRUST_DOM - response to LSA enumerate trusted domains */ -typedef struct lsa_r_enum_trust_dom_info -{ - LSA_POL_HND pol; /* policy handle */ - - uint32 status; /* return code */ - -} LSA_R_ENUM_TRUST_DOM; - -/* LSA_Q_CLOSE */ -typedef struct lsa_q_close_info -{ - LSA_POL_HND pol; /* policy handle */ - -} LSA_Q_CLOSE; - -/* LSA_R_CLOSE */ -typedef struct lsa_r_close_info -{ - LSA_POL_HND pol; /* policy handle. should be all zeros. */ - - uint32 status; /* return code */ - -} LSA_R_CLOSE; - - -#define MAX_REF_DOMAINS 10 - -/* DOM_R_REF */ -typedef struct dom_ref_info -{ - uint32 undoc_buffer; /* undocumented buffer pointer. */ - uint32 num_ref_doms_1; /* num referenced domains? */ - uint32 buffer_dom_name; /* undocumented domain name buffer pointer. */ - uint32 max_entries; /* 32 - max number of entries */ - uint32 num_ref_doms_2; /* 4 - num referenced domains? */ - - UNIHDR2 hdr_dom_name; /* domain name unicode string header */ - UNIHDR2 hdr_ref_dom[MAX_REF_DOMAINS]; /* referenced domain unicode string headers */ - - UNISTR uni_dom_name; /* domain name unicode string */ - DOM_SID ref_dom[MAX_REF_DOMAINS]; /* referenced domain SIDs */ - -} DOM_R_REF; - -#define MAX_LOOKUP_SIDS 10 - -/* LSA_Q_LOOKUP_SIDS - LSA Lookup SIDs */ -typedef struct lsa_q_lookup_sids -{ - LSA_POL_HND pol_hnd; /* policy handle */ - uint32 num_entries; - uint32 buffer_dom_sid; /* undocumented domain SID buffer pointer */ - uint32 buffer_dom_name; /* undocumented domain name buffer pointer */ - uint32 buffer_lookup_sids[MAX_LOOKUP_SIDS]; /* undocumented domain SID pointers to be looked up. */ - DOM_SID dom_sids[MAX_LOOKUP_SIDS]; /* domain SIDs to be looked up. */ - uint8 undoc[16]; /* completely undocumented 16 bytes */ - -} LSA_Q_LOOKUP_SIDS; - -/* LSA_R_LOOKUP_SIDS - response to LSA Lookup SIDs */ -typedef struct lsa_r_lookup_sids -{ - DOM_R_REF dom_ref; /* domain reference info */ - - uint32 num_entries; - uint32 undoc_buffer; /* undocumented buffer pointer */ - uint32 num_entries2; - - DOM_SID2 dom_sid[MAX_LOOKUP_SIDS]; /* domain SIDs being looked up */ - - uint32 num_entries3; - - uint32 status; /* return code */ - -} LSA_R_LOOKUP_SIDS; - -/* DOM_NAME - XXXX not sure about this structure */ -typedef struct dom_name_info -{ - uint32 uni_str_len; - UNISTR str; - -} DOM_NAME; - - -#define UNKNOWN_LEN 1 - -/* LSA_Q_LOOKUP_RIDS - LSA Lookup RIDs */ -typedef struct lsa_q_lookup_rids -{ - - LSA_POL_HND pol_hnd; /* policy handle */ - uint32 num_entries; - uint32 num_entries2; - uint32 buffer_dom_sid; /* undocumented domain SID buffer pointer */ - uint32 buffer_dom_name; /* undocumented domain name buffer pointer */ - DOM_NAME lookup_name[MAX_LOOKUP_SIDS]; /* names to be looked up */ - uint8 undoc[UNKNOWN_LEN]; /* completely undocumented bytes of unknown length */ - -} LSA_Q_LOOKUP_RIDS; - -/* LSA_R_LOOKUP_RIDS - response to LSA Lookup RIDs by name */ -typedef struct lsa_r_lookup_rids -{ - DOM_R_REF dom_ref; /* domain reference info */ - - uint32 num_entries; - uint32 undoc_buffer; /* undocumented buffer pointer */ - - uint32 num_entries2; - DOM_RID2 dom_rid[MAX_LOOKUP_SIDS]; /* domain RIDs being looked up */ - - uint32 num_entries3; - - uint32 status; /* return code */ - -} LSA_R_LOOKUP_RIDS; - - - -/* NEG_FLAGS */ -typedef struct lsa_neg_flags_info -{ - uint32 neg_flags; /* negotiated flags */ - -} NEG_FLAGS; - - -/* LSA_Q_REQ_CHAL */ -typedef struct lsa_q_req_chal_info -{ - uint32 undoc_buffer; /* undocumented buffer pointer */ - UNISTR2 uni_logon_srv; /* logon server unicode string */ - UNISTR2 uni_logon_clnt; /* logon client unicode string */ - DOM_CHAL clnt_chal; /* client challenge */ - -} LSA_Q_REQ_CHAL; - - -/* LSA_R_REQ_CHAL */ -typedef struct lsa_r_req_chal_info -{ - DOM_CHAL srv_chal; /* server challenge */ - - uint32 status; /* return code */ - -} LSA_R_REQ_CHAL; - - - -/* LSA_Q_AUTH_2 */ -typedef struct lsa_q_auth2_info -{ - DOM_LOG_INFO clnt_id; /* client identification info */ - DOM_CHAL clnt_chal; /* client-calculated credentials */ - - NEG_FLAGS clnt_flgs; /* usually 0x0000 01ff */ - -} LSA_Q_AUTH_2; - - -/* LSA_R_AUTH_2 */ -typedef struct lsa_r_auth2_info -{ - DOM_CHAL srv_chal; /* server-calculated credentials */ - NEG_FLAGS srv_flgs; /* usually 0x0000 01ff */ - - uint32 status; /* return code */ - -} LSA_R_AUTH_2; - - -/* LSA_Q_SRV_PWSET */ -typedef struct lsa_q_srv_pwset_info -{ - DOM_CLNT_INFO clnt_id; /* client identification/authentication info */ - char pwd[16]; /* new password - undocumented. */ - -} LSA_Q_SRV_PWSET; - -/* LSA_R_SRV_PWSET */ -typedef struct lsa_r_srv_pwset_info -{ - DOM_CRED srv_cred; /* server-calculated credentials */ - - uint32 status; /* return code */ - -} LSA_R_SRV_PWSET; - -#define LSA_MAX_GROUPS 32 -#define LSA_MAX_SIDS 32 - -/* LSA_USER_INFO */ -typedef struct lsa_q_user_info -{ - uint32 ptr_user_info; - - NTTIME logon_time; /* logon time */ - NTTIME logoff_time; /* logoff time */ - NTTIME kickoff_time; /* kickoff time */ - NTTIME pass_last_set_time; /* password last set time */ - NTTIME pass_can_change_time; /* password can change time */ - NTTIME pass_must_change_time; /* password must change time */ - - UNIHDR hdr_user_name; /* username unicode string header */ - UNIHDR hdr_full_name; /* user's full name unicode string header */ - UNIHDR hdr_logon_script; /* logon script unicode string header */ - UNIHDR hdr_profile_path; /* profile path unicode string header */ - UNIHDR hdr_home_dir; /* home directory unicode string header */ - UNIHDR hdr_dir_drive; /* home directory drive unicode string header */ - - uint16 logon_count; /* logon count */ - uint16 bad_pw_count; /* bad password count */ - - uint32 user_id; /* User ID */ - uint32 group_id; /* Group ID */ - uint32 num_groups; /* num groups */ - uint32 buffer_groups; /* undocumented buffer pointer to groups. */ - uint32 user_flgs; /* user flags */ - - char user_sess_key[16]; /* unused user session key */ - - UNIHDR hdr_logon_srv; /* logon server unicode string header */ - UNIHDR hdr_logon_dom; /* logon domain unicode string header */ - - uint32 buffer_dom_id; /* undocumented logon domain id pointer */ - char padding[40]; /* unused padding bytes. expansion room */ - - uint32 num_other_sids; /* 0 - num_sids */ - uint32 buffer_other_sids; /* NULL - undocumented pointer to SIDs. */ - - UNISTR2 uni_user_name; /* username unicode string */ - UNISTR2 uni_full_name; /* user's full name unicode string */ - UNISTR2 uni_logon_script; /* logon script unicode string */ - UNISTR2 uni_profile_path; /* profile path unicode string */ - UNISTR2 uni_home_dir; /* home directory unicode string */ - UNISTR2 uni_dir_drive; /* home directory drive unicode string */ - - uint32 num_groups2; /* num groups */ - DOM_GID gids[LSA_MAX_GROUPS]; /* group info */ - - UNISTR2 uni_logon_srv; /* logon server unicode string */ - UNISTR2 uni_logon_dom; /* logon domain unicode string */ - - DOM_SID dom_sid; /* domain SID */ - DOM_SID other_sids[LSA_MAX_SIDS]; /* undocumented - domain SIDs */ - -} LSA_USER_INFO; - - -/* LSA_Q_SAM_LOGON */ -typedef struct lsa_q_sam_logon_info -{ - DOM_SAM_INFO sam_id; - -} LSA_Q_SAM_LOGON; - -/* LSA_R_SAM_LOGON */ -typedef struct lsa_r_sam_logon_info -{ - uint32 buffer_creds; /* undocumented buffer pointer */ - DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */ - - uint16 switch_value; /* 3 - indicates type of USER INFO */ - LSA_USER_INFO *user; - - uint32 auth_resp; /* 1 - Authoritative response; 0 - Non-Auth? */ - - uint32 status; /* return code */ - -} LSA_R_SAM_LOGON; - - -/* LSA_Q_SAM_LOGOFF */ -typedef struct lsa_q_sam_logoff_info -{ - DOM_SAM_INFO sam_id; - -} LSA_Q_SAM_LOGOFF; - -/* LSA_R_SAM_LOGOFF */ -typedef struct lsa_r_sam_logoff_info -{ - uint32 buffer_creds; /* undocumented buffer pointer */ - DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */ - - uint32 status; /* return code */ - -} LSA_R_SAM_LOGOFF; - - -/* SH_INFO_1 (pointers to level 1 share info strings) */ -typedef struct ptr_share_info1 -{ - uint32 ptr_netname; /* pointer to net name. */ - uint32 type; /* type of share. 0 - undocumented. */ - uint32 ptr_remark; /* pointer to comment. */ - -} SH_INFO_1; - -/* SH_INFO_1_STR (level 1 share info strings) */ -typedef struct str_share_info1 -{ - UNISTR2 uni_netname; /* unicode string of net name */ - UNISTR2 uni_remark; /* unicode string of comment. */ - -} SH_INFO_1_STR; - -/* oops - this is going to take up a *massive* amount of stack. */ -/* the UNISTR2s already have 1024 uint16 chars in them... */ -#define MAX_SHARE_ENTRIES 32 - -/* SHARE_INFO_1_CONTAINER */ -typedef struct share_info_ctr -{ - uint32 num_entries_read; /* EntriesRead */ - uint32 ptr_share_info; /* Buffer */ - uint32 num_entries_read2; /* EntriesRead */ - SH_INFO_1 info_1 [MAX_SHARE_ENTRIES]; /* share entry pointers */ - SH_INFO_1_STR info_1_str[MAX_SHARE_ENTRIES]; /* share entry strings */ - uint32 num_entries_read3; /* EntriesRead2 */ - uint32 padding; /* padding */ - -} SHARE_INFO_1_CTR; - - -/* SRV_Q_NET_SHARE_ENUM */ -typedef struct q_net_share_enum_info -{ - uint32 ptr_srv_name; /* pointer (to server name?) */ - UNISTR2 uni_srv_name; /* server name */ - - uint32 share_level; /* share level */ - uint32 switch_value; /* switch value */ - - uint32 ptr_share_info; /* pointer to SHARE_INFO_1_CTR */ - - union - { - SHARE_INFO_1_CTR info1; /* share info with 0 entries */ - - } share; - - uint32 preferred_len; /* preferred maximum length (0xffff ffff) */ - -} SRV_Q_NET_SHARE_ENUM; - - -/* SRV_R_NET_SHARE_ENUM */ -typedef struct r_net_share_enum_info -{ - uint32 share_level; /* share level */ - uint32 switch_value; /* switch value */ - - uint32 ptr_share_info; /* pointer to SHARE_INFO_1_CTR */ - union - { - SHARE_INFO_1_CTR info1; /* share info container */ - - } share; - - uint32 status; /* return status */ - -} SRV_R_NET_SHARE_ENUM; - - -/* SAMR_Q_CLOSE - probably a policy handle close */ -typedef struct q_samr_close_info -{ - LSA_POL_HND pol; /* policy handle */ - -} SAMR_Q_CLOSE; - - -/* SAMR_R_CLOSE - probably a policy handle close */ -typedef struct r_samr_close_info -{ - LSA_POL_HND pol; /* policy handle */ - uint32 status; /* return status */ - -} SAMR_R_CLOSE; - - -/**************************************************************************** -SAMR_Q_OPEN_SECRET - unknown_0 values seen associated with SIDs: - -0x0000 0200 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0 -0x0000 0280 and a well-known domain sid - S-1-5-20 -0x2000 0000 and a well-known domain sid - S-1-5-20 -0x2000 0000 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0 -*****************************************************************************/ - -/* SAMR_Q_OPEN_SECRET - probably an open secret */ -typedef struct q_samr_open_secret_info -{ - LSA_POL_HND pol; /* policy handle */ - uint32 unknown_0; /* 0x2000 0000; 0x0000 0211; 0x0000 0280; 0x0000 0200 - unknown */ - DOM_SID dom_sid; /* domain SID */ - -} SAMR_Q_OPEN_SECRET; - - -/* SAMR_R_OPEN_SECRET - probably an open */ -typedef struct r_samr_open_secret_info -{ - LSA_POL_HND pol; /* policy handle associated with the SID */ - uint32 status; /* return status */ - -} SAMR_R_OPEN_SECRET; - - -/**************************************************************************** -SAMR_Q_LOOKUP_RIDS - do a conversion (only one!) from name to RID. - -the policy handle allocated by an "samr open secret" call is associated -with a SID. this policy handle is what is queried here, *not* the SID -itself. the response to the lookup rids is relative to this SID. -*****************************************************************************/ -/* SAMR_Q_LOOKUP_RIDS - probably a "read SAM entry" */ -typedef struct q_samr_lookup_names_info -{ - LSA_POL_HND pol; /* policy handle */ - - uint32 num_rids1; /* 1 - number of rids being looked up */ - uint32 rid; /* 0000 03e8 - RID of the server being queried? */ - uint32 ptr; /* 0 - 32 bit unknown */ - uint32 num_rids2; /* 1 - number of rids being looked up */ - - UNIHDR hdr_mach_acct; /* unicode machine account name header */ - UNISTR2 uni_mach_acct; /* unicode machine account name */ - -} SAMR_Q_LOOKUP_RIDS; - - -/* SAMR_R_LOOKUP_RIDS - probably an open */ -typedef struct r_samr_lookup_names_info -{ - uint32 num_entries; - uint32 undoc_buffer; /* undocumented buffer pointer */ - - uint32 num_entries2; - DOM_RID3 dom_rid[MAX_LOOKUP_SIDS]; /* domain RIDs being looked up */ - - uint32 num_entries3; - - uint32 status; /* return code */ - -} SAMR_R_LOOKUP_RIDS; - - -/* SAMR_Q_UNKNOWN_22 - probably an open */ -typedef struct q_samr_unknown_22_info -{ - LSA_POL_HND pol; /* policy handle */ - uint32 unknown_id_0; /* 0x0000 03E8 - 32 bit unknown id */ - -} SAMR_Q_UNKNOWN_22; - - -/* SAMR_R_UNKNOWN_22 - probably an open */ -typedef struct r_samr_unknown_22_info -{ - LSA_POL_HND pol; /* policy handle associated with unknown id */ - uint32 status; /* return status */ - -} SAMR_R_UNKNOWN_22; - - -/* SAMR_Q_UNKNOWN_24 - probably a get sam info */ -typedef struct q_samr_unknown_24_info -{ - LSA_POL_HND pol; /* policy handle associated with unknown id */ - uint16 unknown_0; /* 0x0015 or 0x0011 - 16 bit unknown */ - -} SAMR_Q_UNKNOWN_24; - - -/* SAMR_R_UNKNOWN_24 - probably a get sam info */ -typedef struct r_samr_unknown_24_info -{ - uint32 ptr; /* pointer */ - uint16 unknown_0; /* 0x0015 or 0x0011 - 16 bit unknown (same as above) */ - uint16 unknown_1; /* 0x8b73 - 16 bit unknown */ - uint8 padding_0[16]; /* 0 - padding 16 bytes */ - NTTIME expiry; /* expiry time or something? */ - uint8 padding_1[24]; /* 0 - padding 24 bytes */ - - UNIHDR hdr_mach_acct; /* unicode header for machine account */ - uint32 padding_2; /* 0 - padding 4 bytes */ - - uint32 ptr_1; /* pointer */ - uint8 padding_3[32]; /* 0 - padding 32 bytes */ - uint32 padding_4; /* 0 - padding 4 bytes */ - - uint32 ptr_2; /* pointer */ - uint32 padding_5; /* 0 - padding 4 bytes */ - - uint32 ptr_3; /* pointer */ - uint8 padding_6[32]; /* 0 - padding 32 bytes */ - - uint32 unknown_id_0; /* unknown id associated with policy handle */ - uint16 unknown_2; /* 0x0201 - 16 bit unknown */ - uint32 unknown_3; /* 0x0000 0080 - 32 bit unknown */ - uint16 unknown_4; /* 0x003f - 16 bit unknown */ - uint16 unknown_5; /* 0x003c - 16 bit unknown */ - - uint8 padding_7[16]; /* 0 - padding 16 bytes */ - uint32 padding_8; /* 0 - padding 4 bytes */ - - UNISTR2 uni_mach_acct; /* unicode string for machine account */ - - uint8 padding_9[48]; /* 0 - padding 48 bytes */ - - uint32 status; /* return status */ - -} SAMR_R_UNKNOWN_24; - - -/* SAMR_Q_UNKNOWN_32 - probably a "create SAM entry" */ -typedef struct q_samr_unknown_32_info -{ - LSA_POL_HND pol; /* policy handle */ - - UNIHDR hdr_mach_acct; /* unicode machine account name header */ - UNISTR2 uni_mach_acct; /* unicode machine account name */ - - uint32 unknown_0; /* 32 bit unknown */ - uint16 unknown_1; /* 16 bit unknown */ - uint16 unknown_2; /* 16 bit unknown */ - -} SAMR_Q_UNKNOWN_32; - - -/* SAMR_R_UNKNOWN_32 - probably a "create SAM entry" */ -typedef struct r_samr_unknown_32_info -{ - LSA_POL_HND pol; /* policy handle */ - uint32 unknown_0; /* 0x0000 0030 - 32 bit unknown */ - uint32 padding; /* 0 - 4 byte padding */ - - uint32 status; /* return status - 0xC000 0099: user exists */ - -} SAMR_R_UNKNOWN_32; - - -/* SAMR_Q_OPEN_POLICY - probably an open */ -typedef struct q_samr_open_policy_info -{ - uint32 ptr_srv_name; /* pointer (to server name?) */ - UNISTR2 uni_srv_name; /* unicode server name starting with '\\' */ - - uint32 unknown_0; /* 32 bit unknown */ - -} SAMR_Q_OPEN_POLICY; - - -/* SAMR_R_OPEN_POLICY - probably an open */ -typedef struct r_samr_open_policy_info -{ - LSA_POL_HND pol; /* policy handle */ - uint32 status; /* return status */ - -} SAMR_R_OPEN_POLICY; - - -/* WKS_Q_UNKNOWN_0 - probably a capabilities request */ -typedef struct q_wks_unknown_0_info -{ - uint32 ptr_srv_name; /* pointer (to server name?) */ - UNISTR2 uni_srv_name; /* unicode server name starting with '\\' */ - - uint32 unknown_0; /* 0x64 - 32 bit unknown */ - uint16 unknown_1; /* 16 bit unknown */ - -} WKS_Q_UNKNOWN_0; - - -/* WKS_R_UNKNOWN_0 - probably a capabilities request */ -typedef struct r_wks_unknown_0_info -{ - uint32 unknown_0; /* 64 - unknown */ - uint32 ptr_1; /* pointer 1 */ - uint32 unknown_1; /* 0x0000 01f4 - unknown */ - uint32 ptr_srv_name; /* pointer to server name */ - uint32 ptr_dom_name; /* pointer to domain name */ - uint32 unknown_2; /* 4 - unknown */ - uint32 unknown_3; /* 0 - unknown */ - - UNISTR2 uni_srv_name; /* unicode server name */ - UNISTR2 uni_dom_name; /* unicode domainn name */ - uint32 status; /* return status */ - -} WKS_R_UNKNOWN_0; - +/* Allowable account control bits */ +#define ACB_DISABLED 0x0001 /* 1 = User account disabled */ +#define ACB_HOMDIRREQ 0x0002 /* 1 = Home directory required */ +#define ACB_PWNOTREQ 0x0004 /* 1 = User password not required */ +#define ACB_TEMPDUP 0x0008 /* 1 = Temporary duplicate account */ +#define ACB_NORMAL 0x0010 /* 1 = Normal user account */ +#define ACB_MNS 0x0020 /* 1 = MNS logon user account */ +#define ACB_DOMTRUST 0x0040 /* 1 = Interdomain trust account */ +#define ACB_WSTRUST 0x0080 /* 1 = Workstation trust account */ +#define ACB_SVRTRUST 0x0100 /* 1 = Server trust account */ +#define ACB_PWNOEXP 0x0200 /* 1 = User password does not expire */ +#define ACB_AUTOLOCK 0x0400 /* 1 = Account auto locked */ + struct smb_passwd { int smb_userid; @@ -1335,6 +286,7 @@ struct smb_passwd unsigned char *smb_passwd; /* Null if no password */ unsigned char *smb_nt_passwd; /* Null if no password */ /* Other fields / flags may be added later */ + uint16 acct_ctrl; }; struct cli_state { @@ -1491,6 +443,20 @@ typedef struct } connection_struct; +/* DOM_CHAL - challenge info */ +typedef struct chal_info +{ + uchar data[8]; /* credentials */ +} DOM_CHAL; + +/* DOM_CREDs - timestamped client or server credentials */ +typedef struct cred_info +{ + DOM_CHAL challenge; /* credentials */ + UTIME timestamp; /* credential time-stamp */ + +} DOM_CRED; + /* Domain controller authentication protocol info */ struct dcinfo { @@ -2058,6 +1024,14 @@ char *Strstr(char *s, char *p); #define BROWSER_ELECTION_VERSION 0x010f #define BROWSER_CONSTANT 0xaa55 +/* NT Flags2 bits - cifs6.txt section 3.1.2 */ + +#define FLAGS2_LONG_PATH_COMPONENTS 0x0001 +#define FLAGS2_EXTENDED_ATTRIBUTES 0x0002 +#define FLAGS2_DFS_PATHNAMES 0x1000 +#define FLAGS2_READ_PERMIT_NO_EXECUTE 0x2000 +#define FLAGS2_32_BIT_ERROR_CODES 0x4000 +#define FLAGS2_UNICODE_STRINGS 0x8000 /* Capabilities. see ftp.microsoft.com/developr/drg/cifs/cifs/cifs4.txt */ @@ -2129,8 +1103,6 @@ enum case_handling {CASE_LOWER,CASE_UPPER}; #define UID_FIELD_INVALID 0 #define VUID_OFFSET 100 /* Amount to bias returned vuid numbers */ -#endif - /* Defines needed for multi-codepage support. */ #define MSDOS_LATIN_1_CODEPAGE 850 #define KANJI_CODEPAGE 932 @@ -2227,4 +1199,8 @@ extern int unix_ERR_code; #define CMD_REPLY 0x8000 +#endif /* _SMB_H */ + +#include "ntdomain.h" + /* _SMB_H */ -- cgit From 914a0b14aad364dd91ca4da90a82995919596e42 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 14 Mar 1998 04:11:56 +0000 Subject: removed a redundent return statement (This used to be commit 24e1539cd06a630334135f957720ed030ec4e894) --- source3/include/proto.h | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 19274157c6..c496e9531a 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -18,19 +18,6 @@ BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question, struct name_record **n); void kill_async_dns_child(); -/*The following definitions come from cgi.c */ - -void cgi_load_variables(FILE *f1); -char *cgi_variable(char *name); -char *cgi_vnum(int i, char **name); -int cgi_boolean(char *name, int def); -char *quotedup(char *s); -char *urlquote(char *s); -char *quotequotes(char *s); -void quote_spaces(char *buf); -void cgi_setup(char *rootdir, int auth_required); -char *cgi_baseurl(void); - /*The following definitions come from charcnv.c */ char *unix2dos_format(char *str,BOOL overwrite); @@ -1473,6 +1460,9 @@ BOOL last_challenge(char *challenge); user_struct *get_valid_user_struct(uint16 vuid); void invalidate_vuid(uint16 vuid); char *validated_username(uint16 vuid); +int setup_groups(char *user, int uid, int gid, int *p_ngroups, + int **p_igroups, gid_t **p_groups, + int **p_attrs); uint16 register_vuid(int uid,int gid, char *name,BOOL guest); void add_session_user(char *user); void dfs_unlogin(void); @@ -1627,9 +1617,6 @@ BOOL request_oplock_break(share_mode_entry *share_entry, BOOL receive_next_smb(int smbfd, int oplockfd, char *inbuf, int bufsize, int timeout); BOOL snum_used(int snum); BOOL reload_services(BOOL test); -int setup_groups(char *user, int uid, int gid, int *p_ngroups, - int **p_igroups, gid_t **p_groups, - int **p_attrs); int make_connection(char *service,char *user,char *password, int pwlen, char *dev,uint16 vuid); int find_free_file(void ); int reply_corep(char *outbuf); @@ -1909,3 +1896,22 @@ void print_asc(int level, unsigned char *buf,int len); void dump_data(int level,char *buf1,int len); char *tab_depth(int depth); char *dom_sid_to_string(DOM_SID *sid); + +/*The following definitions come from web/cgi.c */ + +void cgi_load_variables(FILE *f1); +char *cgi_variable(char *name); +char *cgi_vnum(int i, char **name); +int cgi_boolean(char *name, int def); +char *quotedup(char *s); +char *urlquote(char *s); +char *quotequotes(char *s); +void quote_spaces(char *buf); +void cgi_setup(char *rootdir, int auth_required); +char *cgi_baseurl(void); +char *cgi_rooturl(void); +char *cgi_pathinfo(void); + +/*The following definitions come from web/swat.c */ + +int main(int argc, char *argv[]); -- cgit From b85346942e7d785af718b68d61b208cb457a2b27 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 14 Mar 1998 08:27:41 +0000 Subject: another makeover of loadparm to support new stuff in swat and testparm. In particular I added: - ability to optionally save default values of all parameters when calling lp_load(). This can then be used to save only non-default parameters in lp_dump(). This makes the saved smb.conf (and viewed parameters in testparm) much shorter - ability to not load ipc share in lp_load() - separators in parm_table[] so parameters can be grouped logically. - flag to mark parameters that are local but which should be also viewed as global as far as parameters editing is concerned (This used to be commit f9af35da26e58fb0b644b5f0169f1c212230047a) --- source3/include/smb.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index a60b74a835..48d9a8919d 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -613,12 +613,12 @@ struct connection_options { typedef enum { P_BOOL,P_BOOLREV,P_CHAR,P_INTEGER,P_OCTAL, - P_STRING,P_USTRING,P_GSTRING,P_UGSTRING,P_ENUM + P_STRING,P_USTRING,P_GSTRING,P_UGSTRING,P_ENUM,P_SEP } parm_type; typedef enum { - P_LOCAL,P_GLOBAL,P_NONE + P_LOCAL,P_GLOBAL,P_SEPARATOR,P_NONE, } parm_class; struct enum_list { @@ -635,12 +635,19 @@ struct parm_struct BOOL (*special)(); struct enum_list *enum_list; unsigned flags; + union { + BOOL bvalue; + int ivalue; + char *svalue; + char cvalue; + } def; }; -#define FLAG_BASIC 1 -#define FLAG_HIDE 2 -#define FLAG_PRINT 4 +#define FLAG_BASIC 1 /* fundamental options */ +#define FLAG_HIDE 2 /* options that should be hidden in SWAT */ +#define FLAG_PRINT 4 /* printing options */ +#define FLAG_GLOBAL 8 /* local options that should be globally settable in SWAT */ #ifndef LOCKING_VERSION #define LOCKING_VERSION 4 -- cgit From a62ff8003e5e34f671e0036a2dde5742f0cf5ee4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 14 Mar 1998 08:31:48 +0000 Subject: prototype updates (This used to be commit a565ff605094ed5b05d82b59b7993a3088873733) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index c496e9531a..b324ae6bb1 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1021,7 +1021,7 @@ struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters); BOOL lp_snum_ok(int iService); BOOL lp_loaded(void); void lp_killunused(BOOL (*snumused)(int )); -BOOL lp_load(char *pszFname,BOOL global_only); +BOOL lp_load(char *pszFname,BOOL global_only, BOOL save_defaults, BOOL add_ipc); int lp_numservices(void); void lp_dump(FILE *f); int lp_servicenumber(char *pszServiceName); -- cgit From e2b50d04ad5eb5fa7c10b59cf5ba0cfe374ab240 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 14 Mar 1998 11:24:01 +0000 Subject: if a local parameter is changed at the global level then propogate the change to all shares that are currently set to the default value. (This used to be commit b0e1183b2cbeb7a3150b7250cd19d14c9e5508b6) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index b324ae6bb1..9c7c37f1a6 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1017,6 +1017,7 @@ BOOL lp_add_printer(char *pszPrintername, int iDefaultService); BOOL lp_file_list_changed(void); void *lp_local_ptr(int snum, void *ptr); BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue); +BOOL lp_is_default(int snum, struct parm_struct *parm); struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters); BOOL lp_snum_ok(int iService); BOOL lp_loaded(void); -- cgit From c063e9ec3e90508e846dd51e22a643c74c02f7c1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 14 Mar 1998 12:57:58 +0000 Subject: added the ability to start/stop the server from SWAT. I needed to modify the way the pidfile is handled in nmbd and smbd to do this. Jeremy, you may wish to look at what I've done as it probably breaks the Whistle use of pidfiles. In particular I've removed the -f option and instead smbd and nmbd always create a pidfile in the lock directory. (This used to be commit 20bb22d61b986d2036c681fc33db60f2b2b3c1c7) --- source3/include/proto.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 9c7c37f1a6..88b340319e 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1487,6 +1487,11 @@ BOOL server_validate(char *user, char *domain, BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); void pcap_printer_fn(void (*fn)()); +/*The following definitions come from pidfile.c */ + +void pidfile_create(char *name); +int pidfile_pid(char *name); + /*The following definitions come from pipes.c */ int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize); @@ -1913,6 +1918,18 @@ char *cgi_baseurl(void); char *cgi_rooturl(void); char *cgi_pathinfo(void); +/*The following definitions come from web/diagnose.c */ + +BOOL nmbd_running(void); +BOOL smbd_running(void); + +/*The following definitions come from web/startstop.c */ + +void start_smbd(void); +void start_nmbd(void); +void stop_smbd(void); +void stop_nmbd(void); + /*The following definitions come from web/swat.c */ int main(int argc, char *argv[]); -- cgit From 86f5105fbca56ab07f8a33e892fe656672600388 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 15 Mar 1998 03:06:50 +0000 Subject: - claim the null connection after the session request to mak sure we have the netbios name - fix another kill connection bug (This used to be commit c634b799874795d42dae28fb4440ea452dc89b1b) --- source3/include/proto.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 88b340319e..9046fc2886 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -123,6 +123,11 @@ int process_tar(char *inbuf, char *outbuf); int clipfind(char **aret, int ret, char *tok); int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind); +/*The following definitions come from connection.c */ + +BOOL yield_connection(int cnum,char *name,int max_connections); +BOOL claim_connection(int cnum,char *name,int max_connections,BOOL Clear); + /*The following definitions come from credentials.c */ char *credstr(uchar *cred); @@ -1631,8 +1636,6 @@ int reply_lanman1(char *outbuf); int reply_lanman2(char *outbuf); int reply_nt1(char *outbuf); void close_cnum(int cnum, uint16 vuid); -BOOL yield_connection(int cnum,char *name,int max_connections); -BOOL claim_connection(int cnum,char *name,int max_connections,BOOL Clear); void exit_server(char *reason); void standard_sub(int cnum,char *str); char *smb_fn_name(int type); @@ -1929,6 +1932,11 @@ void start_smbd(void); void start_nmbd(void); void stop_smbd(void); void stop_nmbd(void); +void kill_pid(int pid); + +/*The following definitions come from web/statuspage.c */ + +void status_page(void); /*The following definitions come from web/swat.c */ -- cgit From c4855a8e028914281f179bd3bce8fc7cb249eaf7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 16 Mar 1998 07:23:51 +0000 Subject: changed the default "keepalive" value to 300 seconds. This is more important now that oplocks are being used. (This used to be commit 7bccd2c360a270df227c140aeecb943d8d187855) --- source3/include/local.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index 22862a9a1f..d9e12e506b 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -159,6 +159,8 @@ #define LONG_CONNECT_TIMEOUT 30 #define SHORT_CONNECT_TIMEOUT 5 +/* the default netbios keepalive timeout */ +#define DEFAULT_KEEPALIVE 300 /* the directory to sit in when idle */ /* #define IDLE_DIR "/" */ -- cgit From 90cdd717f8352a3b3eacdc154dfb1f9ff2fabeaf Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 16 Mar 1998 18:31:09 +0000 Subject: includes.h: Addition of NetBSD 1.3 fix, fix for HPUX 9.x, 10.x zombie problem. password.c: Fix for Thursby to stop Dave clients failing in share mode security (this was their bug - they were interpreting the uid field in share mode which is explicitly denied by the spec but it's easier for us to fix it than them :-). Jeremy. (This used to be commit 39372d9e20803d32c0c5b87226a72b007978baad) --- source3/include/includes.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 94bf23cef5..c9a515af9a 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -492,16 +492,22 @@ char *mktemp(char *); /* No standard include */ #endif -#ifdef NETBSD -#include +#ifdef NETBSD +#ifdef NetBSD1_3 +#include +#ifdef ALLOW_CHANGE_PASSWORD +#include +#endif /* ALLOW_CHANGE_PASSWORD */ +#else /* NetBSD1_3 */ +#include +#endif /* NetBSD1_3 */ #include /* you may not need this */ -#define NO_GETSPNAM +#define NO_GETSPNAM #define SIGNAL_CAST (void (*)()) #define USE_DIRECT #define REPLACE_INNETGR -#endif - +#endif #ifdef FreeBSD @@ -598,6 +604,7 @@ char *mktemp(char *); /* No standard include */ /* Ken Weiss tells us that SIGCLD_IGNORE is not good for HPUX */ /* #define SIGCLD_IGNORE */ +#define USE_SIGPROCMASK /* Needed to stop zombie processes on HPUX 9.x and 10.x.*/ #endif /* HPUX */ -- cgit From 14d6ee34de8935cb3ef59820fabf98d588dab11f Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Mon, 16 Mar 1998 20:07:22 +0000 Subject: Lint was complaining about the following typedef in smb.h: typedef enum { P_LOCAL,P_GLOBAL,P_SEPARATOR,P_NONE, } parm_class; I removed the trailing comma. Chris -)----- (This used to be commit ac7cd9cacf2493b52d4db50d4fd4b8b08adfe837) --- source3/include/smb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 48d9a8919d..0acc5cbfa3 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -618,7 +618,7 @@ typedef enum typedef enum { - P_LOCAL,P_GLOBAL,P_SEPARATOR,P_NONE, + P_LOCAL,P_GLOBAL,P_SEPARATOR,P_NONE } parm_class; struct enum_list { -- cgit From c54af0f8b20e3f93c59da6a817920e1de6c4a870 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 16 Mar 1998 20:59:47 +0000 Subject: Adding the same change as was added to 1.9.18 branch to add the "name resolve order" parameter. source/Makefile: Re-ordered link for name resolve order code. source/clientgen.c: source/clientutil.c: Added calls to resolve_name(). source/includes.h: Added HPUX zombie fix. source/loadparm.c: Added new name resolve order parameter. source/namequery.c: Re-wrote to include parsing of lmhosts file, new resolve_name() function requested by John. source/nmbd.c: Tell resolve_name not to do WINS lookups if we are the WINS server. source/nmbd_lmhosts.c: Call lmhosts parsing functions in namequery.c source/password.c: Call resolve_name() to lookup security=server name. source/reply.c: source/time.c: source/trans2.c: "fake directory create times" fix from Jim Hague - hague@research.canon.com.au. source/util.c: Removed isalnum() test in Get_Hostname() that seems to cause problems on many systems. Jeremy. (This used to be commit 7f118970da7c43eaddcf92dc056d3e849f1e7d5c) --- source3/include/proto.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 9046fc2886..03fc3d6317 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -868,6 +868,7 @@ char *lp_auto_services(void); char *lp_passwd_program(void); char *lp_passwd_chat(void); char *lp_passwordserver(void); +char *lp_name_resolve_order(void); char *lp_workgroup(void); char *lp_username_map(void); char *lp_character_set(void); @@ -1007,6 +1008,7 @@ BOOL lp_fake_oplocks(int ); BOOL lp_recursive_veto_delete(int ); BOOL lp_dos_filetimes(int ); BOOL lp_dos_filetime_resolution(int ); +BOOL lp_fake_dir_create_times(int ); int lp_create_mode(int ); int lp_force_create_mode(int ); int lp_dir_mode(int ); @@ -1038,6 +1040,7 @@ void lp_copy_service(int snum, char *new_name); int lp_default_server_announce(void); int lp_major_announce_version(void); int lp_minor_announce_version(void); +void lp_set_name_resolve_order(char *new_order); /*The following definitions come from locking.c */ @@ -1126,6 +1129,10 @@ BOOL name_status(int fd,char *name,int name_type,BOOL recurse, struct in_addr *name_query(int fd,char *name,int name_type, BOOL bcast,BOOL recurse, struct in_addr to_ip, int *count, void (*fn)()); +FILE *startlmhosts(char *fname); +BOOL getlmhostsent( FILE *fp, char *name, int *name_type, struct in_addr *ipaddr); +void endlmhosts(FILE *fp); +BOOL resolve_name(char *name, struct in_addr *return_ip); /*The following definitions come from nmbd.c */ @@ -1725,7 +1732,7 @@ time_t make_unix_date2(void *date_ptr); time_t make_unix_date3(void *date_ptr); char *http_timestring(time_t t); char *timestring(void ); -time_t get_create_time(struct stat *st); +time_t get_create_time(struct stat *st,BOOL fake_dirs); /*The following definitions come from trans2.c */ -- cgit From 15cf7db4c94042a512864a07437689a19609acbe Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 17 Mar 1998 00:02:19 +0000 Subject: changed the default MAXSTATUS from 1000 to 100000 This number limits the number of simultaneous connections to the server. The 1000 limit is from a looong time ago when I couldn't imagine anyone wanting to have 1000 simultaneous clients. Now I hear that people are testing with such numbers. I wonder when I'll change it from 100k ? (This used to be commit bae865da2dca175a8fe25922aeee8e785521e19b) --- source3/include/local.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index d9e12e506b..9a62aa7eb3 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -34,8 +34,8 @@ #define SHMEM_SIZE (1024*MAX_OPEN_FILES) #endif -/* the max number of connections that the smbstatus program will show */ -#define MAXSTATUS 1000 +/* the max number of simultanous connections to the server by all clients */ +#define MAXSTATUS 100000 /* max number of directories open at once */ /* note that with the new directory code this no longer requires a -- cgit From 59d7006b05bb301e36f786b047b90ab9ef5be122 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 17 Mar 1998 11:44:16 +0000 Subject: - added "Full View"/"Normal View" on the "view config" page - added the ability to auto-refresh the status page. There is a problem with this (it can kill inetd!). Hopefully we can fix that. (This used to be commit 4488d8932fa072bf8a3ae236ab666618051b5e83) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 03fc3d6317..dfd9ca8be8 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1031,7 +1031,7 @@ BOOL lp_loaded(void); void lp_killunused(BOOL (*snumused)(int )); BOOL lp_load(char *pszFname,BOOL global_only, BOOL save_defaults, BOOL add_ipc); int lp_numservices(void); -void lp_dump(FILE *f); +void lp_dump(FILE *f, BOOL show_defaults); int lp_servicenumber(char *pszServiceName); char *volume_label(int snum); void lp_rename_service(int snum, char *new_name); -- cgit From f996885676f041437430bfd5843a3000611b0923 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 17 Mar 1998 12:31:43 +0000 Subject: this isn't a big commit, it just looks like it :-) I needed the client_name() and client_addr() functions in swat so I could tell who was connecting from where. The problem was that these functions didn't take a file descriptor parameter they just used the global "Client". So I needed to change all calls to pass a parameter ... lots of files. (This used to be commit a776058900a727591bd7b69debdaa25c0e31d693) --- source3/include/proto.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index dfd9ca8be8..b7c64cbc25 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1873,8 +1873,8 @@ uint32 interpret_addr(char *str); struct in_addr *interpret_addr2(char *str); BOOL zero_ip(struct in_addr ip); void reset_globals_after_fork(); -char *client_name(void); -char *client_addr(void); +char *client_name(int fd); +char *client_addr(int fd); char *automount_server(char *user_name); char *automount_path(char *user_name); void standard_sub_basic(char *str); @@ -1927,6 +1927,8 @@ void cgi_setup(char *rootdir, int auth_required); char *cgi_baseurl(void); char *cgi_rooturl(void); char *cgi_pathinfo(void); +char *cgi_remote_host(void); +char *cgi_remote_addr(void); /*The following definitions come from web/diagnose.c */ -- cgit From c8c61ac6a643d1c51c1546a6e346c566bb34f3b2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 18 Mar 1998 07:33:11 +0000 Subject: changed the method used for auto-reload on the status page to use JavaScript. This avoids the nasty inetd problem. (This used to be commit 9d9b13880963a0e3cf5213ce2a24c52f4a11a472) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index b7c64cbc25..54f833a93e 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1929,6 +1929,7 @@ char *cgi_rooturl(void); char *cgi_pathinfo(void); char *cgi_remote_host(void); char *cgi_remote_addr(void); +BOOL cgi_waspost(void); /*The following definitions come from web/diagnose.c */ -- cgit From da050244c305c1e03e2f3fb2ac02f6bc93ad47ca Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 18 Mar 1998 19:07:53 +0000 Subject: Added SamOEMChangePassword functionality. Jeremy. (This used to be commit e02e3bcbbd4333113dde7bef47763fb229148007) --- source3/include/proto.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 54f833a93e..e980bcacc9 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -38,6 +38,10 @@ BOOL chgpasswd(char *name,char *oldpass,char *newpass); BOOL check_lanman_password(char *user, unsigned char *pass1, unsigned char *pass2, struct smb_passwd **psmbpw); BOOL change_lanman_password(struct smb_passwd *smbpw, unsigned char *pass1, unsigned char *pass2); +BOOL check_oem_password(char *user, unsigned char *data, + struct smb_passwd **psmbpw, char *new_passwd, + int new_passwd_size); +BOOL change_oem_password(struct smb_passwd *smbpw, char *new_passwd); /*The following definitions come from client.c */ @@ -1664,6 +1668,7 @@ void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24); void D_P16(unsigned char *p14, unsigned char *in, unsigned char *out); void cred_hash1(unsigned char *out,unsigned char *in,unsigned char *key); void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key); +void SamOEMhash( unsigned char *data, unsigned char *key); /*The following definitions come from smbencrypt.c */ -- cgit From 7abbf368f908cacdb2978e33069e49755e54faa8 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 19 Mar 1998 20:06:47 +0000 Subject: Adding the same changes to HEAD as were added to BRANCH_1_9_18. Changed smbpasswd to be client-server for a normal user, rather than accessing the private/smbpasswd file directly (it still accesses this file directly when run as root, so root can add users/change a users password without knowing the old password). A shakeout of this change is that smbpasswd can now be used to change a users password on a remote NT machine (yep - you heard that one right - we can now change a NT password from UNIX !!!!!). Jeremy. (This used to be commit 20770b6f1c25288e90d3e0d215afa7f0809ce124) --- source3/include/proto.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index e980bcacc9..209004e90a 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -82,6 +82,8 @@ BOOL cli_qpathinfo2(struct cli_state *cli, char *fname, time_t *w_time, uint32 *size); BOOL cli_qfileinfo(struct cli_state *cli, int fnum, time_t *c_time, time_t *a_time, time_t *m_time, uint32 *size); +BOOL cli_oem_change_password(struct cli_state *cli, char *user, char *new_password, + char *old_password); BOOL cli_negprot(struct cli_state *cli); BOOL cli_session_request(struct cli_state *cli, char *host, int name_type, char *myname); @@ -1666,9 +1668,10 @@ struct shmem_ops *sysv_shm_open(int ronly); void E_P16(unsigned char *p14,unsigned char *p16); void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24); void D_P16(unsigned char *p14, unsigned char *in, unsigned char *out); +void E_old_pw_hash( unsigned char *p14, unsigned char *in, unsigned char *out); void cred_hash1(unsigned char *out,unsigned char *in,unsigned char *key); void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key); -void SamOEMhash( unsigned char *data, unsigned char *key); +void SamOEMhash( unsigned char *data, unsigned char *key, int val); /*The following definitions come from smbencrypt.c */ -- cgit From 1ab10eb365d8e2f5a337eea0b98956d5fd098c44 Mon Sep 17 00:00:00 2001 From: John Terpstra Date: Fri, 20 Mar 1998 13:37:46 +0000 Subject: Added MAXPRINTERLEN define in smb.h setting printer share name length to maximumof 15 characters. IF this needs to be limited to 8 characters again please do it in smb.h. (This used to be commit 3dfe0b135dd91864a81a5fadddc9151ac8812c6e) --- source3/include/smb.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 0acc5cbfa3..f0cdf9f356 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -24,6 +24,9 @@ #ifndef _SMB_H #define _SMB_H +/* Yves Gaige requested this */ +#define MAXPRINTERLEN 15 + #define BUFFER_SIZE (0xFFFF) #define SAFETY_MARGIN 1024 -- cgit From bee4067bd4771ee7883ab6365e91df86a1230618 Mon Sep 17 00:00:00 2001 From: John Terpstra Date: Sat, 21 Mar 1998 03:03:59 +0000 Subject: Getting ready for first Red Hat Linux RPMs for 1.9.19 pre-alpha release (This used to be commit 4e424d0ba652bf9c5dfd3c44216b6145538cf821) --- source3/include/local.h | 8 ++++++++ source3/include/smb.h | 3 --- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index 9a62aa7eb3..144c2d2838 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -1,3 +1,6 @@ +/* Copyright (C) 1995-1998 Samba-Team */ +/* Copyright (C) 1998 John H Terpstra */ + /* local definitions for file server */ #ifndef _LOCAL_H #define _LOCAL_H @@ -17,6 +20,11 @@ refer to the special "printers" service */ #define PRINTERS_NAME "printers" +/* Yves Gaige requested this set this */ +/* to a maximum of 8 if old smb clients break because of long printer names. */ +#define MAXPRINTERLEN 15 + + /* define what facility to use for syslog */ #ifndef SYSLOG_FACILITY #define SYSLOG_FACILITY LOG_DAEMON diff --git a/source3/include/smb.h b/source3/include/smb.h index f0cdf9f356..0acc5cbfa3 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -24,9 +24,6 @@ #ifndef _SMB_H #define _SMB_H -/* Yves Gaige requested this */ -#define MAXPRINTERLEN 15 - #define BUFFER_SIZE (0xFFFF) #define SAFETY_MARGIN 1024 -- cgit From 5d7c8375e4ffb017ef0f9eed7e619e533b3e8d12 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 24 Mar 1998 00:37:53 +0000 Subject: clientgen.c ipc.c smbpasswd.c: Fixes for warnings (from Herb). quotas.c: Linux quota fix. util.c: Ensure smb_read_error is zero in all calls that can set it. lib/rpc/include/rpc_misc.h lib/rpc/include/rpc_netlogon.h lib/rpc/parse/parse_misc.c lib/rpc/parse/parse_net.c lib/rpc/server/srv_netlog.c : Modify Luke's code to call SamOEMhash(). Jeremy. (This used to be commit 7f749708383b8b36c3f23a5fbc5cbdf39bc8e555) --- source3/include/proto.h | 4 ++-- source3/include/rpc_misc.h | 6 +++--- source3/include/rpc_netlogon.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 209004e90a..a643996d3c 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -293,8 +293,8 @@ void make_clnt_info(DOM_CLNT_INFO *clnt, void smb_io_clnt_info(char *desc, DOM_CLNT_INFO *clnt, prs_struct *ps, int depth); void make_logon_id(DOM_LOGON_ID *log, uint32 log_id_low, uint32 log_id_high); void smb_io_logon_id(char *desc, DOM_LOGON_ID *log, prs_struct *ps, int depth); -void make_arc4_owf(ARC4_OWF *hash, uint8 data[16]); -void smb_io_arc4_owf(char *desc, ARC4_OWF *hash, prs_struct *ps, int depth); +void make_owf_info(OWF_INFO *hash, uint8 data[16]); +void smb_io_owf_info(char *desc, OWF_INFO *hash, prs_struct *ps, int depth); void smb_io_gid(char *desc, DOM_GID *gid, prs_struct *ps, int depth); void smb_io_pol_hnd(char *desc, POLICY_HND *pol, prs_struct *ps, int depth); void smb_io_dom_query_3(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth); diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 5d4e385875..c6e0d8d5ee 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -243,12 +243,12 @@ typedef struct logon_info } DOM_LOGON_ID; -/* ARC4_OWF */ -typedef struct arc4_owf_info +/* OWF INFO */ +typedef struct owf_info { uint8 data[16]; -} ARC4_OWF; +} OWF_INFO; /* DOM_GID - group id + user attributes */ diff --git a/source3/include/rpc_netlogon.h b/source3/include/rpc_netlogon.h index 1808649328..1fc6596821 100644 --- a/source3/include/rpc_netlogon.h +++ b/source3/include/rpc_netlogon.h @@ -293,8 +293,8 @@ typedef struct id_info_1 DOM_LOGON_ID logon_id; /* logon ID */ UNIHDR hdr_user_name; /* user name unicode header */ UNIHDR hdr_wksta_name; /* workstation name unicode header */ - ARC4_OWF arc4_lm_owf; /* arc4 LM OWF Password */ - ARC4_OWF arc4_nt_owf; /* arc4 NT OWF Password */ + OWF_INFO lm_owf; /* LM OWF Password */ + OWF_INFO nt_owf; /* NT OWF Password */ UNISTR2 uni_domain_name; /* domain name unicode string */ UNISTR2 uni_user_name; /* user name unicode string */ UNISTR2 uni_wksta_name; /* workgroup name unicode string */ -- cgit From a4156f9b50c81fe40823cd8e32ec990690d3884c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 27 Mar 1998 19:59:14 +0000 Subject: chgpasswd.c, ipc.c, loadparm.c: Added boolean "unix password sync" parameter which allows the new change password code to change the unix password also. Defaults to OFF. includes.h: Added termios.h to FreeBSD to allow password changing. namequery.c: Fixed missing name parameters to debug statements. Jeremy. (This used to be commit 4ac50c0f0aa5af084ddad89b1f9baf6c2c1ddcb8) --- source3/include/includes.h | 1 + source3/include/proto.h | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index c9a515af9a..e6dee108a5 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -516,6 +516,7 @@ char *mktemp(char *); /* No standard include */ #include #include #include +#include #if __FreeBSD__ >= 3 #include #else diff --git a/source3/include/proto.h b/source3/include/proto.h index a643996d3c..993cf46486 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -32,9 +32,9 @@ void add_char_string(char *s); /*The following definitions come from chgpasswd.c */ -BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence); -BOOL chgpasswd(char *name,char *oldpass,char *newpass); -BOOL chgpasswd(char *name,char *oldpass,char *newpass); +BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence, BOOL as_root); +BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root); +BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root); BOOL check_lanman_password(char *user, unsigned char *pass1, unsigned char *pass2, struct smb_passwd **psmbpw); BOOL change_lanman_password(struct smb_passwd *smbpw, unsigned char *pass1, unsigned char *pass2); @@ -924,6 +924,7 @@ BOOL lp_nis_home_map(void); BOOL lp_time_server(void); BOOL lp_bind_interfaces_only(void); BOOL lp_net_wksta_user_logon(void); +BOOL lp_unix_password_sync(void); int lp_os_level(void); int lp_max_ttl(void); int lp_max_wins_ttl(void); -- cgit From 10fe54befa10b283269001fdf779b9938c9a3a2c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 31 Mar 1998 20:55:14 +0000 Subject: includes.h: Added semaphore fix for HPUX10.x server.c trans2.c: Added oplock deadlock bug fix. lib/rpc/server/srv_netlog.c: Made code that changes machine account password the default. Jeremy. (This used to be commit 3b56fbc11e9d1cb7d4930d9782238c2610cac30d) --- source3/include/includes.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index e6dee108a5..5df76668c6 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -606,6 +606,11 @@ char *mktemp(char *); /* No standard include */ not good for HPUX */ /* #define SIGCLD_IGNORE */ #define USE_SIGPROCMASK /* Needed to stop zombie processes on HPUX 9.x and 10.x.*/ +#ifdef HPUX10 +#ifdef SEMMSL +#undef SEMMSL +#endif /* SEMMSL */ +#endif /* HPUX10 */ #endif /* HPUX */ -- cgit From 612cbb6a6039c2cafb3de5e644f23a2a26d6c645 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 2 Apr 1998 01:01:24 +0000 Subject: Patch from Chris Maltby . His comments follow: + improvement to smbtar to allow exclusion/inclusion of system and hidden files, and to generate a listing of what has been archived in a format useful for automated backup systems. + add the "Softq" spooling system to samba's printing capabilities. + I have "fixed" the intrusion of US style dates into samba reporting as well. The format yyyy/mm/dd is not only uunambiguous, but also has the benefit of making lexicographic sorts work correctly. Jeremy. (This used to be commit f9dacd1d8b89fccad859c0c6bc7a492823eb4b06) --- source3/include/smb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 0acc5cbfa3..88d9a9de09 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1064,7 +1064,7 @@ enum security_types {SEC_SHARE,SEC_USER,SEC_SERVER}; /* printing types */ enum printing_types {PRINT_BSD,PRINT_SYSV,PRINT_AIX,PRINT_HPUX, - PRINT_QNX,PRINT_PLP,PRINT_LPRNG}; + PRINT_QNX,PRINT_PLP,PRINT_LPRNG,PRINT_SOFTQ}; /* Remote architectures we know about. */ enum remote_arch_types {RA_UNKNOWN, RA_WFWG, RA_OS2, RA_WIN95, RA_WINNT, RA_SAMBA}; -- cgit From 3339f170c2d8a40c8941555b3ea0ad8b8b2f457f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 9 Apr 1998 00:07:17 +0000 Subject: Added codepage 936 (simplified Chineses). In doing so I realized that much code was being duplicated between Hangul, Big5 and Simplified Chinese - so I re-arranged kanji.[ch] to go through generic functions for all multibyte characters that can be identified by a single code range (not Kanji - but all the others). Jeremy. (This used to be commit b6c965c396eb3d4f0e6dfd863e70b28390c59f66) --- source3/include/kanji.h | 6 +++++- source3/include/smb.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/kanji.h b/source3/include/kanji.h index 302db13a27..db3731e41b 100644 --- a/source3/include/kanji.h +++ b/source3/include/kanji.h @@ -109,6 +109,9 @@ /* For traditional Chinese (known as Big5 encoding - code page 950). */ #define is_big5_c1(c) ((0xa1 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0xf9)) +/* For simplified Chinese (code page - 936). */ +#define is_simpch_c1(c) ((0xa1 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0xf7)) + #else /* not _KANJI_C_ */ /* @@ -143,6 +146,7 @@ extern char *(*multibyte_strtok)(char *s1, char *s2); extern char *(*_dos_to_unix)(char *str, BOOL overwrite); extern char *(*_unix_to_dos)(char *str, BOOL overwrite); extern BOOL (*is_multibyte_char)(char c); +extern int (*_skip_multibyte_char)(char c); #define strchr(s1, c) ((*multibyte_strchr)((s1), (c))) #define strrchr(s1, c) ((*multibyte_strrchr)((s1), (c))) @@ -150,7 +154,7 @@ extern BOOL (*is_multibyte_char)(char c); #define strtok(s1, s2) ((*multibyte_strtok)((s1), (s2))) #define dos_to_unix(x,y) ((*_dos_to_unix)((x), (y))) #define unix_to_dos(x,y) ((*_unix_to_dos)((x), (y))) -#define skip_multibyte_char(c) ((*is_multibyte_char)((c))) +#define skip_multibyte_char(c) ((*_skip_multibyte_char)((c))) #endif /* _KANJI_C_ */ diff --git a/source3/include/smb.h b/source3/include/smb.h index 88d9a9de09..21bf346c62 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1115,6 +1115,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER}; #define KANJI_CODEPAGE 932 #define HANGUL_CODEPAGE 949 #define BIG5_CODEPAGE 950 +#define SIMPLIFIED_CHINESE_CODEPAGE 936 #ifdef KANJI /* -- cgit From af80d8e98f2f74939d680c6abc21e3f40b927f31 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 9 Apr 1998 20:48:48 +0000 Subject: Makefile, loadparm.c, server.c, smb.h, util.c: Patch from stn@techfak.uni-kiel.de (Stefan Nehlsen) to get homes from the NIS+ map. smbpasswd.c: Tidy up of cli_state structure. Jeremy. (This used to be commit fc2295e0f5729585fdb3ee47edb290851d4071c5) --- source3/include/proto.h | 3 --- source3/include/smb.h | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 993cf46486..ad9a36ca62 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1750,9 +1750,6 @@ int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize); int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize); int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize); -/*The following definitions come from ubiqx/ubi_dLinkList.c */ - - /*The following definitions come from ufc.c */ char *ufc_crypt(char *key,char *salt); diff --git a/source3/include/smb.h b/source3/include/smb.h index 21bf346c62..33c483d54c 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -887,7 +887,7 @@ struct parm_struct #define smb_base(buf) (((char *)(buf))+4) -#define SUCCESS 0 /* The request was successful. */ +#define SMB_SUCCESS 0 /* The request was successful. */ #define ERRDOS 0x01 /* Error is from the core DOS operating system set. */ #define ERRSRV 0x02 /* Error is generated by the server network file manager.*/ #define ERRHRD 0x03 /* Error is an hardware error. */ -- cgit From e300c0346ff92035ff9568b55b34469193e29769 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 10 Apr 1998 18:21:16 +0000 Subject: includes.h: Moved HPUX undefine of SEMMSL to where it actually does something. ipc.c: Added Luke's debug statement. locking_slow.c: Added FTRUNCATE_NEEDS_ROOT code for broken systems that need it (not sure what these are yet). membuffer.c ntdomain.h proto.h lib/rpc/include/rpc_dce.h lib/rpc/include/rpc_srvsvc.h lib/rpc/parse/parse_prs.c lib/rpc/parse/parse_rpc.c lib/rpc/server/srv_pipe_hnd.c lib/rpc/server/srv_util.c: Re-merge of Luke's NTDOM changes 'cos he's a lazy git with carpel tunnel syndrome :-). Jeremy. (This used to be commit 52e3966fbcf7b5fbdbc7cbe9ac0b453ab5bf3217) --- source3/include/includes.h | 10 +++++----- source3/include/ntdomain.h | 3 ++- source3/include/proto.h | 8 +++++--- source3/include/rpc_dce.h | 18 +++++++++++++----- source3/include/rpc_srvsvc.h | 2 +- 5 files changed, 26 insertions(+), 15 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 5df76668c6..2ba069aa76 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -606,11 +606,6 @@ char *mktemp(char *); /* No standard include */ not good for HPUX */ /* #define SIGCLD_IGNORE */ #define USE_SIGPROCMASK /* Needed to stop zombie processes on HPUX 9.x and 10.x.*/ -#ifdef HPUX10 -#ifdef SEMMSL -#undef SEMMSL -#endif /* SEMMSL */ -#endif /* HPUX10 */ #endif /* HPUX */ @@ -1137,6 +1132,11 @@ union semun { unsigned short *array; }; #endif +#if defined(HPUX) && defined(HPUX10) +#ifdef SEMMSL +#undef SEMMSL +#endif /* SEMMSL */ +#endif /* HPUX && HPUX10 */ #endif #ifdef AFS_AUTH diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index 32812aa8b1..67fe879f9b 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -69,7 +69,8 @@ typedef struct RPC_HDR hdr; RPC_HDR_BA hdr_ba; RPC_HDR_RB hdr_rb; - RPC_HDR_RR hdr_rr; + RPC_HDR_REQ hdr_req; + RPC_HDR_RESP hdr_resp; RPC_AUTH_NTLMSSP_REQ ntlmssp_req; RPC_AUTH_NTLMSSP_RESP ntlmssp_resp; diff --git a/source3/include/proto.h b/source3/include/proto.h index ad9a36ca62..faf295f625 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -471,8 +471,10 @@ void make_rpc_hdr_ba(RPC_HDR_BA *rpc, uint8 num_results, uint16 result, uint16 reason, RPC_IFACE *transfer); void smb_io_rpc_hdr_ba(char *desc, RPC_HDR_BA *rpc, prs_struct *ps, int depth); -void make_rpc_hdr_rr(RPC_HDR_RR *hdr, uint32 data_len, uint8 opnum); -void smb_io_rpc_hdr_rr(char *desc, RPC_HDR_RR *rpc, prs_struct *ps, int depth); +void make_rpc_hdr_req(RPC_HDR_REQ *hdr, uint32 data_len, uint16 opnum); +void smb_io_rpc_hdr_req(char *desc, RPC_HDR_REQ *rpc, prs_struct *ps, int depth); +void make_rpc_hdr_resp(RPC_HDR_RESP *hdr, uint32 data_len); +void smb_io_rpc_hdr_resp(char *desc, RPC_HDR_RESP *rpc, prs_struct *ps, int depth); void make_rpc_auth_ntlmssp_req(RPC_AUTH_NTLMSSP_REQ *req, fstring ntlmssp_str, uint32 ntlmssp_ver, uint32 unknown_0, fstring myname, fstring domain); @@ -1116,7 +1118,7 @@ void mem_buf_free(struct mem_buf **buf); void mem_free_chain(struct mem_buf **buf); void mem_free_data(struct mem_buf *buf); BOOL mem_realloc_data(struct mem_buf *buf, int new_size); -BOOL mem_grow_data(struct mem_buf **buf, BOOL io, int new_size); +BOOL mem_grow_data(struct mem_buf **buf, BOOL io, int new_size, BOOL force_grow); BOOL mem_find(struct mem_buf **buf, uint32 offset); uint32 mem_buf_len(struct mem_buf *buf); char *mem_data(struct mem_buf **buf, uint32 offset); diff --git a/source3/include/rpc_dce.h b/source3/include/rpc_dce.h index 9aacaaab87..2e3995e43d 100644 --- a/source3/include/rpc_dce.h +++ b/source3/include/rpc_dce.h @@ -75,16 +75,24 @@ typedef struct rpc_hdr_info } RPC_HDR; -/* RPC_HDR_RR - ms request / response rpc header */ -typedef struct rpc_hdr_rr_info +/* RPC_HDR_REQ - ms request rpc header */ +typedef struct rpc_hdr_req_info { uint32 alloc_hint; /* allocation hint - data size (bytes) minus header and tail. */ - uint8 context_id; /* 0 - presentation context identifier */ + uint16 context_id; /* 0 - presentation context identifier */ + uint16 opnum; /* opnum */ + +} RPC_HDR_REQ; + +/* RPC_HDR_RESP - ms response rpc header */ +typedef struct rpc_hdr_resp_info +{ + uint32 alloc_hint; /* allocation hint - data size (bytes) minus header and tail. */ + uint16 context_id; /* 0 - presentation context identifier */ uint8 cancel_count; /* 0 - cancel count */ - uint8 opnum; /* opnum */ uint8 reserved; /* 0 - reserved. */ -} RPC_HDR_RR; +} RPC_HDR_RESP; /* this seems to be the same string name depending on the name of the pipe, * but is more likely to be linked to the interface name diff --git a/source3/include/rpc_srvsvc.h b/source3/include/rpc_srvsvc.h index 4d11b915e4..6ba137da2f 100644 --- a/source3/include/rpc_srvsvc.h +++ b/source3/include/rpc_srvsvc.h @@ -249,7 +249,7 @@ typedef struct r_net_conn_enum_info /* oops - this is going to take up a *massive* amount of stack. */ /* the UNISTR2s already have 1024 uint16 chars in them... */ -#define MAX_SHARE_ENTRIES 32 +#define MAX_SHARE_ENTRIES 128 /* SH_INFO_1 (pointers to level 1 share info strings) */ typedef struct ptr_share_info1 -- cgit From 9b5b34a721ffff5ccc2cbf0bac070ab9dbc5590e Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Sat, 11 Apr 1998 08:14:53 +0000 Subject: Oops, fogot proto.h. It needs to be updated for changes to client.c (This used to be commit c95097501a621a87c51d59407cce754be055558a) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index faf295f625..d49111fabb 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -46,7 +46,7 @@ BOOL change_oem_password(struct smb_passwd *smbpw, char *new_passwd); /*The following definitions come from client.c */ void cli_smb_close(char *inbuf, char *outbuf, int clnt_fd, int c_num, int f_num); -void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(),BOOL recurse_dir); +void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(),BOOL recurse_dir,BOOL dirstoo); void cmd_help(void); /*The following definitions come from clientgen.c */ -- cgit From c0c2353b77021389480ddd2cab887ea8f31769ed Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Sat, 11 Apr 1998 13:02:11 +0000 Subject: Fix heaps of warnings when compiling with gcc under Digital UNIX. Include route.h and mbuf.h at a strategic point ... Wierd stuff really, because the Digital compiler does not complain either way, but GCC does. (This used to be commit 241fde3c713c91961b6bcb97ecb046ac2f3bb00b) --- source3/include/includes.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 2ba069aa76..a1723a55c6 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -182,6 +182,10 @@ #ifdef POSIX_H #include #else +#ifdef OSF1 +#include +#include +#endif #include #endif #endif -- cgit From cac6a060af598bf94e6414b06e7365ec51ca360e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 13 Apr 1998 19:24:06 +0000 Subject: Changes to allow Samba to be compiled with -Wstrict-prototypes with gcc. (Not a big change although it looks like it :-). Jeremy. (This used to be commit cd2613c57261456485fe4eeecfda209ada70de8e) --- source3/include/includes.h | 13 ++++- source3/include/proto.h | 139 ++++++++++++++++++++++----------------------- source3/include/smb.h | 2 +- 3 files changed, 81 insertions(+), 73 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index a1723a55c6..8cc2711e0a 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -521,12 +521,13 @@ char *mktemp(char *); /* No standard include */ #include #include #include +#include #if __FreeBSD__ >= 3 #include #else #define USE_DIRECT #endif -#define SIGNAL_CAST (void (*)()) +#define SIGNAL_CAST (void (*)(int)) #define USE_SETVBUF #define USE_SETSID #define USE_GETCWD @@ -536,7 +537,15 @@ char *mktemp(char *); /* No standard include */ #define HAVE_GETTIMEOFDAY #define HAVE_PATHCONF #define HAVE_GETGRNAM 1 -#endif +#define QSORT_CAST (int (*)(const void *, const void *)) +#if !defined(O_SYNC) +#if defined(O_FSYNC) +#define O_SYNC O_FSYNC +#else /* defined(O_FSYNC) */ +#define O_SYNC 0 +#endif /* defined(O_FSYNC) */ +#endif /* !defined(O_SYNC) */ +#endif /* FreeBSD */ #ifdef __OpenBSD__ #include diff --git a/source3/include/proto.h b/source3/include/proto.h index d49111fabb..fb95a7d525 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -9,14 +9,14 @@ BOOL allow_access(char *deny_list,char *allow_list,char *cname,char *caddr); /*The following definitions come from asyncdns.c */ int asyncdns_fd(void); -void kill_async_dns_child(); +void kill_async_dns_child(void); void start_async_dns(void); void run_dns_queue(void); BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question, struct name_record **n); BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question, struct name_record **n); -void kill_async_dns_child(); +void kill_async_dns_child(void); /*The following definitions come from charcnv.c */ @@ -46,8 +46,8 @@ BOOL change_oem_password(struct smb_passwd *smbpw, char *new_passwd); /*The following definitions come from client.c */ void cli_smb_close(char *inbuf, char *outbuf, int clnt_fd, int c_num, int f_num); -void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(),BOOL recurse_dir,BOOL dirstoo); -void cmd_help(void); +void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(file_info *),BOOL recurse_dir, BOOL dirstoo); +void cmd_help(char *dum_in, char *dum_out); /*The following definitions come from clientgen.c */ @@ -114,16 +114,16 @@ BOOL cli_send_trans_request(char *outbuf,int trans, int mdata,int mparam,int msetup); BOOL cli_send_session_request(char *inbuf,char *outbuf); BOOL cli_send_login(char *inbuf,char *outbuf,BOOL start_session,BOOL use_setup, struct connection_options *options); -void cli_send_logout(void ); +void cli_send_logout(char *dum_in, char *dum_out); BOOL cli_open_sockets(int port ); BOOL cli_reopen_connection(char *inbuf,char *outbuf); /*The following definitions come from clitar.c */ int padit(char *buf, int bufsize, int padsize); -void cmd_block(void); -void cmd_tarmode(void); -void cmd_setmode(void); +void cmd_block(char *dum_in, char *dum_out); +void cmd_tarmode(char *dum_in, char *dum_out); +void cmd_setmode(char *dum_in, char *dum_out); void cmd_tar(char *inbuf, char *outbuf); int process_tar(char *inbuf, char *outbuf); int clipfind(char **aret, int ret, char *tok); @@ -179,7 +179,7 @@ void DirCacheFlush( int snum ); /*The following definitions come from fault.c */ -void fault_setup(void (*fn)()); +void fault_setup(void (*fn)(void *)); /*The following definitions come from getsmbpass.c */ @@ -193,7 +193,7 @@ BOOL ismyip(struct in_addr ip); BOOL ismybcast(struct in_addr bcast); BOOL is_local_net(struct in_addr from); int iface_count(void); -BOOL we_are_multihomed(); +BOOL we_are_multihomed(void); struct interface *get_interface(int n); struct in_addr *iface_n_ip(int n); struct in_addr *iface_bcast(struct in_addr ip); @@ -1125,19 +1125,18 @@ char *mem_data(struct mem_buf **buf, uint32 offset); /*The following definitions come from message.c */ -int reply_sends(char *inbuf,char *outbuf); -int reply_sendstrt(char *inbuf,char *outbuf); -int reply_sendtxt(char *inbuf,char *outbuf); -int reply_sendend(char *inbuf,char *outbuf); +int reply_sends(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_sendstrt(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_sendtxt(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_sendend(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); /*The following definitions come from namequery.c */ BOOL name_status(int fd,char *name,int name_type,BOOL recurse, struct in_addr to_ip,char *master,char *rname, - void (*fn)()); -struct in_addr *name_query(int fd,char *name,int name_type, - BOOL bcast,BOOL recurse, - struct in_addr to_ip, int *count, void (*fn)()); + void (*fn)(struct packet_struct *)); +struct in_addr *name_query(int fd,char *name,int name_type, BOOL bcast,BOOL recurse, + struct in_addr to_ip, int *count, void (*fn)(struct packet_struct *)); FILE *startlmhosts(char *fname); BOOL getlmhostsent( FILE *fp, char *name, int *name_type, struct in_addr *ipaddr); void endlmhosts(FILE *fp); @@ -1230,8 +1229,8 @@ void add_logon_names(void); /*The following definitions come from nmbd_mynames.c */ -BOOL register_my_workgroup_and_names(); -void release_my_names(); +BOOL register_my_workgroup_and_names(void); +void release_my_names(void); void refresh_my_names(time_t t); /*The following definitions come from nmbd_namelistdb.c */ @@ -1263,7 +1262,7 @@ void standard_success_release(struct subnet_record *subrec, void expire_names_on_subnet(struct subnet_record *subrec, time_t t); void expire_names(time_t t); void add_samba_names_to_subnet(struct subnet_record *subrec); -void dump_all_namelists(); +void dump_all_namelists(void); /*The following definitions come from nmbd_namequery.c */ @@ -1358,7 +1357,7 @@ void process_browse_packet(struct packet_struct *p, char *buf,int len); void process_lanman_packet(struct packet_struct *p, char *buf,int len); BOOL validate_nmb_response_packet( struct nmb_packet *nmb ); BOOL validate_nmb_packet( struct nmb_packet *nmb ); -void run_packet_queue(); +void run_packet_queue(void); void retransmit_or_expire_response_records(time_t t); BOOL listen_for_packets(BOOL run_election); BOOL send_mailslot(BOOL unique, char *mailslot,char *buf,int len, @@ -1394,7 +1393,7 @@ void send_browser_reset(int reset_type, char *to_name, int to_type, struct in_ad void broadcast_announce_request(struct subnet_record *subrec, struct work_record *work); void announce_my_server_names(time_t t); void announce_my_lm_server_names(time_t t); -void reset_announce_timer(); +void reset_announce_timer(void); void announce_myself_to_domain_master_browser(time_t t); void announce_my_servers_removed(void); void announce_remote(time_t t); @@ -1414,8 +1413,8 @@ void write_browse_list(time_t t, BOOL force_write); /*The following definitions come from nmbd_subnetdb.c */ -BOOL create_subnets(); -BOOL we_are_a_wins_client(); +BOOL create_subnets(void); +BOOL we_are_a_wins_client(void); struct subnet_record *get_next_subnet_maybe_unicast(struct subnet_record *subrec); struct subnet_record *get_next_subnet_maybe_unicast_or_wins_server(struct subnet_record *subrec); @@ -1506,7 +1505,7 @@ BOOL server_validate(char *user, char *domain, /*The following definitions come from pcap.c */ BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); -void pcap_printer_fn(void (*fn)()); +void pcap_printer_fn(void (*fn)(char *, char *)); /*The following definitions come from pidfile.c */ @@ -1522,12 +1521,12 @@ int reply_pipe_close(char *inbuf,char *outbuf); /*The following definitions come from predict.c */ int read_predict(int fd,int offset,char *buf,char **ptr,int num); -void do_read_prediction(); +void do_read_prediction(void); void invalidate_read_prediction(int fd); /*The following definitions come from print_svid.c */ -void sysv_printer_fn(void (*fn)()); +void sysv_printer_fn(void (*fn)(char *, char *)); int sysv_printername_ok(char *name); /*The following definitions come from printing.c */ @@ -1560,55 +1559,55 @@ void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line); /*The following definitions come from reply.c */ int reply_special(char *inbuf,char *outbuf); -int reply_tcon(char *inbuf,char *outbuf); +int reply_tcon(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize); int reply_unknown(char *inbuf,char *outbuf); -int reply_ioctl(char *inbuf,char *outbuf); +int reply_ioctl(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_chkpth(char *inbuf,char *outbuf); -int reply_getatr(char *inbuf,char *outbuf); -int reply_setatr(char *inbuf,char *outbuf); -int reply_dskattr(char *inbuf,char *outbuf); -int reply_search(char *inbuf,char *outbuf); -int reply_fclose(char *inbuf,char *outbuf); -int reply_open(char *inbuf,char *outbuf); +int reply_chkpth(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_getatr(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_setatr(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_dskattr(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_search(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_fclose(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_open(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); int reply_open_and_X(char *inbuf,char *outbuf,int length,int bufsize); int reply_ulogoffX(char *inbuf,char *outbuf,int length,int bufsize); -int reply_mknew(char *inbuf,char *outbuf); -int reply_ctemp(char *inbuf,char *outbuf); -int reply_unlink(char *inbuf,char *outbuf); -int reply_readbraw(char *inbuf, char *outbuf); -int reply_lockread(char *inbuf,char *outbuf); -int reply_read(char *inbuf,char *outbuf); +int reply_mknew(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_ctemp(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_unlink(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_readbraw(char *inbuf, char *outbuf, int dum_size, int dum_buffsize); +int reply_lockread(char *inbuf,char *outbuf, int dum_size, int dum_buffsiz); +int reply_read(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); int reply_read_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_writebraw(char *inbuf,char *outbuf); -int reply_writeunlock(char *inbuf,char *outbuf); -int reply_write(char *inbuf,char *outbuf,int dum1,int dum2); +int reply_writebraw(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_writeunlock(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_write(char *inbuf,char *outbuf,int dum_size,int dum_buffsize); int reply_write_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_lseek(char *inbuf,char *outbuf); -int reply_flush(char *inbuf,char *outbuf); -int reply_exit(char *inbuf,char *outbuf); -int reply_close(char *inbuf,char *outbuf); -int reply_writeclose(char *inbuf,char *outbuf); -int reply_lock(char *inbuf,char *outbuf); -int reply_unlock(char *inbuf,char *outbuf); -int reply_tdis(char *inbuf,char *outbuf); -int reply_echo(char *inbuf,char *outbuf); -int reply_printopen(char *inbuf,char *outbuf); -int reply_printclose(char *inbuf,char *outbuf); -int reply_printqueue(char *inbuf,char *outbuf); -int reply_printwrite(char *inbuf,char *outbuf); -int reply_mkdir(char *inbuf,char *outbuf); -int reply_rmdir(char *inbuf,char *outbuf); -int reply_mv(char *inbuf,char *outbuf); -int reply_copy(char *inbuf,char *outbuf); -int reply_setdir(char *inbuf,char *outbuf); +int reply_lseek(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_flush(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_exit(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_close(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_writeclose(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_lock(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_unlock(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_tdis(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_echo(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_printopen(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_printclose(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_printqueue(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_printwrite(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_mkdir(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_rmdir(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_mv(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_copy(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_setdir(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); int reply_lockingX(char *inbuf,char *outbuf,int length,int bufsize); int reply_readbmpx(char *inbuf,char *outbuf,int length,int bufsize); -int reply_writebmpx(char *inbuf,char *outbuf); -int reply_writebs(char *inbuf,char *outbuf); -int reply_setattrE(char *inbuf,char *outbuf); -int reply_getattrE(char *inbuf,char *outbuf); +int reply_writebmpx(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_writebs(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_setattrE(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_getattrE(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); /*The following definitions come from server.c */ @@ -1880,7 +1879,7 @@ int interpret_security(char *str,int def); uint32 interpret_addr(char *str); struct in_addr *interpret_addr2(char *str); BOOL zero_ip(struct in_addr ip); -void reset_globals_after_fork(); +void reset_globals_after_fork(void); char *client_name(int fd); char *client_addr(int fd); char *automount_server(char *user_name); @@ -1903,7 +1902,7 @@ int file_lock(char *name,int timeout); void file_unlock(int fd); BOOL is_myname(char *s); void set_remote_arch(enum remote_arch_types type); -enum remote_arch_types get_remote_arch(); +enum remote_arch_types get_remote_arch(void); char *skip_unicode_string(char *buf,int n); char *unistrn2(uint16 *buf, int len); char *unistr2(uint16 *buf); diff --git a/source3/include/smb.h b/source3/include/smb.h index 33c483d54c..95521217e9 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -632,7 +632,7 @@ struct parm_struct parm_type type; parm_class class; void *ptr; - BOOL (*special)(); + BOOL (*special)(char *, char **); struct enum_list *enum_list; unsigned flags; union { -- cgit From d5e040247e180664bd32a0d7d8dd905f46cbdb47 Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Mon, 13 Apr 1998 22:45:52 +0000 Subject: Changes include: proto.h: The unusual. ;) reply.c: I changes some function names, and updated reply.c to match. See mangle.c below for more. server.c: Changed function names and parameters in file mangle.c, so changed server.c calls to match. See mangle.c below for more. mangle.c: I replaced the caching mechanism used for caching reverse mangled name maps. The old method was a large array of 256-byte strings. Movement in the stack (including push and pop) was done by memcpy()ing whole chunks of memory around. The new system uses the ubi_Cache module which, in turn, uses a splay tree. Entries are dynamically allocated using a minimum amount of memory. Searches are non-linear, which should speed things up a bit, too. Overall, this should save memory and be faster. Other changes: I streamlined the is_mangled() test and made other speed enhancements including replacing some static functions with macros. Added comments, etc. Note: Per an E'mail conversation with Andrew, the 'mangled stack' parameter in smb.conf doesn't do anything anymore. The cache is now set for 16K bytes maximum memory usage. The mangle stack parameter is silently ignored. This can easily be changed, but I'd rather introduce a 'mangled cache memory' parameter and remove 'mangled stack'. Remaining problems: While testing the module, I noticed that something is calling name_map_mangle() twice. The result is that names which contain illegal characters are getting mangled twice. Also, the entire module works by overwriting the input string. This has a variety of nasty side effects. Summary: There's a lot still to be done, but the changes I have in place *should* work in exactly the same way (except for the mangle stack parameter). The rest of the bugs and other issues are separate. Chris -)----- (This used to be commit 8759bec11ba483b2292b0e513b85c98ed5e3e2d4) --- source3/include/proto.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index fb95a7d525..3e1f9f5fa3 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1078,13 +1078,13 @@ struct share_ops *locking_slow_init(int ronly); /*The following definitions come from mangle.c */ -int str_checksum(char *s); -BOOL is_8_3(char *fname, BOOL check_case); -void reset_mangled_stack( int size ); -BOOL check_mangled_stack(char *s); BOOL is_mangled( char *s ); -void mangle_name_83(char *s); -BOOL name_map_mangle(char *OutName,BOOL need83,int snum); +BOOL is_8_3( char *fname, BOOL check_case ); +int str_checksum( char *s ); +void reset_mangled_cache( void ); +BOOL check_mangled_cache( char *s ); +void mangle_name_83( char *s ); +BOOL name_map_mangle( char *OutName, BOOL need83, int snum ); /*The following definitions come from md4.c */ -- cgit From 2a53d6f7077de596265a3e73e79827392054142c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 14 Apr 1998 00:41:59 +0000 Subject: Modified interfaces to getting smb password entries from get_smbpwd_entry (now an internal function to smbpass.c) to a more UNIX-like : getsmbpwnam() - get entry by name. getsmbpwuid() - get entry by uid. Changed the type returned by the smbpasswd enumeration functions to be a void * so that people don't come to depend on it being a FILE *. These abstractions should make it much easier to replace the smbpasswd file with a better backend in future. Other files changed are to match the above changes. Jeremy. (This used to be commit 1161cfb7f2b0d5a6d3e2b524a14a6f325ce70efb) --- source3/include/proto.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 3e1f9f5fa3..07df90e1bd 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1690,10 +1690,13 @@ char *smb_errstr(char *inbuf); int pw_file_lock(int fd, int type, int secs); int pw_file_unlock(int fd); -FILE *startsmbpwent(BOOL update); -void endsmbpwent(FILE *fp); -struct smb_passwd *getsmbpwent(FILE *fp); -struct smb_passwd *get_smbpwd_entry(char *name, int smb_userid); +void *startsmbpwent(BOOL update); +void endsmbpwent(void *vp); +struct smb_passwd *getsmbpwent(void *vp); +unsigned long getsmbpwpos(void *vp); +BOOL setsmbpwpos(void *vp, unsigned long tok); +struct smb_passwd *getsmbpwnam(char *name); +struct smb_passwd *getsmbpwuid(unsigned int uid); BOOL add_smbpwd_entry(struct smb_passwd *newpwd); BOOL mod_smbpwd_entry(struct smb_passwd* pwd); -- cgit From 041a292c439189206f1c35de94893dd51a1fda33 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 15 Apr 1998 20:00:41 +0000 Subject: ipc.c: Fix for printer queue spinning with Win95. nmbd.c: Fix for always overwriting log despite append setting. smb.h: Addition of last time password changed entry to account info. smbpass.c: Changes to support last time changed field in smbpasswd file. smbpasswd.c: Changes to support last time changed field in smbpasswd file. util.c: Fix for always overwriting log despite append setting. Jeremy. (This used to be commit eb4fe9ecdf539209efab07dc992447ea7370cf93) --- source3/include/proto.h | 1 + source3/include/smb.h | 1 + 2 files changed, 2 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 07df90e1bd..c5c7c1e846 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1697,6 +1697,7 @@ unsigned long getsmbpwpos(void *vp); BOOL setsmbpwpos(void *vp, unsigned long tok); struct smb_passwd *getsmbpwnam(char *name); struct smb_passwd *getsmbpwuid(unsigned int uid); +char *encode_acct_ctrl(uint16 acct_ctrl); BOOL add_smbpwd_entry(struct smb_passwd *newpwd); BOOL mod_smbpwd_entry(struct smb_passwd* pwd); diff --git a/source3/include/smb.h b/source3/include/smb.h index 95521217e9..46e282b2ba 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -287,6 +287,7 @@ struct smb_passwd unsigned char *smb_nt_passwd; /* Null if no password */ /* Other fields / flags may be added later */ uint16 acct_ctrl; + time_t last_change_time; }; struct cli_state { -- cgit From 373d7c62577c13e1a85043844953a8d779858432 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 17 Apr 1998 19:29:51 +0000 Subject: Changing of machine passwords now works !!!!!! smbdes.c: Added cred_hash3. smbpasswd.c: Fixes for adding a machine account (needs more work). lib/rpc/server/srv_netlog.c: Turn on the machine password changing code by default (calls cred_hash3). Jeremy. (This used to be commit 50aa513b969c6e41911aeee8207b065f93af0beb) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index c5c7c1e846..b1a5edab62 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1673,6 +1673,7 @@ void D_P16(unsigned char *p14, unsigned char *in, unsigned char *out); void E_old_pw_hash( unsigned char *p14, unsigned char *in, unsigned char *out); void cred_hash1(unsigned char *out,unsigned char *in,unsigned char *key); void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key); +void cred_hash3(unsigned char *out,unsigned char *in,unsigned char *key); void SamOEMhash( unsigned char *data, unsigned char *key, int val); /*The following definitions come from smbencrypt.c */ -- cgit From f9a96f060bdc8d045748b5f7e31d177e43e8810a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 17 Apr 1998 22:44:01 +0000 Subject: clientgen.c: Changes 'cli_xxx_' calls to use the following regularized parameter syntax: setup, setup_count, max_setup_count, params, params_count, max_params_count, data, data_count, max_data_count, (and if a reply is needed) *reply_params, *reply_data_len *reply_data, *reply_data_len This allows the pointers and the lengths that relate to these pointers to be next to each other in the parameter list. This makes seeing what you are passing to these functions much easier to see. Getting ready for adding the lib/rpc/client functions needed to do security=domain. torture.c: Fixed it so it uses / rather than \\ internally for the //machine/share syntax. Jeremy. (This used to be commit 38350ea8b949d0908497490898ff04df7591ccac) --- source3/include/proto.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index b1a5edab62..3afc150649 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -51,6 +51,12 @@ void cmd_help(char *dum_in, char *dum_out); /*The following definitions come from clientgen.c */ +BOOL cli_api_pipe(struct cli_state *cli, char *pipe_name, int pipe_name_len, + uint16 *setup, uint32 setup_count, uint32 max_setup_count, + char *params, uint32 param_count, uint32 max_param_count, + char *data, uint32 data_count, uint32 max_data_count, + char **rparam, uint32 *rparam_count, + char **rdata, uint32 *rdata_count); BOOL cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation); BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype, void (*fn)(char *, uint32, char *)); -- cgit From 6733e2b36e00ccbe8df363651ecc98ba42d53cee Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 18 Apr 1998 02:00:39 +0000 Subject: includes.h: Added John's redhat fix for QSORT_CAST. smbpass.c: Added lock depth code so calls to pw_file_lock() can be nested. Fixed codedump problems in add_smbpwd_entry(). smbpasswd.c: Removed all the code that manipulated the password file directly. Now *all* smbpasswd file changes are done through the interfaces defined in smbpass.c This should make the life of people adding alternate backend databases *much* easier. lib/rpc/server/srv_netlog.c: Removed debug messages used to debug machine password changing. Jeremy. (This used to be commit c9f61be08f3691a6421734d8b026a295d9cbd6ba) --- source3/include/includes.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 8cc2711e0a..587d13bd40 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -226,6 +226,9 @@ Here come some platform specific sections #include #include #endif +#ifndef QSORT_CAST +#define QSORT_CAST (int (*)(const void *, const void *)) +#endif /* QSORT_CAST */ #define SIGNAL_CAST (__sighandler_t) #define USE_GETCWD #define USE_SETSID -- cgit From ec6fde99ab739ff2c410e5459bba06b06d18b5dc Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 20 Apr 1998 20:32:50 +0000 Subject: Fixed bug that John found in WINS server code. When nmbd as a WINS server is sending out a name_query after a WACK, it needs to send a packet with recursion_desired = 0 (yes Luke, you were right all along :-). If it doesn't then if it's talking to itself then the query packet ends up back in the WINS server instead of in the client side code. Makefile: Changed proto generation to stop including NMBDOBJ twice. nmbd_namequery.c nmbd_packets.c nmbd_winsserver.c: Added extra query_name_from_wins_server() code. Jeremy. (This used to be commit c5ca05c29546053a771f4ea3ef850efb3be970ea) --- source3/include/proto.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 3afc150649..539ddc2ae5 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1276,6 +1276,11 @@ BOOL query_name(struct subnet_record *subrec, char *name, int type, query_name_success_function success_fn, query_name_fail_function fail_fn, struct userdata_struct *userdata); +BOOL query_name_from_wins_server(struct in_addr ip_to, + char *name, int type, + query_name_success_function success_fn, + query_name_fail_function fail_fn, + struct userdata_struct *userdata); /*The following definitions come from nmbd_nameregister.c */ @@ -1347,6 +1352,13 @@ struct response_record *queue_query_name( struct subnet_record *subrec, query_name_fail_function fail_fn, struct userdata_struct *userdata, struct nmb_name *nmbname); +struct response_record *queue_query_name_from_wins_server( struct in_addr to_ip, + response_function resp_fn, + timeout_response_function timeout_fn, + query_name_success_function success_fn, + query_name_fail_function fail_fn, + struct userdata_struct *userdata, + struct nmb_name *nmbname); struct response_record *queue_node_status( struct subnet_record *subrec, response_function resp_fn, timeout_response_function timeout_fn, -- cgit From efb71742ca8ff9ec3211c5b3cf5d311fdceecd1c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 20 Apr 1998 22:43:54 +0000 Subject: Makefile: Added genrand.o clientgen.c: Changed to fill change password buffer with random stuff. password.c: Changed to get challenge from genrand.c server.c: Added #ifdef around O_SYNC. version.h: Changed to 1.9.19prealpha. genrand.c: New code to generate (hopefully) good random numbers for use in crypto challenges/session keys etc. PLEASE REVIEW THIS CODE AND SUGGEST IMPROVEMENTS !!!!!! Jeremy. (This used to be commit 608e98546392fd0aac9b33f4feac43615dbb4405) --- source3/include/proto.h | 4 ++++ source3/include/version.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 539ddc2ae5..e57f7924ee 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -187,6 +187,10 @@ void DirCacheFlush( int snum ); void fault_setup(void (*fn)(void *)); +/*The following definitions come from genrand.c */ + +void generate_random_buffer( unsigned char *out, int len, BOOL re_seed); + /*The following definitions come from getsmbpass.c */ char *getsmbpass(char *prompt) ; diff --git a/source3/include/version.h b/source3/include/version.h index 758b32209e..146d0b7753 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.18-HEAD" +#define VERSION "1.9.19-prealpha" -- cgit From 6babe8da07b6a803d15deed70dd7e6aaae93ed4a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 20 Apr 1998 23:07:28 +0000 Subject: Added 'passwd chat debug' parameter to allow admins to debug their Samba passwd chat scripts. Jeremy. (This used to be commit 5a995f4f75ffb0d55d6ceaa63a1209d230001991) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index e57f7924ee..433e833c31 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -937,6 +937,7 @@ BOOL lp_time_server(void); BOOL lp_bind_interfaces_only(void); BOOL lp_net_wksta_user_logon(void); BOOL lp_unix_password_sync(void); +BOOL lp_passwd_chat_debug(void); int lp_os_level(void); int lp_max_ttl(void); int lp_max_wins_ttl(void); -- cgit From 2dee1ed38867504d067d593c62734ecff0eca77c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 21 Apr 1998 02:23:24 +0000 Subject: clientgen.c: Added cli_ulogoff() call. password.c: Added call to cli_ulogoff on successfull sessionsetup. Jeremy. (This used to be commit 77882f002b2a8203aad419e485fc885303d999a0) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 433e833c31..da1293fa69 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -65,6 +65,7 @@ BOOL cli_session_setup(struct cli_state *cli, char *pass, int passlen, char *ntpass, int ntpasslen, char *workgroup); +BOOL cli_ulogoff(struct cli_state *cli); BOOL cli_send_tconX(struct cli_state *cli, char *share, char *dev, char *pass, int passlen); BOOL cli_tdis(struct cli_state *cli); -- cgit From 76d3bc36a5ce13d2a7bd08f9c18b2cfd0ab0210f Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 21 Apr 1998 02:36:37 +0000 Subject: put server-side long dce/rpc code in main branch. (This used to be commit 2e1a08b28c1c0c9ea988a09067cd149926f25c69) --- source3/include/ntdomain.h | 90 +++++++++++++++++++++++----------------------- 1 file changed, 46 insertions(+), 44 deletions(-) (limited to 'source3/include') diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index 67fe879f9b..329cb1e325 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -46,44 +46,46 @@ typedef struct { - struct mem_buf *data; /* memory buffer */ - uint32 offset; /* offset currently being accessed in memory buffer */ - uint8 align; /* data alignment */ - BOOL io; /* parsing in or out of data stream */ + struct mem_buf *data; /* memory buffer */ + uint32 offset; /* offset currently being accessed in memory buffer */ + uint8 align; /* data alignment */ + BOOL io; /* parsing in or out of data stream */ } prs_struct; typedef struct { - int cnum; - int uid; - BOOL open; /* open connection */ - uint16 device_state; - fstring name; - fstring pipe_srv_name; - - prs_struct rhdr; /* output header */ - prs_struct rdata; /* output data */ - prs_struct rauth; /* output authentication verifier */ - - RPC_HDR hdr; - RPC_HDR_BA hdr_ba; - RPC_HDR_RB hdr_rb; - RPC_HDR_REQ hdr_req; - RPC_HDR_RESP hdr_resp; - - RPC_AUTH_NTLMSSP_REQ ntlmssp_req; - RPC_AUTH_NTLMSSP_RESP ntlmssp_resp; - - uint32 max_rdata_len; - uint32 hdr_offsets; + int cnum; + int uid; + BOOL open; /* open connection */ + uint16 device_state; + fstring name; + fstring pipe_srv_name; + + prs_struct rhdr; /* output header */ + prs_struct rdata; /* output data */ + prs_struct rauth; /* output authentication verifier */ + + RPC_HDR hdr; + RPC_HDR_BA hdr_ba; + RPC_HDR_RB hdr_rb; + RPC_HDR_REQ hdr_req; + RPC_HDR_RESP hdr_resp; + + RPC_AUTH_NTLMSSP_REQ ntlmssp_req; + RPC_AUTH_NTLMSSP_RESP ntlmssp_resp; + + uint32 file_offset; + uint32 hdr_offsets; + uint32 frag_len_left; + uint32 next_frag_start; } pipes_struct; struct acct_info { - fstring acct_name; /* account name */ - uint32 smb_userid; /* domain-relative RID */ + fstring acct_name; /* account name */ + uint32 smb_userid; /* domain-relative RID */ }; struct api_struct @@ -95,33 +97,33 @@ struct api_struct struct mem_desc { - /* array memory offsets */ - uint32 start; - uint32 end; + /* array memory offsets */ + uint32 start; + uint32 end; }; struct mem_buf { - BOOL dynamic; /* True iff data has been dynamically allocated - (and therefore can be freed) */ - char *data; - uint32 data_size; - uint32 data_used; + BOOL dynamic; /* True iff data has been dynamically allocated + (and therefore can be freed) */ + char *data; + uint32 data_size; + uint32 data_used; - uint32 margin; /* safety margin when reallocing. */ - /* this can be abused quite nicely */ - uint8 align; /* alignment of data structures (smb, dce/rpc, udp etc) */ + uint32 margin; /* safety margin when reallocing. */ + /* this can be abused quite nicely */ + uint8 align; /* alignment of data structures (smb, dce/rpc, udp etc) */ - struct mem_desc offset; + struct mem_desc offset; - struct mem_buf *next; + struct mem_buf *next; }; typedef struct { - uint32 rid; - char *name; - + uint32 rid; + char *name; + } rid_name; #endif /* _NT_DOMAIN_H */ -- cgit From 8584c6bd6621eefb49aff69581caf28e38b4ceda Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 22 Apr 1998 00:56:38 +0000 Subject: genrand.c: Improved generation of random values, more secure. loadparm.c: Started add of 'security=domain' code. password.c: Fix for security=server NT bugs. reply.c: Started add of 'security=domain' code. server.c: Started add of 'security=domain' code. smb.h: Started add of 'security=domain' code. Jeremy. (This used to be commit e6bda112ebe0d41f54c4249b5c2e1f24011347e1) --- source3/include/smb.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 46e282b2ba..4438024dbd 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1061,7 +1061,11 @@ char *Strstr(char *s, char *p); enum protocol_types {PROTOCOL_NONE,PROTOCOL_CORE,PROTOCOL_COREPLUS,PROTOCOL_LANMAN1,PROTOCOL_LANMAN2,PROTOCOL_NT1}; /* security levels */ +#ifdef DOMAIN_CLIENT +enum security_types {SEC_SHARE,SEC_USER,SEC_SERVER,SEC_DOMAIN}; +#else /* DOMAIN_CLIENT */ enum security_types {SEC_SHARE,SEC_USER,SEC_SERVER}; +#endif /* DOMAIN_CLIENT */ /* printing types */ enum printing_types {PRINT_BSD,PRINT_SYSV,PRINT_AIX,PRINT_HPUX, -- cgit From a85f5bc268a1c13334b86ac3a44a026359c09371 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 23 Apr 1998 18:54:57 +0000 Subject: genrand.c: Changed SMB_PASSWD_FILE to lp_smb_passwd_file(). password.c: Started the initial code for domain_client_validate(). All bracketed with #ifdef DOMAIN_CLIENT for now. reply.c: Call to domain_client_validate(). All bracketed with #ifdef DOMAIN_CLIENT for now. smbpass.c: New code to get/set machine passwords. Tidied up nesting of lock calls. Jeremy. (This used to be commit 89fe059a6816f32d2cc5c4c04c4089b60590e7e6) --- source3/include/proto.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index da1293fa69..9bba68df48 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1525,6 +1525,9 @@ struct cli_state *server_cryptkey(void); BOOL server_validate(char *user, char *domain, char *pass, int passlen, char *ntpass, int ntpasslen); +BOOL domain_client_validate( char *user, char *domain, + char *smb_apasswd, int smb_apasslen, + char *smb_ntpasswd, int smb_ntpasslen); /*The following definitions come from pcap.c */ @@ -1713,8 +1716,6 @@ char *smb_errstr(char *inbuf); /*The following definitions come from smbpass.c */ -int pw_file_lock(int fd, int type, int secs); -int pw_file_unlock(int fd); void *startsmbpwent(BOOL update); void endsmbpwent(void *vp); struct smb_passwd *getsmbpwent(void *vp); @@ -1725,6 +1726,11 @@ struct smb_passwd *getsmbpwuid(unsigned int uid); char *encode_acct_ctrl(uint16 acct_ctrl); BOOL add_smbpwd_entry(struct smb_passwd *newpwd); BOOL mod_smbpwd_entry(struct smb_passwd* pwd); +void *machine_password_lock( char *doman, char *name, BOOL update); +BOOL machine_password_unlock( void *token ); +BOOL get_machine_account_password( void *mach_tok, unsigned char *ret_pwd, + time_t *last_change_time); +BOOL set_machine_account_password( void *mach_tok, unsigned char *md4_new_pwd); /*The following definitions come from status.c */ -- cgit From 002a47de8e0cf03c79cedbed2db52f391001f459 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 23 Apr 1998 20:12:17 +0000 Subject: clientgen.c: Added rap error codes to cli_error, moved from smbpasswd.c password.c: Changed global cli -> pw_cli, removed strtok (bad strtok, bad :-) use in security=server, started to extend security=domain code. smbpasswd.c: Removed rap error code functions. Jeremy. (This used to be commit 0f00b8fce1a5cad7f8c212568fa33f09986e5bd6) --- source3/include/proto.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 9bba68df48..adf753ccf5 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -51,6 +51,8 @@ void cmd_help(char *dum_in, char *dum_out); /*The following definitions come from clientgen.c */ +char *cli_smb_errstr(struct cli_state *cli); +char *cli_errstr(struct cli_state *cli); BOOL cli_api_pipe(struct cli_state *cli, char *pipe_name, int pipe_name_len, uint16 *setup, uint32 setup_count, uint32 max_setup_count, char *params, uint32 param_count, uint32 max_param_count, @@ -97,7 +99,6 @@ BOOL cli_session_request(struct cli_state *cli, char *host, int name_type, BOOL cli_connect(struct cli_state *cli, char *host, struct in_addr *ip); BOOL cli_initialise(struct cli_state *cli); void cli_shutdown(struct cli_state *cli); -char *cli_errstr(struct cli_state *cli); void cli_error(struct cli_state *cli, int *eclass, int *num); void cli_sockopt(struct cli_state *cli, char *options); int cli_setpid(struct cli_state *cli, int pid); @@ -1726,7 +1727,7 @@ struct smb_passwd *getsmbpwuid(unsigned int uid); char *encode_acct_ctrl(uint16 acct_ctrl); BOOL add_smbpwd_entry(struct smb_passwd *newpwd); BOOL mod_smbpwd_entry(struct smb_passwd* pwd); -void *machine_password_lock( char *doman, char *name, BOOL update); +void *machine_password_lock( char *domain, char *name, BOOL update); BOOL machine_password_unlock( void *token ); BOOL get_machine_account_password( void *mach_tok, unsigned char *ret_pwd, time_t *last_change_time); -- cgit From 30675f81f60bab24f47758baab8316d4467709ef Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 23 Apr 1998 22:59:19 +0000 Subject: Makefile: Added nterr.c into the mix. clientgen.c: Added nt_error as an entry in the struct client_state. password.c: Open the netlogon pipe. smb.h: Added nt_error as an entry in the struct client_state. lib/rpc/parse/parse_net.c: Added comments on net logon. lib/rpc/server/srv_netlog.c: Added comments on net logon. Jeremy. (This used to be commit 899a9f0dce50c73e03c8da2ebe920957491c8ad7) --- source3/include/proto.h | 4 ++++ source3/include/smb.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index adf753ccf5..70f61781ea 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1492,6 +1492,10 @@ BOOL nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2); BOOL send_packet(struct packet_struct *p); struct packet_struct *receive_packet(int fd,enum packet_type type,int t); +/*The following definitions come from nterr.c */ + +char *get_nt_error_msg(uint32 nt_code); + /*The following definitions come from params.c */ BOOL pm_process( char *FileName, diff --git a/source3/include/smb.h b/source3/include/smb.h index 4438024dbd..8d5cc20582 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -298,7 +298,8 @@ struct cli_state { int uid; int protocol; int sec_mode; - int error; + int rap_error; + uint32 nt_error; int privilages; fstring eff_name; fstring desthost; -- cgit From 9189005f7f884123d29c8f27db73687b68c80bb9 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 24 Apr 1998 21:01:08 +0000 Subject: ABOUT time. dce/rpc long packet format now works, server-side. turns out that [it can be deduced that] microsoft ignores the SMBreadX offset, and goes by the SMBreadX length only. this makes for a lot simpler code, in both client and server. (This used to be commit a8b641c027c8cce179455ac1f6fd0322a8ab017d) --- source3/include/proto.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 70f61781ea..b999e6a4b6 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -864,6 +864,8 @@ uint32 lookup_group_rid(char *group_name, uint32 *rid); uint32 lookup_alias_rid(char *alias_name, uint32 *rid); uint32 lookup_user_rid(char *user_name, uint32 *rid); BOOL name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); +uint32 uid_to_user_rid(uint32 uid); +uint32 gid_to_group_rid(uint32 gid); /*The following definitions come from lib/rpc/server/srv_wkssvc.c */ -- cgit From e7ac86607c80912e55ac7179b100cea22749c16f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 25 Apr 1998 01:12:08 +0000 Subject: This looks like a big change but really isn't. It is changing the global variables "myname" and "myworkgroup" to "global_myname" and "global_myworkgroup" respectively. This is to make it very explicit when we are messing with a global (don't ask - it makes the domain client code much clearer :-). Jeremy. (This used to be commit 866406bfe399cf757c8275093dacd5ce4843afa0) --- source3/include/includes.h | 3 ++ source3/include/smb.h | 112 ++++++++++++++++++++++++--------------------- 2 files changed, 63 insertions(+), 52 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 587d13bd40..5fc2811981 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -383,6 +383,9 @@ char *getwd(char *); #define USE_WAITPID #define USE_SETSID #define USE_SYSV_IPC +#ifndef QSORT_CAST +#define QSORT_CAST (int (*)(const void *, const void *)) +#endif /* QSORT_CAST */ #endif diff --git a/source3/include/smb.h b/source3/include/smb.h index 8d5cc20582..1bf5b318b3 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -251,13 +251,6 @@ typedef fstring string; #define PIPE_LSASS "\\PIPE\\lsass" #define PIPE_LSARPC "\\PIPE\\lsarpc" -/* 32 bit time (sec) since 01jan1970 - cifs6.txt, section 3.5, page 30 */ -typedef struct time_info -{ - uint32 time; - -} UTIME; - /* 64 bit time (100usec) since ????? - cifs6.txt, section 3.5, page 30 */ typedef struct nttime_info { @@ -281,40 +274,69 @@ typedef struct nttime_info struct smb_passwd { - int smb_userid; - char *smb_name; - unsigned char *smb_passwd; /* Null if no password */ - unsigned char *smb_nt_passwd; /* Null if no password */ - /* Other fields / flags may be added later */ - uint16 acct_ctrl; - time_t last_change_time; + int smb_userid; + char *smb_name; + unsigned char *smb_passwd; /* Null if no password */ + unsigned char *smb_nt_passwd; /* Null if no password */ + /* Other fields / flags may be added later */ + uint16 acct_ctrl; + time_t last_change_time; }; +/* DOM_CHAL - challenge info */ +typedef struct chal_info +{ + uchar data[8]; /* credentials */ +} DOM_CHAL; + +/* 32 bit time (sec) since 01jan1970 - cifs6.txt, section 3.5, page 30 */ +typedef struct time_info +{ + uint32 time; + +} UTIME; + +/* DOM_CREDs - timestamped client or server credentials */ +typedef struct cred_info +{ + DOM_CHAL challenge; /* credentials */ + UTIME timestamp; /* credential time-stamp */ + +} DOM_CRED; + struct cli_state { - int fd; - int cnum; - int pid; - int mid; - int uid; - int protocol; - int sec_mode; - int rap_error; - uint32 nt_error; - int privilages; - fstring eff_name; - fstring desthost; - char cryptkey[8]; - uint32 sesskey; - int serverzone; - uint32 servertime; - int readbraw_supported; - int writebraw_supported; - int timeout; - int max_xmit; - char *outbuf; - char *inbuf; - int bufsize; - int initialised; + int fd; + int cnum; + int pid; + int mid; + int uid; + int protocol; + int sec_mode; + int rap_error; + int privilages; + fstring eff_name; + fstring desthost; + char cryptkey[8]; + uint32 sesskey; + int serverzone; + uint32 servertime; + int readbraw_supported; + int writebraw_supported; + int timeout; + int max_xmit; + char *outbuf; + char *inbuf; + int bufsize; + int initialised; + /* + * Only used in NT domain calls. + */ + uint32 nt_error; /* NT RPC error code. */ + uint16 nt_pipe_fnum; /* Pipe handle. */ + unsigned char sess_key[16]; /* Current session key. */ + DOM_CRED clnt_cred; /* Client credential. */ + fstring mach_acct; + fstring srv_name; }; @@ -445,20 +467,6 @@ typedef struct } connection_struct; -/* DOM_CHAL - challenge info */ -typedef struct chal_info -{ - uchar data[8]; /* credentials */ -} DOM_CHAL; - -/* DOM_CREDs - timestamped client or server credentials */ -typedef struct cred_info -{ - DOM_CHAL challenge; /* credentials */ - UTIME timestamp; /* credential time-stamp */ - -} DOM_CRED; - /* Domain controller authentication protocol info */ struct dcinfo { -- cgit From d3832506b2583130c4f4ba4b3edeabca987b7cbb Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 29 Apr 1998 00:02:57 +0000 Subject: This is the checkin that adds the security=domain functionality. WARNING - so far this has only been tested against a Samba PDC (still waiting for IS to add me the machine accounts :-). Still missing is the code in smbpasswd that will add a machine account password and change it on the domain controller, but this is not hard, and I will check it in soon. Jeremy. (This used to be commit 17b94a7084621b3f0106dd4d3386f05cdfc56d19) --- source3/include/proto.h | 46 ++++++++++++++++++++++++++++++++++++++---- source3/include/rpc_netlogon.h | 3 +++ source3/include/smb.h | 8 ++------ 3 files changed, 47 insertions(+), 10 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index b999e6a4b6..60f04bde87 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -60,6 +60,7 @@ BOOL cli_api_pipe(struct cli_state *cli, char *pipe_name, int pipe_name_len, char **rparam, uint32 *rparam_count, char **rdata, uint32 *rdata_count); BOOL cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation); +BOOL cli_RNetShareEnum(struct cli_state *cli, void (*fn)(char *, uint32, char *)); BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype, void (*fn)(char *, uint32, char *)); BOOL cli_session_setup(struct cli_state *cli, @@ -222,6 +223,44 @@ int reply_trans(char *inbuf,char *outbuf, int size, int bufsize); void interpret_coding_system(char *str); void initialize_multibyte_vectors( int client_codepage); +/*The following definitions come from lib/rpc/client/cli_login.c */ + +BOOL cli_nt_setup_creds(struct cli_state *cli, unsigned char mach_pwd[16]); +BOOL cli_nt_srv_pwset(struct cli_state *cli, unsigned char *new_hashof_mach_pwd); +BOOL cli_nt_login_interactive(struct cli_state *cli, char *domain, char *username, + uint32 smb_userid_low, char *password, + NET_ID_INFO_CTR *ctr, NET_USER_INFO_3 *user_info3); +BOOL cli_nt_login_network(struct cli_state *cli, char *domain, char *username, + uint32 smb_userid_low, char lm_chal[8], char lm_chal_resp[24], + char nt_chal_resp[24], + NET_ID_INFO_CTR *ctr, NET_USER_INFO_3 *user_info3); +BOOL cli_nt_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr); + +/*The following definitions come from lib/rpc/client/cli_netlogon.c */ + +BOOL cli_net_logon_ctrl2(struct cli_state *cli, uint32 status_level); +BOOL cli_net_auth2(struct cli_state *cli, uint16 sec_chan, + uint32 neg_flags, DOM_CHAL *srv_chal); +BOOL cli_net_req_chal(struct cli_state *cli, DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal); +BOOL cli_net_srv_pwset(struct cli_state *cli, uint8 hashed_mach_pwd[16]); +BOOL cli_net_sam_logon(struct cli_state *cli, NET_ID_INFO_CTR *ctr, + NET_USER_INFO_3 *user_info3); +BOOL cli_net_sam_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr); + +/*The following definitions come from lib/rpc/client/cli_pipe.c */ + +uint32 get_rpc_call_id(void); +BOOL rpc_api_pipe(struct cli_state *cli, uint16 cmd, + prs_struct *param , prs_struct *data, + prs_struct *rparam, prs_struct *rdata); +BOOL rpc_api_pipe_req(struct cli_state *cli, uint8 op_num, + prs_struct *data, prs_struct *rdata); +BOOL rpc_pipe_set_hnd_state(struct cli_state *cli, char *pipe_name, uint16 device_state); +BOOL rpc_pipe_bind(struct cli_state *cli, char *pipe_name, + RPC_IFACE *abstract, RPC_IFACE *transfer, BOOL ntlmssp_auth); +BOOL cli_nt_session_open(struct cli_state *cli, char *pipe_name, BOOL encrypted); +void nt_session_close(struct cli_state *cli); + /*The following definitions come from lib/rpc/parse/parse_lsa.c */ void make_lsa_trans_name(LSA_TRANS_NAME *trn, uint32 sid_name_use, char *name, uint32 idx); @@ -347,9 +386,8 @@ void make_q_auth_2(NET_Q_AUTH_2 *q_a, DOM_CHAL *clnt_chal, uint32 clnt_flgs); void net_io_q_auth_2(char *desc, NET_Q_AUTH_2 *q_a, prs_struct *ps, int depth); void net_io_r_auth_2(char *desc, NET_R_AUTH_2 *r_a, prs_struct *ps, int depth); -void make_q_srv_pwset(NET_Q_SRV_PWSET *q_s, char sess_key[16], - char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name, - DOM_CRED *cred, char nt_cypher[16]); +void make_q_srv_pwset(NET_Q_SRV_PWSET *q_s, char *logon_srv, char *acct_name, + uint16 sec_chan, char *comp_name, DOM_CRED *cred, char nt_cypher[16]); void net_io_q_srv_pwset(char *desc, NET_Q_SRV_PWSET *q_s, prs_struct *ps, int depth); void net_io_r_srv_pwset(char *desc, NET_R_SRV_PWSET *r_s, prs_struct *ps, int depth); void make_id_info1(NET_ID_INFO_1 *id, char *domain_name, @@ -1707,7 +1745,7 @@ void D_P16(unsigned char *p14, unsigned char *in, unsigned char *out); void E_old_pw_hash( unsigned char *p14, unsigned char *in, unsigned char *out); void cred_hash1(unsigned char *out,unsigned char *in,unsigned char *key); void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key); -void cred_hash3(unsigned char *out,unsigned char *in,unsigned char *key); +void cred_hash3(unsigned char *out,unsigned char *in,unsigned char *key, int forw); void SamOEMhash( unsigned char *data, unsigned char *key, int val); /*The following definitions come from smbencrypt.c */ diff --git a/source3/include/rpc_netlogon.h b/source3/include/rpc_netlogon.h index 1fc6596821..ca8231fc5b 100644 --- a/source3/include/rpc_netlogon.h +++ b/source3/include/rpc_netlogon.h @@ -301,6 +301,9 @@ typedef struct id_info_1 } NET_ID_INFO_1; +#define INTERACTIVE_LOGON_TYPE 1 +#define NET_LOGON_TYPE 2 + /* NET_ID_INFO_CTR */ typedef struct net_id_info_ctr_info { diff --git a/source3/include/smb.h b/source3/include/smb.h index 1bf5b318b3..33b38706df 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -335,8 +335,8 @@ struct cli_state { uint16 nt_pipe_fnum; /* Pipe handle. */ unsigned char sess_key[16]; /* Current session key. */ DOM_CRED clnt_cred; /* Client credential. */ - fstring mach_acct; - fstring srv_name; + fstring mach_acct; /* MYNAME$. */ + fstring srv_name_slash; /* \\remote server. */ }; @@ -1070,11 +1070,7 @@ char *Strstr(char *s, char *p); enum protocol_types {PROTOCOL_NONE,PROTOCOL_CORE,PROTOCOL_COREPLUS,PROTOCOL_LANMAN1,PROTOCOL_LANMAN2,PROTOCOL_NT1}; /* security levels */ -#ifdef DOMAIN_CLIENT enum security_types {SEC_SHARE,SEC_USER,SEC_SERVER,SEC_DOMAIN}; -#else /* DOMAIN_CLIENT */ -enum security_types {SEC_SHARE,SEC_USER,SEC_SERVER}; -#endif /* DOMAIN_CLIENT */ /* printing types */ enum printing_types {PRINT_BSD,PRINT_SYSV,PRINT_AIX,PRINT_HPUX, -- cgit From e305c2c9e2e657974d34d1d58a8f9372921fdae2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 29 Apr 1998 19:22:01 +0000 Subject: clientgen.c: Fixed null session setup bug. password.c: Stopped cli_nt_logout call (we don't have it correct yet). Added Luke object-orientation fix :-). smb.h: Added clnt_name_slash to cli_state. lib/rpc/client/cli_login.c: Changed global_myname to clnt_name_slash where needed. lib/rpc/client/cli_netlogon.c: Fixed debug messages, don't check creds on error. lib/rpc/client/cli_pipe.c: Fixed debug messages, Added Luke object-orientation fix. lib/rpc/parse/parse_misc.c: Fixed STRING2 linearization bug that was adding 1. Jeremy. (This used to be commit c6c22df20196cb7f0ae84b1a1dd202a87adb8d4e) --- source3/include/proto.h | 2 +- source3/include/smb.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 60f04bde87..15c25b01e7 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -259,7 +259,7 @@ BOOL rpc_pipe_set_hnd_state(struct cli_state *cli, char *pipe_name, uint16 devic BOOL rpc_pipe_bind(struct cli_state *cli, char *pipe_name, RPC_IFACE *abstract, RPC_IFACE *transfer, BOOL ntlmssp_auth); BOOL cli_nt_session_open(struct cli_state *cli, char *pipe_name, BOOL encrypted); -void nt_session_close(struct cli_state *cli); +void cli_nt_session_close(struct cli_state *cli); /*The following definitions come from lib/rpc/parse/parse_lsa.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index 33b38706df..589a70879c 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -337,6 +337,7 @@ struct cli_state { DOM_CRED clnt_cred; /* Client credential. */ fstring mach_acct; /* MYNAME$. */ fstring srv_name_slash; /* \\remote server. */ + fstring clnt_name_slash; /* \\local client. */ }; -- cgit From 90177708aaf5bf17d689979701b5f0156b8a2fa4 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 29 Apr 1998 22:27:26 +0000 Subject: Makefile: Added files to smbpasswd.c. loadparm.c: Patch from tim@quiknet.com for static string problems. server.c: Setup global_myname. smbpass.c: Fix up locking. Add machine_password_delete() call. smbpasswd.c: Added provisional code to add to a domain. lib/rpc/client/cli_login.c: Fixed incorrect cred_hash3 call when setting machine password. lib/rpc/server/srv_netlog.c: Fixed incorrect cred_hash3 call when setting machine password. Jeremy. (This used to be commit 6a7164233e3bf9d6bb57c44a53204068e454ae5c) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 15c25b01e7..76fb11c12e 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1773,6 +1773,7 @@ BOOL add_smbpwd_entry(struct smb_passwd *newpwd); BOOL mod_smbpwd_entry(struct smb_passwd* pwd); void *machine_password_lock( char *domain, char *name, BOOL update); BOOL machine_password_unlock( void *token ); +BOOL machine_password_delete( char *domain, char *name ); BOOL get_machine_account_password( void *mach_tok, unsigned char *ret_pwd, time_t *last_change_time); BOOL set_machine_account_password( void *mach_tok, unsigned char *md4_new_pwd); -- cgit From 3eae1e3f8e53c51f638b1b381085f29feea1c517 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 30 Apr 1998 01:39:22 +0000 Subject: Added patch from Bruce Tenison to allow encrypted passwords to be stored over time, allowing a smbpasswd file migration. Adds new parameter "update encrypted". Will also add to 1.9.18 branch. Docs update to follow. Jeremy. (This used to be commit 5d3e874d780d595415cc27a7f5945fc2e694c3ac) --- source3/include/proto.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 76fb11c12e..0965527205 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -41,7 +41,7 @@ BOOL change_lanman_password(struct smb_passwd *smbpw, unsigned char *pass1, unsi BOOL check_oem_password(char *user, unsigned char *data, struct smb_passwd **psmbpw, char *new_passwd, int new_passwd_size); -BOOL change_oem_password(struct smb_passwd *smbpw, char *new_passwd); +BOOL change_oem_password(struct smb_passwd *smbpw, char *new_passwd, BOOL flag); /*The following definitions come from client.c */ @@ -971,6 +971,7 @@ BOOL lp_writeraw(void); BOOL lp_null_passwords(void); BOOL lp_strip_dot(void); BOOL lp_encrypted_passwords(void); +BOOL lp_update_encrypted(void); BOOL lp_syslog_only(void); BOOL lp_browse_list(void); BOOL lp_unix_realname(void); @@ -1555,6 +1556,7 @@ int setup_groups(char *user, int uid, int gid, int *p_ngroups, int **p_attrs); uint16 register_vuid(int uid,int gid, char *name,BOOL guest); void add_session_user(char *user); +BOOL update_smbpassword_file( char *user, fstring password); void dfs_unlogin(void); BOOL password_check(char *password); BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8); @@ -1770,7 +1772,7 @@ struct smb_passwd *getsmbpwnam(char *name); struct smb_passwd *getsmbpwuid(unsigned int uid); char *encode_acct_ctrl(uint16 acct_ctrl); BOOL add_smbpwd_entry(struct smb_passwd *newpwd); -BOOL mod_smbpwd_entry(struct smb_passwd* pwd); +BOOL mod_smbpwd_entry(struct smb_passwd* pwd, BOOL override); void *machine_password_lock( char *domain, char *name, BOOL update); BOOL machine_password_unlock( void *token ); BOOL machine_password_delete( char *domain, char *name ); -- cgit From 19f76f391b97b405879fd8574e711a6d59e4e60c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 5 May 1998 19:24:32 +0000 Subject: genrand.c: SGI compile warning fix. ipc.c: Fix for duplicate printer names being long. loadparm.c: Set bNetWkstaUserLogon to false by default - new code in password.c protects us. nmbd_logonnames.c: nmbd_namequery.c: nmbd_namerelease.c: Debug messages fix. password.c: SGI compile warning fix, fix for tcon() with bNetWkstaUserLogon call. reply.c: SGI compile warning fix. server.c Debug messages fix. smbpass.c: Fix for incorrect pointer. Jeremy. (This used to be commit 567d3f838988cafab4770fce1cf68b73085e6c71) --- source3/include/proto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 0965527205..639817c049 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -41,7 +41,7 @@ BOOL change_lanman_password(struct smb_passwd *smbpw, unsigned char *pass1, unsi BOOL check_oem_password(char *user, unsigned char *data, struct smb_passwd **psmbpw, char *new_passwd, int new_passwd_size); -BOOL change_oem_password(struct smb_passwd *smbpw, char *new_passwd, BOOL flag); +BOOL change_oem_password(struct smb_passwd *smbpw, char *new_passwd, BOOL override); /*The following definitions come from client.c */ @@ -1547,7 +1547,7 @@ BOOL pm_process( char *FileName, void generate_next_challenge(char *challenge); BOOL set_challenge(char *challenge); -BOOL last_challenge(char *challenge); +BOOL last_challenge(unsigned char *challenge); user_struct *get_valid_user_struct(uint16 vuid); void invalidate_vuid(uint16 vuid); char *validated_username(uint16 vuid); -- cgit From a2bddb20ed078c3e1b9cb60a7420b3d107898f52 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 6 May 1998 01:34:51 +0000 Subject: Fixes for the %U and %G problems people have reported. Essentially, multiple session_setup_and_X's may be done to an smbd. As there is only one global variable containing the requested connection name (sessionsetup_user), then any subsequent sessionsetups overwrite this name (causing %U and %G to get the wrong name). This is particularly common when an NT client does a null session setup to get a browse list after the user has connected, but before a share has been mounted. These changes store the requested_name in the vuid structure (so this only really works for user level and above security) and copies this name back into the global variable before the standard_sub call. Jeremy. (This used to be commit b5187ad6a3b3af9fbbeee8bced0ab16b41e9825b) --- source3/include/proto.h | 4 ++-- source3/include/smb.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 639817c049..9c0de0024f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1554,7 +1554,7 @@ char *validated_username(uint16 vuid); int setup_groups(char *user, int uid, int gid, int *p_ngroups, int **p_igroups, gid_t **p_groups, int **p_attrs); -uint16 register_vuid(int uid,int gid, char *name,BOOL guest); +uint16 register_vuid(int uid,int gid, char *unix_name, char *requested_name, BOOL guest); void add_session_user(char *user); BOOL update_smbpassword_file( char *user, fstring password); void dfs_unlogin(void); @@ -1726,7 +1726,7 @@ int reply_lanman2(char *outbuf); int reply_nt1(char *outbuf); void close_cnum(int cnum, uint16 vuid); void exit_server(char *reason); -void standard_sub(int cnum,char *str); +void standard_sub(int cnum,char *str,uint16 vuid); char *smb_fn_name(int type); int chain_reply(char *inbuf,char *outbuf,int size,int bufsize); int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); diff --git a/source3/include/smb.h b/source3/include/smb.h index 589a70879c..8b7ad6ea92 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -485,7 +485,8 @@ typedef struct int uid; /* uid of a validated user */ int gid; /* gid of a validated user */ - fstring name; /* name of a validated user */ + fstring requested_name; /* user name from the client */ + fstring name; /* unix user name of a validated user */ fstring real_name; /* to store real name from password file - simeon */ BOOL guest; -- cgit From b59916ebf77814edca91683e3fe6f30799d29dd2 Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Wed, 6 May 1998 02:35:56 +0000 Subject: Real fix for clitar.c problems. Have now made all the right things static, and have done a 'make proto; make clean; make'. Still get 54 compiler warnings under Digital UNIX cc. Honest. :-) (This used to be commit 47eb7e5be2f12206bd2de0670be478d80e1d84de) --- source3/include/proto.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 9c0de0024f..fc41d18a1d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1547,14 +1547,14 @@ BOOL pm_process( char *FileName, void generate_next_challenge(char *challenge); BOOL set_challenge(char *challenge); -BOOL last_challenge(unsigned char *challenge); +BOOL last_challenge(char *challenge); user_struct *get_valid_user_struct(uint16 vuid); void invalidate_vuid(uint16 vuid); char *validated_username(uint16 vuid); int setup_groups(char *user, int uid, int gid, int *p_ngroups, int **p_igroups, gid_t **p_groups, int **p_attrs); -uint16 register_vuid(int uid,int gid, char *unix_name, char *requested_name, BOOL guest); +uint16 register_vuid(int uid,int gid, char *name,BOOL guest); void add_session_user(char *user); BOOL update_smbpassword_file( char *user, fstring password); void dfs_unlogin(void); @@ -1726,7 +1726,7 @@ int reply_lanman2(char *outbuf); int reply_nt1(char *outbuf); void close_cnum(int cnum, uint16 vuid); void exit_server(char *reason); -void standard_sub(int cnum,char *str,uint16 vuid); +void standard_sub(int cnum,char *str); char *smb_fn_name(int type); int chain_reply(char *inbuf,char *outbuf,int size,int bufsize); int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); -- cgit From 5fa8775d9758254f6f4784a0e34c9b5b8bf18bdb Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 6 May 1998 17:43:44 +0000 Subject: jean-francois micouleau's well-alpha code for ldap password database stuff! he's going to hate me for checking this in so early, but... (This used to be commit ad9ba0a1cbac5c4e6cbcbcadefe8f1df72231f74) --- source3/include/includes.h | 5 +++++ source3/include/proto.h | 20 +++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 5fc2811981..859603c29f 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -1212,6 +1212,11 @@ extern char *sys_errlist[]; #define MAXCODEPAGELINES 256 #endif +#ifdef USE_LDAP +#include "lber.h" +#include "ldap.h" +#endif + /***** automatically generated prototypes *****/ #include "proto.h" diff --git a/source3/include/proto.h b/source3/include/proto.h index fc41d18a1d..720806026b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -840,6 +840,14 @@ void make_wks_r_query_info(WKS_R_QUERY_INFO *r_u, int status) ; void wks_io_r_query_info(char *desc, WKS_R_QUERY_INFO *r_u, prs_struct *ps, int depth); +/*The following definitions come from lib/rpc/server/srv_ldap_helpers.c */ + +BOOL get_ldap_entries(SAM_USER_INFO_21 *pw_buf, + int *total_entries, int *num_entries, + int max_num_entries, + uint16 acb_mask, int switch_level); +BOOL ldap_get_user_info_21(SAM_USER_INFO_21 *id21, uint32 rid); + /*The following definitions come from lib/rpc/server/srv_lsa.c */ BOOL api_ntlsa_rpc(pipes_struct *p, prs_struct *data); @@ -952,6 +960,11 @@ char *lp_domain_admin_users(void); char *lp_domain_guest_users(void); char *lp_domain_hostsallow(void); char *lp_domain_hostsdeny(void); +char *lp_ldap_server(void); +char *lp_ldap_suffix(void); +char *lp_ldap_filter(void); +char *lp_ldap_root(void); +char *lp_ldap_rootpasswd(void); BOOL lp_dns_proxy(void); BOOL lp_wins_support(void); BOOL lp_we_are_a_wins_server(void); @@ -1005,6 +1018,7 @@ int lp_client_code_page(void); int lp_announce_as(void); int lp_lm_announce(void); int lp_lm_interval(void); +int lp_ldap_port(void); char *lp_preexec(int ); char *lp_postexec(int ); char *lp_rootpreexec(int ); @@ -1547,14 +1561,14 @@ BOOL pm_process( char *FileName, void generate_next_challenge(char *challenge); BOOL set_challenge(char *challenge); -BOOL last_challenge(char *challenge); +BOOL last_challenge(unsigned char *challenge); user_struct *get_valid_user_struct(uint16 vuid); void invalidate_vuid(uint16 vuid); char *validated_username(uint16 vuid); int setup_groups(char *user, int uid, int gid, int *p_ngroups, int **p_igroups, gid_t **p_groups, int **p_attrs); -uint16 register_vuid(int uid,int gid, char *name,BOOL guest); +uint16 register_vuid(int uid,int gid, char *unix_name, char *requested_name, BOOL guest); void add_session_user(char *user); BOOL update_smbpassword_file( char *user, fstring password); void dfs_unlogin(void); @@ -1726,7 +1740,7 @@ int reply_lanman2(char *outbuf); int reply_nt1(char *outbuf); void close_cnum(int cnum, uint16 vuid); void exit_server(char *reason); -void standard_sub(int cnum,char *str); +void standard_sub(int cnum,char *str,uint16 vuid); char *smb_fn_name(int type); int chain_reply(char *inbuf,char *outbuf,int size,int bufsize); int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); -- cgit From 346abceb277e3354214599cc3c0f9bac6d44dfc8 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 6 May 1998 18:45:57 +0000 Subject: smbpass.c: Fixed machine_passwd_lock() problems. password.c: Fixed machine_passwd_lock() problems. lib/rpc/server/srv_ldap_helpers.c: Oops - broke proto.h with dummy function. Fixed now. Jeremy. (This used to be commit d28427f21fff49da6b38c24625e3e2dae49a9713) --- source3/include/proto.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 720806026b..7c09113259 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -847,6 +847,7 @@ BOOL get_ldap_entries(SAM_USER_INFO_21 *pw_buf, int max_num_entries, uint16 acb_mask, int switch_level); BOOL ldap_get_user_info_21(SAM_USER_INFO_21 *id21, uint32 rid); +void ldap_helper_dummy(void); /*The following definitions come from lib/rpc/server/srv_lsa.c */ @@ -1787,12 +1788,11 @@ struct smb_passwd *getsmbpwuid(unsigned int uid); char *encode_acct_ctrl(uint16 acct_ctrl); BOOL add_smbpwd_entry(struct smb_passwd *newpwd); BOOL mod_smbpwd_entry(struct smb_passwd* pwd, BOOL override); -void *machine_password_lock( char *domain, char *name, BOOL update); -BOOL machine_password_unlock( void *token ); +BOOL machine_password_lock( char *domain, char *name, BOOL update); +BOOL machine_password_unlock(void); BOOL machine_password_delete( char *domain, char *name ); -BOOL get_machine_account_password( void *mach_tok, unsigned char *ret_pwd, - time_t *last_change_time); -BOOL set_machine_account_password( void *mach_tok, unsigned char *md4_new_pwd); +BOOL get_machine_account_password( unsigned char *ret_pwd, time_t *last_change_time); +BOOL set_machine_account_password( unsigned char *md4_new_pwd); /*The following definitions come from status.c */ -- cgit From d8d9f7723337c267a8740750fe19a6387cfbb1f6 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 7 May 1998 18:19:05 +0000 Subject: created "passdb.c" which is an interface point to (at present) either smbpasswd or ldap passwd, at compile-time (-DUSE_LDAP). _none_ of the functions in ldap.c or smbpass.c should be called directly: only those in passdb.c should be used. -DUSE_LDAP is unlikely to compile at the moment. (This used to be commit 57b01ad4ffb14ebd600d4e66602b54ed987f6106) --- source3/include/proto.h | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 7c09113259..c6311b3068 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -36,12 +36,12 @@ BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence, BOOL BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root); BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root); BOOL check_lanman_password(char *user, unsigned char *pass1, - unsigned char *pass2, struct smb_passwd **psmbpw); -BOOL change_lanman_password(struct smb_passwd *smbpw, unsigned char *pass1, unsigned char *pass2); + unsigned char *pass2, struct smb_passwd **psampw); +BOOL change_lanman_password(struct smb_passwd *sampw, unsigned char *pass1, unsigned char *pass2); BOOL check_oem_password(char *user, unsigned char *data, - struct smb_passwd **psmbpw, char *new_passwd, + struct smb_passwd **psampw, char *new_passwd, int new_passwd_size); -BOOL change_oem_password(struct smb_passwd *smbpw, char *new_passwd, BOOL override); +BOOL change_oem_password(struct smb_passwd *sampw, char *new_passwd, BOOL override); /*The following definitions come from client.c */ @@ -1558,6 +1558,18 @@ BOOL pm_process( char *FileName, BOOL (*sfunc)(char *), BOOL (*pfunc)(char *, char *) ); +/*The following definitions come from passdb.c */ + +struct smb_passwd *getsampwnam(char *name); +struct smb_passwd *getsampwuid(unsigned int uid); +void *startsampwent(BOOL update); +void endsampwent(void *vp); +struct smb_passwd *getsampwent(void *vp); +unsigned long getsampwpos(void *vp); +BOOL setsampwpos(void *vp, unsigned long tok); +BOOL add_sampwd_entry(struct smb_passwd *newpwd); +BOOL mod_sampwd_entry(struct smb_passwd* pwd, BOOL override); + /*The following definitions come from password.c */ void generate_next_challenge(char *challenge); -- cgit From 01df1ed95f880a671ead7bc92b3bcff01a2e2dc0 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 7 May 1998 19:04:14 +0000 Subject: This should (hopefully :-) be the final fix for the %U %G substitution problem.... smbpass.c: Removed Luke's dire warning - as some of the functions in here *need* to be called externally :-). Jeremy. (This used to be commit 1fd8d12ca414066acec71b33eb8a13e16c2acd3a) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index c6311b3068..3cc48bb78f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1753,7 +1753,7 @@ int reply_lanman2(char *outbuf); int reply_nt1(char *outbuf); void close_cnum(int cnum, uint16 vuid); void exit_server(char *reason); -void standard_sub(int cnum,char *str,uint16 vuid); +void standard_sub(int cnum,char *str); char *smb_fn_name(int type); int chain_reply(char *inbuf,char *outbuf,int size,int bufsize); int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); -- cgit From b543829dfceae6781624bebe11a2365c34e2d159 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 7 May 1998 19:59:32 +0000 Subject: moving gethexpwd into util.c, because it's used in both smbpass.c and ldap.c (This used to be commit abe261b2f5ea7036e7be6230876176d134ef4ee4) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 3cc48bb78f..fda55a652c 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2028,6 +2028,7 @@ void print_asc(int level, unsigned char *buf,int len); void dump_data(int level,char *buf1,int len); char *tab_depth(int depth); char *dom_sid_to_string(DOM_SID *sid); +int gethexpwd(char *p, char *pwd); /*The following definitions come from web/cgi.c */ -- cgit From 9273102ea54d010043e6fdfaf1c61116eb93562e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 8 May 1998 01:23:11 +0000 Subject: smb.h: Supporting defines for NT trans calls. trans2.c: Paranoia bugfixes added when studying nttrans.c. Jeremy. (This used to be commit 94e70edef91c71703a7ebcdaf2b5a2bdce940a69) --- source3/include/smb.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 8b7ad6ea92..429ce87f40 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -895,6 +895,31 @@ struct parm_struct #define smb_droff smb_vwv7 #define smb_drdisp smb_vwv8 +/* these are for the NT trans primary request. */ +#define smb_nt_MaxSetupCount smb_vwv0 +#define smb_nt_Flags (smb_vwv0 + 1) +#define smb_nt_TotalParameterCount (smb_vwv0 + 3) +#define smb_nt_TotalDataCount (smb_vwv0 + 7) +#define smb_nt_MaxParameterCount (smb_vwv0 + 11) +#define smb_nt_MaxDataCount (smb_vwv0 + 15) +#define smb_nt_ParameterCount (smb_vwv0 + 19) +#define smb_nt_ParameterOffset (smb_vwv0 + 23) +#define smb_nt_DataCount (smb_vwv0 + 27) +#define smb_nt_DataOffset (smb_vwv0 + 31) +#define smb_nt_SetupCount (smb_vwv0 + 35) +#define smb_nt_Function (smb_vwv0 + 36) +#define smb_nt_SetupStart (smb_vwv0 + 39) + +/* these are for the NT trans secondary request. */ +#define smb_nts_TotalParameterCount (smb_vwv0 + 3) +#define smb_nts_TotalDataCount (smb_vwv0 + 7) +#define smb_nts_ParameterCount (smb_vwv0 + 11) +#define smb_nts_ParameterOffset (smb_vwv0 + 15) +#define smb_nts_ParameterDisplacement (smb_vwv0 + 19) +#define smb_nts_DataCount (smb_vwv0 + 23) +#define smb_nts_DataOffset (smb_vwv0 + 27) +#define smb_nts_DataDisplacement (smb_vwv0 + 31) + /* where to find the base of the SMB packet proper */ #define smb_base(buf) (((char *)(buf))+4) -- cgit From 6b70e2c7fd55f6cd21c645ffd587c71ddc354374 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 8 May 1998 11:30:17 +0000 Subject: added extra fields to struct smb_passwd the smbpw functions are expected to fill in the blanks by reading the appropriate smb.conf parameters. the ldappw functions are expected to fill in the fields from the ldap database. a separate utility can be written to fill in the ldap database fields from the smb.conf parameters, at a later date. (This used to be commit 0b6394c83ec20afdd8065da6785e057c35f3951f) --- source3/include/smb.h | 44 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 7 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 429ce87f40..11e7409a9a 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -272,17 +272,47 @@ typedef struct nttime_info #define ACB_PWNOEXP 0x0200 /* 1 = User password does not expire */ #define ACB_AUTOLOCK 0x0400 /* 1 = Account auto locked */ +#define MAX_HOURS_LEN 32 + struct smb_passwd { - int smb_userid; - char *smb_name; - unsigned char *smb_passwd; /* Null if no password */ - unsigned char *smb_nt_passwd; /* Null if no password */ - /* Other fields / flags may be added later */ - uint16 acct_ctrl; - time_t last_change_time; + time_t logon_time; /* logon time */ + time_t logoff_time; /* logoff time */ + time_t kickoff_time; /* kickoff time */ + time_t pass_last_set_time; /* password last set time */ + time_t pass_can_change_time; /* password can change time */ + time_t pass_must_change_time; /* password must change time */ + + char *smb_name; /* username unicode string */ + char *full_name; /* user's full name unicode string */ + char *home_dir; /* home directory unicode string */ + char *dir_drive; /* home directory drive unicode string */ + char *logon_script; /* logon script unicode string */ + char *profile_path; /* profile path unicode string */ + char *acct_desc ; /* user description unicode string */ + char *workstations; /* login from workstations unicode string */ + char *unknown_str ; /* don't know what this is, yet. */ + char *munged_dial ; /* munged path name and dial-back tel number */ + + int smb_userid; /* this is actually the unix uid_t */ + uint32 user_rid; /* Primary User ID */ + uint32 group_rid; /* Primary Group ID */ + + unsigned char *smb_passwd; /* Null if no password */ + unsigned char *smb_nt_passwd; /* Null if no password */ + + uint16 acct_ctrl; /* account info (ACB_xxxx bit-mask) */ + uint32 unknown_3; /* 0x00ff ffff */ + + uint16 logon_divs; /* 168 - number of hours in a week */ + uint32 hours_len; /* normally 21 bytes */ + uint8 hours[MAX_HOURS_LEN]; + + uint32 unknown_5; /* 0x0002 0000 */ + uint32 unknown_6; /* 0x0000 04ec */ }; + /* DOM_CHAL - challenge info */ typedef struct chal_info { -- cgit From bb8706f4076ca1e0ba11b62014ebfc85a357e931 Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Fri, 8 May 1998 13:51:17 +0000 Subject: Se-submitting clitar.c/ I now only have one warning in my code which is the result of some code I have started working on but am not yet using in the code, along with a warning that is caused by one of the include files (a nested comment). I used -Wall -Wshadow -Wstrict-prototypes (This used to be commit 7b98fd5b69282320af700833c2d2720c42a382d8) --- source3/include/includes.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 859603c29f..e5076c6f39 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -205,6 +205,9 @@ #include #endif +#ifdef HAVE_REGEX_H +#include +#endif /*************************************************************************** @@ -1212,11 +1215,6 @@ extern char *sys_errlist[]; #define MAXCODEPAGELINES 256 #endif -#ifdef USE_LDAP -#include "lber.h" -#include "ldap.h" -#endif - /***** automatically generated prototypes *****/ #include "proto.h" -- cgit From 45d32e53015d754dbdfe5dede2f1ff8b23a71c74 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 8 May 1998 14:09:13 +0000 Subject: added smb_grpid to smb_passwd struct (This used to be commit bcafdcda85581cee4b7b5ead4526c30851e461bf) --- source3/include/smb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 11e7409a9a..542545147b 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -295,6 +295,7 @@ struct smb_passwd char *munged_dial ; /* munged path name and dial-back tel number */ int smb_userid; /* this is actually the unix uid_t */ + int smb_grpid; /* this is actually the unix gid_t */ uint32 user_rid; /* Primary User ID */ uint32 group_rid; /* Primary Group ID */ -- cgit From f5039406e1bde6e8dce9336b72f6112691a4862b Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 8 May 1998 14:41:35 +0000 Subject: proto.h was being a pain. use "make proto" instead. check release and release-alpha scripts operate correctly when it comes to generating a release or alpha release. (This used to be commit 6f792502d714c4883fe0831068c4ac703e7029ba) --- source3/include/proto.h | 2070 ----------------------------------------------- 1 file changed, 2070 deletions(-) delete mode 100644 source3/include/proto.h (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h deleted file mode 100644 index fda55a652c..0000000000 --- a/source3/include/proto.h +++ /dev/null @@ -1,2070 +0,0 @@ -/* This file is automatically generated with "make proto". DO NOT EDIT */ - - -/*The following definitions come from access.c */ - -BOOL check_access(int snum); -BOOL allow_access(char *deny_list,char *allow_list,char *cname,char *caddr); - -/*The following definitions come from asyncdns.c */ - -int asyncdns_fd(void); -void kill_async_dns_child(void); -void start_async_dns(void); -void run_dns_queue(void); -BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question, - struct name_record **n); -BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question, - struct name_record **n); -void kill_async_dns_child(void); - -/*The following definitions come from charcnv.c */ - -char *unix2dos_format(char *str,BOOL overwrite); -char *dos2unix_format(char *str, BOOL overwrite); -void interpret_character_set(char *str); - -/*The following definitions come from charset.c */ - -void charset_initialise(void); -void codepage_initialise(int client_codepage); -void add_char_string(char *s); - -/*The following definitions come from chgpasswd.c */ - -BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence, BOOL as_root); -BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root); -BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root); -BOOL check_lanman_password(char *user, unsigned char *pass1, - unsigned char *pass2, struct smb_passwd **psampw); -BOOL change_lanman_password(struct smb_passwd *sampw, unsigned char *pass1, unsigned char *pass2); -BOOL check_oem_password(char *user, unsigned char *data, - struct smb_passwd **psampw, char *new_passwd, - int new_passwd_size); -BOOL change_oem_password(struct smb_passwd *sampw, char *new_passwd, BOOL override); - -/*The following definitions come from client.c */ - -void cli_smb_close(char *inbuf, char *outbuf, int clnt_fd, int c_num, int f_num); -void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(file_info *),BOOL recurse_dir, BOOL dirstoo); -void cmd_help(char *dum_in, char *dum_out); - -/*The following definitions come from clientgen.c */ - -char *cli_smb_errstr(struct cli_state *cli); -char *cli_errstr(struct cli_state *cli); -BOOL cli_api_pipe(struct cli_state *cli, char *pipe_name, int pipe_name_len, - uint16 *setup, uint32 setup_count, uint32 max_setup_count, - char *params, uint32 param_count, uint32 max_param_count, - char *data, uint32 data_count, uint32 max_data_count, - char **rparam, uint32 *rparam_count, - char **rdata, uint32 *rdata_count); -BOOL cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation); -BOOL cli_RNetShareEnum(struct cli_state *cli, void (*fn)(char *, uint32, char *)); -BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype, - void (*fn)(char *, uint32, char *)); -BOOL cli_session_setup(struct cli_state *cli, - char *user, - char *pass, int passlen, - char *ntpass, int ntpasslen, - char *workgroup); -BOOL cli_ulogoff(struct cli_state *cli); -BOOL cli_send_tconX(struct cli_state *cli, - char *share, char *dev, char *pass, int passlen); -BOOL cli_tdis(struct cli_state *cli); -BOOL cli_mv(struct cli_state *cli, char *fname_src, char *fname_dst); -BOOL cli_unlink(struct cli_state *cli, char *fname); -BOOL cli_mkdir(struct cli_state *cli, char *dname); -BOOL cli_rmdir(struct cli_state *cli, char *dname); -int cli_open(struct cli_state *cli, char *fname, int flags, int share_mode); -BOOL cli_close(struct cli_state *cli, int fnum); -BOOL cli_lock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout); -BOOL cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout); -int cli_read(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 size); -int cli_write(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 size); -BOOL cli_getatr(struct cli_state *cli, char *fname, - int *attr, uint32 *size, time_t *t); -BOOL cli_setatr(struct cli_state *cli, char *fname, int attr, time_t t); -BOOL cli_qpathinfo(struct cli_state *cli, char *fname, - time_t *c_time, time_t *a_time, time_t *m_time, uint32 *size); -BOOL cli_qpathinfo2(struct cli_state *cli, char *fname, - time_t *c_time, time_t *a_time, time_t *m_time, - time_t *w_time, uint32 *size); -BOOL cli_qfileinfo(struct cli_state *cli, int fnum, - time_t *c_time, time_t *a_time, time_t *m_time, uint32 *size); -BOOL cli_oem_change_password(struct cli_state *cli, char *user, char *new_password, - char *old_password); -BOOL cli_negprot(struct cli_state *cli); -BOOL cli_session_request(struct cli_state *cli, char *host, int name_type, - char *myname); -BOOL cli_connect(struct cli_state *cli, char *host, struct in_addr *ip); -BOOL cli_initialise(struct cli_state *cli); -void cli_shutdown(struct cli_state *cli); -void cli_error(struct cli_state *cli, int *eclass, int *num); -void cli_sockopt(struct cli_state *cli, char *options); -int cli_setpid(struct cli_state *cli, int pid); - -/*The following definitions come from clientutil.c */ - -void cli_setup_pkt(char *outbuf); -BOOL cli_call_api(char *pipe_name, int pipe_name_len, - int prcnt,int drcnt, int srcnt, - int mprcnt,int mdrcnt, - int *rprcnt,int *rdrcnt, - char *param,char *data, uint16 *setup, - char **rparam,char **rdata); -BOOL cli_receive_trans_response(char *inbuf,int trans, - int *data_len,int *param_len, - char **data,char **param); -BOOL cli_send_trans_request(char *outbuf,int trans, - char *name,int namelen, int fid,int flags, - char *data,char *param,uint16 *setup, - int ldata,int lparam,int lsetup, - int mdata,int mparam,int msetup); -BOOL cli_send_session_request(char *inbuf,char *outbuf); -BOOL cli_send_login(char *inbuf,char *outbuf,BOOL start_session,BOOL use_setup, struct connection_options *options); -void cli_send_logout(char *dum_in, char *dum_out); -BOOL cli_open_sockets(int port ); -BOOL cli_reopen_connection(char *inbuf,char *outbuf); - -/*The following definitions come from clitar.c */ - -int padit(char *buf, int bufsize, int padsize); -void cmd_block(char *dum_in, char *dum_out); -void cmd_tarmode(char *dum_in, char *dum_out); -void cmd_setmode(char *dum_in, char *dum_out); -void cmd_tar(char *inbuf, char *outbuf); -int process_tar(char *inbuf, char *outbuf); -int clipfind(char **aret, int ret, char *tok); -int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind); - -/*The following definitions come from connection.c */ - -BOOL yield_connection(int cnum,char *name,int max_connections); -BOOL claim_connection(int cnum,char *name,int max_connections,BOOL Clear); - -/*The following definitions come from credentials.c */ - -char *credstr(uchar *cred); -void cred_session_key(DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal, char *pass, - uchar session_key[8]); -void cred_create(uchar session_key[8], DOM_CHAL *stor_cred, UTIME timestamp, - DOM_CHAL *cred); -int cred_assert(DOM_CHAL *cred, uchar session_key[8], DOM_CHAL *stored_cred, - UTIME timestamp); -BOOL clnt_deal_with_creds(uchar sess_key[8], - DOM_CRED *sto_clnt_cred, DOM_CRED *rcv_srv_cred); -BOOL deal_with_creds(uchar sess_key[8], - DOM_CRED *sto_clnt_cred, - DOM_CRED *rcv_clnt_cred, DOM_CRED *rtn_srv_cred); - -/*The following definitions come from dir.c */ - -void init_dptrs(void); -char *dptr_path(int key); -char *dptr_wcard(int key); -BOOL dptr_set_wcard(int key, char *wcard); -BOOL dptr_set_attr(int key, uint16 attr); -uint16 dptr_attr(int key); -void dptr_close(int key); -void dptr_closecnum(int cnum); -void dptr_idlecnum(int cnum); -void dptr_closepath(char *path,int pid); -int dptr_create(int cnum,char *path, BOOL expect_close,int pid); -BOOL dptr_fill(char *buf1,unsigned int key); -BOOL dptr_zero(char *buf); -void *dptr_fetch(char *buf,int *num); -void *dptr_fetch_lanman2(int dptr_num); -BOOL dir_check_ftype(int cnum,int mode,struct stat *st,int dirtype); -BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend); -void *OpenDir(int cnum, char *name, BOOL use_veto); -void CloseDir(void *p); -char *ReadDirName(void *p); -BOOL SeekDir(void *p,int pos); -int TellDir(void *p); -void DirCacheAdd( char *path, char *name, char *dname, int snum ); -char *DirCacheCheck( char *path, char *name, int snum ); -void DirCacheFlush( int snum ); - -/*The following definitions come from fault.c */ - -void fault_setup(void (*fn)(void *)); - -/*The following definitions come from genrand.c */ - -void generate_random_buffer( unsigned char *out, int len, BOOL re_seed); - -/*The following definitions come from getsmbpass.c */ - -char *getsmbpass(char *prompt) ; - -/*The following definitions come from interface.c */ - -void load_interfaces(void); -void iface_set_default(char *ip,char *bcast,char *nmask); -BOOL ismyip(struct in_addr ip); -BOOL ismybcast(struct in_addr bcast); -BOOL is_local_net(struct in_addr from); -int iface_count(void); -BOOL we_are_multihomed(void); -struct interface *get_interface(int n); -struct in_addr *iface_n_ip(int n); -struct in_addr *iface_bcast(struct in_addr ip); -struct in_addr *iface_nmask(struct in_addr ip); -struct in_addr *iface_ip(struct in_addr ip); - -/*The following definitions come from ipc.c */ - -int get_printerdrivernumber(int snum); -int reply_trans(char *inbuf,char *outbuf, int size, int bufsize); - -/*The following definitions come from kanji.c */ - -void interpret_coding_system(char *str); -void initialize_multibyte_vectors( int client_codepage); - -/*The following definitions come from lib/rpc/client/cli_login.c */ - -BOOL cli_nt_setup_creds(struct cli_state *cli, unsigned char mach_pwd[16]); -BOOL cli_nt_srv_pwset(struct cli_state *cli, unsigned char *new_hashof_mach_pwd); -BOOL cli_nt_login_interactive(struct cli_state *cli, char *domain, char *username, - uint32 smb_userid_low, char *password, - NET_ID_INFO_CTR *ctr, NET_USER_INFO_3 *user_info3); -BOOL cli_nt_login_network(struct cli_state *cli, char *domain, char *username, - uint32 smb_userid_low, char lm_chal[8], char lm_chal_resp[24], - char nt_chal_resp[24], - NET_ID_INFO_CTR *ctr, NET_USER_INFO_3 *user_info3); -BOOL cli_nt_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr); - -/*The following definitions come from lib/rpc/client/cli_netlogon.c */ - -BOOL cli_net_logon_ctrl2(struct cli_state *cli, uint32 status_level); -BOOL cli_net_auth2(struct cli_state *cli, uint16 sec_chan, - uint32 neg_flags, DOM_CHAL *srv_chal); -BOOL cli_net_req_chal(struct cli_state *cli, DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal); -BOOL cli_net_srv_pwset(struct cli_state *cli, uint8 hashed_mach_pwd[16]); -BOOL cli_net_sam_logon(struct cli_state *cli, NET_ID_INFO_CTR *ctr, - NET_USER_INFO_3 *user_info3); -BOOL cli_net_sam_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr); - -/*The following definitions come from lib/rpc/client/cli_pipe.c */ - -uint32 get_rpc_call_id(void); -BOOL rpc_api_pipe(struct cli_state *cli, uint16 cmd, - prs_struct *param , prs_struct *data, - prs_struct *rparam, prs_struct *rdata); -BOOL rpc_api_pipe_req(struct cli_state *cli, uint8 op_num, - prs_struct *data, prs_struct *rdata); -BOOL rpc_pipe_set_hnd_state(struct cli_state *cli, char *pipe_name, uint16 device_state); -BOOL rpc_pipe_bind(struct cli_state *cli, char *pipe_name, - RPC_IFACE *abstract, RPC_IFACE *transfer, BOOL ntlmssp_auth); -BOOL cli_nt_session_open(struct cli_state *cli, char *pipe_name, BOOL encrypted); -void cli_nt_session_close(struct cli_state *cli); - -/*The following definitions come from lib/rpc/parse/parse_lsa.c */ - -void make_lsa_trans_name(LSA_TRANS_NAME *trn, uint32 sid_name_use, char *name, uint32 idx); -void lsa_io_trans_name(char *desc, LSA_TRANS_NAME *trn, prs_struct *ps, int depth); -void lsa_io_dom_r_ref(char *desc, DOM_R_REF *r_r, prs_struct *ps, int depth); -void make_lsa_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, uint32 sec_qos); -void lsa_io_obj_attr(char *desc, LSA_OBJ_ATTR *attr, prs_struct *ps, int depth); -void make_q_open_pol(LSA_Q_OPEN_POL *r_q, char *server_name, - uint32 attributes, uint32 sec_qos, - uint32 desired_access); -void lsa_io_q_open_pol(char *desc, LSA_Q_OPEN_POL *r_q, prs_struct *ps, int depth); -void lsa_io_r_open_pol(char *desc, LSA_R_OPEN_POL *r_p, prs_struct *ps, int depth); -void make_q_query(LSA_Q_QUERY_INFO *q_q, POLICY_HND *hnd, uint16 info_class); -void lsa_io_q_query(char *desc, LSA_Q_QUERY_INFO *q_q, prs_struct *ps, int depth); -void lsa_io_q_enum_trust_dom(char *desc, LSA_Q_ENUM_TRUST_DOM *q_e, prs_struct *ps, int depth); -void make_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM *r_e, - uint32 enum_context, char *domain_name, char *domain_sid, - uint32 status); -void lsa_io_r_enum_trust_dom(char *desc, LSA_R_ENUM_TRUST_DOM *r_e, prs_struct *ps, int depth); -void make_lsa_q_close(LSA_Q_CLOSE *q_c, POLICY_HND *hnd); -void lsa_io_q_close(char *desc, LSA_Q_CLOSE *q_c, prs_struct *ps, int depth); -void make_lsa_r_close(LSA_R_CLOSE *q_r, POLICY_HND *hnd); -void lsa_io_r_close(char *desc, LSA_R_CLOSE *r_c, prs_struct *ps, int depth); -void lsa_io_r_query(char *desc, LSA_R_QUERY_INFO *r_q, prs_struct *ps, int depth); -void lsa_io_sid_enum(char *desc, LSA_SID_ENUM *sen, prs_struct *ps, int depth); -void lsa_io_q_lookup_sids(char *desc, LSA_Q_LOOKUP_SIDS *q_s, prs_struct *ps, int depth); -void lsa_io_trans_names(char *desc, LSA_TRANS_NAME_ENUM *trn, prs_struct *ps, int depth); -void lsa_io_r_lookup_sids(char *desc, LSA_R_LOOKUP_SIDS *r_s, prs_struct *ps, int depth); -void lsa_io_q_lookup_rids(char *desc, LSA_Q_LOOKUP_RIDS *q_r, prs_struct *ps, int depth); -void lsa_io_r_lookup_rids(char *desc, LSA_R_LOOKUP_RIDS *r_r, prs_struct *ps, int depth); - -/*The following definitions come from lib/rpc/parse/parse_misc.c */ - -void smb_io_utime(char *desc, UTIME *t, prs_struct *ps, int depth); -void smb_io_time(char *desc, NTTIME *nttime, prs_struct *ps, int depth); -void smb_io_lookup_level(char *desc, LOOKUP_LEVEL *level, prs_struct *ps, int depth); -uint32 get_enum_hnd(ENUM_HND *enh); -void make_enum_hnd(ENUM_HND *enh, uint32 hnd); -void smb_io_enum_hnd(char *desc, ENUM_HND *hnd, prs_struct *ps, int depth); -void make_dom_sid(DOM_SID *sid, char *str_sid); -void smb_io_dom_sid(char *desc, DOM_SID *sid, prs_struct *ps, int depth); -void make_dom_sid2(DOM_SID2 *sid, char *str_sid); -void smb_io_dom_sid2(char *desc, DOM_SID2 *sid, prs_struct *ps, int depth); -void make_str_hdr(STRHDR *hdr, int max_len, int len, uint32 buffer); -void smb_io_strhdr(char *desc, STRHDR *hdr, prs_struct *ps, int depth); -void make_uni_hdr(UNIHDR *hdr, int max_len, int len, uint32 buffer); -void smb_io_unihdr(char *desc, UNIHDR *hdr, prs_struct *ps, int depth); -void make_uni_hdr2(UNIHDR2 *hdr, int max_len, int len, uint16 terminate); -void smb_io_unihdr2(char *desc, UNIHDR2 *hdr2, prs_struct *ps, int depth); -void make_unistr(UNISTR *str, char *buf); -void smb_io_unistr(char *desc, UNISTR *uni, prs_struct *ps, int depth); -void make_uninotstr2(UNINOTSTR2 *str, char *buf, int len); -void smb_io_uninotstr2(char *desc, UNINOTSTR2 *uni2, uint32 buffer, prs_struct *ps, int depth); -void make_buf_unistr2(UNISTR2 *str, uint32 *ptr, char *buf); -void copy_unistr2(UNISTR2 *str, UNISTR2 *from); -void make_string2(STRING2 *str, char *buf, int len); -void smb_io_string2(char *desc, STRING2 *str2, uint32 buffer, prs_struct *ps, int depth); -void make_unistr2(UNISTR2 *str, char *buf, int len); -void smb_io_unistr2(char *desc, UNISTR2 *uni2, uint32 buffer, prs_struct *ps, int depth); -void make_dom_rid2(DOM_RID2 *rid2, uint32 rid); -void smb_io_dom_rid2(char *desc, DOM_RID2 *rid2, prs_struct *ps, int depth); -void make_dom_rid3(DOM_RID3 *rid3, uint32 rid); -void smb_io_dom_rid3(char *desc, DOM_RID3 *rid3, prs_struct *ps, int depth); -void make_dom_rid4(DOM_RID4 *rid4, uint16 unknown, uint16 attr, uint32 rid); -void smb_io_dom_rid4(char *desc, DOM_RID4 *rid4, prs_struct *ps, int depth); -void make_clnt_srv(DOM_CLNT_SRV *log, char *logon_srv, char *comp_name); -void smb_io_clnt_srv(char *desc, DOM_CLNT_SRV *log, prs_struct *ps, int depth); -void make_log_info(DOM_LOG_INFO *log, char *logon_srv, char *acct_name, - uint16 sec_chan, char *comp_name); -void smb_io_log_info(char *desc, DOM_LOG_INFO *log, prs_struct *ps, int depth); -void smb_io_chal(char *desc, DOM_CHAL *chal, prs_struct *ps, int depth); -void smb_io_cred(char *desc, DOM_CRED *cred, prs_struct *ps, int depth); -void make_clnt_info2(DOM_CLNT_INFO2 *clnt, - char *logon_srv, char *comp_name, - DOM_CRED *clnt_cred); -void smb_io_clnt_info2(char *desc, DOM_CLNT_INFO2 *clnt, prs_struct *ps, int depth); -void make_clnt_info(DOM_CLNT_INFO *clnt, - char *logon_srv, char *acct_name, - uint16 sec_chan, char *comp_name, - DOM_CRED *cred); -void smb_io_clnt_info(char *desc, DOM_CLNT_INFO *clnt, prs_struct *ps, int depth); -void make_logon_id(DOM_LOGON_ID *log, uint32 log_id_low, uint32 log_id_high); -void smb_io_logon_id(char *desc, DOM_LOGON_ID *log, prs_struct *ps, int depth); -void make_owf_info(OWF_INFO *hash, uint8 data[16]); -void smb_io_owf_info(char *desc, OWF_INFO *hash, prs_struct *ps, int depth); -void smb_io_gid(char *desc, DOM_GID *gid, prs_struct *ps, int depth); -void smb_io_pol_hnd(char *desc, POLICY_HND *pol, prs_struct *ps, int depth); -void smb_io_dom_query_3(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth); -void smb_io_dom_query_5(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth); -void smb_io_dom_query(char *desc, DOM_QUERY *d_q, prs_struct *ps, int depth); -void smb_io_dom_name(char *desc, DOM_NAME *name, prs_struct *ps, int depth); - -/*The following definitions come from lib/rpc/parse/parse_net.c */ - -void net_io_neg_flags(char *desc, NEG_FLAGS *neg, prs_struct *ps, int depth); -void make_netinfo_3(NETLOGON_INFO_3 *info, uint32 flags, uint32 logon_attempts); -void net_io_netinfo_3(char *desc, NETLOGON_INFO_3 *info, prs_struct *ps, int depth); -void make_netinfo_1(NETLOGON_INFO_1 *info, uint32 flags, uint32 pdc_status); -void net_io_netinfo_1(char *desc, NETLOGON_INFO_1 *info, prs_struct *ps, int depth); -void make_netinfo_2(NETLOGON_INFO_2 *info, uint32 flags, uint32 pdc_status, - uint32 tc_status, char *trusted_dc_name); -void net_io_netinfo_2(char *desc, NETLOGON_INFO_2 *info, prs_struct *ps, int depth); -void make_q_logon_ctrl2(NET_Q_LOGON_CTRL2 *q_l, char *server_name, - uint32 function_code); -void net_io_q_logon_ctrl2(char *desc, NET_Q_LOGON_CTRL2 *q_l, prs_struct *ps, int depth); -void make_r_logon_ctrl2(NET_R_LOGON_CTRL2 *r_l, uint32 query_level, - uint32 flags, uint32 pdc_status, uint32 logon_attempts, - uint32 tc_status, char *trusted_domain_name); -void net_io_r_logon_ctrl2(char *desc, NET_R_LOGON_CTRL2 *r_l, prs_struct *ps, int depth); -void make_r_trust_dom(NET_R_TRUST_DOM_LIST *r_t, - uint32 num_doms, char *dom_name); -void net_io_r_trust_dom(char *desc, NET_R_TRUST_DOM_LIST *r_t, prs_struct *ps, int depth); -void make_q_trust_dom(NET_Q_TRUST_DOM_LIST *q_l, char *server_name, - uint32 function_code); -void net_io_q_trust_dom(char *desc, NET_Q_TRUST_DOM_LIST *q_l, prs_struct *ps, int depth); -void make_q_req_chal(NET_Q_REQ_CHAL *q_c, - char *logon_srv, char *logon_clnt, - DOM_CHAL *clnt_chal); -void net_io_q_req_chal(char *desc, NET_Q_REQ_CHAL *q_c, prs_struct *ps, int depth); -void net_io_r_req_chal(char *desc, NET_R_REQ_CHAL *r_c, prs_struct *ps, int depth); -void make_q_auth_2(NET_Q_AUTH_2 *q_a, - char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name, - DOM_CHAL *clnt_chal, uint32 clnt_flgs); -void net_io_q_auth_2(char *desc, NET_Q_AUTH_2 *q_a, prs_struct *ps, int depth); -void net_io_r_auth_2(char *desc, NET_R_AUTH_2 *r_a, prs_struct *ps, int depth); -void make_q_srv_pwset(NET_Q_SRV_PWSET *q_s, char *logon_srv, char *acct_name, - uint16 sec_chan, char *comp_name, DOM_CRED *cred, char nt_cypher[16]); -void net_io_q_srv_pwset(char *desc, NET_Q_SRV_PWSET *q_s, prs_struct *ps, int depth); -void net_io_r_srv_pwset(char *desc, NET_R_SRV_PWSET *r_s, prs_struct *ps, int depth); -void make_id_info1(NET_ID_INFO_1 *id, char *domain_name, - uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high, - char *user_name, char *wksta_name, - char sess_key[16], - unsigned char lm_cypher[16], unsigned char nt_cypher[16]); -void net_io_id_info1(char *desc, NET_ID_INFO_1 *id, prs_struct *ps, int depth); -void make_id_info2(NET_ID_INFO_2 *id, char *domain_name, - uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high, - char *user_name, char *wksta_name, - unsigned char lm_challenge[8], - unsigned char lm_chal_resp[24], - unsigned char nt_chal_resp[24]); -void net_io_id_info2(char *desc, NET_ID_INFO_2 *id, prs_struct *ps, int depth); -void make_sam_info(DOM_SAM_INFO *sam, - char *logon_srv, char *comp_name, DOM_CRED *clnt_cred, - DOM_CRED *rtn_cred, uint16 logon_level, - NET_ID_INFO_CTR *ctr, uint16 validation_level); -void net_io_id_info_ctr(char *desc, NET_ID_INFO_CTR *ctr, prs_struct *ps, int depth); -void smb_io_sam_info(char *desc, DOM_SAM_INFO *sam, prs_struct *ps, int depth); -void make_net_user_info3(NET_USER_INFO_3 *usr, - - NTTIME *logon_time, - NTTIME *logoff_time, - NTTIME *kickoff_time, - NTTIME *pass_last_set_time, - NTTIME *pass_can_change_time, - NTTIME *pass_must_change_time, - - char *user_name, - char *full_name, - char *logon_script, - char *profile_path, - char *home_dir, - char *dir_drive, - - uint16 logon_count, - uint16 bad_pw_count, - - uint32 user_id, - uint32 group_id, - uint32 num_groups, - DOM_GID *gids, - uint32 user_flgs, - - char sess_key[16], - - char *logon_srv, - char *logon_dom, - - char *dom_sid, - char *other_sids); -void net_io_user_info3(char *desc, NET_USER_INFO_3 *usr, prs_struct *ps, int depth); -void net_io_q_sam_logon(char *desc, NET_Q_SAM_LOGON *q_l, prs_struct *ps, int depth); -void net_io_r_sam_logon(char *desc, NET_R_SAM_LOGON *r_l, prs_struct *ps, int depth); -void net_io_q_sam_logoff(char *desc, NET_Q_SAM_LOGOFF *q_l, prs_struct *ps, int depth); -void net_io_r_sam_logoff(char *desc, NET_R_SAM_LOGOFF *r_l, prs_struct *ps, int depth); - -/*The following definitions come from lib/rpc/parse/parse_prs.c */ - -void prs_debug(prs_struct *ps, int depth, char *desc, char *fn_name); -void prs_init(prs_struct *ps, uint32 size, - uint8 align, uint32 margin, - BOOL io); -void prs_mem_free(prs_struct *ps); -void prs_align(prs_struct *ps); -BOOL prs_grow(prs_struct *ps); -BOOL prs_uint8(char *name, prs_struct *ps, int depth, uint8 *data8); -BOOL prs_uint16(char *name, prs_struct *ps, int depth, uint16 *data16); -BOOL prs_uint32(char *name, prs_struct *ps, int depth, uint32 *data32); -BOOL prs_uint8s(BOOL charmode, char *name, prs_struct *ps, int depth, uint8 *data8s, int len); -BOOL prs_uint16s(BOOL charmode, char *name, prs_struct *ps, int depth, uint16 *data16s, int len); -BOOL prs_uint32s(BOOL charmode, char *name, prs_struct *ps, int depth, uint32 *data32s, int len); -BOOL prs_uninotstr2(BOOL charmode, char *name, prs_struct *ps, int depth, UNINOTSTR2 *str); -BOOL prs_string2(BOOL charmode, char *name, prs_struct *ps, int depth, STRING2 *str); -BOOL prs_unistr2(BOOL charmode, char *name, prs_struct *ps, int depth, UNISTR2 *str); -BOOL prs_unistr(char *name, prs_struct *ps, int depth, UNISTR *str); -BOOL prs_string(char *name, prs_struct *ps, int depth, char *str, uint16 len); - -/*The following definitions come from lib/rpc/parse/parse_reg.c */ - -void make_reg_q_open_policy(REG_Q_OPEN_POLICY *r_q, - uint16 unknown_0, uint32 level, uint16 unknown_1); -void reg_io_q_open_policy(char *desc, REG_Q_OPEN_POLICY *r_q, prs_struct *ps, int depth); -void make_reg_r_open_policy(REG_R_OPEN_POLICY *r_r, - POLICY_HND *pol, uint32 status); -void reg_io_r_open_policy(char *desc, REG_R_OPEN_POLICY *r_r, prs_struct *ps, int depth); -void reg_io_q_close(char *desc, REG_Q_CLOSE *q_u, prs_struct *ps, int depth); -void reg_io_r_close(char *desc, REG_R_CLOSE *r_u, prs_struct *ps, int depth); -void make_reg_q_info(REG_Q_INFO *r_q, - POLICY_HND *pol, char *product_type, - NTTIME *prod_time, uint8 major_version, uint8 minor_version, - uint32 unknown); -void reg_io_q_info(char *desc, REG_Q_INFO *r_q, prs_struct *ps, int depth); -void make_reg_r_info(REG_R_INFO *r_r, - uint32 level, char *os_type, - uint32 unknown_0, uint32 unknown_1, - uint32 status); -void reg_io_r_info(char *desc, REG_R_INFO *r_r, prs_struct *ps, int depth); -void make_reg_q_open_entry(REG_Q_OPEN_ENTRY *r_q, - POLICY_HND *pol, char *name, - uint32 unknown_0, uint32 unknown_1, uint16 unknown_2); -void reg_io_q_open_entry(char *desc, REG_Q_OPEN_ENTRY *r_q, prs_struct *ps, int depth); -void make_reg_r_open_entry(REG_R_OPEN_ENTRY *r_r, - POLICY_HND *pol, uint32 status); -void reg_io_r_open_entry(char *desc, REG_R_OPEN_ENTRY *r_r, prs_struct *ps, int depth); - -/*The following definitions come from lib/rpc/parse/parse_rpc.c */ - -void make_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 flags, - uint32 call_id, int data_len, int auth_len); -void smb_io_rpc_hdr(char *desc, RPC_HDR *rpc, prs_struct *ps, int depth); -void make_rpc_iface(RPC_IFACE *ifc, char data[16], uint32 version); -void smb_io_rpc_iface(char *desc, RPC_IFACE *ifc, prs_struct *ps, int depth); -void make_rpc_addr_str(RPC_ADDR_STR *str, char *name); -void smb_io_rpc_addr_str(char *desc, RPC_ADDR_STR *str, prs_struct *ps, int depth); -void make_rpc_hdr_bba(RPC_HDR_BBA *bba, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid); -void smb_io_rpc_hdr_bba(char *desc, RPC_HDR_BBA *rpc, prs_struct *ps, int depth); -void make_rpc_hdr_rb(RPC_HDR_RB *rpc, - uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, - uint32 num_elements, uint16 context_id, uint8 num_syntaxes, - RPC_IFACE *abstract, RPC_IFACE *transfer); -void smb_io_rpc_hdr_rb(char *desc, RPC_HDR_RB *rpc, prs_struct *ps, int depth); -void make_rpc_results(RPC_RESULTS *res, - uint8 num_results, uint16 result, uint16 reason); -void smb_io_rpc_results(char *desc, RPC_RESULTS *res, prs_struct *ps, int depth); -void make_rpc_hdr_ba(RPC_HDR_BA *rpc, - uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, - char *pipe_addr, - uint8 num_results, uint16 result, uint16 reason, - RPC_IFACE *transfer); -void smb_io_rpc_hdr_ba(char *desc, RPC_HDR_BA *rpc, prs_struct *ps, int depth); -void make_rpc_hdr_req(RPC_HDR_REQ *hdr, uint32 data_len, uint16 opnum); -void smb_io_rpc_hdr_req(char *desc, RPC_HDR_REQ *rpc, prs_struct *ps, int depth); -void make_rpc_hdr_resp(RPC_HDR_RESP *hdr, uint32 data_len); -void smb_io_rpc_hdr_resp(char *desc, RPC_HDR_RESP *rpc, prs_struct *ps, int depth); -void make_rpc_auth_ntlmssp_req(RPC_AUTH_NTLMSSP_REQ *req, - fstring ntlmssp_str, uint32 ntlmssp_ver, - uint32 unknown_0, fstring myname, fstring domain); -void smb_io_rpc_auth_ntlmssp_req(char *desc, RPC_AUTH_NTLMSSP_REQ *req, prs_struct *ps, int depth); -void make_rpc_auth_ntlmssp_resp(RPC_AUTH_NTLMSSP_RESP *rsp, - uint8 auth_type, uint8 auth_level, uint8 stub_type_len, - fstring ntlmssp_str, uint32 ntlmssp_ver, - uint32 unknown_1, uint32 unknown_2, uint32 unknown_3, - uint8 data[16]); -void smb_io_rpc_auth_ntlmssp_resp(char *desc, RPC_AUTH_NTLMSSP_RESP *rsp, prs_struct *ps, int depth); - -/*The following definitions come from lib/rpc/parse/parse_samr.c */ - -void make_samr_q_close_hnd(SAMR_Q_CLOSE_HND *q_c, POLICY_HND *hnd); -void samr_io_q_close_hnd(char *desc, SAMR_Q_CLOSE_HND *q_u, prs_struct *ps, int depth); -void samr_io_r_close_hnd(char *desc, SAMR_R_CLOSE_HND *r_u, prs_struct *ps, int depth); -void make_samr_q_open_domain(SAMR_Q_OPEN_DOMAIN *q_u, - POLICY_HND *connect_pol, uint32 rid, char *sid); -void samr_io_q_open_domain(char *desc, SAMR_Q_OPEN_DOMAIN *q_u, prs_struct *ps, int depth); -void samr_io_r_open_domain(char *desc, SAMR_R_OPEN_DOMAIN *r_u, prs_struct *ps, int depth); -void make_samr_q_unknown_8(SAMR_Q_UNKNOWN_8 *q_u, - POLICY_HND *domain_pol, uint16 switch_value); -void samr_io_q_unknown_8(char *desc, SAMR_Q_UNKNOWN_8 *q_u, prs_struct *ps, int depth); -void make_samr_q_unknown_3(SAMR_Q_UNKNOWN_3 *q_u, - POLICY_HND *user_pol, uint16 switch_value); -void samr_io_q_unknown_3(char *desc, SAMR_Q_UNKNOWN_3 *q_u, prs_struct *ps, int depth); -void make_dom_sid3(DOM_SID3 *sid3, uint16 unk_0, uint16 unk_1, char *sid); -void sam_io_dom_sid3(char *desc, DOM_SID3 *sid3, prs_struct *ps, int depth); -void make_sam_sid_stuff(SAM_SID_STUFF *stf, - uint16 unknown_2, uint16 unknown_3, - uint32 unknown_4, uint16 unknown_6, uint16 unknown_7, - int num_sid3s, DOM_SID3 sid3[MAX_SAM_SIDS]); -void sam_io_sid_stuff(char *desc, SAM_SID_STUFF *stf, prs_struct *ps, int depth); -void make_samr_r_unknown_3(SAMR_R_UNKNOWN_3 *r_u, - uint16 unknown_2, uint16 unknown_3, - uint32 unknown_4, uint16 unknown_6, uint16 unknown_7, - int num_sid3s, DOM_SID3 sid3[MAX_SAM_SIDS], - uint32 status); -void samr_io_r_unknown_3(char *desc, SAMR_R_UNKNOWN_3 *r_u, prs_struct *ps, int depth); -void make_sam_str1(SAM_STR1 *sam, char *sam_acct, char *sam_name, char *sam_desc); -void sam_io_sam_str1(char *desc, SAM_STR1 *sam, uint32 acct_buf, uint32 name_buf, uint32 desc_buf, prs_struct *ps, int depth); -void make_sam_entry1(SAM_ENTRY1 *sam, uint32 user_idx, - uint32 len_sam_name, uint32 len_sam_full, uint32 len_sam_desc, - uint32 rid_user, uint16 acb_info); -void sam_io_sam_entry1(char *desc, SAM_ENTRY1 *sam, prs_struct *ps, int depth); -void make_sam_str2(SAM_STR2 *sam, char *sam_acct, char *sam_desc); -void sam_io_sam_str2(char *desc, SAM_STR2 *sam, uint32 acct_buf, uint32 desc_buf, prs_struct *ps, int depth); -void make_sam_entry2(SAM_ENTRY2 *sam, uint32 user_idx, - uint32 len_sam_name, uint32 len_sam_desc, - uint32 rid_user, uint16 acb_info); -void sam_io_sam_entry2(char *desc, SAM_ENTRY2 *sam, prs_struct *ps, int depth); -void make_sam_str3(SAM_STR3 *sam, char *grp_acct, char *grp_desc); -void sam_io_sam_str3(char *desc, SAM_STR3 *sam, uint32 acct_buf, uint32 desc_buf, prs_struct *ps, int depth); -void make_sam_entry3(SAM_ENTRY3 *sam, uint32 grp_idx, - uint32 len_grp_name, uint32 len_grp_desc, uint32 rid_grp); -void sam_io_sam_entry3(char *desc, SAM_ENTRY3 *sam, prs_struct *ps, int depth); -void make_sam_entry(SAM_ENTRY *sam, uint32 len_sam_name, uint32 rid); -void sam_io_sam_entry(char *desc, SAM_ENTRY *sam, prs_struct *ps, int depth); -void make_samr_q_enum_dom_users(SAMR_Q_ENUM_DOM_USERS *q_e, POLICY_HND *pol, - uint16 req_num_entries, uint16 unk_0, - uint16 acb_mask, uint16 unk_1, uint32 size); -void samr_io_q_enum_dom_users(char *desc, SAMR_Q_ENUM_DOM_USERS *q_e, prs_struct *ps, int depth); -void make_samr_r_enum_dom_users(SAMR_R_ENUM_DOM_USERS *r_u, - uint16 total_num_entries, uint16 unk_0, - uint32 num_sam_entries, SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES], uint32 status); -void samr_io_r_enum_dom_users(char *desc, SAMR_R_ENUM_DOM_USERS *r_u, prs_struct *ps, int depth); -void make_samr_q_enum_dom_aliases(SAMR_Q_ENUM_DOM_ALIASES *q_e, POLICY_HND *pol, uint32 size); -void samr_io_q_enum_dom_aliases(char *desc, SAMR_Q_ENUM_DOM_ALIASES *q_e, prs_struct *ps, int depth); -void make_samr_r_enum_dom_aliases(SAMR_R_ENUM_DOM_ALIASES *r_u, - uint32 num_sam_entries, SAM_USER_INFO_21 grps[MAX_SAM_ENTRIES], - uint32 status); -void samr_io_r_enum_dom_aliases(char *desc, SAMR_R_ENUM_DOM_ALIASES *r_u, prs_struct *ps, int depth); -void make_samr_q_query_dispinfo(SAMR_Q_QUERY_DISPINFO *q_e, POLICY_HND *pol, - uint16 switch_level, uint32 start_idx, uint32 size); -void samr_io_q_query_dispinfo(char *desc, SAMR_Q_QUERY_DISPINFO *q_e, prs_struct *ps, int depth); -void make_sam_info_2(SAM_INFO_2 *sam, uint32 acb_mask, - uint32 start_idx, uint32 num_sam_entries, - SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]); -void sam_io_sam_info_2(char *desc, SAM_INFO_2 *sam, prs_struct *ps, int depth); -void make_sam_info_1(SAM_INFO_1 *sam, uint32 acb_mask, - uint32 start_idx, uint32 num_sam_entries, - SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]); -void sam_io_sam_info_1(char *desc, SAM_INFO_1 *sam, prs_struct *ps, int depth); -void make_samr_r_query_dispinfo(SAMR_R_QUERY_DISPINFO *r_u, - uint16 switch_level, SAM_INFO_CTR *ctr, uint32 status); -void samr_io_r_query_dispinfo(char *desc, SAMR_R_QUERY_DISPINFO *r_u, prs_struct *ps, int depth); -void make_samr_q_enum_dom_groups(SAMR_Q_ENUM_DOM_GROUPS *q_e, POLICY_HND *pol, - uint16 switch_level, uint32 start_idx, uint32 size); -void samr_io_q_enum_dom_groups(char *desc, SAMR_Q_ENUM_DOM_GROUPS *q_e, prs_struct *ps, int depth); -void make_samr_r_enum_dom_groups(SAMR_R_ENUM_DOM_GROUPS *r_u, - uint32 start_idx, uint32 num_sam_entries, - SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES], - uint32 status); -void samr_io_r_enum_dom_groups(char *desc, SAMR_R_ENUM_DOM_GROUPS *r_u, prs_struct *ps, int depth); -void make_samr_q_query_aliasinfo(SAMR_Q_QUERY_ALIASINFO *q_e, - POLICY_HND *pol, - uint16 switch_level); -void samr_io_q_query_aliasinfo(char *desc, SAMR_Q_QUERY_ALIASINFO *q_e, prs_struct *ps, int depth); -void make_samr_r_query_aliasinfo(SAMR_R_QUERY_ALIASINFO *r_u, - uint16 switch_value, char *acct_desc, - uint32 status); -void samr_io_r_query_aliasinfo(char *desc, SAMR_R_QUERY_ALIASINFO *r_u, prs_struct *ps, int depth); -void samr_io_q_lookup_ids(char *desc, SAMR_Q_LOOKUP_IDS *q_u, prs_struct *ps, int depth); -void make_samr_r_lookup_ids(SAMR_R_LOOKUP_IDS *r_u, - uint32 num_rids, uint32 *rid, uint32 status); -void samr_io_r_lookup_ids(char *desc, SAMR_R_LOOKUP_IDS *r_u, prs_struct *ps, int depth); -void samr_io_q_lookup_names(char *desc, SAMR_Q_LOOKUP_NAMES *q_u, prs_struct *ps, int depth); -void make_samr_r_lookup_names(SAMR_R_LOOKUP_NAMES *r_u, - uint32 num_rids, uint32 *rid, uint32 status); -void samr_io_r_lookup_names(char *desc, SAMR_R_LOOKUP_NAMES *r_u, prs_struct *ps, int depth); -void make_samr_q_unknown_12(SAMR_Q_UNKNOWN_12 *q_u, - POLICY_HND *pol, uint32 rid, - uint32 num_gids, uint32 *gid); -void samr_io_q_unknown_12(char *desc, SAMR_Q_UNKNOWN_12 *q_u, prs_struct *ps, int depth); -void make_samr_r_unknown_12(SAMR_R_UNKNOWN_12 *r_u, - uint32 num_aliases, fstring *als_name, uint32 *num_als_usrs, - uint32 status); -void samr_io_r_unknown_12(char *desc, SAMR_R_UNKNOWN_12 *r_u, prs_struct *ps, int depth); -void make_samr_q_open_user(SAMR_Q_OPEN_USER *q_u, - POLICY_HND *pol, - uint32 unk_0, uint32 rid); -void samr_io_q_open_user(char *desc, SAMR_Q_OPEN_USER *q_u, prs_struct *ps, int depth); -void samr_io_r_open_user(char *desc, SAMR_R_OPEN_USER *r_u, prs_struct *ps, int depth); -void make_samr_q_query_usergroups(SAMR_Q_QUERY_USERGROUPS *q_u, - POLICY_HND *hnd); -void samr_io_q_query_usergroups(char *desc, SAMR_Q_QUERY_USERGROUPS *q_u, prs_struct *ps, int depth); -void make_samr_r_query_usergroups(SAMR_R_QUERY_USERGROUPS *r_u, - uint32 num_gids, DOM_GID *gid, uint32 status); -void samr_io_r_query_usergroups(char *desc, SAMR_R_QUERY_USERGROUPS *r_u, prs_struct *ps, int depth); -void make_samr_q_query_userinfo(SAMR_Q_QUERY_USERINFO *q_u, - POLICY_HND *hnd, uint16 switch_value); -void samr_io_q_query_userinfo(char *desc, SAMR_Q_QUERY_USERINFO *q_u, prs_struct *ps, int depth); -void sam_io_logon_hrs(char *desc, LOGON_HRS *hrs, prs_struct *ps, int depth); -void make_sam_user_info11(SAM_USER_INFO_11 *usr, - NTTIME *expiry, - char *mach_acct, - uint32 rid_user, - uint32 rid_group, - uint16 acct_ctrl); -void sam_io_user_info11(char *desc, SAM_USER_INFO_11 *usr, prs_struct *ps, int depth); -void make_sam_user_info21(SAM_USER_INFO_21 *usr, - - NTTIME *logon_time, - NTTIME *logoff_time, - NTTIME *kickoff_time, - NTTIME *pass_last_set_time, - NTTIME *pass_can_change_time, - NTTIME *pass_must_change_time, - - char *user_name, - char *full_name, - char *home_dir, - char *dir_drive, - char *logon_script, - char *profile_path, - char *description, - char *workstations, - char *unknown_str, - char *munged_dial, - - uint32 user_rid, - uint32 group_rid, - uint16 acb_info, - - uint32 unknown_3, - uint16 logon_divs, - LOGON_HRS *hrs, - uint32 unknown_5, - uint32 unknown_6); -void sam_io_user_info21(char *desc, SAM_USER_INFO_21 *usr, prs_struct *ps, int depth); -void make_samr_r_query_userinfo(SAMR_R_QUERY_USERINFO *r_u, - uint16 switch_value, void *info, uint32 status); -void samr_io_r_query_userinfo(char *desc, SAMR_R_QUERY_USERINFO *r_u, prs_struct *ps, int depth); -void make_samr_q_unknown_21(SAMR_Q_UNKNOWN_21 *q_c, - POLICY_HND *hnd, uint16 unk_1, uint16 unk_2); -void samr_io_q_unknown_21(char *desc, SAMR_Q_UNKNOWN_21 *q_u, prs_struct *ps, int depth); -void make_samr_q_unknown_13(SAMR_Q_UNKNOWN_13 *q_c, - POLICY_HND *hnd, uint16 unk_1, uint16 unk_2); -void samr_io_q_unknown_13(char *desc, SAMR_Q_UNKNOWN_13 *q_u, prs_struct *ps, int depth); -void samr_io_q_unknown_32(char *desc, SAMR_Q_UNKNOWN_32 *q_u, prs_struct *ps, int depth); -void samr_io_r_unknown_32(char *desc, SAMR_R_UNKNOWN_32 *r_u, prs_struct *ps, int depth); -void make_samr_q_connect(SAMR_Q_CONNECT *q_u, - char *srv_name, uint32 unknown_0); -void samr_io_q_connect(char *desc, SAMR_Q_CONNECT *q_u, prs_struct *ps, int depth); -void samr_io_r_connect(char *desc, SAMR_R_CONNECT *r_u, prs_struct *ps, int depth); -void make_samr_q_open_alias(SAMR_Q_OPEN_ALIAS *q_u, - uint32 unknown_0, uint32 rid); -void samr_io_q_open_alias(char *desc, SAMR_Q_OPEN_ALIAS *q_u, prs_struct *ps, int depth); -void samr_io_r_open_alias(char *desc, SAMR_R_OPEN_ALIAS *r_u, prs_struct *ps, int depth); -void make_samr_q_unknown_38(SAMR_Q_UNKNOWN_38 *q_u, char *srv_name); -void samr_io_q_unknown_38(char *desc, SAMR_Q_UNKNOWN_38 *q_u, prs_struct *ps, int depth); -void make_samr_r_unknown_38(SAMR_R_UNKNOWN_38 *r_u, - uint16 level, uint32 status); -void samr_io_r_unknown_38(char *desc, SAMR_R_UNKNOWN_38 *r_u, prs_struct *ps, int depth); -void samr_io_enc_passwd(char *desc, SAMR_ENC_PASSWD *pwd, prs_struct *ps, int depth); -void samr_io_enc_hash(char *desc, SAMR_ENC_HASH *hsh, prs_struct *ps, int depth); - -/*The following definitions come from lib/rpc/parse/parse_srv.c */ - -void make_srv_share_info1_str(SH_INFO_1_STR *sh1, char *net_name, char *remark); -void srv_io_share_info1_str(char *desc, SH_INFO_1_STR *sh1, prs_struct *ps, int depth); -void make_srv_share_info1(SH_INFO_1 *sh1, char *net_name, uint32 type, char *remark); -void srv_io_share_info1(char *desc, SH_INFO_1 *sh1, prs_struct *ps, int depth); -void srv_io_srv_share_info_1(char *desc, SRV_SHARE_INFO_1 *ctr, prs_struct *ps, int depth); -void make_srv_share_info2_str(SH_INFO_2_STR *sh2, - char *net_name, char *remark, - char *path, char *passwd); -void srv_io_share_info2_str(char *desc, SH_INFO_2_STR *sh2, prs_struct *ps, int depth); -void make_srv_share_info2(SH_INFO_2 *sh2, - char *net_name, uint32 type, char *remark, - uint32 perms, uint32 max_uses, uint32 num_uses, - char *path, char *passwd); -void srv_io_share_info2(char *desc, SH_INFO_2 *sh2, prs_struct *ps, int depth); -void srv_io_srv_share_info_2(char *desc, SRV_SHARE_INFO_2 *ctr, prs_struct *ps, int depth); -void srv_io_srv_share_ctr(char *desc, SRV_SHARE_INFO_CTR *ctr, prs_struct *ps, int depth); -void make_srv_q_net_share_enum(SRV_Q_NET_SHARE_ENUM *q_n, - char *srv_name, - uint32 share_level, SRV_SHARE_INFO_CTR *ctr, - uint32 preferred_len, - ENUM_HND *hnd); -void srv_io_q_net_share_enum(char *desc, SRV_Q_NET_SHARE_ENUM *q_n, prs_struct *ps, int depth); -void srv_io_r_net_share_enum(char *desc, SRV_R_NET_SHARE_ENUM *r_n, prs_struct *ps, int depth); -void make_srv_sess_info0_str(SESS_INFO_0_STR *ss0, char *name); -void srv_io_sess_info0_str(char *desc, SESS_INFO_0_STR *ss0, prs_struct *ps, int depth); -void make_srv_sess_info0(SESS_INFO_0 *ss0, char *name); -void srv_io_sess_info0(char *desc, SESS_INFO_0 *ss0, prs_struct *ps, int depth); -void srv_io_srv_sess_info_0(char *desc, SRV_SESS_INFO_0 *ss0, prs_struct *ps, int depth); -void make_srv_sess_info1_str(SESS_INFO_1_STR *ss1, char *name, char *user); -void srv_io_sess_info1_str(char *desc, SESS_INFO_1_STR *ss1, prs_struct *ps, int depth); -void make_srv_sess_info1(SESS_INFO_1 *ss1, - char *name, char *user, - uint32 num_opens, uint32 open_time, uint32 idle_time, - uint32 user_flags); -void srv_io_sess_info1(char *desc, SESS_INFO_1 *ss1, prs_struct *ps, int depth); -void srv_io_srv_sess_info_1(char *desc, SRV_SESS_INFO_1 *ss1, prs_struct *ps, int depth); -void srv_io_srv_sess_ctr(char *desc, SRV_SESS_INFO_CTR *ctr, prs_struct *ps, int depth); -void make_srv_q_net_sess_enum(SRV_Q_NET_SESS_ENUM *q_n, - char *srv_name, char *qual_name, - uint32 sess_level, SRV_SESS_INFO_CTR *ctr, - uint32 preferred_len, - ENUM_HND *hnd); -void srv_io_q_net_sess_enum(char *desc, SRV_Q_NET_SESS_ENUM *q_n, prs_struct *ps, int depth); -void srv_io_r_net_sess_enum(char *desc, SRV_R_NET_SESS_ENUM *r_n, prs_struct *ps, int depth); -void make_srv_conn_info0(CONN_INFO_0 *ss0, uint32 id); -void srv_io_conn_info0(char *desc, CONN_INFO_0 *ss0, prs_struct *ps, int depth); -void srv_io_srv_conn_info_0(char *desc, SRV_CONN_INFO_0 *ss0, prs_struct *ps, int depth); -void make_srv_conn_info1_str(CONN_INFO_1_STR *ss1, char *usr_name, char *net_name); -void srv_io_conn_info1_str(char *desc, CONN_INFO_1_STR *ss1, prs_struct *ps, int depth); -void make_srv_conn_info1(CONN_INFO_1 *ss1, - uint32 id, uint32 type, - uint32 num_opens, uint32 num_users, uint32 open_time, - char *usr_name, char *net_name); -void srv_io_conn_info1(char *desc, CONN_INFO_1 *ss1, prs_struct *ps, int depth); -void srv_io_srv_conn_info_1(char *desc, SRV_CONN_INFO_1 *ss1, prs_struct *ps, int depth); -void srv_io_srv_conn_ctr(char *desc, SRV_CONN_INFO_CTR *ctr, prs_struct *ps, int depth); -void make_srv_q_net_conn_enum(SRV_Q_NET_CONN_ENUM *q_n, - char *srv_name, char *qual_name, - uint32 conn_level, SRV_CONN_INFO_CTR *ctr, - uint32 preferred_len, - ENUM_HND *hnd); -void srv_io_q_net_conn_enum(char *desc, SRV_Q_NET_CONN_ENUM *q_n, prs_struct *ps, int depth); -void srv_io_r_net_conn_enum(char *desc, SRV_R_NET_CONN_ENUM *r_n, prs_struct *ps, int depth); -void make_srv_file_info3_str(FILE_INFO_3_STR *fi3, char *user_name, char *path_name); -void srv_io_file_info3_str(char *desc, FILE_INFO_3_STR *sh1, prs_struct *ps, int depth); -void make_srv_file_info3(FILE_INFO_3 *fl3, - uint32 id, uint32 perms, uint32 num_locks, - char *path_name, char *user_name); -void srv_io_file_info3(char *desc, FILE_INFO_3 *fl3, prs_struct *ps, int depth); -void srv_io_srv_file_info_3(char *desc, SRV_FILE_INFO_3 *fl3, prs_struct *ps, int depth); -void srv_io_srv_file_ctr(char *desc, SRV_FILE_INFO_CTR *ctr, prs_struct *ps, int depth); -void make_srv_q_net_file_enum(SRV_Q_NET_FILE_ENUM *q_n, - char *srv_name, char *qual_name, - uint32 file_level, SRV_FILE_INFO_CTR *ctr, - uint32 preferred_len, - ENUM_HND *hnd); -void srv_io_q_net_file_enum(char *desc, SRV_Q_NET_FILE_ENUM *q_n, prs_struct *ps, int depth); -void srv_io_r_net_file_enum(char *desc, SRV_R_NET_FILE_ENUM *r_n, prs_struct *ps, int depth); -void make_srv_info_101(SRV_INFO_101 *sv101, uint32 platform_id, char *name, - uint32 ver_major, uint32 ver_minor, - uint32 srv_type, char *comment); -void srv_io_info_101(char *desc, SRV_INFO_101 *sv101, prs_struct *ps, int depth); -void make_srv_info_102(SRV_INFO_102 *sv102, uint32 platform_id, char *name, - char *comment, uint32 ver_major, uint32 ver_minor, - uint32 srv_type, uint32 users, uint32 disc, uint32 hidden, - uint32 announce, uint32 ann_delta, uint32 licenses, - char *usr_path); -void srv_io_info_102(char *desc, SRV_INFO_102 *sv102, prs_struct *ps, int depth); -void srv_io_info_ctr(char *desc, SRV_INFO_CTR *ctr, prs_struct *ps, int depth); -void make_srv_q_net_srv_get_info(SRV_Q_NET_SRV_GET_INFO *srv, - char *server_name, uint32 switch_value); -void srv_io_q_net_srv_get_info(char *desc, SRV_Q_NET_SRV_GET_INFO *q_n, prs_struct *ps, int depth); -void make_srv_r_net_srv_get_info(SRV_R_NET_SRV_GET_INFO *srv, - uint32 switch_value, SRV_INFO_CTR *ctr, uint32 status); -void srv_io_r_net_srv_get_info(char *desc, SRV_R_NET_SRV_GET_INFO *r_n, prs_struct *ps, int depth); -void make_srv_q_net_srv_set_info(SRV_Q_NET_SRV_SET_INFO *srv, - uint32 switch_value, SRV_INFO_CTR *ctr); -void srv_io_q_net_srv_set_info(char *desc, SRV_Q_NET_SRV_SET_INFO *q_n, prs_struct *ps, int depth); -void make_srv_r_net_srv_set_info(SRV_R_NET_SRV_SET_INFO *srv, - uint32 switch_value, SRV_INFO_CTR *ctr, uint32 status); -void srv_io_r_net_srv_set_info(char *desc, SRV_R_NET_SRV_SET_INFO *r_n, prs_struct *ps, int depth); - -/*The following definitions come from lib/rpc/parse/parse_wks.c */ - -void make_wks_q_query_info(WKS_Q_QUERY_INFO *q_u, - char *server, uint16 switch_value) ; -void wks_io_q_query_info(char *desc, WKS_Q_QUERY_INFO *q_u, prs_struct *ps, int depth); -void make_wks_info_100(WKS_INFO_100 *inf, - uint32 platform_id, uint32 ver_major, uint32 ver_minor, - char *my_name, char *domain_name); -void wks_io_wks_info_100(char *desc, WKS_INFO_100 *inf, prs_struct *ps, int depth); -void make_wks_r_query_info(WKS_R_QUERY_INFO *r_u, - uint32 switch_value, WKS_INFO_100 *wks100, - int status) ; -void wks_io_r_query_info(char *desc, WKS_R_QUERY_INFO *r_u, prs_struct *ps, int depth); - -/*The following definitions come from lib/rpc/server/srv_ldap_helpers.c */ - -BOOL get_ldap_entries(SAM_USER_INFO_21 *pw_buf, - int *total_entries, int *num_entries, - int max_num_entries, - uint16 acb_mask, int switch_level); -BOOL ldap_get_user_info_21(SAM_USER_INFO_21 *id21, uint32 rid); -void ldap_helper_dummy(void); - -/*The following definitions come from lib/rpc/server/srv_lsa.c */ - -BOOL api_ntlsa_rpc(pipes_struct *p, prs_struct *data); - -/*The following definitions come from lib/rpc/server/srv_lsa_hnd.c */ - -void create_pol_hnd(POLICY_HND *hnd); -void init_lsa_policy_hnd(void); -BOOL open_lsa_policy_hnd(POLICY_HND *hnd); -int find_lsa_policy_by_hnd(POLICY_HND *hnd); -BOOL set_lsa_policy_samr_rid(POLICY_HND *hnd, uint32 rid); -BOOL set_lsa_policy_samr_pol_status(POLICY_HND *hnd, uint32 pol_status); -BOOL set_lsa_policy_samr_sid(POLICY_HND *hnd, DOM_SID *sid); -uint32 get_lsa_policy_samr_rid(POLICY_HND *hnd); -BOOL set_lsa_policy_reg_name(POLICY_HND *hnd, fstring name); -BOOL get_lsa_policy_reg_name(POLICY_HND *hnd, fstring name); -BOOL close_lsa_policy_hnd(POLICY_HND *hnd); - -/*The following definitions come from lib/rpc/server/srv_netlog.c */ - -BOOL api_netlog_rpc(pipes_struct *p, prs_struct *data); - -/*The following definitions come from lib/rpc/server/srv_pipe_hnd.c */ - -void reset_chain_pnum(void); -void set_chain_pnum(int new_pnum); -void init_rpc_pipe_hnd(void); -int open_rpc_pipe_hnd(char *pipe_name, int cnum, uint16 vuid); -int read_pipe(uint16 pnum, char *data, uint32 pos, int n); -BOOL get_rpc_pipe(int pnum, pipes_struct **p); -char *get_rpc_pipe_hnd_name(int pnum); -BOOL set_rpc_pipe_hnd_state(pipes_struct *p, uint16 device_state); -BOOL close_rpc_pipe_hnd(int pnum, int cnum); -int get_rpc_pipe_num(char *buf, int where); - -/*The following definitions come from lib/rpc/server/srv_reg.c */ - -BOOL api_reg_rpc(pipes_struct *p, prs_struct *data); - -/*The following definitions come from lib/rpc/server/srv_samr.c */ - -BOOL api_samr_rpc(pipes_struct *p, prs_struct *data); - -/*The following definitions come from lib/rpc/server/srv_srvsvc.c */ - -BOOL api_srvsvc_rpc(pipes_struct *p, prs_struct *data); - -/*The following definitions come from lib/rpc/server/srv_util.c */ - -int make_dom_gids(char *gids_str, DOM_GID *gids); -void get_domain_user_groups(char *domain_groups, char *user); -BOOL create_rpc_reply(pipes_struct *p, - uint32 data_start, uint32 data_end); -BOOL api_rpcTNP(pipes_struct *p, char *rpc_name, struct api_struct *api_rpc_cmds, - prs_struct *data); -uint32 lookup_group_name(uint32 rid, char *group_name, uint32 *type); -uint32 lookup_alias_name(uint32 rid, char *alias_name, uint32 *type); -uint32 lookup_user_name(uint32 rid, char *user_name, uint32 *type); -uint32 lookup_group_rid(char *group_name, uint32 *rid); -uint32 lookup_alias_rid(char *alias_name, uint32 *rid); -uint32 lookup_user_rid(char *user_name, uint32 *rid); -BOOL name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); -uint32 uid_to_user_rid(uint32 uid); -uint32 gid_to_group_rid(uint32 gid); - -/*The following definitions come from lib/rpc/server/srv_wkssvc.c */ - -BOOL api_wkssvc_rpc(pipes_struct *p, prs_struct *data); - -/*The following definitions come from loadparm.c */ - -char *lp_string(char *s); -char *lp_logfile(void); -char *lp_smbrun(void); -char *lp_configfile(void); -char *lp_smb_passwd_file(void); -char *lp_serverstring(void); -char *lp_printcapname(void); -char *lp_lockdir(void); -char *lp_rootdir(void); -char *lp_defaultservice(void); -char *lp_msg_command(void); -char *lp_dfree_command(void); -char *lp_hosts_equiv(void); -char *lp_auto_services(void); -char *lp_passwd_program(void); -char *lp_passwd_chat(void); -char *lp_passwordserver(void); -char *lp_name_resolve_order(void); -char *lp_workgroup(void); -char *lp_username_map(void); -char *lp_character_set(void); -char *lp_logon_script(void); -char *lp_logon_path(void); -char *lp_logon_drive(void); -char *lp_logon_home(void); -char *lp_remote_announce(void); -char *lp_remote_browse_sync(void); -char *lp_wins_server(void); -char *lp_interfaces(void); -char *lp_socket_address(void); -char *lp_nis_home_map_name(void); -char *lp_announce_version(void); -char *lp_netbios_aliases(void); -char *lp_driverfile(void); -char *lp_domain_sid(void); -char *lp_domain_other_sids(void); -char *lp_domain_groups(void); -char *lp_domain_admin_users(void); -char *lp_domain_guest_users(void); -char *lp_domain_hostsallow(void); -char *lp_domain_hostsdeny(void); -char *lp_ldap_server(void); -char *lp_ldap_suffix(void); -char *lp_ldap_filter(void); -char *lp_ldap_root(void); -char *lp_ldap_rootpasswd(void); -BOOL lp_dns_proxy(void); -BOOL lp_wins_support(void); -BOOL lp_we_are_a_wins_server(void); -BOOL lp_wins_proxy(void); -BOOL lp_local_master(void); -BOOL lp_domain_controller(void); -BOOL lp_domain_master(void); -BOOL lp_domain_logons(void); -BOOL lp_preferred_master(void); -BOOL lp_load_printers(void); -BOOL lp_use_rhosts(void); -BOOL lp_getwdcache(void); -BOOL lp_readprediction(void); -BOOL lp_readbmpx(void); -BOOL lp_readraw(void); -BOOL lp_writeraw(void); -BOOL lp_null_passwords(void); -BOOL lp_strip_dot(void); -BOOL lp_encrypted_passwords(void); -BOOL lp_update_encrypted(void); -BOOL lp_syslog_only(void); -BOOL lp_browse_list(void); -BOOL lp_unix_realname(void); -BOOL lp_nis_home_map(void); -BOOL lp_time_server(void); -BOOL lp_bind_interfaces_only(void); -BOOL lp_net_wksta_user_logon(void); -BOOL lp_unix_password_sync(void); -BOOL lp_passwd_chat_debug(void); -int lp_os_level(void); -int lp_max_ttl(void); -int lp_max_wins_ttl(void); -int lp_min_wins_ttl(void); -int lp_max_log_size(void); -int lp_mangledstack(void); -int lp_maxxmit(void); -int lp_maxmux(void); -int lp_maxpacket(void); -int lp_keepalive(void); -int lp_passwordlevel(void); -int lp_usernamelevel(void); -int lp_readsize(void); -int lp_shmem_size(void); -int lp_deadtime(void); -int lp_maxprotocol(void); -int lp_security(void); -int lp_maxdisksize(void); -int lp_lpqcachetime(void); -int lp_syslog(void); -int lp_client_code_page(void); -int lp_announce_as(void); -int lp_lm_announce(void); -int lp_lm_interval(void); -int lp_ldap_port(void); -char *lp_preexec(int ); -char *lp_postexec(int ); -char *lp_rootpreexec(int ); -char *lp_rootpostexec(int ); -char *lp_servicename(int ); -char *lp_pathname(int ); -char *lp_dontdescend(int ); -char *lp_username(int ); -char *lp_guestaccount(int ); -char *lp_invalid_users(int ); -char *lp_valid_users(int ); -char *lp_admin_users(int ); -char *lp_printcommand(int ); -char *lp_lpqcommand(int ); -char *lp_lprmcommand(int ); -char *lp_lppausecommand(int ); -char *lp_lpresumecommand(int ); -char *lp_printername(int ); -char *lp_printerdriver(int ); -char *lp_hostsallow(int ); -char *lp_hostsdeny(int ); -char *lp_magicscript(int ); -char *lp_magicoutput(int ); -char *lp_comment(int ); -char *lp_force_user(int ); -char *lp_force_group(int ); -char *lp_readlist(int ); -char *lp_writelist(int ); -char *lp_volume(int ); -char *lp_mangled_map(int ); -char *lp_veto_files(int ); -char *lp_hide_files(int ); -char *lp_veto_oplocks(int ); -char *lp_driverlocation(int ); -BOOL lp_alternate_permissions(int ); -BOOL lp_revalidate(int ); -BOOL lp_casesensitive(int ); -BOOL lp_preservecase(int ); -BOOL lp_shortpreservecase(int ); -BOOL lp_casemangle(int ); -BOOL lp_status(int ); -BOOL lp_hide_dot_files(int ); -BOOL lp_browseable(int ); -BOOL lp_readonly(int ); -BOOL lp_no_set_dir(int ); -BOOL lp_guest_ok(int ); -BOOL lp_guest_only(int ); -BOOL lp_print_ok(int ); -BOOL lp_postscript(int ); -BOOL lp_map_hidden(int ); -BOOL lp_map_archive(int ); -BOOL lp_locking(int ); -BOOL lp_strict_locking(int ); -BOOL lp_share_modes(int ); -BOOL lp_oplocks(int ); -BOOL lp_onlyuser(int ); -BOOL lp_manglednames(int ); -BOOL lp_widelinks(int ); -BOOL lp_symlinks(int ); -BOOL lp_syncalways(int ); -BOOL lp_map_system(int ); -BOOL lp_delete_readonly(int ); -BOOL lp_fake_oplocks(int ); -BOOL lp_recursive_veto_delete(int ); -BOOL lp_dos_filetimes(int ); -BOOL lp_dos_filetime_resolution(int ); -BOOL lp_fake_dir_create_times(int ); -int lp_create_mode(int ); -int lp_force_create_mode(int ); -int lp_dir_mode(int ); -int lp_force_dir_mode(int ); -int lp_max_connections(int ); -int lp_defaultcase(int ); -int lp_minprintspace(int ); -int lp_printing(int ); -char lp_magicchar(int ); -BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir); -int lp_add_service(char *pszService, int iDefaultService); -BOOL lp_add_printer(char *pszPrintername, int iDefaultService); -BOOL lp_file_list_changed(void); -void *lp_local_ptr(int snum, void *ptr); -BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue); -BOOL lp_is_default(int snum, struct parm_struct *parm); -struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters); -BOOL lp_snum_ok(int iService); -BOOL lp_loaded(void); -void lp_killunused(BOOL (*snumused)(int )); -BOOL lp_load(char *pszFname,BOOL global_only, BOOL save_defaults, BOOL add_ipc); -int lp_numservices(void); -void lp_dump(FILE *f, BOOL show_defaults); -int lp_servicenumber(char *pszServiceName); -char *volume_label(int snum); -void lp_rename_service(int snum, char *new_name); -void lp_remove_service(int snum); -void lp_copy_service(int snum, char *new_name); -int lp_default_server_announce(void); -int lp_major_announce_version(void); -int lp_minor_announce_version(void); -void lp_set_name_resolve_order(char *new_order); - -/*The following definitions come from locking.c */ - -BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset); -BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); -BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); -BOOL locking_init(int read_only); -BOOL locking_end(void); -BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, int *ptok); -BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, int token); -int get_share_modes(int cnum, int token, uint32 dev, uint32 inode, - share_mode_entry **shares); -void del_share_mode(int token, int fnum); -BOOL set_share_mode(int token, int fnum, uint16 port, uint16 op_type); -BOOL remove_share_oplock(int fnum, int token); -int share_mode_forall(void (*fn)(share_mode_entry *, char *)); -void share_status(FILE *f); - -/*The following definitions come from locking_shm.c */ - -struct share_ops *locking_shm_init(int ronly); - -/*The following definitions come from locking_slow.c */ - -struct share_ops *locking_slow_init(int ronly); - -/*The following definitions come from mangle.c */ - -BOOL is_mangled( char *s ); -BOOL is_8_3( char *fname, BOOL check_case ); -int str_checksum( char *s ); -void reset_mangled_cache( void ); -BOOL check_mangled_cache( char *s ); -void mangle_name_83( char *s ); -BOOL name_map_mangle( char *OutName, BOOL need83, int snum ); - -/*The following definitions come from md4.c */ - -void mdfour(unsigned char *out, unsigned char *in, int n); - -/*The following definitions come from mem_man/mem_man.c */ - -void *smb_mem_malloc(size_t size,char *file,int line); -char *smb_mem_strdup(char *s, char *file, int line); -int smb_mem_free(void *ptr,char *file,int line); -void smb_mem_write_info(void *ptr,FILE *outfile); -char *smb_mem_query_file(void *ptr); -int smb_mem_query_line(void *ptr); -int smb_mem_test(void *ptr); -void smb_mem_write_status(FILE *outfile); -void smb_mem_write_verbose(FILE *outfile); -void smb_mem_write_errors(FILE *outfile); -void smb_mem_set_multiplier(int multiplier); -void *smb_mem_resize(void *ptr,size_t newsize); - -/*The following definitions come from membuffer.c */ - -void mem_init(struct mem_buf *buf, int margin); -void mem_create(struct mem_buf *buf, char *data, int size, int margin, BOOL dynamic); -void mem_take(struct mem_buf *mem_to, struct mem_buf *mem_from); -BOOL mem_alloc_data(struct mem_buf *buf, int size); -BOOL mem_buf_copy(char *copy_into, struct mem_buf *buf, - uint32 offset, uint32 len); -BOOL mem_buf_init(struct mem_buf **buf, uint32 margin); -void mem_buf_free(struct mem_buf **buf); -void mem_free_chain(struct mem_buf **buf); -void mem_free_data(struct mem_buf *buf); -BOOL mem_realloc_data(struct mem_buf *buf, int new_size); -BOOL mem_grow_data(struct mem_buf **buf, BOOL io, int new_size, BOOL force_grow); -BOOL mem_find(struct mem_buf **buf, uint32 offset); -uint32 mem_buf_len(struct mem_buf *buf); -char *mem_data(struct mem_buf **buf, uint32 offset); - -/*The following definitions come from message.c */ - -int reply_sends(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_sendstrt(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_sendtxt(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_sendend(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); - -/*The following definitions come from namequery.c */ - -BOOL name_status(int fd,char *name,int name_type,BOOL recurse, - struct in_addr to_ip,char *master,char *rname, - void (*fn)(struct packet_struct *)); -struct in_addr *name_query(int fd,char *name,int name_type, BOOL bcast,BOOL recurse, - struct in_addr to_ip, int *count, void (*fn)(struct packet_struct *)); -FILE *startlmhosts(char *fname); -BOOL getlmhostsent( FILE *fp, char *name, int *name_type, struct in_addr *ipaddr); -void endlmhosts(FILE *fp); -BOOL resolve_name(char *name, struct in_addr *return_ip); - -/*The following definitions come from nmbd.c */ - -BOOL reload_services(BOOL test); -int main(int argc,char *argv[]); - -/*The following definitions come from nmbd_become_dmb.c */ - -void unbecome_domain_master(char *workgroup_name); -void add_domain_names(time_t t); - -/*The following definitions come from nmbd_become_lmb.c */ - -void insert_permanent_name_into_unicast( struct subnet_record *subrec, - struct nmb_name *nmbname, uint16 nb_type ); -void unbecome_local_master_success(struct subnet_record *subrec, - struct userdata_struct *userdata, - struct nmb_name *released_name, - struct in_addr released_ip); -void unbecome_local_master_fail(struct subnet_record *subrec, struct response_record *rrec, - struct nmb_name *fail_name); -void release_1d_name( struct subnet_record *subrec, char *workgroup_name); -void unbecome_local_master_browser(struct subnet_record *subrec, struct work_record *work); -void become_local_master_browser(struct subnet_record *subrec, struct work_record *work); -void set_workgroup_local_master_browser_name( struct work_record *work, char *newname); - -/*The following definitions come from nmbd_browserdb.c */ - -void remove_lmb_browser_entry(struct browse_cache_record *browc); -void update_browser_death_time(struct browse_cache_record *browc); -struct browse_cache_record *create_browser_in_lmb_cache(char *work_name, char *browser_name, - struct in_addr ip); -struct browse_cache_record *find_browser_in_lmb_cache( char *browser_name ); -void expire_lmb_browsers(time_t t); -void remove_workgroup_lmb_browsers(char *work_group); - -/*The following definitions come from nmbd_browsesync.c */ - -void dmb_expire_and_sync_browser_lists(time_t t); -void announce_and_sync_with_domain_master_browser( struct subnet_record *subrec, - struct work_record *work); -void collect_all_workgroup_names_from_wins_server(time_t t); - -/*The following definitions come from nmbd_elections.c */ - -void check_master_browser_exists(time_t t); -void run_elections(time_t t); -void process_election(struct subnet_record *subrec, struct packet_struct *p, char *buf); -BOOL check_elections(void); - -/*The following definitions come from nmbd_incomingdgrams.c */ - -void tell_become_backup(void); -void process_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf); -void process_workgroup_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf); -void process_local_master_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf); -void process_master_browser_announce(struct subnet_record *subrec, - struct packet_struct *p,char *buf); -void process_lm_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf); -void process_get_backup_list_request(struct subnet_record *subrec, - struct packet_struct *p,char *buf); -void process_reset_browser(struct subnet_record *subrec, - struct packet_struct *p,char *buf); -void process_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf); -void process_lm_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf); - -/*The following definitions come from nmbd_incomingrequests.c */ - -void process_name_release_request(struct subnet_record *subrec, - struct packet_struct *p); -void process_name_refresh_request(struct subnet_record *subrec, - struct packet_struct *p); -void process_name_registration_request(struct subnet_record *subrec, - struct packet_struct *p); -void process_node_status_request(struct subnet_record *subrec, struct packet_struct *p); -void process_name_query_request(struct subnet_record *subrec, struct packet_struct *p); - -/*The following definitions come from nmbd_lmhosts.c */ - -void load_lmhosts_file(char *fname); -BOOL find_name_in_lmhosts(struct nmb_name *nmbname, struct name_record **namerecp); - -/*The following definitions come from nmbd_logonnames.c */ - -void add_logon_names(void); - -/*The following definitions come from nmbd_mynames.c */ - -BOOL register_my_workgroup_and_names(void); -void release_my_names(void); -void refresh_my_names(time_t t); - -/*The following definitions come from nmbd_namelistdb.c */ - -void set_samba_nb_type(void); -BOOL ms_browser_name(char *name, int type); -void remove_name_from_namelist(struct subnet_record *subrec, - struct name_record *namerec); -struct name_record *find_name_on_subnet(struct subnet_record *subrec, - struct nmb_name *nmbname, BOOL self_only); -struct name_record *find_name_for_remote_broadcast_subnet( struct nmb_name *nmbname, - BOOL self_only); -void update_name_ttl(struct name_record *namerec, int ttl); -struct name_record *add_name_to_subnet(struct subnet_record *subrec, - char *name, int type, uint16 nb_flags, int ttl, - enum name_source source, int num_ips, struct in_addr *iplist); -void standard_success_register(struct subnet_record *subrec, - struct userdata_struct *userdata, - struct nmb_name *nmbname, uint16 nb_flags, int ttl, - struct in_addr registered_ip); -void standard_fail_register(struct subnet_record *subrec, - struct response_record *rrec, struct nmb_name *nmbname); -BOOL find_ip_in_name_record(struct name_record *namerec, struct in_addr ip); -void add_ip_to_name_record(struct name_record *namerec, struct in_addr new_ip); -void remove_ip_from_name_record( struct name_record *namerec, struct in_addr remove_ip); -void standard_success_release(struct subnet_record *subrec, - struct userdata_struct *userdata, - struct nmb_name *nmbname, struct in_addr released_ip); -void expire_names_on_subnet(struct subnet_record *subrec, time_t t); -void expire_names(time_t t); -void add_samba_names_to_subnet(struct subnet_record *subrec); -void dump_all_namelists(void); - -/*The following definitions come from nmbd_namequery.c */ - -BOOL query_name(struct subnet_record *subrec, char *name, int type, - query_name_success_function success_fn, - query_name_fail_function fail_fn, - struct userdata_struct *userdata); -BOOL query_name_from_wins_server(struct in_addr ip_to, - char *name, int type, - query_name_success_function success_fn, - query_name_fail_function fail_fn, - struct userdata_struct *userdata); - -/*The following definitions come from nmbd_nameregister.c */ - -BOOL register_name(struct subnet_record *subrec, - char *name, int type, uint16 nb_flags, - register_name_success_function success_fn, - register_name_fail_function fail_fn, - struct userdata_struct *userdata); -BOOL refresh_name(struct subnet_record *subrec, struct name_record *namerec, - refresh_name_success_function success_fn, - refresh_name_fail_function fail_fn, - struct userdata_struct *userdata); - -/*The following definitions come from nmbd_namerelease.c */ - -BOOL release_name(struct subnet_record *subrec, struct name_record *namerec, - release_name_success_function success_fn, - release_name_fail_function fail_fn, - struct userdata_struct *userdata); - -/*The following definitions come from nmbd_nodestatus.c */ - -BOOL node_status(struct subnet_record *subrec, struct nmb_name *nmbname, - struct in_addr send_ip, node_status_success_function success_fn, - node_status_fail_function fail_fn, struct userdata_struct *userdata); - -/*The following definitions come from nmbd_packets.c */ - -uint16 get_nb_flags(char *buf); -void set_nb_flags(char *buf, uint16 nb_flags); -struct response_record *queue_register_name( struct subnet_record *subrec, - response_function resp_fn, - timeout_response_function timeout_fn, - register_name_success_function success_fn, - register_name_fail_function fail_fn, - struct userdata_struct *userdata, - struct nmb_name *nmbname, - uint16 nb_flags); -struct response_record *queue_register_multihomed_name( struct subnet_record *subrec, - response_function resp_fn, - timeout_response_function timeout_fn, - register_name_success_function success_fn, - register_name_fail_function fail_fn, - struct userdata_struct *userdata, - struct nmb_name *nmbname, - uint16 nb_flags, - struct in_addr register_ip); -struct response_record *queue_release_name( struct subnet_record *subrec, - response_function resp_fn, - timeout_response_function timeout_fn, - release_name_success_function success_fn, - release_name_fail_function fail_fn, - struct userdata_struct *userdata, - struct nmb_name *nmbname, - uint16 nb_flags, - struct in_addr release_ip); -struct response_record *queue_refresh_name( struct subnet_record *subrec, - response_function resp_fn, - timeout_response_function timeout_fn, - refresh_name_success_function success_fn, - refresh_name_fail_function fail_fn, - struct userdata_struct *userdata, - struct name_record *namerec, - struct in_addr refresh_ip); -struct response_record *queue_query_name( struct subnet_record *subrec, - response_function resp_fn, - timeout_response_function timeout_fn, - query_name_success_function success_fn, - query_name_fail_function fail_fn, - struct userdata_struct *userdata, - struct nmb_name *nmbname); -struct response_record *queue_query_name_from_wins_server( struct in_addr to_ip, - response_function resp_fn, - timeout_response_function timeout_fn, - query_name_success_function success_fn, - query_name_fail_function fail_fn, - struct userdata_struct *userdata, - struct nmb_name *nmbname); -struct response_record *queue_node_status( struct subnet_record *subrec, - response_function resp_fn, - timeout_response_function timeout_fn, - node_status_success_function success_fn, - node_status_fail_function fail_fn, - struct userdata_struct *userdata, - struct nmb_name *nmbname, - struct in_addr send_ip); -void reply_netbios_packet(struct packet_struct *orig_packet, - int rcode, enum netbios_reply_type_code rcv_code, int opcode, - int ttl, char *data,int len); -void queue_packet(struct packet_struct *packet); -void process_browse_packet(struct packet_struct *p, char *buf,int len); -void process_lanman_packet(struct packet_struct *p, char *buf,int len); -BOOL validate_nmb_response_packet( struct nmb_packet *nmb ); -BOOL validate_nmb_packet( struct nmb_packet *nmb ); -void run_packet_queue(void); -void retransmit_or_expire_response_records(time_t t); -BOOL listen_for_packets(BOOL run_election); -BOOL send_mailslot(BOOL unique, char *mailslot,char *buf,int len, - char *srcname, int src_type, - char *dstname, int dest_type, - struct in_addr dest_ip,struct in_addr src_ip); - -/*The following definitions come from nmbd_processlogon.c */ - -void process_logon_packet(struct packet_struct *p,char *buf,int len, - char *mailslot); - -/*The following definitions come from nmbd_responserecordsdb.c */ - -void add_response_record(struct subnet_record *subrec, - struct response_record *rrec); -void remove_response_record(struct subnet_record *subrec, - struct response_record *rrec); -struct response_record *make_response_record( struct subnet_record *subrec, - struct packet_struct *p, - response_function resp_fn, - timeout_response_function timeout_fn, - success_function success_fn, - fail_function fail_fn, - struct userdata_struct *userdata); -struct response_record *find_response_record(struct subnet_record **ppsubrec, - uint16 id); -BOOL is_refresh_already_queued(struct subnet_record *subrec, struct name_record *namerec); - -/*The following definitions come from nmbd_sendannounce.c */ - -void send_browser_reset(int reset_type, char *to_name, int to_type, struct in_addr to_ip); -void broadcast_announce_request(struct subnet_record *subrec, struct work_record *work); -void announce_my_server_names(time_t t); -void announce_my_lm_server_names(time_t t); -void reset_announce_timer(void); -void announce_myself_to_domain_master_browser(time_t t); -void announce_my_servers_removed(void); -void announce_remote(time_t t); -void browse_sync_remote(time_t t); - -/*The following definitions come from nmbd_serverlistdb.c */ - -void remove_all_servers(struct work_record *work); -struct server_record *find_server_in_workgroup(struct work_record *work, char *name); -void remove_server_from_workgroup(struct work_record *work, struct server_record *servrec); -struct server_record *create_server_on_workgroup(struct work_record *work, - char *name,int servertype, - int ttl,char *comment); -void update_server_ttl(struct server_record *servrec, int ttl); -void expire_servers(struct work_record *work, time_t t); -void write_browse_list(time_t t, BOOL force_write); - -/*The following definitions come from nmbd_subnetdb.c */ - -BOOL create_subnets(void); -BOOL we_are_a_wins_client(void); -struct subnet_record *get_next_subnet_maybe_unicast(struct subnet_record *subrec); -struct subnet_record *get_next_subnet_maybe_unicast_or_wins_server(struct subnet_record *subrec); - -/*The following definitions come from nmbd_winsproxy.c */ - -void make_wins_proxy_name_query_request( struct subnet_record *subrec, - struct packet_struct *incoming_packet, - struct nmb_name *question_name); - -/*The following definitions come from nmbd_winsserver.c */ - -BOOL packet_is_for_wins_server(struct packet_struct *packet); -BOOL initialise_wins(void); -void wins_process_name_refresh_request(struct subnet_record *subrec, - struct packet_struct *p); -void wins_process_name_registration_request(struct subnet_record *subrec, - struct packet_struct *p); -void wins_process_multihomed_name_registration_request( struct subnet_record *subrec, - struct packet_struct *p); -void send_wins_name_query_response(int rcode, struct packet_struct *p, - struct name_record *namerec); -void wins_process_name_query_request(struct subnet_record *subrec, - struct packet_struct *p); -void wins_process_name_release_request(struct subnet_record *subrec, - struct packet_struct *p); -void initiate_wins_processing(time_t t); -void wins_write_database(void); - -/*The following definitions come from nmbd_workgroupdb.c */ - -struct work_record *find_workgroup_on_subnet(struct subnet_record *subrec, - fstring name); -struct work_record *create_workgroup_on_subnet(struct subnet_record *subrec, - fstring name, int ttl); -void update_workgroup_ttl(struct work_record *work, int ttl); -void initiate_myworkgroup_startup(struct subnet_record *subrec, struct work_record *work); -void dump_workgroups(BOOL force_write); -void expire_workgroups_and_servers(time_t t); - -/*The following definitions come from nmblib.c */ - -char *lookup_opcode_name( int opcode ); -void debug_nmb_packet(struct packet_struct *p); -char *namestr(struct nmb_name *n); -struct packet_struct *copy_packet(struct packet_struct *packet); -void free_packet(struct packet_struct *packet); -struct packet_struct *read_packet(int fd,enum packet_type packet_type); -void make_nmb_name(struct nmb_name *n,char *name,int type,char *this_scope); -BOOL nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2); -BOOL send_packet(struct packet_struct *p); -struct packet_struct *receive_packet(int fd,enum packet_type type,int t); - -/*The following definitions come from nterr.c */ - -char *get_nt_error_msg(uint32 nt_code); - -/*The following definitions come from params.c */ - -BOOL pm_process( char *FileName, - BOOL (*sfunc)(char *), - BOOL (*pfunc)(char *, char *) ); - -/*The following definitions come from passdb.c */ - -struct smb_passwd *getsampwnam(char *name); -struct smb_passwd *getsampwuid(unsigned int uid); -void *startsampwent(BOOL update); -void endsampwent(void *vp); -struct smb_passwd *getsampwent(void *vp); -unsigned long getsampwpos(void *vp); -BOOL setsampwpos(void *vp, unsigned long tok); -BOOL add_sampwd_entry(struct smb_passwd *newpwd); -BOOL mod_sampwd_entry(struct smb_passwd* pwd, BOOL override); - -/*The following definitions come from password.c */ - -void generate_next_challenge(char *challenge); -BOOL set_challenge(char *challenge); -BOOL last_challenge(unsigned char *challenge); -user_struct *get_valid_user_struct(uint16 vuid); -void invalidate_vuid(uint16 vuid); -char *validated_username(uint16 vuid); -int setup_groups(char *user, int uid, int gid, int *p_ngroups, - int **p_igroups, gid_t **p_groups, - int **p_attrs); -uint16 register_vuid(int uid,int gid, char *unix_name, char *requested_name, BOOL guest); -void add_session_user(char *user); -BOOL update_smbpassword_file( char *user, fstring password); -void dfs_unlogin(void); -BOOL password_check(char *password); -BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8); -BOOL smb_password_ok(struct smb_passwd *smb_pass, - uchar lm_pass[24], uchar nt_pass[24]); -BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd); -BOOL user_ok(char *user,int snum); -BOOL authorise_login(int snum,char *user,char *password, int pwlen, - BOOL *guest,BOOL *force,uint16 vuid); -BOOL check_hosts_equiv(char *user); -struct cli_state *server_client(void); -struct cli_state *server_cryptkey(void); -BOOL server_validate(char *user, char *domain, - char *pass, int passlen, - char *ntpass, int ntpasslen); -BOOL domain_client_validate( char *user, char *domain, - char *smb_apasswd, int smb_apasslen, - char *smb_ntpasswd, int smb_ntpasslen); - -/*The following definitions come from pcap.c */ - -BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); -void pcap_printer_fn(void (*fn)(char *, char *)); - -/*The following definitions come from pidfile.c */ - -void pidfile_create(char *name); -int pidfile_pid(char *name); - -/*The following definitions come from pipes.c */ - -int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_pipe_read_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_pipe_close(char *inbuf,char *outbuf); - -/*The following definitions come from predict.c */ - -int read_predict(int fd,int offset,char *buf,char **ptr,int num); -void do_read_prediction(void); -void invalidate_read_prediction(int fd); - -/*The following definitions come from print_svid.c */ - -void sysv_printer_fn(void (*fn)(char *, char *)); -int sysv_printername_ok(char *name); - -/*The following definitions come from printing.c */ - -void lpq_reset(int snum); -void print_file(int fnum); -int get_printqueue(int snum,int cnum,print_queue_struct **queue, - print_status_struct *status); -void del_printqueue(int cnum,int snum,int jobid); -void status_printjob(int cnum,int snum,int jobid,int status); -int printjob_encode(int snum, int job); -void printjob_decode(int jobid, int *snum, int *job); - -/*The following definitions come from quotas.c */ - -BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); -BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); -BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); -BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); -BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); -BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); - -/*The following definitions come from replace.c */ - -char *Strstr(char *s, char *p); -time_t Mktime(struct tm *t); -int InNetGr(char *group,char *host,char *user,char *dom); -void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line); - -/*The following definitions come from reply.c */ - -int reply_special(char *inbuf,char *outbuf); -int reply_tcon(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_unknown(char *inbuf,char *outbuf); -int reply_ioctl(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_chkpth(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_getatr(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_setatr(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_dskattr(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_search(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_fclose(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_open(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_open_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_ulogoffX(char *inbuf,char *outbuf,int length,int bufsize); -int reply_mknew(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_ctemp(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_unlink(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_readbraw(char *inbuf, char *outbuf, int dum_size, int dum_buffsize); -int reply_lockread(char *inbuf,char *outbuf, int dum_size, int dum_buffsiz); -int reply_read(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_read_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_writebraw(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_writeunlock(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_write(char *inbuf,char *outbuf,int dum_size,int dum_buffsize); -int reply_write_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_lseek(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_flush(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_exit(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_close(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_writeclose(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_lock(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_unlock(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_tdis(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_echo(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_printopen(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_printclose(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_printqueue(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_printwrite(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_mkdir(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_rmdir(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_mv(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_copy(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_setdir(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_lockingX(char *inbuf,char *outbuf,int length,int bufsize); -int reply_readbmpx(char *inbuf,char *outbuf,int length,int bufsize); -int reply_writebmpx(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_writebs(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_setattrE(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_getattrE(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); - -/*The following definitions come from server.c */ - -void *dflt_sig(void); -void killkids(void); -mode_t unix_mode(int cnum,int dosmode); -int dos_mode(int cnum,char *path,struct stat *sbuf); -int dos_chmod(int cnum,char *fname,int dosmode,struct stat *st); -int file_utime(int cnum, char *fname, struct utimbuf *times); -BOOL set_filetime(int cnum, char *fname, time_t mtime); -BOOL unix_convert(char *name,int cnum,pstring saved_last_component, BOOL *bad_path); -int disk_free(char *path,int *bsize,int *dfree,int *dsize); -int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); -BOOL check_name(char *name,int cnum); -void sync_file(int fnum); -void close_file(int fnum, BOOL normal_close); -BOOL check_file_sharing(int cnum,char *fname, BOOL rename_op); -int check_share_mode( share_mode_entry *share, int deny_mode, char *fname, - BOOL fcbopen, int *flags); -void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun, - int mode,int oplock_request, int *Access,int *action); -int seek_file(int fnum,uint32 pos); -int read_file(int fnum,char *data,uint32 pos,int n); -int write_file(int fnum,char *data,int n); -BOOL become_service(int cnum,BOOL do_chdir); -int find_service(char *service); -int cached_error_packet(char *inbuf,char *outbuf,int fnum,int line); -int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line); -int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int line); -BOOL oplock_break(uint32 dev, uint32 inode, struct timeval *tval); -BOOL request_oplock_break(share_mode_entry *share_entry, - uint32 dev, uint32 inode); -BOOL receive_next_smb(int smbfd, int oplockfd, char *inbuf, int bufsize, int timeout); -BOOL snum_used(int snum); -BOOL reload_services(BOOL test); -int make_connection(char *service,char *user,char *password, int pwlen, char *dev,uint16 vuid); -int find_free_file(void ); -int reply_corep(char *outbuf); -int reply_coreplus(char *outbuf); -int reply_lanman1(char *outbuf); -int reply_lanman2(char *outbuf); -int reply_nt1(char *outbuf); -void close_cnum(int cnum, uint16 vuid); -void exit_server(char *reason); -void standard_sub(int cnum,char *str); -char *smb_fn_name(int type); -int chain_reply(char *inbuf,char *outbuf,int size,int bufsize); -int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); - -/*The following definitions come from shmem.c */ - -struct shmem_ops *smb_shm_open(int ronly); - -/*The following definitions come from shmem_sysv.c */ - -struct shmem_ops *sysv_shm_open(int ronly); - -/*The following definitions come from smbdes.c */ - -void E_P16(unsigned char *p14,unsigned char *p16); -void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24); -void D_P16(unsigned char *p14, unsigned char *in, unsigned char *out); -void E_old_pw_hash( unsigned char *p14, unsigned char *in, unsigned char *out); -void cred_hash1(unsigned char *out,unsigned char *in,unsigned char *key); -void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key); -void cred_hash3(unsigned char *out,unsigned char *in,unsigned char *key, int forw); -void SamOEMhash( unsigned char *data, unsigned char *key, int val); - -/*The following definitions come from smbencrypt.c */ - -void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); -void E_md4hash(uchar *passwd, uchar *p16); -void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); -void nt_lm_owf_gen(char *pwd, char *nt_p16, char *p16); - -/*The following definitions come from smberr.c */ - -char *smb_errstr(char *inbuf); - -/*The following definitions come from smbpass.c */ - -void *startsmbpwent(BOOL update); -void endsmbpwent(void *vp); -struct smb_passwd *getsmbpwent(void *vp); -unsigned long getsmbpwpos(void *vp); -BOOL setsmbpwpos(void *vp, unsigned long tok); -struct smb_passwd *getsmbpwnam(char *name); -struct smb_passwd *getsmbpwuid(unsigned int uid); -char *encode_acct_ctrl(uint16 acct_ctrl); -BOOL add_smbpwd_entry(struct smb_passwd *newpwd); -BOOL mod_smbpwd_entry(struct smb_passwd* pwd, BOOL override); -BOOL machine_password_lock( char *domain, char *name, BOOL update); -BOOL machine_password_unlock(void); -BOOL machine_password_delete( char *domain, char *name ); -BOOL get_machine_account_password( unsigned char *ret_pwd, time_t *last_change_time); -BOOL set_machine_account_password( unsigned char *md4_new_pwd); - -/*The following definitions come from status.c */ - -void Ucrit_addUsername(pstring username); -unsigned int Ucrit_checkUsername(pstring username); -void Ucrit_addPid(int pid); -unsigned int Ucrit_checkPid(int pid); - -/*The following definitions come from system.c */ - -int sys_select(fd_set *fds,struct timeval *tval); -int sys_select(fd_set *fds,struct timeval *tval); -int sys_unlink(char *fname); -int sys_open(char *fname,int flags,int mode); -DIR *sys_opendir(char *dname); -int sys_stat(char *fname,struct stat *sbuf); -int sys_waitpid(pid_t pid,int *status,int options); -int sys_lstat(char *fname,struct stat *sbuf); -int sys_mkdir(char *dname,int mode); -int sys_rmdir(char *dname); -int sys_chdir(char *dname); -int sys_utime(char *fname,struct utimbuf *times); -int sys_rename(char *from, char *to); -int sys_chmod(char *fname,int mode); -char *sys_getwd(char *s); -int sys_chown(char *fname,int uid,int gid); -int sys_chroot(char *dname); -struct hostent *sys_gethostbyname(char *name); - -/*The following definitions come from time.c */ - -void GetTimeOfDay(struct timeval *tval); -void TimeInit(void); -int TimeDiff(time_t t); -struct tm *LocalTime(time_t *t); -time_t interpret_long_date(char *p); -void put_long_date(char *p,time_t t); -BOOL null_mtime(time_t mtime); -void put_dos_date(char *buf,int offset,time_t unixdate); -void put_dos_date2(char *buf,int offset,time_t unixdate); -void put_dos_date3(char *buf,int offset,time_t unixdate); -time_t make_unix_date(void *date_ptr); -time_t make_unix_date2(void *date_ptr); -time_t make_unix_date3(void *date_ptr); -char *http_timestring(time_t t); -char *timestring(void ); -time_t get_create_time(struct stat *st,BOOL fake_dirs); - -/*The following definitions come from trans2.c */ - -int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize); -int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize); -int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize); -int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize); - -/*The following definitions come from ufc.c */ - -char *ufc_crypt(char *key,char *salt); - -/*The following definitions come from uid.c */ - -void init_uid(void); -BOOL become_guest(void); -BOOL become_user(connection_struct *conn, int cnum, uint16 vuid); -BOOL unbecome_user(void ); -int smbrun(char *cmd,char *outfile,BOOL shared); -void become_root(BOOL save_dir) ; -void unbecome_root(BOOL restore_dir); - -/*The following definitions come from username.c */ - -char *get_home_dir(char *user); -void map_username(char *user); -struct passwd *Get_Pwnam(char *user,BOOL allow_change); -BOOL user_in_list(char *user,char *list); - -/*The following definitions come from util.c */ - -int sig_usr2(void); -int sig_usr1(void); -void setup_logging(char *pname,BOOL interactive); -void reopen_logs(void); -char *tmpdir(void); -BOOL is_a_socket(int fd); -BOOL next_token(char **ptr,char *buff,char *sep); -char **toktocliplist(int *ctok, char *sep); -void *MemMove(void *dest,void *src,int size); -void array_promote(char *array,int elsize,int element); -void set_socket_options(int fd, char *options); -void close_sockets(void ); -BOOL in_group(gid_t group, int current_gid, int ngroups, int *groups); -char *StrCpy(char *dest,char *src); -char *StrnCpy(char *dest,char *src,int n); -void putip(void *dest,void *src); -int name_mangle( char *In, char *Out, char name_type ); -BOOL file_exist(char *fname,struct stat *sbuf); -time_t file_modtime(char *fname); -BOOL directory_exist(char *dname,struct stat *st); -uint32 file_size(char *file_name); -char *attrib_string(int mode); -int StrCaseCmp(char *s, char *t); -int StrnCaseCmp(char *s, char *t, int n); -BOOL strequal(char *s1, char *s2); -BOOL strnequal(char *s1,char *s2,int n); -BOOL strcsequal(char *s1,char *s2); -void strlower(char *s); -void strupper(char *s); -void strnorm(char *s); -BOOL strisnormal(char *s); -void string_replace(char *s,char oldc,char newc); -void unix_format(char *fname); -void dos_format(char *fname); -void show_msg(char *buf); -int smb_len(char *buf); -void _smb_setlen(char *buf,int len); -void smb_setlen(char *buf,int len); -int set_message(char *buf,int num_words,int num_bytes,BOOL zero); -int smb_numwords(char *buf); -int smb_buflen(char *buf); -int smb_buf_ofs(char *buf); -char *smb_buf(char *buf); -int smb_offset(char *p,char *buf); -char *skip_string(char *buf,int n); -BOOL trim_string(char *s,char *front,char *back); -void dos_clean_name(char *s); -void unix_clean_name(char *s); -int ChDir(char *path); -char *GetWd(char *str); -BOOL reduce_name(char *s,char *dir,BOOL widelinks); -void expand_mask(char *Mask,BOOL doext); -BOOL strhasupper(char *s); -BOOL strhaslower(char *s); -int count_chars(char *s,char c); -void make_dir_struct(char *buf,char *mask,char *fname,unsigned int size,int mode,time_t date); -void close_low_fds(void); -int set_blocking(int fd, BOOL set); -int write_socket(int fd,char *buf,int len); -int read_udp_socket(int fd,char *buf,int len); -int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out); -int read_max_udp(int fd,char *buffer,int bufsize,int maxtime); -int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew); -BOOL send_keepalive(int client); -int read_data(int fd,char *buffer,int N); -int write_data(int fd,char *buffer,int N); -int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align); -int read_smb_length(int fd,char *inbuf,int timeout); -BOOL receive_smb(int fd,char *buffer, int timeout); -BOOL client_receive_smb(int fd,char *buffer, int timeout); -BOOL receive_local_message(int fd, char *buffer, int buffer_len, int timeout); -BOOL push_smb_message(char *buf, int msg_len); -BOOL receive_message_or_smb(int smbfd, int oplock_fd, - char *buffer, int buffer_len, - int timeout, BOOL *got_smb); -BOOL send_smb(int fd,char *buffer); -char *name_ptr(char *buf,int ofs); -int name_extract(char *buf,int ofs,char *name); -int name_len( char *s ); -BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type); -void msleep(int t); -BOOL in_list(char *s,char *list,BOOL casesensitive); -BOOL string_init(char **dest,char *src); -void string_free(char **s); -BOOL string_set(char **dest,char *src); -BOOL string_sub(char *s,char *pattern,char *insert); -BOOL do_match(char *str, char *regexp, int case_sig); -BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2); -void become_daemon(void); -BOOL yesno(char *p); -char *fgets_slash(char *s2,int maxlen,FILE *f); -int set_filelen(int fd, long len); -int byte_checksum(char *buf,int len); -char *dirname_dos(char *path,char *buf); -void *Realloc(void *p,int size); -void Abort(void ); -BOOL get_myname(char *my_name,struct in_addr *ip); -BOOL ip_equal(struct in_addr ip1,struct in_addr ip2); -int open_socket_in(int type, int port, int dlevel,uint32 socket_addr); -int open_socket_out(int type, struct in_addr *addr, int port ,int timeout); -int interpret_protocol(char *str,int def); -int interpret_security(char *str,int def); -uint32 interpret_addr(char *str); -struct in_addr *interpret_addr2(char *str); -BOOL zero_ip(struct in_addr ip); -void reset_globals_after_fork(void); -char *client_name(int fd); -char *client_addr(int fd); -char *automount_server(char *user_name); -char *automount_path(char *user_name); -void standard_sub_basic(char *str); -BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask); -int PutUniCode(char *dst,char *src); -struct hostent *Get_Hostbyname(char *name); -BOOL process_exists(int pid); -char *uidtoname(int uid); -char *gidtoname(int gid); -void BlockSignals(BOOL block,int signum); -void ajt_panic(void); -char *readdirname(void *p); -BOOL is_in_path(char *name, name_compare_entry *namelist); -void set_namearray(name_compare_entry **ppname_array, char *namelist); -void free_namearray(name_compare_entry *name_array); -BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); -int file_lock(char *name,int timeout); -void file_unlock(int fd); -BOOL is_myname(char *s); -void set_remote_arch(enum remote_arch_types type); -enum remote_arch_types get_remote_arch(void); -char *skip_unicode_string(char *buf,int n); -char *unistrn2(uint16 *buf, int len); -char *unistr2(uint16 *buf); -int struni2(uint16 *p, char *buf); -char *unistr(char *buf); -int unistrncpy(char *dst, char *src, int len); -int unistrcpy(char *dst, char *src); -void fstrcpy(char *dest, char *src); -void pstrcpy(char *dest, char *src); -char *align4(char *q, char *base); -char *align2(char *q, char *base); -char *align_offset(char *q, char *base, int align_offset_len); -void print_asc(int level, unsigned char *buf,int len); -void dump_data(int level,char *buf1,int len); -char *tab_depth(int depth); -char *dom_sid_to_string(DOM_SID *sid); -int gethexpwd(char *p, char *pwd); - -/*The following definitions come from web/cgi.c */ - -void cgi_load_variables(FILE *f1); -char *cgi_variable(char *name); -char *cgi_vnum(int i, char **name); -int cgi_boolean(char *name, int def); -char *quotedup(char *s); -char *urlquote(char *s); -char *quotequotes(char *s); -void quote_spaces(char *buf); -void cgi_setup(char *rootdir, int auth_required); -char *cgi_baseurl(void); -char *cgi_rooturl(void); -char *cgi_pathinfo(void); -char *cgi_remote_host(void); -char *cgi_remote_addr(void); -BOOL cgi_waspost(void); - -/*The following definitions come from web/diagnose.c */ - -BOOL nmbd_running(void); -BOOL smbd_running(void); - -/*The following definitions come from web/startstop.c */ - -void start_smbd(void); -void start_nmbd(void); -void stop_smbd(void); -void stop_nmbd(void); -void kill_pid(int pid); - -/*The following definitions come from web/statuspage.c */ - -void status_page(void); - -/*The following definitions come from web/swat.c */ - -int main(int argc, char *argv[]); -- cgit From 5e9cd44fedc388cf83807592327696a66835af47 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 8 May 1998 16:49:10 +0000 Subject: Ho hum, someone deleted proto.h from cvs... re-adding. Jeremy. (This used to be commit 6dde50738fcdbaae799101b84ab6b6270696193d) --- source3/include/proto.h | 2070 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2070 insertions(+) create mode 100644 source3/include/proto.h (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h new file mode 100644 index 0000000000..c9ca7a5ea6 --- /dev/null +++ b/source3/include/proto.h @@ -0,0 +1,2070 @@ +/* This file is automatically generated with "make proto". DO NOT EDIT */ + + +/*The following definitions come from access.c */ + +BOOL check_access(int snum); +BOOL allow_access(char *deny_list,char *allow_list,char *cname,char *caddr); + +/*The following definitions come from asyncdns.c */ + +int asyncdns_fd(void); +void kill_async_dns_child(void); +void start_async_dns(void); +void run_dns_queue(void); +BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question, + struct name_record **n); +BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question, + struct name_record **n); +void kill_async_dns_child(void); + +/*The following definitions come from charcnv.c */ + +char *unix2dos_format(char *str,BOOL overwrite); +char *dos2unix_format(char *str, BOOL overwrite); +void interpret_character_set(char *str); + +/*The following definitions come from charset.c */ + +void charset_initialise(void); +void codepage_initialise(int client_codepage); +void add_char_string(char *s); + +/*The following definitions come from chgpasswd.c */ + +BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence, BOOL as_root); +BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root); +BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root); +BOOL check_lanman_password(char *user, unsigned char *pass1, + unsigned char *pass2, struct smb_passwd **psampw); +BOOL change_lanman_password(struct smb_passwd *sampw, unsigned char *pass1, unsigned char *pass2); +BOOL check_oem_password(char *user, unsigned char *data, + struct smb_passwd **psampw, char *new_passwd, + int new_passwd_size); +BOOL change_oem_password(struct smb_passwd *sampw, char *new_passwd, BOOL override); + +/*The following definitions come from client.c */ + +void cli_smb_close(char *inbuf, char *outbuf, int clnt_fd, int c_num, int f_num); +void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(file_info *),BOOL recurse_dir, BOOL dirstoo); +void cmd_help(char *dum_in, char *dum_out); + +/*The following definitions come from clientgen.c */ + +char *cli_smb_errstr(struct cli_state *cli); +char *cli_errstr(struct cli_state *cli); +BOOL cli_api_pipe(struct cli_state *cli, char *pipe_name, int pipe_name_len, + uint16 *setup, uint32 setup_count, uint32 max_setup_count, + char *params, uint32 param_count, uint32 max_param_count, + char *data, uint32 data_count, uint32 max_data_count, + char **rparam, uint32 *rparam_count, + char **rdata, uint32 *rdata_count); +BOOL cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation); +BOOL cli_RNetShareEnum(struct cli_state *cli, void (*fn)(char *, uint32, char *)); +BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype, + void (*fn)(char *, uint32, char *)); +BOOL cli_session_setup(struct cli_state *cli, + char *user, + char *pass, int passlen, + char *ntpass, int ntpasslen, + char *workgroup); +BOOL cli_ulogoff(struct cli_state *cli); +BOOL cli_send_tconX(struct cli_state *cli, + char *share, char *dev, char *pass, int passlen); +BOOL cli_tdis(struct cli_state *cli); +BOOL cli_mv(struct cli_state *cli, char *fname_src, char *fname_dst); +BOOL cli_unlink(struct cli_state *cli, char *fname); +BOOL cli_mkdir(struct cli_state *cli, char *dname); +BOOL cli_rmdir(struct cli_state *cli, char *dname); +int cli_open(struct cli_state *cli, char *fname, int flags, int share_mode); +BOOL cli_close(struct cli_state *cli, int fnum); +BOOL cli_lock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout); +BOOL cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout); +int cli_read(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 size); +int cli_write(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 size); +BOOL cli_getatr(struct cli_state *cli, char *fname, + int *attr, uint32 *size, time_t *t); +BOOL cli_setatr(struct cli_state *cli, char *fname, int attr, time_t t); +BOOL cli_qpathinfo(struct cli_state *cli, char *fname, + time_t *c_time, time_t *a_time, time_t *m_time, uint32 *size); +BOOL cli_qpathinfo2(struct cli_state *cli, char *fname, + time_t *c_time, time_t *a_time, time_t *m_time, + time_t *w_time, uint32 *size); +BOOL cli_qfileinfo(struct cli_state *cli, int fnum, + time_t *c_time, time_t *a_time, time_t *m_time, uint32 *size); +BOOL cli_oem_change_password(struct cli_state *cli, char *user, char *new_password, + char *old_password); +BOOL cli_negprot(struct cli_state *cli); +BOOL cli_session_request(struct cli_state *cli, char *host, int name_type, + char *myname); +BOOL cli_connect(struct cli_state *cli, char *host, struct in_addr *ip); +BOOL cli_initialise(struct cli_state *cli); +void cli_shutdown(struct cli_state *cli); +void cli_error(struct cli_state *cli, int *eclass, int *num); +void cli_sockopt(struct cli_state *cli, char *options); +int cli_setpid(struct cli_state *cli, int pid); + +/*The following definitions come from clientutil.c */ + +void cli_setup_pkt(char *outbuf); +BOOL cli_call_api(char *pipe_name, int pipe_name_len, + int prcnt,int drcnt, int srcnt, + int mprcnt,int mdrcnt, + int *rprcnt,int *rdrcnt, + char *param,char *data, uint16 *setup, + char **rparam,char **rdata); +BOOL cli_receive_trans_response(char *inbuf,int trans, + int *data_len,int *param_len, + char **data,char **param); +BOOL cli_send_trans_request(char *outbuf,int trans, + char *name,int namelen, int fid,int flags, + char *data,char *param,uint16 *setup, + int ldata,int lparam,int lsetup, + int mdata,int mparam,int msetup); +BOOL cli_send_session_request(char *inbuf,char *outbuf); +BOOL cli_send_login(char *inbuf,char *outbuf,BOOL start_session,BOOL use_setup, struct connection_options *options); +void cli_send_logout(char *dum_in, char *dum_out); +BOOL cli_open_sockets(int port ); +BOOL cli_reopen_connection(char *inbuf,char *outbuf); + +/*The following definitions come from clitar.c */ + +int padit(char *buf, int bufsize, int padsize); +void cmd_block(char *dum_in, char *dum_out); +void cmd_tarmode(char *dum_in, char *dum_out); +void cmd_setmode(char *dum_in, char *dum_out); +void cmd_tar(char *inbuf, char *outbuf); +int process_tar(char *inbuf, char *outbuf); +int clipfind(char **aret, int ret, char *tok); +int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind); + +/*The following definitions come from connection.c */ + +BOOL yield_connection(int cnum,char *name,int max_connections); +BOOL claim_connection(int cnum,char *name,int max_connections,BOOL Clear); + +/*The following definitions come from credentials.c */ + +char *credstr(uchar *cred); +void cred_session_key(DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal, char *pass, + uchar session_key[8]); +void cred_create(uchar session_key[8], DOM_CHAL *stor_cred, UTIME timestamp, + DOM_CHAL *cred); +int cred_assert(DOM_CHAL *cred, uchar session_key[8], DOM_CHAL *stored_cred, + UTIME timestamp); +BOOL clnt_deal_with_creds(uchar sess_key[8], + DOM_CRED *sto_clnt_cred, DOM_CRED *rcv_srv_cred); +BOOL deal_with_creds(uchar sess_key[8], + DOM_CRED *sto_clnt_cred, + DOM_CRED *rcv_clnt_cred, DOM_CRED *rtn_srv_cred); + +/*The following definitions come from dir.c */ + +void init_dptrs(void); +char *dptr_path(int key); +char *dptr_wcard(int key); +BOOL dptr_set_wcard(int key, char *wcard); +BOOL dptr_set_attr(int key, uint16 attr); +uint16 dptr_attr(int key); +void dptr_close(int key); +void dptr_closecnum(int cnum); +void dptr_idlecnum(int cnum); +void dptr_closepath(char *path,int pid); +int dptr_create(int cnum,char *path, BOOL expect_close,int pid); +BOOL dptr_fill(char *buf1,unsigned int key); +BOOL dptr_zero(char *buf); +void *dptr_fetch(char *buf,int *num); +void *dptr_fetch_lanman2(int dptr_num); +BOOL dir_check_ftype(int cnum,int mode,struct stat *st,int dirtype); +BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend); +void *OpenDir(int cnum, char *name, BOOL use_veto); +void CloseDir(void *p); +char *ReadDirName(void *p); +BOOL SeekDir(void *p,int pos); +int TellDir(void *p); +void DirCacheAdd( char *path, char *name, char *dname, int snum ); +char *DirCacheCheck( char *path, char *name, int snum ); +void DirCacheFlush( int snum ); + +/*The following definitions come from fault.c */ + +void fault_setup(void (*fn)(void *)); + +/*The following definitions come from genrand.c */ + +void generate_random_buffer( unsigned char *out, int len, BOOL re_seed); + +/*The following definitions come from getsmbpass.c */ + +char *getsmbpass(char *prompt) ; + +/*The following definitions come from interface.c */ + +void load_interfaces(void); +void iface_set_default(char *ip,char *bcast,char *nmask); +BOOL ismyip(struct in_addr ip); +BOOL ismybcast(struct in_addr bcast); +BOOL is_local_net(struct in_addr from); +int iface_count(void); +BOOL we_are_multihomed(void); +struct interface *get_interface(int n); +struct in_addr *iface_n_ip(int n); +struct in_addr *iface_bcast(struct in_addr ip); +struct in_addr *iface_nmask(struct in_addr ip); +struct in_addr *iface_ip(struct in_addr ip); + +/*The following definitions come from ipc.c */ + +int get_printerdrivernumber(int snum); +int reply_trans(char *inbuf,char *outbuf, int size, int bufsize); + +/*The following definitions come from kanji.c */ + +void interpret_coding_system(char *str); +void initialize_multibyte_vectors( int client_codepage); + +/*The following definitions come from lib/rpc/client/cli_login.c */ + +BOOL cli_nt_setup_creds(struct cli_state *cli, unsigned char mach_pwd[16]); +BOOL cli_nt_srv_pwset(struct cli_state *cli, unsigned char *new_hashof_mach_pwd); +BOOL cli_nt_login_interactive(struct cli_state *cli, char *domain, char *username, + uint32 smb_userid_low, char *password, + NET_ID_INFO_CTR *ctr, NET_USER_INFO_3 *user_info3); +BOOL cli_nt_login_network(struct cli_state *cli, char *domain, char *username, + uint32 smb_userid_low, char lm_chal[8], char lm_chal_resp[24], + char nt_chal_resp[24], + NET_ID_INFO_CTR *ctr, NET_USER_INFO_3 *user_info3); +BOOL cli_nt_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr); + +/*The following definitions come from lib/rpc/client/cli_netlogon.c */ + +BOOL cli_net_logon_ctrl2(struct cli_state *cli, uint32 status_level); +BOOL cli_net_auth2(struct cli_state *cli, uint16 sec_chan, + uint32 neg_flags, DOM_CHAL *srv_chal); +BOOL cli_net_req_chal(struct cli_state *cli, DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal); +BOOL cli_net_srv_pwset(struct cli_state *cli, uint8 hashed_mach_pwd[16]); +BOOL cli_net_sam_logon(struct cli_state *cli, NET_ID_INFO_CTR *ctr, + NET_USER_INFO_3 *user_info3); +BOOL cli_net_sam_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr); + +/*The following definitions come from lib/rpc/client/cli_pipe.c */ + +uint32 get_rpc_call_id(void); +BOOL rpc_api_pipe(struct cli_state *cli, uint16 cmd, + prs_struct *param , prs_struct *data, + prs_struct *rparam, prs_struct *rdata); +BOOL rpc_api_pipe_req(struct cli_state *cli, uint8 op_num, + prs_struct *data, prs_struct *rdata); +BOOL rpc_pipe_set_hnd_state(struct cli_state *cli, char *pipe_name, uint16 device_state); +BOOL rpc_pipe_bind(struct cli_state *cli, char *pipe_name, + RPC_IFACE *abstract, RPC_IFACE *transfer, BOOL ntlmssp_auth); +BOOL cli_nt_session_open(struct cli_state *cli, char *pipe_name, BOOL encrypted); +void cli_nt_session_close(struct cli_state *cli); + +/*The following definitions come from lib/rpc/parse/parse_lsa.c */ + +void make_lsa_trans_name(LSA_TRANS_NAME *trn, uint32 sid_name_use, char *name, uint32 idx); +void lsa_io_trans_name(char *desc, LSA_TRANS_NAME *trn, prs_struct *ps, int depth); +void lsa_io_dom_r_ref(char *desc, DOM_R_REF *r_r, prs_struct *ps, int depth); +void make_lsa_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, uint32 sec_qos); +void lsa_io_obj_attr(char *desc, LSA_OBJ_ATTR *attr, prs_struct *ps, int depth); +void make_q_open_pol(LSA_Q_OPEN_POL *r_q, char *server_name, + uint32 attributes, uint32 sec_qos, + uint32 desired_access); +void lsa_io_q_open_pol(char *desc, LSA_Q_OPEN_POL *r_q, prs_struct *ps, int depth); +void lsa_io_r_open_pol(char *desc, LSA_R_OPEN_POL *r_p, prs_struct *ps, int depth); +void make_q_query(LSA_Q_QUERY_INFO *q_q, POLICY_HND *hnd, uint16 info_class); +void lsa_io_q_query(char *desc, LSA_Q_QUERY_INFO *q_q, prs_struct *ps, int depth); +void lsa_io_q_enum_trust_dom(char *desc, LSA_Q_ENUM_TRUST_DOM *q_e, prs_struct *ps, int depth); +void make_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM *r_e, + uint32 enum_context, char *domain_name, char *domain_sid, + uint32 status); +void lsa_io_r_enum_trust_dom(char *desc, LSA_R_ENUM_TRUST_DOM *r_e, prs_struct *ps, int depth); +void make_lsa_q_close(LSA_Q_CLOSE *q_c, POLICY_HND *hnd); +void lsa_io_q_close(char *desc, LSA_Q_CLOSE *q_c, prs_struct *ps, int depth); +void make_lsa_r_close(LSA_R_CLOSE *q_r, POLICY_HND *hnd); +void lsa_io_r_close(char *desc, LSA_R_CLOSE *r_c, prs_struct *ps, int depth); +void lsa_io_r_query(char *desc, LSA_R_QUERY_INFO *r_q, prs_struct *ps, int depth); +void lsa_io_sid_enum(char *desc, LSA_SID_ENUM *sen, prs_struct *ps, int depth); +void lsa_io_q_lookup_sids(char *desc, LSA_Q_LOOKUP_SIDS *q_s, prs_struct *ps, int depth); +void lsa_io_trans_names(char *desc, LSA_TRANS_NAME_ENUM *trn, prs_struct *ps, int depth); +void lsa_io_r_lookup_sids(char *desc, LSA_R_LOOKUP_SIDS *r_s, prs_struct *ps, int depth); +void lsa_io_q_lookup_rids(char *desc, LSA_Q_LOOKUP_RIDS *q_r, prs_struct *ps, int depth); +void lsa_io_r_lookup_rids(char *desc, LSA_R_LOOKUP_RIDS *r_r, prs_struct *ps, int depth); + +/*The following definitions come from lib/rpc/parse/parse_misc.c */ + +void smb_io_utime(char *desc, UTIME *t, prs_struct *ps, int depth); +void smb_io_time(char *desc, NTTIME *nttime, prs_struct *ps, int depth); +void smb_io_lookup_level(char *desc, LOOKUP_LEVEL *level, prs_struct *ps, int depth); +uint32 get_enum_hnd(ENUM_HND *enh); +void make_enum_hnd(ENUM_HND *enh, uint32 hnd); +void smb_io_enum_hnd(char *desc, ENUM_HND *hnd, prs_struct *ps, int depth); +void make_dom_sid(DOM_SID *sid, char *str_sid); +void smb_io_dom_sid(char *desc, DOM_SID *sid, prs_struct *ps, int depth); +void make_dom_sid2(DOM_SID2 *sid, char *str_sid); +void smb_io_dom_sid2(char *desc, DOM_SID2 *sid, prs_struct *ps, int depth); +void make_str_hdr(STRHDR *hdr, int max_len, int len, uint32 buffer); +void smb_io_strhdr(char *desc, STRHDR *hdr, prs_struct *ps, int depth); +void make_uni_hdr(UNIHDR *hdr, int max_len, int len, uint32 buffer); +void smb_io_unihdr(char *desc, UNIHDR *hdr, prs_struct *ps, int depth); +void make_uni_hdr2(UNIHDR2 *hdr, int max_len, int len, uint16 terminate); +void smb_io_unihdr2(char *desc, UNIHDR2 *hdr2, prs_struct *ps, int depth); +void make_unistr(UNISTR *str, char *buf); +void smb_io_unistr(char *desc, UNISTR *uni, prs_struct *ps, int depth); +void make_uninotstr2(UNINOTSTR2 *str, char *buf, int len); +void smb_io_uninotstr2(char *desc, UNINOTSTR2 *uni2, uint32 buffer, prs_struct *ps, int depth); +void make_buf_unistr2(UNISTR2 *str, uint32 *ptr, char *buf); +void copy_unistr2(UNISTR2 *str, UNISTR2 *from); +void make_string2(STRING2 *str, char *buf, int len); +void smb_io_string2(char *desc, STRING2 *str2, uint32 buffer, prs_struct *ps, int depth); +void make_unistr2(UNISTR2 *str, char *buf, int len); +void smb_io_unistr2(char *desc, UNISTR2 *uni2, uint32 buffer, prs_struct *ps, int depth); +void make_dom_rid2(DOM_RID2 *rid2, uint32 rid); +void smb_io_dom_rid2(char *desc, DOM_RID2 *rid2, prs_struct *ps, int depth); +void make_dom_rid3(DOM_RID3 *rid3, uint32 rid); +void smb_io_dom_rid3(char *desc, DOM_RID3 *rid3, prs_struct *ps, int depth); +void make_dom_rid4(DOM_RID4 *rid4, uint16 unknown, uint16 attr, uint32 rid); +void smb_io_dom_rid4(char *desc, DOM_RID4 *rid4, prs_struct *ps, int depth); +void make_clnt_srv(DOM_CLNT_SRV *log, char *logon_srv, char *comp_name); +void smb_io_clnt_srv(char *desc, DOM_CLNT_SRV *log, prs_struct *ps, int depth); +void make_log_info(DOM_LOG_INFO *log, char *logon_srv, char *acct_name, + uint16 sec_chan, char *comp_name); +void smb_io_log_info(char *desc, DOM_LOG_INFO *log, prs_struct *ps, int depth); +void smb_io_chal(char *desc, DOM_CHAL *chal, prs_struct *ps, int depth); +void smb_io_cred(char *desc, DOM_CRED *cred, prs_struct *ps, int depth); +void make_clnt_info2(DOM_CLNT_INFO2 *clnt, + char *logon_srv, char *comp_name, + DOM_CRED *clnt_cred); +void smb_io_clnt_info2(char *desc, DOM_CLNT_INFO2 *clnt, prs_struct *ps, int depth); +void make_clnt_info(DOM_CLNT_INFO *clnt, + char *logon_srv, char *acct_name, + uint16 sec_chan, char *comp_name, + DOM_CRED *cred); +void smb_io_clnt_info(char *desc, DOM_CLNT_INFO *clnt, prs_struct *ps, int depth); +void make_logon_id(DOM_LOGON_ID *log, uint32 log_id_low, uint32 log_id_high); +void smb_io_logon_id(char *desc, DOM_LOGON_ID *log, prs_struct *ps, int depth); +void make_owf_info(OWF_INFO *hash, uint8 data[16]); +void smb_io_owf_info(char *desc, OWF_INFO *hash, prs_struct *ps, int depth); +void smb_io_gid(char *desc, DOM_GID *gid, prs_struct *ps, int depth); +void smb_io_pol_hnd(char *desc, POLICY_HND *pol, prs_struct *ps, int depth); +void smb_io_dom_query_3(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth); +void smb_io_dom_query_5(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth); +void smb_io_dom_query(char *desc, DOM_QUERY *d_q, prs_struct *ps, int depth); +void smb_io_dom_name(char *desc, DOM_NAME *name, prs_struct *ps, int depth); + +/*The following definitions come from lib/rpc/parse/parse_net.c */ + +void net_io_neg_flags(char *desc, NEG_FLAGS *neg, prs_struct *ps, int depth); +void make_netinfo_3(NETLOGON_INFO_3 *info, uint32 flags, uint32 logon_attempts); +void net_io_netinfo_3(char *desc, NETLOGON_INFO_3 *info, prs_struct *ps, int depth); +void make_netinfo_1(NETLOGON_INFO_1 *info, uint32 flags, uint32 pdc_status); +void net_io_netinfo_1(char *desc, NETLOGON_INFO_1 *info, prs_struct *ps, int depth); +void make_netinfo_2(NETLOGON_INFO_2 *info, uint32 flags, uint32 pdc_status, + uint32 tc_status, char *trusted_dc_name); +void net_io_netinfo_2(char *desc, NETLOGON_INFO_2 *info, prs_struct *ps, int depth); +void make_q_logon_ctrl2(NET_Q_LOGON_CTRL2 *q_l, char *server_name, + uint32 function_code); +void net_io_q_logon_ctrl2(char *desc, NET_Q_LOGON_CTRL2 *q_l, prs_struct *ps, int depth); +void make_r_logon_ctrl2(NET_R_LOGON_CTRL2 *r_l, uint32 query_level, + uint32 flags, uint32 pdc_status, uint32 logon_attempts, + uint32 tc_status, char *trusted_domain_name); +void net_io_r_logon_ctrl2(char *desc, NET_R_LOGON_CTRL2 *r_l, prs_struct *ps, int depth); +void make_r_trust_dom(NET_R_TRUST_DOM_LIST *r_t, + uint32 num_doms, char *dom_name); +void net_io_r_trust_dom(char *desc, NET_R_TRUST_DOM_LIST *r_t, prs_struct *ps, int depth); +void make_q_trust_dom(NET_Q_TRUST_DOM_LIST *q_l, char *server_name, + uint32 function_code); +void net_io_q_trust_dom(char *desc, NET_Q_TRUST_DOM_LIST *q_l, prs_struct *ps, int depth); +void make_q_req_chal(NET_Q_REQ_CHAL *q_c, + char *logon_srv, char *logon_clnt, + DOM_CHAL *clnt_chal); +void net_io_q_req_chal(char *desc, NET_Q_REQ_CHAL *q_c, prs_struct *ps, int depth); +void net_io_r_req_chal(char *desc, NET_R_REQ_CHAL *r_c, prs_struct *ps, int depth); +void make_q_auth_2(NET_Q_AUTH_2 *q_a, + char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name, + DOM_CHAL *clnt_chal, uint32 clnt_flgs); +void net_io_q_auth_2(char *desc, NET_Q_AUTH_2 *q_a, prs_struct *ps, int depth); +void net_io_r_auth_2(char *desc, NET_R_AUTH_2 *r_a, prs_struct *ps, int depth); +void make_q_srv_pwset(NET_Q_SRV_PWSET *q_s, char *logon_srv, char *acct_name, + uint16 sec_chan, char *comp_name, DOM_CRED *cred, char nt_cypher[16]); +void net_io_q_srv_pwset(char *desc, NET_Q_SRV_PWSET *q_s, prs_struct *ps, int depth); +void net_io_r_srv_pwset(char *desc, NET_R_SRV_PWSET *r_s, prs_struct *ps, int depth); +void make_id_info1(NET_ID_INFO_1 *id, char *domain_name, + uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high, + char *user_name, char *wksta_name, + char sess_key[16], + unsigned char lm_cypher[16], unsigned char nt_cypher[16]); +void net_io_id_info1(char *desc, NET_ID_INFO_1 *id, prs_struct *ps, int depth); +void make_id_info2(NET_ID_INFO_2 *id, char *domain_name, + uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high, + char *user_name, char *wksta_name, + unsigned char lm_challenge[8], + unsigned char lm_chal_resp[24], + unsigned char nt_chal_resp[24]); +void net_io_id_info2(char *desc, NET_ID_INFO_2 *id, prs_struct *ps, int depth); +void make_sam_info(DOM_SAM_INFO *sam, + char *logon_srv, char *comp_name, DOM_CRED *clnt_cred, + DOM_CRED *rtn_cred, uint16 logon_level, + NET_ID_INFO_CTR *ctr, uint16 validation_level); +void net_io_id_info_ctr(char *desc, NET_ID_INFO_CTR *ctr, prs_struct *ps, int depth); +void smb_io_sam_info(char *desc, DOM_SAM_INFO *sam, prs_struct *ps, int depth); +void make_net_user_info3(NET_USER_INFO_3 *usr, + + NTTIME *logon_time, + NTTIME *logoff_time, + NTTIME *kickoff_time, + NTTIME *pass_last_set_time, + NTTIME *pass_can_change_time, + NTTIME *pass_must_change_time, + + char *user_name, + char *full_name, + char *logon_script, + char *profile_path, + char *home_dir, + char *dir_drive, + + uint16 logon_count, + uint16 bad_pw_count, + + uint32 user_id, + uint32 group_id, + uint32 num_groups, + DOM_GID *gids, + uint32 user_flgs, + + char sess_key[16], + + char *logon_srv, + char *logon_dom, + + char *dom_sid, + char *other_sids); +void net_io_user_info3(char *desc, NET_USER_INFO_3 *usr, prs_struct *ps, int depth); +void net_io_q_sam_logon(char *desc, NET_Q_SAM_LOGON *q_l, prs_struct *ps, int depth); +void net_io_r_sam_logon(char *desc, NET_R_SAM_LOGON *r_l, prs_struct *ps, int depth); +void net_io_q_sam_logoff(char *desc, NET_Q_SAM_LOGOFF *q_l, prs_struct *ps, int depth); +void net_io_r_sam_logoff(char *desc, NET_R_SAM_LOGOFF *r_l, prs_struct *ps, int depth); + +/*The following definitions come from lib/rpc/parse/parse_prs.c */ + +void prs_debug(prs_struct *ps, int depth, char *desc, char *fn_name); +void prs_init(prs_struct *ps, uint32 size, + uint8 align, uint32 margin, + BOOL io); +void prs_mem_free(prs_struct *ps); +void prs_align(prs_struct *ps); +BOOL prs_grow(prs_struct *ps); +BOOL prs_uint8(char *name, prs_struct *ps, int depth, uint8 *data8); +BOOL prs_uint16(char *name, prs_struct *ps, int depth, uint16 *data16); +BOOL prs_uint32(char *name, prs_struct *ps, int depth, uint32 *data32); +BOOL prs_uint8s(BOOL charmode, char *name, prs_struct *ps, int depth, uint8 *data8s, int len); +BOOL prs_uint16s(BOOL charmode, char *name, prs_struct *ps, int depth, uint16 *data16s, int len); +BOOL prs_uint32s(BOOL charmode, char *name, prs_struct *ps, int depth, uint32 *data32s, int len); +BOOL prs_uninotstr2(BOOL charmode, char *name, prs_struct *ps, int depth, UNINOTSTR2 *str); +BOOL prs_string2(BOOL charmode, char *name, prs_struct *ps, int depth, STRING2 *str); +BOOL prs_unistr2(BOOL charmode, char *name, prs_struct *ps, int depth, UNISTR2 *str); +BOOL prs_unistr(char *name, prs_struct *ps, int depth, UNISTR *str); +BOOL prs_string(char *name, prs_struct *ps, int depth, char *str, uint16 len); + +/*The following definitions come from lib/rpc/parse/parse_reg.c */ + +void make_reg_q_open_policy(REG_Q_OPEN_POLICY *r_q, + uint16 unknown_0, uint32 level, uint16 unknown_1); +void reg_io_q_open_policy(char *desc, REG_Q_OPEN_POLICY *r_q, prs_struct *ps, int depth); +void make_reg_r_open_policy(REG_R_OPEN_POLICY *r_r, + POLICY_HND *pol, uint32 status); +void reg_io_r_open_policy(char *desc, REG_R_OPEN_POLICY *r_r, prs_struct *ps, int depth); +void reg_io_q_close(char *desc, REG_Q_CLOSE *q_u, prs_struct *ps, int depth); +void reg_io_r_close(char *desc, REG_R_CLOSE *r_u, prs_struct *ps, int depth); +void make_reg_q_info(REG_Q_INFO *r_q, + POLICY_HND *pol, char *product_type, + NTTIME *prod_time, uint8 major_version, uint8 minor_version, + uint32 unknown); +void reg_io_q_info(char *desc, REG_Q_INFO *r_q, prs_struct *ps, int depth); +void make_reg_r_info(REG_R_INFO *r_r, + uint32 level, char *os_type, + uint32 unknown_0, uint32 unknown_1, + uint32 status); +void reg_io_r_info(char *desc, REG_R_INFO *r_r, prs_struct *ps, int depth); +void make_reg_q_open_entry(REG_Q_OPEN_ENTRY *r_q, + POLICY_HND *pol, char *name, + uint32 unknown_0, uint32 unknown_1, uint16 unknown_2); +void reg_io_q_open_entry(char *desc, REG_Q_OPEN_ENTRY *r_q, prs_struct *ps, int depth); +void make_reg_r_open_entry(REG_R_OPEN_ENTRY *r_r, + POLICY_HND *pol, uint32 status); +void reg_io_r_open_entry(char *desc, REG_R_OPEN_ENTRY *r_r, prs_struct *ps, int depth); + +/*The following definitions come from lib/rpc/parse/parse_rpc.c */ + +void make_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 flags, + uint32 call_id, int data_len, int auth_len); +void smb_io_rpc_hdr(char *desc, RPC_HDR *rpc, prs_struct *ps, int depth); +void make_rpc_iface(RPC_IFACE *ifc, char data[16], uint32 version); +void smb_io_rpc_iface(char *desc, RPC_IFACE *ifc, prs_struct *ps, int depth); +void make_rpc_addr_str(RPC_ADDR_STR *str, char *name); +void smb_io_rpc_addr_str(char *desc, RPC_ADDR_STR *str, prs_struct *ps, int depth); +void make_rpc_hdr_bba(RPC_HDR_BBA *bba, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid); +void smb_io_rpc_hdr_bba(char *desc, RPC_HDR_BBA *rpc, prs_struct *ps, int depth); +void make_rpc_hdr_rb(RPC_HDR_RB *rpc, + uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, + uint32 num_elements, uint16 context_id, uint8 num_syntaxes, + RPC_IFACE *abstract, RPC_IFACE *transfer); +void smb_io_rpc_hdr_rb(char *desc, RPC_HDR_RB *rpc, prs_struct *ps, int depth); +void make_rpc_results(RPC_RESULTS *res, + uint8 num_results, uint16 result, uint16 reason); +void smb_io_rpc_results(char *desc, RPC_RESULTS *res, prs_struct *ps, int depth); +void make_rpc_hdr_ba(RPC_HDR_BA *rpc, + uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, + char *pipe_addr, + uint8 num_results, uint16 result, uint16 reason, + RPC_IFACE *transfer); +void smb_io_rpc_hdr_ba(char *desc, RPC_HDR_BA *rpc, prs_struct *ps, int depth); +void make_rpc_hdr_req(RPC_HDR_REQ *hdr, uint32 data_len, uint16 opnum); +void smb_io_rpc_hdr_req(char *desc, RPC_HDR_REQ *rpc, prs_struct *ps, int depth); +void make_rpc_hdr_resp(RPC_HDR_RESP *hdr, uint32 data_len); +void smb_io_rpc_hdr_resp(char *desc, RPC_HDR_RESP *rpc, prs_struct *ps, int depth); +void make_rpc_auth_ntlmssp_req(RPC_AUTH_NTLMSSP_REQ *req, + fstring ntlmssp_str, uint32 ntlmssp_ver, + uint32 unknown_0, fstring myname, fstring domain); +void smb_io_rpc_auth_ntlmssp_req(char *desc, RPC_AUTH_NTLMSSP_REQ *req, prs_struct *ps, int depth); +void make_rpc_auth_ntlmssp_resp(RPC_AUTH_NTLMSSP_RESP *rsp, + uint8 auth_type, uint8 auth_level, uint8 stub_type_len, + fstring ntlmssp_str, uint32 ntlmssp_ver, + uint32 unknown_1, uint32 unknown_2, uint32 unknown_3, + uint8 data[16]); +void smb_io_rpc_auth_ntlmssp_resp(char *desc, RPC_AUTH_NTLMSSP_RESP *rsp, prs_struct *ps, int depth); + +/*The following definitions come from lib/rpc/parse/parse_samr.c */ + +void make_samr_q_close_hnd(SAMR_Q_CLOSE_HND *q_c, POLICY_HND *hnd); +void samr_io_q_close_hnd(char *desc, SAMR_Q_CLOSE_HND *q_u, prs_struct *ps, int depth); +void samr_io_r_close_hnd(char *desc, SAMR_R_CLOSE_HND *r_u, prs_struct *ps, int depth); +void make_samr_q_open_domain(SAMR_Q_OPEN_DOMAIN *q_u, + POLICY_HND *connect_pol, uint32 rid, char *sid); +void samr_io_q_open_domain(char *desc, SAMR_Q_OPEN_DOMAIN *q_u, prs_struct *ps, int depth); +void samr_io_r_open_domain(char *desc, SAMR_R_OPEN_DOMAIN *r_u, prs_struct *ps, int depth); +void make_samr_q_unknown_8(SAMR_Q_UNKNOWN_8 *q_u, + POLICY_HND *domain_pol, uint16 switch_value); +void samr_io_q_unknown_8(char *desc, SAMR_Q_UNKNOWN_8 *q_u, prs_struct *ps, int depth); +void make_samr_q_unknown_3(SAMR_Q_UNKNOWN_3 *q_u, + POLICY_HND *user_pol, uint16 switch_value); +void samr_io_q_unknown_3(char *desc, SAMR_Q_UNKNOWN_3 *q_u, prs_struct *ps, int depth); +void make_dom_sid3(DOM_SID3 *sid3, uint16 unk_0, uint16 unk_1, char *sid); +void sam_io_dom_sid3(char *desc, DOM_SID3 *sid3, prs_struct *ps, int depth); +void make_sam_sid_stuff(SAM_SID_STUFF *stf, + uint16 unknown_2, uint16 unknown_3, + uint32 unknown_4, uint16 unknown_6, uint16 unknown_7, + int num_sid3s, DOM_SID3 sid3[MAX_SAM_SIDS]); +void sam_io_sid_stuff(char *desc, SAM_SID_STUFF *stf, prs_struct *ps, int depth); +void make_samr_r_unknown_3(SAMR_R_UNKNOWN_3 *r_u, + uint16 unknown_2, uint16 unknown_3, + uint32 unknown_4, uint16 unknown_6, uint16 unknown_7, + int num_sid3s, DOM_SID3 sid3[MAX_SAM_SIDS], + uint32 status); +void samr_io_r_unknown_3(char *desc, SAMR_R_UNKNOWN_3 *r_u, prs_struct *ps, int depth); +void make_sam_str1(SAM_STR1 *sam, char *sam_acct, char *sam_name, char *sam_desc); +void sam_io_sam_str1(char *desc, SAM_STR1 *sam, uint32 acct_buf, uint32 name_buf, uint32 desc_buf, prs_struct *ps, int depth); +void make_sam_entry1(SAM_ENTRY1 *sam, uint32 user_idx, + uint32 len_sam_name, uint32 len_sam_full, uint32 len_sam_desc, + uint32 rid_user, uint16 acb_info); +void sam_io_sam_entry1(char *desc, SAM_ENTRY1 *sam, prs_struct *ps, int depth); +void make_sam_str2(SAM_STR2 *sam, char *sam_acct, char *sam_desc); +void sam_io_sam_str2(char *desc, SAM_STR2 *sam, uint32 acct_buf, uint32 desc_buf, prs_struct *ps, int depth); +void make_sam_entry2(SAM_ENTRY2 *sam, uint32 user_idx, + uint32 len_sam_name, uint32 len_sam_desc, + uint32 rid_user, uint16 acb_info); +void sam_io_sam_entry2(char *desc, SAM_ENTRY2 *sam, prs_struct *ps, int depth); +void make_sam_str3(SAM_STR3 *sam, char *grp_acct, char *grp_desc); +void sam_io_sam_str3(char *desc, SAM_STR3 *sam, uint32 acct_buf, uint32 desc_buf, prs_struct *ps, int depth); +void make_sam_entry3(SAM_ENTRY3 *sam, uint32 grp_idx, + uint32 len_grp_name, uint32 len_grp_desc, uint32 rid_grp); +void sam_io_sam_entry3(char *desc, SAM_ENTRY3 *sam, prs_struct *ps, int depth); +void make_sam_entry(SAM_ENTRY *sam, uint32 len_sam_name, uint32 rid); +void sam_io_sam_entry(char *desc, SAM_ENTRY *sam, prs_struct *ps, int depth); +void make_samr_q_enum_dom_users(SAMR_Q_ENUM_DOM_USERS *q_e, POLICY_HND *pol, + uint16 req_num_entries, uint16 unk_0, + uint16 acb_mask, uint16 unk_1, uint32 size); +void samr_io_q_enum_dom_users(char *desc, SAMR_Q_ENUM_DOM_USERS *q_e, prs_struct *ps, int depth); +void make_samr_r_enum_dom_users(SAMR_R_ENUM_DOM_USERS *r_u, + uint16 total_num_entries, uint16 unk_0, + uint32 num_sam_entries, SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES], uint32 status); +void samr_io_r_enum_dom_users(char *desc, SAMR_R_ENUM_DOM_USERS *r_u, prs_struct *ps, int depth); +void make_samr_q_enum_dom_aliases(SAMR_Q_ENUM_DOM_ALIASES *q_e, POLICY_HND *pol, uint32 size); +void samr_io_q_enum_dom_aliases(char *desc, SAMR_Q_ENUM_DOM_ALIASES *q_e, prs_struct *ps, int depth); +void make_samr_r_enum_dom_aliases(SAMR_R_ENUM_DOM_ALIASES *r_u, + uint32 num_sam_entries, SAM_USER_INFO_21 grps[MAX_SAM_ENTRIES], + uint32 status); +void samr_io_r_enum_dom_aliases(char *desc, SAMR_R_ENUM_DOM_ALIASES *r_u, prs_struct *ps, int depth); +void make_samr_q_query_dispinfo(SAMR_Q_QUERY_DISPINFO *q_e, POLICY_HND *pol, + uint16 switch_level, uint32 start_idx, uint32 size); +void samr_io_q_query_dispinfo(char *desc, SAMR_Q_QUERY_DISPINFO *q_e, prs_struct *ps, int depth); +void make_sam_info_2(SAM_INFO_2 *sam, uint32 acb_mask, + uint32 start_idx, uint32 num_sam_entries, + SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]); +void sam_io_sam_info_2(char *desc, SAM_INFO_2 *sam, prs_struct *ps, int depth); +void make_sam_info_1(SAM_INFO_1 *sam, uint32 acb_mask, + uint32 start_idx, uint32 num_sam_entries, + SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]); +void sam_io_sam_info_1(char *desc, SAM_INFO_1 *sam, prs_struct *ps, int depth); +void make_samr_r_query_dispinfo(SAMR_R_QUERY_DISPINFO *r_u, + uint16 switch_level, SAM_INFO_CTR *ctr, uint32 status); +void samr_io_r_query_dispinfo(char *desc, SAMR_R_QUERY_DISPINFO *r_u, prs_struct *ps, int depth); +void make_samr_q_enum_dom_groups(SAMR_Q_ENUM_DOM_GROUPS *q_e, POLICY_HND *pol, + uint16 switch_level, uint32 start_idx, uint32 size); +void samr_io_q_enum_dom_groups(char *desc, SAMR_Q_ENUM_DOM_GROUPS *q_e, prs_struct *ps, int depth); +void make_samr_r_enum_dom_groups(SAMR_R_ENUM_DOM_GROUPS *r_u, + uint32 start_idx, uint32 num_sam_entries, + SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES], + uint32 status); +void samr_io_r_enum_dom_groups(char *desc, SAMR_R_ENUM_DOM_GROUPS *r_u, prs_struct *ps, int depth); +void make_samr_q_query_aliasinfo(SAMR_Q_QUERY_ALIASINFO *q_e, + POLICY_HND *pol, + uint16 switch_level); +void samr_io_q_query_aliasinfo(char *desc, SAMR_Q_QUERY_ALIASINFO *q_e, prs_struct *ps, int depth); +void make_samr_r_query_aliasinfo(SAMR_R_QUERY_ALIASINFO *r_u, + uint16 switch_value, char *acct_desc, + uint32 status); +void samr_io_r_query_aliasinfo(char *desc, SAMR_R_QUERY_ALIASINFO *r_u, prs_struct *ps, int depth); +void samr_io_q_lookup_ids(char *desc, SAMR_Q_LOOKUP_IDS *q_u, prs_struct *ps, int depth); +void make_samr_r_lookup_ids(SAMR_R_LOOKUP_IDS *r_u, + uint32 num_rids, uint32 *rid, uint32 status); +void samr_io_r_lookup_ids(char *desc, SAMR_R_LOOKUP_IDS *r_u, prs_struct *ps, int depth); +void samr_io_q_lookup_names(char *desc, SAMR_Q_LOOKUP_NAMES *q_u, prs_struct *ps, int depth); +void make_samr_r_lookup_names(SAMR_R_LOOKUP_NAMES *r_u, + uint32 num_rids, uint32 *rid, uint32 status); +void samr_io_r_lookup_names(char *desc, SAMR_R_LOOKUP_NAMES *r_u, prs_struct *ps, int depth); +void make_samr_q_unknown_12(SAMR_Q_UNKNOWN_12 *q_u, + POLICY_HND *pol, uint32 rid, + uint32 num_gids, uint32 *gid); +void samr_io_q_unknown_12(char *desc, SAMR_Q_UNKNOWN_12 *q_u, prs_struct *ps, int depth); +void make_samr_r_unknown_12(SAMR_R_UNKNOWN_12 *r_u, + uint32 num_aliases, fstring *als_name, uint32 *num_als_usrs, + uint32 status); +void samr_io_r_unknown_12(char *desc, SAMR_R_UNKNOWN_12 *r_u, prs_struct *ps, int depth); +void make_samr_q_open_user(SAMR_Q_OPEN_USER *q_u, + POLICY_HND *pol, + uint32 unk_0, uint32 rid); +void samr_io_q_open_user(char *desc, SAMR_Q_OPEN_USER *q_u, prs_struct *ps, int depth); +void samr_io_r_open_user(char *desc, SAMR_R_OPEN_USER *r_u, prs_struct *ps, int depth); +void make_samr_q_query_usergroups(SAMR_Q_QUERY_USERGROUPS *q_u, + POLICY_HND *hnd); +void samr_io_q_query_usergroups(char *desc, SAMR_Q_QUERY_USERGROUPS *q_u, prs_struct *ps, int depth); +void make_samr_r_query_usergroups(SAMR_R_QUERY_USERGROUPS *r_u, + uint32 num_gids, DOM_GID *gid, uint32 status); +void samr_io_r_query_usergroups(char *desc, SAMR_R_QUERY_USERGROUPS *r_u, prs_struct *ps, int depth); +void make_samr_q_query_userinfo(SAMR_Q_QUERY_USERINFO *q_u, + POLICY_HND *hnd, uint16 switch_value); +void samr_io_q_query_userinfo(char *desc, SAMR_Q_QUERY_USERINFO *q_u, prs_struct *ps, int depth); +void sam_io_logon_hrs(char *desc, LOGON_HRS *hrs, prs_struct *ps, int depth); +void make_sam_user_info11(SAM_USER_INFO_11 *usr, + NTTIME *expiry, + char *mach_acct, + uint32 rid_user, + uint32 rid_group, + uint16 acct_ctrl); +void sam_io_user_info11(char *desc, SAM_USER_INFO_11 *usr, prs_struct *ps, int depth); +void make_sam_user_info21(SAM_USER_INFO_21 *usr, + + NTTIME *logon_time, + NTTIME *logoff_time, + NTTIME *kickoff_time, + NTTIME *pass_last_set_time, + NTTIME *pass_can_change_time, + NTTIME *pass_must_change_time, + + char *user_name, + char *full_name, + char *home_dir, + char *dir_drive, + char *logon_script, + char *profile_path, + char *description, + char *workstations, + char *unknown_str, + char *munged_dial, + + uint32 user_rid, + uint32 group_rid, + uint16 acb_info, + + uint32 unknown_3, + uint16 logon_divs, + LOGON_HRS *hrs, + uint32 unknown_5, + uint32 unknown_6); +void sam_io_user_info21(char *desc, SAM_USER_INFO_21 *usr, prs_struct *ps, int depth); +void make_samr_r_query_userinfo(SAMR_R_QUERY_USERINFO *r_u, + uint16 switch_value, void *info, uint32 status); +void samr_io_r_query_userinfo(char *desc, SAMR_R_QUERY_USERINFO *r_u, prs_struct *ps, int depth); +void make_samr_q_unknown_21(SAMR_Q_UNKNOWN_21 *q_c, + POLICY_HND *hnd, uint16 unk_1, uint16 unk_2); +void samr_io_q_unknown_21(char *desc, SAMR_Q_UNKNOWN_21 *q_u, prs_struct *ps, int depth); +void make_samr_q_unknown_13(SAMR_Q_UNKNOWN_13 *q_c, + POLICY_HND *hnd, uint16 unk_1, uint16 unk_2); +void samr_io_q_unknown_13(char *desc, SAMR_Q_UNKNOWN_13 *q_u, prs_struct *ps, int depth); +void samr_io_q_unknown_32(char *desc, SAMR_Q_UNKNOWN_32 *q_u, prs_struct *ps, int depth); +void samr_io_r_unknown_32(char *desc, SAMR_R_UNKNOWN_32 *r_u, prs_struct *ps, int depth); +void make_samr_q_connect(SAMR_Q_CONNECT *q_u, + char *srv_name, uint32 unknown_0); +void samr_io_q_connect(char *desc, SAMR_Q_CONNECT *q_u, prs_struct *ps, int depth); +void samr_io_r_connect(char *desc, SAMR_R_CONNECT *r_u, prs_struct *ps, int depth); +void make_samr_q_open_alias(SAMR_Q_OPEN_ALIAS *q_u, + uint32 unknown_0, uint32 rid); +void samr_io_q_open_alias(char *desc, SAMR_Q_OPEN_ALIAS *q_u, prs_struct *ps, int depth); +void samr_io_r_open_alias(char *desc, SAMR_R_OPEN_ALIAS *r_u, prs_struct *ps, int depth); +void make_samr_q_unknown_38(SAMR_Q_UNKNOWN_38 *q_u, char *srv_name); +void samr_io_q_unknown_38(char *desc, SAMR_Q_UNKNOWN_38 *q_u, prs_struct *ps, int depth); +void make_samr_r_unknown_38(SAMR_R_UNKNOWN_38 *r_u, + uint16 level, uint32 status); +void samr_io_r_unknown_38(char *desc, SAMR_R_UNKNOWN_38 *r_u, prs_struct *ps, int depth); +void samr_io_enc_passwd(char *desc, SAMR_ENC_PASSWD *pwd, prs_struct *ps, int depth); +void samr_io_enc_hash(char *desc, SAMR_ENC_HASH *hsh, prs_struct *ps, int depth); + +/*The following definitions come from lib/rpc/parse/parse_srv.c */ + +void make_srv_share_info1_str(SH_INFO_1_STR *sh1, char *net_name, char *remark); +void srv_io_share_info1_str(char *desc, SH_INFO_1_STR *sh1, prs_struct *ps, int depth); +void make_srv_share_info1(SH_INFO_1 *sh1, char *net_name, uint32 type, char *remark); +void srv_io_share_info1(char *desc, SH_INFO_1 *sh1, prs_struct *ps, int depth); +void srv_io_srv_share_info_1(char *desc, SRV_SHARE_INFO_1 *ctr, prs_struct *ps, int depth); +void make_srv_share_info2_str(SH_INFO_2_STR *sh2, + char *net_name, char *remark, + char *path, char *passwd); +void srv_io_share_info2_str(char *desc, SH_INFO_2_STR *sh2, prs_struct *ps, int depth); +void make_srv_share_info2(SH_INFO_2 *sh2, + char *net_name, uint32 type, char *remark, + uint32 perms, uint32 max_uses, uint32 num_uses, + char *path, char *passwd); +void srv_io_share_info2(char *desc, SH_INFO_2 *sh2, prs_struct *ps, int depth); +void srv_io_srv_share_info_2(char *desc, SRV_SHARE_INFO_2 *ctr, prs_struct *ps, int depth); +void srv_io_srv_share_ctr(char *desc, SRV_SHARE_INFO_CTR *ctr, prs_struct *ps, int depth); +void make_srv_q_net_share_enum(SRV_Q_NET_SHARE_ENUM *q_n, + char *srv_name, + uint32 share_level, SRV_SHARE_INFO_CTR *ctr, + uint32 preferred_len, + ENUM_HND *hnd); +void srv_io_q_net_share_enum(char *desc, SRV_Q_NET_SHARE_ENUM *q_n, prs_struct *ps, int depth); +void srv_io_r_net_share_enum(char *desc, SRV_R_NET_SHARE_ENUM *r_n, prs_struct *ps, int depth); +void make_srv_sess_info0_str(SESS_INFO_0_STR *ss0, char *name); +void srv_io_sess_info0_str(char *desc, SESS_INFO_0_STR *ss0, prs_struct *ps, int depth); +void make_srv_sess_info0(SESS_INFO_0 *ss0, char *name); +void srv_io_sess_info0(char *desc, SESS_INFO_0 *ss0, prs_struct *ps, int depth); +void srv_io_srv_sess_info_0(char *desc, SRV_SESS_INFO_0 *ss0, prs_struct *ps, int depth); +void make_srv_sess_info1_str(SESS_INFO_1_STR *ss1, char *name, char *user); +void srv_io_sess_info1_str(char *desc, SESS_INFO_1_STR *ss1, prs_struct *ps, int depth); +void make_srv_sess_info1(SESS_INFO_1 *ss1, + char *name, char *user, + uint32 num_opens, uint32 open_time, uint32 idle_time, + uint32 user_flags); +void srv_io_sess_info1(char *desc, SESS_INFO_1 *ss1, prs_struct *ps, int depth); +void srv_io_srv_sess_info_1(char *desc, SRV_SESS_INFO_1 *ss1, prs_struct *ps, int depth); +void srv_io_srv_sess_ctr(char *desc, SRV_SESS_INFO_CTR *ctr, prs_struct *ps, int depth); +void make_srv_q_net_sess_enum(SRV_Q_NET_SESS_ENUM *q_n, + char *srv_name, char *qual_name, + uint32 sess_level, SRV_SESS_INFO_CTR *ctr, + uint32 preferred_len, + ENUM_HND *hnd); +void srv_io_q_net_sess_enum(char *desc, SRV_Q_NET_SESS_ENUM *q_n, prs_struct *ps, int depth); +void srv_io_r_net_sess_enum(char *desc, SRV_R_NET_SESS_ENUM *r_n, prs_struct *ps, int depth); +void make_srv_conn_info0(CONN_INFO_0 *ss0, uint32 id); +void srv_io_conn_info0(char *desc, CONN_INFO_0 *ss0, prs_struct *ps, int depth); +void srv_io_srv_conn_info_0(char *desc, SRV_CONN_INFO_0 *ss0, prs_struct *ps, int depth); +void make_srv_conn_info1_str(CONN_INFO_1_STR *ss1, char *usr_name, char *net_name); +void srv_io_conn_info1_str(char *desc, CONN_INFO_1_STR *ss1, prs_struct *ps, int depth); +void make_srv_conn_info1(CONN_INFO_1 *ss1, + uint32 id, uint32 type, + uint32 num_opens, uint32 num_users, uint32 open_time, + char *usr_name, char *net_name); +void srv_io_conn_info1(char *desc, CONN_INFO_1 *ss1, prs_struct *ps, int depth); +void srv_io_srv_conn_info_1(char *desc, SRV_CONN_INFO_1 *ss1, prs_struct *ps, int depth); +void srv_io_srv_conn_ctr(char *desc, SRV_CONN_INFO_CTR *ctr, prs_struct *ps, int depth); +void make_srv_q_net_conn_enum(SRV_Q_NET_CONN_ENUM *q_n, + char *srv_name, char *qual_name, + uint32 conn_level, SRV_CONN_INFO_CTR *ctr, + uint32 preferred_len, + ENUM_HND *hnd); +void srv_io_q_net_conn_enum(char *desc, SRV_Q_NET_CONN_ENUM *q_n, prs_struct *ps, int depth); +void srv_io_r_net_conn_enum(char *desc, SRV_R_NET_CONN_ENUM *r_n, prs_struct *ps, int depth); +void make_srv_file_info3_str(FILE_INFO_3_STR *fi3, char *user_name, char *path_name); +void srv_io_file_info3_str(char *desc, FILE_INFO_3_STR *sh1, prs_struct *ps, int depth); +void make_srv_file_info3(FILE_INFO_3 *fl3, + uint32 id, uint32 perms, uint32 num_locks, + char *path_name, char *user_name); +void srv_io_file_info3(char *desc, FILE_INFO_3 *fl3, prs_struct *ps, int depth); +void srv_io_srv_file_info_3(char *desc, SRV_FILE_INFO_3 *fl3, prs_struct *ps, int depth); +void srv_io_srv_file_ctr(char *desc, SRV_FILE_INFO_CTR *ctr, prs_struct *ps, int depth); +void make_srv_q_net_file_enum(SRV_Q_NET_FILE_ENUM *q_n, + char *srv_name, char *qual_name, + uint32 file_level, SRV_FILE_INFO_CTR *ctr, + uint32 preferred_len, + ENUM_HND *hnd); +void srv_io_q_net_file_enum(char *desc, SRV_Q_NET_FILE_ENUM *q_n, prs_struct *ps, int depth); +void srv_io_r_net_file_enum(char *desc, SRV_R_NET_FILE_ENUM *r_n, prs_struct *ps, int depth); +void make_srv_info_101(SRV_INFO_101 *sv101, uint32 platform_id, char *name, + uint32 ver_major, uint32 ver_minor, + uint32 srv_type, char *comment); +void srv_io_info_101(char *desc, SRV_INFO_101 *sv101, prs_struct *ps, int depth); +void make_srv_info_102(SRV_INFO_102 *sv102, uint32 platform_id, char *name, + char *comment, uint32 ver_major, uint32 ver_minor, + uint32 srv_type, uint32 users, uint32 disc, uint32 hidden, + uint32 announce, uint32 ann_delta, uint32 licenses, + char *usr_path); +void srv_io_info_102(char *desc, SRV_INFO_102 *sv102, prs_struct *ps, int depth); +void srv_io_info_ctr(char *desc, SRV_INFO_CTR *ctr, prs_struct *ps, int depth); +void make_srv_q_net_srv_get_info(SRV_Q_NET_SRV_GET_INFO *srv, + char *server_name, uint32 switch_value); +void srv_io_q_net_srv_get_info(char *desc, SRV_Q_NET_SRV_GET_INFO *q_n, prs_struct *ps, int depth); +void make_srv_r_net_srv_get_info(SRV_R_NET_SRV_GET_INFO *srv, + uint32 switch_value, SRV_INFO_CTR *ctr, uint32 status); +void srv_io_r_net_srv_get_info(char *desc, SRV_R_NET_SRV_GET_INFO *r_n, prs_struct *ps, int depth); +void make_srv_q_net_srv_set_info(SRV_Q_NET_SRV_SET_INFO *srv, + uint32 switch_value, SRV_INFO_CTR *ctr); +void srv_io_q_net_srv_set_info(char *desc, SRV_Q_NET_SRV_SET_INFO *q_n, prs_struct *ps, int depth); +void make_srv_r_net_srv_set_info(SRV_R_NET_SRV_SET_INFO *srv, + uint32 switch_value, SRV_INFO_CTR *ctr, uint32 status); +void srv_io_r_net_srv_set_info(char *desc, SRV_R_NET_SRV_SET_INFO *r_n, prs_struct *ps, int depth); + +/*The following definitions come from lib/rpc/parse/parse_wks.c */ + +void make_wks_q_query_info(WKS_Q_QUERY_INFO *q_u, + char *server, uint16 switch_value) ; +void wks_io_q_query_info(char *desc, WKS_Q_QUERY_INFO *q_u, prs_struct *ps, int depth); +void make_wks_info_100(WKS_INFO_100 *inf, + uint32 platform_id, uint32 ver_major, uint32 ver_minor, + char *my_name, char *domain_name); +void wks_io_wks_info_100(char *desc, WKS_INFO_100 *inf, prs_struct *ps, int depth); +void make_wks_r_query_info(WKS_R_QUERY_INFO *r_u, + uint32 switch_value, WKS_INFO_100 *wks100, + int status) ; +void wks_io_r_query_info(char *desc, WKS_R_QUERY_INFO *r_u, prs_struct *ps, int depth); + +/*The following definitions come from lib/rpc/server/srv_ldap_helpers.c */ + +BOOL get_ldap_entries(SAM_USER_INFO_21 *pw_buf, + int *total_entries, int *num_entries, + int max_num_entries, + uint16 acb_mask, int switch_level); +BOOL ldap_get_user_info_21(SAM_USER_INFO_21 *id21, uint32 rid); +void ldap_helper_dummy(void); + +/*The following definitions come from lib/rpc/server/srv_lsa.c */ + +BOOL api_ntlsa_rpc(pipes_struct *p, prs_struct *data); + +/*The following definitions come from lib/rpc/server/srv_lsa_hnd.c */ + +void create_pol_hnd(POLICY_HND *hnd); +void init_lsa_policy_hnd(void); +BOOL open_lsa_policy_hnd(POLICY_HND *hnd); +int find_lsa_policy_by_hnd(POLICY_HND *hnd); +BOOL set_lsa_policy_samr_rid(POLICY_HND *hnd, uint32 rid); +BOOL set_lsa_policy_samr_pol_status(POLICY_HND *hnd, uint32 pol_status); +BOOL set_lsa_policy_samr_sid(POLICY_HND *hnd, DOM_SID *sid); +uint32 get_lsa_policy_samr_rid(POLICY_HND *hnd); +BOOL set_lsa_policy_reg_name(POLICY_HND *hnd, fstring name); +BOOL get_lsa_policy_reg_name(POLICY_HND *hnd, fstring name); +BOOL close_lsa_policy_hnd(POLICY_HND *hnd); + +/*The following definitions come from lib/rpc/server/srv_netlog.c */ + +BOOL api_netlog_rpc(pipes_struct *p, prs_struct *data); + +/*The following definitions come from lib/rpc/server/srv_pipe_hnd.c */ + +void reset_chain_pnum(void); +void set_chain_pnum(int new_pnum); +void init_rpc_pipe_hnd(void); +int open_rpc_pipe_hnd(char *pipe_name, int cnum, uint16 vuid); +int read_pipe(uint16 pnum, char *data, uint32 pos, int n); +BOOL get_rpc_pipe(int pnum, pipes_struct **p); +char *get_rpc_pipe_hnd_name(int pnum); +BOOL set_rpc_pipe_hnd_state(pipes_struct *p, uint16 device_state); +BOOL close_rpc_pipe_hnd(int pnum, int cnum); +int get_rpc_pipe_num(char *buf, int where); + +/*The following definitions come from lib/rpc/server/srv_reg.c */ + +BOOL api_reg_rpc(pipes_struct *p, prs_struct *data); + +/*The following definitions come from lib/rpc/server/srv_samr.c */ + +BOOL api_samr_rpc(pipes_struct *p, prs_struct *data); + +/*The following definitions come from lib/rpc/server/srv_srvsvc.c */ + +BOOL api_srvsvc_rpc(pipes_struct *p, prs_struct *data); + +/*The following definitions come from lib/rpc/server/srv_util.c */ + +int make_dom_gids(char *gids_str, DOM_GID *gids); +void get_domain_user_groups(char *domain_groups, char *user); +BOOL create_rpc_reply(pipes_struct *p, + uint32 data_start, uint32 data_end); +BOOL api_rpcTNP(pipes_struct *p, char *rpc_name, struct api_struct *api_rpc_cmds, + prs_struct *data); +uint32 lookup_group_name(uint32 rid, char *group_name, uint32 *type); +uint32 lookup_alias_name(uint32 rid, char *alias_name, uint32 *type); +uint32 lookup_user_name(uint32 rid, char *user_name, uint32 *type); +uint32 lookup_group_rid(char *group_name, uint32 *rid); +uint32 lookup_alias_rid(char *alias_name, uint32 *rid); +uint32 lookup_user_rid(char *user_name, uint32 *rid); +BOOL name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); +uint32 uid_to_user_rid(uint32 uid); +uint32 gid_to_group_rid(uint32 gid); + +/*The following definitions come from lib/rpc/server/srv_wkssvc.c */ + +BOOL api_wkssvc_rpc(pipes_struct *p, prs_struct *data); + +/*The following definitions come from loadparm.c */ + +char *lp_string(char *s); +char *lp_logfile(void); +char *lp_smbrun(void); +char *lp_configfile(void); +char *lp_smb_passwd_file(void); +char *lp_serverstring(void); +char *lp_printcapname(void); +char *lp_lockdir(void); +char *lp_rootdir(void); +char *lp_defaultservice(void); +char *lp_msg_command(void); +char *lp_dfree_command(void); +char *lp_hosts_equiv(void); +char *lp_auto_services(void); +char *lp_passwd_program(void); +char *lp_passwd_chat(void); +char *lp_passwordserver(void); +char *lp_name_resolve_order(void); +char *lp_workgroup(void); +char *lp_username_map(void); +char *lp_character_set(void); +char *lp_logon_script(void); +char *lp_logon_path(void); +char *lp_logon_drive(void); +char *lp_logon_home(void); +char *lp_remote_announce(void); +char *lp_remote_browse_sync(void); +char *lp_wins_server(void); +char *lp_interfaces(void); +char *lp_socket_address(void); +char *lp_nis_home_map_name(void); +char *lp_announce_version(void); +char *lp_netbios_aliases(void); +char *lp_driverfile(void); +char *lp_domain_sid(void); +char *lp_domain_other_sids(void); +char *lp_domain_groups(void); +char *lp_domain_admin_users(void); +char *lp_domain_guest_users(void); +char *lp_domain_hostsallow(void); +char *lp_domain_hostsdeny(void); +char *lp_ldap_server(void); +char *lp_ldap_suffix(void); +char *lp_ldap_filter(void); +char *lp_ldap_root(void); +char *lp_ldap_rootpasswd(void); +BOOL lp_dns_proxy(void); +BOOL lp_wins_support(void); +BOOL lp_we_are_a_wins_server(void); +BOOL lp_wins_proxy(void); +BOOL lp_local_master(void); +BOOL lp_domain_controller(void); +BOOL lp_domain_master(void); +BOOL lp_domain_logons(void); +BOOL lp_preferred_master(void); +BOOL lp_load_printers(void); +BOOL lp_use_rhosts(void); +BOOL lp_getwdcache(void); +BOOL lp_readprediction(void); +BOOL lp_readbmpx(void); +BOOL lp_readraw(void); +BOOL lp_writeraw(void); +BOOL lp_null_passwords(void); +BOOL lp_strip_dot(void); +BOOL lp_encrypted_passwords(void); +BOOL lp_update_encrypted(void); +BOOL lp_syslog_only(void); +BOOL lp_browse_list(void); +BOOL lp_unix_realname(void); +BOOL lp_nis_home_map(void); +BOOL lp_time_server(void); +BOOL lp_bind_interfaces_only(void); +BOOL lp_net_wksta_user_logon(void); +BOOL lp_unix_password_sync(void); +BOOL lp_passwd_chat_debug(void); +int lp_os_level(void); +int lp_max_ttl(void); +int lp_max_wins_ttl(void); +int lp_min_wins_ttl(void); +int lp_max_log_size(void); +int lp_mangledstack(void); +int lp_maxxmit(void); +int lp_maxmux(void); +int lp_maxpacket(void); +int lp_keepalive(void); +int lp_passwordlevel(void); +int lp_usernamelevel(void); +int lp_readsize(void); +int lp_shmem_size(void); +int lp_deadtime(void); +int lp_maxprotocol(void); +int lp_security(void); +int lp_maxdisksize(void); +int lp_lpqcachetime(void); +int lp_syslog(void); +int lp_client_code_page(void); +int lp_announce_as(void); +int lp_lm_announce(void); +int lp_lm_interval(void); +int lp_ldap_port(void); +char *lp_preexec(int ); +char *lp_postexec(int ); +char *lp_rootpreexec(int ); +char *lp_rootpostexec(int ); +char *lp_servicename(int ); +char *lp_pathname(int ); +char *lp_dontdescend(int ); +char *lp_username(int ); +char *lp_guestaccount(int ); +char *lp_invalid_users(int ); +char *lp_valid_users(int ); +char *lp_admin_users(int ); +char *lp_printcommand(int ); +char *lp_lpqcommand(int ); +char *lp_lprmcommand(int ); +char *lp_lppausecommand(int ); +char *lp_lpresumecommand(int ); +char *lp_printername(int ); +char *lp_printerdriver(int ); +char *lp_hostsallow(int ); +char *lp_hostsdeny(int ); +char *lp_magicscript(int ); +char *lp_magicoutput(int ); +char *lp_comment(int ); +char *lp_force_user(int ); +char *lp_force_group(int ); +char *lp_readlist(int ); +char *lp_writelist(int ); +char *lp_volume(int ); +char *lp_mangled_map(int ); +char *lp_veto_files(int ); +char *lp_hide_files(int ); +char *lp_veto_oplocks(int ); +char *lp_driverlocation(int ); +BOOL lp_alternate_permissions(int ); +BOOL lp_revalidate(int ); +BOOL lp_casesensitive(int ); +BOOL lp_preservecase(int ); +BOOL lp_shortpreservecase(int ); +BOOL lp_casemangle(int ); +BOOL lp_status(int ); +BOOL lp_hide_dot_files(int ); +BOOL lp_browseable(int ); +BOOL lp_readonly(int ); +BOOL lp_no_set_dir(int ); +BOOL lp_guest_ok(int ); +BOOL lp_guest_only(int ); +BOOL lp_print_ok(int ); +BOOL lp_postscript(int ); +BOOL lp_map_hidden(int ); +BOOL lp_map_archive(int ); +BOOL lp_locking(int ); +BOOL lp_strict_locking(int ); +BOOL lp_share_modes(int ); +BOOL lp_oplocks(int ); +BOOL lp_onlyuser(int ); +BOOL lp_manglednames(int ); +BOOL lp_widelinks(int ); +BOOL lp_symlinks(int ); +BOOL lp_syncalways(int ); +BOOL lp_map_system(int ); +BOOL lp_delete_readonly(int ); +BOOL lp_fake_oplocks(int ); +BOOL lp_recursive_veto_delete(int ); +BOOL lp_dos_filetimes(int ); +BOOL lp_dos_filetime_resolution(int ); +BOOL lp_fake_dir_create_times(int ); +int lp_create_mode(int ); +int lp_force_create_mode(int ); +int lp_dir_mode(int ); +int lp_force_dir_mode(int ); +int lp_max_connections(int ); +int lp_defaultcase(int ); +int lp_minprintspace(int ); +int lp_printing(int ); +char lp_magicchar(int ); +BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir); +int lp_add_service(char *pszService, int iDefaultService); +BOOL lp_add_printer(char *pszPrintername, int iDefaultService); +BOOL lp_file_list_changed(void); +void *lp_local_ptr(int snum, void *ptr); +BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue); +BOOL lp_is_default(int snum, struct parm_struct *parm); +struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters); +BOOL lp_snum_ok(int iService); +BOOL lp_loaded(void); +void lp_killunused(BOOL (*snumused)(int )); +BOOL lp_load(char *pszFname,BOOL global_only, BOOL save_defaults, BOOL add_ipc); +int lp_numservices(void); +void lp_dump(FILE *f, BOOL show_defaults); +int lp_servicenumber(char *pszServiceName); +char *volume_label(int snum); +void lp_rename_service(int snum, char *new_name); +void lp_remove_service(int snum); +void lp_copy_service(int snum, char *new_name); +int lp_default_server_announce(void); +int lp_major_announce_version(void); +int lp_minor_announce_version(void); +void lp_set_name_resolve_order(char *new_order); + +/*The following definitions come from locking.c */ + +BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset); +BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); +BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); +BOOL locking_init(int read_only); +BOOL locking_end(void); +BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, int *ptok); +BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, int token); +int get_share_modes(int cnum, int token, uint32 dev, uint32 inode, + share_mode_entry **shares); +void del_share_mode(int token, int fnum); +BOOL set_share_mode(int token, int fnum, uint16 port, uint16 op_type); +BOOL remove_share_oplock(int fnum, int token); +int share_mode_forall(void (*fn)(share_mode_entry *, char *)); +void share_status(FILE *f); + +/*The following definitions come from locking_shm.c */ + +struct share_ops *locking_shm_init(int ronly); + +/*The following definitions come from locking_slow.c */ + +struct share_ops *locking_slow_init(int ronly); + +/*The following definitions come from mangle.c */ + +BOOL is_mangled( char *s ); +BOOL is_8_3( char *fname, BOOL check_case ); +int str_checksum( char *s ); +void reset_mangled_cache( void ); +BOOL check_mangled_cache( char *s ); +void mangle_name_83( char *s ); +BOOL name_map_mangle( char *OutName, BOOL need83, int snum ); + +/*The following definitions come from md4.c */ + +void mdfour(unsigned char *out, unsigned char *in, int n); + +/*The following definitions come from mem_man/mem_man.c */ + +void *smb_mem_malloc(size_t size,char *file,int line); +char *smb_mem_strdup(char *s, char *file, int line); +int smb_mem_free(void *ptr,char *file,int line); +void smb_mem_write_info(void *ptr,FILE *outfile); +char *smb_mem_query_file(void *ptr); +int smb_mem_query_line(void *ptr); +int smb_mem_test(void *ptr); +void smb_mem_write_status(FILE *outfile); +void smb_mem_write_verbose(FILE *outfile); +void smb_mem_write_errors(FILE *outfile); +void smb_mem_set_multiplier(int multiplier); +void *smb_mem_resize(void *ptr,size_t newsize); + +/*The following definitions come from membuffer.c */ + +void mem_init(struct mem_buf *buf, int margin); +void mem_create(struct mem_buf *buf, char *data, int size, int margin, BOOL dynamic); +void mem_take(struct mem_buf *mem_to, struct mem_buf *mem_from); +BOOL mem_alloc_data(struct mem_buf *buf, int size); +BOOL mem_buf_copy(char *copy_into, struct mem_buf *buf, + uint32 offset, uint32 len); +BOOL mem_buf_init(struct mem_buf **buf, uint32 margin); +void mem_buf_free(struct mem_buf **buf); +void mem_free_chain(struct mem_buf **buf); +void mem_free_data(struct mem_buf *buf); +BOOL mem_realloc_data(struct mem_buf *buf, int new_size); +BOOL mem_grow_data(struct mem_buf **buf, BOOL io, int new_size, BOOL force_grow); +BOOL mem_find(struct mem_buf **buf, uint32 offset); +uint32 mem_buf_len(struct mem_buf *buf); +char *mem_data(struct mem_buf **buf, uint32 offset); + +/*The following definitions come from message.c */ + +int reply_sends(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_sendstrt(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_sendtxt(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_sendend(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); + +/*The following definitions come from namequery.c */ + +BOOL name_status(int fd,char *name,int name_type,BOOL recurse, + struct in_addr to_ip,char *master,char *rname, + void (*fn)(struct packet_struct *)); +struct in_addr *name_query(int fd,char *name,int name_type, BOOL bcast,BOOL recurse, + struct in_addr to_ip, int *count, void (*fn)(struct packet_struct *)); +FILE *startlmhosts(char *fname); +BOOL getlmhostsent( FILE *fp, char *name, int *name_type, struct in_addr *ipaddr); +void endlmhosts(FILE *fp); +BOOL resolve_name(char *name, struct in_addr *return_ip); + +/*The following definitions come from nmbd.c */ + +BOOL reload_services(BOOL test); +int main(int argc,char *argv[]); + +/*The following definitions come from nmbd_become_dmb.c */ + +void unbecome_domain_master(char *workgroup_name); +void add_domain_names(time_t t); + +/*The following definitions come from nmbd_become_lmb.c */ + +void insert_permanent_name_into_unicast( struct subnet_record *subrec, + struct nmb_name *nmbname, uint16 nb_type ); +void unbecome_local_master_success(struct subnet_record *subrec, + struct userdata_struct *userdata, + struct nmb_name *released_name, + struct in_addr released_ip); +void unbecome_local_master_fail(struct subnet_record *subrec, struct response_record *rrec, + struct nmb_name *fail_name); +void release_1d_name( struct subnet_record *subrec, char *workgroup_name); +void unbecome_local_master_browser(struct subnet_record *subrec, struct work_record *work); +void become_local_master_browser(struct subnet_record *subrec, struct work_record *work); +void set_workgroup_local_master_browser_name( struct work_record *work, char *newname); + +/*The following definitions come from nmbd_browserdb.c */ + +void remove_lmb_browser_entry(struct browse_cache_record *browc); +void update_browser_death_time(struct browse_cache_record *browc); +struct browse_cache_record *create_browser_in_lmb_cache(char *work_name, char *browser_name, + struct in_addr ip); +struct browse_cache_record *find_browser_in_lmb_cache( char *browser_name ); +void expire_lmb_browsers(time_t t); +void remove_workgroup_lmb_browsers(char *work_group); + +/*The following definitions come from nmbd_browsesync.c */ + +void dmb_expire_and_sync_browser_lists(time_t t); +void announce_and_sync_with_domain_master_browser( struct subnet_record *subrec, + struct work_record *work); +void collect_all_workgroup_names_from_wins_server(time_t t); + +/*The following definitions come from nmbd_elections.c */ + +void check_master_browser_exists(time_t t); +void run_elections(time_t t); +void process_election(struct subnet_record *subrec, struct packet_struct *p, char *buf); +BOOL check_elections(void); + +/*The following definitions come from nmbd_incomingdgrams.c */ + +void tell_become_backup(void); +void process_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf); +void process_workgroup_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf); +void process_local_master_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf); +void process_master_browser_announce(struct subnet_record *subrec, + struct packet_struct *p,char *buf); +void process_lm_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf); +void process_get_backup_list_request(struct subnet_record *subrec, + struct packet_struct *p,char *buf); +void process_reset_browser(struct subnet_record *subrec, + struct packet_struct *p,char *buf); +void process_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf); +void process_lm_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf); + +/*The following definitions come from nmbd_incomingrequests.c */ + +void process_name_release_request(struct subnet_record *subrec, + struct packet_struct *p); +void process_name_refresh_request(struct subnet_record *subrec, + struct packet_struct *p); +void process_name_registration_request(struct subnet_record *subrec, + struct packet_struct *p); +void process_node_status_request(struct subnet_record *subrec, struct packet_struct *p); +void process_name_query_request(struct subnet_record *subrec, struct packet_struct *p); + +/*The following definitions come from nmbd_lmhosts.c */ + +void load_lmhosts_file(char *fname); +BOOL find_name_in_lmhosts(struct nmb_name *nmbname, struct name_record **namerecp); + +/*The following definitions come from nmbd_logonnames.c */ + +void add_logon_names(void); + +/*The following definitions come from nmbd_mynames.c */ + +BOOL register_my_workgroup_and_names(void); +void release_my_names(void); +void refresh_my_names(time_t t); + +/*The following definitions come from nmbd_namelistdb.c */ + +void set_samba_nb_type(void); +BOOL ms_browser_name(char *name, int type); +void remove_name_from_namelist(struct subnet_record *subrec, + struct name_record *namerec); +struct name_record *find_name_on_subnet(struct subnet_record *subrec, + struct nmb_name *nmbname, BOOL self_only); +struct name_record *find_name_for_remote_broadcast_subnet( struct nmb_name *nmbname, + BOOL self_only); +void update_name_ttl(struct name_record *namerec, int ttl); +struct name_record *add_name_to_subnet(struct subnet_record *subrec, + char *name, int type, uint16 nb_flags, int ttl, + enum name_source source, int num_ips, struct in_addr *iplist); +void standard_success_register(struct subnet_record *subrec, + struct userdata_struct *userdata, + struct nmb_name *nmbname, uint16 nb_flags, int ttl, + struct in_addr registered_ip); +void standard_fail_register(struct subnet_record *subrec, + struct response_record *rrec, struct nmb_name *nmbname); +BOOL find_ip_in_name_record(struct name_record *namerec, struct in_addr ip); +void add_ip_to_name_record(struct name_record *namerec, struct in_addr new_ip); +void remove_ip_from_name_record( struct name_record *namerec, struct in_addr remove_ip); +void standard_success_release(struct subnet_record *subrec, + struct userdata_struct *userdata, + struct nmb_name *nmbname, struct in_addr released_ip); +void expire_names_on_subnet(struct subnet_record *subrec, time_t t); +void expire_names(time_t t); +void add_samba_names_to_subnet(struct subnet_record *subrec); +void dump_all_namelists(void); + +/*The following definitions come from nmbd_namequery.c */ + +BOOL query_name(struct subnet_record *subrec, char *name, int type, + query_name_success_function success_fn, + query_name_fail_function fail_fn, + struct userdata_struct *userdata); +BOOL query_name_from_wins_server(struct in_addr ip_to, + char *name, int type, + query_name_success_function success_fn, + query_name_fail_function fail_fn, + struct userdata_struct *userdata); + +/*The following definitions come from nmbd_nameregister.c */ + +BOOL register_name(struct subnet_record *subrec, + char *name, int type, uint16 nb_flags, + register_name_success_function success_fn, + register_name_fail_function fail_fn, + struct userdata_struct *userdata); +BOOL refresh_name(struct subnet_record *subrec, struct name_record *namerec, + refresh_name_success_function success_fn, + refresh_name_fail_function fail_fn, + struct userdata_struct *userdata); + +/*The following definitions come from nmbd_namerelease.c */ + +BOOL release_name(struct subnet_record *subrec, struct name_record *namerec, + release_name_success_function success_fn, + release_name_fail_function fail_fn, + struct userdata_struct *userdata); + +/*The following definitions come from nmbd_nodestatus.c */ + +BOOL node_status(struct subnet_record *subrec, struct nmb_name *nmbname, + struct in_addr send_ip, node_status_success_function success_fn, + node_status_fail_function fail_fn, struct userdata_struct *userdata); + +/*The following definitions come from nmbd_packets.c */ + +uint16 get_nb_flags(char *buf); +void set_nb_flags(char *buf, uint16 nb_flags); +struct response_record *queue_register_name( struct subnet_record *subrec, + response_function resp_fn, + timeout_response_function timeout_fn, + register_name_success_function success_fn, + register_name_fail_function fail_fn, + struct userdata_struct *userdata, + struct nmb_name *nmbname, + uint16 nb_flags); +struct response_record *queue_register_multihomed_name( struct subnet_record *subrec, + response_function resp_fn, + timeout_response_function timeout_fn, + register_name_success_function success_fn, + register_name_fail_function fail_fn, + struct userdata_struct *userdata, + struct nmb_name *nmbname, + uint16 nb_flags, + struct in_addr register_ip); +struct response_record *queue_release_name( struct subnet_record *subrec, + response_function resp_fn, + timeout_response_function timeout_fn, + release_name_success_function success_fn, + release_name_fail_function fail_fn, + struct userdata_struct *userdata, + struct nmb_name *nmbname, + uint16 nb_flags, + struct in_addr release_ip); +struct response_record *queue_refresh_name( struct subnet_record *subrec, + response_function resp_fn, + timeout_response_function timeout_fn, + refresh_name_success_function success_fn, + refresh_name_fail_function fail_fn, + struct userdata_struct *userdata, + struct name_record *namerec, + struct in_addr refresh_ip); +struct response_record *queue_query_name( struct subnet_record *subrec, + response_function resp_fn, + timeout_response_function timeout_fn, + query_name_success_function success_fn, + query_name_fail_function fail_fn, + struct userdata_struct *userdata, + struct nmb_name *nmbname); +struct response_record *queue_query_name_from_wins_server( struct in_addr to_ip, + response_function resp_fn, + timeout_response_function timeout_fn, + query_name_success_function success_fn, + query_name_fail_function fail_fn, + struct userdata_struct *userdata, + struct nmb_name *nmbname); +struct response_record *queue_node_status( struct subnet_record *subrec, + response_function resp_fn, + timeout_response_function timeout_fn, + node_status_success_function success_fn, + node_status_fail_function fail_fn, + struct userdata_struct *userdata, + struct nmb_name *nmbname, + struct in_addr send_ip); +void reply_netbios_packet(struct packet_struct *orig_packet, + int rcode, enum netbios_reply_type_code rcv_code, int opcode, + int ttl, char *data,int len); +void queue_packet(struct packet_struct *packet); +void process_browse_packet(struct packet_struct *p, char *buf,int len); +void process_lanman_packet(struct packet_struct *p, char *buf,int len); +BOOL validate_nmb_response_packet( struct nmb_packet *nmb ); +BOOL validate_nmb_packet( struct nmb_packet *nmb ); +void run_packet_queue(void); +void retransmit_or_expire_response_records(time_t t); +BOOL listen_for_packets(BOOL run_election); +BOOL send_mailslot(BOOL unique, char *mailslot,char *buf,int len, + char *srcname, int src_type, + char *dstname, int dest_type, + struct in_addr dest_ip,struct in_addr src_ip); + +/*The following definitions come from nmbd_processlogon.c */ + +void process_logon_packet(struct packet_struct *p,char *buf,int len, + char *mailslot); + +/*The following definitions come from nmbd_responserecordsdb.c */ + +void add_response_record(struct subnet_record *subrec, + struct response_record *rrec); +void remove_response_record(struct subnet_record *subrec, + struct response_record *rrec); +struct response_record *make_response_record( struct subnet_record *subrec, + struct packet_struct *p, + response_function resp_fn, + timeout_response_function timeout_fn, + success_function success_fn, + fail_function fail_fn, + struct userdata_struct *userdata); +struct response_record *find_response_record(struct subnet_record **ppsubrec, + uint16 id); +BOOL is_refresh_already_queued(struct subnet_record *subrec, struct name_record *namerec); + +/*The following definitions come from nmbd_sendannounce.c */ + +void send_browser_reset(int reset_type, char *to_name, int to_type, struct in_addr to_ip); +void broadcast_announce_request(struct subnet_record *subrec, struct work_record *work); +void announce_my_server_names(time_t t); +void announce_my_lm_server_names(time_t t); +void reset_announce_timer(void); +void announce_myself_to_domain_master_browser(time_t t); +void announce_my_servers_removed(void); +void announce_remote(time_t t); +void browse_sync_remote(time_t t); + +/*The following definitions come from nmbd_serverlistdb.c */ + +void remove_all_servers(struct work_record *work); +struct server_record *find_server_in_workgroup(struct work_record *work, char *name); +void remove_server_from_workgroup(struct work_record *work, struct server_record *servrec); +struct server_record *create_server_on_workgroup(struct work_record *work, + char *name,int servertype, + int ttl,char *comment); +void update_server_ttl(struct server_record *servrec, int ttl); +void expire_servers(struct work_record *work, time_t t); +void write_browse_list(time_t t, BOOL force_write); + +/*The following definitions come from nmbd_subnetdb.c */ + +BOOL create_subnets(void); +BOOL we_are_a_wins_client(void); +struct subnet_record *get_next_subnet_maybe_unicast(struct subnet_record *subrec); +struct subnet_record *get_next_subnet_maybe_unicast_or_wins_server(struct subnet_record *subrec); + +/*The following definitions come from nmbd_winsproxy.c */ + +void make_wins_proxy_name_query_request( struct subnet_record *subrec, + struct packet_struct *incoming_packet, + struct nmb_name *question_name); + +/*The following definitions come from nmbd_winsserver.c */ + +BOOL packet_is_for_wins_server(struct packet_struct *packet); +BOOL initialise_wins(void); +void wins_process_name_refresh_request(struct subnet_record *subrec, + struct packet_struct *p); +void wins_process_name_registration_request(struct subnet_record *subrec, + struct packet_struct *p); +void wins_process_multihomed_name_registration_request( struct subnet_record *subrec, + struct packet_struct *p); +void send_wins_name_query_response(int rcode, struct packet_struct *p, + struct name_record *namerec); +void wins_process_name_query_request(struct subnet_record *subrec, + struct packet_struct *p); +void wins_process_name_release_request(struct subnet_record *subrec, + struct packet_struct *p); +void initiate_wins_processing(time_t t); +void wins_write_database(void); + +/*The following definitions come from nmbd_workgroupdb.c */ + +struct work_record *find_workgroup_on_subnet(struct subnet_record *subrec, + fstring name); +struct work_record *create_workgroup_on_subnet(struct subnet_record *subrec, + fstring name, int ttl); +void update_workgroup_ttl(struct work_record *work, int ttl); +void initiate_myworkgroup_startup(struct subnet_record *subrec, struct work_record *work); +void dump_workgroups(BOOL force_write); +void expire_workgroups_and_servers(time_t t); + +/*The following definitions come from nmblib.c */ + +char *lookup_opcode_name( int opcode ); +void debug_nmb_packet(struct packet_struct *p); +char *namestr(struct nmb_name *n); +struct packet_struct *copy_packet(struct packet_struct *packet); +void free_packet(struct packet_struct *packet); +struct packet_struct *read_packet(int fd,enum packet_type packet_type); +void make_nmb_name(struct nmb_name *n,char *name,int type,char *this_scope); +BOOL nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2); +BOOL send_packet(struct packet_struct *p); +struct packet_struct *receive_packet(int fd,enum packet_type type,int t); + +/*The following definitions come from nterr.c */ + +char *get_nt_error_msg(uint32 nt_code); + +/*The following definitions come from params.c */ + +BOOL pm_process( char *FileName, + BOOL (*sfunc)(char *), + BOOL (*pfunc)(char *, char *) ); + +/*The following definitions come from passdb.c */ + +struct smb_passwd *getsampwnam(char *name); +struct smb_passwd *getsampwuid(unsigned int uid); +void *startsampwent(BOOL update); +void endsampwent(void *vp); +struct smb_passwd *getsampwent(void *vp); +unsigned long getsampwpos(void *vp); +BOOL setsampwpos(void *vp, unsigned long tok); +BOOL add_sampwd_entry(struct smb_passwd *newpwd); +BOOL mod_sampwd_entry(struct smb_passwd* pwd, BOOL override); + +/*The following definitions come from password.c */ + +void generate_next_challenge(char *challenge); +BOOL set_challenge(char *challenge); +BOOL last_challenge(unsigned char *challenge); +user_struct *get_valid_user_struct(uint16 vuid); +void invalidate_vuid(uint16 vuid); +char *validated_username(uint16 vuid); +int setup_groups(char *user, int uid, int gid, int *p_ngroups, + int **p_igroups, gid_t **p_groups, + int **p_attrs); +uint16 register_vuid(int uid,int gid, char *unix_name, char *requested_name, BOOL guest); +void add_session_user(char *user); +BOOL update_smbpassword_file( char *user, fstring password); +void dfs_unlogin(void); +BOOL password_check(char *password); +BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8); +BOOL smb_password_ok(struct smb_passwd *smb_pass, + uchar lm_pass[24], uchar nt_pass[24]); +BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd); +BOOL user_ok(char *user,int snum); +BOOL authorise_login(int snum,char *user,char *password, int pwlen, + BOOL *guest,BOOL *force,uint16 vuid); +BOOL check_hosts_equiv(char *user); +struct cli_state *server_client(void); +struct cli_state *server_cryptkey(void); +BOOL server_validate(char *user, char *domain, + char *pass, int passlen, + char *ntpass, int ntpasslen); +BOOL domain_client_validate( char *user, char *domain, + char *smb_apasswd, int smb_apasslen, + char *smb_ntpasswd, int smb_ntpasslen); + +/*The following definitions come from pcap.c */ + +BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); +void pcap_printer_fn(void (*fn)(char *, char *)); + +/*The following definitions come from pidfile.c */ + +void pidfile_create(char *name); +int pidfile_pid(char *name); + +/*The following definitions come from pipes.c */ + +int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_pipe_read_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_pipe_close(char *inbuf,char *outbuf); + +/*The following definitions come from predict.c */ + +int read_predict(int fd,int offset,char *buf,char **ptr,int num); +void do_read_prediction(void); +void invalidate_read_prediction(int fd); + +/*The following definitions come from print_svid.c */ + +void sysv_printer_fn(void (*fn)(char *, char *)); +int sysv_printername_ok(char *name); + +/*The following definitions come from printing.c */ + +void lpq_reset(int snum); +void print_file(int fnum); +int get_printqueue(int snum,int cnum,print_queue_struct **queue, + print_status_struct *status); +void del_printqueue(int cnum,int snum,int jobid); +void status_printjob(int cnum,int snum,int jobid,int status); +int printjob_encode(int snum, int job); +void printjob_decode(int jobid, int *snum, int *job); + +/*The following definitions come from quotas.c */ + +BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); +BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); +BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); +BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); +BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); +BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); + +/*The following definitions come from replace.c */ + +char *Strstr(char *s, char *p); +time_t Mktime(struct tm *t); +int InNetGr(char *group,char *host,char *user,char *dom); +void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line); + +/*The following definitions come from reply.c */ + +int reply_special(char *inbuf,char *outbuf); +int reply_tcon(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_unknown(char *inbuf,char *outbuf); +int reply_ioctl(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_chkpth(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_getatr(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_setatr(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_dskattr(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_search(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_fclose(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_open(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_open_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_ulogoffX(char *inbuf,char *outbuf,int length,int bufsize); +int reply_mknew(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_ctemp(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_unlink(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_readbraw(char *inbuf, char *outbuf, int dum_size, int dum_buffsize); +int reply_lockread(char *inbuf,char *outbuf, int dum_size, int dum_buffsiz); +int reply_read(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_read_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_writebraw(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_writeunlock(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_write(char *inbuf,char *outbuf,int dum_size,int dum_buffsize); +int reply_write_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_lseek(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_flush(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_exit(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_close(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_writeclose(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_lock(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_unlock(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_tdis(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_echo(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_printopen(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_printclose(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_printqueue(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_printwrite(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_mkdir(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_rmdir(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_mv(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_copy(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_setdir(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_lockingX(char *inbuf,char *outbuf,int length,int bufsize); +int reply_readbmpx(char *inbuf,char *outbuf,int length,int bufsize); +int reply_writebmpx(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_writebs(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_setattrE(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_getattrE(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); + +/*The following definitions come from server.c */ + +void *dflt_sig(void); +void killkids(void); +mode_t unix_mode(int cnum,int dosmode); +int dos_mode(int cnum,char *path,struct stat *sbuf); +int dos_chmod(int cnum,char *fname,int dosmode,struct stat *st); +int file_utime(int cnum, char *fname, struct utimbuf *times); +BOOL set_filetime(int cnum, char *fname, time_t mtime); +BOOL unix_convert(char *name,int cnum,pstring saved_last_component, BOOL *bad_path); +int disk_free(char *path,int *bsize,int *dfree,int *dsize); +int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); +BOOL check_name(char *name,int cnum); +void sync_file(int fnum); +void close_file(int fnum, BOOL normal_close); +BOOL check_file_sharing(int cnum,char *fname, BOOL rename_op); +int check_share_mode( share_mode_entry *share, int deny_mode, char *fname, + BOOL fcbopen, int *flags); +void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun, + int mode,int oplock_request, int *Access,int *action); +int seek_file(int fnum,uint32 pos); +int read_file(int fnum,char *data,uint32 pos,int n); +int write_file(int fnum,char *data,int n); +BOOL become_service(int cnum,BOOL do_chdir); +int find_service(char *service); +int cached_error_packet(char *inbuf,char *outbuf,int fnum,int line); +int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line); +int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int line); +BOOL oplock_break(uint32 dev, uint32 inode, struct timeval *tval); +BOOL request_oplock_break(share_mode_entry *share_entry, + uint32 dev, uint32 inode); +BOOL receive_next_smb(int smbfd, int oplockfd, char *inbuf, int bufsize, int timeout); +BOOL snum_used(int snum); +BOOL reload_services(BOOL test); +int make_connection(char *service,char *user,char *password, int pwlen, char *dev,uint16 vuid); +int find_free_file(void ); +int reply_corep(char *outbuf); +int reply_coreplus(char *outbuf); +int reply_lanman1(char *outbuf); +int reply_lanman2(char *outbuf); +int reply_nt1(char *outbuf); +void close_cnum(int cnum, uint16 vuid); +void exit_server(char *reason); +void standard_sub(int cnum,char *str); +char *smb_fn_name(int type); +int chain_reply(char *inbuf,char *outbuf,int size,int bufsize); +int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); + +/*The following definitions come from shmem.c */ + +struct shmem_ops *smb_shm_open(int ronly); + +/*The following definitions come from shmem_sysv.c */ + +struct shmem_ops *sysv_shm_open(int ronly); + +/*The following definitions come from smbdes.c */ + +void E_P16(unsigned char *p14,unsigned char *p16); +void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24); +void D_P16(unsigned char *p14, unsigned char *in, unsigned char *out); +void E_old_pw_hash( unsigned char *p14, unsigned char *in, unsigned char *out); +void cred_hash1(unsigned char *out,unsigned char *in,unsigned char *key); +void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key); +void cred_hash3(unsigned char *out,unsigned char *in,unsigned char *key, int forw); +void SamOEMhash( unsigned char *data, unsigned char *key, int val); + +/*The following definitions come from smbencrypt.c */ + +void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); +void E_md4hash(uchar *passwd, uchar *p16); +void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); +void nt_lm_owf_gen(char *pwd, char *nt_p16, char *p16); + +/*The following definitions come from smberr.c */ + +char *smb_errstr(char *inbuf); + +/*The following definitions come from smbpass.c */ + +void *startsmbpwent(BOOL update); +void endsmbpwent(void *vp); +struct smb_passwd *getsmbpwent(void *vp); +unsigned long getsmbpwpos(void *vp); +BOOL setsmbpwpos(void *vp, unsigned long tok); +struct smb_passwd *getsmbpwnam(char *name); +struct smb_passwd *getsmbpwuid(unsigned int uid); +char *encode_acct_ctrl(uint16 acct_ctrl); +BOOL add_smbpwd_entry(struct smb_passwd *newpwd); +BOOL mod_smbpwd_entry(struct smb_passwd* pwd, BOOL override); +BOOL machine_password_lock( char *domain, char *name, BOOL update); +BOOL machine_password_unlock(void); +BOOL machine_password_delete( char *domain, char *name ); +BOOL get_machine_account_password( unsigned char *ret_pwd, time_t *pass_last_set_time); +BOOL set_machine_account_password( unsigned char *md4_new_pwd); + +/*The following definitions come from status.c */ + +void Ucrit_addUsername(pstring username); +unsigned int Ucrit_checkUsername(pstring username); +void Ucrit_addPid(int pid); +unsigned int Ucrit_checkPid(int pid); + +/*The following definitions come from system.c */ + +int sys_select(fd_set *fds,struct timeval *tval); +int sys_select(fd_set *fds,struct timeval *tval); +int sys_unlink(char *fname); +int sys_open(char *fname,int flags,int mode); +DIR *sys_opendir(char *dname); +int sys_stat(char *fname,struct stat *sbuf); +int sys_waitpid(pid_t pid,int *status,int options); +int sys_lstat(char *fname,struct stat *sbuf); +int sys_mkdir(char *dname,int mode); +int sys_rmdir(char *dname); +int sys_chdir(char *dname); +int sys_utime(char *fname,struct utimbuf *times); +int sys_rename(char *from, char *to); +int sys_chmod(char *fname,int mode); +char *sys_getwd(char *s); +int sys_chown(char *fname,int uid,int gid); +int sys_chroot(char *dname); +struct hostent *sys_gethostbyname(char *name); + +/*The following definitions come from time.c */ + +void GetTimeOfDay(struct timeval *tval); +void TimeInit(void); +int TimeDiff(time_t t); +struct tm *LocalTime(time_t *t); +time_t interpret_long_date(char *p); +void put_long_date(char *p,time_t t); +BOOL null_mtime(time_t mtime); +void put_dos_date(char *buf,int offset,time_t unixdate); +void put_dos_date2(char *buf,int offset,time_t unixdate); +void put_dos_date3(char *buf,int offset,time_t unixdate); +time_t make_unix_date(void *date_ptr); +time_t make_unix_date2(void *date_ptr); +time_t make_unix_date3(void *date_ptr); +char *http_timestring(time_t t); +char *timestring(void ); +time_t get_create_time(struct stat *st,BOOL fake_dirs); + +/*The following definitions come from trans2.c */ + +int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize); +int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize); +int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize); +int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize); + +/*The following definitions come from ufc.c */ + +char *ufc_crypt(char *key,char *salt); + +/*The following definitions come from uid.c */ + +void init_uid(void); +BOOL become_guest(void); +BOOL become_user(connection_struct *conn, int cnum, uint16 vuid); +BOOL unbecome_user(void ); +int smbrun(char *cmd,char *outfile,BOOL shared); +void become_root(BOOL save_dir) ; +void unbecome_root(BOOL restore_dir); + +/*The following definitions come from username.c */ + +char *get_home_dir(char *user); +void map_username(char *user); +struct passwd *Get_Pwnam(char *user,BOOL allow_change); +BOOL user_in_list(char *user,char *list); + +/*The following definitions come from util.c */ + +int sig_usr2(void); +int sig_usr1(void); +void setup_logging(char *pname,BOOL interactive); +void reopen_logs(void); +char *tmpdir(void); +BOOL is_a_socket(int fd); +BOOL next_token(char **ptr,char *buff,char *sep); +char **toktocliplist(int *ctok, char *sep); +void *MemMove(void *dest,void *src,int size); +void array_promote(char *array,int elsize,int element); +void set_socket_options(int fd, char *options); +void close_sockets(void ); +BOOL in_group(gid_t group, int current_gid, int ngroups, int *groups); +char *StrCpy(char *dest,char *src); +char *StrnCpy(char *dest,char *src,int n); +void putip(void *dest,void *src); +int name_mangle( char *In, char *Out, char name_type ); +BOOL file_exist(char *fname,struct stat *sbuf); +time_t file_modtime(char *fname); +BOOL directory_exist(char *dname,struct stat *st); +uint32 file_size(char *file_name); +char *attrib_string(int mode); +int StrCaseCmp(char *s, char *t); +int StrnCaseCmp(char *s, char *t, int n); +BOOL strequal(char *s1, char *s2); +BOOL strnequal(char *s1,char *s2,int n); +BOOL strcsequal(char *s1,char *s2); +void strlower(char *s); +void strupper(char *s); +void strnorm(char *s); +BOOL strisnormal(char *s); +void string_replace(char *s,char oldc,char newc); +void unix_format(char *fname); +void dos_format(char *fname); +void show_msg(char *buf); +int smb_len(char *buf); +void _smb_setlen(char *buf,int len); +void smb_setlen(char *buf,int len); +int set_message(char *buf,int num_words,int num_bytes,BOOL zero); +int smb_numwords(char *buf); +int smb_buflen(char *buf); +int smb_buf_ofs(char *buf); +char *smb_buf(char *buf); +int smb_offset(char *p,char *buf); +char *skip_string(char *buf,int n); +BOOL trim_string(char *s,char *front,char *back); +void dos_clean_name(char *s); +void unix_clean_name(char *s); +int ChDir(char *path); +char *GetWd(char *str); +BOOL reduce_name(char *s,char *dir,BOOL widelinks); +void expand_mask(char *Mask,BOOL doext); +BOOL strhasupper(char *s); +BOOL strhaslower(char *s); +int count_chars(char *s,char c); +void make_dir_struct(char *buf,char *mask,char *fname,unsigned int size,int mode,time_t date); +void close_low_fds(void); +int set_blocking(int fd, BOOL set); +int write_socket(int fd,char *buf,int len); +int read_udp_socket(int fd,char *buf,int len); +int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out); +int read_max_udp(int fd,char *buffer,int bufsize,int maxtime); +int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew); +BOOL send_keepalive(int client); +int read_data(int fd,char *buffer,int N); +int write_data(int fd,char *buffer,int N); +int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align); +int read_smb_length(int fd,char *inbuf,int timeout); +BOOL receive_smb(int fd,char *buffer, int timeout); +BOOL client_receive_smb(int fd,char *buffer, int timeout); +BOOL receive_local_message(int fd, char *buffer, int buffer_len, int timeout); +BOOL push_smb_message(char *buf, int msg_len); +BOOL receive_message_or_smb(int smbfd, int oplock_fd, + char *buffer, int buffer_len, + int timeout, BOOL *got_smb); +BOOL send_smb(int fd,char *buffer); +char *name_ptr(char *buf,int ofs); +int name_extract(char *buf,int ofs,char *name); +int name_len( char *s ); +BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type); +void msleep(int t); +BOOL in_list(char *s,char *list,BOOL casesensitive); +BOOL string_init(char **dest,char *src); +void string_free(char **s); +BOOL string_set(char **dest,char *src); +BOOL string_sub(char *s,char *pattern,char *insert); +BOOL do_match(char *str, char *regexp, int case_sig); +BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2); +void become_daemon(void); +BOOL yesno(char *p); +char *fgets_slash(char *s2,int maxlen,FILE *f); +int set_filelen(int fd, long len); +int byte_checksum(char *buf,int len); +char *dirname_dos(char *path,char *buf); +void *Realloc(void *p,int size); +void Abort(void ); +BOOL get_myname(char *my_name,struct in_addr *ip); +BOOL ip_equal(struct in_addr ip1,struct in_addr ip2); +int open_socket_in(int type, int port, int dlevel,uint32 socket_addr); +int open_socket_out(int type, struct in_addr *addr, int port ,int timeout); +int interpret_protocol(char *str,int def); +int interpret_security(char *str,int def); +uint32 interpret_addr(char *str); +struct in_addr *interpret_addr2(char *str); +BOOL zero_ip(struct in_addr ip); +void reset_globals_after_fork(void); +char *client_name(int fd); +char *client_addr(int fd); +char *automount_server(char *user_name); +char *automount_path(char *user_name); +void standard_sub_basic(char *str); +BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask); +int PutUniCode(char *dst,char *src); +struct hostent *Get_Hostbyname(char *name); +BOOL process_exists(int pid); +char *uidtoname(int uid); +char *gidtoname(int gid); +void BlockSignals(BOOL block,int signum); +void ajt_panic(void); +char *readdirname(void *p); +BOOL is_in_path(char *name, name_compare_entry *namelist); +void set_namearray(name_compare_entry **ppname_array, char *namelist); +void free_namearray(name_compare_entry *name_array); +BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); +int file_lock(char *name,int timeout); +void file_unlock(int fd); +BOOL is_myname(char *s); +void set_remote_arch(enum remote_arch_types type); +enum remote_arch_types get_remote_arch(void); +char *skip_unicode_string(char *buf,int n); +char *unistrn2(uint16 *buf, int len); +char *unistr2(uint16 *buf); +int struni2(uint16 *p, char *buf); +char *unistr(char *buf); +int unistrncpy(char *dst, char *src, int len); +int unistrcpy(char *dst, char *src); +void fstrcpy(char *dest, char *src); +void pstrcpy(char *dest, char *src); +char *align4(char *q, char *base); +char *align2(char *q, char *base); +char *align_offset(char *q, char *base, int align_offset_len); +void print_asc(int level, unsigned char *buf,int len); +void dump_data(int level,char *buf1,int len); +char *tab_depth(int depth); +char *dom_sid_to_string(DOM_SID *sid); +int gethexpwd(char *p, char *pwd); + +/*The following definitions come from web/cgi.c */ + +void cgi_load_variables(FILE *f1); +char *cgi_variable(char *name); +char *cgi_vnum(int i, char **name); +int cgi_boolean(char *name, int def); +char *quotedup(char *s); +char *urlquote(char *s); +char *quotequotes(char *s); +void quote_spaces(char *buf); +void cgi_setup(char *rootdir, int auth_required); +char *cgi_baseurl(void); +char *cgi_rooturl(void); +char *cgi_pathinfo(void); +char *cgi_remote_host(void); +char *cgi_remote_addr(void); +BOOL cgi_waspost(void); + +/*The following definitions come from web/diagnose.c */ + +BOOL nmbd_running(void); +BOOL smbd_running(void); + +/*The following definitions come from web/startstop.c */ + +void start_smbd(void); +void start_nmbd(void); +void stop_smbd(void); +void stop_nmbd(void); +void kill_pid(int pid); + +/*The following definitions come from web/statuspage.c */ + +void status_page(void); + +/*The following definitions come from web/swat.c */ + +int main(int argc, char *argv[]); -- cgit From 9f57f01b144b030274cc5d116b864b3c27f251ef Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 8 May 1998 16:59:30 +0000 Subject: clitar.c: #ifdef'ed out all the bits that were giving 'defined but not used' messages. nttrans.c: More updates. smb.h: Removed stuff that didn't belong in the smb_passwd struct. Persuaded Luke to use a new structure. web/swat.c: Fixed gcc complaints about shadowing global 'string'. Jeremy. (This used to be commit 61c1dbb9785ed1e6fe40f93c7cc65024884df6f5) --- source3/include/smb.h | 45 ++++++--------------------------------------- 1 file changed, 6 insertions(+), 39 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 542545147b..23335e190a 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -272,45 +272,14 @@ typedef struct nttime_info #define ACB_PWNOEXP 0x0200 /* 1 = User password does not expire */ #define ACB_AUTOLOCK 0x0400 /* 1 = Account auto locked */ -#define MAX_HOURS_LEN 32 - struct smb_passwd { - time_t logon_time; /* logon time */ - time_t logoff_time; /* logoff time */ - time_t kickoff_time; /* kickoff time */ - time_t pass_last_set_time; /* password last set time */ - time_t pass_can_change_time; /* password can change time */ - time_t pass_must_change_time; /* password must change time */ - - char *smb_name; /* username unicode string */ - char *full_name; /* user's full name unicode string */ - char *home_dir; /* home directory unicode string */ - char *dir_drive; /* home directory drive unicode string */ - char *logon_script; /* logon script unicode string */ - char *profile_path; /* profile path unicode string */ - char *acct_desc ; /* user description unicode string */ - char *workstations; /* login from workstations unicode string */ - char *unknown_str ; /* don't know what this is, yet. */ - char *munged_dial ; /* munged path name and dial-back tel number */ - - int smb_userid; /* this is actually the unix uid_t */ - int smb_grpid; /* this is actually the unix gid_t */ - uint32 user_rid; /* Primary User ID */ - uint32 group_rid; /* Primary Group ID */ - - unsigned char *smb_passwd; /* Null if no password */ - unsigned char *smb_nt_passwd; /* Null if no password */ - - uint16 acct_ctrl; /* account info (ACB_xxxx bit-mask) */ - uint32 unknown_3; /* 0x00ff ffff */ - - uint16 logon_divs; /* 168 - number of hours in a week */ - uint32 hours_len; /* normally 21 bytes */ - uint8 hours[MAX_HOURS_LEN]; - - uint32 unknown_5; /* 0x0002 0000 */ - uint32 unknown_6; /* 0x0000 04ec */ + char *smb_name; /* username */ + int smb_userid; /* this is actually the unix uid_t */ + unsigned char *smb_passwd; /* Null if no password */ + unsigned char *smb_nt_passwd; /* Null if no password */ + uint16 acct_ctrl; /* account info (ACB_xxxx bit-mask) */ + time_t pass_last_set_time; /* password last set time */ }; @@ -324,7 +293,6 @@ typedef struct chal_info typedef struct time_info { uint32 time; - } UTIME; /* DOM_CREDs - timestamped client or server credentials */ @@ -332,7 +300,6 @@ typedef struct cred_info { DOM_CHAL challenge; /* credentials */ UTIME timestamp; /* credential time-stamp */ - } DOM_CRED; struct cli_state { -- cgit From 721814dd3e10a9f7ae3e6cd26bf5224f3fdcbd23 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 8 May 1998 17:53:17 +0000 Subject: added sam_passwd structure: don't want smb_passwd to be "polluted". (This used to be commit d42dd371fa2ab690bf4261a735f03a7380479ebe) --- source3/include/smb.h | 56 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 50 insertions(+), 6 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 23335e190a..d8fe5a84f7 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -251,6 +251,7 @@ typedef fstring string; #define PIPE_LSASS "\\PIPE\\lsass" #define PIPE_LSARPC "\\PIPE\\lsarpc" + /* 64 bit time (100usec) since ????? - cifs6.txt, section 3.5, page 30 */ typedef struct nttime_info { @@ -272,14 +273,57 @@ typedef struct nttime_info #define ACB_PWNOEXP 0x0200 /* 1 = User password does not expire */ #define ACB_AUTOLOCK 0x0400 /* 1 = Account auto locked */ +#define MAX_HOURS_LEN 32 + +struct sam_passwd +{ + time_t logon_time; /* logon time */ + time_t logoff_time; /* logoff time */ + time_t kickoff_time; /* kickoff time */ + time_t pass_last_set_time; /* password last set time */ + time_t pass_can_change_time; /* password can change time */ + time_t pass_must_change_time; /* password must change time */ + + char *smb_name; /* username string */ + char *full_name; /* user's full name string */ + char *home_dir; /* home directory string */ + char *dir_drive; /* home directory drive string */ + char *logon_script; /* logon script string */ + char *profile_path; /* profile path string */ + char *acct_desc ; /* user description string */ + char *workstations; /* login from workstations string */ + char *unknown_str ; /* don't know what this is, yet. */ + char *munged_dial ; /* munged path name and dial-back tel number */ + + int smb_userid; /* this is actually the unix uid_t */ + int smb_grpid; /* this is actually the unix gid_t */ + uint32 user_rid; /* Primary User ID */ + uint32 group_rid; /* Primary Group ID */ + + unsigned char *smb_passwd; /* Null if no password */ + unsigned char *smb_nt_passwd; /* Null if no password */ + + uint16 acct_ctrl; /* account info (ACB_xxxx bit-mask) */ + uint32 unknown_3; /* 0x00ff ffff */ + + uint16 logon_divs; /* 168 - number of hours in a week */ + uint32 hours_len; /* normally 21 bytes */ + uint8 hours[MAX_HOURS_LEN]; + + uint32 unknown_5; /* 0x0002 0000 */ + uint32 unknown_6; /* 0x0000 04ec */ +}; + struct smb_passwd { - char *smb_name; /* username */ - int smb_userid; /* this is actually the unix uid_t */ - unsigned char *smb_passwd; /* Null if no password */ - unsigned char *smb_nt_passwd; /* Null if no password */ - uint16 acct_ctrl; /* account info (ACB_xxxx bit-mask) */ - time_t pass_last_set_time; /* password last set time */ + int smb_userid; /* this is actually the unix uid_t */ + char *smb_name; /* username string */ + + unsigned char *smb_passwd; /* Null if no password */ + unsigned char *smb_nt_passwd; /* Null if no password */ + + uint16 acct_ctrl; /* account info (ACB_xxxx bit-mask) */ + time_t pass_last_set_time; /* password last set time */ }; -- cgit From 3dfc0c847240ac7e12c39f4ed9c31a888949ade1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 11 May 1998 06:38:36 +0000 Subject: changed to use slprintf() instead of sprintf() just about everywhere. I've implemented slprintf() as a bounds checked sprintf() using mprotect() and a non-writeable page. This should prevent any sprintf based security holes. (This used to be commit ee09e9dadb69aaba5a751dd20ccc6d587d841bd6) --- source3/include/includes.h | 1 + source3/include/proto.h | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index e5076c6f39..44ed317ae9 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -237,6 +237,7 @@ Here come some platform specific sections #define USE_SETSID #define HAVE_BZERO #define HAVE_MEMMOVE +#define HAVE_VSNPRINTF #define USE_SIGPROCMASK #define USE_WAITPID #define USE_SYSV_IPC diff --git a/source3/include/proto.h b/source3/include/proto.h index c9ca7a5ea6..833794a4fb 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1806,6 +1806,11 @@ BOOL machine_password_delete( char *domain, char *name ); BOOL get_machine_account_password( unsigned char *ret_pwd, time_t *pass_last_set_time); BOOL set_machine_account_password( unsigned char *md4_new_pwd); +/*The following definitions come from snprintf.c */ + +int vslprintf(char *str, int n, char *format, va_list ap); +int slprintf(char *str, int n, char *format, ...); + /*The following definitions come from status.c */ void Ucrit_addUsername(pstring username); -- cgit From f004d84f683673b7cb167320e3e78a3fcefdfd07 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 11 May 1998 15:56:01 +0000 Subject: ldap back-end database development Makefile: created PASSBD_OBJ group includes.h: added #ifdef USE_LDAP to #include headers ldap.c: - renamed "_machine" to "_trust" everywhere. - added sam_passwd support routines - removed get_ldappwd_entry function: replaced with get_sampwd_entry - removed getldappwnam/uid: replaced with getsampwnam/uid - other messing about bits which are probably going to annoy the hell out of jean-francois (sorry!) mkproto.awk: - added stuff to wrap ldap.c protos with #ifdef USE_LDAP - added uid_t and gid_t return results to the prototype generation passdb.c: - created getsam21pwent, add_sam21pwd_entry, mod_sam21pwd_entry. - modified getsampwnam/uid and created getsam21pwnam/rid functions to replace the local get_smbpwd_entry() and get_ldappwd_entry() functions, which jeremy didn't like anyway because they were dual-purpose. - added utility routines which are or may be useful to all the password database routines. password.c: - renamed "machine_" to "trust_" everywhere. smbpass.c: - removed get_smbpwd_entry function: replaced it with get_sampwd_entry functions in passdb.c - moved code that decoded acct_ctrl into passdb.c - moved encode_acct_ctrl into passdb.c - removed getsmbpwnam/uid: replaced with getsampwnam/uid - renamed "machine_" to "trust_" everywhere. smbpasswd.c: - renamed "machine_" to "trust_" everywhere. util.c: - moved gethexpwd function into passdb.c lib/rpc/server/srv_util.c: - moved user_rid_to_uid, group_rid_to_rid etc etc into passdb.c (This used to be commit 673ab50c4c2c25db355d90efde3a6bfbb4d8369e) --- source3/include/includes.h | 5 ++++ source3/include/proto.h | 65 ++++++++++++++++++++++++++++++++-------------- 2 files changed, 50 insertions(+), 20 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 44ed317ae9..d741e07c28 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -1180,6 +1180,11 @@ union semun { #include #endif +#ifdef USE_LDAP +#include +#include +#endif + #ifdef NO_UTIMBUF struct utimbuf { time_t actime; diff --git a/source3/include/proto.h b/source3/include/proto.h index 833794a4fb..1d4f917b70 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -223,6 +223,25 @@ int reply_trans(char *inbuf,char *outbuf, int size, int bufsize); void interpret_coding_system(char *str); void initialize_multibyte_vectors( int client_codepage); +/*The following definitions come from ldap.c */ + +#ifdef USE_LDAP +BOOL ldap_open_connection(LDAP **ldap_struct); +BOOL ldap_connect_system(LDAP *ldap_struct); +BOOL ldap_search_one_user_by_name(LDAP *ldap_struct, char *user, LDAPMessage **result); +BOOL ldap_search_one_user_by_uid(LDAP *ldap_struct, int uid, LDAPMessage **result); +void get_single_attribute(LDAP *ldap_struct, LDAPMessage *entry, char *attribute, char *value); +BOOL ldap_check_user(LDAP *ldap_struct, LDAPMessage *entry); +BOOL ldap_check_trust(LDAP *ldap_struct, LDAPMessage *entry); +BOOL add_ldappwd_entry(struct smb_passwd *newpwd); +BOOL mod_ldappwd_entry(struct smb_passwd* pwd, BOOL override); +void *startldappwent(BOOL update); +struct smb_passwd *getldappwent(void *vp); +void endldappwent(void *vp); +unsigned long getldappwpos(void *vp); +BOOL setldappwpos(void *vp, unsigned long tok); +#endif /* USE_LDAP */ + /*The following definitions come from lib/rpc/client/cli_login.c */ BOOL cli_nt_setup_creds(struct cli_state *cli, unsigned char mach_pwd[16]); @@ -899,20 +918,17 @@ BOOL api_srvsvc_rpc(pipes_struct *p, prs_struct *data); /*The following definitions come from lib/rpc/server/srv_util.c */ int make_dom_gids(char *gids_str, DOM_GID *gids); -void get_domain_user_groups(char *domain_groups, char *user); BOOL create_rpc_reply(pipes_struct *p, uint32 data_start, uint32 data_end); BOOL api_rpcTNP(pipes_struct *p, char *rpc_name, struct api_struct *api_rpc_cmds, prs_struct *data); +void get_domain_user_groups(char *domain_groups, char *user); uint32 lookup_group_name(uint32 rid, char *group_name, uint32 *type); uint32 lookup_alias_name(uint32 rid, char *alias_name, uint32 *type); uint32 lookup_user_name(uint32 rid, char *user_name, uint32 *type); uint32 lookup_group_rid(char *group_name, uint32 *rid); uint32 lookup_alias_rid(char *alias_name, uint32 *rid); uint32 lookup_user_rid(char *user_name, uint32 *rid); -BOOL name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); -uint32 uid_to_user_rid(uint32 uid); -uint32 gid_to_group_rid(uint32 gid); /*The following definitions come from lib/rpc/server/srv_wkssvc.c */ @@ -1560,15 +1576,28 @@ BOOL pm_process( char *FileName, /*The following definitions come from passdb.c */ -struct smb_passwd *getsampwnam(char *name); -struct smb_passwd *getsampwuid(unsigned int uid); void *startsampwent(BOOL update); void endsampwent(void *vp); struct smb_passwd *getsampwent(void *vp); +struct sam_passwd *getsam21pwent(void *vp); unsigned long getsampwpos(void *vp); BOOL setsampwpos(void *vp, unsigned long tok); BOOL add_sampwd_entry(struct smb_passwd *newpwd); +BOOL add_sam21pwd_entry(struct sam_passwd *newpwd); BOOL mod_sampwd_entry(struct smb_passwd* pwd, BOOL override); +BOOL mod_sam21pwd_entry(struct sam_passwd* pwd, BOOL override); +struct smb_passwd *getsampwnam(char *name); +struct sam_passwd *getsam21pwnam(char *name); +struct smb_passwd *getsampwuid(uid_t smb_userid); +struct sam_passwd *getsam21pwrid(uint32 rid); +char *encode_acct_ctrl(uint16 acct_ctrl); +uint16 decode_acct_ctrl(char *p); +int gethexpwd(char *p, char *pwd); +BOOL name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); +uid_t user_rid_to_uid(uint32 u_rid); +uid_t group_rid_to_uid(uint32 u_gid); +uint32 uid_to_user_rid(uint32 uid); +uint32 gid_to_group_rid(uint32 gid); /*The following definitions come from password.c */ @@ -1766,6 +1795,11 @@ struct shmem_ops *smb_shm_open(int ronly); struct shmem_ops *sysv_shm_open(int ronly); +/*The following definitions come from slprintf.c */ + +int vslprintf(char *str, int n, char *format, va_list ap); +int slprintf(char *str, int n, char *format, ...); + /*The following definitions come from smbdes.c */ void E_P16(unsigned char *p14,unsigned char *p16); @@ -1795,21 +1829,13 @@ void endsmbpwent(void *vp); struct smb_passwd *getsmbpwent(void *vp); unsigned long getsmbpwpos(void *vp); BOOL setsmbpwpos(void *vp, unsigned long tok); -struct smb_passwd *getsmbpwnam(char *name); -struct smb_passwd *getsmbpwuid(unsigned int uid); -char *encode_acct_ctrl(uint16 acct_ctrl); BOOL add_smbpwd_entry(struct smb_passwd *newpwd); BOOL mod_smbpwd_entry(struct smb_passwd* pwd, BOOL override); -BOOL machine_password_lock( char *domain, char *name, BOOL update); -BOOL machine_password_unlock(void); -BOOL machine_password_delete( char *domain, char *name ); -BOOL get_machine_account_password( unsigned char *ret_pwd, time_t *pass_last_set_time); -BOOL set_machine_account_password( unsigned char *md4_new_pwd); - -/*The following definitions come from snprintf.c */ - -int vslprintf(char *str, int n, char *format, va_list ap); -int slprintf(char *str, int n, char *format, ...); +BOOL trust_password_lock( char *domain, char *name, BOOL update); +BOOL trust_password_unlock(void); +BOOL trust_password_delete( char *domain, char *name ); +BOOL get_trust_account_password( unsigned char *ret_pwd, time_t *pass_last_set_time); +BOOL set_trust_account_password( unsigned char *md4_new_pwd); /*The following definitions come from status.c */ @@ -2033,7 +2059,6 @@ void print_asc(int level, unsigned char *buf,int len); void dump_data(int level,char *buf1,int len); char *tab_depth(int depth); char *dom_sid_to_string(DOM_SID *sid); -int gethexpwd(char *p, char *pwd); /*The following definitions come from web/cgi.c */ -- cgit From 0518067c6e5ca3ebd7743a2a4f5ce6d63eec6812 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 11 May 1998 17:34:39 +0000 Subject: add lp_domain_workstations() parameter. this is a list of workstation names from which an NT user can log in from. empty (default) indicates no restrictions. exactly how this is enforced is unknown. from past experience it's likely that the enforcement is left to the client to carry out... (This used to be commit 6b2f9ea68f5754ca6caaf685a9538ab404e1bab4) --- source3/include/proto.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 1d4f917b70..79712d3c87 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -237,6 +237,7 @@ BOOL add_ldappwd_entry(struct smb_passwd *newpwd); BOOL mod_ldappwd_entry(struct smb_passwd* pwd, BOOL override); void *startldappwent(BOOL update); struct smb_passwd *getldappwent(void *vp); +struct sam_passwd *getldap21pwent(void *vp); void endldappwent(void *vp); unsigned long getldappwpos(void *vp); BOOL setldappwpos(void *vp, unsigned long tok); @@ -973,6 +974,7 @@ char *lp_driverfile(void); char *lp_domain_sid(void); char *lp_domain_other_sids(void); char *lp_domain_groups(void); +char *lp_domain_workstations(void); char *lp_domain_admin_users(void); char *lp_domain_guest_users(void); char *lp_domain_hostsallow(void); @@ -1826,6 +1828,7 @@ char *smb_errstr(char *inbuf); void *startsmbpwent(BOOL update); void endsmbpwent(void *vp); +struct sam_passwd *getsmb21pwent(void *vp); struct smb_passwd *getsmbpwent(void *vp); unsigned long getsmbpwpos(void *vp); BOOL setsmbpwpos(void *vp, unsigned long tok); -- cgit From f888868f46a5418bac9ab528497136c152895305 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 12 May 1998 00:55:32 +0000 Subject: This is a security audit change of the main source. It removed all ocurrences of the following functions : sprintf strcpy strcat The replacements are slprintf, safe_strcpy and safe_strcat. It should not be possible to use code in Samba that uses sprintf, strcpy or strcat, only the safe_equivalents. Once Andrew has fixed the slprintf implementation then this code will be moved back to the 1.9.18 code stream. Jeremy. (This used to be commit 2d774454005f0b54e5684cf618da7060594dfcbb) --- source3/include/includes.h | 31 +++++++++++++++++++++++++++---- source3/include/proto.h | 6 ++++-- source3/include/smb.h | 2 +- 3 files changed, 32 insertions(+), 7 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index d741e07c28..d345ea38de 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -332,6 +332,10 @@ extern int innetgr (const char *, const char *, const char *, const char *); #define REPLACE_GETPASS #endif /* REPLACE_GETPASS */ #define USE_SIGPROCMASK +#ifndef QSORT_CAST +#define QSORT_CAST (int (*)(const void *, const void *)) +#endif /* QSORT_CAST */ +#define HAVE_VSNPRINTF #endif @@ -547,6 +551,7 @@ char *mktemp(char *); /* No standard include */ #define HAVE_GETTIMEOFDAY #define HAVE_PATHCONF #define HAVE_GETGRNAM 1 +#define HAVE_VSNPRINTF #define QSORT_CAST (int (*)(const void *, const void *)) #if !defined(O_SYNC) #if defined(O_FSYNC) @@ -624,6 +629,7 @@ char *mktemp(char *); /* No standard include */ #define USE_SETRES #define USE_SYSV_IPC #define NO_SEMUN +#define HAVE_VALLOC #define DEFAULT_PRINTING PRINT_HPUX /* Ken Weiss tells us that SIGCLD_IGNORE is not good for HPUX */ @@ -1353,12 +1359,29 @@ extern int errno; #define strncasecmp(s1,s2,n) StrnCaseCmp(s1,s2,n) #endif -#ifndef strcpy -#define strcpy(dest,src) StrCpy(dest,src) -#endif +#ifdef strcpy +#undef strcpy +#endif /* strcpy */ +#define strcpy(dest,src) __ERROR__XX__NEVER_USE_STRCPY___; + +#ifdef strcat +#undef strcat +#endif /* strcat */ +#define strcat(dest,src) __ERROR__XX__NEVER_USE_STRCAT___; + +#ifdef sprintf +#undef sprintf +#endif /* sprintf */ +#define sprintf __ERROR__XX__NEVER_USE_SPRINTF__>; + +#define pstrcpy(d,s) safe_strcpy((d),(s),sizeof(pstring)-1) +#define pstrcat(d,s) safe_strcat((d),(s),sizeof(pstring)-1) +#define fstrcpy(d,s) safe_strcpy((d),(s),sizeof(fstring)-1) +#define fstrcat(d,s) safe_strcat((d),(s),sizeof(fstring)-1) #if MEM_MAN #include "mem_man/mem_man.h" -#endif +#endif /* MEM_MAN */ + #endif diff --git a/source3/include/proto.h b/source3/include/proto.h index 79712d3c87..2285f36aa9 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1170,7 +1170,7 @@ BOOL is_8_3( char *fname, BOOL check_case ); int str_checksum( char *s ); void reset_mangled_cache( void ); BOOL check_mangled_cache( char *s ); -void mangle_name_83( char *s ); +void mangle_name_83( char *s, int s_len ); BOOL name_map_mangle( char *OutName, BOOL need83, int snum ); /*The following definitions come from md4.c */ @@ -2054,7 +2054,9 @@ char *unistr(char *buf); int unistrncpy(char *dst, char *src, int len); int unistrcpy(char *dst, char *src); void fstrcpy(char *dest, char *src); -void pstrcpy(char *dest, char *src); +void fstrcat(char *dest, char *src); +char *safe_strcpy(char *dest, char *src, int maxlength); +char *safe_strcat(char *dest, char *src, int maxlength); char *align4(char *q, char *base); char *align2(char *q, char *base); char *align_offset(char *q, char *base, int align_offset_len); diff --git a/source3/include/smb.h b/source3/include/smb.h index d8fe5a84f7..714d3b2eb4 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -237,7 +237,7 @@ implemented */ typedef char pstring[1024]; typedef char fstring[128]; -typedef fstring string; +/* typedef fstring string; */ /* pipe strings */ -- cgit From d48e8376f116cc6f23d090359442ed579e5b5228 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 12 May 1998 14:04:46 +0000 Subject: removed lp_domain_workstation() parameter (This used to be commit 80d6a3bb0cf3853aa51594cce888e6c0a6e6f634) --- source3/include/proto.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 2285f36aa9..79d46b1e4b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -862,11 +862,6 @@ void wks_io_r_query_info(char *desc, WKS_R_QUERY_INFO *r_u, prs_struct *ps, int /*The following definitions come from lib/rpc/server/srv_ldap_helpers.c */ -BOOL get_ldap_entries(SAM_USER_INFO_21 *pw_buf, - int *total_entries, int *num_entries, - int max_num_entries, - uint16 acb_mask, int switch_level); -BOOL ldap_get_user_info_21(SAM_USER_INFO_21 *id21, uint32 rid); void ldap_helper_dummy(void); /*The following definitions come from lib/rpc/server/srv_lsa.c */ @@ -974,7 +969,6 @@ char *lp_driverfile(void); char *lp_domain_sid(void); char *lp_domain_other_sids(void); char *lp_domain_groups(void); -char *lp_domain_workstations(void); char *lp_domain_admin_users(void); char *lp_domain_guest_users(void); char *lp_domain_hostsallow(void); -- cgit From ee9a61841ac10d32d869a3893bc690c66f2bb1bb Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 12 May 1998 22:11:24 +0000 Subject: includes.h: SunOS doesn't have strcasecmp, solaris versions prior to 2.6 don't have vsnprintf. locking_slow.c: slight tidy. make_smbcodepage.c: Use safe_strcpy instead of pstrcpy. nmbd_winsserver.c: Use pstrcpy instead of fstrcpy. smbmount.c: Fixed reported bug. util.c: Removed old fstrcpy/fstrcat functions. Jeremy. (This used to be commit f257d2e4bafd3944cca737699913a8d868279ca6) --- source3/include/includes.h | 5 +++-- source3/include/proto.h | 4 ---- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index d345ea38de..ae073d1df8 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -263,6 +263,7 @@ Here come some platform specific sections #include #include #include +#include #include #include #include @@ -291,6 +292,7 @@ typedef unsigned short mode_t; #define USE_SYSV_IPC /* SunOS doesn't have POSIX atexit */ #define atexit on_exit +#define NOSTRCASECMP #endif @@ -335,7 +337,6 @@ extern int innetgr (const char *, const char *, const char *, const char *); #ifndef QSORT_CAST #define QSORT_CAST (int (*)(const void *, const void *)) #endif /* QSORT_CAST */ -#define HAVE_VSNPRINTF #endif @@ -1372,7 +1373,7 @@ extern int errno; #ifdef sprintf #undef sprintf #endif /* sprintf */ -#define sprintf __ERROR__XX__NEVER_USE_SPRINTF__>; +#define sprintf __ERROR__XX__NEVER_USE_SPRINTF__; #define pstrcpy(d,s) safe_strcpy((d),(s),sizeof(pstring)-1) #define pstrcat(d,s) safe_strcat((d),(s),sizeof(pstring)-1) diff --git a/source3/include/proto.h b/source3/include/proto.h index 79d46b1e4b..e574861b65 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -860,10 +860,6 @@ void make_wks_r_query_info(WKS_R_QUERY_INFO *r_u, int status) ; void wks_io_r_query_info(char *desc, WKS_R_QUERY_INFO *r_u, prs_struct *ps, int depth); -/*The following definitions come from lib/rpc/server/srv_ldap_helpers.c */ - -void ldap_helper_dummy(void); - /*The following definitions come from lib/rpc/server/srv_lsa.c */ BOOL api_ntlsa_rpc(pipes_struct *p, prs_struct *data); -- cgit From ed4719b66c728b52240961897282d0bbc9c456c1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 13 May 1998 05:01:36 +0000 Subject: we don't need a typedef for string (This used to be commit 9907296225e35548dadd70e1be5a06517b27bb87) --- source3/include/smb.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 714d3b2eb4..3049b50362 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -237,8 +237,6 @@ implemented */ typedef char pstring[1024]; typedef char fstring[128]; -/* typedef fstring string; */ - /* pipe strings */ #define PIPE_LANMAN "\\PIPE\\LANMAN" -- cgit From 329fe213439a4ef253e0b16221f98d2ade032e06 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 13 May 1998 18:36:12 +0000 Subject: Fixed up HPUX entry. Jeremy. (This used to be commit a7afda2e4ecab226c90db023293f5d460e81ae2f) --- source3/include/includes.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index ae073d1df8..2bb154554f 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -619,7 +619,10 @@ char *mktemp(char *); /* No standard include */ #define NEED_AUTH_PARAMETERS #endif #define SIGNAL_CAST (void (*)(__harg)) -#ifndef HPUX10 /* This is only needed for HPUX 9.x */ +#ifdef HPUX10 +#include +#else /* HPUX10 */ +/* This is only needed for HPUX 9.x */ #define SELECT_CAST (int *) #endif /* HPUX10 */ #define SYSV @@ -630,7 +633,6 @@ char *mktemp(char *); /* No standard include */ #define USE_SETRES #define USE_SYSV_IPC #define NO_SEMUN -#define HAVE_VALLOC #define DEFAULT_PRINTING PRINT_HPUX /* Ken Weiss tells us that SIGCLD_IGNORE is not good for HPUX */ -- cgit From a4276507e43487f47445eab11d4ac1b080b3270e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 14 May 1998 01:30:40 +0000 Subject: chgpasswd.c: Added comments to #ifdefs ipc.c: Caused samba password changing not to be done if UNIX password changing requested and not successful. util.c: Added string_to_sid() and sid_to_string() functions. lib/rpc/client/cli_samr.c: lib/rpc/include/rpc_misc.h: lib/rpc/parse/parse_lsa.c: lib/rpc/parse/parse_misc.c: lib/rpc/parse/parse_net.c: lib/rpc/parse/parse_samr.c: lib/rpc/server/srv_lsa.c: lib/rpc/server/srv_lsa_hnd.c: lib/rpc/server/srv_netlog.c: lib/rpc/server/srv_samr.c: lib/rpc/server/srv_util.c: Changes so that instead of passing SIDs around as char *, they are converted to DOM_SID at the earliest opportunity, and passed around as that. Also added dynamic memory allocation of group sids. Preparing to auto-generate machine sid. Jeremy. (This used to be commit 134d6fa79c1b6b9505a2c84ba9bfb91dd3be76e5) --- source3/include/proto.h | 20 +++++++++----------- source3/include/rpc_misc.h | 4 ++++ 2 files changed, 13 insertions(+), 11 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index e574861b65..7f7322122e 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -297,8 +297,8 @@ void make_q_query(LSA_Q_QUERY_INFO *q_q, POLICY_HND *hnd, uint16 info_class); void lsa_io_q_query(char *desc, LSA_Q_QUERY_INFO *q_q, prs_struct *ps, int depth); void lsa_io_q_enum_trust_dom(char *desc, LSA_Q_ENUM_TRUST_DOM *q_e, prs_struct *ps, int depth); void make_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM *r_e, - uint32 enum_context, char *domain_name, char *domain_sid, - uint32 status); + uint32 enum_context, char *domain_name, DOM_SID *domain_sid, + uint32 status); void lsa_io_r_enum_trust_dom(char *desc, LSA_R_ENUM_TRUST_DOM *r_e, prs_struct *ps, int depth); void make_lsa_q_close(LSA_Q_CLOSE *q_c, POLICY_HND *hnd); void lsa_io_q_close(char *desc, LSA_Q_CLOSE *q_c, prs_struct *ps, int depth); @@ -320,9 +320,8 @@ void smb_io_lookup_level(char *desc, LOOKUP_LEVEL *level, prs_struct *ps, int de uint32 get_enum_hnd(ENUM_HND *enh); void make_enum_hnd(ENUM_HND *enh, uint32 hnd); void smb_io_enum_hnd(char *desc, ENUM_HND *hnd, prs_struct *ps, int depth); -void make_dom_sid(DOM_SID *sid, char *str_sid); void smb_io_dom_sid(char *desc, DOM_SID *sid, prs_struct *ps, int depth); -void make_dom_sid2(DOM_SID2 *sid, char *str_sid); +void make_dom_sid2(DOM_SID2 *sid2, DOM_SID *sid); void smb_io_dom_sid2(char *desc, DOM_SID2 *sid, prs_struct *ps, int depth); void make_str_hdr(STRHDR *hdr, int max_len, int len, uint32 buffer); void smb_io_strhdr(char *desc, STRHDR *hdr, prs_struct *ps, int depth); @@ -459,7 +458,7 @@ void make_net_user_info3(NET_USER_INFO_3 *usr, char *logon_srv, char *logon_dom, - char *dom_sid, + DOM_SID *dom_sid, char *other_sids); void net_io_user_info3(char *desc, NET_USER_INFO_3 *usr, prs_struct *ps, int depth); void net_io_q_sam_logon(char *desc, NET_Q_SAM_LOGON *q_l, prs_struct *ps, int depth); @@ -562,7 +561,7 @@ void make_samr_q_close_hnd(SAMR_Q_CLOSE_HND *q_c, POLICY_HND *hnd); void samr_io_q_close_hnd(char *desc, SAMR_Q_CLOSE_HND *q_u, prs_struct *ps, int depth); void samr_io_r_close_hnd(char *desc, SAMR_R_CLOSE_HND *r_u, prs_struct *ps, int depth); void make_samr_q_open_domain(SAMR_Q_OPEN_DOMAIN *q_u, - POLICY_HND *connect_pol, uint32 rid, char *sid); + POLICY_HND *connect_pol, uint32 rid, DOM_SID *sid); void samr_io_q_open_domain(char *desc, SAMR_Q_OPEN_DOMAIN *q_u, prs_struct *ps, int depth); void samr_io_r_open_domain(char *desc, SAMR_R_OPEN_DOMAIN *r_u, prs_struct *ps, int depth); void make_samr_q_unknown_8(SAMR_Q_UNKNOWN_8 *q_u, @@ -571,7 +570,7 @@ void samr_io_q_unknown_8(char *desc, SAMR_Q_UNKNOWN_8 *q_u, prs_struct *ps, int void make_samr_q_unknown_3(SAMR_Q_UNKNOWN_3 *q_u, POLICY_HND *user_pol, uint16 switch_value); void samr_io_q_unknown_3(char *desc, SAMR_Q_UNKNOWN_3 *q_u, prs_struct *ps, int depth); -void make_dom_sid3(DOM_SID3 *sid3, uint16 unk_0, uint16 unk_1, char *sid); +void make_dom_sid3(DOM_SID3 *sid3, uint16 unk_0, uint16 unk_1, char *sidstr); void sam_io_dom_sid3(char *desc, DOM_SID3 *sid3, prs_struct *ps, int depth); void make_sam_sid_stuff(SAM_SID_STUFF *stf, uint16 unknown_2, uint16 unknown_3, @@ -909,7 +908,7 @@ BOOL api_srvsvc_rpc(pipes_struct *p, prs_struct *data); /*The following definitions come from lib/rpc/server/srv_util.c */ -int make_dom_gids(char *gids_str, DOM_GID *gids); +int make_dom_gids(char *gids_str, DOM_GID **ppgids); BOOL create_rpc_reply(pipes_struct *p, uint32 data_start, uint32 data_end); BOOL api_rpcTNP(pipes_struct *p, char *rpc_name, struct api_struct *api_rpc_cmds, @@ -2043,8 +2042,6 @@ int struni2(uint16 *p, char *buf); char *unistr(char *buf); int unistrncpy(char *dst, char *src, int len); int unistrcpy(char *dst, char *src); -void fstrcpy(char *dest, char *src); -void fstrcat(char *dest, char *src); char *safe_strcpy(char *dest, char *src, int maxlength); char *safe_strcat(char *dest, char *src, int maxlength); char *align4(char *q, char *base); @@ -2053,7 +2050,8 @@ char *align_offset(char *q, char *base, int align_offset_len); void print_asc(int level, unsigned char *buf,int len); void dump_data(int level,char *buf1,int len); char *tab_depth(int depth); -char *dom_sid_to_string(DOM_SID *sid); +char *sid_to_string(pstring sidstr_out, DOM_SID *sid); +BOOL string_to_sid(DOM_SID *sidout, char *sidstr); /*The following definitions come from web/cgi.c */ diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index c6e0d8d5ee..7406916cce 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -85,6 +85,10 @@ typedef struct sid_info uint8 sid_rev_num; /* SID revision number */ uint8 num_auths; /* number of sub-authorities */ uint8 id_auth[6]; /* Identifier Authority */ + /* + * Note that the values in these uint32's are in *native* byteorder, + * not neccessarily little-endian...... JRA. + */ uint32 sub_auths[MAXSUBAUTHS]; /* pointer to sub-authorities. */ } DOM_SID; -- cgit From bce6d410130982af6ca58dc9a0d297b5f80e6c6c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 14 May 1998 03:20:42 +0000 Subject: namequery.c: Fixed SGI IRIX 5.x compiler problem. server.c: Added MACHINE.SID file generation - use lp_domain_sid() be default. smbpass.c: Exposed do_file_lock() as I now use it in server.c Jeremy. (This used to be commit 5bf17840ac7d65d08dd3fdfe8b789010488f6808) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 7f7322122e..70e10f1479 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1815,6 +1815,7 @@ char *smb_errstr(char *inbuf); /*The following definitions come from smbpass.c */ +BOOL do_file_lock(int fd, int waitsecs, int type); void *startsmbpwent(BOOL update); void endsmbpwent(void *vp); struct sam_passwd *getsmb21pwent(void *vp); -- cgit From ea92374814a5b64edd0756e46153dcb70ef8d2d6 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 14 May 1998 11:16:18 +0000 Subject: robert frank - some Next3 compilation errors detected. (This used to be commit da3d9602c71094df4dba0edd45ade71555f5e97b) --- source3/include/includes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 2bb154554f..acae03c56b 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -710,7 +710,6 @@ char *mktemp(char *); /* No standard include */ #include #include #include -#define bzero(b,len) memset(b,0,len) #define NO_UTIMBUF #include #define NOSTRDUP @@ -722,6 +721,7 @@ char *mktemp(char *); /* No standard include */ #define SIGNAL_CAST (void (*)(int)) #define WAIT3_CAST1 (union wait *) #define HAVE_GMTOFF +#define O_NONBLOCK O_NDELAY #endif -- cgit From f8a4273407f2983bb05a76e914d4f532bbd5004e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 14 May 1998 21:10:49 +0000 Subject: passdb.c server.c: Moved generate_machine_sid() into passdb.c for Jean-Francois (who might want an LDAP version). Changed locking to free exclusive lock as soon as possible to prevent contention. lib/rpc/parse/parse_samr.c lib/rpc/server/srv_samr.c: Changed last SID-as-string manipulation function to use DOM_SID structure. Jeremy. (This used to be commit 3b8f5aef57b4f37265c0403385053085f0df6f18) --- source3/include/proto.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 70e10f1479..f448f4b9b3 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -570,7 +570,7 @@ void samr_io_q_unknown_8(char *desc, SAMR_Q_UNKNOWN_8 *q_u, prs_struct *ps, int void make_samr_q_unknown_3(SAMR_Q_UNKNOWN_3 *q_u, POLICY_HND *user_pol, uint16 switch_value); void samr_io_q_unknown_3(char *desc, SAMR_Q_UNKNOWN_3 *q_u, prs_struct *ps, int depth); -void make_dom_sid3(DOM_SID3 *sid3, uint16 unk_0, uint16 unk_1, char *sidstr); +void make_dom_sid3(DOM_SID3 *sid3, uint16 unk_0, uint16 unk_1, DOM_SID *sid); void sam_io_dom_sid3(char *desc, DOM_SID3 *sid3, prs_struct *ps, int depth); void make_sam_sid_stuff(SAM_SID_STUFF *stf, uint16 unknown_2, uint16 unknown_3, @@ -1585,6 +1585,7 @@ char *encode_acct_ctrl(uint16 acct_ctrl); uint16 decode_acct_ctrl(char *p); int gethexpwd(char *p, char *pwd); BOOL name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); +BOOL generate_machine_sid(void); uid_t user_rid_to_uid(uint32 u_rid); uid_t group_rid_to_uid(uint32 u_gid); uint32 uid_to_user_rid(uint32 uid); -- cgit From 32954eb9e9eb1e3613ad55cb1afd5e19e81b5da8 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 18 May 1998 11:54:00 +0000 Subject: Makefile: - added nisppass.c and NISPLUS_FLAGS includes.h: - renamed USE_LDAP to USE_LDAP_DB. renamed NISPLUS to USE_NISPLUS_DB. added default define of USE_SMBPASS_DB. - removed ldap headers: they are local only to ldap.c ldap.c : - made all ldap-specific functions static. - added dummy sam21 functions loadparm.c : - renamed NISPLUS to NISPLUS_HOME mkproto.awk - commented out ldap-specific #ifdef generation code: it's not needed now that ldap-specific functions in ldap.c are static nisppass.c : - first attempt at an add function from (This used to be commit f215d375f0f1e12894c2a9e86bd28d4776d337c1) --- source3/include/includes.h | 9 ++++----- source3/include/proto.h | 49 +++++++++++++++++++++++++++++----------------- source3/include/smb.h | 8 ++++++++ 3 files changed, 43 insertions(+), 23 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index acae03c56b..49fb30e786 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -1068,6 +1068,10 @@ typedef int mode_t; end of the platform specific sections ********************************************************************/ +#if (!defined(USE_LDAP_DB) && !defined(USE_NISPLUS_DB)) +#define USE_SMBPASS_DB +#endif + #if defined(USE_MMAP) || defined(FAST_SHARE_MODES) #include #endif @@ -1189,11 +1193,6 @@ union semun { #include #endif -#ifdef USE_LDAP -#include -#include -#endif - #ifdef NO_UTIMBUF struct utimbuf { time_t actime; diff --git a/source3/include/proto.h b/source3/include/proto.h index f448f4b9b3..5457d99570 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -225,23 +225,16 @@ void initialize_multibyte_vectors( int client_codepage); /*The following definitions come from ldap.c */ -#ifdef USE_LDAP -BOOL ldap_open_connection(LDAP **ldap_struct); -BOOL ldap_connect_system(LDAP *ldap_struct); -BOOL ldap_search_one_user_by_name(LDAP *ldap_struct, char *user, LDAPMessage **result); -BOOL ldap_search_one_user_by_uid(LDAP *ldap_struct, int uid, LDAPMessage **result); -void get_single_attribute(LDAP *ldap_struct, LDAPMessage *entry, char *attribute, char *value); -BOOL ldap_check_user(LDAP *ldap_struct, LDAPMessage *entry); -BOOL ldap_check_trust(LDAP *ldap_struct, LDAPMessage *entry); +BOOL add_ldap21pwd_entry(struct smb_passwd *newpwd); BOOL add_ldappwd_entry(struct smb_passwd *newpwd); BOOL mod_ldappwd_entry(struct smb_passwd* pwd, BOOL override); +BOOL mod_ldap21pwd_entry(struct smb_passwd* pwd, BOOL override); void *startldappwent(BOOL update); struct smb_passwd *getldappwent(void *vp); struct sam_passwd *getldap21pwent(void *vp); void endldappwent(void *vp); unsigned long getldappwpos(void *vp); BOOL setldappwpos(void *vp, unsigned long tok); -#endif /* USE_LDAP */ /*The following definitions come from lib/rpc/client/cli_login.c */ @@ -1218,6 +1211,21 @@ BOOL getlmhostsent( FILE *fp, char *name, int *name_type, struct in_addr *ipaddr void endlmhosts(FILE *fp); BOOL resolve_name(char *name, struct in_addr *return_ip); +/*The following definitions come from nisppass.c */ + +void *startnisppwent(BOOL update); +void endnisppwent(void *vp); +struct sam_passwd *getnisp21pwent(void *vp); +struct smb_passwd *getnisppwent(void *vp); +unsigned long getnisppwpos(void *vp); +BOOL setnisppwpos(void *vp, unsigned long tok); +BOOL add_nisp21pwd_entry(struct sam_passwd *newpwd); +BOOL add_nisppwd_entry(struct smb_passwd *newpwd); +BOOL mod_nisp21pwd_entry(struct sam_passwd* pwd, BOOL override); +BOOL mod_nisppwd_entry(struct smb_passwd* pwd, BOOL override); +struct smb_passwd *getnisppwnam(char *name); +struct smb_passwd *getnisppwuid(int smb_userid); + /*The following definitions come from nmbd.c */ BOOL reload_services(BOOL test); @@ -1570,6 +1578,7 @@ BOOL pm_process( char *FileName, void *startsampwent(BOOL update); void endsampwent(void *vp); struct smb_passwd *getsampwent(void *vp); +struct sam_disp_info *getsamdispent(void *vp); struct sam_passwd *getsam21pwent(void *vp); unsigned long getsampwpos(void *vp); BOOL setsampwpos(void *vp, unsigned long tok); @@ -1581,15 +1590,17 @@ struct smb_passwd *getsampwnam(char *name); struct sam_passwd *getsam21pwnam(char *name); struct smb_passwd *getsampwuid(uid_t smb_userid); struct sam_passwd *getsam21pwrid(uint32 rid); -char *encode_acct_ctrl(uint16 acct_ctrl); -uint16 decode_acct_ctrl(char *p); -int gethexpwd(char *p, char *pwd); -BOOL name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); -BOOL generate_machine_sid(void); -uid_t user_rid_to_uid(uint32 u_rid); -uid_t group_rid_to_uid(uint32 u_gid); -uint32 uid_to_user_rid(uint32 uid); -uint32 gid_to_group_rid(uint32 gid); +time_t pdb_get_last_set_time(char *p); +void pdb_set_last_set_time(char *p, int max_len, time_t t); +char *pdb_encode_acct_ctrl(uint16 acct_ctrl); +uint16 pdb_decode_acct_ctrl(char *p); +int pdb_gethexpwd(char *p, char *pwd); +BOOL pdb_name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); +BOOL pdb_generate_machine_sid(void); +uid_t pdb_user_rid_to_uid(uint32 u_rid); +uid_t pdb_group_rid_to_uid(uint32 u_gid); +uint32 pdb_uid_to_user_rid(uint32 uid); +uint32 pdb_gid_to_group_rid(uint32 gid); /*The following definitions come from password.c */ @@ -1823,7 +1834,9 @@ struct sam_passwd *getsmb21pwent(void *vp); struct smb_passwd *getsmbpwent(void *vp); unsigned long getsmbpwpos(void *vp); BOOL setsmbpwpos(void *vp, unsigned long tok); +BOOL add_smb21pwd_entry(struct sam_passwd *newpwd); BOOL add_smbpwd_entry(struct smb_passwd *newpwd); +BOOL mod_smb21pwd_entry(struct sam_passwd* pwd, BOOL override); BOOL mod_smbpwd_entry(struct smb_passwd* pwd, BOOL override); BOOL trust_password_lock( char *domain, char *name, BOOL update); BOOL trust_password_unlock(void); diff --git a/source3/include/smb.h b/source3/include/smb.h index 3049b50362..893d61fc79 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -325,6 +325,14 @@ struct smb_passwd }; +struct sam_disp_info +{ + uint32 user_rid; /* Primary User ID */ + char *smb_name; /* username string */ + char *full_name; /* user's full name string */ +}; + + /* DOM_CHAL - challenge info */ typedef struct chal_info { -- cgit From 648ceb2f2ed5c9c029cf85f22f0dfccdd915ab12 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 18 May 1998 14:06:49 +0000 Subject: received update from jean francois for ldap.c: he is doing add / mod functions (This used to be commit 381df1e52bfc97b80422de2703db8cb521dc47e1) --- source3/include/proto.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 5457d99570..29135ec02b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -225,10 +225,11 @@ void initialize_multibyte_vectors( int client_codepage); /*The following definitions come from ldap.c */ -BOOL add_ldap21pwd_entry(struct smb_passwd *newpwd); +BOOL ldap_open_connection(LDAP **ldap_struct); BOOL add_ldappwd_entry(struct smb_passwd *newpwd); -BOOL mod_ldappwd_entry(struct smb_passwd* pwd, BOOL override); -BOOL mod_ldap21pwd_entry(struct smb_passwd* pwd, BOOL override); +BOOL mod_ldappwd_entry(struct smb_passwd *pwd, BOOL override); +BOOL add_ldap21pwd_entry(struct sam_passwd *newpwd); +BOOL mod_ldap21pwd_entry(struct sam_passwd *pwd, BOOL override); void *startldappwent(BOOL update); struct smb_passwd *getldappwent(void *vp); struct sam_passwd *getldap21pwent(void *vp); @@ -1827,7 +1828,6 @@ char *smb_errstr(char *inbuf); /*The following definitions come from smbpass.c */ -BOOL do_file_lock(int fd, int waitsecs, int type); void *startsmbpwent(BOOL update); void endsmbpwent(void *vp); struct sam_passwd *getsmb21pwent(void *vp); @@ -1838,6 +1838,12 @@ BOOL add_smb21pwd_entry(struct sam_passwd *newpwd); BOOL add_smbpwd_entry(struct smb_passwd *newpwd); BOOL mod_smb21pwd_entry(struct sam_passwd* pwd, BOOL override); BOOL mod_smbpwd_entry(struct smb_passwd* pwd, BOOL override); + +/*The following definitions come from smbpassfile.c */ + +BOOL do_file_lock(int fd, int waitsecs, int type); +BOOL pw_file_lock(int fd, int type, int secs, int *plock_depth); +BOOL pw_file_unlock(int fd, int *plock_depth); BOOL trust_password_lock( char *domain, char *name, BOOL update); BOOL trust_password_unlock(void); BOOL trust_password_delete( char *domain, char *name ); -- cgit From 646ab2b0a773592a5973ce78fecfb24b39aa2506 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 18 May 1998 14:17:47 +0000 Subject: resolving compilation errors (This used to be commit dea0c06eec44a7c2860f97d8f23584d30e482e0a) --- source3/include/proto.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 29135ec02b..e4cefae193 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -225,7 +225,6 @@ void initialize_multibyte_vectors( int client_codepage); /*The following definitions come from ldap.c */ -BOOL ldap_open_connection(LDAP **ldap_struct); BOOL add_ldappwd_entry(struct smb_passwd *newpwd); BOOL mod_ldappwd_entry(struct smb_passwd *pwd, BOOL override); BOOL add_ldap21pwd_entry(struct sam_passwd *newpwd); -- cgit From 4d63fdc430ff9ff6cd141280c024e83f41bd6744 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 18 May 1998 14:55:17 +0000 Subject: creating and using some pdb_init_(sam/smb) routines. putting ldap headers back in (they had been taken out of includes.h because they are only local to ldap.c. (This used to be commit 98ab085b93fb25a4d9275c0d54a863fd9fae2548) --- source3/include/proto.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index e4cefae193..4ef785357c 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1590,6 +1590,10 @@ struct smb_passwd *getsampwnam(char *name); struct sam_passwd *getsam21pwnam(char *name); struct smb_passwd *getsampwuid(uid_t smb_userid); struct sam_passwd *getsam21pwrid(uint32 rid); +void pdb_init_smb(struct smb_passwd *user); +void pdb_init_sam(struct sam_passwd *user); +struct smb_passwd *pdb_sam_to_smb(struct sam_passwd *user); +struct sam_passwd *pdb_smb_to_sam(struct smb_passwd *user); time_t pdb_get_last_set_time(char *p); void pdb_set_last_set_time(char *p, int max_len, time_t t); char *pdb_encode_acct_ctrl(uint16 acct_ctrl); -- cgit From cffaf886da8b0970acb670b58b64d5145122aab1 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 18 May 1998 15:50:56 +0000 Subject: removed references to some of the smb_passwd routines from ldap and nis+ code, use pdb_sam_to_smb(...sam21...) calls instead. this is a lot simpler. (This used to be commit d92f4e71c12ce5010f05fa7dd3918a48e7386d1e) --- source3/include/proto.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 4ef785357c..6f1f9e038c 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1216,15 +1216,12 @@ BOOL resolve_name(char *name, struct in_addr *return_ip); void *startnisppwent(BOOL update); void endnisppwent(void *vp); struct sam_passwd *getnisp21pwent(void *vp); -struct smb_passwd *getnisppwent(void *vp); unsigned long getnisppwpos(void *vp); BOOL setnisppwpos(void *vp, unsigned long tok); BOOL add_nisp21pwd_entry(struct sam_passwd *newpwd); -BOOL add_nisppwd_entry(struct smb_passwd *newpwd); BOOL mod_nisp21pwd_entry(struct sam_passwd* pwd, BOOL override); -BOOL mod_nisppwd_entry(struct smb_passwd* pwd, BOOL override); -struct smb_passwd *getnisppwnam(char *name); -struct smb_passwd *getnisppwuid(int smb_userid); +struct sam_passwd *getnisp21pwnam(char *name); +struct sam_passwd *getnisp21pwuid(int smb_userid); /*The following definitions come from nmbd.c */ @@ -1586,12 +1583,14 @@ BOOL add_sampwd_entry(struct smb_passwd *newpwd); BOOL add_sam21pwd_entry(struct sam_passwd *newpwd); BOOL mod_sampwd_entry(struct smb_passwd* pwd, BOOL override); BOOL mod_sam21pwd_entry(struct sam_passwd* pwd, BOOL override); -struct smb_passwd *getsampwnam(char *name); struct sam_passwd *getsam21pwnam(char *name); +struct smb_passwd *getsampwnam(char *name); struct smb_passwd *getsampwuid(uid_t smb_userid); struct sam_passwd *getsam21pwrid(uint32 rid); +void pdb_init_dispinfo(struct sam_disp_info *user); void pdb_init_smb(struct smb_passwd *user); void pdb_init_sam(struct sam_passwd *user); +struct sam_disp_info *pdb_sam_to_dispinfo(struct sam_passwd *user); struct smb_passwd *pdb_sam_to_smb(struct sam_passwd *user); struct sam_passwd *pdb_smb_to_sam(struct smb_passwd *user); time_t pdb_get_last_set_time(char *p); -- cgit From ffab54750f0eec202895670dd9293ee4aa3eb475 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 18 May 1998 21:30:57 +0000 Subject: chgpasswd.c: Changed back to getsmb... from getsam... ldap.c: Stoped dummy_function being prototyped. loadparm.c: Fixed slprintf sizes. nisppass.c: Fixed safe_strcpy sizes. nmbd_processlogon.c: Changed back to getsmb... from getsam... nttrans.c: Just a dump of new code. passdb.c: Moved stuff around a lot - stopped any lookups by rid. This needs to be indirected through a function table (soon). password.c: Changed back to getsmb... from getsam... reply.c: Changed back to getsmb... from getsam... slprintf.c: Fixed prototype problems. smb.h: Fixed prototype problems. smbpass.c: Changed to getsmbfile.... smbpasswd.c: Changed back to getsmb... from getsam... lib/rpc/server/srv_netlog.c: Changed back to getsmb... from getsam... lib/rpc/server/srv_samr.c: Fixed rid lookup - use uid or gid lookup. lib/rpc/server/srv_util.c: Changed back to getsmb... from getsam... Jeremy. (This used to be commit 7d332b2493d2089d09521250fc9b72d8953307c0) --- source3/include/proto.h | 54 ++++++++++++++++++++++++------------------------- source3/include/smb.h | 6 ++++-- 2 files changed, 31 insertions(+), 29 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 6f1f9e038c..aea8543271 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -36,12 +36,12 @@ BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence, BOOL BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root); BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root); BOOL check_lanman_password(char *user, unsigned char *pass1, - unsigned char *pass2, struct smb_passwd **psampw); -BOOL change_lanman_password(struct smb_passwd *sampw, unsigned char *pass1, unsigned char *pass2); + unsigned char *pass2, struct smb_passwd **psmbpw); +BOOL change_lanman_password(struct smb_passwd *smbpw, unsigned char *pass1, unsigned char *pass2); BOOL check_oem_password(char *user, unsigned char *data, - struct smb_passwd **psampw, char *new_passwd, + struct smb_passwd **psmbpw, char *new_passwd, int new_passwd_size); -BOOL change_oem_password(struct smb_passwd *sampw, char *new_passwd, BOOL override); +BOOL change_oem_password(struct smb_passwd *smbpw, char *new_passwd, BOOL override); /*The following definitions come from client.c */ @@ -1572,21 +1572,21 @@ BOOL pm_process( char *FileName, /*The following definitions come from passdb.c */ -void *startsampwent(BOOL update); -void endsampwent(void *vp); -struct smb_passwd *getsampwent(void *vp); +void *startsmbpwent(BOOL update); +void endsmbpwent(void *vp); +struct smb_passwd *getsmbpwent(void *vp); +unsigned long getsmbpwpos(void *vp); +BOOL setsmbpwpos(void *vp, unsigned long tok); +BOOL add_smbpwd_entry(struct smb_passwd *newpwd); +BOOL mod_smbpwd_entry(struct smb_passwd* pwd, BOOL override); +struct smb_passwd *getsmbpwnam(char *name); +struct smb_passwd *getsmbpwuid(uid_t smb_userid); struct sam_disp_info *getsamdispent(void *vp); struct sam_passwd *getsam21pwent(void *vp); -unsigned long getsampwpos(void *vp); -BOOL setsampwpos(void *vp, unsigned long tok); -BOOL add_sampwd_entry(struct smb_passwd *newpwd); BOOL add_sam21pwd_entry(struct sam_passwd *newpwd); -BOOL mod_sampwd_entry(struct smb_passwd* pwd, BOOL override); BOOL mod_sam21pwd_entry(struct sam_passwd* pwd, BOOL override); struct sam_passwd *getsam21pwnam(char *name); -struct smb_passwd *getsampwnam(char *name); -struct smb_passwd *getsampwuid(uid_t smb_userid); -struct sam_passwd *getsam21pwrid(uint32 rid); +struct sam_passwd *getsam21pwuid(uint32 uid); void pdb_init_dispinfo(struct sam_disp_info *user); void pdb_init_smb(struct smb_passwd *user); void pdb_init_sam(struct sam_passwd *user); @@ -1600,10 +1600,11 @@ uint16 pdb_decode_acct_ctrl(char *p); int pdb_gethexpwd(char *p, char *pwd); BOOL pdb_name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); BOOL pdb_generate_machine_sid(void); -uid_t pdb_user_rid_to_uid(uint32 u_rid); -uid_t pdb_group_rid_to_uid(uint32 u_gid); +uint32 pdb_user_rid_to_uid(uint32 u_rid); +uint32 pdb_group_rid_to_gid(uint32 u_gid); uint32 pdb_uid_to_user_rid(uint32 uid); uint32 pdb_gid_to_group_rid(uint32 gid); +BOOL pdb_rid_is_user(uint32 rid); /*The following definitions come from password.c */ @@ -1804,7 +1805,6 @@ struct shmem_ops *sysv_shm_open(int ronly); /*The following definitions come from slprintf.c */ int vslprintf(char *str, int n, char *format, va_list ap); -int slprintf(char *str, int n, char *format, ...); /*The following definitions come from smbdes.c */ @@ -1830,16 +1830,16 @@ char *smb_errstr(char *inbuf); /*The following definitions come from smbpass.c */ -void *startsmbpwent(BOOL update); -void endsmbpwent(void *vp); -struct sam_passwd *getsmb21pwent(void *vp); -struct smb_passwd *getsmbpwent(void *vp); -unsigned long getsmbpwpos(void *vp); -BOOL setsmbpwpos(void *vp, unsigned long tok); -BOOL add_smb21pwd_entry(struct sam_passwd *newpwd); -BOOL add_smbpwd_entry(struct smb_passwd *newpwd); -BOOL mod_smb21pwd_entry(struct sam_passwd* pwd, BOOL override); -BOOL mod_smbpwd_entry(struct smb_passwd* pwd, BOOL override); +void *startsmbfilepwent(BOOL update); +void endsmbfilepwent(void *vp); +struct sam_passwd *getsmbfile21pwent(void *vp); +struct smb_passwd *getsmbfilepwent(void *vp); +unsigned long getsmbfilepwpos(void *vp); +BOOL setsmbfilepwpos(void *vp, unsigned long tok); +BOOL add_smbfile21pwd_entry(struct sam_passwd *newpwd); +BOOL add_smbfilepwd_entry(struct smb_passwd *newpwd); +BOOL mod_smbfile21pwd_entry(struct sam_passwd* pwd, BOOL override); +BOOL mod_smbfilepwd_entry(struct smb_passwd* pwd, BOOL override); /*The following definitions come from smbpassfile.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index 893d61fc79..c90f77a593 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -979,9 +979,11 @@ struct parm_struct #define ERRCMD 0xFF /* Command was not in the "SMB" format. */ #ifdef __STDC__ -int Debug1(char *, ...); +int Debug1(char *, ...); +int slprintf(char *str, int n, char *format, ...); #else -int Debug1(); +int Debug1(); +int slprintf(); #endif #ifdef DFS_AUTH -- cgit From 118827376f8ccedb455e81b7d2b3bff029cde457 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 18 May 1998 23:57:28 +0000 Subject: Abstracted all the crappy password interfaces through an indirect function table, selectable at compile time. This should make the code that implements all the password functions much cleaner, as it's now very clear exactly what a particular password database needs to provide to Samba. Jeremy. (This used to be commit 27ca536ad974242524c12f7100e419d9e7f9647f) --- source3/include/proto.h | 34 ++++++++-------------------------- source3/include/smb.h | 38 +++++++++++++++++++++++++++++++++++++- 2 files changed, 45 insertions(+), 27 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index aea8543271..8207aa8adc 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -225,16 +225,7 @@ void initialize_multibyte_vectors( int client_codepage); /*The following definitions come from ldap.c */ -BOOL add_ldappwd_entry(struct smb_passwd *newpwd); -BOOL mod_ldappwd_entry(struct smb_passwd *pwd, BOOL override); -BOOL add_ldap21pwd_entry(struct sam_passwd *newpwd); -BOOL mod_ldap21pwd_entry(struct sam_passwd *pwd, BOOL override); -void *startldappwent(BOOL update); -struct smb_passwd *getldappwent(void *vp); -struct sam_passwd *getldap21pwent(void *vp); -void endldappwent(void *vp); -unsigned long getldappwpos(void *vp); -BOOL setldappwpos(void *vp, unsigned long tok); +struct passdb_ops *ldap_initialize_password_db(void); /*The following definitions come from lib/rpc/client/cli_login.c */ @@ -1213,15 +1204,7 @@ BOOL resolve_name(char *name, struct in_addr *return_ip); /*The following definitions come from nisppass.c */ -void *startnisppwent(BOOL update); -void endnisppwent(void *vp); -struct sam_passwd *getnisp21pwent(void *vp); -unsigned long getnisppwpos(void *vp); -BOOL setnisppwpos(void *vp, unsigned long tok); -BOOL add_nisp21pwd_entry(struct sam_passwd *newpwd); -BOOL mod_nisp21pwd_entry(struct sam_passwd* pwd, BOOL override); -struct sam_passwd *getnisp21pwnam(char *name); -struct sam_passwd *getnisp21pwuid(int smb_userid); +struct passdb_ops *nisplus_initialize_password_db(void); /*The following definitions come from nmbd.c */ @@ -1572,6 +1555,9 @@ BOOL pm_process( char *FileName, /*The following definitions come from passdb.c */ +struct smb_passwd *iterate_getsmbpwuid(uid_t smb_userid); +struct smb_passwd *iterate_getsmbpwnam(char *name); +BOOL initialize_password_db(void); void *startsmbpwent(BOOL update); void endsmbpwent(void *vp); struct smb_passwd *getsmbpwent(void *vp); @@ -1581,6 +1567,8 @@ BOOL add_smbpwd_entry(struct smb_passwd *newpwd); BOOL mod_smbpwd_entry(struct smb_passwd* pwd, BOOL override); struct smb_passwd *getsmbpwnam(char *name); struct smb_passwd *getsmbpwuid(uid_t smb_userid); +struct sam_passwd *iterate_getsam21pwnam(char *name); +struct sam_passwd *iterate_getsam21pwuid(uint32 uid); struct sam_disp_info *getsamdispent(void *vp); struct sam_passwd *getsam21pwent(void *vp); BOOL add_sam21pwd_entry(struct sam_passwd *newpwd); @@ -1830,16 +1818,10 @@ char *smb_errstr(char *inbuf); /*The following definitions come from smbpass.c */ -void *startsmbfilepwent(BOOL update); -void endsmbfilepwent(void *vp); -struct sam_passwd *getsmbfile21pwent(void *vp); struct smb_passwd *getsmbfilepwent(void *vp); -unsigned long getsmbfilepwpos(void *vp); -BOOL setsmbfilepwpos(void *vp, unsigned long tok); -BOOL add_smbfile21pwd_entry(struct sam_passwd *newpwd); -BOOL add_smbfilepwd_entry(struct smb_passwd *newpwd); BOOL mod_smbfile21pwd_entry(struct sam_passwd* pwd, BOOL override); BOOL mod_smbfilepwd_entry(struct smb_passwd* pwd, BOOL override); +struct passdb_ops *file_initialize_password_db(void); /*The following definitions come from smbpassfile.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index c90f77a593..fff44f179d 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -332,7 +332,6 @@ struct sam_disp_info char *full_name; /* user's full name string */ }; - /* DOM_CHAL - challenge info */ typedef struct chal_info { @@ -635,8 +634,45 @@ struct shmem_ops { unsigned (*hash_size)(void); }; +/* + * Each implementation of the password database code needs + * to support the following operations. + */ + +struct passdb_ops { + /* + * Password database ops. + */ + void *(*startsmbpwent)(BOOL); + void (*endsmbpwent)(void *); + unsigned long (*getsmbpwpos)(void *); + BOOL (*setsmbpwpos)(void *, unsigned long); + /* + * smb password database query functions. + */ + struct smb_passwd *(*getsmbpwnam)(char *); + struct smb_passwd *(*getsmbpwuid)(uid_t); + struct smb_passwd *(*getsmbpwent)(void *); + /* + * smb password database modification functions. + */ + BOOL (*add_smbpwd_entry)(struct smb_passwd *); + BOOL (*mod_smbpwd_entry)(struct smb_passwd *, BOOL); + + /* + * Functions that manupulate a struct sam_passwd. + */ + struct sam_passwd *(*getsam21pwent)(void *); + + struct sam_passwd *(*getsam21pwnam)(char *); + struct sam_passwd *(*getsam21pwuid)(uint32); + + BOOL (*add_sam21pwd_entry)(struct sam_passwd *); + BOOL (*mod_sam21pwd_entry)(struct sam_passwd *, BOOL); +}; /* this is used for smbstatus */ + struct connect_record { int magic; -- cgit From 0a36b8d8a959c18c670a7e41e3f5a728f3ea88c3 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 19 May 1998 17:48:40 +0000 Subject: ldap.c : - added support for some of the new passdb_ops functions. - removed functions that are supported "indirectly" through passdb.c nisppass.c : - modified make_nisname_from_xxx() functions to take a "file" arg. - turned getnisp21pwuid() into getnisp21pwrid(). getnisp21pwuid() functionality is available through "indirect" support in passdb.c - removed functions that are supported "indirectly" through passdb.c - added support for some of the new passdb_ops functions. passdb.c : - created getsam21pwrid() function to go alongside getsam21pwuid. it is not expected that getsam21pwuid ever be used, certainly not from the lib/rpc code. - created getsamdisprid() and getsamdispent(). these are primarily for support of SamrQueryDisplayInfo, however given that they [struct sam_disp_info] return username, rid and fullname, there may be further instances where these functions will be useful. - added support where either the get/add/mod-smb or get/add/mod-sam21 functions are optional. this can be done very easily by checking whether the struct passdb_ops table functions are NULL or not. documented this capability in the notes at the top of the module. - where unix uid was referenced, use uid_t. - where unix gid was referenced, use gid_t. smb.h : - added sam_disp_info functions to passdb_ops. - added getsam21pwrid() function. smbpass.c : - added reference to iterate_getsam21pwrid(). lib/rpc/server/srv_samr.c : - removed group rid code added to get_user_info_21() code: this had been added in the wrong place. the client / server should already know whether it wants to do a lookup by user rid or by group rid. the test of whether the rid is a user or group rid has been left in because this may become useful consistency-check code. - converted back to getsam21pwrid() not getsam21pwuid(pdb_user_rid_to_uid()). this is because the unix uid to user rid mapping can be non-monotonic in some password database systems, and monotonic in others. imposing the restriction by converting immediately from rid to uid at this point is inadviseable, and will place this potential restriction on _all_ password database systems, not just some which, for whatever reason, do not support user rids. it should be up to the individual password database writer to convert from user rid to unix uid, should that module not support rids. lib/rpc/server/srv_util.c : - got lookup_user_name() to call getsamdisprid() not getsmbpwuid(). a bug was introduced (or at least the bug already there was not fixed) whereby the nt user rid was converted to a unix uid, and then not used. (This used to be commit 0193dd21c3c44e0611add742c6f92b92474de6b8) --- source3/include/proto.h | 15 +++++++++------ source3/include/smb.h | 28 +++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 7 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 8207aa8adc..177a45c9c0 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1568,13 +1568,16 @@ BOOL mod_smbpwd_entry(struct smb_passwd* pwd, BOOL override); struct smb_passwd *getsmbpwnam(char *name); struct smb_passwd *getsmbpwuid(uid_t smb_userid); struct sam_passwd *iterate_getsam21pwnam(char *name); -struct sam_passwd *iterate_getsam21pwuid(uint32 uid); +struct sam_passwd *iterate_getsam21pwrid(uint32 rid); +struct sam_passwd *iterate_getsam21pwuid(uid_t uid); +struct sam_disp_info *getsamdisprid(uint32 rid); struct sam_disp_info *getsamdispent(void *vp); struct sam_passwd *getsam21pwent(void *vp); BOOL add_sam21pwd_entry(struct sam_passwd *newpwd); BOOL mod_sam21pwd_entry(struct sam_passwd* pwd, BOOL override); struct sam_passwd *getsam21pwnam(char *name); -struct sam_passwd *getsam21pwuid(uint32 uid); +struct sam_passwd *getsam21pwrid(uint32 rid); +struct sam_passwd *getsam21pwuid(uid_t uid); void pdb_init_dispinfo(struct sam_disp_info *user); void pdb_init_smb(struct smb_passwd *user); void pdb_init_sam(struct sam_passwd *user); @@ -1588,10 +1591,10 @@ uint16 pdb_decode_acct_ctrl(char *p); int pdb_gethexpwd(char *p, char *pwd); BOOL pdb_name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); BOOL pdb_generate_machine_sid(void); -uint32 pdb_user_rid_to_uid(uint32 u_rid); -uint32 pdb_group_rid_to_gid(uint32 u_gid); -uint32 pdb_uid_to_user_rid(uint32 uid); -uint32 pdb_gid_to_group_rid(uint32 gid); +uid_t pdb_user_rid_to_uid(uint32 u_rid); +gid_t pdb_group_rid_to_gid(uint32 g_rid); +uint32 pdb_uid_to_user_rid(uid_t uid); +uint32 pdb_gid_to_group_rid(gid_t gid); BOOL pdb_rid_is_user(uint32 rid); /*The following definitions come from password.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index fff44f179d..8687f618e4 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -637,6 +637,17 @@ struct shmem_ops { /* * Each implementation of the password database code needs * to support the following operations. + * + * either the get/mod/add-smbXXX or the get/mod/add-sam21XXX functions + * are optional, but not both. conversion routines will be called + * if only one of each is supported. the preference is to provide + * full getsam21pwXXX functionality. + * + * e.g: provide a getsam21pwnam() function but set getsmbpwnam() to NULL: + * passdb.c will automatically call getsam21pwnam() and then call the + * sam21-to-smb conversion routine if the passdb.c::getsmbpwnam() function + * is called. + * */ struct passdb_ops { @@ -647,12 +658,14 @@ struct passdb_ops { void (*endsmbpwent)(void *); unsigned long (*getsmbpwpos)(void *); BOOL (*setsmbpwpos)(void *, unsigned long); + /* * smb password database query functions. */ struct smb_passwd *(*getsmbpwnam)(char *); struct smb_passwd *(*getsmbpwuid)(uid_t); struct smb_passwd *(*getsmbpwent)(void *); + /* * smb password database modification functions. */ @@ -664,11 +677,24 @@ struct passdb_ops { */ struct sam_passwd *(*getsam21pwent)(void *); + /* + * sam password database query functions. + */ struct sam_passwd *(*getsam21pwnam)(char *); - struct sam_passwd *(*getsam21pwuid)(uint32); + struct sam_passwd *(*getsam21pwuid)(uid_t); + struct sam_passwd *(*getsam21pwrid)(uint32); + /* + * sam password database modification functions. + */ BOOL (*add_sam21pwd_entry)(struct sam_passwd *); BOOL (*mod_sam21pwd_entry)(struct sam_passwd *, BOOL); + + /* + * sam query display info functions. + */ + struct sam_disp_info *(*getsamdisprid)(uint32); + struct sam_disp_info *(*getsamdispent)(void *); }; /* this is used for smbstatus */ -- cgit From 48c7034c92452982167adc2c34049dea353c272c Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 19 May 1998 19:17:35 +0000 Subject: removed "default" system for password database api: all functions must be supported. there are some stub routines in passdb.c which can be copied into a password database api which do conversion. the module writer can choose which of these to provide full support for instead of using the conversion routines. (This used to be commit d906ac5941fa22f93a38d65906b89a80f971b83c) --- source3/include/proto.h | 3 ++- source3/include/smb.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 177a45c9c0..9256520efe 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1555,9 +1555,9 @@ BOOL pm_process( char *FileName, /*The following definitions come from passdb.c */ +BOOL initialize_password_db(void); struct smb_passwd *iterate_getsmbpwuid(uid_t smb_userid); struct smb_passwd *iterate_getsmbpwnam(char *name); -BOOL initialize_password_db(void); void *startsmbpwent(BOOL update); void endsmbpwent(void *vp); struct smb_passwd *getsmbpwent(void *vp); @@ -1570,6 +1570,7 @@ struct smb_passwd *getsmbpwuid(uid_t smb_userid); struct sam_passwd *iterate_getsam21pwnam(char *name); struct sam_passwd *iterate_getsam21pwrid(uint32 rid); struct sam_passwd *iterate_getsam21pwuid(uid_t uid); +struct sam_disp_info *getsamdispnam(char *name); struct sam_disp_info *getsamdisprid(uint32 rid); struct sam_disp_info *getsamdispent(void *vp); struct sam_passwd *getsam21pwent(void *vp); diff --git a/source3/include/smb.h b/source3/include/smb.h index 8687f618e4..cc0ce07495 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -693,6 +693,7 @@ struct passdb_ops { /* * sam query display info functions. */ + struct sam_disp_info *(*getsamdispnam)(char *); struct sam_disp_info *(*getsamdisprid)(uint32); struct sam_disp_info *(*getsamdispent)(void *); }; -- cgit From 74ea6c06f336c2d6d264afc128064c60be17c693 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 19 May 1998 19:41:22 +0000 Subject: oops - got some of the default (conversion) functions wrong. (This used to be commit b836581cda2b58d285245f71f2bc419c6ece4911) --- source3/include/proto.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 9256520efe..760f889dd9 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1822,9 +1822,6 @@ char *smb_errstr(char *inbuf); /*The following definitions come from smbpass.c */ -struct smb_passwd *getsmbfilepwent(void *vp); -BOOL mod_smbfile21pwd_entry(struct sam_passwd* pwd, BOOL override); -BOOL mod_smbfilepwd_entry(struct smb_passwd* pwd, BOOL override); struct passdb_ops *file_initialize_password_db(void); /*The following definitions come from smbpassfile.c */ -- cgit From 1b412a501e22602ac5edcd875e09bd3814b6e841 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 19 May 1998 20:08:37 +0000 Subject: passdb.c: Fixed typo in coment. smb.h: Removed comments no longer valid. smbpass.c: Stopped dummy function from being prototyped. util.c: Fix for multibyte char problems with strlower, strupper and string_replace. Jeremy. (This used to be commit cd244b45a5d35fceee2a4034b0c6aabdb58871aa) --- source3/include/smb.h | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index cc0ce07495..092cf349e5 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -637,17 +637,6 @@ struct shmem_ops { /* * Each implementation of the password database code needs * to support the following operations. - * - * either the get/mod/add-smbXXX or the get/mod/add-sam21XXX functions - * are optional, but not both. conversion routines will be called - * if only one of each is supported. the preference is to provide - * full getsam21pwXXX functionality. - * - * e.g: provide a getsam21pwnam() function but set getsmbpwnam() to NULL: - * passdb.c will automatically call getsam21pwnam() and then call the - * sam21-to-smb conversion routine if the passdb.c::getsmbpwnam() function - * is called. - * */ struct passdb_ops { -- cgit From 9c99863642d295e8b674c9c8b5eeda95bfc4d094 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 20 May 1998 13:17:26 +0000 Subject: dce/rpc net time command from jean-francois. does not support timezones (This used to be commit 8e11d542eebe076d74ab264e22b87f7aed9bbe8f) --- source3/include/proto.h | 7 +++++++ source3/include/rpc_srvsvc.h | 38 +++++++++++++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 760f889dd9..005911d1f6 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -828,6 +828,13 @@ void srv_io_q_net_srv_set_info(char *desc, SRV_Q_NET_SRV_SET_INFO *q_n, prs_str void make_srv_r_net_srv_set_info(SRV_R_NET_SRV_SET_INFO *srv, uint32 switch_value, SRV_INFO_CTR *ctr, uint32 status); void srv_io_r_net_srv_set_info(char *desc, SRV_R_NET_SRV_SET_INFO *r_n, prs_struct *ps, int depth); +void srv_io_q_net_remote_tod(char *desc, SRV_Q_NET_REMOTE_TOD *q_n, prs_struct *ps, int depth); +void srv_io_time_of_day_info(char *desc, TIME_OF_DAY_INFO *tod, prs_struct *ps, int depth); +void make_time_of_day_info(TIME_OF_DAY_INFO *tod, uint32 elapsedt, uint32 msecs, + uint32 hours, uint32 mins, uint32 secs, uint32 hunds, + uint32 zone, uint32 tintervals, uint32 day, + uint32 month, uint32 year, uint32 weekday); +void srv_io_r_net_remote_tod(char *desc, SRV_R_NET_REMOTE_TOD *r_n, prs_struct *ps, int depth); /*The following definitions come from lib/rpc/parse/parse_wks.c */ diff --git a/source3/include/rpc_srvsvc.h b/source3/include/rpc_srvsvc.h index 6ba137da2f..afcef4e168 100644 --- a/source3/include/rpc_srvsvc.h +++ b/source3/include/rpc_srvsvc.h @@ -32,7 +32,7 @@ #define SRV_NETSHAREENUM 0x0f #define SRV_NET_SRV_GET_INFO 0x15 #define SRV_NET_SRV_SET_INFO 0x16 - +#define SRV_NET_REMOTE_TOD 0x1c /* SESS_INFO_0 (pointers to level 0 session info strings) */ typedef struct ptr_sess_info0 @@ -535,6 +535,42 @@ typedef struct r_net_srv_set_info } SRV_R_NET_SRV_SET_INFO; +/* SRV_Q_NET_REMOTE_TOD */ +typedef struct q_net_remote_tod +{ + uint32 ptr_srv_name; + UNISTR2 uni_srv_name; /* "\\server" */ + +} SRV_Q_NET_REMOTE_TOD; + +/* TIME_OF_DAY_INFO */ +typedef struct time_of_day_info +{ + uint32 elapsedt; + uint32 msecs; + uint32 hours; + uint32 mins; + uint32 secs; + uint32 hunds; + uint32 zone; + uint32 tintervals; + uint32 day; + uint32 month; + uint32 year; + uint32 weekday; + +} TIME_OF_DAY_INFO; + +/* SRV_R_NET_REMOTE_TOD */ +typedef struct r_net_remote_tod +{ + uint32 ptr_srv_tod; /* pointer to TOD */ + TIME_OF_DAY_INFO *tod; + + uint32 status; /* return status */ + +} SRV_R_NET_REMOTE_TOD; + #endif /* _RPC_SRVSVC_H */ -- cgit From 6580fa6b5ce023a6bb7ce8aa9b8ab4b5c524f08b Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Fri, 22 May 1998 05:16:27 +0000 Subject: Removed all ubiqx includes from includes.h. So far, this was only a problem for dir.h, which I've fixed. Andrew did not add includes.h to the ubiqx headers, which is good because it would cause internal conflicts within the ubiqx tree modules. It's also bad because the definitions and includes that are part of includes.h are now in the ubiqx C files, but not in the header files. So, if includes.h were to redefine int, for example, the new definition would be in the ubiqx C files, but not in the headers. So, until Andrew and I can work something out that we both agree upon, there are three basic rules: 1) Don't include includes.h in the ubiqx headers. Problems may arise. 2) The ubiqx headers must follow includes.h in any Samba module that uses them. This can and should all be worked out. We just have to talk about it. Chris -)----- (This used to be commit 2b6be7084df4ddfca3a1ab7b73304007c5f9d0aa) --- source3/include/includes.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 49fb30e786..eda5afbe4e 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -1218,7 +1218,6 @@ extern char *sys_errlist[]; #include "version.h" #include "smb.h" #include "nameserv.h" -#include "ubiqx/ubi_dLinkList.h" #include "byteorder.h" -- cgit From cfc43a5a2fe65cccd9902bc28441da6c8d29f6a0 Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Fri, 22 May 1998 07:46:39 +0000 Subject: I've put the ubiqx headers back into includes.h, and removed them from dir.c & mangle.c. This was possible after I checked the tree code to make sure that the tree code did not reference functions by macro name. Also, note that the AVL module has been removed to prevent conflict with the SplayTree macro defines. Chris -)----- (This used to be commit a1f4c8567c3c5264cbfa99867fa894cafab7da81) --- source3/include/includes.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index eda5afbe4e..00f4e7ee0f 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -1385,4 +1385,12 @@ extern int errno; #endif /* MEM_MAN */ -#endif +/* -------------------------------------------------------------------------- ** + * Lists, trees, and caches... + */ +#include "ubiqx/ubi_sLinkList.h" +#include "ubiqx/ubi_dLinkList.h" +#include "ubiqx/ubi_SplayTree.h" +#include "ubiqx/ubi_Cache.h" + +#endif /* _INCLUDES_H */ -- cgit From 0f9d24f083acb5bb17d220ac6bcac833625e1f74 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 23 May 1998 02:00:21 +0000 Subject: Added more NT definitions, getting ready for nttrans code. Jeremy. (This used to be commit 26c0176e104f7345f16f7fdb1115f32e6b0cfcdb) --- source3/include/smb.h | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 092cf349e5..31935b636d 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1020,6 +1020,63 @@ struct parm_struct #define smb_nts_DataOffset (smb_vwv0 + 27) #define smb_nts_DataDisplacement (smb_vwv0 + 31) +/* these are for the NT create_and_X */ +#define smb_ntcreate_NameLength (smb_vwv0 + 5) +#define smb_ntcreate_Flags (smb_vwv0 + 7) +#define smb_ntcreate_RootDirectoryFid (smb_wvw0 + 11) +#define smb_ntcreate_DesiredAccess (smb_vwv0 + 15) +#define smb_ntcreate_AllocationSize (smb_vwv0 + 19) +#define smb_ntcreate_FileAttributes (smb_vwv0 + 27) +#define smb_ntcreate_ShareAccess (smb_vwv0 + 31) +#define smb_ntcreate_CreateDisposition (smb_vwv0 + 35) +#define smb_ntcreate_CreateOptions (smb_vwv0 + 39) +#define smb_ntcreate_ImpersonationLevel (smb_vwv0 + 43) +#define smb_ntcreate_SecurityFlags (smb_vwv0 + 47) + +/* these are the constants used in the above call. */ +/* DesiredAccess */ +#if 0 +/* TODO.... JRA */ +#define GENERIC_READ xxx? +#define GENERIC_WRITE xxx? +#endif + +/* Flags field. */ +#define REQUEST_OPLOCK 2 +#define REQUEST_BATCH_OPLOCK 4 +#define OPEN_DIRECTORY 8 + +/* ShareAccess field. */ +#define FILE_SHARE_NONE 0 /* Cannot be used in bitmask. */ +#define FILE_SHARE_READ 1 +#define FILE_SHARE_WRITE 2 +#define FILE_SHARE_DELETE 4 + +/* FileAttributesField */ +#define FILE_ATTRIBUTE_READONLY aRONLY +#define FILE_ATTRIBUTE_HIDDEN aHIDDEN +#define FILE_ATTRIBUTE_SYSTEM aSYSTEM +#define FILE_ATTRIBUTE_DIRECTORY aDIR +#define FILE_ATTRIBUTE_ARCHIVE aARCH +#define FILE_ATTRIBUTE_NORMAL 0x80L +#define FILE_ATTRIBUTE_TEMPORARY 0x100L +#define FILE_ATTRIBUTE_COMPRESSED 0x800L +/* Flags - combined with attributes. */ +#define FILE_FLAG_WRITE_THROUGH 0x80000000L +#define FILE_FLAG_NO_BUFFERING 0x20000000L +#define FILE_FLAG_RANDOM_ACCESS 0x10000000L +#define FILE_FLAG_SEQUENTIAL_SCAN 0x08000000L +#define FILE_FLAG_DELETE_ON_CLOSE 0x04000000L +#define FILE_FLAG_BACKUP_SEMANTICS 0x02000000L +#define FILE_FLAG_POSIX_SEMANTICS 0x01000000L + +/* CreateDisposition field. */ +#define CREATE_NEW 1 +#define CREATE_ALWAYS 2 +#define OPEN_EXISTING 3 +#define OPEN_ALWAYS 4 +#define TRUNCATE_EXISTING 5 + /* where to find the base of the SMB packet proper */ #define smb_base(buf) (((char *)(buf))+4) -- cgit From 684edc9fcd73d9c2059d018c4b5eb599888cfd8b Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sun, 24 May 1998 13:36:43 +0000 Subject: - created pdb_sethexpwd(), to be called from all pwd apis that need to store passwords in ascii format - dealt with lots of signed/unsigned char thingies spotted by Tim Winders. (This used to be commit bd825f1ef15c4bf12aeba945f8bfdc7fd0e14d25) --- source3/include/proto.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 005911d1f6..9af21c5637 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1596,7 +1596,8 @@ time_t pdb_get_last_set_time(char *p); void pdb_set_last_set_time(char *p, int max_len, time_t t); char *pdb_encode_acct_ctrl(uint16 acct_ctrl); uint16 pdb_decode_acct_ctrl(char *p); -int pdb_gethexpwd(char *p, char *pwd); +BOOL pdb_gethexpwd(char *p, char *pwd); +void pdb_sethexpwd(char *p, char *pwd, uint16 acct_ctrl); BOOL pdb_name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); BOOL pdb_generate_machine_sid(void); uid_t pdb_user_rid_to_uid(uint32 u_rid); -- cgit From 863c787b020eaf2dc648f51087f5ce3d2c82ab2c Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 25 May 1998 13:39:08 +0000 Subject: added set logon, logoff, kickoff etc time functions. (This used to be commit dab9728a4376cc52d6e53b09b5f42d08712330d6) --- source3/include/proto.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 9af21c5637..48cda04561 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1593,6 +1593,11 @@ struct sam_disp_info *pdb_sam_to_dispinfo(struct sam_passwd *user); struct smb_passwd *pdb_sam_to_smb(struct sam_passwd *user); struct sam_passwd *pdb_smb_to_sam(struct smb_passwd *user); time_t pdb_get_last_set_time(char *p); +void pdb_set_logon_time(char *p, int max_len, time_t t); +void pdb_set_logoff_time(char *p, int max_len, time_t t); +void pdb_set_kickoff_time(char *p, int max_len, time_t t); +void pdb_set_can_change_time(char *p, int max_len, time_t t); +void pdb_set_must_change_time(char *p, int max_len, time_t t); void pdb_set_last_set_time(char *p, int max_len, time_t t); char *pdb_encode_acct_ctrl(uint16 acct_ctrl); uint16 pdb_decode_acct_ctrl(char *p); -- cgit From 1d16f750515bcf49e0dc87394479dc56e7192538 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 26 May 1998 19:37:31 +0000 Subject: smb.h: More NT SMB stuff (just defines). smbpass.c: Do *NOT* make this function static. It breaks the compile on gcc util.c: Getting closer to MS wildcard semantics. A trailing '*' matches any trailing dot-separated components. trans2.c: Removed hacks that change multiple '?' -> '*' as this breaks things now. trans2.h: Removed NT_FILE_ATTRIBUTE_NORMAL - now FILE_ATTRIBUTE_NORMAL is defined in smb.h. Jeremy. (This used to be commit 42a65511068cd9006350c80bbed2f346f3f01cb0) --- source3/include/smb.h | 9 +++++++++ source3/include/trans2.h | 5 ----- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 31935b636d..0382cf2c71 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1037,6 +1037,15 @@ struct parm_struct /* DesiredAccess */ #if 0 /* TODO.... JRA */ +#define SPECIFIC_RIGHTS_MASK 0x00FFFFL +#define STANDARD_RIGHTS_MASK 0xFF0000L +#define DELETE_ACCESS (1L<<16) +#define READ_CONTROL_ACCESS (1L<<17) +#define WRITE_DAC_ACCESS (1L<<18) +#define WRITE_OWNER_ACCESS (1L<<19) +#define SYNCHRONIZE_ACCESS (1L<<20) +#define SYSTEM_SECURITY_ACCESS (1L<<24) + #define GENERIC_READ xxx? #define GENERIC_WRITE xxx? #endif diff --git a/source3/include/trans2.h b/source3/include/trans2.h index 62b6a1a9bf..894823602e 100644 --- a/source3/include/trans2.h +++ b/source3/include/trans2.h @@ -233,11 +233,6 @@ Byte offset Type name description #define DIRLEN_GUESS (45+MAX(l1_achName,l2_achName)) -/* NT uses a FILE_ATTRIBUTE_NORMAL when no other attributes - are set. */ - -#define NT_FILE_ATTRIBUTE_NORMAL 0x80 - #endif -- cgit From 9bd7e1e8870da87ea6f3c9e78933beeb08b65a0c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 27 May 1998 00:30:52 +0000 Subject: loadparm.c: Added machine password timeout parameter - set to 7 days be default. password.c: Added code to tell server.c when machine password needs changing. server.c: Change machine password in idle cycles if it needs it. smbpassfile.c: Fixed up length calculations for machine password file. smbpasswd.c: Moved domain joining code/machine password changing code. lib/rpc/client/cli_netlogon.c: And this is where it now lives. Jeremy. (This used to be commit b8fedca6191de96159df0d1d17082d82e8e44773) --- source3/include/proto.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 48cda04561..3086c6cd24 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -250,6 +250,7 @@ BOOL cli_net_srv_pwset(struct cli_state *cli, uint8 hashed_mach_pwd[16]); BOOL cli_net_sam_logon(struct cli_state *cli, NET_ID_INFO_CTR *ctr, NET_USER_INFO_3 *user_info3); BOOL cli_net_sam_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr); +BOOL change_trust_account_password( char *domain, char *remote_machine_list); /*The following definitions come from lib/rpc/client/cli_pipe.c */ @@ -1017,6 +1018,7 @@ int lp_client_code_page(void); int lp_announce_as(void); int lp_lm_announce(void); int lp_lm_interval(void); +int lp_machine_password_timeout(void); int lp_ldap_port(void); char *lp_preexec(int ); char *lp_postexec(int ); -- cgit From ad53f02511506e75f4f656b4164e12da4a7aafe7 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 27 May 1998 22:48:22 +0000 Subject: Newly re-written do_match and mask_match functions, with the help of Ums Harald , who has been testing our 8.3 wildcards with a test suite. With his new code for 8.3 matching, this is the test done (I'm quoting from his email) "I tested it by generating a directory with about 7600 Files and run automatc tests with about 4000 patterns. The result from Win95 -> WinNT and Win95 -> Samba where identical according to diff." I have also re-written the long filename wildcard code, so that doing DIR a*z now matches files : AAA.BBB.CCCC....ZZZZ correctly, and other fixes besides. I sincerely hope I can lay this (horrid) issue to rest now :-). Jeremy. (This used to be commit 94e3f0d9b48c1ac6d9235eb6600aff1c47e024bc) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 3086c6cd24..44821405d4 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2013,6 +2013,7 @@ BOOL string_init(char **dest,char *src); void string_free(char **s); BOOL string_set(char **dest,char *src); BOOL string_sub(char *s,char *pattern,char *insert); +BOOL mask_match(char *str, char *regexp, int case_sig, BOOL trans2); BOOL do_match(char *str, char *regexp, int case_sig); BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2); void become_daemon(void); -- cgit From 459ecfec832c872f4186c06de4917f19e8f0ef98 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 27 May 1998 23:50:30 +0000 Subject: Ooops - fixed Win95 crash bugs with earlier code. Jeremy (This used to be commit 6baeb4ad96bc58cf1bd53f6621067af8344c9556) --- source3/include/proto.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 44821405d4..3086c6cd24 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2013,7 +2013,6 @@ BOOL string_init(char **dest,char *src); void string_free(char **s); BOOL string_set(char **dest,char *src); BOOL string_sub(char *s,char *pattern,char *insert); -BOOL mask_match(char *str, char *regexp, int case_sig, BOOL trans2); BOOL do_match(char *str, char *regexp, int case_sig); BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2); void become_daemon(void); -- cgit From ffe91d6443f2a3e19977ed97167dd100a42a3e9a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 1 Jun 1998 18:50:27 +0000 Subject: clientutil.c: Don't core dump if no controlling terminal available for password. passdb.c: lib/rpc/include/rpc_misc.h: First cut at automatic uid/gid to rid mapping. We can change this at a later date to make more bits available if neccessary. Jeremy. (This used to be commit 34f40474aba97118e1e80fe6259c686e46dc16b4) --- source3/include/proto.h | 1 + source3/include/rpc_misc.h | 13 +++++++++++++ 2 files changed, 14 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 3086c6cd24..ff44a5841f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1611,6 +1611,7 @@ uid_t pdb_user_rid_to_uid(uint32 u_rid); gid_t pdb_group_rid_to_gid(uint32 g_rid); uint32 pdb_uid_to_user_rid(uid_t uid); uint32 pdb_gid_to_group_rid(gid_t gid); +BOOL pdb_rid_is_well_known(uint32 rid); BOOL pdb_rid_is_user(uint32 rid); /*The following definitions come from password.c */ diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 7406916cce..e8ffcd4a16 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -62,6 +62,19 @@ #define DOMAIN_ALIAS_RID_REPLICATOR (0x00000228L) +/* + * Masks for mappings between unix uid and gid types and + * NT RIDS. + */ + +/* Take the 3 bottom bits. */ +#define RID_TYPE_MASK 7 +#define RID_MULTIPLIER 8 + +/* The two common types for now. */ +#define USER_RID_TYPE 0 +#define GROUP_RID_TYPE 1 + /* ENUM_HND */ typedef struct enum_hnd_info { -- cgit From c435955b02c7fc227b9475ff73c62e080d34a1af Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 3 Jun 1998 01:04:45 +0000 Subject: ipc.c: Fix bug where we don't return the correct error code when client gives a too-small buffer for share info. Fix from Gil Kloepfer smb.h: server.c: Fix for a nastly little security problem with multi-user Windows NT servers and Samba where the contents of the open-file cache can end up being served out to users who shouldn't have access. This is some *seriously* ugly code. Jeremy. (This used to be commit 05c85df3c7da982085615e5a1db6c71e164db4f5) --- source3/include/smb.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 0382cf2c71..cdac9cb720 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -433,6 +433,8 @@ typedef struct typedef struct { uint16 ref_count; + uint16 uid_cache_count; + uid_t uid_users_cache[10]; uint32 dev; uint32 inode; int fd; -- cgit From 52c69766ea495f08a907c6ca76b1cef8df8c5d7c Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Wed, 3 Jun 1998 21:38:51 +0000 Subject: It occurred to me that the samba includes.h file should be included in the header files used by the ubiqx modules, instead of being hidden in the .c files. This would ensure that anything in includes.h would be "seen" by the ubiqx headers. I also had to put an #ifdef around the includes for ubi_SplayTree.h and ubi_Cache.h in includes.h to prevent the header of the descendant type from being included before its parent type. Chris -)----- (This used to be commit e30a7e023b7491c01e052ae3dbd1788f84075413) --- source3/include/includes.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 00f4e7ee0f..5054c2ee5b 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -1386,11 +1386,14 @@ extern int errno; /* -------------------------------------------------------------------------- ** - * Lists, trees, and caches... + * Lists, trees, and caching... */ #include "ubiqx/ubi_sLinkList.h" #include "ubiqx/ubi_dLinkList.h" + +#ifndef UBI_BINTREE_H #include "ubiqx/ubi_SplayTree.h" #include "ubiqx/ubi_Cache.h" +#endif /* UBI_BINTREE_H */ #endif /* _INCLUDES_H */ -- cgit From a1c66b009ff2d6ac16b43f2af8eeaea67abb6414 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 4 Jun 1998 00:49:32 +0000 Subject: includes.h: Fixes for NetBSD and BSDI. smbpass.c: Fixed irix warnings. Jeremy. (This used to be commit 2caefb35ff56dba67968d04755d74238a38ba29d) --- source3/include/includes.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 5054c2ee5b..74000a83ba 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -508,6 +508,7 @@ char *mktemp(char *); /* No standard include */ #include #define SIGNAL_CAST (void (*)()) #define USE_DIRECT +#define QSORT_CAST (int (*)(const void *, const void *)) #endif @@ -521,6 +522,8 @@ char *mktemp(char *); /* No standard include */ #include #endif /* NetBSD1_3 */ #include +#include +#include /* you may not need this */ #define NO_GETSPNAM #define SIGNAL_CAST (void (*)()) -- cgit From 59e2992139774762456826f6667e73f2b39828d8 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 4 Jun 1998 15:24:20 +0000 Subject: added "domain admin group" and "domain guest group" parameters. this is because "domain admin users" and "domain guest users" was overloaded. incorrectly. (This used to be commit 04b824007263ac4879c7282a2d230deaac7d2c7b) --- source3/include/proto.h | 2 ++ source3/include/smb.h | 9 +++++++++ 2 files changed, 11 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index ff44a5841f..737ae94571 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -956,6 +956,8 @@ char *lp_driverfile(void); char *lp_domain_sid(void); char *lp_domain_other_sids(void); char *lp_domain_groups(void); +char *lp_domain_admin_group(void); +char *lp_domain_guest_group(void); char *lp_domain_admin_users(void); char *lp_domain_guest_users(void); char *lp_domain_hostsallow(void); diff --git a/source3/include/smb.h b/source3/include/smb.h index cdac9cb720..214b36e704 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -687,6 +687,15 @@ struct passdb_ops { struct sam_disp_info *(*getsamdispnam)(char *); struct sam_disp_info *(*getsamdisprid)(uint32); struct sam_disp_info *(*getsamdispent)(void *); + +#if 0 + /* + * password checking functions + */ + struct smb_passwd *(*smb_password_chal )(char *username, char lm_pass[24], char nt_pass[24], char chal[8]); + struct smb_passwd *(*smb_password_check )(char *username, char lm_hash[16], char nt_hash[16], + struct passwd *(*unix_password_check)(char *username, char *pass, int pass_len); +#endif }; /* this is used for smbstatus */ -- cgit From 1b85da9a1cd91c4d658ea50f1ed6545e85a0199a Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 4 Jun 1998 17:48:21 +0000 Subject: had what would be a compile error if it wasn't #if 0'd out in passdb_ops (This used to be commit 2cb94eec59bdcc1272063637bbc8b7a5449fdc62) --- source3/include/smb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 214b36e704..dfbe213e57 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -693,7 +693,7 @@ struct passdb_ops { * password checking functions */ struct smb_passwd *(*smb_password_chal )(char *username, char lm_pass[24], char nt_pass[24], char chal[8]); - struct smb_passwd *(*smb_password_check )(char *username, char lm_hash[16], char nt_hash[16], + struct smb_passwd *(*smb_password_check )(char *username, char lm_hash[16], char nt_hash[16]); struct passwd *(*unix_password_check)(char *username, char *pass, int pass_len); #endif }; -- cgit From 6d53920d8a94eae92a5f061eeb99b7cdfac76228 Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Mon, 8 Jun 1998 19:38:57 +0000 Subject: proto.h *Not* the usual. I did make proto to add the #ifndef..#endif block. Just to be safe, I did a cvs diff and found no prototype changes. ubiqx/sys_includes.h More fudging. I want to use binary tree typdefs in nameserv.h, but nameserv.h is included in includes.h which is included by all of the ubiqx modules. The result is that the types are referenced before they are declared. My solution is to prevent nameserv.h and proto.h from being included in the ubiqx modules (where they are not needed anyway). Chris -)----- (This used to be commit f128fda8e6abdbd9ae661dd17684580969ef5068) --- source3/include/proto.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 737ae94571..030528c032 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1,3 +1,5 @@ +#ifndef _PROTO_H_ +#define _PROTO_H_ /* This file is automatically generated with "make proto". DO NOT EDIT */ @@ -2115,3 +2117,4 @@ void status_page(void); /*The following definitions come from web/swat.c */ int main(int argc, char *argv[]); +#endif /* _PROTO_H_ */ -- cgit From ae260b9688676afc712fec0890b3cd79dfb53331 Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Mon, 8 Jun 1998 20:07:40 +0000 Subject: Moved the ubiqx stuff above nameserv.h so that ubiqx typedefs could be seen by the nameserve.h header. (This used to be commit 530b54b8a2234a72d7a12606bff38648e56c5c1c) --- source3/include/includes.h | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 74000a83ba..4164d408c9 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -1218,6 +1218,12 @@ extern char *sys_errlist[]; #define MAXHOSTNAMELEN 255 #endif +/* Lists, trees, caching, datbase... */ +#include "ubiqx/ubi_dLinkList.h" +#ifndef UBI_BINTREE_H +#include "ubiqx/ubi_Cache.h" +#endif /* UBI_BINTREE_H */ + #include "version.h" #include "smb.h" #include "nameserv.h" @@ -1387,16 +1393,4 @@ extern int errno; #include "mem_man/mem_man.h" #endif /* MEM_MAN */ - -/* -------------------------------------------------------------------------- ** - * Lists, trees, and caching... - */ -#include "ubiqx/ubi_sLinkList.h" -#include "ubiqx/ubi_dLinkList.h" - -#ifndef UBI_BINTREE_H -#include "ubiqx/ubi_SplayTree.h" -#include "ubiqx/ubi_Cache.h" -#endif /* UBI_BINTREE_H */ - #endif /* _INCLUDES_H */ -- cgit From 96bc4042779570e6239b2626888ea0ca9be17391 Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Tue, 9 Jun 1998 01:56:18 +0000 Subject: This is a first step toward moving long namelists into a database. I split the name_record structure into pieces. The goal is that the key (the name) be separate from the data associated with the key. Databases such as gdbm store information in [key,content] pairs. There is no functional change in with this update. It's just a step in the direction that Jeremy and I have been discussing. Chris -)----- (This used to be commit e420a4bd7d368a0e910893400fb7b46ab8694a08) --- source3/include/nameserv.h | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 7faad9aff4..f1707115ca 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -85,16 +85,16 @@ enum netbios_reply_type_code { NMB_QUERY, NMB_STATUS, NMB_REG, NMB_REG_REFRESH, #define NB_FLGMSK 0xE0 /* NetBIOS flag identifier. */ -#define NAME_GROUP(p) ((p)->nb_flags & NB_GROUP) -#define NAME_BFLAG(p) (((p)->nb_flags & NB_NODETYPEMASK) == NB_BFLAG) -#define NAME_PFLAG(p) (((p)->nb_flags & NB_NODETYPEMASK) == NB_PFLAG) -#define NAME_MFLAG(p) (((p)->nb_flags & NB_NODETYPEMASK) == NB_MFLAG) -#define NAME_HFLAG(p) (((p)->nb_flags & NB_NODETYPEMASK) == NB_HFLAG) +#define NAME_GROUP(p) ((p)->data.nb_flags & NB_GROUP) +#define NAME_BFLAG(p) (((p)->data.nb_flags & NB_NODETYPEMASK) == NB_BFLAG) +#define NAME_PFLAG(p) (((p)->data.nb_flags & NB_NODETYPEMASK) == NB_PFLAG) +#define NAME_MFLAG(p) (((p)->data.nb_flags & NB_NODETYPEMASK) == NB_MFLAG) +#define NAME_HFLAG(p) (((p)->data.nb_flags & NB_NODETYPEMASK) == NB_HFLAG) /* Samba name state for a name in a namelist. */ -#define NAME_IS_ACTIVE(p) ((p)->nb_flags & NB_ACTIVE) -#define NAME_IN_CONFLICT(p) ((p)->nb_flags & NB_CONFL) -#define NAME_IS_DEREGISTERING(p) ((p)->nb_flags & NB_DEREG) +#define NAME_IS_ACTIVE(p) ((p)->data.nb_flags & NB_ACTIVE) +#define NAME_IN_CONFLICT(p) ((p)->data.nb_flags & NB_CONFL) +#define NAME_IS_DEREGISTERING(p) ((p)->data.nb_flags & NB_DEREG) /* Error codes for NetBIOS requests. */ #define FMT_ERR 0x1 /* Packet format error. */ @@ -168,22 +168,17 @@ enum logon_state LOGON_SRV }; +struct subnet_record; + /* A netbios name structure. */ struct nmb_name { - char name[17]; - char scope[64]; + char name[17]; + char scope[64]; unsigned int name_type; }; -/* This is the structure used for the local netbios name list. */ -struct name_record +struct nmb_data { - struct name_record *next; - struct name_record *prev; - - struct subnet_record *subnet; - - struct nmb_name name; /* The netbios name. */ uint16 nb_flags; /* Netbios flags. */ int num_ips; /* Number of ip entries. */ struct in_addr *ip; /* The ip list for this name. */ @@ -194,7 +189,15 @@ struct name_record time_t refresh_time; /* The time the record should be refreshed. */ }; -struct subnet_record; +/* This is the structure used for the local netbios name list. */ +struct name_record +{ + struct name_record *next; + struct name_record *prev; + struct subnet_record *subnet; + struct nmb_name name; /* The netbios name. */ + struct nmb_data data; /* The netbios data. */ +}; /* Browser cache for synchronising browse lists. */ struct browse_cache_record -- cgit From 75e909f27db1e1ff69897e477a2c4704faf9a2fb Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 9 Jun 1998 02:17:06 +0000 Subject: Fixed compile problem after make proto. Chris's reformating of the (rather long named function) find_name_for_remote_broadcast_subnet (moving the function name onto a line on it's own) caused the proto awk script to miss it. Jeremy. (This used to be commit 17c758687f0ec6040633bc1815a52627b7e15f02) --- source3/include/proto.h | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 030528c032..9ad6e6b183 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1313,14 +1313,14 @@ void refresh_my_names(time_t t); /*The following definitions come from nmbd_namelistdb.c */ void set_samba_nb_type(void); -BOOL ms_browser_name(char *name, int type); -void remove_name_from_namelist(struct subnet_record *subrec, - struct name_record *namerec); +BOOL ms_browser_name( char *name, int type ); +void remove_name_from_namelist( struct subnet_record *subrec, + struct name_record *namerec ); struct name_record *find_name_on_subnet(struct subnet_record *subrec, struct nmb_name *nmbname, BOOL self_only); -struct name_record *find_name_for_remote_broadcast_subnet( struct nmb_name *nmbname, - BOOL self_only); -void update_name_ttl(struct name_record *namerec, int ttl); +struct name_record *find_name_for_remote_broadcast_subnet( struct nmb_name *nmbname, + BOOL self_only ); +void update_name_ttl( struct name_record *namerec, int ttl ); struct name_record *add_name_to_subnet(struct subnet_record *subrec, char *name, int type, uint16 nb_flags, int ttl, enum name_source source, int num_ips, struct in_addr *iplist); @@ -1328,17 +1328,20 @@ void standard_success_register(struct subnet_record *subrec, struct userdata_struct *userdata, struct nmb_name *nmbname, uint16 nb_flags, int ttl, struct in_addr registered_ip); -void standard_fail_register(struct subnet_record *subrec, - struct response_record *rrec, struct nmb_name *nmbname); -BOOL find_ip_in_name_record(struct name_record *namerec, struct in_addr ip); +void standard_fail_register( struct subnet_record *subrec, + struct response_record *rrec, + struct nmb_name *nmbname ); +BOOL find_ip_in_name_record( struct name_record *namerec, struct in_addr ip ); void add_ip_to_name_record(struct name_record *namerec, struct in_addr new_ip); -void remove_ip_from_name_record( struct name_record *namerec, struct in_addr remove_ip); -void standard_success_release(struct subnet_record *subrec, - struct userdata_struct *userdata, - struct nmb_name *nmbname, struct in_addr released_ip); +void remove_ip_from_name_record( struct name_record *namerec, + struct in_addr remove_ip ); +void standard_success_release( struct subnet_record *subrec, + struct userdata_struct *userdata, + struct nmb_name *nmbname, + struct in_addr released_ip ); void expire_names_on_subnet(struct subnet_record *subrec, time_t t); void expire_names(time_t t); -void add_samba_names_to_subnet(struct subnet_record *subrec); +void add_samba_names_to_subnet( struct subnet_record *subrec ); void dump_all_namelists(void); /*The following definitions come from nmbd_namequery.c */ -- cgit From e85295d9241bcdad3723898ab8ad88d8f11d5f28 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 9 Jun 1998 02:26:26 +0000 Subject: loadparm.c: Removed 'domain other sids' parameter. lib/rpc/include/rpc_lsa.h: Changed #defines for RPC calls - moved some, made LSA_LOOKUPNAMES correct. lib/rpc/include/rpc_misc.h: Changed DOMAIN_ALIAS_xxx to BUILTIN_ALIAS_xxx. Changed bitmasks for uid to rid to be 1 bit. lib/rpc/parse/parse_misc.c: Changed make_unistr2 to put length as given, max length as one more. lib/rpc/server/srv_netlog.c: Removed 'domain other sids' parameter. lib/rpc/server/srv_samr.c: Changed DOMAIN_ALIAS_xxx to BUILTIN_ALIAS_xxx. lib/rpc/server/srv_util.c: Changed DOMAIN_ALIAS_xxx to BUILTIN_ALIAS_xxx. Jeremy. (This used to be commit 34c91840a3d8c252715dc2f749b7a3b171a5b74f) --- source3/include/rpc_lsa.h | 8 ++++---- source3/include/rpc_misc.h | 26 +++++++++++++------------- 2 files changed, 17 insertions(+), 17 deletions(-) (limited to 'source3/include') diff --git a/source3/include/rpc_lsa.h b/source3/include/rpc_lsa.h index 008f8866c0..39f42dcd56 100644 --- a/source3/include/rpc_lsa.h +++ b/source3/include/rpc_lsa.h @@ -34,16 +34,16 @@ enum SID_NAME_USE }; /* ntlsa pipe */ -#define LSA_OPENPOLICY 0x2c +#define LSA_CLOSE 0x00 #define LSA_QUERYINFOPOLICY 0x07 #define LSA_ENUMTRUSTDOM 0x0d -#define LSA_CLOSE 0x00 -#define LSA_OPENSECRET 0x1C +#define LSA_LOOKUPNAMES 0x0e #define LSA_LOOKUPSIDS 0x0f +#define LSA_OPENPOLICY 0x2c +#define LSA_OPENSECRET 0x1C /* XXXX these are here to get a compile! */ #define LSA_LOOKUPRIDS 0xFD -#define LSA_LOOKUPNAMES 0xFC #define LSA_MAX_GROUPS 32 #define LSA_MAX_SIDS 32 diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index e8ffcd4a16..3e1a6052b5 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -50,28 +50,28 @@ #define DOMAIN_GROUP_RID_GUESTS (0x00000202L) /* RIDs - well-known aliases ... */ -#define DOMAIN_ALIAS_RID_ADMINS (0x00000220L) -#define DOMAIN_ALIAS_RID_USERS (0x00000221L) -#define DOMAIN_ALIAS_RID_GUESTS (0x00000222L) -#define DOMAIN_ALIAS_RID_POWER_USERS (0x00000223L) +#define BUILTIN_ALIAS_RID_ADMINS (0x00000220L) +#define BUILTIN_ALIAS_RID_USERS (0x00000221L) +#define BUILTIN_ALIAS_RID_GUESTS (0x00000222L) +#define BUILTIN_ALIAS_RID_POWER_USERS (0x00000223L) -#define DOMAIN_ALIAS_RID_ACCOUNT_OPS (0x00000224L) -#define DOMAIN_ALIAS_RID_SYSTEM_OPS (0x00000225L) -#define DOMAIN_ALIAS_RID_PRINT_OPS (0x00000226L) -#define DOMAIN_ALIAS_RID_BACKUP_OPS (0x00000227L) +#define BUILTIN_ALIAS_RID_ACCOUNT_OPS (0x00000224L) +#define BUILTIN_ALIAS_RID_SYSTEM_OPS (0x00000225L) +#define BUILTIN_ALIAS_RID_PRINT_OPS (0x00000226L) +#define BUILTIN_ALIAS_RID_BACKUP_OPS (0x00000227L) -#define DOMAIN_ALIAS_RID_REPLICATOR (0x00000228L) +#define BUILTIN_ALIAS_RID_REPLICATOR (0x00000228L) /* * Masks for mappings between unix uid and gid types and * NT RIDS. */ -/* Take the 3 bottom bits. */ -#define RID_TYPE_MASK 7 -#define RID_MULTIPLIER 8 +/* Take the bottom bit. */ +#define RID_TYPE_MASK 1 +#define RID_MULTIPLIER 2 -/* The two common types for now. */ +/* The two common types. */ #define USER_RID_TYPE 0 #define GROUP_RID_TYPE 1 -- cgit From d4366df039dfd730fe24c95b9ef7d59306f35309 Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Wed, 10 Jun 1998 19:51:58 +0000 Subject: I've replaced the linked list used to manage the subnet namelists with a splay tree. For short lists, this will have no noticable effect. As lists (eg. the WINS database) grow longer, the speed improvements should be quite dramatic. This change is an incremental step toward replacing the in-memory namelists with a back-end database. This change is going into the 1.9.19pre-alpha code because...well...it's pre-alpha. Please let me know if there are any problems. (Oh, as a side-effect, the wins.dat will be in sorted order. :) Chris -)----- (This used to be commit 7806c453df02a89f67e7c5c8b91f24aa2274e756) --- source3/include/nameserv.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index f1707115ca..0ba7acda18 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -191,13 +191,13 @@ struct nmb_data /* This is the structure used for the local netbios name list. */ struct name_record -{ - struct name_record *next; - struct name_record *prev; + { + ubi_trNode node[1]; + struct subnet_record *subnet; - struct nmb_name name; /* The netbios name. */ - struct nmb_data data; /* The netbios data. */ -}; + struct nmb_name name; /* The netbios name. */ + struct nmb_data data; /* The netbios data. */ + }; /* Browser cache for synchronising browse lists. */ struct browse_cache_record @@ -404,9 +404,9 @@ struct subnet_record char *subnet_name; /* For Debug identification. */ enum subnet_type type; /* To catagorize the subnet. */ - struct work_record *workgrouplist; /* List of workgroups. */ - struct name_record *namelist; /* List of netbios names. */ - struct response_record *responselist; /* List of responses expected. */ + struct work_record *workgrouplist; /* List of workgroups. */ + ubi_trRoot namelist[1]; /* List of netbios names. */ + struct response_record *responselist; /* List of responses expected. */ BOOL namelist_changed; BOOL work_changed; -- cgit From cd3de05fb53852cd0951cf7c9bc44ea0fbd66276 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 10 Jun 1998 23:15:42 +0000 Subject: Minor changes as I've now discovered gcc -pedantic-errors. This does the signed/unsigned warnings I've been missing. Jeremy (This used to be commit 6d94e67624d1f2c08ac2e1c0eea23facd1e618f2) --- source3/include/proto.h | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 9ad6e6b183..7dd4918028 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1314,16 +1314,25 @@ void refresh_my_names(time_t t); void set_samba_nb_type(void); BOOL ms_browser_name( char *name, int type ); +void update_name_in_namelist( struct subnet_record *subrec, + struct name_record *namerec ); void remove_name_from_namelist( struct subnet_record *subrec, - struct name_record *namerec ); -struct name_record *find_name_on_subnet(struct subnet_record *subrec, - struct nmb_name *nmbname, BOOL self_only); -struct name_record *find_name_for_remote_broadcast_subnet( struct nmb_name *nmbname, - BOOL self_only ); + struct name_record *namerec ); +struct name_record *find_name_on_subnet( struct subnet_record *subrec, + struct nmb_name *nmbname, + BOOL self_only ); +struct name_record *find_name_for_remote_broadcast_subnet( + struct nmb_name *nmbname, + BOOL self_only ); void update_name_ttl( struct name_record *namerec, int ttl ); -struct name_record *add_name_to_subnet(struct subnet_record *subrec, - char *name, int type, uint16 nb_flags, int ttl, - enum name_source source, int num_ips, struct in_addr *iplist); +struct name_record *add_name_to_subnet( struct subnet_record *subrec, + char *name, + int type, + uint16 nb_flags, + int ttl, + enum name_source source, + int num_ips, + struct in_addr *iplist); void standard_success_register(struct subnet_record *subrec, struct userdata_struct *userdata, struct nmb_name *nmbname, uint16 nb_flags, int ttl, @@ -1332,7 +1341,7 @@ void standard_fail_register( struct subnet_record *subrec, struct response_record *rrec, struct nmb_name *nmbname ); BOOL find_ip_in_name_record( struct name_record *namerec, struct in_addr ip ); -void add_ip_to_name_record(struct name_record *namerec, struct in_addr new_ip); +void add_ip_to_name_record( struct name_record *namerec, struct in_addr new_ip ); void remove_ip_from_name_record( struct name_record *namerec, struct in_addr remove_ip ); void standard_success_release( struct subnet_record *subrec, @@ -1505,6 +1514,7 @@ void write_browse_list(time_t t, BOOL force_write); /*The following definitions come from nmbd_subnetdb.c */ +int namelist_entry_compare( ubi_trItemPtr Item, ubi_trNodePtr Node ); BOOL create_subnets(void); BOOL we_are_a_wins_client(void); struct subnet_record *get_next_subnet_maybe_unicast(struct subnet_record *subrec); -- cgit From e6e4a63113b756ac637e2584e31e2f2d0f92b4d0 Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Thu, 11 Jun 1998 04:40:14 +0000 Subject: Removed directory-relative include references. This required that I add a -I$(srcdir)ubiqx to CFLAGS in the Makefile. It might be better to create a UBIDIR value. What would people like to see? Chris -)----- (This used to be commit 7fb9cf4d57eb6ec8f22bc62a7a38d4d71dfaadc6) --- source3/include/includes.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 4164d408c9..98854bee82 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -1219,9 +1219,9 @@ extern char *sys_errlist[]; #endif /* Lists, trees, caching, datbase... */ -#include "ubiqx/ubi_dLinkList.h" +#include "ubi_dLinkList.h" #ifndef UBI_BINTREE_H -#include "ubiqx/ubi_Cache.h" +#include "ubi_Cache.h" #endif /* UBI_BINTREE_H */ #include "version.h" -- cgit From 9a735eb7e25d8bf6c5be7775d89436034ea6be8a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 12 Jun 1998 03:08:23 +0000 Subject: ipc.c: map_username is now a BOOL function. reply.c: map_username is now a BOOL function. server.c: Added capability to do map_username on service names when looking for a home directory. That's what the original code would do. lib/rpc/server/srv_util.c: Changed domain_ to builtin_ for BUILTIN aliases. username.c: Work in progress on groupname map parameter. Jeremy (This used to be commit fa95fae5eed95aff64f0a01825477610a101bbc7) --- source3/include/proto.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 7dd4918028..9381aacf84 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1939,9 +1939,10 @@ void unbecome_root(BOOL restore_dir); /*The following definitions come from username.c */ char *get_home_dir(char *user); -void map_username(char *user); +BOOL map_username(char *user); struct passwd *Get_Pwnam(char *user,BOOL allow_change); BOOL user_in_list(char *user,char *list); +void load_groupname_map(void); /*The following definitions come from util.c */ -- cgit From 860f674c0deefca62f3c918cf657a902f4b73dd8 Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Fri, 12 Jun 1998 03:11:33 +0000 Subject: This is the first, small step toward some tweaks that Jeremy and I have been discussing regarding the debug mechanism. With this, I've added a macro that allows syntax like: if( DEBUGLVL( 3 ) ) { Debug1( "message" ); Debug2( "message" ); } The next step is to incorporate timestamps. Chris -)----- (This used to be commit 0b35065d0c5a33a9eebee683ecb08e9aef4c1830) --- source3/include/smb.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index dfbe213e57..085c06769b 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -100,10 +100,12 @@ typedef unsigned int uint32; /* debugging code */ #ifndef SYSLOG #define DEBUG(level,body) ((DEBUGLEVEL>=(level))?(Debug1 body):0) +#define DEBUGLVL(level) (DEBUGLEVEL>=(level)) #else extern int syslog_level; #define DEBUG(level,body) ((DEBUGLEVEL>=(level))? (syslog_level = (level), Debug1 body):0) +#define DEBUGLVL(level) ( DEBUGLEVEL >= (syslog_level=(level)) ) #endif /* this defines the error codes that receive_smb can put in smb_read_error */ -- cgit From 5b5eb35c91ec400a25f6e6cf3eec421bd9560d50 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 13 Jun 1998 03:04:00 +0000 Subject: Makefile: Added ubi_sLinkList.o as the groupname.o file needs it. Added groupname.o includes.h: Added ubi_sLinkList.h include. loadparm.c: Added groupname map parameter. password.c: Fix HPUX big_crypt. username.c: New user_in_list() code. Moved groupname map code to groupname.c lib/rpc/server/srv_util.c: Added lookup_wellknown_sid_from_name(). New groupname map stuff. Note that nothing currently uses this but at compiles ok. Jeremy. (This used to be commit beef636a4d772457816ef068c62ea965d07131f6) --- source3/include/includes.h | 1 + source3/include/proto.h | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 98854bee82..dae97b121b 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -1219,6 +1219,7 @@ extern char *sys_errlist[]; #endif /* Lists, trees, caching, datbase... */ +#include "ubi_sLinkList.h" #include "ubi_dLinkList.h" #ifndef UBI_BINTREE_H #include "ubi_Cache.h" diff --git a/source3/include/proto.h b/source3/include/proto.h index 9381aacf84..6938be6367 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -200,6 +200,10 @@ void generate_random_buffer( unsigned char *out, int len, BOOL re_seed); char *getsmbpass(char *prompt) ; +/*The following definitions come from groupname.c */ + +void load_groupname_map(void); + /*The following definitions come from interface.c */ void load_interfaces(void); @@ -902,6 +906,7 @@ BOOL api_srvsvc_rpc(pipes_struct *p, prs_struct *data); /*The following definitions come from lib/rpc/server/srv_util.c */ +BOOL lookup_wellknown_sid_from_name(char *windows_name, DOM_SID *psid); int make_dom_gids(char *gids_str, DOM_GID **ppgids); BOOL create_rpc_reply(pipes_struct *p, uint32 data_start, uint32 data_end); @@ -941,6 +946,7 @@ char *lp_passwordserver(void); char *lp_name_resolve_order(void); char *lp_workgroup(void); char *lp_username_map(void); +char *lp_groupname_map(void); char *lp_character_set(void); char *lp_logon_script(void); char *lp_logon_path(void); @@ -1942,7 +1948,6 @@ char *get_home_dir(char *user); BOOL map_username(char *user); struct passwd *Get_Pwnam(char *user,BOOL allow_change); BOOL user_in_list(char *user,char *list); -void load_groupname_map(void); /*The following definitions come from util.c */ -- cgit From 644fbaaf9ba38a5f3d60f27f7110e755b20d31e7 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 15 Jun 1998 18:19:54 +0000 Subject: Makefile: smbumount.c: Added fixes to compile under Linux. includes.h: Added SunOS 4.x QSORT_CAST fix. reply.c: Fixed user name mapping function for security=server, security=domain. Jeremy. (This used to be commit 21ca6bfb3ba3927efaf7eeff4325976d41489be2) --- source3/include/includes.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index dae97b121b..ea09dcb367 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -293,6 +293,9 @@ typedef unsigned short mode_t; /* SunOS doesn't have POSIX atexit */ #define atexit on_exit #define NOSTRCASECMP +#ifndef QSORT_CAST +#define QSORT_CAST (int (*)(const void *, const void *)) +#endif /* QSORT_CAST */ #endif -- cgit From 7ed5a181ac836f2f88e1525723dd6197ca3a9084 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 15 Jun 1998 22:02:14 +0000 Subject: client.c: Made -L do a null-session share unless -U user is specified. clientutil.c: Fixed NT session to add NT password. groupname.c: Added lookup function. Jeremy. (This used to be commit 8216363e83fcdccfade70f983830b56b7e6546a4) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 6938be6367..5ff9df5a5f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -203,6 +203,7 @@ char *getsmbpass(char *prompt) ; /*The following definitions come from groupname.c */ void load_groupname_map(void); +void map_gid_to_sid( gid_t gid, DOM_SID *psid); /*The following definitions come from interface.c */ -- cgit From cb757820f5452d192ce3b1eeb4f19a17ee93c3fe Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 16 Jun 1998 01:35:52 +0000 Subject: Added SSL support from Christian Starkjohann This patch may not yet compile with -DUSE_SSL enabled, further Makefile changes may be needed. But it was important to get this code in place before I go off to USENIX. Jeremy. (This used to be commit 31e768369fdc61e07c59630c86c62239f3d3f3f7) --- source3/include/proto.h | 14 ++++++++++++++ source3/include/smb.h | 4 ++++ 2 files changed, 18 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 5ff9df5a5f..1758301ef4 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -976,6 +976,20 @@ char *lp_ldap_suffix(void); char *lp_ldap_filter(void); char *lp_ldap_root(void); char *lp_ldap_rootpasswd(void); +int lp_ssl_version(void); +char *lp_ssl_hosts(void); +char *lp_ssl_hosts_resign(void); +char *lp_ssl_cacertdir(void); +char *lp_ssl_cacertfile(void); +char *lp_ssl_cert(void); +char *lp_ssl_privkey(void); +char *lp_ssl_client_cert(void); +char *lp_ssl_client_privkey(void); +char *lp_ssl_ciphers(void); +BOOL lp_ssl_enabled(void); +BOOL lp_ssl_reqClientCert(void); +BOOL lp_ssl_reqServerCert(void); +BOOL lp_ssl_compatibility(void); BOOL lp_dns_proxy(void); BOOL lp_wins_support(void); BOOL lp_we_are_a_wins_server(void); diff --git a/source3/include/smb.h b/source3/include/smb.h index 085c06769b..a5571d3645 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1290,6 +1290,10 @@ enum remote_arch_types {RA_UNKNOWN, RA_WFWG, RA_OS2, RA_WIN95, RA_WINNT, RA_SAMB /* case handling */ enum case_handling {CASE_LOWER,CASE_UPPER}; +#ifdef USE_SSL +/* SSL version options */ +enum ssl_version_enum {SMB_SSL_V2,SMB_SSL_V3,SMB_SSL_V23,SMB_SSL_TLS1}; +#endif /* USE_SSL */ /* Macros to get at offsets within smb_lkrng and smb_unlkrng structures. We cannot define these as actual structures -- cgit From c2e2e691ebece45f0dc3226ce1e5a61d1bb9fbce Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Tue, 16 Jun 1998 06:53:32 +0000 Subject: Damn, forgot the proto file again (This used to be commit c63e679337221bbf15beca57249ff3306ebb0369) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 1758301ef4..a5f029870a 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2102,6 +2102,7 @@ int struni2(uint16 *p, char *buf); char *unistr(char *buf); int unistrncpy(char *dst, char *src, int len); int unistrcpy(char *dst, char *src); +char *string_create_s(int size); char *safe_strcpy(char *dest, char *src, int maxlength); char *safe_strcat(char *dest, char *src, int maxlength); char *align4(char *q, char *base); -- cgit From bbd7ca65e706457f5dbc046e83b4bd8cdde5be8f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 16 Jun 1998 18:25:36 +0000 Subject: clientgen: Added USE_SSL for client shutdown. clitar.c: Added 'Samba style' comments before string_create_s(). loadparm.c: Fixed missing comma in SSL code. util.c: Removed string_create_s(). Currently it's only called from clitar.c and having it here as well as a static in clitar causes the compile to break (Richard, please decide where you want this function). lib/rpc/parse/parse_net.c: Fix from to stop coredump on missing parameter. Jeremy. (This used to be commit d23b44322570cb9a7aa2b86407bf4f91010a237b) --- source3/include/proto.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index a5f029870a..1758301ef4 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2102,7 +2102,6 @@ int struni2(uint16 *p, char *buf); char *unistr(char *buf); int unistrncpy(char *dst, char *src, int len); int unistrcpy(char *dst, char *src); -char *string_create_s(int size); char *safe_strcpy(char *dest, char *src, int maxlength); char *safe_strcat(char *dest, char *src, int maxlength); char *align4(char *q, char *base); -- cgit From 8afebcdd7e055cd6c6f9eb69f9ba652b4e1ab591 Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Sun, 21 Jun 1998 12:44:34 +0000 Subject: Remove the copyright to Canon Information Systems Australia, as we don't want them to have the copyright. Added a new DOSERR response code that Win95 returns, unimp, unimplemented. Added code to ignore errors on setting remote time, as Win 95 does not like the time being changed on a directory. Win NT and Samba are OK at this. This is the next to last clean-ups here. Next is to properly handle restore times on directories (except for Win95--see above). Now have Jay's changes in and have fixed a bug reported by Tim Lee. (This used to be commit dc9436bae4493b71ba92970d6cc49dbb33cd55cd) --- source3/include/smb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index a5571d3645..821bf12d94 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -164,6 +164,7 @@ implemented */ #define ERRnofiles 18 /* no more files found in file search */ #define ERRbadshare 32 /* Share mode on file conflict with open mode */ #define ERRlock 33 /* Lock request conflicts with existing lock */ +#define ERRunsup 50 /* Request unsupported, returned by Win 95, RJS 20Jun98 */ #define ERRfilexists 80 /* File in operation already exists */ #define ERRcannotopen 110 /* Cannot open the file specified */ #define ERRunknownlevel 124 -- cgit From d8b0a8bab2334e9214975e3ac35c1556c4030fd9 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 27 Jun 1998 00:27:44 +0000 Subject: nisppass.c: Fixed incorrect parameter usage. nmbd_become_lmb.c: Add 'force_new_election' parameter to some functions. This allows the start of the election to be done *after* the demotion from local master browser is done. Also changed code so release of 1d name is done immediately to allow other local master to gain it. nmbd_elections.c: Ensured no elections are run until we have registered the WORKGROUP<1e> name that we must listen on to participate in elections. nmbd_incomingdgrams.c: Use force_new_election code. nmbd_namelistdb.c: Make update_name_in_namelist static. nmbd_subnetdb.c: Fix bug in comparison function. We cannot use memcmp as structure packing may make this fail. nmbd_packets.c: Ensure that we only send one release packet when sending a broadcast packet. nmbd_workgroupdb.c: Ensure we put the correct value in the ElectionCriterion field. nmblib.c: Ensure make_nmb_name zero's the struct nmb_name. Jeremy. (This used to be commit 1fcb094ba04f01be1261ac92198c25b21b0d5ad5) --- source3/include/proto.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 1758301ef4..edf6e60915 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1260,8 +1260,8 @@ void unbecome_local_master_success(struct subnet_record *subrec, struct in_addr released_ip); void unbecome_local_master_fail(struct subnet_record *subrec, struct response_record *rrec, struct nmb_name *fail_name); -void release_1d_name( struct subnet_record *subrec, char *workgroup_name); -void unbecome_local_master_browser(struct subnet_record *subrec, struct work_record *work); +void unbecome_local_master_browser(struct subnet_record *subrec, struct work_record *work, + BOOL force_new_election); void become_local_master_browser(struct subnet_record *subrec, struct work_record *work); void set_workgroup_local_master_browser_name( struct work_record *work, char *newname); @@ -1335,8 +1335,6 @@ void refresh_my_names(time_t t); void set_samba_nb_type(void); BOOL ms_browser_name( char *name, int type ); -void update_name_in_namelist( struct subnet_record *subrec, - struct name_record *namerec ); void remove_name_from_namelist( struct subnet_record *subrec, struct name_record *namerec ); struct name_record *find_name_on_subnet( struct subnet_record *subrec, -- cgit From 1829528d1fb2b87c726341aaf8d69d1190f83d6b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 30 Jun 1998 21:19:40 +0000 Subject: nttrans.c: More code towards NT protocol. smb.h: More code towards NT protocol. time.c: Fix for sco bug. Jeremy. (This used to be commit e53f4396ead540bcf9ecd18f3253e49216404a1b) --- source3/include/smb.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 821bf12d94..734dddff14 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1049,8 +1049,18 @@ struct parm_struct /* these are the constants used in the above call. */ /* DesiredAccess */ -#if 0 -/* TODO.... JRA */ +/* File Specific access rights. */ +#define FILE_READ_DATA 0x001 +#define FILE_WRITE_DATA 0x002 +#define FILE_APPEND_DATA 0x004 +#define FILE_READ_EA 0x008 +#define FILE_WRITE_EA 0x010 +#define FILE_EXECUTE 0x020 +#define FILE_DELETE_CHILD 0x040 +#define FILE_READ_ATTRIBUTES 0x080 +#define FILE_WRITE_ATTRIBUTES 0x100 + +/* Generic access masks & rights. */ #define SPECIFIC_RIGHTS_MASK 0x00FFFFL #define STANDARD_RIGHTS_MASK 0xFF0000L #define DELETE_ACCESS (1L<<16) @@ -1060,10 +1070,6 @@ struct parm_struct #define SYNCHRONIZE_ACCESS (1L<<20) #define SYSTEM_SECURITY_ACCESS (1L<<24) -#define GENERIC_READ xxx? -#define GENERIC_WRITE xxx? -#endif - /* Flags field. */ #define REQUEST_OPLOCK 2 #define REQUEST_BATCH_OPLOCK 4 -- cgit From 139a34157eba50f70c86f2dd07fb384a7cbaf9cc Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 1 Jul 1998 21:49:49 +0000 Subject: includes.h: AIX fix. nttrans.c: More NT SMB work. smb.h: More NT SMB defines. trans2.c: Change call response as I now have docs on what the flags mean. #ifdef it with JRATEST until I'm sure it's ok though. Jeremy. (This used to be commit ce2503fddd7ef9eed89e1a63fd834f13432a9cd6) --- source3/include/includes.h | 2 ++ source3/include/smb.h | 8 ++++++++ 2 files changed, 10 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index ea09dcb367..6eab1a1641 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -600,6 +600,8 @@ char *mktemp(char *); /* No standard include */ #include #include #include +#include +#define HAVE_GETGRNAM 1 #define SYSV #define USE_WAITPID #define USE_SIGBLOCK diff --git a/source3/include/smb.h b/source3/include/smb.h index 734dddff14..9cedc890b8 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1090,6 +1090,8 @@ struct parm_struct #define FILE_ATTRIBUTE_NORMAL 0x80L #define FILE_ATTRIBUTE_TEMPORARY 0x100L #define FILE_ATTRIBUTE_COMPRESSED 0x800L +#define SAMBA_ATTRIBUTES_MASK 0x7F + /* Flags - combined with attributes. */ #define FILE_FLAG_WRITE_THROUGH 0x80000000L #define FILE_FLAG_NO_BUFFERING 0x20000000L @@ -1106,6 +1108,12 @@ struct parm_struct #define OPEN_ALWAYS 4 #define TRUNCATE_EXISTING 5 +/* Filesystem Attributes. */ +#define FILE_CASE_SENSITIVE_SEARCH 0x1 +#define FILE_CASE_PRESERVED_NAMES 0x2 +#define FILE_UNICODE_ON_DISK 0x4 +#define FILE_PERISITANT_ACLS 0x8 + /* where to find the base of the SMB packet proper */ #define smb_base(buf) (((char *)(buf))+4) -- cgit From 3daefed54e221b397f1eff43d2a83a61c4500fb1 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 2 Jul 1998 18:49:08 +0000 Subject: chgpasswd.c: Fix from Peter Debus for Digital UNIX password change core dump bug. nmbd_subnetdb.c: Make namelist_entry_compare() static. nttrans.c: More NT SMB stuff. Jeremy. (This used to be commit 1925a29c6b355b8358ee99e5b876b6376aa7d628) --- source3/include/proto.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index edf6e60915..888f26e906 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1533,7 +1533,6 @@ void write_browse_list(time_t t, BOOL force_write); /*The following definitions come from nmbd_subnetdb.c */ -int namelist_entry_compare( ubi_trItemPtr Item, ubi_trNodePtr Node ); BOOL create_subnets(void); BOOL we_are_a_wins_client(void); struct subnet_record *get_next_subnet_maybe_unicast(struct subnet_record *subrec); -- cgit From efc2732f55c909a2d6228be2185a69c3569f7c97 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 2 Jul 1998 23:57:56 +0000 Subject: Fix for pidfile startup message. Jeremy. (This used to be commit 108284cc28d44ffea028209cf28b746008bdf455) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 888f26e906..06f0015638 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1689,8 +1689,8 @@ void pcap_printer_fn(void (*fn)(char *, char *)); /*The following definitions come from pidfile.c */ -void pidfile_create(char *name); int pidfile_pid(char *name); +void pidfile_create(char *name); /*The following definitions come from pipes.c */ -- cgit From 734d66bb00d3eea3c4b07703c92b17a4afbabeb0 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 7 Jul 1998 19:25:46 +0000 Subject: includes.h: Fixes for QNX 4.x. Jeremy. (This used to be commit 6055be064ec1e9416bb9a7cd97a11976fb336fb6) --- source3/include/includes.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 6eab1a1641..a821ce181f 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -89,6 +89,8 @@ #ifdef __386__ #define __i386__ #endif +#define SHADOW_PWD +#define NO_GETSPNAM #endif #ifdef NEWS42 @@ -959,8 +961,11 @@ extern char *getpass(char *); #endif #ifdef QNX +#include #define STATFS4 #include +/* Override QNX size of 32 to be 255 */ +#define FD_SETSIZE 255 #include #include #include @@ -1106,7 +1111,7 @@ extern char *getsmbpass(char *); #endif /* Now for some other grungy stuff */ -#ifdef NO_GETSPNAM +#if defined(NO_GETSPNAM) && !defined(QNX) struct spwd { /* fake shadow password structure */ char *sp_pwdp; }; -- cgit From ddf62bbbdb12e45d0fec5dab3dcd8030d2aa4680 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 9 Jul 1998 00:41:32 +0000 Subject: NT SMB trans reply code. Jeremy. (This used to be commit 556254d72517c8a5bf70cafaf443df1675fe64d9) --- source3/include/smb.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 9cedc890b8..697caa349d 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1034,6 +1034,16 @@ struct parm_struct #define smb_nts_DataOffset (smb_vwv0 + 27) #define smb_nts_DataDisplacement (smb_vwv0 + 31) +/* these are for the NT trans reply. */ +#define smb_ntr_TotalParameterCount (smb_vwv0 + 3) +#define smb_ntr_TotalDataCount (smb_vwv0 + 7) +#define smb_ntr_ParameterCount (smb_vwv0 + 11) +#define smb_ntr_ParameterOffset (smb_vwv0 + 15) +#define smb_ntr_ParameterDisplacement (smb_vwv0 + 19) +#define smb_ntr_DataCount (smb_vwv0 + 23) +#define smb_ntr_DataOffset (smb_vwv0 + 27) +#define smb_ntr_DataDisplacement (smb_vwv0 + 31) + /* these are for the NT create_and_X */ #define smb_ntcreate_NameLength (smb_vwv0 + 5) #define smb_ntcreate_Flags (smb_vwv0 + 7) -- cgit From 5ffb30858f3b9181c90e50f6a3d791e017be3f7e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 11 Jul 1998 00:28:34 +0000 Subject: nttrans.c: More NT SMB stuff. reply.c: Broke out the internals of reply_mv so that they may be called externally from the NT transact rename. server.c: Changed stat calls to sys_stat - found in code review of bugfix. Jeremy. (This used to be commit fb19dad88edfd7a5c7257a15afc9253fb41f4b99) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 06f0015638..2c377bfb56 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1779,6 +1779,7 @@ int reply_printqueue(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); int reply_printwrite(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); int reply_mkdir(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); int reply_rmdir(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int rename_internals(char *inbuf, char *outbuf, char *name, char *newname); int reply_mv(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); int reply_copy(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); int reply_setdir(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -- cgit From ebad4278b72289f10ce7afa72a137f5e3e998b01 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 11 Jul 1998 01:25:02 +0000 Subject: nntrans.c: Fully implemented transact rename. reply.c: Added NT specific rename if exists flag to rename_internals(). smb.h: Added NT rename flag. Jeremy. (This used to be commit b398f7daf58459db6e8d3496502abeb634ac2183) --- source3/include/proto.h | 2 +- source3/include/smb.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 2c377bfb56..6d9d083bc1 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1779,7 +1779,7 @@ int reply_printqueue(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); int reply_printwrite(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); int reply_mkdir(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); int reply_rmdir(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int rename_internals(char *inbuf, char *outbuf, char *name, char *newname); +int rename_internals(char *inbuf, char *outbuf, char *name, char *newname, BOOL replace_if_exists); int reply_mv(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); int reply_copy(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); int reply_setdir(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); diff --git a/source3/include/smb.h b/source3/include/smb.h index 697caa349d..e58fcc034d 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1118,6 +1118,9 @@ struct parm_struct #define OPEN_ALWAYS 4 #define TRUNCATE_EXISTING 5 +/* Flag for NT transact rename call. */ +#define RENAME_REPLACE_IF_EXISTS 1 + /* Filesystem Attributes. */ #define FILE_CASE_SENSITIVE_SEARCH 0x1 #define FILE_CASE_PRESERVED_NAMES 0x2 -- cgit From 7ade0aa1d22367cb0d998d35573dc5e333a41f75 Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Wed, 15 Jul 1998 20:15:25 +0000 Subject: util.c: I've added a function called mem_dup(). Similar to strdup(), mem_dup() allocates the required memory before copying the source data. It returns NULL if memory could not be allcoated, else a pointer to the newly allocated memory. proto.h: Rebuilt to add the prototype for mem_dup(). (This used to be commit 7f7e265ab457d046441d502d4b8447bc2c966675) --- source3/include/proto.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 6d9d083bc1..ed725b722d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1582,7 +1582,7 @@ char *namestr(struct nmb_name *n); struct packet_struct *copy_packet(struct packet_struct *packet); void free_packet(struct packet_struct *packet); struct packet_struct *read_packet(int fd,enum packet_type packet_type); -void make_nmb_name(struct nmb_name *n,char *name,int type,char *this_scope); +void make_nmb_name( struct nmb_name *n, char *name, int type, char *this_scope ); BOOL nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2); BOOL send_packet(struct packet_struct *p); struct packet_struct *receive_packet(int fd,enum packet_type type,int t); @@ -1973,6 +1973,7 @@ BOOL is_a_socket(int fd); BOOL next_token(char **ptr,char *buff,char *sep); char **toktocliplist(int *ctok, char *sep); void *MemMove(void *dest,void *src,int size); +void *mem_dup( void *from, int size ); void array_promote(char *array,int elsize,int element); void set_socket_options(int fd, char *options); void close_sockets(void ); -- cgit From f1cd3cb54c6495db2a91c473f91c78d24622d98e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 16 Jul 1998 00:06:29 +0000 Subject: Makefile: Added CC=gcc to DGUX on Intel. Comment from ross@filmworks.com. ipc.c: loadparm.c: printing.c: Added code from to implement print queue pausing. New parameters are "queuepause command" and "queueresume command". util.c: Added fix for mount options in autmount map. lib/rpc/include/rpc_misc.h: Removed duplicate pipe names for Jean-Francois. Jeremy. (This used to be commit 559a9bf2bbdeae3e76ba9178779cd3a9537c4e91) --- source3/include/proto.h | 3 +++ source3/include/rpc_misc.h | 11 ----------- 2 files changed, 3 insertions(+), 11 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index ed725b722d..6a64059eb1 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1062,6 +1062,8 @@ char *lp_lpqcommand(int ); char *lp_lprmcommand(int ); char *lp_lppausecommand(int ); char *lp_lpresumecommand(int ); +char *lp_queuepausecommand(int ); +char *lp_queueresumecommand(int ); char *lp_printername(int ); char *lp_printerdriver(int ); char *lp_hostsallow(int ); @@ -1719,6 +1721,7 @@ void del_printqueue(int cnum,int snum,int jobid); void status_printjob(int cnum,int snum,int jobid,int status); int printjob_encode(int snum, int job); void printjob_decode(int jobid, int *snum, int *job); +void status_printqueue(int cnum,int snum,int status); /*The following definitions come from quotas.c */ diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 3e1a6052b5..c03471ebfc 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -27,17 +27,6 @@ #include "rpc_dce.h" -/* pipe string names */ -#define PIPE_SRVSVC "\\PIPE\\srvsvc" -#define PIPE_SAMR "\\PIPE\\samr" -#define PIPE_WINREG "\\PIPE\\winreg" -#define PIPE_WKSSVC "\\PIPE\\wkssvc" -#define PIPE_NETLOGON "\\PIPE\\NETLOGON" -#define PIPE_NTLSA "\\PIPE\\ntlsa" -#define PIPE_NTSVCS "\\PIPE\\ntsvcs" -#define PIPE_LSASS "\\PIPE\\lsass" -#define PIPE_LSARPC "\\PIPE\\lsarpc" - /* well-known RIDs - Relative IDs */ /* RIDs - Well-known users ... */ -- cgit From dc44d77c7fd3427b1313e8ee2d7929fb7778148f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 16 Jul 1998 22:46:06 +0000 Subject: Makefile: Added nttrans.o includes.h: Added termios.h for AIX. nttrans.c: Working NT SMB calls ! pipes.c: Use strequal instead of strcmp. server.c: Use #defines rather than numbers. smb.h: Updated NT SMB #defines. Jeremy. (This used to be commit 3e5cada9885059e9926eb6a56d350c4b1b53d245) --- source3/include/includes.h | 3 +++ source3/include/proto.h | 7 +++++++ source3/include/smb.h | 24 +++++++++++++++++++----- 3 files changed, 29 insertions(+), 5 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index a821ce181f..69692e5847 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -596,6 +596,9 @@ char *mktemp(char *); /* No standard include */ #include #include #include +#ifdef ALLOW_CHANGE_PASSWORD +#include +#endif /* ALLOW_CHANGE_PASSWORD */ /* According to AIX 4.1 man pages, inet_ntoa needs the following headers */ #include #include diff --git a/source3/include/proto.h b/source3/include/proto.h index 6a64059eb1..3acfb0cf5e 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1593,6 +1593,13 @@ struct packet_struct *receive_packet(int fd,enum packet_type type,int t); char *get_nt_error_msg(uint32 nt_code); +/*The following definitions come from nttrans.c */ + +int reply_ntcreate_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_ntcancel(char *inbuf,char *outbuf,int length,int bufsize); +int reply_nttranss(char *inbuf,char *outbuf,int length,int bufsize); +int reply_nttrans(char *inbuf,char *outbuf,int length,int bufsize); + /*The following definitions come from params.c */ BOOL pm_process( char *FileName, diff --git a/source3/include/smb.h b/source3/include/smb.h index e58fcc034d..ca295f3b42 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1112,11 +1112,25 @@ struct parm_struct #define FILE_FLAG_POSIX_SEMANTICS 0x01000000L /* CreateDisposition field. */ -#define CREATE_NEW 1 -#define CREATE_ALWAYS 2 -#define OPEN_EXISTING 3 -#define OPEN_ALWAYS 4 -#define TRUNCATE_EXISTING 5 +#define FILE_SUPERSEDE 0 +#define FILE_OPEN 1 +#define FILE_CREATE 2 +#define FILE_OPEN_IF 3 +#define FILE_OVERWRITE 4 +#define FILE_OVERWRITE_IF 5 + +/* Responses when opening a file. */ +#define FILE_WAS_OPENED 1 +#define FILE_WAS_CREATED 2 +#define FILE_WAS_OVERWRITTEN 3 + +/* File type flags */ +#define FILE_TYPE_DISK 0 +#define FILE_TYPE_BYTE_MODE_PIPE 1 +#define FILE_TYPE_MESSAGE_MODE_PIPE 2 +#define FILE_TYPE_PRINTER 3 +#define FILE_TYPE_COMM_DEVICE 4 +#define FILE_TYPE_UNKNOWN 0xFFFF /* Flag for NT transact rename call. */ #define RENAME_REPLACE_IF_EXISTS 1 -- cgit From b61b50ac2c42968a499d1c048fa5ee89e321f8a0 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 17 Jul 1998 00:47:16 +0000 Subject: local.h: Added NTFS define if HAVE_NT_SMBS is defined. nttrans.c: Fixed issue with access DELETE on renaming files. Jeremy. (This used to be commit 0fcf167af898a9c7a20fddc0d95c887477a22ed1) --- source3/include/local.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index 144c2d2838..f32700c0eb 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -83,8 +83,11 @@ /* what type of filesystem do we want this to show up as in a NT file manager window? */ +#ifdef HAVE_NT_SMBS +#define FSTYPE_STRING "NTFS" +#else /* HAVE_NT_SMBS */ #define FSTYPE_STRING "Samba" - +#endif /* HAVE_NT_SMBS */ /* the default guest account - normally set in the Makefile or smb.conf */ #ifndef GUEST_ACCOUNT -- cgit From 471087c9d28a4058efc16f98784cb179ffc1e4c4 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 17 Jul 1998 22:21:24 +0000 Subject: Code added to fix the renaming of a directory under NT SMB calls. local.h: Changed MAXDIR to MAX_OPEN_DIRECTORIES - shmem size also tuned by this. dir.c: Use MAX_OPEN_DIRECTORIES. nttrans.c: Allow opening of a directory to succeed. Doesn't actually open a file descriptor but takes a files_struct slot marked as an fd. reply.c: Changed to close any outstanding is_directory files. reply_close changed to understand directory files. server.c: Added open_directory(), close_directory() calls. smb.h: Added is_directory to files_struct. Changed OPEN_FNUM to check that target is !is_directory (this prevents the normal file calls from processing a directory files_struct. Jeremy. (This used to be commit e01ce693f47e75e277f3440d46e32b0bd866b550) --- source3/include/local.h | 12 ++++++------ source3/include/proto.h | 2 ++ source3/include/smb.h | 19 ++++++++++--------- 3 files changed, 18 insertions(+), 15 deletions(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index f32700c0eb..4a69325b77 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -37,19 +37,19 @@ #define MAX_CONNECTIONS 127 #define MAX_OPEN_FILES 100 +/* max number of directories open at once */ +/* note that with the new directory code this no longer requires a + file handle per directory, but large numbers do use more memory */ +#define MAX_OPEN_DIRECTORIES 64 + /* Default size of shared memory used for share mode locking */ #ifndef SHMEM_SIZE -#define SHMEM_SIZE (1024*MAX_OPEN_FILES) +#define SHMEM_SIZE (1024*(MAX_OPEN_FILES+MAX_OPEN_DIRECTORIES)) #endif /* the max number of simultanous connections to the server by all clients */ #define MAXSTATUS 100000 -/* max number of directories open at once */ -/* note that with the new directory code this no longer requires a - file handle per directory, but large numbers do use more memory */ -#define MAXDIR 64 - #define WORDMAX 0xFFFF /* the maximum password length before we declare a likely attack */ diff --git a/source3/include/proto.h b/source3/include/proto.h index 3acfb0cf5e..b390cb60d9 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1815,6 +1815,8 @@ int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); BOOL check_name(char *name,int cnum); void sync_file(int fnum); void close_file(int fnum, BOOL normal_close); +void close_directory(int fnum); +void open_directory(int fnum,int cnum,char *fname, int *action); BOOL check_file_sharing(int cnum,char *fname, BOOL rename_op); int check_share_mode( share_mode_entry *share, int deny_mode, char *fname, BOOL fcbopen, int *flags); diff --git a/source3/include/smb.h b/source3/include/smb.h index ca295f3b42..921cb4284d 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -418,14 +418,14 @@ typedef struct /* Structure used when SMBwritebmpx is active */ typedef struct - { - int wr_total_written; /* So we know when to discard this */ - int32 wr_timeout; - int32 wr_errclass; - int32 wr_error; /* Cached errors */ - BOOL wr_mode; /* write through mode) */ - BOOL wr_discard; /* discard all further data */ - } write_bmpx_struct; +{ + int wr_total_written; /* So we know when to discard this */ + int32 wr_timeout; + int32 wr_errclass; + int32 wr_error; /* Cached errors */ + BOOL wr_mode; /* write through mode) */ + BOOL wr_discard; /* discard all further data */ +} write_bmpx_struct; /* * Structure used to indirect fd's from the files_struct. @@ -467,6 +467,7 @@ typedef struct BOOL modified; BOOL granted_oplock; BOOL sent_oplock_break; + BOOL is_directory; BOOL reserved; char *name; } files_struct; @@ -781,7 +782,7 @@ struct parm_struct /* these are useful macros for checking validity of handles */ #define VALID_FNUM(fnum) (((fnum) >= 0) && ((fnum) < MAX_OPEN_FILES)) -#define OPEN_FNUM(fnum) (VALID_FNUM(fnum) && Files[fnum].open) +#define OPEN_FNUM(fnum) (VALID_FNUM(fnum) && Files[fnum].open && !Files[fnum].is_directory) #define VALID_CNUM(cnum) (((cnum) >= 0) && ((cnum) < MAX_CONNECTIONS)) #define OPEN_CNUM(cnum) (VALID_CNUM(cnum) && Connections[cnum].open) #define IS_IPC(cnum) (VALID_CNUM(cnum) && Connections[cnum].ipc) -- cgit From 781c9e50820e3bc2b11e15bbff2f16b6ad74f26a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 22 Jul 1998 01:31:59 +0000 Subject: includes.h: Added feature type USE_GRANTPT for pty code. chgpasswd.c: Updated to use USE_GRANTPT feature definition. Jeremy. (This used to be commit 953c5dbbae8c1370e5988619746b508f26cb0390) --- source3/include/includes.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 69692e5847..d72595b6b4 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -342,6 +342,7 @@ extern int innetgr (const char *, const char *, const char *, const char *); #ifndef QSORT_CAST #define QSORT_CAST (int (*)(const void *, const void *)) #endif /* QSORT_CAST */ +#define USE_GRANTPT #endif @@ -387,16 +388,18 @@ char *getwd(char *); #include #include #include +#include #define USE_WAITPID #define NETGROUP #ifndef SYSV #define SYSV -#endif +#endif /* SYSV */ #define SIGNAL_CAST (void (*)()) #define USE_STATVFS #define USE_WAITPID #define USE_SETSID #define USE_SYSV_IPC +#define USE_GRANTPT #ifndef QSORT_CAST #define QSORT_CAST (int (*)(const void *, const void *)) #endif /* QSORT_CAST */ @@ -458,6 +461,7 @@ extern struct passwd *getpwnam(); #define USE_SETSID #define USE_SYSV_IPC #define NO_SEMUN +#define USE_GRANTPT #endif -- cgit From f5866fd4ba8da9acde87c7f9da8f1a242540e287 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 22 Jul 1998 13:59:19 +0000 Subject: Fixed bug found by Richard Sharpe. After increasing files_struct size by MAX_OPEN_DIRECTORIES for nttrans I forgot to update the code that enumerates the array. Created new MAX_FNUMS in local.h, changed all code that iterates through the files_struct array to use this. (sorry Richard). Jeremy. (This used to be commit 339b10222269d71c7a493cc08b7b1bfd35fd55fc) --- source3/include/local.h | 2 ++ source3/include/smb.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index 4a69325b77..a55af443ec 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -42,6 +42,8 @@ file handle per directory, but large numbers do use more memory */ #define MAX_OPEN_DIRECTORIES 64 +#define MAX_FNUMS (MAX_OPEN_FILES+MAX_OPEN_DIRECTORIES) + /* Default size of shared memory used for share mode locking */ #ifndef SHMEM_SIZE #define SHMEM_SIZE (1024*(MAX_OPEN_FILES+MAX_OPEN_DIRECTORIES)) diff --git a/source3/include/smb.h b/source3/include/smb.h index 921cb4284d..7079198a40 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -781,7 +781,7 @@ struct parm_struct #endif /* LOCKING_VERSION */ /* these are useful macros for checking validity of handles */ -#define VALID_FNUM(fnum) (((fnum) >= 0) && ((fnum) < MAX_OPEN_FILES)) +#define VALID_FNUM(fnum) (((fnum) >= 0) && ((fnum) < MAX_FNUMS)) #define OPEN_FNUM(fnum) (VALID_FNUM(fnum) && Files[fnum].open && !Files[fnum].is_directory) #define VALID_CNUM(cnum) (((cnum) >= 0) && ((cnum) < MAX_CONNECTIONS)) #define OPEN_CNUM(cnum) (VALID_CNUM(cnum) && Connections[cnum].open) -- cgit From 06c0349c445958aebb8a4611bdb7082711585754 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 23 Jul 1998 00:10:26 +0000 Subject: locking.c: Added lock type to is_locked() and do_lock() as the code in reply_lockingX wasn't taking account of the difference between read and write locks ! How did this ever work :-) ! reply.c: server.c: Add lock type to is_locked() and do_lock(). util.c: Also added code from klausr@ITAP.Physik.Uni-Stuttgart.De to fix problem with log files growing too large if an smbd writes less than 100 debug messages. Jeremy. (This used to be commit 80080abf772a470d5f0f4dcd4a75fb2a09a9fb2a) --- source3/include/proto.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index b390cb60d9..5819d1aadc 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1149,8 +1149,9 @@ void lp_set_name_resolve_order(char *new_order); /*The following definitions come from locking.c */ -BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset); -BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); +BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset, int lock_type); +BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int lock_type, + int *eclass,uint32 *ecode); BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); BOOL locking_init(int read_only); BOOL locking_end(void); @@ -1980,6 +1981,7 @@ int sig_usr2(void); int sig_usr1(void); void setup_logging(char *pname,BOOL interactive); void reopen_logs(void); +void force_check_log_size(void); char *tmpdir(void); BOOL is_a_socket(int fd); BOOL next_token(char **ptr,char *buff,char *sep); -- cgit From e6608b5279dcb258fa97d7719e854b72de84b9b9 Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Fri, 24 Jul 1998 19:03:11 +0000 Subject: Converted the browser database to a ubi_dLinkList. This should reduce code size, etc. Also did a bit of work to add comments. Chris -)----- (This used to be commit d8b0a2104c05df957f0eb49c21388ec5a4858d98) --- source3/include/nameserv.h | 19 ++++++++----------- source3/include/proto.h | 12 ++++++------ 2 files changed, 14 insertions(+), 17 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 0ba7acda18..80d9667d1c 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -189,11 +189,10 @@ struct nmb_data time_t refresh_time; /* The time the record should be refreshed. */ }; -/* This is the structure used for the local netbios name list. */ +/* This structure represents an entry in a local netbios name list. */ struct name_record { ubi_trNode node[1]; - struct subnet_record *subnet; struct nmb_name name; /* The netbios name. */ struct nmb_data data; /* The netbios data. */ @@ -201,16 +200,14 @@ struct name_record /* Browser cache for synchronising browse lists. */ struct browse_cache_record -{ - struct browse_cache_record *next; - struct browse_cache_record *prev; - - pstring lmb_name; - pstring work_group; + { + ubi_dlNode node[1]; + pstring lmb_name; + pstring work_group; struct in_addr ip; - time_t sync_time; - time_t death_time; /* The time the record must be removed. */ -}; + time_t sync_time; + time_t death_time; /* The time the record must be removed. */ + }; /* This is used to hold the list of servers in my domain, and is contained within lists of domains. */ diff --git a/source3/include/proto.h b/source3/include/proto.h index 5819d1aadc..8adfb70d38 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1270,13 +1270,13 @@ void set_workgroup_local_master_browser_name( struct work_record *work, char *ne /*The following definitions come from nmbd_browserdb.c */ -void remove_lmb_browser_entry(struct browse_cache_record *browc); -void update_browser_death_time(struct browse_cache_record *browc); -struct browse_cache_record *create_browser_in_lmb_cache(char *work_name, char *browser_name, - struct in_addr ip); +void update_browser_death_time( struct browse_cache_record *browc ); +struct browse_cache_record *create_browser_in_lmb_cache( char *work_name, + char *browser_name, + struct in_addr ip ); struct browse_cache_record *find_browser_in_lmb_cache( char *browser_name ); -void expire_lmb_browsers(time_t t); -void remove_workgroup_lmb_browsers(char *work_group); +void expire_lmb_browsers( time_t t ); +void remove_workgroup_lmb_browsers( char *work_group ); /*The following definitions come from nmbd_browsesync.c */ -- cgit From 1aa138922e5c0e4925ff5cbfcdb4e7cad367b31b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 27 Jul 1998 18:50:45 +0000 Subject: chgpasswd.c: Fixed up debug calls to stop crashes if ptsname failed. local.h: Kept FSTYPE_STRING as Samba for now. nmbd_browsesync.c: Added bugfix from Matt Chapman mattyc@cyberdude.com - lmb_browserlist is now a struct ubi_dlList not a struct browse_cache_record *. server.c: smb.h: uid.c: password.c: Removed attrs code - it is not used anywhere. Jeremy (This used to be commit ef1af7fe6d5c58ae57b8e4efff0729e1a315da43) --- source3/include/local.h | 4 ---- source3/include/proto.h | 3 +-- source3/include/smb.h | 3 --- 3 files changed, 1 insertion(+), 9 deletions(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index a55af443ec..0a369d80e2 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -85,11 +85,7 @@ /* what type of filesystem do we want this to show up as in a NT file manager window? */ -#ifdef HAVE_NT_SMBS -#define FSTYPE_STRING "NTFS" -#else /* HAVE_NT_SMBS */ #define FSTYPE_STRING "Samba" -#endif /* HAVE_NT_SMBS */ /* the default guest account - normally set in the Makefile or smb.conf */ #ifndef GUEST_ACCOUNT diff --git a/source3/include/proto.h b/source3/include/proto.h index 8adfb70d38..2a7e5ed080 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1668,8 +1668,7 @@ user_struct *get_valid_user_struct(uint16 vuid); void invalidate_vuid(uint16 vuid); char *validated_username(uint16 vuid); int setup_groups(char *user, int uid, int gid, int *p_ngroups, - int **p_igroups, gid_t **p_groups, - int **p_attrs); + int **p_igroups, gid_t **p_groups); uint16 register_vuid(int uid,int gid, char *unix_name, char *requested_name, BOOL guest); void add_session_user(char *user); BOOL update_smbpassword_file( char *user, fstring password); diff --git a/source3/include/smb.h b/source3/include/smb.h index 7079198a40..3b1796f76b 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -398,7 +398,6 @@ struct current_user int ngroups; gid_t *groups; int *igroups; - int *attrs; }; typedef struct @@ -510,7 +509,6 @@ typedef struct int ngroups; gid_t *groups; int *igroups; /* an integer version - some OSes are broken :-( */ - int *attrs; time_t lastused; BOOL used; @@ -548,7 +546,6 @@ typedef struct int n_groups; gid_t *groups; int *igroups; /* an integer version - some OSes are broken :-( */ - int *attrs; /* attributes associated with each gid */ int n_sids; int *sids; -- cgit From 7abcd0521e36425bf7c3dc90929c00ed49e9ab07 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 28 Jul 1998 18:15:31 +0000 Subject: loadparm.c: Added strict sync parameter. locking.c: Added code to deal with real open mode of file. reply.c: Added strict sync parameter. server.c: Added strict sync parameter. Fixed open modes. Jeremy. (This used to be commit ed57b603b5c9333d588e62d774ad2be67e43ffd9) --- source3/include/proto.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 2a7e5ed080..92008b46e1 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1107,6 +1107,7 @@ BOOL lp_manglednames(int ); BOOL lp_widelinks(int ); BOOL lp_symlinks(int ); BOOL lp_syncalways(int ); +BOOL lp_strict_sync(int ); BOOL lp_map_system(int ); BOOL lp_delete_readonly(int ); BOOL lp_fake_oplocks(int ); @@ -1813,7 +1814,7 @@ BOOL unix_convert(char *name,int cnum,pstring saved_last_component, BOOL *bad_pa int disk_free(char *path,int *bsize,int *dfree,int *dsize); int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); BOOL check_name(char *name,int cnum); -void sync_file(int fnum); +void sync_file(int cnum, int fnum); void close_file(int fnum, BOOL normal_close); void close_directory(int fnum); void open_directory(int fnum,int cnum,char *fname, int *action); -- cgit From c48b3fce6be6d5d952cbcda0ddae223dda5a576f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 29 Jul 1998 00:27:23 +0000 Subject: locking.c: Print messages when we downgrade a lock. reply.c: Do the same mask expansion we do in trans2.c - needed for Win98. trans2.c: Make the mask expansion into a function call now we have to do it twice. Jeremy. (This used to be commit 7b3a9d6285cc0d1967155a68845e28c6296ecc67) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 92008b46e1..97ee483f55 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1949,6 +1949,7 @@ time_t get_create_time(struct stat *st,BOOL fake_dirs); /*The following definitions come from trans2.c */ +void mask_convert( char *mask); int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize); int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize); int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize); -- cgit From 64578c0589a3a741f81fb55c16eeb882128da00b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 29 Jul 1998 03:08:05 +0000 Subject: merge from the autoconf2 branch to the main branch (This used to be commit 3bda7ac417107a7b01d91805ca71c4330657ed21) --- source3/include/config.h.in | 397 ++++++++++++ source3/include/includes.h | 1426 +++++++------------------------------------ source3/include/local.h | 6 - source3/include/proto.h | 39 +- source3/include/smb.h | 39 +- 5 files changed, 657 insertions(+), 1250 deletions(-) create mode 100644 source3/include/config.h.in (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in new file mode 100644 index 0000000000..3bc3e95e4f --- /dev/null +++ b/source3/include/config.h.in @@ -0,0 +1,397 @@ +/* config.h.in. Generated automatically from configure.in by autoheader. */ + +/* Define if on AIX 3. + System headers sometimes define this. + We just want to avoid a redefinition error message. */ +#ifndef _ALL_SOURCE +#undef _ALL_SOURCE +#endif + +/* Define if type char is unsigned and you are not using gcc. */ +#ifndef __CHAR_UNSIGNED__ +#undef __CHAR_UNSIGNED__ +#endif + +/* Define to empty if the keyword does not work. */ +#undef const + +/* Define to `int' if doesn't define. */ +#undef gid_t + +/* Define if your struct stat has st_rdev. */ +#undef HAVE_ST_RDEV + +/* Define if you have that is POSIX.1 compatible. */ +#undef HAVE_SYS_WAIT_H + +/* Define as __inline if that's what the C compiler calls it. */ +#undef inline + +/* Define to `int' if doesn't define. */ +#undef mode_t + +/* Define to `long' if doesn't define. */ +#undef off_t + +/* Define to `int' if doesn't define. */ +#undef pid_t + +/* Define as the return type of signal handlers (int or void). */ +#undef RETSIGTYPE + +/* Define to `unsigned' if doesn't define. */ +#undef size_t + +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Define to `int' if doesn't define. */ +#undef uid_t + +/* Define if your processor stores words with the most significant + byte first (like Motorola and SPARC, unlike Intel and VAX). */ +#undef WORDS_BIGENDIAN + +#undef HAVE_BROKEN_READDIR +#undef HAVE_ERRNO_DECL +#undef HAVE_LONGLONG +#undef HAVE_OFF64_T +#undef HAVE_REMSH +#undef HAVE_UNSIGNED_CHAR +#undef HAVE_UTIMBUF +#undef ino_t +#undef HAVE_CONNECT +#undef HAVE_SHORT_INO_T +#undef WITH_AFS +#undef WITH_DFS +#undef SUNOS5 +#undef SUNOS4 +#undef LINUX +#undef AIX +#undef IRIX +#undef HPUX +#undef QNX +#undef SCO +#undef OSF1 +#undef NEXT2 +#undef HAVE_SHARED_MMAP +#undef HAVE_SYSV_IPC +#undef HAVE_FCNTL_LOCK +#undef HAVE_FTRUNCATE_EXTEND +#undef HAVE_TRAPDOOR_UID +#undef HAVE_ROOT +#undef HAVE_UNION_SEMUN +#undef HAVE_NETMASK_IFCONF +#undef HAVE_GETTIMEOFDAY_TZ +#undef HAVE_SOCK_SIN_LEN +#undef STAT_READ_FILSYS +#undef STAT_STATFS2_BSIZE +#undef STAT_STATFS2_FSIZE +#undef STAT_STATFS2_FS_DATA +#undef STAT_STATFS3_OSF1 +#undef STAT_STATFS4 +#undef STAT_STATVFS +#undef HAVE_NETMASK_IFREQ +#undef HAVE_NETMASK_AIX +#undef HAVE_CRYPT +#undef WITH_MMAP +#undef WITH_SYSLOG +#undef WITH_SSL +#undef WITH_LDAP +#undef WITH_NISPLUS +#undef WITH_AUTOMOUNT +#undef HAVE_PAM_AUTHENTICATE + +/* The number of bytes in a int. */ +#undef SIZEOF_INT + +/* The number of bytes in a long. */ +#undef SIZEOF_LONG + +/* The number of bytes in a short. */ +#undef SIZEOF_SHORT + +/* Define if you have the atexit function. */ +#undef HAVE_ATEXIT + +/* Define if you have the bigcrypt function. */ +#undef HAVE_BIGCRYPT + +/* Define if you have the chmod function. */ +#undef HAVE_CHMOD + +/* Define if you have the chown function. */ +#undef HAVE_CHOWN + +/* Define if you have the chroot function. */ +#undef HAVE_CHROOT + +/* Define if you have the crypt16 function. */ +#undef HAVE_CRYPT16 + +/* Define if you have the dup2 function. */ +#undef HAVE_DUP2 + +/* Define if you have the execl function. */ +#undef HAVE_EXECL + +/* Define if you have the fstat function. */ +#undef HAVE_FSTAT + +/* Define if you have the fsync function. */ +#undef HAVE_FSYNC + +/* Define if you have the ftruncate function. */ +#undef HAVE_FTRUNCATE + +/* Define if you have the getauthuid function. */ +#undef HAVE_GETAUTHUID + +/* Define if you have the getcwd function. */ +#undef HAVE_GETCWD + +/* Define if you have the getgrnam function. */ +#undef HAVE_GETGRNAM + +/* Define if you have the getprpwnam function. */ +#undef HAVE_GETPRPWNAM + +/* Define if you have the getrlimit function. */ +#undef HAVE_GETRLIMIT + +/* Define if you have the getspnam function. */ +#undef HAVE_GETSPNAM + +/* Define if you have the glob function. */ +#undef HAVE_GLOB + +/* Define if you have the grantpt function. */ +#undef HAVE_GRANTPT + +/* Define if you have the initgroups function. */ +#undef HAVE_INITGROUPS + +/* Define if you have the innetgr function. */ +#undef HAVE_INNETGR + +/* Define if you have the memmove function. */ +#undef HAVE_MEMMOVE + +/* Define if you have the mktime function. */ +#undef HAVE_MKTIME + +/* Define if you have the pathconf function. */ +#undef HAVE_PATHCONF + +/* Define if you have the pipe function. */ +#undef HAVE_PIPE + +/* Define if you have the putprpwnam function. */ +#undef HAVE_PUTPRPWNAM + +/* Define if you have the rdchk function. */ +#undef HAVE_RDCHK + +/* Define if you have the rename function. */ +#undef HAVE_RENAME + +/* Define if you have the select function. */ +#undef HAVE_SELECT + +/* Define if you have the set_auth_parameters function. */ +#undef HAVE_SET_AUTH_PARAMETERS + +/* Define if you have the setgroups function. */ +#undef HAVE_SETGROUPS + +/* Define if you have the setluid function. */ +#undef HAVE_SETLUID + +/* Define if you have the setresuid function. */ +#undef HAVE_SETRESUID + +/* Define if you have the setsid function. */ +#undef HAVE_SETSID + +/* Define if you have the setuidx function. */ +#undef HAVE_SETUIDX + +/* Define if you have the sigaction function. */ +#undef HAVE_SIGACTION + +/* Define if you have the sigblock function. */ +#undef HAVE_SIGBLOCK + +/* Define if you have the sigprocmask function. */ +#undef HAVE_SIGPROCMASK + +/* Define if you have the strchr function. */ +#undef HAVE_STRCHR + +/* Define if you have the strdup function. */ +#undef HAVE_STRDUP + +/* Define if you have the strerror function. */ +#undef HAVE_STRERROR + +/* Define if you have the strftime function. */ +#undef HAVE_STRFTIME + +/* Define if you have the strpbrk function. */ +#undef HAVE_STRPBRK + +/* Define if you have the utime function. */ +#undef HAVE_UTIME + +/* Define if you have the utimes function. */ +#undef HAVE_UTIMES + +/* Define if you have the vsnprintf function. */ +#undef HAVE_VSNPRINTF + +/* Define if you have the waitpid function. */ +#undef HAVE_WAITPID + +/* Define if you have the yp_get_default_domain function. */ +#undef HAVE_YP_GET_DEFAULT_DOMAIN + +/* Define if you have the header file. */ +#undef HAVE_COMPAT_H + +/* Define if you have the header file. */ +#undef HAVE_CTYPE_H + +/* Define if you have the header file. */ +#undef HAVE_DIRENT_H + +/* Define if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define if you have the header file. */ +#undef HAVE_GRP_H + +/* Define if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define if you have the header file. */ +#undef HAVE_NDIR_H + +/* Define if you have the header file. */ +#undef HAVE_NET_IF_H + +/* Define if you have the header file. */ +#undef HAVE_NETINET_TCP_H + +/* Define if you have the header file. */ +#undef HAVE_SECURITY_PAM_APPL_H + +/* Define if you have the header file. */ +#undef HAVE_SHADOW_H + +/* Define if you have the header file. */ +#undef HAVE_STDARG_H + +/* Define if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define if you have the header file. */ +#undef HAVE_STRING_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_DIR_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_DUSTAT_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_FCNTL_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_FILIO_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_FILSYS_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_FS_S5PARAM_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_ID_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_MODE_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_MOUNT_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_NDIR_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_SECURITY_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_SELECT_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_SOCKIO_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_STATFS_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_STATVFS_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_UNISTD_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_VFS_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_WAIT_H + +/* Define if you have the header file. */ +#undef HAVE_TERMIOS_H + +/* Define if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define if you have the header file. */ +#undef HAVE_UTIME_H + +/* Define if you have the crypt library (-lcrypt). */ +#undef HAVE_LIBCRYPT + +/* Define if you have the dl library (-ldl). */ +#undef HAVE_LIBDL + +/* Define if you have the inet library (-linet). */ +#undef HAVE_LIBINET + +/* Define if you have the nsl library (-lnsl). */ +#undef HAVE_LIBNSL + +/* Define if you have the nsl_s library (-lnsl_s). */ +#undef HAVE_LIBNSL_S + +/* Define if you have the pam library (-lpam). */ +#undef HAVE_LIBPAM + +/* Define if you have the socket library (-lsocket). */ +#undef HAVE_LIBSOCKET diff --git a/source3/include/includes.h b/source3/include/includes.h index d72595b6b4..b63787fd5e 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -20,1221 +20,274 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* - This file does all the #includes's. This makes it easier to - port to a new unix. Hopefully a port will only have to edit the Makefile - and add a section for the new unix below. -*/ - - -/* the first OS dependent section is to setup what includes will be used. - the main OS dependent section comes later on -*/ - -#ifdef ALTOS -#define NO_UTIMEH -#endif - -#ifdef MIPS -#define POSIX_H -#define NO_UTIMEH -#endif -#ifdef sun386 -#define NO_UTIMEH -#endif +#include "config.h" +#include "local.h" -#ifdef NEXT2 -#define NO_UTIMEH +#ifdef AIX +#define DEFAULT_PRINTING PRINT_AIX #endif -#ifdef NEXT3_0 -#define NO_UTIMEH -#define NO_UNISTDH +#ifdef HPUX +#define DEFAULT_PRINTING PRINT_HPUX #endif -#ifdef APOLLO -#define NO_UTIMEH -#define NO_SYSMOUNTH -#define NO_UNISTDH +#ifdef QNX +#define DEFAULT_PRINTING PRINT_QNX #endif -#ifdef AIX -#define NO_SYSMOUNTH +#ifdef SUNOS4 +#define REPLACE_GETPASS +/* on SUNOS4 termios.h conflicts with sys/ioctl.h */ +#undef HAVE_TERMIOS_H #endif -#ifdef M88K_R3 -#define SVR3H -#define NO_RESOURCEH +#ifdef SUNOS5 +#define REPLACE_GETPASS #endif -#ifdef DNIX -#define NO_SYSMOUNTH -#define NO_NETIFH -#define NO_RESOURCEH -#define PRIME_NMBD 0 -#define NO_SETGROUPS -#endif +#include -#ifdef ISC -#define SYSSTREAMH -#define NO_RESOURCEH +#ifdef HAVE_UNISTD_H +#include #endif +#include +#include -#ifdef QNX -#define NO_RESOURCEH -#define NO_SYSMOUNTH -#define USE_MMAP 1 -#ifdef __386__ - #define __i386__ -#endif -#define SHADOW_PWD -#define NO_GETSPNAM +#ifdef HAVE_SYS_PARAM_H +#include #endif -#ifdef NEWS42 -#define NO_UTIMEH -#define NO_STRFTIME -#define NO_UTIMBUF -#define REPLACE_MKTIME -#define NO_TM_NAME +#ifdef HAVE_STDLIB_H +#include #endif -#ifdef OS2 -#define NO_SYSMOUNTH -#define NO_NETIFH +#ifdef HAVE_SYS_SOCKET_H +#include #endif -#ifdef LYNX -#define NO_SYSMOUNTH +#ifdef HAVE_STRING_H +#include #endif - -#if (defined(SHADOW_PWD)||defined(OSF1_ENH_SEC)||defined(SecureWare)||defined(PWDAUTH)) -#define PASSWORD_LENGTH 16 +#ifdef HAVE_MALLOC_H +#include #endif -/* here is the general includes section - with some ifdefs generated - by the previous section -*/ -#include "local.h" -#include -#ifdef POSIX_STDLIBH -#include -#else -#include -#endif -#include +#ifdef TIME_WITH_SYS_TIME +#include #include -#ifndef NO_UTIMEH -#include -#endif -#include - -#ifdef SVR3H -#include -#include -#include -#include -#include -#endif - -#include -#ifdef AXPROC -#include -#endif -#include -#include -#ifdef POSIX_H -#include -#include -#include #else +#ifdef HAVE_SYS_TIME_H #include -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#ifndef NO_RESOURCEH -#include -#endif -#ifndef NO_SYSMOUNTH -#include -#endif -#include -#ifdef __STDC__ -#include #else -#include -#endif -#ifndef NO_UNISTDH -#include +#include #endif -#include -#ifdef SYSSTREAMH -#include #endif -#ifndef NO_NETIFH -#ifdef POSIX_H -#include + +#ifdef HAVE_FCNTL_H +#include #else -#ifdef OSF1 -#include -#include -#endif -#include +#ifdef HAVE_SYS_FCNTL_H +#include #endif #endif -#if defined(GETPWANAM) -#include -#include -#include -#include -#endif +#include -#if defined(SHADOW_PWD) && !defined(NETBSD) && !defined(FreeBSD) && !defined(CONVEX) && !defined(__OpenBSD__) -#include +#ifdef HAVE_LIMITS_H +#include #endif -#ifdef SYSLOG -#include +#ifdef HAVE_SYS_IOCTL_H +#include #endif -#ifdef HAVE_REGEX_H -#include +#ifdef HAVE_SYS_FILIO_H +#include #endif +#include -/*************************************************************************** -Here come some platform specific sections -***************************************************************************/ - - -#ifdef LINUX -#include -#include -#include -#include -#include -#ifdef GLIBC2 -#define _LINUX_C_LIB_VERSION_MAJOR 6 -#include -#include -#include -#include -#include -#endif -#ifndef QSORT_CAST -#define QSORT_CAST (int (*)(const void *, const void *)) -#endif /* QSORT_CAST */ -#define SIGNAL_CAST (__sighandler_t) -#define USE_GETCWD -#define USE_SETSID -#define HAVE_BZERO -#define HAVE_MEMMOVE -#define HAVE_VSNPRINTF -#define USE_SIGPROCMASK -#define USE_WAITPID -#define USE_SYSV_IPC -#if 0 -/* SETFS disabled until we can check on some bug reports */ -#if _LINUX_C_LIB_VERSION_MAJOR >= 5 -#define USE_SETFS -#endif -#endif -#ifdef SHADOW_PWD -#if _LINUX_C_LIB_VERSION_MAJOR < 5 -#ifndef crypt -#define crypt pw_encrypt -#endif -#endif -#endif -#endif - -#ifdef SUNOS4 -#define SIGNAL_CAST (void (*)(int)) -#include -#include -#include -#include -#include -#include -#include +#ifdef HAVE_SYS_WAIT_H #include -#include -/* #include */ -#ifdef sun386 -#define NO_STRFTIME -#define NO_UTIMBUF -#define mktime timelocal -typedef unsigned short mode_t; -#else -#include -#define NO_STRERROR #endif -#ifndef REPLACE_GETPASS -#define REPLACE_GETPASS -#endif -#ifndef BSD_TERMIO -#define BSD_TERMIO -#endif -#ifndef USE_SIGPROCMASK -#define USE_SIGPROCMASK -#endif -#ifndef USE_WAITPID -#define USE_WAITPID +#ifdef HAVE_CTYPE_H +#include #endif -#define USE_SYSV_IPC -/* SunOS doesn't have POSIX atexit */ -#define atexit on_exit -#define NOSTRCASECMP -#ifndef QSORT_CAST -#define QSORT_CAST (int (*)(const void *, const void *)) -#endif /* QSORT_CAST */ +#ifdef HAVE_GRP_H +#include #endif - - -#ifdef SUNOS5 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if !defined(USE_LIBDES) && !defined(KRB4_AUTH) -#include -#endif /* !USE_LIBDES && !KRB4_AUTH */ -extern int gettimeofday (struct timeval *, void *); -extern int gethostname (char *name, int namelen); -extern int innetgr (const char *, const char *, const char *, const char *); -#define USE_SETVBUF -#define SIGNAL_CAST (void (*)(int)) -#ifndef SYSV -#define SYSV -#endif -#define USE_WAITPID -#define REPLACE_STRLEN -#define USE_STATVFS -#define USE_GETCWD -#define USE_SETSID -#define USE_SYSV_IPC -#define NO_SEMUN -#ifndef REPLACE_GETPASS -#define REPLACE_GETPASS -#endif /* REPLACE_GETPASS */ -#define USE_SIGPROCMASK -#ifndef QSORT_CAST -#define QSORT_CAST (int (*)(const void *, const void *)) -#endif /* QSORT_CAST */ -#define USE_GRANTPT +#ifdef HAVE_SYS_ID_H +#include #endif +#include -#ifdef ULTRIX -#include -#include -#include -#include -#ifdef ULTRIX_AUTH -#include -#endif -char *getwd(char *); -#define NOSTRDUP -#ifdef __STDC__ -#define SIGNAL_CAST (void(*)(int)) -#endif -#define USE_DIRECT -#define USE_WAITPID +#ifdef HAVE_UTIME_H +#include #endif -#ifdef SGI4 -#include -#include -#include -#include -#ifndef SYSV -#define SYSV -#endif -#define SIGNAL_CAST (void (*)()) -#define STATFS4 -#define USE_WAITPID -#define USE_DIRECT -#define USE_SETSID -#define USE_SYSV_IPC +#ifdef HAVE_SYS_SELECT_H +#include #endif -#if defined(SGI5) || defined(SGI6) -#include -#include -#include -#include -#include -#include -#include -#include -#include -#define USE_WAITPID -#define NETGROUP -#ifndef SYSV -#define SYSV -#endif /* SYSV */ -#define SIGNAL_CAST (void (*)()) -#define USE_STATVFS -#define USE_WAITPID -#define USE_SETSID -#define USE_SYSV_IPC -#define USE_GRANTPT -#ifndef QSORT_CAST -#define QSORT_CAST (int (*)(const void *, const void *)) -#endif /* QSORT_CAST */ +#ifdef HAVE_SYS_MODE_H +/* apparently AIX needs this for S_ISLNK */ +#ifndef S_ISLNK +#include #endif - - -#ifdef MIPS -#include -#include -#include -#include -#include -#include -#include -#define SIGNAL_CAST (void (*)()) -typedef int mode_t; -extern struct group *getgrnam(); -extern struct passwd *getpwnam(); -#define STATFS4 -#define NO_STRERROR -#define REPLACE_STRSTR -#endif /* MIPS */ - - - -#ifdef DGUX -#include -#include -#include -#include -#include -#include -#define SYSV -#define USE_WAITPID -#define SIGNAL_CAST (void (*)(int)) -#define STATFS4 -#define USE_GETCWD #endif - -#ifdef SVR4 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#define SYSV -#define USE_WAITPID -#define SIGNAL_CAST (void (*)(int)) -#define USE_STATVFS -#define USE_GETCWD -#define USE_SETSID -#define USE_SYSV_IPC -#define NO_SEMUN -#define USE_GRANTPT +#ifdef HAVE_GLOB +#include #endif - -#ifdef OSF1 -#include -#include -#include -char *getwd(char *); -char *mktemp(char *); /* No standard include */ -#include -#include /* both for inet_ntoa */ -#define SIGNAL_CAST ( void (*) (int) ) -#define STATFS3 -#define USE_F_FSIZE -#define USE_SETSID -#include -#ifdef OSF1_ENH_SEC #include -#include -#include -#include -#include -#define PASSWORD_LENGTH 16 -#define NEED_AUTH_PARAMETERS -#endif /* OSF1_ENH_SEC */ -#define USE_SYSV_IPC -#define NO_SEMUN -#endif - - -#ifdef CLIX -#include -#define SIGNAL_CAST (void (*)()) -#include -#include -#include -#define NO_EID -#define USE_WAITPID -#define STATFS4 -#define NO_FSYNC -#define USE_GETCWD -#define USE_SETSID -#ifndef REPLACE_GETPASS -#define REPLACE_GETPASS -#endif /* REPLACE_GETPASS */ -#define NO_GETRLIMIT -#endif /* CLIX */ - - - -#ifdef BSDI -#include -#include -#define SIGNAL_CAST (void (*)()) -#define USE_DIRECT -#define QSORT_CAST (int (*)(const void *, const void *)) -#endif - - -#ifdef NETBSD -#ifdef NetBSD1_3 -#include -#ifdef ALLOW_CHANGE_PASSWORD -#include -#endif /* ALLOW_CHANGE_PASSWORD */ -#else /* NetBSD1_3 */ -#include -#endif /* NetBSD1_3 */ -#include -#include -#include -/* you may not need this */ -#define NO_GETSPNAM -#define SIGNAL_CAST (void (*)()) -#define USE_DIRECT -#define REPLACE_INNETGR -#endif - +#include -#ifdef FreeBSD -#include -#include -#include -#include -#include -#include -#include -#if __FreeBSD__ >= 3 -#include +#ifdef HAVE_STDARG_H +#include #else -#define USE_DIRECT -#endif -#define SIGNAL_CAST (void (*)(int)) -#define USE_SETVBUF -#define USE_SETSID -#define USE_GETCWD -#define USE_WAITPID -#define HAVE_MEMMOVE -#define HAVE_BZERO -#define HAVE_GETTIMEOFDAY -#define HAVE_PATHCONF -#define HAVE_GETGRNAM 1 -#define HAVE_VSNPRINTF -#define QSORT_CAST (int (*)(const void *, const void *)) -#if !defined(O_SYNC) -#if defined(O_FSYNC) -#define O_SYNC O_FSYNC -#else /* defined(O_FSYNC) */ -#define O_SYNC 0 -#endif /* defined(O_FSYNC) */ -#endif /* !defined(O_SYNC) */ -#endif /* FreeBSD */ - -#ifdef __OpenBSD__ -#include -#include -#define NO_GETSPNAM -#define SIGNAL_CAST (void (*)()) -#define USE_DIRECT -#define REPLACE_INNETGR -#define HAVE_BZERO -#define HAVE_PATHCONF -#define HAVE_GETGRNAM 1 -#define HAVE_GETTIMEOFDAY -#define HAVE_MEMMOVE -#define USE_GETCWD -#define USE_SETSID -#endif +#include +#endif -#ifdef AIX -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef ALLOW_CHANGE_PASSWORD -#include -#endif /* ALLOW_CHANGE_PASSWORD */ -/* According to AIX 4.1 man pages, inet_ntoa needs the following headers */ -#include #include #include -#include -#include -#include -#define HAVE_GETGRNAM 1 -#define SYSV -#define USE_WAITPID -#define USE_SIGBLOCK -#define SIGNAL_CAST (void (*)()) -#define DEFAULT_PRINTING PRINT_AIX -/* we undef this because sys/param.h is broken in aix. uggh. */ -#undef MAXHOSTNAMELEN -#endif - - -#ifdef HPUX -#include -#include -#include -#include -#include -#include -#include -#include /* needed for inet_ntoa proto */ -#ifdef HPUX_10_TRUSTED -#include -#include -#define NEED_AUTH_PARAMETERS -#endif -#define SIGNAL_CAST (void (*)(__harg)) -#ifdef HPUX10 -#include -#else /* HPUX10 */ -/* This is only needed for HPUX 9.x */ -#define SELECT_CAST (int *) -#endif /* HPUX10 */ -#define SYSV -#define USE_WAITPID -#define WAIT3_CAST2 (int *) -#define USE_GETCWD -#define USE_SETSID -#define USE_SETRES -#define USE_SYSV_IPC -#define NO_SEMUN -#define DEFAULT_PRINTING PRINT_HPUX -/* Ken Weiss tells us that SIGCLD_IGNORE is - not good for HPUX */ -/* #define SIGCLD_IGNORE */ -#define USE_SIGPROCMASK /* Needed to stop zombie processes on HPUX 9.x and 10.x.*/ -#endif /* HPUX */ - - -#ifdef SEQUENT -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#define SIGNAL_CAST (void (*)(int)) -#define USE_WAITPID -#define USE_GETCWD -#define NO_EID -#define STATFS4 -#define USE_DIRECT -#ifdef PTX4 -#undef USE_DIRECT -#endif -#endif - - +#include +#include +#include -#ifdef SEQUENT_PTX4 -#include -#include -#include -#include -#include -#include -#include -#include +#ifdef HAVE_NETINET_TCP_H #include -#include -#include -#define SYSV -#define USE_WAITPID -#define SIGNAL_CAST (void (*)(int)) -#define USE_STATVFS -#define USE_GETCWD -#ifndef seteuid -#define seteuid(uid) setreuid(-1,uid) -#endif -#ifndef setegid -#define setegid(gid) setregid(-1,gid) -#endif #endif - -#ifdef NEXT2 -#include -#include -#include -#include -#define bzero(b,len) memset(b,0,len) -#define mode_t int -#define NO_UTIMBUF -#include -#define NOSTRDUP -#define USE_DIRECT -#define USE_WAITPID -#endif - - -#ifdef NEXT3_0 -#include -#include -#include -#define NO_UTIMBUF -#include -#define NOSTRDUP -#define USE_DIRECT -#define mode_t int -#define GID_TYPE int -#define gid_t int -#define pid_t int -#define SIGNAL_CAST (void (*)(int)) -#define WAIT3_CAST1 (union wait *) -#define HAVE_GMTOFF -#define O_NONBLOCK O_NDELAY -#endif - - - -#ifdef APOLLO -#include -#include -#include -#define NO_UTIMBUF -#define USE_DIRECT -#define USE_GETCWD -#define SIGNAL_CAST (void (*)()) -#define HAVE_FCNTL_LOCK 0 -#define HAVE_GETTIMEOFDAY -#define STATFS4 -#endif - - - -#ifdef SCO -#include -#include -#include -#include -#include +#ifdef HAVE_TERMIOS_H #include -#include -#include -#include -#include -#include -#ifdef EVEREST -#include -#endif /* EVEREST */ -#ifdef NETGROUP -#include -#endif /* NETGROUP */ -#ifdef SecureWare -#include -#include -#include -#define crypt bigcrypt -#endif /* SecureWare */ -#define SIGNAL_CAST (void (*)(int)) -#define USE_WAITPID -#define USE_GETCWD -#define USE_SETSID -#ifdef SCO3_2_2 -#define setuid(u) setreuid(u,-1) -#define seteuid(u) setreuid(-1,u) -#else /* SCO3_2_2 */ -#ifndef EVEREST -#define ftruncate(f,l) syscall(0x0a28,f,l) -#define USE_IFREQ -#define NO_INITGROUPS -#endif /* EVEREST */ -#endif /* SCO3_2_2 */ -#define STATFS4 -#define NO_FSYNC -#define HAVE_PATHCONF -#define NO_GETRLIMIT -#endif /* SCO */ - - - -/* Definitions for RiscIX */ -#ifdef RiscIX -#define SIGNAL_CAST (void (*)(int)) -#include -#include -#include -#include -#include -#include -#define HAVE_GETTIMEOFDAY -#define NOSTRCASECMP -#define NOSTRDUP #endif - - -#ifdef ISC -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#define FIONREAD FIORDCHK -#define SYSV -#define USE_WAITPID -#define SIGNAL_CAST (void (*)(int)) -#define USE_GETCWD -#define USE_SETSID -#define USE_IFREQ -#define NO_FTRUNCATE -#define STATFS4 -#define NO_FSYNC -#endif - - - -#ifdef AUX -#include -#include -#include -#include -#include -#include -#define SYSV -#define USE_WAITPID -#define SIGNAL_CAST (void (*)(int)) -char *strdup (char *); -#define USE_GETCWD +#if HAVE_DIRENT_H +# include +# define NAMLEN(dirent) strlen((dirent)->d_name) +#else +# define dirent direct +# define NAMLEN(dirent) (dirent)->d_namlen +# if HAVE_SYS_NDIR_H +# include +# endif +# if HAVE_SYS_DIR_H +# include +# endif +# if HAVE_NDIR_H +# include +# endif +#endif + +#ifdef HAVE_SHARED_MMAP +#include #endif - -#ifdef M88K_R3 -#include -#include -#include -#include -#define STATFS4 -#define SYSV -#define USE_WAITPID -#define SIGNAL_CAST (void (*)(int)) -char *strdup (char *); -#define USE_GETCWD -#define NO_FSYNC -#define NO_EID +#ifdef HAVE_SYSV_IPC +#include +#include +#include #endif - -#ifdef DNIX -#include -#include -#include -#include -#include -#define NO_GET_BROADCAST -#define USE_WAITPID -#define USE_GETCWD -#define USE_SETSID -#define STATFS4 -#define NO_EID -#define PF_INET AF_INET -#define NO_STRERROR -#define ftruncate(f,l) chsize(f,l) -#endif /* DNIX */ - -#ifdef CONVEX -#include -#include -#include -#include -#include -#include -#define DONT_REINSTALL_SIG -#define USE_SIGBLOCK -#define USE_WAITPID -#define SIGNAL_CAST (_SigFunc_Ptr_t) -#define NO_GETSPNAM -#define HAVE_MEMMOVE -extern char *mktemp(char *); -extern int fsync(int); -extern int seteuid(uid_t); -extern int setgroups(int, int *); -extern int initgroups(char *, int); -extern int statfs(char *, struct statfs *); -extern int setegid(gid_t); -extern int getopt(int, char *const *, const char *); -extern int chroot(char *); -extern int gettimeofday(struct timeval *, struct timezone *); -extern int gethostname(char *, int); -extern char *crypt(char *, char *); -extern char *getpass(char *); -#endif - - -#ifdef CRAY -#define MAXPATHLEN 1024 -#include -#include -#include -#include -#define SIGNAL_CAST (void (*)(int)) -#define SIGCLD_IGNORE -#define HAVE_FCNTL_LOCK 1 -#define USE_SETSID -#define STATFS4 +#ifdef HAVE_NET_IF_H +#include #endif -#ifdef ALTOS -#include -#include -#include -#include -#include -#define const -#define uid_t int -#define gid_t int -#define mode_t int -#define ptrdiff_t int -#define HAVE_GETGRNAM 0 -#define NO_EID -#define NO_FSYNC -#define NO_FTRUNCATE -#define NO_GETRLIMIT -#define NO_INITGROUPS -#define NO_SELECT -#define NO_SETGROUPS -#define NO_STRERROR -#define NO_STRFTIME -#define NO_TM_NAME -#define NO_UTIMEH -#define NOSTRCASECMP -#define REPLACE_MKTIME -#define REPLACE_RENAME -#define REPLACE_STRSTR -#define STATFS4 -#define USE_GETCWD -#endif - -#ifdef QNX -#include -#define STATFS4 -#include -/* Override QNX size of 32 to be 255 */ -#define FD_SETSIZE 255 -#include -#include -#include -#define SIGNAL_CAST (void (*)()) -#define USE_WAITPID -#define NO_INITGROUPS -#define NO_SETGROUPS -#define HAVE_TIMEZONE -#define USE_GETCWD -#define USE_SETSID -#define HAVE_FCNTL_LOCK 1 -#define DEFAULT_PRINTING PRINT_QNX +#ifdef HAVE_SYS_MOUNT_H +#include #endif - -#ifdef NEWS42 -#include -#include +#ifdef HAVE_SYS_VFS_H #include -#include -typedef int mode_t; -#endif - -#ifdef OS2 -#include -#include -#include -#include -#define SIGNAL_CAST (void (*)()) -#define HAVE_FCNTL_LOCK 0 -#define USE_WAITPID -#define NO_GET_BROADCAST -#define NO_EID -#define NO_SETGROUPS -#define NO_INITGROUPS -#define NO_CRYPT -#define NO_STATFS -#define NO_CHROOT -#define NO_CHOWN -#define strcasecmp stricmp -#define strncasecmp strnicmp -#endif - - -#ifdef LYNX -#define SIGNAL_CAST (void (*)()) -#define WAIT3_CAST1 (union wait *) -#define STATFS4 -#include -#include -#include -#include -#include -#include -#define USE_GETCWD -#define USE_GETSID -#endif - - -#ifdef BOS -#define SIGNAL_CAST (void (*)(int)) -#include -#include -#include -#include -#include -#include -#include -#include -#endif - -#ifdef AMIGA -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define SIGNAL_CAST (void (*)(int)) -#define USE_GETCWD -#define HAVE_BZERO -#define HAVE_MEMMOVE -#define USE_SIGPROCMASK -#define USE_WAITPID -#define USE_DIRECT -#define USE_F_FSIZE -#define HAVE_FCNTL_LOCK 0 -#define HAVE_GETTIMEOFDAY -#define HAVE_PATHCONF - -#define HAVE_NO_PROC -#define NO_FORK_DEBUG -#define HAVE_FORK 0 -#define HAVE_VFORK 1 -#endif - -/* For UnixWare 2.x's ia_uinfo routines. (tangent@cyberport.com) */ -#ifdef IA_UINFO -#include -#include -#endif - - -/******************************************************************* -end of the platform specific sections -********************************************************************/ - -#if (!defined(USE_LDAP_DB) && !defined(USE_NISPLUS_DB)) -#define USE_SMBPASS_DB -#endif - -#if defined(USE_MMAP) || defined(FAST_SHARE_MODES) -#include #endif -#ifdef SecureWare -#define NEED_AUTH_PARAMETERS +#ifdef HAVE_SYS_FS_S5PARAM_H +#include #endif -#ifdef REPLACE_GETPASS -extern char *getsmbpass(char *); -#define getpass(s) getsmbpass(s) +#if defined (HAVE_SYS_FILSYS_H) && !defined (_CRAY) +#include #endif -#ifdef REPLACE_INNETGR -#define innetgr(group,host,user,dom) InNetGr(group,host,user,dom) +#ifdef HAVE_SYS_STATFS_H +# include #endif -#ifndef FD_SETSIZE -#define FD_SETSIZE 255 +#ifdef HAVE_DUSTAT_H +#include #endif -#ifndef __STDC__ -#define const -#endif - -/* Now for some other grungy stuff */ -#if defined(NO_GETSPNAM) && !defined(QNX) -struct spwd { /* fake shadow password structure */ - char *sp_pwdp; -}; -#endif - -#ifndef HAVE_BZERO -#ifndef bzero -#define bzero(p,s) memset(p,0,s) -#endif +#ifdef HAVE_SYS_STATVFS_H +#include #endif -#ifndef HAVE_MEMMOVE -#ifndef memmove -#define memmove(d,s,n) MemMove(d,s,n) -#endif +#ifdef HAVE_SHADOW_H +#include #endif -#ifdef USE_DIRECT -#include -#endif +#ifdef HAVE_SYS_SECURITY_H +#include +#include +#define PASSWORD_LENGTH 16 +#endif /* HAVE_SYS_SECURITY_H */ -/* some unixes have ENOTTY instead of TIOCNOTTY */ -#ifndef TIOCNOTTY -#ifdef ENOTTY -#define TIOCNOTTY ENOTTY -#endif +#ifdef HAVE_COMPAT_H +#include #endif -#ifndef SIGHUP -#define SIGHUP 1 +#ifndef uchar +#define uchar unsigned char #endif -/* if undefined then use bsd or sysv printing */ -#ifndef DEFAULT_PRINTING -#ifdef SYSV -#define DEFAULT_PRINTING PRINT_SYSV +#ifdef HAVE_UNSIGNED_CHAR +#define schar signed char #else -#define DEFAULT_PRINTING PRINT_BSD -#endif +#define schar char #endif -/* This defines the name of the printcap file. It is MOST UNLIKELY that - this will change BUT! Specifying a file with the format of a printcap - file but containing only a subset of the printers actually in your real - printcap file is a quick-n-dirty way to allow dynamic access to a subset - of available printers. -*/ -#ifndef PRINTCAP_NAME -#ifdef AIX -#define PRINTCAP_NAME "/etc/qconfig" -#elif defined(SYSV) -#define PRINTCAP_NAME "lpstat" -#else -#define PRINTCAP_NAME "/etc/printcap" +#ifndef int32 +#if (SIZEOF_INT == 4) +#define int32 int +#elif (SIZEOF_LONG == 4) +#define int32 long +#elif (SIZEOF_SHORT == 4) +#define int32 short #endif #endif - -#ifdef USE_SYSV_IPC -#include -#include -#include -#ifdef NO_SEMUN -union semun { - int val; - struct semid_ds *buf; - unsigned short *array; -}; -#endif -#if defined(HPUX) && defined(HPUX10) -#ifdef SEMMSL -#undef SEMMSL -#endif /* SEMMSL */ -#endif /* HPUX && HPUX10 */ -#endif - -#ifdef AFS_AUTH -#include -#include -#endif - -#ifdef DFS_AUTH -#include -#include +#ifndef uint32 +#define uint32 unsigned int32 #endif -#ifdef KRB5_AUTH -#include +#ifndef MIN +#define MIN(a,b) ((a)<(b)?(a):(b)) #endif -#ifdef KRB4_AUTH -#include +#ifndef MAX +#define MAX(a,b) ((a)>(b)?(a):(b)) #endif -#ifdef NO_UTIMBUF -struct utimbuf { - time_t actime; - time_t modtime; -}; -#endif - -#ifdef NO_STRERROR -#ifndef strerror +#ifndef HAVE_STRERROR extern char *sys_errlist[]; #define strerror(i) sys_errlist[i] #endif -#endif -#ifndef perror -#define perror(m) printf("%s: %s\n",m,strerror(errno)) +#ifndef HAVE_STRCHR +# define strchr index +# define strrchr rindex #endif -#ifndef MAXHOSTNAMELEN -#define MAXHOSTNAMELEN 255 +#ifndef HAVE_ERRNO_DECL +extern int errno; #endif + /* Lists, trees, caching, datbase... */ #include "ubi_sLinkList.h" #include "ubi_dLinkList.h" @@ -1258,157 +311,144 @@ extern char *sys_errlist[]; /***** automatically generated prototypes *****/ #include "proto.h" +#ifdef strcpy +#undef strcpy +#endif /* strcpy */ +#define strcpy(dest,src) __ERROR__XX__NEVER_USE_STRCPY___; +#ifdef strcat +#undef strcat +#endif /* strcat */ +#define strcat(dest,src) __ERROR__XX__NEVER_USE_STRCAT___; -#ifndef S_IFREG -#define S_IFREG 0100000 -#endif +#ifdef sprintf +#undef sprintf +#endif /* sprintf */ +#define sprintf __ERROR__XX__NEVER_USE_SPRINTF__; -#ifndef S_ISREG -#define S_ISREG(x) ((S_IFREG & (x))!=0) -#endif +#define pstrcpy(d,s) safe_strcpy((d),(s),sizeof(pstring)-1) +#define pstrcat(d,s) safe_strcat((d),(s),sizeof(pstring)-1) +#define fstrcpy(d,s) safe_strcpy((d),(s),sizeof(fstring)-1) +#define fstrcat(d,s) safe_strcat((d),(s),sizeof(fstring)-1) -#ifndef S_ISDIR -#define S_ISDIR(x) ((S_IFDIR & (x))!=0) +#ifdef __COMPAR_FN_T +#define QSORT_CAST (__compar_fn_t) #endif -#if !defined(S_ISLNK) && defined(S_IFLNK) -#define S_ISLNK(x) ((S_IFLNK & (x))!=0) +#ifndef QSORT_CAST +#define QSORT_CAST (int (*)(const void *, const void *)) #endif -#ifdef UFC_CRYPT -#define crypt ufc_crypt +/* this guess needs to be improved (tridge) */ +#if defined(HAVE_STATVFS) && !defined(SYSV) +#define SYSV 1 #endif -#ifdef REPLACE_STRLEN -#define strlen(s) Strlen(s) +#ifndef DEFAULT_PRINTING +#ifdef SYSV +#define DEFAULT_PRINTING PRINT_SYSV +#else +#define DEFAULT_PRINTING PRINT_BSD #endif - -#ifdef REPLACE_STRSTR -#define strstr(s,p) Strstr(s,p) #endif -#ifdef REPLACE_MKTIME -#define mktime(t) Mktime(t) +#ifndef SIGCLD +#define SIGCLD SIGCHLD #endif -#ifndef NGROUPS_MAX -#define NGROUPS_MAX 128 +#if (defined(HAVE_SYSV_IPC) || defined(HAVE_SHARED_MMAP)) +#define FAST_SHARE_MODES 1 #endif -#ifndef EDQUOT -#define EDQUOT ENOSPC +#ifndef MAP_FILE +#define MAP_FILE 0 #endif -#ifndef HAVE_GETGRNAM -#define HAVE_GETGRNAM 1 +#ifdef HAVE_SYSV_IPC +#ifndef HAVE_UNION_SEMUN +union semun { + int val; + struct semid_ds *buf; + unsigned short *array; +}; #endif - -#ifndef SOL_TCP -#define SOL_TCP 6 #endif -/* default to using ftruncate workaround as this is safer than assuming -it works and getting lots of bug reports */ -#ifndef FTRUNCATE_CAN_EXTEND -#define FTRUNCATE_CAN_EXTEND 0 +#if (!defined(WITH_NISPLUS) && !defined(WITH_LDAP)) +#define USE_SMBPASS_DB 1 #endif -/* maybe this unix doesn't separate RD and WR locks? */ -#ifndef F_RDLCK -#define F_RDLCK F_WRLCK +#if defined(HAVE_PUTPRPWNAM) && defined(AUTH_CLEARTEXT_SEG_CHARS) +#define OSF1_ENH_SEC 1 #endif -#ifndef ENOTSOCK -#define ENOTSOCK EINVAL +#if defined(HAVE_PAM_AUTHENTICATE) && defined(HAVE_SECURITY_PAM_APPL_H) +#define HAVE_PAM 1 #endif -#ifndef SIGCLD -#define SIGCLD SIGCHLD -#endif +#if defined(HAVE_YP_GET_DEFAULT_DOMAIN) +#define HAVE_NETGROUP 1 +#endif -#ifndef MAP_FILE -#define MAP_FILE 0 +#ifndef ALLOW_CHANGE_PASSWORD +#if (defined(HAVE_TERMIOS_H) && defined(HAVE_DUP2) && defined(HAVE_SETSID)) +#define ALLOW_CHANGE_PASSWORD 1 +#endif #endif -#ifndef HAVE_FCNTL_LOCK -#define HAVE_FCNTL_LOCK 1 +/* what is the longest significant password available on your system? + Knowing this speeds up password searches a lot */ +#ifndef PASSWORD_LENGTH +#define PASSWORD_LENGTH 8 #endif -#ifndef WAIT3_CAST2 -#define WAIT3_CAST2 (struct rusage *) + +#ifndef HAVE_PIPE +#define SYNC_DNS 1 #endif -#ifndef WAIT3_CAST1 -#define WAIT3_CAST1 (int *) +#ifndef MAXPATHLEN +#define MAXPATHLEN 256 #endif -#ifndef QSORT_CAST -#define QSORT_CAST (int (*)()) +#ifndef SEEK_SET +#define SEEK_SET 0 #endif #ifndef INADDR_LOOPBACK #define INADDR_LOOPBACK 0x7f000001 -#endif /* INADDR_LOOPBACK */ - -/* this is a rough check to see if this machine has a lstat() call. - it is not guaranteed to work */ -#if !defined(S_ISLNK) -#define lstat stat #endif -/* Not all systems declare ERRNO in errno.h... and some systems #define it! */ -#ifndef errno -extern int errno; -#endif - - -#ifdef NO_EID -#define geteuid() getuid() -#define getegid() getgid() -#define seteuid(x) setuid(x) -#define setegid(x) setgid(x) +#ifndef HAVE_CRYPT +#define crypt ufc_crypt #endif +#if defined(HAVE_CRYPT16) && defined(HAVE_GETAUTHUID) +#define ULTRIX_AUTH 1 +#endif -#if (HAVE_FCNTL_LOCK == 0) -/* since there is no locking available, system includes */ -/* for DomainOS 10.4 do not contain any of the following */ -/* #define's. So, to satisfy the compiler, add these */ -/* #define's, although they arn't really necessary. */ -#define F_GETLK 0 -#define F_SETLK 0 -#define F_WRLCK 0 -#define F_UNLCK 0 -#endif /* HAVE_FCNTL_LOCK == 0 */ - -#ifdef NOSTRCASECMP -#define strcasecmp(s1,s2) StrCaseCmp(s1,s2) -#define strncasecmp(s1,s2,n) StrnCaseCmp(s1,s2,n) +#ifndef HAVE_STRDUP +char *strdup(const char *s); #endif -#ifdef strcpy -#undef strcpy -#endif /* strcpy */ -#define strcpy(dest,src) __ERROR__XX__NEVER_USE_STRCPY___; +#ifndef HAVE_MEMMOVE +void *memmove(void *dest,const void *src,int size); +#endif -#ifdef strcat -#undef strcat -#endif /* strcat */ -#define strcat(dest,src) __ERROR__XX__NEVER_USE_STRCAT___; +#ifndef HAVE_INITGROUPS +int initgroups(char *name,gid_t id); +#endif -#ifdef sprintf -#undef sprintf -#endif /* sprintf */ -#define sprintf __ERROR__XX__NEVER_USE_SPRINTF__; +#ifndef HAVE_RENAME +int rename(const char *zfrom, const char *zto); +#endif -#define pstrcpy(d,s) safe_strcpy((d),(s),sizeof(pstring)-1) -#define pstrcat(d,s) safe_strcat((d),(s),sizeof(pstring)-1) -#define fstrcpy(d,s) safe_strcpy((d),(s),sizeof(fstring)-1) -#define fstrcat(d,s) safe_strcat((d),(s),sizeof(fstring)-1) +#ifndef HAVE_MKTIME +time_t mktime(struct tm *t); +#endif -#if MEM_MAN -#include "mem_man/mem_man.h" -#endif /* MEM_MAN */ +#ifndef HAVE_FTRUNCATE +int ftruncate(int f,long l); +#endif #endif /* _INCLUDES_H */ diff --git a/source3/include/local.h b/source3/include/local.h index 0a369d80e2..afe1a3b1c6 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -152,12 +152,6 @@ accessible to root */ #define DUMP_CORE 1 -/* what is the longest significant password available on your system? - Knowing this speeds up password searches a lot */ -#ifndef PASSWORD_LENGTH -#define PASSWORD_LENGTH 8 -#endif - #define SMB_ALIGNMENT 1 diff --git a/source3/include/proto.h b/source3/include/proto.h index 97ee483f55..523d7c9615 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -160,6 +160,10 @@ BOOL deal_with_creds(uchar sess_key[8], DOM_CRED *sto_clnt_cred, DOM_CRED *rcv_clnt_cred, DOM_CRED *rtn_srv_cred); +/*The following definitions come from dfree.c */ + +int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); + /*The following definitions come from dir.c */ void init_dptrs(void); @@ -186,7 +190,7 @@ BOOL SeekDir(void *p,int pos); int TellDir(void *p); void DirCacheAdd( char *path, char *name, char *dname, int snum ); char *DirCacheCheck( char *path, char *name, int snum ); -void DirCacheFlush( int snum ); +void DirCacheFlush(int snum); /*The following definitions come from fault.c */ @@ -1188,21 +1192,6 @@ BOOL name_map_mangle( char *OutName, BOOL need83, int snum ); void mdfour(unsigned char *out, unsigned char *in, int n); -/*The following definitions come from mem_man/mem_man.c */ - -void *smb_mem_malloc(size_t size,char *file,int line); -char *smb_mem_strdup(char *s, char *file, int line); -int smb_mem_free(void *ptr,char *file,int line); -void smb_mem_write_info(void *ptr,FILE *outfile); -char *smb_mem_query_file(void *ptr); -int smb_mem_query_line(void *ptr); -int smb_mem_test(void *ptr); -void smb_mem_write_status(FILE *outfile); -void smb_mem_write_verbose(FILE *outfile); -void smb_mem_write_errors(FILE *outfile); -void smb_mem_set_multiplier(int multiplier); -void *smb_mem_resize(void *ptr,size_t newsize); - /*The following definitions come from membuffer.c */ void mem_init(struct mem_buf *buf, int margin); @@ -1240,6 +1229,10 @@ BOOL getlmhostsent( FILE *fp, char *name, int *name_type, struct in_addr *ipaddr void endlmhosts(FILE *fp); BOOL resolve_name(char *name, struct in_addr *return_ip); +/*The following definitions come from netmask.c */ + +int get_netmask(struct in_addr *ipaddr, struct in_addr *nmask); + /*The following definitions come from nisppass.c */ struct passdb_ops *nisplus_initialize_password_db(void); @@ -1742,10 +1735,6 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); /*The following definitions come from replace.c */ -char *Strstr(char *s, char *p); -time_t Mktime(struct tm *t); -int InNetGr(char *group,char *host,char *user,char *dom); -void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line); /*The following definitions come from reply.c */ @@ -1811,8 +1800,6 @@ int dos_chmod(int cnum,char *fname,int dosmode,struct stat *st); int file_utime(int cnum, char *fname, struct utimbuf *times); BOOL set_filetime(int cnum, char *fname, time_t mtime); BOOL unix_convert(char *name,int cnum,pstring saved_last_component, BOOL *bad_path); -int disk_free(char *path,int *bsize,int *dfree,int *dsize); -int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); BOOL check_name(char *name,int cnum); void sync_file(int cnum, int fnum); void close_file(int fnum, BOOL normal_close); @@ -1859,6 +1846,12 @@ struct shmem_ops *smb_shm_open(int ronly); struct shmem_ops *sysv_shm_open(int ronly); +/*The following definitions come from signal.c */ + +void BlockSignals(BOOL block,int signum); +void CatchSignal(int signum,void (*handler)(int )); +void CatchChild(void); + /*The following definitions come from slprintf.c */ int vslprintf(char *str, int n, char *format, va_list ap); @@ -1987,7 +1980,6 @@ char *tmpdir(void); BOOL is_a_socket(int fd); BOOL next_token(char **ptr,char *buff,char *sep); char **toktocliplist(int *ctok, char *sep); -void *MemMove(void *dest,void *src,int size); void *mem_dup( void *from, int size ); void array_promote(char *array,int elsize,int element); void set_socket_options(int fd, char *options); @@ -2097,7 +2089,6 @@ struct hostent *Get_Hostbyname(char *name); BOOL process_exists(int pid); char *uidtoname(int uid); char *gidtoname(int gid); -void BlockSignals(BOOL block,int signum); void ajt_panic(void); char *readdirname(void *p); BOOL is_in_path(char *name, name_compare_entry *namelist); diff --git a/source3/include/smb.h b/source3/include/smb.h index 3b1796f76b..1c37aab7e2 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -57,12 +57,6 @@ typedef int BOOL; as signed and unsigned int will work. */ -/* afs/stds.h defines int16 and int32 */ -#ifndef AFS_AUTH -typedef short int16; -typedef int int32; -#endif - #ifndef uint8 typedef unsigned char uint8; #endif @@ -71,22 +65,17 @@ typedef unsigned char uint8; typedef unsigned short uint16; #endif -#ifndef uint32 -typedef unsigned int uint32; -#endif - #ifndef uchar #define uchar unsigned char #endif + #ifndef int16 #define int16 short #endif + #ifndef uint16 #define uint16 unsigned short #endif -#ifndef uint32 -#define uint32 unsigned int -#endif #define SIZEOFWORD 2 @@ -94,11 +83,15 @@ typedef unsigned int uint32; #define DEF_CREATE_MASK (0755) #endif +#ifndef PRINTCAP_NAME +#define PRINTCAP_NAME "/etc/printcap" +#endif + /* how long to wait for secondary SMB packets (milli-seconds) */ #define SMB_SECONDARY_WAIT (60*1000) /* debugging code */ -#ifndef SYSLOG +#if !defined(WITH_SYSLOG) || defined(NO_SYSLOG) #define DEBUG(level,body) ((DEBUGLEVEL>=(level))?(Debug1 body):0) #define DEBUGLVL(level) (DEBUGLEVEL>=(level)) #else @@ -1149,7 +1142,7 @@ struct parm_struct #define ERRHRD 0x03 /* Error is an hardware error. */ #define ERRCMD 0xFF /* Command was not in the "SMB" format. */ -#ifdef __STDC__ +#ifdef HAVE_STDARG_H int Debug1(char *, ...); int slprintf(char *str, int n, char *format, ...); #else @@ -1157,7 +1150,7 @@ int Debug1(); int slprintf(); #endif -#ifdef DFS_AUTH +#ifdef WITH_DFS void dfs_unlogin(void); extern int dcelogin_atmost_once; #endif @@ -1170,14 +1163,6 @@ void ajt_panic(void); char *strdup(char *s); #endif -#ifdef REPLACE_STRLEN -int Strlen(char *); -#endif - -#ifdef REPLACE_STRSTR -char *Strstr(char *s, char *p); -#endif - #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif @@ -1190,7 +1175,7 @@ char *Strstr(char *s, char *p); #endif #ifndef SIGNAL_CAST -#define SIGNAL_CAST +#define SIGNAL_CAST (RETSIGTYPE (*)()) #endif #ifndef SELECT_CAST @@ -1330,10 +1315,10 @@ enum remote_arch_types {RA_UNKNOWN, RA_WFWG, RA_OS2, RA_WIN95, RA_WINNT, RA_SAMB /* case handling */ enum case_handling {CASE_LOWER,CASE_UPPER}; -#ifdef USE_SSL +#ifdef WITH_SSL /* SSL version options */ enum ssl_version_enum {SMB_SSL_V2,SMB_SSL_V3,SMB_SSL_V23,SMB_SSL_TLS1}; -#endif /* USE_SSL */ +#endif /* WITH_SSL */ /* Macros to get at offsets within smb_lkrng and smb_unlkrng structures. We cannot define these as actual structures -- cgit From 8d42ee0f2c8cdd8d9f41e5e245999a9a6d44523f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 29 Jul 1998 03:15:02 +0000 Subject: some merge cleanups (This used to be commit 1d655b7c64231b0aec0548bb90fc3dcc3f37791c) --- source3/include/dummy.in | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 source3/include/dummy.in (limited to 'source3/include') diff --git a/source3/include/dummy.in b/source3/include/dummy.in new file mode 100644 index 0000000000..e69de29bb2 -- cgit From fb08c34cf3950f994701a9c98c89670f6346f7ab Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 29 Jul 1998 05:05:36 +0000 Subject: get rid of the runtime test for broken getgroups() and add a compile time test instead. This also allows us to get rid of the igroups element of a couple of structures. (This used to be commit 8b25fe734166b76ceebf8d9543c706ebe0fddc96) --- source3/include/config.h.in | 1 + source3/include/includes.h | 6 ++++++ source3/include/proto.h | 5 ++--- source3/include/smb.h | 15 ++++++--------- 4 files changed, 15 insertions(+), 12 deletions(-) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 3bc3e95e4f..dbbd5431a2 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -104,6 +104,7 @@ #undef WITH_NISPLUS #undef WITH_AUTOMOUNT #undef HAVE_PAM_AUTHENTICATE +#undef HAVE_BROKEN_GETGROUPS /* The number of bytes in a int. */ #undef SIZEOF_INT diff --git a/source3/include/includes.h b/source3/include/includes.h index b63787fd5e..2a420f76ed 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -287,6 +287,12 @@ extern char *sys_errlist[]; extern int errno; #endif +#ifdef HAVE_BROKEN_GETGROUPS +#define GID_T int +#else +#define GID_T gid_t +#endif + /* Lists, trees, caching, datbase... */ #include "ubi_sLinkList.h" diff --git a/source3/include/proto.h b/source3/include/proto.h index 523d7c9615..c8c0cc8145 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1661,8 +1661,7 @@ BOOL last_challenge(unsigned char *challenge); user_struct *get_valid_user_struct(uint16 vuid); void invalidate_vuid(uint16 vuid); char *validated_username(uint16 vuid); -int setup_groups(char *user, int uid, int gid, int *p_ngroups, - int **p_igroups, gid_t **p_groups); +int setup_groups(char *user, int uid, int gid, int *p_ngroups, GID_T **p_groups); uint16 register_vuid(int uid,int gid, char *unix_name, char *requested_name, BOOL guest); void add_session_user(char *user); BOOL update_smbpassword_file( char *user, fstring password); @@ -1984,7 +1983,7 @@ void *mem_dup( void *from, int size ); void array_promote(char *array,int elsize,int element); void set_socket_options(int fd, char *options); void close_sockets(void ); -BOOL in_group(gid_t group, int current_gid, int ngroups, int *groups); +BOOL in_group(gid_t group, int current_gid, int ngroups, GID_T *groups); char *StrCpy(char *dest,char *src); char *StrnCpy(char *dest,char *src,int n); void putip(void *dest,void *src); diff --git a/source3/include/smb.h b/source3/include/smb.h index 1c37aab7e2..8d846d4531 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -386,11 +386,10 @@ struct cli_state { struct current_user { - int cnum, vuid; - int uid, gid; - int ngroups; - gid_t *groups; - int *igroups; + int cnum, vuid; + int uid, gid; + int ngroups; + GID_T *groups; }; typedef struct @@ -500,8 +499,7 @@ typedef struct /* This groups info is valid for the user that *opened* the connection */ int ngroups; - gid_t *groups; - int *igroups; /* an integer version - some OSes are broken :-( */ + GID_T *groups; time_t lastused; BOOL used; @@ -537,8 +535,7 @@ typedef struct /* following groups stuff added by ih */ /* This groups info is needed for when we become_user() for this uid */ int n_groups; - gid_t *groups; - int *igroups; /* an integer version - some OSes are broken :-( */ + GID_T *groups; int n_sids; int *sids; -- cgit From a957abd1fd1bd891354abb1a3590627ae06a45e9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 29 Jul 1998 07:02:06 +0000 Subject: test for a broken inet_ntoa and replace it if necessary (for IRIX+gcc-2.8.1) (This used to be commit ddffbcbcb1284b6ead5f7f7b6665ba2456c0071a) --- source3/include/config.h.in | 1 + source3/include/includes.h | 3 +++ 2 files changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index dbbd5431a2..142c554da6 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -105,6 +105,7 @@ #undef WITH_AUTOMOUNT #undef HAVE_PAM_AUTHENTICATE #undef HAVE_BROKEN_GETGROUPS +#undef REPLACE_INET_NTOA /* The number of bytes in a int. */ #undef SIZEOF_INT diff --git a/source3/include/includes.h b/source3/include/includes.h index 2a420f76ed..a4547a6b4a 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -408,6 +408,9 @@ union semun { #define PASSWORD_LENGTH 8 #endif +#ifdef REPLACE_INET_NTOA +#define inet_ntoa rep_inet_ntoa +#endif #ifndef HAVE_PIPE #define SYNC_DNS 1 -- cgit From 184cf564e622f286c7be465330c09e61bce07c30 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 29 Jul 1998 07:11:33 +0000 Subject: updated prototypes (This used to be commit 0bdb51af3199eb32cd3da4c4b8d31fbed5d2ae85) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index c8c0cc8145..955d746125 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1734,6 +1734,7 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); /*The following definitions come from replace.c */ +char *rep_inet_ntoa(struct in_addr ip); /*The following definitions come from reply.c */ -- cgit From 555616b85e4de934d9230bcdc17ddf945ac11510 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 30 Jul 1998 07:05:15 +0000 Subject: added HAVE_FUNCTION_MACRO test (This used to be commit cae580ccc397ea33fdb24a777bdedef6e8271244) --- source3/include/config.h.in | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 142c554da6..80a1dcb09a 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -106,6 +106,7 @@ #undef HAVE_PAM_AUTHENTICATE #undef HAVE_BROKEN_GETGROUPS #undef REPLACE_INET_NTOA +#undef HAVE_FUNCTION_MACRO /* The number of bytes in a int. */ #undef SIZEOF_INT -- cgit From 7284bb5ca049a682097bb25afcf25d40f1ac5479 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 30 Jul 1998 21:18:57 +0000 Subject: Makefile.in: Moved UBIQX stuff into UTILOBJ. loadparm.c: Added "ole locking compatibility" option (default "true"). locking.c: Changes to implement union in files_struct. locking_shm.c: Changes to implement union in files_struct. nttrans.c: Made opening a directory explicit (we have to). Added create directory code for nttrans. reply.c: Changes to implement union in files_struct. server.c: Changes to implement union in files_struct. Added create directory code. trans2.c: Changes to implement union in files_struct. smb.h: Changes to implement union in files_struct. util.c: Changed linked list code to UNIQX linked list. This will make the other lists I need to implement for ChangeNotify and blocking locks easier. Jeremy. (This used to be commit 3a5eea850bb256b39cff8ace1e4fb4e0c1f5472b) --- source3/include/proto.h | 5 +++-- source3/include/smb.h | 18 ++++++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 955d746125..56d72bd339 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1023,6 +1023,7 @@ BOOL lp_bind_interfaces_only(void); BOOL lp_net_wksta_user_logon(void); BOOL lp_unix_password_sync(void); BOOL lp_passwd_chat_debug(void); +BOOL lp_ole_locking_compat(void); int lp_os_level(void); int lp_max_ttl(void); int lp_max_wins_ttl(void); @@ -1804,7 +1805,7 @@ BOOL check_name(char *name,int cnum); void sync_file(int cnum, int fnum); void close_file(int fnum, BOOL normal_close); void close_directory(int fnum); -void open_directory(int fnum,int cnum,char *fname, int *action); +int open_directory(int fnum,int cnum,char *fname, int smb_ofun, int unixmode, int *action); BOOL check_file_sharing(int cnum,char *fname, BOOL rename_op); int check_share_mode( share_mode_entry *share, int deny_mode, char *fname, BOOL fcbopen, int *flags); @@ -2043,7 +2044,7 @@ int read_smb_length(int fd,char *inbuf,int timeout); BOOL receive_smb(int fd,char *buffer, int timeout); BOOL client_receive_smb(int fd,char *buffer, int timeout); BOOL receive_local_message(int fd, char *buffer, int buffer_len, int timeout); -BOOL push_smb_message(char *buf, int msg_len); +BOOL push_oplock_pending_smb_message(char *buf, int msg_len); BOOL receive_message_or_smb(int smbfd, int oplock_fd, char *buffer, int buffer_len, int timeout, BOOL *got_smb); diff --git a/source3/include/smb.h b/source3/include/smb.h index 8d846d4531..115d8ce31b 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -169,6 +169,7 @@ implemented */ #define ERRbaddirectory 267 /* Invalid directory name in a path. */ #define ERROR_EAS_DIDNT_FIT 275 /* Extended attributes didn't fit */ #define ERROR_EAS_NOT_SUPPORTED 282 /* Extended attributes not supported */ +#define ERROR_NOTIFY_ENUM_DIR 1022 /* Buffer too small to return change notify. */ #define ERRunknownipc 2142 @@ -437,10 +438,24 @@ typedef struct int real_open_flags; } file_fd_struct; +/* + * Structure used to keep directory state information around. + * Used in NT change-notify code. + */ + +typedef struct +{ + time_t modify_time; + time_t status_time; +} dir_status_struct; + typedef struct { int cnum; - file_fd_struct *fd_ptr; + union { + file_fd_struct *fd_ptr; + dir_status_struct *dir_ptr; + } f_u; int pos; uint32 size; int mode; @@ -463,7 +478,6 @@ typedef struct char *name; } files_struct; - struct uid_cache { int entries; int list[UID_CACHE_SIZE]; -- cgit From 3a1fdf05dde2fdd71976b77b85635e300bd436f7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 31 Jul 1998 03:33:25 +0000 Subject: added test for getpwanam(). (This used to be commit 4eb28f7148f61a215ca644cbe704a4e8dbd83a77) --- source3/include/config.h.in | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 80a1dcb09a..d61d540ad9 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -106,6 +106,7 @@ #undef HAVE_PAM_AUTHENTICATE #undef HAVE_BROKEN_GETGROUPS #undef REPLACE_INET_NTOA +#undef HAVE_FILE_MACRO #undef HAVE_FUNCTION_MACRO /* The number of bytes in a int. */ @@ -162,6 +163,9 @@ /* Define if you have the getprpwnam function. */ #undef HAVE_GETPRPWNAM +/* Define if you have the getpwanam function. */ +#undef HAVE_GETPWANAM + /* Define if you have the getrlimit function. */ #undef HAVE_GETRLIMIT -- cgit From ebd415c03f7e76a024182748d2cafebbfd5238b1 Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Fri, 31 Jul 1998 20:16:35 +0000 Subject: This is the checkin of the debug changes. Makefile.in: I've added debug.o. proto.h : Rebuilt, as is standard for these sorts of things. smb.h : New macros, etc. util.c : Debug code removed. I'll check in debug.c in the next step. Chris -)----- (This used to be commit 653c17c1b8e34bfbd05ea35ada9436a50d5a7ba4) --- source3/include/proto.h | 14 ++++++---- source3/include/smb.h | 68 ++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 68 insertions(+), 14 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 56d72bd339..10f01c1b9d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -160,6 +160,15 @@ BOOL deal_with_creds(uchar sess_key[8], DOM_CRED *sto_clnt_cred, DOM_CRED *rcv_clnt_cred, DOM_CRED *rtn_srv_cred); +/*The following definitions come from debug.c */ + +int sig_usr2( void ); +int sig_usr1( void ); +void setup_logging( char *pname, BOOL interactive ); +void reopen_logs( void ); +void force_check_log_size( void ); +BOOL dbghdr( int level, char *file, char *func, int line ); + /*The following definitions come from dfree.c */ int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); @@ -1972,11 +1981,6 @@ BOOL user_in_list(char *user,char *list); /*The following definitions come from util.c */ -int sig_usr2(void); -int sig_usr1(void); -void setup_logging(char *pname,BOOL interactive); -void reopen_logs(void); -void force_check_log_size(void); char *tmpdir(void); BOOL is_a_socket(int fd); BOOL next_token(char **ptr,char *buff,char *sep); diff --git a/source3/include/smb.h b/source3/include/smb.h index 115d8ce31b..60e214d73e 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -90,17 +90,69 @@ typedef unsigned short uint16; /* how long to wait for secondary SMB packets (milli-seconds) */ #define SMB_SECONDARY_WAIT (60*1000) -/* debugging code */ -#if !defined(WITH_SYSLOG) || defined(NO_SYSLOG) -#define DEBUG(level,body) ((DEBUGLEVEL>=(level))?(Debug1 body):0) -#define DEBUGLVL(level) (DEBUGLEVEL>=(level)) +/* -------------------------------------------------------------------------- ** + * Debugging code. See also debug.c + */ + +/* mkproto.awk has trouble with ifdef'd function definitions (it ignores + * the #ifdef directive and will read both definitions, thus creating two + * diffferent prototype declarations), so we must do these by hand. + */ +#ifdef HAVE_STDARG_H +int Debug1( char *, ... ); +BOOL dbgtext( char *, ... ); #else -extern int syslog_level; +int Debug1(); +BOOL dbgtext(); +#endif -#define DEBUG(level,body) ((DEBUGLEVEL>=(level))? (syslog_level = (level), Debug1 body):0) -#define DEBUGLVL(level) ( DEBUGLEVEL >= (syslog_level=(level)) ) +/* If we have these macros, we can add additional info to the header. */ +#ifdef HAVE_FILE_MACRO +#define FILE_MACRO (__FILE__) +#else +#define FILE_MACRO ("") #endif +#ifdef HAVE_FUNCTION_MACRO +#define FUNCTION_MACRO (__FUNCTION__) +#else +#define FUNCTION_MACRO ("") +#endif + +/* Debugging macros. + * DEBUGLVL() - If level is <= the system-wide DEBUGLEVEL then generate a + * header using the default macros for file, line, and + * function name. + * Returns True if the debug level was <= DEBUGLEVEL. + * Example usage: + * if( DEBUGLVL( 2 ) ) + * dbgtext( "Some text.\n" ); + * DEGUG() - Good old DEBUG(). Each call to DEBUG() will generate a new + * header *unless* the previous debug output was unterminated + * (i.e., no '\n'). See debug.c:dbghdr() for more info. + * Example usage: + * DEBUG( 2, ("Some text.\n") ); + * DEBUGADD() - If level <= DEBUGLEVEL, then the text is appended to the + * current message (i.e., no header). + * Usage: + * DEBUGADD( 2, ("Some additional text.\n") ); + */ +#define DEBUGLVL( level ) \ + ( (DEBUGLEVEL>=(level)) \ + && dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) ) ) + +#define DEBUG( level, body ) \ + if( (DEBUGLEVEL>=(level)) \ + && dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) ) ) \ + (void)dbgtext body + +#define DEBUGADD( level, body ) \ + if( DEBUGLEVEL>=(level) ) (void)dbgtext body + +/* End Debugging code section. + * -------------------------------------------------------------------------- ** + */ + /* this defines the error codes that receive_smb can put in smb_read_error */ #define READ_TIMEOUT 1 #define READ_EOF 2 @@ -1154,10 +1206,8 @@ struct parm_struct #define ERRCMD 0xFF /* Command was not in the "SMB" format. */ #ifdef HAVE_STDARG_H -int Debug1(char *, ...); int slprintf(char *str, int n, char *format, ...); #else -int Debug1(); int slprintf(); #endif -- cgit From 7448091da6ee11709b8e5117ff6810515567f88a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 3 Aug 1998 19:07:55 +0000 Subject: First implementation of ChangeNotify - this version only checks for changes in the directory modify timestamps. A better version will look at the requested client flags, and create a hash that represents the current state of the directory, and check against this instead. debug.c: Added lp_timestamp_logs() function. loadparm.c: Added "change notify timeout" in seconds (default 60) - this is the scan rate for a directory. Added ""timestamp logs" boolean - default True. Turns off log timestamps (so I can read them :-). nttrans.c: ChangeNotify implementation. server.c: ChangeNotify implementation. shmem_sysv.c: Added exits on shmem errors (without them smbd can core dump if some calls fail). smb.h: Added ChangeNotify flags for future use. util.c: Tidied up typedef. Jeremy. (This used to be commit a0748c3f53974483680ebe2ea4f556ece8d7fa43) --- source3/include/proto.h | 5 +++++ source3/include/smb.h | 15 +++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 10f01c1b9d..d3dcd70c16 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1024,6 +1024,7 @@ BOOL lp_strip_dot(void); BOOL lp_encrypted_passwords(void); BOOL lp_update_encrypted(void); BOOL lp_syslog_only(void); +BOOL lp_timestamp_logs(void); BOOL lp_browse_list(void); BOOL lp_unix_realname(void); BOOL lp_nis_home_map(void); @@ -1058,6 +1059,7 @@ int lp_announce_as(void); int lp_lm_announce(void); int lp_lm_interval(void); int lp_machine_password_timeout(void); +int lp_change_notify_timeout(void); int lp_ldap_port(void); char *lp_preexec(int ); char *lp_postexec(int ); @@ -1603,6 +1605,9 @@ char *get_nt_error_msg(uint32 nt_code); int reply_ntcreate_and_X(char *inbuf,char *outbuf,int length,int bufsize); int reply_ntcancel(char *inbuf,char *outbuf,int length,int bufsize); int reply_nttranss(char *inbuf,char *outbuf,int length,int bufsize); +void remove_pending_change_notify_requests_by_fid(int fnum); +void remove_pending_change_notify_requests_by_mid(int mid); +void process_pending_change_notify_queue(time_t t); int reply_nttrans(char *inbuf,char *outbuf,int length,int bufsize); /*The following definitions come from params.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index 60e214d73e..b33db0ce66 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -190,7 +190,7 @@ implemented */ #define STYPE_IPC 3 /* Interprocess communication (IPC) */ #define STYPE_HIDDEN 0x80000000 /* share is a hidden one (ends with $) */ -/* SMB X/Open error codes for the ERRdos error class */ +/* SMB X/Open error codes for the ERRDOS error class */ #define ERRbadfunc 1 /* Invalid function (or system call) */ #define ERRbadfile 2 /* File not found (pathname error) */ #define ERRbadpath 3 /* Directory not found */ @@ -1076,7 +1076,7 @@ struct parm_struct #define smb_nt_DataOffset (smb_vwv0 + 31) #define smb_nt_SetupCount (smb_vwv0 + 35) #define smb_nt_Function (smb_vwv0 + 36) -#define smb_nt_SetupStart (smb_vwv0 + 39) +#define smb_nt_SetupStart (smb_vwv0 + 38) /* these are for the NT trans secondary request. */ #define smb_nts_TotalParameterCount (smb_vwv0 + 3) @@ -1195,6 +1195,17 @@ struct parm_struct #define FILE_UNICODE_ON_DISK 0x4 #define FILE_PERISITANT_ACLS 0x8 +/* ChangeNotify flags. */ +#define FILE_NOTIFY_CHANGE_FILE_NAME 0x001 +#define FILE_NOTIFY_CHANGE_DIR_NAME 0x002 +#define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x004 +#define FILE_NOTIFY_CHANGE_SIZE 0x008 +#define FILE_NOTIFY_CHANGE_LAST_WRITE 0x010 +#define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x020 +#define FILE_NOTIFY_CHANGE_CREATION 0x040 +#define FILE_NOTIFY_CHANGE_EA 0x080 +#define FILE_NOTIFY_CHANGE_SECURITY 0x100 + /* where to find the base of the SMB packet proper */ #define smb_base(buf) (((char *)(buf))+4) -- cgit From 963e96f3a980b20925e21ed2f9d3744c21802cce Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 8 Aug 1998 01:15:14 +0000 Subject: added --with-nisplus-home option (This used to be commit 70000c21909a154344b489e8aa18a5868ff52865) --- source3/include/config.h.in | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index d61d540ad9..3bdf5f1918 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -102,6 +102,7 @@ #undef WITH_SSL #undef WITH_LDAP #undef WITH_NISPLUS +#undef WITH_NISPLUS_HOME #undef WITH_AUTOMOUNT #undef HAVE_PAM_AUTHENTICATE #undef HAVE_BROKEN_GETGROUPS -- cgit From 426de6f97f1b585b754c2c4b214ca7aa8b7f1a42 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 9 Aug 1998 11:23:13 +0000 Subject: the autoconf scripts are now converted to the new directory structure now the Makefile ..... (This used to be commit 4fae7f129e46930960831af0da28496f9766f6ae) --- source3/include/config.h.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 3bdf5f1918..b73ee04e77 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -1,4 +1,4 @@ -/* config.h.in. Generated automatically from configure.in by autoheader. */ +/* include/config.h.in. Generated automatically from configure.in by autoheader. */ /* Define if on AIX 3. System headers sometimes define this. -- cgit From 87bcd5502c105921b48f9654d1c4f6d14ed9e9f6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 9 Aug 1998 11:25:49 +0000 Subject: added ignore rules for the dummy files (This used to be commit 687f76a17d6d3ebd33b4d9a848deef56f3c1f56a) --- source3/include/.cvsignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 source3/include/.cvsignore (limited to 'source3/include') diff --git a/source3/include/.cvsignore b/source3/include/.cvsignore new file mode 100644 index 0000000000..10c58ff061 --- /dev/null +++ b/source3/include/.cvsignore @@ -0,0 +1,2 @@ +config.h +dummy -- cgit From 5a5049cd77c608134c87a2332b8a070c01731680 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 9 Aug 1998 13:12:09 +0000 Subject: removed the if statements from the DEBUG() macro definitions. Chris, you should never put if statements in macros, use the ugly (a?b:c) form instead, otherwise you can produce incorrect code when you have things like: if (foo) DEBUG((blah)); else DEBUG((blooh)); (This used to be commit ab912448c1ff2487b6a313574d72f389baa65e6d) --- source3/include/smb.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index b33db0ce66..f8a055ad48 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -142,12 +142,12 @@ BOOL dbgtext(); && dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) ) ) #define DEBUG( level, body ) \ - if( (DEBUGLEVEL>=(level)) \ - && dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) ) ) \ - (void)dbgtext body + ((DEBUGLEVEL>=(level) && \ + dbghdr(level, FILE_MACRO, FUNCTION_MACRO, (__LINE__)))? \ + (void)dbgtext body:0) #define DEBUGADD( level, body ) \ - if( DEBUGLEVEL>=(level) ) (void)dbgtext body + (DEBUGLEVEL>=(level)?(void)dbgtext body:0); /* End Debugging code section. * -------------------------------------------------------------------------- ** -- cgit From 35f815d2786ec1bd99676f62ff5e636e81809e51 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 9 Aug 1998 13:25:34 +0000 Subject: this gets smbd compiling and linking correctly with the new layout. (This used to be commit d08fa39cec5c71a9034dbf4241fc7e195f1bbaa5) --- source3/include/local.h | 5 + source3/include/ntdomain.h | 16 +- source3/include/proto.h | 2706 +++++++++++++++++++------------------------- 3 files changed, 1157 insertions(+), 1570 deletions(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index afe1a3b1c6..2350c00211 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -5,6 +5,11 @@ #ifndef _LOCAL_H #define _LOCAL_H +/* The default workgroup - usually overridden in smb.conf */ +#ifndef WORKGROUP +#define WORKGROUP "WORKGROUP" +#endif + /* This defines the section name in the configuration file that will contain */ /* global parameters - that is, parameters relating to the whole server, not */ /* just services. This name is then reserved, and may not be used as a */ diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index 329cb1e325..50f9397012 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -26,18 +26,18 @@ /* dce/rpc support */ -#include "lib/rpc/include/rpc_dce.h" +#include "rpc_dce.h" /* miscellaneous structures / defines */ -#include "lib/rpc/include/rpc_misc.h" +#include "rpc_misc.h" /* different dce/rpc pipes */ -#include "lib/rpc/include/rpc_lsa.h" -#include "lib/rpc/include/rpc_netlogon.h" -#include "lib/rpc/include/rpc_reg.h" -#include "lib/rpc/include/rpc_samr.h" -#include "lib/rpc/include/rpc_srvsvc.h" -#include "lib/rpc/include/rpc_wkssvc.h" +#include "rpc_lsa.h" +#include "rpc_netlogon.h" +#include "rpc_reg.h" +#include "rpc_samr.h" +#include "rpc_srvsvc.h" +#include "rpc_wkssvc.h" /* * A bunch of stuff that was put into smb.h diff --git a/source3/include/proto.h b/source3/include/proto.h index d3dcd70c16..e1f88f2365 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -3,164 +3,19 @@ /* This file is automatically generated with "make proto". DO NOT EDIT */ -/*The following definitions come from access.c */ - -BOOL check_access(int snum); -BOOL allow_access(char *deny_list,char *allow_list,char *cname,char *caddr); - -/*The following definitions come from asyncdns.c */ - -int asyncdns_fd(void); -void kill_async_dns_child(void); -void start_async_dns(void); -void run_dns_queue(void); -BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question, - struct name_record **n); -BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question, - struct name_record **n); -void kill_async_dns_child(void); - -/*The following definitions come from charcnv.c */ +/*The following definitions come from lib/charcnv.c */ char *unix2dos_format(char *str,BOOL overwrite); char *dos2unix_format(char *str, BOOL overwrite); void interpret_character_set(char *str); -/*The following definitions come from charset.c */ +/*The following definitions come from lib/charset.c */ void charset_initialise(void); void codepage_initialise(int client_codepage); void add_char_string(char *s); -/*The following definitions come from chgpasswd.c */ - -BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence, BOOL as_root); -BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root); -BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root); -BOOL check_lanman_password(char *user, unsigned char *pass1, - unsigned char *pass2, struct smb_passwd **psmbpw); -BOOL change_lanman_password(struct smb_passwd *smbpw, unsigned char *pass1, unsigned char *pass2); -BOOL check_oem_password(char *user, unsigned char *data, - struct smb_passwd **psmbpw, char *new_passwd, - int new_passwd_size); -BOOL change_oem_password(struct smb_passwd *smbpw, char *new_passwd, BOOL override); - -/*The following definitions come from client.c */ - -void cli_smb_close(char *inbuf, char *outbuf, int clnt_fd, int c_num, int f_num); -void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(file_info *),BOOL recurse_dir, BOOL dirstoo); -void cmd_help(char *dum_in, char *dum_out); - -/*The following definitions come from clientgen.c */ - -char *cli_smb_errstr(struct cli_state *cli); -char *cli_errstr(struct cli_state *cli); -BOOL cli_api_pipe(struct cli_state *cli, char *pipe_name, int pipe_name_len, - uint16 *setup, uint32 setup_count, uint32 max_setup_count, - char *params, uint32 param_count, uint32 max_param_count, - char *data, uint32 data_count, uint32 max_data_count, - char **rparam, uint32 *rparam_count, - char **rdata, uint32 *rdata_count); -BOOL cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation); -BOOL cli_RNetShareEnum(struct cli_state *cli, void (*fn)(char *, uint32, char *)); -BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype, - void (*fn)(char *, uint32, char *)); -BOOL cli_session_setup(struct cli_state *cli, - char *user, - char *pass, int passlen, - char *ntpass, int ntpasslen, - char *workgroup); -BOOL cli_ulogoff(struct cli_state *cli); -BOOL cli_send_tconX(struct cli_state *cli, - char *share, char *dev, char *pass, int passlen); -BOOL cli_tdis(struct cli_state *cli); -BOOL cli_mv(struct cli_state *cli, char *fname_src, char *fname_dst); -BOOL cli_unlink(struct cli_state *cli, char *fname); -BOOL cli_mkdir(struct cli_state *cli, char *dname); -BOOL cli_rmdir(struct cli_state *cli, char *dname); -int cli_open(struct cli_state *cli, char *fname, int flags, int share_mode); -BOOL cli_close(struct cli_state *cli, int fnum); -BOOL cli_lock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout); -BOOL cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout); -int cli_read(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 size); -int cli_write(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 size); -BOOL cli_getatr(struct cli_state *cli, char *fname, - int *attr, uint32 *size, time_t *t); -BOOL cli_setatr(struct cli_state *cli, char *fname, int attr, time_t t); -BOOL cli_qpathinfo(struct cli_state *cli, char *fname, - time_t *c_time, time_t *a_time, time_t *m_time, uint32 *size); -BOOL cli_qpathinfo2(struct cli_state *cli, char *fname, - time_t *c_time, time_t *a_time, time_t *m_time, - time_t *w_time, uint32 *size); -BOOL cli_qfileinfo(struct cli_state *cli, int fnum, - time_t *c_time, time_t *a_time, time_t *m_time, uint32 *size); -BOOL cli_oem_change_password(struct cli_state *cli, char *user, char *new_password, - char *old_password); -BOOL cli_negprot(struct cli_state *cli); -BOOL cli_session_request(struct cli_state *cli, char *host, int name_type, - char *myname); -BOOL cli_connect(struct cli_state *cli, char *host, struct in_addr *ip); -BOOL cli_initialise(struct cli_state *cli); -void cli_shutdown(struct cli_state *cli); -void cli_error(struct cli_state *cli, int *eclass, int *num); -void cli_sockopt(struct cli_state *cli, char *options); -int cli_setpid(struct cli_state *cli, int pid); - -/*The following definitions come from clientutil.c */ - -void cli_setup_pkt(char *outbuf); -BOOL cli_call_api(char *pipe_name, int pipe_name_len, - int prcnt,int drcnt, int srcnt, - int mprcnt,int mdrcnt, - int *rprcnt,int *rdrcnt, - char *param,char *data, uint16 *setup, - char **rparam,char **rdata); -BOOL cli_receive_trans_response(char *inbuf,int trans, - int *data_len,int *param_len, - char **data,char **param); -BOOL cli_send_trans_request(char *outbuf,int trans, - char *name,int namelen, int fid,int flags, - char *data,char *param,uint16 *setup, - int ldata,int lparam,int lsetup, - int mdata,int mparam,int msetup); -BOOL cli_send_session_request(char *inbuf,char *outbuf); -BOOL cli_send_login(char *inbuf,char *outbuf,BOOL start_session,BOOL use_setup, struct connection_options *options); -void cli_send_logout(char *dum_in, char *dum_out); -BOOL cli_open_sockets(int port ); -BOOL cli_reopen_connection(char *inbuf,char *outbuf); - -/*The following definitions come from clitar.c */ - -int padit(char *buf, int bufsize, int padsize); -void cmd_block(char *dum_in, char *dum_out); -void cmd_tarmode(char *dum_in, char *dum_out); -void cmd_setmode(char *dum_in, char *dum_out); -void cmd_tar(char *inbuf, char *outbuf); -int process_tar(char *inbuf, char *outbuf); -int clipfind(char **aret, int ret, char *tok); -int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind); - -/*The following definitions come from connection.c */ - -BOOL yield_connection(int cnum,char *name,int max_connections); -BOOL claim_connection(int cnum,char *name,int max_connections,BOOL Clear); - -/*The following definitions come from credentials.c */ - -char *credstr(uchar *cred); -void cred_session_key(DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal, char *pass, - uchar session_key[8]); -void cred_create(uchar session_key[8], DOM_CHAL *stor_cred, UTIME timestamp, - DOM_CHAL *cred); -int cred_assert(DOM_CHAL *cred, uchar session_key[8], DOM_CHAL *stored_cred, - UTIME timestamp); -BOOL clnt_deal_with_creds(uchar sess_key[8], - DOM_CRED *sto_clnt_cred, DOM_CRED *rcv_srv_cred); -BOOL deal_with_creds(uchar sess_key[8], - DOM_CRED *sto_clnt_cred, - DOM_CRED *rcv_clnt_cred, DOM_CRED *rtn_srv_cred); - -/*The following definitions come from debug.c */ +/*The following definitions come from lib/debug.c */ int sig_usr2( void ); int sig_usr1( void ); @@ -169,56 +24,15 @@ void reopen_logs( void ); void force_check_log_size( void ); BOOL dbghdr( int level, char *file, char *func, int line ); -/*The following definitions come from dfree.c */ - -int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); - -/*The following definitions come from dir.c */ - -void init_dptrs(void); -char *dptr_path(int key); -char *dptr_wcard(int key); -BOOL dptr_set_wcard(int key, char *wcard); -BOOL dptr_set_attr(int key, uint16 attr); -uint16 dptr_attr(int key); -void dptr_close(int key); -void dptr_closecnum(int cnum); -void dptr_idlecnum(int cnum); -void dptr_closepath(char *path,int pid); -int dptr_create(int cnum,char *path, BOOL expect_close,int pid); -BOOL dptr_fill(char *buf1,unsigned int key); -BOOL dptr_zero(char *buf); -void *dptr_fetch(char *buf,int *num); -void *dptr_fetch_lanman2(int dptr_num); -BOOL dir_check_ftype(int cnum,int mode,struct stat *st,int dirtype); -BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend); -void *OpenDir(int cnum, char *name, BOOL use_veto); -void CloseDir(void *p); -char *ReadDirName(void *p); -BOOL SeekDir(void *p,int pos); -int TellDir(void *p); -void DirCacheAdd( char *path, char *name, char *dname, int snum ); -char *DirCacheCheck( char *path, char *name, int snum ); -void DirCacheFlush(int snum); - -/*The following definitions come from fault.c */ +/*The following definitions come from lib/fault.c */ void fault_setup(void (*fn)(void *)); -/*The following definitions come from genrand.c */ - -void generate_random_buffer( unsigned char *out, int len, BOOL re_seed); - -/*The following definitions come from getsmbpass.c */ +/*The following definitions come from lib/getsmbpass.c */ char *getsmbpass(char *prompt) ; -/*The following definitions come from groupname.c */ - -void load_groupname_map(void); -void map_gid_to_sid( gid_t gid, DOM_SID *psid); - -/*The following definitions come from interface.c */ +/*The following definitions come from lib/interface.c */ void load_interfaces(void); void iface_set_default(char *ip,char *bcast,char *nmask); @@ -233,712 +47,385 @@ struct in_addr *iface_bcast(struct in_addr ip); struct in_addr *iface_nmask(struct in_addr ip); struct in_addr *iface_ip(struct in_addr ip); -/*The following definitions come from ipc.c */ - -int get_printerdrivernumber(int snum); -int reply_trans(char *inbuf,char *outbuf, int size, int bufsize); - -/*The following definitions come from kanji.c */ +/*The following definitions come from lib/kanji.c */ void interpret_coding_system(char *str); void initialize_multibyte_vectors( int client_codepage); -/*The following definitions come from ldap.c */ +/*The following definitions come from lib/md4.c */ -struct passdb_ops *ldap_initialize_password_db(void); +void mdfour(unsigned char *out, unsigned char *in, int n); -/*The following definitions come from lib/rpc/client/cli_login.c */ +/*The following definitions come from lib/membuffer.c */ -BOOL cli_nt_setup_creds(struct cli_state *cli, unsigned char mach_pwd[16]); -BOOL cli_nt_srv_pwset(struct cli_state *cli, unsigned char *new_hashof_mach_pwd); -BOOL cli_nt_login_interactive(struct cli_state *cli, char *domain, char *username, - uint32 smb_userid_low, char *password, - NET_ID_INFO_CTR *ctr, NET_USER_INFO_3 *user_info3); -BOOL cli_nt_login_network(struct cli_state *cli, char *domain, char *username, - uint32 smb_userid_low, char lm_chal[8], char lm_chal_resp[24], - char nt_chal_resp[24], - NET_ID_INFO_CTR *ctr, NET_USER_INFO_3 *user_info3); -BOOL cli_nt_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr); +void mem_init(struct mem_buf *buf, int margin); +void mem_create(struct mem_buf *buf, char *data, int size, int margin, BOOL dynamic); +void mem_take(struct mem_buf *mem_to, struct mem_buf *mem_from); +BOOL mem_alloc_data(struct mem_buf *buf, int size); +BOOL mem_buf_copy(char *copy_into, struct mem_buf *buf, + uint32 offset, uint32 len); +BOOL mem_buf_init(struct mem_buf **buf, uint32 margin); +void mem_buf_free(struct mem_buf **buf); +void mem_free_chain(struct mem_buf **buf); +void mem_free_data(struct mem_buf *buf); +BOOL mem_realloc_data(struct mem_buf *buf, int new_size); +BOOL mem_grow_data(struct mem_buf **buf, BOOL io, int new_size, BOOL force_grow); +BOOL mem_find(struct mem_buf **buf, uint32 offset); +uint32 mem_buf_len(struct mem_buf *buf); +char *mem_data(struct mem_buf **buf, uint32 offset); -/*The following definitions come from lib/rpc/client/cli_netlogon.c */ +/*The following definitions come from lib/netmask.c */ -BOOL cli_net_logon_ctrl2(struct cli_state *cli, uint32 status_level); -BOOL cli_net_auth2(struct cli_state *cli, uint16 sec_chan, - uint32 neg_flags, DOM_CHAL *srv_chal); -BOOL cli_net_req_chal(struct cli_state *cli, DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal); -BOOL cli_net_srv_pwset(struct cli_state *cli, uint8 hashed_mach_pwd[16]); -BOOL cli_net_sam_logon(struct cli_state *cli, NET_ID_INFO_CTR *ctr, - NET_USER_INFO_3 *user_info3); -BOOL cli_net_sam_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr); -BOOL change_trust_account_password( char *domain, char *remote_machine_list); +int get_netmask(struct in_addr *ipaddr, struct in_addr *nmask); -/*The following definitions come from lib/rpc/client/cli_pipe.c */ +/*The following definitions come from lib/pidfile.c */ -uint32 get_rpc_call_id(void); -BOOL rpc_api_pipe(struct cli_state *cli, uint16 cmd, - prs_struct *param , prs_struct *data, - prs_struct *rparam, prs_struct *rdata); -BOOL rpc_api_pipe_req(struct cli_state *cli, uint8 op_num, - prs_struct *data, prs_struct *rdata); -BOOL rpc_pipe_set_hnd_state(struct cli_state *cli, char *pipe_name, uint16 device_state); -BOOL rpc_pipe_bind(struct cli_state *cli, char *pipe_name, - RPC_IFACE *abstract, RPC_IFACE *transfer, BOOL ntlmssp_auth); -BOOL cli_nt_session_open(struct cli_state *cli, char *pipe_name, BOOL encrypted); -void cli_nt_session_close(struct cli_state *cli); +int pidfile_pid(char *name); +void pidfile_create(char *name); -/*The following definitions come from lib/rpc/parse/parse_lsa.c */ +/*The following definitions come from lib/replace.c */ -void make_lsa_trans_name(LSA_TRANS_NAME *trn, uint32 sid_name_use, char *name, uint32 idx); -void lsa_io_trans_name(char *desc, LSA_TRANS_NAME *trn, prs_struct *ps, int depth); -void lsa_io_dom_r_ref(char *desc, DOM_R_REF *r_r, prs_struct *ps, int depth); -void make_lsa_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, uint32 sec_qos); -void lsa_io_obj_attr(char *desc, LSA_OBJ_ATTR *attr, prs_struct *ps, int depth); -void make_q_open_pol(LSA_Q_OPEN_POL *r_q, char *server_name, - uint32 attributes, uint32 sec_qos, - uint32 desired_access); -void lsa_io_q_open_pol(char *desc, LSA_Q_OPEN_POL *r_q, prs_struct *ps, int depth); -void lsa_io_r_open_pol(char *desc, LSA_R_OPEN_POL *r_p, prs_struct *ps, int depth); -void make_q_query(LSA_Q_QUERY_INFO *q_q, POLICY_HND *hnd, uint16 info_class); -void lsa_io_q_query(char *desc, LSA_Q_QUERY_INFO *q_q, prs_struct *ps, int depth); -void lsa_io_q_enum_trust_dom(char *desc, LSA_Q_ENUM_TRUST_DOM *q_e, prs_struct *ps, int depth); -void make_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM *r_e, - uint32 enum_context, char *domain_name, DOM_SID *domain_sid, - uint32 status); -void lsa_io_r_enum_trust_dom(char *desc, LSA_R_ENUM_TRUST_DOM *r_e, prs_struct *ps, int depth); -void make_lsa_q_close(LSA_Q_CLOSE *q_c, POLICY_HND *hnd); -void lsa_io_q_close(char *desc, LSA_Q_CLOSE *q_c, prs_struct *ps, int depth); -void make_lsa_r_close(LSA_R_CLOSE *q_r, POLICY_HND *hnd); -void lsa_io_r_close(char *desc, LSA_R_CLOSE *r_c, prs_struct *ps, int depth); -void lsa_io_r_query(char *desc, LSA_R_QUERY_INFO *r_q, prs_struct *ps, int depth); -void lsa_io_sid_enum(char *desc, LSA_SID_ENUM *sen, prs_struct *ps, int depth); -void lsa_io_q_lookup_sids(char *desc, LSA_Q_LOOKUP_SIDS *q_s, prs_struct *ps, int depth); -void lsa_io_trans_names(char *desc, LSA_TRANS_NAME_ENUM *trn, prs_struct *ps, int depth); -void lsa_io_r_lookup_sids(char *desc, LSA_R_LOOKUP_SIDS *r_s, prs_struct *ps, int depth); -void lsa_io_q_lookup_rids(char *desc, LSA_Q_LOOKUP_RIDS *q_r, prs_struct *ps, int depth); -void lsa_io_r_lookup_rids(char *desc, LSA_R_LOOKUP_RIDS *r_r, prs_struct *ps, int depth); +char *rep_inet_ntoa(struct in_addr ip); -/*The following definitions come from lib/rpc/parse/parse_misc.c */ +/*The following definitions come from lib/signal.c */ -void smb_io_utime(char *desc, UTIME *t, prs_struct *ps, int depth); -void smb_io_time(char *desc, NTTIME *nttime, prs_struct *ps, int depth); -void smb_io_lookup_level(char *desc, LOOKUP_LEVEL *level, prs_struct *ps, int depth); -uint32 get_enum_hnd(ENUM_HND *enh); -void make_enum_hnd(ENUM_HND *enh, uint32 hnd); -void smb_io_enum_hnd(char *desc, ENUM_HND *hnd, prs_struct *ps, int depth); -void smb_io_dom_sid(char *desc, DOM_SID *sid, prs_struct *ps, int depth); -void make_dom_sid2(DOM_SID2 *sid2, DOM_SID *sid); -void smb_io_dom_sid2(char *desc, DOM_SID2 *sid, prs_struct *ps, int depth); -void make_str_hdr(STRHDR *hdr, int max_len, int len, uint32 buffer); -void smb_io_strhdr(char *desc, STRHDR *hdr, prs_struct *ps, int depth); -void make_uni_hdr(UNIHDR *hdr, int max_len, int len, uint32 buffer); -void smb_io_unihdr(char *desc, UNIHDR *hdr, prs_struct *ps, int depth); -void make_uni_hdr2(UNIHDR2 *hdr, int max_len, int len, uint16 terminate); -void smb_io_unihdr2(char *desc, UNIHDR2 *hdr2, prs_struct *ps, int depth); -void make_unistr(UNISTR *str, char *buf); -void smb_io_unistr(char *desc, UNISTR *uni, prs_struct *ps, int depth); -void make_uninotstr2(UNINOTSTR2 *str, char *buf, int len); -void smb_io_uninotstr2(char *desc, UNINOTSTR2 *uni2, uint32 buffer, prs_struct *ps, int depth); -void make_buf_unistr2(UNISTR2 *str, uint32 *ptr, char *buf); -void copy_unistr2(UNISTR2 *str, UNISTR2 *from); -void make_string2(STRING2 *str, char *buf, int len); -void smb_io_string2(char *desc, STRING2 *str2, uint32 buffer, prs_struct *ps, int depth); -void make_unistr2(UNISTR2 *str, char *buf, int len); -void smb_io_unistr2(char *desc, UNISTR2 *uni2, uint32 buffer, prs_struct *ps, int depth); -void make_dom_rid2(DOM_RID2 *rid2, uint32 rid); -void smb_io_dom_rid2(char *desc, DOM_RID2 *rid2, prs_struct *ps, int depth); -void make_dom_rid3(DOM_RID3 *rid3, uint32 rid); -void smb_io_dom_rid3(char *desc, DOM_RID3 *rid3, prs_struct *ps, int depth); -void make_dom_rid4(DOM_RID4 *rid4, uint16 unknown, uint16 attr, uint32 rid); -void smb_io_dom_rid4(char *desc, DOM_RID4 *rid4, prs_struct *ps, int depth); -void make_clnt_srv(DOM_CLNT_SRV *log, char *logon_srv, char *comp_name); -void smb_io_clnt_srv(char *desc, DOM_CLNT_SRV *log, prs_struct *ps, int depth); -void make_log_info(DOM_LOG_INFO *log, char *logon_srv, char *acct_name, - uint16 sec_chan, char *comp_name); -void smb_io_log_info(char *desc, DOM_LOG_INFO *log, prs_struct *ps, int depth); -void smb_io_chal(char *desc, DOM_CHAL *chal, prs_struct *ps, int depth); -void smb_io_cred(char *desc, DOM_CRED *cred, prs_struct *ps, int depth); -void make_clnt_info2(DOM_CLNT_INFO2 *clnt, - char *logon_srv, char *comp_name, - DOM_CRED *clnt_cred); -void smb_io_clnt_info2(char *desc, DOM_CLNT_INFO2 *clnt, prs_struct *ps, int depth); -void make_clnt_info(DOM_CLNT_INFO *clnt, - char *logon_srv, char *acct_name, - uint16 sec_chan, char *comp_name, - DOM_CRED *cred); -void smb_io_clnt_info(char *desc, DOM_CLNT_INFO *clnt, prs_struct *ps, int depth); -void make_logon_id(DOM_LOGON_ID *log, uint32 log_id_low, uint32 log_id_high); -void smb_io_logon_id(char *desc, DOM_LOGON_ID *log, prs_struct *ps, int depth); -void make_owf_info(OWF_INFO *hash, uint8 data[16]); -void smb_io_owf_info(char *desc, OWF_INFO *hash, prs_struct *ps, int depth); -void smb_io_gid(char *desc, DOM_GID *gid, prs_struct *ps, int depth); -void smb_io_pol_hnd(char *desc, POLICY_HND *pol, prs_struct *ps, int depth); -void smb_io_dom_query_3(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth); -void smb_io_dom_query_5(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth); -void smb_io_dom_query(char *desc, DOM_QUERY *d_q, prs_struct *ps, int depth); -void smb_io_dom_name(char *desc, DOM_NAME *name, prs_struct *ps, int depth); - -/*The following definitions come from lib/rpc/parse/parse_net.c */ - -void net_io_neg_flags(char *desc, NEG_FLAGS *neg, prs_struct *ps, int depth); -void make_netinfo_3(NETLOGON_INFO_3 *info, uint32 flags, uint32 logon_attempts); -void net_io_netinfo_3(char *desc, NETLOGON_INFO_3 *info, prs_struct *ps, int depth); -void make_netinfo_1(NETLOGON_INFO_1 *info, uint32 flags, uint32 pdc_status); -void net_io_netinfo_1(char *desc, NETLOGON_INFO_1 *info, prs_struct *ps, int depth); -void make_netinfo_2(NETLOGON_INFO_2 *info, uint32 flags, uint32 pdc_status, - uint32 tc_status, char *trusted_dc_name); -void net_io_netinfo_2(char *desc, NETLOGON_INFO_2 *info, prs_struct *ps, int depth); -void make_q_logon_ctrl2(NET_Q_LOGON_CTRL2 *q_l, char *server_name, - uint32 function_code); -void net_io_q_logon_ctrl2(char *desc, NET_Q_LOGON_CTRL2 *q_l, prs_struct *ps, int depth); -void make_r_logon_ctrl2(NET_R_LOGON_CTRL2 *r_l, uint32 query_level, - uint32 flags, uint32 pdc_status, uint32 logon_attempts, - uint32 tc_status, char *trusted_domain_name); -void net_io_r_logon_ctrl2(char *desc, NET_R_LOGON_CTRL2 *r_l, prs_struct *ps, int depth); -void make_r_trust_dom(NET_R_TRUST_DOM_LIST *r_t, - uint32 num_doms, char *dom_name); -void net_io_r_trust_dom(char *desc, NET_R_TRUST_DOM_LIST *r_t, prs_struct *ps, int depth); -void make_q_trust_dom(NET_Q_TRUST_DOM_LIST *q_l, char *server_name, - uint32 function_code); -void net_io_q_trust_dom(char *desc, NET_Q_TRUST_DOM_LIST *q_l, prs_struct *ps, int depth); -void make_q_req_chal(NET_Q_REQ_CHAL *q_c, - char *logon_srv, char *logon_clnt, - DOM_CHAL *clnt_chal); -void net_io_q_req_chal(char *desc, NET_Q_REQ_CHAL *q_c, prs_struct *ps, int depth); -void net_io_r_req_chal(char *desc, NET_R_REQ_CHAL *r_c, prs_struct *ps, int depth); -void make_q_auth_2(NET_Q_AUTH_2 *q_a, - char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name, - DOM_CHAL *clnt_chal, uint32 clnt_flgs); -void net_io_q_auth_2(char *desc, NET_Q_AUTH_2 *q_a, prs_struct *ps, int depth); -void net_io_r_auth_2(char *desc, NET_R_AUTH_2 *r_a, prs_struct *ps, int depth); -void make_q_srv_pwset(NET_Q_SRV_PWSET *q_s, char *logon_srv, char *acct_name, - uint16 sec_chan, char *comp_name, DOM_CRED *cred, char nt_cypher[16]); -void net_io_q_srv_pwset(char *desc, NET_Q_SRV_PWSET *q_s, prs_struct *ps, int depth); -void net_io_r_srv_pwset(char *desc, NET_R_SRV_PWSET *r_s, prs_struct *ps, int depth); -void make_id_info1(NET_ID_INFO_1 *id, char *domain_name, - uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high, - char *user_name, char *wksta_name, - char sess_key[16], - unsigned char lm_cypher[16], unsigned char nt_cypher[16]); -void net_io_id_info1(char *desc, NET_ID_INFO_1 *id, prs_struct *ps, int depth); -void make_id_info2(NET_ID_INFO_2 *id, char *domain_name, - uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high, - char *user_name, char *wksta_name, - unsigned char lm_challenge[8], - unsigned char lm_chal_resp[24], - unsigned char nt_chal_resp[24]); -void net_io_id_info2(char *desc, NET_ID_INFO_2 *id, prs_struct *ps, int depth); -void make_sam_info(DOM_SAM_INFO *sam, - char *logon_srv, char *comp_name, DOM_CRED *clnt_cred, - DOM_CRED *rtn_cred, uint16 logon_level, - NET_ID_INFO_CTR *ctr, uint16 validation_level); -void net_io_id_info_ctr(char *desc, NET_ID_INFO_CTR *ctr, prs_struct *ps, int depth); -void smb_io_sam_info(char *desc, DOM_SAM_INFO *sam, prs_struct *ps, int depth); -void make_net_user_info3(NET_USER_INFO_3 *usr, - - NTTIME *logon_time, - NTTIME *logoff_time, - NTTIME *kickoff_time, - NTTIME *pass_last_set_time, - NTTIME *pass_can_change_time, - NTTIME *pass_must_change_time, - - char *user_name, - char *full_name, - char *logon_script, - char *profile_path, - char *home_dir, - char *dir_drive, - - uint16 logon_count, - uint16 bad_pw_count, - - uint32 user_id, - uint32 group_id, - uint32 num_groups, - DOM_GID *gids, - uint32 user_flgs, - - char sess_key[16], +void BlockSignals(BOOL block,int signum); +void CatchSignal(int signum,void (*handler)(int )); +void CatchChild(void); - char *logon_srv, - char *logon_dom, +/*The following definitions come from lib/slprintf.c */ - DOM_SID *dom_sid, - char *other_sids); -void net_io_user_info3(char *desc, NET_USER_INFO_3 *usr, prs_struct *ps, int depth); -void net_io_q_sam_logon(char *desc, NET_Q_SAM_LOGON *q_l, prs_struct *ps, int depth); -void net_io_r_sam_logon(char *desc, NET_R_SAM_LOGON *r_l, prs_struct *ps, int depth); -void net_io_q_sam_logoff(char *desc, NET_Q_SAM_LOGOFF *q_l, prs_struct *ps, int depth); -void net_io_r_sam_logoff(char *desc, NET_R_SAM_LOGOFF *r_l, prs_struct *ps, int depth); +int vslprintf(char *str, int n, char *format, va_list ap); -/*The following definitions come from lib/rpc/parse/parse_prs.c */ +/*The following definitions come from lib/system.c */ -void prs_debug(prs_struct *ps, int depth, char *desc, char *fn_name); -void prs_init(prs_struct *ps, uint32 size, - uint8 align, uint32 margin, - BOOL io); -void prs_mem_free(prs_struct *ps); -void prs_align(prs_struct *ps); -BOOL prs_grow(prs_struct *ps); -BOOL prs_uint8(char *name, prs_struct *ps, int depth, uint8 *data8); -BOOL prs_uint16(char *name, prs_struct *ps, int depth, uint16 *data16); -BOOL prs_uint32(char *name, prs_struct *ps, int depth, uint32 *data32); -BOOL prs_uint8s(BOOL charmode, char *name, prs_struct *ps, int depth, uint8 *data8s, int len); -BOOL prs_uint16s(BOOL charmode, char *name, prs_struct *ps, int depth, uint16 *data16s, int len); -BOOL prs_uint32s(BOOL charmode, char *name, prs_struct *ps, int depth, uint32 *data32s, int len); -BOOL prs_uninotstr2(BOOL charmode, char *name, prs_struct *ps, int depth, UNINOTSTR2 *str); -BOOL prs_string2(BOOL charmode, char *name, prs_struct *ps, int depth, STRING2 *str); -BOOL prs_unistr2(BOOL charmode, char *name, prs_struct *ps, int depth, UNISTR2 *str); -BOOL prs_unistr(char *name, prs_struct *ps, int depth, UNISTR *str); -BOOL prs_string(char *name, prs_struct *ps, int depth, char *str, uint16 len); +int sys_select(fd_set *fds,struct timeval *tval); +int sys_select(fd_set *fds,struct timeval *tval); +int sys_unlink(char *fname); +int sys_open(char *fname,int flags,int mode); +DIR *sys_opendir(char *dname); +int sys_stat(char *fname,struct stat *sbuf); +int sys_waitpid(pid_t pid,int *status,int options); +int sys_lstat(char *fname,struct stat *sbuf); +int sys_mkdir(char *dname,int mode); +int sys_rmdir(char *dname); +int sys_chdir(char *dname); +int sys_utime(char *fname,struct utimbuf *times); +int sys_rename(char *from, char *to); +int sys_chmod(char *fname,int mode); +char *sys_getwd(char *s); +int sys_chown(char *fname,int uid,int gid); +int sys_chroot(char *dname); +struct hostent *sys_gethostbyname(char *name); -/*The following definitions come from lib/rpc/parse/parse_reg.c */ +/*The following definitions come from lib/time.c */ -void make_reg_q_open_policy(REG_Q_OPEN_POLICY *r_q, - uint16 unknown_0, uint32 level, uint16 unknown_1); -void reg_io_q_open_policy(char *desc, REG_Q_OPEN_POLICY *r_q, prs_struct *ps, int depth); -void make_reg_r_open_policy(REG_R_OPEN_POLICY *r_r, - POLICY_HND *pol, uint32 status); -void reg_io_r_open_policy(char *desc, REG_R_OPEN_POLICY *r_r, prs_struct *ps, int depth); -void reg_io_q_close(char *desc, REG_Q_CLOSE *q_u, prs_struct *ps, int depth); -void reg_io_r_close(char *desc, REG_R_CLOSE *r_u, prs_struct *ps, int depth); -void make_reg_q_info(REG_Q_INFO *r_q, - POLICY_HND *pol, char *product_type, - NTTIME *prod_time, uint8 major_version, uint8 minor_version, - uint32 unknown); -void reg_io_q_info(char *desc, REG_Q_INFO *r_q, prs_struct *ps, int depth); -void make_reg_r_info(REG_R_INFO *r_r, - uint32 level, char *os_type, - uint32 unknown_0, uint32 unknown_1, - uint32 status); -void reg_io_r_info(char *desc, REG_R_INFO *r_r, prs_struct *ps, int depth); -void make_reg_q_open_entry(REG_Q_OPEN_ENTRY *r_q, - POLICY_HND *pol, char *name, - uint32 unknown_0, uint32 unknown_1, uint16 unknown_2); -void reg_io_q_open_entry(char *desc, REG_Q_OPEN_ENTRY *r_q, prs_struct *ps, int depth); -void make_reg_r_open_entry(REG_R_OPEN_ENTRY *r_r, - POLICY_HND *pol, uint32 status); -void reg_io_r_open_entry(char *desc, REG_R_OPEN_ENTRY *r_r, prs_struct *ps, int depth); +void GetTimeOfDay(struct timeval *tval); +void TimeInit(void); +int TimeDiff(time_t t); +struct tm *LocalTime(time_t *t); +time_t interpret_long_date(char *p); +void put_long_date(char *p,time_t t); +BOOL null_mtime(time_t mtime); +void put_dos_date(char *buf,int offset,time_t unixdate); +void put_dos_date2(char *buf,int offset,time_t unixdate); +void put_dos_date3(char *buf,int offset,time_t unixdate); +time_t make_unix_date(void *date_ptr); +time_t make_unix_date2(void *date_ptr); +time_t make_unix_date3(void *date_ptr); +char *http_timestring(time_t t); +char *timestring(void ); +time_t get_create_time(struct stat *st,BOOL fake_dirs); -/*The following definitions come from lib/rpc/parse/parse_rpc.c */ +/*The following definitions come from lib/ufc.c */ -void make_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 flags, - uint32 call_id, int data_len, int auth_len); -void smb_io_rpc_hdr(char *desc, RPC_HDR *rpc, prs_struct *ps, int depth); -void make_rpc_iface(RPC_IFACE *ifc, char data[16], uint32 version); -void smb_io_rpc_iface(char *desc, RPC_IFACE *ifc, prs_struct *ps, int depth); -void make_rpc_addr_str(RPC_ADDR_STR *str, char *name); -void smb_io_rpc_addr_str(char *desc, RPC_ADDR_STR *str, prs_struct *ps, int depth); -void make_rpc_hdr_bba(RPC_HDR_BBA *bba, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid); -void smb_io_rpc_hdr_bba(char *desc, RPC_HDR_BBA *rpc, prs_struct *ps, int depth); -void make_rpc_hdr_rb(RPC_HDR_RB *rpc, - uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, - uint32 num_elements, uint16 context_id, uint8 num_syntaxes, - RPC_IFACE *abstract, RPC_IFACE *transfer); -void smb_io_rpc_hdr_rb(char *desc, RPC_HDR_RB *rpc, prs_struct *ps, int depth); -void make_rpc_results(RPC_RESULTS *res, - uint8 num_results, uint16 result, uint16 reason); -void smb_io_rpc_results(char *desc, RPC_RESULTS *res, prs_struct *ps, int depth); -void make_rpc_hdr_ba(RPC_HDR_BA *rpc, - uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, - char *pipe_addr, - uint8 num_results, uint16 result, uint16 reason, - RPC_IFACE *transfer); -void smb_io_rpc_hdr_ba(char *desc, RPC_HDR_BA *rpc, prs_struct *ps, int depth); -void make_rpc_hdr_req(RPC_HDR_REQ *hdr, uint32 data_len, uint16 opnum); -void smb_io_rpc_hdr_req(char *desc, RPC_HDR_REQ *rpc, prs_struct *ps, int depth); -void make_rpc_hdr_resp(RPC_HDR_RESP *hdr, uint32 data_len); -void smb_io_rpc_hdr_resp(char *desc, RPC_HDR_RESP *rpc, prs_struct *ps, int depth); -void make_rpc_auth_ntlmssp_req(RPC_AUTH_NTLMSSP_REQ *req, - fstring ntlmssp_str, uint32 ntlmssp_ver, - uint32 unknown_0, fstring myname, fstring domain); -void smb_io_rpc_auth_ntlmssp_req(char *desc, RPC_AUTH_NTLMSSP_REQ *req, prs_struct *ps, int depth); -void make_rpc_auth_ntlmssp_resp(RPC_AUTH_NTLMSSP_RESP *rsp, - uint8 auth_type, uint8 auth_level, uint8 stub_type_len, - fstring ntlmssp_str, uint32 ntlmssp_ver, - uint32 unknown_1, uint32 unknown_2, uint32 unknown_3, - uint8 data[16]); -void smb_io_rpc_auth_ntlmssp_resp(char *desc, RPC_AUTH_NTLMSSP_RESP *rsp, prs_struct *ps, int depth); +char *ufc_crypt(char *key,char *salt); -/*The following definitions come from lib/rpc/parse/parse_samr.c */ +/*The following definitions come from lib/util.c */ -void make_samr_q_close_hnd(SAMR_Q_CLOSE_HND *q_c, POLICY_HND *hnd); -void samr_io_q_close_hnd(char *desc, SAMR_Q_CLOSE_HND *q_u, prs_struct *ps, int depth); -void samr_io_r_close_hnd(char *desc, SAMR_R_CLOSE_HND *r_u, prs_struct *ps, int depth); -void make_samr_q_open_domain(SAMR_Q_OPEN_DOMAIN *q_u, - POLICY_HND *connect_pol, uint32 rid, DOM_SID *sid); -void samr_io_q_open_domain(char *desc, SAMR_Q_OPEN_DOMAIN *q_u, prs_struct *ps, int depth); -void samr_io_r_open_domain(char *desc, SAMR_R_OPEN_DOMAIN *r_u, prs_struct *ps, int depth); -void make_samr_q_unknown_8(SAMR_Q_UNKNOWN_8 *q_u, - POLICY_HND *domain_pol, uint16 switch_value); -void samr_io_q_unknown_8(char *desc, SAMR_Q_UNKNOWN_8 *q_u, prs_struct *ps, int depth); -void make_samr_q_unknown_3(SAMR_Q_UNKNOWN_3 *q_u, - POLICY_HND *user_pol, uint16 switch_value); -void samr_io_q_unknown_3(char *desc, SAMR_Q_UNKNOWN_3 *q_u, prs_struct *ps, int depth); -void make_dom_sid3(DOM_SID3 *sid3, uint16 unk_0, uint16 unk_1, DOM_SID *sid); -void sam_io_dom_sid3(char *desc, DOM_SID3 *sid3, prs_struct *ps, int depth); -void make_sam_sid_stuff(SAM_SID_STUFF *stf, - uint16 unknown_2, uint16 unknown_3, - uint32 unknown_4, uint16 unknown_6, uint16 unknown_7, - int num_sid3s, DOM_SID3 sid3[MAX_SAM_SIDS]); -void sam_io_sid_stuff(char *desc, SAM_SID_STUFF *stf, prs_struct *ps, int depth); -void make_samr_r_unknown_3(SAMR_R_UNKNOWN_3 *r_u, - uint16 unknown_2, uint16 unknown_3, - uint32 unknown_4, uint16 unknown_6, uint16 unknown_7, - int num_sid3s, DOM_SID3 sid3[MAX_SAM_SIDS], - uint32 status); -void samr_io_r_unknown_3(char *desc, SAMR_R_UNKNOWN_3 *r_u, prs_struct *ps, int depth); -void make_sam_str1(SAM_STR1 *sam, char *sam_acct, char *sam_name, char *sam_desc); -void sam_io_sam_str1(char *desc, SAM_STR1 *sam, uint32 acct_buf, uint32 name_buf, uint32 desc_buf, prs_struct *ps, int depth); -void make_sam_entry1(SAM_ENTRY1 *sam, uint32 user_idx, - uint32 len_sam_name, uint32 len_sam_full, uint32 len_sam_desc, - uint32 rid_user, uint16 acb_info); -void sam_io_sam_entry1(char *desc, SAM_ENTRY1 *sam, prs_struct *ps, int depth); -void make_sam_str2(SAM_STR2 *sam, char *sam_acct, char *sam_desc); -void sam_io_sam_str2(char *desc, SAM_STR2 *sam, uint32 acct_buf, uint32 desc_buf, prs_struct *ps, int depth); -void make_sam_entry2(SAM_ENTRY2 *sam, uint32 user_idx, - uint32 len_sam_name, uint32 len_sam_desc, - uint32 rid_user, uint16 acb_info); -void sam_io_sam_entry2(char *desc, SAM_ENTRY2 *sam, prs_struct *ps, int depth); -void make_sam_str3(SAM_STR3 *sam, char *grp_acct, char *grp_desc); -void sam_io_sam_str3(char *desc, SAM_STR3 *sam, uint32 acct_buf, uint32 desc_buf, prs_struct *ps, int depth); -void make_sam_entry3(SAM_ENTRY3 *sam, uint32 grp_idx, - uint32 len_grp_name, uint32 len_grp_desc, uint32 rid_grp); -void sam_io_sam_entry3(char *desc, SAM_ENTRY3 *sam, prs_struct *ps, int depth); -void make_sam_entry(SAM_ENTRY *sam, uint32 len_sam_name, uint32 rid); -void sam_io_sam_entry(char *desc, SAM_ENTRY *sam, prs_struct *ps, int depth); -void make_samr_q_enum_dom_users(SAMR_Q_ENUM_DOM_USERS *q_e, POLICY_HND *pol, - uint16 req_num_entries, uint16 unk_0, - uint16 acb_mask, uint16 unk_1, uint32 size); -void samr_io_q_enum_dom_users(char *desc, SAMR_Q_ENUM_DOM_USERS *q_e, prs_struct *ps, int depth); -void make_samr_r_enum_dom_users(SAMR_R_ENUM_DOM_USERS *r_u, - uint16 total_num_entries, uint16 unk_0, - uint32 num_sam_entries, SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES], uint32 status); -void samr_io_r_enum_dom_users(char *desc, SAMR_R_ENUM_DOM_USERS *r_u, prs_struct *ps, int depth); -void make_samr_q_enum_dom_aliases(SAMR_Q_ENUM_DOM_ALIASES *q_e, POLICY_HND *pol, uint32 size); -void samr_io_q_enum_dom_aliases(char *desc, SAMR_Q_ENUM_DOM_ALIASES *q_e, prs_struct *ps, int depth); -void make_samr_r_enum_dom_aliases(SAMR_R_ENUM_DOM_ALIASES *r_u, - uint32 num_sam_entries, SAM_USER_INFO_21 grps[MAX_SAM_ENTRIES], - uint32 status); -void samr_io_r_enum_dom_aliases(char *desc, SAMR_R_ENUM_DOM_ALIASES *r_u, prs_struct *ps, int depth); -void make_samr_q_query_dispinfo(SAMR_Q_QUERY_DISPINFO *q_e, POLICY_HND *pol, - uint16 switch_level, uint32 start_idx, uint32 size); -void samr_io_q_query_dispinfo(char *desc, SAMR_Q_QUERY_DISPINFO *q_e, prs_struct *ps, int depth); -void make_sam_info_2(SAM_INFO_2 *sam, uint32 acb_mask, - uint32 start_idx, uint32 num_sam_entries, - SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]); -void sam_io_sam_info_2(char *desc, SAM_INFO_2 *sam, prs_struct *ps, int depth); -void make_sam_info_1(SAM_INFO_1 *sam, uint32 acb_mask, - uint32 start_idx, uint32 num_sam_entries, - SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]); -void sam_io_sam_info_1(char *desc, SAM_INFO_1 *sam, prs_struct *ps, int depth); -void make_samr_r_query_dispinfo(SAMR_R_QUERY_DISPINFO *r_u, - uint16 switch_level, SAM_INFO_CTR *ctr, uint32 status); -void samr_io_r_query_dispinfo(char *desc, SAMR_R_QUERY_DISPINFO *r_u, prs_struct *ps, int depth); -void make_samr_q_enum_dom_groups(SAMR_Q_ENUM_DOM_GROUPS *q_e, POLICY_HND *pol, - uint16 switch_level, uint32 start_idx, uint32 size); -void samr_io_q_enum_dom_groups(char *desc, SAMR_Q_ENUM_DOM_GROUPS *q_e, prs_struct *ps, int depth); -void make_samr_r_enum_dom_groups(SAMR_R_ENUM_DOM_GROUPS *r_u, - uint32 start_idx, uint32 num_sam_entries, - SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES], - uint32 status); -void samr_io_r_enum_dom_groups(char *desc, SAMR_R_ENUM_DOM_GROUPS *r_u, prs_struct *ps, int depth); -void make_samr_q_query_aliasinfo(SAMR_Q_QUERY_ALIASINFO *q_e, - POLICY_HND *pol, - uint16 switch_level); -void samr_io_q_query_aliasinfo(char *desc, SAMR_Q_QUERY_ALIASINFO *q_e, prs_struct *ps, int depth); -void make_samr_r_query_aliasinfo(SAMR_R_QUERY_ALIASINFO *r_u, - uint16 switch_value, char *acct_desc, - uint32 status); -void samr_io_r_query_aliasinfo(char *desc, SAMR_R_QUERY_ALIASINFO *r_u, prs_struct *ps, int depth); -void samr_io_q_lookup_ids(char *desc, SAMR_Q_LOOKUP_IDS *q_u, prs_struct *ps, int depth); -void make_samr_r_lookup_ids(SAMR_R_LOOKUP_IDS *r_u, - uint32 num_rids, uint32 *rid, uint32 status); -void samr_io_r_lookup_ids(char *desc, SAMR_R_LOOKUP_IDS *r_u, prs_struct *ps, int depth); -void samr_io_q_lookup_names(char *desc, SAMR_Q_LOOKUP_NAMES *q_u, prs_struct *ps, int depth); -void make_samr_r_lookup_names(SAMR_R_LOOKUP_NAMES *r_u, - uint32 num_rids, uint32 *rid, uint32 status); -void samr_io_r_lookup_names(char *desc, SAMR_R_LOOKUP_NAMES *r_u, prs_struct *ps, int depth); -void make_samr_q_unknown_12(SAMR_Q_UNKNOWN_12 *q_u, - POLICY_HND *pol, uint32 rid, - uint32 num_gids, uint32 *gid); -void samr_io_q_unknown_12(char *desc, SAMR_Q_UNKNOWN_12 *q_u, prs_struct *ps, int depth); -void make_samr_r_unknown_12(SAMR_R_UNKNOWN_12 *r_u, - uint32 num_aliases, fstring *als_name, uint32 *num_als_usrs, - uint32 status); -void samr_io_r_unknown_12(char *desc, SAMR_R_UNKNOWN_12 *r_u, prs_struct *ps, int depth); -void make_samr_q_open_user(SAMR_Q_OPEN_USER *q_u, - POLICY_HND *pol, - uint32 unk_0, uint32 rid); -void samr_io_q_open_user(char *desc, SAMR_Q_OPEN_USER *q_u, prs_struct *ps, int depth); -void samr_io_r_open_user(char *desc, SAMR_R_OPEN_USER *r_u, prs_struct *ps, int depth); -void make_samr_q_query_usergroups(SAMR_Q_QUERY_USERGROUPS *q_u, - POLICY_HND *hnd); -void samr_io_q_query_usergroups(char *desc, SAMR_Q_QUERY_USERGROUPS *q_u, prs_struct *ps, int depth); -void make_samr_r_query_usergroups(SAMR_R_QUERY_USERGROUPS *r_u, - uint32 num_gids, DOM_GID *gid, uint32 status); -void samr_io_r_query_usergroups(char *desc, SAMR_R_QUERY_USERGROUPS *r_u, prs_struct *ps, int depth); -void make_samr_q_query_userinfo(SAMR_Q_QUERY_USERINFO *q_u, - POLICY_HND *hnd, uint16 switch_value); -void samr_io_q_query_userinfo(char *desc, SAMR_Q_QUERY_USERINFO *q_u, prs_struct *ps, int depth); -void sam_io_logon_hrs(char *desc, LOGON_HRS *hrs, prs_struct *ps, int depth); -void make_sam_user_info11(SAM_USER_INFO_11 *usr, - NTTIME *expiry, - char *mach_acct, - uint32 rid_user, - uint32 rid_group, - uint16 acct_ctrl); -void sam_io_user_info11(char *desc, SAM_USER_INFO_11 *usr, prs_struct *ps, int depth); -void make_sam_user_info21(SAM_USER_INFO_21 *usr, - - NTTIME *logon_time, - NTTIME *logoff_time, - NTTIME *kickoff_time, - NTTIME *pass_last_set_time, - NTTIME *pass_can_change_time, - NTTIME *pass_must_change_time, +char *tmpdir(void); +BOOL is_a_socket(int fd); +BOOL next_token(char **ptr,char *buff,char *sep); +char **toktocliplist(int *ctok, char *sep); +void *mem_dup( void *from, int size ); +void array_promote(char *array,int elsize,int element); +void set_socket_options(int fd, char *options); +void close_sockets(void ); +BOOL in_group(gid_t group, int current_gid, int ngroups, GID_T *groups); +char *StrCpy(char *dest,char *src); +char *StrnCpy(char *dest,char *src,int n); +void putip(void *dest,void *src); +int name_mangle( char *In, char *Out, char name_type ); +BOOL file_exist(char *fname,struct stat *sbuf); +time_t file_modtime(char *fname); +BOOL directory_exist(char *dname,struct stat *st); +uint32 file_size(char *file_name); +char *attrib_string(int mode); +int StrCaseCmp(char *s, char *t); +int StrnCaseCmp(char *s, char *t, int n); +BOOL strequal(char *s1, char *s2); +BOOL strnequal(char *s1,char *s2,int n); +BOOL strcsequal(char *s1,char *s2); +void strlower(char *s); +void strupper(char *s); +void strnorm(char *s); +BOOL strisnormal(char *s); +void string_replace(char *s,char oldc,char newc); +void unix_format(char *fname); +void dos_format(char *fname); +void show_msg(char *buf); +int smb_len(char *buf); +void _smb_setlen(char *buf,int len); +void smb_setlen(char *buf,int len); +int set_message(char *buf,int num_words,int num_bytes,BOOL zero); +int smb_numwords(char *buf); +int smb_buflen(char *buf); +int smb_buf_ofs(char *buf); +char *smb_buf(char *buf); +int smb_offset(char *p,char *buf); +char *skip_string(char *buf,int n); +BOOL trim_string(char *s,char *front,char *back); +void dos_clean_name(char *s); +void unix_clean_name(char *s); +int ChDir(char *path); +char *GetWd(char *str); +BOOL reduce_name(char *s,char *dir,BOOL widelinks); +void expand_mask(char *Mask,BOOL doext); +BOOL strhasupper(char *s); +BOOL strhaslower(char *s); +int count_chars(char *s,char c); +void make_dir_struct(char *buf,char *mask,char *fname,unsigned int size,int mode,time_t date); +void close_low_fds(void); +int set_blocking(int fd, BOOL set); +int write_socket(int fd,char *buf,int len); +int read_udp_socket(int fd,char *buf,int len); +int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out); +int read_max_udp(int fd,char *buffer,int bufsize,int maxtime); +int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew); +BOOL send_keepalive(int client); +int read_data(int fd,char *buffer,int N); +int write_data(int fd,char *buffer,int N); +int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align); +int read_smb_length(int fd,char *inbuf,int timeout); +BOOL receive_smb(int fd,char *buffer, int timeout); +BOOL client_receive_smb(int fd,char *buffer, int timeout); +BOOL receive_local_message(int fd, char *buffer, int buffer_len, int timeout); +BOOL push_oplock_pending_smb_message(char *buf, int msg_len); +BOOL receive_message_or_smb(int smbfd, int oplock_fd, + char *buffer, int buffer_len, + int timeout, BOOL *got_smb); +BOOL send_smb(int fd,char *buffer); +char *name_ptr(char *buf,int ofs); +int name_extract(char *buf,int ofs,char *name); +int name_len( char *s ); +BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type); +void msleep(int t); +BOOL in_list(char *s,char *list,BOOL casesensitive); +BOOL string_init(char **dest,char *src); +void string_free(char **s); +BOOL string_set(char **dest,char *src); +BOOL string_sub(char *s,char *pattern,char *insert); +BOOL do_match(char *str, char *regexp, int case_sig); +BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2); +void become_daemon(void); +BOOL yesno(char *p); +char *fgets_slash(char *s2,int maxlen,FILE *f); +int set_filelen(int fd, long len); +int byte_checksum(char *buf,int len); +char *dirname_dos(char *path,char *buf); +void *Realloc(void *p,int size); +void Abort(void ); +BOOL get_myname(char *my_name,struct in_addr *ip); +BOOL ip_equal(struct in_addr ip1,struct in_addr ip2); +int open_socket_in(int type, int port, int dlevel,uint32 socket_addr); +int open_socket_out(int type, struct in_addr *addr, int port ,int timeout); +int interpret_protocol(char *str,int def); +int interpret_security(char *str,int def); +uint32 interpret_addr(char *str); +struct in_addr *interpret_addr2(char *str); +BOOL zero_ip(struct in_addr ip); +void reset_globals_after_fork(void); +char *client_name(int fd); +char *client_addr(int fd); +char *automount_server(char *user_name); +char *automount_path(char *user_name); +void standard_sub_basic(char *str); +BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask); +int PutUniCode(char *dst,char *src); +struct hostent *Get_Hostbyname(char *name); +BOOL process_exists(int pid); +char *uidtoname(int uid); +char *gidtoname(int gid); +void ajt_panic(void); +char *readdirname(void *p); +BOOL is_in_path(char *name, name_compare_entry *namelist); +void set_namearray(name_compare_entry **ppname_array, char *namelist); +void free_namearray(name_compare_entry *name_array); +BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); +int file_lock(char *name,int timeout); +void file_unlock(int fd); +BOOL is_myname(char *s); +void set_remote_arch(enum remote_arch_types type); +enum remote_arch_types get_remote_arch(void); +char *skip_unicode_string(char *buf,int n); +char *unistrn2(uint16 *buf, int len); +char *unistr2(uint16 *buf); +int struni2(uint16 *p, char *buf); +char *unistr(char *buf); +int unistrncpy(char *dst, char *src, int len); +int unistrcpy(char *dst, char *src); +char *safe_strcpy(char *dest, char *src, int maxlength); +char *safe_strcat(char *dest, char *src, int maxlength); +char *align4(char *q, char *base); +char *align2(char *q, char *base); +char *align_offset(char *q, char *base, int align_offset_len); +void print_asc(int level, unsigned char *buf,int len); +void dump_data(int level,char *buf1,int len); +char *tab_depth(int depth); +char *sid_to_string(pstring sidstr_out, DOM_SID *sid); +BOOL string_to_sid(DOM_SID *sidout, char *sidstr); - char *user_name, - char *full_name, - char *home_dir, - char *dir_drive, - char *logon_script, - char *profile_path, - char *description, - char *workstations, - char *unknown_str, - char *munged_dial, +/*The following definitions come from libsmb/clientgen.c */ - uint32 user_rid, - uint32 group_rid, - uint16 acb_info, +char *cli_smb_errstr(struct cli_state *cli); +char *cli_errstr(struct cli_state *cli); +BOOL cli_api_pipe(struct cli_state *cli, char *pipe_name, int pipe_name_len, + uint16 *setup, uint32 setup_count, uint32 max_setup_count, + char *params, uint32 param_count, uint32 max_param_count, + char *data, uint32 data_count, uint32 max_data_count, + char **rparam, uint32 *rparam_count, + char **rdata, uint32 *rdata_count); +BOOL cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation); +BOOL cli_RNetShareEnum(struct cli_state *cli, void (*fn)(char *, uint32, char *)); +BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype, + void (*fn)(char *, uint32, char *)); +BOOL cli_session_setup(struct cli_state *cli, + char *user, + char *pass, int passlen, + char *ntpass, int ntpasslen, + char *workgroup); +BOOL cli_ulogoff(struct cli_state *cli); +BOOL cli_send_tconX(struct cli_state *cli, + char *share, char *dev, char *pass, int passlen); +BOOL cli_tdis(struct cli_state *cli); +BOOL cli_mv(struct cli_state *cli, char *fname_src, char *fname_dst); +BOOL cli_unlink(struct cli_state *cli, char *fname); +BOOL cli_mkdir(struct cli_state *cli, char *dname); +BOOL cli_rmdir(struct cli_state *cli, char *dname); +int cli_open(struct cli_state *cli, char *fname, int flags, int share_mode); +BOOL cli_close(struct cli_state *cli, int fnum); +BOOL cli_lock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout); +BOOL cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout); +int cli_read(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 size); +int cli_write(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 size); +BOOL cli_getatr(struct cli_state *cli, char *fname, + int *attr, uint32 *size, time_t *t); +BOOL cli_setatr(struct cli_state *cli, char *fname, int attr, time_t t); +BOOL cli_qpathinfo(struct cli_state *cli, char *fname, + time_t *c_time, time_t *a_time, time_t *m_time, uint32 *size); +BOOL cli_qpathinfo2(struct cli_state *cli, char *fname, + time_t *c_time, time_t *a_time, time_t *m_time, + time_t *w_time, uint32 *size); +BOOL cli_qfileinfo(struct cli_state *cli, int fnum, + time_t *c_time, time_t *a_time, time_t *m_time, uint32 *size); +BOOL cli_oem_change_password(struct cli_state *cli, char *user, char *new_password, + char *old_password); +BOOL cli_negprot(struct cli_state *cli); +BOOL cli_session_request(struct cli_state *cli, char *host, int name_type, + char *myname); +BOOL cli_connect(struct cli_state *cli, char *host, struct in_addr *ip); +BOOL cli_initialise(struct cli_state *cli); +void cli_shutdown(struct cli_state *cli); +void cli_error(struct cli_state *cli, int *eclass, int *num); +void cli_sockopt(struct cli_state *cli, char *options); +int cli_setpid(struct cli_state *cli, int pid); - uint32 unknown_3, - uint16 logon_divs, - LOGON_HRS *hrs, - uint32 unknown_5, - uint32 unknown_6); -void sam_io_user_info21(char *desc, SAM_USER_INFO_21 *usr, prs_struct *ps, int depth); -void make_samr_r_query_userinfo(SAMR_R_QUERY_USERINFO *r_u, - uint16 switch_value, void *info, uint32 status); -void samr_io_r_query_userinfo(char *desc, SAMR_R_QUERY_USERINFO *r_u, prs_struct *ps, int depth); -void make_samr_q_unknown_21(SAMR_Q_UNKNOWN_21 *q_c, - POLICY_HND *hnd, uint16 unk_1, uint16 unk_2); -void samr_io_q_unknown_21(char *desc, SAMR_Q_UNKNOWN_21 *q_u, prs_struct *ps, int depth); -void make_samr_q_unknown_13(SAMR_Q_UNKNOWN_13 *q_c, - POLICY_HND *hnd, uint16 unk_1, uint16 unk_2); -void samr_io_q_unknown_13(char *desc, SAMR_Q_UNKNOWN_13 *q_u, prs_struct *ps, int depth); -void samr_io_q_unknown_32(char *desc, SAMR_Q_UNKNOWN_32 *q_u, prs_struct *ps, int depth); -void samr_io_r_unknown_32(char *desc, SAMR_R_UNKNOWN_32 *r_u, prs_struct *ps, int depth); -void make_samr_q_connect(SAMR_Q_CONNECT *q_u, - char *srv_name, uint32 unknown_0); -void samr_io_q_connect(char *desc, SAMR_Q_CONNECT *q_u, prs_struct *ps, int depth); -void samr_io_r_connect(char *desc, SAMR_R_CONNECT *r_u, prs_struct *ps, int depth); -void make_samr_q_open_alias(SAMR_Q_OPEN_ALIAS *q_u, - uint32 unknown_0, uint32 rid); -void samr_io_q_open_alias(char *desc, SAMR_Q_OPEN_ALIAS *q_u, prs_struct *ps, int depth); -void samr_io_r_open_alias(char *desc, SAMR_R_OPEN_ALIAS *r_u, prs_struct *ps, int depth); -void make_samr_q_unknown_38(SAMR_Q_UNKNOWN_38 *q_u, char *srv_name); -void samr_io_q_unknown_38(char *desc, SAMR_Q_UNKNOWN_38 *q_u, prs_struct *ps, int depth); -void make_samr_r_unknown_38(SAMR_R_UNKNOWN_38 *r_u, - uint16 level, uint32 status); -void samr_io_r_unknown_38(char *desc, SAMR_R_UNKNOWN_38 *r_u, prs_struct *ps, int depth); -void samr_io_enc_passwd(char *desc, SAMR_ENC_PASSWD *pwd, prs_struct *ps, int depth); -void samr_io_enc_hash(char *desc, SAMR_ENC_HASH *hsh, prs_struct *ps, int depth); +/*The following definitions come from libsmb/namequery.c */ -/*The following definitions come from lib/rpc/parse/parse_srv.c */ +BOOL name_status(int fd,char *name,int name_type,BOOL recurse, + struct in_addr to_ip,char *master,char *rname, + void (*fn)(struct packet_struct *)); +struct in_addr *name_query(int fd,char *name,int name_type, BOOL bcast,BOOL recurse, + struct in_addr to_ip, int *count, void (*fn)(struct packet_struct *)); +FILE *startlmhosts(char *fname); +BOOL getlmhostsent( FILE *fp, char *name, int *name_type, struct in_addr *ipaddr); +void endlmhosts(FILE *fp); +BOOL resolve_name(char *name, struct in_addr *return_ip); -void make_srv_share_info1_str(SH_INFO_1_STR *sh1, char *net_name, char *remark); -void srv_io_share_info1_str(char *desc, SH_INFO_1_STR *sh1, prs_struct *ps, int depth); -void make_srv_share_info1(SH_INFO_1 *sh1, char *net_name, uint32 type, char *remark); -void srv_io_share_info1(char *desc, SH_INFO_1 *sh1, prs_struct *ps, int depth); -void srv_io_srv_share_info_1(char *desc, SRV_SHARE_INFO_1 *ctr, prs_struct *ps, int depth); -void make_srv_share_info2_str(SH_INFO_2_STR *sh2, - char *net_name, char *remark, - char *path, char *passwd); -void srv_io_share_info2_str(char *desc, SH_INFO_2_STR *sh2, prs_struct *ps, int depth); -void make_srv_share_info2(SH_INFO_2 *sh2, - char *net_name, uint32 type, char *remark, - uint32 perms, uint32 max_uses, uint32 num_uses, - char *path, char *passwd); -void srv_io_share_info2(char *desc, SH_INFO_2 *sh2, prs_struct *ps, int depth); -void srv_io_srv_share_info_2(char *desc, SRV_SHARE_INFO_2 *ctr, prs_struct *ps, int depth); -void srv_io_srv_share_ctr(char *desc, SRV_SHARE_INFO_CTR *ctr, prs_struct *ps, int depth); -void make_srv_q_net_share_enum(SRV_Q_NET_SHARE_ENUM *q_n, - char *srv_name, - uint32 share_level, SRV_SHARE_INFO_CTR *ctr, - uint32 preferred_len, - ENUM_HND *hnd); -void srv_io_q_net_share_enum(char *desc, SRV_Q_NET_SHARE_ENUM *q_n, prs_struct *ps, int depth); -void srv_io_r_net_share_enum(char *desc, SRV_R_NET_SHARE_ENUM *r_n, prs_struct *ps, int depth); -void make_srv_sess_info0_str(SESS_INFO_0_STR *ss0, char *name); -void srv_io_sess_info0_str(char *desc, SESS_INFO_0_STR *ss0, prs_struct *ps, int depth); -void make_srv_sess_info0(SESS_INFO_0 *ss0, char *name); -void srv_io_sess_info0(char *desc, SESS_INFO_0 *ss0, prs_struct *ps, int depth); -void srv_io_srv_sess_info_0(char *desc, SRV_SESS_INFO_0 *ss0, prs_struct *ps, int depth); -void make_srv_sess_info1_str(SESS_INFO_1_STR *ss1, char *name, char *user); -void srv_io_sess_info1_str(char *desc, SESS_INFO_1_STR *ss1, prs_struct *ps, int depth); -void make_srv_sess_info1(SESS_INFO_1 *ss1, - char *name, char *user, - uint32 num_opens, uint32 open_time, uint32 idle_time, - uint32 user_flags); -void srv_io_sess_info1(char *desc, SESS_INFO_1 *ss1, prs_struct *ps, int depth); -void srv_io_srv_sess_info_1(char *desc, SRV_SESS_INFO_1 *ss1, prs_struct *ps, int depth); -void srv_io_srv_sess_ctr(char *desc, SRV_SESS_INFO_CTR *ctr, prs_struct *ps, int depth); -void make_srv_q_net_sess_enum(SRV_Q_NET_SESS_ENUM *q_n, - char *srv_name, char *qual_name, - uint32 sess_level, SRV_SESS_INFO_CTR *ctr, - uint32 preferred_len, - ENUM_HND *hnd); -void srv_io_q_net_sess_enum(char *desc, SRV_Q_NET_SESS_ENUM *q_n, prs_struct *ps, int depth); -void srv_io_r_net_sess_enum(char *desc, SRV_R_NET_SESS_ENUM *r_n, prs_struct *ps, int depth); -void make_srv_conn_info0(CONN_INFO_0 *ss0, uint32 id); -void srv_io_conn_info0(char *desc, CONN_INFO_0 *ss0, prs_struct *ps, int depth); -void srv_io_srv_conn_info_0(char *desc, SRV_CONN_INFO_0 *ss0, prs_struct *ps, int depth); -void make_srv_conn_info1_str(CONN_INFO_1_STR *ss1, char *usr_name, char *net_name); -void srv_io_conn_info1_str(char *desc, CONN_INFO_1_STR *ss1, prs_struct *ps, int depth); -void make_srv_conn_info1(CONN_INFO_1 *ss1, - uint32 id, uint32 type, - uint32 num_opens, uint32 num_users, uint32 open_time, - char *usr_name, char *net_name); -void srv_io_conn_info1(char *desc, CONN_INFO_1 *ss1, prs_struct *ps, int depth); -void srv_io_srv_conn_info_1(char *desc, SRV_CONN_INFO_1 *ss1, prs_struct *ps, int depth); -void srv_io_srv_conn_ctr(char *desc, SRV_CONN_INFO_CTR *ctr, prs_struct *ps, int depth); -void make_srv_q_net_conn_enum(SRV_Q_NET_CONN_ENUM *q_n, - char *srv_name, char *qual_name, - uint32 conn_level, SRV_CONN_INFO_CTR *ctr, - uint32 preferred_len, - ENUM_HND *hnd); -void srv_io_q_net_conn_enum(char *desc, SRV_Q_NET_CONN_ENUM *q_n, prs_struct *ps, int depth); -void srv_io_r_net_conn_enum(char *desc, SRV_R_NET_CONN_ENUM *r_n, prs_struct *ps, int depth); -void make_srv_file_info3_str(FILE_INFO_3_STR *fi3, char *user_name, char *path_name); -void srv_io_file_info3_str(char *desc, FILE_INFO_3_STR *sh1, prs_struct *ps, int depth); -void make_srv_file_info3(FILE_INFO_3 *fl3, - uint32 id, uint32 perms, uint32 num_locks, - char *path_name, char *user_name); -void srv_io_file_info3(char *desc, FILE_INFO_3 *fl3, prs_struct *ps, int depth); -void srv_io_srv_file_info_3(char *desc, SRV_FILE_INFO_3 *fl3, prs_struct *ps, int depth); -void srv_io_srv_file_ctr(char *desc, SRV_FILE_INFO_CTR *ctr, prs_struct *ps, int depth); -void make_srv_q_net_file_enum(SRV_Q_NET_FILE_ENUM *q_n, - char *srv_name, char *qual_name, - uint32 file_level, SRV_FILE_INFO_CTR *ctr, - uint32 preferred_len, - ENUM_HND *hnd); -void srv_io_q_net_file_enum(char *desc, SRV_Q_NET_FILE_ENUM *q_n, prs_struct *ps, int depth); -void srv_io_r_net_file_enum(char *desc, SRV_R_NET_FILE_ENUM *r_n, prs_struct *ps, int depth); -void make_srv_info_101(SRV_INFO_101 *sv101, uint32 platform_id, char *name, - uint32 ver_major, uint32 ver_minor, - uint32 srv_type, char *comment); -void srv_io_info_101(char *desc, SRV_INFO_101 *sv101, prs_struct *ps, int depth); -void make_srv_info_102(SRV_INFO_102 *sv102, uint32 platform_id, char *name, - char *comment, uint32 ver_major, uint32 ver_minor, - uint32 srv_type, uint32 users, uint32 disc, uint32 hidden, - uint32 announce, uint32 ann_delta, uint32 licenses, - char *usr_path); -void srv_io_info_102(char *desc, SRV_INFO_102 *sv102, prs_struct *ps, int depth); -void srv_io_info_ctr(char *desc, SRV_INFO_CTR *ctr, prs_struct *ps, int depth); -void make_srv_q_net_srv_get_info(SRV_Q_NET_SRV_GET_INFO *srv, - char *server_name, uint32 switch_value); -void srv_io_q_net_srv_get_info(char *desc, SRV_Q_NET_SRV_GET_INFO *q_n, prs_struct *ps, int depth); -void make_srv_r_net_srv_get_info(SRV_R_NET_SRV_GET_INFO *srv, - uint32 switch_value, SRV_INFO_CTR *ctr, uint32 status); -void srv_io_r_net_srv_get_info(char *desc, SRV_R_NET_SRV_GET_INFO *r_n, prs_struct *ps, int depth); -void make_srv_q_net_srv_set_info(SRV_Q_NET_SRV_SET_INFO *srv, - uint32 switch_value, SRV_INFO_CTR *ctr); -void srv_io_q_net_srv_set_info(char *desc, SRV_Q_NET_SRV_SET_INFO *q_n, prs_struct *ps, int depth); -void make_srv_r_net_srv_set_info(SRV_R_NET_SRV_SET_INFO *srv, - uint32 switch_value, SRV_INFO_CTR *ctr, uint32 status); -void srv_io_r_net_srv_set_info(char *desc, SRV_R_NET_SRV_SET_INFO *r_n, prs_struct *ps, int depth); -void srv_io_q_net_remote_tod(char *desc, SRV_Q_NET_REMOTE_TOD *q_n, prs_struct *ps, int depth); -void srv_io_time_of_day_info(char *desc, TIME_OF_DAY_INFO *tod, prs_struct *ps, int depth); -void make_time_of_day_info(TIME_OF_DAY_INFO *tod, uint32 elapsedt, uint32 msecs, - uint32 hours, uint32 mins, uint32 secs, uint32 hunds, - uint32 zone, uint32 tintervals, uint32 day, - uint32 month, uint32 year, uint32 weekday); -void srv_io_r_net_remote_tod(char *desc, SRV_R_NET_REMOTE_TOD *r_n, prs_struct *ps, int depth); +/*The following definitions come from libsmb/nmblib.c */ -/*The following definitions come from lib/rpc/parse/parse_wks.c */ +char *lookup_opcode_name( int opcode ); +void debug_nmb_packet(struct packet_struct *p); +char *namestr(struct nmb_name *n); +struct packet_struct *copy_packet(struct packet_struct *packet); +void free_packet(struct packet_struct *packet); +struct packet_struct *read_packet(int fd,enum packet_type packet_type); +void make_nmb_name( struct nmb_name *n, char *name, int type, char *this_scope ); +BOOL nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2); +BOOL send_packet(struct packet_struct *p); +struct packet_struct *receive_packet(int fd,enum packet_type type,int t); -void make_wks_q_query_info(WKS_Q_QUERY_INFO *q_u, - char *server, uint16 switch_value) ; -void wks_io_q_query_info(char *desc, WKS_Q_QUERY_INFO *q_u, prs_struct *ps, int depth); -void make_wks_info_100(WKS_INFO_100 *inf, - uint32 platform_id, uint32 ver_major, uint32 ver_minor, - char *my_name, char *domain_name); -void wks_io_wks_info_100(char *desc, WKS_INFO_100 *inf, prs_struct *ps, int depth); -void make_wks_r_query_info(WKS_R_QUERY_INFO *r_u, - uint32 switch_value, WKS_INFO_100 *wks100, - int status) ; -void wks_io_r_query_info(char *desc, WKS_R_QUERY_INFO *r_u, prs_struct *ps, int depth); +/*The following definitions come from libsmb/nterr.c */ -/*The following definitions come from lib/rpc/server/srv_lsa.c */ +char *get_nt_error_msg(uint32 nt_code); -BOOL api_ntlsa_rpc(pipes_struct *p, prs_struct *data); +/*The following definitions come from libsmb/smbdes.c */ -/*The following definitions come from lib/rpc/server/srv_lsa_hnd.c */ +void E_P16(unsigned char *p14,unsigned char *p16); +void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24); +void D_P16(unsigned char *p14, unsigned char *in, unsigned char *out); +void E_old_pw_hash( unsigned char *p14, unsigned char *in, unsigned char *out); +void cred_hash1(unsigned char *out,unsigned char *in,unsigned char *key); +void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key); +void cred_hash3(unsigned char *out,unsigned char *in,unsigned char *key, int forw); +void SamOEMhash( unsigned char *data, unsigned char *key, int val); -void create_pol_hnd(POLICY_HND *hnd); -void init_lsa_policy_hnd(void); -BOOL open_lsa_policy_hnd(POLICY_HND *hnd); -int find_lsa_policy_by_hnd(POLICY_HND *hnd); -BOOL set_lsa_policy_samr_rid(POLICY_HND *hnd, uint32 rid); -BOOL set_lsa_policy_samr_pol_status(POLICY_HND *hnd, uint32 pol_status); -BOOL set_lsa_policy_samr_sid(POLICY_HND *hnd, DOM_SID *sid); -uint32 get_lsa_policy_samr_rid(POLICY_HND *hnd); -BOOL set_lsa_policy_reg_name(POLICY_HND *hnd, fstring name); -BOOL get_lsa_policy_reg_name(POLICY_HND *hnd, fstring name); -BOOL close_lsa_policy_hnd(POLICY_HND *hnd); +/*The following definitions come from libsmb/smbencrypt.c */ -/*The following definitions come from lib/rpc/server/srv_netlog.c */ +void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); +void E_md4hash(uchar *passwd, uchar *p16); +void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); +void nt_lm_owf_gen(char *pwd, char *nt_p16, char *p16); -BOOL api_netlog_rpc(pipes_struct *p, prs_struct *data); +/*The following definitions come from libsmb/smberr.c */ -/*The following definitions come from lib/rpc/server/srv_pipe_hnd.c */ +char *smb_errstr(char *inbuf); -void reset_chain_pnum(void); -void set_chain_pnum(int new_pnum); -void init_rpc_pipe_hnd(void); -int open_rpc_pipe_hnd(char *pipe_name, int cnum, uint16 vuid); -int read_pipe(uint16 pnum, char *data, uint32 pos, int n); -BOOL get_rpc_pipe(int pnum, pipes_struct **p); -char *get_rpc_pipe_hnd_name(int pnum); -BOOL set_rpc_pipe_hnd_state(pipes_struct *p, uint16 device_state); -BOOL close_rpc_pipe_hnd(int pnum, int cnum); -int get_rpc_pipe_num(char *buf, int where); - -/*The following definitions come from lib/rpc/server/srv_reg.c */ +/*The following definitions come from locking/locking.c */ -BOOL api_reg_rpc(pipes_struct *p, prs_struct *data); +BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset, int lock_type); +BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int lock_type, + int *eclass,uint32 *ecode); +BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); +BOOL locking_init(int read_only); +BOOL locking_end(void); +BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, int *ptok); +BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, int token); +int get_share_modes(int cnum, int token, uint32 dev, uint32 inode, + share_mode_entry **shares); +void del_share_mode(int token, int fnum); +BOOL set_share_mode(int token, int fnum, uint16 port, uint16 op_type); +BOOL remove_share_oplock(int fnum, int token); +int share_mode_forall(void (*fn)(share_mode_entry *, char *)); +void share_status(FILE *f); -/*The following definitions come from lib/rpc/server/srv_samr.c */ +/*The following definitions come from locking/locking_shm.c */ -BOOL api_samr_rpc(pipes_struct *p, prs_struct *data); +struct share_ops *locking_shm_init(int ronly); -/*The following definitions come from lib/rpc/server/srv_srvsvc.c */ +/*The following definitions come from locking/locking_slow.c */ -BOOL api_srvsvc_rpc(pipes_struct *p, prs_struct *data); +struct share_ops *locking_slow_init(int ronly); -/*The following definitions come from lib/rpc/server/srv_util.c */ +/*The following definitions come from locking/shmem.c */ -BOOL lookup_wellknown_sid_from_name(char *windows_name, DOM_SID *psid); -int make_dom_gids(char *gids_str, DOM_GID **ppgids); -BOOL create_rpc_reply(pipes_struct *p, - uint32 data_start, uint32 data_end); -BOOL api_rpcTNP(pipes_struct *p, char *rpc_name, struct api_struct *api_rpc_cmds, - prs_struct *data); -void get_domain_user_groups(char *domain_groups, char *user); -uint32 lookup_group_name(uint32 rid, char *group_name, uint32 *type); -uint32 lookup_alias_name(uint32 rid, char *alias_name, uint32 *type); -uint32 lookup_user_name(uint32 rid, char *user_name, uint32 *type); -uint32 lookup_group_rid(char *group_name, uint32 *rid); -uint32 lookup_alias_rid(char *alias_name, uint32 *rid); -uint32 lookup_user_rid(char *user_name, uint32 *rid); +struct shmem_ops *smb_shm_open(int ronly); -/*The following definitions come from lib/rpc/server/srv_wkssvc.c */ +/*The following definitions come from locking/shmem_sysv.c */ -BOOL api_wkssvc_rpc(pipes_struct *p, prs_struct *data); +struct shmem_ops *sysv_shm_open(int ronly); -/*The following definitions come from loadparm.c */ +/*The following definitions come from param/loadparm.c */ char *lp_string(char *s); char *lp_logfile(void); @@ -1164,443 +651,817 @@ int lp_major_announce_version(void); int lp_minor_announce_version(void); void lp_set_name_resolve_order(char *new_order); -/*The following definitions come from locking.c */ +/*The following definitions come from param/params.c */ + +BOOL pm_process( char *FileName, + BOOL (*sfunc)(char *), + BOOL (*pfunc)(char *, char *) ); + +/*The following definitions come from rpc_client/cli_login.c */ + +BOOL cli_nt_setup_creds(struct cli_state *cli, unsigned char mach_pwd[16]); +BOOL cli_nt_srv_pwset(struct cli_state *cli, unsigned char *new_hashof_mach_pwd); +BOOL cli_nt_login_interactive(struct cli_state *cli, char *domain, char *username, + uint32 smb_userid_low, char *password, + NET_ID_INFO_CTR *ctr, NET_USER_INFO_3 *user_info3); +BOOL cli_nt_login_network(struct cli_state *cli, char *domain, char *username, + uint32 smb_userid_low, char lm_chal[8], char lm_chal_resp[24], + char nt_chal_resp[24], + NET_ID_INFO_CTR *ctr, NET_USER_INFO_3 *user_info3); +BOOL cli_nt_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr); + +/*The following definitions come from rpc_client/cli_netlogon.c */ + +BOOL cli_net_logon_ctrl2(struct cli_state *cli, uint32 status_level); +BOOL cli_net_auth2(struct cli_state *cli, uint16 sec_chan, + uint32 neg_flags, DOM_CHAL *srv_chal); +BOOL cli_net_req_chal(struct cli_state *cli, DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal); +BOOL cli_net_srv_pwset(struct cli_state *cli, uint8 hashed_mach_pwd[16]); +BOOL cli_net_sam_logon(struct cli_state *cli, NET_ID_INFO_CTR *ctr, + NET_USER_INFO_3 *user_info3); +BOOL cli_net_sam_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr); +BOOL change_trust_account_password( char *domain, char *remote_machine_list); + +/*The following definitions come from rpc_client/cli_pipe.c */ + +uint32 get_rpc_call_id(void); +BOOL rpc_api_pipe(struct cli_state *cli, uint16 cmd, + prs_struct *param , prs_struct *data, + prs_struct *rparam, prs_struct *rdata); +BOOL rpc_api_pipe_req(struct cli_state *cli, uint8 op_num, + prs_struct *data, prs_struct *rdata); +BOOL rpc_pipe_set_hnd_state(struct cli_state *cli, char *pipe_name, uint16 device_state); +BOOL rpc_pipe_bind(struct cli_state *cli, char *pipe_name, + RPC_IFACE *abstract, RPC_IFACE *transfer, BOOL ntlmssp_auth); +BOOL cli_nt_session_open(struct cli_state *cli, char *pipe_name, BOOL encrypted); +void cli_nt_session_close(struct cli_state *cli); + +/*The following definitions come from rpc_parse/parse_lsa.c */ + +void make_lsa_trans_name(LSA_TRANS_NAME *trn, uint32 sid_name_use, char *name, uint32 idx); +void lsa_io_trans_name(char *desc, LSA_TRANS_NAME *trn, prs_struct *ps, int depth); +void lsa_io_dom_r_ref(char *desc, DOM_R_REF *r_r, prs_struct *ps, int depth); +void make_lsa_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, uint32 sec_qos); +void lsa_io_obj_attr(char *desc, LSA_OBJ_ATTR *attr, prs_struct *ps, int depth); +void make_q_open_pol(LSA_Q_OPEN_POL *r_q, char *server_name, + uint32 attributes, uint32 sec_qos, + uint32 desired_access); +void lsa_io_q_open_pol(char *desc, LSA_Q_OPEN_POL *r_q, prs_struct *ps, int depth); +void lsa_io_r_open_pol(char *desc, LSA_R_OPEN_POL *r_p, prs_struct *ps, int depth); +void make_q_query(LSA_Q_QUERY_INFO *q_q, POLICY_HND *hnd, uint16 info_class); +void lsa_io_q_query(char *desc, LSA_Q_QUERY_INFO *q_q, prs_struct *ps, int depth); +void lsa_io_q_enum_trust_dom(char *desc, LSA_Q_ENUM_TRUST_DOM *q_e, prs_struct *ps, int depth); +void make_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM *r_e, + uint32 enum_context, char *domain_name, DOM_SID *domain_sid, + uint32 status); +void lsa_io_r_enum_trust_dom(char *desc, LSA_R_ENUM_TRUST_DOM *r_e, prs_struct *ps, int depth); +void make_lsa_q_close(LSA_Q_CLOSE *q_c, POLICY_HND *hnd); +void lsa_io_q_close(char *desc, LSA_Q_CLOSE *q_c, prs_struct *ps, int depth); +void make_lsa_r_close(LSA_R_CLOSE *q_r, POLICY_HND *hnd); +void lsa_io_r_close(char *desc, LSA_R_CLOSE *r_c, prs_struct *ps, int depth); +void lsa_io_r_query(char *desc, LSA_R_QUERY_INFO *r_q, prs_struct *ps, int depth); +void lsa_io_sid_enum(char *desc, LSA_SID_ENUM *sen, prs_struct *ps, int depth); +void lsa_io_q_lookup_sids(char *desc, LSA_Q_LOOKUP_SIDS *q_s, prs_struct *ps, int depth); +void lsa_io_trans_names(char *desc, LSA_TRANS_NAME_ENUM *trn, prs_struct *ps, int depth); +void lsa_io_r_lookup_sids(char *desc, LSA_R_LOOKUP_SIDS *r_s, prs_struct *ps, int depth); +void lsa_io_q_lookup_rids(char *desc, LSA_Q_LOOKUP_RIDS *q_r, prs_struct *ps, int depth); +void lsa_io_r_lookup_rids(char *desc, LSA_R_LOOKUP_RIDS *r_r, prs_struct *ps, int depth); + +/*The following definitions come from rpc_parse/parse_misc.c */ + +void smb_io_utime(char *desc, UTIME *t, prs_struct *ps, int depth); +void smb_io_time(char *desc, NTTIME *nttime, prs_struct *ps, int depth); +void smb_io_lookup_level(char *desc, LOOKUP_LEVEL *level, prs_struct *ps, int depth); +uint32 get_enum_hnd(ENUM_HND *enh); +void make_enum_hnd(ENUM_HND *enh, uint32 hnd); +void smb_io_enum_hnd(char *desc, ENUM_HND *hnd, prs_struct *ps, int depth); +void smb_io_dom_sid(char *desc, DOM_SID *sid, prs_struct *ps, int depth); +void make_dom_sid2(DOM_SID2 *sid2, DOM_SID *sid); +void smb_io_dom_sid2(char *desc, DOM_SID2 *sid, prs_struct *ps, int depth); +void make_str_hdr(STRHDR *hdr, int max_len, int len, uint32 buffer); +void smb_io_strhdr(char *desc, STRHDR *hdr, prs_struct *ps, int depth); +void make_uni_hdr(UNIHDR *hdr, int max_len, int len, uint32 buffer); +void smb_io_unihdr(char *desc, UNIHDR *hdr, prs_struct *ps, int depth); +void make_uni_hdr2(UNIHDR2 *hdr, int max_len, int len, uint16 terminate); +void smb_io_unihdr2(char *desc, UNIHDR2 *hdr2, prs_struct *ps, int depth); +void make_unistr(UNISTR *str, char *buf); +void smb_io_unistr(char *desc, UNISTR *uni, prs_struct *ps, int depth); +void make_uninotstr2(UNINOTSTR2 *str, char *buf, int len); +void smb_io_uninotstr2(char *desc, UNINOTSTR2 *uni2, uint32 buffer, prs_struct *ps, int depth); +void make_buf_unistr2(UNISTR2 *str, uint32 *ptr, char *buf); +void copy_unistr2(UNISTR2 *str, UNISTR2 *from); +void make_string2(STRING2 *str, char *buf, int len); +void smb_io_string2(char *desc, STRING2 *str2, uint32 buffer, prs_struct *ps, int depth); +void make_unistr2(UNISTR2 *str, char *buf, int len); +void smb_io_unistr2(char *desc, UNISTR2 *uni2, uint32 buffer, prs_struct *ps, int depth); +void make_dom_rid2(DOM_RID2 *rid2, uint32 rid); +void smb_io_dom_rid2(char *desc, DOM_RID2 *rid2, prs_struct *ps, int depth); +void make_dom_rid3(DOM_RID3 *rid3, uint32 rid); +void smb_io_dom_rid3(char *desc, DOM_RID3 *rid3, prs_struct *ps, int depth); +void make_dom_rid4(DOM_RID4 *rid4, uint16 unknown, uint16 attr, uint32 rid); +void smb_io_dom_rid4(char *desc, DOM_RID4 *rid4, prs_struct *ps, int depth); +void make_clnt_srv(DOM_CLNT_SRV *log, char *logon_srv, char *comp_name); +void smb_io_clnt_srv(char *desc, DOM_CLNT_SRV *log, prs_struct *ps, int depth); +void make_log_info(DOM_LOG_INFO *log, char *logon_srv, char *acct_name, + uint16 sec_chan, char *comp_name); +void smb_io_log_info(char *desc, DOM_LOG_INFO *log, prs_struct *ps, int depth); +void smb_io_chal(char *desc, DOM_CHAL *chal, prs_struct *ps, int depth); +void smb_io_cred(char *desc, DOM_CRED *cred, prs_struct *ps, int depth); +void make_clnt_info2(DOM_CLNT_INFO2 *clnt, + char *logon_srv, char *comp_name, + DOM_CRED *clnt_cred); +void smb_io_clnt_info2(char *desc, DOM_CLNT_INFO2 *clnt, prs_struct *ps, int depth); +void make_clnt_info(DOM_CLNT_INFO *clnt, + char *logon_srv, char *acct_name, + uint16 sec_chan, char *comp_name, + DOM_CRED *cred); +void smb_io_clnt_info(char *desc, DOM_CLNT_INFO *clnt, prs_struct *ps, int depth); +void make_logon_id(DOM_LOGON_ID *log, uint32 log_id_low, uint32 log_id_high); +void smb_io_logon_id(char *desc, DOM_LOGON_ID *log, prs_struct *ps, int depth); +void make_owf_info(OWF_INFO *hash, uint8 data[16]); +void smb_io_owf_info(char *desc, OWF_INFO *hash, prs_struct *ps, int depth); +void smb_io_gid(char *desc, DOM_GID *gid, prs_struct *ps, int depth); +void smb_io_pol_hnd(char *desc, POLICY_HND *pol, prs_struct *ps, int depth); +void smb_io_dom_query_3(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth); +void smb_io_dom_query_5(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth); +void smb_io_dom_query(char *desc, DOM_QUERY *d_q, prs_struct *ps, int depth); +void smb_io_dom_name(char *desc, DOM_NAME *name, prs_struct *ps, int depth); + +/*The following definitions come from rpc_parse/parse_net.c */ + +void net_io_neg_flags(char *desc, NEG_FLAGS *neg, prs_struct *ps, int depth); +void make_netinfo_3(NETLOGON_INFO_3 *info, uint32 flags, uint32 logon_attempts); +void net_io_netinfo_3(char *desc, NETLOGON_INFO_3 *info, prs_struct *ps, int depth); +void make_netinfo_1(NETLOGON_INFO_1 *info, uint32 flags, uint32 pdc_status); +void net_io_netinfo_1(char *desc, NETLOGON_INFO_1 *info, prs_struct *ps, int depth); +void make_netinfo_2(NETLOGON_INFO_2 *info, uint32 flags, uint32 pdc_status, + uint32 tc_status, char *trusted_dc_name); +void net_io_netinfo_2(char *desc, NETLOGON_INFO_2 *info, prs_struct *ps, int depth); +void make_q_logon_ctrl2(NET_Q_LOGON_CTRL2 *q_l, char *server_name, + uint32 function_code); +void net_io_q_logon_ctrl2(char *desc, NET_Q_LOGON_CTRL2 *q_l, prs_struct *ps, int depth); +void make_r_logon_ctrl2(NET_R_LOGON_CTRL2 *r_l, uint32 query_level, + uint32 flags, uint32 pdc_status, uint32 logon_attempts, + uint32 tc_status, char *trusted_domain_name); +void net_io_r_logon_ctrl2(char *desc, NET_R_LOGON_CTRL2 *r_l, prs_struct *ps, int depth); +void make_r_trust_dom(NET_R_TRUST_DOM_LIST *r_t, + uint32 num_doms, char *dom_name); +void net_io_r_trust_dom(char *desc, NET_R_TRUST_DOM_LIST *r_t, prs_struct *ps, int depth); +void make_q_trust_dom(NET_Q_TRUST_DOM_LIST *q_l, char *server_name, + uint32 function_code); +void net_io_q_trust_dom(char *desc, NET_Q_TRUST_DOM_LIST *q_l, prs_struct *ps, int depth); +void make_q_req_chal(NET_Q_REQ_CHAL *q_c, + char *logon_srv, char *logon_clnt, + DOM_CHAL *clnt_chal); +void net_io_q_req_chal(char *desc, NET_Q_REQ_CHAL *q_c, prs_struct *ps, int depth); +void net_io_r_req_chal(char *desc, NET_R_REQ_CHAL *r_c, prs_struct *ps, int depth); +void make_q_auth_2(NET_Q_AUTH_2 *q_a, + char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name, + DOM_CHAL *clnt_chal, uint32 clnt_flgs); +void net_io_q_auth_2(char *desc, NET_Q_AUTH_2 *q_a, prs_struct *ps, int depth); +void net_io_r_auth_2(char *desc, NET_R_AUTH_2 *r_a, prs_struct *ps, int depth); +void make_q_srv_pwset(NET_Q_SRV_PWSET *q_s, char *logon_srv, char *acct_name, + uint16 sec_chan, char *comp_name, DOM_CRED *cred, char nt_cypher[16]); +void net_io_q_srv_pwset(char *desc, NET_Q_SRV_PWSET *q_s, prs_struct *ps, int depth); +void net_io_r_srv_pwset(char *desc, NET_R_SRV_PWSET *r_s, prs_struct *ps, int depth); +void make_id_info1(NET_ID_INFO_1 *id, char *domain_name, + uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high, + char *user_name, char *wksta_name, + char sess_key[16], + unsigned char lm_cypher[16], unsigned char nt_cypher[16]); +void net_io_id_info1(char *desc, NET_ID_INFO_1 *id, prs_struct *ps, int depth); +void make_id_info2(NET_ID_INFO_2 *id, char *domain_name, + uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high, + char *user_name, char *wksta_name, + unsigned char lm_challenge[8], + unsigned char lm_chal_resp[24], + unsigned char nt_chal_resp[24]); +void net_io_id_info2(char *desc, NET_ID_INFO_2 *id, prs_struct *ps, int depth); +void make_sam_info(DOM_SAM_INFO *sam, + char *logon_srv, char *comp_name, DOM_CRED *clnt_cred, + DOM_CRED *rtn_cred, uint16 logon_level, + NET_ID_INFO_CTR *ctr, uint16 validation_level); +void net_io_id_info_ctr(char *desc, NET_ID_INFO_CTR *ctr, prs_struct *ps, int depth); +void smb_io_sam_info(char *desc, DOM_SAM_INFO *sam, prs_struct *ps, int depth); +void make_net_user_info3(NET_USER_INFO_3 *usr, + + NTTIME *logon_time, + NTTIME *logoff_time, + NTTIME *kickoff_time, + NTTIME *pass_last_set_time, + NTTIME *pass_can_change_time, + NTTIME *pass_must_change_time, + + char *user_name, + char *full_name, + char *logon_script, + char *profile_path, + char *home_dir, + char *dir_drive, + + uint16 logon_count, + uint16 bad_pw_count, + + uint32 user_id, + uint32 group_id, + uint32 num_groups, + DOM_GID *gids, + uint32 user_flgs, + + char sess_key[16], + + char *logon_srv, + char *logon_dom, + + DOM_SID *dom_sid, + char *other_sids); +void net_io_user_info3(char *desc, NET_USER_INFO_3 *usr, prs_struct *ps, int depth); +void net_io_q_sam_logon(char *desc, NET_Q_SAM_LOGON *q_l, prs_struct *ps, int depth); +void net_io_r_sam_logon(char *desc, NET_R_SAM_LOGON *r_l, prs_struct *ps, int depth); +void net_io_q_sam_logoff(char *desc, NET_Q_SAM_LOGOFF *q_l, prs_struct *ps, int depth); +void net_io_r_sam_logoff(char *desc, NET_R_SAM_LOGOFF *r_l, prs_struct *ps, int depth); + +/*The following definitions come from rpc_parse/parse_prs.c */ + +void prs_debug(prs_struct *ps, int depth, char *desc, char *fn_name); +void prs_init(prs_struct *ps, uint32 size, + uint8 align, uint32 margin, + BOOL io); +void prs_mem_free(prs_struct *ps); +void prs_align(prs_struct *ps); +BOOL prs_grow(prs_struct *ps); +BOOL prs_uint8(char *name, prs_struct *ps, int depth, uint8 *data8); +BOOL prs_uint16(char *name, prs_struct *ps, int depth, uint16 *data16); +BOOL prs_uint32(char *name, prs_struct *ps, int depth, uint32 *data32); +BOOL prs_uint8s(BOOL charmode, char *name, prs_struct *ps, int depth, uint8 *data8s, int len); +BOOL prs_uint16s(BOOL charmode, char *name, prs_struct *ps, int depth, uint16 *data16s, int len); +BOOL prs_uint32s(BOOL charmode, char *name, prs_struct *ps, int depth, uint32 *data32s, int len); +BOOL prs_uninotstr2(BOOL charmode, char *name, prs_struct *ps, int depth, UNINOTSTR2 *str); +BOOL prs_string2(BOOL charmode, char *name, prs_struct *ps, int depth, STRING2 *str); +BOOL prs_unistr2(BOOL charmode, char *name, prs_struct *ps, int depth, UNISTR2 *str); +BOOL prs_unistr(char *name, prs_struct *ps, int depth, UNISTR *str); +BOOL prs_string(char *name, prs_struct *ps, int depth, char *str, uint16 len); + +/*The following definitions come from rpc_parse/parse_reg.c */ + +void make_reg_q_open_policy(REG_Q_OPEN_POLICY *r_q, + uint16 unknown_0, uint32 level, uint16 unknown_1); +void reg_io_q_open_policy(char *desc, REG_Q_OPEN_POLICY *r_q, prs_struct *ps, int depth); +void make_reg_r_open_policy(REG_R_OPEN_POLICY *r_r, + POLICY_HND *pol, uint32 status); +void reg_io_r_open_policy(char *desc, REG_R_OPEN_POLICY *r_r, prs_struct *ps, int depth); +void reg_io_q_close(char *desc, REG_Q_CLOSE *q_u, prs_struct *ps, int depth); +void reg_io_r_close(char *desc, REG_R_CLOSE *r_u, prs_struct *ps, int depth); +void make_reg_q_info(REG_Q_INFO *r_q, + POLICY_HND *pol, char *product_type, + NTTIME *prod_time, uint8 major_version, uint8 minor_version, + uint32 unknown); +void reg_io_q_info(char *desc, REG_Q_INFO *r_q, prs_struct *ps, int depth); +void make_reg_r_info(REG_R_INFO *r_r, + uint32 level, char *os_type, + uint32 unknown_0, uint32 unknown_1, + uint32 status); +void reg_io_r_info(char *desc, REG_R_INFO *r_r, prs_struct *ps, int depth); +void make_reg_q_open_entry(REG_Q_OPEN_ENTRY *r_q, + POLICY_HND *pol, char *name, + uint32 unknown_0, uint32 unknown_1, uint16 unknown_2); +void reg_io_q_open_entry(char *desc, REG_Q_OPEN_ENTRY *r_q, prs_struct *ps, int depth); +void make_reg_r_open_entry(REG_R_OPEN_ENTRY *r_r, + POLICY_HND *pol, uint32 status); +void reg_io_r_open_entry(char *desc, REG_R_OPEN_ENTRY *r_r, prs_struct *ps, int depth); + +/*The following definitions come from rpc_parse/parse_rpc.c */ + +void make_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 flags, + uint32 call_id, int data_len, int auth_len); +void smb_io_rpc_hdr(char *desc, RPC_HDR *rpc, prs_struct *ps, int depth); +void make_rpc_iface(RPC_IFACE *ifc, char data[16], uint32 version); +void smb_io_rpc_iface(char *desc, RPC_IFACE *ifc, prs_struct *ps, int depth); +void make_rpc_addr_str(RPC_ADDR_STR *str, char *name); +void smb_io_rpc_addr_str(char *desc, RPC_ADDR_STR *str, prs_struct *ps, int depth); +void make_rpc_hdr_bba(RPC_HDR_BBA *bba, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid); +void smb_io_rpc_hdr_bba(char *desc, RPC_HDR_BBA *rpc, prs_struct *ps, int depth); +void make_rpc_hdr_rb(RPC_HDR_RB *rpc, + uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, + uint32 num_elements, uint16 context_id, uint8 num_syntaxes, + RPC_IFACE *abstract, RPC_IFACE *transfer); +void smb_io_rpc_hdr_rb(char *desc, RPC_HDR_RB *rpc, prs_struct *ps, int depth); +void make_rpc_results(RPC_RESULTS *res, + uint8 num_results, uint16 result, uint16 reason); +void smb_io_rpc_results(char *desc, RPC_RESULTS *res, prs_struct *ps, int depth); +void make_rpc_hdr_ba(RPC_HDR_BA *rpc, + uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, + char *pipe_addr, + uint8 num_results, uint16 result, uint16 reason, + RPC_IFACE *transfer); +void smb_io_rpc_hdr_ba(char *desc, RPC_HDR_BA *rpc, prs_struct *ps, int depth); +void make_rpc_hdr_req(RPC_HDR_REQ *hdr, uint32 data_len, uint16 opnum); +void smb_io_rpc_hdr_req(char *desc, RPC_HDR_REQ *rpc, prs_struct *ps, int depth); +void make_rpc_hdr_resp(RPC_HDR_RESP *hdr, uint32 data_len); +void smb_io_rpc_hdr_resp(char *desc, RPC_HDR_RESP *rpc, prs_struct *ps, int depth); +void make_rpc_auth_ntlmssp_req(RPC_AUTH_NTLMSSP_REQ *req, + fstring ntlmssp_str, uint32 ntlmssp_ver, + uint32 unknown_0, fstring myname, fstring domain); +void smb_io_rpc_auth_ntlmssp_req(char *desc, RPC_AUTH_NTLMSSP_REQ *req, prs_struct *ps, int depth); +void make_rpc_auth_ntlmssp_resp(RPC_AUTH_NTLMSSP_RESP *rsp, + uint8 auth_type, uint8 auth_level, uint8 stub_type_len, + fstring ntlmssp_str, uint32 ntlmssp_ver, + uint32 unknown_1, uint32 unknown_2, uint32 unknown_3, + uint8 data[16]); +void smb_io_rpc_auth_ntlmssp_resp(char *desc, RPC_AUTH_NTLMSSP_RESP *rsp, prs_struct *ps, int depth); + +/*The following definitions come from rpc_parse/parse_samr.c */ + +void make_samr_q_close_hnd(SAMR_Q_CLOSE_HND *q_c, POLICY_HND *hnd); +void samr_io_q_close_hnd(char *desc, SAMR_Q_CLOSE_HND *q_u, prs_struct *ps, int depth); +void samr_io_r_close_hnd(char *desc, SAMR_R_CLOSE_HND *r_u, prs_struct *ps, int depth); +void make_samr_q_open_domain(SAMR_Q_OPEN_DOMAIN *q_u, + POLICY_HND *connect_pol, uint32 rid, DOM_SID *sid); +void samr_io_q_open_domain(char *desc, SAMR_Q_OPEN_DOMAIN *q_u, prs_struct *ps, int depth); +void samr_io_r_open_domain(char *desc, SAMR_R_OPEN_DOMAIN *r_u, prs_struct *ps, int depth); +void make_samr_q_unknown_8(SAMR_Q_UNKNOWN_8 *q_u, + POLICY_HND *domain_pol, uint16 switch_value); +void samr_io_q_unknown_8(char *desc, SAMR_Q_UNKNOWN_8 *q_u, prs_struct *ps, int depth); +void make_samr_q_unknown_3(SAMR_Q_UNKNOWN_3 *q_u, + POLICY_HND *user_pol, uint16 switch_value); +void samr_io_q_unknown_3(char *desc, SAMR_Q_UNKNOWN_3 *q_u, prs_struct *ps, int depth); +void make_dom_sid3(DOM_SID3 *sid3, uint16 unk_0, uint16 unk_1, DOM_SID *sid); +void sam_io_dom_sid3(char *desc, DOM_SID3 *sid3, prs_struct *ps, int depth); +void make_sam_sid_stuff(SAM_SID_STUFF *stf, + uint16 unknown_2, uint16 unknown_3, + uint32 unknown_4, uint16 unknown_6, uint16 unknown_7, + int num_sid3s, DOM_SID3 sid3[MAX_SAM_SIDS]); +void sam_io_sid_stuff(char *desc, SAM_SID_STUFF *stf, prs_struct *ps, int depth); +void make_samr_r_unknown_3(SAMR_R_UNKNOWN_3 *r_u, + uint16 unknown_2, uint16 unknown_3, + uint32 unknown_4, uint16 unknown_6, uint16 unknown_7, + int num_sid3s, DOM_SID3 sid3[MAX_SAM_SIDS], + uint32 status); +void samr_io_r_unknown_3(char *desc, SAMR_R_UNKNOWN_3 *r_u, prs_struct *ps, int depth); +void make_sam_str1(SAM_STR1 *sam, char *sam_acct, char *sam_name, char *sam_desc); +void sam_io_sam_str1(char *desc, SAM_STR1 *sam, uint32 acct_buf, uint32 name_buf, uint32 desc_buf, prs_struct *ps, int depth); +void make_sam_entry1(SAM_ENTRY1 *sam, uint32 user_idx, + uint32 len_sam_name, uint32 len_sam_full, uint32 len_sam_desc, + uint32 rid_user, uint16 acb_info); +void sam_io_sam_entry1(char *desc, SAM_ENTRY1 *sam, prs_struct *ps, int depth); +void make_sam_str2(SAM_STR2 *sam, char *sam_acct, char *sam_desc); +void sam_io_sam_str2(char *desc, SAM_STR2 *sam, uint32 acct_buf, uint32 desc_buf, prs_struct *ps, int depth); +void make_sam_entry2(SAM_ENTRY2 *sam, uint32 user_idx, + uint32 len_sam_name, uint32 len_sam_desc, + uint32 rid_user, uint16 acb_info); +void sam_io_sam_entry2(char *desc, SAM_ENTRY2 *sam, prs_struct *ps, int depth); +void make_sam_str3(SAM_STR3 *sam, char *grp_acct, char *grp_desc); +void sam_io_sam_str3(char *desc, SAM_STR3 *sam, uint32 acct_buf, uint32 desc_buf, prs_struct *ps, int depth); +void make_sam_entry3(SAM_ENTRY3 *sam, uint32 grp_idx, + uint32 len_grp_name, uint32 len_grp_desc, uint32 rid_grp); +void sam_io_sam_entry3(char *desc, SAM_ENTRY3 *sam, prs_struct *ps, int depth); +void make_sam_entry(SAM_ENTRY *sam, uint32 len_sam_name, uint32 rid); +void sam_io_sam_entry(char *desc, SAM_ENTRY *sam, prs_struct *ps, int depth); +void make_samr_q_enum_dom_users(SAMR_Q_ENUM_DOM_USERS *q_e, POLICY_HND *pol, + uint16 req_num_entries, uint16 unk_0, + uint16 acb_mask, uint16 unk_1, uint32 size); +void samr_io_q_enum_dom_users(char *desc, SAMR_Q_ENUM_DOM_USERS *q_e, prs_struct *ps, int depth); +void make_samr_r_enum_dom_users(SAMR_R_ENUM_DOM_USERS *r_u, + uint16 total_num_entries, uint16 unk_0, + uint32 num_sam_entries, SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES], uint32 status); +void samr_io_r_enum_dom_users(char *desc, SAMR_R_ENUM_DOM_USERS *r_u, prs_struct *ps, int depth); +void make_samr_q_enum_dom_aliases(SAMR_Q_ENUM_DOM_ALIASES *q_e, POLICY_HND *pol, uint32 size); +void samr_io_q_enum_dom_aliases(char *desc, SAMR_Q_ENUM_DOM_ALIASES *q_e, prs_struct *ps, int depth); +void make_samr_r_enum_dom_aliases(SAMR_R_ENUM_DOM_ALIASES *r_u, + uint32 num_sam_entries, SAM_USER_INFO_21 grps[MAX_SAM_ENTRIES], + uint32 status); +void samr_io_r_enum_dom_aliases(char *desc, SAMR_R_ENUM_DOM_ALIASES *r_u, prs_struct *ps, int depth); +void make_samr_q_query_dispinfo(SAMR_Q_QUERY_DISPINFO *q_e, POLICY_HND *pol, + uint16 switch_level, uint32 start_idx, uint32 size); +void samr_io_q_query_dispinfo(char *desc, SAMR_Q_QUERY_DISPINFO *q_e, prs_struct *ps, int depth); +void make_sam_info_2(SAM_INFO_2 *sam, uint32 acb_mask, + uint32 start_idx, uint32 num_sam_entries, + SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]); +void sam_io_sam_info_2(char *desc, SAM_INFO_2 *sam, prs_struct *ps, int depth); +void make_sam_info_1(SAM_INFO_1 *sam, uint32 acb_mask, + uint32 start_idx, uint32 num_sam_entries, + SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]); +void sam_io_sam_info_1(char *desc, SAM_INFO_1 *sam, prs_struct *ps, int depth); +void make_samr_r_query_dispinfo(SAMR_R_QUERY_DISPINFO *r_u, + uint16 switch_level, SAM_INFO_CTR *ctr, uint32 status); +void samr_io_r_query_dispinfo(char *desc, SAMR_R_QUERY_DISPINFO *r_u, prs_struct *ps, int depth); +void make_samr_q_enum_dom_groups(SAMR_Q_ENUM_DOM_GROUPS *q_e, POLICY_HND *pol, + uint16 switch_level, uint32 start_idx, uint32 size); +void samr_io_q_enum_dom_groups(char *desc, SAMR_Q_ENUM_DOM_GROUPS *q_e, prs_struct *ps, int depth); +void make_samr_r_enum_dom_groups(SAMR_R_ENUM_DOM_GROUPS *r_u, + uint32 start_idx, uint32 num_sam_entries, + SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES], + uint32 status); +void samr_io_r_enum_dom_groups(char *desc, SAMR_R_ENUM_DOM_GROUPS *r_u, prs_struct *ps, int depth); +void make_samr_q_query_aliasinfo(SAMR_Q_QUERY_ALIASINFO *q_e, + POLICY_HND *pol, + uint16 switch_level); +void samr_io_q_query_aliasinfo(char *desc, SAMR_Q_QUERY_ALIASINFO *q_e, prs_struct *ps, int depth); +void make_samr_r_query_aliasinfo(SAMR_R_QUERY_ALIASINFO *r_u, + uint16 switch_value, char *acct_desc, + uint32 status); +void samr_io_r_query_aliasinfo(char *desc, SAMR_R_QUERY_ALIASINFO *r_u, prs_struct *ps, int depth); +void samr_io_q_lookup_ids(char *desc, SAMR_Q_LOOKUP_IDS *q_u, prs_struct *ps, int depth); +void make_samr_r_lookup_ids(SAMR_R_LOOKUP_IDS *r_u, + uint32 num_rids, uint32 *rid, uint32 status); +void samr_io_r_lookup_ids(char *desc, SAMR_R_LOOKUP_IDS *r_u, prs_struct *ps, int depth); +void samr_io_q_lookup_names(char *desc, SAMR_Q_LOOKUP_NAMES *q_u, prs_struct *ps, int depth); +void make_samr_r_lookup_names(SAMR_R_LOOKUP_NAMES *r_u, + uint32 num_rids, uint32 *rid, uint32 status); +void samr_io_r_lookup_names(char *desc, SAMR_R_LOOKUP_NAMES *r_u, prs_struct *ps, int depth); +void make_samr_q_unknown_12(SAMR_Q_UNKNOWN_12 *q_u, + POLICY_HND *pol, uint32 rid, + uint32 num_gids, uint32 *gid); +void samr_io_q_unknown_12(char *desc, SAMR_Q_UNKNOWN_12 *q_u, prs_struct *ps, int depth); +void make_samr_r_unknown_12(SAMR_R_UNKNOWN_12 *r_u, + uint32 num_aliases, fstring *als_name, uint32 *num_als_usrs, + uint32 status); +void samr_io_r_unknown_12(char *desc, SAMR_R_UNKNOWN_12 *r_u, prs_struct *ps, int depth); +void make_samr_q_open_user(SAMR_Q_OPEN_USER *q_u, + POLICY_HND *pol, + uint32 unk_0, uint32 rid); +void samr_io_q_open_user(char *desc, SAMR_Q_OPEN_USER *q_u, prs_struct *ps, int depth); +void samr_io_r_open_user(char *desc, SAMR_R_OPEN_USER *r_u, prs_struct *ps, int depth); +void make_samr_q_query_usergroups(SAMR_Q_QUERY_USERGROUPS *q_u, + POLICY_HND *hnd); +void samr_io_q_query_usergroups(char *desc, SAMR_Q_QUERY_USERGROUPS *q_u, prs_struct *ps, int depth); +void make_samr_r_query_usergroups(SAMR_R_QUERY_USERGROUPS *r_u, + uint32 num_gids, DOM_GID *gid, uint32 status); +void samr_io_r_query_usergroups(char *desc, SAMR_R_QUERY_USERGROUPS *r_u, prs_struct *ps, int depth); +void make_samr_q_query_userinfo(SAMR_Q_QUERY_USERINFO *q_u, + POLICY_HND *hnd, uint16 switch_value); +void samr_io_q_query_userinfo(char *desc, SAMR_Q_QUERY_USERINFO *q_u, prs_struct *ps, int depth); +void sam_io_logon_hrs(char *desc, LOGON_HRS *hrs, prs_struct *ps, int depth); +void make_sam_user_info11(SAM_USER_INFO_11 *usr, + NTTIME *expiry, + char *mach_acct, + uint32 rid_user, + uint32 rid_group, + uint16 acct_ctrl); +void sam_io_user_info11(char *desc, SAM_USER_INFO_11 *usr, prs_struct *ps, int depth); +void make_sam_user_info21(SAM_USER_INFO_21 *usr, + + NTTIME *logon_time, + NTTIME *logoff_time, + NTTIME *kickoff_time, + NTTIME *pass_last_set_time, + NTTIME *pass_can_change_time, + NTTIME *pass_must_change_time, + + char *user_name, + char *full_name, + char *home_dir, + char *dir_drive, + char *logon_script, + char *profile_path, + char *description, + char *workstations, + char *unknown_str, + char *munged_dial, + + uint32 user_rid, + uint32 group_rid, + uint16 acb_info, + + uint32 unknown_3, + uint16 logon_divs, + LOGON_HRS *hrs, + uint32 unknown_5, + uint32 unknown_6); +void sam_io_user_info21(char *desc, SAM_USER_INFO_21 *usr, prs_struct *ps, int depth); +void make_samr_r_query_userinfo(SAMR_R_QUERY_USERINFO *r_u, + uint16 switch_value, void *info, uint32 status); +void samr_io_r_query_userinfo(char *desc, SAMR_R_QUERY_USERINFO *r_u, prs_struct *ps, int depth); +void make_samr_q_unknown_21(SAMR_Q_UNKNOWN_21 *q_c, + POLICY_HND *hnd, uint16 unk_1, uint16 unk_2); +void samr_io_q_unknown_21(char *desc, SAMR_Q_UNKNOWN_21 *q_u, prs_struct *ps, int depth); +void make_samr_q_unknown_13(SAMR_Q_UNKNOWN_13 *q_c, + POLICY_HND *hnd, uint16 unk_1, uint16 unk_2); +void samr_io_q_unknown_13(char *desc, SAMR_Q_UNKNOWN_13 *q_u, prs_struct *ps, int depth); +void samr_io_q_unknown_32(char *desc, SAMR_Q_UNKNOWN_32 *q_u, prs_struct *ps, int depth); +void samr_io_r_unknown_32(char *desc, SAMR_R_UNKNOWN_32 *r_u, prs_struct *ps, int depth); +void make_samr_q_connect(SAMR_Q_CONNECT *q_u, + char *srv_name, uint32 unknown_0); +void samr_io_q_connect(char *desc, SAMR_Q_CONNECT *q_u, prs_struct *ps, int depth); +void samr_io_r_connect(char *desc, SAMR_R_CONNECT *r_u, prs_struct *ps, int depth); +void make_samr_q_open_alias(SAMR_Q_OPEN_ALIAS *q_u, + uint32 unknown_0, uint32 rid); +void samr_io_q_open_alias(char *desc, SAMR_Q_OPEN_ALIAS *q_u, prs_struct *ps, int depth); +void samr_io_r_open_alias(char *desc, SAMR_R_OPEN_ALIAS *r_u, prs_struct *ps, int depth); +void make_samr_q_unknown_38(SAMR_Q_UNKNOWN_38 *q_u, char *srv_name); +void samr_io_q_unknown_38(char *desc, SAMR_Q_UNKNOWN_38 *q_u, prs_struct *ps, int depth); +void make_samr_r_unknown_38(SAMR_R_UNKNOWN_38 *r_u, + uint16 level, uint32 status); +void samr_io_r_unknown_38(char *desc, SAMR_R_UNKNOWN_38 *r_u, prs_struct *ps, int depth); +void samr_io_enc_passwd(char *desc, SAMR_ENC_PASSWD *pwd, prs_struct *ps, int depth); +void samr_io_enc_hash(char *desc, SAMR_ENC_HASH *hsh, prs_struct *ps, int depth); + +/*The following definitions come from rpc_parse/parse_srv.c */ + +void make_srv_share_info1_str(SH_INFO_1_STR *sh1, char *net_name, char *remark); +void srv_io_share_info1_str(char *desc, SH_INFO_1_STR *sh1, prs_struct *ps, int depth); +void make_srv_share_info1(SH_INFO_1 *sh1, char *net_name, uint32 type, char *remark); +void srv_io_share_info1(char *desc, SH_INFO_1 *sh1, prs_struct *ps, int depth); +void srv_io_srv_share_info_1(char *desc, SRV_SHARE_INFO_1 *ctr, prs_struct *ps, int depth); +void make_srv_share_info2_str(SH_INFO_2_STR *sh2, + char *net_name, char *remark, + char *path, char *passwd); +void srv_io_share_info2_str(char *desc, SH_INFO_2_STR *sh2, prs_struct *ps, int depth); +void make_srv_share_info2(SH_INFO_2 *sh2, + char *net_name, uint32 type, char *remark, + uint32 perms, uint32 max_uses, uint32 num_uses, + char *path, char *passwd); +void srv_io_share_info2(char *desc, SH_INFO_2 *sh2, prs_struct *ps, int depth); +void srv_io_srv_share_info_2(char *desc, SRV_SHARE_INFO_2 *ctr, prs_struct *ps, int depth); +void srv_io_srv_share_ctr(char *desc, SRV_SHARE_INFO_CTR *ctr, prs_struct *ps, int depth); +void make_srv_q_net_share_enum(SRV_Q_NET_SHARE_ENUM *q_n, + char *srv_name, + uint32 share_level, SRV_SHARE_INFO_CTR *ctr, + uint32 preferred_len, + ENUM_HND *hnd); +void srv_io_q_net_share_enum(char *desc, SRV_Q_NET_SHARE_ENUM *q_n, prs_struct *ps, int depth); +void srv_io_r_net_share_enum(char *desc, SRV_R_NET_SHARE_ENUM *r_n, prs_struct *ps, int depth); +void make_srv_sess_info0_str(SESS_INFO_0_STR *ss0, char *name); +void srv_io_sess_info0_str(char *desc, SESS_INFO_0_STR *ss0, prs_struct *ps, int depth); +void make_srv_sess_info0(SESS_INFO_0 *ss0, char *name); +void srv_io_sess_info0(char *desc, SESS_INFO_0 *ss0, prs_struct *ps, int depth); +void srv_io_srv_sess_info_0(char *desc, SRV_SESS_INFO_0 *ss0, prs_struct *ps, int depth); +void make_srv_sess_info1_str(SESS_INFO_1_STR *ss1, char *name, char *user); +void srv_io_sess_info1_str(char *desc, SESS_INFO_1_STR *ss1, prs_struct *ps, int depth); +void make_srv_sess_info1(SESS_INFO_1 *ss1, + char *name, char *user, + uint32 num_opens, uint32 open_time, uint32 idle_time, + uint32 user_flags); +void srv_io_sess_info1(char *desc, SESS_INFO_1 *ss1, prs_struct *ps, int depth); +void srv_io_srv_sess_info_1(char *desc, SRV_SESS_INFO_1 *ss1, prs_struct *ps, int depth); +void srv_io_srv_sess_ctr(char *desc, SRV_SESS_INFO_CTR *ctr, prs_struct *ps, int depth); +void make_srv_q_net_sess_enum(SRV_Q_NET_SESS_ENUM *q_n, + char *srv_name, char *qual_name, + uint32 sess_level, SRV_SESS_INFO_CTR *ctr, + uint32 preferred_len, + ENUM_HND *hnd); +void srv_io_q_net_sess_enum(char *desc, SRV_Q_NET_SESS_ENUM *q_n, prs_struct *ps, int depth); +void srv_io_r_net_sess_enum(char *desc, SRV_R_NET_SESS_ENUM *r_n, prs_struct *ps, int depth); +void make_srv_conn_info0(CONN_INFO_0 *ss0, uint32 id); +void srv_io_conn_info0(char *desc, CONN_INFO_0 *ss0, prs_struct *ps, int depth); +void srv_io_srv_conn_info_0(char *desc, SRV_CONN_INFO_0 *ss0, prs_struct *ps, int depth); +void make_srv_conn_info1_str(CONN_INFO_1_STR *ss1, char *usr_name, char *net_name); +void srv_io_conn_info1_str(char *desc, CONN_INFO_1_STR *ss1, prs_struct *ps, int depth); +void make_srv_conn_info1(CONN_INFO_1 *ss1, + uint32 id, uint32 type, + uint32 num_opens, uint32 num_users, uint32 open_time, + char *usr_name, char *net_name); +void srv_io_conn_info1(char *desc, CONN_INFO_1 *ss1, prs_struct *ps, int depth); +void srv_io_srv_conn_info_1(char *desc, SRV_CONN_INFO_1 *ss1, prs_struct *ps, int depth); +void srv_io_srv_conn_ctr(char *desc, SRV_CONN_INFO_CTR *ctr, prs_struct *ps, int depth); +void make_srv_q_net_conn_enum(SRV_Q_NET_CONN_ENUM *q_n, + char *srv_name, char *qual_name, + uint32 conn_level, SRV_CONN_INFO_CTR *ctr, + uint32 preferred_len, + ENUM_HND *hnd); +void srv_io_q_net_conn_enum(char *desc, SRV_Q_NET_CONN_ENUM *q_n, prs_struct *ps, int depth); +void srv_io_r_net_conn_enum(char *desc, SRV_R_NET_CONN_ENUM *r_n, prs_struct *ps, int depth); +void make_srv_file_info3_str(FILE_INFO_3_STR *fi3, char *user_name, char *path_name); +void srv_io_file_info3_str(char *desc, FILE_INFO_3_STR *sh1, prs_struct *ps, int depth); +void make_srv_file_info3(FILE_INFO_3 *fl3, + uint32 id, uint32 perms, uint32 num_locks, + char *path_name, char *user_name); +void srv_io_file_info3(char *desc, FILE_INFO_3 *fl3, prs_struct *ps, int depth); +void srv_io_srv_file_info_3(char *desc, SRV_FILE_INFO_3 *fl3, prs_struct *ps, int depth); +void srv_io_srv_file_ctr(char *desc, SRV_FILE_INFO_CTR *ctr, prs_struct *ps, int depth); +void make_srv_q_net_file_enum(SRV_Q_NET_FILE_ENUM *q_n, + char *srv_name, char *qual_name, + uint32 file_level, SRV_FILE_INFO_CTR *ctr, + uint32 preferred_len, + ENUM_HND *hnd); +void srv_io_q_net_file_enum(char *desc, SRV_Q_NET_FILE_ENUM *q_n, prs_struct *ps, int depth); +void srv_io_r_net_file_enum(char *desc, SRV_R_NET_FILE_ENUM *r_n, prs_struct *ps, int depth); +void make_srv_info_101(SRV_INFO_101 *sv101, uint32 platform_id, char *name, + uint32 ver_major, uint32 ver_minor, + uint32 srv_type, char *comment); +void srv_io_info_101(char *desc, SRV_INFO_101 *sv101, prs_struct *ps, int depth); +void make_srv_info_102(SRV_INFO_102 *sv102, uint32 platform_id, char *name, + char *comment, uint32 ver_major, uint32 ver_minor, + uint32 srv_type, uint32 users, uint32 disc, uint32 hidden, + uint32 announce, uint32 ann_delta, uint32 licenses, + char *usr_path); +void srv_io_info_102(char *desc, SRV_INFO_102 *sv102, prs_struct *ps, int depth); +void srv_io_info_ctr(char *desc, SRV_INFO_CTR *ctr, prs_struct *ps, int depth); +void make_srv_q_net_srv_get_info(SRV_Q_NET_SRV_GET_INFO *srv, + char *server_name, uint32 switch_value); +void srv_io_q_net_srv_get_info(char *desc, SRV_Q_NET_SRV_GET_INFO *q_n, prs_struct *ps, int depth); +void make_srv_r_net_srv_get_info(SRV_R_NET_SRV_GET_INFO *srv, + uint32 switch_value, SRV_INFO_CTR *ctr, uint32 status); +void srv_io_r_net_srv_get_info(char *desc, SRV_R_NET_SRV_GET_INFO *r_n, prs_struct *ps, int depth); +void make_srv_q_net_srv_set_info(SRV_Q_NET_SRV_SET_INFO *srv, + uint32 switch_value, SRV_INFO_CTR *ctr); +void srv_io_q_net_srv_set_info(char *desc, SRV_Q_NET_SRV_SET_INFO *q_n, prs_struct *ps, int depth); +void make_srv_r_net_srv_set_info(SRV_R_NET_SRV_SET_INFO *srv, + uint32 switch_value, SRV_INFO_CTR *ctr, uint32 status); +void srv_io_r_net_srv_set_info(char *desc, SRV_R_NET_SRV_SET_INFO *r_n, prs_struct *ps, int depth); +void srv_io_q_net_remote_tod(char *desc, SRV_Q_NET_REMOTE_TOD *q_n, prs_struct *ps, int depth); +void srv_io_time_of_day_info(char *desc, TIME_OF_DAY_INFO *tod, prs_struct *ps, int depth); +void make_time_of_day_info(TIME_OF_DAY_INFO *tod, uint32 elapsedt, uint32 msecs, + uint32 hours, uint32 mins, uint32 secs, uint32 hunds, + uint32 zone, uint32 tintervals, uint32 day, + uint32 month, uint32 year, uint32 weekday); +void srv_io_r_net_remote_tod(char *desc, SRV_R_NET_REMOTE_TOD *r_n, prs_struct *ps, int depth); + +/*The following definitions come from rpc_parse/parse_wks.c */ -BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset, int lock_type); -BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int lock_type, - int *eclass,uint32 *ecode); -BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); -BOOL locking_init(int read_only); -BOOL locking_end(void); -BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, int *ptok); -BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, int token); -int get_share_modes(int cnum, int token, uint32 dev, uint32 inode, - share_mode_entry **shares); -void del_share_mode(int token, int fnum); -BOOL set_share_mode(int token, int fnum, uint16 port, uint16 op_type); -BOOL remove_share_oplock(int fnum, int token); -int share_mode_forall(void (*fn)(share_mode_entry *, char *)); -void share_status(FILE *f); +void make_wks_q_query_info(WKS_Q_QUERY_INFO *q_u, + char *server, uint16 switch_value) ; +void wks_io_q_query_info(char *desc, WKS_Q_QUERY_INFO *q_u, prs_struct *ps, int depth); +void make_wks_info_100(WKS_INFO_100 *inf, + uint32 platform_id, uint32 ver_major, uint32 ver_minor, + char *my_name, char *domain_name); +void wks_io_wks_info_100(char *desc, WKS_INFO_100 *inf, prs_struct *ps, int depth); +void make_wks_r_query_info(WKS_R_QUERY_INFO *r_u, + uint32 switch_value, WKS_INFO_100 *wks100, + int status) ; +void wks_io_r_query_info(char *desc, WKS_R_QUERY_INFO *r_u, prs_struct *ps, int depth); -/*The following definitions come from locking_shm.c */ +/*The following definitions come from rpc_server/srv_ldap_helpers.c */ -struct share_ops *locking_shm_init(int ronly); +void ldap_helper_dummy(void); -/*The following definitions come from locking_slow.c */ +/*The following definitions come from rpc_server/srv_lsa.c */ -struct share_ops *locking_slow_init(int ronly); +BOOL api_ntlsa_rpc(pipes_struct *p, prs_struct *data); -/*The following definitions come from mangle.c */ +/*The following definitions come from rpc_server/srv_lsa_hnd.c */ -BOOL is_mangled( char *s ); -BOOL is_8_3( char *fname, BOOL check_case ); -int str_checksum( char *s ); -void reset_mangled_cache( void ); -BOOL check_mangled_cache( char *s ); -void mangle_name_83( char *s, int s_len ); -BOOL name_map_mangle( char *OutName, BOOL need83, int snum ); +void create_pol_hnd(POLICY_HND *hnd); +void init_lsa_policy_hnd(void); +BOOL open_lsa_policy_hnd(POLICY_HND *hnd); +int find_lsa_policy_by_hnd(POLICY_HND *hnd); +BOOL set_lsa_policy_samr_rid(POLICY_HND *hnd, uint32 rid); +BOOL set_lsa_policy_samr_pol_status(POLICY_HND *hnd, uint32 pol_status); +BOOL set_lsa_policy_samr_sid(POLICY_HND *hnd, DOM_SID *sid); +uint32 get_lsa_policy_samr_rid(POLICY_HND *hnd); +BOOL set_lsa_policy_reg_name(POLICY_HND *hnd, fstring name); +BOOL get_lsa_policy_reg_name(POLICY_HND *hnd, fstring name); +BOOL close_lsa_policy_hnd(POLICY_HND *hnd); -/*The following definitions come from md4.c */ +/*The following definitions come from rpc_server/srv_netlog.c */ -void mdfour(unsigned char *out, unsigned char *in, int n); +BOOL api_netlog_rpc(pipes_struct *p, prs_struct *data); -/*The following definitions come from membuffer.c */ +/*The following definitions come from rpc_server/srv_pipe_hnd.c */ -void mem_init(struct mem_buf *buf, int margin); -void mem_create(struct mem_buf *buf, char *data, int size, int margin, BOOL dynamic); -void mem_take(struct mem_buf *mem_to, struct mem_buf *mem_from); -BOOL mem_alloc_data(struct mem_buf *buf, int size); -BOOL mem_buf_copy(char *copy_into, struct mem_buf *buf, - uint32 offset, uint32 len); -BOOL mem_buf_init(struct mem_buf **buf, uint32 margin); -void mem_buf_free(struct mem_buf **buf); -void mem_free_chain(struct mem_buf **buf); -void mem_free_data(struct mem_buf *buf); -BOOL mem_realloc_data(struct mem_buf *buf, int new_size); -BOOL mem_grow_data(struct mem_buf **buf, BOOL io, int new_size, BOOL force_grow); -BOOL mem_find(struct mem_buf **buf, uint32 offset); -uint32 mem_buf_len(struct mem_buf *buf); -char *mem_data(struct mem_buf **buf, uint32 offset); +void reset_chain_pnum(void); +void set_chain_pnum(int new_pnum); +void init_rpc_pipe_hnd(void); +int open_rpc_pipe_hnd(char *pipe_name, int cnum, uint16 vuid); +int read_pipe(uint16 pnum, char *data, uint32 pos, int n); +BOOL get_rpc_pipe(int pnum, pipes_struct **p); +char *get_rpc_pipe_hnd_name(int pnum); +BOOL set_rpc_pipe_hnd_state(pipes_struct *p, uint16 device_state); +BOOL close_rpc_pipe_hnd(int pnum, int cnum); +int get_rpc_pipe_num(char *buf, int where); -/*The following definitions come from message.c */ +/*The following definitions come from rpc_server/srv_reg.c */ -int reply_sends(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_sendstrt(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_sendtxt(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_sendend(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +BOOL api_reg_rpc(pipes_struct *p, prs_struct *data); -/*The following definitions come from namequery.c */ +/*The following definitions come from rpc_server/srv_samr.c */ -BOOL name_status(int fd,char *name,int name_type,BOOL recurse, - struct in_addr to_ip,char *master,char *rname, - void (*fn)(struct packet_struct *)); -struct in_addr *name_query(int fd,char *name,int name_type, BOOL bcast,BOOL recurse, - struct in_addr to_ip, int *count, void (*fn)(struct packet_struct *)); -FILE *startlmhosts(char *fname); -BOOL getlmhostsent( FILE *fp, char *name, int *name_type, struct in_addr *ipaddr); -void endlmhosts(FILE *fp); -BOOL resolve_name(char *name, struct in_addr *return_ip); +BOOL api_samr_rpc(pipes_struct *p, prs_struct *data); -/*The following definitions come from netmask.c */ +/*The following definitions come from rpc_server/srv_srvsvc.c */ -int get_netmask(struct in_addr *ipaddr, struct in_addr *nmask); +BOOL api_srvsvc_rpc(pipes_struct *p, prs_struct *data); -/*The following definitions come from nisppass.c */ +/*The following definitions come from rpc_server/srv_util.c */ -struct passdb_ops *nisplus_initialize_password_db(void); +BOOL lookup_wellknown_sid_from_name(char *windows_name, DOM_SID *psid); +int make_dom_gids(char *gids_str, DOM_GID **ppgids); +BOOL create_rpc_reply(pipes_struct *p, + uint32 data_start, uint32 data_end); +BOOL api_rpcTNP(pipes_struct *p, char *rpc_name, struct api_struct *api_rpc_cmds, + prs_struct *data); +void get_domain_user_groups(char *domain_groups, char *user); +uint32 lookup_group_name(uint32 rid, char *group_name, uint32 *type); +uint32 lookup_alias_name(uint32 rid, char *alias_name, uint32 *type); +uint32 lookup_user_name(uint32 rid, char *user_name, uint32 *type); +uint32 lookup_group_rid(char *group_name, uint32 *rid); +uint32 lookup_alias_rid(char *alias_name, uint32 *rid); +uint32 lookup_user_rid(char *user_name, uint32 *rid); + +/*The following definitions come from rpc_server/srv_wkssvc.c */ + +BOOL api_wkssvc_rpc(pipes_struct *p, prs_struct *data); + +/*The following definitions come from smbd/access.c */ + +BOOL check_access(int snum); +BOOL allow_access(char *deny_list,char *allow_list,char *cname,char *caddr); + +/*The following definitions come from smbd/chgpasswd.c */ + +BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence, BOOL as_root); +BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root); +BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root); +BOOL check_lanman_password(char *user, unsigned char *pass1, + unsigned char *pass2, struct smb_passwd **psmbpw); +BOOL change_lanman_password(struct smb_passwd *smbpw, unsigned char *pass1, unsigned char *pass2); +BOOL check_oem_password(char *user, unsigned char *data, + struct smb_passwd **psmbpw, char *new_passwd, + int new_passwd_size); +BOOL change_oem_password(struct smb_passwd *smbpw, char *new_passwd, BOOL override); + +/*The following definitions come from smbd/connection.c */ + +BOOL yield_connection(int cnum,char *name,int max_connections); +BOOL claim_connection(int cnum,char *name,int max_connections,BOOL Clear); + +/*The following definitions come from smbd/credentials.c */ + +char *credstr(uchar *cred); +void cred_session_key(DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal, char *pass, + uchar session_key[8]); +void cred_create(uchar session_key[8], DOM_CHAL *stor_cred, UTIME timestamp, + DOM_CHAL *cred); +int cred_assert(DOM_CHAL *cred, uchar session_key[8], DOM_CHAL *stored_cred, + UTIME timestamp); +BOOL clnt_deal_with_creds(uchar sess_key[8], + DOM_CRED *sto_clnt_cred, DOM_CRED *rcv_srv_cred); +BOOL deal_with_creds(uchar sess_key[8], + DOM_CRED *sto_clnt_cred, + DOM_CRED *rcv_clnt_cred, DOM_CRED *rtn_srv_cred); + +/*The following definitions come from smbd/dfree.c */ + +int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); + +/*The following definitions come from smbd/dir.c */ + +void init_dptrs(void); +char *dptr_path(int key); +char *dptr_wcard(int key); +BOOL dptr_set_wcard(int key, char *wcard); +BOOL dptr_set_attr(int key, uint16 attr); +uint16 dptr_attr(int key); +void dptr_close(int key); +void dptr_closecnum(int cnum); +void dptr_idlecnum(int cnum); +void dptr_closepath(char *path,int pid); +int dptr_create(int cnum,char *path, BOOL expect_close,int pid); +BOOL dptr_fill(char *buf1,unsigned int key); +BOOL dptr_zero(char *buf); +void *dptr_fetch(char *buf,int *num); +void *dptr_fetch_lanman2(int dptr_num); +BOOL dir_check_ftype(int cnum,int mode,struct stat *st,int dirtype); +BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend); +void *OpenDir(int cnum, char *name, BOOL use_veto); +void CloseDir(void *p); +char *ReadDirName(void *p); +BOOL SeekDir(void *p,int pos); +int TellDir(void *p); +void DirCacheAdd( char *path, char *name, char *dname, int snum ); +char *DirCacheCheck( char *path, char *name, int snum ); +void DirCacheFlush(int snum); + +/*The following definitions come from smbd/genrand.c */ + +void generate_random_buffer( unsigned char *out, int len, BOOL re_seed); + +/*The following definitions come from smbd/groupname.c */ + +void load_groupname_map(void); +void map_gid_to_sid( gid_t gid, DOM_SID *psid); + +/*The following definitions come from smbd/ipc.c */ + +int get_printerdrivernumber(int snum); +int reply_trans(char *inbuf,char *outbuf, int size, int bufsize); + +/*The following definitions come from smbd/ldap.c */ + +struct passdb_ops *ldap_initialize_password_db(void); -/*The following definitions come from nmbd.c */ +/*The following definitions come from smbd/mangle.c */ + +BOOL is_mangled( char *s ); +BOOL is_8_3( char *fname, BOOL check_case ); +int str_checksum( char *s ); +void reset_mangled_cache( void ); +BOOL check_mangled_cache( char *s ); +void mangle_name_83( char *s, int s_len ); +BOOL name_map_mangle( char *OutName, BOOL need83, int snum ); -BOOL reload_services(BOOL test); -int main(int argc,char *argv[]); - -/*The following definitions come from nmbd_become_dmb.c */ - -void unbecome_domain_master(char *workgroup_name); -void add_domain_names(time_t t); - -/*The following definitions come from nmbd_become_lmb.c */ - -void insert_permanent_name_into_unicast( struct subnet_record *subrec, - struct nmb_name *nmbname, uint16 nb_type ); -void unbecome_local_master_success(struct subnet_record *subrec, - struct userdata_struct *userdata, - struct nmb_name *released_name, - struct in_addr released_ip); -void unbecome_local_master_fail(struct subnet_record *subrec, struct response_record *rrec, - struct nmb_name *fail_name); -void unbecome_local_master_browser(struct subnet_record *subrec, struct work_record *work, - BOOL force_new_election); -void become_local_master_browser(struct subnet_record *subrec, struct work_record *work); -void set_workgroup_local_master_browser_name( struct work_record *work, char *newname); - -/*The following definitions come from nmbd_browserdb.c */ - -void update_browser_death_time( struct browse_cache_record *browc ); -struct browse_cache_record *create_browser_in_lmb_cache( char *work_name, - char *browser_name, - struct in_addr ip ); -struct browse_cache_record *find_browser_in_lmb_cache( char *browser_name ); -void expire_lmb_browsers( time_t t ); -void remove_workgroup_lmb_browsers( char *work_group ); - -/*The following definitions come from nmbd_browsesync.c */ - -void dmb_expire_and_sync_browser_lists(time_t t); -void announce_and_sync_with_domain_master_browser( struct subnet_record *subrec, - struct work_record *work); -void collect_all_workgroup_names_from_wins_server(time_t t); - -/*The following definitions come from nmbd_elections.c */ - -void check_master_browser_exists(time_t t); -void run_elections(time_t t); -void process_election(struct subnet_record *subrec, struct packet_struct *p, char *buf); -BOOL check_elections(void); - -/*The following definitions come from nmbd_incomingdgrams.c */ - -void tell_become_backup(void); -void process_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf); -void process_workgroup_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf); -void process_local_master_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf); -void process_master_browser_announce(struct subnet_record *subrec, - struct packet_struct *p,char *buf); -void process_lm_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf); -void process_get_backup_list_request(struct subnet_record *subrec, - struct packet_struct *p,char *buf); -void process_reset_browser(struct subnet_record *subrec, - struct packet_struct *p,char *buf); -void process_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf); -void process_lm_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf); - -/*The following definitions come from nmbd_incomingrequests.c */ - -void process_name_release_request(struct subnet_record *subrec, - struct packet_struct *p); -void process_name_refresh_request(struct subnet_record *subrec, - struct packet_struct *p); -void process_name_registration_request(struct subnet_record *subrec, - struct packet_struct *p); -void process_node_status_request(struct subnet_record *subrec, struct packet_struct *p); -void process_name_query_request(struct subnet_record *subrec, struct packet_struct *p); - -/*The following definitions come from nmbd_lmhosts.c */ - -void load_lmhosts_file(char *fname); -BOOL find_name_in_lmhosts(struct nmb_name *nmbname, struct name_record **namerecp); - -/*The following definitions come from nmbd_logonnames.c */ - -void add_logon_names(void); - -/*The following definitions come from nmbd_mynames.c */ - -BOOL register_my_workgroup_and_names(void); -void release_my_names(void); -void refresh_my_names(time_t t); - -/*The following definitions come from nmbd_namelistdb.c */ - -void set_samba_nb_type(void); -BOOL ms_browser_name( char *name, int type ); -void remove_name_from_namelist( struct subnet_record *subrec, - struct name_record *namerec ); -struct name_record *find_name_on_subnet( struct subnet_record *subrec, - struct nmb_name *nmbname, - BOOL self_only ); -struct name_record *find_name_for_remote_broadcast_subnet( - struct nmb_name *nmbname, - BOOL self_only ); -void update_name_ttl( struct name_record *namerec, int ttl ); -struct name_record *add_name_to_subnet( struct subnet_record *subrec, - char *name, - int type, - uint16 nb_flags, - int ttl, - enum name_source source, - int num_ips, - struct in_addr *iplist); -void standard_success_register(struct subnet_record *subrec, - struct userdata_struct *userdata, - struct nmb_name *nmbname, uint16 nb_flags, int ttl, - struct in_addr registered_ip); -void standard_fail_register( struct subnet_record *subrec, - struct response_record *rrec, - struct nmb_name *nmbname ); -BOOL find_ip_in_name_record( struct name_record *namerec, struct in_addr ip ); -void add_ip_to_name_record( struct name_record *namerec, struct in_addr new_ip ); -void remove_ip_from_name_record( struct name_record *namerec, - struct in_addr remove_ip ); -void standard_success_release( struct subnet_record *subrec, - struct userdata_struct *userdata, - struct nmb_name *nmbname, - struct in_addr released_ip ); -void expire_names_on_subnet(struct subnet_record *subrec, time_t t); -void expire_names(time_t t); -void add_samba_names_to_subnet( struct subnet_record *subrec ); -void dump_all_namelists(void); - -/*The following definitions come from nmbd_namequery.c */ - -BOOL query_name(struct subnet_record *subrec, char *name, int type, - query_name_success_function success_fn, - query_name_fail_function fail_fn, - struct userdata_struct *userdata); -BOOL query_name_from_wins_server(struct in_addr ip_to, - char *name, int type, - query_name_success_function success_fn, - query_name_fail_function fail_fn, - struct userdata_struct *userdata); - -/*The following definitions come from nmbd_nameregister.c */ - -BOOL register_name(struct subnet_record *subrec, - char *name, int type, uint16 nb_flags, - register_name_success_function success_fn, - register_name_fail_function fail_fn, - struct userdata_struct *userdata); -BOOL refresh_name(struct subnet_record *subrec, struct name_record *namerec, - refresh_name_success_function success_fn, - refresh_name_fail_function fail_fn, - struct userdata_struct *userdata); - -/*The following definitions come from nmbd_namerelease.c */ - -BOOL release_name(struct subnet_record *subrec, struct name_record *namerec, - release_name_success_function success_fn, - release_name_fail_function fail_fn, - struct userdata_struct *userdata); - -/*The following definitions come from nmbd_nodestatus.c */ - -BOOL node_status(struct subnet_record *subrec, struct nmb_name *nmbname, - struct in_addr send_ip, node_status_success_function success_fn, - node_status_fail_function fail_fn, struct userdata_struct *userdata); - -/*The following definitions come from nmbd_packets.c */ - -uint16 get_nb_flags(char *buf); -void set_nb_flags(char *buf, uint16 nb_flags); -struct response_record *queue_register_name( struct subnet_record *subrec, - response_function resp_fn, - timeout_response_function timeout_fn, - register_name_success_function success_fn, - register_name_fail_function fail_fn, - struct userdata_struct *userdata, - struct nmb_name *nmbname, - uint16 nb_flags); -struct response_record *queue_register_multihomed_name( struct subnet_record *subrec, - response_function resp_fn, - timeout_response_function timeout_fn, - register_name_success_function success_fn, - register_name_fail_function fail_fn, - struct userdata_struct *userdata, - struct nmb_name *nmbname, - uint16 nb_flags, - struct in_addr register_ip); -struct response_record *queue_release_name( struct subnet_record *subrec, - response_function resp_fn, - timeout_response_function timeout_fn, - release_name_success_function success_fn, - release_name_fail_function fail_fn, - struct userdata_struct *userdata, - struct nmb_name *nmbname, - uint16 nb_flags, - struct in_addr release_ip); -struct response_record *queue_refresh_name( struct subnet_record *subrec, - response_function resp_fn, - timeout_response_function timeout_fn, - refresh_name_success_function success_fn, - refresh_name_fail_function fail_fn, - struct userdata_struct *userdata, - struct name_record *namerec, - struct in_addr refresh_ip); -struct response_record *queue_query_name( struct subnet_record *subrec, - response_function resp_fn, - timeout_response_function timeout_fn, - query_name_success_function success_fn, - query_name_fail_function fail_fn, - struct userdata_struct *userdata, - struct nmb_name *nmbname); -struct response_record *queue_query_name_from_wins_server( struct in_addr to_ip, - response_function resp_fn, - timeout_response_function timeout_fn, - query_name_success_function success_fn, - query_name_fail_function fail_fn, - struct userdata_struct *userdata, - struct nmb_name *nmbname); -struct response_record *queue_node_status( struct subnet_record *subrec, - response_function resp_fn, - timeout_response_function timeout_fn, - node_status_success_function success_fn, - node_status_fail_function fail_fn, - struct userdata_struct *userdata, - struct nmb_name *nmbname, - struct in_addr send_ip); -void reply_netbios_packet(struct packet_struct *orig_packet, - int rcode, enum netbios_reply_type_code rcv_code, int opcode, - int ttl, char *data,int len); -void queue_packet(struct packet_struct *packet); -void process_browse_packet(struct packet_struct *p, char *buf,int len); -void process_lanman_packet(struct packet_struct *p, char *buf,int len); -BOOL validate_nmb_response_packet( struct nmb_packet *nmb ); -BOOL validate_nmb_packet( struct nmb_packet *nmb ); -void run_packet_queue(void); -void retransmit_or_expire_response_records(time_t t); -BOOL listen_for_packets(BOOL run_election); -BOOL send_mailslot(BOOL unique, char *mailslot,char *buf,int len, - char *srcname, int src_type, - char *dstname, int dest_type, - struct in_addr dest_ip,struct in_addr src_ip); - -/*The following definitions come from nmbd_processlogon.c */ - -void process_logon_packet(struct packet_struct *p,char *buf,int len, - char *mailslot); - -/*The following definitions come from nmbd_responserecordsdb.c */ - -void add_response_record(struct subnet_record *subrec, - struct response_record *rrec); -void remove_response_record(struct subnet_record *subrec, - struct response_record *rrec); -struct response_record *make_response_record( struct subnet_record *subrec, - struct packet_struct *p, - response_function resp_fn, - timeout_response_function timeout_fn, - success_function success_fn, - fail_function fail_fn, - struct userdata_struct *userdata); -struct response_record *find_response_record(struct subnet_record **ppsubrec, - uint16 id); -BOOL is_refresh_already_queued(struct subnet_record *subrec, struct name_record *namerec); - -/*The following definitions come from nmbd_sendannounce.c */ - -void send_browser_reset(int reset_type, char *to_name, int to_type, struct in_addr to_ip); -void broadcast_announce_request(struct subnet_record *subrec, struct work_record *work); -void announce_my_server_names(time_t t); -void announce_my_lm_server_names(time_t t); -void reset_announce_timer(void); -void announce_myself_to_domain_master_browser(time_t t); -void announce_my_servers_removed(void); -void announce_remote(time_t t); -void browse_sync_remote(time_t t); - -/*The following definitions come from nmbd_serverlistdb.c */ - -void remove_all_servers(struct work_record *work); -struct server_record *find_server_in_workgroup(struct work_record *work, char *name); -void remove_server_from_workgroup(struct work_record *work, struct server_record *servrec); -struct server_record *create_server_on_workgroup(struct work_record *work, - char *name,int servertype, - int ttl,char *comment); -void update_server_ttl(struct server_record *servrec, int ttl); -void expire_servers(struct work_record *work, time_t t); -void write_browse_list(time_t t, BOOL force_write); - -/*The following definitions come from nmbd_subnetdb.c */ - -BOOL create_subnets(void); -BOOL we_are_a_wins_client(void); -struct subnet_record *get_next_subnet_maybe_unicast(struct subnet_record *subrec); -struct subnet_record *get_next_subnet_maybe_unicast_or_wins_server(struct subnet_record *subrec); - -/*The following definitions come from nmbd_winsproxy.c */ - -void make_wins_proxy_name_query_request( struct subnet_record *subrec, - struct packet_struct *incoming_packet, - struct nmb_name *question_name); - -/*The following definitions come from nmbd_winsserver.c */ - -BOOL packet_is_for_wins_server(struct packet_struct *packet); -BOOL initialise_wins(void); -void wins_process_name_refresh_request(struct subnet_record *subrec, - struct packet_struct *p); -void wins_process_name_registration_request(struct subnet_record *subrec, - struct packet_struct *p); -void wins_process_multihomed_name_registration_request( struct subnet_record *subrec, - struct packet_struct *p); -void send_wins_name_query_response(int rcode, struct packet_struct *p, - struct name_record *namerec); -void wins_process_name_query_request(struct subnet_record *subrec, - struct packet_struct *p); -void wins_process_name_release_request(struct subnet_record *subrec, - struct packet_struct *p); -void initiate_wins_processing(time_t t); -void wins_write_database(void); - -/*The following definitions come from nmbd_workgroupdb.c */ - -struct work_record *find_workgroup_on_subnet(struct subnet_record *subrec, - fstring name); -struct work_record *create_workgroup_on_subnet(struct subnet_record *subrec, - fstring name, int ttl); -void update_workgroup_ttl(struct work_record *work, int ttl); -void initiate_myworkgroup_startup(struct subnet_record *subrec, struct work_record *work); -void dump_workgroups(BOOL force_write); -void expire_workgroups_and_servers(time_t t); - -/*The following definitions come from nmblib.c */ +/*The following definitions come from smbd/message.c */ -char *lookup_opcode_name( int opcode ); -void debug_nmb_packet(struct packet_struct *p); -char *namestr(struct nmb_name *n); -struct packet_struct *copy_packet(struct packet_struct *packet); -void free_packet(struct packet_struct *packet); -struct packet_struct *read_packet(int fd,enum packet_type packet_type); -void make_nmb_name( struct nmb_name *n, char *name, int type, char *this_scope ); -BOOL nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2); -BOOL send_packet(struct packet_struct *p); -struct packet_struct *receive_packet(int fd,enum packet_type type,int t); +int reply_sends(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_sendstrt(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_sendtxt(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_sendend(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -/*The following definitions come from nterr.c */ +/*The following definitions come from smbd/nispass.c */ -char *get_nt_error_msg(uint32 nt_code); +struct passdb_ops *nisplus_initialize_password_db(void); -/*The following definitions come from nttrans.c */ +/*The following definitions come from smbd/nttrans.c */ int reply_ntcreate_and_X(char *inbuf,char *outbuf,int length,int bufsize); int reply_ntcancel(char *inbuf,char *outbuf,int length,int bufsize); @@ -1610,13 +1471,7 @@ void remove_pending_change_notify_requests_by_mid(int mid); void process_pending_change_notify_queue(time_t t); int reply_nttrans(char *inbuf,char *outbuf,int length,int bufsize); -/*The following definitions come from params.c */ - -BOOL pm_process( char *FileName, - BOOL (*sfunc)(char *), - BOOL (*pfunc)(char *, char *) ); - -/*The following definitions come from passdb.c */ +/*The following definitions come from smbd/passdb.c */ BOOL initialize_password_db(void); struct smb_passwd *iterate_getsmbpwuid(uid_t smb_userid); @@ -1668,7 +1523,7 @@ uint32 pdb_gid_to_group_rid(gid_t gid); BOOL pdb_rid_is_well_known(uint32 rid); BOOL pdb_rid_is_user(uint32 rid); -/*The following definitions come from password.c */ +/*The following definitions come from smbd/password.c */ void generate_next_challenge(char *challenge); BOOL set_challenge(char *challenge); @@ -1699,34 +1554,29 @@ BOOL domain_client_validate( char *user, char *domain, char *smb_apasswd, int smb_apasslen, char *smb_ntpasswd, int smb_ntpasslen); -/*The following definitions come from pcap.c */ +/*The following definitions come from smbd/pcap.c */ BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); void pcap_printer_fn(void (*fn)(char *, char *)); -/*The following definitions come from pidfile.c */ - -int pidfile_pid(char *name); -void pidfile_create(char *name); - -/*The following definitions come from pipes.c */ +/*The following definitions come from smbd/pipes.c */ int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize); int reply_pipe_read_and_X(char *inbuf,char *outbuf,int length,int bufsize); int reply_pipe_close(char *inbuf,char *outbuf); -/*The following definitions come from predict.c */ +/*The following definitions come from smbd/predict.c */ int read_predict(int fd,int offset,char *buf,char **ptr,int num); void do_read_prediction(void); void invalidate_read_prediction(int fd); -/*The following definitions come from print_svid.c */ +/*The following definitions come from smbd/print_svid.c */ void sysv_printer_fn(void (*fn)(char *, char *)); int sysv_printername_ok(char *name); -/*The following definitions come from printing.c */ +/*The following definitions come from smbd/printing.c */ void lpq_reset(int snum); void print_file(int fnum); @@ -1738,7 +1588,7 @@ int printjob_encode(int snum, int job); void printjob_decode(int jobid, int *snum, int *job); void status_printqueue(int cnum,int snum,int status); -/*The following definitions come from quotas.c */ +/*The following definitions come from smbd/quotas.c */ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); @@ -1747,11 +1597,7 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); -/*The following definitions come from replace.c */ - -char *rep_inet_ntoa(struct in_addr ip); - -/*The following definitions come from reply.c */ +/*The following definitions come from smbd/reply.c */ int reply_special(char *inbuf,char *outbuf); int reply_tcon(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); @@ -1805,7 +1651,7 @@ int reply_writebs(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); int reply_setattrE(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); int reply_getattrE(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -/*The following definitions come from server.c */ +/*The following definitions come from smbd/server.c */ void *dflt_sig(void); void killkids(void); @@ -1851,53 +1697,14 @@ void exit_server(char *reason); void standard_sub(int cnum,char *str); char *smb_fn_name(int type); int chain_reply(char *inbuf,char *outbuf,int size,int bufsize); +void construct_reply_common(char *inbuf,char *outbuf); int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); -/*The following definitions come from shmem.c */ - -struct shmem_ops *smb_shm_open(int ronly); - -/*The following definitions come from shmem_sysv.c */ - -struct shmem_ops *sysv_shm_open(int ronly); - -/*The following definitions come from signal.c */ - -void BlockSignals(BOOL block,int signum); -void CatchSignal(int signum,void (*handler)(int )); -void CatchChild(void); - -/*The following definitions come from slprintf.c */ - -int vslprintf(char *str, int n, char *format, va_list ap); - -/*The following definitions come from smbdes.c */ - -void E_P16(unsigned char *p14,unsigned char *p16); -void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24); -void D_P16(unsigned char *p14, unsigned char *in, unsigned char *out); -void E_old_pw_hash( unsigned char *p14, unsigned char *in, unsigned char *out); -void cred_hash1(unsigned char *out,unsigned char *in,unsigned char *key); -void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key); -void cred_hash3(unsigned char *out,unsigned char *in,unsigned char *key, int forw); -void SamOEMhash( unsigned char *data, unsigned char *key, int val); - -/*The following definitions come from smbencrypt.c */ - -void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); -void E_md4hash(uchar *passwd, uchar *p16); -void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); -void nt_lm_owf_gen(char *pwd, char *nt_p16, char *p16); - -/*The following definitions come from smberr.c */ - -char *smb_errstr(char *inbuf); - -/*The following definitions come from smbpass.c */ +/*The following definitions come from smbd/smbpass.c */ struct passdb_ops *file_initialize_password_db(void); -/*The following definitions come from smbpassfile.c */ +/*The following definitions come from smbd/smbpassfile.c */ BOOL do_file_lock(int fd, int waitsecs, int type); BOOL pw_file_lock(int fd, int type, int secs, int *plock_depth); @@ -1908,54 +1715,16 @@ BOOL trust_password_delete( char *domain, char *name ); BOOL get_trust_account_password( unsigned char *ret_pwd, time_t *pass_last_set_time); BOOL set_trust_account_password( unsigned char *md4_new_pwd); -/*The following definitions come from status.c */ - -void Ucrit_addUsername(pstring username); -unsigned int Ucrit_checkUsername(pstring username); -void Ucrit_addPid(int pid); -unsigned int Ucrit_checkPid(int pid); - -/*The following definitions come from system.c */ +/*The following definitions come from smbd/ssl.c */ -int sys_select(fd_set *fds,struct timeval *tval); -int sys_select(fd_set *fds,struct timeval *tval); -int sys_unlink(char *fname); -int sys_open(char *fname,int flags,int mode); -DIR *sys_opendir(char *dname); -int sys_stat(char *fname,struct stat *sbuf); -int sys_waitpid(pid_t pid,int *status,int options); -int sys_lstat(char *fname,struct stat *sbuf); -int sys_mkdir(char *dname,int mode); -int sys_rmdir(char *dname); -int sys_chdir(char *dname); -int sys_utime(char *fname,struct utimbuf *times); -int sys_rename(char *from, char *to); -int sys_chmod(char *fname,int mode); -char *sys_getwd(char *s); -int sys_chown(char *fname,int uid,int gid); -int sys_chroot(char *dname); -struct hostent *sys_gethostbyname(char *name); - -/*The following definitions come from time.c */ - -void GetTimeOfDay(struct timeval *tval); -void TimeInit(void); -int TimeDiff(time_t t); -struct tm *LocalTime(time_t *t); -time_t interpret_long_date(char *p); -void put_long_date(char *p,time_t t); -BOOL null_mtime(time_t mtime); -void put_dos_date(char *buf,int offset,time_t unixdate); -void put_dos_date2(char *buf,int offset,time_t unixdate); -void put_dos_date3(char *buf,int offset,time_t unixdate); -time_t make_unix_date(void *date_ptr); -time_t make_unix_date2(void *date_ptr); -time_t make_unix_date3(void *date_ptr); -char *http_timestring(time_t t); -char *timestring(void ); -time_t get_create_time(struct stat *st,BOOL fake_dirs); +int sslutil_init(int isServer); +int sslutil_accept(int fd); +int sslutil_fd_is_ssl(int fd); +int sslutil_connect(int fd); +int sslutil_disconnect(int fd); +int sslutil_negotiate_ssl(int fd, int msg_type); -/*The following definitions come from trans2.c */ +/*The following definitions come from smbd/trans2.c */ void mask_convert( char *mask); int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize); @@ -1963,11 +1732,7 @@ int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize); int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize); int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize); -/*The following definitions come from ufc.c */ - -char *ufc_crypt(char *key,char *salt); - -/*The following definitions come from uid.c */ +/*The following definitions come from smbd/uid.c */ void init_uid(void); BOOL become_guest(void); @@ -1977,193 +1742,10 @@ int smbrun(char *cmd,char *outfile,BOOL shared); void become_root(BOOL save_dir) ; void unbecome_root(BOOL restore_dir); -/*The following definitions come from username.c */ +/*The following definitions come from smbd/username.c */ char *get_home_dir(char *user); BOOL map_username(char *user); struct passwd *Get_Pwnam(char *user,BOOL allow_change); BOOL user_in_list(char *user,char *list); - -/*The following definitions come from util.c */ - -char *tmpdir(void); -BOOL is_a_socket(int fd); -BOOL next_token(char **ptr,char *buff,char *sep); -char **toktocliplist(int *ctok, char *sep); -void *mem_dup( void *from, int size ); -void array_promote(char *array,int elsize,int element); -void set_socket_options(int fd, char *options); -void close_sockets(void ); -BOOL in_group(gid_t group, int current_gid, int ngroups, GID_T *groups); -char *StrCpy(char *dest,char *src); -char *StrnCpy(char *dest,char *src,int n); -void putip(void *dest,void *src); -int name_mangle( char *In, char *Out, char name_type ); -BOOL file_exist(char *fname,struct stat *sbuf); -time_t file_modtime(char *fname); -BOOL directory_exist(char *dname,struct stat *st); -uint32 file_size(char *file_name); -char *attrib_string(int mode); -int StrCaseCmp(char *s, char *t); -int StrnCaseCmp(char *s, char *t, int n); -BOOL strequal(char *s1, char *s2); -BOOL strnequal(char *s1,char *s2,int n); -BOOL strcsequal(char *s1,char *s2); -void strlower(char *s); -void strupper(char *s); -void strnorm(char *s); -BOOL strisnormal(char *s); -void string_replace(char *s,char oldc,char newc); -void unix_format(char *fname); -void dos_format(char *fname); -void show_msg(char *buf); -int smb_len(char *buf); -void _smb_setlen(char *buf,int len); -void smb_setlen(char *buf,int len); -int set_message(char *buf,int num_words,int num_bytes,BOOL zero); -int smb_numwords(char *buf); -int smb_buflen(char *buf); -int smb_buf_ofs(char *buf); -char *smb_buf(char *buf); -int smb_offset(char *p,char *buf); -char *skip_string(char *buf,int n); -BOOL trim_string(char *s,char *front,char *back); -void dos_clean_name(char *s); -void unix_clean_name(char *s); -int ChDir(char *path); -char *GetWd(char *str); -BOOL reduce_name(char *s,char *dir,BOOL widelinks); -void expand_mask(char *Mask,BOOL doext); -BOOL strhasupper(char *s); -BOOL strhaslower(char *s); -int count_chars(char *s,char c); -void make_dir_struct(char *buf,char *mask,char *fname,unsigned int size,int mode,time_t date); -void close_low_fds(void); -int set_blocking(int fd, BOOL set); -int write_socket(int fd,char *buf,int len); -int read_udp_socket(int fd,char *buf,int len); -int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out); -int read_max_udp(int fd,char *buffer,int bufsize,int maxtime); -int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew); -BOOL send_keepalive(int client); -int read_data(int fd,char *buffer,int N); -int write_data(int fd,char *buffer,int N); -int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align); -int read_smb_length(int fd,char *inbuf,int timeout); -BOOL receive_smb(int fd,char *buffer, int timeout); -BOOL client_receive_smb(int fd,char *buffer, int timeout); -BOOL receive_local_message(int fd, char *buffer, int buffer_len, int timeout); -BOOL push_oplock_pending_smb_message(char *buf, int msg_len); -BOOL receive_message_or_smb(int smbfd, int oplock_fd, - char *buffer, int buffer_len, - int timeout, BOOL *got_smb); -BOOL send_smb(int fd,char *buffer); -char *name_ptr(char *buf,int ofs); -int name_extract(char *buf,int ofs,char *name); -int name_len( char *s ); -BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type); -void msleep(int t); -BOOL in_list(char *s,char *list,BOOL casesensitive); -BOOL string_init(char **dest,char *src); -void string_free(char **s); -BOOL string_set(char **dest,char *src); -BOOL string_sub(char *s,char *pattern,char *insert); -BOOL do_match(char *str, char *regexp, int case_sig); -BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2); -void become_daemon(void); -BOOL yesno(char *p); -char *fgets_slash(char *s2,int maxlen,FILE *f); -int set_filelen(int fd, long len); -int byte_checksum(char *buf,int len); -char *dirname_dos(char *path,char *buf); -void *Realloc(void *p,int size); -void Abort(void ); -BOOL get_myname(char *my_name,struct in_addr *ip); -BOOL ip_equal(struct in_addr ip1,struct in_addr ip2); -int open_socket_in(int type, int port, int dlevel,uint32 socket_addr); -int open_socket_out(int type, struct in_addr *addr, int port ,int timeout); -int interpret_protocol(char *str,int def); -int interpret_security(char *str,int def); -uint32 interpret_addr(char *str); -struct in_addr *interpret_addr2(char *str); -BOOL zero_ip(struct in_addr ip); -void reset_globals_after_fork(void); -char *client_name(int fd); -char *client_addr(int fd); -char *automount_server(char *user_name); -char *automount_path(char *user_name); -void standard_sub_basic(char *str); -BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask); -int PutUniCode(char *dst,char *src); -struct hostent *Get_Hostbyname(char *name); -BOOL process_exists(int pid); -char *uidtoname(int uid); -char *gidtoname(int gid); -void ajt_panic(void); -char *readdirname(void *p); -BOOL is_in_path(char *name, name_compare_entry *namelist); -void set_namearray(name_compare_entry **ppname_array, char *namelist); -void free_namearray(name_compare_entry *name_array); -BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); -int file_lock(char *name,int timeout); -void file_unlock(int fd); -BOOL is_myname(char *s); -void set_remote_arch(enum remote_arch_types type); -enum remote_arch_types get_remote_arch(void); -char *skip_unicode_string(char *buf,int n); -char *unistrn2(uint16 *buf, int len); -char *unistr2(uint16 *buf); -int struni2(uint16 *p, char *buf); -char *unistr(char *buf); -int unistrncpy(char *dst, char *src, int len); -int unistrcpy(char *dst, char *src); -char *safe_strcpy(char *dest, char *src, int maxlength); -char *safe_strcat(char *dest, char *src, int maxlength); -char *align4(char *q, char *base); -char *align2(char *q, char *base); -char *align_offset(char *q, char *base, int align_offset_len); -void print_asc(int level, unsigned char *buf,int len); -void dump_data(int level,char *buf1,int len); -char *tab_depth(int depth); -char *sid_to_string(pstring sidstr_out, DOM_SID *sid); -BOOL string_to_sid(DOM_SID *sidout, char *sidstr); - -/*The following definitions come from web/cgi.c */ - -void cgi_load_variables(FILE *f1); -char *cgi_variable(char *name); -char *cgi_vnum(int i, char **name); -int cgi_boolean(char *name, int def); -char *quotedup(char *s); -char *urlquote(char *s); -char *quotequotes(char *s); -void quote_spaces(char *buf); -void cgi_setup(char *rootdir, int auth_required); -char *cgi_baseurl(void); -char *cgi_rooturl(void); -char *cgi_pathinfo(void); -char *cgi_remote_host(void); -char *cgi_remote_addr(void); -BOOL cgi_waspost(void); - -/*The following definitions come from web/diagnose.c */ - -BOOL nmbd_running(void); -BOOL smbd_running(void); - -/*The following definitions come from web/startstop.c */ - -void start_smbd(void); -void start_nmbd(void); -void stop_smbd(void); -void stop_nmbd(void); -void kill_pid(int pid); - -/*The following definitions come from web/statuspage.c */ - -void status_page(void); - -/*The following definitions come from web/swat.c */ - -int main(int argc, char *argv[]); #endif /* _PROTO_H_ */ -- cgit From ea6a257fca8ddc853184846578edbd3042d170c2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 9 Aug 1998 14:08:42 +0000 Subject: close to having nmbd linking (just a bit of repository hacking to go) (This used to be commit 34dd9b79457ab01637e0d7374d33cafe2f859c99) --- source3/include/proto.h | 346 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 346 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index e1f88f2365..727fdfa596 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -425,6 +425,352 @@ struct shmem_ops *smb_shm_open(int ronly); struct shmem_ops *sysv_shm_open(int ronly); +/*The following definitions come from nmbd/asyncdns.c */ + +int asyncdns_fd(void); +void kill_async_dns_child(void); +void start_async_dns(void); +void run_dns_queue(void); +BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question, + struct name_record **n); +BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question, + struct name_record **n); +void kill_async_dns_child(void); + +/*The following definitions come from nmbd/nmbd.c */ + +BOOL reload_services(BOOL test); +int main(int argc,char *argv[]); + +/*The following definitions come from nmbd/nmbd_become_dmb.c */ + +void unbecome_domain_master(char *workgroup_name); +void add_domain_names(time_t t); + +/*The following definitions come from nmbd/nmbd_become_lmb.c */ + +void insert_permanent_name_into_unicast( struct subnet_record *subrec, + struct nmb_name *nmbname, uint16 nb_type ); +void unbecome_local_master_success(struct subnet_record *subrec, + struct userdata_struct *userdata, + struct nmb_name *released_name, + struct in_addr released_ip); +void unbecome_local_master_fail(struct subnet_record *subrec, struct response_record *rrec, + struct nmb_name *fail_name); +void unbecome_local_master_browser(struct subnet_record *subrec, struct work_record *work, + BOOL force_new_election); +void become_local_master_browser(struct subnet_record *subrec, struct work_record *work); +void set_workgroup_local_master_browser_name( struct work_record *work, char *newname); + +/*The following definitions come from nmbd/nmbd_browserdb.c */ + +void update_browser_death_time( struct browse_cache_record *browc ); +struct browse_cache_record *create_browser_in_lmb_cache( char *work_name, + char *browser_name, + struct in_addr ip ); +struct browse_cache_record *find_browser_in_lmb_cache( char *browser_name ); +void expire_lmb_browsers( time_t t ); +void remove_workgroup_lmb_browsers( char *work_group ); + +/*The following definitions come from nmbd/nmbd_browsesync.c */ + +void dmb_expire_and_sync_browser_lists(time_t t); +void announce_and_sync_with_domain_master_browser( struct subnet_record *subrec, + struct work_record *work); +void collect_all_workgroup_names_from_wins_server(time_t t); + +/*The following definitions come from nmbd/nmbd_elections.c */ + +void check_master_browser_exists(time_t t); +void run_elections(time_t t); +void process_election(struct subnet_record *subrec, struct packet_struct *p, char *buf); +BOOL check_elections(void); + +/*The following definitions come from nmbd/nmbd_incomingdgrams.c */ + +void tell_become_backup(void); +void process_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf); +void process_workgroup_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf); +void process_local_master_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf); +void process_master_browser_announce(struct subnet_record *subrec, + struct packet_struct *p,char *buf); +void process_lm_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf); +void process_get_backup_list_request(struct subnet_record *subrec, + struct packet_struct *p,char *buf); +void process_reset_browser(struct subnet_record *subrec, + struct packet_struct *p,char *buf); +void process_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf); +void process_lm_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf); + +/*The following definitions come from nmbd/nmbd_incomingrequests.c */ + +void process_name_release_request(struct subnet_record *subrec, + struct packet_struct *p); +void process_name_refresh_request(struct subnet_record *subrec, + struct packet_struct *p); +void process_name_registration_request(struct subnet_record *subrec, + struct packet_struct *p); +void process_node_status_request(struct subnet_record *subrec, struct packet_struct *p); +void process_name_query_request(struct subnet_record *subrec, struct packet_struct *p); + +/*The following definitions come from nmbd/nmbd_lmhosts.c */ + +void load_lmhosts_file(char *fname); +BOOL find_name_in_lmhosts(struct nmb_name *nmbname, struct name_record **namerecp); + +/*The following definitions come from nmbd/nmbd_logonnames.c */ + +void add_logon_names(void); + +/*The following definitions come from nmbd/nmbd_mynames.c */ + +BOOL register_my_workgroup_and_names(void); +void release_my_names(void); +void refresh_my_names(time_t t); + +/*The following definitions come from nmbd/nmbd_namelistdb.c */ + +void set_samba_nb_type(void); +BOOL ms_browser_name( char *name, int type ); +void remove_name_from_namelist( struct subnet_record *subrec, + struct name_record *namerec ); +struct name_record *find_name_on_subnet( struct subnet_record *subrec, + struct nmb_name *nmbname, + BOOL self_only ); +struct name_record *find_name_for_remote_broadcast_subnet( + struct nmb_name *nmbname, + BOOL self_only ); +void update_name_ttl( struct name_record *namerec, int ttl ); +struct name_record *add_name_to_subnet( struct subnet_record *subrec, + char *name, + int type, + uint16 nb_flags, + int ttl, + enum name_source source, + int num_ips, + struct in_addr *iplist); +void standard_success_register(struct subnet_record *subrec, + struct userdata_struct *userdata, + struct nmb_name *nmbname, uint16 nb_flags, int ttl, + struct in_addr registered_ip); +void standard_fail_register( struct subnet_record *subrec, + struct response_record *rrec, + struct nmb_name *nmbname ); +BOOL find_ip_in_name_record( struct name_record *namerec, struct in_addr ip ); +void add_ip_to_name_record( struct name_record *namerec, struct in_addr new_ip ); +void remove_ip_from_name_record( struct name_record *namerec, + struct in_addr remove_ip ); +void standard_success_release( struct subnet_record *subrec, + struct userdata_struct *userdata, + struct nmb_name *nmbname, + struct in_addr released_ip ); +void expire_names_on_subnet(struct subnet_record *subrec, time_t t); +void expire_names(time_t t); +void add_samba_names_to_subnet( struct subnet_record *subrec ); +void dump_all_namelists(void); + +/*The following definitions come from nmbd/nmbd_namequery.c */ + +BOOL query_name(struct subnet_record *subrec, char *name, int type, + query_name_success_function success_fn, + query_name_fail_function fail_fn, + struct userdata_struct *userdata); +BOOL query_name_from_wins_server(struct in_addr ip_to, + char *name, int type, + query_name_success_function success_fn, + query_name_fail_function fail_fn, + struct userdata_struct *userdata); + +/*The following definitions come from nmbd/nmbd_nameregister.c */ + +BOOL register_name(struct subnet_record *subrec, + char *name, int type, uint16 nb_flags, + register_name_success_function success_fn, + register_name_fail_function fail_fn, + struct userdata_struct *userdata); +BOOL refresh_name(struct subnet_record *subrec, struct name_record *namerec, + refresh_name_success_function success_fn, + refresh_name_fail_function fail_fn, + struct userdata_struct *userdata); + +/*The following definitions come from nmbd/nmbd_namerelease.c */ + +BOOL release_name(struct subnet_record *subrec, struct name_record *namerec, + release_name_success_function success_fn, + release_name_fail_function fail_fn, + struct userdata_struct *userdata); + +/*The following definitions come from nmbd/nmbd_nodestatus.c */ + +BOOL node_status(struct subnet_record *subrec, struct nmb_name *nmbname, + struct in_addr send_ip, node_status_success_function success_fn, + node_status_fail_function fail_fn, struct userdata_struct *userdata); + +/*The following definitions come from nmbd/nmbd_packets.c */ + +uint16 get_nb_flags(char *buf); +void set_nb_flags(char *buf, uint16 nb_flags); +struct response_record *queue_register_name( struct subnet_record *subrec, + response_function resp_fn, + timeout_response_function timeout_fn, + register_name_success_function success_fn, + register_name_fail_function fail_fn, + struct userdata_struct *userdata, + struct nmb_name *nmbname, + uint16 nb_flags); +struct response_record *queue_register_multihomed_name( struct subnet_record *subrec, + response_function resp_fn, + timeout_response_function timeout_fn, + register_name_success_function success_fn, + register_name_fail_function fail_fn, + struct userdata_struct *userdata, + struct nmb_name *nmbname, + uint16 nb_flags, + struct in_addr register_ip); +struct response_record *queue_release_name( struct subnet_record *subrec, + response_function resp_fn, + timeout_response_function timeout_fn, + release_name_success_function success_fn, + release_name_fail_function fail_fn, + struct userdata_struct *userdata, + struct nmb_name *nmbname, + uint16 nb_flags, + struct in_addr release_ip); +struct response_record *queue_refresh_name( struct subnet_record *subrec, + response_function resp_fn, + timeout_response_function timeout_fn, + refresh_name_success_function success_fn, + refresh_name_fail_function fail_fn, + struct userdata_struct *userdata, + struct name_record *namerec, + struct in_addr refresh_ip); +struct response_record *queue_query_name( struct subnet_record *subrec, + response_function resp_fn, + timeout_response_function timeout_fn, + query_name_success_function success_fn, + query_name_fail_function fail_fn, + struct userdata_struct *userdata, + struct nmb_name *nmbname); +struct response_record *queue_query_name_from_wins_server( struct in_addr to_ip, + response_function resp_fn, + timeout_response_function timeout_fn, + query_name_success_function success_fn, + query_name_fail_function fail_fn, + struct userdata_struct *userdata, + struct nmb_name *nmbname); +struct response_record *queue_node_status( struct subnet_record *subrec, + response_function resp_fn, + timeout_response_function timeout_fn, + node_status_success_function success_fn, + node_status_fail_function fail_fn, + struct userdata_struct *userdata, + struct nmb_name *nmbname, + struct in_addr send_ip); +void reply_netbios_packet(struct packet_struct *orig_packet, + int rcode, enum netbios_reply_type_code rcv_code, int opcode, + int ttl, char *data,int len); +void queue_packet(struct packet_struct *packet); +void process_browse_packet(struct packet_struct *p, char *buf,int len); +void process_lanman_packet(struct packet_struct *p, char *buf,int len); +BOOL validate_nmb_response_packet( struct nmb_packet *nmb ); +BOOL validate_nmb_packet( struct nmb_packet *nmb ); +void run_packet_queue(void); +void retransmit_or_expire_response_records(time_t t); +BOOL listen_for_packets(BOOL run_election); +BOOL send_mailslot(BOOL unique, char *mailslot,char *buf,int len, + char *srcname, int src_type, + char *dstname, int dest_type, + struct in_addr dest_ip,struct in_addr src_ip); + +/*The following definitions come from nmbd/nmbd_processlogon.c */ + +void process_logon_packet(struct packet_struct *p,char *buf,int len, + char *mailslot); + +/*The following definitions come from nmbd/nmbd_responserecordsdb.c */ + +void add_response_record(struct subnet_record *subrec, + struct response_record *rrec); +void remove_response_record(struct subnet_record *subrec, + struct response_record *rrec); +struct response_record *make_response_record( struct subnet_record *subrec, + struct packet_struct *p, + response_function resp_fn, + timeout_response_function timeout_fn, + success_function success_fn, + fail_function fail_fn, + struct userdata_struct *userdata); +struct response_record *find_response_record(struct subnet_record **ppsubrec, + uint16 id); +BOOL is_refresh_already_queued(struct subnet_record *subrec, struct name_record *namerec); + +/*The following definitions come from nmbd/nmbd_sendannounce.c */ + +void send_browser_reset(int reset_type, char *to_name, int to_type, struct in_addr to_ip); +void broadcast_announce_request(struct subnet_record *subrec, struct work_record *work); +void announce_my_server_names(time_t t); +void announce_my_lm_server_names(time_t t); +void reset_announce_timer(void); +void announce_myself_to_domain_master_browser(time_t t); +void announce_my_servers_removed(void); +void announce_remote(time_t t); +void browse_sync_remote(time_t t); + +/*The following definitions come from nmbd/nmbd_serverlistdb.c */ + +void remove_all_servers(struct work_record *work); +struct server_record *find_server_in_workgroup(struct work_record *work, char *name); +void remove_server_from_workgroup(struct work_record *work, struct server_record *servrec); +struct server_record *create_server_on_workgroup(struct work_record *work, + char *name,int servertype, + int ttl,char *comment); +void update_server_ttl(struct server_record *servrec, int ttl); +void expire_servers(struct work_record *work, time_t t); +void write_browse_list(time_t t, BOOL force_write); + +/*The following definitions come from nmbd/nmbd_subnetdb.c */ + +BOOL create_subnets(void); +BOOL we_are_a_wins_client(void); +struct subnet_record *get_next_subnet_maybe_unicast(struct subnet_record *subrec); +struct subnet_record *get_next_subnet_maybe_unicast_or_wins_server(struct subnet_record *subrec); + +/*The following definitions come from nmbd/nmbd_winsproxy.c */ + +void make_wins_proxy_name_query_request( struct subnet_record *subrec, + struct packet_struct *incoming_packet, + struct nmb_name *question_name); + +/*The following definitions come from nmbd/nmbd_winsserver.c */ + +BOOL packet_is_for_wins_server(struct packet_struct *packet); +BOOL initialise_wins(void); +void wins_process_name_refresh_request(struct subnet_record *subrec, + struct packet_struct *p); +void wins_process_name_registration_request(struct subnet_record *subrec, + struct packet_struct *p); +void wins_process_multihomed_name_registration_request( struct subnet_record *subrec, + struct packet_struct *p); +void send_wins_name_query_response(int rcode, struct packet_struct *p, + struct name_record *namerec); +void wins_process_name_query_request(struct subnet_record *subrec, + struct packet_struct *p); +void wins_process_name_release_request(struct subnet_record *subrec, + struct packet_struct *p); +void initiate_wins_processing(time_t t); +void wins_write_database(void); + +/*The following definitions come from nmbd/nmbd_workgroupdb.c */ + +struct work_record *find_workgroup_on_subnet(struct subnet_record *subrec, + fstring name); +struct work_record *create_workgroup_on_subnet(struct subnet_record *subrec, + fstring name, int ttl); +void update_workgroup_ttl(struct work_record *work, int ttl); +void initiate_myworkgroup_startup(struct subnet_record *subrec, struct work_record *work); +void dump_workgroups(BOOL force_write); +void expire_workgroups_and_servers(time_t t); + /*The following definitions come from param/loadparm.c */ char *lp_string(char *s); -- cgit From 19c965894d73b1d39deedfc4cc04b9cbf52e571a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 9 Aug 1998 14:20:02 +0000 Subject: nmbd compiles and links. I had to do some ugly stuff, putting files in illogical places. Once I get everything compiled these will need to be revisited, but at least the new Makefile.in makes it really obvious what is out of place. (This used to be commit beef5341fc313249bf1117deccb9c21c510c4697) --- source3/include/proto.h | 166 ++++++++++++++++++++++++------------------------ 1 file changed, 83 insertions(+), 83 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 727fdfa596..8af9925803 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -28,6 +28,10 @@ BOOL dbghdr( int level, char *file, char *func, int line ); void fault_setup(void (*fn)(void *)); +/*The following definitions come from lib/genrand.c */ + +void generate_random_buffer( unsigned char *out, int len, BOOL re_seed); + /*The following definitions come from lib/getsmbpass.c */ char *getsmbpass(char *prompt) ; @@ -1003,6 +1007,85 @@ BOOL pm_process( char *FileName, BOOL (*sfunc)(char *), BOOL (*pfunc)(char *, char *) ); +/*The following definitions come from param/pcap.c */ + +BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); +void pcap_printer_fn(void (*fn)(char *, char *)); + +/*The following definitions come from passdb/passdb.c */ + +BOOL initialize_password_db(void); +struct smb_passwd *iterate_getsmbpwuid(uid_t smb_userid); +struct smb_passwd *iterate_getsmbpwnam(char *name); +void *startsmbpwent(BOOL update); +void endsmbpwent(void *vp); +struct smb_passwd *getsmbpwent(void *vp); +unsigned long getsmbpwpos(void *vp); +BOOL setsmbpwpos(void *vp, unsigned long tok); +BOOL add_smbpwd_entry(struct smb_passwd *newpwd); +BOOL mod_smbpwd_entry(struct smb_passwd* pwd, BOOL override); +struct smb_passwd *getsmbpwnam(char *name); +struct smb_passwd *getsmbpwuid(uid_t smb_userid); +struct sam_passwd *iterate_getsam21pwnam(char *name); +struct sam_passwd *iterate_getsam21pwrid(uint32 rid); +struct sam_passwd *iterate_getsam21pwuid(uid_t uid); +struct sam_disp_info *getsamdispnam(char *name); +struct sam_disp_info *getsamdisprid(uint32 rid); +struct sam_disp_info *getsamdispent(void *vp); +struct sam_passwd *getsam21pwent(void *vp); +BOOL add_sam21pwd_entry(struct sam_passwd *newpwd); +BOOL mod_sam21pwd_entry(struct sam_passwd* pwd, BOOL override); +struct sam_passwd *getsam21pwnam(char *name); +struct sam_passwd *getsam21pwrid(uint32 rid); +struct sam_passwd *getsam21pwuid(uid_t uid); +void pdb_init_dispinfo(struct sam_disp_info *user); +void pdb_init_smb(struct smb_passwd *user); +void pdb_init_sam(struct sam_passwd *user); +struct sam_disp_info *pdb_sam_to_dispinfo(struct sam_passwd *user); +struct smb_passwd *pdb_sam_to_smb(struct sam_passwd *user); +struct sam_passwd *pdb_smb_to_sam(struct smb_passwd *user); +time_t pdb_get_last_set_time(char *p); +void pdb_set_logon_time(char *p, int max_len, time_t t); +void pdb_set_logoff_time(char *p, int max_len, time_t t); +void pdb_set_kickoff_time(char *p, int max_len, time_t t); +void pdb_set_can_change_time(char *p, int max_len, time_t t); +void pdb_set_must_change_time(char *p, int max_len, time_t t); +void pdb_set_last_set_time(char *p, int max_len, time_t t); +char *pdb_encode_acct_ctrl(uint16 acct_ctrl); +uint16 pdb_decode_acct_ctrl(char *p); +BOOL pdb_gethexpwd(char *p, char *pwd); +void pdb_sethexpwd(char *p, char *pwd, uint16 acct_ctrl); +BOOL pdb_name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); +BOOL pdb_generate_machine_sid(void); +uid_t pdb_user_rid_to_uid(uint32 u_rid); +gid_t pdb_group_rid_to_gid(uint32 g_rid); +uint32 pdb_uid_to_user_rid(uid_t uid); +uint32 pdb_gid_to_group_rid(gid_t gid); +BOOL pdb_rid_is_well_known(uint32 rid); +BOOL pdb_rid_is_user(uint32 rid); + +/*The following definitions come from passdb/smbpass.c */ + +struct passdb_ops *file_initialize_password_db(void); + +/*The following definitions come from passdb/smbpassfile.c */ + +BOOL do_file_lock(int fd, int waitsecs, int type); +BOOL pw_file_lock(int fd, int type, int secs, int *plock_depth); +BOOL pw_file_unlock(int fd, int *plock_depth); +BOOL trust_password_lock( char *domain, char *name, BOOL update); +BOOL trust_password_unlock(void); +BOOL trust_password_delete( char *domain, char *name ); +BOOL get_trust_account_password( unsigned char *ret_pwd, time_t *pass_last_set_time); +BOOL set_trust_account_password( unsigned char *md4_new_pwd); + +/*The following definitions come from passdb/username.c */ + +char *get_home_dir(char *user); +BOOL map_username(char *user); +struct passwd *Get_Pwnam(char *user,BOOL allow_change); +BOOL user_in_list(char *user,char *list); + /*The following definitions come from rpc_client/cli_login.c */ BOOL cli_nt_setup_creds(struct cli_state *cli, unsigned char mach_pwd[16]); @@ -1768,10 +1851,6 @@ void DirCacheAdd( char *path, char *name, char *dname, int snum ); char *DirCacheCheck( char *path, char *name, int snum ); void DirCacheFlush(int snum); -/*The following definitions come from smbd/genrand.c */ - -void generate_random_buffer( unsigned char *out, int len, BOOL re_seed); - /*The following definitions come from smbd/groupname.c */ void load_groupname_map(void); @@ -1817,58 +1896,6 @@ void remove_pending_change_notify_requests_by_mid(int mid); void process_pending_change_notify_queue(time_t t); int reply_nttrans(char *inbuf,char *outbuf,int length,int bufsize); -/*The following definitions come from smbd/passdb.c */ - -BOOL initialize_password_db(void); -struct smb_passwd *iterate_getsmbpwuid(uid_t smb_userid); -struct smb_passwd *iterate_getsmbpwnam(char *name); -void *startsmbpwent(BOOL update); -void endsmbpwent(void *vp); -struct smb_passwd *getsmbpwent(void *vp); -unsigned long getsmbpwpos(void *vp); -BOOL setsmbpwpos(void *vp, unsigned long tok); -BOOL add_smbpwd_entry(struct smb_passwd *newpwd); -BOOL mod_smbpwd_entry(struct smb_passwd* pwd, BOOL override); -struct smb_passwd *getsmbpwnam(char *name); -struct smb_passwd *getsmbpwuid(uid_t smb_userid); -struct sam_passwd *iterate_getsam21pwnam(char *name); -struct sam_passwd *iterate_getsam21pwrid(uint32 rid); -struct sam_passwd *iterate_getsam21pwuid(uid_t uid); -struct sam_disp_info *getsamdispnam(char *name); -struct sam_disp_info *getsamdisprid(uint32 rid); -struct sam_disp_info *getsamdispent(void *vp); -struct sam_passwd *getsam21pwent(void *vp); -BOOL add_sam21pwd_entry(struct sam_passwd *newpwd); -BOOL mod_sam21pwd_entry(struct sam_passwd* pwd, BOOL override); -struct sam_passwd *getsam21pwnam(char *name); -struct sam_passwd *getsam21pwrid(uint32 rid); -struct sam_passwd *getsam21pwuid(uid_t uid); -void pdb_init_dispinfo(struct sam_disp_info *user); -void pdb_init_smb(struct smb_passwd *user); -void pdb_init_sam(struct sam_passwd *user); -struct sam_disp_info *pdb_sam_to_dispinfo(struct sam_passwd *user); -struct smb_passwd *pdb_sam_to_smb(struct sam_passwd *user); -struct sam_passwd *pdb_smb_to_sam(struct smb_passwd *user); -time_t pdb_get_last_set_time(char *p); -void pdb_set_logon_time(char *p, int max_len, time_t t); -void pdb_set_logoff_time(char *p, int max_len, time_t t); -void pdb_set_kickoff_time(char *p, int max_len, time_t t); -void pdb_set_can_change_time(char *p, int max_len, time_t t); -void pdb_set_must_change_time(char *p, int max_len, time_t t); -void pdb_set_last_set_time(char *p, int max_len, time_t t); -char *pdb_encode_acct_ctrl(uint16 acct_ctrl); -uint16 pdb_decode_acct_ctrl(char *p); -BOOL pdb_gethexpwd(char *p, char *pwd); -void pdb_sethexpwd(char *p, char *pwd, uint16 acct_ctrl); -BOOL pdb_name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); -BOOL pdb_generate_machine_sid(void); -uid_t pdb_user_rid_to_uid(uint32 u_rid); -gid_t pdb_group_rid_to_gid(uint32 g_rid); -uint32 pdb_uid_to_user_rid(uid_t uid); -uint32 pdb_gid_to_group_rid(gid_t gid); -BOOL pdb_rid_is_well_known(uint32 rid); -BOOL pdb_rid_is_user(uint32 rid); - /*The following definitions come from smbd/password.c */ void generate_next_challenge(char *challenge); @@ -1900,11 +1927,6 @@ BOOL domain_client_validate( char *user, char *domain, char *smb_apasswd, int smb_apasslen, char *smb_ntpasswd, int smb_ntpasslen); -/*The following definitions come from smbd/pcap.c */ - -BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); -void pcap_printer_fn(void (*fn)(char *, char *)); - /*The following definitions come from smbd/pipes.c */ int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize); @@ -2046,21 +2068,6 @@ int chain_reply(char *inbuf,char *outbuf,int size,int bufsize); void construct_reply_common(char *inbuf,char *outbuf); int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); -/*The following definitions come from smbd/smbpass.c */ - -struct passdb_ops *file_initialize_password_db(void); - -/*The following definitions come from smbd/smbpassfile.c */ - -BOOL do_file_lock(int fd, int waitsecs, int type); -BOOL pw_file_lock(int fd, int type, int secs, int *plock_depth); -BOOL pw_file_unlock(int fd, int *plock_depth); -BOOL trust_password_lock( char *domain, char *name, BOOL update); -BOOL trust_password_unlock(void); -BOOL trust_password_delete( char *domain, char *name ); -BOOL get_trust_account_password( unsigned char *ret_pwd, time_t *pass_last_set_time); -BOOL set_trust_account_password( unsigned char *md4_new_pwd); - /*The following definitions come from smbd/ssl.c */ int sslutil_init(int isServer); @@ -2087,11 +2094,4 @@ BOOL unbecome_user(void ); int smbrun(char *cmd,char *outfile,BOOL shared); void become_root(BOOL save_dir) ; void unbecome_root(BOOL restore_dir); - -/*The following definitions come from smbd/username.c */ - -char *get_home_dir(char *user); -BOOL map_username(char *user); -struct passwd *Get_Pwnam(char *user,BOOL allow_change); -BOOL user_in_list(char *user,char *list); #endif /* _PROTO_H_ */ -- cgit From 723b9d0d5b4b4ccc2852b21ebf65aab53cea862c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 9 Aug 1998 14:37:32 +0000 Subject: swat compiles, with some even uglier hacks. we really have to do something about our dependencies between seemingly unrelated code. (This used to be commit 3ecfd271de5e6f7b4868800e7c06d51ed69278fd) --- source3/include/proto.h | 131 +++++++++++++++++++++++++++++++----------------- 1 file changed, 85 insertions(+), 46 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 8af9925803..022c0a93c2 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -344,6 +344,21 @@ void cli_error(struct cli_state *cli, int *eclass, int *num); void cli_sockopt(struct cli_state *cli, char *options); int cli_setpid(struct cli_state *cli, int pid); +/*The following definitions come from libsmb/credentials.c */ + +char *credstr(uchar *cred); +void cred_session_key(DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal, char *pass, + uchar session_key[8]); +void cred_create(uchar session_key[8], DOM_CHAL *stor_cred, UTIME timestamp, + DOM_CHAL *cred); +int cred_assert(DOM_CHAL *cred, uchar session_key[8], DOM_CHAL *stored_cred, + UTIME timestamp); +BOOL clnt_deal_with_creds(uchar sess_key[8], + DOM_CRED *sto_clnt_cred, DOM_CRED *rcv_srv_cred); +BOOL deal_with_creds(uchar sess_key[8], + DOM_CRED *sto_clnt_cred, + DOM_CRED *rcv_clnt_cred, DOM_CRED *rtn_srv_cred); + /*The following definitions come from libsmb/namequery.c */ BOOL name_status(int fd,char *name,int name_type,BOOL recurse, @@ -1064,6 +1079,37 @@ uint32 pdb_gid_to_group_rid(gid_t gid); BOOL pdb_rid_is_well_known(uint32 rid); BOOL pdb_rid_is_user(uint32 rid); +/*The following definitions come from passdb/password.c */ + +void generate_next_challenge(char *challenge); +BOOL set_challenge(char *challenge); +BOOL last_challenge(unsigned char *challenge); +user_struct *get_valid_user_struct(uint16 vuid); +void invalidate_vuid(uint16 vuid); +char *validated_username(uint16 vuid); +int setup_groups(char *user, int uid, int gid, int *p_ngroups, GID_T **p_groups); +uint16 register_vuid(int uid,int gid, char *unix_name, char *requested_name, BOOL guest); +void add_session_user(char *user); +BOOL update_smbpassword_file( char *user, fstring password); +void dfs_unlogin(void); +BOOL password_check(char *password); +BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8); +BOOL smb_password_ok(struct smb_passwd *smb_pass, + uchar lm_pass[24], uchar nt_pass[24]); +BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd); +BOOL user_ok(char *user,int snum); +BOOL authorise_login(int snum,char *user,char *password, int pwlen, + BOOL *guest,BOOL *force,uint16 vuid); +BOOL check_hosts_equiv(char *user); +struct cli_state *server_client(void); +struct cli_state *server_cryptkey(void); +BOOL server_validate(char *user, char *domain, + char *pass, int passlen, + char *ntpass, int ntpasslen); +BOOL domain_client_validate( char *user, char *domain, + char *smb_apasswd, int smb_apasslen, + char *smb_ntpasswd, int smb_ntpasslen); + /*The following definitions come from passdb/smbpass.c */ struct passdb_ops *file_initialize_password_db(void); @@ -1804,21 +1850,6 @@ BOOL change_oem_password(struct smb_passwd *smbpw, char *new_passwd, BOOL overri BOOL yield_connection(int cnum,char *name,int max_connections); BOOL claim_connection(int cnum,char *name,int max_connections,BOOL Clear); -/*The following definitions come from smbd/credentials.c */ - -char *credstr(uchar *cred); -void cred_session_key(DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal, char *pass, - uchar session_key[8]); -void cred_create(uchar session_key[8], DOM_CHAL *stor_cred, UTIME timestamp, - DOM_CHAL *cred); -int cred_assert(DOM_CHAL *cred, uchar session_key[8], DOM_CHAL *stored_cred, - UTIME timestamp); -BOOL clnt_deal_with_creds(uchar sess_key[8], - DOM_CRED *sto_clnt_cred, DOM_CRED *rcv_srv_cred); -BOOL deal_with_creds(uchar sess_key[8], - DOM_CRED *sto_clnt_cred, - DOM_CRED *rcv_clnt_cred, DOM_CRED *rtn_srv_cred); - /*The following definitions come from smbd/dfree.c */ int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); @@ -1896,37 +1927,6 @@ void remove_pending_change_notify_requests_by_mid(int mid); void process_pending_change_notify_queue(time_t t); int reply_nttrans(char *inbuf,char *outbuf,int length,int bufsize); -/*The following definitions come from smbd/password.c */ - -void generate_next_challenge(char *challenge); -BOOL set_challenge(char *challenge); -BOOL last_challenge(unsigned char *challenge); -user_struct *get_valid_user_struct(uint16 vuid); -void invalidate_vuid(uint16 vuid); -char *validated_username(uint16 vuid); -int setup_groups(char *user, int uid, int gid, int *p_ngroups, GID_T **p_groups); -uint16 register_vuid(int uid,int gid, char *unix_name, char *requested_name, BOOL guest); -void add_session_user(char *user); -BOOL update_smbpassword_file( char *user, fstring password); -void dfs_unlogin(void); -BOOL password_check(char *password); -BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8); -BOOL smb_password_ok(struct smb_passwd *smb_pass, - uchar lm_pass[24], uchar nt_pass[24]); -BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd); -BOOL user_ok(char *user,int snum); -BOOL authorise_login(int snum,char *user,char *password, int pwlen, - BOOL *guest,BOOL *force,uint16 vuid); -BOOL check_hosts_equiv(char *user); -struct cli_state *server_client(void); -struct cli_state *server_cryptkey(void); -BOOL server_validate(char *user, char *domain, - char *pass, int passlen, - char *ntpass, int ntpasslen); -BOOL domain_client_validate( char *user, char *domain, - char *smb_apasswd, int smb_apasslen, - char *smb_ntpasswd, int smb_ntpasslen); - /*The following definitions come from smbd/pipes.c */ int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize); @@ -2094,4 +2094,43 @@ BOOL unbecome_user(void ); int smbrun(char *cmd,char *outfile,BOOL shared); void become_root(BOOL save_dir) ; void unbecome_root(BOOL restore_dir); + +/*The following definitions come from web/cgi.c */ + +void cgi_load_variables(FILE *f1); +char *cgi_variable(char *name); +char *cgi_vnum(int i, char **name); +int cgi_boolean(char *name, int def); +char *quotedup(char *s); +char *urlquote(char *s); +char *quotequotes(char *s); +void quote_spaces(char *buf); +void cgi_setup(char *rootdir, int auth_required); +char *cgi_baseurl(void); +char *cgi_rooturl(void); +char *cgi_pathinfo(void); +char *cgi_remote_host(void); +char *cgi_remote_addr(void); +BOOL cgi_waspost(void); + +/*The following definitions come from web/diagnose.c */ + +BOOL nmbd_running(void); +BOOL smbd_running(void); + +/*The following definitions come from web/startstop.c */ + +void start_smbd(void); +void start_nmbd(void); +void stop_smbd(void); +void stop_nmbd(void); +void kill_pid(int pid); + +/*The following definitions come from web/statuspage.c */ + +void status_page(void); + +/*The following definitions come from web/swat.c */ + +int main(int argc, char *argv[]); #endif /* _PROTO_H_ */ -- cgit From 59e2e2c7d8df317c17b860a4f924c791e8dbbca8 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 9 Aug 1998 14:58:51 +0000 Subject: a few more things compile. I'll do the rest tomorrow. (This used to be commit b92ce41c54fa187bce3287257996f7a3e9c9b9ff) --- source3/include/proto.h | 102 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 71 insertions(+), 31 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 022c0a93c2..558e17acab 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -3,6 +3,46 @@ /* This file is automatically generated with "make proto". DO NOT EDIT */ +/*The following definitions come from client/client.c */ + +void cli_smb_close(char *inbuf, char *outbuf, int clnt_fd, int c_num, int f_num); +void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(file_info *),BOOL recurse_dir, BOOL dirstoo); +void cmd_help(char *dum_in, char *dum_out); + +/*The following definitions come from client/clientutil.c */ + +void cli_setup_pkt(char *outbuf); +BOOL cli_call_api(char *pipe_name, int pipe_name_len, + int prcnt,int drcnt, int srcnt, + int mprcnt,int mdrcnt, + int *rprcnt,int *rdrcnt, + char *param,char *data, uint16 *setup, + char **rparam,char **rdata); +BOOL cli_receive_trans_response(char *inbuf,int trans, + int *data_len,int *param_len, + char **data,char **param); +BOOL cli_send_trans_request(char *outbuf,int trans, + char *name,int namelen, int fid,int flags, + char *data,char *param,uint16 *setup, + int ldata,int lparam,int lsetup, + int mdata,int mparam,int msetup); +BOOL cli_send_session_request(char *inbuf,char *outbuf); +BOOL cli_send_login(char *inbuf,char *outbuf,BOOL start_session,BOOL use_setup, struct connection_options *options); +void cli_send_logout(char *dum_in, char *dum_out); +BOOL cli_open_sockets(int port ); +BOOL cli_reopen_connection(char *inbuf,char *outbuf); + +/*The following definitions come from client/clitar.c */ + +int padit(char *buf, int bufsize, int padsize); +void cmd_block(char *dum_in, char *dum_out); +void cmd_tarmode(char *dum_in, char *dum_out); +void cmd_setmode(char *dum_in, char *dum_out); +void cmd_tar(char *inbuf, char *outbuf); +int process_tar(char *inbuf, char *outbuf); +int clipfind(char **aret, int ret, char *tok); +int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind); + /*The following definitions come from lib/charcnv.c */ char *unix2dos_format(char *str,BOOL overwrite); @@ -1079,37 +1119,6 @@ uint32 pdb_gid_to_group_rid(gid_t gid); BOOL pdb_rid_is_well_known(uint32 rid); BOOL pdb_rid_is_user(uint32 rid); -/*The following definitions come from passdb/password.c */ - -void generate_next_challenge(char *challenge); -BOOL set_challenge(char *challenge); -BOOL last_challenge(unsigned char *challenge); -user_struct *get_valid_user_struct(uint16 vuid); -void invalidate_vuid(uint16 vuid); -char *validated_username(uint16 vuid); -int setup_groups(char *user, int uid, int gid, int *p_ngroups, GID_T **p_groups); -uint16 register_vuid(int uid,int gid, char *unix_name, char *requested_name, BOOL guest); -void add_session_user(char *user); -BOOL update_smbpassword_file( char *user, fstring password); -void dfs_unlogin(void); -BOOL password_check(char *password); -BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8); -BOOL smb_password_ok(struct smb_passwd *smb_pass, - uchar lm_pass[24], uchar nt_pass[24]); -BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd); -BOOL user_ok(char *user,int snum); -BOOL authorise_login(int snum,char *user,char *password, int pwlen, - BOOL *guest,BOOL *force,uint16 vuid); -BOOL check_hosts_equiv(char *user); -struct cli_state *server_client(void); -struct cli_state *server_cryptkey(void); -BOOL server_validate(char *user, char *domain, - char *pass, int passlen, - char *ntpass, int ntpasslen); -BOOL domain_client_validate( char *user, char *domain, - char *smb_apasswd, int smb_apasslen, - char *smb_ntpasswd, int smb_ntpasslen); - /*The following definitions come from passdb/smbpass.c */ struct passdb_ops *file_initialize_password_db(void); @@ -1927,6 +1936,37 @@ void remove_pending_change_notify_requests_by_mid(int mid); void process_pending_change_notify_queue(time_t t); int reply_nttrans(char *inbuf,char *outbuf,int length,int bufsize); +/*The following definitions come from smbd/password.c */ + +void generate_next_challenge(char *challenge); +BOOL set_challenge(char *challenge); +BOOL last_challenge(unsigned char *challenge); +user_struct *get_valid_user_struct(uint16 vuid); +void invalidate_vuid(uint16 vuid); +char *validated_username(uint16 vuid); +int setup_groups(char *user, int uid, int gid, int *p_ngroups, GID_T **p_groups); +uint16 register_vuid(int uid,int gid, char *unix_name, char *requested_name, BOOL guest); +void add_session_user(char *user); +BOOL update_smbpassword_file( char *user, fstring password); +void dfs_unlogin(void); +BOOL password_check(char *password); +BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8); +BOOL smb_password_ok(struct smb_passwd *smb_pass, + uchar lm_pass[24], uchar nt_pass[24]); +BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd); +BOOL user_ok(char *user,int snum); +BOOL authorise_login(int snum,char *user,char *password, int pwlen, + BOOL *guest,BOOL *force,uint16 vuid); +BOOL check_hosts_equiv(char *user); +struct cli_state *server_client(void); +struct cli_state *server_cryptkey(void); +BOOL server_validate(char *user, char *domain, + char *pass, int passlen, + char *ntpass, int ntpasslen); +BOOL domain_client_validate( char *user, char *domain, + char *smb_apasswd, int smb_apasslen, + char *smb_ntpasswd, int smb_ntpasslen); + /*The following definitions come from smbd/pipes.c */ int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize); -- cgit From fa88efbbacbbe74b72ddb9e316265de2aab31260 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 10 Aug 1998 07:04:53 +0000 Subject: split the system password checking routines out of smbd/password.c and into passdb/pass_check.c. This means SWAT no longer needs to link to smbd/password.c (This used to be commit 90d93889d722670cbb517017531264630af759bf) --- source3/include/proto.h | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 558e17acab..d9a35aa33f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -185,6 +185,13 @@ time_t get_create_time(struct stat *st,BOOL fake_dirs); char *ufc_crypt(char *key,char *salt); +/*The following definitions come from lib/username.c */ + +char *get_home_dir(char *user); +BOOL map_username(char *user); +struct passwd *Get_Pwnam(char *user,BOOL allow_change); +BOOL user_in_list(char *user,char *list); + /*The following definitions come from lib/util.c */ char *tmpdir(void); @@ -1067,6 +1074,12 @@ BOOL pm_process( char *FileName, BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); void pcap_printer_fn(void (*fn)(char *, char *)); +/*The following definitions come from passdb/pass_check.c */ + +void dfs_unlogin(void); +BOOL pass_check(char *user,char *password, int pwlen, struct passwd *pwd, + BOOL (*fn)(char *, char *)); + /*The following definitions come from passdb/passdb.c */ BOOL initialize_password_db(void); @@ -1134,13 +1147,6 @@ BOOL trust_password_delete( char *domain, char *name ); BOOL get_trust_account_password( unsigned char *ret_pwd, time_t *pass_last_set_time); BOOL set_trust_account_password( unsigned char *md4_new_pwd); -/*The following definitions come from passdb/username.c */ - -char *get_home_dir(char *user); -BOOL map_username(char *user); -struct passwd *Get_Pwnam(char *user,BOOL allow_change); -BOOL user_in_list(char *user,char *list); - /*The following definitions come from rpc_client/cli_login.c */ BOOL cli_nt_setup_creds(struct cli_state *cli, unsigned char mach_pwd[16]); @@ -1947,9 +1953,7 @@ char *validated_username(uint16 vuid); int setup_groups(char *user, int uid, int gid, int *p_ngroups, GID_T **p_groups); uint16 register_vuid(int uid,int gid, char *unix_name, char *requested_name, BOOL guest); void add_session_user(char *user); -BOOL update_smbpassword_file( char *user, fstring password); -void dfs_unlogin(void); -BOOL password_check(char *password); +BOOL update_smbpassword_file(char *user, char *password); BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8); BOOL smb_password_ok(struct smb_passwd *smb_pass, uchar lm_pass[24], uchar nt_pass[24]); -- cgit From 670c6addc322e69b86975fc4024c88a885b63d9f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 10 Aug 1998 07:29:57 +0000 Subject: moved access.c into lib/ from smbd/ as it is needed by testparm. I modified it not to need any smbd specific structures and instead pass things from smbd. (This used to be commit 162141d3b3fcf53fbc6a1f18702df85c2b7f1781) --- source3/include/proto.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index d9a35aa33f..e3189a2d08 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1844,8 +1844,9 @@ BOOL api_wkssvc_rpc(pipes_struct *p, prs_struct *data); /*The following definitions come from smbd/access.c */ -BOOL check_access(int snum); -BOOL allow_access(char *deny_list,char *allow_list,char *cname,char *caddr); +BOOL allow_access(char *deny_list,char *allow_list, + char *cname,char *caddr); +BOOL check_access(int sock, char *allow_list, char *deny_list); /*The following definitions come from smbd/chgpasswd.c */ -- cgit From 17fb3a2304d3f9eaa314c90b476d153b5f333f31 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 10 Aug 1998 20:12:53 +0000 Subject: Makefile.in: Fixed make clean bug with CVS directory in bin/. include/smb.h: Fixed bugs in Debug macro's with SGI compiler. smbd/trans2.c: Fixed bug reported by Zoltan Palmai PR#8903 where get_lanman2_dir_entry() could return a mangled name as a resume key and call_trans2findnext() wasn't doing the same. Jeremy. (This used to be commit 9d010e721c27af1d9498fd1e147993ba8ac8b41e) --- source3/include/smb.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index f8a055ad48..bc44fbdd2b 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -144,10 +144,10 @@ BOOL dbgtext(); #define DEBUG( level, body ) \ ((DEBUGLEVEL>=(level) && \ dbghdr(level, FILE_MACRO, FUNCTION_MACRO, (__LINE__)))? \ - (void)dbgtext body:0) + (void)(dbgtext body) : (void)0) #define DEBUGADD( level, body ) \ - (DEBUGLEVEL>=(level)?(void)dbgtext body:0); + (DEBUGLEVEL>=(level)?(void)(dbgtext body) : (void)0); /* End Debugging code section. * -------------------------------------------------------------------------- ** -- cgit From 9042aa41c3c54e8dce600338cd4b796b65aaf066 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 11 Aug 1998 02:13:01 +0000 Subject: Makefile.in: Added CHECK target back in (at Herb's request). Added manpath in (although we don't currently use it). client/client.c: Added John Blair's fixes for "put -". include/nterr.h: Added NT_STATUS_NOTIFY_ENUM_DIR error code. smbd/nttrans.c: Added in devious fix for one-shot NT change notify bug. Jeremy. (This used to be commit 4ac3091e57e9ab234b3c051333ba521a92defa99) --- source3/include/nterr.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/nterr.h b/source3/include/nterr.h index 643d93bc93..a94464a013 100644 --- a/source3/include/nterr.h +++ b/source3/include/nterr.h @@ -504,3 +504,4 @@ #define NT_STATUS_TOO_MANY_LINKS (613) #define NT_STATUS_QUOTA_LIST_INCONSISTENT (614) #define NT_STATUS_FILE_IS_OFFLINE (615) +#define NT_STATUS_NOTIFY_ENUM_DIR (0x10C) -- cgit From 7938e492bad71dc9a1d7618cf31c02d663a3fab0 Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Tue, 11 Aug 1998 15:54:15 +0000 Subject: Removed a stray semicolon in the DEBUGADD() macro. (This used to be commit efa67d6b2b6d4a1e007dba5f2f5da5aff723fe59) --- source3/include/smb.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index bc44fbdd2b..5d408719ae 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -138,16 +138,16 @@ BOOL dbgtext(); * DEBUGADD( 2, ("Some additional text.\n") ); */ #define DEBUGLVL( level ) \ - ( (DEBUGLEVEL>=(level)) \ + ( (DEBUGLEVEL >= (level)) \ && dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) ) ) #define DEBUG( level, body ) \ - ((DEBUGLEVEL>=(level) && \ - dbghdr(level, FILE_MACRO, FUNCTION_MACRO, (__LINE__)))? \ - (void)(dbgtext body) : (void)0) + ( ( DEBUGLEVEL >= (level) \ + && dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) ) ) \ + ? (void)(dbgtext body) : (void)0 ) #define DEBUGADD( level, body ) \ - (DEBUGLEVEL>=(level)?(void)(dbgtext body) : (void)0); + ( (DEBUGLEVEL >= (level)) ? (void)(dbgtext body) : (void)0 ) /* End Debugging code section. * -------------------------------------------------------------------------- ** -- cgit From a0082c340a2c577e8ecec8c1e0fefc2765af90dc Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Tue, 11 Aug 1998 18:56:03 +0000 Subject: I've come up with a different scheme for doing the DEBUG() and DEBUGADD() macros that meets the RVALUE requirement and doesn't use the (a?b:c) format that Andrew called "ugly". I've added the new macros but kept the old macros within a #if 0..#else..#endif block in case I've missed somthing. Basically, I've used (void)( (a) && (b) ) or (void)( (a) && (b) && (c) ) instead of ( (a) ? (void)(b) : (void)(c) ) or similar. I have this compiled and running now. Here's the diff: $ cvs diff smb.h Enter passphrase for RSA key 'crh@Ruby': Index: smb.h =================================================================== RCS file: /data/cvs/samba/source/include/smb.h,v retrieving revision 1.172 diff -r1.172 smb.h 143a144,145 > #if 0 > 150a153,164 > > #else > > #define DEBUG( level, body ) \ > (void)( (DEBUGLEVEL >= (level)) \ > && (dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) )) \ > && (dbgtext body) ) > > #define DEBUGADD( level, body ) \ > (void)( (DEBUGLEVEL >= (level)) && (dbgtext body) ) > > #endif Chris -)----- (This used to be commit 53b433e6ab9fd69a02016ee4f2a3f756640ea565) --- source3/include/smb.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 5d408719ae..69f98dfdee 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -141,6 +141,8 @@ BOOL dbgtext(); ( (DEBUGLEVEL >= (level)) \ && dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) ) ) +#if 0 + #define DEBUG( level, body ) \ ( ( DEBUGLEVEL >= (level) \ && dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) ) ) \ @@ -149,6 +151,18 @@ BOOL dbgtext(); #define DEBUGADD( level, body ) \ ( (DEBUGLEVEL >= (level)) ? (void)(dbgtext body) : (void)0 ) +#else + +#define DEBUG( level, body ) \ + (void)( (DEBUGLEVEL >= (level)) \ + && (dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) )) \ + && (dbgtext body) ) + +#define DEBUGADD( level, body ) \ + (void)( (DEBUGLEVEL >= (level)) && (dbgtext body) ) + +#endif + /* End Debugging code section. * -------------------------------------------------------------------------- ** */ -- cgit From b1778b6b57401d78fb4352992fde54706af6b75f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 11 Aug 1998 23:28:35 +0000 Subject: include/smb.h: Removed dir_ptr. Not needed. locking/locking.c: First cut a blocking lock code. #ifdef'ed out for now. locking/locking_shm.c: Removed dir_ptr. Not needed. smbd/nttrans.c: More work on ChangeNotify - return is not an error and needs to be handled as a nttrans with zero params. Removed dir_ptr. Not needed. smbd/reply.c: smbd/server.c: smbd/trans2.c: Removed dir_ptr. Not needed. Hmmm. At the moment smbclient is broken - doesn't issue prompt correctly. This needs looking at. Jeremy. (This used to be commit ddfbcc05815621d3c463f92faed047f126412342) --- source3/include/smb.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 69f98dfdee..bbd404b217 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -518,10 +518,7 @@ typedef struct typedef struct { int cnum; - union { - file_fd_struct *fd_ptr; - dir_status_struct *dir_ptr; - } f_u; + file_fd_struct *fd_ptr; int pos; uint32 size; int mode; -- cgit From 5a5b4258ed51cc3dabe7a017fa2e3a538ef99d7d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 13 Aug 1998 16:20:37 +0000 Subject: HAVE_STATVFS should be STAT_STAVFS (caused printing to break on IRIX). Jeremy. (This used to be commit 83c54b01ba6c891a0587a80aa083594ddda9a680) --- source3/include/includes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index a4547a6b4a..20eb850cd1 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -346,7 +346,7 @@ extern int errno; #endif /* this guess needs to be improved (tridge) */ -#if defined(HAVE_STATVFS) && !defined(SYSV) +#if defined(STAT_STATVFS) && !defined(SYSV) #define SYSV 1 #endif -- cgit From c629b4c53f2523585e6b05de9589ae73ebe99e78 Mon Sep 17 00:00:00 2001 From: John Blair Date: Thu, 13 Aug 1998 18:56:09 +0000 Subject: Added the APPLEDOUBLE macro for the name of the directory containing a file's Macintosh resource fork (normally .AppleDouble under Netatalk). (This used to be commit 1313451f2161f69d33e7f1d41a1bf5615f61014c) --- source3/include/local.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index 2350c00211..fb67babcda 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -187,4 +187,7 @@ it are worked out */ #define USE_READ_PREDICTION 0 +/* name of directory that netatalk uses to store macintosh resource forks */ +#define APPLEDOUBLE ".AppleDouble/" + #endif -- cgit From 3cf6cc6134960c99adb702b21394a4a607cfe30a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 14 Aug 1998 02:02:40 +0000 Subject: Makefile.in: Changed so that make proto will work with ldap & nisplus. locking/locking.c: Made #ifdef'ed out functions static for Make proto. lib/util.c: Re-instated old mask_match code for UNIX filesystem checks only. Client calls use the new mask_match code. Changed the name of the old function to unix_mask_match. Jeremy. (This used to be commit b68e756ff57622c6c74f28031d4be964d7b1c9bc) --- source3/include/proto.h | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index e3189a2d08..e310246a87 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -43,6 +43,12 @@ int process_tar(char *inbuf, char *outbuf); int clipfind(char **aret, int ret, char *tok); int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind); +/*The following definitions come from lib/access.c */ + +BOOL allow_access(char *deny_list,char *allow_list, + char *cname,char *caddr); +BOOL check_access(int sock, char *allow_list, char *deny_list); + /*The following definitions come from lib/charcnv.c */ char *unix2dos_format(char *str,BOOL overwrite); @@ -62,6 +68,7 @@ int sig_usr1( void ); void setup_logging( char *pname, BOOL interactive ); void reopen_logs( void ); void force_check_log_size( void ); +void dbgflush( void ); BOOL dbghdr( int level, char *file, char *func, int line ); /*The following definitions come from lib/fault.c */ @@ -459,6 +466,8 @@ char *smb_errstr(char *inbuf); /*The following definitions come from locking/locking.c */ +BOOL push_blocking_lock_request( char *inbuf, int length, int lock_timeout, int lock_num); +void process_blocking_lock_queue(time_t t); BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset, int lock_type); BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int lock_type, int *eclass,uint32 *ecode); @@ -1074,6 +1083,14 @@ BOOL pm_process( char *FileName, BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); void pcap_printer_fn(void (*fn)(char *, char *)); +/*The following definitions come from passdb/ldap.c */ + +struct passdb_ops *ldap_initialize_password_db(void); + +/*The following definitions come from passdb/nispass.c */ + +struct passdb_ops *nisplus_initialize_password_db(void); + /*The following definitions come from passdb/pass_check.c */ void dfs_unlogin(void); @@ -1842,12 +1859,6 @@ uint32 lookup_user_rid(char *user_name, uint32 *rid); BOOL api_wkssvc_rpc(pipes_struct *p, prs_struct *data); -/*The following definitions come from smbd/access.c */ - -BOOL allow_access(char *deny_list,char *allow_list, - char *cname,char *caddr); -BOOL check_access(int sock, char *allow_list, char *deny_list); - /*The following definitions come from smbd/chgpasswd.c */ BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence, BOOL as_root); @@ -1908,10 +1919,6 @@ void map_gid_to_sid( gid_t gid, DOM_SID *psid); int get_printerdrivernumber(int snum); int reply_trans(char *inbuf,char *outbuf, int size, int bufsize); -/*The following definitions come from smbd/ldap.c */ - -struct passdb_ops *ldap_initialize_password_db(void); - /*The following definitions come from smbd/mangle.c */ BOOL is_mangled( char *s ); @@ -1929,10 +1936,6 @@ int reply_sendstrt(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); int reply_sendtxt(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); int reply_sendend(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -/*The following definitions come from smbd/nispass.c */ - -struct passdb_ops *nisplus_initialize_password_db(void); - /*The following definitions come from smbd/nttrans.c */ int reply_ntcreate_and_X(char *inbuf,char *outbuf,int length,int bufsize); -- cgit From 2bb8f8ce4385336083caf353e5ac11e11457e6f8 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 14 Aug 1998 06:25:26 +0000 Subject: define INADDR_NONE if not already defined (This used to be commit 7446540017e29827900981cab5ae3a2f9f7b3ce6) --- source3/include/includes.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 20eb850cd1..a65114f3de 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -428,6 +428,10 @@ union semun { #define INADDR_LOOPBACK 0x7f000001 #endif +#ifndef INADDR_NONE +#define INADDR_NONE 0xffffffff +#endif + #ifndef HAVE_CRYPT #define crypt ufc_crypt #endif -- cgit From b9623ab59e813131b1ed3f51616a46e719d59c21 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 14 Aug 1998 17:38:29 +0000 Subject: this is the bug change to using connection_struct* instead of cnum. Connections[] is now a local array in server.c I might have broken something with this change. In particular the oplock code is suspect and some .dll files aren't being oplocked when I expected them to be. I'll look at it after I've got some sleep. (This used to be commit c7ee025ead4a85b6fa44a832047b878451845fb6) --- source3/include/config.h.in | 2 + source3/include/includes.h | 6 ++ source3/include/ntdomain.h | 3 +- source3/include/proto.h | 245 +++++++++++++++++++++++++------------------- source3/include/smb.h | 184 ++++++++++++++++++--------------- 5 files changed, 251 insertions(+), 189 deletions(-) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index b73ee04e77..ced68aa762 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -109,6 +109,8 @@ #undef REPLACE_INET_NTOA #undef HAVE_FILE_MACRO #undef HAVE_FUNCTION_MACRO +#undef HAVE_SETRESUID_DECL +#undef WITH_NETATALK /* The number of bytes in a int. */ #undef SIZEOF_INT diff --git a/source3/include/includes.h b/source3/include/includes.h index a65114f3de..237251209a 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -464,4 +464,10 @@ time_t mktime(struct tm *t); int ftruncate(int f,long l); #endif +#if (defined(HAVE_SETRESUID) && !defined(HAVE_SETRESUID_DECL)) +/* stupid glibc */ +int setresuid(uid_t ruid, uid_t euid, uid_t suid); +int setresgid(gid_t rgid, gid_t egid, gid_t sgid); +#endif + #endif /* _INCLUDES_H */ diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index 50f9397012..0b2648372b 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -55,7 +55,7 @@ typedef struct typedef struct { - int cnum; + connection_struct *conn; int uid; BOOL open; /* open connection */ uint16 device_state; @@ -79,7 +79,6 @@ typedef struct uint32 hdr_offsets; uint32 frag_len_left; uint32 next_frag_start; - } pipes_struct; struct acct_info diff --git a/source3/include/proto.h b/source3/include/proto.h index e310246a87..1cab9c5e9d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -148,6 +148,10 @@ void CatchChild(void); int vslprintf(char *str, int n, char *format, va_list ap); +/*The following definitions come from lib/smbrun.c */ + +int smbrun(char *cmd,char *outfile,BOOL shared); + /*The following definitions come from lib/system.c */ int sys_select(fd_set *fds,struct timeval *tval); @@ -308,6 +312,7 @@ char *client_addr(int fd); char *automount_server(char *user_name); char *automount_path(char *user_name); void standard_sub_basic(char *str); +void standard_sub(connection_struct *conn,char *str); BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask); int PutUniCode(char *dst,char *src); struct hostent *Get_Hostbyname(char *name); @@ -342,6 +347,7 @@ void dump_data(int level,char *buf1,int len); char *tab_depth(int depth); char *sid_to_string(pstring sidstr_out, DOM_SID *sid); BOOL string_to_sid(DOM_SID *sidout, char *sidstr); +int str_checksum(char *s); /*The following definitions come from libsmb/clientgen.c */ @@ -468,15 +474,21 @@ char *smb_errstr(char *inbuf); BOOL push_blocking_lock_request( char *inbuf, int length, int lock_timeout, int lock_num); void process_blocking_lock_queue(time_t t); -BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset, int lock_type); -BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int lock_type, +BOOL is_locked(int fnum,connection_struct *conn, + uint32 count,uint32 offset, int lock_type); +BOOL do_lock(int fnum,connection_struct *conn, + uint32 count,uint32 offset,int lock_type, int *eclass,uint32 *ecode); -BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); +BOOL do_unlock(int fnum,connection_struct *conn, + uint32 count,uint32 offset,int *eclass,uint32 *ecode); BOOL locking_init(int read_only); BOOL locking_end(void); -BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, int *ptok); -BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, int token); -int get_share_modes(int cnum, int token, uint32 dev, uint32 inode, +BOOL lock_share_entry(connection_struct *conn, + uint32 dev, uint32 inode, int *ptok); +BOOL unlock_share_entry(connection_struct *conn, + uint32 dev, uint32 inode, int token); +int get_share_modes(connection_struct *conn, + int token, uint32 dev, uint32 inode, share_mode_entry **shares); void del_share_mode(int token, int fnum); BOOL set_share_mode(int token, int fnum, uint16 port, uint16 op_type); @@ -1057,6 +1069,7 @@ BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue); BOOL lp_is_default(int snum, struct parm_struct *parm); struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters); BOOL lp_snum_ok(int iService); +void lp_add_one_printer(char *name,char *comment); BOOL lp_loaded(void); void lp_killunused(BOOL (*snumused)(int )); BOOL lp_load(char *pszFname,BOOL global_only, BOOL save_defaults, BOOL add_ipc); @@ -1819,12 +1832,12 @@ BOOL api_netlog_rpc(pipes_struct *p, prs_struct *data); void reset_chain_pnum(void); void set_chain_pnum(int new_pnum); void init_rpc_pipe_hnd(void); -int open_rpc_pipe_hnd(char *pipe_name, int cnum, uint16 vuid); +int open_rpc_pipe_hnd(char *pipe_name, connection_struct *conn, uint16 vuid); int read_pipe(uint16 pnum, char *data, uint32 pos, int n); BOOL get_rpc_pipe(int pnum, pipes_struct **p); char *get_rpc_pipe_hnd_name(int pnum); BOOL set_rpc_pipe_hnd_state(pipes_struct *p, uint16 device_state); -BOOL close_rpc_pipe_hnd(int pnum, int cnum); +BOOL close_rpc_pipe_hnd(int pnum, connection_struct *conn); int get_rpc_pipe_num(char *buf, int where); /*The following definitions come from rpc_server/srv_reg.c */ @@ -1874,8 +1887,8 @@ BOOL change_oem_password(struct smb_passwd *smbpw, char *new_passwd, BOOL overri /*The following definitions come from smbd/connection.c */ -BOOL yield_connection(int cnum,char *name,int max_connections); -BOOL claim_connection(int cnum,char *name,int max_connections,BOOL Clear); +BOOL yield_connection(connection_struct *conn,char *name,int max_connections); +BOOL claim_connection(connection_struct *conn,char *name,int max_connections,BOOL Clear); /*The following definitions come from smbd/dfree.c */ @@ -1890,17 +1903,17 @@ BOOL dptr_set_wcard(int key, char *wcard); BOOL dptr_set_attr(int key, uint16 attr); uint16 dptr_attr(int key); void dptr_close(int key); -void dptr_closecnum(int cnum); -void dptr_idlecnum(int cnum); +void dptr_closecnum(connection_struct *conn); +void dptr_idlecnum(connection_struct *conn); void dptr_closepath(char *path,int pid); -int dptr_create(int cnum,char *path, BOOL expect_close,int pid); +int dptr_create(connection_struct *conn,char *path, BOOL expect_close,int pid); BOOL dptr_fill(char *buf1,unsigned int key); BOOL dptr_zero(char *buf); void *dptr_fetch(char *buf,int *num); void *dptr_fetch_lanman2(int dptr_num); -BOOL dir_check_ftype(int cnum,int mode,struct stat *st,int dirtype); -BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend); -void *OpenDir(int cnum, char *name, BOOL use_veto); +BOOL dir_check_ftype(connection_struct *conn,int mode,struct stat *st,int dirtype); +BOOL get_dir_entry(connection_struct *conn,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend); +void *OpenDir(connection_struct *conn, char *name, BOOL use_veto); void CloseDir(void *p); char *ReadDirName(void *p); BOOL SeekDir(void *p,int pos); @@ -1917,13 +1930,12 @@ void map_gid_to_sid( gid_t gid, DOM_SID *psid); /*The following definitions come from smbd/ipc.c */ int get_printerdrivernumber(int snum); -int reply_trans(char *inbuf,char *outbuf, int size, int bufsize); +int reply_trans(connection_struct *conn, char *inbuf,char *outbuf, int size, int bufsize); /*The following definitions come from smbd/mangle.c */ BOOL is_mangled( char *s ); BOOL is_8_3( char *fname, BOOL check_case ); -int str_checksum( char *s ); void reset_mangled_cache( void ); BOOL check_mangled_cache( char *s ); void mangle_name_83( char *s, int s_len ); @@ -1931,20 +1943,28 @@ BOOL name_map_mangle( char *OutName, BOOL need83, int snum ); /*The following definitions come from smbd/message.c */ -int reply_sends(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_sendstrt(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_sendtxt(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_sendend(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_sends(connection_struct *conn, + char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_sendstrt(connection_struct *conn, + char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_sendtxt(connection_struct *conn, + char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_sendend(connection_struct *conn, + char *inbuf,char *outbuf, int dum_size, int dum_buffsize); /*The following definitions come from smbd/nttrans.c */ -int reply_ntcreate_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_ntcancel(char *inbuf,char *outbuf,int length,int bufsize); -int reply_nttranss(char *inbuf,char *outbuf,int length,int bufsize); +int reply_ntcreate_and_X(connection_struct *conn, + char *inbuf,char *outbuf,int length,int bufsize); +int reply_ntcancel(connection_struct *conn, + char *inbuf,char *outbuf,int length,int bufsize); +int reply_nttranss(connection_struct *conn, + char *inbuf,char *outbuf,int length,int bufsize); void remove_pending_change_notify_requests_by_fid(int fnum); void remove_pending_change_notify_requests_by_mid(int mid); void process_pending_change_notify_queue(time_t t); -int reply_nttrans(char *inbuf,char *outbuf,int length,int bufsize); +int reply_nttrans(connection_struct *conn, + char *inbuf,char *outbuf,int length,int bufsize); /*The following definitions come from smbd/password.c */ @@ -1977,9 +1997,10 @@ BOOL domain_client_validate( char *user, char *domain, /*The following definitions come from smbd/pipes.c */ -int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_open_pipe_and_X(connection_struct *conn, + char *inbuf,char *outbuf,int length,int bufsize); int reply_pipe_read_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_pipe_close(char *inbuf,char *outbuf); +int reply_pipe_close(connection_struct *conn, char *inbuf,char *outbuf); /*The following definitions come from smbd/predict.c */ @@ -1995,14 +2016,16 @@ int sysv_printername_ok(char *name); /*The following definitions come from smbd/printing.c */ void lpq_reset(int snum); -void print_file(int fnum); -int get_printqueue(int snum,int cnum,print_queue_struct **queue, +void print_file(connection_struct *conn, files_struct *file); +int get_printqueue(int snum, + connection_struct *conn,print_queue_struct **queue, print_status_struct *status); -void del_printqueue(int cnum,int snum,int jobid); -void status_printjob(int cnum,int snum,int jobid,int status); +void del_printqueue(connection_struct *conn,int snum,int jobid); +void status_printjob(connection_struct *conn,int snum,int jobid,int status); int printjob_encode(int snum, int job); void printjob_decode(int jobid, int *snum, int *job); -void status_printqueue(int cnum,int snum,int status); +void status_printqueue(connection_struct *conn,int snum,int status); +void load_printers(void); /*The following definitions come from smbd/quotas.c */ @@ -2016,81 +2039,95 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); /*The following definitions come from smbd/reply.c */ int reply_special(char *inbuf,char *outbuf); -int reply_tcon(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize); +int reply_tcon(connection_struct *conn, + char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize); int reply_unknown(char *inbuf,char *outbuf); -int reply_ioctl(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_chkpth(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_getatr(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_setatr(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_dskattr(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_search(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_fclose(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_open(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_open_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_ulogoffX(char *inbuf,char *outbuf,int length,int bufsize); -int reply_mknew(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_ctemp(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_unlink(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_readbraw(char *inbuf, char *outbuf, int dum_size, int dum_buffsize); -int reply_lockread(char *inbuf,char *outbuf, int dum_size, int dum_buffsiz); -int reply_read(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_read_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_writebraw(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_writeunlock(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_write(char *inbuf,char *outbuf,int dum_size,int dum_buffsize); -int reply_write_and_X(char *inbuf,char *outbuf,int length,int bufsize); -int reply_lseek(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_flush(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_exit(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_close(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_writeclose(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_lock(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_unlock(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_tdis(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_echo(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_printopen(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_printclose(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_printqueue(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_printwrite(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_mkdir(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_rmdir(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int rename_internals(char *inbuf, char *outbuf, char *name, char *newname, BOOL replace_if_exists); -int reply_mv(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_copy(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_setdir(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_lockingX(char *inbuf,char *outbuf,int length,int bufsize); -int reply_readbmpx(char *inbuf,char *outbuf,int length,int bufsize); -int reply_writebmpx(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_writebs(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_setattrE(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -int reply_getattrE(char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_ioctl(connection_struct *conn, + char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize); +int reply_chkpth(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_getatr(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_setatr(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_dskattr(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_search(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_fclose(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_open(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_open_and_X(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize); +int reply_ulogoffX(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize); +int reply_mknew(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_ctemp(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_unlink(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_readbraw(connection_struct *conn, char *inbuf, char *outbuf, int dum_size, int dum_buffsize); +int reply_lockread(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsiz); +int reply_read(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_read_and_X(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize); +int reply_writebraw(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_writeunlock(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_write(connection_struct *conn, char *inbuf,char *outbuf,int dum_size,int dum_buffsize); +int reply_write_and_X(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize); +int reply_lseek(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_flush(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_exit(connection_struct *conn, + char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_close(connection_struct *conn, + char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_writeclose(connection_struct *conn, + char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_lock(connection_struct *conn, + char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_unlock(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_tdis(connection_struct *conn, + char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_echo(connection_struct *conn, + char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_printopen(connection_struct *conn, + char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_printclose(connection_struct *conn, + char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_printqueue(connection_struct *conn, + char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_printwrite(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_mkdir(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_rmdir(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int rename_internals(connection_struct *conn, + char *inbuf, char *outbuf, char *name, + char *newname, BOOL replace_if_exists); +int reply_mv(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_copy(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_setdir(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_lockingX(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize); +int reply_readbmpx(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize); +int reply_writebmpx(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_writebs(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_setattrE(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +int reply_getattrE(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); /*The following definitions come from smbd/server.c */ void *dflt_sig(void); void killkids(void); -mode_t unix_mode(int cnum,int dosmode); -int dos_mode(int cnum,char *path,struct stat *sbuf); -int dos_chmod(int cnum,char *fname,int dosmode,struct stat *st); -int file_utime(int cnum, char *fname, struct utimbuf *times); -BOOL set_filetime(int cnum, char *fname, time_t mtime); -BOOL unix_convert(char *name,int cnum,pstring saved_last_component, BOOL *bad_path); -BOOL check_name(char *name,int cnum); -void sync_file(int cnum, int fnum); +mode_t unix_mode(connection_struct *conn,int dosmode); +int dos_mode(connection_struct *conn,char *path,struct stat *sbuf); +int dos_chmod(connection_struct *conn,char *fname,int dosmode,struct stat *st); +int file_utime(connection_struct *conn, char *fname, struct utimbuf *times); +BOOL set_filetime(connection_struct *conn, char *fname, time_t mtime); +BOOL unix_convert(char *name,connection_struct *conn,char *saved_last_component, BOOL *bad_path); +BOOL check_name(char *name,connection_struct *conn); +void sync_file(connection_struct *conn, int fnum); void close_file(int fnum, BOOL normal_close); void close_directory(int fnum); -int open_directory(int fnum,int cnum,char *fname, int smb_ofun, int unixmode, int *action); -BOOL check_file_sharing(int cnum,char *fname, BOOL rename_op); +int open_directory(int fnum,connection_struct *conn, + char *fname, int smb_ofun, int unixmode, int *action); +BOOL check_file_sharing(connection_struct *conn,char *fname, BOOL rename_op); int check_share_mode( share_mode_entry *share, int deny_mode, char *fname, BOOL fcbopen, int *flags); -void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun, +void open_file_shared(int fnum,connection_struct *conn,char *fname,int share_mode,int ofun, int mode,int oplock_request, int *Access,int *action); int seek_file(int fnum,uint32 pos); int read_file(int fnum,char *data,uint32 pos,int n); int write_file(int fnum,char *data,int n); -BOOL become_service(int cnum,BOOL do_chdir); +BOOL become_service(connection_struct *conn,BOOL do_chdir); int find_service(char *service); int cached_error_packet(char *inbuf,char *outbuf,int fnum,int line); int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line); @@ -2101,16 +2138,15 @@ BOOL request_oplock_break(share_mode_entry *share_entry, BOOL receive_next_smb(int smbfd, int oplockfd, char *inbuf, int bufsize, int timeout); BOOL snum_used(int snum); BOOL reload_services(BOOL test); -int make_connection(char *service,char *user,char *password, int pwlen, char *dev,uint16 vuid); +connection_struct *make_connection(char *service,char *user,char *password, int pwlen, char *dev,uint16 vuid, int *ecode); int find_free_file(void ); int reply_corep(char *outbuf); int reply_coreplus(char *outbuf); int reply_lanman1(char *outbuf); int reply_lanman2(char *outbuf); int reply_nt1(char *outbuf); -void close_cnum(int cnum, uint16 vuid); +void close_cnum(connection_struct *conn, uint16 vuid); void exit_server(char *reason); -void standard_sub(int cnum,char *str); char *smb_fn_name(int type); int chain_reply(char *inbuf,char *outbuf,int size,int bufsize); void construct_reply_common(char *inbuf,char *outbuf); @@ -2128,18 +2164,21 @@ int sslutil_negotiate_ssl(int fd, int msg_type); /*The following definitions come from smbd/trans2.c */ void mask_convert( char *mask); -int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize); -int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize); -int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize); -int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize); +int reply_findclose(connection_struct *conn, + char *inbuf,char *outbuf,int length,int bufsize); +int reply_findnclose(connection_struct *conn, + char *inbuf,char *outbuf,int length,int bufsize); +int reply_transs2(connection_struct *conn, + char *inbuf,char *outbuf,int length,int bufsize); +int reply_trans2(connection_struct *conn, + char *inbuf,char *outbuf,int length,int bufsize); /*The following definitions come from smbd/uid.c */ void init_uid(void); BOOL become_guest(void); -BOOL become_user(connection_struct *conn, int cnum, uint16 vuid); +BOOL become_user(connection_struct *conn, uint16 vuid); BOOL unbecome_user(void ); -int smbrun(char *cmd,char *outfile,BOOL shared); void become_root(BOOL save_dir) ; void unbecome_root(BOOL restore_dir); diff --git a/source3/include/smb.h b/source3/include/smb.h index bbd404b217..b060134d8e 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -98,9 +98,20 @@ typedef unsigned short uint16; * the #ifdef directive and will read both definitions, thus creating two * diffferent prototype declarations), so we must do these by hand. */ +/* I know the __attribute__ stuff is ugly, but it does ensure we get the + arguemnts to DEBUG() right. We have got them wrong too often in the + past */ #ifdef HAVE_STDARG_H -int Debug1( char *, ... ); -BOOL dbgtext( char *, ... ); +int Debug1( char *, ... ) +#ifdef __GNUC__ + __attribute__ ((format (printf, 1, 2))) +#endif +; +BOOL dbgtext( char *, ... ) +#ifdef __GNUC__ + __attribute__ ((format (printf, 1, 2))) +#endif +; #else int Debug1(); BOOL dbgtext(); @@ -451,14 +462,6 @@ struct cli_state { }; -struct current_user -{ - int cnum, vuid; - int uid, gid; - int ngroups; - GID_T *groups; -}; - typedef struct { int size; @@ -515,32 +518,6 @@ typedef struct time_t status_time; } dir_status_struct; -typedef struct -{ - int cnum; - file_fd_struct *fd_ptr; - int pos; - uint32 size; - int mode; - int vuid; - char *mmap_ptr; - uint32 mmap_size; - write_bmpx_struct *wbmpx_ptr; - struct timeval open_time; - BOOL open; - BOOL can_lock; - BOOL can_read; - BOOL can_write; - BOOL share_mode; - BOOL print_file; - BOOL modified; - BOOL granted_oplock; - BOOL sent_oplock_break; - BOOL is_directory; - BOOL reserved; - char *name; -} files_struct; - struct uid_cache { int entries; int list[UID_CACHE_SIZE]; @@ -554,38 +531,74 @@ typedef struct typedef struct { - int service; - BOOL force_user; - struct uid_cache uid_cache; - void *dirptr; - BOOL open; - BOOL printer; - BOOL ipc; - BOOL read_only; - BOOL admin_user; - char *dirpath; - char *connectpath; - char *origpath; - char *user; /* name of user who *opened* this connection */ - int uid; /* uid of user who *opened* this connection */ - int gid; /* gid of user who *opened* this connection */ - - uint16 vuid; /* vuid of user who *opened* this connection, or UID_FIELD_INVALID */ - - /* following groups stuff added by ih */ + unsigned cnum; /* an index passed over the wire */ + int service; + BOOL force_user; + struct uid_cache uid_cache; + void *dirptr; + BOOL open; + BOOL printer; + BOOL ipc; + BOOL read_only; + BOOL admin_user; + char *dirpath; + char *connectpath; + char *origpath; + char *user; /* name of user who *opened* this connection */ + int uid; /* uid of user who *opened* this connection */ + int gid; /* gid of user who *opened* this connection */ + + uint16 vuid; /* vuid of user who *opened* this connection, or UID_FIELD_INVALID */ + + /* following groups stuff added by ih */ + + /* This groups info is valid for the user that *opened* the connection */ + int ngroups; + GID_T *groups; + + time_t lastused; + BOOL used; + int num_files_open; + name_compare_entry *hide_list; /* Per-share list of files to return as hidden. */ + name_compare_entry *veto_list; /* Per-share list of files to veto (never show). */ + name_compare_entry *veto_oplock_list; /* Per-share list of files to refuse oplocks on. */ +} connection_struct; - /* This groups info is valid for the user that *opened* the connection */ - int ngroups; - GID_T *groups; +struct current_user +{ + connection_struct *conn; + int vuid; + int uid, gid; + int ngroups; + GID_T *groups; +}; - time_t lastused; - BOOL used; - int num_files_open; - name_compare_entry *hide_list; /* Per-share list of files to return as hidden. */ - name_compare_entry *veto_list; /* Per-share list of files to veto (never show). */ - name_compare_entry *veto_oplock_list; /* Per-share list of files to refuse oplocks on. */ +typedef struct +{ + connection_struct *conn; + file_fd_struct *fd_ptr; + int pos; + uint32 size; + int mode; + int vuid; + char *mmap_ptr; + uint32 mmap_size; + write_bmpx_struct *wbmpx_ptr; + struct timeval open_time; + BOOL open; + BOOL can_lock; + BOOL can_read; + BOOL can_write; + BOOL share_mode; + BOOL print_file; + BOOL modified; + BOOL granted_oplock; + BOOL sent_oplock_break; + BOOL is_directory; + BOOL reserved; + char *fsp_name; +} files_struct; -} connection_struct; /* Domain controller authentication protocol info */ struct dcinfo @@ -679,9 +692,9 @@ typedef struct to support the following operations */ struct share_ops { BOOL (*stop_mgmt)(void); - BOOL (*lock_entry)(int , uint32 , uint32 , int *); - BOOL (*unlock_entry)(int , uint32 , uint32 , int ); - int (*get_entries)(int , int , uint32 , uint32 , share_mode_entry **); + BOOL (*lock_entry)(connection_struct *, uint32 , uint32 , int *); + BOOL (*unlock_entry)(connection_struct *, uint32 , uint32 , int ); + int (*get_entries)(connection_struct *, int , uint32 , uint32 , share_mode_entry **); void (*del_entry)(int , int ); BOOL (*set_entry)(int , int , uint16 , uint16 ); BOOL (*remove_oplock)(int , int); @@ -848,12 +861,12 @@ struct parm_struct #define VALID_FNUM(fnum) (((fnum) >= 0) && ((fnum) < MAX_FNUMS)) #define OPEN_FNUM(fnum) (VALID_FNUM(fnum) && Files[fnum].open && !Files[fnum].is_directory) #define VALID_CNUM(cnum) (((cnum) >= 0) && ((cnum) < MAX_CONNECTIONS)) -#define OPEN_CNUM(cnum) (VALID_CNUM(cnum) && Connections[cnum].open) -#define IS_IPC(cnum) (VALID_CNUM(cnum) && Connections[cnum].ipc) -#define IS_PRINT(cnum) (VALID_CNUM(cnum) && Connections[cnum].printer) -#define FNUM_OK(fnum,c) (OPEN_FNUM(fnum) && (c)==Files[fnum].cnum) +#define OPEN_CNUM(conn) ((conn) && (conn)->open) +#define IS_IPC(conn) ((conn) && (conn)->ipc) +#define IS_PRINT(conn) ((conn) && (conn)->printer) +#define FNUM_OK(fnum,c) (OPEN_FNUM(fnum) && (c)==Files[fnum].conn) -#define CHECK_FNUM(fnum,c) if (!FNUM_OK(fnum,c)) \ +#define CHECK_FNUM(fnum,conn) if (!FNUM_OK(fnum,conn)) \ return(ERROR(ERRDOS,ERRbadfid)) #define CHECK_READ(fnum) if (!Files[fnum].can_read) \ return(ERROR(ERRDOS,ERRbadaccess)) @@ -863,26 +876,25 @@ struct parm_struct return(CACHED_ERROR(fnum)) /* translates a connection number into a service number */ -#define SNUM(cnum) (Connections[cnum].service) +#define SNUM(conn) ((conn)?(conn)->service:-1) /* access various service details */ #define SERVICE(snum) (lp_servicename(snum)) #define PRINTCAP (lp_printcapname()) #define PRINTCOMMAND(snum) (lp_printcommand(snum)) #define PRINTERNAME(snum) (lp_printername(snum)) -#define CAN_WRITE(cnum) (OPEN_CNUM(cnum) && !Connections[cnum].read_only) +#define CAN_WRITE(conn) (OPEN_CNUM(conn) && !conn->read_only) #define VALID_SNUM(snum) (lp_snum_ok(snum)) #define GUEST_OK(snum) (VALID_SNUM(snum) && lp_guest_ok(snum)) #define GUEST_ONLY(snum) (VALID_SNUM(snum) && lp_guest_only(snum)) #define CAN_SETDIR(snum) (!lp_no_set_dir(snum)) -#define CAN_PRINT(cnum) (OPEN_CNUM(cnum) && lp_print_ok(SNUM(cnum))) -#define POSTSCRIPT(cnum) (OPEN_CNUM(cnum) && lp_postscript(SNUM(cnum))) -#define MAP_HIDDEN(cnum) (OPEN_CNUM(cnum) && lp_map_hidden(SNUM(cnum))) -#define MAP_SYSTEM(cnum) (OPEN_CNUM(cnum) && lp_map_system(SNUM(cnum))) -#define MAP_ARCHIVE(cnum) (OPEN_CNUM(cnum) && lp_map_archive(SNUM(cnum))) -#define IS_HIDDEN_PATH(cnum,path) (is_in_path((path),Connections[(cnum)].hide_list)) -#define IS_VETO_PATH(cnum,path) (is_in_path((path),Connections[(cnum)].veto_list)) -#define IS_VETO_OPLOCK_PATH(cnum,path) (is_in_path((path),Connections[(cnum)].veto_oplock_list)) +#define CAN_PRINT(conn) ((conn) && lp_print_ok((conn)->service)) +#define MAP_HIDDEN(conn) ((conn) && lp_map_hidden((conn)->service)) +#define MAP_SYSTEM(conn) ((conn) && lp_map_system((conn)->service)) +#define MAP_ARCHIVE(conn) ((conn) && lp_map_archive((conn)->service)) +#define IS_HIDDEN_PATH(conn,path) ((conn) && is_in_path((path),(conn)->hide_list)) +#define IS_VETO_PATH(conn,path) ((conn) && is_in_path((path),(conn)->veto_list)) +#define IS_VETO_OPLOCK_PATH(conn,path) ((conn) && is_in_path((path),(conn)->veto_oplock_list)) #define SMBENCRYPT() (lp_encrypted_passwords()) @@ -1228,7 +1240,11 @@ struct parm_struct #define ERRCMD 0xFF /* Command was not in the "SMB" format. */ #ifdef HAVE_STDARG_H -int slprintf(char *str, int n, char *format, ...); +int slprintf(char *str, int n, char *format, ...) +#ifdef __GNUC__ + __attribute__ ((format (printf, 3, 4))) +#endif +; #else int slprintf(); #endif -- cgit From e13aeea928dd89373cfaf3916c96f853c1227884 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 15 Aug 1998 01:19:26 +0000 Subject: configure: Changes for extra headers. configure.in: Source for header changes. client/clitar.c: Fixed isXXX macros & debugs for gcc pedantic compile. include/config.h.in: Added MEMSET, BZERO, MEMORY, RPCSVC_YPCLNT, STRINGS headers. include/includes.h: Headers for the above. include/smb.h: Made SIGNAL_CAST POSIX by default void (*)(int). lib/access.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/charset.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/debug.c: Fixed signal functs. lib/kanji.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/smbrun.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/util.c: Fixed isXXX macros & debugs for gcc pedantic compile. libsmb/namequery.c: Fixed isXXX macros & debugs for gcc pedantic compile. locking/shmem.c: Fixed isXXX macros & debugs for gcc pedantic compile. locking/shmem_sysv.c: Fixed error messages in sysV stuff. nmbd/asyncdns.c: Fixed signal functs. nmbd/nmbd.c: Fixed isXXX macros & debugs for gcc pedantic compile. passdb/passdb.c: Fixed isXXX macros & debugs for gcc pedantic compile. passdb/smbpassfile.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/chgpasswd.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/ipc.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/nttrans.c: Fixed fsp code path. smbd/password.c: fixed HAVE_YP_GET_DEFAULT_DOMAIN problem. smbd/printing.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/reply.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/server.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/trans2.c: Fixed core dump bug. smbd/uid.c: Fixed isXXX macros & debugs for gcc pedantic compile. Jeremy. (This used to be commit 1b9cbcd02e575dc0a95fa589f720df30a4acc46b) --- source3/include/config.h.in | 15 +++++++++++++++ source3/include/includes.h | 16 ++++++++++++++++ source3/include/proto.h | 4 ++-- source3/include/smb.h | 2 +- 4 files changed, 34 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index ced68aa762..d3968452c3 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -127,6 +127,9 @@ /* Define if you have the bigcrypt function. */ #undef HAVE_BIGCRYPT +/* Define if you have the bzero function. */ +#undef HAVE_BZERO + /* Define if you have the chmod function. */ #undef HAVE_CHMOD @@ -190,6 +193,9 @@ /* Define if you have the memmove function. */ #undef HAVE_MEMMOVE +/* Define if you have the memset function. */ +#undef HAVE_MEMSET + /* Define if you have the mktime function. */ #undef HAVE_MKTIME @@ -286,6 +292,9 @@ /* Define if you have the header file. */ #undef HAVE_LIMITS_H +/* Define if you have the header file. */ +#undef HAVE_MEMORY_H + /* Define if you have the header file. */ #undef HAVE_NDIR_H @@ -310,6 +319,9 @@ /* Define if you have the header file. */ #undef HAVE_STRING_H +/* Define if you have the header file. */ +#undef HAVE_STRINGS_H + /* Define if you have the header file. */ #undef HAVE_SYS_DIR_H @@ -346,6 +358,9 @@ /* Define if you have the header file. */ #undef HAVE_SYS_PARAM_H +/* Define if you have the header file. */ +#undef HAVE_RPCSVC_YPCLNT_H + /* Define if you have the header file. */ #undef HAVE_SYS_SECURITY_H diff --git a/source3/include/includes.h b/source3/include/includes.h index 237251209a..42ec579692 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -71,6 +71,14 @@ #include #endif +#ifdef HAVE_STRINGS_H +#include +#endif + +#ifdef HAVE_MEMORY_H +#include +#endif + #ifdef HAVE_MALLOC_H #include #endif @@ -241,6 +249,10 @@ #include #endif +#ifdef HAVE_RPCSVC_YPCLNT_H +#include +#endif + #ifndef uchar #define uchar unsigned char #endif @@ -470,4 +482,8 @@ int setresuid(uid_t ruid, uid_t euid, uid_t suid); int setresgid(gid_t rgid, gid_t egid, gid_t sgid); #endif +#if !defined(HAVE_BZERO) && defined(HAVE_MEMSET) +#define bzero(a,b) memset((a),'\0',(b)) +#endif + #endif /* _INCLUDES_H */ diff --git a/source3/include/proto.h b/source3/include/proto.h index 1cab9c5e9d..74e240cfa3 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -63,8 +63,8 @@ void add_char_string(char *s); /*The following definitions come from lib/debug.c */ -int sig_usr2( void ); -int sig_usr1( void ); +void sig_usr2( int sig ); +void sig_usr1( int sig ); void setup_logging( char *pname, BOOL interactive ); void reopen_logs( void ); void force_check_log_size( void ); diff --git a/source3/include/smb.h b/source3/include/smb.h index b060134d8e..fa5d496ceb 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1274,7 +1274,7 @@ char *strdup(char *s); #endif #ifndef SIGNAL_CAST -#define SIGNAL_CAST (RETSIGTYPE (*)()) +#define SIGNAL_CAST (RETSIGTYPE (*)(int)) #endif #ifndef SELECT_CAST -- cgit From 570f8e9a77656f3363938bde1364053d6bbfb30f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 15 Aug 1998 03:26:52 +0000 Subject: moved the printing related files to a separate printing/ directory. (This used to be commit d933a47be6fa7b5f161179fa11244aaba1051160) --- source3/include/config.h.in | 6 +++--- source3/include/proto.h | 48 ++++++++++++++++++++++----------------------- 2 files changed, 27 insertions(+), 27 deletions(-) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index d3968452c3..de5cd41544 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -304,6 +304,9 @@ /* Define if you have the header file. */ #undef HAVE_NETINET_TCP_H +/* Define if you have the header file. */ +#undef HAVE_RPCSVC_YPCLNT_H + /* Define if you have the header file. */ #undef HAVE_SECURITY_PAM_APPL_H @@ -358,9 +361,6 @@ /* Define if you have the header file. */ #undef HAVE_SYS_PARAM_H -/* Define if you have the header file. */ -#undef HAVE_RPCSVC_YPCLNT_H - /* Define if you have the header file. */ #undef HAVE_SYS_SECURITY_H diff --git a/source3/include/proto.h b/source3/include/proto.h index 74e240cfa3..49d078b78a 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1091,11 +1091,6 @@ BOOL pm_process( char *FileName, BOOL (*sfunc)(char *), BOOL (*pfunc)(char *, char *) ); -/*The following definitions come from param/pcap.c */ - -BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); -void pcap_printer_fn(void (*fn)(char *, char *)); - /*The following definitions come from passdb/ldap.c */ struct passdb_ops *ldap_initialize_password_db(void); @@ -1177,6 +1172,30 @@ BOOL trust_password_delete( char *domain, char *name ); BOOL get_trust_account_password( unsigned char *ret_pwd, time_t *pass_last_set_time); BOOL set_trust_account_password( unsigned char *md4_new_pwd); +/*The following definitions come from printing/pcap.c */ + +BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); +void pcap_printer_fn(void (*fn)(char *, char *)); + +/*The following definitions come from printing/print_svid.c */ + +void sysv_printer_fn(void (*fn)(char *, char *)); +int sysv_printername_ok(char *name); + +/*The following definitions come from printing/printing.c */ + +void lpq_reset(int snum); +void print_file(connection_struct *conn, files_struct *file); +int get_printqueue(int snum, + connection_struct *conn,print_queue_struct **queue, + print_status_struct *status); +void del_printqueue(connection_struct *conn,int snum,int jobid); +void status_printjob(connection_struct *conn,int snum,int jobid,int status); +int printjob_encode(int snum, int job); +void printjob_decode(int jobid, int *snum, int *job); +void status_printqueue(connection_struct *conn,int snum,int status); +void load_printers(void); + /*The following definitions come from rpc_client/cli_login.c */ BOOL cli_nt_setup_creds(struct cli_state *cli, unsigned char mach_pwd[16]); @@ -2008,25 +2027,6 @@ int read_predict(int fd,int offset,char *buf,char **ptr,int num); void do_read_prediction(void); void invalidate_read_prediction(int fd); -/*The following definitions come from smbd/print_svid.c */ - -void sysv_printer_fn(void (*fn)(char *, char *)); -int sysv_printername_ok(char *name); - -/*The following definitions come from smbd/printing.c */ - -void lpq_reset(int snum); -void print_file(connection_struct *conn, files_struct *file); -int get_printqueue(int snum, - connection_struct *conn,print_queue_struct **queue, - print_status_struct *status); -void del_printqueue(connection_struct *conn,int snum,int jobid); -void status_printjob(connection_struct *conn,int snum,int jobid,int status); -int printjob_encode(int snum, int job); -void printjob_decode(int jobid, int *snum, int *job); -void status_printqueue(connection_struct *conn,int snum,int status); -void load_printers(void); - /*The following definitions come from smbd/quotas.c */ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); -- cgit From 127655cc888ac40332d4e8e5b94aab03f5120aae Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 15 Aug 1998 07:27:34 +0000 Subject: this checkin gets rid of the global Files[] array and makes it local in files.c it should now be faily easy to expand the default MAX_OPEN_FILES to many thousands. (This used to be commit b088c804f98908eb02f05ab2f2e8a61691a0a582) --- source3/include/local.h | 15 +++++++-------- source3/include/proto.h | 49 ++++++++++++++++++++++++++++++++----------------- source3/include/smb.h | 37 ++++++++++++++++++++----------------- 3 files changed, 59 insertions(+), 42 deletions(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index fb67babcda..af12f83551 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -29,6 +29,10 @@ /* to a maximum of 8 if old smb clients break because of long printer names. */ #define MAXPRINTERLEN 15 +/* max number of directories open at once */ +/* note that with the new directory code this no longer requires a + file handle per directory, but large numbers do use more memory */ +#define MAX_OPEN_DIRECTORIES 64 /* define what facility to use for syslog */ #ifndef SYSLOG_FACILITY @@ -40,18 +44,13 @@ MAX_CONNECTIONS services, but any number of machines may connect at one time. */ #define MAX_CONNECTIONS 127 -#define MAX_OPEN_FILES 100 - -/* max number of directories open at once */ -/* note that with the new directory code this no longer requires a - file handle per directory, but large numbers do use more memory */ -#define MAX_OPEN_DIRECTORIES 64 -#define MAX_FNUMS (MAX_OPEN_FILES+MAX_OPEN_DIRECTORIES) +/* this must be larger than the sum of the open files and directories */ +#define PIPE_HANDLE_OFFSET 0x7000 /* Default size of shared memory used for share mode locking */ #ifndef SHMEM_SIZE -#define SHMEM_SIZE (1024*(MAX_OPEN_FILES+MAX_OPEN_DIRECTORIES)) +#define SHMEM_SIZE (1024*1024) #endif /* the max number of simultanous connections to the server by all clients */ diff --git a/source3/include/proto.h b/source3/include/proto.h index 49d078b78a..9587828ea9 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -474,12 +474,12 @@ char *smb_errstr(char *inbuf); BOOL push_blocking_lock_request( char *inbuf, int length, int lock_timeout, int lock_num); void process_blocking_lock_queue(time_t t); -BOOL is_locked(int fnum,connection_struct *conn, +BOOL is_locked(files_struct *fsp,connection_struct *conn, uint32 count,uint32 offset, int lock_type); -BOOL do_lock(int fnum,connection_struct *conn, +BOOL do_lock(files_struct *fsp,connection_struct *conn, uint32 count,uint32 offset,int lock_type, int *eclass,uint32 *ecode); -BOOL do_unlock(int fnum,connection_struct *conn, +BOOL do_unlock(files_struct *fsp,connection_struct *conn, uint32 count,uint32 offset,int *eclass,uint32 *ecode); BOOL locking_init(int read_only); BOOL locking_end(void); @@ -490,9 +490,9 @@ BOOL unlock_share_entry(connection_struct *conn, int get_share_modes(connection_struct *conn, int token, uint32 dev, uint32 inode, share_mode_entry **shares); -void del_share_mode(int token, int fnum); -BOOL set_share_mode(int token, int fnum, uint16 port, uint16 op_type); -BOOL remove_share_oplock(int fnum, int token); +void del_share_mode(int token, files_struct *fsp); +BOOL set_share_mode(int token, files_struct *fsp, uint16 port, uint16 op_type); +BOOL remove_share_oplock(files_struct *fsp, int token); int share_mode_forall(void (*fn)(share_mode_entry *, char *)); void share_status(FILE *f); @@ -1941,6 +1941,20 @@ void DirCacheAdd( char *path, char *name, char *dname, int snum ); char *DirCacheCheck( char *path, char *name, int snum ); void DirCacheFlush(int snum); +/*The following definitions come from smbd/files.c */ + +files_struct *find_free_file(void ); +file_fd_struct *fd_get_already_open(struct stat *sbuf); +file_fd_struct *fd_get_new(void); +void file_close_conn(connection_struct *conn); +void file_init(void); +files_struct *file_fsp(int fnum); +void file_close_user(int vuid); +files_struct *file_find_dit(int dev, int inode, struct timeval *tval); +files_struct *file_find_print(void); +void file_sync_all(connection_struct *conn); +void file_free(files_struct *fsp); + /*The following definitions come from smbd/groupname.c */ void load_groupname_map(void); @@ -1979,7 +1993,7 @@ int reply_ntcancel(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize); int reply_nttranss(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize); -void remove_pending_change_notify_requests_by_fid(int fnum); +void remove_pending_change_notify_requests_by_fid(files_struct *fsp); void remove_pending_change_notify_requests_by_mid(int mid); void process_pending_change_notify_queue(time_t t); int reply_nttrans(connection_struct *conn, @@ -2114,22 +2128,23 @@ int file_utime(connection_struct *conn, char *fname, struct utimbuf *times); BOOL set_filetime(connection_struct *conn, char *fname, time_t mtime); BOOL unix_convert(char *name,connection_struct *conn,char *saved_last_component, BOOL *bad_path); BOOL check_name(char *name,connection_struct *conn); -void sync_file(connection_struct *conn, int fnum); -void close_file(int fnum, BOOL normal_close); -void close_directory(int fnum); -int open_directory(int fnum,connection_struct *conn, +void fd_add_to_uid_cache(file_fd_struct *fd_ptr, uid_t u); +void sync_file(connection_struct *conn, files_struct *fsp); +void close_file(files_struct *fsp, BOOL normal_close); +void close_directory(files_struct *fsp); +int open_directory(files_struct *fsp,connection_struct *conn, char *fname, int smb_ofun, int unixmode, int *action); BOOL check_file_sharing(connection_struct *conn,char *fname, BOOL rename_op); int check_share_mode( share_mode_entry *share, int deny_mode, char *fname, BOOL fcbopen, int *flags); -void open_file_shared(int fnum,connection_struct *conn,char *fname,int share_mode,int ofun, +void open_file_shared(files_struct *fsp,connection_struct *conn,char *fname,int share_mode,int ofun, int mode,int oplock_request, int *Access,int *action); -int seek_file(int fnum,uint32 pos); -int read_file(int fnum,char *data,uint32 pos,int n); -int write_file(int fnum,char *data,int n); +int seek_file(files_struct *fsp,uint32 pos); +int read_file(files_struct *fsp,char *data,uint32 pos,int n); +int write_file(files_struct *fsp,char *data,int n); BOOL become_service(connection_struct *conn,BOOL do_chdir); int find_service(char *service); -int cached_error_packet(char *inbuf,char *outbuf,int fnum,int line); +int cached_error_packet(char *inbuf,char *outbuf,files_struct *fsp,int line); int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line); int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int line); BOOL oplock_break(uint32 dev, uint32 inode, struct timeval *tval); @@ -2139,7 +2154,7 @@ BOOL receive_next_smb(int smbfd, int oplockfd, char *inbuf, int bufsize, int tim BOOL snum_used(int snum); BOOL reload_services(BOOL test); connection_struct *make_connection(char *service,char *user,char *password, int pwlen, char *dev,uint16 vuid, int *ecode); -int find_free_file(void ); +BOOL attempt_close_oplocked_file(files_struct *fsp); int reply_corep(char *outbuf); int reply_coreplus(char *outbuf); int reply_lanman1(char *outbuf); diff --git a/source3/include/smb.h b/source3/include/smb.h index fa5d496ceb..801e134435 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -575,6 +575,7 @@ struct current_user typedef struct { + int fnum; connection_struct *conn; file_fd_struct *fd_ptr; int pos; @@ -599,6 +600,10 @@ typedef struct char *fsp_name; } files_struct; +/* this macro should always be used to extract an fnum (smb_fid) from + a packet to ensure chaining works correctly */ +#define GETFSP(buf,where) (chain_fsp?chain_fsp:file_fsp(SVAL(buf,where))) + /* Domain controller authentication protocol info */ struct dcinfo @@ -695,9 +700,9 @@ struct share_ops { BOOL (*lock_entry)(connection_struct *, uint32 , uint32 , int *); BOOL (*unlock_entry)(connection_struct *, uint32 , uint32 , int ); int (*get_entries)(connection_struct *, int , uint32 , uint32 , share_mode_entry **); - void (*del_entry)(int , int ); - BOOL (*set_entry)(int , int , uint16 , uint16 ); - BOOL (*remove_oplock)(int , int); + void (*del_entry)(int , files_struct *); + BOOL (*set_entry)(int, files_struct *, uint16 , uint16 ); + BOOL (*remove_oplock)(files_struct *, int); int (*forall)(void (*)(share_mode_entry *, char *)); void (*status)(FILE *); }; @@ -858,22 +863,21 @@ struct parm_struct #endif /* LOCKING_VERSION */ /* these are useful macros for checking validity of handles */ -#define VALID_FNUM(fnum) (((fnum) >= 0) && ((fnum) < MAX_FNUMS)) -#define OPEN_FNUM(fnum) (VALID_FNUM(fnum) && Files[fnum].open && !Files[fnum].is_directory) +#define OPEN_FSP(fsp) ((fsp) && (fsp)->open && !(fsp)->is_directory) #define VALID_CNUM(cnum) (((cnum) >= 0) && ((cnum) < MAX_CONNECTIONS)) -#define OPEN_CNUM(conn) ((conn) && (conn)->open) +#define OPEN_CONN(conn) ((conn) && (conn)->open) #define IS_IPC(conn) ((conn) && (conn)->ipc) #define IS_PRINT(conn) ((conn) && (conn)->printer) -#define FNUM_OK(fnum,c) (OPEN_FNUM(fnum) && (c)==Files[fnum].conn) +#define FNUM_OK(fsp,c) (OPEN_FSP(fsp) && (c)==(fsp)->conn) -#define CHECK_FNUM(fnum,conn) if (!FNUM_OK(fnum,conn)) \ +#define CHECK_FSP(fsp,conn) if (!FNUM_OK(fsp,conn)) \ return(ERROR(ERRDOS,ERRbadfid)) -#define CHECK_READ(fnum) if (!Files[fnum].can_read) \ +#define CHECK_READ(fsp) if (!(fsp)->can_read) \ return(ERROR(ERRDOS,ERRbadaccess)) -#define CHECK_WRITE(fnum) if (!Files[fnum].can_write) \ +#define CHECK_WRITE(fsp) if (!(fsp)->can_write) \ return(ERROR(ERRDOS,ERRbadaccess)) -#define CHECK_ERROR(fnum) if (HAS_CACHED_ERROR(fnum)) \ - return(CACHED_ERROR(fnum)) +#define CHECK_ERROR(fsp) if (HAS_CACHED_ERROR(fsp)) \ + return(CACHED_ERROR(fsp)) /* translates a connection number into a service number */ #define SNUM(conn) ((conn)?(conn)->service:-1) @@ -883,7 +887,7 @@ struct parm_struct #define PRINTCAP (lp_printcapname()) #define PRINTCOMMAND(snum) (lp_printcommand(snum)) #define PRINTERNAME(snum) (lp_printername(snum)) -#define CAN_WRITE(conn) (OPEN_CNUM(conn) && !conn->read_only) +#define CAN_WRITE(conn) (OPEN_CONN(conn) && !conn->read_only) #define VALID_SNUM(snum) (lp_snum_ok(snum)) #define GUEST_OK(snum) (VALID_SNUM(snum) && lp_guest_ok(snum)) #define GUEST_ONLY(snum) (VALID_SNUM(snum) && lp_guest_only(snum)) @@ -1432,11 +1436,10 @@ enum ssl_version_enum {SMB_SSL_V2,SMB_SSL_V3,SMB_SSL_V23,SMB_SSL_TLS1}; #define CACHE_ERROR(w,c,e) ((w)->wr_errclass = (c), (w)->wr_error = (e), \ w->wr_discard = True, -1) /* Macro to test if an error has been cached for this fnum */ -#define HAS_CACHED_ERROR(fnum) (Files[(fnum)].open && \ - Files[(fnum)].wbmpx_ptr && \ - Files[(fnum)].wbmpx_ptr->wr_discard) +#define HAS_CACHED_ERROR(fsp) ((fsp)->open && (fsp)->wbmpx_ptr && \ + (fsp)->wbmpx_ptr->wr_discard) /* Macro to turn the cached error into an error packet */ -#define CACHED_ERROR(fnum) cached_error_packet(inbuf,outbuf,fnum,__LINE__) +#define CACHED_ERROR(fsp) cached_error_packet(inbuf,outbuf,fsp,__LINE__) /* these are the datagram types */ #define DGRAM_DIRECT_UNIQUE 0x10 -- cgit From a7acf10566af549eb71e7a421397c8073d55e0f6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 16 Aug 1998 03:04:06 +0000 Subject: server.c: fixed a bug in close_file() with the new files.c handling code bitmap.c: added bitmap hanlding code in preparation for increasing the default max open files to several thousand (This used to be commit f573a65b67e7a57586fec57845598e49b157ee0a) --- source3/include/proto.h | 2 +- source3/include/smb.h | 29 ++++++++++++++++++----------- 2 files changed, 19 insertions(+), 12 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 9587828ea9..6f2a593f92 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1943,7 +1943,7 @@ void DirCacheFlush(int snum); /*The following definitions come from smbd/files.c */ -files_struct *find_free_file(void ); +files_struct *file_new(void ); file_fd_struct *fd_get_already_open(struct stat *sbuf); file_fd_struct *fd_get_new(void); void file_close_conn(connection_struct *conn); diff --git a/source3/include/smb.h b/source3/include/smb.h index 801e134435..3b562b9d13 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -494,17 +494,19 @@ typedef struct * file descriptor and process. */ -typedef struct +typedef struct file_fd_struct { - uint16 ref_count; - uint16 uid_cache_count; - uid_t uid_users_cache[10]; - uint32 dev; - uint32 inode; - int fd; - int fd_readonly; - int fd_writeonly; - int real_open_flags; + struct file_fd_struct *next, *prev; + uint16 ref_count; + uint16 uid_cache_count; + uid_t uid_users_cache[10]; + uint32 dev; + uint32 inode; + int fd; + int fdnum; + int fd_readonly; + int fd_writeonly; + int real_open_flags; } file_fd_struct; /* @@ -573,8 +575,9 @@ struct current_user GID_T *groups; }; -typedef struct +typedef struct files_struct { + struct files_struct *next, *prev; int fnum; connection_struct *conn; file_fd_struct *fd_ptr; @@ -852,6 +855,10 @@ struct parm_struct } def; }; +struct bitmap { + uint32 *b; + int n; +}; #define FLAG_BASIC 1 /* fundamental options */ #define FLAG_HIDE 2 /* options that should be hidden in SWAT */ -- cgit From 739d0b1ddc58bbb792c3eebe8c545602a4fae438 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 16 Aug 1998 04:08:47 +0000 Subject: got rid of the Files[] array completely (previously I'd just made it private to files.c) It now is a doubly linked list with a bitmap for allocated file numbers. Similarly for the fd_ptr code. I also changed the default maximum number of open files to 4096. The static cost is 1 bit per file. It all seems to work, and it passes the "does Sue scream" test, but if you see weird behaviour then please investigate. With the volume of new code that has gone in there are bound to be one or two bugs lurking. note that you must do a "make clean" before building this as many data structures have changed in size. (This used to be commit 79755ce97004b787d7e83a8d18fc4c7c003b7231) --- source3/include/proto.h | 9 +++++++++ source3/include/smb.h | 1 - 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 6f2a593f92..e52ffdcd7a 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -49,6 +49,15 @@ BOOL allow_access(char *deny_list,char *allow_list, char *cname,char *caddr); BOOL check_access(int sock, char *allow_list, char *deny_list); +/*The following definitions come from lib/bitmap.c */ + +struct bitmap *bitmap_allocate(int n); +void bitmap_free(struct bitmap *bm); +BOOL bitmap_set(struct bitmap *bm, unsigned i); +BOOL bitmap_clear(struct bitmap *bm, unsigned i); +BOOL bitmap_query(struct bitmap *bm, unsigned i); +int bitmap_find(struct bitmap *bm, unsigned ofs); + /*The following definitions come from lib/charcnv.c */ char *unix2dos_format(char *str,BOOL overwrite); diff --git a/source3/include/smb.h b/source3/include/smb.h index 3b562b9d13..e99eb30023 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -599,7 +599,6 @@ typedef struct files_struct BOOL granted_oplock; BOOL sent_oplock_break; BOOL is_directory; - BOOL reserved; char *fsp_name; } files_struct; -- cgit From 23294e6fc1a6270067b7745ccaea1117a706e361 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 16 Aug 1998 05:22:01 +0000 Subject: added include of sys/resource.h (This used to be commit bf136b4fa8aeadcea8f65610148d46d093aba2cc) --- source3/include/config.h.in | 3 +++ source3/include/includes.h | 5 +++++ 2 files changed, 8 insertions(+) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index de5cd41544..ed3c1ac770 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -361,6 +361,9 @@ /* Define if you have the header file. */ #undef HAVE_SYS_PARAM_H +/* Define if you have the header file. */ +#undef HAVE_SYS_RESOURCE_H + /* Define if you have the header file. */ #undef HAVE_SYS_SECURITY_H diff --git a/source3/include/includes.h b/source3/include/includes.h index 42ec579692..4ced157359 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -49,9 +49,14 @@ #include +#ifdef HAVE_SYS_RESOURCE_H +#include +#endif + #ifdef HAVE_UNISTD_H #include #endif + #include #include -- cgit From c5e2c883c0415ca3c7e366357c8c6ba573713aa6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 16 Aug 1998 13:02:35 +0000 Subject: I think it is pretty much decided that the next major version will be 2.0, so I've updated version.h to reflect this. I've put in "2.0.0-prealpha". (This used to be commit f1c67a00b8603bf1a9e6bef680c0d563727ba108) --- source3/include/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/version.h b/source3/include/version.h index 146d0b7753..921701de4b 100644 --- a/source3/include/version.h +++ b/source3/include/version.h @@ -1 +1 @@ -#define VERSION "1.9.19-prealpha" +#define VERSION "2.0.0-prealpha" -- cgit From f2d538a105a61ce6d2852700fc328e15ac158827 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 17 Aug 1998 03:06:20 +0000 Subject: some cleanups from the conversion of Pipes[] to a linked list. I also removed most cases where a pnum is used and substituted a pipes_struct*. in files.c I added a offset of 0x1000 to all file handles on the wire. This makes it much less likely that bad parsing will give us the wrong field. (This used to be commit 8bc2627ff28d340db65bfa017daca2dc291d5ef7) --- source3/include/local.h | 3 --- source3/include/ntdomain.h | 4 +++- source3/include/proto.h | 18 +++++++++--------- 3 files changed, 12 insertions(+), 13 deletions(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index af12f83551..1db1e9d4c1 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -45,9 +45,6 @@ one time. */ #define MAX_CONNECTIONS 127 -/* this must be larger than the sum of the open files and directories */ -#define PIPE_HANDLE_OFFSET 0x7000 - /* Default size of shared memory used for share mode locking */ #ifndef SHMEM_SIZE #define SHMEM_SIZE (1024*1024) diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index 0b2648372b..ac411fa653 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -53,8 +53,10 @@ typedef struct } prs_struct; -typedef struct +typedef struct pipes_struct { + struct pipes_struct *next, *prev; + int pnum; connection_struct *conn; int uid; BOOL open; /* open connection */ diff --git a/source3/include/proto.h b/source3/include/proto.h index e52ffdcd7a..cda824c7d0 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -55,7 +55,6 @@ struct bitmap *bitmap_allocate(int n); void bitmap_free(struct bitmap *bm); BOOL bitmap_set(struct bitmap *bm, unsigned i); BOOL bitmap_clear(struct bitmap *bm, unsigned i); -BOOL bitmap_query(struct bitmap *bm, unsigned i); int bitmap_find(struct bitmap *bm, unsigned ofs); /*The following definitions come from lib/charcnv.c */ @@ -1857,16 +1856,17 @@ BOOL api_netlog_rpc(pipes_struct *p, prs_struct *data); /*The following definitions come from rpc_server/srv_pipe_hnd.c */ -void reset_chain_pnum(void); -void set_chain_pnum(int new_pnum); +void reset_chain_p(void); +void set_chain_p(pipes_struct *new_p); void init_rpc_pipe_hnd(void); -int open_rpc_pipe_hnd(char *pipe_name, connection_struct *conn, uint16 vuid); -int read_pipe(uint16 pnum, char *data, uint32 pos, int n); -BOOL get_rpc_pipe(int pnum, pipes_struct **p); -char *get_rpc_pipe_hnd_name(int pnum); +pipes_struct *open_rpc_pipe_p(char *pipe_name, + connection_struct *conn, uint16 vuid); +int read_pipe(pipes_struct *p, char *data, uint32 pos, int n); +char *get_rpc_pipe_hnd_name(pipes_struct *p); BOOL set_rpc_pipe_hnd_state(pipes_struct *p, uint16 device_state); -BOOL close_rpc_pipe_hnd(int pnum, connection_struct *conn); -int get_rpc_pipe_num(char *buf, int where); +BOOL close_rpc_pipe_hnd(pipes_struct *p, connection_struct *conn); +pipes_struct *get_rpc_pipe_p(char *buf, int where); +pipes_struct *get_rpc_pipe(int pnum); /*The following definitions come from rpc_server/srv_reg.c */ -- cgit From 8978aae69699ccab76fdf95037948b1cc7e7c286 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 17 Aug 1998 03:52:05 +0000 Subject: much cleaner chain pointer handling for both files and pipes. the chain pointer is now stored as a static and is set whenever a handle is created or extracted. This also makes the code less error prone. (This used to be commit 068a862982bea726e8d7b1b4065d510b9840a272) --- source3/include/proto.h | 6 +++--- source3/include/smb.h | 5 ----- 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index cda824c7d0..e00ddbb79d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1857,10 +1857,9 @@ BOOL api_netlog_rpc(pipes_struct *p, prs_struct *data); /*The following definitions come from rpc_server/srv_pipe_hnd.c */ void reset_chain_p(void); -void set_chain_p(pipes_struct *new_p); void init_rpc_pipe_hnd(void); pipes_struct *open_rpc_pipe_p(char *pipe_name, - connection_struct *conn, uint16 vuid); + connection_struct *conn, uint16 vuid); int read_pipe(pipes_struct *p, char *data, uint32 pos, int n); char *get_rpc_pipe_hnd_name(pipes_struct *p); BOOL set_rpc_pipe_hnd_state(pipes_struct *p, uint16 device_state); @@ -1957,12 +1956,13 @@ file_fd_struct *fd_get_already_open(struct stat *sbuf); file_fd_struct *fd_get_new(void); void file_close_conn(connection_struct *conn); void file_init(void); -files_struct *file_fsp(int fnum); void file_close_user(int vuid); files_struct *file_find_dit(int dev, int inode, struct timeval *tval); files_struct *file_find_print(void); void file_sync_all(connection_struct *conn); void file_free(files_struct *fsp); +files_struct *file_fsp(char *buf, int where); +void file_chain_reset(void); /*The following definitions come from smbd/groupname.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index e99eb30023..2f2363ba71 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -602,11 +602,6 @@ typedef struct files_struct char *fsp_name; } files_struct; -/* this macro should always be used to extract an fnum (smb_fid) from - a packet to ensure chaining works correctly */ -#define GETFSP(buf,where) (chain_fsp?chain_fsp:file_fsp(SVAL(buf,where))) - - /* Domain controller authentication protocol info */ struct dcinfo { -- cgit From 4a68715c2518a2d3c2eb4282b503c1ef7857b9d0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 17 Aug 1998 04:54:06 +0000 Subject: converted the policy code to use a linked list and bitmap. This saves us a bit of memory. (This used to be commit 27da84b90df1f32e0d07acad04c72065b2005470) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index e00ddbb79d..0b5067e480 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1847,7 +1847,7 @@ BOOL set_lsa_policy_samr_pol_status(POLICY_HND *hnd, uint32 pol_status); BOOL set_lsa_policy_samr_sid(POLICY_HND *hnd, DOM_SID *sid); uint32 get_lsa_policy_samr_rid(POLICY_HND *hnd); BOOL set_lsa_policy_reg_name(POLICY_HND *hnd, fstring name); -BOOL get_lsa_policy_reg_name(POLICY_HND *hnd, fstring name); +BOOL get_lsa_policy_reg_name(POLICY_HND *hnd, char *name); BOOL close_lsa_policy_hnd(POLICY_HND *hnd); /*The following definitions come from rpc_server/srv_netlog.c */ -- cgit From 983dc71c9844675ad364f3ea59ddd04b87857b55 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 17 Aug 1998 06:13:32 +0000 Subject: moved connection_struct handling code into smbd/conn.c and changed it to a linked list with bitmap format. (This used to be commit b7aaab1b6b2d2f72b2bb7c11f5c7bf081a6093d9) --- source3/include/local.h | 6 ------ source3/include/proto.h | 12 +++++++++++- source3/include/smb.h | 7 +++---- 3 files changed, 14 insertions(+), 11 deletions(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index 1db1e9d4c1..ead97e565d 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -39,12 +39,6 @@ #define SYSLOG_FACILITY LOG_DAEMON #endif -/* set these to define the limits of the server. NOTE These are on a - per-client basis. Thus any one machine can't connect to more than - MAX_CONNECTIONS services, but any number of machines may connect at - one time. */ -#define MAX_CONNECTIONS 127 - /* Default size of shared memory used for share mode locking */ #ifndef SHMEM_SIZE #define SHMEM_SIZE (1024*1024) diff --git a/source3/include/proto.h b/source3/include/proto.h index 0b5067e480..4c7c625397 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1912,6 +1912,17 @@ BOOL check_oem_password(char *user, unsigned char *data, int new_passwd_size); BOOL change_oem_password(struct smb_passwd *smbpw, char *new_passwd, BOOL override); +/*The following definitions come from smbd/conn.c */ + +void conn_init(void); +int conn_num_open(void); +BOOL conn_snum_used(int snum); +connection_struct *conn_find(int cnum); +connection_struct *conn_new(void); +void conn_close_all(void); +BOOL conn_idle_all(time_t t, int deadtime); +void conn_free(connection_struct *conn); + /*The following definitions come from smbd/connection.c */ BOOL yield_connection(connection_struct *conn,char *name,int max_connections); @@ -2160,7 +2171,6 @@ BOOL oplock_break(uint32 dev, uint32 inode, struct timeval *tval); BOOL request_oplock_break(share_mode_entry *share_entry, uint32 dev, uint32 inode); BOOL receive_next_smb(int smbfd, int oplockfd, char *inbuf, int bufsize, int timeout); -BOOL snum_used(int snum); BOOL reload_services(BOOL test); connection_struct *make_connection(char *service,char *user,char *password, int pwlen, char *dev,uint16 vuid, int *ecode); BOOL attempt_close_oplocked_file(files_struct *fsp); diff --git a/source3/include/smb.h b/source3/include/smb.h index 2f2363ba71..c68f88cbdd 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -531,14 +531,14 @@ typedef struct BOOL is_wild; } name_compare_entry; -typedef struct +typedef struct connection_struct { + struct connection_struct *next, *prev; unsigned cnum; /* an index passed over the wire */ int service; BOOL force_user; struct uid_cache uid_cache; void *dirptr; - BOOL open; BOOL printer; BOOL ipc; BOOL read_only; @@ -865,7 +865,6 @@ struct bitmap { /* these are useful macros for checking validity of handles */ #define OPEN_FSP(fsp) ((fsp) && (fsp)->open && !(fsp)->is_directory) -#define VALID_CNUM(cnum) (((cnum) >= 0) && ((cnum) < MAX_CONNECTIONS)) #define OPEN_CONN(conn) ((conn) && (conn)->open) #define IS_IPC(conn) ((conn) && (conn)->ipc) #define IS_PRINT(conn) ((conn) && (conn)->printer) @@ -888,7 +887,7 @@ struct bitmap { #define PRINTCAP (lp_printcapname()) #define PRINTCOMMAND(snum) (lp_printcommand(snum)) #define PRINTERNAME(snum) (lp_printername(snum)) -#define CAN_WRITE(conn) (OPEN_CONN(conn) && !conn->read_only) +#define CAN_WRITE(conn) (!conn->read_only) #define VALID_SNUM(snum) (lp_snum_ok(snum)) #define GUEST_OK(snum) (VALID_SNUM(snum) && lp_guest_ok(snum)) #define GUEST_ONLY(snum) (VALID_SNUM(snum) && lp_guest_only(snum)) -- cgit From 72ed7049d88e5296ebec362189e62a384385ad34 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 17 Aug 1998 06:47:53 +0000 Subject: added some optimisation for the case where the number of open files is very large. files.c now promotes a files_struct to the top of the list if it is used when it is more than 10 elements from the top. also moved common linked list code for the 5 sets of linked lists that I've created over the past few days into dlinklist.h (I've explained to Chris why I didn't use the ubiqx code) (This used to be commit 1eb9ae2996b5a243a147f485e7e353d54f820852) --- source3/include/dlinklist.h | 52 +++++++++++++++++++++++++++++++++++++++++++++ source3/include/includes.h | 2 ++ 2 files changed, 54 insertions(+) create mode 100644 source3/include/dlinklist.h (limited to 'source3/include') diff --git a/source3/include/dlinklist.h b/source3/include/dlinklist.h new file mode 100644 index 0000000000..8810eca5b9 --- /dev/null +++ b/source3/include/dlinklist.h @@ -0,0 +1,52 @@ +/* + Unix SMB/Netbios implementation. + Version 1.9. + some simple double linked list macros + Copyright (C) Andrew Tridgell 1998 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +/* To use these macros you must have a structure containing a next and + prev pointer */ + + +/* hook into the front of the list */ +#define DLIST_ADD(list, p) \ + if (!(list)) { \ + (list) = (p); \ + (p)->next = (p)->prev = NULL; \ + } else { \ + (list)->prev = (p); \ + (p)->next = (list); \ + (p)->prev = NULL; \ + (list) = (p); \ + } + + +/* remove an element from a list */ +#define DLIST_REMOVE(list, p) \ + if ((p) == (list)) { \ + (list) = (p)->next; \ + if (list) (list)->prev = NULL; \ + } else { \ + (p)->prev->next = (p)->next; \ + if ((p)->next) (p)->next->prev = (p)->prev; \ + } + +/* promote an element to the top of the list */ +#define DLIST_PROMOTE(list, p) \ + DLIST_REMOVE(list, p) \ + DLIST_ADD(list, p) diff --git a/source3/include/includes.h b/source3/include/includes.h index 4ced157359..3fd5f7be08 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -314,6 +314,8 @@ extern int errno; /* Lists, trees, caching, datbase... */ #include "ubi_sLinkList.h" #include "ubi_dLinkList.h" +#include "dlinklist.h" + #ifndef UBI_BINTREE_H #include "ubi_Cache.h" #endif /* UBI_BINTREE_H */ -- cgit From 4c5c26b1ef4be862fc2037dd5fcc120cb35bacca Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 17 Aug 1998 07:15:54 +0000 Subject: now that we have no global arrays we can start to split up the monster server.c without breaking things. this splits off netprot.c and fileio.c for negprot and read/write/seek handling respectively. (This used to be commit b3d7014643ec9f2eef6e6f598f5b9db1fe2f930d) --- source3/include/proto.h | 20 ++++++++++++-------- source3/include/smb.h | 7 +++++++ 2 files changed, 19 insertions(+), 8 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 4c7c625397..667fc01a3b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1960,6 +1960,12 @@ void DirCacheAdd( char *path, char *name, char *dname, int snum ); char *DirCacheCheck( char *path, char *name, int snum ); void DirCacheFlush(int snum); +/*The following definitions come from smbd/fileio.c */ + +int seek_file(files_struct *fsp,uint32 pos); +int read_file(files_struct *fsp,char *data,uint32 pos,int n); +int write_file(files_struct *fsp,char *data,int n); + /*The following definitions come from smbd/files.c */ files_struct *file_new(void ); @@ -2005,6 +2011,12 @@ int reply_sendtxt(connection_struct *conn, int reply_sendend(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); +/*The following definitions come from smbd/negprot.c */ + +int reply_negprot(connection_struct *conn, + char *inbuf,char *outbuf, int dum_size, + int dum_buffsize); + /*The following definitions come from smbd/nttrans.c */ int reply_ntcreate_and_X(connection_struct *conn, @@ -2159,9 +2171,6 @@ int check_share_mode( share_mode_entry *share, int deny_mode, char *fname, BOOL fcbopen, int *flags); void open_file_shared(files_struct *fsp,connection_struct *conn,char *fname,int share_mode,int ofun, int mode,int oplock_request, int *Access,int *action); -int seek_file(files_struct *fsp,uint32 pos); -int read_file(files_struct *fsp,char *data,uint32 pos,int n); -int write_file(files_struct *fsp,char *data,int n); BOOL become_service(connection_struct *conn,BOOL do_chdir); int find_service(char *service); int cached_error_packet(char *inbuf,char *outbuf,files_struct *fsp,int line); @@ -2174,11 +2183,6 @@ BOOL receive_next_smb(int smbfd, int oplockfd, char *inbuf, int bufsize, int tim BOOL reload_services(BOOL test); connection_struct *make_connection(char *service,char *user,char *password, int pwlen, char *dev,uint16 vuid, int *ecode); BOOL attempt_close_oplocked_file(files_struct *fsp); -int reply_corep(char *outbuf); -int reply_coreplus(char *outbuf); -int reply_lanman1(char *outbuf); -int reply_lanman2(char *outbuf); -int reply_nt1(char *outbuf); void close_cnum(connection_struct *conn, uint16 vuid); void exit_server(char *reason); char *smb_fn_name(int type); diff --git a/source3/include/smb.h b/source3/include/smb.h index c68f88cbdd..e88737f046 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -200,6 +200,13 @@ implemented */ #define aDIR (1L<<4) #define aARCH (1L<<5) +/* for readability... */ +#define IS_DOS_READONLY(test_mode) (((test_mode) & aRONLY) != 0) +#define IS_DOS_DIR(test_mode) (((test_mode) & aDIR) != 0) +#define IS_DOS_ARCHIVE(test_mode) (((test_mode) & aARCH) != 0) +#define IS_DOS_SYSTEM(test_mode) (((test_mode) & aSYSTEM) != 0) +#define IS_DOS_HIDDEN(test_mode) (((test_mode) & aHIDDEN) != 0) + /* deny modes */ #define DENY_DOS 0 #define DENY_ALL 1 -- cgit From 0922615405838af7430ef39490ee578711866320 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 17 Aug 1998 07:40:06 +0000 Subject: more splitting of server.c created dosmode.c and filename.c (This used to be commit 534a90ca44641417c21f6ed6d4b94b1de60f808d) --- source3/include/proto.h | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 667fc01a3b..f154b8f469 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1960,11 +1960,26 @@ void DirCacheAdd( char *path, char *name, char *dname, int snum ); char *DirCacheCheck( char *path, char *name, int snum ); void DirCacheFlush(int snum); +/*The following definitions come from smbd/dosmode.c */ + +mode_t unix_mode(connection_struct *conn,int dosmode); +int dos_mode(connection_struct *conn,char *path,struct stat *sbuf); +int dos_chmod(connection_struct *conn,char *fname,int dosmode,struct stat *st); + /*The following definitions come from smbd/fileio.c */ int seek_file(files_struct *fsp,uint32 pos); int read_file(files_struct *fsp,char *data,uint32 pos,int n); int write_file(files_struct *fsp,char *data,int n); +void sync_file(connection_struct *conn, files_struct *fsp); + +/*The following definitions come from smbd/filename.c */ + +BOOL fname_equal(char *name1, char *name2); +BOOL mangled_equal(char *name1, char *name2); +BOOL unix_convert(char *name,connection_struct *conn,char *saved_last_component, BOOL *bad_path); +BOOL check_name(char *name,connection_struct *conn); +BOOL scan_directory(char *path, char *name,connection_struct *conn,BOOL docache); /*The following definitions come from smbd/files.c */ @@ -2153,15 +2168,9 @@ int reply_getattrE(connection_struct *conn, char *inbuf,char *outbuf, int dum_si void *dflt_sig(void); void killkids(void); -mode_t unix_mode(connection_struct *conn,int dosmode); -int dos_mode(connection_struct *conn,char *path,struct stat *sbuf); -int dos_chmod(connection_struct *conn,char *fname,int dosmode,struct stat *st); int file_utime(connection_struct *conn, char *fname, struct utimbuf *times); BOOL set_filetime(connection_struct *conn, char *fname, time_t mtime); -BOOL unix_convert(char *name,connection_struct *conn,char *saved_last_component, BOOL *bad_path); -BOOL check_name(char *name,connection_struct *conn); void fd_add_to_uid_cache(file_fd_struct *fd_ptr, uid_t u); -void sync_file(connection_struct *conn, files_struct *fsp); void close_file(files_struct *fsp, BOOL normal_close); void close_directory(files_struct *fsp); int open_directory(files_struct *fsp,connection_struct *conn, -- cgit From c3effa8b599a6a0a2fe05487edc3a0d13e83d427 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 17 Aug 1998 13:11:34 +0000 Subject: this completes the splitup of server.c. the splitup was done with an axe, not a scalpel, so there are some rough edges. I mostly wanted to get the general form right with fine tuning of what goes where to come later. Still, this is better than what we had before where server.c was a general repository for anything that didn't fit elsewhere. (This used to be commit a6d194886a4a5f7507fa37289ff96c1be56f14a6) --- source3/include/proto.h | 75 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 49 insertions(+), 26 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index f154b8f469..56f888dbdd 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1912,6 +1912,11 @@ BOOL check_oem_password(char *user, unsigned char *data, int new_passwd_size); BOOL change_oem_password(struct smb_passwd *smbpw, char *new_passwd, BOOL override); +/*The following definitions come from smbd/close.c */ + +void close_file(files_struct *fsp, BOOL normal_close); +void close_directory(files_struct *fsp); + /*The following definitions come from smbd/conn.c */ void conn_init(void); @@ -1965,6 +1970,14 @@ void DirCacheFlush(int snum); mode_t unix_mode(connection_struct *conn,int dosmode); int dos_mode(connection_struct *conn,char *path,struct stat *sbuf); int dos_chmod(connection_struct *conn,char *fname,int dosmode,struct stat *st); +int file_utime(connection_struct *conn, char *fname, struct utimbuf *times); +BOOL set_filetime(connection_struct *conn, char *fname, time_t mtime); + +/*The following definitions come from smbd/error.c */ + +int cached_error_packet(char *inbuf,char *outbuf,files_struct *fsp,int line); +int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line); +int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int line); /*The following definitions come from smbd/fileio.c */ @@ -2046,6 +2059,27 @@ void process_pending_change_notify_queue(time_t t); int reply_nttrans(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize); +/*The following definitions come from smbd/open.c */ + +void fd_add_to_uid_cache(file_fd_struct *fd_ptr, uid_t u); +int fd_attempt_close(file_fd_struct *fd_ptr); +void open_file_shared(files_struct *fsp,connection_struct *conn,char *fname,int share_mode,int ofun, + int mode,int oplock_request, int *Access,int *action); +int open_directory(files_struct *fsp,connection_struct *conn, + char *fname, int smb_ofun, int unixmode, int *action); +BOOL check_file_sharing(connection_struct *conn,char *fname, BOOL rename_op); +int check_share_mode( share_mode_entry *share, int deny_mode, char *fname, + BOOL fcbopen, int *flags); + +/*The following definitions come from smbd/oplock.c */ + +BOOL open_oplock_ipc(void); +BOOL process_local_message(int sock, char *buffer, int buf_size); +BOOL oplock_break(uint32 dev, uint32 inode, struct timeval *tval); +BOOL request_oplock_break(share_mode_entry *share_entry, + uint32 dev, uint32 inode); +BOOL attempt_close_oplocked_file(files_struct *fsp); + /*The following definitions come from smbd/password.c */ void generate_next_challenge(char *challenge); @@ -2088,6 +2122,16 @@ int read_predict(int fd,int offset,char *buf,char **ptr,int num); void do_read_prediction(void); void invalidate_read_prediction(int fd); +/*The following definitions come from smbd/process.c */ + +BOOL receive_next_smb(int smbfd, int oplockfd, char *inbuf, int bufsize, int timeout); +void process_smb(char *inbuf, char *outbuf); +char *smb_fn_name(int type); +int chain_reply(char *inbuf,char *outbuf,int size,int bufsize); +void construct_reply_common(char *inbuf,char *outbuf); +int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); +void smbd_process(void); + /*The following definitions come from smbd/quotas.c */ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize); @@ -2168,36 +2212,15 @@ int reply_getattrE(connection_struct *conn, char *inbuf,char *outbuf, int dum_si void *dflt_sig(void); void killkids(void); -int file_utime(connection_struct *conn, char *fname, struct utimbuf *times); -BOOL set_filetime(connection_struct *conn, char *fname, time_t mtime); -void fd_add_to_uid_cache(file_fd_struct *fd_ptr, uid_t u); -void close_file(files_struct *fsp, BOOL normal_close); -void close_directory(files_struct *fsp); -int open_directory(files_struct *fsp,connection_struct *conn, - char *fname, int smb_ofun, int unixmode, int *action); -BOOL check_file_sharing(connection_struct *conn,char *fname, BOOL rename_op); -int check_share_mode( share_mode_entry *share, int deny_mode, char *fname, - BOOL fcbopen, int *flags); -void open_file_shared(files_struct *fsp,connection_struct *conn,char *fname,int share_mode,int ofun, - int mode,int oplock_request, int *Access,int *action); +BOOL reload_services(BOOL test); +void exit_server(char *reason); + +/*The following definitions come from smbd/service.c */ + BOOL become_service(connection_struct *conn,BOOL do_chdir); int find_service(char *service); -int cached_error_packet(char *inbuf,char *outbuf,files_struct *fsp,int line); -int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line); -int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int line); -BOOL oplock_break(uint32 dev, uint32 inode, struct timeval *tval); -BOOL request_oplock_break(share_mode_entry *share_entry, - uint32 dev, uint32 inode); -BOOL receive_next_smb(int smbfd, int oplockfd, char *inbuf, int bufsize, int timeout); -BOOL reload_services(BOOL test); connection_struct *make_connection(char *service,char *user,char *password, int pwlen, char *dev,uint16 vuid, int *ecode); -BOOL attempt_close_oplocked_file(files_struct *fsp); void close_cnum(connection_struct *conn, uint16 vuid); -void exit_server(char *reason); -char *smb_fn_name(int type); -int chain_reply(char *inbuf,char *outbuf,int size,int bufsize); -void construct_reply_common(char *inbuf,char *outbuf); -int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); /*The following definitions come from smbd/ssl.c */ -- cgit From b935fc086285e73203e5f3af80041489e893ee1a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 17 Aug 1998 22:59:53 +0000 Subject: Fixed bug introduced by the recent changes where the chain_fnum could be overwritten in oplock processing code. Jeremy. (This used to be commit 908a583b48e37c5e869216f4dc92d4a587ff1238) --- source3/include/proto.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 56f888dbdd..07e3b70dba 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2008,6 +2008,8 @@ void file_sync_all(connection_struct *conn); void file_free(files_struct *fsp); files_struct *file_fsp(char *buf, int where); void file_chain_reset(void); +void file_chain_save(void); +void file_chain_restore(void); /*The following definitions come from smbd/groupname.c */ @@ -2210,7 +2212,7 @@ int reply_getattrE(connection_struct *conn, char *inbuf,char *outbuf, int dum_si /*The following definitions come from smbd/server.c */ -void *dflt_sig(void); +void *dflt_sig(void); void killkids(void); BOOL reload_services(BOOL test); void exit_server(char *reason); -- cgit From 12de4034c72ea5054d716bf848c2b16bef7a4d89 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 19 Aug 1998 01:49:34 +0000 Subject: Makefile.in: Moved blocking lock code into smbd/blocking.c for link purposes. include/includes.h: Added nterr.h. locking/locking.c: Moved blocking lock code into smbd/blocking.c for link purposes. smbd/close.c: Added blocking lock removal to file close. smbd/filename.c: Tidied up unix_convert() so I could read it (:-) in preparation for the stat_cache code. smbd/nttrans.c: Added WRITE_ATTRIBUTES check. smbd/reply.c: Fixed multibyte char problem in wildcard mask. Jeremy. (This used to be commit 148eaba3dadb1d0bd3ac3ef53da3d9811636e89a) --- source3/include/includes.h | 2 ++ source3/include/proto.h | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 3fd5f7be08..a2419bc42c 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -329,6 +329,8 @@ extern int errno; #include "kanji.h" #include "charset.h" +#include "nterr.h" + #ifndef MAXCODEPAGELINES #define MAXCODEPAGELINES 256 #endif diff --git a/source3/include/proto.h b/source3/include/proto.h index 07e3b70dba..9b7267658d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -480,8 +480,6 @@ char *smb_errstr(char *inbuf); /*The following definitions come from locking/locking.c */ -BOOL push_blocking_lock_request( char *inbuf, int length, int lock_timeout, int lock_num); -void process_blocking_lock_queue(time_t t); BOOL is_locked(files_struct *fsp,connection_struct *conn, uint32 count,uint32 offset, int lock_type); BOOL do_lock(files_struct *fsp,connection_struct *conn, @@ -1899,6 +1897,13 @@ uint32 lookup_user_rid(char *user_name, uint32 *rid); BOOL api_wkssvc_rpc(pipes_struct *p, prs_struct *data); +/*The following definitions come from smbd/blocking.c */ + +BOOL push_blocking_lock_request( char *inbuf, int length, int lock_timeout, int lock_num); +void remove_pending_lock_requests_by_fid(files_struct *fsp); +void remove_pending_lock_requests_by_mid(int mid); +void process_blocking_lock_queue(time_t t); + /*The following definitions come from smbd/chgpasswd.c */ BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence, BOOL as_root); -- cgit From 8487f959d10fe1ad1c8de0e97e623a2927165eaf Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 19 Aug 1998 15:01:03 +0000 Subject: added a test for a working setresuid (This used to be commit dbe333b590ef004ccbd31a14ad161d73139b2486) --- source3/include/config.h.in | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index ed3c1ac770..876fa619d1 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -110,6 +110,7 @@ #undef HAVE_FILE_MACRO #undef HAVE_FUNCTION_MACRO #undef HAVE_SETRESUID_DECL +#undef HAVE_SETRESUID #undef WITH_NETATALK /* The number of bytes in a int. */ @@ -226,9 +227,6 @@ /* Define if you have the setluid function. */ #undef HAVE_SETLUID -/* Define if you have the setresuid function. */ -#undef HAVE_SETRESUID - /* Define if you have the setsid function. */ #undef HAVE_SETSID -- cgit From dc76502cd8a950f6aff84ce4eedfd9d2b30d3dcc Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 20 Aug 1998 19:28:37 +0000 Subject: Turning on blocking locking code. NB. Blocking lock requests that are not the head of an SMB request (ie. are part of a chain) will not be queued - this will be fixed when we move to the new chain code. In practice, this doesn't seem to cause much of a problem (in my admittedly limited testing) bug a debug level zero message will be placed in the log when this happens to help determine how real the problem is. smbd/locking.c: New debug messages. smbd/blocking.c: New blocking code - handles SMBlock, SMBlockread and SMBlockingX smbd/chgpasswd.c: Fix for master fd leak. smbd/files.c: Tidyup comment. smbd/nttrans.c: Added fnum to debug message. smbd/process.c: Made chain_reply() use construct_reply_common(). Added blocking lock queue processing into idle loop. smbd/reply.c: Added queue pushes for SMBlock, SMBlockread and SMBlockingX. Jeremy. (This used to be commit e1dd03ecda0bc6d7eaa31070c83774bb5679fd1b) --- source3/include/proto.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 9b7267658d..a4cac1c2f8 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2134,8 +2134,8 @@ void invalidate_read_prediction(int fd); BOOL receive_next_smb(int smbfd, int oplockfd, char *inbuf, int bufsize, int timeout); void process_smb(char *inbuf, char *outbuf); char *smb_fn_name(int type); -int chain_reply(char *inbuf,char *outbuf,int size,int bufsize); void construct_reply_common(char *inbuf,char *outbuf); +int chain_reply(char *inbuf,char *outbuf,int size,int bufsize); int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); void smbd_process(void); @@ -2171,7 +2171,7 @@ int reply_mknew(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int reply_ctemp(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); int reply_unlink(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); int reply_readbraw(connection_struct *conn, char *inbuf, char *outbuf, int dum_size, int dum_buffsize); -int reply_lockread(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsiz); +int reply_lockread(connection_struct *conn, char *inbuf,char *outbuf, int length, int dum_buffsiz); int reply_read(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); int reply_read_and_X(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize); int reply_writebraw(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); @@ -2187,7 +2187,7 @@ int reply_close(connection_struct *conn, int reply_writeclose(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); int reply_lock(connection_struct *conn, - char *inbuf,char *outbuf, int dum_size, int dum_buffsize); + char *inbuf,char *outbuf, int length, int dum_buffsize); int reply_unlock(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); int reply_tdis(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize); -- cgit From 7d657984bbdf867319e96dee6fbf5ed5b835ad14 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 21 Aug 1998 09:43:21 +0000 Subject: added a macro ZERO_STRUCT() which is useful for initialising structures declared on the stack. (This used to be commit f323af8fce54cd5d51c848aa7ea7be4dd3538f2e) --- source3/include/smb.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index e88737f046..9d6c8d7e29 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1563,6 +1563,9 @@ extern int unix_ERR_code; #define CMD_REPLY 0x8000 +/* useful macros */ +#define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x)) + #endif /* _SMB_H */ #include "ntdomain.h" -- cgit From 038e3433d39337f736b7b69ac1e6212e9f8e5406 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 21 Aug 1998 11:37:40 +0000 Subject: added new smb.conf option "panic action". see my samba-technical explanation. (This used to be commit c6899df44c34088a4d2bf1edc840320b0ba7e32e) --- source3/include/proto.h | 3 ++- source3/include/smb.h | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index a4cac1c2f8..b89bb088dc 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -327,7 +327,7 @@ struct hostent *Get_Hostbyname(char *name); BOOL process_exists(int pid); char *uidtoname(int uid); char *gidtoname(int gid); -void ajt_panic(void); +void smb_panic(char *why); char *readdirname(void *p); BOOL is_in_path(char *name, name_compare_entry *namelist); void set_namearray(name_compare_entry **ppname_array, char *namelist); @@ -901,6 +901,7 @@ char *lp_nis_home_map_name(void); char *lp_announce_version(void); char *lp_netbios_aliases(void); char *lp_driverfile(void); +char *lp_panic_action(void); char *lp_domain_sid(void); char *lp_domain_other_sids(void); char *lp_domain_groups(void); diff --git a/source3/include/smb.h b/source3/include/smb.h index 9d6c8d7e29..a11a3ac61f 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1265,10 +1265,6 @@ void dfs_unlogin(void); extern int dcelogin_atmost_once; #endif -#if AJT -void ajt_panic(void); -#endif - #ifdef NOSTRDUP char *strdup(char *s); #endif -- cgit From bce4d95ca9f0f1b175f5eff682c961754d494253 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 22 Aug 1998 02:52:25 +0000 Subject: expanded MAX_LOOKUP_SIDS to 30 (I saw 21 in a packet) (This used to be commit bd9290c36c9993a994e485da0a81df926f8662e4) --- source3/include/rpc_lsa.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/rpc_lsa.h b/source3/include/rpc_lsa.h index 39f42dcd56..8bcc4a1338 100644 --- a/source3/include/rpc_lsa.h +++ b/source3/include/rpc_lsa.h @@ -194,7 +194,7 @@ typedef struct lsa_trans_name_info } LSA_TRANS_NAME; -#define MAX_LOOKUP_SIDS 10 +#define MAX_LOOKUP_SIDS 30 /* LSA_TRANS_NAME_ENUM - LSA Translated Name Enumeration container */ typedef struct lsa_trans_name_enum_info -- cgit From 3f3f47b0bd8d089120d267cfad1976db95cd8ebe Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 22 Aug 1998 02:54:21 +0000 Subject: added ASSERT() and ASSERT_ARRAY() macros and sprinkled them liberally in the rpc code. (This used to be commit e6ce1c5b5a9f29d8fcbbd23019186ff5c600e795) --- source3/include/smb.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index a11a3ac61f..9dc1ff5f38 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1561,6 +1561,10 @@ extern int unix_ERR_code; /* useful macros */ #define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x)) +#define ASSERT(b) ((b)?0: \ + (DEBUG(0,("PANIC: assert failed at %s(%d)\n", \ + __FILE__, __LINE__)), smb_panic("assert failed"))) +#define ASSERT_ARRAY(a,n) ASSERT((sizeof(a)/sizeof((a)[0])) >= (n)) #endif /* _SMB_H */ -- cgit From 0e877bd53bcffcaeab738610ca64c685c99f8263 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 24 Aug 1998 18:53:37 +0000 Subject: resource.h on FreeBSD 2.1 requires sys/time.h to come first. (This used to be commit e94ab03a4f97ff7ee7bb938245cf054a00f950fd) --- source3/include/includes.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index a2419bc42c..5d050bf627 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -49,6 +49,17 @@ #include +#ifdef TIME_WITH_SYS_TIME +#include +#include +#else +#ifdef HAVE_SYS_TIME_H +#include +#else +#include +#endif +#endif + #ifdef HAVE_SYS_RESOURCE_H #include #endif @@ -88,17 +99,6 @@ #include #endif -#ifdef TIME_WITH_SYS_TIME -#include -#include -#else -#ifdef HAVE_SYS_TIME_H -#include -#else -#include -#endif -#endif - #ifdef HAVE_FCNTL_H #include #else -- cgit From 8afc9c80ac11649f06e5517d819dbf201c941acb Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 24 Aug 1998 21:49:10 +0000 Subject: Changed ASSERT macros to SMB_ASSERT macros as some systems already have an ASSERT macro defined. Jeremy. (This used to be commit dbe6ad014a8b5dcbf17d7cd9865650c2e040d666) --- source3/include/smb.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 9dc1ff5f38..0a49b72a27 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1561,10 +1561,10 @@ extern int unix_ERR_code; /* useful macros */ #define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x)) -#define ASSERT(b) ((b)?0: \ +#define SMB_ASSERT(b) ((b)?(void)0: \ (DEBUG(0,("PANIC: assert failed at %s(%d)\n", \ __FILE__, __LINE__)), smb_panic("assert failed"))) -#define ASSERT_ARRAY(a,n) ASSERT((sizeof(a)/sizeof((a)[0])) >= (n)) +#define SMB_ASSERT_ARRAY(a,n) SMB_ASSERT((sizeof(a)/sizeof((a)[0])) >= (n)) #endif /* _SMB_H */ -- cgit From 2c065107b149797e2a42a6c119f883d30be411eb Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 25 Aug 1998 06:40:42 +0000 Subject: changed the default permissions code to do this: if ((sbuf->st_mode & S_IWUSR) == 0) result |= aRONLY; rather than the very complex user/group permissions checks we do currently. This is equivalent ot setting "alternate permissions = yes" in the old code. The change is motivated by three main reasons: 1) it's basically impossible to second guess whether a file is writeable without trying to open it for writing. ACLs, root squash etc just make it too hard. 2) setting it not RONLY if the owner can write is closer to what NT does (eg. look at a cdrom - files are not marked read only). 3) it prevents the silly problem of copying files from a read only share to a writeable share and then finding you can't write to them as windows preserves the RONLY flag. Lots of people get bitten by this when they drag a folder from a Samba drive. It also hurts some install programs. I have also added a new flag type for loadparm.c called FLAG_DEPRECATED which I've set for "alternate permissions". I'll soon add code to testparm to give a warning about deprecated options. (This used to be commit c4363a12fdc0be329ca2bfeb1d7b89bfe90031dc) --- source3/include/smb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 0a49b72a27..00c5464251 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -865,6 +865,7 @@ struct bitmap { #define FLAG_HIDE 2 /* options that should be hidden in SWAT */ #define FLAG_PRINT 4 /* printing options */ #define FLAG_GLOBAL 8 /* local options that should be globally settable in SWAT */ +#define FLAG_DEPRECATED 16 /* options that should no longer be used */ #ifndef LOCKING_VERSION #define LOCKING_VERSION 4 -- cgit From 0d35fe89929f801821f187b3b2257b07be01b7e4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 25 Aug 1998 06:52:26 +0000 Subject: proto changes (This used to be commit e4f81f4a230130f53857e3664e6d83ce252c207e) --- source3/include/proto.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index b89bb088dc..a96092511f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -367,6 +367,11 @@ BOOL cli_api_pipe(struct cli_state *cli, char *pipe_name, int pipe_name_len, char *data, uint32 data_count, uint32 max_data_count, char **rparam, uint32 *rparam_count, char **rdata, uint32 *rdata_count); +BOOL cli_api(struct cli_state *cli, + char *param, int prcnt, int mprcnt, + char *data, int drcnt, int mdrcnt, + char **rparam, int *rprcnt, + char **rdata, int *rdrcnt); BOOL cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation); BOOL cli_RNetShareEnum(struct cli_state *cli, void (*fn)(char *, uint32, char *)); BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype, @@ -1024,7 +1029,6 @@ char *lp_veto_files(int ); char *lp_hide_files(int ); char *lp_veto_oplocks(int ); char *lp_driverlocation(int ); -BOOL lp_alternate_permissions(int ); BOOL lp_revalidate(int ); BOOL lp_casesensitive(int ); BOOL lp_preservecase(int ); -- cgit From 3131d67cfd50ffeb2fa1cf0af948a4bb9ba6d39f Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 25 Aug 1998 13:17:04 +0000 Subject: added loads of pointless rpcsvc/ and rpc/ include files, all because rpcsvc/ypclnt.h wants a struct dom_binding. knock-on include effect under freebsd 2.1. (This used to be commit d1005b5692e41660a2a7230231b0591aa0773485) --- source3/include/config.h.in | 15 +++++++++++++++ source3/include/includes.h | 20 ++++++++++++++++++++ 2 files changed, 35 insertions(+) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 876fa619d1..dd8e509fad 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -302,6 +302,21 @@ /* Define if you have the header file. */ #undef HAVE_NETINET_TCP_H +/* Define if you have the header file. */ +#undef HAVE_RPC_TYPES_H + +/* Define if you have the header file. */ +#undef HAVE_RPC_XDR_H + +/* Define if you have the header file. */ +#undef HAVE_RPC_AUTH_H + +/* Define if you have the header file. */ +#undef HAVE_RPC_CLNT_H + +/* Define if you have the header file. */ +#undef HAVE_RPCSVC_YP_PROT_H + /* Define if you have the header file. */ #undef HAVE_RPCSVC_YPCLNT_H diff --git a/source3/include/includes.h b/source3/include/includes.h index 5d050bf627..4993a29e2b 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -254,6 +254,26 @@ #include #endif +#ifdef HAVE_RPC_TYPES_H +#include +#endif + +#ifdef HAVE_RPC_XDR_H +#include +#endif + +#ifdef HAVE_RPC_AUTH_H +#include +#endif + +#ifdef HAVE_RPC_CLNT_H +#include +#endif + +#ifdef HAVE_RPCSVC_YP_PROT_H +#include +#endif + #ifdef HAVE_RPCSVC_YPCLNT_H #include #endif -- cgit From 54499a925c9e580bbdeca12dde42af3557a01067 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 26 Aug 1998 02:02:55 +0000 Subject: took all the rpc includes back out until we can work out _why_ freebsd needs them and what should really be there. (This used to be commit c2bf18fb8d2fea5af86ba8cf5d92b1dc076dd7d5) --- source3/include/includes.h | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 4993a29e2b..55c2c1a1de 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -254,30 +254,6 @@ #include #endif -#ifdef HAVE_RPC_TYPES_H -#include -#endif - -#ifdef HAVE_RPC_XDR_H -#include -#endif - -#ifdef HAVE_RPC_AUTH_H -#include -#endif - -#ifdef HAVE_RPC_CLNT_H -#include -#endif - -#ifdef HAVE_RPCSVC_YP_PROT_H -#include -#endif - -#ifdef HAVE_RPCSVC_YPCLNT_H -#include -#endif - #ifndef uchar #define uchar unsigned char #endif -- cgit From f1451f5d2e97360a39fdee1b26e140de5619673f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 26 Aug 1998 02:36:27 +0000 Subject: get includes right for systems that use getpwanam() (This used to be commit afe98165a261a740cd0ee88bf041d69721ec72e6) --- source3/include/includes.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 55c2c1a1de..38f0719164 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -244,6 +244,12 @@ #include #endif +#ifdef HAVE_GETPWANAM +#include +#include +#include +#endif + #ifdef HAVE_SYS_SECURITY_H #include #include -- cgit From 520d24c191941289ae1e86bc372cde4908a9fa35 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 26 Aug 1998 03:06:48 +0000 Subject: use a separate ZERO_ARRAY() macro instead of ZERO_STRUCT() for arrays. This prevents (harmless) warnings from some compilers (This used to be commit c2da46d1d0820a86e7f77506563cfe7f67b08fee) --- source3/include/smb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 00c5464251..31e3b645b1 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1562,6 +1562,7 @@ extern int unix_ERR_code; /* useful macros */ #define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x)) +#define ZERO_ARRAY(x) memset((char *)(x), 0, sizeof(x)) #define SMB_ASSERT(b) ((b)?(void)0: \ (DEBUG(0,("PANIC: assert failed at %s(%d)\n", \ __FILE__, __LINE__)), smb_panic("assert failed"))) -- cgit From 5e5e320d361afcb4d9503354b3912b4c7a672197 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 27 Aug 1998 20:38:53 +0000 Subject: This is the stat cache code - seems to work fine (needs heavy NetBench testing though.... :-). Attempts to efficiently reduce the number of stat() calls Samba does. Jeremy. (This used to be commit d0e48a2d8072c3e77a57ac6a2fb5044c05f03b41) --- source3/include/includes.h | 4 ++++ source3/include/proto.h | 4 +++- source3/include/smb.h | 8 ++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 38f0719164..4efa475424 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -419,6 +419,10 @@ union semun { #define HAVE_NETGROUP 1 #endif +#if defined (HAVE_NETGROUP) && defined(HAVE_RPCSVC_YPCLNT_H) +#include "rpcsvc/ypclnt.h" +#endif + #ifndef ALLOW_CHANGE_PASSWORD #if (defined(HAVE_TERMIOS_H) && defined(HAVE_DUP2) && defined(HAVE_SETSID)) #define ALLOW_CHANGE_PASSWORD 1 diff --git a/source3/include/proto.h b/source3/include/proto.h index a96092511f..85e00b375b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2000,7 +2000,9 @@ void sync_file(connection_struct *conn, files_struct *fsp); BOOL fname_equal(char *name1, char *name2); BOOL mangled_equal(char *name1, char *name2); -BOOL unix_convert(char *name,connection_struct *conn,char *saved_last_component, BOOL *bad_path); +void print_stat_cache_statistics(void); +BOOL unix_convert(char *name,connection_struct *conn,char *saved_last_component, + BOOL *bad_path, struct stat *pst); BOOL check_name(char *name,connection_struct *conn); BOOL scan_directory(char *path, char *name,connection_struct *conn,BOOL docache); diff --git a/source3/include/smb.h b/source3/include/smb.h index 31e3b645b1..b615d09708 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -908,6 +908,14 @@ struct bitmap { #define IS_VETO_PATH(conn,path) ((conn) && is_in_path((path),(conn)->veto_list)) #define IS_VETO_OPLOCK_PATH(conn,path) ((conn) && is_in_path((path),(conn)->veto_oplock_list)) +/* + * Used by the stat cache code to check if a returned + * stat structure is valid. + */ + +#define VALID_STAT(st) (st.st_nlink != 0) +#define VALID_STAT_OF_DIR(st) (VALID_STAT(st) && S_ISDIR(st.st_mode)) + #define SMBENCRYPT() (lp_encrypted_passwords()) /* the basic packet size, assuming no words or bytes */ -- cgit From 38142a1ebbe860778e26eaff68585726061c05e2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 28 Aug 1998 21:46:29 +0000 Subject: This checking fixes the statcache bug that stopped NetBench from running correctly. Added new parameter "stat cache size" - set to 50 by default. I now declare the statcache code officially "open" for business :-). It gets a hit rate of 97% with a NetBench run and seems to make using a case insensitive run as efficient as a case sensitive run. Also tidied up our sys_select usage - added a maxfd parameter and also added an implementation of select in terms of poll(), for systems where poll() is much faster. This is disabled by default. Jeremy. (This used to be commit 779b924ec1f6c81ff578d22295b20fece698d1fc) --- source3/include/proto.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 85e00b375b..6594ac6143 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -162,8 +162,8 @@ int smbrun(char *cmd,char *outfile,BOOL shared); /*The following definitions come from lib/system.c */ -int sys_select(fd_set *fds,struct timeval *tval); -int sys_select(fd_set *fds,struct timeval *tval); +int sys_select(int maxfd, fd_set *fds,struct timeval *tval); +int sys_select(int maxfd, fd_set *fds,struct timeval *tval); int sys_unlink(char *fname); int sys_open(char *fname,int flags,int mode); DIR *sys_opendir(char *dname); @@ -992,6 +992,7 @@ int lp_lm_announce(void); int lp_lm_interval(void); int lp_machine_password_timeout(void); int lp_change_notify_timeout(void); +int lp_stat_cache_size(void); int lp_ldap_port(void); char *lp_preexec(int ); char *lp_postexec(int ); -- cgit From c021867feea2a7a1bc29ec89d7625754220f0431 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 30 Aug 1998 04:30:57 +0000 Subject: changed the size of a char array in the userdata_struct from 1 to 16 to account for padding/alignment issues. Eventually I'd like to find a way to get rid of this construct altogether as it is a bit error prone and hard to debug. also added a new macro: ZERO_STRUCTP() that takes a pointer to a structure and zeros the structure. Used in nmbd to zero allocated structures before freeing them to try to catch bugs a bit faster. (This used to be commit d3dda65d5177154e2128f50ca3dd34e8e13b6b08) --- source3/include/nameserv.h | 2 +- source3/include/proto.h | 1 + source3/include/smb.h | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index 80d9667d1c..fe00a1415d 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -278,7 +278,7 @@ struct userdata_struct { userdata_copy_fn copy_fn; userdata_free_fn free_fn; unsigned int userdata_len; - char data[1]; + char data[16]; /* 16 is to ensure alignment/padding on all systems */ }; struct response_record; diff --git a/source3/include/proto.h b/source3/include/proto.h index 6594ac6143..991e4f3e31 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -356,6 +356,7 @@ char *tab_depth(int depth); char *sid_to_string(pstring sidstr_out, DOM_SID *sid); BOOL string_to_sid(DOM_SID *sidout, char *sidstr); int str_checksum(char *s); +void zero_free(void *p, int size); /*The following definitions come from libsmb/clientgen.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index b615d09708..90435b208e 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1569,8 +1569,17 @@ extern int unix_ERR_code; #define CMD_REPLY 0x8000 /* useful macros */ + +/* zero a structure */ #define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x)) + +/* zero a structure given a pointer to the structure */ +#define ZERO_STRUCTP(x) memset((char *)(x), 0, sizeof(*(x))) + +/* zero an array - note that sizeof(array) must work - ie. it must not be a + pointer */ #define ZERO_ARRAY(x) memset((char *)(x), 0, sizeof(x)) + #define SMB_ASSERT(b) ((b)?(void)0: \ (DEBUG(0,("PANIC: assert failed at %s(%d)\n", \ __FILE__, __LINE__)), smb_panic("assert failed"))) -- cgit From 5a44ce9caaa9e3b19ee387b698ac255ec2cb5785 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 30 Aug 1998 05:43:59 +0000 Subject: changed the format of the wins.dat file slightly. It now has a line like this: VERSION 1 251152 the first number is a version #define in nmbd_winsserver.c and will be used if we ever have to change the format again. The second number is a hash of the current interfaces setting. It is used to detect the case where nmbd is restarted on a machine after the IP of the machine has changed (or the interfaces list has changed in any way). When that happens we need to discard the old wins.dat cache or you end up with chaos. This has bitten quite a few people, they find that when they move a machine it continues using the old IP for some things for the next week until the wins entries time out! I've checked, and the old nmbd can handle the new format, although it does spit out a spurious error message about the VERSION line. So users can safely run 2.0alpha then switch back to 1.9.18 without problems. (This used to be commit c4a8cdc60a5b01894ab2456e77b6d89d4c16a088) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 991e4f3e31..0312d25f86 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -102,6 +102,7 @@ int iface_count(void); BOOL we_are_multihomed(void); struct interface *get_interface(int n); struct in_addr *iface_n_ip(int n); +unsigned iface_hash(void); struct in_addr *iface_bcast(struct in_addr ip); struct in_addr *iface_nmask(struct in_addr ip); struct in_addr *iface_ip(struct in_addr ip); -- cgit From 179e8c66f121e01b5e69ad8b1c39f8a1a1e45814 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 30 Aug 1998 08:45:23 +0000 Subject: changed the way that name query records are sorted in replies. They are now sorted by the number of common leading bits in the IP address with the address of the querying host. (This used to be commit 4460a1bc6aa7666d1c71d32ba73855d6ed32320a) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 0312d25f86..56e7d7f88f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -458,6 +458,7 @@ void make_nmb_name( struct nmb_name *n, char *name, int type, char *this_scope ) BOOL nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2); BOOL send_packet(struct packet_struct *p); struct packet_struct *receive_packet(int fd,enum packet_type type,int t); +void sort_query_replies(char *data, int n, struct in_addr ip); /*The following definitions come from libsmb/nterr.c */ -- cgit From 998db177ba25d0fb1fc12b1528025bf975b7c6ad Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 30 Aug 1998 15:58:17 +0000 Subject: finished the asynchronous browse synchronisation code. It even seems to work (not a lot of testing yet though). Now we just need to deal with people worried about having more than two nmbd processes sometimes. (the async processes are created on demand for browse sync, so you'll only see more than 2 occasionally) (This used to be commit a350a54680e4170e2adf571b010ea508e7291780) --- source3/include/proto.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 56e7d7f88f..784d130d23 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -579,6 +579,7 @@ void dmb_expire_and_sync_browser_lists(time_t t); void announce_and_sync_with_domain_master_browser( struct subnet_record *subrec, struct work_record *work); void collect_all_workgroup_names_from_wins_server(time_t t); +void sync_all_dmbs(time_t t); /*The following definitions come from nmbd/nmbd_elections.c */ @@ -836,6 +837,13 @@ BOOL we_are_a_wins_client(void); struct subnet_record *get_next_subnet_maybe_unicast(struct subnet_record *subrec); struct subnet_record *get_next_subnet_maybe_unicast_or_wins_server(struct subnet_record *subrec); +/*The following definitions come from nmbd/nmbd_synclists.c */ + +void sync_browse_lists(struct work_record *work, + char *name, int nm_type, + struct in_addr ip, BOOL local, BOOL servers); +void sync_check_completion(void); + /*The following definitions come from nmbd/nmbd_winsproxy.c */ void make_wins_proxy_name_query_request( struct subnet_record *subrec, -- cgit From ab4577f141b0c08a543d998a36892bbafae4e902 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 30 Aug 1998 17:04:24 +0000 Subject: added a dest_port parameter to send_mailslot() so we send replies to the correct port in environments like ip masq. (This used to be commit 7d455ee637b6ff70c95845f89d71573ca07b83f3) --- source3/include/proto.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 784d130d23..ae38ece1a2 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -782,7 +782,8 @@ BOOL listen_for_packets(BOOL run_election); BOOL send_mailslot(BOOL unique, char *mailslot,char *buf,int len, char *srcname, int src_type, char *dstname, int dest_type, - struct in_addr dest_ip,struct in_addr src_ip); + struct in_addr dest_ip,struct in_addr src_ip, + int dest_port); /*The following definitions come from nmbd/nmbd_processlogon.c */ -- cgit From 61b5fd6f32e9ccb612df1354a3e3b3bed5f2b808 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 31 Aug 1998 03:11:42 +0000 Subject: bounds check next_token() to prevent possible buffer overflows (This used to be commit 3eade55dc7c842bdc50205c330802d211fae54d3) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index ae38ece1a2..8ee95483c5 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -216,7 +216,7 @@ BOOL user_in_list(char *user,char *list); char *tmpdir(void); BOOL is_a_socket(int fd); -BOOL next_token(char **ptr,char *buff,char *sep); +BOOL next_token(char **ptr,char *buff,char *sep, int bufsize); char **toktocliplist(int *ctok, char *sep); void *mem_dup( void *from, int size ); void array_promote(char *array,int elsize,int element); -- cgit From 055e3c88e6d88bd7dee5ae9c87dc04433124f660 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 31 Aug 1998 04:19:31 +0000 Subject: set a maximum name refresh time of 20 minutes. The previous code was strictly correct, but not very practical. self names were only refreshed every 3 days. I hit a situation where the Samba WINS server was restarted after deleting wins.dat and didn't notice some remote subnets (also running Samba). I realised that the complete database wouldn't have been rebuilt for 3 days, which is way too long. In order to recover from WINS restarts we need a much shorter maximum refresh time. (This used to be commit 1d23dd0912e81ff72695bd043e8e2aee32da18a8) --- source3/include/nameserv.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index fe00a1415d..c219a1f723 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -546,6 +546,10 @@ struct packet_struct /* Do all remote announcements this often. */ #define REMOTE_ANNOUNCE_INTERVAL 180 +/* what is the maximum period between name refreshes. Note that this only + affects non-permanent self names */ +#define MAX_REFRESH_TIME (60*20) + /* Types of machine we can announce as. */ #define ANNOUNCE_AS_NT 1 #define ANNOUNCE_AS_WIN95 2 -- cgit From 60be7d222e9278390e1ef9e33f0a76ff0599c005 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 31 Aug 1998 05:21:39 +0000 Subject: fixed a comment (This used to be commit 560ed560f46e69255b6437e50ba0865b642c38b1) --- source3/include/nameserv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index c219a1f723..e50ad042d9 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -547,7 +547,7 @@ struct packet_struct #define REMOTE_ANNOUNCE_INTERVAL 180 /* what is the maximum period between name refreshes. Note that this only - affects non-permanent self names */ + affects non-permanent self names (in seconds) */ #define MAX_REFRESH_TIME (60*20) /* Types of machine we can announce as. */ -- cgit From 693480af8bb2d3e83566af9463ca427f47a879da Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 31 Aug 1998 20:20:54 +0000 Subject: configure.in, configure: include/config.h.in: Added stropts and poll. include/smb.h: Moved old typedefs of uint8 etc. into include/includes.h where all the other defines live (changed them from typedefs to defines). Other changes : changed from using uint32 to SMB_DEV_T and SMB_INO_T in preparation for moving to size independed (ie. 64 bit clean) device and inode access. Stat call wrapper comes next :-). Jeremy. (This used to be commit 3d9ec96de5e04e83abafe9c5d980bd39eee856ea) --- source3/include/config.h.in | 6 +++++ source3/include/includes.h | 45 ++++++++++++++++++++++++++++++++++++++ source3/include/proto.h | 12 +++++----- source3/include/smb.h | 53 ++++++++++----------------------------------- 4 files changed, 69 insertions(+), 47 deletions(-) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index dd8e509fad..f67061a289 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -302,6 +302,9 @@ /* Define if you have the header file. */ #undef HAVE_NETINET_TCP_H +/* Define if you have the header file. */ +#undef HAVE_POLL_H + /* Define if you have the header file. */ #undef HAVE_RPC_TYPES_H @@ -338,6 +341,9 @@ /* Define if you have the header file. */ #undef HAVE_STRINGS_H +/* Define if you have the header file. */ +#undef HAVE_STROPTS_H + /* Define if you have the header file. */ #undef HAVE_SYS_DIR_H diff --git a/source3/include/includes.h b/source3/include/includes.h index 4efa475424..8b7620e4f9 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -260,6 +260,14 @@ #include #endif +#ifdef HAVE_STROPTS_H +#include +#endif + +#ifdef HAVE_POLL_H +#include +#endif + #ifndef uchar #define uchar unsigned char #endif @@ -270,6 +278,31 @@ #define schar char #endif +/* + Samba needs type definitions for int16, int32, uint16 and uint32. + + Normally these are signed and unsigned 16 and 32 bit integers, but + they actually only need to be at least 16 and 32 bits + respectively. Thus if your word size is 8 bytes just defining them + as signed and unsigned int will work. +*/ + +#ifndef uint8 +#define uint8 unsigned char +#endif + +#ifndef int16 +#if (SIZEOF_SHORT == 4) +#define int16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16; +#else /* SIZEOF_SHORT != 4 */ +#define int16 short +#endif /* SIZEOF_SHORT != 4 */ +#endif + +#ifndef uint16 +#define uint16 unsigned int16 +#endif + #ifndef int32 #if (SIZEOF_INT == 4) #define int32 int @@ -284,6 +317,18 @@ #define uint32 unsigned int32 #endif +/* + * Type for device and inodes. + */ + +#ifndef SMB_DEV_T +#define SMB_DEV_T uint32 +#endif + +#ifndef SMB_INO_T +#define SMB_INO_T uint32 +#endif + #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif diff --git a/source3/include/proto.h b/source3/include/proto.h index 8ee95483c5..3bc2a132a0 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -498,11 +498,11 @@ BOOL do_unlock(files_struct *fsp,connection_struct *conn, BOOL locking_init(int read_only); BOOL locking_end(void); BOOL lock_share_entry(connection_struct *conn, - uint32 dev, uint32 inode, int *ptok); + SMB_DEV_T dev, SMB_INO_T inode, int *ptok); BOOL unlock_share_entry(connection_struct *conn, - uint32 dev, uint32 inode, int token); + SMB_DEV_T dev, SMB_INO_T inode, int token); int get_share_modes(connection_struct *conn, - int token, uint32 dev, uint32 inode, + int token, SMB_DEV_T dev, SMB_INO_T inode, share_mode_entry **shares); void del_share_mode(int token, files_struct *fsp); BOOL set_share_mode(int token, files_struct *fsp, uint16 port, uint16 op_type); @@ -2027,7 +2027,7 @@ file_fd_struct *fd_get_new(void); void file_close_conn(connection_struct *conn); void file_init(void); void file_close_user(int vuid); -files_struct *file_find_dit(int dev, int inode, struct timeval *tval); +files_struct *file_find_dit(SMB_DEV_T dev, SMB_INO_T inode, struct timeval *tval); files_struct *file_find_print(void); void file_sync_all(connection_struct *conn); void file_free(files_struct *fsp); @@ -2102,9 +2102,9 @@ int check_share_mode( share_mode_entry *share, int deny_mode, char *fname, BOOL open_oplock_ipc(void); BOOL process_local_message(int sock, char *buffer, int buf_size); -BOOL oplock_break(uint32 dev, uint32 inode, struct timeval *tval); +BOOL oplock_break(SMB_DEV_T dev, SMB_INO_T inode, struct timeval *tval); BOOL request_oplock_break(share_mode_entry *share_entry, - uint32 dev, uint32 inode); + SMB_DEV_T dev, SMB_INO_T inode); BOOL attempt_close_oplocked_file(files_struct *fsp); /*The following definitions come from smbd/password.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index 90435b208e..b27c531937 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -48,35 +48,6 @@ typedef int BOOL; /* limiting size of ipc replies */ #define REALLOC(ptr,size) Realloc(ptr,MAX((size),4*1024)) -/* - Samba needs type definitions for int16, int32, uint16 and uint32. - - Normally these are signed and unsigned 16 and 32 bit integers, but - they actually only need to be at least 16 and 32 bits - respectively. Thus if your word size is 8 bytes just defining them - as signed and unsigned int will work. -*/ - -#ifndef uint8 -typedef unsigned char uint8; -#endif - -#ifndef uint16 -typedef unsigned short uint16; -#endif - -#ifndef uchar -#define uchar unsigned char -#endif - -#ifndef int16 -#define int16 short -#endif - -#ifndef uint16 -#define uint16 unsigned short -#endif - #define SIZEOFWORD 2 #ifndef DEF_CREATE_MASK @@ -507,8 +478,8 @@ typedef struct file_fd_struct uint16 ref_count; uint16 uid_cache_count; uid_t uid_users_cache[10]; - uint32 dev; - uint32 inode; + SMB_DEV_T dev; + SMB_INO_T inode; int fd; int fdnum; int fd_readonly; @@ -701,9 +672,9 @@ typedef struct to support the following operations */ struct share_ops { BOOL (*stop_mgmt)(void); - BOOL (*lock_entry)(connection_struct *, uint32 , uint32 , int *); - BOOL (*unlock_entry)(connection_struct *, uint32 , uint32 , int ); - int (*get_entries)(connection_struct *, int , uint32 , uint32 , share_mode_entry **); + BOOL (*lock_entry)(connection_struct *, SMB_DEV_T , SMB_INO_T , int *); + BOOL (*unlock_entry)(connection_struct *, SMB_DEV_T , SMB_INO_T , int ); + int (*get_entries)(connection_struct *, int , SMB_DEV_T , SMB_INO_T , share_mode_entry **); void (*del_entry)(int , files_struct *); BOOL (*set_entry)(int, files_struct *, uint16 , uint16 ); BOOL (*remove_oplock)(files_struct *, int); @@ -1551,19 +1522,19 @@ extern int unix_ERR_code; * * Form of this is : * - * 0 2 6 10 14 18 22 + * 0 2 6 10 14 14+devsize 14+devsize+inodesize * +----+--------+--------+--------+-------+--------+ - * | cmd| pid | dev | inode | sec | usec | + * | cmd| pid | sec | usec | dev | inode | * +----+--------+--------+--------+-------+--------+ */ #define OPLOCK_BREAK_CMD 0x1 #define OPLOCK_BREAK_PID_OFFSET 2 -#define OPLOCK_BREAK_DEV_OFFSET 6 -#define OPLOCK_BREAK_INODE_OFFSET 10 -#define OPLOCK_BREAK_SEC_OFFSET 14 -#define OPLOCK_BREAK_USEC_OFFSET 18 -#define OPLOCK_BREAK_MSG_LEN 22 +#define OPLOCK_BREAK_SEC_OFFSET 6 +#define OPLOCK_BREAK_USEC_OFFSET 10 +#define OPLOCK_BREAK_DEV_OFFSET 14 +#define OPLOCK_BREAK_INODE_OFFSET (OPLOCK_BREAK_DEV_OFFSET + sizeof(SMB_DEV_T)) +#define OPLOCK_BREAK_MSG_LEN (OPLOCK_BREAK_INODE_OFFSET + sizeof(SMB_INO_T)) #define CMD_REPLY 0x8000 -- cgit From 18556274139cc5a00593471bd745354d98a35303 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 1 Sep 1998 20:11:54 +0000 Subject: More abstraction of file system data types, to move to a 64 bit file interface for the NT SMB's. Created a new define, SMB_STRUCT_STAT that currently is defined to be struct stat - this wil change to a user defined type containing 64 bit info when the correct wrappers are written for 64 bit stat(), fstat() and lstat() calls. Also changed all sys_xxxx() calls that were previously just wrappers to the same call prefixed by a dos_to_unix() call into dos_xxxx() calls. This makes it explicit when a pathname translation is being done, and when it is not. Now, all sys_xxx() calls are meant to be wrappers to mask OS differences, and not silently converting filenames on the fly. Jeremy. (This used to be commit 28aa182dbffaa4ffd86047e608400de4b26e80eb) --- source3/include/includes.h | 11 +++++++++++ source3/include/proto.h | 38 +++++++++++++++++++------------------- 2 files changed, 30 insertions(+), 19 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 8b7620e4f9..15112cb163 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -329,6 +329,17 @@ #define SMB_INO_T uint32 #endif +/* + * Type for stat structure. This will + * soon change to a user defined type + * once we wrap stat(), fstat() and lstat() + * for 64 bit file sizes. JRA. + */ + +#ifndef SMB_STRUCT_STAT +#define SMB_STRUCT_STAT struct stat +#endif + #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif diff --git a/source3/include/proto.h b/source3/include/proto.h index 3bc2a132a0..01ae342f98 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -165,18 +165,18 @@ int smbrun(char *cmd,char *outfile,BOOL shared); int sys_select(int maxfd, fd_set *fds,struct timeval *tval); int sys_select(int maxfd, fd_set *fds,struct timeval *tval); -int sys_unlink(char *fname); -int sys_open(char *fname,int flags,int mode); -DIR *sys_opendir(char *dname); -int sys_stat(char *fname,struct stat *sbuf); +int dos_unlink(char *fname); +int dos_open(char *fname,int flags,int mode); +DIR *dos_opendir(char *dname); +int dos_stat(char *fname,SMB_STRUCT_STAT *sbuf); int sys_waitpid(pid_t pid,int *status,int options); -int sys_lstat(char *fname,struct stat *sbuf); -int sys_mkdir(char *dname,int mode); -int sys_rmdir(char *dname); -int sys_chdir(char *dname); -int sys_utime(char *fname,struct utimbuf *times); -int sys_rename(char *from, char *to); -int sys_chmod(char *fname,int mode); +int dos_lstat(char *fname,struct stat *sbuf); +int dos_mkdir(char *dname,int mode); +int dos_rmdir(char *dname); +int dos_chdir(char *dname); +int dos_utime(char *fname,struct utimbuf *times); +int dos_rename(char *from, char *to); +int dos_chmod(char *fname,int mode); char *sys_getwd(char *s); int sys_chown(char *fname,int uid,int gid); int sys_chroot(char *dname); @@ -199,7 +199,7 @@ time_t make_unix_date2(void *date_ptr); time_t make_unix_date3(void *date_ptr); char *http_timestring(time_t t); char *timestring(void ); -time_t get_create_time(struct stat *st,BOOL fake_dirs); +time_t get_create_time(SMB_STRUCT_STAT *st,BOOL fake_dirs); /*The following definitions come from lib/ufc.c */ @@ -227,9 +227,9 @@ char *StrCpy(char *dest,char *src); char *StrnCpy(char *dest,char *src,int n); void putip(void *dest,void *src); int name_mangle( char *In, char *Out, char name_type ); -BOOL file_exist(char *fname,struct stat *sbuf); +BOOL file_exist(char *fname,SMB_STRUCT_STAT *sbuf); time_t file_modtime(char *fname); -BOOL directory_exist(char *dname,struct stat *st); +BOOL directory_exist(char *dname,SMB_STRUCT_STAT *st); uint32 file_size(char *file_name); char *attrib_string(int mode); int StrCaseCmp(char *s, char *t); @@ -1977,7 +1977,7 @@ BOOL dptr_fill(char *buf1,unsigned int key); BOOL dptr_zero(char *buf); void *dptr_fetch(char *buf,int *num); void *dptr_fetch_lanman2(int dptr_num); -BOOL dir_check_ftype(connection_struct *conn,int mode,struct stat *st,int dirtype); +BOOL dir_check_ftype(connection_struct *conn,int mode,SMB_STRUCT_STAT *st,int dirtype); BOOL get_dir_entry(connection_struct *conn,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend); void *OpenDir(connection_struct *conn, char *name, BOOL use_veto); void CloseDir(void *p); @@ -1991,8 +1991,8 @@ void DirCacheFlush(int snum); /*The following definitions come from smbd/dosmode.c */ mode_t unix_mode(connection_struct *conn,int dosmode); -int dos_mode(connection_struct *conn,char *path,struct stat *sbuf); -int dos_chmod(connection_struct *conn,char *fname,int dosmode,struct stat *st); +int dos_mode(connection_struct *conn,char *path,SMB_STRUCT_STAT *sbuf); +int file_chmod(connection_struct *conn,char *fname,int dosmode,SMB_STRUCT_STAT *st); int file_utime(connection_struct *conn, char *fname, struct utimbuf *times); BOOL set_filetime(connection_struct *conn, char *fname, time_t mtime); @@ -2015,14 +2015,14 @@ BOOL fname_equal(char *name1, char *name2); BOOL mangled_equal(char *name1, char *name2); void print_stat_cache_statistics(void); BOOL unix_convert(char *name,connection_struct *conn,char *saved_last_component, - BOOL *bad_path, struct stat *pst); + BOOL *bad_path, SMB_STRUCT_STAT *pst); BOOL check_name(char *name,connection_struct *conn); BOOL scan_directory(char *path, char *name,connection_struct *conn,BOOL docache); /*The following definitions come from smbd/files.c */ files_struct *file_new(void ); -file_fd_struct *fd_get_already_open(struct stat *sbuf); +file_fd_struct *fd_get_already_open(SMB_STRUCT_STAT *sbuf); file_fd_struct *fd_get_new(void); void file_close_conn(connection_struct *conn); void file_init(void); -- cgit From 0b5cc173099c7fd5ea4865ef4197739ec87e4c35 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 3 Sep 1998 03:14:31 +0000 Subject: fixed a bug in the name mangling code. It implicitly assumed that mangling a name can't increase it's size which isn't true. (imagine a file called "L B" which mangles to "LB~XX") The symptoms were that users couldn't run batch files from short directory names that contained non 8.3 characters (such as spaces). (This used to be commit c319d8ea3f8b42bb3a8e501642971ed0bdb21583) --- source3/include/proto.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 01ae342f98..969b8c6a86 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -170,7 +170,7 @@ int dos_open(char *fname,int flags,int mode); DIR *dos_opendir(char *dname); int dos_stat(char *fname,SMB_STRUCT_STAT *sbuf); int sys_waitpid(pid_t pid,int *status,int options); -int dos_lstat(char *fname,struct stat *sbuf); +int dos_lstat(char *fname,SMB_STRUCT_STAT *sbuf); int dos_mkdir(char *dname,int mode); int dos_rmdir(char *dname); int dos_chdir(char *dname); @@ -305,7 +305,6 @@ int set_filelen(int fd, long len); int byte_checksum(char *buf,int len); char *dirname_dos(char *path,char *buf); void *Realloc(void *p,int size); -void Abort(void ); BOOL get_myname(char *my_name,struct in_addr *ip); BOOL ip_equal(struct in_addr ip1,struct in_addr ip2); int open_socket_in(int type, int port, int dlevel,uint32 socket_addr); @@ -2052,8 +2051,8 @@ BOOL is_mangled( char *s ); BOOL is_8_3( char *fname, BOOL check_case ); void reset_mangled_cache( void ); BOOL check_mangled_cache( char *s ); -void mangle_name_83( char *s, int s_len ); -BOOL name_map_mangle( char *OutName, BOOL need83, int snum ); +void mangle_name_83( char *s); +BOOL name_map_mangle(char *OutName, BOOL need83, int snum); /*The following definitions come from smbd/message.c */ @@ -2291,7 +2290,6 @@ char *quotequotes(char *s); void quote_spaces(char *buf); void cgi_setup(char *rootdir, int auth_required); char *cgi_baseurl(void); -char *cgi_rooturl(void); char *cgi_pathinfo(void); char *cgi_remote_host(void); char *cgi_remote_addr(void); -- cgit From 7bb86c1b132bce31a006ea9768a54db7a45fe1a5 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 3 Sep 1998 18:40:31 +0000 Subject: Ok - this is the 64 bit widening check in. It changes the configure to check for stat64 and friends, and then changes much of Samba to use the data type SMB_OFF_T for file size information. stat/fstat/lstat/lseek/ftruncate have now become sys_stat etc. to hide the 64 bit calls if needed. Note that this still does not expose 64 bit functionality to the client, as the changes to the reply_xxx smb's are not yet done. This code change should make these changes possible. Still to do before full 64 bit-ness to the client: fcntl lock code. statfs code widening of dev_t and ino_t (now possible due to SMB_DEV_T and SMB_OFF_T types being in place). Let me know if wierd things happen after this check-in and I'll fix them :-). Jeremy. (This used to be commit 14500936c321d15995c963766aac67bf1f4e3824) --- source3/include/config.h.in | 16 ++++++++++++++++ source3/include/includes.h | 30 +++++++++++++++++++++++++----- source3/include/proto.h | 22 ++++++++++++++-------- source3/include/smb.h | 12 ++++++------ 4 files changed, 61 insertions(+), 19 deletions(-) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index f67061a289..71304c86b4 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -59,6 +59,7 @@ #undef HAVE_ERRNO_DECL #undef HAVE_LONGLONG #undef HAVE_OFF64_T +#undef SIZEOF_OFF_T #undef HAVE_REMSH #undef HAVE_UNSIGNED_CHAR #undef HAVE_UTIMBUF @@ -158,6 +159,21 @@ /* Define if you have the ftruncate function. */ #undef HAVE_FTRUNCATE +/* Define if you have the stat64 function. */ +#undef HAVE_STAT64 + +/* Define if you have the fstat64 function. */ +#undef HAVE_FSTAT64 + +/* Define if you have the lstat64 function. */ +#undef HAVE_LSTAT64 + +/* Define if you have the lseek64 function. */ +#undef HAVE_LSEEK64 + +/* Define if you have the ftruncate64 function. */ +#undef HAVE_FTRUNCATE64 + /* Define if you have the getauthuid function. */ #undef HAVE_GETAUTHUID diff --git a/source3/include/includes.h b/source3/include/includes.h index 15112cb163..41fccce5fe 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -318,7 +318,7 @@ #endif /* - * Type for device and inodes. + * Types for devices, inodes and offsets. */ #ifndef SMB_DEV_T @@ -329,16 +329,36 @@ #define SMB_INO_T uint32 #endif +#ifndef SMB_OFF_T +#ifdef HAVE_OFF64_T +#define SMB_OFF_T off64_t +#else +#define SMB_OFF_T off_t +#endif +#endif + +/* + * Set the define that tells us if we can do 64 bit + * NT SMB calls. + */ + +#ifndef LARGE_SMB_OFF_T +#if defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)) +#define LARGE_SMB_OFF_T 1 +#endif +#endif + /* - * Type for stat structure. This will - * soon change to a user defined type - * once we wrap stat(), fstat() and lstat() - * for 64 bit file sizes. JRA. + * Type for stat structure. */ #ifndef SMB_STRUCT_STAT +#if defined(HAVE_STAT64) && defined(HAVE_OFF64_T) +#define SMB_STRUCT_STAT struct stat64 +#else #define SMB_STRUCT_STAT struct stat #endif +#endif #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) diff --git a/source3/include/proto.h b/source3/include/proto.h index 969b8c6a86..0e6dc54d34 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -165,6 +165,11 @@ int smbrun(char *cmd,char *outfile,BOOL shared); int sys_select(int maxfd, fd_set *fds,struct timeval *tval); int sys_select(int maxfd, fd_set *fds,struct timeval *tval); +int sys_stat(char *fname,SMB_STRUCT_STAT *sbuf); +int sys_fstat(int fd,SMB_STRUCT_STAT *sbuf); +int sys_lstat(char *fname,SMB_STRUCT_STAT *sbuf); +int sys_ftruncate(int fd, SMB_OFF_T offset); +int sys_lseek(int fd, SMB_OFF_T offset, int whence); int dos_unlink(char *fname); int dos_open(char *fname,int flags,int mode); DIR *dos_opendir(char *dname); @@ -177,7 +182,7 @@ int dos_chdir(char *dname); int dos_utime(char *fname,struct utimbuf *times); int dos_rename(char *from, char *to); int dos_chmod(char *fname,int mode); -char *sys_getwd(char *s); +char *dos_getwd(char *s); int sys_chown(char *fname,int uid,int gid); int sys_chroot(char *dname); struct hostent *sys_gethostbyname(char *name); @@ -230,7 +235,7 @@ int name_mangle( char *In, char *Out, char name_type ); BOOL file_exist(char *fname,SMB_STRUCT_STAT *sbuf); time_t file_modtime(char *fname); BOOL directory_exist(char *dname,SMB_STRUCT_STAT *st); -uint32 file_size(char *file_name); +SMB_OFF_T file_size(char *file_name); char *attrib_string(int mode); int StrCaseCmp(char *s, char *t); int StrnCaseCmp(char *s, char *t, int n); @@ -265,7 +270,7 @@ void expand_mask(char *Mask,BOOL doext); BOOL strhasupper(char *s); BOOL strhaslower(char *s); int count_chars(char *s,char c); -void make_dir_struct(char *buf,char *mask,char *fname,unsigned int size,int mode,time_t date); +void make_dir_struct(char *buf,char *mask,char *fname,SMB_OFF_T size,int mode,time_t date); void close_low_fds(void); int set_blocking(int fd, BOOL set); int write_socket(int fd,char *buf,int len); @@ -276,7 +281,7 @@ int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew); BOOL send_keepalive(int client); int read_data(int fd,char *buffer,int N); int write_data(int fd,char *buffer,int N); -int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align); +SMB_OFF_T transfer_file(int infd,int outfd,SMB_OFF_T n,char *header,int headlen,int align); int read_smb_length(int fd,char *inbuf,int timeout); BOOL receive_smb(int fd,char *buffer, int timeout); BOOL client_receive_smb(int fd,char *buffer, int timeout); @@ -301,7 +306,7 @@ BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2); void become_daemon(void); BOOL yesno(char *p); char *fgets_slash(char *s2,int maxlen,FILE *f); -int set_filelen(int fd, long len); +int set_filelen(int fd, SMB_OFF_T len); int byte_checksum(char *buf,int len); char *dirname_dos(char *path,char *buf); void *Realloc(void *p,int size); @@ -1977,7 +1982,8 @@ BOOL dptr_zero(char *buf); void *dptr_fetch(char *buf,int *num); void *dptr_fetch_lanman2(int dptr_num); BOOL dir_check_ftype(connection_struct *conn,int mode,SMB_STRUCT_STAT *st,int dirtype); -BOOL get_dir_entry(connection_struct *conn,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend); +BOOL get_dir_entry(connection_struct *conn,char *mask,int dirtype,char *fname, + SMB_OFF_T *size,int *mode,time_t *date,BOOL check_descend); void *OpenDir(connection_struct *conn, char *name, BOOL use_veto); void CloseDir(void *p); char *ReadDirName(void *p); @@ -2003,7 +2009,7 @@ int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int /*The following definitions come from smbd/fileio.c */ -int seek_file(files_struct *fsp,uint32 pos); +SMB_OFF_T seek_file(files_struct *fsp,SMB_OFF_T pos); int read_file(files_struct *fsp,char *data,uint32 pos,int n); int write_file(files_struct *fsp,char *data,int n); void sync_file(connection_struct *conn, files_struct *fsp); @@ -2144,7 +2150,7 @@ int reply_pipe_close(connection_struct *conn, char *inbuf,char *outbuf); /*The following definitions come from smbd/predict.c */ -int read_predict(int fd,int offset,char *buf,char **ptr,int num); +int read_predict(int fd,SMB_OFF_T offset,char *buf,char **ptr,int num); void do_read_prediction(void); void invalidate_read_prediction(int fd); diff --git a/source3/include/smb.h b/source3/include/smb.h index b27c531937..8600bcc120 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -442,10 +442,10 @@ struct cli_state { typedef struct { - int size; + SMB_OFF_T size; int mode; - int uid; - int gid; + uid_t uid; + gid_t gid; /* these times are normally kept in GMT */ time_t mtime; time_t atime; @@ -559,12 +559,12 @@ typedef struct files_struct int fnum; connection_struct *conn; file_fd_struct *fd_ptr; - int pos; - uint32 size; + SMB_OFF_T pos; + SMB_OFF_T size; int mode; int vuid; char *mmap_ptr; - uint32 mmap_size; + SMB_OFF_T mmap_size; write_bmpx_struct *wbmpx_ptr; struct timeval open_time; BOOL open; -- cgit From 623a18db4b0f46c80c29e93a0ad0a2fcbfec71dc Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 4 Sep 1998 00:23:28 +0000 Subject: More 64 bit stuff - now the fcntl locks are 64 bit clean. Nearly at the stage where I can expose the 64-bit-ness to the NT clients.... Jeremy. (This used to be commit 422f1dd45074c0e28203aca5952e57bbe56676b6) --- source3/include/config.h.in | 1 + source3/include/includes.h | 60 ++++++++++++++++++++++++++++++++++++--------- source3/include/proto.h | 8 +++--- 3 files changed, 53 insertions(+), 16 deletions(-) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 71304c86b4..80160fb4b4 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -81,6 +81,7 @@ #undef HAVE_SHARED_MMAP #undef HAVE_SYSV_IPC #undef HAVE_FCNTL_LOCK +#undef HAVE_STRUCT_FLOCK64 #undef HAVE_FTRUNCATE_EXTEND #undef HAVE_TRAPDOOR_UID #undef HAVE_ROOT diff --git a/source3/include/includes.h b/source3/include/includes.h index 41fccce5fe..4086bd53fe 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -330,11 +330,11 @@ #endif #ifndef SMB_OFF_T -#ifdef HAVE_OFF64_T -#define SMB_OFF_T off64_t -#else -#define SMB_OFF_T off_t -#endif +# ifdef HAVE_OFF64_T +# define SMB_OFF_T off64_t +# else +# define SMB_OFF_T off_t +# endif #endif /* @@ -343,9 +343,9 @@ */ #ifndef LARGE_SMB_OFF_T -#if defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)) -#define LARGE_SMB_OFF_T 1 -#endif +# if defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)) +# define LARGE_SMB_OFF_T 1 +# endif #endif /* @@ -353,11 +353,47 @@ */ #ifndef SMB_STRUCT_STAT -#if defined(HAVE_STAT64) && defined(HAVE_OFF64_T) -#define SMB_STRUCT_STAT struct stat64 -#else -#define SMB_STRUCT_STAT struct stat +# if defined(HAVE_STAT64) && defined(HAVE_OFF64_T) +# define SMB_STRUCT_STAT struct stat64 +# else +# define SMB_STRUCT_STAT struct stat +# endif +#endif + +/* + * Defines for 64 bit fcntl locks. + */ + +#ifndef SMB_STRUCT_FLOCK +# if defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T) +# define SMB_STRUCT_FLOCK struct flock64 +# else +# define SMB_STRUCT_FLOCK struct flock +# endif +#endif + +#ifndef SMB_F_SETLKW +# if defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T) +# define SMB_F_SETLKW F_SETLKW64 +# else +# define SMB_F_SETLKW F_SETLKW +# endif #endif + +#ifndef SMB_F_SETLK +# if defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T) +# define SMB_F_SETLK F_SETLK64 +# else +# define SMB_F_SETLK F_SETLK +# endif +#endif + +#ifndef SMB_F_GETLK +# if defined(HAVE_STRUCT_FLOCK64) && defined(HAVE_OFF64_T) +# define SMB_F_GETLK F_GETLK64 +# else +# define SMB_F_GETLK F_GETLK +# endif #endif #ifndef MIN diff --git a/source3/include/proto.h b/source3/include/proto.h index 0e6dc54d34..7313fef8f8 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -337,7 +337,7 @@ char *readdirname(void *p); BOOL is_in_path(char *name, name_compare_entry *namelist); void set_namearray(name_compare_entry **ppname_array, char *namelist); void free_namearray(name_compare_entry *name_array); -BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type); +BOOL fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type); int file_lock(char *name,int timeout); void file_unlock(int fd); BOOL is_myname(char *s); @@ -493,12 +493,12 @@ char *smb_errstr(char *inbuf); /*The following definitions come from locking/locking.c */ BOOL is_locked(files_struct *fsp,connection_struct *conn, - uint32 count,uint32 offset, int lock_type); + SMB_OFF_T count,SMB_OFF_T offset, int lock_type); BOOL do_lock(files_struct *fsp,connection_struct *conn, - uint32 count,uint32 offset,int lock_type, + SMB_OFF_T count,SMB_OFF_T offset,int lock_type, int *eclass,uint32 *ecode); BOOL do_unlock(files_struct *fsp,connection_struct *conn, - uint32 count,uint32 offset,int *eclass,uint32 *ecode); + SMB_OFF_T count,SMB_OFF_T offset,int *eclass,uint32 *ecode); BOOL locking_init(int read_only); BOOL locking_end(void); BOOL lock_share_entry(connection_struct *conn, -- cgit From 83900f2b682c62f2b5620b29ecb710274990ac51 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 4 Sep 1998 20:53:58 +0000 Subject: Modified dev_t and ino_t code to be 64 bit clean (including changes to oplock break message passing). I think that smbd/nmbd are now inode and offset size independent (at least for 32 bit and 64 bit systems). Now to expose all this new functionality to NT clients..... Jeremy. (This used to be commit 5910d07bbf45a34d3c901461f74704c029a79474) --- source3/include/config.h.in | 2 ++ source3/include/includes.h | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 80160fb4b4..e0bcbfe6f0 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -60,6 +60,8 @@ #undef HAVE_LONGLONG #undef HAVE_OFF64_T #undef SIZEOF_OFF_T +#undef HAVE_INO64_T +#undef SIZEOF_INO_T #undef HAVE_REMSH #undef HAVE_UNSIGNED_CHAR #undef HAVE_UTIMBUF diff --git a/source3/include/includes.h b/source3/include/includes.h index 4086bd53fe..f0271906a5 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -322,11 +322,25 @@ */ #ifndef SMB_DEV_T -#define SMB_DEV_T uint32 +#define SMB_DEV_T dev_t #endif +/* + * Setup the correctly sized inode type. + */ + #ifndef SMB_INO_T -#define SMB_INO_T uint32 +# ifdef HAVE_INO64_T +# define SMB_INO_T ino64_t +# else +# define SMB_INO_T ino_t +# endif +#endif + +#ifndef LARGE_SMB_INO_T +# if defined(HAVE_INO64_T) || (defined(SIZEOF_INO_T) && (SIZEOF_INO_T == 8)) +# define LARGE_SMB_INO_T 1 +# endif #endif #ifndef SMB_OFF_T -- cgit From 1546ccfd24a712973c82fcd2064d3c48381f1360 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 5 Sep 1998 01:12:07 +0000 Subject: got rid of interpret_security(). Thanks to Jean-Francois for pointing out it is no longer used (replaced by enumerated types in loadparm.c) (This used to be commit 88df8a8b25921389ee9d017b770bbae143cc51b8) --- source3/include/proto.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 7313fef8f8..7ef9cbb677 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -315,7 +315,6 @@ BOOL ip_equal(struct in_addr ip1,struct in_addr ip2); int open_socket_in(int type, int port, int dlevel,uint32 socket_addr); int open_socket_out(int type, struct in_addr *addr, int port ,int timeout); int interpret_protocol(char *str,int def); -int interpret_security(char *str,int def); uint32 interpret_addr(char *str); struct in_addr *interpret_addr2(char *str); BOOL zero_ip(struct in_addr ip); -- cgit From 98f524bde4801bd0b013a6bc79c5552ef62b59f8 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 5 Sep 1998 03:14:40 +0000 Subject: Bugfix for leak in reference counted file struct. Added "nt smb support" parameter to allow NT SMB's to be turned off. Jeremy. (This used to be commit 63f65f5027d5022153fa2757b49c56829db1725b) --- source3/include/proto.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 7ef9cbb677..d5cfb28166 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -981,6 +981,7 @@ BOOL lp_net_wksta_user_logon(void); BOOL lp_unix_password_sync(void); BOOL lp_passwd_chat_debug(void); BOOL lp_ole_locking_compat(void); +BOOL lp_nt_smb_support(void); int lp_os_level(void); int lp_max_ttl(void); int lp_max_wins_ttl(void); @@ -2034,6 +2035,7 @@ void file_close_user(int vuid); files_struct *file_find_dit(SMB_DEV_T dev, SMB_INO_T inode, struct timeval *tval); files_struct *file_find_print(void); void file_sync_all(connection_struct *conn); +void fd_ptr_free(file_fd_struct *fd_ptr); void file_free(files_struct *fsp); files_struct *file_fsp(char *buf, int where); void file_chain_reset(void); -- cgit From e9ea36e4d2270bd7d32da12ef6d6e2299641582d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 5 Sep 1998 05:07:05 +0000 Subject: tridge the destroyer returns! prompted by the interpret_security() dead code that Jean-Francois pointed out I added a make target "finddead" that finds potentially dead (ie. unused) code. It spat out 304 function names ... I went through these are deleted many of them, making others static (finddead also reports functions that are used only in the local file). in doing this I have almost certainly deleted some useful code. I may have even prevented compilation with some compile options. I apologise. I decided it was better to get rid of this code now and add back the one or two functions that are needed than to keep all this baggage. So, if I have done a bit too much "destroying" then let me know. Keep the swearing to a minimum :) One bit I didn't do is the ubibt code. Chris, can you look at that? Heaps of unused functions there. Can they be made static? (This used to be commit 2204475c87f3024ea8fd1fbd7385b2def617a46f) --- source3/include/proto.h | 322 ------------------------------------------------ 1 file changed, 322 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index d5cfb28166..7430affd34 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5,9 +5,7 @@ /*The following definitions come from client/client.c */ -void cli_smb_close(char *inbuf, char *outbuf, int clnt_fd, int c_num, int f_num); void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(file_info *),BOOL recurse_dir, BOOL dirstoo); -void cmd_help(char *dum_in, char *dum_out); /*The following definitions come from client/clientutil.c */ @@ -34,13 +32,11 @@ BOOL cli_reopen_connection(char *inbuf,char *outbuf); /*The following definitions come from client/clitar.c */ -int padit(char *buf, int bufsize, int padsize); void cmd_block(char *dum_in, char *dum_out); void cmd_tarmode(char *dum_in, char *dum_out); void cmd_setmode(char *dum_in, char *dum_out); void cmd_tar(char *inbuf, char *outbuf); int process_tar(char *inbuf, char *outbuf); -int clipfind(char **aret, int ret, char *tok); int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind); /*The following definitions come from lib/access.c */ @@ -52,7 +48,6 @@ BOOL check_access(int sock, char *allow_list, char *deny_list); /*The following definitions come from lib/bitmap.c */ struct bitmap *bitmap_allocate(int n); -void bitmap_free(struct bitmap *bm); BOOL bitmap_set(struct bitmap *bm, unsigned i); BOOL bitmap_clear(struct bitmap *bm, unsigned i); int bitmap_find(struct bitmap *bm, unsigned ofs); @@ -96,7 +91,6 @@ char *getsmbpass(char *prompt) ; void load_interfaces(void); void iface_set_default(char *ip,char *bcast,char *nmask); BOOL ismyip(struct in_addr ip); -BOOL ismybcast(struct in_addr bcast); BOOL is_local_net(struct in_addr from); int iface_count(void); BOOL we_are_multihomed(void); @@ -104,7 +98,6 @@ struct interface *get_interface(int n); struct in_addr *iface_n_ip(int n); unsigned iface_hash(void); struct in_addr *iface_bcast(struct in_addr ip); -struct in_addr *iface_nmask(struct in_addr ip); struct in_addr *iface_ip(struct in_addr ip); /*The following definitions come from lib/kanji.c */ @@ -120,17 +113,14 @@ void mdfour(unsigned char *out, unsigned char *in, int n); void mem_init(struct mem_buf *buf, int margin); void mem_create(struct mem_buf *buf, char *data, int size, int margin, BOOL dynamic); -void mem_take(struct mem_buf *mem_to, struct mem_buf *mem_from); BOOL mem_alloc_data(struct mem_buf *buf, int size); BOOL mem_buf_copy(char *copy_into, struct mem_buf *buf, uint32 offset, uint32 len); BOOL mem_buf_init(struct mem_buf **buf, uint32 margin); void mem_buf_free(struct mem_buf **buf); -void mem_free_chain(struct mem_buf **buf); void mem_free_data(struct mem_buf *buf); BOOL mem_realloc_data(struct mem_buf *buf, int new_size); BOOL mem_grow_data(struct mem_buf **buf, BOOL io, int new_size, BOOL force_grow); -BOOL mem_find(struct mem_buf **buf, uint32 offset); uint32 mem_buf_len(struct mem_buf *buf); char *mem_data(struct mem_buf **buf, uint32 offset); @@ -223,8 +213,6 @@ char *tmpdir(void); BOOL is_a_socket(int fd); BOOL next_token(char **ptr,char *buff,char *sep, int bufsize); char **toktocliplist(int *ctok, char *sep); -void *mem_dup( void *from, int size ); -void array_promote(char *array,int elsize,int element); void set_socket_options(int fd, char *options); void close_sockets(void ); BOOL in_group(gid_t group, int current_gid, int ngroups, GID_T *groups); @@ -254,9 +242,7 @@ int smb_len(char *buf); void _smb_setlen(char *buf,int len); void smb_setlen(char *buf,int len); int set_message(char *buf,int num_words,int num_bytes,BOOL zero); -int smb_numwords(char *buf); int smb_buflen(char *buf); -int smb_buf_ofs(char *buf); char *smb_buf(char *buf); int smb_offset(char *p,char *buf); char *skip_string(char *buf,int n); @@ -272,11 +258,9 @@ BOOL strhaslower(char *s); int count_chars(char *s,char c); void make_dir_struct(char *buf,char *mask,char *fname,SMB_OFF_T size,int mode,time_t date); void close_low_fds(void); -int set_blocking(int fd, BOOL set); int write_socket(int fd,char *buf,int len); int read_udp_socket(int fd,char *buf,int len); int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out); -int read_max_udp(int fd,char *buffer,int bufsize,int maxtime); int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew); BOOL send_keepalive(int client); int read_data(int fd,char *buffer,int N); @@ -291,11 +275,9 @@ BOOL receive_message_or_smb(int smbfd, int oplock_fd, char *buffer, int buffer_len, int timeout, BOOL *got_smb); BOOL send_smb(int fd,char *buffer); -char *name_ptr(char *buf,int ofs); int name_extract(char *buf,int ofs,char *name); int name_len( char *s ); BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type); -void msleep(int t); BOOL in_list(char *s,char *list,BOOL casesensitive); BOOL string_init(char **dest,char *src); void string_free(char **s); @@ -307,8 +289,6 @@ void become_daemon(void); BOOL yesno(char *p); char *fgets_slash(char *s2,int maxlen,FILE *f); int set_filelen(int fd, SMB_OFF_T len); -int byte_checksum(char *buf,int len); -char *dirname_dos(char *path,char *buf); void *Realloc(void *p,int size); BOOL get_myname(char *my_name,struct in_addr *ip); BOOL ip_equal(struct in_addr ip1,struct in_addr ip2); @@ -321,8 +301,6 @@ BOOL zero_ip(struct in_addr ip); void reset_globals_after_fork(void); char *client_name(int fd); char *client_addr(int fd); -char *automount_server(char *user_name); -char *automount_path(char *user_name); void standard_sub_basic(char *str); void standard_sub(connection_struct *conn,char *str); BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask); @@ -337,8 +315,6 @@ BOOL is_in_path(char *name, name_compare_entry *namelist); void set_namearray(name_compare_entry **ppname_array, char *namelist); void free_namearray(name_compare_entry *name_array); BOOL fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type); -int file_lock(char *name,int timeout); -void file_unlock(int fd); BOOL is_myname(char *s); void set_remote_arch(enum remote_arch_types type); enum remote_arch_types get_remote_arch(void); @@ -347,13 +323,10 @@ char *unistrn2(uint16 *buf, int len); char *unistr2(uint16 *buf); int struni2(uint16 *p, char *buf); char *unistr(char *buf); -int unistrncpy(char *dst, char *src, int len); int unistrcpy(char *dst, char *src); char *safe_strcpy(char *dest, char *src, int maxlength); char *safe_strcat(char *dest, char *src, int maxlength); -char *align4(char *q, char *base); char *align2(char *q, char *base); -char *align_offset(char *q, char *base, int align_offset_len); void print_asc(int level, unsigned char *buf,int len); void dump_data(int level,char *buf1,int len); char *tab_depth(int depth); @@ -364,7 +337,6 @@ void zero_free(void *p, int size); /*The following definitions come from libsmb/clientgen.c */ -char *cli_smb_errstr(struct cli_state *cli); char *cli_errstr(struct cli_state *cli); BOOL cli_api_pipe(struct cli_state *cli, char *pipe_name, int pipe_name_len, uint16 *setup, uint32 setup_count, uint32 max_setup_count, @@ -451,7 +423,6 @@ BOOL resolve_name(char *name, struct in_addr *return_ip); /*The following definitions come from libsmb/nmblib.c */ -char *lookup_opcode_name( int opcode ); void debug_nmb_packet(struct packet_struct *p); char *namestr(struct nmb_name *n); struct packet_struct *copy_packet(struct packet_struct *packet); @@ -483,7 +454,6 @@ void SamOEMhash( unsigned char *data, unsigned char *key, int val); void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); void E_md4hash(uchar *passwd, uchar *p16); void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); -void nt_lm_owf_gen(char *pwd, char *nt_p16, char *p16); /*The following definitions come from libsmb/smberr.c */ @@ -548,19 +518,12 @@ int main(int argc,char *argv[]); /*The following definitions come from nmbd/nmbd_become_dmb.c */ -void unbecome_domain_master(char *workgroup_name); void add_domain_names(time_t t); /*The following definitions come from nmbd/nmbd_become_lmb.c */ void insert_permanent_name_into_unicast( struct subnet_record *subrec, struct nmb_name *nmbname, uint16 nb_type ); -void unbecome_local_master_success(struct subnet_record *subrec, - struct userdata_struct *userdata, - struct nmb_name *released_name, - struct in_addr released_ip); -void unbecome_local_master_fail(struct subnet_record *subrec, struct response_record *rrec, - struct nmb_name *fail_name); void unbecome_local_master_browser(struct subnet_record *subrec, struct work_record *work, BOOL force_new_election); void become_local_master_browser(struct subnet_record *subrec, struct work_record *work); @@ -574,7 +537,6 @@ struct browse_cache_record *create_browser_in_lmb_cache( char *work_name, struct in_addr ip ); struct browse_cache_record *find_browser_in_lmb_cache( char *browser_name ); void expire_lmb_browsers( time_t t ); -void remove_workgroup_lmb_browsers( char *work_group ); /*The following definitions come from nmbd/nmbd_browsesync.c */ @@ -636,7 +598,6 @@ void refresh_my_names(time_t t); /*The following definitions come from nmbd/nmbd_namelistdb.c */ void set_samba_nb_type(void); -BOOL ms_browser_name( char *name, int type ); void remove_name_from_namelist( struct subnet_record *subrec, struct name_record *namerec ); struct name_record *find_name_on_subnet( struct subnet_record *subrec, @@ -774,11 +735,6 @@ struct response_record *queue_node_status( struct subnet_record *subrec, void reply_netbios_packet(struct packet_struct *orig_packet, int rcode, enum netbios_reply_type_code rcv_code, int opcode, int ttl, char *data,int len); -void queue_packet(struct packet_struct *packet); -void process_browse_packet(struct packet_struct *p, char *buf,int len); -void process_lanman_packet(struct packet_struct *p, char *buf,int len); -BOOL validate_nmb_response_packet( struct nmb_packet *nmb ); -BOOL validate_nmb_packet( struct nmb_packet *nmb ); void run_packet_queue(void); void retransmit_or_expire_response_records(time_t t); BOOL listen_for_packets(BOOL run_election); @@ -795,8 +751,6 @@ void process_logon_packet(struct packet_struct *p,char *buf,int len, /*The following definitions come from nmbd/nmbd_responserecordsdb.c */ -void add_response_record(struct subnet_record *subrec, - struct response_record *rrec); void remove_response_record(struct subnet_record *subrec, struct response_record *rrec); struct response_record *make_response_record( struct subnet_record *subrec, @@ -886,7 +840,6 @@ void expire_workgroups_and_servers(time_t t); /*The following definitions come from param/loadparm.c */ -char *lp_string(char *s); char *lp_logfile(void); char *lp_smbrun(void); char *lp_configfile(void); @@ -897,7 +850,6 @@ char *lp_lockdir(void); char *lp_rootdir(void); char *lp_defaultservice(void); char *lp_msg_command(void); -char *lp_dfree_command(void); char *lp_hosts_equiv(void); char *lp_auto_services(void); char *lp_passwd_program(void); @@ -906,8 +858,6 @@ char *lp_passwordserver(void); char *lp_name_resolve_order(void); char *lp_workgroup(void); char *lp_username_map(void); -char *lp_groupname_map(void); -char *lp_character_set(void); char *lp_logon_script(void); char *lp_logon_path(void); char *lp_logon_drive(void); @@ -918,19 +868,15 @@ char *lp_wins_server(void); char *lp_interfaces(void); char *lp_socket_address(void); char *lp_nis_home_map_name(void); -char *lp_announce_version(void); char *lp_netbios_aliases(void); char *lp_driverfile(void); char *lp_panic_action(void); char *lp_domain_sid(void); -char *lp_domain_other_sids(void); char *lp_domain_groups(void); char *lp_domain_admin_group(void); char *lp_domain_guest_group(void); char *lp_domain_admin_users(void); char *lp_domain_guest_users(void); -char *lp_domain_hostsallow(void); -char *lp_domain_hostsdeny(void); char *lp_ldap_server(void); char *lp_ldap_suffix(void); char *lp_ldap_filter(void); @@ -961,7 +907,6 @@ BOOL lp_domain_logons(void); BOOL lp_preferred_master(void); BOOL lp_load_printers(void); BOOL lp_use_rhosts(void); -BOOL lp_getwdcache(void); BOOL lp_readprediction(void); BOOL lp_readbmpx(void); BOOL lp_readraw(void); @@ -975,7 +920,6 @@ BOOL lp_timestamp_logs(void); BOOL lp_browse_list(void); BOOL lp_unix_realname(void); BOOL lp_nis_home_map(void); -BOOL lp_time_server(void); BOOL lp_bind_interfaces_only(void); BOOL lp_net_wksta_user_logon(void); BOOL lp_unix_password_sync(void); @@ -987,11 +931,8 @@ int lp_max_ttl(void); int lp_max_wins_ttl(void); int lp_min_wins_ttl(void); int lp_max_log_size(void); -int lp_mangledstack(void); int lp_maxxmit(void); int lp_maxmux(void); -int lp_maxpacket(void); -int lp_keepalive(void); int lp_passwordlevel(void); int lp_usernamelevel(void); int lp_readsize(void); @@ -1003,7 +944,6 @@ int lp_maxdisksize(void); int lp_lpqcachetime(void); int lp_syslog(void); int lp_client_code_page(void); -int lp_announce_as(void); int lp_lm_announce(void); int lp_lm_interval(void); int lp_machine_password_timeout(void); @@ -1040,7 +980,6 @@ char *lp_force_user(int ); char *lp_force_group(int ); char *lp_readlist(int ); char *lp_writelist(int ); -char *lp_volume(int ); char *lp_mangled_map(int ); char *lp_veto_files(int ); char *lp_hide_files(int ); @@ -1105,7 +1044,6 @@ int lp_numservices(void); void lp_dump(FILE *f, BOOL show_defaults); int lp_servicenumber(char *pszServiceName); char *volume_label(int snum); -void lp_rename_service(int snum, char *new_name); void lp_remove_service(int snum); void lp_copy_service(int snum, char *new_name); int lp_default_server_announce(void); @@ -1141,8 +1079,6 @@ struct smb_passwd *iterate_getsmbpwnam(char *name); void *startsmbpwent(BOOL update); void endsmbpwent(void *vp); struct smb_passwd *getsmbpwent(void *vp); -unsigned long getsmbpwpos(void *vp); -BOOL setsmbpwpos(void *vp, unsigned long tok); BOOL add_smbpwd_entry(struct smb_passwd *newpwd); BOOL mod_smbpwd_entry(struct smb_passwd* pwd, BOOL override); struct smb_passwd *getsmbpwnam(char *name); @@ -1150,39 +1086,21 @@ struct smb_passwd *getsmbpwuid(uid_t smb_userid); struct sam_passwd *iterate_getsam21pwnam(char *name); struct sam_passwd *iterate_getsam21pwrid(uint32 rid); struct sam_passwd *iterate_getsam21pwuid(uid_t uid); -struct sam_disp_info *getsamdispnam(char *name); struct sam_disp_info *getsamdisprid(uint32 rid); -struct sam_disp_info *getsamdispent(void *vp); struct sam_passwd *getsam21pwent(void *vp); -BOOL add_sam21pwd_entry(struct sam_passwd *newpwd); -BOOL mod_sam21pwd_entry(struct sam_passwd* pwd, BOOL override); struct sam_passwd *getsam21pwnam(char *name); struct sam_passwd *getsam21pwrid(uint32 rid); -struct sam_passwd *getsam21pwuid(uid_t uid); -void pdb_init_dispinfo(struct sam_disp_info *user); void pdb_init_smb(struct smb_passwd *user); void pdb_init_sam(struct sam_passwd *user); struct sam_disp_info *pdb_sam_to_dispinfo(struct sam_passwd *user); struct smb_passwd *pdb_sam_to_smb(struct sam_passwd *user); -struct sam_passwd *pdb_smb_to_sam(struct smb_passwd *user); -time_t pdb_get_last_set_time(char *p); -void pdb_set_logon_time(char *p, int max_len, time_t t); -void pdb_set_logoff_time(char *p, int max_len, time_t t); -void pdb_set_kickoff_time(char *p, int max_len, time_t t); -void pdb_set_can_change_time(char *p, int max_len, time_t t); -void pdb_set_must_change_time(char *p, int max_len, time_t t); -void pdb_set_last_set_time(char *p, int max_len, time_t t); char *pdb_encode_acct_ctrl(uint16 acct_ctrl); uint16 pdb_decode_acct_ctrl(char *p); BOOL pdb_gethexpwd(char *p, char *pwd); -void pdb_sethexpwd(char *p, char *pwd, uint16 acct_ctrl); BOOL pdb_name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); BOOL pdb_generate_machine_sid(void); -uid_t pdb_user_rid_to_uid(uint32 u_rid); -gid_t pdb_group_rid_to_gid(uint32 g_rid); uint32 pdb_uid_to_user_rid(uid_t uid); uint32 pdb_gid_to_group_rid(gid_t gid); -BOOL pdb_rid_is_well_known(uint32 rid); BOOL pdb_rid_is_user(uint32 rid); /*The following definitions come from passdb/smbpass.c */ @@ -1251,52 +1169,30 @@ BOOL change_trust_account_password( char *domain, char *remote_machine_list); /*The following definitions come from rpc_client/cli_pipe.c */ -uint32 get_rpc_call_id(void); -BOOL rpc_api_pipe(struct cli_state *cli, uint16 cmd, - prs_struct *param , prs_struct *data, - prs_struct *rparam, prs_struct *rdata); BOOL rpc_api_pipe_req(struct cli_state *cli, uint8 op_num, prs_struct *data, prs_struct *rdata); -BOOL rpc_pipe_set_hnd_state(struct cli_state *cli, char *pipe_name, uint16 device_state); -BOOL rpc_pipe_bind(struct cli_state *cli, char *pipe_name, - RPC_IFACE *abstract, RPC_IFACE *transfer, BOOL ntlmssp_auth); BOOL cli_nt_session_open(struct cli_state *cli, char *pipe_name, BOOL encrypted); void cli_nt_session_close(struct cli_state *cli); /*The following definitions come from rpc_parse/parse_lsa.c */ void make_lsa_trans_name(LSA_TRANS_NAME *trn, uint32 sid_name_use, char *name, uint32 idx); -void lsa_io_trans_name(char *desc, LSA_TRANS_NAME *trn, prs_struct *ps, int depth); -void lsa_io_dom_r_ref(char *desc, DOM_R_REF *r_r, prs_struct *ps, int depth); -void make_lsa_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, uint32 sec_qos); -void lsa_io_obj_attr(char *desc, LSA_OBJ_ATTR *attr, prs_struct *ps, int depth); -void make_q_open_pol(LSA_Q_OPEN_POL *r_q, char *server_name, - uint32 attributes, uint32 sec_qos, - uint32 desired_access); void lsa_io_q_open_pol(char *desc, LSA_Q_OPEN_POL *r_q, prs_struct *ps, int depth); void lsa_io_r_open_pol(char *desc, LSA_R_OPEN_POL *r_p, prs_struct *ps, int depth); -void make_q_query(LSA_Q_QUERY_INFO *q_q, POLICY_HND *hnd, uint16 info_class); void lsa_io_q_query(char *desc, LSA_Q_QUERY_INFO *q_q, prs_struct *ps, int depth); void lsa_io_q_enum_trust_dom(char *desc, LSA_Q_ENUM_TRUST_DOM *q_e, prs_struct *ps, int depth); void make_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM *r_e, uint32 enum_context, char *domain_name, DOM_SID *domain_sid, uint32 status); void lsa_io_r_enum_trust_dom(char *desc, LSA_R_ENUM_TRUST_DOM *r_e, prs_struct *ps, int depth); -void make_lsa_q_close(LSA_Q_CLOSE *q_c, POLICY_HND *hnd); -void lsa_io_q_close(char *desc, LSA_Q_CLOSE *q_c, prs_struct *ps, int depth); -void make_lsa_r_close(LSA_R_CLOSE *q_r, POLICY_HND *hnd); -void lsa_io_r_close(char *desc, LSA_R_CLOSE *r_c, prs_struct *ps, int depth); void lsa_io_r_query(char *desc, LSA_R_QUERY_INFO *r_q, prs_struct *ps, int depth); -void lsa_io_sid_enum(char *desc, LSA_SID_ENUM *sen, prs_struct *ps, int depth); void lsa_io_q_lookup_sids(char *desc, LSA_Q_LOOKUP_SIDS *q_s, prs_struct *ps, int depth); -void lsa_io_trans_names(char *desc, LSA_TRANS_NAME_ENUM *trn, prs_struct *ps, int depth); void lsa_io_r_lookup_sids(char *desc, LSA_R_LOOKUP_SIDS *r_s, prs_struct *ps, int depth); void lsa_io_q_lookup_rids(char *desc, LSA_Q_LOOKUP_RIDS *q_r, prs_struct *ps, int depth); void lsa_io_r_lookup_rids(char *desc, LSA_R_LOOKUP_RIDS *r_r, prs_struct *ps, int depth); /*The following definitions come from rpc_parse/parse_misc.c */ -void smb_io_utime(char *desc, UTIME *t, prs_struct *ps, int depth); void smb_io_time(char *desc, NTTIME *nttime, prs_struct *ps, int depth); void smb_io_lookup_level(char *desc, LOOKUP_LEVEL *level, prs_struct *ps, int depth); uint32 get_enum_hnd(ENUM_HND *enh); @@ -1326,9 +1222,6 @@ void smb_io_dom_rid2(char *desc, DOM_RID2 *rid2, prs_struct *ps, int depth); void make_dom_rid3(DOM_RID3 *rid3, uint32 rid); void smb_io_dom_rid3(char *desc, DOM_RID3 *rid3, prs_struct *ps, int depth); void make_dom_rid4(DOM_RID4 *rid4, uint16 unknown, uint16 attr, uint32 rid); -void smb_io_dom_rid4(char *desc, DOM_RID4 *rid4, prs_struct *ps, int depth); -void make_clnt_srv(DOM_CLNT_SRV *log, char *logon_srv, char *comp_name); -void smb_io_clnt_srv(char *desc, DOM_CLNT_SRV *log, prs_struct *ps, int depth); void make_log_info(DOM_LOG_INFO *log, char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name); void smb_io_log_info(char *desc, DOM_LOG_INFO *log, prs_struct *ps, int depth); @@ -1351,21 +1244,10 @@ void smb_io_gid(char *desc, DOM_GID *gid, prs_struct *ps, int depth); void smb_io_pol_hnd(char *desc, POLICY_HND *pol, prs_struct *ps, int depth); void smb_io_dom_query_3(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth); void smb_io_dom_query_5(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth); -void smb_io_dom_query(char *desc, DOM_QUERY *d_q, prs_struct *ps, int depth); void smb_io_dom_name(char *desc, DOM_NAME *name, prs_struct *ps, int depth); /*The following definitions come from rpc_parse/parse_net.c */ -void net_io_neg_flags(char *desc, NEG_FLAGS *neg, prs_struct *ps, int depth); -void make_netinfo_3(NETLOGON_INFO_3 *info, uint32 flags, uint32 logon_attempts); -void net_io_netinfo_3(char *desc, NETLOGON_INFO_3 *info, prs_struct *ps, int depth); -void make_netinfo_1(NETLOGON_INFO_1 *info, uint32 flags, uint32 pdc_status); -void net_io_netinfo_1(char *desc, NETLOGON_INFO_1 *info, prs_struct *ps, int depth); -void make_netinfo_2(NETLOGON_INFO_2 *info, uint32 flags, uint32 pdc_status, - uint32 tc_status, char *trusted_dc_name); -void net_io_netinfo_2(char *desc, NETLOGON_INFO_2 *info, prs_struct *ps, int depth); -void make_q_logon_ctrl2(NET_Q_LOGON_CTRL2 *q_l, char *server_name, - uint32 function_code); void net_io_q_logon_ctrl2(char *desc, NET_Q_LOGON_CTRL2 *q_l, prs_struct *ps, int depth); void make_r_logon_ctrl2(NET_R_LOGON_CTRL2 *r_l, uint32 query_level, uint32 flags, uint32 pdc_status, uint32 logon_attempts, @@ -1374,8 +1256,6 @@ void net_io_r_logon_ctrl2(char *desc, NET_R_LOGON_CTRL2 *r_l, prs_struct *ps, i void make_r_trust_dom(NET_R_TRUST_DOM_LIST *r_t, uint32 num_doms, char *dom_name); void net_io_r_trust_dom(char *desc, NET_R_TRUST_DOM_LIST *r_t, prs_struct *ps, int depth); -void make_q_trust_dom(NET_Q_TRUST_DOM_LIST *q_l, char *server_name, - uint32 function_code); void net_io_q_trust_dom(char *desc, NET_Q_TRUST_DOM_LIST *q_l, prs_struct *ps, int depth); void make_q_req_chal(NET_Q_REQ_CHAL *q_c, char *logon_srv, char *logon_clnt, @@ -1391,25 +1271,16 @@ void make_q_srv_pwset(NET_Q_SRV_PWSET *q_s, char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name, DOM_CRED *cred, char nt_cypher[16]); void net_io_q_srv_pwset(char *desc, NET_Q_SRV_PWSET *q_s, prs_struct *ps, int depth); void net_io_r_srv_pwset(char *desc, NET_R_SRV_PWSET *r_s, prs_struct *ps, int depth); -void make_id_info1(NET_ID_INFO_1 *id, char *domain_name, - uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high, - char *user_name, char *wksta_name, - char sess_key[16], - unsigned char lm_cypher[16], unsigned char nt_cypher[16]); -void net_io_id_info1(char *desc, NET_ID_INFO_1 *id, prs_struct *ps, int depth); void make_id_info2(NET_ID_INFO_2 *id, char *domain_name, uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high, char *user_name, char *wksta_name, unsigned char lm_challenge[8], unsigned char lm_chal_resp[24], unsigned char nt_chal_resp[24]); -void net_io_id_info2(char *desc, NET_ID_INFO_2 *id, prs_struct *ps, int depth); void make_sam_info(DOM_SAM_INFO *sam, char *logon_srv, char *comp_name, DOM_CRED *clnt_cred, DOM_CRED *rtn_cred, uint16 logon_level, NET_ID_INFO_CTR *ctr, uint16 validation_level); -void net_io_id_info_ctr(char *desc, NET_ID_INFO_CTR *ctr, prs_struct *ps, int depth); -void smb_io_sam_info(char *desc, DOM_SAM_INFO *sam, prs_struct *ps, int depth); void make_net_user_info3(NET_USER_INFO_3 *usr, NTTIME *logon_time, @@ -1442,7 +1313,6 @@ void make_net_user_info3(NET_USER_INFO_3 *usr, DOM_SID *dom_sid, char *other_sids); -void net_io_user_info3(char *desc, NET_USER_INFO_3 *usr, prs_struct *ps, int depth); void net_io_q_sam_logon(char *desc, NET_Q_SAM_LOGON *q_l, prs_struct *ps, int depth); void net_io_r_sam_logon(char *desc, NET_R_SAM_LOGON *r_l, prs_struct *ps, int depth); void net_io_q_sam_logoff(char *desc, NET_Q_SAM_LOGOFF *q_l, prs_struct *ps, int depth); @@ -1461,7 +1331,6 @@ BOOL prs_uint8(char *name, prs_struct *ps, int depth, uint8 *data8); BOOL prs_uint16(char *name, prs_struct *ps, int depth, uint16 *data16); BOOL prs_uint32(char *name, prs_struct *ps, int depth, uint32 *data32); BOOL prs_uint8s(BOOL charmode, char *name, prs_struct *ps, int depth, uint8 *data8s, int len); -BOOL prs_uint16s(BOOL charmode, char *name, prs_struct *ps, int depth, uint16 *data16s, int len); BOOL prs_uint32s(BOOL charmode, char *name, prs_struct *ps, int depth, uint32 *data32s, int len); BOOL prs_uninotstr2(BOOL charmode, char *name, prs_struct *ps, int depth, UNINOTSTR2 *str); BOOL prs_string2(BOOL charmode, char *name, prs_struct *ps, int depth, STRING2 *str); @@ -1471,27 +1340,16 @@ BOOL prs_string(char *name, prs_struct *ps, int depth, char *str, uint16 len); /*The following definitions come from rpc_parse/parse_reg.c */ -void make_reg_q_open_policy(REG_Q_OPEN_POLICY *r_q, - uint16 unknown_0, uint32 level, uint16 unknown_1); void reg_io_q_open_policy(char *desc, REG_Q_OPEN_POLICY *r_q, prs_struct *ps, int depth); -void make_reg_r_open_policy(REG_R_OPEN_POLICY *r_r, - POLICY_HND *pol, uint32 status); void reg_io_r_open_policy(char *desc, REG_R_OPEN_POLICY *r_r, prs_struct *ps, int depth); void reg_io_q_close(char *desc, REG_Q_CLOSE *q_u, prs_struct *ps, int depth); void reg_io_r_close(char *desc, REG_R_CLOSE *r_u, prs_struct *ps, int depth); -void make_reg_q_info(REG_Q_INFO *r_q, - POLICY_HND *pol, char *product_type, - NTTIME *prod_time, uint8 major_version, uint8 minor_version, - uint32 unknown); void reg_io_q_info(char *desc, REG_Q_INFO *r_q, prs_struct *ps, int depth); void make_reg_r_info(REG_R_INFO *r_r, uint32 level, char *os_type, uint32 unknown_0, uint32 unknown_1, uint32 status); void reg_io_r_info(char *desc, REG_R_INFO *r_r, prs_struct *ps, int depth); -void make_reg_q_open_entry(REG_Q_OPEN_ENTRY *r_q, - POLICY_HND *pol, char *name, - uint32 unknown_0, uint32 unknown_1, uint16 unknown_2); void reg_io_q_open_entry(char *desc, REG_Q_OPEN_ENTRY *r_q, prs_struct *ps, int depth); void make_reg_r_open_entry(REG_R_OPEN_ENTRY *r_r, POLICY_HND *pol, uint32 status); @@ -1502,20 +1360,11 @@ void reg_io_r_open_entry(char *desc, REG_R_OPEN_ENTRY *r_r, prs_struct *ps, int void make_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 flags, uint32 call_id, int data_len, int auth_len); void smb_io_rpc_hdr(char *desc, RPC_HDR *rpc, prs_struct *ps, int depth); -void make_rpc_iface(RPC_IFACE *ifc, char data[16], uint32 version); -void smb_io_rpc_iface(char *desc, RPC_IFACE *ifc, prs_struct *ps, int depth); -void make_rpc_addr_str(RPC_ADDR_STR *str, char *name); -void smb_io_rpc_addr_str(char *desc, RPC_ADDR_STR *str, prs_struct *ps, int depth); -void make_rpc_hdr_bba(RPC_HDR_BBA *bba, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid); -void smb_io_rpc_hdr_bba(char *desc, RPC_HDR_BBA *rpc, prs_struct *ps, int depth); void make_rpc_hdr_rb(RPC_HDR_RB *rpc, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, uint32 num_elements, uint16 context_id, uint8 num_syntaxes, RPC_IFACE *abstract, RPC_IFACE *transfer); void smb_io_rpc_hdr_rb(char *desc, RPC_HDR_RB *rpc, prs_struct *ps, int depth); -void make_rpc_results(RPC_RESULTS *res, - uint8 num_results, uint16 result, uint16 reason); -void smb_io_rpc_results(char *desc, RPC_RESULTS *res, prs_struct *ps, int depth); void make_rpc_hdr_ba(RPC_HDR_BA *rpc, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, char *pipe_addr, @@ -1524,7 +1373,6 @@ void make_rpc_hdr_ba(RPC_HDR_BA *rpc, void smb_io_rpc_hdr_ba(char *desc, RPC_HDR_BA *rpc, prs_struct *ps, int depth); void make_rpc_hdr_req(RPC_HDR_REQ *hdr, uint32 data_len, uint16 opnum); void smb_io_rpc_hdr_req(char *desc, RPC_HDR_REQ *rpc, prs_struct *ps, int depth); -void make_rpc_hdr_resp(RPC_HDR_RESP *hdr, uint32 data_len); void smb_io_rpc_hdr_resp(char *desc, RPC_HDR_RESP *rpc, prs_struct *ps, int depth); void make_rpc_auth_ntlmssp_req(RPC_AUTH_NTLMSSP_REQ *req, fstring ntlmssp_str, uint32 ntlmssp_ver, @@ -1539,90 +1387,44 @@ void smb_io_rpc_auth_ntlmssp_resp(char *desc, RPC_AUTH_NTLMSSP_RESP *rsp, prs_st /*The following definitions come from rpc_parse/parse_samr.c */ -void make_samr_q_close_hnd(SAMR_Q_CLOSE_HND *q_c, POLICY_HND *hnd); void samr_io_q_close_hnd(char *desc, SAMR_Q_CLOSE_HND *q_u, prs_struct *ps, int depth); void samr_io_r_close_hnd(char *desc, SAMR_R_CLOSE_HND *r_u, prs_struct *ps, int depth); -void make_samr_q_open_domain(SAMR_Q_OPEN_DOMAIN *q_u, - POLICY_HND *connect_pol, uint32 rid, DOM_SID *sid); void samr_io_q_open_domain(char *desc, SAMR_Q_OPEN_DOMAIN *q_u, prs_struct *ps, int depth); void samr_io_r_open_domain(char *desc, SAMR_R_OPEN_DOMAIN *r_u, prs_struct *ps, int depth); -void make_samr_q_unknown_8(SAMR_Q_UNKNOWN_8 *q_u, - POLICY_HND *domain_pol, uint16 switch_value); -void samr_io_q_unknown_8(char *desc, SAMR_Q_UNKNOWN_8 *q_u, prs_struct *ps, int depth); -void make_samr_q_unknown_3(SAMR_Q_UNKNOWN_3 *q_u, - POLICY_HND *user_pol, uint16 switch_value); void samr_io_q_unknown_3(char *desc, SAMR_Q_UNKNOWN_3 *q_u, prs_struct *ps, int depth); void make_dom_sid3(DOM_SID3 *sid3, uint16 unk_0, uint16 unk_1, DOM_SID *sid); -void sam_io_dom_sid3(char *desc, DOM_SID3 *sid3, prs_struct *ps, int depth); -void make_sam_sid_stuff(SAM_SID_STUFF *stf, - uint16 unknown_2, uint16 unknown_3, - uint32 unknown_4, uint16 unknown_6, uint16 unknown_7, - int num_sid3s, DOM_SID3 sid3[MAX_SAM_SIDS]); -void sam_io_sid_stuff(char *desc, SAM_SID_STUFF *stf, prs_struct *ps, int depth); void make_samr_r_unknown_3(SAMR_R_UNKNOWN_3 *r_u, uint16 unknown_2, uint16 unknown_3, uint32 unknown_4, uint16 unknown_6, uint16 unknown_7, int num_sid3s, DOM_SID3 sid3[MAX_SAM_SIDS], uint32 status); void samr_io_r_unknown_3(char *desc, SAMR_R_UNKNOWN_3 *r_u, prs_struct *ps, int depth); -void make_sam_str1(SAM_STR1 *sam, char *sam_acct, char *sam_name, char *sam_desc); -void sam_io_sam_str1(char *desc, SAM_STR1 *sam, uint32 acct_buf, uint32 name_buf, uint32 desc_buf, prs_struct *ps, int depth); -void make_sam_entry1(SAM_ENTRY1 *sam, uint32 user_idx, - uint32 len_sam_name, uint32 len_sam_full, uint32 len_sam_desc, - uint32 rid_user, uint16 acb_info); -void sam_io_sam_entry1(char *desc, SAM_ENTRY1 *sam, prs_struct *ps, int depth); -void make_sam_str2(SAM_STR2 *sam, char *sam_acct, char *sam_desc); -void sam_io_sam_str2(char *desc, SAM_STR2 *sam, uint32 acct_buf, uint32 desc_buf, prs_struct *ps, int depth); -void make_sam_entry2(SAM_ENTRY2 *sam, uint32 user_idx, - uint32 len_sam_name, uint32 len_sam_desc, - uint32 rid_user, uint16 acb_info); -void sam_io_sam_entry2(char *desc, SAM_ENTRY2 *sam, prs_struct *ps, int depth); -void make_sam_str3(SAM_STR3 *sam, char *grp_acct, char *grp_desc); -void sam_io_sam_str3(char *desc, SAM_STR3 *sam, uint32 acct_buf, uint32 desc_buf, prs_struct *ps, int depth); -void make_sam_entry3(SAM_ENTRY3 *sam, uint32 grp_idx, - uint32 len_grp_name, uint32 len_grp_desc, uint32 rid_grp); -void sam_io_sam_entry3(char *desc, SAM_ENTRY3 *sam, prs_struct *ps, int depth); -void make_sam_entry(SAM_ENTRY *sam, uint32 len_sam_name, uint32 rid); -void sam_io_sam_entry(char *desc, SAM_ENTRY *sam, prs_struct *ps, int depth); -void make_samr_q_enum_dom_users(SAMR_Q_ENUM_DOM_USERS *q_e, POLICY_HND *pol, - uint16 req_num_entries, uint16 unk_0, - uint16 acb_mask, uint16 unk_1, uint32 size); void samr_io_q_enum_dom_users(char *desc, SAMR_Q_ENUM_DOM_USERS *q_e, prs_struct *ps, int depth); void make_samr_r_enum_dom_users(SAMR_R_ENUM_DOM_USERS *r_u, uint16 total_num_entries, uint16 unk_0, uint32 num_sam_entries, SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES], uint32 status); void samr_io_r_enum_dom_users(char *desc, SAMR_R_ENUM_DOM_USERS *r_u, prs_struct *ps, int depth); -void make_samr_q_enum_dom_aliases(SAMR_Q_ENUM_DOM_ALIASES *q_e, POLICY_HND *pol, uint32 size); void samr_io_q_enum_dom_aliases(char *desc, SAMR_Q_ENUM_DOM_ALIASES *q_e, prs_struct *ps, int depth); void make_samr_r_enum_dom_aliases(SAMR_R_ENUM_DOM_ALIASES *r_u, uint32 num_sam_entries, SAM_USER_INFO_21 grps[MAX_SAM_ENTRIES], uint32 status); void samr_io_r_enum_dom_aliases(char *desc, SAMR_R_ENUM_DOM_ALIASES *r_u, prs_struct *ps, int depth); -void make_samr_q_query_dispinfo(SAMR_Q_QUERY_DISPINFO *q_e, POLICY_HND *pol, - uint16 switch_level, uint32 start_idx, uint32 size); void samr_io_q_query_dispinfo(char *desc, SAMR_Q_QUERY_DISPINFO *q_e, prs_struct *ps, int depth); void make_sam_info_2(SAM_INFO_2 *sam, uint32 acb_mask, uint32 start_idx, uint32 num_sam_entries, SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]); -void sam_io_sam_info_2(char *desc, SAM_INFO_2 *sam, prs_struct *ps, int depth); void make_sam_info_1(SAM_INFO_1 *sam, uint32 acb_mask, uint32 start_idx, uint32 num_sam_entries, SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES]); -void sam_io_sam_info_1(char *desc, SAM_INFO_1 *sam, prs_struct *ps, int depth); void make_samr_r_query_dispinfo(SAMR_R_QUERY_DISPINFO *r_u, uint16 switch_level, SAM_INFO_CTR *ctr, uint32 status); void samr_io_r_query_dispinfo(char *desc, SAMR_R_QUERY_DISPINFO *r_u, prs_struct *ps, int depth); -void make_samr_q_enum_dom_groups(SAMR_Q_ENUM_DOM_GROUPS *q_e, POLICY_HND *pol, - uint16 switch_level, uint32 start_idx, uint32 size); void samr_io_q_enum_dom_groups(char *desc, SAMR_Q_ENUM_DOM_GROUPS *q_e, prs_struct *ps, int depth); void make_samr_r_enum_dom_groups(SAMR_R_ENUM_DOM_GROUPS *r_u, uint32 start_idx, uint32 num_sam_entries, SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES], uint32 status); void samr_io_r_enum_dom_groups(char *desc, SAMR_R_ENUM_DOM_GROUPS *r_u, prs_struct *ps, int depth); -void make_samr_q_query_aliasinfo(SAMR_Q_QUERY_ALIASINFO *q_e, - POLICY_HND *pol, - uint16 switch_level); void samr_io_q_query_aliasinfo(char *desc, SAMR_Q_QUERY_ALIASINFO *q_e, prs_struct *ps, int depth); void make_samr_r_query_aliasinfo(SAMR_R_QUERY_ALIASINFO *r_u, uint16 switch_value, char *acct_desc, @@ -1636,36 +1438,18 @@ void samr_io_q_lookup_names(char *desc, SAMR_Q_LOOKUP_NAMES *q_u, prs_struct *p void make_samr_r_lookup_names(SAMR_R_LOOKUP_NAMES *r_u, uint32 num_rids, uint32 *rid, uint32 status); void samr_io_r_lookup_names(char *desc, SAMR_R_LOOKUP_NAMES *r_u, prs_struct *ps, int depth); -void make_samr_q_unknown_12(SAMR_Q_UNKNOWN_12 *q_u, - POLICY_HND *pol, uint32 rid, - uint32 num_gids, uint32 *gid); void samr_io_q_unknown_12(char *desc, SAMR_Q_UNKNOWN_12 *q_u, prs_struct *ps, int depth); void make_samr_r_unknown_12(SAMR_R_UNKNOWN_12 *r_u, uint32 num_aliases, fstring *als_name, uint32 *num_als_usrs, uint32 status); void samr_io_r_unknown_12(char *desc, SAMR_R_UNKNOWN_12 *r_u, prs_struct *ps, int depth); -void make_samr_q_open_user(SAMR_Q_OPEN_USER *q_u, - POLICY_HND *pol, - uint32 unk_0, uint32 rid); void samr_io_q_open_user(char *desc, SAMR_Q_OPEN_USER *q_u, prs_struct *ps, int depth); void samr_io_r_open_user(char *desc, SAMR_R_OPEN_USER *r_u, prs_struct *ps, int depth); -void make_samr_q_query_usergroups(SAMR_Q_QUERY_USERGROUPS *q_u, - POLICY_HND *hnd); void samr_io_q_query_usergroups(char *desc, SAMR_Q_QUERY_USERGROUPS *q_u, prs_struct *ps, int depth); void make_samr_r_query_usergroups(SAMR_R_QUERY_USERGROUPS *r_u, uint32 num_gids, DOM_GID *gid, uint32 status); void samr_io_r_query_usergroups(char *desc, SAMR_R_QUERY_USERGROUPS *r_u, prs_struct *ps, int depth); -void make_samr_q_query_userinfo(SAMR_Q_QUERY_USERINFO *q_u, - POLICY_HND *hnd, uint16 switch_value); void samr_io_q_query_userinfo(char *desc, SAMR_Q_QUERY_USERINFO *q_u, prs_struct *ps, int depth); -void sam_io_logon_hrs(char *desc, LOGON_HRS *hrs, prs_struct *ps, int depth); -void make_sam_user_info11(SAM_USER_INFO_11 *usr, - NTTIME *expiry, - char *mach_acct, - uint32 rid_user, - uint32 rid_group, - uint16 acct_ctrl); -void sam_io_user_info11(char *desc, SAM_USER_INFO_11 *usr, prs_struct *ps, int depth); void make_sam_user_info21(SAM_USER_INFO_21 *usr, NTTIME *logon_time, @@ -1695,139 +1479,65 @@ void make_sam_user_info21(SAM_USER_INFO_21 *usr, LOGON_HRS *hrs, uint32 unknown_5, uint32 unknown_6); -void sam_io_user_info21(char *desc, SAM_USER_INFO_21 *usr, prs_struct *ps, int depth); void make_samr_r_query_userinfo(SAMR_R_QUERY_USERINFO *r_u, uint16 switch_value, void *info, uint32 status); void samr_io_r_query_userinfo(char *desc, SAMR_R_QUERY_USERINFO *r_u, prs_struct *ps, int depth); -void make_samr_q_unknown_21(SAMR_Q_UNKNOWN_21 *q_c, - POLICY_HND *hnd, uint16 unk_1, uint16 unk_2); -void samr_io_q_unknown_21(char *desc, SAMR_Q_UNKNOWN_21 *q_u, prs_struct *ps, int depth); -void make_samr_q_unknown_13(SAMR_Q_UNKNOWN_13 *q_c, - POLICY_HND *hnd, uint16 unk_1, uint16 unk_2); -void samr_io_q_unknown_13(char *desc, SAMR_Q_UNKNOWN_13 *q_u, prs_struct *ps, int depth); void samr_io_q_unknown_32(char *desc, SAMR_Q_UNKNOWN_32 *q_u, prs_struct *ps, int depth); void samr_io_r_unknown_32(char *desc, SAMR_R_UNKNOWN_32 *r_u, prs_struct *ps, int depth); -void make_samr_q_connect(SAMR_Q_CONNECT *q_u, - char *srv_name, uint32 unknown_0); void samr_io_q_connect(char *desc, SAMR_Q_CONNECT *q_u, prs_struct *ps, int depth); void samr_io_r_connect(char *desc, SAMR_R_CONNECT *r_u, prs_struct *ps, int depth); -void make_samr_q_open_alias(SAMR_Q_OPEN_ALIAS *q_u, - uint32 unknown_0, uint32 rid); void samr_io_q_open_alias(char *desc, SAMR_Q_OPEN_ALIAS *q_u, prs_struct *ps, int depth); void samr_io_r_open_alias(char *desc, SAMR_R_OPEN_ALIAS *r_u, prs_struct *ps, int depth); -void make_samr_q_unknown_38(SAMR_Q_UNKNOWN_38 *q_u, char *srv_name); -void samr_io_q_unknown_38(char *desc, SAMR_Q_UNKNOWN_38 *q_u, prs_struct *ps, int depth); -void make_samr_r_unknown_38(SAMR_R_UNKNOWN_38 *r_u, - uint16 level, uint32 status); -void samr_io_r_unknown_38(char *desc, SAMR_R_UNKNOWN_38 *r_u, prs_struct *ps, int depth); -void samr_io_enc_passwd(char *desc, SAMR_ENC_PASSWD *pwd, prs_struct *ps, int depth); -void samr_io_enc_hash(char *desc, SAMR_ENC_HASH *hsh, prs_struct *ps, int depth); /*The following definitions come from rpc_parse/parse_srv.c */ void make_srv_share_info1_str(SH_INFO_1_STR *sh1, char *net_name, char *remark); -void srv_io_share_info1_str(char *desc, SH_INFO_1_STR *sh1, prs_struct *ps, int depth); void make_srv_share_info1(SH_INFO_1 *sh1, char *net_name, uint32 type, char *remark); -void srv_io_share_info1(char *desc, SH_INFO_1 *sh1, prs_struct *ps, int depth); -void srv_io_srv_share_info_1(char *desc, SRV_SHARE_INFO_1 *ctr, prs_struct *ps, int depth); void make_srv_share_info2_str(SH_INFO_2_STR *sh2, char *net_name, char *remark, char *path, char *passwd); -void srv_io_share_info2_str(char *desc, SH_INFO_2_STR *sh2, prs_struct *ps, int depth); void make_srv_share_info2(SH_INFO_2 *sh2, char *net_name, uint32 type, char *remark, uint32 perms, uint32 max_uses, uint32 num_uses, char *path, char *passwd); -void srv_io_share_info2(char *desc, SH_INFO_2 *sh2, prs_struct *ps, int depth); -void srv_io_srv_share_info_2(char *desc, SRV_SHARE_INFO_2 *ctr, prs_struct *ps, int depth); -void srv_io_srv_share_ctr(char *desc, SRV_SHARE_INFO_CTR *ctr, prs_struct *ps, int depth); -void make_srv_q_net_share_enum(SRV_Q_NET_SHARE_ENUM *q_n, - char *srv_name, - uint32 share_level, SRV_SHARE_INFO_CTR *ctr, - uint32 preferred_len, - ENUM_HND *hnd); void srv_io_q_net_share_enum(char *desc, SRV_Q_NET_SHARE_ENUM *q_n, prs_struct *ps, int depth); void srv_io_r_net_share_enum(char *desc, SRV_R_NET_SHARE_ENUM *r_n, prs_struct *ps, int depth); void make_srv_sess_info0_str(SESS_INFO_0_STR *ss0, char *name); -void srv_io_sess_info0_str(char *desc, SESS_INFO_0_STR *ss0, prs_struct *ps, int depth); void make_srv_sess_info0(SESS_INFO_0 *ss0, char *name); -void srv_io_sess_info0(char *desc, SESS_INFO_0 *ss0, prs_struct *ps, int depth); -void srv_io_srv_sess_info_0(char *desc, SRV_SESS_INFO_0 *ss0, prs_struct *ps, int depth); void make_srv_sess_info1_str(SESS_INFO_1_STR *ss1, char *name, char *user); -void srv_io_sess_info1_str(char *desc, SESS_INFO_1_STR *ss1, prs_struct *ps, int depth); void make_srv_sess_info1(SESS_INFO_1 *ss1, char *name, char *user, uint32 num_opens, uint32 open_time, uint32 idle_time, uint32 user_flags); -void srv_io_sess_info1(char *desc, SESS_INFO_1 *ss1, prs_struct *ps, int depth); -void srv_io_srv_sess_info_1(char *desc, SRV_SESS_INFO_1 *ss1, prs_struct *ps, int depth); -void srv_io_srv_sess_ctr(char *desc, SRV_SESS_INFO_CTR *ctr, prs_struct *ps, int depth); -void make_srv_q_net_sess_enum(SRV_Q_NET_SESS_ENUM *q_n, - char *srv_name, char *qual_name, - uint32 sess_level, SRV_SESS_INFO_CTR *ctr, - uint32 preferred_len, - ENUM_HND *hnd); void srv_io_q_net_sess_enum(char *desc, SRV_Q_NET_SESS_ENUM *q_n, prs_struct *ps, int depth); void srv_io_r_net_sess_enum(char *desc, SRV_R_NET_SESS_ENUM *r_n, prs_struct *ps, int depth); void make_srv_conn_info0(CONN_INFO_0 *ss0, uint32 id); -void srv_io_conn_info0(char *desc, CONN_INFO_0 *ss0, prs_struct *ps, int depth); -void srv_io_srv_conn_info_0(char *desc, SRV_CONN_INFO_0 *ss0, prs_struct *ps, int depth); void make_srv_conn_info1_str(CONN_INFO_1_STR *ss1, char *usr_name, char *net_name); -void srv_io_conn_info1_str(char *desc, CONN_INFO_1_STR *ss1, prs_struct *ps, int depth); void make_srv_conn_info1(CONN_INFO_1 *ss1, uint32 id, uint32 type, uint32 num_opens, uint32 num_users, uint32 open_time, char *usr_name, char *net_name); -void srv_io_conn_info1(char *desc, CONN_INFO_1 *ss1, prs_struct *ps, int depth); -void srv_io_srv_conn_info_1(char *desc, SRV_CONN_INFO_1 *ss1, prs_struct *ps, int depth); -void srv_io_srv_conn_ctr(char *desc, SRV_CONN_INFO_CTR *ctr, prs_struct *ps, int depth); -void make_srv_q_net_conn_enum(SRV_Q_NET_CONN_ENUM *q_n, - char *srv_name, char *qual_name, - uint32 conn_level, SRV_CONN_INFO_CTR *ctr, - uint32 preferred_len, - ENUM_HND *hnd); void srv_io_q_net_conn_enum(char *desc, SRV_Q_NET_CONN_ENUM *q_n, prs_struct *ps, int depth); void srv_io_r_net_conn_enum(char *desc, SRV_R_NET_CONN_ENUM *r_n, prs_struct *ps, int depth); void make_srv_file_info3_str(FILE_INFO_3_STR *fi3, char *user_name, char *path_name); -void srv_io_file_info3_str(char *desc, FILE_INFO_3_STR *sh1, prs_struct *ps, int depth); void make_srv_file_info3(FILE_INFO_3 *fl3, uint32 id, uint32 perms, uint32 num_locks, char *path_name, char *user_name); -void srv_io_file_info3(char *desc, FILE_INFO_3 *fl3, prs_struct *ps, int depth); -void srv_io_srv_file_info_3(char *desc, SRV_FILE_INFO_3 *fl3, prs_struct *ps, int depth); -void srv_io_srv_file_ctr(char *desc, SRV_FILE_INFO_CTR *ctr, prs_struct *ps, int depth); -void make_srv_q_net_file_enum(SRV_Q_NET_FILE_ENUM *q_n, - char *srv_name, char *qual_name, - uint32 file_level, SRV_FILE_INFO_CTR *ctr, - uint32 preferred_len, - ENUM_HND *hnd); void srv_io_q_net_file_enum(char *desc, SRV_Q_NET_FILE_ENUM *q_n, prs_struct *ps, int depth); void srv_io_r_net_file_enum(char *desc, SRV_R_NET_FILE_ENUM *r_n, prs_struct *ps, int depth); void make_srv_info_101(SRV_INFO_101 *sv101, uint32 platform_id, char *name, uint32 ver_major, uint32 ver_minor, uint32 srv_type, char *comment); -void srv_io_info_101(char *desc, SRV_INFO_101 *sv101, prs_struct *ps, int depth); void make_srv_info_102(SRV_INFO_102 *sv102, uint32 platform_id, char *name, char *comment, uint32 ver_major, uint32 ver_minor, uint32 srv_type, uint32 users, uint32 disc, uint32 hidden, uint32 announce, uint32 ann_delta, uint32 licenses, char *usr_path); -void srv_io_info_102(char *desc, SRV_INFO_102 *sv102, prs_struct *ps, int depth); -void srv_io_info_ctr(char *desc, SRV_INFO_CTR *ctr, prs_struct *ps, int depth); -void make_srv_q_net_srv_get_info(SRV_Q_NET_SRV_GET_INFO *srv, - char *server_name, uint32 switch_value); void srv_io_q_net_srv_get_info(char *desc, SRV_Q_NET_SRV_GET_INFO *q_n, prs_struct *ps, int depth); void make_srv_r_net_srv_get_info(SRV_R_NET_SRV_GET_INFO *srv, uint32 switch_value, SRV_INFO_CTR *ctr, uint32 status); void srv_io_r_net_srv_get_info(char *desc, SRV_R_NET_SRV_GET_INFO *r_n, prs_struct *ps, int depth); -void make_srv_q_net_srv_set_info(SRV_Q_NET_SRV_SET_INFO *srv, - uint32 switch_value, SRV_INFO_CTR *ctr); -void srv_io_q_net_srv_set_info(char *desc, SRV_Q_NET_SRV_SET_INFO *q_n, prs_struct *ps, int depth); -void make_srv_r_net_srv_set_info(SRV_R_NET_SRV_SET_INFO *srv, - uint32 switch_value, SRV_INFO_CTR *ctr, uint32 status); -void srv_io_r_net_srv_set_info(char *desc, SRV_R_NET_SRV_SET_INFO *r_n, prs_struct *ps, int depth); void srv_io_q_net_remote_tod(char *desc, SRV_Q_NET_REMOTE_TOD *q_n, prs_struct *ps, int depth); -void srv_io_time_of_day_info(char *desc, TIME_OF_DAY_INFO *tod, prs_struct *ps, int depth); void make_time_of_day_info(TIME_OF_DAY_INFO *tod, uint32 elapsedt, uint32 msecs, uint32 hours, uint32 mins, uint32 secs, uint32 hunds, uint32 zone, uint32 tintervals, uint32 day, @@ -1836,13 +1546,10 @@ void srv_io_r_net_remote_tod(char *desc, SRV_R_NET_REMOTE_TOD *r_n, prs_struct * /*The following definitions come from rpc_parse/parse_wks.c */ -void make_wks_q_query_info(WKS_Q_QUERY_INFO *q_u, - char *server, uint16 switch_value) ; void wks_io_q_query_info(char *desc, WKS_Q_QUERY_INFO *q_u, prs_struct *ps, int depth); void make_wks_info_100(WKS_INFO_100 *inf, uint32 platform_id, uint32 ver_major, uint32 ver_minor, char *my_name, char *domain_name); -void wks_io_wks_info_100(char *desc, WKS_INFO_100 *inf, prs_struct *ps, int depth); void make_wks_r_query_info(WKS_R_QUERY_INFO *r_u, uint32 switch_value, WKS_INFO_100 *wks100, int status) ; @@ -1858,7 +1565,6 @@ BOOL api_ntlsa_rpc(pipes_struct *p, prs_struct *data); /*The following definitions come from rpc_server/srv_lsa_hnd.c */ -void create_pol_hnd(POLICY_HND *hnd); void init_lsa_policy_hnd(void); BOOL open_lsa_policy_hnd(POLICY_HND *hnd); int find_lsa_policy_by_hnd(POLICY_HND *hnd); @@ -1867,7 +1573,6 @@ BOOL set_lsa_policy_samr_pol_status(POLICY_HND *hnd, uint32 pol_status); BOOL set_lsa_policy_samr_sid(POLICY_HND *hnd, DOM_SID *sid); uint32 get_lsa_policy_samr_rid(POLICY_HND *hnd); BOOL set_lsa_policy_reg_name(POLICY_HND *hnd, fstring name); -BOOL get_lsa_policy_reg_name(POLICY_HND *hnd, char *name); BOOL close_lsa_policy_hnd(POLICY_HND *hnd); /*The following definitions come from rpc_server/srv_netlog.c */ @@ -1881,7 +1586,6 @@ void init_rpc_pipe_hnd(void); pipes_struct *open_rpc_pipe_p(char *pipe_name, connection_struct *conn, uint16 vuid); int read_pipe(pipes_struct *p, char *data, uint32 pos, int n); -char *get_rpc_pipe_hnd_name(pipes_struct *p); BOOL set_rpc_pipe_hnd_state(pipes_struct *p, uint16 device_state); BOOL close_rpc_pipe_hnd(pipes_struct *p, connection_struct *conn); pipes_struct *get_rpc_pipe_p(char *buf, int where); @@ -1901,7 +1605,6 @@ BOOL api_srvsvc_rpc(pipes_struct *p, prs_struct *data); /*The following definitions come from rpc_server/srv_util.c */ -BOOL lookup_wellknown_sid_from_name(char *windows_name, DOM_SID *psid); int make_dom_gids(char *gids_str, DOM_GID **ppgids); BOOL create_rpc_reply(pipes_struct *p, uint32 data_start, uint32 data_end); @@ -1928,7 +1631,6 @@ void process_blocking_lock_queue(time_t t); /*The following definitions come from smbd/chgpasswd.c */ -BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence, BOOL as_root); BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root); BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root); BOOL check_lanman_password(char *user, unsigned char *pass1, @@ -2016,13 +1718,10 @@ void sync_file(connection_struct *conn, files_struct *fsp); /*The following definitions come from smbd/filename.c */ -BOOL fname_equal(char *name1, char *name2); -BOOL mangled_equal(char *name1, char *name2); void print_stat_cache_statistics(void); BOOL unix_convert(char *name,connection_struct *conn,char *saved_last_component, BOOL *bad_path, SMB_STRUCT_STAT *pst); BOOL check_name(char *name,connection_struct *conn); -BOOL scan_directory(char *path, char *name,connection_struct *conn,BOOL docache); /*The following definitions come from smbd/files.c */ @@ -2042,14 +1741,8 @@ void file_chain_reset(void); void file_chain_save(void); void file_chain_restore(void); -/*The following definitions come from smbd/groupname.c */ - -void load_groupname_map(void); -void map_gid_to_sid( gid_t gid, DOM_SID *psid); - /*The following definitions come from smbd/ipc.c */ -int get_printerdrivernumber(int snum); int reply_trans(connection_struct *conn, char *inbuf,char *outbuf, int size, int bufsize); /*The following definitions come from smbd/mangle.c */ @@ -2087,7 +1780,6 @@ int reply_ntcancel(connection_struct *conn, int reply_nttranss(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize); void remove_pending_change_notify_requests_by_fid(files_struct *fsp); -void remove_pending_change_notify_requests_by_mid(int mid); void process_pending_change_notify_queue(time_t t); int reply_nttrans(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize); @@ -2101,14 +1793,11 @@ void open_file_shared(files_struct *fsp,connection_struct *conn,char *fname,int int open_directory(files_struct *fsp,connection_struct *conn, char *fname, int smb_ofun, int unixmode, int *action); BOOL check_file_sharing(connection_struct *conn,char *fname, BOOL rename_op); -int check_share_mode( share_mode_entry *share, int deny_mode, char *fname, - BOOL fcbopen, int *flags); /*The following definitions come from smbd/oplock.c */ BOOL open_oplock_ipc(void); BOOL process_local_message(int sock, char *buffer, int buf_size); -BOOL oplock_break(SMB_DEV_T dev, SMB_INO_T inode, struct timeval *tval); BOOL request_oplock_break(share_mode_entry *share_entry, SMB_DEV_T dev, SMB_INO_T inode); BOOL attempt_close_oplocked_file(files_struct *fsp); @@ -2117,14 +1806,12 @@ BOOL attempt_close_oplocked_file(files_struct *fsp); void generate_next_challenge(char *challenge); BOOL set_challenge(char *challenge); -BOOL last_challenge(unsigned char *challenge); user_struct *get_valid_user_struct(uint16 vuid); void invalidate_vuid(uint16 vuid); char *validated_username(uint16 vuid); int setup_groups(char *user, int uid, int gid, int *p_ngroups, GID_T **p_groups); uint16 register_vuid(int uid,int gid, char *unix_name, char *requested_name, BOOL guest); void add_session_user(char *user); -BOOL update_smbpassword_file(char *user, char *password); BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8); BOOL smb_password_ok(struct smb_passwd *smb_pass, uchar lm_pass[24], uchar nt_pass[24]); @@ -2162,7 +1849,6 @@ void process_smb(char *inbuf, char *outbuf); char *smb_fn_name(int type); void construct_reply_common(char *inbuf,char *outbuf); int chain_reply(char *inbuf,char *outbuf,int size,int bufsize); -int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); void smbd_process(void); /*The following definitions come from smbd/quotas.c */ @@ -2243,8 +1929,6 @@ int reply_getattrE(connection_struct *conn, char *inbuf,char *outbuf, int dum_si /*The following definitions come from smbd/server.c */ -void *dflt_sig(void); -void killkids(void); BOOL reload_services(BOOL test); void exit_server(char *reason); @@ -2289,12 +1973,6 @@ void unbecome_root(BOOL restore_dir); void cgi_load_variables(FILE *f1); char *cgi_variable(char *name); -char *cgi_vnum(int i, char **name); -int cgi_boolean(char *name, int def); -char *quotedup(char *s); -char *urlquote(char *s); -char *quotequotes(char *s); -void quote_spaces(char *buf); void cgi_setup(char *rootdir, int auth_required); char *cgi_baseurl(void); char *cgi_pathinfo(void); -- cgit From 0cb85e04a974daf4442a7561931ff1be566a8410 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 5 Sep 1998 13:21:57 +0000 Subject: some people are foolishly running ./configure from other than the source directory! This adds a new "trivial" test that makes sure that the autoconf tests are working. It aborts the configure run if not. (This used to be commit ead0338ad27f29f1abbbe9f6302d6bf633bf98b2) --- source3/include/config.h.in | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index e0bcbfe6f0..fc5dcd2c4e 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -59,9 +59,6 @@ #undef HAVE_ERRNO_DECL #undef HAVE_LONGLONG #undef HAVE_OFF64_T -#undef SIZEOF_OFF_T -#undef HAVE_INO64_T -#undef SIZEOF_INO_T #undef HAVE_REMSH #undef HAVE_UNSIGNED_CHAR #undef HAVE_UTIMBUF @@ -83,7 +80,6 @@ #undef HAVE_SHARED_MMAP #undef HAVE_SYSV_IPC #undef HAVE_FCNTL_LOCK -#undef HAVE_STRUCT_FLOCK64 #undef HAVE_FTRUNCATE_EXTEND #undef HAVE_TRAPDOOR_UID #undef HAVE_ROOT @@ -116,6 +112,10 @@ #undef HAVE_SETRESUID_DECL #undef HAVE_SETRESUID #undef WITH_NETATALK +#undef HAVE_INO64_T +#undef HAVE_STRUCT_FLOCK64 +#undef SIZEOF_INO_T +#undef SIZEOF_OFF_T /* The number of bytes in a int. */ #undef SIZEOF_INT @@ -156,24 +156,15 @@ /* Define if you have the fstat function. */ #undef HAVE_FSTAT +/* Define if you have the fstat64 function. */ +#undef HAVE_FSTAT64 + /* Define if you have the fsync function. */ #undef HAVE_FSYNC /* Define if you have the ftruncate function. */ #undef HAVE_FTRUNCATE -/* Define if you have the stat64 function. */ -#undef HAVE_STAT64 - -/* Define if you have the fstat64 function. */ -#undef HAVE_FSTAT64 - -/* Define if you have the lstat64 function. */ -#undef HAVE_LSTAT64 - -/* Define if you have the lseek64 function. */ -#undef HAVE_LSEEK64 - /* Define if you have the ftruncate64 function. */ #undef HAVE_FTRUNCATE64 @@ -210,6 +201,12 @@ /* Define if you have the innetgr function. */ #undef HAVE_INNETGR +/* Define if you have the lseek64 function. */ +#undef HAVE_LSEEK64 + +/* Define if you have the lstat64 function. */ +#undef HAVE_LSTAT64 + /* Define if you have the memmove function. */ #undef HAVE_MEMMOVE @@ -261,6 +258,9 @@ /* Define if you have the sigprocmask function. */ #undef HAVE_SIGPROCMASK +/* Define if you have the stat64 function. */ +#undef HAVE_STAT64 + /* Define if you have the strchr function. */ #undef HAVE_STRCHR @@ -324,18 +324,18 @@ /* Define if you have the header file. */ #undef HAVE_POLL_H -/* Define if you have the header file. */ -#undef HAVE_RPC_TYPES_H - -/* Define if you have the header file. */ -#undef HAVE_RPC_XDR_H - /* Define if you have the header file. */ #undef HAVE_RPC_AUTH_H /* Define if you have the header file. */ #undef HAVE_RPC_CLNT_H +/* Define if you have the header file. */ +#undef HAVE_RPC_TYPES_H + +/* Define if you have the header file. */ +#undef HAVE_RPC_XDR_H + /* Define if you have the header file. */ #undef HAVE_RPCSVC_YP_PROT_H -- cgit From 4fc5a74ffa491d52afc373abcdd4257a4f105aa4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 6 Sep 1998 01:37:14 +0000 Subject: add a "stat cache" boolean smb.conf option. (defaults to on) I think we need this so we can rule out stat cache bugs when dealing with bug reports. If we ask a user to disable the stat cache and the problem persists then we know it isn't a stat cache bug. The stat cache code is sufficiently complicated that it can be pretty hard to tell if it is causing problems or not. (This used to be commit c83f3775cd8a7aad13571926cdd5949a07538771) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 7430affd34..a7581ced79 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -926,6 +926,7 @@ BOOL lp_unix_password_sync(void); BOOL lp_passwd_chat_debug(void); BOOL lp_ole_locking_compat(void); BOOL lp_nt_smb_support(void); +BOOL lp_stat_cache(void); int lp_os_level(void); int lp_max_ttl(void); int lp_max_wins_ttl(void); -- cgit From 6e0c276ec8b918165a19b3dfc86bc7bef6d1f706 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 8 Sep 1998 19:21:04 +0000 Subject: Added back groupname map stuff removed by Andrew's "slash 'n' burn" tactics :-). Protected by #ifdef until used. Fixed bug in fd_attempt_close() where a pointer to potentially free'd memory was returned. I hate that. Added "blocking locks" as a per-share option for performance testing. Changed is_mangled() so it will return true if called with a pathname and any component of the pathname was mangled (it was already attempting to do this, but not checking for a '/' as end-of-mangle). This should be a better fix for the wierd stat cache bug Andrew identified. Jeremy. (This used to be commit 0de01f45980c7bc261248a9cead972a8d8cbd594) --- source3/include/proto.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index a7581ced79..862c11f350 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -858,6 +858,7 @@ char *lp_passwordserver(void); char *lp_name_resolve_order(void); char *lp_workgroup(void); char *lp_username_map(void); +char *lp_groupname_map(void); char *lp_logon_script(void); char *lp_logon_path(void); char *lp_logon_drive(void); @@ -1019,6 +1020,7 @@ BOOL lp_recursive_veto_delete(int ); BOOL lp_dos_filetimes(int ); BOOL lp_dos_filetime_resolution(int ); BOOL lp_fake_dir_create_times(int ); +BOOL lp_blocking_locks(int ); int lp_create_mode(int ); int lp_force_create_mode(int ); int lp_dir_mode(int ); @@ -1742,6 +1744,11 @@ void file_chain_reset(void); void file_chain_save(void); void file_chain_restore(void); +/*The following definitions come from smbd/groupname.c */ + +void load_groupname_map(void); +void map_gid_to_sid( gid_t gid, DOM_SID *psid); + /*The following definitions come from smbd/ipc.c */ int reply_trans(connection_struct *conn, char *inbuf,char *outbuf, int size, int bufsize); @@ -1788,7 +1795,7 @@ int reply_nttrans(connection_struct *conn, /*The following definitions come from smbd/open.c */ void fd_add_to_uid_cache(file_fd_struct *fd_ptr, uid_t u); -int fd_attempt_close(file_fd_struct *fd_ptr); +uint16 fd_attempt_close(file_fd_struct *fd_ptr); void open_file_shared(files_struct *fsp,connection_struct *conn,char *fname,int share_mode,int ofun, int mode,int oplock_request, int *Access,int *action); int open_directory(files_struct *fsp,connection_struct *conn, -- cgit From ede44ebdf089a835ea1f3141dd00b50b7bbc54e1 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 10 Sep 1998 18:57:06 +0000 Subject: smb.h: Removed fdnum from file_fd_struct. Not needed. files.c: Removed fd bitmap - not needed. Added code to do use arrays rather than linked list - disabled by default but can be enabled to check performance. Jeremy. (This used to be commit 069efc04545d5fdfc5c40467b8b7554ed5226a2e) --- source3/include/smb.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 8600bcc120..dae3e275d5 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -481,7 +481,6 @@ typedef struct file_fd_struct SMB_DEV_T dev; SMB_INO_T inode; int fd; - int fdnum; int fd_readonly; int fd_writeonly; int real_open_flags; -- cgit From 06cc91f9a631a23dcd4902d710b89e4b7584c459 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 11 Sep 1998 01:24:30 +0000 Subject: Added ssize_t to configure code. Got 'religion' about using size_t and ssize_t for read/write stuff as part of the code to expose 64 bits to the client. This checkin does all the 'easy' stuff - such as all the read/write/lock calls - but now comes the harder parts (open & friends) and all the file enquiry functions..... Jeremy. (This used to be commit 36544fe5476f7770bd5748574fc54be7b3ee4d4a) --- source3/include/config.h.in | 1 + source3/include/proto.h | 28 ++++++++++++++-------------- source3/include/smb.h | 6 +++++- 3 files changed, 20 insertions(+), 15 deletions(-) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index fc5dcd2c4e..615666b7ff 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -63,6 +63,7 @@ #undef HAVE_UNSIGNED_CHAR #undef HAVE_UTIMBUF #undef ino_t +#undef ssize_t #undef HAVE_CONNECT #undef HAVE_SHORT_INO_T #undef WITH_AFS diff --git a/source3/include/proto.h b/source3/include/proto.h index 862c11f350..4c966b2faa 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -258,18 +258,18 @@ BOOL strhaslower(char *s); int count_chars(char *s,char c); void make_dir_struct(char *buf,char *mask,char *fname,SMB_OFF_T size,int mode,time_t date); void close_low_fds(void); -int write_socket(int fd,char *buf,int len); -int read_udp_socket(int fd,char *buf,int len); -int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out); +ssize_t write_socket(int fd,char *buf,size_t len); +ssize_t read_udp_socket(int fd,char *buf,size_t len); +ssize_t read_with_timeout(int fd,char *buf,size_t mincnt,size_t maxcnt,unsigned int time_out); int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew); BOOL send_keepalive(int client); -int read_data(int fd,char *buffer,int N); -int write_data(int fd,char *buffer,int N); +ssize_t read_data(int fd,char *buffer,size_t N); +ssize_t write_data(int fd,char *buffer,size_t N); SMB_OFF_T transfer_file(int infd,int outfd,SMB_OFF_T n,char *header,int headlen,int align); -int read_smb_length(int fd,char *inbuf,int timeout); -BOOL receive_smb(int fd,char *buffer, int timeout); -BOOL client_receive_smb(int fd,char *buffer, int timeout); -BOOL receive_local_message(int fd, char *buffer, int buffer_len, int timeout); +ssize_t read_smb_length(int fd,char *inbuf,unsigned int timeout); +BOOL receive_smb(int fd,char *buffer, unsigned int timeout); +BOOL client_receive_smb(int fd,char *buffer, unsigned int timeout); +BOOL receive_local_message(int fd, char *buffer, int buffer_len, unsigned int timeout); BOOL push_oplock_pending_smb_message(char *buf, int msg_len); BOOL receive_message_or_smb(int smbfd, int oplock_fd, char *buffer, int buffer_len, @@ -289,7 +289,7 @@ void become_daemon(void); BOOL yesno(char *p); char *fgets_slash(char *s2,int maxlen,FILE *f); int set_filelen(int fd, SMB_OFF_T len); -void *Realloc(void *p,int size); +void *Realloc(void *p,size_t size); BOOL get_myname(char *my_name,struct in_addr *ip); BOOL ip_equal(struct in_addr ip1,struct in_addr ip2); int open_socket_in(int type, int port, int dlevel,uint32 socket_addr); @@ -333,7 +333,7 @@ char *tab_depth(int depth); char *sid_to_string(pstring sidstr_out, DOM_SID *sid); BOOL string_to_sid(DOM_SID *sidout, char *sidstr); int str_checksum(char *s); -void zero_free(void *p, int size); +void zero_free(void *p, size_t size); /*The following definitions come from libsmb/clientgen.c */ @@ -1715,8 +1715,8 @@ int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int /*The following definitions come from smbd/fileio.c */ SMB_OFF_T seek_file(files_struct *fsp,SMB_OFF_T pos); -int read_file(files_struct *fsp,char *data,uint32 pos,int n); -int write_file(files_struct *fsp,char *data,int n); +ssize_t read_file(files_struct *fsp,char *data,SMB_OFF_T pos,size_t n); +ssize_t write_file(files_struct *fsp,char *data,size_t n); void sync_file(connection_struct *conn, files_struct *fsp); /*The following definitions come from smbd/filename.c */ @@ -1846,7 +1846,7 @@ int reply_pipe_close(connection_struct *conn, char *inbuf,char *outbuf); /*The following definitions come from smbd/predict.c */ -int read_predict(int fd,SMB_OFF_T offset,char *buf,char **ptr,int num); +ssize_t read_predict(int fd,SMB_OFF_T offset,char *buf,char **ptr,size_t num); void do_read_prediction(void); void invalidate_read_prediction(int fd); diff --git a/source3/include/smb.h b/source3/include/smb.h index dae3e275d5..3e68f1c4ca 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -458,7 +458,7 @@ typedef struct /* Structure used when SMBwritebmpx is active */ typedef struct { - int wr_total_written; /* So we know when to discard this */ + size_t wr_total_written; /* So we know when to discard this */ int32 wr_timeout; int32 wr_errclass; int32 wr_error; /* Cached errors */ @@ -1413,6 +1413,10 @@ enum ssl_version_enum {SMB_SSL_V2,SMB_SSL_V3,SMB_SSL_V23,SMB_SSL_TLS1}; #define SMB_LPID_OFFSET(indx) (10 * (indx)) #define SMB_LKOFF_OFFSET(indx) ( 2 + (10 * (indx))) #define SMB_LKLEN_OFFSET(indx) ( 6 + (10 * (indx))) +#define SMB_LARGE_LKOFF_OFFSET_HIGH(indx) (4 + (20 * (indx))) +#define SMB_LARGE_LKOFF_OFFSET_LOW(indx) (8 + (20 * (indx))) +#define SMB_LARGE_LKLEN_OFFSET_HIGH(indx) (12 + (20 * (indx))) +#define SMB_LARGE_LKLEN_OFFSET_LOW(indx) (16 + (20 * (indx))) /* Macro to cache an error in a write_bmpx_struct */ #define CACHE_ERROR(w,c,e) ((w)->wr_errclass = (c), (w)->wr_error = (e), \ -- cgit From 27d0bef143fbc4d7547c022046c094bbdbd0bfc1 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 11 Sep 1998 19:14:27 +0000 Subject: Ok - this is the 'expose 64 bit to the clients' checkin. I have tested it by creating a 'holey' 20GB file - checking that it shows up correctl in the NT file view (it does) and am busily copying it to NULL: on the NT box. All good so far.... :-). Also implemented NT 'delete on close' semantics. Jeremy. (This used to be commit 1654faee80648583e6a47ab7eda990fefdf85124) --- source3/include/smb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 3e68f1c4ca..5a90f08258 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -576,6 +576,7 @@ typedef struct files_struct BOOL granted_oplock; BOOL sent_oplock_break; BOOL is_directory; + BOOL delete_on_close; char *fsp_name; } files_struct; -- cgit From 9b20e5bac2a7b83f8e3dfdf3a274a1ce12dbd92c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 11 Sep 1998 21:42:18 +0000 Subject: Ok so with this bugfix 64 bit file access actually seems to work :-). Problems were just dumb bugs like (defining sys_lseek to return 'int' DOH !). Jeremy. (This used to be commit 54dd51176fbab18af0b21bdee71b53f8f86573a8) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 4c966b2faa..a864cd7033 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -159,7 +159,7 @@ int sys_stat(char *fname,SMB_STRUCT_STAT *sbuf); int sys_fstat(int fd,SMB_STRUCT_STAT *sbuf); int sys_lstat(char *fname,SMB_STRUCT_STAT *sbuf); int sys_ftruncate(int fd, SMB_OFF_T offset); -int sys_lseek(int fd, SMB_OFF_T offset, int whence); +SMB_OFF_T sys_lseek(int fd, SMB_OFF_T offset, int whence); int dos_unlink(char *fname); int dos_open(char *fname,int flags,int mode); DIR *dos_opendir(char *dname); -- cgit From cd5d4d5c12395fc55cca5048ff368d52717ab9cc Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 14 Sep 1998 19:49:55 +0000 Subject: Fixed problems people were having with creating profile directories (NTTrans/Create with Security Descriptor for a directory). It turns out the CIFS spec is bogus (what a suprise) and the 'is a directory' flag is actually embedded in the create_options field. Jeremy. (This used to be commit 68750d8153f01bd0802bb86e93c3ca5d11acb199) --- source3/include/smb.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 5a90f08258..412b1f3383 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1187,6 +1187,16 @@ struct bitmap { #define FILE_OVERWRITE 4 #define FILE_OVERWRITE_IF 5 +/* CreateOptions field. */ +#define FILE_DIRECTORY_FILE 0x0001 +#define FILE_WRITE_THROUGH 0x0002 +#define FILE_SEQUENTIAL_ONLY 0x0004 +#define FILE_NON_DIRECTORY_FILE 0x0040 +#define FILE_NO_EA_KNOWLEDGE 0x0200 +#define FILE_EIGHT_DOT_THREE_ONLY 0x0400 +#define FILE_RANDOM_ACCESS 0x0800 +#define FILE_DELETE_ON_CLOSE 0x1000 + /* Responses when opening a file. */ #define FILE_WAS_OPENED 1 #define FILE_WAS_CREATED 2 -- cgit From e959f2e2322cfac811946d418406267629a2c12b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 17 Sep 1998 06:36:08 +0000 Subject: fixed a potential problem with wins_write_database() child processes. In sig_term() we were calling wins_write_database(0) which would fork a child. This child might then get killed by the same process killing off the parent. That process would then fork another child etc. The solution is to pass a "background" flag to wins_write_database(0) and only fork if this is set. (This used to be commit 1e1a512e3ff59f962fb3de382f671618bed60839) --- source3/include/proto.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index a864cd7033..f2b74b4076 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -825,7 +825,7 @@ void wins_process_name_query_request(struct subnet_record *subrec, void wins_process_name_release_request(struct subnet_record *subrec, struct packet_struct *p); void initiate_wins_processing(time_t t); -void wins_write_database(void); +void wins_write_database(BOOL background); /*The following definitions come from nmbd/nmbd_workgroupdb.c */ @@ -1744,11 +1744,6 @@ void file_chain_reset(void); void file_chain_save(void); void file_chain_restore(void); -/*The following definitions come from smbd/groupname.c */ - -void load_groupname_map(void); -void map_gid_to_sid( gid_t gid, DOM_SID *psid); - /*The following definitions come from smbd/ipc.c */ int reply_trans(connection_struct *conn, char *inbuf,char *outbuf, int size, int bufsize); -- cgit From ac9b687cc2496409e1c8d86393812faf94ec7550 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 17 Sep 1998 19:16:12 +0000 Subject: configure configure.in: Added tests for fseek64 and ftell64. config.h.in: Added fseek64 and ftell64. includes.h: Added definition of SMB_BIG_INTEGER. smb.h: Changed (*getsmbpwpos) and (*setsmbpwpos) to use SMB_BIG_INTEGER. access.c: Tidyup of dbug statement. system.c: Added sys_fseek and sys_ftell. Changed mode calls to use mode_t. asyncdns.c: Tidyup of comment. loadparm.c: Tidyup of set_default_server_announce_type() function definition. ldap.c: Changed (*getsmbpwpos) and (*setsmbpwpos) to use SMB_BIG_INTEGER. nispass.c: Changed (*getsmbpwpos) and (*setsmbpwpos) to use SMB_BIG_INTEGER. smbpass.c: Changed (*getsmbpwpos) and (*setsmbpwpos) to use SMB_BIG_INTEGER. smbpassfile.c: Use sys_fseek(). chgpasswd.c: Tidyup of debug statement. dosmode.c: Changed mode calls to use mode_t. ipc.c: Removal of dead code. nttrans.c: Changed mode calls to use mode_t. open.c: Changed mode calls to use mode_t. pipes.c: Removal of dead code. reply.c: Removal of dead code. trans2.c: Removal of dead code. Changed mode calls to use mode_t. Jeremy. (This used to be commit c381d32e3dc23fe887408016cae821aceb30da2c) --- source3/include/config.h.in | 6 ++++++ source3/include/includes.h | 6 ++++++ source3/include/proto.h | 10 ++++++---- source3/include/smb.h | 4 ++-- 4 files changed, 20 insertions(+), 6 deletions(-) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 615666b7ff..2934d438dc 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -154,6 +154,9 @@ /* Define if you have the execl function. */ #undef HAVE_EXECL +/* Define if you have the fseek64 function. */ +#undef HAVE_FSEEK64 + /* Define if you have the fstat function. */ #undef HAVE_FSTAT @@ -163,6 +166,9 @@ /* Define if you have the fsync function. */ #undef HAVE_FSYNC +/* Define if you have the ftell64 function. */ +#undef HAVE_FTELL64 + /* Define if you have the ftruncate function. */ #undef HAVE_FTRUNCATE diff --git a/source3/include/includes.h b/source3/include/includes.h index f0271906a5..d8da84bd4e 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -410,6 +410,12 @@ # endif #endif +#if defined(HAVE_LONGLONG) +#define SMB_BIG_INTEGER unsigned long long +#else +#define SMB_BIG_INTEGER unsigned long +#endif + #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif diff --git a/source3/include/proto.h b/source3/include/proto.h index f2b74b4076..6ddc92824d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -160,18 +160,20 @@ int sys_fstat(int fd,SMB_STRUCT_STAT *sbuf); int sys_lstat(char *fname,SMB_STRUCT_STAT *sbuf); int sys_ftruncate(int fd, SMB_OFF_T offset); SMB_OFF_T sys_lseek(int fd, SMB_OFF_T offset, int whence); +int sys_fseek(FILE *fp, SMB_OFF_T offset, int whence); +SMB_OFF_T sys_ftell(FILE *fp); int dos_unlink(char *fname); -int dos_open(char *fname,int flags,int mode); +int dos_open(char *fname,int flags,mode_t mode); DIR *dos_opendir(char *dname); int dos_stat(char *fname,SMB_STRUCT_STAT *sbuf); int sys_waitpid(pid_t pid,int *status,int options); int dos_lstat(char *fname,SMB_STRUCT_STAT *sbuf); -int dos_mkdir(char *dname,int mode); +int dos_mkdir(char *dname,mode_t mode); int dos_rmdir(char *dname); int dos_chdir(char *dname); int dos_utime(char *fname,struct utimbuf *times); int dos_rename(char *from, char *to); -int dos_chmod(char *fname,int mode); +int dos_chmod(char *fname,mode_t mode); char *dos_getwd(char *s); int sys_chown(char *fname,int uid,int gid); int sys_chroot(char *dname); @@ -1792,7 +1794,7 @@ int reply_nttrans(connection_struct *conn, void fd_add_to_uid_cache(file_fd_struct *fd_ptr, uid_t u); uint16 fd_attempt_close(file_fd_struct *fd_ptr); void open_file_shared(files_struct *fsp,connection_struct *conn,char *fname,int share_mode,int ofun, - int mode,int oplock_request, int *Access,int *action); + mode_t mode,int oplock_request, int *Access,int *action); int open_directory(files_struct *fsp,connection_struct *conn, char *fname, int smb_ofun, int unixmode, int *action); BOOL check_file_sharing(connection_struct *conn,char *fname, BOOL rename_op); diff --git a/source3/include/smb.h b/source3/include/smb.h index 412b1f3383..aa963f9163 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -708,8 +708,8 @@ struct passdb_ops { */ void *(*startsmbpwent)(BOOL); void (*endsmbpwent)(void *); - unsigned long (*getsmbpwpos)(void *); - BOOL (*setsmbpwpos)(void *, unsigned long); + SMB_BIG_INTEGER (*getsmbpwpos)(void *); + BOOL (*setsmbpwpos)(void *, SMB_BIG_INTEGER); /* * smb password database query functions. -- cgit From b8b67f4fab4a6fd686c5796c2701882197a7bd9d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 17 Sep 1998 23:06:57 +0000 Subject: configure configure.in: Added checks for statvfs64. Last bit of 64 bit widening (I hope :-). include/config.h.in: Added #undef STAT_STATVFS64. include/includes.h: Added SMB_STRUCT_STATVFS type, Changed SMB_BIG_INTEGER to SMB_BIG_UINT and SMB_BIG_INT types. include/smb.h: Added flag defines from CIFS spec. lib/debug.c: Fixed one more mode_t issue. lib/system.c: Added sys_statvfs wrapper. lib/util.c: Changed trim_string to use size_t. param/loadparm.c: Moved "blocking locks" into locking section. Alphabetised locking options. Question - shuld we do this for all options ? passdb/ldap.c: Changed SMB_BIG_INTEGER to SMB_BIG_UINT. passdb/nispass.c: Changed SMB_BIG_INTEGER to SMB_BIG_UINT. passdb/smbpass.c: Changed SMB_BIG_INTEGER to SMB_BIG_UINT. smbd/dfree.c: Changed to use 64 bit types if available. Moved to use unsigned types. smbd/dosmode.c: Fixed one more mode_t issue. smbd/negprot.c: Changed literals to be FLAG_ #defines. smbd/nttrans.c: Removed dead code. smbd/open.c: Changed disk_free call. smbd/process.c: Changed literals to be FLAG_ #defines. smbd/reply.c: Changed disk_free call. smbd/trans2.c: Fixed but in SMB_QUERY_FS_VOLUME_INFO call. Was using UNICODE - should use ascii. tests/summary.c: Added STAT_STATVFS64 check. Jeremy. (This used to be commit c512b1b91fb7f2a7a93b9033a33e06d966daadb4) --- source3/include/config.h.in | 1 + source3/include/includes.h | 18 ++++++++++++++++-- source3/include/proto.h | 4 ++-- source3/include/smb.h | 18 ++++++++++++++---- 4 files changed, 33 insertions(+), 8 deletions(-) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 2934d438dc..4e4127e448 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -95,6 +95,7 @@ #undef STAT_STATFS3_OSF1 #undef STAT_STATFS4 #undef STAT_STATVFS +#undef STAT_STATVFS64 #undef HAVE_NETMASK_IFREQ #undef HAVE_NETMASK_AIX #undef HAVE_CRYPT diff --git a/source3/include/includes.h b/source3/include/includes.h index d8da84bd4e..788e4485ab 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -374,6 +374,18 @@ # endif #endif +/* + * Type for statvfs structure. + */ + +#ifndef SMB_STRUCT_STATVFS +# if defined(STAT_STATVFS64) +# define SMB_STRUCT_STATVFS struct statvfs64 +# else +# define SMB_STRUCT_STATVFS struct statvfs +# endif +#endif + /* * Defines for 64 bit fcntl locks. */ @@ -411,9 +423,11 @@ #endif #if defined(HAVE_LONGLONG) -#define SMB_BIG_INTEGER unsigned long long +#define SMB_BIG_UINT unsigned long long +#define SMB_BIG_INT long long #else -#define SMB_BIG_INTEGER unsigned long +#define SMB_BIG_UINT unsigned long +#define SMB_BIG_INT long #endif #ifndef MIN diff --git a/source3/include/proto.h b/source3/include/proto.h index 6ddc92824d..8b063bcfd9 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -158,6 +158,7 @@ int sys_select(int maxfd, fd_set *fds,struct timeval *tval); int sys_stat(char *fname,SMB_STRUCT_STAT *sbuf); int sys_fstat(int fd,SMB_STRUCT_STAT *sbuf); int sys_lstat(char *fname,SMB_STRUCT_STAT *sbuf); +int sys_statvfs( const char *path, SMB_STRUCT_STATVFS *fsd); int sys_ftruncate(int fd, SMB_OFF_T offset); SMB_OFF_T sys_lseek(int fd, SMB_OFF_T offset, int whence); int sys_fseek(FILE *fp, SMB_OFF_T offset, int whence); @@ -1669,7 +1670,6 @@ BOOL claim_connection(connection_struct *conn,char *name,int max_connections,BOO /*The following definitions come from smbd/dfree.c */ -int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize); /*The following definitions come from smbd/dir.c */ @@ -1796,7 +1796,7 @@ uint16 fd_attempt_close(file_fd_struct *fd_ptr); void open_file_shared(files_struct *fsp,connection_struct *conn,char *fname,int share_mode,int ofun, mode_t mode,int oplock_request, int *Access,int *action); int open_directory(files_struct *fsp,connection_struct *conn, - char *fname, int smb_ofun, int unixmode, int *action); + char *fname, int smb_ofun, mode_t unixmode, int *action); BOOL check_file_sharing(connection_struct *conn,char *fname, BOOL rename_op); /*The following definitions come from smbd/oplock.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index aa963f9163..de482de6d6 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -708,8 +708,8 @@ struct passdb_ops { */ void *(*startsmbpwent)(BOOL); void (*endsmbpwent)(void *); - SMB_BIG_INTEGER (*getsmbpwpos)(void *); - BOOL (*setsmbpwpos)(void *, SMB_BIG_INTEGER); + SMB_BIG_UINT (*getsmbpwpos)(void *); + BOOL (*setsmbpwpos)(void *, SMB_BIG_UINT); /* * smb password database query functions. @@ -925,6 +925,15 @@ struct bitmap { #define smb_vwv16 69 #define smb_vwv17 71 +/* flag defines. CIFS spec 3.1.1 */ +#define FLAG_SUPPORT_LOCKREAD 0x01 +#define FLAG_CLIENT_BUF_AVAIL 0x02 +#define FLAG_RESERVED 0x04 +#define FLAG_CASELESS_PATHNAMES 0x08 +#define FLAG_CANONICAL_PATHNAMES 0x10 +#define FLAG_REQUEST_OPLOCK 0x20 +#define FLAG_REQUEST_BATCH_OPLOCK 0x40 +#define FLAG_REPLY 0x80 /* the complete */ #define SMBmkdir 0x00 /* create directory */ @@ -1115,7 +1124,7 @@ struct bitmap { /* these are for the NT create_and_X */ #define smb_ntcreate_NameLength (smb_vwv0 + 5) #define smb_ntcreate_Flags (smb_vwv0 + 7) -#define smb_ntcreate_RootDirectoryFid (smb_wvw0 + 11) +#define smb_ntcreate_RootDirectoryFid (smb_vwv0 + 11) #define smb_ntcreate_DesiredAccess (smb_vwv0 + 15) #define smb_ntcreate_AllocationSize (smb_vwv0 + 19) #define smb_ntcreate_FileAttributes (smb_vwv0 + 27) @@ -1494,7 +1503,8 @@ extern int unix_ERR_code; /* * Core protocol. */ -#define CORE_OPLOCK_REQUEST(inbuf) ((CVAL(inbuf,smb_flg)&((1<<5)|(1<<6)))>>5) +#define CORE_OPLOCK_REQUEST(inbuf) \ + ((CVAL(inbuf,smb_flg)&(FLAG_REQUEST_OPLOCK|FLAG_REQUEST_BATCH_OPLOCK))>>5) /* * Extended protocol. -- cgit From 1e17cbd2a3db061c8638ee8566ded53d14878bca Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 18 Sep 1998 00:12:15 +0000 Subject: nmbd/nmbd_winsserver.c: Fixed printf style warning. script/mkproto.awk: Added SMB_BIG_UINT. Jeremy. (This used to be commit c22c40f0caa7d6a9e8120e6415fa728db708db3e) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 8b063bcfd9..d19188f8ef 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1670,6 +1670,7 @@ BOOL claim_connection(connection_struct *conn,char *name,int max_connections,BOO /*The following definitions come from smbd/dfree.c */ +SMB_BIG_UINT sys_disk_free(char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize); /*The following definitions come from smbd/dir.c */ -- cgit From 6dfbe2fa1a1d6eb5de05c8f5516c891abe7bdb74 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 18 Sep 1998 00:30:28 +0000 Subject: include/includes.h: lib/system.c: Can't assume every system has a statvfs varient. Return -1 for those that don't. smbd/reply.c: Fixed printf warning. Jeremy. (This used to be commit 14c134e8316687aa5a4ee089c2acfa6428faceae) --- source3/include/includes.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 788e4485ab..69b629f07c 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -376,13 +376,18 @@ /* * Type for statvfs structure. + * Unfortunately, due to the make proto structure + * we still need to define this as void * for platforms + * that don't have either statvfs or statvfs64. JRA. */ #ifndef SMB_STRUCT_STATVFS # if defined(STAT_STATVFS64) # define SMB_STRUCT_STATVFS struct statvfs64 -# else +# elif defined(STAT_STATVFS) # define SMB_STRUCT_STATVFS struct statvfs +# else +# define SMB_STRUCT_STATVFS void * # endif #endif -- cgit From fdc07d1417274d10038da83cee2ea718e6a7abec Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 18 Sep 1998 02:30:03 +0000 Subject: added a SMB_OFF_T_BITS define, allowing us to get rid of most of the #ifdefs for LARGE_OFF_T. (This used to be commit 724b9508c2d15bafdad5912fce702108fdd4cac3) --- source3/include/includes.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 69b629f07c..0f0bbdd89b 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -351,6 +351,8 @@ # endif #endif +#define SMB_OFF_T_BITS (sizeof(SMB_OFF_T)*8) + /* * Set the define that tells us if we can do 64 bit * NT SMB calls. -- cgit From c7da9992cb39fc84a6a915dd2158beaf5e616617 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 18 Sep 1998 03:00:20 +0000 Subject: gto ri of a bunch more #ifdef LARGE_SMB_OFF_T checks by introducing a SOFF_T() macro for setting an SMB_OFF_T variable also limited mmap based reads to MAX_MMAP_SIZE. We really can't mmap 2^50 bytes due to virtual address space problems. (This used to be commit 4e784b18899eddd2399a51fa7d8c219560432922) --- source3/include/includes.h | 8 ++++++++ source3/include/local.h | 5 +++++ 2 files changed, 13 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 0f0bbdd89b..9b6e6266dc 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -353,6 +353,14 @@ #define SMB_OFF_T_BITS (sizeof(SMB_OFF_T)*8) + +#ifdef LARGE_SMB_OFF_T +#define SOFF_T(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,(v)>>32)) +#else +#define SOFF_T(p, ofs, v) SIVAL(p,ofs,v) +#endif + + /* * Set the define that tells us if we can do 64 bit * NT SMB calls. diff --git a/source3/include/local.h b/source3/include/local.h index ead97e565d..bf41af70d7 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -125,6 +125,11 @@ /* the size of the uid cache used to reduce valid user checks */ #define UID_CACHE_SIZE 4 +/* if mmap is enabled, then this is the maximum size of file to use + the mmap code on. We don't want to mmap huge files as virtual + address spaces are limited */ +#define MAX_MMAP_SIZE (100*0x100000) + /* the following control timings of various actions. Don't change them unless you know what you are doing. These are all in seconds */ #define DEFAULT_SMBD_TIMEOUT (60*60*24*7) -- cgit From d1a82e643b2e75db8e0c5afa7280ca383917ba64 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 18 Sep 1998 03:53:14 +0000 Subject: got rid of SMB_STRUCT_STATVFS. I don't think we should be defining structures that only apply on some platforms. (This used to be commit 926591067cd8646426ca06df0b00a1d6f6dd5752) --- source3/include/includes.h | 17 ----------------- source3/include/proto.h | 1 - 2 files changed, 18 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 9b6e6266dc..62c044603d 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -384,23 +384,6 @@ # endif #endif -/* - * Type for statvfs structure. - * Unfortunately, due to the make proto structure - * we still need to define this as void * for platforms - * that don't have either statvfs or statvfs64. JRA. - */ - -#ifndef SMB_STRUCT_STATVFS -# if defined(STAT_STATVFS64) -# define SMB_STRUCT_STATVFS struct statvfs64 -# elif defined(STAT_STATVFS) -# define SMB_STRUCT_STATVFS struct statvfs -# else -# define SMB_STRUCT_STATVFS void * -# endif -#endif - /* * Defines for 64 bit fcntl locks. */ diff --git a/source3/include/proto.h b/source3/include/proto.h index d19188f8ef..0df682c4e3 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -158,7 +158,6 @@ int sys_select(int maxfd, fd_set *fds,struct timeval *tval); int sys_stat(char *fname,SMB_STRUCT_STAT *sbuf); int sys_fstat(int fd,SMB_STRUCT_STAT *sbuf); int sys_lstat(char *fname,SMB_STRUCT_STAT *sbuf); -int sys_statvfs( const char *path, SMB_STRUCT_STATVFS *fsd); int sys_ftruncate(int fd, SMB_OFF_T offset); SMB_OFF_T sys_lseek(int fd, SMB_OFF_T offset, int whence); int sys_fseek(FILE *fp, SMB_OFF_T offset, int whence); -- cgit From c198d4c8be6b1a4f042151714107ff37fc446471 Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Fri, 18 Sep 1998 12:47:46 +0000 Subject: Adding rewritten restore code ... Old code is still there surrounded by a OLD_DOTARPUT. (This used to be commit 00ba54d4ee9ad875c5cfbee09d4b745df5f116ab) --- source3/include/includes.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 62c044603d..8c8ee32301 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -611,6 +611,31 @@ union semun { #define ULTRIX_AUTH 1 #endif +/* This is the naughty bit. Autoconf should declare these symbols if + it finds that GNU Readline is installed. */ + +#define HAVE_LIBREADLINE +#define HAVE_READLINE_READLINE_H +#define HAVE_READLINE_HISTORY_H + +#ifdef HAVE_LIBREADLINE +# ifdef HAVE_READLINE_READLINE_H +# include +# ifdef HAVE_READLINE_HISTORY_H +# include +# endif +# else +# ifdef HAVE_READLINE_H +# include +# ifdef HAVE_HISTORY_H +# include +# endif +# else +# undef HAVE_LIBREADLINE +# endif +# endif +#endif + #ifndef HAVE_STRDUP char *strdup(const char *s); #endif -- cgit From 184db9266efcbcea13169f99002b32208dc2ec9b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 18 Sep 1998 17:50:18 +0000 Subject: configure configure.in include/config.h.in include/includes.h Fixed bugs in readline autoconf. param/loadparm.c smbd/open.c smbd/oplock.c: Started on kernel oplock code - checking forced by above issue. Should not be used currently. Jeremy. (This used to be commit f939efac9e6c45331b17e3d3aa6bc2235e886c1a) --- source3/include/config.h.in | 15 +++++++++++++++ source3/include/includes.h | 9 +-------- source3/include/proto.h | 10 +++++++++- 3 files changed, 25 insertions(+), 9 deletions(-) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 4e4127e448..b54b3635e4 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -314,6 +314,9 @@ /* Define if you have the header file. */ #undef HAVE_GRP_H +/* Define if you have the header file. */ +#undef HAVE_HISTORY_H + /* Define if you have the header file. */ #undef HAVE_LIMITS_H @@ -332,6 +335,15 @@ /* Define if you have the header file. */ #undef HAVE_POLL_H +/* Define if you have the header file. */ +#undef HAVE_READLINE_H + +/* Define if you have the header file. */ +#undef HAVE_READLINE_HISTORY_H + +/* Define if you have the header file. */ +#undef HAVE_READLINE_READLINE_H + /* Define if you have the header file. */ #undef HAVE_RPC_AUTH_H @@ -469,3 +481,6 @@ /* Define if you have the socket library (-lsocket). */ #undef HAVE_LIBSOCKET + +/* Define if you have the readline library (-lreadline). */ +#undef HAVE_LIBREADLINE diff --git a/source3/include/includes.h b/source3/include/includes.h index 8c8ee32301..86887cec6d 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -357,7 +357,7 @@ #ifdef LARGE_SMB_OFF_T #define SOFF_T(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,(v)>>32)) #else -#define SOFF_T(p, ofs, v) SIVAL(p,ofs,v) +#define SOFF_T(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0)) #endif @@ -611,13 +611,6 @@ union semun { #define ULTRIX_AUTH 1 #endif -/* This is the naughty bit. Autoconf should declare these symbols if - it finds that GNU Readline is installed. */ - -#define HAVE_LIBREADLINE -#define HAVE_READLINE_READLINE_H -#define HAVE_READLINE_HISTORY_H - #ifdef HAVE_LIBREADLINE # ifdef HAVE_READLINE_READLINE_H # include diff --git a/source3/include/proto.h b/source3/include/proto.h index 0df682c4e3..df6cb7ddcd 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6,6 +6,11 @@ /*The following definitions come from client/client.c */ void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(file_info *),BOOL recurse_dir, BOOL dirstoo); +char *complete_cmd_null(char *text, int state); +void complete_process_file(file_info *f); +char *complete_remote_file(char *text, int state); +char *complete_cmd(char *text, int state); +char **completion_fn(char *text, int start, int end); /*The following definitions come from client/clientutil.c */ @@ -930,6 +935,7 @@ BOOL lp_passwd_chat_debug(void); BOOL lp_ole_locking_compat(void); BOOL lp_nt_smb_support(void); BOOL lp_stat_cache(void); +BOOL lp_kernel_oplocks(void); int lp_os_level(void); int lp_max_ttl(void); int lp_max_wins_ttl(void); @@ -1055,6 +1061,7 @@ int lp_default_server_announce(void); int lp_major_announce_version(void); int lp_minor_announce_version(void); void lp_set_name_resolve_order(char *new_order); +void lp_set_kernel_oplocks(BOOL val); /*The following definitions come from param/params.c */ @@ -1794,7 +1801,7 @@ int reply_nttrans(connection_struct *conn, void fd_add_to_uid_cache(file_fd_struct *fd_ptr, uid_t u); uint16 fd_attempt_close(file_fd_struct *fd_ptr); void open_file_shared(files_struct *fsp,connection_struct *conn,char *fname,int share_mode,int ofun, - mode_t mode,int oplock_request, int *Access,int *action); + mode_t mode,int *oplock_request, int *Access,int *action); int open_directory(files_struct *fsp,connection_struct *conn, char *fname, int smb_ofun, mode_t unixmode, int *action); BOOL check_file_sharing(connection_struct *conn,char *fname, BOOL rename_op); @@ -1806,6 +1813,7 @@ BOOL process_local_message(int sock, char *buffer, int buf_size); BOOL request_oplock_break(share_mode_entry *share_entry, SMB_DEV_T dev, SMB_INO_T inode); BOOL attempt_close_oplocked_file(files_struct *fsp); +void check_kernel_oplocks(BOOL *have_oplocks); /*The following definitions come from smbd/password.c */ -- cgit From 31ebc956e5f17fef8411b5fef1a6529df072df2a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 18 Sep 1998 18:09:17 +0000 Subject: Fixed problems with premature kernel oplock checkin code. The ./configure & build now seem to work ok. Jeremy. (This used to be commit 7c1a5ed1c2a55543d3f3c8bbd38e6c9c35b80390) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index df6cb7ddcd..6c63df7e30 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1801,7 +1801,7 @@ int reply_nttrans(connection_struct *conn, void fd_add_to_uid_cache(file_fd_struct *fd_ptr, uid_t u); uint16 fd_attempt_close(file_fd_struct *fd_ptr); void open_file_shared(files_struct *fsp,connection_struct *conn,char *fname,int share_mode,int ofun, - mode_t mode,int *oplock_request, int *Access,int *action); + mode_t mode,int oplock_request, int *Access,int *action); int open_directory(files_struct *fsp,connection_struct *conn, char *fname, int smb_ofun, mode_t unixmode, int *action); BOOL check_file_sharing(connection_struct *conn,char *fname, BOOL rename_op); -- cgit From 0ebdf28c9843dc7830a483980432a67955114db2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 18 Sep 1998 18:30:42 +0000 Subject: Fixed position of LARGE_SMB_OFF_T definition. The SOFF_T define was being done *before* the LARGE_SMB_OFF_T was being defined, but SOFF_T depended on it :-). This broke 64 bit file reporting. Jeremy. (This used to be commit c6a353cfabd99be0ce5bf508d716216443a44c20) --- source3/include/includes.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 86887cec6d..3f99574c64 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -353,14 +353,6 @@ #define SMB_OFF_T_BITS (sizeof(SMB_OFF_T)*8) - -#ifdef LARGE_SMB_OFF_T -#define SOFF_T(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,(v)>>32)) -#else -#define SOFF_T(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0)) -#endif - - /* * Set the define that tells us if we can do 64 bit * NT SMB calls. @@ -372,6 +364,12 @@ # endif #endif +#ifdef LARGE_SMB_OFF_T +#define SOFF_T(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,(v)>>32)) +#else +#define SOFF_T(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0)) +#endif + /* * Type for stat structure. */ -- cgit From 11fe457e336168ab7491cfe123899240441316b8 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 18 Sep 1998 21:57:12 +0000 Subject: Now that Alexandre Oliva has explained the use of acconfig.h to me, I'm adding the HAVE_LIBREADLINE and other stuff correctly. Thanks Alexandre :-). Jeremy. (This used to be commit 89a4a73caf474e59f239f50ad6d93e5df66ae300) --- source3/include/config.h.in | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index b54b3635e4..9ad89bf13e 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -95,7 +95,6 @@ #undef STAT_STATFS3_OSF1 #undef STAT_STATFS4 #undef STAT_STATVFS -#undef STAT_STATVFS64 #undef HAVE_NETMASK_IFREQ #undef HAVE_NETMASK_AIX #undef HAVE_CRYPT @@ -118,6 +117,8 @@ #undef HAVE_STRUCT_FLOCK64 #undef SIZEOF_INO_T #undef SIZEOF_OFF_T +#undef STAT_STATVFS64 +#undef HAVE_LIBREADLINE /* The number of bytes in a int. */ #undef SIZEOF_INT @@ -479,8 +480,8 @@ /* Define if you have the pam library (-lpam). */ #undef HAVE_LIBPAM -/* Define if you have the socket library (-lsocket). */ -#undef HAVE_LIBSOCKET - /* Define if you have the readline library (-lreadline). */ #undef HAVE_LIBREADLINE + +/* Define if you have the socket library (-lsocket). */ +#undef HAVE_LIBSOCKET -- cgit From bc97ab2b7ca6849696b391412333a96ff0ad682f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 20 Sep 1998 15:39:12 +0000 Subject: add a define for SMB_SEARCH_BITS and change comment on FSTYPE_STRING (This used to be commit 9c275bcd98cbbd9367d9b7a2204889fcefd74638) --- source3/include/local.h | 4 ++-- source3/include/smb.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index bf41af70d7..f68f57eff7 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -78,8 +78,8 @@ /* the size of the directory cache */ #define DIRCACHESIZE 20 -/* what type of filesystem do we want this to show up as in a NT file - manager window? */ +/* what default type of filesystem do we want this to show up as in a + NT file manager window? */ #define FSTYPE_STRING "Samba" /* the default guest account - normally set in the Makefile or smb.conf */ diff --git a/source3/include/smb.h b/source3/include/smb.h index de482de6d6..2af7b7ced4 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1134,6 +1134,9 @@ struct bitmap { #define smb_ntcreate_ImpersonationLevel (smb_vwv0 + 43) #define smb_ntcreate_SecurityFlags (smb_vwv0 + 47) +/* this is used on a TConX. I'm not sure the name is very helpful though */ +#define SMB_SUPPORT_SEARCH_BITS 0x0001 + /* these are the constants used in the above call. */ /* DesiredAccess */ /* File Specific access rights. */ -- cgit From f0dc663c6332b4922826dcc446e4c5359646897e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 20 Sep 1998 15:48:35 +0000 Subject: lp_fstype() proto (This used to be commit ac48db7f2130c29a25185bc5450f94811cc54640) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 6c63df7e30..161e6a6bed 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -990,6 +990,7 @@ char *lp_force_user(int ); char *lp_force_group(int ); char *lp_readlist(int ); char *lp_writelist(int ); +char *lp_fstype(int ); char *lp_mangled_map(int ); char *lp_veto_files(int ); char *lp_hide_files(int ); -- cgit From e649750cb4d2d2577f0577b1d7a87ae4daf8fb6f Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Mon, 21 Sep 1998 09:07:08 +0000 Subject: major autoconf clean-up fix problems in builds with srcdir!=builddir (This used to be commit 1ffc3b807a3f80644c974b454ff5e6f68e89b546) --- source3/include/config.h.in | 17 +++++++++++------ source3/include/dummy.in | 1 + source3/include/stamp-h.in | 2 ++ 3 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 source3/include/stamp-h.in (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 9ad89bf13e..7b536afc31 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -62,6 +62,7 @@ #undef HAVE_REMSH #undef HAVE_UNSIGNED_CHAR #undef HAVE_UTIMBUF +#undef ssize_t #undef ino_t #undef ssize_t #undef HAVE_CONNECT @@ -95,6 +96,7 @@ #undef STAT_STATFS3_OSF1 #undef STAT_STATFS4 #undef STAT_STATVFS +#undef STAT_STATVFS64 #undef HAVE_NETMASK_IFREQ #undef HAVE_NETMASK_AIX #undef HAVE_CRYPT @@ -147,6 +149,12 @@ /* Define if you have the chroot function. */ #undef HAVE_CHROOT +/* Define if you have the connect function. */ +#undef HAVE_CONNECT + +/* Define if you have the crypt function. */ +#undef HAVE_CRYPT + /* Define if you have the crypt16 function. */ #undef HAVE_CRYPT16 @@ -225,6 +233,9 @@ /* Define if you have the mktime function. */ #undef HAVE_MKTIME +/* Define if you have the pam_authenticate function. */ +#undef HAVE_PAM_AUTHENTICATE + /* Define if you have the pathconf function. */ #undef HAVE_PATHCONF @@ -462,9 +473,6 @@ /* Define if you have the header file. */ #undef HAVE_UTIME_H -/* Define if you have the crypt library (-lcrypt). */ -#undef HAVE_LIBCRYPT - /* Define if you have the dl library (-ldl). */ #undef HAVE_LIBDL @@ -477,9 +485,6 @@ /* Define if you have the nsl_s library (-lnsl_s). */ #undef HAVE_LIBNSL_S -/* Define if you have the pam library (-lpam). */ -#undef HAVE_LIBPAM - /* Define if you have the readline library (-lreadline). */ #undef HAVE_LIBREADLINE diff --git a/source3/include/dummy.in b/source3/include/dummy.in index e69de29bb2..8b13789179 100644 --- a/source3/include/dummy.in +++ b/source3/include/dummy.in @@ -0,0 +1 @@ + diff --git a/source3/include/stamp-h.in b/source3/include/stamp-h.in new file mode 100644 index 0000000000..1214bd37f5 --- /dev/null +++ b/source3/include/stamp-h.in @@ -0,0 +1,2 @@ +-rw-r--r-- 1 oliva pos 1371 Sep 19 00:48 acconfig.h +-rw-r--r-- 1 oliva pos 24197 Sep 20 07:11 configure.in -- cgit From ac39ce3eba28eed97942e915f7b4cd77cdfd9e2d Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Mon, 21 Sep 1998 11:34:44 +0000 Subject: replace getpass() with getsmbpass() if getsmbpass.c compiles (This used to be commit 9a5bdf5c1bef689fe0d6879949df869efbc34783) --- source3/include/config.h.in | 1 + source3/include/includes.h | 11 ++++++----- source3/include/proto.h | 2 -- source3/include/stamp-h.in | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 7b536afc31..da545486f0 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -109,6 +109,7 @@ #undef WITH_AUTOMOUNT #undef HAVE_PAM_AUTHENTICATE #undef HAVE_BROKEN_GETGROUPS +#undef REPLACE_GETPASS #undef REPLACE_INET_NTOA #undef HAVE_FILE_MACRO #undef HAVE_FUNCTION_MACRO diff --git a/source3/include/includes.h b/source3/include/includes.h index 3f99574c64..5b47e6fa35 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -21,7 +21,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#ifndef NO_CONFIG_H /* for some tests */ #include "config.h" +#endif #include "local.h" #ifdef AIX @@ -37,15 +39,10 @@ #endif #ifdef SUNOS4 -#define REPLACE_GETPASS /* on SUNOS4 termios.h conflicts with sys/ioctl.h */ #undef HAVE_TERMIOS_H #endif -#ifdef SUNOS5 -#define REPLACE_GETPASS -#endif - #include @@ -661,4 +658,8 @@ int setresgid(gid_t rgid, gid_t egid, gid_t sgid); #define bzero(a,b) memset((a),'\0',(b)) #endif +#ifdef REPLACE_GETPASS +#define getpass(prompt) getsmbpass((prompt)) +#endif + #endif /* _INCLUDES_H */ diff --git a/source3/include/proto.h b/source3/include/proto.h index 161e6a6bed..c2d5c0e1ff 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -521,7 +521,6 @@ void kill_async_dns_child(void); /*The following definitions come from nmbd/nmbd.c */ BOOL reload_services(BOOL test); -int main(int argc,char *argv[]); /*The following definitions come from nmbd/nmbd_become_dmb.c */ @@ -2013,5 +2012,4 @@ void status_page(void); /*The following definitions come from web/swat.c */ -int main(int argc, char *argv[]); #endif /* _PROTO_H_ */ diff --git a/source3/include/stamp-h.in b/source3/include/stamp-h.in index 1214bd37f5..75ac934484 100644 --- a/source3/include/stamp-h.in +++ b/source3/include/stamp-h.in @@ -1,2 +1,2 @@ --rw-r--r-- 1 oliva pos 1371 Sep 19 00:48 acconfig.h --rw-r--r-- 1 oliva pos 24197 Sep 20 07:11 configure.in +-rw-r--r-- 1 oliva pos 1394 Sep 21 08:00 acconfig.h +-rw-r--r-- 1 oliva pos 24688 Sep 21 08:11 configure.in -- cgit From aab2fe021643417854451c65e564932f4ac25f10 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 23 Sep 1998 01:48:45 +0000 Subject: First cut at kernel oplocks. This should have no effect unless runnin on a machine that supports them in autoconf. Move various functions out of lib/util.c into smbd/process.c and smbd/oplock.c where they belong. Jeremy. (This used to be commit c3c5e13f85c97939746070132dad941e79c546fb) --- source3/include/config.h.in | 1 + source3/include/proto.h | 15 +++++++-------- source3/include/smb.h | 26 ++++++++++++++++++++++---- 3 files changed, 30 insertions(+), 12 deletions(-) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index da545486f0..4f199f0df3 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -122,6 +122,7 @@ #undef SIZEOF_OFF_T #undef STAT_STATVFS64 #undef HAVE_LIBREADLINE +#undef HAVE_KERNEL_OPLOCKS /* The number of bytes in a int. */ #undef SIZEOF_INT diff --git a/source3/include/proto.h b/source3/include/proto.h index c2d5c0e1ff..cbd4f07b2f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -276,11 +276,6 @@ SMB_OFF_T transfer_file(int infd,int outfd,SMB_OFF_T n,char *header,int headlen, ssize_t read_smb_length(int fd,char *inbuf,unsigned int timeout); BOOL receive_smb(int fd,char *buffer, unsigned int timeout); BOOL client_receive_smb(int fd,char *buffer, unsigned int timeout); -BOOL receive_local_message(int fd, char *buffer, int buffer_len, unsigned int timeout); -BOOL push_oplock_pending_smb_message(char *buf, int msg_len); -BOOL receive_message_or_smb(int smbfd, int oplock_fd, - char *buffer, int buffer_len, - int timeout, BOOL *got_smb); BOOL send_smb(int fd,char *buffer); int name_extract(char *buf,int ofs,char *name); int name_len( char *s ); @@ -1809,11 +1804,14 @@ BOOL check_file_sharing(connection_struct *conn,char *fname, BOOL rename_op); /*The following definitions come from smbd/oplock.c */ BOOL open_oplock_ipc(void); -BOOL process_local_message(int sock, char *buffer, int buf_size); +BOOL receive_local_message(fd_set *fds, char *buffer, int buffer_len, int timeout); +BOOL set_file_oplock(files_struct *fsp); +int setup_oplock_select_set( fd_set *fds); +BOOL process_local_message(char *buffer, int buf_size); BOOL request_oplock_break(share_mode_entry *share_entry, SMB_DEV_T dev, SMB_INO_T inode); BOOL attempt_close_oplocked_file(files_struct *fsp); -void check_kernel_oplocks(BOOL *have_oplocks); +void check_kernel_oplocks(void); /*The following definitions come from smbd/password.c */ @@ -1857,7 +1855,8 @@ void invalidate_read_prediction(int fd); /*The following definitions come from smbd/process.c */ -BOOL receive_next_smb(int smbfd, int oplockfd, char *inbuf, int bufsize, int timeout); +BOOL push_oplock_pending_smb_message(char *buf, int msg_len); +BOOL receive_next_smb(char *inbuf, int bufsize, int timeout); void process_smb(char *inbuf, char *outbuf); char *smb_fn_name(int type); void construct_reply_common(char *inbuf,char *outbuf); diff --git a/source3/include/smb.h b/source3/include/smb.h index 2af7b7ced4..842aeb57be 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1538,11 +1538,11 @@ extern int unix_ERR_code; * Loopback command offsets. */ -#define UDP_CMD_LEN_OFFSET 0 -#define UDP_CMD_PORT_OFFSET 4 -#define UDP_CMD_HEADER_LEN 6 +#define OPBRK_CMD_LEN_OFFSET 0 +#define OPBRK_CMD_PORT_OFFSET 4 +#define OPBRK_CMD_HEADER_LEN 6 -#define UDP_MESSAGE_CMD_OFFSET 0 +#define OPBRK_MESSAGE_CMD_OFFSET 0 /* * Oplock break command code to send over the udp socket. @@ -1563,6 +1563,24 @@ extern int unix_ERR_code; #define OPLOCK_BREAK_INODE_OFFSET (OPLOCK_BREAK_DEV_OFFSET + sizeof(SMB_DEV_T)) #define OPLOCK_BREAK_MSG_LEN (OPLOCK_BREAK_INODE_OFFSET + sizeof(SMB_INO_T)) +#if defined(HAVE_KERNEL_OPLOCKS) +/* + * Oplock break command code sent via the kernel interface. + * + * Form of this is : + * + * 0 2 2+devsize 2+devsize+inodesize + * +----+--------+--------+ + * | cmd| dev | inode | + * +----+--------+--------+ + */ + +#define KERNEL_OPLOCK_BREAK_CMD 0x2 +#define KERNEL_OPLOCK_BREAK_DEV_OFFSET 2 +#define KERNEL_OPLOCK_BREAK_INODE_OFFSET (KERNEL_OPLOCK_BREAK_DEV_OFFSET + sizeof(SMB_DEV_T)) +#define KERNEL_OPLOCK_BREAK_MSG_LEN (KERNEL_OPLOCK_BREAK_INODE_OFFSET + sizeof(SMB_INO_T)) + +#endif /* HAVE_KERNEL_OPLOCKS */ #define CMD_REPLY 0x8000 -- cgit From 500a474aae49bd1cc8e75481a3b3cd6e79720d89 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 23 Sep 1998 21:49:09 +0000 Subject: nttrans.c: winreg was missing from the list of pipes. advise using the array already defined in... rpc_parse/parse_rpc.c's pipe_names[], but writing code to strip "\PIPE\" from the front when making the check. one location to update when adding new pipes, not two. srv_pipe_hnd.c: moved the ZERO_STRUCT(p) macro to _before_ the DLIST_ADD(Pipes, p) macro. dlinklist.h: added { }s around the code inserted by DLIST_ADD and DLIST_REMOVE macros (This used to be commit 29201d4b9b52652c7a992d0f6b677a09b4c33912) --- source3/include/dlinklist.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/dlinklist.h b/source3/include/dlinklist.h index 8810eca5b9..851bf01d38 100644 --- a/source3/include/dlinklist.h +++ b/source3/include/dlinklist.h @@ -25,6 +25,7 @@ /* hook into the front of the list */ #define DLIST_ADD(list, p) \ +{ \ if (!(list)) { \ (list) = (p); \ (p)->next = (p)->prev = NULL; \ @@ -33,18 +34,21 @@ (p)->next = (list); \ (p)->prev = NULL; \ (list) = (p); \ - } + }\ +} /* remove an element from a list */ #define DLIST_REMOVE(list, p) \ +{ \ if ((p) == (list)) { \ (list) = (p)->next; \ if (list) (list)->prev = NULL; \ } else { \ (p)->prev->next = (p)->next; \ if ((p)->next) (p)->next->prev = (p)->prev; \ - } + } \ +} /* promote an element to the top of the list */ #define DLIST_PROMOTE(list, p) \ -- cgit From dc36d8768aa13000c48b520f09f6678ea9ffbf28 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 24 Sep 1998 22:33:13 +0000 Subject: Integration of Anders Blomdell 's smbpasswd changes. Not exactly the same as his code - several changes. Jeremy. (This used to be commit e96747a8e3b9ea5a79c4258e55d7e8f3bf0bf193) --- source3/include/proto.h | 2 +- source3/include/smb.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index cbd4f07b2f..fd77c45ee3 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1101,7 +1101,7 @@ void pdb_init_smb(struct smb_passwd *user); void pdb_init_sam(struct sam_passwd *user); struct sam_disp_info *pdb_sam_to_dispinfo(struct sam_passwd *user); struct smb_passwd *pdb_sam_to_smb(struct sam_passwd *user); -char *pdb_encode_acct_ctrl(uint16 acct_ctrl); +char *pdb_encode_acct_ctrl(uint16 acct_ctrl, size_t length); uint16 pdb_decode_acct_ctrl(char *p); BOOL pdb_gethexpwd(char *p, char *pwd); BOOL pdb_name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); diff --git a/source3/include/smb.h b/source3/include/smb.h index 842aeb57be..bec14ddd13 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1601,6 +1601,12 @@ extern int unix_ERR_code; __FILE__, __LINE__)), smb_panic("assert failed"))) #define SMB_ASSERT_ARRAY(a,n) SMB_ASSERT((sizeof(a)/sizeof((a)[0])) >= (n)) +/* + * Size of new password account encoding string. DO NOT CHANGE. + */ + +#define NEW_PW_FORMAT_SPACE_PADDED_LEN 14 + #endif /* _SMB_H */ #include "ntdomain.h" -- cgit From 66d5d73a5d75e88a77970f7b27687b8354ab2e80 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 25 Sep 1998 21:01:52 +0000 Subject: added rpcclient program (This used to be commit aa38f39d67fade4dfd7badb7a9b39c833a1dd1ca) --- source3/include/nameserv.h | 7 -- source3/include/ntdomain.h | 7 +- source3/include/proto.h | 52 +++++++++++- source3/include/smb.h | 205 +++++++++++++++++++++++++++++++++++++-------- 4 files changed, 219 insertions(+), 52 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h index e50ad042d9..e3a1d740a7 100644 --- a/source3/include/nameserv.h +++ b/source3/include/nameserv.h @@ -170,13 +170,6 @@ enum logon_state struct subnet_record; -/* A netbios name structure. */ -struct nmb_name { - char name[17]; - char scope[64]; - unsigned int name_type; -}; - struct nmb_data { uint16 nb_flags; /* Netbios flags. */ diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index ac411fa653..5cdd2849f8 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -81,13 +81,8 @@ typedef struct pipes_struct uint32 hdr_offsets; uint32 frag_len_left; uint32 next_frag_start; -} pipes_struct; -struct acct_info -{ - fstring acct_name; /* account name */ - uint32 smb_userid; /* domain-relative RID */ -}; +} pipes_struct; struct api_struct { diff --git a/source3/include/proto.h b/source3/include/proto.h index fd77c45ee3..d9ea40354f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -226,6 +226,7 @@ BOOL in_group(gid_t group, int current_gid, int ngroups, GID_T *groups); char *StrCpy(char *dest,char *src); char *StrnCpy(char *dest,char *src,int n); void putip(void *dest,void *src); +char *dns_to_netbios_name(char *dns_name); int name_mangle( char *In, char *Out, char name_type ); BOOL file_exist(char *fname,SMB_STRUCT_STAT *sbuf); time_t file_modtime(char *fname); @@ -387,14 +388,20 @@ BOOL cli_qfileinfo(struct cli_state *cli, int fnum, BOOL cli_oem_change_password(struct cli_state *cli, char *user, char *new_password, char *old_password); BOOL cli_negprot(struct cli_state *cli); -BOOL cli_session_request(struct cli_state *cli, char *host, int name_type, - char *myname); +BOOL cli_session_request(struct cli_state *cli, + struct nmb_name *calling, struct nmb_name *called); BOOL cli_connect(struct cli_state *cli, char *host, struct in_addr *ip); BOOL cli_initialise(struct cli_state *cli); void cli_shutdown(struct cli_state *cli); void cli_error(struct cli_state *cli, int *eclass, int *num); void cli_sockopt(struct cli_state *cli, char *options); int cli_setpid(struct cli_state *cli, int pid); +BOOL cli_reestablish_connection(struct cli_state *cli); +BOOL cli_establish_connection(struct cli_state *cli, + char *dest_host, struct in_addr *dest_ip, + struct nmb_name *calling, struct nmb_name *called, + char *service, char *service_type, + BOOL do_shutdown, BOOL do_tcon); /*The following definitions come from libsmb/credentials.c */ @@ -440,6 +447,20 @@ void sort_query_replies(char *data, int n, struct in_addr ip); char *get_nt_error_msg(uint32 nt_code); +/*The following definitions come from libsmb/pwd_cache.c */ + +void pwd_init(struct pwd_info *pwd); +void pwd_obfuscate_key(struct pwd_info *pwd, uint32 int_key, char *str_key); +void pwd_read(struct pwd_info *pwd, char *passwd_report, BOOL do_encrypt); +void pwd_set_nullpwd(struct pwd_info *pwd); +void pwd_set_cleartext(struct pwd_info *pwd, char *clr); +void pwd_get_cleartext(struct pwd_info *pwd, char *clr); +void pwd_set_lm_nt_16(struct pwd_info *pwd, char lm_pwd[16], char nt_pwd[16]); +void pwd_get_lm_nt_16(struct pwd_info *pwd, char lm_pwd[16], char nt_pwd[16]); +void pwd_make_lm_nt_16(struct pwd_info *pwd, char *clr); +void pwd_make_lm_nt_owf(struct pwd_info *pwd, char cryptkey[8]); +void pwd_get_lm_nt_owf(struct pwd_info *pwd, char lm_owf[24], char nt_owf[24]); + /*The following definitions come from libsmb/smbdes.c */ void E_P16(unsigned char *p14,unsigned char *p16); @@ -455,6 +476,8 @@ void SamOEMhash( unsigned char *data, unsigned char *key, int val); void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); void E_md4hash(uchar *passwd, uchar *p16); +void nt_lm_owf_gen(char *pwd, uchar nt_p16[16], uchar p16[16]); +void SMBOWFencrypt(uchar passwd[16], uchar *c8, uchar p24[24]); void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); /*The following definitions come from libsmb/smberr.c */ @@ -1162,6 +1185,15 @@ BOOL cli_nt_login_network(struct cli_state *cli, char *domain, char *username, NET_ID_INFO_CTR *ctr, NET_USER_INFO_3 *user_info3); BOOL cli_nt_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr); +/*The following definitions come from rpc_client/cli_lsarpc.c */ + +BOOL do_lsa_open_policy(struct cli_state *cli, + char *server_name, POLICY_HND *hnd); +BOOL do_lsa_query_info_pol(struct cli_state *cli, + POLICY_HND *hnd, uint16 info_class, + fstring domain_name, fstring domain_sid); +BOOL do_lsa_close(struct cli_state *cli, POLICY_HND *hnd); + /*The following definitions come from rpc_client/cli_netlogon.c */ BOOL cli_net_logon_ctrl2(struct cli_state *cli, uint32 status_level); @@ -1184,8 +1216,13 @@ void cli_nt_session_close(struct cli_state *cli); /*The following definitions come from rpc_parse/parse_lsa.c */ void make_lsa_trans_name(LSA_TRANS_NAME *trn, uint32 sid_name_use, char *name, uint32 idx); +void make_lsa_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, uint32 sec_qos); +void make_q_open_pol(LSA_Q_OPEN_POL *r_q, char *server_name, + uint32 attributes, uint32 sec_qos, + uint32 desired_access); void lsa_io_q_open_pol(char *desc, LSA_Q_OPEN_POL *r_q, prs_struct *ps, int depth); void lsa_io_r_open_pol(char *desc, LSA_R_OPEN_POL *r_p, prs_struct *ps, int depth); +void make_q_query(LSA_Q_QUERY_INFO *q_q, POLICY_HND *hnd, uint16 info_class); void lsa_io_q_query(char *desc, LSA_Q_QUERY_INFO *q_q, prs_struct *ps, int depth); void lsa_io_q_enum_trust_dom(char *desc, LSA_Q_ENUM_TRUST_DOM *q_e, prs_struct *ps, int depth); void make_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM *r_e, @@ -1197,6 +1234,9 @@ void lsa_io_q_lookup_sids(char *desc, LSA_Q_LOOKUP_SIDS *q_s, prs_struct *ps, in void lsa_io_r_lookup_sids(char *desc, LSA_R_LOOKUP_SIDS *r_s, prs_struct *ps, int depth); void lsa_io_q_lookup_rids(char *desc, LSA_Q_LOOKUP_RIDS *q_r, prs_struct *ps, int depth); void lsa_io_r_lookup_rids(char *desc, LSA_R_LOOKUP_RIDS *r_r, prs_struct *ps, int depth); +void make_lsa_q_close(LSA_Q_CLOSE *q_c, POLICY_HND *hnd); +void lsa_io_q_close(char *desc, LSA_Q_CLOSE *q_c, prs_struct *ps, int depth); +void lsa_io_r_close(char *desc, LSA_R_CLOSE *r_c, prs_struct *ps, int depth); /*The following definitions come from rpc_parse/parse_misc.c */ @@ -1629,6 +1669,14 @@ uint32 lookup_user_rid(char *user_name, uint32 *rid); BOOL api_wkssvc_rpc(pipes_struct *p, prs_struct *data); +/*The following definitions come from rpcclient/cmd_lsarpc.c */ + +void cmd_lsa_query_info(struct client_info *info); + +/*The following definitions come from rpcclient/rpcclient.c */ + +void rpcclient_init(void); + /*The following definitions come from smbd/blocking.c */ BOOL push_blocking_lock_request( char *inbuf, int length, int lock_timeout, int lock_num); diff --git a/source3/include/smb.h b/source3/include/smb.h index bec14ddd13..59a7a07e76 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -403,42 +403,20 @@ typedef struct cred_info UTIME timestamp; /* credential time-stamp */ } DOM_CRED; -struct cli_state { - int fd; - int cnum; - int pid; - int mid; - int uid; - int protocol; - int sec_mode; - int rap_error; - int privilages; - fstring eff_name; - fstring desthost; - char cryptkey[8]; - uint32 sesskey; - int serverzone; - uint32 servertime; - int readbraw_supported; - int writebraw_supported; - int timeout; - int max_xmit; - char *outbuf; - char *inbuf; - int bufsize; - int initialised; - /* - * Only used in NT domain calls. - */ - uint32 nt_error; /* NT RPC error code. */ - uint16 nt_pipe_fnum; /* Pipe handle. */ - unsigned char sess_key[16]; /* Current session key. */ - DOM_CRED clnt_cred; /* Client credential. */ - fstring mach_acct; /* MYNAME$. */ - fstring srv_name_slash; /* \\remote server. */ - fstring clnt_name_slash; /* \\local client. */ -}; +struct pwd_info +{ + BOOL null_pwd; + BOOL cleartext; + BOOL crypted; + fstring password; + + uchar smb_lm_pwd[16]; + uchar smb_nt_pwd[16]; + + uchar smb_lm_owf[24]; + uchar smb_nt_owf[24]; +}; typedef struct { @@ -1601,6 +1579,161 @@ extern int unix_ERR_code; __FILE__, __LINE__)), smb_panic("assert failed"))) #define SMB_ASSERT_ARRAY(a,n) SMB_ASSERT((sizeof(a)/sizeof((a)[0])) >= (n)) +#include "ntdomain.h" + +/* A netbios name structure. */ +struct nmb_name { + char name[17]; + char scope[64]; + unsigned int name_type; +}; + +struct cli_state { + int fd; + int cnum; + int pid; + int mid; + int uid; + int protocol; + int sec_mode; + int rap_error; + int privilages; + + fstring eff_name; + fstring desthost; + fstring user_name; + fstring domain; + + fstring share; + fstring dev; + struct nmb_name called; + struct nmb_name calling; + fstring full_dest_host_name; + struct in_addr dest_ip; + + struct pwd_info pwd; + char cryptkey[8]; + uint32 sesskey; + int serverzone; + uint32 servertime; + int readbraw_supported; + int writebraw_supported; + int timeout; + int max_xmit; + char *outbuf; + char *inbuf; + int bufsize; + int initialised; + /* + * Only used in NT domain calls. + */ + uint32 nt_error; /* NT RPC error code. */ + uint16 nt_pipe_fnum; /* Pipe handle. */ + unsigned char sess_key[16]; /* Current session key. */ + DOM_CRED clnt_cred; /* Client credential. */ + fstring mach_acct; /* MYNAME$. */ + fstring srv_name_slash; /* \\remote server. */ + fstring clnt_name_slash; /* \\local client. */ +}; + +struct acct_info +{ + fstring acct_name; /* account name */ + uint32 smb_userid; /* domain-relative RID */ +}; + +struct nt_client_info +{ + /************* \PIPE\NETLOGON stuff ******************/ + + fstring mach_acct; + + uint8 sess_key[16]; + DOM_CRED clnt_cred; + DOM_CRED rtn_cred; + + NET_ID_INFO_CTR ctr; + NET_USER_INFO_3 user_info3; + + /************** \PIPE\lsarpc stuff ********************/ + + POLICY_HND lsa_info_pol; + + /* domain member */ + fstring level3_dom; + fstring level3_sid; + + /* domain controller */ + fstring level5_dom; + fstring level5_sid; + + /************** \PIPE\samr stuff ********************/ + + POLICY_HND samr_pol_connect; + POLICY_HND samr_pol_open_domain; + POLICY_HND samr_pol_open_user; + + struct acct_info *sam; + int num_sam_entries; +}; + + +struct tar_client_info +{ + int blocksize; + BOOL inc; + BOOL reset; + BOOL excl; + char type; + int attrib; + char **cliplist; + int clipn; + int tp; + int num_files; + int buf_size; + int bytes_written; + char *buf; + int handle; + int print_mode; + char *file_mode; +}; + +struct client_info +{ + struct in_addr dest_ip; + fstring dest_host; + fstring query_host; + uint8 name_type; + + fstring myhostname; + fstring mach_acct; + + pstring cur_dir; + pstring base_dir; + pstring file_sel; + + fstring service; + fstring share; + fstring svc_type; + + time_t newer_than; + int archive_level; + int dir_total; + int put_total_time_ms; + int put_total_size; + int get_total_time_ms; + int get_total_size; + int print_mode; + BOOL translation; + BOOL recurse_dir; + BOOL prompt; + BOOL lowercase; + BOOL abort_mget; + + struct tar_client_info tar; + struct nt_client_info dom; +}; + /* * Size of new password account encoding string. DO NOT CHANGE. */ @@ -1609,6 +1742,4 @@ extern int unix_ERR_code; #endif /* _SMB_H */ -#include "ntdomain.h" - /* _SMB_H */ -- cgit From ff07b2e4a37f23af90a27456a116b773ae3bbf97 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 25 Sep 1998 21:20:37 +0000 Subject: added wksinfo command to rpcclient, which don't work too good. (This used to be commit 8d23da91cbd74a45a5b030688fd89d88a25738dc) --- source3/include/proto.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index d9ea40354f..9d2f3a30a7 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1213,6 +1213,12 @@ BOOL rpc_api_pipe_req(struct cli_state *cli, uint8 op_num, BOOL cli_nt_session_open(struct cli_state *cli, char *pipe_name, BOOL encrypted); void cli_nt_session_close(struct cli_state *cli); +/*The following definitions come from rpc_client/cli_wkssvc.c */ + +BOOL do_wks_query_info(struct cli_state *cli, + char *server_name, uint32 switch_value, + WKS_INFO_100 *wks100); + /*The following definitions come from rpc_parse/parse_lsa.c */ void make_lsa_trans_name(LSA_TRANS_NAME *trn, uint32 sid_name_use, char *name, uint32 idx); @@ -1593,6 +1599,8 @@ void srv_io_r_net_remote_tod(char *desc, SRV_R_NET_REMOTE_TOD *r_n, prs_struct * /*The following definitions come from rpc_parse/parse_wks.c */ +void make_wks_q_query_info(WKS_Q_QUERY_INFO *q_u, + char *server, uint16 switch_value) ; void wks_io_q_query_info(char *desc, WKS_Q_QUERY_INFO *q_u, prs_struct *ps, int depth); void make_wks_info_100(WKS_INFO_100 *inf, uint32 platform_id, uint32 ver_major, uint32 ver_minor, @@ -1673,6 +1681,10 @@ BOOL api_wkssvc_rpc(pipes_struct *p, prs_struct *data); void cmd_lsa_query_info(struct client_info *info); +/*The following definitions come from rpcclient/cmd_wkssvc.c */ + +void cmd_wks_query_info(struct client_info *info); + /*The following definitions come from rpcclient/rpcclient.c */ void rpcclient_init(void); -- cgit From 6fb5804b28adffbbcb45b84e485e09d9d2ddddea Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 25 Sep 1998 22:20:05 +0000 Subject: added in samr commands. assistance in returning the missing functions, automatically removed because they were "unused", would be appreciated. (This used to be commit d0f7b0d915973ccb85409af3d6d951a716cd66d2) --- source3/include/proto.h | 143 ++++++++++++++++++++++++++++++++++++++++++++++++ source3/include/smb.h | 3 + 2 files changed, 146 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 9d2f3a30a7..5c3dbc003b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -190,6 +190,7 @@ void GetTimeOfDay(struct timeval *tval); void TimeInit(void); int TimeDiff(time_t t); struct tm *LocalTime(time_t *t); +time_t interpret_nt_time(NTTIME *t); time_t interpret_long_date(char *p); void put_long_date(char *p,time_t t); BOOL null_mtime(time_t mtime); @@ -1213,6 +1214,42 @@ BOOL rpc_api_pipe_req(struct cli_state *cli, uint8 op_num, BOOL cli_nt_session_open(struct cli_state *cli, char *pipe_name, BOOL encrypted); void cli_nt_session_close(struct cli_state *cli); +/*The following definitions come from rpc_client/cli_samr.c */ + +BOOL get_samr_query_usergroups(struct cli_state *cli, + POLICY_HND *pol_open_domain, uint32 user_rid, + uint32 *num_groups, DOM_GID *gid); +BOOL get_samr_query_userinfo(struct cli_state *cli, + POLICY_HND *pol_open_domain, + uint32 info_level, + uint32 user_rid, SAM_USER_INFO_21 *usr); +BOOL do_samr_unknown_8(struct cli_state *cli, + POLICY_HND *domain_pol, uint16 switch_value); +BOOL do_samr_enum_dom_users(struct cli_state *cli, + POLICY_HND *pol, uint16 num_entries, uint16 unk_0, + uint16 acb_mask, uint16 unk_1, uint32 size, + struct acct_info sam[MAX_SAM_ENTRIES], + int *num_sam_users); +BOOL do_samr_connect(struct cli_state *cli, + char *srv_name, uint32 unknown_0, + POLICY_HND *connect_pol); +BOOL do_samr_open_user(struct cli_state *cli, + POLICY_HND *pol, uint32 unk_0, uint32 rid, + POLICY_HND *user_pol); +BOOL do_samr_open_domain(struct cli_state *cli, + POLICY_HND *connect_pol, uint32 rid, DOM_SID *sid, + POLICY_HND *domain_pol); +BOOL do_samr_query_unknown_12(struct cli_state *cli, + POLICY_HND *pol, uint32 rid, uint32 num_gids, uint32 *gids, + uint32 *num_aliases, + fstring als_names [MAX_LOOKUP_SIDS], + uint32 num_als_users[MAX_LOOKUP_SIDS]); +BOOL do_samr_query_usergroups(struct cli_state *cli, + POLICY_HND *pol, uint32 *num_groups, DOM_GID *gid); +BOOL do_samr_query_userinfo(struct cli_state *cli, + POLICY_HND *pol, uint16 switch_value, void* usr); +BOOL do_samr_close(struct cli_state *cli, POLICY_HND *hnd); + /*The following definitions come from rpc_client/cli_wkssvc.c */ BOOL do_wks_query_info(struct cli_state *cli, @@ -1252,6 +1289,7 @@ uint32 get_enum_hnd(ENUM_HND *enh); void make_enum_hnd(ENUM_HND *enh, uint32 hnd); void smb_io_enum_hnd(char *desc, ENUM_HND *hnd, prs_struct *ps, int depth); void smb_io_dom_sid(char *desc, DOM_SID *sid, prs_struct *ps, int depth); +void make_dom_sid(DOM_SID *sid, char *str_sid); void make_dom_sid2(DOM_SID2 *sid2, DOM_SID *sid); void smb_io_dom_sid2(char *desc, DOM_SID2 *sid, prs_struct *ps, int depth); void make_str_hdr(STRHDR *hdr, int max_len, int len, uint32 buffer); @@ -1440,11 +1478,20 @@ void smb_io_rpc_auth_ntlmssp_resp(char *desc, RPC_AUTH_NTLMSSP_RESP *rsp, prs_st /*The following definitions come from rpc_parse/parse_samr.c */ +void make_samr_q_close_hnd(SAMR_Q_CLOSE_HND *q_c, POLICY_HND *hnd); void samr_io_q_close_hnd(char *desc, SAMR_Q_CLOSE_HND *q_u, prs_struct *ps, int depth); void samr_io_r_close_hnd(char *desc, SAMR_R_CLOSE_HND *r_u, prs_struct *ps, int depth); +void make_samr_q_open_domain(SAMR_Q_OPEN_DOMAIN *q_u, + POLICY_HND *connect_pol, uint32 rid, + DOM_SID *sid); void samr_io_q_open_domain(char *desc, SAMR_Q_OPEN_DOMAIN *q_u, prs_struct *ps, int depth); void samr_io_r_open_domain(char *desc, SAMR_R_OPEN_DOMAIN *r_u, prs_struct *ps, int depth); +void make_samr_q_unknown_3(SAMR_Q_UNKNOWN_3 *q_u, + POLICY_HND *user_pol, uint16 switch_value); void samr_io_q_unknown_3(char *desc, SAMR_Q_UNKNOWN_3 *q_u, prs_struct *ps, int depth); +void make_samr_q_unknown_8(SAMR_Q_UNKNOWN_8 *q_u, + POLICY_HND *domain_pol, uint16 switch_value); +void samr_io_q_unknown_8(char *desc, SAMR_Q_UNKNOWN_8 *q_u, prs_struct *ps, int depth); void make_dom_sid3(DOM_SID3 *sid3, uint16 unk_0, uint16 unk_1, DOM_SID *sid); void make_samr_r_unknown_3(SAMR_R_UNKNOWN_3 *r_u, uint16 unknown_2, uint16 unknown_3, @@ -1452,16 +1499,22 @@ void make_samr_r_unknown_3(SAMR_R_UNKNOWN_3 *r_u, int num_sid3s, DOM_SID3 sid3[MAX_SAM_SIDS], uint32 status); void samr_io_r_unknown_3(char *desc, SAMR_R_UNKNOWN_3 *r_u, prs_struct *ps, int depth); +void make_samr_q_enum_dom_users(SAMR_Q_ENUM_DOM_USERS *q_e, POLICY_HND *pol, + uint16 req_num_entries, uint16 unk_0, + uint16 acb_mask, uint16 unk_1, uint32 size); void samr_io_q_enum_dom_users(char *desc, SAMR_Q_ENUM_DOM_USERS *q_e, prs_struct *ps, int depth); void make_samr_r_enum_dom_users(SAMR_R_ENUM_DOM_USERS *r_u, uint16 total_num_entries, uint16 unk_0, uint32 num_sam_entries, SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES], uint32 status); void samr_io_r_enum_dom_users(char *desc, SAMR_R_ENUM_DOM_USERS *r_u, prs_struct *ps, int depth); +void make_samr_q_enum_dom_aliases(SAMR_Q_ENUM_DOM_ALIASES *q_e, POLICY_HND *pol, uint32 size); void samr_io_q_enum_dom_aliases(char *desc, SAMR_Q_ENUM_DOM_ALIASES *q_e, prs_struct *ps, int depth); void make_samr_r_enum_dom_aliases(SAMR_R_ENUM_DOM_ALIASES *r_u, uint32 num_sam_entries, SAM_USER_INFO_21 grps[MAX_SAM_ENTRIES], uint32 status); void samr_io_r_enum_dom_aliases(char *desc, SAMR_R_ENUM_DOM_ALIASES *r_u, prs_struct *ps, int depth); +void make_samr_q_query_dispinfo(SAMR_Q_QUERY_DISPINFO *q_e, POLICY_HND *pol, + uint16 switch_level, uint32 start_idx, uint32 size); void samr_io_q_query_dispinfo(char *desc, SAMR_Q_QUERY_DISPINFO *q_e, prs_struct *ps, int depth); void make_sam_info_2(SAM_INFO_2 *sam, uint32 acb_mask, uint32 start_idx, uint32 num_sam_entries, @@ -1472,12 +1525,17 @@ void make_sam_info_1(SAM_INFO_1 *sam, uint32 acb_mask, void make_samr_r_query_dispinfo(SAMR_R_QUERY_DISPINFO *r_u, uint16 switch_level, SAM_INFO_CTR *ctr, uint32 status); void samr_io_r_query_dispinfo(char *desc, SAMR_R_QUERY_DISPINFO *r_u, prs_struct *ps, int depth); +void make_samr_q_enum_dom_groups(SAMR_Q_ENUM_DOM_GROUPS *q_e, POLICY_HND *pol, + uint16 switch_level, uint32 start_idx, uint32 size); void samr_io_q_enum_dom_groups(char *desc, SAMR_Q_ENUM_DOM_GROUPS *q_e, prs_struct *ps, int depth); void make_samr_r_enum_dom_groups(SAMR_R_ENUM_DOM_GROUPS *r_u, uint32 start_idx, uint32 num_sam_entries, SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES], uint32 status); void samr_io_r_enum_dom_groups(char *desc, SAMR_R_ENUM_DOM_GROUPS *r_u, prs_struct *ps, int depth); +void make_samr_q_query_aliasinfo(SAMR_Q_QUERY_ALIASINFO *q_e, + POLICY_HND *pol, + uint16 switch_level); void samr_io_q_query_aliasinfo(char *desc, SAMR_Q_QUERY_ALIASINFO *q_e, prs_struct *ps, int depth); void make_samr_r_query_aliasinfo(SAMR_R_QUERY_ALIASINFO *r_u, uint16 switch_value, char *acct_desc, @@ -1496,12 +1554,19 @@ void make_samr_r_unknown_12(SAMR_R_UNKNOWN_12 *r_u, uint32 num_aliases, fstring *als_name, uint32 *num_als_usrs, uint32 status); void samr_io_r_unknown_12(char *desc, SAMR_R_UNKNOWN_12 *r_u, prs_struct *ps, int depth); +void make_samr_q_open_user(SAMR_Q_OPEN_USER *q_u, + POLICY_HND *pol, + uint32 unk_0, uint32 rid); void samr_io_q_open_user(char *desc, SAMR_Q_OPEN_USER *q_u, prs_struct *ps, int depth); void samr_io_r_open_user(char *desc, SAMR_R_OPEN_USER *r_u, prs_struct *ps, int depth); +void make_samr_q_query_usergroups(SAMR_Q_QUERY_USERGROUPS *q_u, + POLICY_HND *hnd); void samr_io_q_query_usergroups(char *desc, SAMR_Q_QUERY_USERGROUPS *q_u, prs_struct *ps, int depth); void make_samr_r_query_usergroups(SAMR_R_QUERY_USERGROUPS *r_u, uint32 num_gids, DOM_GID *gid, uint32 status); void samr_io_r_query_usergroups(char *desc, SAMR_R_QUERY_USERGROUPS *r_u, prs_struct *ps, int depth); +void make_samr_q_query_userinfo(SAMR_Q_QUERY_USERINFO *q_u, + POLICY_HND *hnd, uint16 switch_value); void samr_io_q_query_userinfo(char *desc, SAMR_Q_QUERY_USERINFO *q_u, prs_struct *ps, int depth); void make_sam_user_info21(SAM_USER_INFO_21 *usr, @@ -1537,10 +1602,28 @@ void make_samr_r_query_userinfo(SAMR_R_QUERY_USERINFO *r_u, void samr_io_r_query_userinfo(char *desc, SAMR_R_QUERY_USERINFO *r_u, prs_struct *ps, int depth); void samr_io_q_unknown_32(char *desc, SAMR_Q_UNKNOWN_32 *q_u, prs_struct *ps, int depth); void samr_io_r_unknown_32(char *desc, SAMR_R_UNKNOWN_32 *r_u, prs_struct *ps, int depth); +void make_samr_q_connect(SAMR_Q_CONNECT *q_u, + char *srv_name, uint32 unknown_0); void samr_io_q_connect(char *desc, SAMR_Q_CONNECT *q_u, prs_struct *ps, int depth); void samr_io_r_connect(char *desc, SAMR_R_CONNECT *r_u, prs_struct *ps, int depth); +void make_samr_q_open_alias(SAMR_Q_OPEN_ALIAS *q_u, + uint32 unknown_0, uint32 rid); void samr_io_q_open_alias(char *desc, SAMR_Q_OPEN_ALIAS *q_u, prs_struct *ps, int depth); void samr_io_r_open_alias(char *desc, SAMR_R_OPEN_ALIAS *r_u, prs_struct *ps, int depth); +void make_samr_q_unknown_38(SAMR_Q_UNKNOWN_38 *q_u, char *srv_name); +void samr_io_q_unknown_38(char *desc, SAMR_Q_UNKNOWN_38 *q_u, prs_struct *ps, int depth); +void make_samr_r_unknown_38(SAMR_R_UNKNOWN_38 *r_u, + uint16 level, uint32 status); +void samr_io_r_unknown_38(char *desc, SAMR_R_UNKNOWN_38 *r_u, prs_struct *ps, int depth); +void samr_io_enc_passwd(char *desc, SAMR_ENC_PASSWD *pwd, prs_struct *ps, int depth); +void samr_io_enc_hash(char *desc, SAMR_ENC_HASH *hsh, prs_struct *ps, int depth); +void make_samr_q_unknown_12(SAMR_Q_UNKNOWN_12 *q_u, + POLICY_HND *pol, uint32 rid, + uint32 num_gids, uint32 *gid); +void make_samr_q_unknown_21(SAMR_Q_UNKNOWN_21 *q_c, + POLICY_HND *hnd, uint16 unk_1, uint16 unk_2); +void make_samr_q_unknown_13(SAMR_Q_UNKNOWN_13 *q_c, + POLICY_HND *hnd, uint16 unk_1, uint16 unk_2); /*The following definitions come from rpc_parse/parse_srv.c */ @@ -1681,10 +1764,70 @@ BOOL api_wkssvc_rpc(pipes_struct *p, prs_struct *data); void cmd_lsa_query_info(struct client_info *info); +/*The following definitions come from rpcclient/cmd_samr.c */ + +void cmd_sam_test(struct client_info *info); +void cmd_sam_enum_users(struct client_info *info); +void cmd_sam_query_user(struct client_info *info); +void cmd_sam_query_groups(struct client_info *info); +void cmd_sam_enum_aliases(struct client_info *info); + /*The following definitions come from rpcclient/cmd_wkssvc.c */ void cmd_wks_query_info(struct client_info *info); +/*The following definitions come from rpcclient/display.c */ + +char *get_file_mode_str(uint32 share_mode); +char *get_file_oplock_str(uint32 op_type); +char *get_share_type_str(uint32 type); +char *get_server_type_str(uint32 type); +void display_srv_info_101(FILE *out_hnd, enum action_type action, + SRV_INFO_101 *sv101); +void display_srv_info_102(FILE *out_hnd, enum action_type action,SRV_INFO_102 *sv102); +void display_srv_info_ctr(FILE *out_hnd, enum action_type action,SRV_INFO_CTR *ctr); +void display_conn_info_0(FILE *out_hnd, enum action_type action, + CONN_INFO_0 *info0); +void display_conn_info_1(FILE *out_hnd, enum action_type action, + CONN_INFO_1 *info1, CONN_INFO_1_STR *str1); +void display_srv_conn_info_0_ctr(FILE *out_hnd, enum action_type action, + SRV_CONN_INFO_0 *ctr); +void display_srv_conn_info_1_ctr(FILE *out_hnd, enum action_type action, + SRV_CONN_INFO_1 *ctr); +void display_srv_conn_info_ctr(FILE *out_hnd, enum action_type action, + SRV_CONN_INFO_CTR *ctr); +void display_share_info_1(FILE *out_hnd, enum action_type action, + SH_INFO_1 *info1, SH_INFO_1_STR *str1); +void display_share_info_2(FILE *out_hnd, enum action_type action, + SH_INFO_2 *info2, SH_INFO_2_STR *str2); +void display_srv_share_info_1_ctr(FILE *out_hnd, enum action_type action, + SRV_SHARE_INFO_1 *ctr); +void display_srv_share_info_2_ctr(FILE *out_hnd, enum action_type action, + SRV_SHARE_INFO_2 *ctr); +void display_srv_share_info_ctr(FILE *out_hnd, enum action_type action, + SRV_SHARE_INFO_CTR *ctr); +void display_file_info_3(FILE *out_hnd, enum action_type action, + FILE_INFO_3 *info3, FILE_INFO_3_STR *str3); +void display_srv_file_info_3_ctr(FILE *out_hnd, enum action_type action, + SRV_FILE_INFO_3 *ctr); +void display_srv_file_info_ctr(FILE *out_hnd, enum action_type action, + SRV_FILE_INFO_CTR *ctr); +void display_server(FILE *out_hnd, enum action_type action, + char *sname, uint32 type, char *comment); +void display_share(FILE *out_hnd, enum action_type action, + char *sname, uint32 type, char *comment); +void display_share2(FILE *out_hnd, enum action_type action, + char *sname, uint32 type, char *comment, + uint32 perms, uint32 max_uses, uint32 num_uses, + char *path, char *passwd); +void display_name(FILE *out_hnd, enum action_type action, + char *sname); +void display_group_rid_info(FILE *out_hnd, enum action_type action, + uint32 num_gids, DOM_GID *gid); +void display_alias_name_info(FILE *out_hnd, enum action_type action, + uint32 num_aliases, fstring *alias_name, uint32 *num_als_usrs); +void display_sam_user_info_21(FILE *out_hnd, enum action_type action, SAM_USER_INFO_21 *usr); + /*The following definitions come from rpcclient/rpcclient.c */ void rpcclient_init(void); diff --git a/source3/include/smb.h b/source3/include/smb.h index 59a7a07e76..cc62234268 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1401,6 +1401,9 @@ enum remote_arch_types {RA_UNKNOWN, RA_WFWG, RA_OS2, RA_WIN95, RA_WINNT, RA_SAMB /* case handling */ enum case_handling {CASE_LOWER,CASE_UPPER}; +/* display info */ +enum action_type { ACTION_HEADER, ACTION_ENUMERATE, ACTION_FOOTER }; + #ifdef WITH_SSL /* SSL version options */ enum ssl_version_enum {SMB_SSL_V2,SMB_SSL_V3,SMB_SSL_V23,SMB_SSL_TLS1}; -- cgit From c1bbd1868f90b672ab88e53e039732854dca1f8d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 25 Sep 1998 22:34:40 +0000 Subject: Moved the extra struct definitions Luke added to smb.h into rpcclient.h and client.h. They are still included from smb.h so nothing should change (or break) but this keeps the new definitions easier to maintain. This is similar to what I did with ntdomain.h Jeremy. (This used to be commit 2831e5c9c46e05ecd8c858fac2d93e8baa96d102) --- source3/include/client.h | 79 +++++++++++++++++++++++++++++ source3/include/rpcclient.h | 118 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 197 insertions(+) create mode 100644 source3/include/client.h create mode 100644 source3/include/rpcclient.h (limited to 'source3/include') diff --git a/source3/include/client.h b/source3/include/client.h new file mode 100644 index 0000000000..6d0be057ae --- /dev/null +++ b/source3/include/client.h @@ -0,0 +1,79 @@ +/* + Unix SMB/Netbios implementation. + Version 1.9. + SMB parameters and setup + Copyright (C) Andrew Tridgell 1992-1998 + Copyright (C) Luke Kenneth Casson Leighton 1996-1998 + Copyright (C) Jeremy Allison 1998 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _CLIENT_H +#define _CLIENT_H + +/* + * These definitions depend on smb.h + */ + +struct cli_state { + int fd; + int cnum; + int pid; + int mid; + int uid; + int protocol; + int sec_mode; + int rap_error; + int privilages; + + fstring eff_name; + fstring desthost; + fstring user_name; + fstring domain; + + fstring share; + fstring dev; + struct nmb_name called; + struct nmb_name calling; + fstring full_dest_host_name; + struct in_addr dest_ip; + + struct pwd_info pwd; + char cryptkey[8]; + uint32 sesskey; + int serverzone; + uint32 servertime; + int readbraw_supported; + int writebraw_supported; + int timeout; + int max_xmit; + char *outbuf; + char *inbuf; + int bufsize; + int initialised; + /* + * Only used in NT domain calls. + */ + uint32 nt_error; /* NT RPC error code. */ + uint16 nt_pipe_fnum; /* Pipe handle. */ + unsigned char sess_key[16]; /* Current session key. */ + DOM_CRED clnt_cred; /* Client credential. */ + fstring mach_acct; /* MYNAME$. */ + fstring srv_name_slash; /* \\remote server. */ + fstring clnt_name_slash; /* \\local client. */ +}; + +#endif /* _CLIENT_H */ diff --git a/source3/include/rpcclient.h b/source3/include/rpcclient.h new file mode 100644 index 0000000000..2fa91152cc --- /dev/null +++ b/source3/include/rpcclient.h @@ -0,0 +1,118 @@ +/* + Unix SMB/Netbios implementation. + Version 1.9. + SMB parameters and setup + Copyright (C) Andrew Tridgell 1992-1998 + Copyright (C) Luke Kenneth Casson Leighton 1996-1998 + Copyright (C) Jeremy Allison 1998 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _RPCCLIENT_H +#define _RPCCLIENT_H + +struct tar_client_info +{ + int blocksize; + BOOL inc; + BOOL reset; + BOOL excl; + char type; + int attrib; + char **cliplist; + int clipn; + int tp; + int num_files; + int buf_size; + int bytes_written; + char *buf; + int handle; + int print_mode; + char *file_mode; +}; + +struct nt_client_info +{ + /************* \PIPE\NETLOGON stuff ******************/ + + fstring mach_acct; + + uint8 sess_key[16]; + DOM_CRED clnt_cred; + DOM_CRED rtn_cred; + + NET_ID_INFO_CTR ctr; + NET_USER_INFO_3 user_info3; + + /************** \PIPE\lsarpc stuff ********************/ + + POLICY_HND lsa_info_pol; + + /* domain member */ + fstring level3_dom; + fstring level3_sid; + + /* domain controller */ + fstring level5_dom; + fstring level5_sid; + + /************** \PIPE\samr stuff ********************/ + + POLICY_HND samr_pol_connect; + POLICY_HND samr_pol_open_domain; + POLICY_HND samr_pol_open_user; + + struct acct_info *sam; + int num_sam_entries; +}; + +struct client_info +{ + struct in_addr dest_ip; + fstring dest_host; + fstring query_host; + uint8 name_type; + + fstring myhostname; + fstring mach_acct; + + pstring cur_dir; + pstring base_dir; + pstring file_sel; + + fstring service; + fstring share; + fstring svc_type; + + time_t newer_than; + int archive_level; + int dir_total; + int put_total_time_ms; + int put_total_size; + int get_total_time_ms; + int get_total_size; + int print_mode; + BOOL translation; + BOOL recurse_dir; + BOOL prompt; + BOOL lowercase; + BOOL abort_mget; + + struct tar_client_info tar; + struct nt_client_info dom; +}; + +#endif /* _RPCCLIENT_H */ -- cgit From 4b9e0941b9440d25d253dab62633858c2a5117c2 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 25 Sep 1998 23:14:20 +0000 Subject: rpcclient: got samr command "enumusers -g -u" working (This used to be commit 3a00023efedb34684bd45bd8a562f07a9880f1ad) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 5c3dbc003b..91906eefea 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1228,7 +1228,7 @@ BOOL do_samr_unknown_8(struct cli_state *cli, BOOL do_samr_enum_dom_users(struct cli_state *cli, POLICY_HND *pol, uint16 num_entries, uint16 unk_0, uint16 acb_mask, uint16 unk_1, uint32 size, - struct acct_info sam[MAX_SAM_ENTRIES], + struct acct_info **sam, int *num_sam_users); BOOL do_samr_connect(struct cli_state *cli, char *srv_name, uint32 unknown_0, -- cgit From 14f9495e4c5ff98cd15bf18d7fbc63c1b491cfea Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 25 Sep 1998 23:28:41 +0000 Subject: Added missing display enum. Jeremy. (This used to be commit 535ac8a7c204a223a57d561bb12f1934b852a579) --- source3/include/rpcclient.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include') diff --git a/source3/include/rpcclient.h b/source3/include/rpcclient.h index 2fa91152cc..1065b7c159 100644 --- a/source3/include/rpcclient.h +++ b/source3/include/rpcclient.h @@ -115,4 +115,6 @@ struct client_info struct nt_client_info dom; }; +enum action_type {ACTION_HEADER, ACTION_ENUMERATE, ACTION_FOOTER}; + #endif /* _RPCCLIENT_H */ -- cgit From 5f7ee360567a6b4e1a6f43ff01da057d2998fef8 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 25 Sep 1998 23:40:49 +0000 Subject: Makefile.in: Fixed bug with continuation line causing proto to fail. Added $(PROGS) $(SPROGS) as targets for make clean. acconfig.h: Added HAVE_IRIX_SPECIFIC_CAPABILITIES. configure.in: Added sys/capability.h header check. Added function checks for srandom random srand rand. Added HAVE_IRIX_SPECIFIC_CAPABILITIES test. includes.h: Added #include . ntdomain.h: Moved struct acct_info into here from smb.h smb.h: Added KERNEL_OPLOCK_CAPABILITY define. Moved enum action_type into rpcclient.h Moved struct cli_state into client.h Moved struct nt_client_info, struct tar_client_info, struct client_info into rpcclient.h lib/genrand.c: Changed to use sys_random() & friends. lib/smbrun.c: Lose capabilities after fork. lib/system.c: Added set_process_capability(), set_inherited_process_capability() sys_random(), sys_srandom(). lib/util.c: Added Ander's EFBIG lock check to fcntl_lock for 64 bit access to an 32 bit mounted NFS filesystem. nmbd/nmbd.c: Changed to use sys_random() & friends. nmbd/nmbd_browsesync.c: Changed to use sys_random() & friends. passdb/ldap.c: Missed one pdb_encode_acct_ctrl call. passdb/passdb.c: Changed to Ander's code for ' ' characters. passdb/smbpass.c: Added Ander's code to reset ACB_PWNOTREQ. script/mkproto.awk: Added 'long' to prototypes. smbd/chgpasswd.c: Lose capabilities after fork. smbd/open.c: Do the mmap *after* the kernel oplock. smbd/oplock.c: Removed stub code from kernel oplock path. Added set_process_capability(), set_inherited_process_capability() calls. smbd/reply.c: Initialize count = 0, offset = 0. smbd/server.c: Added set_process_capability(), set_inherited_process_capability() calls. tests/summary.c: Ensure we have RANDOM or RAND. utils/smbpasswd.c: Added Ander's code to reset ACB_PWNOTREQ. utils/torture.c: Changed to use sys_random() & friends. Jeremy. (This used to be commit e8be306f23963ac00b1a383ebe0cc1421529fb02) --- source3/include/config.h.in | 16 +++++ source3/include/includes.h | 4 ++ source3/include/ntdomain.h | 6 ++ source3/include/proto.h | 4 ++ source3/include/smb.h | 156 +++----------------------------------------- 5 files changed, 38 insertions(+), 148 deletions(-) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 4f199f0df3..e0b62031c5 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -123,6 +123,7 @@ #undef STAT_STATVFS64 #undef HAVE_LIBREADLINE #undef HAVE_KERNEL_OPLOCKS +#undef HAVE_IRIX_SPECIFIC_CAPABILITIES /* The number of bytes in a int. */ #undef SIZEOF_INT @@ -247,6 +248,12 @@ /* Define if you have the putprpwnam function. */ #undef HAVE_PUTPRPWNAM +/* Define if you have the rand function. */ +#undef HAVE_RAND + +/* Define if you have the random function. */ +#undef HAVE_RANDOM + /* Define if you have the rdchk function. */ #undef HAVE_RDCHK @@ -280,6 +287,12 @@ /* Define if you have the sigprocmask function. */ #undef HAVE_SIGPROCMASK +/* Define if you have the srand function. */ +#undef HAVE_SRAND + +/* Define if you have the srandom function. */ +#undef HAVE_SRANDOM + /* Define if you have the stat64 function. */ #undef HAVE_STAT64 @@ -397,6 +410,9 @@ /* Define if you have the header file. */ #undef HAVE_STROPTS_H +/* Define if you have the header file. */ +#undef HAVE_SYS_CAPABILITY_H + /* Define if you have the header file. */ #undef HAVE_SYS_DIR_H diff --git a/source3/include/includes.h b/source3/include/includes.h index 5b47e6fa35..2ec134b7c6 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -265,6 +265,10 @@ #include #endif +#ifdef HAVE_SYS_CAPABILITY_H +#include +#endif + #ifndef uchar #define uchar unsigned char #endif diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index 5cdd2849f8..efe7e663a0 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -122,5 +122,11 @@ typedef struct } rid_name; +struct acct_info +{ + fstring acct_name; /* account name */ + uint32 smb_userid; /* domain-relative RID */ +}; + #endif /* _NT_DOMAIN_H */ diff --git a/source3/include/proto.h b/source3/include/proto.h index 91906eefea..c1397884b7 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -183,6 +183,10 @@ char *dos_getwd(char *s); int sys_chown(char *fname,int uid,int gid); int sys_chroot(char *dname); struct hostent *sys_gethostbyname(char *name); +BOOL set_process_capability( uint32 cap_flag, BOOL enable ); +BOOL set_inherited_process_capability( uint32 cap_flag, BOOL enable ); +long sys_random(void); +void sys_srandom(unsigned int seed); /*The following definitions come from lib/time.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index cc62234268..e1baac8f6f 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1401,9 +1401,6 @@ enum remote_arch_types {RA_UNKNOWN, RA_WFWG, RA_OS2, RA_WIN95, RA_WINNT, RA_SAMB /* case handling */ enum case_handling {CASE_LOWER,CASE_UPPER}; -/* display info */ -enum action_type { ACTION_HEADER, ACTION_ENUMERATE, ACTION_FOOTER }; - #ifdef WITH_SSL /* SSL version options */ enum ssl_version_enum {SMB_SSL_V2,SMB_SSL_V3,SMB_SSL_V23,SMB_SSL_TLS1}; @@ -1544,6 +1541,12 @@ extern int unix_ERR_code; #define OPLOCK_BREAK_INODE_OFFSET (OPLOCK_BREAK_DEV_OFFSET + sizeof(SMB_DEV_T)) #define OPLOCK_BREAK_MSG_LEN (OPLOCK_BREAK_INODE_OFFSET + sizeof(SMB_INO_T)) +/* + * Capabilities abstracted for different systems. + */ + +#define KERNEL_OPLOCK_CAPABILITY 0x1 + #if defined(HAVE_KERNEL_OPLOCKS) /* * Oplock break command code sent via the kernel interface. @@ -1591,151 +1594,8 @@ struct nmb_name { unsigned int name_type; }; -struct cli_state { - int fd; - int cnum; - int pid; - int mid; - int uid; - int protocol; - int sec_mode; - int rap_error; - int privilages; - - fstring eff_name; - fstring desthost; - fstring user_name; - fstring domain; - - fstring share; - fstring dev; - struct nmb_name called; - struct nmb_name calling; - fstring full_dest_host_name; - struct in_addr dest_ip; - - struct pwd_info pwd; - char cryptkey[8]; - uint32 sesskey; - int serverzone; - uint32 servertime; - int readbraw_supported; - int writebraw_supported; - int timeout; - int max_xmit; - char *outbuf; - char *inbuf; - int bufsize; - int initialised; - /* - * Only used in NT domain calls. - */ - uint32 nt_error; /* NT RPC error code. */ - uint16 nt_pipe_fnum; /* Pipe handle. */ - unsigned char sess_key[16]; /* Current session key. */ - DOM_CRED clnt_cred; /* Client credential. */ - fstring mach_acct; /* MYNAME$. */ - fstring srv_name_slash; /* \\remote server. */ - fstring clnt_name_slash; /* \\local client. */ -}; - -struct acct_info -{ - fstring acct_name; /* account name */ - uint32 smb_userid; /* domain-relative RID */ -}; - -struct nt_client_info -{ - /************* \PIPE\NETLOGON stuff ******************/ - - fstring mach_acct; - - uint8 sess_key[16]; - DOM_CRED clnt_cred; - DOM_CRED rtn_cred; - - NET_ID_INFO_CTR ctr; - NET_USER_INFO_3 user_info3; - - /************** \PIPE\lsarpc stuff ********************/ - - POLICY_HND lsa_info_pol; - - /* domain member */ - fstring level3_dom; - fstring level3_sid; - - /* domain controller */ - fstring level5_dom; - fstring level5_sid; - - /************** \PIPE\samr stuff ********************/ - - POLICY_HND samr_pol_connect; - POLICY_HND samr_pol_open_domain; - POLICY_HND samr_pol_open_user; - - struct acct_info *sam; - int num_sam_entries; -}; - - -struct tar_client_info -{ - int blocksize; - BOOL inc; - BOOL reset; - BOOL excl; - char type; - int attrib; - char **cliplist; - int clipn; - int tp; - int num_files; - int buf_size; - int bytes_written; - char *buf; - int handle; - int print_mode; - char *file_mode; -}; - -struct client_info -{ - struct in_addr dest_ip; - fstring dest_host; - fstring query_host; - uint8 name_type; - - fstring myhostname; - fstring mach_acct; - - pstring cur_dir; - pstring base_dir; - pstring file_sel; - - fstring service; - fstring share; - fstring svc_type; - - time_t newer_than; - int archive_level; - int dir_total; - int put_total_time_ms; - int put_total_size; - int get_total_time_ms; - int get_total_size; - int print_mode; - BOOL translation; - BOOL recurse_dir; - BOOL prompt; - BOOL lowercase; - BOOL abort_mget; - - struct tar_client_info tar; - struct nt_client_info dom; -}; +#include "client.h" +#include "rpcclient.h" /* * Size of new password account encoding string. DO NOT CHANGE. -- cgit From b053652d490c8b37084797a64f14cdd44ff82578 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 26 Sep 1998 03:30:15 +0000 Subject: Added Kerberos4 support patches from Johan Hedin Jeremy. (This used to be commit 548634915f21f774b7efb06f138c8fb7bc089daa) --- source3/include/config.h.in | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index e0b62031c5..77a546b32d 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -124,6 +124,7 @@ #undef HAVE_LIBREADLINE #undef HAVE_KERNEL_OPLOCKS #undef HAVE_IRIX_SPECIFIC_CAPABILITIES +#undef KRB4_AUTH /* The number of bytes in a int. */ #undef SIZEOF_INT @@ -506,5 +507,8 @@ /* Define if you have the readline library (-lreadline). */ #undef HAVE_LIBREADLINE +/* Define if you have the resolv library (-lresolv). */ +#undef HAVE_LIBRESOLV + /* Define if you have the socket library (-lsocket). */ #undef HAVE_LIBSOCKET -- cgit From 6da95a6f1d17ad69ab572fbc627167f5edb593fb Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 26 Sep 1998 10:31:40 +0000 Subject: changed the default filesystem type to NTFS (from Samba) I've finally changed this because I've found a real effect that this has. Win95 shows long filenames in a directory listing in a dos box only if this is set to NTFS or HPFS (only ones I've found so far anyway). If NTFS poses problems of some kind then we should try HPFS I wonder if this change will trigger any attempts to use ACLs ? (This used to be commit 410d54fa0dba319e802d7327d89c4c1e61f2db65) --- source3/include/local.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index f68f57eff7..6903e5854f 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -80,7 +80,7 @@ /* what default type of filesystem do we want this to show up as in a NT file manager window? */ -#define FSTYPE_STRING "Samba" +#define FSTYPE_STRING "NTFS" /* the default guest account - normally set in the Makefile or smb.conf */ #ifndef GUEST_ACCOUNT -- cgit From cf971f88ac188eec353a7fb021744b8076cc4eb7 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Mon, 28 Sep 1998 00:14:36 +0000 Subject: automated generation of .dummy files for each subdirectory; dummy.in files are no longer needed, and new directories will be taken care of automatically, at configure (or config.status --recheck) time (This used to be commit 237a8e5fe62d757c04b8207cbbee4df1470cfe4e) --- source3/include/dummy.in | 1 - source3/include/stamp-h.in | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) delete mode 100644 source3/include/dummy.in (limited to 'source3/include') diff --git a/source3/include/dummy.in b/source3/include/dummy.in deleted file mode 100644 index 8b13789179..0000000000 --- a/source3/include/dummy.in +++ /dev/null @@ -1 +0,0 @@ - diff --git a/source3/include/stamp-h.in b/source3/include/stamp-h.in index 75ac934484..8b13789179 100644 --- a/source3/include/stamp-h.in +++ b/source3/include/stamp-h.in @@ -1,2 +1 @@ --rw-r--r-- 1 oliva pos 1394 Sep 21 08:00 acconfig.h --rw-r--r-- 1 oliva pos 24688 Sep 21 08:11 configure.in + -- cgit From cf3a9741dc7427efb97eff09a3c197a906ce6767 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 28 Sep 1998 21:43:48 +0000 Subject: Changes to test in configure if capabilities are enabled on a system. Changes to get Samba to compile cleanly with the IRIX compiler with the options : -fullwarn -woff 1209,1174 (the -woff options are to turn off warnings about unused function parameters and controlling loop expressions being constants). Split prototype generation as we hit a limit in IRIX nawk. Removed "." code in smbd/filename.c (yet again :-). Jeremy. (This used to be commit e0567433bd72aec17bf5a54cc292701095d25f09) --- source3/include/client.h | 30 +++++++++++++++++++++++++++++- source3/include/proto.h | 14 +++++++------- source3/include/smb.h | 32 +------------------------------- 3 files changed, 37 insertions(+), 39 deletions(-) (limited to 'source3/include') diff --git a/source3/include/client.h b/source3/include/client.h index 6d0be057ae..dde377f484 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -28,6 +28,34 @@ * These definitions depend on smb.h */ +typedef struct +{ + SMB_OFF_T size; + int mode; + uid_t uid; + gid_t gid; + /* these times are normally kept in GMT */ + time_t mtime; + time_t atime; + time_t ctime; + pstring name; +} file_info; + +struct pwd_info +{ + BOOL null_pwd; + BOOL cleartext; + BOOL crypted; + + fstring password; + + uchar smb_lm_pwd[16]; + uchar smb_nt_pwd[16]; + + uchar smb_lm_owf[24]; + uchar smb_nt_owf[24]; +}; + struct cli_state { int fd; int cnum; @@ -52,7 +80,7 @@ struct cli_state { struct in_addr dest_ip; struct pwd_info pwd; - char cryptkey[8]; + unsigned char cryptkey[8]; uint32 sesskey; int serverzone; uint32 servertime; diff --git a/source3/include/proto.h b/source3/include/proto.h index c1397884b7..1c09d627db 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -135,7 +135,7 @@ int get_netmask(struct in_addr *ipaddr, struct in_addr *nmask); /*The following definitions come from lib/pidfile.c */ -int pidfile_pid(char *name); +pid_t pidfile_pid(char *name); void pidfile_create(char *name); /*The following definitions come from lib/replace.c */ @@ -460,11 +460,11 @@ void pwd_read(struct pwd_info *pwd, char *passwd_report, BOOL do_encrypt); void pwd_set_nullpwd(struct pwd_info *pwd); void pwd_set_cleartext(struct pwd_info *pwd, char *clr); void pwd_get_cleartext(struct pwd_info *pwd, char *clr); -void pwd_set_lm_nt_16(struct pwd_info *pwd, char lm_pwd[16], char nt_pwd[16]); -void pwd_get_lm_nt_16(struct pwd_info *pwd, char lm_pwd[16], char nt_pwd[16]); +void pwd_set_lm_nt_16(struct pwd_info *pwd, uchar lm_pwd[16], uchar nt_pwd[16]); +void pwd_get_lm_nt_16(struct pwd_info *pwd, uchar lm_pwd[16], uchar nt_pwd[16]); void pwd_make_lm_nt_16(struct pwd_info *pwd, char *clr); -void pwd_make_lm_nt_owf(struct pwd_info *pwd, char cryptkey[8]); -void pwd_get_lm_nt_owf(struct pwd_info *pwd, char lm_owf[24], char nt_owf[24]); +void pwd_make_lm_nt_owf(struct pwd_info *pwd, uchar cryptkey[8]); +void pwd_get_lm_nt_owf(struct pwd_info *pwd, uchar lm_owf[24], uchar nt_owf[24]); /*The following definitions come from libsmb/smbdes.c */ @@ -2023,7 +2023,7 @@ void check_kernel_oplocks(void); /*The following definitions come from smbd/password.c */ void generate_next_challenge(char *challenge); -BOOL set_challenge(char *challenge); +BOOL set_challenge(unsigned char *challenge); user_struct *get_valid_user_struct(uint16 vuid); void invalidate_vuid(uint16 vuid); char *validated_username(uint16 vuid); @@ -2210,7 +2210,7 @@ void start_smbd(void); void start_nmbd(void); void stop_smbd(void); void stop_nmbd(void); -void kill_pid(int pid); +void kill_pid(pid_t pid); /*The following definitions come from web/statuspage.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index e1baac8f6f..f42951ec59 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -403,36 +403,6 @@ typedef struct cred_info UTIME timestamp; /* credential time-stamp */ } DOM_CRED; -struct pwd_info -{ - BOOL null_pwd; - BOOL cleartext; - BOOL crypted; - - fstring password; - - uchar smb_lm_pwd[16]; - uchar smb_nt_pwd[16]; - - uchar smb_lm_owf[24]; - uchar smb_nt_owf[24]; -}; - -typedef struct -{ - SMB_OFF_T size; - int mode; - uid_t uid; - gid_t gid; - /* these times are normally kept in GMT */ - time_t mtime; - time_t atime; - time_t ctime; - pstring name; - -} file_info; - - /* Structure used when SMBwritebmpx is active */ typedef struct { @@ -538,7 +508,7 @@ typedef struct files_struct file_fd_struct *fd_ptr; SMB_OFF_T pos; SMB_OFF_T size; - int mode; + mode_t mode; int vuid; char *mmap_ptr; SMB_OFF_T mmap_size; -- cgit From a42bb09db84fb767ab9ac4f85ff03c6bc3ab8521 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Tue, 29 Sep 1998 04:50:07 +0000 Subject: added WITH_SMBMOUNT (This used to be commit fe5721b9527979e6ac59d1e3e56544276a5777d5) --- source3/include/config.h.in | 1 + source3/include/stamp-h.in | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 77a546b32d..1f1cb04e0b 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -107,6 +107,7 @@ #undef WITH_NISPLUS #undef WITH_NISPLUS_HOME #undef WITH_AUTOMOUNT +#undef WITH_SMBMOUNT #undef HAVE_PAM_AUTHENTICATE #undef HAVE_BROKEN_GETGROUPS #undef REPLACE_GETPASS diff --git a/source3/include/stamp-h.in b/source3/include/stamp-h.in index 8b13789179..7aae7732de 100644 --- a/source3/include/stamp-h.in +++ b/source3/include/stamp-h.in @@ -1 +1 @@ - +Tue Sep 29 04:45:55 UTC 1998 -- cgit From a2d7f765e8500f23c126c7b7cb6bb346adc11641 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Tue, 29 Sep 1998 04:52:17 +0000 Subject: get away with dummy and .dummy files (This used to be commit 90a8a02484a0897b053fd6531b7fec5d23098b6f) --- source3/include/.cvsignore | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/.cvsignore b/source3/include/.cvsignore index 10c58ff061..0e56cf2f8c 100644 --- a/source3/include/.cvsignore +++ b/source3/include/.cvsignore @@ -1,2 +1 @@ config.h -dummy -- cgit From e898fc10f32bf88ce7997ea4810f4251a33acfd5 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Tue, 29 Sep 1998 17:09:44 +0000 Subject: added stamp-h (This used to be commit 078a4b564fe1511452bf0012c643646d4900d04b) --- source3/include/.cvsignore | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/.cvsignore b/source3/include/.cvsignore index 0e56cf2f8c..b423e99519 100644 --- a/source3/include/.cvsignore +++ b/source3/include/.cvsignore @@ -1 +1,2 @@ config.h +stamp-h -- cgit From c62031c3002e18fd3bf12818bc58f34d0bc81668 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 29 Sep 1998 17:56:12 +0000 Subject: added in some pdb_xxx routines that are needed by nispass.c (This used to be commit 5212dd69d05a0d26dddcb4a0d9efca195436bfda) --- source3/include/proto.h | 10 +++++++++- source3/include/rpc_lsa.h | 23 ++++++++++++----------- 2 files changed, 21 insertions(+), 12 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 1c09d627db..eac1093450 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -482,7 +482,7 @@ void SamOEMhash( unsigned char *data, unsigned char *key, int val); void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); void E_md4hash(uchar *passwd, uchar *p16); void nt_lm_owf_gen(char *pwd, uchar nt_p16[16], uchar p16[16]); -void SMBOWFencrypt(uchar passwd[16], uchar *c8, uchar p24[24]); +void SMBOWFencrypt(uchar passwd[16], char *c8, uchar p24[24]); void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); /*The following definitions come from libsmb/smberr.c */ @@ -1131,6 +1131,14 @@ struct sam_disp_info *pdb_sam_to_dispinfo(struct sam_passwd *user); struct smb_passwd *pdb_sam_to_smb(struct sam_passwd *user); char *pdb_encode_acct_ctrl(uint16 acct_ctrl, size_t length); uint16 pdb_decode_acct_ctrl(char *p); +time_t pdb_get_last_set_time(char *p); +void pdb_set_logon_time(char *p, int max_len, time_t t); +void pdb_set_logoff_time(char *p, int max_len, time_t t); +void pdb_set_kickoff_time(char *p, int max_len, time_t t); +void pdb_set_can_change_time(char *p, int max_len, time_t t); +void pdb_set_must_change_time(char *p, int max_len, time_t t); +void pdb_set_last_set_time(char *p, int max_len, time_t t); +void pdb_sethexpwd(char *p, char *pwd, uint16 acct_ctrl); BOOL pdb_gethexpwd(char *p, char *pwd); BOOL pdb_name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); BOOL pdb_generate_machine_sid(void); diff --git a/source3/include/rpc_lsa.h b/source3/include/rpc_lsa.h index 8bcc4a1338..ff87ed1bfb 100644 --- a/source3/include/rpc_lsa.h +++ b/source3/include/rpc_lsa.h @@ -168,17 +168,18 @@ typedef struct lsa_r_close_info /* DOM_R_REF */ typedef struct dom_ref_info { - uint32 undoc_buffer; /* undocumented buffer pointer. */ - uint32 num_ref_doms_1; /* num referenced domains? */ - uint32 buffer_dom_name; /* undocumented domain name buffer pointer. */ - uint32 max_entries; /* 32 - max number of entries */ - uint32 num_ref_doms_2; /* 4 - num referenced domains? */ + uint32 undoc_buffer; /* undocumented buffer pointer. */ + uint32 num_ref_doms_1; /* num referenced domains */ + uint32 buffer_dom_name; /* undocumented domain name buffer pointer. */ + uint32 max_entries; /* 32 - max number of entries */ + uint32 num_ref_doms_2; /* num referenced domains */ - UNIHDR2 hdr_dom_name; /* domain name unicode string header */ - UNIHDR2 hdr_ref_dom[MAX_REF_DOMAINS]; /* referenced domain unicode string headers */ - UNISTR uni_dom_name; /* domain name unicode string */ - DOM_SID2 ref_dom[MAX_REF_DOMAINS]; /* referenced domain SIDs */ + UNIHDR2 hdr_dom_name; /* domain name unicode string header */ + UNIHDR2 hdr_ref_dom[MAX_REF_DOMAINS]; /* referenced domain unicode string headers */ + + UNISTR uni_dom_name; /* domain name unicode string */ + DOM_SID2 ref_dom[MAX_REF_DOMAINS]; /* referenced domain SIDs */ } DOM_R_REF; @@ -223,7 +224,7 @@ typedef struct lsa_sid_enum_info /* LSA_Q_LOOKUP_SIDS - LSA Lookup SIDs */ typedef struct lsa_q_lookup_sids { - POLICY_HND pol_hnd; /* policy handle */ + POLICY_HND pol_hnd; /* policy handle */ LSA_SID_ENUM sids; LSA_TRANS_NAME_ENUM names; LOOKUP_LEVEL level; @@ -234,7 +235,7 @@ typedef struct lsa_q_lookup_sids /* LSA_R_LOOKUP_SIDS - response to LSA Lookup SIDs */ typedef struct lsa_r_lookup_sids { - DOM_R_REF *dom_ref; /* domain reference info */ + DOM_R_REF *dom_ref; /* domain reference info */ LSA_TRANS_NAME_ENUM *names; uint32 mapped_count; -- cgit From 282eb4f3e8ea2f19c5609bc498d24a68a1ca48a5 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 29 Sep 1998 17:59:16 +0000 Subject: missed the pdb_sam_to_smb function needed by nispass.c (This used to be commit b40a4e6385757cb8a44044a1437651954d6b1c90) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index eac1093450..38d02becea 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1129,6 +1129,7 @@ void pdb_init_smb(struct smb_passwd *user); void pdb_init_sam(struct sam_passwd *user); struct sam_disp_info *pdb_sam_to_dispinfo(struct sam_passwd *user); struct smb_passwd *pdb_sam_to_smb(struct sam_passwd *user); +struct sam_passwd *pdb_smb_to_sam(struct smb_passwd *user); char *pdb_encode_acct_ctrl(uint16 acct_ctrl, size_t length); uint16 pdb_decode_acct_ctrl(char *p); time_t pdb_get_last_set_time(char *p); -- cgit From 9066025a8a4afe1f7f559c455d86fc023792ed17 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 29 Sep 1998 20:24:17 +0000 Subject: Got very strict about the differences and uses of uid_t, gid_t and vuid. Added sys_getgroups() to get around the int * return problem. Set correct datatypes for all uid, gid and vuid variables. Jeremy. (This used to be commit e570db46fc3a78e499523fd342e9a34cebb18998) --- source3/include/client.h | 8 ++++---- source3/include/ntdomain.h | 4 ++-- source3/include/proto.h | 19 ++++++++++--------- source3/include/smb.h | 35 ++++++++++++++++++----------------- 4 files changed, 34 insertions(+), 32 deletions(-) (limited to 'source3/include') diff --git a/source3/include/client.h b/source3/include/client.h index dde377f484..2b71b37524 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -58,10 +58,10 @@ struct pwd_info struct cli_state { int fd; - int cnum; - int pid; - int mid; - int uid; + uint16 cnum; + uint16 pid; + uint16 mid; + uint16 vuid; int protocol; int sec_mode; int rap_error; diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index efe7e663a0..8362dcb73f 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -58,7 +58,7 @@ typedef struct pipes_struct struct pipes_struct *next, *prev; int pnum; connection_struct *conn; - int uid; + uint16 vuid; BOOL open; /* open connection */ uint16 device_state; fstring name; @@ -88,7 +88,7 @@ struct api_struct { char *name; uint8 opnum; - void (*fn) (int uid, prs_struct*, prs_struct*); + void (*fn) (uint16 vuid, prs_struct*, prs_struct*); }; struct mem_desc diff --git a/source3/include/proto.h b/source3/include/proto.h index 38d02becea..4f29b3ae20 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5,7 +5,7 @@ /*The following definitions come from client/client.c */ -void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(file_info *),BOOL recurse_dir, BOOL dirstoo); +void do_dir(char *inbuf,char *outbuf,char *mask,int attribute,void (*fn)(file_info *),BOOL recurse_dir, BOOL dirstoo); char *complete_cmd_null(char *text, int state); void complete_process_file(file_info *f); char *complete_remote_file(char *text, int state); @@ -180,13 +180,14 @@ int dos_utime(char *fname,struct utimbuf *times); int dos_rename(char *from, char *to); int dos_chmod(char *fname,mode_t mode); char *dos_getwd(char *s); -int sys_chown(char *fname,int uid,int gid); +int sys_chown(char *fname,uid_t uid,gid_t gid); int sys_chroot(char *dname); struct hostent *sys_gethostbyname(char *name); BOOL set_process_capability( uint32 cap_flag, BOOL enable ); BOOL set_inherited_process_capability( uint32 cap_flag, BOOL enable ); long sys_random(void); void sys_srandom(unsigned int seed); +int sys_getgroups(int setlen, gid_t *gidset); /*The following definitions come from lib/time.c */ @@ -227,7 +228,7 @@ BOOL next_token(char **ptr,char *buff,char *sep, int bufsize); char **toktocliplist(int *ctok, char *sep); void set_socket_options(int fd, char *options); void close_sockets(void ); -BOOL in_group(gid_t group, int current_gid, int ngroups, GID_T *groups); +BOOL in_group(gid_t group, gid_t current_gid, int ngroups, gid_t *groups); char *StrCpy(char *dest,char *src); char *StrnCpy(char *dest,char *src,int n); void putip(void *dest,void *src); @@ -315,8 +316,8 @@ BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask); int PutUniCode(char *dst,char *src); struct hostent *Get_Hostbyname(char *name); BOOL process_exists(int pid); -char *uidtoname(int uid); -char *gidtoname(int gid); +char *uidtoname(uid_t uid); +char *gidtoname(gid_t gid); void smb_panic(char *why); char *readdirname(void *p); BOOL is_in_path(char *name, name_compare_entry *namelist); @@ -400,7 +401,7 @@ BOOL cli_initialise(struct cli_state *cli); void cli_shutdown(struct cli_state *cli); void cli_error(struct cli_state *cli, int *eclass, int *num); void cli_sockopt(struct cli_state *cli, char *options); -int cli_setpid(struct cli_state *cli, int pid); +uint16 cli_setpid(struct cli_state *cli, uint16 pid); BOOL cli_reestablish_connection(struct cli_state *cli); BOOL cli_establish_connection(struct cli_state *cli, char *dest_host, struct in_addr *dest_ip, @@ -482,7 +483,7 @@ void SamOEMhash( unsigned char *data, unsigned char *key, int val); void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); void E_md4hash(uchar *passwd, uchar *p16); void nt_lm_owf_gen(char *pwd, uchar nt_p16[16], uchar p16[16]); -void SMBOWFencrypt(uchar passwd[16], char *c8, uchar p24[24]); +void SMBOWFencrypt(uchar passwd[16], uchar *c8, uchar p24[24]); void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); /*The following definitions come from libsmb/smberr.c */ @@ -2036,8 +2037,8 @@ BOOL set_challenge(unsigned char *challenge); user_struct *get_valid_user_struct(uint16 vuid); void invalidate_vuid(uint16 vuid); char *validated_username(uint16 vuid); -int setup_groups(char *user, int uid, int gid, int *p_ngroups, GID_T **p_groups); -uint16 register_vuid(int uid,int gid, char *unix_name, char *requested_name, BOOL guest); +int setup_groups(char *user, uid_t uid, gid_t gid, int *p_ngroups, gid_t **p_groups); +uint16 register_vuid(uid_t uid,gid_t gid, char *unix_name, char *requested_name, BOOL guest); void add_session_user(char *user); BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8); BOOL smb_password_ok(struct smb_passwd *smb_pass, diff --git a/source3/include/smb.h b/source3/include/smb.h index f42951ec59..56b0e3bc24 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -345,8 +345,8 @@ struct sam_passwd char *unknown_str ; /* don't know what this is, yet. */ char *munged_dial ; /* munged path name and dial-back tel number */ - int smb_userid; /* this is actually the unix uid_t */ - int smb_grpid; /* this is actually the unix gid_t */ + uid_t smb_userid; /* this is actually the unix uid_t */ + gid_t smb_grpid; /* this is actually the unix gid_t */ uint32 user_rid; /* Primary User ID */ uint32 group_rid; /* Primary Group ID */ @@ -366,7 +366,7 @@ struct sam_passwd struct smb_passwd { - int smb_userid; /* this is actually the unix uid_t */ + uid_t smb_userid; /* this is actually the unix uid_t */ char *smb_name; /* username string */ unsigned char *smb_passwd; /* Null if no password */ @@ -447,7 +447,7 @@ typedef struct struct uid_cache { int entries; - int list[UID_CACHE_SIZE]; + uid_t list[UID_CACHE_SIZE]; }; typedef struct @@ -472,8 +472,8 @@ typedef struct connection_struct char *connectpath; char *origpath; char *user; /* name of user who *opened* this connection */ - int uid; /* uid of user who *opened* this connection */ - int gid; /* gid of user who *opened* this connection */ + uid_t uid; /* uid of user who *opened* this connection */ + gid_t gid; /* gid of user who *opened* this connection */ uint16 vuid; /* vuid of user who *opened* this connection, or UID_FIELD_INVALID */ @@ -481,7 +481,7 @@ typedef struct connection_struct /* This groups info is valid for the user that *opened* the connection */ int ngroups; - GID_T *groups; + gid_t *groups; time_t lastused; BOOL used; @@ -494,10 +494,11 @@ typedef struct connection_struct struct current_user { connection_struct *conn; - int vuid; - int uid, gid; + uint16 vuid; + uid_t uid; + gid_t gid; int ngroups; - GID_T *groups; + gid_t *groups; }; typedef struct files_struct @@ -509,7 +510,7 @@ typedef struct files_struct SMB_OFF_T pos; SMB_OFF_T size; mode_t mode; - int vuid; + uint16 vuid; char *mmap_ptr; SMB_OFF_T mmap_size; write_bmpx_struct *wbmpx_ptr; @@ -542,8 +543,8 @@ struct dcinfo typedef struct { - int uid; /* uid of a validated user */ - int gid; /* gid of a validated user */ + uid_t uid; /* uid of a validated user */ + gid_t gid; /* gid of a validated user */ fstring requested_name; /* user name from the client */ fstring name; /* unix user name of a validated user */ @@ -553,7 +554,7 @@ typedef struct /* following groups stuff added by ih */ /* This groups info is needed for when we become_user() for this uid */ int n_groups; - GID_T *groups; + gid_t *groups; int n_sids; int *sids; @@ -714,8 +715,8 @@ struct connect_record int magic; int pid; int cnum; - int uid; - int gid; + uid_t uid; + gid_t gid; char name[24]; char addr[24]; char machine[128]; @@ -727,7 +728,7 @@ struct connection_options { int protocol; /* Connection-Options */ uint32 max_xmit; - uint16 server_uid; + uint16 server_vuid; uint16 tid; /* The following are LANMAN 1.0 options */ uint16 sec_mode; -- cgit From 5b4d94e20fdb5888da1b71a7b6a30ebede6cb06a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 30 Sep 1998 01:49:24 +0000 Subject: (Finally) implemented "max open files" as a global smb.conf parameter. Sets up the files array correctly - limited by the smb.conf parameter and by the max fd's per process as found by getrlimit(). Jeremy. (This used to be commit eca24bd24352c688cdf48c1ef14adb8ac353468f) --- source3/include/local.h | 11 +++++++++++ source3/include/proto.h | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index 6903e5854f..a31c5c35b4 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -44,6 +44,17 @@ #define SHMEM_SIZE (1024*1024) #endif +/* + * Default number of maximum open files per smbd. This is + * also limited by the maximum available file descriptors + * per process and can also be set in smb.conf as "max open files" + * in the [global] section. + */ + +#ifndef MAX_OPEN_FILES +#define MAX_OPEN_FILES 4096 +#endif + /* the max number of simultanous connections to the server by all clients */ #define MAXSTATUS 100000 diff --git a/source3/include/proto.h b/source3/include/proto.h index 4f29b3ae20..c706cbd2c5 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -958,12 +958,12 @@ BOOL lp_passwd_chat_debug(void); BOOL lp_ole_locking_compat(void); BOOL lp_nt_smb_support(void); BOOL lp_stat_cache(void); -BOOL lp_kernel_oplocks(void); int lp_os_level(void); int lp_max_ttl(void); int lp_max_wins_ttl(void); int lp_min_wins_ttl(void); int lp_max_log_size(void); +int lp_max_open_files(void); int lp_maxxmit(void); int lp_maxmux(void); int lp_passwordlevel(void); @@ -1086,6 +1086,7 @@ int lp_major_announce_version(void); int lp_minor_announce_version(void); void lp_set_name_resolve_order(char *new_order); void lp_set_kernel_oplocks(BOOL val); +BOOL lp_kernel_oplocks(void); /*The following definitions come from param/params.c */ @@ -1733,6 +1734,7 @@ BOOL api_netlog_rpc(pipes_struct *p, prs_struct *data); /*The following definitions come from rpc_server/srv_pipe_hnd.c */ +void set_pipe_handle_offset(int max_open_files); void reset_chain_p(void); void init_rpc_pipe_hnd(void); pipes_struct *open_rpc_pipe_p(char *pipe_name, -- cgit From 8883e74ed44f5b25cc8f5a06e65a525587036f6c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 30 Sep 1998 03:05:29 +0000 Subject: Upped default MAX_OPEN_FILES to 10000 after conversation with tridge. As we're only using 1 bit per fd when idle it doesn't matter too much.... Jeremy. (This used to be commit dba55b2d3453bd18e1a0cb031d012733e5a214b9) --- source3/include/local.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index a31c5c35b4..7c63ab830b 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -52,7 +52,7 @@ */ #ifndef MAX_OPEN_FILES -#define MAX_OPEN_FILES 4096 +#define MAX_OPEN_FILES 10000 #endif /* the max number of simultanous connections to the server by all clients */ -- cgit From d8f609aeeb9ce70a97193d9e6709b82b78b39c39 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 30 Sep 1998 19:09:57 +0000 Subject: lsa_lookup_sids command added. severe debugging needed on lookup_sids code. added "quality of service" capability to lsa_open_policy code. different lsa_open_policy queries are *not* dealt with in the server code. answers like "0xC000 0022" - access denied - will have to be made to lsa_lookup_sids calls when a "quality of service" request is *not* specified in the lsa_open_policy call. (This used to be commit 299a723d4e55712beb12362dfff3846d82b8516b) --- source3/include/proto.h | 22 ++++++++++++++---- source3/include/rpc_lsa.h | 59 ++++++++++++++++++++++++++++++++--------------- 2 files changed, 58 insertions(+), 23 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index c706cbd2c5..fe090e8e25 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1204,7 +1204,13 @@ BOOL cli_nt_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr); /*The following definitions come from rpc_client/cli_lsarpc.c */ BOOL do_lsa_open_policy(struct cli_state *cli, - char *server_name, POLICY_HND *hnd); + char *server_name, POLICY_HND *hnd, + BOOL sec_qos); +BOOL do_lsa_lookup_sids(struct cli_state *cli, + POLICY_HND *hnd, + int num_sids, + DOM_SID **sids, + char **names); BOOL do_lsa_query_info_pol(struct cli_state *cli, POLICY_HND *hnd, uint16 info_class, fstring domain_name, fstring domain_sid); @@ -1274,10 +1280,13 @@ BOOL do_wks_query_info(struct cli_state *cli, /*The following definitions come from rpc_parse/parse_lsa.c */ void make_lsa_trans_name(LSA_TRANS_NAME *trn, uint32 sid_name_use, char *name, uint32 idx); -void make_lsa_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, uint32 sec_qos); +void make_lsa_sec_qos(LSA_SEC_QOS *qos, uint16 imp_lev, uint8 ctxt, uint8 eff, + uint32 unknown); +void make_lsa_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, LSA_SEC_QOS *qos); void make_q_open_pol(LSA_Q_OPEN_POL *r_q, char *server_name, - uint32 attributes, uint32 sec_qos, - uint32 desired_access); + uint32 attributes, + uint32 desired_access, + LSA_SEC_QOS *qos); void lsa_io_q_open_pol(char *desc, LSA_Q_OPEN_POL *r_q, prs_struct *ps, int depth); void lsa_io_r_open_pol(char *desc, LSA_R_OPEN_POL *r_p, prs_struct *ps, int depth); void make_q_query(LSA_Q_QUERY_INFO *q_q, POLICY_HND *hnd, uint16 info_class); @@ -1288,6 +1297,10 @@ void make_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM *r_e, uint32 status); void lsa_io_r_enum_trust_dom(char *desc, LSA_R_ENUM_TRUST_DOM *r_e, prs_struct *ps, int depth); void lsa_io_r_query(char *desc, LSA_R_QUERY_INFO *r_q, prs_struct *ps, int depth); +void make_lsa_sid_enum(LSA_SID_ENUM *sen, int num_entries, DOM_SID **sids); +void make_q_lookup_sids(LSA_Q_LOOKUP_SIDS *q_l, POLICY_HND *hnd, + int num_sids, DOM_SID **sids, + uint16 level); void lsa_io_q_lookup_sids(char *desc, LSA_Q_LOOKUP_SIDS *q_s, prs_struct *ps, int depth); void lsa_io_r_lookup_sids(char *desc, LSA_R_LOOKUP_SIDS *r_s, prs_struct *ps, int depth); void lsa_io_q_lookup_rids(char *desc, LSA_Q_LOOKUP_RIDS *q_r, prs_struct *ps, int depth); @@ -1779,6 +1792,7 @@ BOOL api_wkssvc_rpc(pipes_struct *p, prs_struct *data); /*The following definitions come from rpcclient/cmd_lsarpc.c */ void cmd_lsa_query_info(struct client_info *info); +void cmd_lsa_lookup_sids(struct client_info *info); /*The following definitions come from rpcclient/cmd_samr.c */ diff --git a/source3/include/rpc_lsa.h b/source3/include/rpc_lsa.h index ff87ed1bfb..fe4d018dbb 100644 --- a/source3/include/rpc_lsa.h +++ b/source3/include/rpc_lsa.h @@ -64,6 +64,15 @@ typedef struct dom_query_info typedef DOM_QUERY DOM_QUERY_3; typedef DOM_QUERY DOM_QUERY_5; +typedef struct seq_qos_info +{ + uint32 len; /* 12 */ + uint16 sec_imp_level; /* 0x02 - impersonation level */ + uint8 sec_ctxt_mode; /* 0x01 - context tracking mode */ + uint8 effective_only; /* 0x00 - effective only */ + uint32 unknown; /* 0x2000 0000 - not known */ + +} LSA_SEC_QOS; typedef struct obj_attr_info { @@ -72,7 +81,8 @@ typedef struct obj_attr_info uint32 ptr_obj_name; /* 0 - object name (pointer) */ uint32 attributes; /* 0 - attributes (undocumented) */ uint32 ptr_sec_desc; /* 0 - security descriptior (pointer) */ - uint32 sec_qos; /* 0 - security quality of service */ + uint32 ptr_sec_qos; /* security quality of service */ + LSA_SEC_QOS *sec_qos; } LSA_OBJ_ATTR; @@ -165,33 +175,44 @@ typedef struct lsa_r_close_info #define MAX_REF_DOMAINS 10 +/* DOM_TRUST_HDR */ +typedef struct dom_trust_hdr +{ + UNIHDR hdr_dom_name; /* referenced domain unicode string headers */ + uint32 ptr_dom_sid; + +} DOM_TRUST_HDR; + +/* DOM_TRUST_INFO */ +typedef struct dom_trust_info +{ + UNISTR2 uni_dom_name; /* domain name unicode string */ + DOM_SID2 ref_dom ; /* referenced domain SID */ + +} DOM_TRUST_INFO; + /* DOM_R_REF */ typedef struct dom_ref_info { uint32 undoc_buffer; /* undocumented buffer pointer. */ uint32 num_ref_doms_1; /* num referenced domains */ - uint32 buffer_dom_name; /* undocumented domain name buffer pointer. */ + uint32 undoc_buffer2; /* undocumented domain name buffer pointer. */ uint32 max_entries; /* 32 - max number of entries */ uint32 num_ref_doms_2; /* num referenced domains */ - - UNIHDR2 hdr_dom_name; /* domain name unicode string header */ - UNIHDR2 hdr_ref_dom[MAX_REF_DOMAINS]; /* referenced domain unicode string headers */ - - UNISTR uni_dom_name; /* domain name unicode string */ - DOM_SID2 ref_dom[MAX_REF_DOMAINS]; /* referenced domain SIDs */ + DOM_TRUST_HDR hdr_ref_dom[MAX_REF_DOMAINS]; /* referenced domains */ + DOM_TRUST_INFO ref_dom [MAX_REF_DOMAINS]; /* referenced domains */ } DOM_R_REF; +/* the domain_idx points to a SID associated with the name */ + /* LSA_TRANS_NAME - translated name */ typedef struct lsa_trans_name_info { uint32 sid_name_use; /* value is 5 for a well-known group; 2 for a domain group; 1 for a user... */ - - UNIHDR hdr_name; - UNISTR2 uni_name; - - uint32 domain_idx; + UNIHDR hdr_name; + uint32 domain_idx; /* index into DOM_R_REF array of SIDs */ } LSA_TRANS_NAME; @@ -204,8 +225,8 @@ typedef struct lsa_trans_name_enum_info uint32 ptr_trans_names; uint32 num_entries2; - uint32 ptr_name[MAX_LOOKUP_SIDS]; /* translated name pointers */ - LSA_TRANS_NAME name [MAX_LOOKUP_SIDS]; /* translated names */ + LSA_TRANS_NAME name [MAX_LOOKUP_SIDS]; /* translated names */ + UNISTR2 uni_name[MAX_LOOKUP_SIDS]; } LSA_TRANS_NAME_ENUM; @@ -216,15 +237,15 @@ typedef struct lsa_sid_enum_info uint32 ptr_sid_enum; uint32 num_entries2; - uint32 ptr_sid[MAX_LOOKUP_SIDS]; /* domain SID pointers to be looked up. */ - DOM_SID2 sid [MAX_LOOKUP_SIDS]; /* domain SIDs to be looked up. */ + uint32 ptr_sid[MAX_LOOKUP_SIDS]; /* domain SID pointers to be looked up. */ + DOM_SID2 sid [MAX_LOOKUP_SIDS]; /* domain SIDs to be looked up. */ } LSA_SID_ENUM; /* LSA_Q_LOOKUP_SIDS - LSA Lookup SIDs */ typedef struct lsa_q_lookup_sids { - POLICY_HND pol_hnd; /* policy handle */ + POLICY_HND pol; /* policy handle */ LSA_SID_ENUM sids; LSA_TRANS_NAME_ENUM names; LOOKUP_LEVEL level; @@ -257,7 +278,7 @@ typedef struct dom_name_info /* LSA_Q_LOOKUP_RIDS - LSA Lookup RIDs */ typedef struct lsa_q_lookup_rids { - POLICY_HND pol_hnd; /* policy handle */ + POLICY_HND pol; /* policy handle */ uint32 num_entries; uint32 num_entries2; uint32 buffer_dom_sid; /* undocumented domain SID buffer pointer */ -- cgit From 7b463b5f04617de19b405ca131113271183aa811 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 2 Oct 1998 12:34:14 +0000 Subject: a couple of mode for smbwrapper (This used to be commit 07dd2aedf1e8ad143669694b504554de74bbaa1d) --- source3/include/client.h | 2 +- source3/include/proto.h | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/client.h b/source3/include/client.h index 2b71b37524..40bd48de46 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -28,7 +28,7 @@ * These definitions depend on smb.h */ -typedef struct +typedef struct file_info { SMB_OFF_T size; int mode; diff --git a/source3/include/proto.h b/source3/include/proto.h index fe090e8e25..d329961623 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -179,6 +179,7 @@ int dos_chdir(char *dname); int dos_utime(char *fname,struct utimbuf *times); int dos_rename(char *from, char *to); int dos_chmod(char *fname,mode_t mode); +char *sys_getwd(char *s); char *dos_getwd(char *s); int sys_chown(char *fname,uid_t uid,gid_t gid); int sys_chroot(char *dname); @@ -385,12 +386,15 @@ BOOL cli_getatr(struct cli_state *cli, char *fname, int *attr, uint32 *size, time_t *t); BOOL cli_setatr(struct cli_state *cli, char *fname, int attr, time_t t); BOOL cli_qpathinfo(struct cli_state *cli, char *fname, - time_t *c_time, time_t *a_time, time_t *m_time, uint32 *size); + time_t *c_time, time_t *a_time, time_t *m_time, + uint32 *size, int *mode); BOOL cli_qpathinfo2(struct cli_state *cli, char *fname, time_t *c_time, time_t *a_time, time_t *m_time, time_t *w_time, uint32 *size); BOOL cli_qfileinfo(struct cli_state *cli, int fnum, - time_t *c_time, time_t *a_time, time_t *m_time, uint32 *size); + time_t *c_time, time_t *a_time, time_t *m_time, + uint32 *size, int *mode); +int cli_list(struct cli_state *cli,char *Mask,int attribute,void (*fn)(file_info *)); BOOL cli_oem_change_password(struct cli_state *cli, char *user, char *new_password, char *old_password); BOOL cli_negprot(struct cli_state *cli); -- cgit From bdbc959a9afd7fab159f235551c25139763af100 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 2 Oct 1998 18:45:07 +0000 Subject: - static function "create_new_hashes" was identical to "nt_lm_owf_gen". create_new_hashes didn't zero the buffer for the md4hash: nt_lm_owf_gen did, because jeremy sorted this out a couple of days ago. call nt_lm_owf_gen instead. - call SMBOWFencrypt from SMBencrypt and SMBNTencrypt. - added #ifdef DEBUG_PASSWORD debug password calls. (This used to be commit a4e7cc3e46b713aa0ae55de74a1c70921bef578d) --- source3/include/rpc_samr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/rpc_samr.h b/source3/include/rpc_samr.h index bcce64b6be..2e569396b9 100644 --- a/source3/include/rpc_samr.h +++ b/source3/include/rpc_samr.h @@ -334,13 +334,13 @@ typedef struct sam_unkown_info_2_info pointer is referring to */ - uint32 unknown_4; /* 0x0000 0099 */ + uint32 unknown_4; /* 0x0000 0099, 0x0000 0045 */ uint32 unknown_5; /* 0x0000 0000 */ uint32 unknown_6 ; /* 0x0000 0001 */ uint32 unknown_7 ; /* 0x0000 0003 */ uint32 unknown_8 ; /* 0x0000 0001 */ - uint32 unknown_9 ; /* 0x0000 0008 */ + uint32 unknown_9 ; /* 0x0000 0008, 0x0000 0006 */ uint32 unknown_10; /* 0x0000 0003 */ uint8 padding[16]; /* 16 bytes zeros */ -- cgit From 732d4ff7dacce985fb209ee99569cef907e2cbf4 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 2 Oct 1998 21:09:23 +0000 Subject: Makefile.in : - added srvsvc client files clientgen.c : - replaced cli_error(cli, int *cls, int *err) with cli_error(cli, uint8 cls, uint32 *err). this version detects 32 bit status messages. the DOS error "MORE_DATA", the equivalent of the 32 bit *warning* 0x8000 0005 (STATUS_BUFFER_OVERFLOW), was being processed as an error, terminating the cli_receive_trans() call. cli_pipe.c : - replaced calls that had been incorrectly modified from 32 bit warnings (0x8000 0005 - STATUS_BUFFER_OVERFLOW) to 8 bit DOS errors (0x01 0xEA - MORE_DATA). the use of the old version of cli_error (DOS only) instead of the new one (DOS and 32 bit) caused the dce/rpc client code to fail. - replaced 2 space indentation with tab indentation in all functions. cli_srvsvc.c : cmd_srvsvc.c : - added these files back in, fixing them up to use jeremy's modified versions of the dce/rpc client functions. parse_srv.c : - added back in some "unused" functions required by dce/rpc client-side code. it would be helpful if all such "unused" functions could be added back in. rpcclient.c : - added "session", "file", "share", "connection" enumeration functions back in. these are equivalent to nt's "NetXXXXXEnum" Win32 (MSDN) functions. - added "srvinfo" function back in. this is equivalent to nt's NetServerGetInfo Win32 (MSDN) function. (This used to be commit bcf39ffdcc64e049bca2d70a394a99976291e81d) --- source3/include/proto.h | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index d329961623..e120e5021e 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -403,7 +403,7 @@ BOOL cli_session_request(struct cli_state *cli, BOOL cli_connect(struct cli_state *cli, char *host, struct in_addr *ip); BOOL cli_initialise(struct cli_state *cli); void cli_shutdown(struct cli_state *cli); -void cli_error(struct cli_state *cli, int *eclass, int *num); +BOOL cli_error(struct cli_state *cli, uint8 *eclass, uint32 *num); void cli_sockopt(struct cli_state *cli, char *options); uint16 cli_setpid(struct cli_state *cli, uint16 pid); BOOL cli_reestablish_connection(struct cli_state *cli); @@ -1275,6 +1275,31 @@ BOOL do_samr_query_userinfo(struct cli_state *cli, POLICY_HND *pol, uint16 switch_value, void* usr); BOOL do_samr_close(struct cli_state *cli, POLICY_HND *hnd); +/*The following definitions come from rpc_client/cli_srvsvc.c */ + +BOOL do_srv_net_srv_conn_enum(struct cli_state *cli, + char *server_name, char *qual_name, + uint32 switch_value, SRV_CONN_INFO_CTR *ctr, + uint32 preferred_len, + ENUM_HND *hnd); +BOOL do_srv_net_srv_sess_enum(struct cli_state *cli, + char *server_name, char *qual_name, + uint32 switch_value, SRV_SESS_INFO_CTR *ctr, + uint32 preferred_len, + ENUM_HND *hnd); +BOOL do_srv_net_srv_share_enum(struct cli_state *cli, + char *server_name, + uint32 switch_value, SRV_SHARE_INFO_CTR *ctr, + uint32 preferred_len, + ENUM_HND *hnd); +BOOL do_srv_net_srv_file_enum(struct cli_state *cli, + char *server_name, char *qual_name, + uint32 switch_value, SRV_FILE_INFO_CTR *ctr, + uint32 preferred_len, + ENUM_HND *hnd); +BOOL do_srv_net_srv_get_info(struct cli_state *cli, + char *server_name, uint32 switch_value, SRV_INFO_CTR *ctr); + /*The following definitions come from rpc_client/cli_wkssvc.c */ BOOL do_wks_query_info(struct cli_state *cli, @@ -1668,6 +1693,11 @@ void make_srv_share_info2(SH_INFO_2 *sh2, char *net_name, uint32 type, char *remark, uint32 perms, uint32 max_uses, uint32 num_uses, char *path, char *passwd); +void make_srv_q_net_share_enum(SRV_Q_NET_SHARE_ENUM *q_n, + char *srv_name, + uint32 share_level, SRV_SHARE_INFO_CTR *ctr, + uint32 preferred_len, + ENUM_HND *hnd); void srv_io_q_net_share_enum(char *desc, SRV_Q_NET_SHARE_ENUM *q_n, prs_struct *ps, int depth); void srv_io_r_net_share_enum(char *desc, SRV_R_NET_SHARE_ENUM *r_n, prs_struct *ps, int depth); void make_srv_sess_info0_str(SESS_INFO_0_STR *ss0, char *name); @@ -1677,6 +1707,11 @@ void make_srv_sess_info1(SESS_INFO_1 *ss1, char *name, char *user, uint32 num_opens, uint32 open_time, uint32 idle_time, uint32 user_flags); +void make_srv_q_net_sess_enum(SRV_Q_NET_SESS_ENUM *q_n, + char *srv_name, char *qual_name, + uint32 sess_level, SRV_SESS_INFO_CTR *ctr, + uint32 preferred_len, + ENUM_HND *hnd); void srv_io_q_net_sess_enum(char *desc, SRV_Q_NET_SESS_ENUM *q_n, prs_struct *ps, int depth); void srv_io_r_net_sess_enum(char *desc, SRV_R_NET_SESS_ENUM *r_n, prs_struct *ps, int depth); void make_srv_conn_info0(CONN_INFO_0 *ss0, uint32 id); @@ -1685,12 +1720,22 @@ void make_srv_conn_info1(CONN_INFO_1 *ss1, uint32 id, uint32 type, uint32 num_opens, uint32 num_users, uint32 open_time, char *usr_name, char *net_name); +void make_srv_q_net_conn_enum(SRV_Q_NET_CONN_ENUM *q_n, + char *srv_name, char *qual_name, + uint32 conn_level, SRV_CONN_INFO_CTR *ctr, + uint32 preferred_len, + ENUM_HND *hnd); void srv_io_q_net_conn_enum(char *desc, SRV_Q_NET_CONN_ENUM *q_n, prs_struct *ps, int depth); void srv_io_r_net_conn_enum(char *desc, SRV_R_NET_CONN_ENUM *r_n, prs_struct *ps, int depth); void make_srv_file_info3_str(FILE_INFO_3_STR *fi3, char *user_name, char *path_name); void make_srv_file_info3(FILE_INFO_3 *fl3, uint32 id, uint32 perms, uint32 num_locks, char *path_name, char *user_name); +void make_srv_q_net_file_enum(SRV_Q_NET_FILE_ENUM *q_n, + char *srv_name, char *qual_name, + uint32 file_level, SRV_FILE_INFO_CTR *ctr, + uint32 preferred_len, + ENUM_HND *hnd); void srv_io_q_net_file_enum(char *desc, SRV_Q_NET_FILE_ENUM *q_n, prs_struct *ps, int depth); void srv_io_r_net_file_enum(char *desc, SRV_R_NET_FILE_ENUM *r_n, prs_struct *ps, int depth); void make_srv_info_101(SRV_INFO_101 *sv101, uint32 platform_id, char *name, @@ -1701,6 +1746,8 @@ void make_srv_info_102(SRV_INFO_102 *sv102, uint32 platform_id, char *name, uint32 srv_type, uint32 users, uint32 disc, uint32 hidden, uint32 announce, uint32 ann_delta, uint32 licenses, char *usr_path); +void make_srv_q_net_srv_get_info(SRV_Q_NET_SRV_GET_INFO *srv, + char *server_name, uint32 switch_value); void srv_io_q_net_srv_get_info(char *desc, SRV_Q_NET_SRV_GET_INFO *q_n, prs_struct *ps, int depth); void make_srv_r_net_srv_get_info(SRV_R_NET_SRV_GET_INFO *srv, uint32 switch_value, SRV_INFO_CTR *ctr, uint32 status); -- cgit From 392cdc89e737f8bf9fe42e899421ff4cf3884686 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 3 Oct 1998 08:08:03 +0000 Subject: added capabilities ab win95 fields to client structure. Used for detecting win95 server for bug handling (This used to be commit 76b5c8243791358be1a4781ff2e6929e56d98887) --- source3/include/client.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include') diff --git a/source3/include/client.h b/source3/include/client.h index 40bd48de46..628834925b 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -92,6 +92,8 @@ struct cli_state { char *inbuf; int bufsize; int initialised; + int win95; + uint32 capabilities; /* * Only used in NT domain calls. */ -- cgit From 4261ed2e8385761e39a7bf02cddcf8a0dcae253e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 3 Oct 1998 08:28:05 +0000 Subject: updated prototypes (This used to be commit a42155f77a0156aa10adc9fd0070f3edab647382) --- source3/include/proto.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index e120e5021e..55850d4cc0 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -288,6 +288,7 @@ BOOL send_smb(int fd,char *buffer); int name_extract(char *buf,int ofs,char *name); int name_len( char *s ); BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type); +void msleep(int t); BOOL in_list(char *s,char *list,BOOL casesensitive); BOOL string_init(char **dest,char *src); void string_free(char **s); @@ -382,12 +383,15 @@ BOOL cli_lock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int ti BOOL cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout); int cli_read(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 size); int cli_write(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 size); +BOOL cli_getattrE(struct cli_state *cli, int fd, + int *attr, uint32 *size, + time_t *c_time, time_t *a_time, time_t *m_time); BOOL cli_getatr(struct cli_state *cli, char *fname, - int *attr, uint32 *size, time_t *t); + uint32 *attr, size_t *size, time_t *t); BOOL cli_setatr(struct cli_state *cli, char *fname, int attr, time_t t); BOOL cli_qpathinfo(struct cli_state *cli, char *fname, time_t *c_time, time_t *a_time, time_t *m_time, - uint32 *size, int *mode); + size_t *size, uint32 *mode); BOOL cli_qpathinfo2(struct cli_state *cli, char *fname, time_t *c_time, time_t *a_time, time_t *m_time, time_t *w_time, uint32 *size); @@ -403,7 +407,7 @@ BOOL cli_session_request(struct cli_state *cli, BOOL cli_connect(struct cli_state *cli, char *host, struct in_addr *ip); BOOL cli_initialise(struct cli_state *cli); void cli_shutdown(struct cli_state *cli); -BOOL cli_error(struct cli_state *cli, uint8 *eclass, uint32 *num); +int cli_error(struct cli_state *cli, uint8 *eclass, uint32 *num); void cli_sockopt(struct cli_state *cli, char *options); uint16 cli_setpid(struct cli_state *cli, uint16 pid); BOOL cli_reestablish_connection(struct cli_state *cli); -- cgit From cce5f09a90b5027bafd22f42edab9c256789bce1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 3 Oct 1998 09:39:11 +0000 Subject: added unlink() and rename() support to smbwrapper (This used to be commit b85d96144728e8a29c7c1114462e28bf3b144b80) --- source3/include/proto.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 55850d4cc0..12331e5a88 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -335,7 +335,7 @@ char *unistr2(uint16 *buf); int struni2(uint16 *p, char *buf); char *unistr(char *buf); int unistrcpy(char *dst, char *src); -char *safe_strcpy(char *dest, char *src, int maxlength); +char *safe_strcpy(char *dest,const char *src, int maxlength); char *safe_strcat(char *dest, char *src, int maxlength); char *align2(char *q, char *base); void print_asc(int level, unsigned char *buf,int len); @@ -361,7 +361,7 @@ BOOL cli_api(struct cli_state *cli, char **rparam, int *rprcnt, char **rdata, int *rdrcnt); BOOL cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation); -BOOL cli_RNetShareEnum(struct cli_state *cli, void (*fn)(char *, uint32, char *)); +BOOL cli_RNetShareEnum(struct cli_state *cli, void (*fn)(const char *, uint32, char *)); BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype, void (*fn)(char *, uint32, char *)); BOOL cli_session_setup(struct cli_state *cli, @@ -373,7 +373,7 @@ BOOL cli_ulogoff(struct cli_state *cli); BOOL cli_send_tconX(struct cli_state *cli, char *share, char *dev, char *pass, int passlen); BOOL cli_tdis(struct cli_state *cli); -BOOL cli_mv(struct cli_state *cli, char *fname_src, char *fname_dst); +BOOL cli_rename(struct cli_state *cli, char *fname_src, char *fname_dst); BOOL cli_unlink(struct cli_state *cli, char *fname); BOOL cli_mkdir(struct cli_state *cli, char *dname); BOOL cli_rmdir(struct cli_state *cli, char *dname); -- cgit From 959005eb5e78f847c0c4f789c3af96549617873c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 3 Oct 1998 11:51:30 +0000 Subject: define O_ACCMODE if not defined (This used to be commit 48de03824ed33e9751bc9deeb22f1e1ef650b8cb) --- source3/include/includes.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 2ec134b7c6..ecd7e0e1ab 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -606,6 +606,10 @@ union semun { #define crypt ufc_crypt #endif +#ifndef O_ACCMODE +#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR) +#endif + #if defined(HAVE_CRYPT16) && defined(HAVE_GETAUTHUID) #define ULTRIX_AUTH 1 #endif -- cgit From bab2843a752bbb54ec886039903a581256d8cc7b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 3 Oct 1998 11:51:52 +0000 Subject: updated prototypes (This used to be commit 40af9fee1ac17bf329afcf1f0c73a92f03f183dd) --- source3/include/proto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 12331e5a88..f2324fda47 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -396,8 +396,8 @@ BOOL cli_qpathinfo2(struct cli_state *cli, char *fname, time_t *c_time, time_t *a_time, time_t *m_time, time_t *w_time, uint32 *size); BOOL cli_qfileinfo(struct cli_state *cli, int fnum, - time_t *c_time, time_t *a_time, time_t *m_time, - uint32 *size, int *mode); + uint32 *mode, size_t *size, + time_t *c_time, time_t *a_time, time_t *m_time); int cli_list(struct cli_state *cli,char *Mask,int attribute,void (*fn)(file_info *)); BOOL cli_oem_change_password(struct cli_state *cli, char *user, char *new_password, char *old_password); -- cgit From f651787785c0a8f2884e254723eeb26512a76e2a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 3 Oct 1998 12:33:34 +0000 Subject: added lseek() support for directories (This used to be commit 67ca971b0b00b5256b0af2c1c5777c393f9cef0b) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index f2324fda47..7eb3e1abc2 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -286,7 +286,7 @@ BOOL receive_smb(int fd,char *buffer, unsigned int timeout); BOOL client_receive_smb(int fd,char *buffer, unsigned int timeout); BOOL send_smb(int fd,char *buffer); int name_extract(char *buf,int ofs,char *name); -int name_len( char *s ); +int name_len(unsigned char *s); BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type); void msleep(int t); BOOL in_list(char *s,char *list,BOOL casesensitive); -- cgit From 03a06267f4674201c107b85abf993688312c5093 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 3 Oct 1998 13:12:08 +0000 Subject: added simple device/inode number support based on a checksum of the filename (This used to be commit 5674fb4e9dc4d92213d763c8cecd26efc23a9720) --- source3/include/proto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 7eb3e1abc2..08d4476da9 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -343,7 +343,7 @@ void dump_data(int level,char *buf1,int len); char *tab_depth(int depth); char *sid_to_string(pstring sidstr_out, DOM_SID *sid); BOOL string_to_sid(DOM_SID *sidout, char *sidstr); -int str_checksum(char *s); +int str_checksum(const char *s); void zero_free(void *p, size_t size); /*The following definitions come from libsmb/clientgen.c */ @@ -361,7 +361,7 @@ BOOL cli_api(struct cli_state *cli, char **rparam, int *rprcnt, char **rdata, int *rdrcnt); BOOL cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation); -BOOL cli_RNetShareEnum(struct cli_state *cli, void (*fn)(const char *, uint32, char *)); +BOOL cli_RNetShareEnum(struct cli_state *cli, void (*fn)(const char *, uint32, const char *)); BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype, void (*fn)(char *, uint32, char *)); BOOL cli_session_setup(struct cli_state *cli, -- cgit From f2d8f110db994588cb85a9c0c22c0941f4ccca38 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 3 Oct 1998 15:01:11 +0000 Subject: fixed vi on smbwrappper (it was a problem in cli_read()) (This used to be commit 1dcc84b942d4669f978aebdeaf85ea609c2b732f) --- source3/include/proto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 08d4476da9..b246289fd6 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -381,8 +381,8 @@ int cli_open(struct cli_state *cli, char *fname, int flags, int share_mode); BOOL cli_close(struct cli_state *cli, int fnum); BOOL cli_lock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout); BOOL cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout); -int cli_read(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 size); -int cli_write(struct cli_state *cli, int fnum, char *buf, uint32 offset, uint16 size); +size_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_t size); +size_t cli_write(struct cli_state *cli, int fnum, char *buf, off_t offset, size_t size); BOOL cli_getattrE(struct cli_state *cli, int fd, int *attr, uint32 *size, time_t *c_time, time_t *a_time, time_t *m_time); -- cgit From 57a58f592b67a0ebf482f06315b9c546590126bf Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 4 Oct 1998 04:33:56 +0000 Subject: more smbw cleanups. - cleaned up prototyping. Unfortunately we can't auto-prototype wrapped.c because it replaces system functions. - split stat functions into smbw_stat.c (This used to be commit 04e92e692e49234df6fbbfd07a33b315ed62f0de) --- source3/include/includes.h | 1 + source3/include/proto.h | 56 +++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 56 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index ecd7e0e1ab..be41db4d43 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -467,6 +467,7 @@ extern int errno; #include "version.h" #include "smb.h" +#include "smbw.h" #include "nameserv.h" #include "byteorder.h" diff --git a/source3/include/proto.h b/source3/include/proto.h index b246289fd6..932621ce9a 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -389,7 +389,7 @@ BOOL cli_getattrE(struct cli_state *cli, int fd, BOOL cli_getatr(struct cli_state *cli, char *fname, uint32 *attr, size_t *size, time_t *t); BOOL cli_setatr(struct cli_state *cli, char *fname, int attr, time_t t); -BOOL cli_qpathinfo(struct cli_state *cli, char *fname, +BOOL cli_qpathinfo(struct cli_state *cli, const char *fname, time_t *c_time, time_t *a_time, time_t *m_time, size_t *size, uint32 *mode); BOOL cli_qpathinfo2(struct cli_state *cli, char *fname, @@ -2269,6 +2269,60 @@ BOOL unbecome_user(void ); void become_root(BOOL save_dir) ; void unbecome_root(BOOL restore_dir); +/*The following definitions come from smbwrapper/smbw.c */ + +void smbw_init(void); +int smbw_fd(int fd); +ino_t smbw_inode(const char *name); +void clean_fname(char *name); +char *smbw_parse_path(const char *fname, char *server, char *share, char *path); +int smbw_path(const char *path); +int smbw_errno(struct cli_state *c); +struct smbw_server *smbw_server(char *server, char *share); +struct smbw_file *smbw_file(int fd); +int smbw_open(const char *fname, int flags, mode_t mode); +ssize_t smbw_read(int fd, void *buf, size_t count); +ssize_t smbw_write(int fd, void *buf, size_t count); +int smbw_close(int fd); +int smbw_fcntl(int fd, int cmd, long arg); +int smbw_access(const char *name, int mode); +int smbw_readlink(const char *path, char *buf, size_t bufsize); +int smbw_unlink(const char *fname); +int smbw_rename(const char *oldname, const char *newname); +int smbw_utime(const char *fname, void *buf); +int smbw_chown(const char *fname, uid_t owner, gid_t group); +int smbw_chmod(const char *fname, mode_t newmode); +off_t smbw_lseek(int fd, off_t offset, int whence); + +/*The following definitions come from smbwrapper/smbw_dir.c */ + +struct smbw_dir *smbw_dir(int fd); +int smbw_dirp(DIR *dirp); +int smbw_dir_open(const char *fname); +int smbw_dir_fstat(int fd, struct stat *st); +int smbw_dir_close(int fd); +int smbw_getdents(unsigned int fd, struct dirent *dirp, int count); +int smbw_chdir(const char *name); +off_t smbw_dir_lseek(int fd, off_t offset, int whence); +int smbw_mkdir(const char *fname, mode_t mode); +int smbw_rmdir(const char *fname); +char *smbw_getcwd(char *buf, size_t size); +int smbw_fchdir(unsigned int fd); +DIR *smbw_opendir(const char *fname); +struct dirent *smbw_readdir(DIR *dirp); +int smbw_closedir(DIR *dirp); +void smbw_seekdir(DIR *dirp, off_t offset); +off_t smbw_telldir(DIR *dirp); + +/*The following definitions come from smbwrapper/smbw_stat.c */ + +void smbw_setup_stat(struct stat *st, char *fname, size_t size, int mode); +BOOL smbw_getatr(struct smbw_server *srv, char *path, + uint32 *mode, size_t *size, + time_t *c_time, time_t *a_time, time_t *m_time); +int smbw_fstat(int fd, struct stat *st); +int smbw_stat(const char *fname, struct stat *st); + /*The following definitions come from web/cgi.c */ void cgi_load_variables(FILE *f1); -- cgit From d71c04f927cbcbaae0708c1533748caac20ee5af Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 4 Oct 1998 04:48:17 +0000 Subject: use dummy file descriptors opened on /dev/null to ensure that the smbw file descriptor allocation order is identical to the kernels. (This used to be commit 60a683465647932f7241ba9f92443d5e5294e20b) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 932621ce9a..78863b5984 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -55,6 +55,7 @@ BOOL check_access(int sock, char *allow_list, char *deny_list); struct bitmap *bitmap_allocate(int n); BOOL bitmap_set(struct bitmap *bm, unsigned i); BOOL bitmap_clear(struct bitmap *bm, unsigned i); +BOOL bitmap_query(struct bitmap *bm, unsigned i); int bitmap_find(struct bitmap *bm, unsigned ofs); /*The following definitions come from lib/charcnv.c */ -- cgit From 5ade894f32377ffaed3fc085810892509a6e8c66 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 4 Oct 1998 06:22:08 +0000 Subject: modified cli_read() and cli_write() to issue multiple outstanding read/write requests for large reads. up to max_mux requests may be outstanding. This gives _much_ better throughput and should allow smbsh to saturate just about any network. this is an implementation of the "fast SMB" method I described on the CIFS list a couple of months back. (This used to be commit c728d1c5d6e4626d2f8e318eab4df32acc8cb505) --- source3/include/client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/client.h b/source3/include/client.h index 628834925b..c312d29bf7 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -88,6 +88,7 @@ struct cli_state { int writebraw_supported; int timeout; int max_xmit; + int max_mux; char *outbuf; char *inbuf; int bufsize; -- cgit From 944d7e2c7e7f2fa8d0a69c89ad8740a1a6d96051 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 4 Oct 1998 07:50:44 +0000 Subject: set a default 16k client buffer size (This used to be commit cc1a0cf82b25e259c35f8accbb948814cc28a9ba) --- source3/include/client.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/client.h b/source3/include/client.h index c312d29bf7..79fb96dad2 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -24,6 +24,10 @@ #ifndef _CLIENT_H #define _CLIENT_H +/* the client asks for a smaller buffer to save ram and also to get more + overlap on the wire */ +#define CLI_BUFFER_SIZE (0x4000) + /* * These definitions depend on smb.h */ -- cgit From 6760e69a68571e01ee57b959193a56278962a23c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 4 Oct 1998 09:42:51 +0000 Subject: added support for printing via smbwrapper You can print using "cp filename /smb/SERVER/PRINTER/jobname" You can list the current printqueue using ls (This used to be commit 080fb61b69620e26e8122705383dc2bd0468a519) --- source3/include/client.h | 15 +++++++++++++-- source3/include/proto.h | 7 +++++++ 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/client.h b/source3/include/client.h index 79fb96dad2..495780cbaa 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -25,8 +25,9 @@ #define _CLIENT_H /* the client asks for a smaller buffer to save ram and also to get more - overlap on the wire */ -#define CLI_BUFFER_SIZE (0x4000) + overlap on the wire. This size gives us a nice read/write size, which + will be a multiple of the page size on almost any system */ +#define CLI_BUFFER_SIZE (0x4400) /* * These definitions depend on smb.h @@ -45,6 +46,16 @@ typedef struct file_info pstring name; } file_info; +struct print_job_info +{ + uint16 id; + uint16 priority; + size_t size; + fstring user; + fstring name; + time_t t; +}; + struct pwd_info { BOOL null_pwd; diff --git a/source3/include/proto.h b/source3/include/proto.h index 78863b5984..29803cdbbc 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -321,6 +321,7 @@ struct hostent *Get_Hostbyname(char *name); BOOL process_exists(int pid); char *uidtoname(uid_t uid); char *gidtoname(gid_t gid); +uid_t nametouid(const char *name); void smb_panic(char *why); char *readdirname(void *p); BOOL is_in_path(char *name, name_compare_entry *namelist); @@ -417,6 +418,8 @@ BOOL cli_establish_connection(struct cli_state *cli, struct nmb_name *calling, struct nmb_name *called, char *service, char *service_type, BOOL do_shutdown, BOOL do_tcon); +int cli_print_queue(struct cli_state *cli, + void (*fn)(struct print_job_info *)); /*The following definitions come from libsmb/credentials.c */ @@ -2294,6 +2297,8 @@ int smbw_utime(const char *fname, void *buf); int smbw_chown(const char *fname, uid_t owner, gid_t group); int smbw_chmod(const char *fname, mode_t newmode); off_t smbw_lseek(int fd, off_t offset, int whence); +int smbw_dup(int fd); +int smbw_dup2(int fd, int fd2); /*The following definitions come from smbwrapper/smbw_dir.c */ @@ -2321,6 +2326,8 @@ void smbw_setup_stat(struct stat *st, char *fname, size_t size, int mode); BOOL smbw_getatr(struct smbw_server *srv, char *path, uint32 *mode, size_t *size, time_t *c_time, time_t *a_time, time_t *m_time); +int smbw_stat_printjob(struct smbw_server *srv,char *path, + size_t *size, time_t *m_time); int smbw_fstat(int fd, struct stat *st); int smbw_stat(const char *fname, struct stat *st); -- cgit From a1b002fcbe5daa91ce8bc94b73760e2428238315 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 4 Oct 1998 10:14:21 +0000 Subject: add support for unlink() on printer shares in smbwrapper. unlink() will remove the job from the pirnt queue. (This used to be commit 7bd738c30a09a211fd14a8544309efeec17c66f5) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 29803cdbbc..f2b484ceec 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -418,6 +418,7 @@ BOOL cli_establish_connection(struct cli_state *cli, struct nmb_name *calling, struct nmb_name *called, char *service, char *service_type, BOOL do_shutdown, BOOL do_tcon); +int cli_printjob_del(struct cli_state *cli, int job); int cli_print_queue(struct cli_state *cli, void (*fn)(struct print_job_info *)); -- cgit From 1970c92c0a56672308314d39718f994302c95c95 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 4 Oct 1998 11:25:06 +0000 Subject: support NetServerEnum in smbwrapper. You can now do a ls in /smb/ and it will list all servers in your workgroup. You can set your workgroup with the SMBW_WORKGROUP environment variable. (This used to be commit 64699810e2d94e8648a0a3341b1cc826d4e8bfd9) --- source3/include/proto.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index f2b484ceec..86792a2245 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -365,7 +365,7 @@ BOOL cli_api(struct cli_state *cli, BOOL cli_NetWkstaUserLogon(struct cli_state *cli,char *user, char *workstation); BOOL cli_RNetShareEnum(struct cli_state *cli, void (*fn)(const char *, uint32, const char *)); BOOL cli_NetServerEnum(struct cli_state *cli, char *workgroup, uint32 stype, - void (*fn)(char *, uint32, char *)); + void (*fn)(const char *, uint32, const char *)); BOOL cli_session_setup(struct cli_state *cli, char *user, char *pass, int passlen, @@ -405,7 +405,7 @@ BOOL cli_oem_change_password(struct cli_state *cli, char *user, char *new_passwo char *old_password); BOOL cli_negprot(struct cli_state *cli); BOOL cli_session_request(struct cli_state *cli, - struct nmb_name *calling, struct nmb_name *called); + struct nmb_name *calling, struct nmb_name *called); BOOL cli_connect(struct cli_state *cli, char *host, struct in_addr *ip); BOOL cli_initialise(struct cli_state *cli); void cli_shutdown(struct cli_state *cli); @@ -448,6 +448,7 @@ FILE *startlmhosts(char *fname); BOOL getlmhostsent( FILE *fp, char *name, int *name_type, struct in_addr *ipaddr); void endlmhosts(FILE *fp); BOOL resolve_name(char *name, struct in_addr *return_ip); +BOOL find_master(char *group, struct in_addr *master_ip); /*The following definitions come from libsmb/nmblib.c */ -- cgit From 40984f6b55212c710f6a7c7b940a785b2b607985 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 4 Oct 1998 12:00:40 +0000 Subject: - modified resolve_name() to take a name_type - cleaned up resolve_name() (split into separate functions for each resolver) - if can't find local master then use #1B name - support listing of foreign workgroups in /smb/ (This used to be commit a4e607c17d1119925c9d0e1d05e0fe81e9a2d1aa) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 86792a2245..f89b7a7ff5 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -447,7 +447,7 @@ struct in_addr *name_query(int fd,char *name,int name_type, BOOL bcast,BOOL recu FILE *startlmhosts(char *fname); BOOL getlmhostsent( FILE *fp, char *name, int *name_type, struct in_addr *ipaddr); void endlmhosts(FILE *fp); -BOOL resolve_name(char *name, struct in_addr *return_ip); +BOOL resolve_name(char *name, struct in_addr *return_ip, int name_type); BOOL find_master(char *group, struct in_addr *master_ip); /*The following definitions come from libsmb/nmblib.c */ -- cgit From 3a8232644e04a4cfdcbe2061f0556b78b4045191 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 4 Oct 1998 14:02:50 +0000 Subject: started basic support for solaris 2.5 in smbwrapper. (This used to be commit e5c7cabae4826bde819b94a48bc4674dcd69da21) --- source3/include/config.h.in | 81 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 1f1cb04e0b..ffcc6a2ef0 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -136,6 +136,81 @@ /* The number of bytes in a short. */ #undef SIZEOF_SHORT +/* Define if you have the __closedir function. */ +#undef HAVE___CLOSEDIR + +/* Define if you have the __dup function. */ +#undef HAVE___DUP + +/* Define if you have the __dup2 function. */ +#undef HAVE___DUP2 + +/* Define if you have the __fstat function. */ +#undef HAVE___FSTAT + +/* Define if you have the __fxstat function. */ +#undef HAVE___FXSTAT + +/* Define if you have the __getcwd function. */ +#undef HAVE___GETCWD + +/* Define if you have the __lstat function. */ +#undef HAVE___LSTAT + +/* Define if you have the __lxstat function. */ +#undef HAVE___LXSTAT + +/* Define if you have the __opendir function. */ +#undef HAVE___OPENDIR + +/* Define if you have the __readdir function. */ +#undef HAVE___READDIR + +/* Define if you have the __seekdir function. */ +#undef HAVE___SEEKDIR + +/* Define if you have the __stat function. */ +#undef HAVE___STAT + +/* Define if you have the __telldir function. */ +#undef HAVE___TELLDIR + +/* Define if you have the __xstat function. */ +#undef HAVE___XSTAT + +/* Define if you have the _closedir function. */ +#undef HAVE__CLOSEDIR + +/* Define if you have the _dup function. */ +#undef HAVE__DUP + +/* Define if you have the _dup2 function. */ +#undef HAVE__DUP2 + +/* Define if you have the _fstat function. */ +#undef HAVE__FSTAT + +/* Define if you have the _getcwd function. */ +#undef HAVE__GETCWD + +/* Define if you have the _lstat function. */ +#undef HAVE__LSTAT + +/* Define if you have the _opendir function. */ +#undef HAVE__OPENDIR + +/* Define if you have the _readdir function. */ +#undef HAVE__READDIR + +/* Define if you have the _seekdir function. */ +#undef HAVE__SEEKDIR + +/* Define if you have the _stat function. */ +#undef HAVE__STAT + +/* Define if you have the _telldir function. */ +#undef HAVE__TELLDIR + /* Define if you have the atexit function. */ #undef HAVE_ATEXIT @@ -472,6 +547,9 @@ /* Define if you have the header file. */ #undef HAVE_SYS_STATVFS_H +/* Define if you have the header file. */ +#undef HAVE_SYS_SYSCALL_H + /* Define if you have the header file. */ #undef HAVE_SYS_TIME_H @@ -484,6 +562,9 @@ /* Define if you have the header file. */ #undef HAVE_SYS_WAIT_H +/* Define if you have the header file. */ +#undef HAVE_SYSACLL_H + /* Define if you have the header file. */ #undef HAVE_TERMIOS_H -- cgit From e34e25d907ee92063fd2466a1634b961e292cc0f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 4 Oct 1998 15:54:04 +0000 Subject: more solaris 2.5 fixups. It now seems to be working pretty well. (This used to be commit c4e450817886b40474cebdfc50c0c16fb4646baf) --- source3/include/config.h.in | 72 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index ffcc6a2ef0..9893f7c2da 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -136,6 +136,15 @@ /* The number of bytes in a short. */ #undef SIZEOF_SHORT +/* Define if you have the __acl function. */ +#undef HAVE___ACL + +/* Define if you have the __chdir function. */ +#undef HAVE___CHDIR + +/* Define if you have the __close function. */ +#undef HAVE___CLOSE + /* Define if you have the __closedir function. */ #undef HAVE___CLOSEDIR @@ -145,6 +154,15 @@ /* Define if you have the __dup2 function. */ #undef HAVE___DUP2 +/* Define if you have the __facl function. */ +#undef HAVE___FACL + +/* Define if you have the __fchdir function. */ +#undef HAVE___FCHDIR + +/* Define if you have the __fcntl function. */ +#undef HAVE___FCNTL + /* Define if you have the __fstat function. */ #undef HAVE___FSTAT @@ -154,15 +172,27 @@ /* Define if you have the __getcwd function. */ #undef HAVE___GETCWD +/* Define if you have the __getdents function. */ +#undef HAVE___GETDENTS + +/* Define if you have the __lseek function. */ +#undef HAVE___LSEEK + /* Define if you have the __lstat function. */ #undef HAVE___LSTAT /* Define if you have the __lxstat function. */ #undef HAVE___LXSTAT +/* Define if you have the __open function. */ +#undef HAVE___OPEN + /* Define if you have the __opendir function. */ #undef HAVE___OPENDIR +/* Define if you have the __read function. */ +#undef HAVE___READ + /* Define if you have the __readdir function. */ #undef HAVE___READDIR @@ -175,9 +205,21 @@ /* Define if you have the __telldir function. */ #undef HAVE___TELLDIR +/* Define if you have the __write function. */ +#undef HAVE___WRITE + /* Define if you have the __xstat function. */ #undef HAVE___XSTAT +/* Define if you have the _acl function. */ +#undef HAVE__ACL + +/* Define if you have the _chdir function. */ +#undef HAVE__CHDIR + +/* Define if you have the _close function. */ +#undef HAVE__CLOSE + /* Define if you have the _closedir function. */ #undef HAVE__CLOSEDIR @@ -187,18 +229,39 @@ /* Define if you have the _dup2 function. */ #undef HAVE__DUP2 +/* Define if you have the _facl function. */ +#undef HAVE__FACL + +/* Define if you have the _fchdir function. */ +#undef HAVE__FCHDIR + +/* Define if you have the _fcntl function. */ +#undef HAVE__FCNTL + /* Define if you have the _fstat function. */ #undef HAVE__FSTAT /* Define if you have the _getcwd function. */ #undef HAVE__GETCWD +/* Define if you have the _getdents function. */ +#undef HAVE__GETDENTS + +/* Define if you have the _lseek function. */ +#undef HAVE__LSEEK + /* Define if you have the _lstat function. */ #undef HAVE__LSTAT +/* Define if you have the _open function. */ +#undef HAVE__OPEN + /* Define if you have the _opendir function. */ #undef HAVE__OPENDIR +/* Define if you have the _read function. */ +#undef HAVE__READ + /* Define if you have the _readdir function. */ #undef HAVE__READDIR @@ -211,6 +274,9 @@ /* Define if you have the _telldir function. */ #undef HAVE__TELLDIR +/* Define if you have the _write function. */ +#undef HAVE__WRITE + /* Define if you have the atexit function. */ #undef HAVE_ATEXIT @@ -343,6 +409,9 @@ /* Define if you have the set_auth_parameters function. */ #undef HAVE_SET_AUTH_PARAMETERS +/* Define if you have the setenv function. */ +#undef HAVE_SETENV + /* Define if you have the setgroups function. */ #undef HAVE_SETGROUPS @@ -487,6 +556,9 @@ /* Define if you have the header file. */ #undef HAVE_STROPTS_H +/* Define if you have the header file. */ +#undef HAVE_SYS_ACL_H + /* Define if you have the header file. */ #undef HAVE_SYS_CAPABILITY_H -- cgit From 06eaf71e433bf0970e86f2389842637089805346 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Sun, 4 Oct 1998 22:42:05 +0000 Subject: bin/cvsignore: deleted, so that bin can be removed from the repository .cvsignore: added bin; it is no longer part of the source tree smbwrapper/smbsh: now auto-generated from smbsh.in smbwrapper/.cvsignore: added smbsh configure.in: generate @builddir@ configure, include/stamp-h.in: regen Makefile.in: new target `smbwrapper'; sped up directory creation (This used to be commit 8f95ee8fc32d74f20cca489ecd3f7e34e773db2f) --- source3/include/stamp-h.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/stamp-h.in b/source3/include/stamp-h.in index 7aae7732de..96ffedef4a 100644 --- a/source3/include/stamp-h.in +++ b/source3/include/stamp-h.in @@ -1 +1 @@ -Tue Sep 29 04:45:55 UTC 1998 +Sun Oct 4 22:04:34 UTC 1998 -- cgit From 933db19db30b84aaa25facca2f62ed3991815269 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 5 Oct 1998 00:50:41 +0000 Subject: reran autoconf (This used to be commit 32695b1606c6198aca294ebe1436c98d2d698095) --- source3/include/config.h.in | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 9893f7c2da..29a1d71310 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -166,6 +166,9 @@ /* Define if you have the __fstat function. */ #undef HAVE___FSTAT +/* Define if you have the __fstat64 function. */ +#undef HAVE___FSTAT64 + /* Define if you have the __fxstat function. */ #undef HAVE___FXSTAT @@ -175,12 +178,18 @@ /* Define if you have the __getdents function. */ #undef HAVE___GETDENTS +/* Define if you have the __llseek function. */ +#undef HAVE___LLSEEK + /* Define if you have the __lseek function. */ #undef HAVE___LSEEK /* Define if you have the __lstat function. */ #undef HAVE___LSTAT +/* Define if you have the __lstat64 function. */ +#undef HAVE___LSTAT64 + /* Define if you have the __lxstat function. */ #undef HAVE___LXSTAT @@ -202,6 +211,9 @@ /* Define if you have the __stat function. */ #undef HAVE___STAT +/* Define if you have the __stat64 function. */ +#undef HAVE___STAT64 + /* Define if you have the __telldir function. */ #undef HAVE___TELLDIR @@ -241,18 +253,27 @@ /* Define if you have the _fstat function. */ #undef HAVE__FSTAT +/* Define if you have the _fstat64 function. */ +#undef HAVE__FSTAT64 + /* Define if you have the _getcwd function. */ #undef HAVE__GETCWD /* Define if you have the _getdents function. */ #undef HAVE__GETDENTS +/* Define if you have the _llseek function. */ +#undef HAVE__LLSEEK + /* Define if you have the _lseek function. */ #undef HAVE__LSEEK /* Define if you have the _lstat function. */ #undef HAVE__LSTAT +/* Define if you have the _lstat64 function. */ +#undef HAVE__LSTAT64 + /* Define if you have the _open function. */ #undef HAVE__OPEN @@ -271,6 +292,9 @@ /* Define if you have the _stat function. */ #undef HAVE__STAT +/* Define if you have the _stat64 function. */ +#undef HAVE__STAT64 + /* Define if you have the _telldir function. */ #undef HAVE__TELLDIR @@ -364,6 +388,9 @@ /* Define if you have the innetgr function. */ #undef HAVE_INNETGR +/* Define if you have the llseek function. */ +#undef HAVE_LLSEEK + /* Define if you have the lseek64 function. */ #undef HAVE_LSEEK64 -- cgit From 901399b70699e4f90421c2df2df2671e000c496e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 5 Oct 1998 01:25:39 +0000 Subject: tests for readdir64 (This used to be commit bdf02378c634e0d18f4f2de7a74b2f2fc5965e9a) --- source3/include/config.h.in | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 29a1d71310..df613d2d3b 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -205,6 +205,9 @@ /* Define if you have the __readdir function. */ #undef HAVE___READDIR +/* Define if you have the __readdir64 function. */ +#undef HAVE___READDIR64 + /* Define if you have the __seekdir function. */ #undef HAVE___SEEKDIR @@ -286,6 +289,9 @@ /* Define if you have the _readdir function. */ #undef HAVE__READDIR +/* Define if you have the _readdir64 function. */ +#undef HAVE__READDIR64 + /* Define if you have the _seekdir function. */ #undef HAVE__SEEKDIR @@ -427,6 +433,9 @@ /* Define if you have the rdchk function. */ #undef HAVE_RDCHK +/* Define if you have the readdir64 function. */ +#undef HAVE_READDIR64 + /* Define if you have the rename function. */ #undef HAVE_RENAME -- cgit From 93bbfce02b4ad3f51cef9b057a3959f4e091529f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 5 Oct 1998 01:57:03 +0000 Subject: added a function set_maxfiles() to set our file rlimit to the max possible and return the max. (This used to be commit 7a7b5ee1689b6be57752d176c7b77a2f1b453486) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index f89b7a7ff5..0736e3f5bd 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -347,6 +347,7 @@ char *sid_to_string(pstring sidstr_out, DOM_SID *sid); BOOL string_to_sid(DOM_SID *sidout, char *sidstr); int str_checksum(const char *s); void zero_free(void *p, size_t size); +int set_maxfiles(void); /*The following definitions come from libsmb/clientgen.c */ -- cgit From e248b8905dd61937ebaa5c06b8fdb10bb4917e28 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 5 Oct 1998 02:14:19 +0000 Subject: added pread pread64 pwrite pwrite64 and open64 (This used to be commit 2087e0ce89e113d3989deefdf79b22b2757e008b) --- source3/include/config.h.in | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index df613d2d3b..7b5d4be043 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -196,9 +196,24 @@ /* Define if you have the __open function. */ #undef HAVE___OPEN +/* Define if you have the __open64 function. */ +#undef HAVE___OPEN64 + /* Define if you have the __opendir function. */ #undef HAVE___OPENDIR +/* Define if you have the __pread function. */ +#undef HAVE___PREAD + +/* Define if you have the __pread64 function. */ +#undef HAVE___PREAD64 + +/* Define if you have the __pwrite function. */ +#undef HAVE___PWRITE + +/* Define if you have the __pwrite64 function. */ +#undef HAVE___PWRITE64 + /* Define if you have the __read function. */ #undef HAVE___READ @@ -280,9 +295,24 @@ /* Define if you have the _open function. */ #undef HAVE__OPEN +/* Define if you have the _open64 function. */ +#undef HAVE__OPEN64 + /* Define if you have the _opendir function. */ #undef HAVE__OPENDIR +/* Define if you have the _pread function. */ +#undef HAVE__PREAD + +/* Define if you have the _pread64 function. */ +#undef HAVE__PREAD64 + +/* Define if you have the _pwrite function. */ +#undef HAVE__PWRITE + +/* Define if you have the _pwrite64 function. */ +#undef HAVE__PWRITE64 + /* Define if you have the _read function. */ #undef HAVE__READ @@ -412,6 +442,9 @@ /* Define if you have the mktime function. */ #undef HAVE_MKTIME +/* Define if you have the open64 function. */ +#undef HAVE_OPEN64 + /* Define if you have the pam_authenticate function. */ #undef HAVE_PAM_AUTHENTICATE @@ -421,9 +454,21 @@ /* Define if you have the pipe function. */ #undef HAVE_PIPE +/* Define if you have the pread function. */ +#undef HAVE_PREAD + +/* Define if you have the pread64 function. */ +#undef HAVE_PREAD64 + /* Define if you have the putprpwnam function. */ #undef HAVE_PUTPRPWNAM +/* Define if you have the pwrite function. */ +#undef HAVE_PWRITE + +/* Define if you have the pwrite64 function. */ +#undef HAVE_PWRITE64 + /* Define if you have the rand function. */ #undef HAVE_RAND -- cgit From 5d14f8932469f232960a255170a99a308a0ffcf3 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Mon, 5 Oct 1998 02:19:09 +0000 Subject: added 64-bit file support (This used to be commit 43ec91ac1fbf22f9a0150e1eadec5709a7d21050) --- source3/include/stamp-h.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/stamp-h.in b/source3/include/stamp-h.in index 96ffedef4a..0d4c6e8719 100644 --- a/source3/include/stamp-h.in +++ b/source3/include/stamp-h.in @@ -1 +1 @@ -Sun Oct 4 22:04:34 UTC 1998 +Mon Oct 5 01:39:04 UTC 1998 -- cgit From 508140245293d8a013683db59bc7be2c6b9d8403 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Mon, 5 Oct 1998 03:44:39 +0000 Subject: revert 64-bit file support; it's hard-coded already (This used to be commit f604fd1a8b34efb52531c57e68a3cf31319b9262) --- source3/include/stamp-h.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/stamp-h.in b/source3/include/stamp-h.in index 0d4c6e8719..a9450b6517 100644 --- a/source3/include/stamp-h.in +++ b/source3/include/stamp-h.in @@ -1 +1 @@ -Mon Oct 5 01:39:04 UTC 1998 +Mon Oct 5 03:36:59 UTC 1998 -- cgit From f6b9f31d9343a252a84e67635a1342b5ba33b21a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 5 Oct 1998 03:52:57 +0000 Subject: test for loff_t and offset_t to support llseek() on Solaris and Linux. (This used to be commit 386026930557584fda14f8cdc07c41d84d630b39) --- source3/include/config.h.in | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 7b5d4be043..b5c3fa7b26 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -65,6 +65,8 @@ #undef ssize_t #undef ino_t #undef ssize_t +#undef loff_t +#undef offset_t #undef HAVE_CONNECT #undef HAVE_SHORT_INO_T #undef WITH_AFS -- cgit From a6c2a568c1be2d2b945aae8fefb1eb0cc51e2e3b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 5 Oct 1998 09:01:49 +0000 Subject: test for creat64() (This used to be commit 8aa6c16eeb96d6a66a2946f5048126f175f9f609) --- source3/include/config.h.in | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index b5c3fa7b26..930832a8bd 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -360,6 +360,9 @@ /* Define if you have the connect function. */ #undef HAVE_CONNECT +/* Define if you have the creat64 function. */ +#undef HAVE_CREAT64 + /* Define if you have the crypt function. */ #undef HAVE_CRYPT -- cgit From bfaff8ed1a3899c9aef7eaa2421d3d6467343ea1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 5 Oct 1998 12:17:01 +0000 Subject: got smbwrapper working on IRIX 6.4. Things got a bit tricky, especially as the headers get the syscall numbers wrong! (This used to be commit a5405f1ab069a3123a819311a87ca84f2c5f0fea) --- source3/include/proto.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 0736e3f5bd..b7a1b31f0d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -387,7 +387,7 @@ BOOL cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int size_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_t size); size_t cli_write(struct cli_state *cli, int fnum, char *buf, off_t offset, size_t size); BOOL cli_getattrE(struct cli_state *cli, int fd, - int *attr, uint32 *size, + uint32 *attr, size_t *size, time_t *c_time, time_t *a_time, time_t *m_time); BOOL cli_getatr(struct cli_state *cli, char *fname, uint32 *attr, size_t *size, time_t *t); @@ -2276,6 +2276,11 @@ BOOL unbecome_user(void ); void become_root(BOOL save_dir) ; void unbecome_root(BOOL restore_dir); +/*The following definitions come from smbwrapper/realcalls.c */ + +int real_utime(const char *name, struct utimbuf *buf); +int real_utimes(const char *name, struct timeval tv[2]); + /*The following definitions come from smbwrapper/smbw.c */ void smbw_init(void); @@ -2288,8 +2293,10 @@ int smbw_errno(struct cli_state *c); struct smbw_server *smbw_server(char *server, char *share); struct smbw_file *smbw_file(int fd); int smbw_open(const char *fname, int flags, mode_t mode); +ssize_t smbw_pread(int fd, void *buf, size_t count, off_t ofs); ssize_t smbw_read(int fd, void *buf, size_t count); ssize_t smbw_write(int fd, void *buf, size_t count); +ssize_t smbw_pwrite(int fd, void *buf, size_t count, off_t ofs); int smbw_close(int fd); int smbw_fcntl(int fd, int cmd, long arg); int smbw_access(const char *name, int mode); @@ -2297,6 +2304,7 @@ int smbw_readlink(const char *path, char *buf, size_t bufsize); int smbw_unlink(const char *fname); int smbw_rename(const char *oldname, const char *newname); int smbw_utime(const char *fname, void *buf); +int smbw_utimes(const char *fname, void *buf); int smbw_chown(const char *fname, uid_t owner, gid_t group); int smbw_chmod(const char *fname, mode_t newmode); off_t smbw_lseek(int fd, off_t offset, int whence); -- cgit From c926d8b179643ce26319e5178aaeb38237532fc1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 5 Oct 1998 12:34:57 +0000 Subject: new prototypes (This used to be commit 0a733ce59d3e77f8cfd6a8165beeb39c23b26999) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index b7a1b31f0d..ce064a307c 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -287,7 +287,7 @@ BOOL receive_smb(int fd,char *buffer, unsigned int timeout); BOOL client_receive_smb(int fd,char *buffer, unsigned int timeout); BOOL send_smb(int fd,char *buffer); int name_extract(char *buf,int ofs,char *name); -int name_len(unsigned char *s); +int name_len(char *s1); BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type); void msleep(int t); BOOL in_list(char *s,char *list,BOOL casesensitive); -- cgit From b4fb4caf9032875fe50725c9b71b6411538ba85f Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 5 Oct 1998 15:41:41 +0000 Subject: rpcclient srvsvc commands. (This used to be commit 1a9a22c657c46648adaa98ac1fe394ce4bce11f0) --- source3/include/proto.h | 8 ++++++++ source3/include/rpc_samr.h | 16 ++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index ce064a307c..19aa51a1b7 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1864,6 +1864,14 @@ void cmd_sam_query_user(struct client_info *info); void cmd_sam_query_groups(struct client_info *info); void cmd_sam_enum_aliases(struct client_info *info); +/*The following definitions come from rpcclient/cmd_srvsvc.c */ + +void cmd_srv_query_info(struct client_info *info); +void cmd_srv_enum_conn(struct client_info *info); +void cmd_srv_enum_shares(struct client_info *info); +void cmd_srv_enum_sess(struct client_info *info); +void cmd_srv_enum_files(struct client_info *info); + /*The following definitions come from rpcclient/cmd_wkssvc.c */ void cmd_wks_query_info(struct client_info *info); diff --git a/source3/include/rpc_samr.h b/source3/include/rpc_samr.h index 2e569396b9..a314015591 100644 --- a/source3/include/rpc_samr.h +++ b/source3/include/rpc_samr.h @@ -334,13 +334,13 @@ typedef struct sam_unkown_info_2_info pointer is referring to */ - uint32 unknown_4; /* 0x0000 0099, 0x0000 0045 */ + uint32 unknown_4; /* 0x0000 0099 */ uint32 unknown_5; /* 0x0000 0000 */ uint32 unknown_6 ; /* 0x0000 0001 */ uint32 unknown_7 ; /* 0x0000 0003 */ uint32 unknown_8 ; /* 0x0000 0001 */ - uint32 unknown_9 ; /* 0x0000 0008, 0x0000 0006 */ + uint32 unknown_9 ; /* 0x0000 0008 */ uint32 unknown_10; /* 0x0000 0003 */ uint8 padding[16]; /* 16 bytes zeros */ @@ -385,7 +385,7 @@ SAMR_Q_OPEN_DOMAIN - unknown_0 values seen associated with SIDs: /* SAMR_Q_OPEN_DOMAIN */ typedef struct q_samr_open_domain_info { - POLICY_HND connect_pol; /* policy handle */ + POLICY_HND connect_pol; /* policy handle */ uint32 rid; /* 0x2000 0000; 0x0000 0211; 0x0000 0280; 0x0000 0200 - a RID? */ DOM_SID2 dom_sid; /* domain SID */ @@ -395,7 +395,7 @@ typedef struct q_samr_open_domain_info /* SAMR_R_OPEN_DOMAIN - probably an open */ typedef struct r_samr_open_domain_info { - POLICY_HND domain_pol; /* policy handle associated with the SID */ + POLICY_HND domain_pol; /* policy handle associated with the SID */ uint32 status; /* return status */ } SAMR_R_OPEN_DOMAIN; @@ -668,10 +668,10 @@ typedef struct r_samr_query_aliasinfo_info /* uint8[2] padding */ union - { + { ALIAS_INFO3 info3; - } alias; + } alias; uint32 status; @@ -681,7 +681,7 @@ typedef struct r_samr_query_aliasinfo_info /* SAMR_Q_QUERY_USERGROUPS - */ typedef struct q_samr_query_usergroup_info { - POLICY_HND pol; /* policy handle associated with unknown id */ + POLICY_HND pol; /* policy handle associated with unknown id */ } SAMR_Q_QUERY_USERGROUPS; @@ -703,7 +703,7 @@ typedef struct r_samr_query_usergroup_info /* SAMR_Q_QUERY_USERINFO - probably a get sam info */ typedef struct q_samr_query_user_info { - POLICY_HND pol; /* policy handle associated with unknown id */ + POLICY_HND pol; /* policy handle associated with unknown id */ uint16 switch_value; /* 0x0015, 0x0011 or 0x0010 - 16 bit unknown */ } SAMR_Q_QUERY_USERINFO; -- cgit From fff618aeb4142773ff388ac9b52d127a510c6690 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 6 Oct 1998 12:23:37 +0000 Subject: added a wrapper for fork() in a fork we have to close all server connections otherwise we can end up with two processes writing to the same socket. (This used to be commit b7ecbca3aff34ff06a445e5ee39efba48261b7e8) --- source3/include/config.h.in | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 930832a8bd..92056f075a 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -165,6 +165,9 @@ /* Define if you have the __fcntl function. */ #undef HAVE___FCNTL +/* Define if you have the __fork function. */ +#undef HAVE___FORK + /* Define if you have the __fstat function. */ #undef HAVE___FSTAT @@ -270,6 +273,9 @@ /* Define if you have the _fcntl function. */ #undef HAVE__FCNTL +/* Define if you have the _fork function. */ +#undef HAVE__FORK + /* Define if you have the _fstat function. */ #undef HAVE__FSTAT -- cgit From 404f14fb36577ee182fd8a928e6cb7b374e4ecb9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 6 Oct 1998 13:10:06 +0000 Subject: implemented unix semantics for rename in smbwrapper (This used to be commit a5c18f9c82f5f76b00ff29c5668b4f0d3e8d6bd0) --- source3/include/smb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 56b0e3bc24..05ea1bf7c7 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -216,6 +216,7 @@ implemented */ #define ERRfilexists 80 /* File in operation already exists */ #define ERRcannotopen 110 /* Cannot open the file specified */ #define ERRunknownlevel 124 +#define ERRrename 183 #define ERRbadpipe 230 /* Named pipe invalid */ #define ERRpipebusy 231 /* All instances of pipe are busy */ #define ERRpipeclosing 232 /* named pipe close in progress */ -- cgit From c07b2bdf9032c870f7f50a9671e8d9fb0a56739a Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 6 Oct 1998 22:03:04 +0000 Subject: dce/rpc (This used to be commit eb279cabd059603b6c8d9b74e4fd31c4ffe87593) --- source3/include/ntdomain.h | 5 ++- source3/include/proto.h | 32 ++++++++++++----- source3/include/rpc_dce.h | 87 ++++++++++++++++++++++++++++++++++------------ 3 files changed, 91 insertions(+), 33 deletions(-) (limited to 'source3/include') diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index 8362dcb73f..5fb7f8a089 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -67,6 +67,7 @@ typedef struct pipes_struct prs_struct rhdr; /* output header */ prs_struct rdata; /* output data */ prs_struct rauth; /* output authentication verifier */ + prs_struct rntlm; /* output ntlmssp */ RPC_HDR hdr; RPC_HDR_BA hdr_ba; @@ -74,7 +75,9 @@ typedef struct pipes_struct RPC_HDR_REQ hdr_req; RPC_HDR_RESP hdr_resp; - RPC_AUTH_NTLMSSP_REQ ntlmssp_req; + RPC_AUTH_VERIFIER auth_verifier; + RPC_AUTH_NTLMSSP_NEG ntlmssp_neg; + RPC_AUTH_NTLMSSP_CHAL ntlmssp_chal; RPC_AUTH_NTLMSSP_RESP ntlmssp_resp; uint32 file_offset; diff --git a/source3/include/proto.h b/source3/include/proto.h index 19aa51a1b7..e5b6c0b08e 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -70,6 +70,11 @@ void charset_initialise(void); void codepage_initialise(int client_codepage); void add_char_string(char *s); +/*The following definitions come from lib/crc32.c */ + +void crc32_build_table(void); +uint32 crc32_calc_buffer( uint32 count, uchar *buffer); + /*The following definitions come from lib/debug.c */ void sig_usr2( int sig ); @@ -1495,7 +1500,7 @@ BOOL prs_uninotstr2(BOOL charmode, char *name, prs_struct *ps, int depth, UNINOT BOOL prs_string2(BOOL charmode, char *name, prs_struct *ps, int depth, STRING2 *str); BOOL prs_unistr2(BOOL charmode, char *name, prs_struct *ps, int depth, UNISTR2 *str); BOOL prs_unistr(char *name, prs_struct *ps, int depth, UNISTR *str); -BOOL prs_string(char *name, prs_struct *ps, int depth, char *str, uint16 len); +BOOL prs_string(char *name, prs_struct *ps, int depth, char *str, uint16 len, uint16 max_buf_size); /*The following definitions come from rpc_parse/parse_reg.c */ @@ -1533,15 +1538,23 @@ void smb_io_rpc_hdr_ba(char *desc, RPC_HDR_BA *rpc, prs_struct *ps, int depth); void make_rpc_hdr_req(RPC_HDR_REQ *hdr, uint32 data_len, uint16 opnum); void smb_io_rpc_hdr_req(char *desc, RPC_HDR_REQ *rpc, prs_struct *ps, int depth); void smb_io_rpc_hdr_resp(char *desc, RPC_HDR_RESP *rpc, prs_struct *ps, int depth); -void make_rpc_auth_ntlmssp_req(RPC_AUTH_NTLMSSP_REQ *req, - fstring ntlmssp_str, uint32 ntlmssp_ver, - uint32 unknown_0, fstring myname, fstring domain); -void smb_io_rpc_auth_ntlmssp_req(char *desc, RPC_AUTH_NTLMSSP_REQ *req, prs_struct *ps, int depth); +void make_rpc_auth_ntlmssp_neg(RPC_AUTH_NTLMSSP_NEG *neg, + uint32 neg_flgs, + fstring myname, fstring domain); +void smb_io_rpc_auth_ntlmssp_neg(char *desc, RPC_AUTH_NTLMSSP_NEG *neg, prs_struct *ps, int depth); +void make_rpc_auth_verifier(RPC_AUTH_VERIFIER *rav, + uint8 auth_type, uint8 auth_level, + uint8 stub_type_len, + char *signature, uint32 msg_type); +void smb_io_rpc_auth_verifier(char *desc, RPC_AUTH_VERIFIER *rav, prs_struct *ps, int depth); +void make_rpc_auth_ntlmssp_chal(RPC_AUTH_NTLMSSP_CHAL *chl, + uint32 neg_flags, + uint8 challenge[8]); +void smb_io_rpc_auth_ntlmssp_chal(char *desc, RPC_AUTH_NTLMSSP_CHAL *chl, prs_struct *ps, int depth); void make_rpc_auth_ntlmssp_resp(RPC_AUTH_NTLMSSP_RESP *rsp, - uint8 auth_type, uint8 auth_level, uint8 stub_type_len, - fstring ntlmssp_str, uint32 ntlmssp_ver, - uint32 unknown_1, uint32 unknown_2, uint32 unknown_3, - uint8 data[16]); + uchar lm_resp[24], uchar nt_resp[24], + char *domain, char *user, char *wks, + uint32 neg_flags); void smb_io_rpc_auth_ntlmssp_resp(char *desc, RPC_AUTH_NTLMSSP_RESP *rsp, prs_struct *ps, int depth); /*The following definitions come from rpc_parse/parse_samr.c */ @@ -2318,6 +2331,7 @@ int smbw_chmod(const char *fname, mode_t newmode); off_t smbw_lseek(int fd, off_t offset, int whence); int smbw_dup(int fd); int smbw_dup2(int fd, int fd2); +int smbw_fork(void); /*The following definitions come from smbwrapper/smbw_dir.c */ diff --git a/source3/include/rpc_dce.h b/source3/include/rpc_dce.h index 2e3995e43d..31964d4f37 100644 --- a/source3/include/rpc_dce.h +++ b/source3/include/rpc_dce.h @@ -41,6 +41,28 @@ enum RPC_PKT_TYPE #define RPC_FLG_FIRST 0x01 #define RPC_FLG_LAST 0x02 +/* NTLMSSP message types */ +enum NTLM_MESSAGE_TYPE +{ + NTLMSSP_NEGOTIATE = 1, + NTLMSSP_CHALLENGE = 2, + NTLMSSP_AUTH = 3, + NTLMSSP_UNKNOWN = 4, +}; + +/* NTLMSSP negotiation flags */ +#define NTLMSSP_NEGOTIATE_UNICODE 0x00000001 +#define NTLMSSP_NEGOTIATE_OEM 0x00000002 +#define NTLMSSP_REQUEST_TARGET 0x00000004 +#define NTLMSSP_NEGOTIATE_SIGN 0x00000010 +#define NTLMSSP_NEGOTIATE_SEAL 0x00000020 +#define NTLMSSP_NEGOTIATE_LM_KEY 0x00000080 +#define NTLMSSP_NEGOTIATE_NTLM 0x00000200 +#define NTLMSSP_NEGOTIATE_ALWAYS_SIGN 0x00008000 +#define NTLMSSP_NEGOTIATE_NTLM2 0x00080000 +#define NTLMSSP_NEGOTIATE_TARGET_INFO 0x00800000 +#define NTLMSSP_NEGOTIATE_128 0x20000000 +#define NTLMSSP_NEGOTIATE_KEY_EXCH 0x40000000 /* RPC_IFACE */ typedef struct rpc_iface_info @@ -161,57 +183,76 @@ typedef struct rpc_hdr_ba_info /* RPC_AUTH_VERIFIER */ typedef struct rpc_auth_verif_info { - fstring ssp_str; - uint32 ssp_ver; + uint8 auth_type; /* 0x0a */ + uint8 auth_level; /* 0x06 */ + uint8 stub_type_len; /* don't know */ + uint8 padding; /* padding */ + + uint32 ptr_0; /* non-zero pointer to something */ + + fstring signature; /* "NTLMSSP" */ + uint32 msg_type; /* NTLMSSP_MESSAGE_TYPE (1,2,3) */ } RPC_AUTH_VERIFIER; /* this is TEMPORARILY coded up as a specific structure */ /* this structure comes after the bind request */ -/* RPC_AUTH_NTLMSSP_REQ */ -typedef struct rpc_auth_ntlmssp_req_info +/* RPC_AUTH_NTLMSSP_NEG */ +typedef struct rpc_auth_ntlmssp_neg_info { - fstring ntlmssp_str; /* "NTLMSSP" */ - uint32 ntlmssp_ver; /* 0x0000 0001 */ + uint32 neg_flgs; /* 0x0000 b2b3 */ - uint32 unknown_0; /* 0x00b2b3 */ STRHDR hdr_myname; /* offset is against START of this structure */ STRHDR hdr_domain; /* offset is against START of this structure */ fstring myname; /* calling workstation's name */ fstring domain; /* calling workstations's domain */ -} RPC_AUTH_NTLMSSP_REQ; +} RPC_AUTH_NTLMSSP_NEG; /* this is TEMPORARILY coded up as a specific structure */ /* this structure comes after the bind acknowledgement */ -/* RPC_AUTH_NTLMSSP_RESP */ -typedef struct rpc_auth_ntlmssp_resp_info +/* RPC_AUTH_NTLMSSP_CHAL */ +typedef struct rpc_auth_ntlmssp_chal_info { - uint8 auth_type; /* 0x0a */ - uint8 auth_level; /* 0x06 */ - uint8 stub_type_len; /* don't know */ - uint8 padding; /* padding */ + uint32 unknown_1; /* 0x0000 0000 */ + uint32 unknown_2; /* 0x0000 0028 */ + uint32 neg_flags; /* 0x0000 82b1 */ - uint32 ptr_0; /* non-zero pointer to something */ + uint8 challenge[8]; /* ntlm challenge */ + uint8 reserved [8]; /* zeros */ - fstring ntlmssp_str; /* "NTLMSSP" */ - uint32 ntlmssp_ver; /* 0x0000 0002 */ +} RPC_AUTH_NTLMSSP_CHAL; - uint32 unknown_1; /* 0x0000 0000 */ - uint32 unknown_2; /* 0x00b2b3 */ - uint32 unknown_3; /* 0x0082b1 */ - uint8 data[16]; /* 0x10 bytes of something */ +/* RPC_AUTH_NTLMSSP_RESP */ +typedef struct rpc_auth_ntlmssp_resp_info +{ + STRHDR hdr_lm_resp; /* 24 byte response */ + STRHDR hdr_nt_resp; /* 24 byte response */ + STRHDR hdr_domain; + UNIHDR hdr_usr; + UNIHDR hdr_wks; + UNIHDR hdr_sess_key; /* NULL unless negotiated */ + uint32 neg_flags; /* 0x0000 82b1 */ + + fstring uni_sess_key; + fstring uni_wks; + fstring uni_usr; + fstring uni_domain; + fstring str_nt_resp; + fstring str_lm_resp; } RPC_AUTH_NTLMSSP_RESP; + /* attached to the end of encrypted rpc requests and responses */ /* RPC_AUTH_NTLMSSP_CHK */ typedef struct rpc_auth_ntlmssp_chk_info { - uint32 ver; /* 0x1 */ - uint8 data[12]; + uint32 ver; /* 0x0000 0001 */ + uint8 crc32[8]; /* checksum using 0xEDB8 8320 as a polynomial */ + uint32 seq_num; } RPC_AUTH_NTLMSSP_CHK; -- cgit From 002a9fe6342c1d62f273634db484ac93db647ca9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 7 Oct 1998 05:58:09 +0000 Subject: - no getdents on OSF1 - try a new method of handling prototype mismatches in wrapped.c. We now try to disable prototypes! (This used to be commit 77aea37bb83f2b9ad541f851b003ca10b9811314) --- source3/include/config.h.in | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 92056f075a..289f06f0a2 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -408,6 +408,9 @@ /* Define if you have the getcwd function. */ #undef HAVE_GETCWD +/* Define if you have the getdents function. */ +#undef HAVE_GETDENTS + /* Define if you have the getgrnam function. */ #undef HAVE_GETGRNAM @@ -654,6 +657,9 @@ /* Define if you have the header file. */ #undef HAVE_SYS_CAPABILITY_H +/* Define if you have the header file. */ +#undef HAVE_SYS_CDEFS_H + /* Define if you have the header file. */ #undef HAVE_SYS_DIR_H -- cgit From d2856b2dab5440e184be8d96807a08ce211f39ab Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 7 Oct 1998 06:15:08 +0000 Subject: test whether seekdir() returns void or not (This used to be commit 4dbfec81b2c67f2d36b26685a631001738d9569f) --- source3/include/config.h.in | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 289f06f0a2..21bad4bc78 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -128,6 +128,7 @@ #undef HAVE_KERNEL_OPLOCKS #undef HAVE_IRIX_SPECIFIC_CAPABILITIES #undef KRB4_AUTH +#undef SEEKDIR_RETURNS_VOID /* The number of bytes in a int. */ #undef SIZEOF_INT -- cgit From d836bedb4035acc61e83f1a0dc76df2c33dfc8af Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 7 Oct 1998 07:55:14 +0000 Subject: more OSF1 changes as well as changes to allow us to use the standard includes.h in wrapped.c, thus making porting much simpler (This used to be commit 6f2239c935fdecfefa89227c113df01e3957691a) --- source3/include/config.h.in | 1 + source3/include/includes.h | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 21bad4bc78..020fe0a7c7 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -129,6 +129,7 @@ #undef HAVE_IRIX_SPECIFIC_CAPABILITIES #undef KRB4_AUTH #undef SEEKDIR_RETURNS_VOID +#undef HAVE_DIRENT_D_OFF /* The number of bytes in a int. */ #undef SIZEOF_INT diff --git a/source3/include/includes.h b/source3/include/includes.h index be41db4d43..c9a5e8b271 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -24,6 +24,20 @@ #ifndef NO_CONFIG_H /* for some tests */ #include "config.h" #endif + +#ifdef NO_PROTO +/* get rid of prototypes for smbwrapper */ +#define _NO_PROTO + +#ifdef HAVE_SYS_CDEFS_H +#include +#ifdef __P +#undef __P +#define __P(x) () +#endif +#endif +#endif + #include "local.h" #ifdef AIX @@ -80,6 +94,12 @@ #include #endif +#ifdef HAVE_SYS_SYSCALL_H +#include +#elif HAVE_SYSCALL_H +#include +#endif + #ifdef HAVE_STRING_H #include #endif @@ -671,4 +691,7 @@ int setresgid(gid_t rgid, gid_t egid, gid_t sgid); #define getpass(prompt) getsmbpass((prompt)) #endif +/* yuck, I'd like a better way of doing this */ +#define DIRP_SIZE (256 + 32) + #endif /* _INCLUDES_H */ -- cgit From 853f923c318fb8f199a0c951492c6c0ba6b4ae3f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 7 Oct 1998 08:12:04 +0000 Subject: detect __sys_llseek() (This used to be commit 2a25034b033d207b5ce50946f3d9c9fad2c3a153) --- source3/include/config.h.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 020fe0a7c7..0402e0bc67 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -239,6 +239,9 @@ /* Define if you have the __stat64 function. */ #undef HAVE___STAT64 +/* Define if you have the __sys_llseek function. */ +#undef HAVE___SYS_LLSEEK + /* Define if you have the __telldir function. */ #undef HAVE___TELLDIR @@ -734,8 +737,8 @@ /* Define if you have the header file. */ #undef HAVE_SYS_WAIT_H -/* Define if you have the header file. */ -#undef HAVE_SYSACLL_H +/* Define if you have the header file. */ +#undef HAVE_SYSCALL_H /* Define if you have the header file. */ #undef HAVE_TERMIOS_H -- cgit From 829e72fe9c97feaa3d45b768984a4c47b906a23a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 7 Oct 1998 09:57:22 +0000 Subject: yet another attempt at making this stuff portable. This time I use minimal includes in wrapped.c (This used to be commit fd6a59d8ca0932d61a60b74485841001d4f8fd44) --- source3/include/includes.h | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index c9a5e8b271..2c4c09f675 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -25,19 +25,6 @@ #include "config.h" #endif -#ifdef NO_PROTO -/* get rid of prototypes for smbwrapper */ -#define _NO_PROTO - -#ifdef HAVE_SYS_CDEFS_H -#include -#ifdef __P -#undef __P -#define __P(x) () -#endif -#endif -#endif - #include "local.h" #ifdef AIX -- cgit From 5e9ffa9959413f2c65f21f65d39b3687cd2e54c8 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 7 Oct 1998 10:08:08 +0000 Subject: remoevd a misplaced comma (This used to be commit c1d2d4e27125cbd463f520d1109e7c7988b58222) --- source3/include/rpc_dce.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/rpc_dce.h b/source3/include/rpc_dce.h index 31964d4f37..4362b40cd2 100644 --- a/source3/include/rpc_dce.h +++ b/source3/include/rpc_dce.h @@ -47,7 +47,7 @@ enum NTLM_MESSAGE_TYPE NTLMSSP_NEGOTIATE = 1, NTLMSSP_CHALLENGE = 2, NTLMSSP_AUTH = 3, - NTLMSSP_UNKNOWN = 4, + NTLMSSP_UNKNOWN = 4 }; /* NTLMSSP negotiation flags */ -- cgit From 8ed7427c1b2dfd021c6b4b93935f9fbbe7dffe0e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 7 Oct 1998 10:37:09 +0000 Subject: more solaris acl fixes (This used to be commit 1ad5bc381ab00f0699f025cb64db7cb4fa102c13) --- source3/include/includes.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 2c4c09f675..fdfd1d3d37 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -224,6 +224,10 @@ #include #endif +#ifdef HAVE_SYS_ACL_H +#include +#endif + #ifdef HAVE_SYS_FS_S5PARAM_H #include #endif -- cgit From 2fef8f2e87f61043e3f1a2cf7d1f2a4ff9f119ff Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 7 Oct 1998 15:22:49 +0000 Subject: dce/rpc (This used to be commit 34afa638f6f7bb145ec094510ac58f7a22dfc3aa) --- source3/include/proto.h | 3 +++ source3/include/rpc_dce.h | 22 ++++++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index e5b6c0b08e..7492cb7615 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1489,6 +1489,7 @@ void prs_init(prs_struct *ps, uint32 size, uint8 align, uint32 margin, BOOL io); void prs_mem_free(prs_struct *ps); +void prs_link(prs_struct *ps, prs_struct const *const to); void prs_align(prs_struct *ps); BOOL prs_grow(prs_struct *ps); BOOL prs_uint8(char *name, prs_struct *ps, int depth, uint8 *data8); @@ -1827,6 +1828,7 @@ void reset_chain_p(void); void init_rpc_pipe_hnd(void); pipes_struct *open_rpc_pipe_p(char *pipe_name, connection_struct *conn, uint16 vuid); +int write_pipe(pipes_struct *p, char *data, int n); int read_pipe(pipes_struct *p, char *data, uint32 pos, int n); BOOL set_rpc_pipe_hnd_state(pipes_struct *p, uint16 device_state); BOOL close_rpc_pipe_hnd(pipes_struct *p, connection_struct *conn); @@ -2160,6 +2162,7 @@ BOOL domain_client_validate( char *user, char *domain, int reply_open_pipe_and_X(connection_struct *conn, char *inbuf,char *outbuf,int length,int bufsize); +int reply_pipe_write_and_X(char *inbuf,char *outbuf,int length,int bufsize); int reply_pipe_read_and_X(char *inbuf,char *outbuf,int length,int bufsize); int reply_pipe_close(connection_struct *conn, char *inbuf,char *outbuf); diff --git a/source3/include/rpc_dce.h b/source3/include/rpc_dce.h index 4362b40cd2..a599abb19c 100644 --- a/source3/include/rpc_dce.h +++ b/source3/include/rpc_dce.h @@ -47,7 +47,7 @@ enum NTLM_MESSAGE_TYPE NTLMSSP_NEGOTIATE = 1, NTLMSSP_CHALLENGE = 2, NTLMSSP_AUTH = 3, - NTLMSSP_UNKNOWN = 4 + NTLMSSP_UNKNOWN = 4, }; /* NTLMSSP negotiation flags */ @@ -220,7 +220,9 @@ typedef struct rpc_auth_ntlmssp_chal_info uint32 neg_flags; /* 0x0000 82b1 */ uint8 challenge[8]; /* ntlm challenge */ +#if 0 uint8 reserved [8]; /* zeros */ +#endif } RPC_AUTH_NTLMSSP_CHAL; @@ -231,17 +233,17 @@ typedef struct rpc_auth_ntlmssp_resp_info STRHDR hdr_lm_resp; /* 24 byte response */ STRHDR hdr_nt_resp; /* 24 byte response */ STRHDR hdr_domain; - UNIHDR hdr_usr; - UNIHDR hdr_wks; - UNIHDR hdr_sess_key; /* NULL unless negotiated */ + STRHDR hdr_usr; + STRHDR hdr_wks; + STRHDR hdr_sess_key; /* NULL unless negotiated */ uint32 neg_flags; /* 0x0000 82b1 */ - fstring uni_sess_key; - fstring uni_wks; - fstring uni_usr; - fstring uni_domain; - fstring str_nt_resp; - fstring str_lm_resp; + fstring sess_key; + fstring wks; + fstring user; + fstring domain; + fstring nt_resp; + fstring lm_resp; } RPC_AUTH_NTLMSSP_RESP; -- cgit From eb37144cadd7b0a27e8f723111bac2f5af8476b5 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 7 Oct 1998 15:24:48 +0000 Subject: make proto required (This used to be commit cf4e2a601fe6b6c9980da87d51643b726c0de1dd) --- source3/include/proto.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 7492cb7615..f7fb2a47c1 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2335,6 +2335,11 @@ off_t smbw_lseek(int fd, off_t offset, int whence); int smbw_dup(int fd); int smbw_dup2(int fd, int fd2); int smbw_fork(void); +int smbw_acl(const char *pathp, int cmd, int nentries, aclent_t *aclbufp); +int smbw_facl(int fd, int cmd, int nentries, aclent_t *aclbufp); +void stat64_convert(struct stat *st, struct stat64 *st64); +void dirent64_convert(struct dirent *d, struct dirent64 *d64); +void xstat_convert(int vers, struct stat *st, struct kernel_stat *kbuf); /*The following definitions come from smbwrapper/smbw_dir.c */ -- cgit From cf115a77d038dbd357cf476a6042f1bd5eb1e392 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 7 Oct 1998 16:49:32 +0000 Subject: added aclent_t autoconf test (defines as an int if it doesn't exist). this is to stop a compilation error caused by make proto putting functions that are wrapped in #if HAVE_ACLxxx code. maybe a better fix would be to have mkproto.awk exclude any functions wrapped in #if HAVEs that don't exist. (This used to be commit 361c1b7ea994cc25d460ebd25b2ad9025f90848c) --- source3/include/config.h.in | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 0402e0bc67..1018e17b35 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -67,6 +67,7 @@ #undef ssize_t #undef loff_t #undef offset_t +#undef aclent_t #undef HAVE_CONNECT #undef HAVE_SHORT_INO_T #undef WITH_AFS -- cgit From 48b31ae44fb2a1961bd738b0b3e7a986259168a2 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 7 Oct 1998 21:42:24 +0000 Subject: dce/rpc (This used to be commit 6677b888bdb45df00646eb7cc13005b9465ff971) --- source3/include/ntdomain.h | 6 ++++++ source3/include/proto.h | 17 ++++++++++++++--- source3/include/rpc_dce.h | 40 +++++++++++++++++++++++++++++----------- 3 files changed, 49 insertions(+), 14 deletions(-) (limited to 'source3/include') diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index 5fb7f8a089..261cc3dfe3 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -67,6 +67,7 @@ typedef struct pipes_struct prs_struct rhdr; /* output header */ prs_struct rdata; /* output data */ prs_struct rauth; /* output authentication verifier */ + prs_struct rverf; /* output verifier */ prs_struct rntlm; /* output ntlmssp */ RPC_HDR hdr; @@ -74,12 +75,17 @@ typedef struct pipes_struct RPC_HDR_RB hdr_rb; RPC_HDR_REQ hdr_req; RPC_HDR_RESP hdr_resp; + RPC_HDR_AUTH auth_info; + RPC_HDR_AUTHA autha_info; RPC_AUTH_VERIFIER auth_verifier; RPC_AUTH_NTLMSSP_NEG ntlmssp_neg; RPC_AUTH_NTLMSSP_CHAL ntlmssp_chal; RPC_AUTH_NTLMSSP_RESP ntlmssp_resp; + BOOL ntlmssp_auth; + unsigned char ntlmssp_hash[256]; + uint32 file_offset; uint32 hdr_offsets; uint32 frag_len_left; diff --git a/source3/include/proto.h b/source3/include/proto.h index f7fb2a47c1..64d586f6c0 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -496,6 +496,8 @@ void E_old_pw_hash( unsigned char *p14, unsigned char *in, unsigned char *out); void cred_hash1(unsigned char *out,unsigned char *in,unsigned char *key); void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key); void cred_hash3(unsigned char *out,unsigned char *in,unsigned char *key, int forw); +void NTLMSSPhash( unsigned char hash[256], unsigned char const key[5]); +void NTLMSSPcalc( unsigned char hash[256], unsigned char *data, int len); void SamOEMhash( unsigned char *data, unsigned char *key, int val); /*The following definitions come from libsmb/smbencrypt.c */ @@ -504,6 +506,7 @@ void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24); void E_md4hash(uchar *passwd, uchar *p16); void nt_lm_owf_gen(char *pwd, uchar nt_p16[16], uchar p16[16]); void SMBOWFencrypt(uchar passwd[16], uchar *c8, uchar p24[24]); +void NTLMSSPOWFencrypt(uchar passwd[8], uchar *ntlmchalresp, uchar p24[24]); void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); /*The following definitions come from libsmb/smberr.c */ @@ -1489,7 +1492,7 @@ void prs_init(prs_struct *ps, uint32 size, uint8 align, uint32 margin, BOOL io); void prs_mem_free(prs_struct *ps); -void prs_link(prs_struct *ps, prs_struct const *const to); +void prs_link(prs_struct *prev, prs_struct *ps, prs_struct *next); void prs_align(prs_struct *ps); BOOL prs_grow(prs_struct *ps); BOOL prs_uint8(char *name, prs_struct *ps, int depth, uint8 *data8); @@ -1539,13 +1542,20 @@ void smb_io_rpc_hdr_ba(char *desc, RPC_HDR_BA *rpc, prs_struct *ps, int depth); void make_rpc_hdr_req(RPC_HDR_REQ *hdr, uint32 data_len, uint16 opnum); void smb_io_rpc_hdr_req(char *desc, RPC_HDR_REQ *rpc, prs_struct *ps, int depth); void smb_io_rpc_hdr_resp(char *desc, RPC_HDR_RESP *rpc, prs_struct *ps, int depth); +void make_rpc_hdr_autha(RPC_HDR_AUTHA *rai, + uint16 max_tsize, uint16 max_rsize, + uint8 auth_type, uint8 auth_level, + uint8 stub_type_len); +void smb_io_rpc_hdr_autha(char *desc, RPC_HDR_AUTHA *rai, prs_struct *ps, int depth); +void make_rpc_hdr_auth(RPC_HDR_AUTH *rai, + uint8 auth_type, uint8 auth_level, + uint8 stub_type_len); +void smb_io_rpc_hdr_auth(char *desc, RPC_HDR_AUTH *rai, prs_struct *ps, int depth); void make_rpc_auth_ntlmssp_neg(RPC_AUTH_NTLMSSP_NEG *neg, uint32 neg_flgs, fstring myname, fstring domain); void smb_io_rpc_auth_ntlmssp_neg(char *desc, RPC_AUTH_NTLMSSP_NEG *neg, prs_struct *ps, int depth); void make_rpc_auth_verifier(RPC_AUTH_VERIFIER *rav, - uint8 auth_type, uint8 auth_level, - uint8 stub_type_len, char *signature, uint32 msg_type); void smb_io_rpc_auth_verifier(char *desc, RPC_AUTH_VERIFIER *rav, prs_struct *ps, int depth); void make_rpc_auth_ntlmssp_chal(RPC_AUTH_NTLMSSP_CHAL *chl, @@ -1852,6 +1862,7 @@ BOOL api_srvsvc_rpc(pipes_struct *p, prs_struct *data); int make_dom_gids(char *gids_str, DOM_GID **ppgids); BOOL create_rpc_reply(pipes_struct *p, uint32 data_start, uint32 data_end); +BOOL rpc_command(pipes_struct *p, prs_struct *pd); BOOL api_rpcTNP(pipes_struct *p, char *rpc_name, struct api_struct *api_rpc_cmds, prs_struct *data); void get_domain_user_groups(char *domain_groups, char *user); diff --git a/source3/include/rpc_dce.h b/source3/include/rpc_dce.h index a599abb19c..51a7631c4e 100644 --- a/source3/include/rpc_dce.h +++ b/source3/include/rpc_dce.h @@ -34,7 +34,8 @@ enum RPC_PKT_TYPE RPC_REQUEST = 0x00, RPC_RESPONSE = 0x02, RPC_BIND = 0x0B, - RPC_BINDACK = 0x0C + RPC_BINDACK = 0x0C, + RPC_BINDRESP = 0x10 /* not the real name! this is undocumented! */ }; /* DCE/RPC flags */ @@ -140,6 +141,33 @@ typedef struct rpc_hdr_bba_info } RPC_HDR_BBA; +/* RPC_HDR_AUTHA */ +typedef struct rpc_hdr_autha_info +{ + uint16 max_tsize; /* maximum transmission fragment size (0x1630) */ + uint16 max_rsize; /* max receive fragment size (0x1630) */ + + uint8 auth_type; /* 0x0a */ + uint8 auth_level; /* 0x06 */ + uint8 stub_type_len; /* don't know */ + uint8 padding; /* padding */ + + uint32 unknown; /* 0x0014a0c0 */ + +} RPC_HDR_AUTHA; + +/* RPC_HDR_AUTH */ +typedef struct rpc_hdr_auth_info +{ + uint8 auth_type; /* 0x0a */ + uint8 auth_level; /* 0x06 */ + uint8 stub_type_len; /* don't know */ + uint8 padding; /* padding */ + + uint32 unknown; /* 0x0014a0c0 */ + +} RPC_HDR_AUTH; + /* RPC_BIND_REQ - ms req bind */ typedef struct rpc_bind_req_info { @@ -179,17 +207,9 @@ typedef struct rpc_hdr_ba_info } RPC_HDR_BA; -/* this is TEMPORARY */ /* RPC_AUTH_VERIFIER */ typedef struct rpc_auth_verif_info { - uint8 auth_type; /* 0x0a */ - uint8 auth_level; /* 0x06 */ - uint8 stub_type_len; /* don't know */ - uint8 padding; /* padding */ - - uint32 ptr_0; /* non-zero pointer to something */ - fstring signature; /* "NTLMSSP" */ uint32 msg_type; /* NTLMSSP_MESSAGE_TYPE (1,2,3) */ @@ -220,9 +240,7 @@ typedef struct rpc_auth_ntlmssp_chal_info uint32 neg_flags; /* 0x0000 82b1 */ uint8 challenge[8]; /* ntlm challenge */ -#if 0 uint8 reserved [8]; /* zeros */ -#endif } RPC_AUTH_NTLMSSP_CHAL; -- cgit From 08e890aee6675452138de61b713837b83c4e6ca5 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 8 Oct 1998 00:02:43 +0000 Subject: removed lukes acl check in configure (not needed) (This used to be commit a3339c111de9f82b6badaac8e6ef430d277c3afa) --- source3/include/proto.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 64d586f6c0..07392239fa 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2346,11 +2346,6 @@ off_t smbw_lseek(int fd, off_t offset, int whence); int smbw_dup(int fd); int smbw_dup2(int fd, int fd2); int smbw_fork(void); -int smbw_acl(const char *pathp, int cmd, int nentries, aclent_t *aclbufp); -int smbw_facl(int fd, int cmd, int nentries, aclent_t *aclbufp); -void stat64_convert(struct stat *st, struct stat64 *st64); -void dirent64_convert(struct dirent *d, struct dirent64 *d64); -void xstat_convert(int vers, struct stat *st, struct kernel_stat *kbuf); /*The following definitions come from smbwrapper/smbw_dir.c */ -- cgit From 4750ce1760a39100f71e74ce8b88a925fef4c42f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 8 Oct 1998 02:28:21 +0000 Subject: use 1 second resolution calls if possible (This used to be commit 349469221a84658048790d7567b4fcea43c0b759) --- source3/include/proto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 07392239fa..062fe35264 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -400,9 +400,9 @@ BOOL cli_setatr(struct cli_state *cli, char *fname, int attr, time_t t); BOOL cli_qpathinfo(struct cli_state *cli, const char *fname, time_t *c_time, time_t *a_time, time_t *m_time, size_t *size, uint32 *mode); -BOOL cli_qpathinfo2(struct cli_state *cli, char *fname, +BOOL cli_qpathinfo2(struct cli_state *cli, const char *fname, time_t *c_time, time_t *a_time, time_t *m_time, - time_t *w_time, uint32 *size); + time_t *w_time, size_t *size, uint32 *mode); BOOL cli_qfileinfo(struct cli_state *cli, int fnum, uint32 *mode, size_t *size, time_t *c_time, time_t *a_time, time_t *m_time); -- cgit From 2475668af84129bf308c1b603ed30755b89194ca Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 8 Oct 1998 04:57:59 +0000 Subject: removed extra comma (some compilers don't like it). Luke, I fixed this yesterday as well! grumble. (This used to be commit da5234faa0373f5b913a135b2557f2ca9e30111c) --- source3/include/rpc_dce.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/rpc_dce.h b/source3/include/rpc_dce.h index 51a7631c4e..fe5f809f0d 100644 --- a/source3/include/rpc_dce.h +++ b/source3/include/rpc_dce.h @@ -48,7 +48,7 @@ enum NTLM_MESSAGE_TYPE NTLMSSP_NEGOTIATE = 1, NTLMSSP_CHALLENGE = 2, NTLMSSP_AUTH = 3, - NTLMSSP_UNKNOWN = 4, + NTLMSSP_UNKNOWN = 4 }; /* NTLMSSP negotiation flags */ -- cgit From 788263ba2f749c5bb1546ca6c9363fd508e94280 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 8 Oct 1998 06:21:33 +0000 Subject: - fixed a bunch of warnings and minor errors - got smbtorture to compile - removed %D from some of lukes code - Luke, what is %D? it ain't portable anyway (This used to be commit 91597c12fb593f49b23c7cea5b64dbb89a0428b3) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 062fe35264..1c31c1076b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -454,7 +454,7 @@ FILE *startlmhosts(char *fname); BOOL getlmhostsent( FILE *fp, char *name, int *name_type, struct in_addr *ipaddr); void endlmhosts(FILE *fp); BOOL resolve_name(char *name, struct in_addr *return_ip, int name_type); -BOOL find_master(char *group, struct in_addr *master_ip); +BOOL find_master_ip(char *group, struct in_addr *master_ip); /*The following definitions come from libsmb/nmblib.c */ -- cgit From 6909350ed9b87875ee40191b2e636c6049749195 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 8 Oct 1998 23:57:46 +0000 Subject: dce/rpc (This used to be commit 62fdeef1b79c5c4c9bf0e860881651711bb80b9a) --- source3/include/client.h | 101 ++++++++++++++++++++++++---------------------- source3/include/proto.h | 13 ++++-- source3/include/rpc_dce.h | 9 ++++- 3 files changed, 70 insertions(+), 53 deletions(-) (limited to 'source3/include') diff --git a/source3/include/client.h b/source3/include/client.h index 495780cbaa..44ac147665 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -72,54 +72,59 @@ struct pwd_info }; struct cli_state { - int fd; - uint16 cnum; - uint16 pid; - uint16 mid; - uint16 vuid; - int protocol; - int sec_mode; - int rap_error; - int privilages; - - fstring eff_name; - fstring desthost; - fstring user_name; - fstring domain; - - fstring share; - fstring dev; - struct nmb_name called; - struct nmb_name calling; - fstring full_dest_host_name; - struct in_addr dest_ip; - - struct pwd_info pwd; - unsigned char cryptkey[8]; - uint32 sesskey; - int serverzone; - uint32 servertime; - int readbraw_supported; - int writebraw_supported; - int timeout; - int max_xmit; - int max_mux; - char *outbuf; - char *inbuf; - int bufsize; - int initialised; - int win95; - uint32 capabilities; - /* - * Only used in NT domain calls. - */ - uint32 nt_error; /* NT RPC error code. */ - uint16 nt_pipe_fnum; /* Pipe handle. */ - unsigned char sess_key[16]; /* Current session key. */ - DOM_CRED clnt_cred; /* Client credential. */ - fstring mach_acct; /* MYNAME$. */ - fstring srv_name_slash; /* \\remote server. */ - fstring clnt_name_slash; /* \\local client. */ + int fd; + uint16 cnum; + uint16 pid; + uint16 mid; + uint16 vuid; + int protocol; + int sec_mode; + int rap_error; + int privilages; + + fstring eff_name; + fstring desthost; + fstring user_name; + fstring domain; + + fstring share; + fstring dev; + struct nmb_name called; + struct nmb_name calling; + fstring full_dest_host_name; + struct in_addr dest_ip; + + struct pwd_info pwd; + unsigned char cryptkey[8]; + uint32 sesskey; + int serverzone; + uint32 servertime; + int readbraw_supported; + int writebraw_supported; + int timeout; + int max_xmit; + int max_mux; + char *outbuf; + char *inbuf; + int bufsize; + int initialised; + int win95; + uint32 capabilities; + + /* + * Only used in NT domain calls. + */ + + uint32 nt_error; /* NT RPC error code. */ + uint16 nt_pipe_fnum; /* Pipe handle. */ + unsigned char sess_key[16]; /* Current session key. */ + unsigned char ntlmssp_hash[256]; /* ntlmssp data. */ + uint32 ntlmssp_cli_flgs; /* ntlmssp client flags */ + uint32 ntlmssp_srv_flgs; /* ntlmssp server flags */ + DOM_CRED clnt_cred; /* Client credential. */ + fstring mach_acct; /* MYNAME$. */ + fstring srv_name_slash; /* \\remote server. */ + fstring clnt_name_slash; /* \\local client. */ }; #endif /* _CLIENT_H */ diff --git a/source3/include/proto.h b/source3/include/proto.h index 1c31c1076b..4cf63d2797 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -390,7 +390,9 @@ BOOL cli_close(struct cli_state *cli, int fnum); BOOL cli_lock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout); BOOL cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout); size_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_t size); -size_t cli_write(struct cli_state *cli, int fnum, char *buf, off_t offset, size_t size); +size_t cli_write(struct cli_state *cli, + int fnum, uint16 write_mode, + char *buf, off_t offset, size_t size); BOOL cli_getattrE(struct cli_state *cli, int fd, uint32 *attr, size_t *size, time_t *c_time, time_t *a_time, time_t *m_time); @@ -1551,13 +1553,13 @@ void make_rpc_hdr_auth(RPC_HDR_AUTH *rai, uint8 auth_type, uint8 auth_level, uint8 stub_type_len); void smb_io_rpc_hdr_auth(char *desc, RPC_HDR_AUTH *rai, prs_struct *ps, int depth); +void make_rpc_auth_verifier(RPC_AUTH_VERIFIER *rav, + char *signature, uint32 msg_type); +void smb_io_rpc_auth_verifier(char *desc, RPC_AUTH_VERIFIER *rav, prs_struct *ps, int depth); void make_rpc_auth_ntlmssp_neg(RPC_AUTH_NTLMSSP_NEG *neg, uint32 neg_flgs, fstring myname, fstring domain); void smb_io_rpc_auth_ntlmssp_neg(char *desc, RPC_AUTH_NTLMSSP_NEG *neg, prs_struct *ps, int depth); -void make_rpc_auth_verifier(RPC_AUTH_VERIFIER *rav, - char *signature, uint32 msg_type); -void smb_io_rpc_auth_verifier(char *desc, RPC_AUTH_VERIFIER *rav, prs_struct *ps, int depth); void make_rpc_auth_ntlmssp_chal(RPC_AUTH_NTLMSSP_CHAL *chl, uint32 neg_flags, uint8 challenge[8]); @@ -1567,6 +1569,9 @@ void make_rpc_auth_ntlmssp_resp(RPC_AUTH_NTLMSSP_RESP *rsp, char *domain, char *user, char *wks, uint32 neg_flags); void smb_io_rpc_auth_ntlmssp_resp(char *desc, RPC_AUTH_NTLMSSP_RESP *rsp, prs_struct *ps, int depth); +void make_rpc_auth_ntlmssp_chk(RPC_AUTH_NTLMSSP_CHK *chk, + uint32 ver, uint32 crc32, uint32 seq_num); +void smb_io_rpc_auth_ntlmssp_chk(char *desc, RPC_AUTH_NTLMSSP_CHK *chk, prs_struct *ps, int depth); /*The following definitions come from rpc_parse/parse_samr.c */ diff --git a/source3/include/rpc_dce.h b/source3/include/rpc_dce.h index fe5f809f0d..982ec1f52b 100644 --- a/source3/include/rpc_dce.h +++ b/source3/include/rpc_dce.h @@ -59,12 +59,18 @@ enum NTLM_MESSAGE_TYPE #define NTLMSSP_NEGOTIATE_SEAL 0x00000020 #define NTLMSSP_NEGOTIATE_LM_KEY 0x00000080 #define NTLMSSP_NEGOTIATE_NTLM 0x00000200 +#define NTLMSSP_NEGOTIATE_00001000 0x00001000 +#define NTLMSSP_NEGOTIATE_00002000 0x00002000 #define NTLMSSP_NEGOTIATE_ALWAYS_SIGN 0x00008000 #define NTLMSSP_NEGOTIATE_NTLM2 0x00080000 #define NTLMSSP_NEGOTIATE_TARGET_INFO 0x00800000 #define NTLMSSP_NEGOTIATE_128 0x20000000 #define NTLMSSP_NEGOTIATE_KEY_EXCH 0x40000000 +/* NTLMSSP signature version */ +#define NTLMSSP_SIGN_VERSION 0x01 + + /* RPC_IFACE */ typedef struct rpc_iface_info { @@ -271,7 +277,8 @@ typedef struct rpc_auth_ntlmssp_resp_info typedef struct rpc_auth_ntlmssp_chk_info { uint32 ver; /* 0x0000 0001 */ - uint8 crc32[8]; /* checksum using 0xEDB8 8320 as a polynomial */ + uint32 reserved; + uint32 crc32; /* checksum using 0xEDB8 8320 as a polynomial */ uint32 seq_num; } RPC_AUTH_NTLMSSP_CHK; -- cgit From 755986764f5a6b0ec25c7f20fde0a80eb4d121ba Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 9 Oct 1998 19:05:19 +0000 Subject: dce/rpc (This used to be commit 32d0f5e4a564686ad6b270dd24423ee49a81f223) --- source3/include/client.h | 2 +- source3/include/ntdomain.h | 2 +- source3/include/proto.h | 3 ++- source3/include/rpc_samr.h | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/client.h b/source3/include/client.h index 44ac147665..0da4b40c18 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -118,7 +118,7 @@ struct cli_state { uint32 nt_error; /* NT RPC error code. */ uint16 nt_pipe_fnum; /* Pipe handle. */ unsigned char sess_key[16]; /* Current session key. */ - unsigned char ntlmssp_hash[256]; /* ntlmssp data. */ + unsigned char ntlmssp_hash[258]; /* ntlmssp data. */ uint32 ntlmssp_cli_flgs; /* ntlmssp client flags */ uint32 ntlmssp_srv_flgs; /* ntlmssp server flags */ DOM_CRED clnt_cred; /* Client credential. */ diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index 261cc3dfe3..c2a4170595 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -84,7 +84,7 @@ typedef struct pipes_struct RPC_AUTH_NTLMSSP_RESP ntlmssp_resp; BOOL ntlmssp_auth; - unsigned char ntlmssp_hash[256]; + unsigned char ntlmssp_hash[258]; uint32 file_offset; uint32 hdr_offsets; diff --git a/source3/include/proto.h b/source3/include/proto.h index 4cf63d2797..b0c50cbca7 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1269,6 +1269,7 @@ BOOL get_samr_query_userinfo(struct cli_state *cli, POLICY_HND *pol_open_domain, uint32 info_level, uint32 user_rid, SAM_USER_INFO_21 *usr); +BOOL do_samr_unknown_38(struct cli_state *cli, char *srv_name); BOOL do_samr_unknown_8(struct cli_state *cli, POLICY_HND *domain_pol, uint16 switch_value); BOOL do_samr_enum_dom_users(struct cli_state *cli, @@ -1541,7 +1542,7 @@ void make_rpc_hdr_ba(RPC_HDR_BA *rpc, uint8 num_results, uint16 result, uint16 reason, RPC_IFACE *transfer); void smb_io_rpc_hdr_ba(char *desc, RPC_HDR_BA *rpc, prs_struct *ps, int depth); -void make_rpc_hdr_req(RPC_HDR_REQ *hdr, uint32 data_len, uint16 opnum); +void make_rpc_hdr_req(RPC_HDR_REQ *hdr, uint32 alloc_hint, uint16 opnum); void smb_io_rpc_hdr_req(char *desc, RPC_HDR_REQ *rpc, prs_struct *ps, int depth); void smb_io_rpc_hdr_resp(char *desc, RPC_HDR_RESP *rpc, prs_struct *ps, int depth); void make_rpc_hdr_autha(RPC_HDR_AUTHA *rai, diff --git a/source3/include/rpc_samr.h b/source3/include/rpc_samr.h index a314015591..5f1a4bb36e 100644 --- a/source3/include/rpc_samr.h +++ b/source3/include/rpc_samr.h @@ -91,6 +91,7 @@ SamrTestPrivateFunctionsUser #define SAMR_UNKNOWN_21 0x21 #define SAMR_UNKNOWN_32 0x32 #define SAMR_UNKNOWN_34 0x34 +#define SAMR_UNKNOWN_38 0x38 #define SAMR_CONNECT 0x39 #define SAMR_OPEN_ALIAS 0x1b #define SAMR_QUERY_ALIASINFO 0x1c -- cgit From 4e004a0b5e7521a361444f6d67a3c2910c5688c2 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 9 Oct 1998 19:34:57 +0000 Subject: basic client-side ntcreateX function (hard-wired values except filename) (This used to be commit caeb99201a1471bd709b4e8f07c57e5caabf0795) --- source3/include/proto.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index b0c50cbca7..dec428a142 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -385,6 +385,7 @@ BOOL cli_rename(struct cli_state *cli, char *fname_src, char *fname_dst); BOOL cli_unlink(struct cli_state *cli, char *fname); BOOL cli_mkdir(struct cli_state *cli, char *dname); BOOL cli_rmdir(struct cli_state *cli, char *dname); +int cli_nt_create(struct cli_state *cli, char *fname); int cli_open(struct cli_state *cli, char *fname, int flags, int share_mode); BOOL cli_close(struct cli_state *cli, int fnum); BOOL cli_lock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout); @@ -498,8 +499,8 @@ void E_old_pw_hash( unsigned char *p14, unsigned char *in, unsigned char *out); void cred_hash1(unsigned char *out,unsigned char *in,unsigned char *key); void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key); void cred_hash3(unsigned char *out,unsigned char *in,unsigned char *key, int forw); -void NTLMSSPhash( unsigned char hash[256], unsigned char const key[5]); -void NTLMSSPcalc( unsigned char hash[256], unsigned char *data, int len); +void NTLMSSPhash( unsigned char hash[258], unsigned char key[5]); +void NTLMSSPcalc( unsigned char hash[258], unsigned char *data, int len); void SamOEMhash( unsigned char *data, unsigned char *key, int val); /*The following definitions come from libsmb/smbencrypt.c */ -- cgit From abb67ee6deac030c4bc38e166cd3e3ab086ae285 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 9 Oct 1998 20:31:52 +0000 Subject: signed / unsigned issues spotted by herb (This used to be commit 0b90442021aa3adb5ae7f09c53c9e54c7655d8c5) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index dec428a142..2d64d8df45 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -73,7 +73,7 @@ void add_char_string(char *s); /*The following definitions come from lib/crc32.c */ void crc32_build_table(void); -uint32 crc32_calc_buffer( uint32 count, uchar *buffer); +uint32 crc32_calc_buffer( uint32 count, char *buffer); /*The following definitions come from lib/debug.c */ -- cgit From 78c1fd054f25ae2d0fa57669a0db102bc916577c Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 9 Oct 1998 23:31:50 +0000 Subject: dce/rpc (This used to be commit 8a7ac4a25d177235a98c0f84f97ee50432fb6359) --- source3/include/proto.h | 27 ++++++++++++++++++++------- source3/include/rpc_samr.h | 9 +++++---- 2 files changed, 25 insertions(+), 11 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 2d64d8df45..c473aeb38e 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -511,6 +511,7 @@ void nt_lm_owf_gen(char *pwd, uchar nt_p16[16], uchar p16[16]); void SMBOWFencrypt(uchar passwd[16], uchar *c8, uchar p24[24]); void NTLMSSPOWFencrypt(uchar passwd[8], uchar *ntlmchalresp, uchar p24[24]); void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); +BOOL make_oem_passwd_hash(char data[516], char *passwd, char old_pw_hash[16]); /*The following definitions come from libsmb/smberr.c */ @@ -1270,6 +1271,10 @@ BOOL get_samr_query_userinfo(struct cli_state *cli, POLICY_HND *pol_open_domain, uint32 info_level, uint32 user_rid, SAM_USER_INFO_21 *usr); +BOOL do_samr_chgpasswd_user(struct cli_state *cli, + char *srv_name, char *user_name, + char nt_newpass[516], char nt_oldhash[16], + char lm_newpass[516], char lm_oldhash[16]); BOOL do_samr_unknown_38(struct cli_state *cli, char *srv_name); BOOL do_samr_unknown_8(struct cli_state *cli, POLICY_HND *domain_pol, uint16 switch_value); @@ -1709,13 +1714,6 @@ void make_samr_q_open_alias(SAMR_Q_OPEN_ALIAS *q_u, uint32 unknown_0, uint32 rid); void samr_io_q_open_alias(char *desc, SAMR_Q_OPEN_ALIAS *q_u, prs_struct *ps, int depth); void samr_io_r_open_alias(char *desc, SAMR_R_OPEN_ALIAS *r_u, prs_struct *ps, int depth); -void make_samr_q_unknown_38(SAMR_Q_UNKNOWN_38 *q_u, char *srv_name); -void samr_io_q_unknown_38(char *desc, SAMR_Q_UNKNOWN_38 *q_u, prs_struct *ps, int depth); -void make_samr_r_unknown_38(SAMR_R_UNKNOWN_38 *r_u, - uint16 level, uint32 status); -void samr_io_r_unknown_38(char *desc, SAMR_R_UNKNOWN_38 *r_u, prs_struct *ps, int depth); -void samr_io_enc_passwd(char *desc, SAMR_ENC_PASSWD *pwd, prs_struct *ps, int depth); -void samr_io_enc_hash(char *desc, SAMR_ENC_HASH *hsh, prs_struct *ps, int depth); void make_samr_q_unknown_12(SAMR_Q_UNKNOWN_12 *q_u, POLICY_HND *pol, uint32 rid, uint32 num_gids, uint32 *gid); @@ -1723,6 +1721,21 @@ void make_samr_q_unknown_21(SAMR_Q_UNKNOWN_21 *q_c, POLICY_HND *hnd, uint16 unk_1, uint16 unk_2); void make_samr_q_unknown_13(SAMR_Q_UNKNOWN_13 *q_c, POLICY_HND *hnd, uint16 unk_1, uint16 unk_2); +void make_samr_q_unknown_38(SAMR_Q_UNKNOWN_38 *q_u, char *srv_name); +void samr_io_q_unknown_38(char *desc, SAMR_Q_UNKNOWN_38 *q_u, prs_struct *ps, int depth); +void make_samr_r_unknown_38(SAMR_R_UNKNOWN_38 *r_u, + uint16 level, uint32 status); +void samr_io_r_unknown_38(char *desc, SAMR_R_UNKNOWN_38 *r_u, prs_struct *ps, int depth); +void make_enc_passwd(SAMR_ENC_PASSWD *pwd, char pass[512]); +void samr_io_enc_passwd(char *desc, SAMR_ENC_PASSWD *pwd, prs_struct *ps, int depth); +void make_enc_hash(SAMR_ENC_HASH *hsh, char hash[16]); +void samr_io_enc_hash(char *desc, SAMR_ENC_HASH *hsh, prs_struct *ps, int depth); +void make_samr_q_chgpasswd_user(SAMR_Q_CHGPASSWD_USER *q_u, + char *dest_host, char *user_name, + char nt_newpass[516], char nt_oldhash[16], + char lm_newpass[516], char lm_oldhash[16]); +void samr_io_q_chgpasswd_user(char *desc, SAMR_Q_CHGPASSWD_USER *q_u, prs_struct *ps, int depth); +void samr_io_r_chgpasswd_user(char *desc, SAMR_R_CHGPASSWD_USER *r_u, prs_struct *ps, int depth); /*The following definitions come from rpc_parse/parse_srv.c */ diff --git a/source3/include/rpc_samr.h b/source3/include/rpc_samr.h index 5f1a4bb36e..f27dc66381 100644 --- a/source3/include/rpc_samr.h +++ b/source3/include/rpc_samr.h @@ -91,6 +91,7 @@ SamrTestPrivateFunctionsUser #define SAMR_UNKNOWN_21 0x21 #define SAMR_UNKNOWN_32 0x32 #define SAMR_UNKNOWN_34 0x34 +#define SAMR_CHGPASSWD_USER 0x37 #define SAMR_UNKNOWN_38 0x38 #define SAMR_CONNECT 0x39 #define SAMR_OPEN_ALIAS 0x1b @@ -997,8 +998,8 @@ typedef struct q_samr_chgpasswd_user_info { uint32 ptr_0; - UNIHDR hdr_server; /* server name unicode header */ - UNISTR2 uni_server; /* server name unicode string */ + UNIHDR hdr_dest_host; /* server name unicode header */ + UNISTR2 uni_dest_host; /* server name unicode string */ UNIHDR hdr_user_name; /* username unicode string header */ UNISTR2 uni_user_name; /* username unicode string */ @@ -1006,7 +1007,7 @@ typedef struct q_samr_chgpasswd_user_info SAMR_ENC_PASSWD nt_newpass; SAMR_ENC_HASH nt_oldhash; - uint32 unknown_1; /* seems to always contain 0001 */ + uint32 unknown; /* 0x0000 0001 */ SAMR_ENC_PASSWD lm_newpass; SAMR_ENC_HASH lm_oldhash; @@ -1016,7 +1017,7 @@ typedef struct q_samr_chgpasswd_user_info /* SAMR_R_CHGPASSWD_USER */ typedef struct r_samr_chgpasswd_user_info { - uint32 result; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */ + uint32 status; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */ } SAMR_R_CHGPASSWD_USER; -- cgit From 827a9d862ebe3d5ce1853999d16bd121fddcc796 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sat, 10 Oct 1998 00:46:28 +0000 Subject: dce/rpc (This used to be commit dfb48aab6153e53a5efd1f8ee518375cc584b101) --- source3/include/proto.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index c473aeb38e..9e2d4d33b0 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -511,7 +511,7 @@ void nt_lm_owf_gen(char *pwd, uchar nt_p16[16], uchar p16[16]); void SMBOWFencrypt(uchar passwd[16], uchar *c8, uchar p24[24]); void NTLMSSPOWFencrypt(uchar passwd[8], uchar *ntlmchalresp, uchar p24[24]); void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); -BOOL make_oem_passwd_hash(char data[516], char *passwd, char old_pw_hash[16]); +BOOL make_oem_passwd_hash(char data[516], char *passwd, char old_pw_hash[16], BOOL unicode); /*The following definitions come from libsmb/smberr.c */ @@ -1732,8 +1732,8 @@ void make_enc_hash(SAMR_ENC_HASH *hsh, char hash[16]); void samr_io_enc_hash(char *desc, SAMR_ENC_HASH *hsh, prs_struct *ps, int depth); void make_samr_q_chgpasswd_user(SAMR_Q_CHGPASSWD_USER *q_u, char *dest_host, char *user_name, - char nt_newpass[516], char nt_oldhash[16], - char lm_newpass[516], char lm_oldhash[16]); + char lm_newpass[516], char nt_oldhash[16], + char nt_newpass[516], char lm_oldhash[16]); void samr_io_q_chgpasswd_user(char *desc, SAMR_Q_CHGPASSWD_USER *q_u, prs_struct *ps, int depth); void samr_io_r_chgpasswd_user(char *desc, SAMR_R_CHGPASSWD_USER *r_u, prs_struct *ps, int depth); -- cgit From eb70607c864d3d7d03a01fa39c3716a75db2c3db Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Sat, 10 Oct 1998 00:58:12 +0000 Subject: dce/rpc (This used to be commit b0af7cfd9dea8d286f430c51456b5f67d5e0658a) --- source3/include/proto.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 9e2d4d33b0..e594780535 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1732,8 +1732,8 @@ void make_enc_hash(SAMR_ENC_HASH *hsh, char hash[16]); void samr_io_enc_hash(char *desc, SAMR_ENC_HASH *hsh, prs_struct *ps, int depth); void make_samr_q_chgpasswd_user(SAMR_Q_CHGPASSWD_USER *q_u, char *dest_host, char *user_name, - char lm_newpass[516], char nt_oldhash[16], - char nt_newpass[516], char lm_oldhash[16]); + char nt_newpass[516], char nt_oldhash[16], + char lm_newpass[516], char lm_oldhash[16]); void samr_io_q_chgpasswd_user(char *desc, SAMR_Q_CHGPASSWD_USER *q_u, prs_struct *ps, int depth); void samr_io_r_chgpasswd_user(char *desc, SAMR_R_CHGPASSWD_USER *r_u, prs_struct *ps, int depth); @@ -1904,6 +1904,7 @@ void cmd_lsa_lookup_sids(struct client_info *info); /*The following definitions come from rpcclient/cmd_samr.c */ +void cmd_sam_ntchange_pwd(struct client_info *info); void cmd_sam_test(struct client_info *info); void cmd_sam_enum_users(struct client_info *info); void cmd_sam_query_user(struct client_info *info); -- cgit From 935dc98f6670ba630bd2086ef9eddcc94a0562e2 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 14 Oct 1998 06:29:20 +0000 Subject: dce/rpc (This used to be commit 69f5f9f88935de1f63ffc9aa19c0629b395e66e6) --- source3/include/client.h | 1 + source3/include/proto.h | 3 ++- source3/include/rpc_dce.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/client.h b/source3/include/client.h index 0da4b40c18..53674fe80a 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -121,6 +121,7 @@ struct cli_state { unsigned char ntlmssp_hash[258]; /* ntlmssp data. */ uint32 ntlmssp_cli_flgs; /* ntlmssp client flags */ uint32 ntlmssp_srv_flgs; /* ntlmssp server flags */ + uint32 ntlmssp_seq_num; /* ntlmssp sequence number */ DOM_CRED clnt_cred; /* Client credential. */ fstring mach_acct; /* MYNAME$. */ fstring srv_name_slash; /* \\remote server. */ diff --git a/source3/include/proto.h b/source3/include/proto.h index e594780535..8a0ff12ed9 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1558,7 +1558,8 @@ void make_rpc_hdr_autha(RPC_HDR_AUTHA *rai, void smb_io_rpc_hdr_autha(char *desc, RPC_HDR_AUTHA *rai, prs_struct *ps, int depth); void make_rpc_hdr_auth(RPC_HDR_AUTH *rai, uint8 auth_type, uint8 auth_level, - uint8 stub_type_len); + uint8 stub_type_len, + uint32 ptr); void smb_io_rpc_hdr_auth(char *desc, RPC_HDR_AUTH *rai, prs_struct *ps, int depth); void make_rpc_auth_verifier(RPC_AUTH_VERIFIER *rav, char *signature, uint32 msg_type); diff --git a/source3/include/rpc_dce.h b/source3/include/rpc_dce.h index 982ec1f52b..c6499853d6 100644 --- a/source3/include/rpc_dce.h +++ b/source3/include/rpc_dce.h @@ -170,7 +170,7 @@ typedef struct rpc_hdr_auth_info uint8 stub_type_len; /* don't know */ uint8 padding; /* padding */ - uint32 unknown; /* 0x0014a0c0 */ + uint32 unknown; /* pointer */ } RPC_HDR_AUTH; -- cgit From 948f81a5920c5204438e41d4fd41a32948ce7321 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 14 Oct 1998 07:00:00 +0000 Subject: warnings spotted by ./configure.developer options (This used to be commit 29434bf195b438f4ab41a10ac5ce03f9c2d2ac2f) --- source3/include/proto.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 8a0ff12ed9..5e47faf5ef 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -72,7 +72,6 @@ void add_char_string(char *s); /*The following definitions come from lib/crc32.c */ -void crc32_build_table(void); uint32 crc32_calc_buffer( uint32 count, char *buffer); /*The following definitions come from lib/debug.c */ -- cgit From fc7d3e4caa7650c02ef36fff83b64b06050f66b1 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 15 Oct 1998 00:55:17 +0000 Subject: config: Fix crypt prototype on RedHat Linux. include/includes.h: Fix crypt prototype on RedHat Linux. smbd/fileio.c: Fix mmap bug found by WinCE client. smbd/ipc.c: Fix WinCE wierdness with pipes being opened as \server\pipe\lanman smbd/password.c: Fix encrypted null passwords. Jeremy. (This used to be commit 475992730c0ecbf31c09b3518df2f0354cec61da) --- source3/include/config.h.in | 1 + source3/include/includes.h | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'source3/include') diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 1018e17b35..3a897725dc 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -118,6 +118,7 @@ #undef HAVE_FILE_MACRO #undef HAVE_FUNCTION_MACRO #undef HAVE_SETRESUID_DECL +#undef HAVE_CRYPT_DECL #undef HAVE_SETRESUID #undef WITH_NETATALK #undef HAVE_INO64_T diff --git a/source3/include/includes.h b/source3/include/includes.h index fdfd1d3d37..59d43d8a36 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -674,6 +674,11 @@ int setresuid(uid_t ruid, uid_t euid, uid_t suid); int setresgid(gid_t rgid, gid_t egid, gid_t sgid); #endif +#if (defined(HAVE_CRYPT) && !defined(HAVE_CRYPT_DECL)) +/* stupid glibc */ +int crypt(const char *key, const char *salt); +#endif + #if !defined(HAVE_BZERO) && defined(HAVE_MEMSET) #define bzero(a,b) memset((a),'\0',(b)) #endif -- cgit From a42afcdcc7ab9aa9ed193ae36d3dbb10843447f0 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 15 Oct 1998 05:47:29 +0000 Subject: bug-fixing against: AS/U: it returns dce/rpc "first" and "last" bits _clear_ in a bind/ack response, when they should be set in a (small) packet. they also, in the bind/ack do not set a secondary address string at all, so we can't check against that... Win95: client-side dce/rpc code is a bit odd. it does a "WaitNamedPipeState" and has slightly different pipe-naming (\PIPE\LANMAN is joined by \PIPE\SRVSVC, \PIPE\WINREG etc whereas nt just has \PIPE\LANMAN and \PIPE\). Win95-USRMGR.EXE: added LsaOpenPolicy (renamed existing to LsaOpenPolicy2). added SamrConnect (renamed existing to SamrConnect2). (This used to be commit a7fccd807b938cbb51002ebae8c7a48b40dbb655) --- source3/include/client.h | 2 ++ source3/include/ntdomain.h | 1 + source3/include/proto.h | 15 ++++++++++++--- source3/include/rpc_lsa.h | 28 ++++++++++++++++++++++++---- source3/include/rpc_samr.h | 28 ++++++++++++++++++++++++---- 5 files changed, 63 insertions(+), 11 deletions(-) (limited to 'source3/include') diff --git a/source3/include/client.h b/source3/include/client.h index 53674fe80a..a393ee25a8 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -126,6 +126,8 @@ struct cli_state { fstring mach_acct; /* MYNAME$. */ fstring srv_name_slash; /* \\remote server. */ fstring clnt_name_slash; /* \\local client. */ + uint16 max_xmit_frag; + uint16 max_recv_frag; }; #endif /* _CLIENT_H */ diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index c2a4170595..e540bd2ffc 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -61,6 +61,7 @@ typedef struct pipes_struct uint16 vuid; BOOL open; /* open connection */ uint16 device_state; + uint16 priority; fstring name; fstring pipe_srv_name; diff --git a/source3/include/proto.h b/source3/include/proto.h index 5e47faf5ef..411f923ba8 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1339,12 +1339,18 @@ void make_lsa_trans_name(LSA_TRANS_NAME *trn, uint32 sid_name_use, char *name, u void make_lsa_sec_qos(LSA_SEC_QOS *qos, uint16 imp_lev, uint8 ctxt, uint8 eff, uint32 unknown); void make_lsa_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, LSA_SEC_QOS *qos); -void make_q_open_pol(LSA_Q_OPEN_POL *r_q, char *server_name, +void make_q_open_pol(LSA_Q_OPEN_POL *r_q, uint16 system_name, uint32 attributes, uint32 desired_access, LSA_SEC_QOS *qos); void lsa_io_q_open_pol(char *desc, LSA_Q_OPEN_POL *r_q, prs_struct *ps, int depth); void lsa_io_r_open_pol(char *desc, LSA_R_OPEN_POL *r_p, prs_struct *ps, int depth); +void make_q_open_pol2(LSA_Q_OPEN_POL2 *r_q, char *server_name, + uint32 attributes, + uint32 desired_access, + LSA_SEC_QOS *qos); +void lsa_io_q_open_pol2(char *desc, LSA_Q_OPEN_POL2 *r_q, prs_struct *ps, int depth); +void lsa_io_r_open_pol2(char *desc, LSA_R_OPEN_POL2 *r_p, prs_struct *ps, int depth); void make_q_query(LSA_Q_QUERY_INFO *q_q, POLICY_HND *hnd, uint16 info_class); void lsa_io_q_query(char *desc, LSA_Q_QUERY_INFO *q_q, prs_struct *ps, int depth); void lsa_io_q_enum_trust_dom(char *desc, LSA_Q_ENUM_TRUST_DOM *q_e, prs_struct *ps, int depth); @@ -1710,6 +1716,9 @@ void make_samr_q_connect(SAMR_Q_CONNECT *q_u, char *srv_name, uint32 unknown_0); void samr_io_q_connect(char *desc, SAMR_Q_CONNECT *q_u, prs_struct *ps, int depth); void samr_io_r_connect(char *desc, SAMR_R_CONNECT *r_u, prs_struct *ps, int depth); +void make_samr_q_connect_anon(SAMR_Q_CONNECT_ANON *q_u); +void samr_io_q_connect_anon(char *desc, SAMR_Q_CONNECT_ANON *q_u, prs_struct *ps, int depth); +void samr_io_r_connect_anon(char *desc, SAMR_R_CONNECT_ANON *r_u, prs_struct *ps, int depth); void make_samr_q_open_alias(SAMR_Q_OPEN_ALIAS *q_u, uint32 unknown_0, uint32 rid); void samr_io_q_open_alias(char *desc, SAMR_Q_OPEN_ALIAS *q_u, prs_struct *ps, int depth); @@ -1723,8 +1732,7 @@ void make_samr_q_unknown_13(SAMR_Q_UNKNOWN_13 *q_c, POLICY_HND *hnd, uint16 unk_1, uint16 unk_2); void make_samr_q_unknown_38(SAMR_Q_UNKNOWN_38 *q_u, char *srv_name); void samr_io_q_unknown_38(char *desc, SAMR_Q_UNKNOWN_38 *q_u, prs_struct *ps, int depth); -void make_samr_r_unknown_38(SAMR_R_UNKNOWN_38 *r_u, - uint16 level, uint32 status); +void make_samr_r_unknown_38(SAMR_R_UNKNOWN_38 *r_u); void samr_io_r_unknown_38(char *desc, SAMR_R_UNKNOWN_38 *r_u, prs_struct *ps, int depth); void make_enc_passwd(SAMR_ENC_PASSWD *pwd, char pass[512]); void samr_io_enc_passwd(char *desc, SAMR_ENC_PASSWD *pwd, prs_struct *ps, int depth); @@ -1860,6 +1868,7 @@ pipes_struct *open_rpc_pipe_p(char *pipe_name, connection_struct *conn, uint16 vuid); int write_pipe(pipes_struct *p, char *data, int n); int read_pipe(pipes_struct *p, char *data, uint32 pos, int n); +BOOL wait_rpc_pipe_hnd_state(pipes_struct *p, uint16 priority); BOOL set_rpc_pipe_hnd_state(pipes_struct *p, uint16 device_state); BOOL close_rpc_pipe_hnd(pipes_struct *p, connection_struct *conn); pipes_struct *get_rpc_pipe_p(char *buf, int where); diff --git a/source3/include/rpc_lsa.h b/source3/include/rpc_lsa.h index fe4d018dbb..44758936ae 100644 --- a/source3/include/rpc_lsa.h +++ b/source3/include/rpc_lsa.h @@ -39,7 +39,8 @@ enum SID_NAME_USE #define LSA_ENUMTRUSTDOM 0x0d #define LSA_LOOKUPNAMES 0x0e #define LSA_LOOKUPSIDS 0x0f -#define LSA_OPENPOLICY 0x2c +#define LSA_OPENPOLICY 0x06 +#define LSA_OPENPOLICY2 0x2c #define LSA_OPENSECRET 0x1C /* XXXX these are here to get a compile! */ @@ -89,9 +90,9 @@ typedef struct obj_attr_info /* LSA_Q_OPEN_POL - LSA Query Open Policy */ typedef struct lsa_q_open_pol_info { - uint32 ptr; /* undocumented buffer pointer */ - UNISTR2 uni_server_name; /* server name, starting with two '\'s */ - LSA_OBJ_ATTR attr ; /* object attributes */ + uint32 ptr; /* undocumented buffer pointer */ + uint16 system_name; /* 0x5c - system name */ + LSA_OBJ_ATTR attr ; /* object attributes */ uint32 des_access; /* desired access attributes */ @@ -105,6 +106,25 @@ typedef struct lsa_r_open_pol_info } LSA_R_OPEN_POL; +/* LSA_Q_OPEN_POL2 - LSA Query Open Policy */ +typedef struct lsa_q_open_pol2_info +{ + uint32 ptr; /* undocumented buffer pointer */ + UNISTR2 uni_server_name; /* server name, starting with two '\'s */ + LSA_OBJ_ATTR attr ; /* object attributes */ + + uint32 des_access; /* desired access attributes */ + +} LSA_Q_OPEN_POL2; + +/* LSA_R_OPEN_POL2 - response to LSA Open Policy */ +typedef struct lsa_r_open_pol2_info +{ + POLICY_HND pol; /* policy handle */ + uint32 status; /* return code */ + +} LSA_R_OPEN_POL2; + /* LSA_Q_QUERY_INFO - LSA query info policy */ typedef struct lsa_query_info { diff --git a/source3/include/rpc_samr.h b/source3/include/rpc_samr.h index f27dc66381..baae9a3bd9 100644 --- a/source3/include/rpc_samr.h +++ b/source3/include/rpc_samr.h @@ -94,6 +94,7 @@ SamrTestPrivateFunctionsUser #define SAMR_CHGPASSWD_USER 0x37 #define SAMR_UNKNOWN_38 0x38 #define SAMR_CONNECT 0x39 +#define SAMR_CONNECT_ANON 0x00 #define SAMR_OPEN_ALIAS 0x1b #define SAMR_QUERY_ALIASINFO 0x1c #define SAMR_ENUM_DOM_USERS 0x0d @@ -934,12 +935,30 @@ typedef struct q_samr_open_alias_info /* SAMR_R_OPEN_ALIAS - probably an open */ typedef struct r_samr_open_alias_info { - POLICY_HND pol; /* policy handle */ + POLICY_HND pol; /* policy handle */ uint32 status; /* return status */ } SAMR_R_OPEN_ALIAS; +/* SAMR_Q_CONNECT_ANON - probably an open */ +typedef struct q_samr_connect_anon_info +{ + uint32 ptr; /* ptr? */ + uint16 unknown_0; /* 0x005c */ + uint16 unknown_1; /* 0x0001 */ + uint32 unknown_2; /* 0x0000 0020 */ + +} SAMR_Q_CONNECT_ANON; + +/* SAMR_R_CONNECT_ANON - probably an open */ +typedef struct r_samr_connect_anon_info +{ + POLICY_HND connect_pol; /* policy handle */ + uint32 status; /* return status */ + +} SAMR_R_CONNECT_ANON; + /* SAMR_Q_CONNECT - probably an open */ typedef struct q_samr_connect_info { @@ -971,9 +990,10 @@ typedef struct q_samr_unknown_38 /* SAMR_R_UNKNOWN_38 */ typedef struct r_samr_unknown_38 { - LOOKUP_LEVEL level; /* 0x0006 */ - uint32 ptr_0; /* 0x0000 0000 */ - uint32 status; + uint16 unk_0; + uint16 unk_1; + uint16 unk_2; + uint16 unk_3; } SAMR_R_UNKNOWN_38; -- cgit From c404bb775414139a4b07a73f79cf069a083acb26 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 15 Oct 1998 23:51:07 +0000 Subject: rpcclient interactive login (with trust account changing if you are root) cli_session_setup handles null sessions correctly (This used to be commit 60c0f22a4e84703467006dfe1971384a6294a9aa) --- source3/include/proto.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 411f923ba8..09fe5b0873 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1189,6 +1189,7 @@ BOOL trust_password_unlock(void); BOOL trust_password_delete( char *domain, char *name ); BOOL get_trust_account_password( unsigned char *ret_pwd, time_t *pass_last_set_time); BOOL set_trust_account_password( unsigned char *md4_new_pwd); +BOOL trust_get_passwd( unsigned char trust_passwd[16], char *myname, char *domain); /*The following definitions come from printing/pcap.c */ @@ -1452,6 +1453,11 @@ void make_q_srv_pwset(NET_Q_SRV_PWSET *q_s, char *logon_srv, char *acct_name, uint16 sec_chan, char *comp_name, DOM_CRED *cred, char nt_cypher[16]); void net_io_q_srv_pwset(char *desc, NET_Q_SRV_PWSET *q_s, prs_struct *ps, int depth); void net_io_r_srv_pwset(char *desc, NET_R_SRV_PWSET *r_s, prs_struct *ps, int depth); +void make_id_info1(NET_ID_INFO_1 *id, char *domain_name, + uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high, + char *user_name, char *wksta_name, + char sess_key[16], + unsigned char lm_cypher[16], unsigned char nt_cypher[16]); void make_id_info2(NET_ID_INFO_2 *id, char *domain_name, uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high, char *user_name, char *wksta_name, @@ -1911,6 +1917,10 @@ BOOL api_wkssvc_rpc(pipes_struct *p, prs_struct *data); void cmd_lsa_query_info(struct client_info *info); void cmd_lsa_lookup_sids(struct client_info *info); +/*The following definitions come from rpcclient/cmd_netlogon.c */ + +void cmd_netlogon_login_test(struct client_info *info); + /*The following definitions come from rpcclient/cmd_samr.c */ void cmd_sam_ntchange_pwd(struct client_info *info); -- cgit From 070b33489179d07ed76530ad52b828e6e708789d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 16 Oct 1998 00:54:16 +0000 Subject: trans2.h: Added Thursby MAC extension. smbd/trans2.c: Added Thursby MAX extension. libsmb/clientgen.c: Fixed smbtorture lock code. Jeremy. (This used to be commit 514e52e4b4d6c7db7ebe2265e60c77b4f18d11b3) --- source3/include/trans2.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/include') diff --git a/source3/include/trans2.h b/source3/include/trans2.h index 894823602e..634244a193 100644 --- a/source3/include/trans2.h +++ b/source3/include/trans2.h @@ -231,6 +231,12 @@ Byte offset Type name description #define SMB_SET_FILE_ALLOCATION_INFO 0x103 #define SMB_SET_FILE_END_OF_FILE_INFO 0x104 +/* + * Thursby MAC extensions.... + */ + +#define SMB_MAC_QUERY_FS_INFO 0x301 + #define DIRLEN_GUESS (45+MAX(l1_achName,l2_achName)) #endif -- cgit From f3793be1651c055da7cfa58afb817547df766de8 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 16 Oct 1998 06:16:10 +0000 Subject: Re-added code to tell the user how many open files they have. Needed for server diagnosis purposes... Jeremy. (This used to be commit 04d79a9ae515e7259277f9980552f1d61df239f1) --- source3/include/proto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 09fe5b0873..d563db3933 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -351,7 +351,7 @@ char *sid_to_string(pstring sidstr_out, DOM_SID *sid); BOOL string_to_sid(DOM_SID *sidout, char *sidstr); int str_checksum(const char *s); void zero_free(void *p, size_t size); -int set_maxfiles(void); +int set_maxfiles(int requested_max); /*The following definitions come from libsmb/clientgen.c */ @@ -1189,7 +1189,7 @@ BOOL trust_password_unlock(void); BOOL trust_password_delete( char *domain, char *name ); BOOL get_trust_account_password( unsigned char *ret_pwd, time_t *pass_last_set_time); BOOL set_trust_account_password( unsigned char *md4_new_pwd); -BOOL trust_get_passwd( unsigned char trust_passwd[16], char *myname, char *domain); +BOOL trust_get_passwd( unsigned char trust_passwd[16], char *domain, char *myname); /*The following definitions come from printing/pcap.c */ -- cgit From d4a82ea26d5b9501f210a5c441b1ac09c256a187 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 16 Oct 1998 20:07:02 +0000 Subject: rpc client mods (ntlmssp flags) (This used to be commit 16256f86bf451535c7955b8f51a9b88fc33a8e4d) --- source3/include/ntdomain.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index e540bd2ffc..5fb40c5bcc 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -86,6 +86,9 @@ typedef struct pipes_struct BOOL ntlmssp_auth; unsigned char ntlmssp_hash[258]; + fstring user_name; + fstring domain; + fstring wks; uint32 file_offset; uint32 hdr_offsets; -- cgit From 27a819cb54b5c7e9113e914f100c07d9836db7b9 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 16 Oct 1998 20:08:56 +0000 Subject: oops. (This used to be commit ff9e919b713f077e811b702db6ec20897a11d5a0) --- source3/include/proto.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index d563db3933..2a61a05f6d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1259,7 +1259,8 @@ BOOL change_trust_account_password( char *domain, char *remote_machine_list); BOOL rpc_api_pipe_req(struct cli_state *cli, uint8 op_num, prs_struct *data, prs_struct *rdata); -BOOL cli_nt_session_open(struct cli_state *cli, char *pipe_name, BOOL encrypted); +BOOL cli_nt_set_ntlmssp_flgs(struct cli_state *cli, uint32 ntlmssp_flgs); +BOOL cli_nt_session_open(struct cli_state *cli, char *pipe_name); void cli_nt_session_close(struct cli_state *cli); /*The following definitions come from rpc_client/cli_samr.c */ @@ -1872,7 +1873,7 @@ void reset_chain_p(void); void init_rpc_pipe_hnd(void); pipes_struct *open_rpc_pipe_p(char *pipe_name, connection_struct *conn, uint16 vuid); -int write_pipe(pipes_struct *p, char *data, int n); +ssize_t write_pipe(pipes_struct *p, char *data, size_t n); int read_pipe(pipes_struct *p, char *data, uint32 pos, int n); BOOL wait_rpc_pipe_hnd_state(pipes_struct *p, uint16 priority); BOOL set_rpc_pipe_hnd_state(pipes_struct *p, uint16 device_state); @@ -2195,7 +2196,7 @@ void add_session_user(char *user); BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8); BOOL smb_password_ok(struct smb_passwd *smb_pass, uchar lm_pass[24], uchar nt_pass[24]); -BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd); +BOOL password_ok(char *user, char *password, int pwlen, struct passwd *pwd); BOOL user_ok(char *user,int snum); BOOL authorise_login(int snum,char *user,char *password, int pwlen, BOOL *guest,BOOL *force,uint16 vuid); -- cgit From 97f0c9d55014db221fdceaaf07318ae9df9688a1 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 16 Oct 1998 21:36:19 +0000 Subject: made pass_check_smb() available for dce/rpc use. (This used to be commit 95e8a910c5d9ba0ef57669fb1256eaa932e0bb09) --- source3/include/proto.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 2a61a05f6d..63f4d624dc 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1259,7 +1259,7 @@ BOOL change_trust_account_password( char *domain, char *remote_machine_list); BOOL rpc_api_pipe_req(struct cli_state *cli, uint8 op_num, prs_struct *data, prs_struct *rdata); -BOOL cli_nt_set_ntlmssp_flgs(struct cli_state *cli, uint32 ntlmssp_flgs); +void cli_nt_set_ntlmssp_flgs(struct cli_state *cli, uint32 ntlmssp_flgs); BOOL cli_nt_session_open(struct cli_state *cli, char *pipe_name); void cli_nt_session_close(struct cli_state *cli); @@ -2196,6 +2196,9 @@ void add_session_user(char *user); BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8); BOOL smb_password_ok(struct smb_passwd *smb_pass, uchar lm_pass[24], uchar nt_pass[24]); +BOOL pass_check_smb(char *user, char *domain, + char *challenge, char *lm_pwd, char *nt_pwd, + struct passwd *pwd); BOOL password_ok(char *user, char *password, int pwlen, struct passwd *pwd); BOOL user_ok(char *user,int snum); BOOL authorise_login(int snum,char *user,char *password, int pwlen, -- cgit From a785f8d2c90f3db579c781ca5f722cb5b695fcb4 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 16 Oct 1998 23:40:59 +0000 Subject: dce/rpc (This used to be commit 29434f496c18e816d864060d68f357aea6ef5de8) --- source3/include/ntdomain.h | 1 + source3/include/proto.h | 1 + source3/include/smb.h | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index 5fb40c5bcc..07d32519bf 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -85,6 +85,7 @@ typedef struct pipes_struct RPC_AUTH_NTLMSSP_RESP ntlmssp_resp; BOOL ntlmssp_auth; + BOOL ntlmssp_validated; unsigned char ntlmssp_hash[258]; fstring user_name; fstring domain; diff --git a/source3/include/proto.h b/source3/include/proto.h index 63f4d624dc..a5d6d828f7 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1750,6 +1750,7 @@ void make_samr_q_chgpasswd_user(SAMR_Q_CHGPASSWD_USER *q_u, char nt_newpass[516], char nt_oldhash[16], char lm_newpass[516], char lm_oldhash[16]); void samr_io_q_chgpasswd_user(char *desc, SAMR_Q_CHGPASSWD_USER *q_u, prs_struct *ps, int depth); +void make_samr_r_chgpasswd_user(SAMR_R_CHGPASSWD_USER *r_u, uint32 status); void samr_io_r_chgpasswd_user(char *desc, SAMR_R_CHGPASSWD_USER *r_u, prs_struct *ps, int depth); /*The following definitions come from rpc_parse/parse_srv.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index 05ea1bf7c7..4cc5599f44 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -490,6 +490,7 @@ typedef struct connection_struct name_compare_entry *hide_list; /* Per-share list of files to return as hidden. */ name_compare_entry *veto_list; /* Per-share list of files to veto (never show). */ name_compare_entry *veto_oplock_list; /* Per-share list of files to refuse oplocks on. */ + } connection_struct; struct current_user @@ -497,7 +498,7 @@ struct current_user connection_struct *conn; uint16 vuid; uid_t uid; - gid_t gid; + gid_t gid; int ngroups; gid_t *groups; }; -- cgit From 691e2f245c7ac01b027e7300aa7fd2b1ccc90876 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 18 Oct 1998 19:45:05 +0000 Subject: redid proto.h (This used to be commit 20880966aafb2dbcdfbf979505a2d64a269dd9a8) --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index a5d6d828f7..e22efc7e59 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -983,6 +983,7 @@ BOOL lp_unix_password_sync(void); BOOL lp_passwd_chat_debug(void); BOOL lp_ole_locking_compat(void); BOOL lp_nt_smb_support(void); +BOOL lp_nt_pipe_support(void); BOOL lp_stat_cache(void); int lp_os_level(void); int lp_max_ttl(void); @@ -1845,7 +1846,6 @@ void wks_io_r_query_info(char *desc, WKS_R_QUERY_INFO *r_u, prs_struct *ps, int /*The following definitions come from rpc_server/srv_ldap_helpers.c */ -void ldap_helper_dummy(void); /*The following definitions come from rpc_server/srv_lsa.c */ -- cgit From 4ecf44d8af5a6e2e4a37330ebd2b75e0bb0b73fe Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 19 Oct 1998 01:05:49 +0000 Subject: prototype new functions (This used to be commit ae6e3d8f3820ee09988948ec0c1fa2214acd9b62) --- source3/include/proto.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index e22efc7e59..300eddae40 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2361,6 +2361,12 @@ void unbecome_root(BOOL restore_dir); int real_utime(const char *name, struct utimbuf *buf); int real_utimes(const char *name, struct timeval tv[2]); +/*The following definitions come from smbwrapper/shared.c */ + +void smbw_setup_shared(void); +char *smbw_getshared(const char *name); +void smbw_setshared(const char *name, const char *val); + /*The following definitions come from smbwrapper/smbw.c */ void smbw_init(void); -- cgit From 01de6030843f5f402dee8bf72f564a91ae8437ca Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 19 Oct 1998 17:32:10 +0000 Subject: - dce/rpc code - removed debug info in struni2 and unistr2 (security risk) - rpc_pipe function was getting pointer to data then calling realloc *dur* - password check function, the start of "credential checking", user, wks, domain, pass as the credentials (not just user,pass which is incorrect in a domain context) - cli_write needs to return ssize_t not size_t, because total can be -1 if the write fails. - fixed signed / unsigned warnings (how come i don't get those any more when i compile with gcc???) - nt password change added in smbd. yes, jeremy, i verified that the SMBtrans2 version still works. (This used to be commit fcfb40d2b0fc565ee4f66b3a3761c246366a2ef3) --- source3/include/ntdomain.h | 2 ++ source3/include/proto.h | 26 ++++++++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) (limited to 'source3/include') diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index 07d32519bf..b7c3b5b577 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -83,10 +83,12 @@ typedef struct pipes_struct RPC_AUTH_NTLMSSP_NEG ntlmssp_neg; RPC_AUTH_NTLMSSP_CHAL ntlmssp_chal; RPC_AUTH_NTLMSSP_RESP ntlmssp_resp; + RPC_AUTH_NTLMSSP_CHK ntlmssp_chk; BOOL ntlmssp_auth; BOOL ntlmssp_validated; unsigned char ntlmssp_hash[258]; + uint32 ntlmssp_seq_num; fstring user_name; fstring domain; fstring wks; diff --git a/source3/include/proto.h b/source3/include/proto.h index 300eddae40..6067430740 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -390,7 +390,7 @@ BOOL cli_close(struct cli_state *cli, int fnum); BOOL cli_lock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout); BOOL cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout); size_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_t size); -size_t cli_write(struct cli_state *cli, +ssize_t cli_write(struct cli_state *cli, int fnum, uint16 write_mode, char *buf, off_t offset, size_t size); BOOL cli_getattrE(struct cli_state *cli, int fd, @@ -510,7 +510,7 @@ void nt_lm_owf_gen(char *pwd, uchar nt_p16[16], uchar p16[16]); void SMBOWFencrypt(uchar passwd[16], uchar *c8, uchar p24[24]); void NTLMSSPOWFencrypt(uchar passwd[8], uchar *ntlmchalresp, uchar p24[24]); void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24); -BOOL make_oem_passwd_hash(char data[516], char *passwd, char old_pw_hash[16], BOOL unicode); +BOOL make_oem_passwd_hash(char data[516], char *passwd, uchar old_pw_hash[16], BOOL unicode); /*The following definitions come from libsmb/smberr.c */ @@ -1569,11 +1569,14 @@ void make_rpc_hdr_autha(RPC_HDR_AUTHA *rai, uint8 auth_type, uint8 auth_level, uint8 stub_type_len); void smb_io_rpc_hdr_autha(char *desc, RPC_HDR_AUTHA *rai, prs_struct *ps, int depth); +BOOL rpc_hdr_auth_chk(RPC_HDR_AUTH *rai); void make_rpc_hdr_auth(RPC_HDR_AUTH *rai, uint8 auth_type, uint8 auth_level, uint8 stub_type_len, uint32 ptr); void smb_io_rpc_hdr_auth(char *desc, RPC_HDR_AUTH *rai, prs_struct *ps, int depth); +BOOL rpc_auth_verifier_chk(RPC_AUTH_VERIFIER *rav, + char *signature, uint32 msg_type); void make_rpc_auth_verifier(RPC_AUTH_VERIFIER *rav, char *signature, uint32 msg_type); void smb_io_rpc_auth_verifier(char *desc, RPC_AUTH_VERIFIER *rav, prs_struct *ps, int depth); @@ -1590,6 +1593,7 @@ void make_rpc_auth_ntlmssp_resp(RPC_AUTH_NTLMSSP_RESP *rsp, char *domain, char *user, char *wks, uint32 neg_flags); void smb_io_rpc_auth_ntlmssp_resp(char *desc, RPC_AUTH_NTLMSSP_RESP *rsp, prs_struct *ps, int depth); +BOOL rpc_auth_ntlmssp_chk(RPC_AUTH_NTLMSSP_CHK *chk, uint32 crc32, uint32 *seq_num); void make_rpc_auth_ntlmssp_chk(RPC_AUTH_NTLMSSP_CHK *chk, uint32 ver, uint32 crc32, uint32 seq_num); void smb_io_rpc_auth_ntlmssp_chk(char *desc, RPC_AUTH_NTLMSSP_CHK *chk, prs_struct *ps, int depth); @@ -1846,6 +1850,7 @@ void wks_io_r_query_info(char *desc, WKS_R_QUERY_INFO *r_u, prs_struct *ps, int /*The following definitions come from rpc_server/srv_ldap_helpers.c */ +void ldap_helper_dummy(void); /*The following definitions come from rpc_server/srv_lsa.c */ @@ -2011,10 +2016,15 @@ void process_blocking_lock_queue(time_t t); BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root); BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root); -BOOL check_lanman_password(char *user, unsigned char *pass1, - unsigned char *pass2, struct smb_passwd **psmbpw); -BOOL change_lanman_password(struct smb_passwd *smbpw, unsigned char *pass1, unsigned char *pass2); -BOOL check_oem_password(char *user, unsigned char *data, +BOOL check_lanman_password(char *user, uchar *pass1, + uchar *pass2, struct smb_passwd **psmbpw); +BOOL change_lanman_password(struct smb_passwd *smbpw, uchar *pass1, uchar *pass2); +BOOL pass_oem_change(char *user, + uchar *lmdata, uchar *lmhash, + uchar *ntdata, uchar *nthash); +BOOL check_oem_password(char *user, + uchar *lmdata, uchar *lmhash, + uchar *ntdata, uchar *nthash, struct smb_passwd **psmbpw, char *new_passwd, int new_passwd_size); BOOL change_oem_password(struct smb_passwd *smbpw, char *new_passwd, BOOL override); @@ -2195,10 +2205,10 @@ int setup_groups(char *user, uid_t uid, gid_t gid, int *p_ngroups, gid_t **p_gro uint16 register_vuid(uid_t uid,gid_t gid, char *unix_name, char *requested_name, BOOL guest); void add_session_user(char *user); BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8); -BOOL smb_password_ok(struct smb_passwd *smb_pass, +BOOL smb_password_ok(struct smb_passwd *smb_pass, uchar chal[8], uchar lm_pass[24], uchar nt_pass[24]); BOOL pass_check_smb(char *user, char *domain, - char *challenge, char *lm_pwd, char *nt_pwd, + uchar *chal, char *lm_pwd, char *nt_pwd, struct passwd *pwd); BOOL password_ok(char *user, char *password, int pwlen, struct passwd *pwd); BOOL user_ok(char *user,int snum); -- cgit From e2fcb1880b060c41555d876fd51222f97f8fd8d1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 20 Oct 1998 06:43:59 +0000 Subject: new prorotypes (This used to be commit facd8d74e0cd0998ca5347ac5be14a6027460699) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 6067430740..b1322f5e9f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2376,6 +2376,7 @@ int real_utimes(const char *name, struct timeval tv[2]); void smbw_setup_shared(void); char *smbw_getshared(const char *name); void smbw_setshared(const char *name, const char *val); +int smbw_setenv(const char *name, const char *value); /*The following definitions come from smbwrapper/smbw.c */ -- cgit From 1ebeb54932de01323356e8201d465656b8723d46 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 20 Oct 1998 18:27:49 +0000 Subject: some quite important bug-fixes i missed because i transferred the wrong smb.tgz file from my portable. particularly the call to mem_data followed by a realloc of that data in cli_pipe.c's rpc_read() function. smbd responses now use p->rdata_i which is a faked-up pointer into p->rdata's response data. rdata can be very long; rdata_i is limited to point to no more than max_tsize - 0x18 in length. this will make it an almost trivial task to add the encrypted rpc headers after rdata_i, and mem_buf_copy will cope admirably with rhdr chained to rdata_i chained to auth_verifier etc etc... (This used to be commit 05a297e3a98c14360782af4ad0d851638fb5da9a) --- source3/include/ntdomain.h | 1 + source3/include/proto.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index b7c3b5b577..97122c8169 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -67,6 +67,7 @@ typedef struct pipes_struct prs_struct rhdr; /* output header */ prs_struct rdata; /* output data */ + prs_struct rdata_i; /* output data (intermediate, for fragments) */ prs_struct rauth; /* output authentication verifier */ prs_struct rverf; /* output verifier */ prs_struct rntlm; /* output ntlmssp */ diff --git a/source3/include/proto.h b/source3/include/proto.h index b1322f5e9f..2cec5f91f7 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -122,7 +122,7 @@ void mdfour(unsigned char *out, unsigned char *in, int n); /*The following definitions come from lib/membuffer.c */ void mem_init(struct mem_buf *buf, int margin); -void mem_create(struct mem_buf *buf, char *data, int size, int margin, BOOL dynamic); +void mem_create(struct mem_buf *buf, char *data, int offset, int size, int margin, BOOL dynamic); BOOL mem_alloc_data(struct mem_buf *buf, int size); BOOL mem_buf_copy(char *copy_into, struct mem_buf *buf, uint32 offset, uint32 len); -- cgit From e094a36a98db8299d7b2b21c8f8ee0ee97e57030 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 20 Oct 1998 20:08:35 +0000 Subject: Fixed bug found by John Blair where trim_string wasn't correctly trimming trailing multibyte code page strings. Jeremy. (This used to be commit dbdbce29f56d03f6abf1ee3d96ca2032e688dcbc) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 2cec5f91f7..b177e8d789 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -113,6 +113,7 @@ struct in_addr *iface_ip(struct in_addr ip); /*The following definitions come from lib/kanji.c */ void interpret_coding_system(char *str); +BOOL is_multibyte_codepage(void); void initialize_multibyte_vectors( int client_codepage); /*The following definitions come from lib/md4.c */ -- cgit From 053d6c605caebf5ed61b86f320da6a35f0c5257f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 21 Oct 1998 00:31:14 +0000 Subject: at the interop Isaac (at least I _think_ it was Isaac) said that if a MS client doesn't respond to a oplock break request then we might try resending the request. This morning Sues Win95 machine had this problem (thus forcing me to do something about it!). When starting winword her box refused to answer an oplock break request. I have added code to resend the oplock break request up to 3 times at 10 second intervals before killing the socket. of course, as soon as I did this her box started to behave again so I haven't been able to tell if this fix actually works, but it can't be worse than dropping the socket immediately. (This used to be commit a1c4d8351b9171416693e6d7a9045bdce9217edb) --- source3/include/local.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/local.h b/source3/include/local.h index 7c63ab830b..85e61c63c4 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -184,6 +184,10 @@ #define OPLOCK_BREAK_TIMEOUT 30 +/* how many times do we try to resend the oplock break request - useful + for buggy MS clients */ +#define OPLOCK_BREAK_RESENDS 3 + /* Timout (in seconds) to add to the oplock break timeout to wait for the smbd to smbd message to return. */ -- cgit From 9307940876a6c226969e9169d55c0408cd7ab032 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 21 Oct 1998 01:35:01 +0000 Subject: fixing smbd encrypted rpcs (data lens, alloc hints, sequence nums argh). put unicode strings after SAMLOGON query regardless of whether it's an NT mailslot or a non-NT mailslot, after having observed this behaviour out of NT machines. (This used to be commit c101113ec20ed0ba633e78e4ee45596cdccaf1b5) --- source3/include/proto.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index b177e8d789..206c1b309a 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -267,6 +267,7 @@ int smb_buflen(char *buf); char *smb_buf(char *buf); int smb_offset(char *p,char *buf); char *skip_string(char *buf,int n); +size_t str_charnum(char *s); BOOL trim_string(char *s,char *front,char *back); void dos_clean_name(char *s); void unix_clean_name(char *s); @@ -1594,7 +1595,7 @@ void make_rpc_auth_ntlmssp_resp(RPC_AUTH_NTLMSSP_RESP *rsp, char *domain, char *user, char *wks, uint32 neg_flags); void smb_io_rpc_auth_ntlmssp_resp(char *desc, RPC_AUTH_NTLMSSP_RESP *rsp, prs_struct *ps, int depth); -BOOL rpc_auth_ntlmssp_chk(RPC_AUTH_NTLMSSP_CHK *chk, uint32 crc32, uint32 *seq_num); +BOOL rpc_auth_ntlmssp_chk(RPC_AUTH_NTLMSSP_CHK *chk, uint32 crc32, uint32 seq_num); void make_rpc_auth_ntlmssp_chk(RPC_AUTH_NTLMSSP_CHK *chk, uint32 ver, uint32 crc32, uint32 seq_num); void smb_io_rpc_auth_ntlmssp_chk(char *desc, RPC_AUTH_NTLMSSP_CHK *chk, prs_struct *ps, int depth); -- cgit From 6e3af45afe237790f1d7cd94ab2b22e1ca772157 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 21 Oct 1998 16:58:34 +0000 Subject: Fixed mainly signed/unsigned issues found by SGI cc in -fullwarn mode. smbd/chgpasswd.c: Fixed (my) stupid bug where I was returning stack based variables. Doh ! smbd/trans2.c: Allows SETFILEINFO as well as QFILEINFO on directory handles. Jeremy. (This used to be commit 0b44d27d0b5cc3948a6c2d78370ccddf1a84cd80) --- source3/include/proto.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 206c1b309a..83848e45e7 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1277,8 +1277,8 @@ BOOL get_samr_query_userinfo(struct cli_state *cli, uint32 user_rid, SAM_USER_INFO_21 *usr); BOOL do_samr_chgpasswd_user(struct cli_state *cli, char *srv_name, char *user_name, - char nt_newpass[516], char nt_oldhash[16], - char lm_newpass[516], char lm_oldhash[16]); + char nt_newpass[516], uchar nt_oldhash[16], + char lm_newpass[516], uchar lm_oldhash[16]); BOOL do_samr_unknown_38(struct cli_state *cli, char *srv_name); BOOL do_samr_unknown_8(struct cli_state *cli, POLICY_HND *domain_pol, uint16 switch_value); @@ -1750,12 +1750,12 @@ void make_samr_r_unknown_38(SAMR_R_UNKNOWN_38 *r_u); void samr_io_r_unknown_38(char *desc, SAMR_R_UNKNOWN_38 *r_u, prs_struct *ps, int depth); void make_enc_passwd(SAMR_ENC_PASSWD *pwd, char pass[512]); void samr_io_enc_passwd(char *desc, SAMR_ENC_PASSWD *pwd, prs_struct *ps, int depth); -void make_enc_hash(SAMR_ENC_HASH *hsh, char hash[16]); +void make_enc_hash(SAMR_ENC_HASH *hsh, uchar hash[16]); void samr_io_enc_hash(char *desc, SAMR_ENC_HASH *hsh, prs_struct *ps, int depth); void make_samr_q_chgpasswd_user(SAMR_Q_CHGPASSWD_USER *q_u, char *dest_host, char *user_name, - char nt_newpass[516], char nt_oldhash[16], - char lm_newpass[516], char lm_oldhash[16]); + char nt_newpass[516], uchar nt_oldhash[16], + char lm_newpass[516], uchar lm_oldhash[16]); void samr_io_q_chgpasswd_user(char *desc, SAMR_Q_CHGPASSWD_USER *q_u, prs_struct *ps, int depth); void make_samr_r_chgpasswd_user(SAMR_R_CHGPASSWD_USER *r_u, uint32 status); void samr_io_r_chgpasswd_user(char *desc, SAMR_R_CHGPASSWD_USER *r_u, prs_struct *ps, int depth); @@ -2210,7 +2210,7 @@ BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned cha BOOL smb_password_ok(struct smb_passwd *smb_pass, uchar chal[8], uchar lm_pass[24], uchar nt_pass[24]); BOOL pass_check_smb(char *user, char *domain, - uchar *chal, char *lm_pwd, char *nt_pwd, + uchar *chal, uchar *lm_pwd, uchar *nt_pwd, struct passwd *pwd); BOOL password_ok(char *user, char *password, int pwlen, struct passwd *pwd); BOOL user_ok(char *user,int snum); -- cgit From 21e107fd42eb953affac28239588458c6c0ee323 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 21 Oct 1998 21:11:16 +0000 Subject: the next dialog: user-groups. it's not very sensible what appears, but hey: it appears! (This used to be commit 399035098f212e976cc0000a215e0705ebe78c05) --- source3/include/proto.h | 23 +++++++++++++++++++++++ source3/include/rpc_samr.h | 42 ++++++++++++++++++++++++++++++++++-------- source3/include/smb.h | 1 + 3 files changed, 58 insertions(+), 8 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 83848e45e7..11c9f19393 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1140,6 +1140,7 @@ BOOL pass_check(char *user,char *password, int pwlen, struct passwd *pwd, /*The following definitions come from passdb/passdb.c */ BOOL initialize_password_db(void); +struct smb_passwd *iterate_getsmbpwrid(uint32 user_rid); struct smb_passwd *iterate_getsmbpwuid(uid_t smb_userid); struct smb_passwd *iterate_getsmbpwnam(char *name); void *startsmbpwent(BOOL update); @@ -1148,6 +1149,7 @@ struct smb_passwd *getsmbpwent(void *vp); BOOL add_smbpwd_entry(struct smb_passwd *newpwd); BOOL mod_smbpwd_entry(struct smb_passwd* pwd, BOOL override); struct smb_passwd *getsmbpwnam(char *name); +struct smb_passwd *getsmbpwrid(uint32 user_rid); struct smb_passwd *getsmbpwuid(uid_t smb_userid); struct sam_passwd *iterate_getsam21pwnam(char *name); struct sam_passwd *iterate_getsam21pwrid(uint32 rid); @@ -1174,6 +1176,7 @@ void pdb_sethexpwd(char *p, char *pwd, uint16 acct_ctrl); BOOL pdb_gethexpwd(char *p, char *pwd); BOOL pdb_name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); BOOL pdb_generate_machine_sid(void); +uid_t pdb_user_rid_to_uid(uint32 user_rid); uint32 pdb_uid_to_user_rid(uid_t uid); uint32 pdb_gid_to_group_rid(gid_t gid); BOOL pdb_rid_is_user(uint32 rid); @@ -1610,12 +1613,22 @@ void make_samr_q_open_domain(SAMR_Q_OPEN_DOMAIN *q_u, DOM_SID *sid); void samr_io_q_open_domain(char *desc, SAMR_Q_OPEN_DOMAIN *q_u, prs_struct *ps, int depth); void samr_io_r_open_domain(char *desc, SAMR_R_OPEN_DOMAIN *r_u, prs_struct *ps, int depth); +void make_samr_q_unknown_2c(SAMR_Q_UNKNOWN_2C *q_u, POLICY_HND *user_pol); +void samr_io_q_unknown_2c(char *desc, SAMR_Q_UNKNOWN_2C *q_u, prs_struct *ps, int depth); +void make_samr_r_unknown_2c(SAMR_R_UNKNOWN_2C *q_u, uint32 status); +void samr_io_r_unknown_2c(char *desc, SAMR_R_UNKNOWN_2C *r_u, prs_struct *ps, int depth); void make_samr_q_unknown_3(SAMR_Q_UNKNOWN_3 *q_u, POLICY_HND *user_pol, uint16 switch_value); void samr_io_q_unknown_3(char *desc, SAMR_Q_UNKNOWN_3 *q_u, prs_struct *ps, int depth); void make_samr_q_unknown_8(SAMR_Q_UNKNOWN_8 *q_u, POLICY_HND *domain_pol, uint16 switch_value); void samr_io_q_unknown_8(char *desc, SAMR_Q_UNKNOWN_8 *q_u, prs_struct *ps, int depth); +void make_unk_info2(SAM_UNK_INFO_2 *u_2, char *domain, char *server); +void sam_io_unk_info2(char *desc, SAM_UNK_INFO_2 *u_2, prs_struct *ps, int depth); +void make_samr_r_unknown_8(SAMR_R_UNKNOWN_8 *r_u, + uint16 switch_value, SAM_UNK_CTR *ctr, + uint32 status); +void samr_io_r_unknown_8(char *desc, SAMR_R_UNKNOWN_8 *r_u, prs_struct *ps, int depth); void make_dom_sid3(DOM_SID3 *sid3, uint16 unk_0, uint16 unk_1, DOM_SID *sid); void make_samr_r_unknown_3(SAMR_R_UNKNOWN_3 *r_u, uint16 unknown_2, uint16 unknown_3, @@ -1692,6 +1705,16 @@ void samr_io_r_query_usergroups(char *desc, SAMR_R_QUERY_USERGROUPS *r_u, prs_s void make_samr_q_query_userinfo(SAMR_Q_QUERY_USERINFO *q_u, POLICY_HND *hnd, uint16 switch_value); void samr_io_q_query_userinfo(char *desc, SAMR_Q_QUERY_USERINFO *q_u, prs_struct *ps, int depth); +void make_sam_user_info10(SAM_USER_INFO_10 *usr, + uint32 acb_info); +void sam_io_user_info10(char *desc, SAM_USER_INFO_10 *usr, prs_struct *ps, int depth); +void make_sam_user_info11(SAM_USER_INFO_11 *usr, + NTTIME *expiry, + char *mach_acct, + uint32 rid_user, + uint32 rid_group, + uint16 acct_ctrl); +void sam_io_user_info11(char *desc, SAM_USER_INFO_11 *usr, prs_struct *ps, int depth); void make_sam_user_info21(SAM_USER_INFO_21 *usr, NTTIME *logon_time, diff --git a/source3/include/rpc_samr.h b/source3/include/rpc_samr.h index baae9a3bd9..2a22919642 100644 --- a/source3/include/rpc_samr.h +++ b/source3/include/rpc_samr.h @@ -89,6 +89,7 @@ SamrTestPrivateFunctionsUser #define SAMR_QUERY_USERGROUPS 0x27 #define SAMR_UNKNOWN_12 0x12 #define SAMR_UNKNOWN_21 0x21 +#define SAMR_UNKNOWN_2C 0x2c #define SAMR_UNKNOWN_32 0x32 #define SAMR_UNKNOWN_34 0x34 #define SAMR_CHGPASSWD_USER 0x37 @@ -210,7 +211,7 @@ typedef struct sam_user_info_11 /* SAM_USER_INFO_10 */ typedef struct sam_user_info_10 { - uint32 rid_group; + uint32 acb_info; } SAM_USER_INFO_10; @@ -233,6 +234,32 @@ typedef struct r_samr_close_hnd_info } SAMR_R_CLOSE_HND; +/**************************************************************************** +SAMR_Q_UNKNOWN_2C - a "set user info" occurs just after this +*****************************************************************************/ + +/* SAMR_Q_UNKNOWN_2C */ +typedef struct q_samr_unknown_2c_info +{ + POLICY_HND user_pol; /* policy handle */ + +} SAMR_Q_UNKNOWN_2C; + + +/**************************************************************************** +SAMR_R_UNKNOWN_2C - a "set user info" occurs just after this +*****************************************************************************/ + +/* SAMR_R_UNKNOWN_2C */ +typedef struct r_samr_unknown_2c_info +{ + uint32 unknown_0; /* 0x0016 0000 */ + uint32 unknown_1; /* 0x0000 0000 */ + uint32 status; + +} SAMR_R_UNKNOWN_2C; + + /**************************************************************************** SAMR_Q_UNKNOWN_3 - info level 4. returns SIDs. *****************************************************************************/ @@ -240,7 +267,7 @@ SAMR_Q_UNKNOWN_3 - info level 4. returns SIDs. /* SAMR_Q_UNKNOWN_3 - probably get domain info... */ typedef struct q_samr_unknown_3_info { - POLICY_HND user_pol; /* policy handle */ + POLICY_HND user_pol; /* policy handle */ uint16 switch_value; /* 0x0000 0004 */ /* uint8 pad[2] */ @@ -317,7 +344,7 @@ SAMR_Q_UNKNOWN_8 - probably a query on domain group info. /* SAMR_Q_UNKNOWN_8 - */ typedef struct q_samr_unknown_8_info { - POLICY_HND domain_pol; /* policy handle */ + POLICY_HND domain_pol; /* policy handle */ uint16 switch_value; /* 0x0002 */ } SAMR_Q_UNKNOWN_8; @@ -325,9 +352,8 @@ typedef struct q_samr_unknown_8_info typedef struct sam_unkown_info_2_info { uint32 unknown_0; /* 0x0000 0000 */ - uint32 unknown_1; /* 0x0000 0000 */ - uint32 unknown_2; /* 0x8000 0000 */ - uint32 unknown_3; /* 0x0000 0000 */ + uint32 unknown_1; /* 0x8000 0000 */ + uint32 unknown_2; /* 0x0000 0000 */ uint32 ptr_0; /* pointer to unknown structure */ UNIHDR hdr_domain; /* domain name unicode header */ @@ -337,7 +363,7 @@ typedef struct sam_unkown_info_2_info pointer is referring to */ - uint32 unknown_4; /* 0x0000 0099 */ + uint32 unknown_4; /* 0x0000 0099 or 0x1000 0000 */ uint32 unknown_5; /* 0x0000 0000 */ uint32 unknown_6 ; /* 0x0000 0001 */ @@ -368,7 +394,7 @@ typedef struct sam_unknown_ctr_info /* SAMR_R_UNKNOWN_8 - */ typedef struct r_samr_unknown_8_info { - uint32 ptr_1; + uint32 ptr_0; uint16 switch_value; /* same as in query */ SAM_UNK_CTR *ctr; diff --git a/source3/include/smb.h b/source3/include/smb.h index 4cc5599f44..f755b81b92 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -667,6 +667,7 @@ struct passdb_ops { */ struct smb_passwd *(*getsmbpwnam)(char *); struct smb_passwd *(*getsmbpwuid)(uid_t); + struct smb_passwd *(*getsmbpwrid)(uint32); struct smb_passwd *(*getsmbpwent)(void *); /* -- cgit From eadc5b8c6ecdd6892647d391e1976b2c708d1ea0 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 21 Oct 1998 22:36:26 +0000 Subject: domain aliases added a bit better: does local aliases if you query for sid S-1-5-20 and does (nothing at the moment) if you query for your own sid. (This used to be commit da40f26f4b2f7ce286076b4e39dffd76aa2ef8e6) --- source3/include/proto.h | 13 +++++++------ source3/include/rpc_samr.h | 33 +++++++++++++++++---------------- 2 files changed, 24 insertions(+), 22 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 11c9f19393..f9c3d8734b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1175,7 +1175,7 @@ void pdb_set_last_set_time(char *p, int max_len, time_t t); void pdb_sethexpwd(char *p, char *pwd, uint16 acct_ctrl); BOOL pdb_gethexpwd(char *p, char *pwd); BOOL pdb_name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid); -BOOL pdb_generate_machine_sid(void); +BOOL pdb_generate_sam_sid(void); uid_t pdb_user_rid_to_uid(uint32 user_rid); uint32 pdb_uid_to_user_rid(uid_t uid); uint32 pdb_gid_to_group_rid(gid_t gid); @@ -1283,7 +1283,7 @@ BOOL do_samr_chgpasswd_user(struct cli_state *cli, char nt_newpass[516], uchar nt_oldhash[16], char lm_newpass[516], uchar lm_oldhash[16]); BOOL do_samr_unknown_38(struct cli_state *cli, char *srv_name); -BOOL do_samr_unknown_8(struct cli_state *cli, +BOOL do_samr_query_dom_info(struct cli_state *cli, POLICY_HND *domain_pol, uint16 switch_value); BOOL do_samr_enum_dom_users(struct cli_state *cli, POLICY_HND *pol, uint16 num_entries, uint16 unk_0, @@ -1620,15 +1620,15 @@ void samr_io_r_unknown_2c(char *desc, SAMR_R_UNKNOWN_2C *r_u, prs_struct *ps, i void make_samr_q_unknown_3(SAMR_Q_UNKNOWN_3 *q_u, POLICY_HND *user_pol, uint16 switch_value); void samr_io_q_unknown_3(char *desc, SAMR_Q_UNKNOWN_3 *q_u, prs_struct *ps, int depth); -void make_samr_q_unknown_8(SAMR_Q_UNKNOWN_8 *q_u, +void make_samr_q_query_dom_info(SAMR_Q_QUERY_DOMAIN_INFO *q_u, POLICY_HND *domain_pol, uint16 switch_value); -void samr_io_q_unknown_8(char *desc, SAMR_Q_UNKNOWN_8 *q_u, prs_struct *ps, int depth); +void samr_io_q_query_dom_info(char *desc, SAMR_Q_QUERY_DOMAIN_INFO *q_u, prs_struct *ps, int depth); void make_unk_info2(SAM_UNK_INFO_2 *u_2, char *domain, char *server); void sam_io_unk_info2(char *desc, SAM_UNK_INFO_2 *u_2, prs_struct *ps, int depth); -void make_samr_r_unknown_8(SAMR_R_UNKNOWN_8 *r_u, +void make_samr_r_query_dom_info(SAMR_R_QUERY_DOMAIN_INFO *r_u, uint16 switch_value, SAM_UNK_CTR *ctr, uint32 status); -void samr_io_r_unknown_8(char *desc, SAMR_R_UNKNOWN_8 *r_u, prs_struct *ps, int depth); +void samr_io_r_query_dom_info(char *desc, SAMR_R_QUERY_DOMAIN_INFO *r_u, prs_struct *ps, int depth); void make_dom_sid3(DOM_SID3 *sid3, uint16 unk_0, uint16 unk_1, DOM_SID *sid); void make_samr_r_unknown_3(SAMR_R_UNKNOWN_3 *r_u, uint16 unknown_2, uint16 unknown_3, @@ -1889,6 +1889,7 @@ int find_lsa_policy_by_hnd(POLICY_HND *hnd); BOOL set_lsa_policy_samr_rid(POLICY_HND *hnd, uint32 rid); BOOL set_lsa_policy_samr_pol_status(POLICY_HND *hnd, uint32 pol_status); BOOL set_lsa_policy_samr_sid(POLICY_HND *hnd, DOM_SID *sid); +BOOL get_lsa_policy_samr_sid(POLICY_HND *hnd, DOM_SID *sid); uint32 get_lsa_policy_samr_rid(POLICY_HND *hnd); BOOL set_lsa_policy_reg_name(POLICY_HND *hnd, fstring name); BOOL close_lsa_policy_hnd(POLICY_HND *hnd); diff --git a/source3/include/rpc_samr.h b/source3/include/rpc_samr.h index 2a22919642..d45cb23388 100644 --- a/source3/include/rpc_samr.h +++ b/source3/include/rpc_samr.h @@ -79,7 +79,7 @@ SamrTestPrivateFunctionsUser #define SAMR_CLOSE_HND 0x01 #define SAMR_OPEN_DOMAIN 0x07 -#define SAMR_UNKNOWN_8 0x08 +#define SAMR_QUERY_DOMAIN_INFO 0x08 #define SAMR_LOOKUP_IDS 0x10 #define SAMR_LOOKUP_NAMES 0x11 #define SAMR_UNKNOWN_3 0x03 @@ -338,16 +338,16 @@ typedef struct r_samr_unknown_3_info /**************************************************************************** -SAMR_Q_UNKNOWN_8 - probably a query on domain group info. +SAMR_Q_QUERY_DOMAIN_INFO - probably a query on domain group info. *****************************************************************************/ -/* SAMR_Q_UNKNOWN_8 - */ -typedef struct q_samr_unknown_8_info +/* SAMR_Q_QUERY_DOMAIN_INFO - */ +typedef struct q_samr_query_domain_info { POLICY_HND domain_pol; /* policy handle */ uint16 switch_value; /* 0x0002 */ -} SAMR_Q_UNKNOWN_8; +} SAMR_Q_QUERY_DOMAIN_INFO; typedef struct sam_unkown_info_2_info { @@ -363,16 +363,17 @@ typedef struct sam_unkown_info_2_info pointer is referring to */ - uint32 unknown_4; /* 0x0000 0099 or 0x1000 0000 */ - uint32 unknown_5; /* 0x0000 0000 */ + uint32 seq_num; /* some sort of incrementing sequence number? */ + uint32 unknown_3; /* 0x0000 0000 */ - uint32 unknown_6 ; /* 0x0000 0001 */ - uint32 unknown_7 ; /* 0x0000 0003 */ - uint32 unknown_8 ; /* 0x0000 0001 */ - uint32 unknown_9 ; /* 0x0000 0008 */ - uint32 unknown_10; /* 0x0000 0003 */ + uint32 unknown_4; /* 0x0000 0001 */ + uint32 unknown_5; /* 0x0000 0003 */ + uint32 unknown_6; /* 0x0000 0001 */ + uint32 num_domain_usrs; /* number of users in domain */ + uint32 num_domain_grps; /* number of domain groups in domain */ + uint32 num_local_grps; /* number of local groups in domain */ - uint8 padding[16]; /* 16 bytes zeros */ + uint8 padding[12]; /* 12 bytes zeros */ UNISTR2 uni_domain; /* domain name unicode string */ UNISTR2 uni_server; /* server name unicode string */ @@ -391,8 +392,8 @@ typedef struct sam_unknown_ctr_info } SAM_UNK_CTR; -/* SAMR_R_UNKNOWN_8 - */ -typedef struct r_samr_unknown_8_info +/* SAMR_R_QUERY_DOMAIN_INFO - */ +typedef struct r_samr_query_domain_info { uint32 ptr_0; uint16 switch_value; /* same as in query */ @@ -401,7 +402,7 @@ typedef struct r_samr_unknown_8_info uint32 status; /* return status */ -} SAMR_R_UNKNOWN_8; +} SAMR_R_QUERY_DOMAIN_INFO; /**************************************************************************** -- cgit From cbd0b2ccf9519bcada58567b88987e134563058d Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 22 Oct 1998 18:15:23 +0000 Subject: bug fix in lsa_trans_names. well-known aliases S-1-5-20 is actually S-1-5-0x20 but sid_to_string does decimal not hexadecimal oops. (This used to be commit 4d830e243650729344a2d1b238075e787802ff8b) --- source3/include/proto.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index f9c3d8734b..d75832395d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1343,7 +1343,8 @@ BOOL do_wks_query_info(struct cli_state *cli, /*The following definitions come from rpc_parse/parse_lsa.c */ -void make_lsa_trans_name(LSA_TRANS_NAME *trn, uint32 sid_name_use, char *name, uint32 idx); +void make_lsa_trans_name(LSA_TRANS_NAME *trn, UNISTR2 *uni_name, + uint32 sid_name_use, char *name, uint32 idx); void make_lsa_sec_qos(LSA_SEC_QOS *qos, uint16 imp_lev, uint8 ctxt, uint8 eff, uint32 unknown); void make_lsa_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, LSA_SEC_QOS *qos); -- cgit From a0512ce5ff104bd2d2d11b3e3167d214615a9fbf Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 22 Oct 1998 22:19:08 +0000 Subject: rpctorture command (This used to be commit b4ae65e2d0582274d67d02ea190f6d3d83b48594) --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index d75832395d..e0d70a873c 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -231,6 +231,7 @@ BOOL user_in_list(char *user,char *list); char *tmpdir(void); BOOL is_a_socket(int fd); +BOOL set_first_token(char *ptr); BOOL next_token(char **ptr,char *buff,char *sep, int bufsize); char **toktocliplist(int *ctok, char *sep); void set_socket_options(int fd, char *options); -- cgit From 95056761c8137aa0d0d4f04e862efa7fa94e064c Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 22 Oct 1998 23:05:55 +0000 Subject: torture debug. (This used to be commit 97609596647dea39c061bdf972411a86f7294521) --- source3/include/proto.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index e0d70a873c..6ec6f7e617 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -501,7 +501,6 @@ void E_old_pw_hash( unsigned char *p14, unsigned char *in, unsigned char *out); void cred_hash1(unsigned char *out,unsigned char *in,unsigned char *key); void cred_hash2(unsigned char *out,unsigned char *in,unsigned char *key); void cred_hash3(unsigned char *out,unsigned char *in,unsigned char *key, int forw); -void NTLMSSPhash( unsigned char hash[258], unsigned char key[5]); void NTLMSSPcalc( unsigned char hash[258], unsigned char *data, int len); void SamOEMhash( unsigned char *data, unsigned char *key, int val); -- cgit From 5d6ed11ef3c860c95ae7b3a855b0ddb123bd9737 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 23 Oct 1998 00:58:28 +0000 Subject: include/smb.h: Added #defines for lots of things - makes our code a *lot* easier to read. lib/util.c: Fixed Luke's set_first_token() function - should return void. smbd/close.c: Move delete_on_close into file_fd_struct structure. smbd/ipc.c: Changed local_machine back to fstring. smbd/nttrans.c: Use defines for mapping share modes. smbd/open.c: Move delete_on_close into file_fd_struct structure, added code for ALLOW_SHARE_DELETE. smbd/reply.c: Use defines for mapping share modes. smbd/trans2.c: Move delete_on_close into file_fd_struct structure. Jeremy. (This used to be commit 8e1ce307bd6a9056b4a95fe6f52ff42dc6e03a08) --- source3/include/proto.h | 2 +- source3/include/smb.h | 47 ++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 45 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 6ec6f7e617..9b707adeef 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -231,7 +231,7 @@ BOOL user_in_list(char *user,char *list); char *tmpdir(void); BOOL is_a_socket(int fd); -BOOL set_first_token(char *ptr); +void set_first_token(char *ptr); BOOL next_token(char **ptr,char *buff,char *sep, int bufsize); char **toktocliplist(int *ctok, char *sep); void set_socket_options(int fd, char *options); diff --git a/source3/include/smb.h b/source3/include/smb.h index f755b81b92..d71d1cd1eb 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -186,6 +186,47 @@ implemented */ #define DENY_NONE 4 #define DENY_FCB 7 +/* open modes */ +#define DOS_OPEN_RDONLY 0 +#define DOS_OPEN_WRONLY 1 +#define DOS_OPEN_RDWR 2 +#define DOS_OPEN_FCB 0xF + +/* define shifts and masks for share and open modes. */ +#define OPEN_MODE_MASK 0xF +#define SHARE_MODE_SHIFT 4 +#define SHARE_MODE_MASK 0x7 +#define GET_OPEN_MODE(x) ((x) & OPEN_MODE_MASK) +#define SET_OPEN_MODE(x) ((x) & OPEN_MODE_MASK) +#define GET_DENY_MODE(x) (((x)>>SHARE_MODE_SHIFT) & SHARE_MODE_MASK) +#define SET_DENY_MODE(x) ((x)<