summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1996-06-04 06:42:03 +0000
committerAndrew Tridgell <tridge@samba.org>1996-06-04 06:42:03 +0000
commita2c1623827406667a4f2f058c24f1d971f6627f8 (patch)
tree22350c4c3fe902a1b573612d40a6ca4d2be51856 /source3/lib
parent81e398963dbaed9c6661c336fe98329098576b94 (diff)
downloadsamba-a2c1623827406667a4f2f058c24f1d971f6627f8.tar.gz
samba-a2c1623827406667a4f2f058c24f1d971f6627f8.tar.bz2
samba-a2c1623827406667a4f2f058c24f1d971f6627f8.zip
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)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/charcnv.c9
-rw-r--r--source3/lib/getsmbpass.c13
-rw-r--r--source3/lib/kanji.c5
-rw-r--r--source3/lib/md4.c2
-rw-r--r--source3/lib/ufc.c2
-rw-r--r--source3/lib/util.c35
6 files changed, 37 insertions, 29 deletions
diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c
index 049390f2a4..d9ee551d6a 100644
--- a/source3/lib/charcnv.c
+++ b/source3/lib/charcnv.c
@@ -71,8 +71,7 @@ static void initiso() {
/*
* Convert unix to dos
*/
-char *
-unix2dos_format(char *str,BOOL overwrite)
+char *unix2dos_format(char *str,BOOL overwrite)
{
char *p;
char *dp;
@@ -91,8 +90,7 @@ unix2dos_format(char *str,BOOL overwrite)
/*
* Convert dos to unix
*/
-char *
-dos2unix_format (char *str, BOOL overwrite)
+char *dos2unix_format(char *str, BOOL overwrite)
{
char *p;
char *dp;
@@ -112,8 +110,7 @@ dos2unix_format (char *str, BOOL overwrite)
/*
* Interpret character set.
*/
-int
-interpret_character_set (char *str, int def)
+int interpret_character_set(char *str, int def)
{
if (strequal (str, "iso8859-1")) {
diff --git a/source3/lib/getsmbpass.c b/source3/lib/getsmbpass.c
index 07a7dbfd9b..7ee8c18788 100644
--- a/source3/lib/getsmbpass.c
+++ b/source3/lib/getsmbpass.c
@@ -40,12 +40,12 @@ static struct termio t;
#define TCSANOW 0
#endif
-int tcgetattr(int fd, struct termio *t)
+ int tcgetattr(int fd, struct termio *t)
{
return ioctl(fd, TCGETA, t);
}
-int tcsetattr(int fd, int flags, const struct termio *t)
+ int tcsetattr(int fd, int flags, const struct termio *t)
{
if(flags & TCSAFLUSH)
ioctl(fd, TCFLSH, TCIOFLUSH);
@@ -71,12 +71,12 @@ static struct sgttyb t;
#define TCSANOW 0
#endif
-int tcgetattr(int fd, struct sgttyb *t)
+ int tcgetattr(int fd, struct sgttyb *t)
{
return ioctl(fd, TIOCGETP, (char *)t);
}
-int tcsetattr(int fd, int flags, const struct sgttyb *t)
+ int tcsetattr(int fd, int flags, const struct sgttyb *t)
{
return ioctl(fd, TIOCSETP, (char *)t);
}
@@ -92,8 +92,7 @@ static struct termios t;
#endif /* BSD_TERMIO */
#endif /* SYSV_TERMIO */
-char *
-getsmbpass(char *prompt)
+char *getsmbpass(char *prompt)
{
FILE *in, *out;
int echo_off;
@@ -162,5 +161,5 @@ getsmbpass(char *prompt)
#else
-void getsmbpasswd_dummy() {;}
+ void getsmbpasswd_dummy() {;}
#endif
diff --git a/source3/lib/kanji.c b/source3/lib/kanji.c
index 0af476eb15..a77bdea73f 100644
--- a/source3/lib/kanji.c
+++ b/source3/lib/kanji.c
@@ -796,8 +796,7 @@ setup_string_function (int codes)
/*
* Interpret coding system.
*/
-int
-interpret_coding_system (char *str, int def)
+int interpret_coding_system(char *str, int def)
{
int codes = def;
@@ -890,6 +889,6 @@ interpret_coding_system (char *str, int def)
return setup_string_function (codes);
}
#else
-int kanji_dummy_procedure(void)
+ int kanji_dummy_procedure(void)
{return 0;}
#endif /* KANJI */
diff --git a/source3/lib/md4.c b/source3/lib/md4.c
index 485e231a78..bdff075c7e 100644
--- a/source3/lib/md4.c
+++ b/source3/lib/md4.c
@@ -295,5 +295,5 @@
** End of md4.c
*/
#else
-void md4_dummy() {;}
+ void md4_dummy() {;}
#endif
diff --git a/source3/lib/ufc.c b/source3/lib/ufc.c
index 8417285821..ae48a8776d 100644
--- a/source3/lib/ufc.c
+++ b/source3/lib/ufc.c
@@ -777,6 +777,6 @@ ufc_long *_ufc_doit(l1, l2, r1, r2, itr)
#else
-int ufc_dummy_procedure(void)
+ int ufc_dummy_procedure(void)
{return 0;}
#endif
diff --git a/source3/lib/util.c b/source3/lib/util.c
index d2f0383532..57f2e9240c 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -182,10 +182,10 @@ write an debug message on the debugfile. This is called by the DEBUG
macro
********************************************************************/
#ifdef __STDC__
-int Debug1(char *format_str, ...)
+ int Debug1(char *format_str, ...)
{
#else
-int Debug1(va_alist)
+ int Debug1(va_alist)
va_dcl
{
char *format_str;
@@ -3234,7 +3234,7 @@ void *Realloc(void *p,int size)
/****************************************************************************
duplicate a string
****************************************************************************/
-char *strdup(char *s)
+ char *strdup(char *s)
{
char *ret = NULL;
if (!s) return(NULL);
@@ -3260,7 +3260,7 @@ void Abort(void )
/****************************************************************************
a replacement strlen() that returns int for solaris
****************************************************************************/
-int Strlen(char *s)
+ int Strlen(char *s)
{
int ret=0;
if (!s) return(0);
@@ -3274,7 +3274,7 @@ int Strlen(char *s)
/*******************************************************************
ftruncate for operating systems that don't have it
********************************************************************/
-int ftruncate(int f,long l)
+ int ftruncate(int f,long l)
{
struct flock fl;
@@ -3382,7 +3382,7 @@ int open_socket_in(int type, int port, int dlevel)
if (bind(res, (struct sockaddr * ) &sock,sizeof(sock)) < 0)
{
if (port) {
- if (port == 139 || port == 137)
+ if (port == SMB_PORT || port == NMB_PORT)
DEBUG(dlevel,("bind failed on port %d (%s)\n",
port,strerror(errno)));
close(res);
@@ -3570,6 +3570,21 @@ void standard_sub_basic(char *s)
/*******************************************************************
+are two IPs on the same subnet?
+********************************************************************/
+BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask)
+{
+ unsigned long net1,net2,nmask;
+
+ nmask = ntohl(mask.s_addr);
+ net1 = ntohl(ip1.s_addr);
+ net2 = ntohl(ip2.s_addr);
+
+ return((net1 & nmask) == (net2 & nmask));
+}
+
+
+/*******************************************************************
write a string in unicoode format
********************************************************************/
int PutUniCode(char *dst,char *src)
@@ -3797,7 +3812,7 @@ long nap(long milliseconds) {
/****************************************************************************
some systems don't have an initgroups call
****************************************************************************/
-int initgroups(char *name,gid_t id)
+ int initgroups(char *name,gid_t id)
{
#ifdef NO_SETGROUPS
/* yikes! no SETGROUPS or INITGROUPS? how can this work? */
@@ -3981,8 +3996,7 @@ time_t Mktime(struct tm *t)
#ifdef REPLACE_RENAME
/* Rename a file. (from libiberty in GNU binutils) */
-int
-rename (zfrom, zto)
+ int rename (zfrom, zto)
const char *zfrom;
const char *zto;
{
@@ -4003,8 +4017,7 @@ rename (zfrom, zto)
/*
* Search for a match in a netgroup. This replaces it on broken systems.
*/
-int InNetGr(group, host, user, dom)
- char *group, *host, *user, *dom;
+int InNetGr(char *group,char *host,char *user,char *dom)
{
char *hst, *usr, *dm;