At Jeremy's request, here is a version of the POSIX-96 cleanup
patches for the Samba 2.2 branch.
This is exactly the same set of source files and changes as I
submitted yesterday for the 3.0 branch. The only differences
are due to slight differences in the files between 2.2 and 3.0.
Patch is against 2.2.4.
Tested by successfully rebuilding all of 2.2.4 here on Stratus
VOS.
### START OF PATCH ###
diff -urp oldsamba/source/configure.in newsamba/source/configure.in
--- oldsamba/source/configure.inSat Jun 1 07:56:36 2002
+++ newsamba/source/configure.inSat Jun 1 07:56:50 2002
@@ -422,8 +422,9 @@ AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h)
AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h)
AC_CHECK_HEADERS(compat.h rpc/rpc.h rpcsvc/nis.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h)
+AC_CHECK_HEADERS(stdlib.h string.h strings.h syslog.h sys/file.h)
AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h
sys/mode.h)
-AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h
stdlib.h sys/socket.h)
+AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h sys/socket.h)
AC_CHECK_HEADERS(syslog.h sys/syslog.h sys/mount.h sys/vfs.h sys/fs/s5param.h
sys/filsys.h termios.h termio.h)
AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h
sys/sockio.h)
AC_CHECK_HEADERS(security/pam_modules.h security/_pam_macros.h dlfcn.h synch.h
pthread.h nsswitch.h)
diff -urp oldsamba/source/include/includes.h newsamba/source/include/includes.h
--- oldsamba/source/include/includes.h Sat Jun 1 07:47:53 2002
+++ newsamba/source/include/includes.h Sat Jun 1 07:58:05 2002
@@ -205,10 +205,14 @@
#include netinet/in.h
#include arpa/inet.h
#include netdb.h
+
#ifdef HAVE_SYSLOG_H
#include syslog.h
#endif
+
+#ifdef HAVE_SYS_FILE_H
#include sys/file.h
+#endif
#ifdef HAVE_NETINET_TCP_H
#include netinet/tcp.h
diff -urp oldsamba/source/lib/interfaces.c newsamba/source/lib/interfaces.c
--- oldsamba/source/lib/interfaces.cSat Jun 1 14:40:17 2002
+++ newsamba/source/lib/interfaces.cSat Jun 1 14:40:52 2002
@@ -45,7 +45,9 @@
#include net/if.h
#ifndef SIOCGIFCONF
+#ifdef HAVE_SYS_SOCKIO_H
#include sys/sockio.h
+#endif
#endif
#ifdef AUTOCONF_TEST
diff -urp oldsamba/source/lib/util_sock.c newsamba/source/lib/util_sock.c
--- oldsamba/source/lib/util_sock.c Thu May 23 15:54:34 2002
+++ newsamba/source/lib/util_sock.c Thu May 23 15:57:12 2002
@@ -931,7 +931,7 @@ static BOOL matchname(char *remotehost,s
/* Look up the host address in the address list we just got. */
for (i = 0; hp-h_addr_list[i]; i++) {
- if (memcmp(hp-h_addr_list[i], (caddr_t) addr, sizeof(addr)) == 0)
+ if (memcmp(hp-h_addr_list[i], (void *) addr, sizeof(addr)) == 0)
return True;
}
diff -urp oldsamba/source/libsmb/clifile.c newsamba/source/libsmb/clifile.c
--- oldsamba/source/libsmb/clifile.cThu May 23 15:54:46 2002
+++ newsamba/source/libsmb/clifile.cThu May 23 15:57:27 2002
@@ -77,7 +77,7 @@ static BOOL cli_link_internal(struct cli
uint32 unix_perms_to_wire(mode_t perms)
{
-uint ret = 0;
+uint32 ret = 0;
ret |= ((perms S_IXOTH) ? UNIX_X_OTH : 0);
ret |= ((perms S_IWOTH) ? UNIX_W_OTH : 0);
@@ -95,7 +95,7 @@ uint32 unix_perms_to_wire(mode_t perms)
ret |= ((perms S_ISGID) ? UNIX_SET_GID : 0);
#endif
#ifdef S_ISUID
-ret |= ((perms S_ISVTX) ? UNIX_SET_UID : 0);
+ret |= ((perms S_ISUID) ? UNIX_SET_UID : 0);
#endif
return ret;
}
diff -urp oldsamba/source/nsswitch/winbind_nss_config.h
newsamba/source/nsswitch/winbind_nss_config.h
--- oldsamba/source/nsswitch/winbind_nss_config.h Thu May 23 15:55:08 2002
+++ newsamba/source/nsswitch/winbind_nss_config.h Thu May 23 15:58:17 2002
@@ -38,6 +38,10 @@
#include unistd.h
#endif
+#ifdef HAVE_SYS_SELECT_H
+#include sys/select.h
+#endif
+
#ifdef HAVE_SYS_SOCKET_H
#include sys/socket.h
#endif
diff -urp oldsamba/source/pam_smbpass/general.h newsamba/source/pam_smbpass/general.h
--- oldsamba/source/pam_smbpass/general.h Sat Jun 1 09:02:05 2002
+++ newsamba/source/pam_smbpass/general.h Sat Jun 1 09:03:00 2002
@@ -11,11 +11,14 @@
#include stdio.h
#include stdlib.h
-#include syslog.h
#include unistd.h
#include sys/types.h
#include sys/stat.h
#include sys/wait.h
+
+#ifdef HAVE_SYSLOG_H
+#include syslog.h
+#endif
/*
* here is the string to inform the user that the new passwords they
diff -urp oldsamba/source/rpc_server/srv_spoolss_nt.c
newsamba/source/rpc_server/srv_spoolss_nt.c
--- oldsamba/source/rpc_server/srv_spoolss_nt.c Thu May 23 15:55:38 2002
+++ newsamba/source/rpc_server/srv_spoolss_nt.c Thu May 23 15:59:14 2002
@@ -7886,7 +7886,7 @@ static WERROR getprintprocessordirectory