mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
Fixup passdb stuff to add new nisplus and ldap backends.
Jeremy.
This commit is contained in:
parent
322ba52f71
commit
611bf806d5
@ -171,8 +171,9 @@ RPC_CLIENT_OBJ = rpc_client/cli_netlogon.o rpc_client/cli_pipe.o \
|
||||
LOCKING_OBJ = locking/locking.o locking/brlock.o locking/posix.o
|
||||
|
||||
PASSDB_OBJ = passdb/passdb.o passdb/secrets.o \
|
||||
passdb/machine_sid.o passdb/pdb_smbpasswd.o \
|
||||
passdb/pdb_tdb.o
|
||||
passdb/machine_sid.o passdb/pdb_smbpasswd.o \
|
||||
passdb/pdb_tdb.o passdb/pdb_ldap.o \
|
||||
passdb/pdb_nisplus.o
|
||||
|
||||
GROUPDB_OBJ = groupdb/mapping.o
|
||||
|
||||
|
@ -165,7 +165,10 @@
|
||||
#undef MMAP_BLACKLIST
|
||||
#undef HAVE_IMMEDIATE_STRUCTURES
|
||||
#undef HAVE_CUPS
|
||||
#undef WITH_TDBSAM
|
||||
#undef WITH_LDAP_SAM
|
||||
#undef WITH_NISPLUS_SAM
|
||||
#undef WITH_SMBPASSWD_SAM
|
||||
#undef WITH_TDB_SAM
|
||||
#undef LINUX_QUOTAS_1
|
||||
#undef LINUX_QUOTAS_2
|
||||
#undef PACKAGE
|
||||
|
1680
source/configure
vendored
1680
source/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -1756,7 +1756,7 @@ AC_ARG_WITH(tdbsam,
|
||||
[ case "$withval" in
|
||||
yes)
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(WITH_TDBSAM)
|
||||
AC_DEFINE(WITH_TDB_SAM)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(no)
|
||||
@ -1767,14 +1767,15 @@ AC_ARG_WITH(tdbsam,
|
||||
|
||||
#################################################
|
||||
# check for a LDAP password database
|
||||
AC_MSG_CHECKING(whether to use LDAP password database)
|
||||
AC_ARG_WITH(ldap,
|
||||
[ --with-ldapsam Include Experimental LDAP-Sam support (default=no)],
|
||||
AC_MSG_CHECKING(whether to use LDAP SAM database)
|
||||
AC_ARG_WITH(ldapsam,
|
||||
[ --with-ldapsam Include experimental LDAP SAM support (default=no)],
|
||||
[ case "$withval" in
|
||||
yes)
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(WITH_LDAP)
|
||||
AC_MSG_ERROR([LDAP password database not supported in this version.])
|
||||
AC_DEFINE(WITH_LDAP_SAM)
|
||||
LIBS="-lldap -llber -lresolv $LIBS"
|
||||
with_smbpasswd_sam=no
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(no)
|
||||
@ -1784,23 +1785,22 @@ AC_ARG_WITH(ldap,
|
||||
)
|
||||
|
||||
#################################################
|
||||
# commented out by --jerry
|
||||
# check for a NISPLUS password database
|
||||
#AC_MSG_CHECKING(whether to use NISPLUS password database)
|
||||
#AC_ARG_WITH(nisplus,
|
||||
#[ --with-nisplus Include NISPLUS password database support
|
||||
#[ case "$withval" in
|
||||
# yes)
|
||||
# AC_MSG_RESULT(yes)
|
||||
# AC_DEFINE(WITH_NISPLUS)
|
||||
# ;;
|
||||
# *)
|
||||
# AC_MSG_RESULT(no)
|
||||
# ;;
|
||||
# esac ],
|
||||
# AC_MSG_RESULT(no)
|
||||
#)
|
||||
|
||||
AC_MSG_CHECKING(whether to use NISPLUS SAM database)
|
||||
AC_ARG_WITH(nisplussam,
|
||||
[ --with-nisplussam Include NISPLUS SAM support (default=no)],
|
||||
[ case "$withval" in
|
||||
yes)
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(WITH_NISPLUS_SAM)
|
||||
with_smbpasswd_sam=no
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
esac ],
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
#################################################
|
||||
# check for a NISPLUS_HOME support
|
||||
AC_MSG_CHECKING(whether to use NISPLUS_HOME)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* include/config.h.in. Generated automatically from configure.in by autoheader 2.13. */
|
||||
/* include/config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
/* Define if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
@ -7,6 +7,9 @@
|
||||
#undef _ALL_SOURCE
|
||||
#endif
|
||||
|
||||
/* Define if using alloca.c. */
|
||||
#undef C_ALLOCA
|
||||
|
||||
/* Define if type char is unsigned and you are not using gcc. */
|
||||
#ifndef __CHAR_UNSIGNED__
|
||||
#undef __CHAR_UNSIGNED__
|
||||
@ -15,9 +18,19 @@
|
||||
/* Define to empty if the keyword does not work. */
|
||||
#undef const
|
||||
|
||||
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
|
||||
This function is required for alloca.c support on those systems. */
|
||||
#undef CRAY_STACKSEG_END
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef gid_t
|
||||
|
||||
/* Define if you have alloca, as a function or macro. */
|
||||
#undef HAVE_ALLOCA
|
||||
|
||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||
#undef HAVE_ALLOCA_H
|
||||
|
||||
/* Define if you have a working `mmap' system call. */
|
||||
#undef HAVE_MMAP
|
||||
|
||||
@ -42,12 +55,24 @@
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef pid_t
|
||||
|
||||
/* Define if you need to in order for stat and other things to work. */
|
||||
#undef _POSIX_SOURCE
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
#undef size_t
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown
|
||||
*/
|
||||
#undef STACK_DIRECTION
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
@ -228,25 +253,20 @@
|
||||
#undef MMAP_BLACKLIST
|
||||
#undef HAVE_IMMEDIATE_STRUCTURES
|
||||
#undef HAVE_CUPS
|
||||
#undef WITH_TDBSAM
|
||||
#undef WITH_LDAP_SAM
|
||||
#undef WITH_NISPLUS_SAM
|
||||
#undef WITH_SMBPASSWD_SAM
|
||||
#undef WITH_TDB_SAM
|
||||
#undef LINUX_QUOTAS_1
|
||||
#undef LINUX_QUOTAS_2
|
||||
|
||||
/* Define to the name of the distribution. */
|
||||
#undef PACKAGE
|
||||
/* Define to the version of the distribution. */
|
||||
#undef VERSION
|
||||
/* Define if your locale.h file contains LC_MESSAGES. */
|
||||
#undef HAVE_LC_MESSAGES
|
||||
/* Define to 1 if NLS is requested. */
|
||||
#undef ENABLE_NLS
|
||||
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
|
||||
#undef HAVE_CATGETS
|
||||
#undef HAVE_GETTEXT
|
||||
/* Define as 1 if you have the stpcpy function. */
|
||||
#undef HAVE_STPCPY
|
||||
/* ???? (rkawa) */
|
||||
#undef I18N_SWAT
|
||||
/* Define to the default SWAT language for old browsers. */
|
||||
#undef I18N_DEFAULT_PREF_LANG
|
||||
|
||||
/* The number of bytes in a int. */
|
||||
@ -261,6 +281,15 @@
|
||||
/* Define if you have the __acl function. */
|
||||
#undef HAVE___ACL
|
||||
|
||||
/* Define if you have the __argz_count function. */
|
||||
#undef HAVE___ARGZ_COUNT
|
||||
|
||||
/* Define if you have the __argz_next function. */
|
||||
#undef HAVE___ARGZ_NEXT
|
||||
|
||||
/* Define if you have the __argz_stringify function. */
|
||||
#undef HAVE___ARGZ_STRINGIFY
|
||||
|
||||
/* Define if you have the __chdir function. */
|
||||
#undef HAVE___CHDIR
|
||||
|
||||
@ -501,6 +530,9 @@
|
||||
/* Define if you have the crypt16 function. */
|
||||
#undef HAVE_CRYPT16
|
||||
|
||||
/* Define if you have the dcgettext function. */
|
||||
#undef HAVE_DCGETTEXT
|
||||
|
||||
/* Define if you have the dup2 function. */
|
||||
#undef HAVE_DUP2
|
||||
|
||||
@ -570,6 +602,9 @@
|
||||
/* Define if you have the getnetgrent function. */
|
||||
#undef HAVE_GETNETGRENT
|
||||
|
||||
/* Define if you have the getpagesize function. */
|
||||
#undef HAVE_GETPAGESIZE
|
||||
|
||||
/* Define if you have the getprpwnam function. */
|
||||
#undef HAVE_GETPRPWNAM
|
||||
|
||||
@ -615,6 +650,9 @@
|
||||
/* Define if you have the mktime function. */
|
||||
#undef HAVE_MKTIME
|
||||
|
||||
/* Define if you have the munmap function. */
|
||||
#undef HAVE_MUNMAP
|
||||
|
||||
/* Define if you have the open64 function. */
|
||||
#undef HAVE_OPEN64
|
||||
|
||||
@ -633,6 +671,9 @@
|
||||
/* Define if you have the pread64 function. */
|
||||
#undef HAVE_PREAD64
|
||||
|
||||
/* Define if you have the putenv function. */
|
||||
#undef HAVE_PUTENV
|
||||
|
||||
/* Define if you have the putprpwnam function. */
|
||||
#undef HAVE_PUTPRPWNAM
|
||||
|
||||
@ -687,6 +728,9 @@
|
||||
/* Define if you have the setlinebuf function. */
|
||||
#undef HAVE_SETLINEBUF
|
||||
|
||||
/* Define if you have the setlocale function. */
|
||||
#undef HAVE_SETLOCALE
|
||||
|
||||
/* Define if you have the setluid function. */
|
||||
#undef HAVE_SETLUID
|
||||
|
||||
@ -723,6 +767,9 @@
|
||||
/* Define if you have the stat64 function. */
|
||||
#undef HAVE_STAT64
|
||||
|
||||
/* Define if you have the stpcpy function. */
|
||||
#undef HAVE_STPCPY
|
||||
|
||||
/* Define if you have the strcasecmp function. */
|
||||
#undef HAVE_STRCASECMP
|
||||
|
||||
@ -780,6 +827,9 @@
|
||||
/* Define if you have the yp_get_default_domain function. */
|
||||
#undef HAVE_YP_GET_DEFAULT_DOMAIN
|
||||
|
||||
/* Define if you have the <argz.h> header file. */
|
||||
#undef HAVE_ARGZ_H
|
||||
|
||||
/* Define if you have the <arpa/inet.h> header file. */
|
||||
#undef HAVE_ARPA_INET_H
|
||||
|
||||
@ -819,6 +869,9 @@
|
||||
/* Define if you have the <locale.h> header file. */
|
||||
#undef HAVE_LOCALE_H
|
||||
|
||||
/* Define if you have the <malloc.h> header file. */
|
||||
#undef HAVE_MALLOC_H
|
||||
|
||||
/* Define if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
@ -840,6 +893,9 @@
|
||||
/* Define if you have the <netinet/tcp.h> header file. */
|
||||
#undef HAVE_NETINET_TCP_H
|
||||
|
||||
/* Define if you have the <nl_types.h> header file. */
|
||||
#undef HAVE_NL_TYPES_H
|
||||
|
||||
/* Define if you have the <nss.h> header file. */
|
||||
#undef HAVE_NSS_H
|
||||
|
||||
@ -1026,6 +1082,9 @@
|
||||
/* Define if you have the gen library (-lgen). */
|
||||
#undef HAVE_LIBGEN
|
||||
|
||||
/* Define if you have the i library (-li). */
|
||||
#undef HAVE_LIBI
|
||||
|
||||
/* Define if you have the iconv library (-liconv). */
|
||||
#undef HAVE_LIBICONV
|
||||
|
||||
|
@ -3763,3 +3763,12 @@ BOOL lp_list_substitute(char **list, const char *pattern, const char *insert)
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
Compatibility fn. for 2.2.2 code.....
|
||||
*****************************************************************/
|
||||
|
||||
void get_private_directory(pstring privdir)
|
||||
{
|
||||
pstrcpy (privdir, lp_private_dir());
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
Unix SMB/Netbios implementation.
|
||||
Version 1.9.
|
||||
Password and authentication handling
|
||||
Copyright (C) Jeremy Allison 1996-1998
|
||||
Copyright (C) Jeremy Allison 1996-2001
|
||||
Copyright (C) Luke Kenneth Casson Leighton 1996-1998
|
||||
Copyright (C) Gerald (Jerry) Carter 2000-2001
|
||||
|
||||
@ -35,62 +35,29 @@ extern DOM_SID global_sam_sid;
|
||||
|
||||
struct passdb_ops *pdb_ops;
|
||||
|
||||
#if 0 /* JERRY */
|
||||
static void* pdb_handle = NULL;
|
||||
#endif
|
||||
|
||||
/***************************************************************
|
||||
Initialize the password db operations.
|
||||
***************************************************************/
|
||||
|
||||
BOOL initialize_password_db(BOOL reload)
|
||||
{
|
||||
/* This function is unfinished right now, so just
|
||||
ignore the details and always return True. It is here
|
||||
only as a placeholder --jerry */
|
||||
{
|
||||
/*
|
||||
* This function is unfinished right now, so just
|
||||
* ignore the details and always return True. It
|
||||
* is here only as a placeholder --jerry
|
||||
*/
|
||||
return True;
|
||||
|
||||
#if _NOT_YET_
|
||||
char* modulename = lp_passdb_module_path();
|
||||
|
||||
/* load another module? */
|
||||
if (reload && pdb_handle)
|
||||
{
|
||||
sys_dlclose (pdb_handle);
|
||||
pdb_handle = NULL;
|
||||
}
|
||||
|
||||
/* do we have a module defined or use the default? */
|
||||
if (strlen (modulename) != 0)
|
||||
{
|
||||
if ((pdb_handle=sys_dlopen (modulename, RTLD_LAZY)) == NULL)
|
||||
{
|
||||
DEBUG(0,("initialize_password_db: ERROR - Unable to open passdb module \"%s\"!\n%s\n",
|
||||
modulename, sys_dlerror()));
|
||||
}
|
||||
else
|
||||
DEBUG(1,("initialize_password_db: passdb module \"%s\" loaded successfully\n", modulename));
|
||||
}
|
||||
|
||||
/* either no module name defined or the one that was failed
|
||||
to open. Let's try the default */
|
||||
if (pdb_handle == NULL)
|
||||
{
|
||||
if ((pdb_handle=sys_dlopen ("libpdbfile.so", RTLD_LAZY)) == NULL)
|
||||
{
|
||||
DEBUG(0,("initialize_password_db: ERROR - Unable to open \"libpdbfile.so\" passdb module! No user authentication possible!\n%s\n",
|
||||
sys_dlerror()));
|
||||
return False;
|
||||
}
|
||||
else
|
||||
DEBUG(1,("initialize_password_db: passdb module \"libpdbfile.so\" loaded successfully\n"));
|
||||
}
|
||||
|
||||
|
||||
return (pdb_handle != NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
initialises a struct sam_disp_info.
|
||||
Initialises a struct sam_disp_info.
|
||||
**************************************************************/
|
||||
|
||||
static void pdb_init_dispinfo(struct sam_disp_info *user)
|
||||
{
|
||||
if (user == NULL)
|
||||
@ -99,8 +66,9 @@ static void pdb_init_dispinfo(struct sam_disp_info *user)
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
alloc memory and initialises a struct sam_passwd.
|
||||
Alloc memory and initialises a struct sam_passwd.
|
||||
************************************************************/
|
||||
|
||||
BOOL pdb_init_sam(SAM_ACCOUNT **user)
|
||||
{
|
||||
if (*user != NULL) {
|
||||
@ -138,8 +106,9 @@ BOOL pdb_init_sam(SAM_ACCOUNT **user)
|
||||
}
|
||||
|
||||
/************************************************************
|
||||
free the SAM_ACCOUNT and the NT/LM hashes.
|
||||
Free the SAM_ACCOUNT and the NT/LM hashes.
|
||||
***********************************************************/
|
||||
|
||||
BOOL pdb_free_sam(SAM_ACCOUNT *user)
|
||||
{
|
||||
if (user == NULL) {
|
||||
@ -158,7 +127,7 @@ BOOL pdb_free_sam(SAM_ACCOUNT *user)
|
||||
}
|
||||
|
||||
/************************************************************
|
||||
reset the SAM_ACCOUNT and the NT/LM hashes.
|
||||
Reset the SAM_ACCOUNT and the NT/LM hashes.
|
||||
***********************************************************/
|
||||
|
||||
BOOL pdb_reset_sam(SAM_ACCOUNT *user)
|
||||
@ -169,7 +138,7 @@ BOOL pdb_reset_sam(SAM_ACCOUNT *user)
|
||||
}
|
||||
|
||||
SAFE_FREE(user->nt_pw);
|
||||
SAFE_FREE(user->lm_pw);
|
||||
SAFE_FREE(user->lm_pw);
|
||||
ZERO_STRUCTP(user);
|
||||
|
||||
return True;
|
||||
@ -178,6 +147,7 @@ BOOL pdb_reset_sam(SAM_ACCOUNT *user)
|
||||
/*************************************************************************
|
||||
Routine to return the next entry in the sam passwd list.
|
||||
*************************************************************************/
|
||||
|
||||
struct sam_disp_info *pdb_sam_to_dispinfo(SAM_ACCOUNT *user)
|
||||
{
|
||||
static struct sam_disp_info disp_info;
|
||||
@ -194,20 +164,146 @@ struct sam_disp_info *pdb_sam_to_dispinfo(SAM_ACCOUNT *user)
|
||||
return &disp_info;
|
||||
}
|
||||
|
||||
/**********************************************************
|
||||
Encode the account control bits into a string.
|
||||
length = length of string to encode into (including terminating
|
||||
null). length *MUST BE MORE THAN 2* !
|
||||
**********************************************************/
|
||||
|
||||
char *pdb_encode_acct_ctrl(uint16 acct_ctrl, size_t length)
|
||||
{
|
||||
static fstring acct_str;
|
||||
size_t i = 0;
|
||||
|
||||
acct_str[i++] = '[';
|
||||
|
||||
if (acct_ctrl & ACB_PWNOTREQ ) acct_str[i++] = 'N';
|
||||
if (acct_ctrl & ACB_DISABLED ) acct_str[i++] = 'D';
|
||||
if (acct_ctrl & ACB_HOMDIRREQ) acct_str[i++] = 'H';
|
||||
if (acct_ctrl & ACB_TEMPDUP ) acct_str[i++] = 'T';
|
||||
if (acct_ctrl & ACB_NORMAL ) acct_str[i++] = 'U';
|
||||
if (acct_ctrl & ACB_MNS ) acct_str[i++] = 'M';
|
||||
if (acct_ctrl & ACB_WSTRUST ) acct_str[i++] = 'W';
|
||||
if (acct_ctrl & ACB_SVRTRUST ) acct_str[i++] = 'S';
|
||||
if (acct_ctrl & ACB_AUTOLOCK ) acct_str[i++] = 'L';
|
||||
if (acct_ctrl & ACB_PWNOEXP ) acct_str[i++] = 'X';
|
||||
if (acct_ctrl & ACB_DOMTRUST ) acct_str[i++] = 'I';
|
||||
|
||||
for ( ; i < length - 2 ; i++ )
|
||||
acct_str[i] = ' ';
|
||||
|
||||
i = length - 2;
|
||||
acct_str[i++] = ']';
|
||||
acct_str[i++] = '\0';
|
||||
|
||||
return acct_str;
|
||||
}
|
||||
|
||||
/**********************************************************
|
||||
Decode the account control bits from a string.
|
||||
**********************************************************/
|
||||
|
||||
uint16 pdb_decode_acct_ctrl(const char *p)
|
||||
{
|
||||
uint16 acct_ctrl = 0;
|
||||
BOOL finished = False;
|
||||
|
||||
/*
|
||||
* Check if the account type bits have been encoded after the
|
||||
* NT password (in the form [NDHTUWSLXI]).
|
||||
*/
|
||||
|
||||
if (*p != '[')
|
||||
return 0;
|
||||
|
||||
for (p++; *p && !finished; p++) {
|
||||
switch (*p) {
|
||||
case 'N': { acct_ctrl |= ACB_PWNOTREQ ; break; /* 'N'o password. */ }
|
||||
case 'D': { acct_ctrl |= ACB_DISABLED ; break; /* 'D'isabled. */ }
|
||||
case 'H': { acct_ctrl |= ACB_HOMDIRREQ; break; /* 'H'omedir required. */ }
|
||||
case 'T': { acct_ctrl |= ACB_TEMPDUP ; break; /* 'T'emp account. */ }
|
||||
case 'U': { acct_ctrl |= ACB_NORMAL ; break; /* 'U'ser account (normal). */ }
|
||||
case 'M': { acct_ctrl |= ACB_MNS ; break; /* 'M'NS logon user account. What is this ? */ }
|
||||
case 'W': { acct_ctrl |= ACB_WSTRUST ; break; /* 'W'orkstation account. */ }
|
||||
case 'S': { acct_ctrl |= ACB_SVRTRUST ; break; /* 'S'erver account. */ }
|
||||
case 'L': { acct_ctrl |= ACB_AUTOLOCK ; break; /* 'L'ocked account. */ }
|
||||
case 'X': { acct_ctrl |= ACB_PWNOEXP ; break; /* No 'X'piry on password */ }
|
||||
case 'I': { acct_ctrl |= ACB_DOMTRUST ; break; /* 'I'nterdomain trust account. */ }
|
||||
case ' ': { break; }
|
||||
case ':':
|
||||
case '\n':
|
||||
case '\0':
|
||||
case ']':
|
||||
default: { finished = True; }
|
||||
}
|
||||
}
|
||||
|
||||
return acct_ctrl;
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Routine to set 32 hex password characters from a 16 byte array.
|
||||
**************************************************************/
|
||||
|
||||
void pdb_sethexpwd(char *p, unsigned char *pwd, uint16 acct_ctrl)
|
||||
{
|
||||
if (pwd != NULL) {
|
||||
int i;
|
||||
for (i = 0; i < 16; i++)
|
||||
slprintf(&p[i*2], 3, "%02X", pwd[i]);
|
||||
} else {
|
||||
if (acct_ctrl & ACB_PWNOTREQ)
|
||||
safe_strcpy(p, "NO PASSWORDXXXXXXXXXXXXXXXXXXXXX", 33);
|
||||
else
|
||||
safe_strcpy(p, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 33);
|
||||
}
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
Routine to get the 32 hex characters and turn them
|
||||
into a 16 byte array.
|
||||
**************************************************************/
|
||||
|
||||
BOOL pdb_gethexpwd(char *p, unsigned char *pwd)
|
||||
{
|
||||
int i;
|
||||
unsigned char lonybble, hinybble;
|
||||
char *hexchars = "0123456789ABCDEF";
|
||||
char *p1, *p2;
|
||||
|
||||
if (!p)
|
||||
return (False);
|
||||
|
||||
for (i = 0; i < 32; i += 2) {
|
||||
hinybble = toupper(p[i]);
|
||||
lonybble = toupper(p[i + 1]);
|
||||
|
||||
p1 = strchr(hexchars, hinybble);
|
||||
p2 = strchr(hexchars, lonybble);
|
||||
|
||||
if (!p1 || !p2)
|
||||
return (False);
|
||||
|
||||
hinybble = PTR_DIFF(p1, hexchars);
|
||||
lonybble = PTR_DIFF(p2, hexchars);
|
||||
|
||||
pwd[i / 2] = (hinybble << 4) | lonybble;
|
||||
}
|
||||
return (True);
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
Group and User RID username mapping function
|
||||
********************************************************************/
|
||||
|
||||
BOOL pdb_name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid)
|
||||
{
|
||||
struct passwd *pw = Get_Pwnam(user_name, False);
|
||||
|
||||
if (u_rid == NULL || g_rid == NULL || user_name == NULL)
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
||||
if (!pw)
|
||||
{
|
||||
if (!pw) {
|
||||
DEBUG(1,("Username %s is invalid on this system\n", user_name));
|
||||
return False;
|
||||
}
|
||||
@ -225,6 +321,7 @@ BOOL pdb_name_to_rid(char *user_name, uint32 *u_rid, uint32 *g_rid)
|
||||
/*******************************************************************
|
||||
Converts NT user RID to a UNIX uid.
|
||||
********************************************************************/
|
||||
|
||||
uid_t pdb_user_rid_to_uid(uint32 user_rid)
|
||||
{
|
||||
return (uid_t)(((user_rid & (~USER_RID_TYPE))- 1000)/RID_MULTIPLIER);
|
||||
@ -269,6 +366,7 @@ static BOOL pdb_rid_is_well_known(uint32 rid)
|
||||
/*******************************************************************
|
||||
Decides if a RID is a user or group RID.
|
||||
********************************************************************/
|
||||
|
||||
BOOL pdb_rid_is_user(uint32 rid)
|
||||
{
|
||||
/* lkcl i understand that NT attaches an enumeration to a RID
|
||||
@ -291,9 +389,9 @@ BOOL pdb_rid_is_user(uint32 rid)
|
||||
/*******************************************************************
|
||||
Convert a rid into a name. Used in the lookup SID rpc.
|
||||
********************************************************************/
|
||||
|
||||
BOOL local_lookup_rid(uint32 rid, char *name, enum SID_NAME_USE *psid_name_use)
|
||||
{
|
||||
|
||||
BOOL is_user = pdb_rid_is_user(rid);
|
||||
|
||||
DEBUG(5,("local_lookup_rid: looking up %s RID %u.\n", is_user ? "user" :
|
||||
@ -341,10 +439,9 @@ BOOL local_lookup_rid(uint32 rid, char *name, enum SID_NAME_USE *psid_name_use)
|
||||
}
|
||||
|
||||
} else {
|
||||
gid_t gid=-1;
|
||||
gid_t gid;
|
||||
struct group *gr;
|
||||
GROUP_MAP map;
|
||||
DOM_SID sid;
|
||||
|
||||
/*
|
||||
* Don't try to convert the rid to a name if running
|
||||
* in appliance mode
|
||||
@ -353,30 +450,11 @@ BOOL local_lookup_rid(uint32 rid, char *name, enum SID_NAME_USE *psid_name_use)
|
||||
if (lp_hide_local_users())
|
||||
return False;
|
||||
|
||||
/*
|
||||
* First try the TDB. If the RID exists and is mapped to a unix group,
|
||||
* return the NT name and the type.
|
||||
*/
|
||||
|
||||
sid_copy(&sid, &global_sam_sid);
|
||||
sid_append_rid(&sid, rid);
|
||||
if (get_group_map_from_sid(sid, &map) && map.gid!=-1) {
|
||||
*psid_name_use = map.sid_name_use;
|
||||
fstrcpy(name, map.nt_name);
|
||||
|
||||
DEBUG(5,("local_lookup_rid: found NT group %s mapped to Unix gid %u for rid %u\n",
|
||||
name, (unsigned int)map.gid, (unsigned int)rid ));
|
||||
|
||||
if(!getgrgid(map.gid))
|
||||
return False;
|
||||
else
|
||||
return True;
|
||||
}
|
||||
gid = pdb_user_rid_to_gid(rid);
|
||||
gr = getgrgid(gid);
|
||||
|
||||
*psid_name_use = SID_NAME_ALIAS;
|
||||
gid = pdb_user_rid_to_gid(rid);
|
||||
|
||||
gr = getgrgid(gid);
|
||||
|
||||
DEBUG(5,("local_local_rid: looking up gid %u %s\n", (unsigned int)gid,
|
||||
gr ? "succeeded" : "failed" ));
|
||||
|
||||
@ -387,7 +465,8 @@ BOOL local_lookup_rid(uint32 rid, char *name, enum SID_NAME_USE *psid_name_use)
|
||||
|
||||
fstrcpy( name, gr->gr_name);
|
||||
|
||||
DEBUG(5,("local_lookup_rid: found group %s for rid %u\n", name, (unsigned int)rid ));
|
||||
DEBUG(5,("local_lookup_rid: found group %s for rid %u\n", name,
|
||||
(unsigned int)rid ));
|
||||
}
|
||||
|
||||
return True;
|
||||
@ -441,27 +520,13 @@ BOOL local_lookup_name(const char *c_domain, const char *c_user, DOM_SID *psid,
|
||||
/*
|
||||
* Maybe it was a group ?
|
||||
*/
|
||||
GROUP_MAP map;
|
||||
struct group *grp = NULL;
|
||||
struct group *grp = getgrnam(user);
|
||||
|
||||
/* It can be a mapped group */
|
||||
if (get_group_map_from_ntname(user, &map) && map.gid!=-1) {
|
||||
if(!grp)
|
||||
return False;
|
||||
|
||||
grp=getgrgid(map.gid);
|
||||
if (!grp)
|
||||
return False;
|
||||
|
||||
sid_copy(&local_sid, &map.sid);
|
||||
*psid_name_use = map.sid_name_use;
|
||||
} else {
|
||||
/* It wasn't mapped, it can be a Unix group */
|
||||
grp=getgrnam(user);
|
||||
if(!grp)
|
||||
return False;
|
||||
|
||||
sid_append_rid( &local_sid, pdb_gid_to_group_rid(grp->gr_gid));
|
||||
*psid_name_use = SID_NAME_ALIAS;
|
||||
}
|
||||
sid_append_rid( &local_sid, pdb_gid_to_group_rid(grp->gr_gid));
|
||||
*psid_name_use = SID_NAME_ALIAS;
|
||||
}
|
||||
|
||||
sid_copy( psid, &local_sid);
|
||||
@ -472,6 +537,7 @@ BOOL local_lookup_name(const char *c_domain, const char *c_user, DOM_SID *psid,
|
||||
/****************************************************************************
|
||||
Convert a uid to SID - locally.
|
||||
****************************************************************************/
|
||||
|
||||
DOM_SID *local_uid_to_sid(DOM_SID *psid, uid_t uid)
|
||||
{
|
||||
extern DOM_SID global_sam_sid;
|
||||
@ -482,10 +548,10 @@ DOM_SID *local_uid_to_sid(DOM_SID *psid, uid_t uid)
|
||||
return psid;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
Convert a SID to uid - locally.
|
||||
****************************************************************************/
|
||||
|
||||
BOOL local_sid_to_uid(uid_t *puid, DOM_SID *psid, enum SID_NAME_USE *name_type)
|
||||
{
|
||||
extern DOM_SID global_sam_sid;
|
||||
@ -527,6 +593,7 @@ BOOL local_sid_to_uid(uid_t *puid, DOM_SID *psid, enum SID_NAME_USE *name_type)
|
||||
/****************************************************************************
|
||||
Convert a gid to SID - locally.
|
||||
****************************************************************************/
|
||||
|
||||
DOM_SID *local_gid_to_sid(DOM_SID *psid, gid_t gid)
|
||||
{
|
||||
extern DOM_SID global_sam_sid;
|
||||
@ -540,6 +607,7 @@ DOM_SID *local_gid_to_sid(DOM_SID *psid, gid_t gid)
|
||||
/****************************************************************************
|
||||
Convert a SID to gid - locally.
|
||||
****************************************************************************/
|
||||
|
||||
BOOL local_sid_to_gid(gid_t *pgid, DOM_SID *psid, enum SID_NAME_USE *name_type)
|
||||
{
|
||||
extern DOM_SID global_sam_sid;
|
||||
@ -582,12 +650,13 @@ BOOL local_sid_to_gid(gid_t *pgid, DOM_SID *psid, enum SID_NAME_USE *name_type)
|
||||
static void select_name(pstring string, const UNISTR2 *from)
|
||||
{
|
||||
if (from->buffer != 0)
|
||||
unistr2_to_ascii(string, from, sizeof(string));
|
||||
unistr2_to_ascii(string, from, sizeof(*string));
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
copies a SAM_USER_INFO_23 to a SAM_ACCOUNT
|
||||
Copies a SAM_USER_INFO_23 to a SAM_ACCOUNT
|
||||
**************************************************************/
|
||||
|
||||
void copy_id23_to_sam_passwd(SAM_ACCOUNT *to, SAM_USER_INFO_23 *from)
|
||||
{
|
||||
|
||||
@ -627,8 +696,9 @@ void copy_id23_to_sam_passwd(SAM_ACCOUNT *to, SAM_USER_INFO_23 *from)
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
copies a sam passwd.
|
||||
Copies a sam passwd.
|
||||
**************************************************************/
|
||||
|
||||
void copy_id21_to_sam_passwd(SAM_ACCOUNT *to, SAM_USER_INFO_21 *from)
|
||||
{
|
||||
if (from == NULL || to == NULL)
|
||||
@ -669,19 +739,20 @@ void copy_id21_to_sam_passwd(SAM_ACCOUNT *to, SAM_USER_INFO_21 *from)
|
||||
to->unknown_6 = from->unknown_6;
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************
|
||||
copies a sam passwd.
|
||||
Copies a SAM_ACCOUNT.
|
||||
**************************************************************/
|
||||
|
||||
void copy_sam_passwd(SAM_ACCOUNT *to, const SAM_ACCOUNT *from)
|
||||
{
|
||||
if (!from || !to) return;
|
||||
if (!from || !to)
|
||||
return;
|
||||
|
||||
memcpy(to, from, sizeof(SAM_ACCOUNT));
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
change a password entry in the local smbpasswd file
|
||||
Change a password entry in the local smbpasswd file.
|
||||
|
||||
FIXME!! The function needs to be abstracted into the
|
||||
passdb interface or something. It is currently being called
|
||||
@ -723,8 +794,7 @@ account without a valid local system user.\n", user_name);
|
||||
|
||||
/* Get the smb passwd entry for this user */
|
||||
pdb_init_sam(&sam_pass);
|
||||
if(!pdb_getsampwnam(sam_pass, user_name))
|
||||
{
|
||||
if(!pdb_getsampwnam(sam_pass, user_name)) {
|
||||
pdb_free_sam(sam_pass);
|
||||
|
||||
if(!(local_flags & LOCAL_ADD_USER)) {
|
||||
@ -780,25 +850,21 @@ account without a valid local system user.\n", user_name);
|
||||
* and the valid last change time.
|
||||
*/
|
||||
|
||||
if(local_flags & LOCAL_DISABLE_USER)
|
||||
if(local_flags & LOCAL_DISABLE_USER) {
|
||||
pdb_set_acct_ctrl (sam_pass, pdb_get_acct_ctrl(sam_pass)|ACB_DISABLED);
|
||||
else if (local_flags & LOCAL_ENABLE_USER)
|
||||
{
|
||||
} else if (local_flags & LOCAL_ENABLE_USER) {
|
||||
if(pdb_get_lanman_passwd(sam_pass) == NULL) {
|
||||
pdb_set_lanman_passwd (sam_pass, new_p16);
|
||||
pdb_set_nt_passwd (sam_pass, new_nt_p16);
|
||||
}
|
||||
pdb_set_acct_ctrl (sam_pass, pdb_get_acct_ctrl(sam_pass)&(~ACB_DISABLED));
|
||||
}
|
||||
else if (local_flags & LOCAL_SET_NO_PASSWORD) {
|
||||
} else if (local_flags & LOCAL_SET_NO_PASSWORD) {
|
||||
pdb_set_acct_ctrl (sam_pass, pdb_get_acct_ctrl(sam_pass)|ACB_PWNOTREQ);
|
||||
|
||||
/* This is needed to preserve ACB_PWNOTREQ in mod_smbfilepwd_entry */
|
||||
pdb_set_lanman_passwd (sam_pass, NULL);
|
||||
pdb_set_nt_passwd (sam_pass, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
/*
|
||||
* If we're dealing with setting a completely empty user account
|
||||
* ie. One with a password of 'XXXX', but not set disabled (like
|
||||
@ -822,9 +888,7 @@ account without a valid local system user.\n", user_name);
|
||||
return False;
|
||||
}
|
||||
slprintf(msg_str, msg_str_len-1, "Deleted user %s.\n", user_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
if(!pdb_update_sam_account(sam_pass, True)) {
|
||||
slprintf(err_str, err_str_len-1, "Failed to modify entry for user %s.\n", user_name);
|
||||
pdb_free_sam(sam_pass);
|
||||
@ -842,10 +906,10 @@ account without a valid local system user.\n", user_name);
|
||||
return True;
|
||||
}
|
||||
|
||||
|
||||
/*********************************************************************
|
||||
collection of get...() functions for SAM_ACCOUNT_INFO
|
||||
Collection of get...() functions for SAM_ACCOUNT_INFO.
|
||||
********************************************************************/
|
||||
|
||||
uint16 pdb_get_acct_ctrl (SAM_ACCOUNT *sampass)
|
||||
{
|
||||
if (sampass)
|
||||
@ -942,7 +1006,6 @@ uint8* pdb_get_lanman_passwd (SAM_ACCOUNT *sampass)
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
uint32 pdb_get_user_rid (SAM_ACCOUNT *sampass)
|
||||
{
|
||||
if (sampass)
|
||||
@ -1088,15 +1151,15 @@ uint32 pdb_get_unknown6 (SAM_ACCOUNT *sampass)
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
collection of set...() functions for SAM_ACCOUNT_INFO
|
||||
Collection of set...() functions for SAM_ACCOUNT_INFO.
|
||||
********************************************************************/
|
||||
|
||||
BOOL pdb_set_acct_ctrl (SAM_ACCOUNT *sampass, uint16 flags)
|
||||
{
|
||||
if (!sampass)
|
||||
return False;
|
||||
|
||||
if (sampass)
|
||||
{
|
||||
if (sampass) {
|
||||
sampass->acct_ctrl = flags;
|
||||
return True;
|
||||
}
|
||||
@ -1213,11 +1276,15 @@ BOOL pdb_set_group_rid (SAM_ACCOUNT *sampass, uint32 grid)
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
set the user's UNIX name
|
||||
Set the user's UNIX name.
|
||||
********************************************************************/
|
||||
|
||||
BOOL pdb_set_username(SAM_ACCOUNT *sampass, char *username)
|
||||
{
|
||||
if (!sampass || !username)
|
||||
if (!sampass)
|
||||
return False;
|
||||
*sampass->username = '\0';
|
||||
if (!username)
|
||||
return False;
|
||||
|
||||
StrnCpy (sampass->username, username, strlen(username));
|
||||
@ -1226,11 +1293,15 @@ BOOL pdb_set_username(SAM_ACCOUNT *sampass, char *username)
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
set the domain name
|
||||
Set the domain name.
|
||||
********************************************************************/
|
||||
|
||||
BOOL pdb_set_domain(SAM_ACCOUNT *sampass, char *domain)
|
||||
{
|
||||
if (!sampass || !domain)
|
||||
if (!sampass)
|
||||
return False;
|
||||
*sampass->domain = '\0';
|
||||
if (!domain)
|
||||
return False;
|
||||
|
||||
StrnCpy (sampass->domain, domain, strlen(domain));
|
||||
@ -1239,11 +1310,15 @@ BOOL pdb_set_domain(SAM_ACCOUNT *sampass, char *domain)
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
set the user's NT name
|
||||
Set the user's NT name.
|
||||
********************************************************************/
|
||||
|
||||
BOOL pdb_set_nt_username(SAM_ACCOUNT *sampass, char *nt_username)
|
||||
{
|
||||
if (!sampass || !nt_username)
|
||||
if (!sampass)
|
||||
return False;
|
||||
*sampass->nt_username = '\0';
|
||||
if (!nt_username)
|
||||
return False;
|
||||
|
||||
StrnCpy (sampass->nt_username, nt_username, strlen(nt_username));
|
||||
@ -1252,11 +1327,15 @@ BOOL pdb_set_nt_username(SAM_ACCOUNT *sampass, char *nt_username)
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
set the user's full name
|
||||
Set the user's full name.
|
||||
********************************************************************/
|
||||
|
||||
BOOL pdb_set_fullname(SAM_ACCOUNT *sampass, char *fullname)
|
||||
{
|
||||
if (!sampass || !fullname)
|
||||
if (!sampass)
|
||||
return False;
|
||||
*sampass->full_name = '\0';
|
||||
if (!fullname)
|
||||
return False;
|
||||
|
||||
StrnCpy (sampass->full_name, fullname, strlen(fullname));
|
||||
@ -1265,11 +1344,15 @@ BOOL pdb_set_fullname(SAM_ACCOUNT *sampass, char *fullname)
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
set the user's logon script
|
||||
Set the user's logon script.
|
||||
********************************************************************/
|
||||
|
||||
BOOL pdb_set_logon_script(SAM_ACCOUNT *sampass, char *logon_script)
|
||||
{
|
||||
if (!sampass || !logon_script)
|
||||
if (!sampass)
|
||||
return False;
|
||||
*sampass->logon_script = '\0';
|
||||
if (!logon_script)
|
||||
return False;
|
||||
|
||||
StrnCpy (sampass->logon_script, logon_script, strlen(logon_script));
|
||||
@ -1278,11 +1361,15 @@ BOOL pdb_set_logon_script(SAM_ACCOUNT *sampass, char *logon_script)
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
set the user's profile path
|
||||
Set the user's profile path.
|
||||
********************************************************************/
|
||||
|
||||
BOOL pdb_set_profile_path (SAM_ACCOUNT *sampass, char *profile_path)
|
||||
{
|
||||
if (!sampass || !profile_path)
|
||||
if (!sampass)
|
||||
return False;
|
||||
*sampass->profile_path = '\0';
|
||||
if (!profile_path)
|
||||
return False;
|
||||
|
||||
StrnCpy (sampass->profile_path, profile_path, strlen(profile_path));
|
||||
@ -1291,11 +1378,15 @@ BOOL pdb_set_profile_path (SAM_ACCOUNT *sampass, char *profile_path)
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
set the user's directory drive
|
||||
Set the user's directory drive.
|
||||
********************************************************************/
|
||||
|
||||
BOOL pdb_set_dir_drive (SAM_ACCOUNT *sampass, char *dir_drive)
|
||||
{
|
||||
if (!sampass || !dir_drive)
|
||||
if (!sampass)
|
||||
return False;
|
||||
*sampass->dir_drive = '\0';
|
||||
if (!dir_drive)
|
||||
return False;
|
||||
|
||||
StrnCpy (sampass->dir_drive, dir_drive, strlen(dir_drive));
|
||||
@ -1304,11 +1395,15 @@ BOOL pdb_set_dir_drive (SAM_ACCOUNT *sampass, char *dir_drive)
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
set the user's home directory
|
||||
Set the user's home directory.
|
||||
********************************************************************/
|
||||
|
||||
BOOL pdb_set_homedir (SAM_ACCOUNT *sampass, char *homedir)
|
||||
{
|
||||
if (!sampass || !homedir)
|
||||
if (!sampass)
|
||||
return False;
|
||||
*sampass->home_dir = '\0';
|
||||
if (!homedir)
|
||||
return False;
|
||||
|
||||
StrnCpy (sampass->home_dir, homedir, strlen(homedir));
|
||||
@ -1317,11 +1412,15 @@ BOOL pdb_set_homedir (SAM_ACCOUNT *sampass, char *homedir)
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
set the user's account description
|
||||
Set the user's account description.
|
||||
********************************************************************/
|
||||
|
||||
BOOL pdb_set_acct_desc (SAM_ACCOUNT *sampass, char *acct_desc)
|
||||
{
|
||||
if (!sampass || !acct_desc)
|
||||
if (!sampass)
|
||||
return False;
|
||||
*sampass->acct_desc = '\0';
|
||||
if (!acct_desc)
|
||||
return False;
|
||||
|
||||
StrnCpy (sampass->acct_desc, acct_desc, strlen(acct_desc));
|
||||
@ -1330,11 +1429,16 @@ BOOL pdb_set_acct_desc (SAM_ACCOUNT *sampass, char *acct_desc)
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
set the user's workstation allowed list
|
||||
Set the user's workstation allowed list.
|
||||
********************************************************************/
|
||||
|
||||
BOOL pdb_set_workstations (SAM_ACCOUNT *sampass, char *workstations)
|
||||
{
|
||||
if (!sampass || !workstations) return False;
|
||||
if (!sampass)
|
||||
return False;
|
||||
*sampass->workstations = '\0';
|
||||
if (!workstations)
|
||||
return False;
|
||||
|
||||
StrnCpy (sampass->workstations, workstations, strlen(workstations));
|
||||
|
||||
@ -1342,11 +1446,16 @@ BOOL pdb_set_workstations (SAM_ACCOUNT *sampass, char *workstations)
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
set the user's dial string
|
||||
Set the user's dial string.
|
||||
********************************************************************/
|
||||
|
||||
BOOL pdb_set_munged_dial (SAM_ACCOUNT *sampass, char *munged_dial)
|
||||
{
|
||||
if (!sampass || !munged_dial) return False;
|
||||
if (!sampass)
|
||||
return False;
|
||||
*sampass->munged_dial = '\0';
|
||||
if (!munged_dial)
|
||||
return False;
|
||||
|
||||
StrnCpy (sampass->munged_dial, munged_dial, strlen(munged_dial));
|
||||
|
||||
@ -1354,14 +1463,16 @@ BOOL pdb_set_munged_dial (SAM_ACCOUNT *sampass, char *munged_dial)
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
set the user's NT hash
|
||||
Set the user's NT hash.
|
||||
********************************************************************/
|
||||
|
||||
BOOL pdb_set_nt_passwd (SAM_ACCOUNT *sampass, uint8 *pwd)
|
||||
{
|
||||
if (!sampass || !pwd) return False;
|
||||
if (!sampass || !pwd)
|
||||
return False;
|
||||
|
||||
if (sampass->nt_pw!=NULL)
|
||||
DEBUG(0,("pdb_set_nt_passwd: NT hash non NULL overwriting ?\n"));
|
||||
DEBUG(4,("pdb_set_nt_passwd: NT hash non NULL overwritting ?\n"));
|
||||
else
|
||||
sampass->nt_pw=(unsigned char *)malloc(sizeof(unsigned char)*16);
|
||||
|
||||
@ -1374,14 +1485,16 @@ BOOL pdb_set_nt_passwd (SAM_ACCOUNT *sampass, uint8 *pwd)
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
set the user's LM hash
|
||||
Set the user's LM hash.
|
||||
********************************************************************/
|
||||
|
||||
BOOL pdb_set_lanman_passwd (SAM_ACCOUNT *sampass, uint8 *pwd)
|
||||
{
|
||||
if (!sampass || !pwd) return False;
|
||||
if (!sampass || !pwd)
|
||||
return False;
|
||||
|
||||
if (sampass->lm_pw!=NULL)
|
||||
DEBUG(0,("pdb_set_lanman_passwd: LM hash non NULL overwriting ?\n"));
|
||||
DEBUG(4,("pdb_set_lanman_passwd: LM hash non NULL overwritting ?\n"));
|
||||
else
|
||||
sampass->lm_pw=(unsigned char *)malloc(sizeof(unsigned char)*16);
|
||||
|
||||
@ -1422,10 +1535,10 @@ BOOL pdb_set_unknown_6 (SAM_ACCOUNT *sampass, uint32 unkn)
|
||||
|
||||
BOOL pdb_set_hours (SAM_ACCOUNT *sampass, uint8 *hours)
|
||||
{
|
||||
if (!sampass) return False;
|
||||
if (!sampass)
|
||||
return False;
|
||||
|
||||
if (!hours)
|
||||
{
|
||||
if (!hours) {
|
||||
memset ((char *)sampass->hours, 0, MAX_HOURS_LEN);
|
||||
return True;
|
||||
}
|
||||
@ -1434,4 +1547,3 @@ BOOL pdb_set_hours (SAM_ACCOUNT *sampass, uint8 *hours)
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
|
1014
source/passdb/pdb_ldap.c
Normal file
1014
source/passdb/pdb_ldap.c
Normal file
File diff suppressed because it is too large
Load Diff
1401
source/passdb/pdb_nisplus.c
Normal file
1401
source/passdb/pdb_nisplus.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -22,7 +22,7 @@
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
#ifdef USE_SMBPASS_DB
|
||||
#ifdef WITH_SMBPASSWD_SAM
|
||||
|
||||
|
||||
/*
|
||||
@ -54,10 +54,6 @@ extern struct passdb_ops pdb_ops;
|
||||
static int pw_file_lock_depth;
|
||||
static void *global_vp;
|
||||
|
||||
/* static memory area used by all passdb search functions
|
||||
in this module */
|
||||
/*static SAM_ACCOUNT global_sam_pass;*/
|
||||
|
||||
|
||||
enum pwf_access_type { PWF_READ, PWF_UPDATE, PWF_CREATE };
|
||||
|
||||
@ -414,7 +410,7 @@ static struct smb_passwd *getsmbfilepwent(void *vp)
|
||||
pw_buf.smb_passwd = NULL;
|
||||
pw_buf.acct_ctrl |= ACB_PWNOTREQ;
|
||||
} else {
|
||||
if (!smbpasswd_gethexpwd((char *)p, smbpwd)) {
|
||||
if (!pdb_gethexpwd((char *)p, smbpwd)) {
|
||||
DEBUG(0, ("getsmbfilepwent: Malformed Lanman password entry (non hex chars)\n"));
|
||||
continue;
|
||||
}
|
||||
@ -431,7 +427,7 @@ static struct smb_passwd *getsmbfilepwent(void *vp)
|
||||
the lanman password. */
|
||||
if ((linebuf_len >= (PTR_DIFF(p, linebuf) + 33)) && (p[32] == ':')) {
|
||||
if (*p != '*' && *p != 'X') {
|
||||
if(smbpasswd_gethexpwd((char *)p,smbntpwd))
|
||||
if(pdb_gethexpwd((char *)p,smbntpwd))
|
||||
pw_buf.smb_nt_passwd = smbntpwd;
|
||||
}
|
||||
p += 33; /* Move to the first character of the line after
|
||||
@ -444,7 +440,7 @@ static struct smb_passwd *getsmbfilepwent(void *vp)
|
||||
if (*p == '[')
|
||||
{
|
||||
unsigned char *end_p = (unsigned char *)strchr_m((char *)p, ']');
|
||||
pw_buf.acct_ctrl = smbpasswd_decode_acb_info((char*)p);
|
||||
pw_buf.acct_ctrl = pdb_decode_acct_ctrl((char*)p);
|
||||
|
||||
/* Must have some account type set. */
|
||||
if(pw_buf.acct_ctrl == 0)
|
||||
@ -545,8 +541,8 @@ static char *format_new_smbpasswd_entry(struct smb_passwd *newpwd)
|
||||
*p++ = ':';
|
||||
|
||||
/* Add the account encoding and the last change time. */
|
||||
slprintf((char *)p, new_entry_length - 1 - (p - new_entry), "%s:LCT-%08X:\n",
|
||||
smbpasswd_encode_acb_info(newpwd->acct_ctrl),
|
||||
slprintf((char *)p, new_entry_length - 1 - (p - new_entry), "%s:LCT-%08X:\n",
|
||||
pdb_encode_acct_ctrl(newpwd->acct_ctrl, NEW_PW_FORMAT_SPACE_PADDED_LEN),
|
||||
(uint32)newpwd->pass_last_set_time);
|
||||
|
||||
return new_entry;
|
||||
@ -640,11 +636,11 @@ Error was %s. Password file may be corrupt ! Please examine by hand !\n",
|
||||
}
|
||||
|
||||
endsmbfilepwent(fp, &pw_file_lock_depth);
|
||||
SAFE_FREE(new_entry);
|
||||
free(new_entry);
|
||||
return False;
|
||||
}
|
||||
|
||||
SAFE_FREE(new_entry);
|
||||
free(new_entry);
|
||||
endsmbfilepwent(fp, &pw_file_lock_depth);
|
||||
return True;
|
||||
}
|
||||
@ -903,7 +899,7 @@ static BOOL mod_smbfilepwd_entry(struct smb_passwd* pwd, BOOL override)
|
||||
* acct ctrl field. Encode the given acct ctrl
|
||||
* bits into it.
|
||||
*/
|
||||
fstrcpy(encode_bits, smbpasswd_encode_acb_info(pwd->acct_ctrl));
|
||||
fstrcpy(encode_bits, pdb_encode_acct_ctrl(pwd->acct_ctrl, NEW_PW_FORMAT_SPACE_PADDED_LEN));
|
||||
} else {
|
||||
/*
|
||||
* If using the old format and the ACB_DISABLED or
|
||||
@ -1121,11 +1117,11 @@ Error was %s\n", pwd->smb_name, pfile2, strerror(errno)));
|
||||
unlink(pfile2);
|
||||
endsmbfilepwent(fp, &pw_file_lock_depth);
|
||||
endsmbfilepwent(fp_write, &pfile2_lockdepth);
|
||||
SAFE_FREE(new_entry);
|
||||
free(new_entry);
|
||||
return False;
|
||||
}
|
||||
|
||||
SAFE_FREE(new_entry);
|
||||
free(new_entry);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1298,7 +1294,6 @@ BOOL pdb_getsampwent(SAM_ACCOUNT *user)
|
||||
{
|
||||
struct smb_passwd *pw_buf=NULL;
|
||||
BOOL done = False;
|
||||
|
||||
DEBUG(5,("pdb_getsampwent\n"));
|
||||
|
||||
if (user==NULL) {
|
||||
@ -1309,11 +1304,6 @@ BOOL pdb_getsampwent(SAM_ACCOUNT *user)
|
||||
return False;
|
||||
}
|
||||
|
||||
/* do we have an entry? */
|
||||
pw_buf = getsmbfilepwent(global_vp);
|
||||
if (pw_buf == NULL)
|
||||
return False;
|
||||
|
||||
while (!done)
|
||||
{
|
||||
/* do we have an entry? */
|
||||
@ -1530,4 +1520,4 @@ BOOL pdb_delete_sam_account (char* username)
|
||||
#else
|
||||
/* Do *NOT* make this function static. It breaks the compile on gcc. JRA */
|
||||
void smbpass_dummy_function(void) { } /* stop some compilers complaining */
|
||||
#endif /* USE_SMBPASS_DB */
|
||||
#endif /* WTH_SMBPASSWD_SAM*/
|
||||
|
@ -3,6 +3,7 @@
|
||||
* Copyright (C) Andrew Tridgell 1992-1998
|
||||
* Copyright (C) Simo Sorce 2000
|
||||
* Copyright (C) Gerald Carter 2000
|
||||
* Copyright (C) Jeremy Allison 2001
|
||||
*
|
||||
* 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
|
||||
@ -21,7 +22,7 @@
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
#ifdef WITH_TDBSAM
|
||||
#ifdef WITH_TDB_SAM
|
||||
|
||||
#define PDB_VERSION "20010830"
|
||||
#define PASSDB_FILE_NAME "/passdb.tdb"
|
||||
@ -33,9 +34,7 @@ extern int DEBUGLEVEL;
|
||||
extern pstring samlogon_user;
|
||||
extern BOOL sam_logon_in_ssb;
|
||||
|
||||
|
||||
struct tdb_enum_info
|
||||
{
|
||||
struct tdb_enum_info {
|
||||
TDB_CONTEXT *passwd_tdb;
|
||||
TDB_DATA key;
|
||||
};
|
||||
@ -46,8 +45,8 @@ static struct tdb_enum_info global_tdb_ent;
|
||||
/**********************************************************************
|
||||
Intialize a SAM_ACCOUNT struct from a BYTE buffer of size len
|
||||
*********************************************************************/
|
||||
static BOOL init_sam_from_buffer (SAM_ACCOUNT *sampass, uint8 *buf,
|
||||
uint32 buflen)
|
||||
|
||||
static BOOL init_sam_from_buffer (SAM_ACCOUNT *sampass, uint8 *buf, uint32 buflen)
|
||||
{
|
||||
|
||||
/* times are stored as 32bit integer
|
||||
@ -79,11 +78,10 @@ static BOOL init_sam_from_buffer (SAM_ACCOUNT *sampass, uint8 *buf,
|
||||
uint32 /* uid, gid,*/ user_rid, group_rid, unknown_3, hours_len, unknown_5, unknown_6;
|
||||
uint16 acct_ctrl, logon_divs;
|
||||
uint8 *hours;
|
||||
static uint8 *lm_pw_ptr,
|
||||
*nt_pw_ptr;
|
||||
static uint8 *lm_pw_ptr, *nt_pw_ptr;
|
||||
uint32 len = 0;
|
||||
uint32 lmpwlen, ntpwlen, hourslen;
|
||||
|
||||
BOOL ret = True;
|
||||
|
||||
/* unpack the buffer into variables */
|
||||
len = tdb_unpack (buf, buflen, TDB_FORMAT_STRING,
|
||||
@ -117,8 +115,10 @@ static BOOL init_sam_from_buffer (SAM_ACCOUNT *sampass, uint8 *buf,
|
||||
&unknown_5,
|
||||
&unknown_6);
|
||||
|
||||
if (len == -1)
|
||||
return False;
|
||||
if (len == -1) {
|
||||
ret = False;
|
||||
goto done;
|
||||
}
|
||||
|
||||
pdb_set_logon_time(sampass, logon_time);
|
||||
pdb_set_logoff_time(sampass, logoff_time);
|
||||
@ -153,9 +153,21 @@ static BOOL init_sam_from_buffer (SAM_ACCOUNT *sampass, uint8 *buf,
|
||||
pdb_set_logons_divs(sampass, logon_divs);
|
||||
pdb_set_hours(sampass, hours);
|
||||
|
||||
/* TODO: free TDB alloced memory !!!!! */
|
||||
|
||||
return True;
|
||||
done:
|
||||
|
||||
SAFE_FREE(username);
|
||||
SAFE_FREE(domain);
|
||||
SAFE_FREE(nt_username);
|
||||
SAFE_FREE(fullname);
|
||||
SAFE_FREE(homedir);
|
||||
SAFE_FREE(dir_drive);
|
||||
SAFE_FREE(logon_script);
|
||||
SAFE_FREE(profile_path);
|
||||
SAFE_FREE(acct_desc);
|
||||
SAFE_FREE(workstations);
|
||||
SAFE_FREE(munged_dial);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
@ -203,56 +215,80 @@ static uint32 init_buffer_from_sam (uint8 **buf, SAM_ACCOUNT *sampass)
|
||||
*buf = NULL;
|
||||
buflen = 0;
|
||||
|
||||
logon_time = pdb_get_logon_time(sampass);
|
||||
logoff_time = pdb_get_logoff_time(sampass);
|
||||
kickoff_time = pdb_get_kickoff_time(sampass);
|
||||
pass_can_change_time = pdb_get_pass_can_change_time(sampass);
|
||||
pass_must_change_time = pdb_get_pass_must_change_time(sampass);
|
||||
pass_last_set_time = pdb_get_pass_last_set_time(sampass);
|
||||
logon_time = (uint32)pdb_get_logon_time(sampass);
|
||||
logoff_time = (uint32)pdb_get_logoff_time(sampass);
|
||||
kickoff_time = (uint32)pdb_get_kickoff_time(sampass);
|
||||
pass_can_change_time = (uint32)pdb_get_pass_can_change_time(sampass);
|
||||
pass_must_change_time = (uint32)pdb_get_pass_must_change_time(sampass);
|
||||
pass_last_set_time = (uint32)pdb_get_pass_last_set_time(sampass);
|
||||
|
||||
|
||||
username = pdb_get_username(sampass);
|
||||
if (username) username_len = strlen(username) +1;
|
||||
else username_len = 0;
|
||||
if (username)
|
||||
username_len = strlen(username) +1;
|
||||
else
|
||||
username_len = 0;
|
||||
domain = pdb_get_domain(sampass);
|
||||
if (domain) domain_len = strlen(domain) +1;
|
||||
else domain_len = 0;
|
||||
if (domain)
|
||||
domain_len = strlen(domain) +1;
|
||||
else
|
||||
domain_len = 0;
|
||||
nt_username = pdb_get_nt_username(sampass);
|
||||
if (nt_username) nt_username_len = strlen(nt_username) +1;
|
||||
else nt_username_len = 0;
|
||||
if (nt_username)
|
||||
nt_username_len = strlen(nt_username) +1;
|
||||
else
|
||||
nt_username_len = 0;
|
||||
dir_drive = pdb_get_dirdrive(sampass);
|
||||
if (dir_drive) dir_drive_len = strlen(dir_drive) +1;
|
||||
else dir_drive_len = 0;
|
||||
if (dir_drive)
|
||||
dir_drive_len = strlen(dir_drive) +1;
|
||||
else
|
||||
dir_drive_len = 0;
|
||||
unknown_str = NULL;
|
||||
unknown_str_len = 0;
|
||||
munged_dial = pdb_get_munged_dial(sampass);
|
||||
if (munged_dial) munged_dial_len = strlen(munged_dial) +1;
|
||||
else munged_dial_len = 0;
|
||||
if (munged_dial)
|
||||
munged_dial_len = strlen(munged_dial) +1;
|
||||
else
|
||||
munged_dial_len = 0;
|
||||
|
||||
fullname = pdb_get_fullname(sampass);
|
||||
if (fullname) fullname_len = strlen(fullname) +1;
|
||||
else fullname_len = 0;
|
||||
if (fullname)
|
||||
fullname_len = strlen(fullname) +1;
|
||||
else
|
||||
fullname_len = 0;
|
||||
homedir = pdb_get_homedir(sampass);
|
||||
if (homedir) homedir_len = strlen(homedir) +1;
|
||||
else homedir_len = 0;
|
||||
if (homedir)
|
||||
homedir_len = strlen(homedir) +1;
|
||||
else
|
||||
homedir_len = 0;
|
||||
logon_script = pdb_get_logon_script(sampass);
|
||||
if (logon_script) logon_script_len = strlen(logon_script) +1;
|
||||
else logon_script_len = 0;
|
||||
if (logon_script)
|
||||
logon_script_len = strlen(logon_script) +1;
|
||||
else
|
||||
logon_script_len = 0;
|
||||
profile_path = pdb_get_profile_path(sampass);
|
||||
if (profile_path) profile_path_len = strlen(profile_path) +1;
|
||||
else profile_path_len = 0;
|
||||
if (profile_path)
|
||||
profile_path_len = strlen(profile_path) +1;
|
||||
else
|
||||
profile_path_len = 0;
|
||||
acct_desc = pdb_get_acct_desc(sampass);
|
||||
if (acct_desc) acct_desc_len = strlen(acct_desc) +1;
|
||||
else acct_desc_len = 0;
|
||||
if (acct_desc)
|
||||
acct_desc_len = strlen(acct_desc) +1;
|
||||
else
|
||||
acct_desc_len = 0;
|
||||
workstations = pdb_get_workstations(sampass);
|
||||
if (workstations) workstations_len = strlen(workstations) +1;
|
||||
else workstations_len = 0;
|
||||
if (workstations)
|
||||
workstations_len = strlen(workstations) +1;
|
||||
else
|
||||
workstations_len = 0;
|
||||
|
||||
lm_pw = pdb_get_lanman_passwd(sampass);
|
||||
if (!lm_pw) lm_pw_len = 0;
|
||||
if (!lm_pw)
|
||||
lm_pw_len = 0;
|
||||
|
||||
nt_pw = pdb_get_nt_passwd(sampass);
|
||||
if (!nt_pw) nt_pw_len = 0;
|
||||
if (!nt_pw)
|
||||
nt_pw_len = 0;
|
||||
|
||||
/* one time to get the size needed */
|
||||
len = tdb_pack(NULL, 0, TDB_FORMAT_STRING,
|
||||
@ -288,8 +324,7 @@ static uint32 init_buffer_from_sam (uint8 **buf, SAM_ACCOUNT *sampass)
|
||||
|
||||
|
||||
/* malloc the space needed */
|
||||
if ( (*buf=(uint8*)malloc(len)) == NULL)
|
||||
{
|
||||
if ( (*buf=(uint8*)malloc(len)) == NULL) {
|
||||
DEBUG(0,("init_buffer_from_sam: Unable to malloc() memory for buffer!\n"));
|
||||
return (-1);
|
||||
}
|
||||
@ -328,8 +363,7 @@ static uint32 init_buffer_from_sam (uint8 **buf, SAM_ACCOUNT *sampass)
|
||||
|
||||
|
||||
/* check to make sure we got it correct */
|
||||
if (buflen != len)
|
||||
{
|
||||
if (buflen != len) {
|
||||
/* error */
|
||||
SAFE_FREE (*buf);
|
||||
return (-1);
|
||||
@ -341,19 +375,18 @@ static uint32 init_buffer_from_sam (uint8 **buf, SAM_ACCOUNT *sampass)
|
||||
/***************************************************************
|
||||
Open the TDB passwd database for SAM account enumeration.
|
||||
****************************************************************/
|
||||
|
||||
BOOL pdb_setsampwent(BOOL update)
|
||||
{
|
||||
pstring tdbfile;
|
||||
|
||||
pstrcpy (tdbfile, lp_private_dir());
|
||||
get_private_directory(tdbfile);
|
||||
pstrcat (tdbfile, PASSDB_FILE_NAME);
|
||||
|
||||
/* Open tdb passwd */
|
||||
if (!(global_tdb_ent.passwd_tdb = tdb_open_log(tdbfile, 0, TDB_DEFAULT, update ? O_RDWR : O_RDONLY, 0600)))
|
||||
{
|
||||
if (!(global_tdb_ent.passwd_tdb = tdb_open_log(tdbfile, 0, TDB_DEFAULT, update ? O_RDWR : O_RDONLY, 0600))) {
|
||||
DEBUG(0, ("Unable to open TDB passwd, trying create new!\n"));
|
||||
if (!(global_tdb_ent.passwd_tdb = tdb_open_log(tdbfile, 0, TDB_DEFAULT, O_RDWR | O_CREAT | O_EXCL, 0600)))
|
||||
{
|
||||
if (!(global_tdb_ent.passwd_tdb = tdb_open_log(tdbfile, 0, TDB_DEFAULT, O_RDWR | O_CREAT | O_EXCL, 0600))) {
|
||||
DEBUG(0, ("Unable to create TDB passwd (passdb.tdb) !!!"));
|
||||
return False;
|
||||
}
|
||||
@ -367,10 +400,10 @@ BOOL pdb_setsampwent(BOOL update)
|
||||
/***************************************************************
|
||||
End enumeration of the TDB passwd list.
|
||||
****************************************************************/
|
||||
|
||||
void pdb_endsampwent(void)
|
||||
{
|
||||
if (global_tdb_ent.passwd_tdb)
|
||||
{
|
||||
if (global_tdb_ent.passwd_tdb) {
|
||||
tdb_close(global_tdb_ent.passwd_tdb);
|
||||
global_tdb_ent.passwd_tdb = NULL;
|
||||
}
|
||||
@ -378,10 +411,10 @@ void pdb_endsampwent(void)
|
||||
DEBUG(7, ("endtdbpwent: closed password file.\n"));
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************
|
||||
Get one SAM_ACCOUNT from the TDB (next in line)
|
||||
*****************************************************************/
|
||||
|
||||
BOOL pdb_getsampwent(SAM_ACCOUNT *user)
|
||||
{
|
||||
TDB_DATA data;
|
||||
@ -402,22 +435,19 @@ BOOL pdb_getsampwent(SAM_ACCOUNT *user)
|
||||
global_tdb_ent.key = tdb_nextkey (global_tdb_ent.passwd_tdb, global_tdb_ent.key);
|
||||
|
||||
/* do we have an valid interation pointer? */
|
||||
if(global_tdb_ent.passwd_tdb == NULL)
|
||||
{
|
||||
if(global_tdb_ent.passwd_tdb == NULL) {
|
||||
DEBUG(0,("pdb_get_sampwent: Bad TDB Context pointer.\n"));
|
||||
return False;
|
||||
}
|
||||
|
||||
data = tdb_fetch (global_tdb_ent.passwd_tdb, global_tdb_ent.key);
|
||||
if (!data.dptr)
|
||||
{
|
||||
if (!data.dptr) {
|
||||
DEBUG(5,("pdb_getsampwent: database entry not found.\n"));
|
||||
return False;
|
||||
}
|
||||
|
||||
/* unpack the buffer */
|
||||
if (!init_sam_from_buffer (user, data.dptr, data.dsize))
|
||||
{
|
||||
if (!init_sam_from_buffer (user, data.dptr, data.dsize)) {
|
||||
DEBUG(0,("pdb_getsampwent: Bad SAM_ACCOUNT entry returned from TDB!\n"));
|
||||
SAFE_FREE(data.dptr);
|
||||
return False;
|
||||
@ -427,8 +457,7 @@ BOOL pdb_getsampwent(SAM_ACCOUNT *user)
|
||||
/* validate the account and fill in UNIX uid and gid. sys_getpwnam()
|
||||
is used instaed of Get_Pwnam() as we do not need to try case
|
||||
permutations */
|
||||
if ((pw=sys_getpwnam(pdb_get_username(user))) == NULL)
|
||||
{
|
||||
if ((pw=sys_getpwnam(pdb_get_username(user))) == NULL) {
|
||||
DEBUG(0,("pdb_getsampwent: getpwnam(%s) return NULL. User does not exist!\n",
|
||||
pdb_get_username(user)));
|
||||
return False;
|
||||
@ -455,6 +484,7 @@ BOOL pdb_getsampwent(SAM_ACCOUNT *user)
|
||||
/******************************************************************
|
||||
Lookup a name in the SAM TDB
|
||||
******************************************************************/
|
||||
|
||||
BOOL pdb_getsampwnam (SAM_ACCOUNT *user, char *sname)
|
||||
{
|
||||
TDB_CONTEXT *pwd_tdb;
|
||||
@ -473,8 +503,7 @@ BOOL pdb_getsampwnam (SAM_ACCOUNT *user, char *sname)
|
||||
}
|
||||
|
||||
fstrcpy (name, sname);
|
||||
strlower (name);
|
||||
pstrcpy (tdbfile, lp_private_dir());
|
||||
get_private_directory(tdbfile);
|
||||
pstrcat (tdbfile, PASSDB_FILE_NAME);
|
||||
|
||||
/* set search key */
|
||||
@ -483,16 +512,14 @@ BOOL pdb_getsampwnam (SAM_ACCOUNT *user, char *sname)
|
||||
key.dsize = strlen (keystr) + 1;
|
||||
|
||||
/* open the accounts TDB */
|
||||
if (!(pwd_tdb = tdb_open_log(tdbfile, 0, TDB_DEFAULT, O_RDONLY, 0600)))
|
||||
{
|
||||
if (!(pwd_tdb = tdb_open_log(tdbfile, 0, TDB_DEFAULT, O_RDONLY, 0600))) {
|
||||
DEBUG(0, ("pdb_getsampwnam: Unable to open TDB passwd!\n"));
|
||||
return False;
|
||||
}
|
||||
|
||||
/* get the record */
|
||||
data = tdb_fetch (pwd_tdb, key);
|
||||
if (!data.dptr)
|
||||
{
|
||||
if (!data.dptr) {
|
||||
DEBUG(5,("pdb_getsampwnam (TDB): error fetching database.\n"));
|
||||
DEBUGADD(5, (" Error: %s\n", tdb_errorstr(pwd_tdb)));
|
||||
tdb_close (pwd_tdb);
|
||||
@ -500,8 +527,7 @@ BOOL pdb_getsampwnam (SAM_ACCOUNT *user, char *sname)
|
||||
}
|
||||
|
||||
/* unpack the buffer */
|
||||
if (!init_sam_from_buffer (user, data.dptr, data.dsize))
|
||||
{
|
||||
if (!init_sam_from_buffer (user, data.dptr, data.dsize)) {
|
||||
DEBUG(0,("pdb_getsampwent: Bad SAM_ACCOUNT entry returned from TDB!\n"));
|
||||
SAFE_FREE(data.dptr);
|
||||
return False;
|
||||
@ -511,8 +537,7 @@ BOOL pdb_getsampwnam (SAM_ACCOUNT *user, char *sname)
|
||||
/* validate the account and fill in UNIX uid and gid. sys_getpwnam()
|
||||
is used instaed of Get_Pwnam() as we do not need to try case
|
||||
permutations */
|
||||
if ((pw=sys_getpwnam(pdb_get_username(user))) == NULL)
|
||||
{
|
||||
if ((pw=sys_getpwnam(pdb_get_username(user))) == NULL) {
|
||||
DEBUG(0,("pdb_getsampwent: getpwnam(%s) return NULL. User does not exist!\n",
|
||||
pdb_get_username(user)));
|
||||
return False;
|
||||
@ -539,6 +564,7 @@ BOOL pdb_getsampwnam (SAM_ACCOUNT *user, char *sname)
|
||||
/***************************************************************************
|
||||
Search by uid
|
||||
**************************************************************************/
|
||||
|
||||
BOOL pdb_getsampwuid (SAM_ACCOUNT* user, uid_t uid)
|
||||
{
|
||||
struct passwd *pw;
|
||||
@ -550,8 +576,7 @@ BOOL pdb_getsampwuid (SAM_ACCOUNT* user, uid_t uid)
|
||||
}
|
||||
|
||||
pw = sys_getpwuid(uid);
|
||||
if (pw == NULL)
|
||||
{
|
||||
if (pw == NULL) {
|
||||
DEBUG(0,("pdb_getsampwuid: getpwuid(%d) return NULL. User does not exist!\n", uid));
|
||||
return False;
|
||||
}
|
||||
@ -564,6 +589,7 @@ BOOL pdb_getsampwuid (SAM_ACCOUNT* user, uid_t uid)
|
||||
/***************************************************************************
|
||||
Search by rid
|
||||
**************************************************************************/
|
||||
|
||||
BOOL pdb_getsampwrid (SAM_ACCOUNT *user, uint32 rid)
|
||||
{
|
||||
TDB_CONTEXT *pwd_tdb;
|
||||
@ -577,7 +603,7 @@ BOOL pdb_getsampwrid (SAM_ACCOUNT *user, uint32 rid)
|
||||
return False;
|
||||
}
|
||||
|
||||
pstrcpy (tdbfile, lp_private_dir());
|
||||
get_private_directory(tdbfile);
|
||||
pstrcat (tdbfile, PASSDB_FILE_NAME);
|
||||
|
||||
/* set search key */
|
||||
@ -586,16 +612,14 @@ BOOL pdb_getsampwrid (SAM_ACCOUNT *user, uint32 rid)
|
||||
key.dsize = strlen (keystr) + 1;
|
||||
|
||||
/* open the accounts TDB */
|
||||
if (!(pwd_tdb = tdb_open_log(tdbfile, 0, TDB_DEFAULT, O_RDONLY, 0600)))
|
||||
{
|
||||
if (!(pwd_tdb = tdb_open_log(tdbfile, 0, TDB_DEFAULT, O_RDONLY, 0600))) {
|
||||
DEBUG(0, ("pdb_getsampwrid: Unable to open TDB rid database!\n"));
|
||||
return False;
|
||||
}
|
||||
|
||||
/* get the record */
|
||||
data = tdb_fetch (pwd_tdb, key);
|
||||
if (!data.dptr)
|
||||
{
|
||||
if (!data.dptr) {
|
||||
DEBUG(5,("pdb_getsampwrid (TDB): error fetching database.\n"));
|
||||
DEBUGADD(5, (" Error: %s\n", tdb_errorstr(pwd_tdb)));
|
||||
tdb_close (pwd_tdb);
|
||||
@ -610,10 +634,10 @@ BOOL pdb_getsampwrid (SAM_ACCOUNT *user, uint32 rid)
|
||||
return pdb_getsampwnam (user, name);
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
Delete a SAM_ACCOUNT
|
||||
****************************************************************************/
|
||||
|
||||
BOOL pdb_delete_sam_account(char *sname)
|
||||
{
|
||||
SAM_ACCOUNT *sam_pass = NULL;
|
||||
@ -627,12 +651,11 @@ BOOL pdb_delete_sam_account(char *sname)
|
||||
fstrcpy (name, sname);
|
||||
strlower (name);
|
||||
|
||||
pstrcpy (tdbfile, lp_private_dir());
|
||||
get_private_directory(tdbfile);
|
||||
pstrcat (tdbfile, PASSDB_FILE_NAME);
|
||||
|
||||
/* open the TDB */
|
||||
if (!(pwd_tdb = tdb_open_log(tdbfile, 0, TDB_DEFAULT, O_RDWR, 0600)))
|
||||
{
|
||||
if (!(pwd_tdb = tdb_open_log(tdbfile, 0, TDB_DEFAULT, O_RDWR, 0600))) {
|
||||
DEBUG(0, ("Unable to open TDB passwd!"));
|
||||
return False;
|
||||
}
|
||||
@ -644,8 +667,7 @@ BOOL pdb_delete_sam_account(char *sname)
|
||||
|
||||
/* get the record */
|
||||
data = tdb_fetch (pwd_tdb, key);
|
||||
if (!data.dptr)
|
||||
{
|
||||
if (!data.dptr) {
|
||||
DEBUG(5,("pdb_delete_sam_account (TDB): error fetching database.\n"));
|
||||
DEBUGADD(5, (" Error: %s\n", tdb_errorstr(pwd_tdb)));
|
||||
tdb_close (pwd_tdb);
|
||||
@ -653,14 +675,12 @@ BOOL pdb_delete_sam_account(char *sname)
|
||||
}
|
||||
|
||||
/* unpack the buffer */
|
||||
if (!pdb_init_sam (&sam_pass))
|
||||
{
|
||||
if (!pdb_init_sam (&sam_pass)) {
|
||||
tdb_close (pwd_tdb);
|
||||
return False;
|
||||
}
|
||||
|
||||
if (!init_sam_from_buffer (sam_pass, data.dptr, data.dsize))
|
||||
{
|
||||
if (!init_sam_from_buffer (sam_pass, data.dptr, data.dsize)) {
|
||||
DEBUG(0,("pdb_getsampwent: Bad SAM_ACCOUNT entry returned from TDB!\n"));
|
||||
tdb_close (pwd_tdb);
|
||||
SAFE_FREE(data.dptr);
|
||||
@ -673,8 +693,7 @@ BOOL pdb_delete_sam_account(char *sname)
|
||||
pdb_free_sam (sam_pass);
|
||||
|
||||
/* it's outaa here! 8^) */
|
||||
if (tdb_delete(pwd_tdb, key) != TDB_SUCCESS)
|
||||
{
|
||||
if (tdb_delete(pwd_tdb, key) != TDB_SUCCESS) {
|
||||
DEBUG(5, ("Error deleting entry from tdb passwd database!\n"));
|
||||
DEBUGADD(5, (" Error: %s\n", tdb_errorstr(pwd_tdb)));
|
||||
tdb_close(pwd_tdb);
|
||||
@ -689,8 +708,7 @@ BOOL pdb_delete_sam_account(char *sname)
|
||||
key.dsize = strlen (keystr) + 1;
|
||||
|
||||
/* it's outaa here! 8^) */
|
||||
if (tdb_delete(pwd_tdb, key) != TDB_SUCCESS)
|
||||
{
|
||||
if (tdb_delete(pwd_tdb, key) != TDB_SUCCESS) {
|
||||
DEBUG(5, ("Error deleting entry from tdb rid database!\n"));
|
||||
DEBUGADD(5, (" Error: %s\n", tdb_errorstr(pwd_tdb)));
|
||||
tdb_close(pwd_tdb);
|
||||
@ -705,6 +723,7 @@ BOOL pdb_delete_sam_account(char *sname)
|
||||
/***************************************************************************
|
||||
Update the TDB SAM
|
||||
****************************************************************************/
|
||||
|
||||
static BOOL tdb_update_sam(SAM_ACCOUNT* newpwd, BOOL override, int flag)
|
||||
{
|
||||
TDB_CONTEXT *pwd_tdb;
|
||||
@ -716,7 +735,7 @@ static BOOL tdb_update_sam(SAM_ACCOUNT* newpwd, BOOL override, int flag)
|
||||
BOOL ret = True;
|
||||
int newtdb = FALSE;
|
||||
|
||||
pstrcpy (tdbfile, lp_private_dir());
|
||||
get_private_directory(tdbfile);
|
||||
pstrcat (tdbfile, PASSDB_FILE_NAME);
|
||||
|
||||
if ( (!newpwd->uid) || (!newpwd->gid) )
|
||||
@ -729,10 +748,8 @@ static BOOL tdb_update_sam(SAM_ACCOUNT* newpwd, BOOL override, int flag)
|
||||
if (!newpwd->group_rid)
|
||||
pdb_set_group_rid (newpwd, pdb_gid_to_group_rid (newpwd->gid));
|
||||
|
||||
|
||||
/* copy the SAM_ACCOUNT struct into a BYTE buffer for storage */
|
||||
if ((data.dsize=init_buffer_from_sam (&buf, newpwd)) == -1)
|
||||
{
|
||||
if ((data.dsize=init_buffer_from_sam (&buf, newpwd)) == -1) {
|
||||
DEBUG(0,("tdb_update_sam: ERROR - Unable to copy SAM_ACCOUNT info BYTE buffer!\n"));
|
||||
ret = False;
|
||||
goto done;
|
||||
@ -748,21 +765,17 @@ static BOOL tdb_update_sam(SAM_ACCOUNT* newpwd, BOOL override, int flag)
|
||||
key.dsize = strlen (keystr) + 1;
|
||||
|
||||
/* invalidate the existing TDB iterator if it is open */
|
||||
if (global_tdb_ent.passwd_tdb)
|
||||
{
|
||||
if (global_tdb_ent.passwd_tdb) {
|
||||
tdb_close(global_tdb_ent.passwd_tdb);
|
||||
global_tdb_ent.passwd_tdb = NULL;
|
||||
}
|
||||
|
||||
/* open the account TDB passwd*/
|
||||
if (!(pwd_tdb = tdb_open_log(tdbfile, 0, TDB_DEFAULT, O_RDWR, 0600)))
|
||||
{
|
||||
DEBUG(0, ("tdb_update_sam: Unable to open TDB passwd!\n"));
|
||||
if (flag == TDB_INSERT)
|
||||
{
|
||||
if (!(pwd_tdb = tdb_open_log(tdbfile, 0, TDB_DEFAULT, O_RDWR, 0600))) {
|
||||
DEBUG(0, ("tdb_update_sam: Unable to open TDB passwd!\n"));
|
||||
if (flag == TDB_INSERT) {
|
||||
DEBUG(0, ("Unable to open TDB passwd, trying create new!\n"));
|
||||
if (!(pwd_tdb = tdb_open_log(tdbfile, 0, TDB_DEFAULT, O_RDWR | O_CREAT | O_EXCL, 0600)))
|
||||
{
|
||||
if (!(pwd_tdb = tdb_open_log(tdbfile, 0, TDB_DEFAULT, O_RDWR | O_CREAT | O_EXCL, 0600))) {
|
||||
DEBUG(0, ("Unable to create TDB passwd (passdb.tdb) !!!\n"));
|
||||
ret = False;
|
||||
goto done;
|
||||
@ -772,8 +785,7 @@ static BOOL tdb_update_sam(SAM_ACCOUNT* newpwd, BOOL override, int flag)
|
||||
}
|
||||
|
||||
/* add the account */
|
||||
if (tdb_store(pwd_tdb, key, data, flag) != TDB_SUCCESS)
|
||||
{
|
||||
if (tdb_store(pwd_tdb, key, data, flag) != TDB_SUCCESS) {
|
||||
DEBUG(0, ("Unable to modify passwd TDB!"));
|
||||
DEBUGADD(0, (" Error: %s\n", tdb_errorstr(pwd_tdb)));
|
||||
tdb_close (pwd_tdb);
|
||||
@ -791,8 +803,7 @@ static BOOL tdb_update_sam(SAM_ACCOUNT* newpwd, BOOL override, int flag)
|
||||
key.dsize = strlen (keystr) + 1;
|
||||
|
||||
/* add the reference */
|
||||
if (tdb_store(pwd_tdb, key, data, flag) != TDB_SUCCESS)
|
||||
{
|
||||
if (tdb_store(pwd_tdb, key, data, flag) != TDB_SUCCESS) {
|
||||
DEBUG(0, ("Unable to modify TDB passwd !"));
|
||||
DEBUGADD(0, (" Error: %s\n", tdb_errorstr(pwd_tdb)));
|
||||
ret = False;
|
||||
@ -800,17 +811,17 @@ static BOOL tdb_update_sam(SAM_ACCOUNT* newpwd, BOOL override, int flag)
|
||||
}
|
||||
|
||||
done:
|
||||
|
||||
/* cleanup */
|
||||
tdb_close (pwd_tdb);
|
||||
SAFE_FREE(buf);
|
||||
|
||||
return (ret);
|
||||
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
Modifies an existing SAM_ACCOUNT
|
||||
****************************************************************************/
|
||||
|
||||
BOOL pdb_update_sam_account (SAM_ACCOUNT *newpwd, BOOL override)
|
||||
{
|
||||
return (tdb_update_sam(newpwd, override, TDB_MODIFY));
|
||||
@ -819,13 +830,13 @@ BOOL pdb_update_sam_account (SAM_ACCOUNT *newpwd, BOOL override)
|
||||
/***************************************************************************
|
||||
Adds an existing SAM_ACCOUNT
|
||||
****************************************************************************/
|
||||
|
||||
BOOL pdb_add_sam_account (SAM_ACCOUNT *newpwd)
|
||||
{
|
||||
return (tdb_update_sam(newpwd, True, TDB_INSERT));
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
/* Do *NOT* make this function static. It breaks the compile on gcc. JRA */
|
||||
void samtdb_dummy_function(void) { } /* stop some compilers complaining */
|
||||
#endif /* WITH_TDBSAM */
|
||||
#endif /* WITH_TDB_SAM */
|
||||
|
@ -1,3 +1,4 @@
|
||||
# Generated automatically from Makefile.in.in by configure.
|
||||
# Makefile for program source directory in GNU NLS utilities package.
|
||||
# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
|
||||
#
|
||||
@ -6,54 +7,53 @@
|
||||
# but which still want to provide support for the GNU gettext functionality.
|
||||
# Please note that the actual code is *not* freely available.
|
||||
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE = i18n_swat
|
||||
VERSION = @VERSION@
|
||||
|
||||
SHELL = /bin/sh
|
||||
@SET_MAKE@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
datadir = $(prefix)/@DATADIRNAME@
|
||||
srcdir = .
|
||||
top_srcdir = ..
|
||||
|
||||
prefix = /usr/local/samba
|
||||
exec_prefix = ${prefix}
|
||||
datadir = $(prefix)/share
|
||||
localedir = $(datadir)/locale
|
||||
gnulocaledir = $(prefix)/share/locale
|
||||
gettextsrcdir = $(prefix)/share/gettext/po
|
||||
subdir = po
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = sh @INSTALL_DATA@
|
||||
MKINSTALLDIRS = $(top_srcdir)/script/@MKINSTALLDIRS@
|
||||
INSTALL = /usr/bin/install -c
|
||||
INSTALL_DATA = $(SHELL) ${INSTALL} -m 644
|
||||
MKINSTALLDIRS = $(top_srcdir)/script/./mkinstalldirs
|
||||
|
||||
CC = @CC@
|
||||
GENCAT = @GENCAT@
|
||||
GMSGFMT = PATH=../src:$$PATH @GMSGFMT@
|
||||
MSGFMT = @MSGFMT@
|
||||
XGETTEXT = PATH=../src:$$PATH @XGETTEXT@
|
||||
CC = gcc
|
||||
GENCAT =
|
||||
GMSGFMT = PATH=../src:$$PATH /usr/bin/msgfmt
|
||||
MSGFMT = /usr/bin/msgfmt
|
||||
XGETTEXT = PATH=../src:$$PATH /usr/bin/xgettext
|
||||
MSGMERGE = PATH=../src:$$PATH msgmerge
|
||||
|
||||
DEFS = @DEFS@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
DEFS = -DHAVE_CONFIG_H
|
||||
CFLAGS = -O
|
||||
CPPFLAGS =
|
||||
|
||||
INCLUDES = -I.. -I$(top_srcdir)/intl -I$(top_srcdir)/include
|
||||
|
||||
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
|
||||
|
||||
SOURCES = cat-id-tbl.c
|
||||
POFILES = @POFILES@
|
||||
GMOFILES = @GMOFILES@
|
||||
DISTFILES = ChangeLog Makefile.in POTFILES.in $(PACKAGE).pot \
|
||||
POFILES = en.po ja.po pl.po tr.po
|
||||
GMOFILES = en.gmo ja.gmo pl.gmo tr.gmo
|
||||
DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
|
||||
stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
|
||||
|
||||
POTFILES = \
|
||||
|
||||
CATALOGS = @CATALOGS@
|
||||
CATOBJEXT = @CATOBJEXT@
|
||||
INSTOBJEXT = @INSTOBJEXT@
|
||||
CATALOGS = en.gmo ja.gmo pl.gmo tr.gmo
|
||||
CATOBJEXT = .gmo
|
||||
INSTOBJEXT = .mo
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
|
||||
@ -79,16 +79,16 @@ INSTOBJEXT = @INSTOBJEXT@
|
||||
rm -f $@ && $(GENCAT) $@ $*.msg
|
||||
|
||||
|
||||
all: all-@USE_NLS@
|
||||
all: all-yes
|
||||
|
||||
all-yes: cat-id-tbl.c $(CATALOGS)
|
||||
all-no:
|
||||
|
||||
$(srcdir)/$(PACKAGE).pot: $(POTFILES)
|
||||
@$(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
|
||||
$(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
|
||||
--add-comments --keyword=_ --keyword=N_ \
|
||||
--files-from=$(srcdir)/POTFILES.in \
|
||||
@&& test ! -f $(PACKAGE).po \
|
||||
&& test ! -f $(PACKAGE).po \
|
||||
|| ( rm -f $(srcdir)/$(PACKAGE).pot \
|
||||
&& mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot )
|
||||
|
||||
@ -109,7 +109,7 @@ $(srcdir)/stamp-cat-id: $(PACKAGE).pot
|
||||
|
||||
install: install-exec install-data
|
||||
install-exec:
|
||||
install-data: install-data-@USE_NLS@
|
||||
install-data: install-data-yes
|
||||
install-data-no: all
|
||||
install-data-yes: all install-data-basic
|
||||
install-data-basic:
|
||||
@ -160,8 +160,8 @@ install-data-basic:
|
||||
else \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
|
||||
fi; \
|
||||
$(INSTALL_DATA) $(srcdir)/Makefile.in \
|
||||
$(gettextsrcdir)/Makefile.in; \
|
||||
$(INSTALL_DATA) $(srcdir)/Makefile.in.in \
|
||||
$(gettextsrcdir)/Makefile.in.in; \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
@ -179,7 +179,7 @@ uninstall:
|
||||
rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
|
||||
rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
|
||||
done
|
||||
rm -f $(gettextsrcdir)/po-Makefile.in
|
||||
rm -f $(gettextsrcdir)/po-Makefile.in.in
|
||||
|
||||
check: all
|
||||
|
||||
@ -242,7 +242,7 @@ POTFILES: POTFILES.in
|
||||
&& chmod a-w $@-t \
|
||||
&& mv $@-t $@ )
|
||||
|
||||
Makefile: Makefile.in ../config.status POTFILES
|
||||
Makefile: Makefile.in.in ../config.status POTFILES
|
||||
cd .. \
|
||||
&& CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
|
||||
$(SHELL) ./config.status
|
||||
|
@ -222,212 +222,211 @@ const struct _msg_ent _msg_tbl[] = {
|
||||
{"read bmpx", 213},
|
||||
{"read raw", 214},
|
||||
{"write raw", 215},
|
||||
{"nt smb support", 216},
|
||||
{"nt pipe support", 217},
|
||||
{"nt acl support", 218},
|
||||
{"announce version", 219},
|
||||
{"announce as", 220},
|
||||
{"max mux", 221},
|
||||
{"max xmit", 222},
|
||||
{"name resolve order", 223},
|
||||
{"max packet", 224},
|
||||
{"packet size", 225},
|
||||
{"max ttl", 226},
|
||||
{"max wins ttl", 227},
|
||||
{"min wins ttl", 228},
|
||||
{"time server", 229},
|
||||
{"Tuning Options", 230},
|
||||
{"change notify timeout", 231},
|
||||
{"deadtime", 232},
|
||||
{"getwd cache", 233},
|
||||
{"keepalive", 234},
|
||||
{"lpq cache time", 235},
|
||||
{"max smbd processes", 236},
|
||||
{"max connections", 237},
|
||||
{"paranoid server security", 238},
|
||||
{"max disk size", 239},
|
||||
{"max open files", 240},
|
||||
{"min print space", 241},
|
||||
{"read size", 242},
|
||||
{"socket options", 243},
|
||||
{"stat cache size", 244},
|
||||
{"strict allocate", 245},
|
||||
{"strict sync", 246},
|
||||
{"sync always", 247},
|
||||
{"use mmap", 248},
|
||||
{"hostname lookups", 249},
|
||||
{"write cache size", 250},
|
||||
{"Printing Options", 251},
|
||||
{"total print jobs", 252},
|
||||
{"max print jobs", 253},
|
||||
{"load printers", 254},
|
||||
{"printcap name", 255},
|
||||
{"printcap", 256},
|
||||
{"printable", 257},
|
||||
{"print ok", 258},
|
||||
{"postscript", 259},
|
||||
{"printing", 260},
|
||||
{"print command", 261},
|
||||
{"disable spoolss", 262},
|
||||
{"lpq command", 263},
|
||||
{"lprm command", 264},
|
||||
{"lppause command", 265},
|
||||
{"lpresume command", 266},
|
||||
{"queuepause command", 267},
|
||||
{"queueresume command", 268},
|
||||
{"enumports command", 269},
|
||||
{"addprinter command", 270},
|
||||
{"deleteprinter command", 271},
|
||||
{"show add printer wizard", 272},
|
||||
{"os2 driver map", 273},
|
||||
{"printer name", 274},
|
||||
{"printer", 275},
|
||||
{"use client driver", 276},
|
||||
{"printer driver", 277},
|
||||
{"printer driver file", 278},
|
||||
{"printer driver location", 279},
|
||||
{"Filename Handling", 280},
|
||||
{"strip dot", 281},
|
||||
{"mangled stack", 282},
|
||||
{"default case", 283},
|
||||
{"case sensitive", 284},
|
||||
{"casesignames", 285},
|
||||
{"preserve case", 286},
|
||||
{"short preserve case", 287},
|
||||
{"mangle case", 288},
|
||||
{"mangling char", 289},
|
||||
{"hide dot files", 290},
|
||||
{"hide unreadable", 291},
|
||||
{"delete veto files", 292},
|
||||
{"veto files", 293},
|
||||
{"hide files", 294},
|
||||
{"veto oplock files", 295},
|
||||
{"map system", 296},
|
||||
{"map hidden", 297},
|
||||
{"map archive", 298},
|
||||
{"mangled names", 299},
|
||||
{"mangled map", 300},
|
||||
{"stat cache", 301},
|
||||
{"Domain Options", 302},
|
||||
{"domain admin group", 303},
|
||||
{"domain guest group", 304},
|
||||
{"groupname map", 305},
|
||||
{"machine password timeout", 306},
|
||||
{"Logon Options", 307},
|
||||
{"add user script", 308},
|
||||
{"delete user script", 309},
|
||||
{"add group script", 310},
|
||||
{"delete group script", 311},
|
||||
{"add user to group script", 312},
|
||||
{"delete user from group script", 313},
|
||||
{"add machine script", 314},
|
||||
{"shutdown script", 315},
|
||||
{"abort shutdown script", 316},
|
||||
{"logon script", 317},
|
||||
{"logon path", 318},
|
||||
{"logon drive", 319},
|
||||
{"logon home", 320},
|
||||
{"domain logons", 321},
|
||||
{"Browse Options", 322},
|
||||
{"os level", 323},
|
||||
{"lm announce", 324},
|
||||
{"lm interval", 325},
|
||||
{"preferred master", 326},
|
||||
{"prefered master", 327},
|
||||
{"local master", 328},
|
||||
{"domain master", 329},
|
||||
{"browse list", 330},
|
||||
{"browseable", 331},
|
||||
{"browsable", 332},
|
||||
{"enhanced browsing", 333},
|
||||
{"WINS Options", 334},
|
||||
{"dns proxy", 335},
|
||||
{"wins proxy", 336},
|
||||
{"wins server", 337},
|
||||
{"wins support", 338},
|
||||
{"wins hook", 339},
|
||||
{"Locking Options", 340},
|
||||
{"blocking locks", 341},
|
||||
{"fake oplocks", 342},
|
||||
{"kernel oplocks", 343},
|
||||
{"locking", 344},
|
||||
{"oplocks", 345},
|
||||
{"level2 oplocks", 346},
|
||||
{"oplock break wait time", 347},
|
||||
{"oplock contention limit", 348},
|
||||
{"posix locking", 349},
|
||||
{"strict locking", 350},
|
||||
{"share modes", 351},
|
||||
{"Ldap Options", 352},
|
||||
{"ldap server", 353},
|
||||
{"ldap port", 354},
|
||||
{"ldap suffix", 355},
|
||||
{"ldap filter", 356},
|
||||
{"ldap root", 357},
|
||||
{"ldap root passwd", 358},
|
||||
{"Miscellaneous Options", 359},
|
||||
{"add share command", 360},
|
||||
{"change share command", 361},
|
||||
{"delete share command", 362},
|
||||
{"config file", 363},
|
||||
{"preload", 364},
|
||||
{"auto services", 365},
|
||||
{"lock dir", 366},
|
||||
{"lock directory", 367},
|
||||
{"utmp directory", 368},
|
||||
{"wtmp directory", 369},
|
||||
{"utmp", 370},
|
||||
{"default service", 371},
|
||||
{"default", 372},
|
||||
{"message command", 373},
|
||||
{"dfree command", 374},
|
||||
{"remote announce", 375},
|
||||
{"remote browse sync", 376},
|
||||
{"socket address", 377},
|
||||
{"homedir map", 378},
|
||||
{"time offset", 379},
|
||||
{"NIS homedir", 380},
|
||||
{"-valid", 381},
|
||||
{"copy", 382},
|
||||
{"include", 383},
|
||||
{"exec", 384},
|
||||
{"preexec", 385},
|
||||
{"preexec close", 386},
|
||||
{"postexec", 387},
|
||||
{"root preexec", 388},
|
||||
{"root preexec close", 389},
|
||||
{"root postexec", 390},
|
||||
{"available", 391},
|
||||
{"volume", 392},
|
||||
{"fstype", 393},
|
||||
{"set directory", 394},
|
||||
{"source environment", 395},
|
||||
{"wide links", 396},
|
||||
{"follow symlinks", 397},
|
||||
{"dont descend", 398},
|
||||
{"magic script", 399},
|
||||
{"magic output", 400},
|
||||
{"delete readonly", 401},
|
||||
{"dos filemode", 402},
|
||||
{"dos filetimes", 403},
|
||||
{"dos filetime resolution", 404},
|
||||
{"fake directory create times", 405},
|
||||
{"panic action", 406},
|
||||
{"hide local users", 407},
|
||||
{"VFS options", 408},
|
||||
{"vfs object", 409},
|
||||
{"vfs options", 410},
|
||||
{"msdfs root", 411},
|
||||
{"host msdfs", 412},
|
||||
{"Winbind options", 413},
|
||||
{"winbind uid", 414},
|
||||
{"winbind gid", 415},
|
||||
{"template homedir", 416},
|
||||
{"template shell", 417},
|
||||
{"winbind separator", 418},
|
||||
{"winbind cache time", 419},
|
||||
{"winbind enum users", 420},
|
||||
{"winbind enum groups", 421},
|
||||
{"nt pipe support", 216},
|
||||
{"nt acl support", 217},
|
||||
{"announce version", 218},
|
||||
{"announce as", 219},
|
||||
{"max mux", 220},
|
||||
{"max xmit", 221},
|
||||
{"name resolve order", 222},
|
||||
{"max packet", 223},
|
||||
{"packet size", 224},
|
||||
{"max ttl", 225},
|
||||
{"max wins ttl", 226},
|
||||
{"min wins ttl", 227},
|
||||
{"time server", 228},
|
||||
{"Tuning Options", 229},
|
||||
{"change notify timeout", 230},
|
||||
{"deadtime", 231},
|
||||
{"getwd cache", 232},
|
||||
{"keepalive", 233},
|
||||
{"lpq cache time", 234},
|
||||
{"max smbd processes", 235},
|
||||
{"max connections", 236},
|
||||
{"paranoid server security", 237},
|
||||
{"max disk size", 238},
|
||||
{"max open files", 239},
|
||||
{"min print space", 240},
|
||||
{"read size", 241},
|
||||
{"socket options", 242},
|
||||
{"stat cache size", 243},
|
||||
{"strict allocate", 244},
|
||||
{"strict sync", 245},
|
||||
{"sync always", 246},
|
||||
{"use mmap", 247},
|
||||
{"hostname lookups", 248},
|
||||
{"write cache size", 249},
|
||||
{"Printing Options", 250},
|
||||
{"total print jobs", 251},
|
||||
{"max print jobs", 252},
|
||||
{"load printers", 253},
|
||||
{"printcap name", 254},
|
||||
{"printcap", 255},
|
||||
{"printable", 256},
|
||||
{"print ok", 257},
|
||||
{"postscript", 258},
|
||||
{"printing", 259},
|
||||
{"print command", 260},
|
||||
{"disable spoolss", 261},
|
||||
{"lpq command", 262},
|
||||
{"lprm command", 263},
|
||||
{"lppause command", 264},
|
||||
{"lpresume command", 265},
|
||||
{"queuepause command", 266},
|
||||
{"queueresume command", 267},
|
||||
{"enumports command", 268},
|
||||
{"addprinter command", 269},
|
||||
{"deleteprinter command", 270},
|
||||
{"show add printer wizard", 271},
|
||||
{"os2 driver map", 272},
|
||||
{"printer name", 273},
|
||||
{"printer", 274},
|
||||
{"use client driver", 275},
|
||||
{"printer driver", 276},
|
||||
{"printer driver file", 277},
|
||||
{"printer driver location", 278},
|
||||
{"Filename Handling", 279},
|
||||
{"strip dot", 280},
|
||||
{"mangled stack", 281},
|
||||
{"default case", 282},
|
||||
{"case sensitive", 283},
|
||||
{"casesignames", 284},
|
||||
{"preserve case", 285},
|
||||
{"short preserve case", 286},
|
||||
{"mangle case", 287},
|
||||
{"mangling char", 288},
|
||||
{"hide dot files", 289},
|
||||
{"hide unreadable", 290},
|
||||
{"delete veto files", 291},
|
||||
{"veto files", 292},
|
||||
{"hide files", 293},
|
||||
{"veto oplock files", 294},
|
||||
{"map system", 295},
|
||||
{"map hidden", 296},
|
||||
{"map archive", 297},
|
||||
{"mangled names", 298},
|
||||
{"mangled map", 299},
|
||||
{"stat cache", 300},
|
||||
{"Domain Options", 301},
|
||||
{"domain admin group", 302},
|
||||
{"domain guest group", 303},
|
||||
{"groupname map", 304},
|
||||
{"machine password timeout", 305},
|
||||
{"Logon Options", 306},
|
||||
{"add user script", 307},
|
||||
{"delete user script", 308},
|
||||
{"add group script", 309},
|
||||
{"delete group script", 310},
|
||||
{"add user to group script", 311},
|
||||
{"delete user from group script", 312},
|
||||
{"add machine script", 313},
|
||||
{"shutdown script", 314},
|
||||
{"abort shutdown script", 315},
|
||||
{"logon script", 316},
|
||||
{"logon path", 317},
|
||||
{"logon drive", 318},
|
||||
{"logon home", 319},
|
||||
{"domain logons", 320},
|
||||
{"Browse Options", 321},
|
||||
{"os level", 322},
|
||||
{"lm announce", 323},
|
||||
{"lm interval", 324},
|
||||
{"preferred master", 325},
|
||||
{"prefered master", 326},
|
||||
{"local master", 327},
|
||||
{"domain master", 328},
|
||||
{"browse list", 329},
|
||||
{"browseable", 330},
|
||||
{"browsable", 331},
|
||||
{"enhanced browsing", 332},
|
||||
{"WINS Options", 333},
|
||||
{"dns proxy", 334},
|
||||
{"wins proxy", 335},
|
||||
{"wins server", 336},
|
||||
{"wins support", 337},
|
||||
{"wins hook", 338},
|
||||
{"Locking Options", 339},
|
||||
{"blocking locks", 340},
|
||||
{"fake oplocks", 341},
|
||||
{"kernel oplocks", 342},
|
||||
{"locking", 343},
|
||||
{"oplocks", 344},
|
||||
{"level2 oplocks", 345},
|
||||
{"oplock break wait time", 346},
|
||||
{"oplock contention limit", 347},
|
||||
{"posix locking", 348},
|
||||
{"strict locking", 349},
|
||||
{"share modes", 350},
|
||||
{"Ldap Options", 351},
|
||||
{"ldap server", 352},
|
||||
{"ldap port", 353},
|
||||
{"ldap suffix", 354},
|
||||
{"ldap filter", 355},
|
||||
{"ldap root", 356},
|
||||
{"ldap root passwd", 357},
|
||||
{"Miscellaneous Options", 358},
|
||||
{"add share command", 359},
|
||||
{"change share command", 360},
|
||||
{"delete share command", 361},
|
||||
{"config file", 362},
|
||||
{"preload", 363},
|
||||
{"auto services", 364},
|
||||
{"lock dir", 365},
|
||||
{"lock directory", 366},
|
||||
{"utmp directory", 367},
|
||||
{"wtmp directory", 368},
|
||||
{"utmp", 369},
|
||||
{"default service", 370},
|
||||
{"default", 371},
|
||||
{"message command", 372},
|
||||
{"dfree command", 373},
|
||||
{"remote announce", 374},
|
||||
{"remote browse sync", 375},
|
||||
{"socket address", 376},
|
||||
{"homedir map", 377},
|
||||
{"time offset", 378},
|
||||
{"NIS homedir", 379},
|
||||
{"-valid", 380},
|
||||
{"copy", 381},
|
||||
{"include", 382},
|
||||
{"exec", 383},
|
||||
{"preexec", 384},
|
||||
{"preexec close", 385},
|
||||
{"postexec", 386},
|
||||
{"root preexec", 387},
|
||||
{"root preexec close", 388},
|
||||
{"root postexec", 389},
|
||||
{"available", 390},
|
||||
{"volume", 391},
|
||||
{"fstype", 392},
|
||||
{"set directory", 393},
|
||||
{"source environment", 394},
|
||||
{"wide links", 395},
|
||||
{"follow symlinks", 396},
|
||||
{"dont descend", 397},
|
||||
{"magic script", 398},
|
||||
{"magic output", 399},
|
||||
{"delete readonly", 400},
|
||||
{"dos filemode", 401},
|
||||
{"dos filetimes", 402},
|
||||
{"dos filetime resolution", 403},
|
||||
{"fake directory create times", 404},
|
||||
{"panic action", 405},
|
||||
{"hide local users", 406},
|
||||
{"VFS options", 407},
|
||||
{"vfs object", 408},
|
||||
{"vfs options", 409},
|
||||
{"msdfs root", 410},
|
||||
{"host msdfs", 411},
|
||||
{"Winbind options", 412},
|
||||
{"winbind uid", 413},
|
||||
{"winbind gid", 414},
|
||||
{"template homedir", 415},
|
||||
{"template shell", 416},
|
||||
{"winbind separator", 417},
|
||||
{"winbind cache time", 418},
|
||||
{"winbind enum users", 419},
|
||||
{"winbind enum groups", 420},
|
||||
};
|
||||
|
||||
int _msg_tbl_length = 421;
|
||||
int _msg_tbl_length = 420;
|
||||
|
File diff suppressed because it is too large
Load Diff
BIN
source/po/pl.gmo
BIN
source/po/pl.gmo
Binary file not shown.
@ -448,7 +448,9 @@ static void cgi_download(char *file)
|
||||
char buf[1024];
|
||||
int fd, l, i;
|
||||
char *p;
|
||||
#if I18N_SWAT
|
||||
int nLangDesc;
|
||||
#endif
|
||||
|
||||
/* sanitise the filename */
|
||||
for (i=0;file[i];i++) {
|
||||
|
@ -196,7 +196,6 @@ static void show_parameter(int snum, struct parm_struct *parm)
|
||||
{
|
||||
int i;
|
||||
void *ptr = parm->ptr;
|
||||
char* str;
|
||||
|
||||
if (parm->class == P_LOCAL && snum >= 0) {
|
||||
ptr = lp_local_ptr(snum, ptr);
|
||||
|
Loading…
Reference in New Issue
Block a user