1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

more solaris 2.5 fixups. It now seems to be working pretty well.

This commit is contained in:
Andrew Tridgell 0001-01-01 00:00:00 +00:00
parent 269a7938fc
commit c4e4508178
9 changed files with 716 additions and 274 deletions

780
source/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -45,6 +45,7 @@ AC_CHECK_HEADERS(sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
AC_CHECK_HEADERS(shadow.h netinet/tcp.h sys/security.h security/pam_appl.h)
AC_CHECK_HEADERS(stropts.h poll.h readline.h history.h readline/readline.h)
AC_CHECK_HEADERS(readline/history.h sys/capability.h sysacll.h sys/syscall.h)
AC_CHECK_HEADERS(sys/acl.h)
AC_CHECK_SIZEOF(int,cross)
AC_CHECK_SIZEOF(long,cross)
@ -165,13 +166,17 @@ AC_CHECK_FUNCS(initgroups select rdchk getgrnam pathconf putprpwnam)
AC_CHECK_FUNCS(setuidx setgroups mktime rename ftruncate stat64 fstat64 lstat64)
AC_CHECK_FUNCS(set_auth_parameters atexit grantpt getspnam dup2 lseek64 ftruncate64)
AC_CHECK_FUNCS(fseek64 ftell64 bigcrypt getprpwnam setluid yp_get_default_domain getpwanam)
AC_CHECK_FUNCS(srandom random srand rand)
AC_CHECK_FUNCS(srandom random srand rand setenv)
AC_CHECK_FUNCS(_dup _dup2 _opendir _readdir _seekdir _telldir _closedir)
AC_CHECK_FUNCS(__dup __dup2 __opendir __readdir __seekdir __telldir __closedir)
AC_CHECK_FUNCS(__getcwd _getcwd)
AC_CHECK_FUNCS(__xstat __fxstat __lxstat)
AC_CHECK_FUNCS(_stat _lstat _fstat __stat __lstat __fstat)
AC_CHECK_FUNCS(_acl __acl _facl __facl _open __open _chdir __chdir)
AC_CHECK_FUNCS(_close __close _fchdir __fchdir _fcntl __fcntl)
AC_CHECK_FUNCS(_getdents __getdents _lseek __lseek _read __read)
AC_CHECK_FUNCS(_write __write)
AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
AC_TRY_RUN([#include <stdio.h>

View File

@ -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 <stropts.h> header file. */
#undef HAVE_STROPTS_H
/* Define if you have the <sys/acl.h> header file. */
#undef HAVE_SYS_ACL_H
/* Define if you have the <sys/capability.h> header file. */
#undef HAVE_SYS_CAPABILITY_H

View File

@ -293,3 +293,21 @@ char *rep_inet_ntoa(struct in_addr ip)
return buf;
}
#endif
#ifndef HAVE_SETENV
/*****************************************************************
set an env variable - some systems don't have this
*****************************************************************/
int setenv(const char *name, const char *value, int overwrite)
{
pstring s;
if (!overwrite && getenv(name)) return 0;
slprintf(s,sizeof(s)-1,"%s=%s", name, value);
return putenv(s);
}
#endif

View File

@ -4844,3 +4844,4 @@ void zero_free(void *p, size_t size)
memset(p, 0, size);
free(p);
}

View File

@ -64,7 +64,7 @@
#elif HAVE___SEEKDIR
#define real_seekdir(d) (__seekdir(d,l))
#else
#define NO_SEEKDIR
#define NO_SEEKDIR_WRAPPER
#endif
#ifdef HAVE__TELLDIR
@ -74,7 +74,7 @@
#elif HAVE___TELLDIR
#define real_telldir(d) (__telldir(d))
#else
#define NO_TELLDIR
#define NO_TELLDIR_WRAPPER
#endif
#ifdef HAVE__DUP
@ -125,6 +125,26 @@
#define real_fstat(fd,st) (__fstat(fd,st))
#endif
#ifdef HAVE__ACL
#define real_acl(fn,cmd,n,buf) (_acl(fn,cmd,n,buf))
#elif SYS_acl
#define real_acl(fn,cmd,n,buf) (syscall(SYS_acl,(fn),(cmd),(n),(buf)))
#elif HAVE___ACL
#define real_acl(fn,cmd,n,buf) (__acl(fn,cmd,n,buf))
#else
#define NO_ACL_WRAPPER
#endif
#ifdef HAVE__FACL
#define real_facl(fd,cmd,n,buf) (_facl(fd,cmd,n,buf))
#elif SYS_facl
#define real_facl(fd,cmd,n,buf) (syscall(SYS_facl,(fd),(cmd),(n),(buf)))
#elif HAVE___FACL
#define real_facl(fd,cmd,n,buf) (__facl(fd,cmd,n,buf))
#else
#define NO_FACL_WRAPPER
#endif
#define real_readlink(fn,buf,len) (syscall(SYS_readlink, (fn), (buf), (len)))
#define real_rename(fn1, fn2) (syscall(SYS_rename, (fn1), (fn2)))

View File

@ -27,6 +27,7 @@ fi
LD_PRELOAD=$LIBDIR/smbwrapper.so
export LD_PRELOAD
PWD=`pwd`
export PWD
PS1='smbsh$ '
export PS1

View File

@ -22,7 +22,9 @@
#include "wrapper.h"
#ifdef linux
#ifdef HAVE__OPEN
__asm__(".globl _open; _open = open");
#elif HAVE___OPEN
__asm__(".globl __open; __open = open");
#endif
@ -36,8 +38,10 @@ __asm__(".globl __open; __open = open");
}
#ifdef linux
#ifdef HAVE___CHDIR
__asm__(".globl __chdir; __chdir = chdir");
#elif HAVE__CHDIR
__asm__(".globl _chdir; _chdir = chdir");
#endif
int chdir(const char *name)
@ -47,8 +51,10 @@ __asm__(".globl __chdir; __chdir = chdir");
#ifdef linux
#ifdef HAVE___CLOSE
__asm__(".globl __close; __close = close");
#elif HAVE__CLOSE
__asm__(".globl _close; _close = close");
#endif
ssize_t close(int fd)
@ -61,8 +67,10 @@ __asm__(".globl __close; __close = close");
}
#ifdef linux
#ifdef HAVE___FCHDIR
__asm__(".globl __fchdir; __fchdir = fchdir");
#elif HAVE__FCHDIR
__asm__(".globl _fchdir; _fchdir = fchdir");
#endif
int fchdir(int fd)
@ -75,8 +83,10 @@ __asm__(".globl __fchdir; __fchdir = fchdir");
}
#ifdef linux
#ifdef HAVE___FCNTL
__asm__(".globl __fcntl; __fcntl = fcntl");
#elif HAVE__FCNTL
__asm__(".globl _fcntl; _fcntl = fcntl");
#endif
int fcntl(int fd, int cmd, long arg)
@ -90,8 +100,10 @@ __asm__(".globl __fcntl; __fcntl = fcntl");
#ifdef linux
#ifdef HAVE___GETDENTS
__asm__(".globl __getdents; __getdents = getdents");
#elif HAVE__GETDENTS
__asm__(".globl _getdents; _getdents = getdents");
#endif
int getdents(int fd, struct dirent *dirp, unsigned int count)
@ -104,8 +116,10 @@ __asm__(".globl __getdents; __getdents = getdents");
}
#ifdef linux
#ifdef HAVE___LSEEK
__asm__(".globl __lseek; __lseek = lseek");
#elif HAVE__LSEEK
__asm__(".globl _lseek; _lseek = lseek");
#endif
ssize_t lseek(int fd, off_t offset, int whence)
@ -119,8 +133,10 @@ __asm__(".globl __lseek; __lseek = lseek");
#ifdef linux
#ifdef HAVE___READ
__asm__(".globl __read; __read = read");
#elif HAVE__READ
__asm__(".globl _read; _read = read");
#endif
ssize_t read(int fd, void *buf, size_t count)
@ -133,8 +149,10 @@ __asm__(".globl __read; __read = read");
}
#ifdef linux
#ifdef HAVE___WRITE
__asm__(".globl __write; __write = write");
#elif HAVE__WRITE
__asm__(".globl _write; _write = write");
#endif
ssize_t write(int fd, void *buf, size_t count)
@ -545,7 +563,7 @@ __asm__(".globl __write; __write = write");
return real_closedir(dir);
}
#ifndef NO_TELLDIR
#ifndef NO_TELLDIR_WRAPPER
off_t telldir(DIR *dir)
{
if (smbw_dirp(dir)) {
@ -556,7 +574,7 @@ __asm__(".globl __write; __write = write");
}
#endif
#ifndef NO_SEEKDIR
#ifndef NO_SEEKDIR_WRAPPER
void seekdir(DIR *dir, off_t offset)
{
if (smbw_dirp(dir)) {
@ -567,3 +585,45 @@ __asm__(".globl __write; __write = write");
real_seekdir(dir, offset);
}
#endif
#ifndef NO_ACL_WRAPPER
int acl(const char *pathp, int cmd, int nentries, aclent_t *aclbufp)
{
if (smbw_path(pathp)) {
switch (cmd) {
case GETACL:
case GETACLCNT:
return 0;
default:
errno = ENOSYS;
return -1;
}
}
real_acl(pathp, cmd, nentries, aclbufp);
}
#endif
#ifndef NO_FACL_WRAPPER
int facl(int fd, int cmd, int nentries, aclent_t *aclbufp)
{
if (smbw_fd(fd)) {
switch (cmd) {
case GETACL:
case GETACLCNT:
return 0;
default:
errno = ENOSYS;
return -1;
}
}
real_facl(fd, cmd, nentries, aclbufp);
}
#endif
int creat(const char *path, mode_t mode)
{
return open(path, O_WRONLY | O_CREAT | O_TRUNC, mode);
}

View File

@ -27,9 +27,14 @@
#include <sys/syscall.h>
#endif
#ifdef HAVE_SYS_ACL_H
#include <sys/acl.h>
#endif
#include <stdio.h>
#include <dirent.h>
#include <errno.h>
#include <sys/fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>