1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

fixed some stuff for Linux that porting to Solaris broke

This commit is contained in:
Andrew Tridgell 0001-01-01 00:00:00 +00:00
parent 8d74f7bfdc
commit ee349bb329
6 changed files with 427 additions and 414 deletions

View File

@ -350,8 +350,8 @@ bin/smbtorture: $(SMBTORTURE_OBJ)
@$(CC) $(FLAGS) -o $@ $(SMBTORTURE_OBJ) $(LDFLAGS) $(LIBS)
smbwrapper/smbwrapper.so: $(PICOBJS)
@echo Linking $@
$(LD) -G -o $@ $(PICOBJS)
@echo Linking shared library $@
@$(LD) @LDSHFLAGS@ -o $@ $(PICOBJS)
install: installbin installman installscripts installcp installswat

666
source/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -7,12 +7,15 @@ AC_PROG_CC
AC_PROG_INSTALL
AC_SUBST(SHELL)
AC_SUBST(MPROGS)
AC_SUBST(LDSHFLAGS)
AC_PROG_AWK
AC_CANONICAL_SYSTEM
case "$host_os" in
*linux*) AC_DEFINE(LINUX);;
*solaris*) AC_DEFINE(SUNOS5);;
*linux*) AC_DEFINE(LINUX)
LDSHFLAGS="-shared";;
*solaris*) AC_DEFINE(SUNOS5)
LDSHFLAGS="-G";;
*sunos*) AC_DEFINE(SUNOS4);;
*irix*) AC_DEFINE(IRIX);;
*aix*) AC_DEFINE(AIX);;

View File

@ -35,90 +35,94 @@
#ifdef HAVE__OPENDIR
#define real_opendir(fn) (_opendir(fn))
#elif SYS_opendir
#define real_opendir(fn) ((DIR *)syscall(SYS_opendir,(fn)))
#elif HAVE___OPENDIR
#define real_opendir(fn) (__opendir(fn))
#else
#define real_opendir(fn) ((DIR *)syscall(SYS_opendir,(fn)))
#endif
#ifdef HAVE__READDIR
#define real_readdir(d) (_readdir(d))
#elif SYS_readdir
#define real_readdir(d) (syscall(SYS_readdir,(d)))
#elif HAVE___READDIR
#define real_readdir(d) (__readdir(d))
#else
#define real_readdir(d) (syscall(SYS_readdir,(d)))
#endif
#ifdef HAVE__TELLDIR
#define real_telldir(d) (_telldir(d))
#elif HAVE___TELLDIR
#define real_telldir(d) (__telldir(d))
#else
#define real_telldir(d) (syscall(SYS_telldir,(d)))
#endif
#ifdef HAVE__CLOSEDIR
#define real_closedir(d) (_closedir(d))
#elif SYS_closedir
#define real_closedir(d) (syscall(SYS_closedir,(d)))
#elif HAVE___CLOSEDIR
#define real_closedir(d) (__closedir(d))
#else
#define real_closedir(d) (syscall(SYS_closedir,(d)))
#endif
#ifdef HAVE__SEEKDIR
#define real_seekdir(d,l) (_seekdir(d,l))
#elif SYS_seekdir
#define real_seekdir(d,l) (syscall(SYS_seekdir,(d),(l)))
#elif HAVE___SEEKDIR
#define real_seekdir(d) (__seekdir(d,l))
#else
#define real_seekdir(d,l) (syscall(SYS_seekdir,(d),(l)))
#define NO_SEEKDIR
#endif
#ifdef HAVE__TELLDIR
#define real_telldir(d) (_telldir(d))
#elif SYS_telldir
#define real_telldir(d) (syscall(SYS_telldir,(d)))
#elif HAVE___TELLDIR
#define real_telldir(d) (__telldir(d))
#else
#define NO_TELLDIR
#endif
#ifdef HAVE__DUP
#define real_dup(d) (_dup(d))
#elif SYS_dup
#define real_dup(d) (syscall(SYS_dup,(d)))
#elif HAVE___DUP
#define real_dup(d) (__dup(d))
#else
#define real_dup(d) (syscall(SYS_dup,(d)))
#endif
#ifdef HAVE__DUP2
#define real_dup2(d1,d2) (_dup2(d1,d2))
#elif SYS_dup2
#define real_dup2(d1,d2) (syscall(SYS_dup2,(d1),(d2)))
#elif HAVE___DUP2
#define real_dup2(d1,d2) (__dup2(d1,d2))
#else
#define real_dup2(d1,d2) (syscall(SYS_dup2,(d1),(d2)))
#endif
#ifdef HAVE__GETCWD
#define real_getcwd(b,s) (_getcwd(b,s))
#elif SYS_getcwd
#define real_getcwd(b,s) (syscall(SYS_getcwd,(b),(s)))
#elif HAVE___GETCWD
#define real_getcwd(b,s) (__getcwd(b,s))
#else
#define real_getcwd(b,s) (syscall(SYS_getcwd,(b),(s)))
#endif
#ifdef HAVE__STAT
#define real_stat(fn,st) (_stat(fn,st))
#elif SYS_stat
#define real_stat(fn,st) (syscall(SYS_stat,(fn),(st)))
#elif HAVE___STAT
#define real_stat(fn,st) (__stat(fn,st))
#else
#define real_stat(fn,st) (syscall(SYS_stat,(fn),(st)))
#endif
#ifdef HAVE__LSTAT
#define real_lstat(fn,st) (_lstat(fn,st))
#elif SYS_lstat
#define real_lstat(fn,st) (syscall(SYS_lstat,(fn),(st)))
#elif HAVE___LSTAT
#define real_lstat(fn,st) (__lstat(fn,st))
#else
#define real_lstat(fn,st) (syscall(SYS_lstat,(fn),(st)))
#endif
#ifdef HAVE__FSTAT
#define real_fstat(fd,st) (_fstat(fd,st))
#elif SYS_fstat
#define real_fstat(fd,st) (syscall(SYS_fstat,(fd),(st)))
#elif HAVE___FSTAT
#define real_fstat(fd,st) (__fstat(fd,st))
#else
#define real_fstat(fd,st) (syscall(SYS_fstat,(fd),(st)))
#endif

View File

@ -1,6 +1,6 @@
#!/bin/sh
LIBDIR=/home/tridge/samba/source/smbwrapper
LIBDIR=/home/tridge/samba/cvs/source/smbwrapper
# a simple launcher for the smbwrapper.so preloadde library
@ -16,7 +16,7 @@ if [ x$SMBW_PASSWORD = x ]; then
echo password?
read pass
SMBW_PASSWORD=$pass
export
export SMBW_PASSWORD
fi
LD_PRELOAD=$LIBDIR/smbwrapper.so
@ -26,3 +26,4 @@ export PWD
PS1='smbsh$ '
export PS1
bash
echo done

View File

@ -178,16 +178,6 @@ __asm__(".globl __write; __write = write");
return real_chown(name, owner, group);
}
int closedir(DIR *dir)
{
if (smbw_dirp(dir)) {
return smbw_closedir(dir);
}
return real_closedir(dir);
}
#ifdef LINUX
int __fxstat(int vers, int fd, struct stat *st)
{
@ -334,17 +324,6 @@ __asm__(".globl __write; __write = write");
}
void seekdir(DIR *dir, off_t offset)
{
if (smbw_dirp(dir)) {
smbw_seekdir(dir, offset);
return;
}
real_seekdir(dir, offset);
}
#ifdef LINUX
int __xstat(int vers, const char *name, struct stat *st)
{
@ -446,16 +425,6 @@ __asm__(".globl __write; __write = write");
}
off_t telldir(DIR *dir)
{
if (smbw_dirp(dir)) {
return smbw_telldir(dir);
}
return real_telldir(dir);
}
int unlink(const char *name)
{
if (smbw_path(name)) {
@ -475,25 +444,6 @@ __asm__(".globl __write; __write = write");
return real_utime(name, tvp);
}
DIR *opendir(const char *name)
{
if (smbw_path(name)) {
return smbw_opendir(name);
}
return real_opendir(name);
}
struct dirent *readdir(DIR *dir)
{
if (smbw_dirp(dir)) {
return smbw_readdir(dir);
}
return real_readdir(dir);
}
int readlink(char *path, char *buf, size_t bufsize)
{
if (smbw_path(path)) {
@ -566,3 +516,54 @@ __asm__(".globl __write; __write = write");
return real_dup2(oldfd, newfd);
}
DIR *opendir(const char *name)
{
if (smbw_path(name)) {
return smbw_opendir(name);
}
return real_opendir(name);
}
struct dirent *readdir(DIR *dir)
{
if (smbw_dirp(dir)) {
return smbw_readdir(dir);
}
return real_readdir(dir);
}
int closedir(DIR *dir)
{
if (smbw_dirp(dir)) {
return smbw_closedir(dir);
}
return real_closedir(dir);
}
#ifndef NO_TELLDIR
off_t telldir(DIR *dir)
{
if (smbw_dirp(dir)) {
return smbw_telldir(dir);
}
return real_telldir(dir);
}
#endif
#ifndef NO_SEEKDIR
void seekdir(DIR *dir, off_t offset)
{
if (smbw_dirp(dir)) {
smbw_seekdir(dir, offset);
return;
}
real_seekdir(dir, offset);
}
#endif