summaryrefslogtreecommitdiffstats
path: root/source/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
commit0d8dcfa13c527ec2c8aca39ba49c09e4e694b26c (patch)
tree5e811c2a4419ac3c544291de3fefced4bb367f6a /source/lib
parent72543810ce3eb5ea7b141f957edf38b4c46b1ea4 (diff)
downloadsamba-0d8dcfa13c527ec2c8aca39ba49c09e4e694b26c.tar.gz
samba-0d8dcfa13c527ec2c8aca39ba49c09e4e694b26c.tar.xz
samba-0d8dcfa13c527ec2c8aca39ba49c09e4e694b26c.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
Diffstat (limited to 'source/lib')
-rw-r--r--source/lib/charcnv.c9
-rw-r--r--source/lib/getsmbpass.c13
-rw-r--r--source/lib/kanji.c5
-rw-r--r--source/lib/md4.c2
-rw-r--r--source/lib/ufc.c2
-rw-r--r--source/lib/util.c35
6 files changed, 37 insertions, 29 deletions
diff --git a/source/lib/charcnv.c b/source/lib/charcnv.c
index 049390f2a43..d9ee551d6a8 100644
--- a/source/lib/charcnv.c
+++ b/source/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/source/lib/getsmbpass.c b/source/lib/getsmbpass.c
index 07a7dbfd9b5..7ee8c187885 100644
--- a/source/lib/getsmbpass.c
+++ b/source/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/source/lib/kanji.c b/source/lib/kanji.c
index 0af476eb157..a77bdea73f0 100644
--- a/source/lib/kanji.c
+++ b/source/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/source/lib/md4.c b/source/lib/md4.c
index 485e231a784..bdff075c7e7 100644
--- a/source/lib/md4.c
+++ b/source/lib/md4.c
@@ -295,5 +295,5 @@
** End of md4.c
*/
#else
-void md4_dummy() {;}
+ void md4_dummy() {;}
#endif
diff --git a/source/lib/ufc.c b/source/lib/ufc.c
index 8417285821a..ae48a8776d4 100644
--- a/source/lib/ufc.c
+++ b/source/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/source/lib/util.c b/source/lib/util.c
index d2f03835326..57f2e9240cf 100644
--- a/source/lib/util.c
+++ b/source/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;