Makefile: Added AIX targets from Ole Holm Nielsen <Ole.H.Nielsen@uni-c.dk>
authorSamba Release Account <samba-bugs@samba.org>
Tue, 8 Jul 1997 16:54:44 +0000 (16:54 +0000)
committerSamba Release Account <samba-bugs@samba.org>
Tue, 8 Jul 1997 16:54:44 +0000 (16:54 +0000)
chgpasswd.c: Added Samba/GPL notice (for obvious reasons).
clitar.c: Updated Copyright date to include 1997 (for obvious reasons).
getsmbpass.c: Updated Copyright date to include 1997 (for obvious reasons).
includes.h: Added stropts for solaris.
loadparm.c: Changed comment for hide files option.
nameconf.c: Updated Copyright date to include 1997 (for obvious reasons).
nmbd.c: Updated Copyright date to include 1997 (for obvious reasons).
pcap.c: Updated Copyright date to include 1997 (for obvious reasons).
proto.h: Re-added accidentaly deleted smb_shm_ calls.
quotas.c: Added AIX quota patch from Ole Holm Nielsen <ohnielse@fysik.dtu.dk>
server.c: Optimization on calling is_hidden_path. Updated Copyrights.
smb.h: Changed DEFAULT_FILES_TO_HIDE from  "*/.*" to ".*".
smbpass.c: Updated Copyright date to include 1997 (for obvious reasons).
ufc.c: Updated Copyright date to include 1997 (for obvious reasons).
util.c: Added last component code to is_in_path().
Jeremy (jallison@whistle.com)
(This used to be commit 9385ae1005f13c8ed51f1319e3949b5c8571e62d)

15 files changed:
source3/client/clitar.c
source3/include/includes.h
source3/include/proto.h
source3/include/smb.h
source3/lib/getsmbpass.c
source3/lib/ufc.c
source3/lib/util.c
source3/nameconf.c
source3/nmbd/nmbd.c
source3/param/loadparm.c
source3/passdb/smbpass.c
source3/printing/pcap.c
source3/smbd/chgpasswd.c
source3/smbd/quotas.c
source3/smbd/server.c

index cd819ad21fafc5caa1566f9d8069998586512139..5afff63de488721ded55ef95b4221aaead90bfaf 100644 (file)
@@ -2,7 +2,7 @@
    Unix SMB/Netbios implementation.
    Version 1.9.
    Tar Extensions
-   Copyright (C) Ricky Poulten 1995
+   Copyright (C) Ricky Poulten 1995-1997
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 44707673ee14e063ed3aebb5aea9a1e0a93904cc..a5adb350775a021e2b1589d5e1724872455c338a 100644 (file)
@@ -291,6 +291,7 @@ typedef unsigned short mode_t;
 #include <arpa/inet.h>
 #include <rpcsvc/ypclnt.h>
 #include <termios.h>
+#include <sys/stropts.h>
 #ifndef USE_LIBDES
 #include <crypt.h>
 #endif /* USE_LIBDES */
index aae5b3a63b9c9e00a9368d79f7b49af18549bab3..5ba308561fa28e15d1f63c28d189ee406da53883 100644 (file)
@@ -736,6 +736,9 @@ BOOL smb_shm_unlock_hash_entry( unsigned int entry );
 BOOL smb_shm_get_usage(int *bytes_free,
                   int *bytes_used,
                   int *bytes_overhead);
+smb_shm_offset_t smb_shm_alloc(int size);
+smb_shm_offset_t smb_shm_addr2offset(void *addr);
+smb_shm_offset_t smb_shm_get_userdef_off(void);
 
 /*The following definitions come from  smbencrypt.c  */
 
@@ -951,7 +954,6 @@ void ajt_panic(void);
 char *readdirname(void *p);
 BOOL is_hidden_path(int snum, char *name);
 BOOL is_vetoed_name(int snum, char *name);
-BOOL is_in_path(char *name, char *namelist);
 BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type);
 int file_lock(char *name,int timeout);
 void file_unlock(int fd);
index d4ad9105fe51ee9c1f1f579a475c5195b0f0793d..463dcb137300c96a4f0de8502fed909843db48fe 100644 (file)
@@ -916,6 +916,6 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 #define COPYBUF_SIZE (8*1024)
 
 /* service-based parameter - files are not visible, but are accessible */
-#define DEFAULT_FILES_TO_HIDE "*/.*"
+#define DEFAULT_FILES_TO_HIDE ".*"
 
 /* _SMB_H */
index 7ee8c18788543dbf3b15ee594175badb665090c6..9008d40f910b07cd5ee2103c4ce5aa23327e4c1e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
+/* Copyright (C) 1992-1997 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
index 67b0c6920a486c42665a9bef9ba8b34d6295d281..0fa5cfd3a0f231d2b2e7a83698d15cf0162dc651 100644 (file)
@@ -21,7 +21,7 @@
 /*
  * UFC-crypt: ultra fast crypt(3) implementation
  *
- * Copyright (C) 1991, 1992, Free Software Foundation, Inc.
+ * Copyright (C) 1991-1997, Free Software Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
index 0ee6947d098be82d7ddcf4ea4c26bee2c28d3332..f31ae390aa481733b81b10e97bee6459db93bc99 100644 (file)
@@ -3432,32 +3432,33 @@ char *readdirname(void *p)
   return(dname);
 }
 
+/*
+ * Utility function used by is_hidden_path() and is_vetoed_name()
+ * to decide if the last component of a path matches a (possibly
+ * wildcarded) entry in a namelist.
+ */
 
-BOOL is_hidden_path(int snum, char *name)
-{
-   return is_in_path(name, lp_hide_files(snum));
-}
-
-BOOL is_vetoed_name(int snum, char *name)
-{
-   return is_in_path(name, lp_veto_files(snum));
-}
-
-BOOL is_in_path(char *name, char *namelist)
+static BOOL is_in_path(char *name, char *namelist)
 {
-
+  pstring last_component;
+  char *p;
   char *nameptr = namelist;
   char *name_end;
 
   DEBUG(5, ("is_in_path: %s list: %s\n", name, namelist));
 
   /* if we have no list it's obviously not in the path */
-  if((nameptr == NULL ) || (*nameptr == '\0')) 
+  if((nameptr == NULL ) || ((nameptr != NULL) && (*nameptr == '\0'))) 
   {
     DEBUG(5,("is_in_path: no name list.  return False\n"));
     return False;
   }
 
+  /* Get the last component of the unix name. */
+  p = strrchr(name, '/');
+  strncpy(last_component, p ? p : name, sizeof(last_component)-1);
+  last_component[sizeof(last_component)-1] = '\0'; 
+
   /* now, we need to find the names one by one and check them
      they can contain spaces and all sorts of stuff so we
      separate them with of all things '\' which can never be in a filename
@@ -3470,9 +3471,6 @@ BOOL is_in_path(char *name, char *namelist)
      that unix_convert is called before check_path and dos_mode.
      unix_convert changes, in the path, all dos '\'s to unix '/'s.
 
-     therefore, users might want to match against '/'s in the path,
-     and therefore '\' must be used as the separator.
-
      the alternatives are:
 
      1) move all check_path and dos_mode calls to before the
@@ -3502,7 +3500,7 @@ BOOL is_in_path(char *name, char *namelist)
       }
 
       /* look for a match. */
-      if (mask_match(name, nameptr, case_sensitive, False))
+      if (mask_match(last_component, nameptr, case_sensitive, False))
       {
          DEBUG(5,("is_in_path: mask match succeeded\n"));
          return True;
@@ -3524,6 +3522,16 @@ BOOL is_in_path(char *name, char *namelist)
   return False;
 }
 
+BOOL is_hidden_path(int snum, char *name)
+{
+   return is_in_path(name, lp_hide_files(snum));
+}
+
+BOOL is_vetoed_name(int snum, char *name)
+{
+   return is_in_path(name, lp_veto_files(snum));
+}
+
 /****************************************************************************
 routine to do file locking
 ****************************************************************************/
index 8f33419b9ac708c19b394eb8c9702b0dc93dbd29..190687806110471420303e8249e9df9db7c3912b 100644 (file)
@@ -2,7 +2,7 @@
    Unix SMB/Netbios implementation.
    Version 1.9.
    NBT netbios routines and daemon - version 2
-   Copyright (C) David Chappell 1996
+   Copyright (C) David Chappell 1996-1997
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
index 75544535af2f3cb0f269bf1e51a53b8480ed6676..bf298293178f38f98a1fd855fb79ec9f519e55de 100644 (file)
@@ -491,7 +491,7 @@ static void usage(char *pname)
     }
 
   DEBUG(1,("%s netbios nameserver version %s started\n",timestring(),VERSION));
-  DEBUG(1,("Copyright Andrew Tridgell 1994\n"));
+  DEBUG(1,("Copyright Andrew Tridgell 1994-1997\n"));
 
   get_myname(myhostname,NULL);
 
index dbe711eac6df9b3d69a2af0a7f08d69bf08e89ac..af6c4657bfa52077fc27ff4e13b31bb5ecce3b24 100644 (file)
@@ -293,7 +293,7 @@ static service sDefault =
   NULL,    /* szMagicOutput */
   NULL,    /* szMangledMap */
   NULL,    /* szVetoFiles */
-  DEFAULT_FILES_TO_HIDE,    /* szVetoFiles */
+  DEFAULT_FILES_TO_HIDE,    /* szHideFiles */
   NULL,    /* comment */
   NULL,    /* force user */
   NULL,    /* force group */
index 275ad5e353bbb848956f0b1d5f4a8d76a624e18c..a31a10cef4b8984746bf5976ae530740d7c220a7 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef SMB_PASSWD
 /*
  * Unix SMB/Netbios implementation. Version 1.9. SMB parameters and setup
- * Copyright (C) Andrew Tridgell 1992-1995 Modified by Jeremy Allison 1995.
+ * Copyright (C) Andrew Tridgell 1992-1997 Modified by Jeremy Allison 1995.
  * 
  * This program is free software; you can redistribute it and/or modify it under
  * the terms of the GNU General Public License as published by the Free
index 13b850b3f5b3ec8b04b4d8a132568307eab78c09..549ebcd70df6b63d63efe426232325f4f82357af 100644 (file)
@@ -2,7 +2,7 @@
    Unix SMB/Netbios implementation.
    Version 1.9.
    printcap parsing
-   Copyright (C) Karl Auer 1993,1994
+   Copyright (C) Karl Auer 1993-1997
 
    Re-working by Martin Kiff, 1994
    
index 79ea66253dc04f3877a015a362c139e521ecbce6..6063f2aac8a1662f601eb54d4191cdd31b2b9310 100644 (file)
@@ -1,3 +1,24 @@
+/* 
+   Unix SMB/Netbios implementation.
+   Version 1.9.
+   Samba utility functions
+   Copyright (C) Andrew Tridgell 1992-1997
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
 /* fork a child process to exec passwd and write to its
 * tty to change a users password. This is running as the
 * user who is attempting to change the password.
@@ -38,22 +59,22 @@ extern int DEBUGLEVEL;
 static int findpty(char **slave)
 {
   int master;
-#ifdef SVR4
+#if defined(SVR4) || defined(SUNOS5)
   extern char *ptsname();
-#else
+#else /* defined(SVR4) || defined(SUNOS5) */
   static char line[12];
   void *dirp;
   char *dpname;
-#endif
+#endif /* defined(SVR4) || defined(SUNOS5) */
   
-#ifdef SVR4
+#if defined(SVR4) || defined(SUNOS5)
   if ((master = open("/dev/ptmx", O_RDWR)) >= 1) {
     grantpt(master);
     unlockpt(master);
     *slave = ptsname(master);
     return (master);
   }
-#else
+#else /* defined(SVR4) || defined(SUNOS5) */
   strcpy( line, "/dev/ptyXX" );
 
   dirp = OpenDir(-1, "/dev", True);
@@ -73,7 +94,7 @@ static int findpty(char **slave)
     }
   }
   CloseDir(dirp);
-#endif
+#endif /* defined(SVR4) || defined(SUNOS5) */
   return (-1);
 }
 
@@ -87,9 +108,9 @@ static int dochild(int master,char *slavedev, char *name, char *passwordprogram)
 
 #ifdef USE_SETRES
   setresuid(0,0,0);
-#else
+#else /* USE_SETRES */
   setuid(0);
-#endif
+#endif /* USE_SETRES */
 
   /* Start new session - gets rid of controlling terminal. */
   if (setsid() < 0) {
@@ -103,15 +124,15 @@ static int dochild(int master,char *slavedev, char *name, char *passwordprogram)
             slavedev));
     return(False);
   }
-#ifdef SVR4
+#if defined(SVR4) || defined(SUNOS5)
   ioctl(slave, I_PUSH, "ptem");
   ioctl(slave, I_PUSH, "ldterm");
-#else
+#else /* defined(SVR4) || defined(SUNOS5) */
   if (ioctl(slave,TIOCSCTTY,0) <0) {
      DEBUG(3,("Error in ioctl call for slave pty\n"));
      /* return(False); */
   }
-#endif
+#endif /* defined(SVR4) || defined(SUNOS5) */
 
   /* Close master. */
   close(master);
index e6a6f6156891799141e563ab65d46f3ea33947f2..262eea31004931699749c9d0a9472bb92a8e8b49 100644 (file)
@@ -367,7 +367,14 @@ DEBUG(5,("disk_quotas for path \"%s\" returning  bsize %d, dfree %d, dsize %d\n"
 
 #ifdef        __FreeBSD__
 #include <ufs/ufs/quota.h>
-#else
+#elif         AIX
+/* AIX quota patch from Ole Holm Nielsen <ohnielse@fysik.dtu.dk> */
+#include <jfs/quota.h>
+/* AIX 4.X: Rename members of the dqblk structure (ohnielse@fysik.dtu.dk) */
+#define dqb_curfiles dqb_curinodes
+#define dqb_fhardlimit dqb_ihardlimit
+#define dqb_fsoftlimit dqb_isoftlimit
+#else /* !__FreeBSD__ && !AIX */
 #include <sys/quota.h>
 #include <devnm.h>
 #endif
@@ -380,7 +387,7 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
   uid_t euser_id;
   int r;
   struct dqblk D;
-#ifndef __FreeBSD__
+#if !defined(__FreeBSD__) && !defined(AIX)
   char dev_disk[256];
   struct stat S;
   /* find the block device file */
@@ -401,13 +408,17 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
     if (setresuid(user_id,-1,-1))
       DEBUG(5,("Unable to reset uid to %d\n", user_id));
   }
-#else
+#else /* USE_SETRES */
 #if defined(__FreeBSD__)
   r= quotactl(path,Q_GETQUOTA,euser_id,(char *) &D);
-#else
+#elif defined(AIX)
+  /* 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 */
   r=quotactl(Q_GETQUOTA, dev_disk, euser_id, &D);
-#endif
-#endif
+#endif /* !__FreeBSD__ && !AIX */
+#endif /* USE_SETRES */
 
   /* Use softlimit to determine disk space, except when it has been exceeded */
   *bsize = 1024;
index 0361c5aa4679df86de41aa0f222121781e933d29..768c7c71bcab8328d09feed172a956eee3116e71 100644 (file)
@@ -224,7 +224,9 @@ int dos_mode(int cnum,char *path,struct stat *sbuf)
        result |= aHIDDEN;
     }
 
-  if (is_hidden_path(SNUM(cnum), path))
+  /* Optimization : Only call is_hidden_path if it's not already
+     hidden. */
+  if (!(result & aHIDDEN) && is_hidden_path(SNUM(cnum), path))
   {
     result |= aHIDDEN;
   }
@@ -4189,7 +4191,7 @@ static void usage(char *pname)
   reopen_logs();
 
   DEBUG(2,("%s smbd version %s started\n",timestring(),VERSION));
-  DEBUG(2,("Copyright Andrew Tridgell 1992-1995\n"));
+  DEBUG(2,("Copyright Andrew Tridgell 1992-1997\n"));
 
 #ifndef NO_GETRLIMIT
 #ifdef RLIMIT_NOFILE