summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/include/includes.h18
-rw-r--r--source3/lib/interface.c2
-rw-r--r--source3/lib/util.c2
-rw-r--r--source3/smbd/quotas.c20
4 files changed, 28 insertions, 14 deletions
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 <pwdadj.h>
#endif
-#if defined(SHADOW_PWD) && !defined(NETBSD) && !defined(FreeBSD) && !defined(CONVEX)
+#if defined(SHADOW_PWD) && !defined(NETBSD) && !defined(FreeBSD) && !defined(CONVEX) && !defined(__OpenBSD__)
#include <shadow.h>
#endif
@@ -523,7 +523,21 @@ char *mktemp(char *); /* No standard include */
#define HAVE_GETGRNAM 1
#endif
-
+#ifdef __OpenBSD__
+#include <strings.h>
+#include <netinet/tcp.h>
+#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 <strings.h>
diff --git a/source3/lib/interface.c b/source3/lib/interface.c
index 0008ad889d..95c0b9d53c 100644
--- a/source3/lib/interface.c
+++ b/source3/lib/interface.c
@@ -155,7 +155,7 @@ static void get_broadcast(struct in_addr *if_ipaddr,
}
}
}
-#elif defined(__FreeBSD__) || defined(NETBSD) || defined(AMIGA) || defined(_AIX41)
+#elif defined(__FreeBSD__) || defined(NETBSD) || defined(AMIGA) || defined(_AIX41) || defined(__OpenBSD__)
ifc.ifc_len = sizeof(buff);
ifc.ifc_buf = buff;
if (ioctl(sock, SIOCGIFCONF, &ifc) < 0) {
diff --git a/source3/lib/util.c b/source3/lib/util.c
index a6b5d980f9..125db2ed1e 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -3305,7 +3305,7 @@ int open_socket_in(int type, int port, int dlevel,uint32 socket_addr)
bzero((char *)&sock,sizeof(sock));
memcpy((char *)&sock.sin_addr,(char *)hp->h_addr, hp->h_length);
-#if defined(__FreeBSD__) || defined(NETBSD) /* XXX not the right ifdef */
+#if defined(__FreeBSD__) || defined(NETBSD) || defined(__OpenBSD__) /* XXX not the right ifdef */
sock.sin_len = sizeof(sock);
#endif
sock.sin_port = htons( port );
diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c
index 562d8fd5db..8333fa7cf2 100644
--- a/source3/smbd/quotas.c
+++ b/source3/smbd/quotas.c
@@ -546,7 +546,7 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
#else
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
#include <ufs/ufs/quota.h>
#include <machine/param.h>
#elif AIX
@@ -556,7 +556,7 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
#define dqb_curfiles dqb_curinodes
#define dqb_fhardlimit dqb_ihardlimit
#define dqb_fsoftlimit dqb_isoftlimit
-#else /* !__FreeBSD__ && !AIX */
+#else /* !__FreeBSD__ && !AIX && !__OpenBSD__ */
#include <sys/quota.h>
#include <devnm.h>
#endif
@@ -569,7 +569,7 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
uid_t euser_id;
int r;
struct dqblk D;
-#if !defined(__FreeBSD__) && !defined(AIX)
+#if !defined(__FreeBSD__) && !defined(AIX) && !defined(__OpenBSD__)
char dev_disk[256];
struct stat S;
/* find the block device file */
@@ -591,7 +591,7 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
DEBUG(5,("Unable to reset uid to %d\n", user_id));
}
#else /* USE_SETRES */
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
{
/* FreeBSD patches from Marty Moll <martym@arbor.edu> */
uid_t user_id;
@@ -615,17 +615,17 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
/* AIX has both USER and GROUP quotas:
Get the USER quota (ohnielse@fysik.dtu.dk) */
r= quotactl(path,QCMD(Q_GETQUOTA,USRQUOTA),euser_id,(char *) &D);
-#else /* !__FreeBSD__ && !AIX */
+#else /* !__FreeBSD__ && !AIX && !__OpenBSD__ */
r=quotactl(Q_GETQUOTA, dev_disk, euser_id, &D);
-#endif /* !__FreeBSD__ && !AIX */
+#endif /* !__FreeBSD__ && !AIX && !__OpenBSD__ */
#endif /* USE_SETRES */
/* Use softlimit to determine disk space, except when it has been exceeded */
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
*bsize = DEV_BSIZE;
-#else /* !__FreeBSD__ */
+#else /* !__FreeBSD__ && !__OpenBSD__ */
*bsize = 1024;
-#endif /*!__FreeBSD__ */
+#endif /*!__FreeBSD__ && !__OpenBSD__ */
if (r)
{
@@ -641,7 +641,7 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
return(False);
/* Use softlimit to determine disk space, except when it has been exceeded */
if ((D.dqb_curblocks>D.dqb_bsoftlimit)
-#if !defined(__FreeBSD__)
+#if !defined(__FreeBSD__) && !defined(__OpenBSD__)
||((D.dqb_curfiles>D.dqb_fsoftlimit) && (D.dqb_fsoftlimit != 0))
#endif
) {