diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-07-08 09:19:43 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-07-08 12:35:56 +0200 |
commit | cda86869400285afe17db87a9a666fbcc5b918a8 (patch) | |
tree | d5e36a1f276729a827c2303bdfad56b8aacff55f /lib | |
parent | cf406f7e7d58b9c993ba1ddc6471fa85e445ba88 (diff) | |
download | samba-cda86869400285afe17db87a9a666fbcc5b918a8.tar.gz samba-cda86869400285afe17db87a9a666fbcc5b918a8.tar.bz2 samba-cda86869400285afe17db87a9a666fbcc5b918a8.zip |
lib/param: Merge struct loadparm_service into common
This is handled by a common header and a .c file that is included into
both loadparm.c files.
In the process, _lp functions were renamed to lp__ to allow the common
function definition declarations to be used by source3 and source4
(which have different macro definitions).
The only parameter to change type is 'strict_locking' which was a
bool, and is now an int, to accommodate the 'Auto' value from source3.
Andrew Bartlett
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri Jul 8 12:35:56 CEST 2011 on sn-devel-104
Diffstat (limited to 'lib')
-rw-r--r-- | lib/param/loadparm.h | 16 | ||||
-rw-r--r-- | lib/param/param_functions.c | 141 | ||||
-rw-r--r-- | lib/param/param_structs.h | 13 | ||||
-rw-r--r-- | lib/param/wscript_build | 6 |
4 files changed, 160 insertions, 16 deletions
diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h index d36f5a0f6e..1fa06b6587 100644 --- a/lib/param/loadparm.h +++ b/lib/param/loadparm.h @@ -116,3 +116,19 @@ struct parm_struct { #ifndef PRINT_MAX_JOBID #define PRINT_MAX_JOBID 10000 #endif + +#define LOADPARM_EXTRA_LOCALS \ + bool valid; \ + int usershare; \ + struct timespec usershare_last_mod; \ + int iMaxPrintJobs; \ + char *szCopy; \ + char *szService; \ + char *szInclude; \ + bool bWidelinks; \ + int bAvailable; \ + struct parmlist_entry *param_opt; \ + struct bitmap *copymap; \ + char dummy[3]; /* for alignment */ + +#include "lib/param/param_local.h" diff --git a/lib/param/param_functions.c b/lib/param/param_functions.c index e68e34ae55..ee865fd97c 100644 --- a/lib/param/param_functions.c +++ b/lib/param/param_functions.c @@ -1,7 +1,35 @@ +/* + Unix SMB/CIFS implementation. + Parameter loading functions + Copyright (C) Karl Auer 1993-1998 + + Largely re-written by Andrew Tridgell, September 1994 + + Copyright (C) Simo Sorce 2001 + Copyright (C) Alexander Bokovoy 2002 + Copyright (C) Stefan (metze) Metzmacher 2002 + Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2003 + Copyright (C) Michael Adam 2008 + Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007 + Copyright (C) Andrew Bartlett 2011 + + 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 3 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, see <http://www.gnu.org/licenses/>. +*/ + FN_LOCAL_STRING(pathname, szPath) FN_LOCAL_LIST(hostsallow, szHostsallow) FN_LOCAL_LIST(hostsdeny, szHostsdeny) -FN_LOCAL_STRING(comment, comment) FN_LOCAL_STRING(fstype, fstype) FN_LOCAL_LIST(ntvfs_handler, ntvfs_handler) FN_LOCAL_BOOL(msdfs_root, bMSDfsRoot) @@ -10,8 +38,7 @@ FN_LOCAL_BOOL(readonly, bRead_only) FN_LOCAL_BOOL(print_ok, bPrint_ok) FN_LOCAL_BOOL(map_hidden, bMap_hidden) FN_LOCAL_BOOL(map_archive, bMap_archive) -FN_LOCAL_BOOL(strict_locking, bStrictLocking) -FN_LOCAL_BOOL(oplocks, bOplocks) +FN_LOCAL_BOOL(oplocks, bOpLocks) FN_LOCAL_BOOL(strict_sync, bStrictSync) FN_LOCAL_BOOL(ci_filesystem, bCIFileSystem) FN_LOCAL_BOOL(map_system, bMap_system) @@ -21,3 +48,111 @@ FN_LOCAL_INTEGER(create_mask, iCreate_mask) FN_LOCAL_INTEGER(force_create_mode, iCreate_force_mode) FN_LOCAL_INTEGER(dir_mask, iDir_mask) FN_LOCAL_INTEGER(force_dir_mode, iDir_force_mode) +FN_LOCAL_STRING(preexec, szPreExec) +FN_LOCAL_STRING(postexec, szPostExec) +FN_LOCAL_STRING(rootpreexec, szRootPreExec) +FN_LOCAL_STRING(rootpostexec, szRootPostExec) +FN_LOCAL_STRING(dontdescend, szDontdescend) +FN_LOCAL_STRING(username, szUsername) +FN_LOCAL_LIST(invalid_users, szInvalidUsers) +FN_LOCAL_LIST(valid_users, szValidUsers) +FN_LOCAL_LIST(admin_users, szAdminUsers) +FN_LOCAL_STRING(printcommand, szPrintcommand) +FN_LOCAL_STRING(lpqcommand, szLpqcommand) +FN_LOCAL_STRING(lprmcommand, szLprmcommand) +FN_LOCAL_STRING(lppausecommand, szLppausecommand) +FN_LOCAL_STRING(lpresumecommand, szLpresumecommand) +FN_LOCAL_STRING(queuepausecommand, szQueuepausecommand) +FN_LOCAL_STRING(queueresumecommand, szQueueresumecommand) +static FN_LOCAL_STRING(_printername, szPrintername) +FN_LOCAL_CONST_STRING(printjob_username, szPrintjobUsername) +FN_LOCAL_STRING(magicscript, szMagicScript) +FN_LOCAL_STRING(magicoutput, szMagicOutput) +FN_LOCAL_STRING(comment, comment) +FN_LOCAL_STRING(force_user, force_user) +FN_LOCAL_STRING(force_group, force_group) +FN_LOCAL_LIST(readlist, readlist) +FN_LOCAL_LIST(writelist, writelist) +FN_LOCAL_LIST(printer_admin, printer_admin) +FN_LOCAL_LIST(vfs_objects, szVfsObjects) +FN_LOCAL_STRING(msdfs_proxy, szMSDfsProxy) +static FN_LOCAL_STRING(volume, volume) +FN_LOCAL_STRING(veto_files, szVetoFiles) +FN_LOCAL_STRING(hide_files, szHideFiles) +FN_LOCAL_STRING(veto_oplocks, szVetoOplockFiles) +FN_LOCAL_STRING(aio_write_behind, szAioWriteBehind) +FN_LOCAL_STRING(dfree_command, szDfree) +FN_LOCAL_BOOL(autoloaded, autoloaded) +FN_LOCAL_BOOL(preexec_close, bPreexecClose) +FN_LOCAL_BOOL(rootpreexec_close, bRootpreexecClose) +FN_LOCAL_INTEGER(casesensitive, iCaseSensitive) +FN_LOCAL_BOOL(preservecase, bCasePreserve) +FN_LOCAL_BOOL(shortpreservecase, bShortCasePreserve) +FN_LOCAL_BOOL(hide_dot_files, bHideDotFiles) +FN_LOCAL_BOOL(hide_special_files, bHideSpecialFiles) +FN_LOCAL_BOOL(hideunreadable, bHideUnReadable) +FN_LOCAL_BOOL(hideunwriteable_files, bHideUnWriteableFiles) +FN_LOCAL_BOOL(access_based_share_enum, bAccessBasedShareEnum) +FN_LOCAL_BOOL(no_set_dir, bNo_set_dir) +FN_LOCAL_BOOL(guest_ok, bGuest_ok) +FN_LOCAL_BOOL(guest_only, bGuest_only) +FN_LOCAL_BOOL(administrative_share, bAdministrative_share) +FN_LOCAL_BOOL(print_notify_backchannel, bPrintNotifyBackchannel) +FN_LOCAL_BOOL(store_dos_attributes, bStoreDosAttributes) +FN_LOCAL_BOOL(dmapi_support, bDmapiSupport) +FN_LOCAL_PARM_BOOL(locking, bLocking) +FN_LOCAL_PARM_INTEGER(strict_locking, iStrictLocking) +FN_LOCAL_PARM_BOOL(posix_locking, bPosixLocking) +FN_LOCAL_BOOL(share_modes, bShareModes) +FN_LOCAL_BOOL(level2_oplocks, bLevel2OpLocks) +FN_LOCAL_BOOL(onlyuser, bOnlyUser) +FN_LOCAL_PARM_BOOL(manglednames, bMangledNames) +FN_LOCAL_BOOL(symlinks, bSymlinks) +FN_LOCAL_BOOL(syncalways, bSyncAlways) +FN_LOCAL_BOOL(strict_allocate, bStrictAllocate) +FN_LOCAL_BOOL(delete_readonly, bDeleteReadonly) +FN_LOCAL_BOOL(fake_oplocks, bFakeOplocks) +FN_LOCAL_BOOL(recursive_veto_delete, bDeleteVetoFiles) +FN_LOCAL_BOOL(dos_filemode, bDosFilemode) +FN_LOCAL_BOOL(dos_filetimes, bDosFiletimes) +FN_LOCAL_BOOL(dos_filetime_resolution, bDosFiletimeResolution) +FN_LOCAL_BOOL(fake_dir_create_times, bFakeDirCreateTimes) +FN_LOCAL_BOOL(blocking_locks, bBlockingLocks) +FN_LOCAL_BOOL(inherit_perms, bInheritPerms) +FN_LOCAL_BOOL(inherit_acls, bInheritACLS) +FN_LOCAL_BOOL(inherit_owner, bInheritOwner) +FN_LOCAL_BOOL(use_client_driver, bUseClientDriver) +FN_LOCAL_BOOL(default_devmode, bDefaultDevmode) +FN_LOCAL_BOOL(force_printername, bForcePrintername) +FN_LOCAL_BOOL(nt_acl_support, bNTAclSupport) +FN_LOCAL_BOOL(force_unknown_acl_user, bForceUnknownAclUser) +FN_LOCAL_BOOL(ea_support, bEASupport) +FN_LOCAL_BOOL(_use_sendfile, bUseSendfile) +FN_LOCAL_BOOL(profile_acls, bProfileAcls) +FN_LOCAL_BOOL(map_acl_inherit, bMap_acl_inherit) +FN_LOCAL_BOOL(afs_share, bAfs_Share) +FN_LOCAL_BOOL(acl_check_permissions, bAclCheckPermissions) +FN_LOCAL_BOOL(acl_group_control, bAclGroupControl) +FN_LOCAL_BOOL(acl_map_full_control, bAclMapFullControl) +FN_LOCAL_INTEGER(security_mask, iSecurity_mask) +FN_LOCAL_INTEGER(force_security_mode, iSecurity_force_mode) +FN_LOCAL_INTEGER(dir_security_mask, iDir_Security_mask) +FN_LOCAL_INTEGER(force_dir_security_mode, iDir_Security_force_mode) +FN_LOCAL_INTEGER(defaultcase, iDefaultCase) +FN_LOCAL_INTEGER(minprintspace, iMinPrintSpace) +FN_LOCAL_INTEGER(printing, iPrinting) +FN_LOCAL_INTEGER(max_reported_jobs, iMaxReportedPrintJobs) +FN_LOCAL_INTEGER(oplock_contention_limit, iOplockContentionLimit) +FN_LOCAL_INTEGER(write_cache_size, iWriteCacheSize) +FN_LOCAL_INTEGER(block_size, iBlock_size) +FN_LOCAL_INTEGER(dfree_cache_time, iDfreeCacheTime) +FN_LOCAL_INTEGER(allocation_roundup_size, iallocation_roundup_size) +FN_LOCAL_INTEGER(aio_read_size, iAioReadSize) +FN_LOCAL_INTEGER(aio_write_size, iAioWriteSize) +FN_LOCAL_INTEGER(map_readonly, iMap_readonly) +FN_LOCAL_INTEGER(directory_name_cache_size, iDirectoryNameCacheSize) +FN_LOCAL_INTEGER(smb_encrypt, ismb_encrypt) +FN_LOCAL_CHAR(magicchar, magic_char) +FN_LOCAL_STRING(cups_options, szCupsOptions) +FN_LOCAL_PARM_BOOL(change_notify, bChangeNotify) +FN_LOCAL_PARM_BOOL(kernel_change_notify, bKernelChangeNotify) diff --git a/lib/param/param_structs.h b/lib/param/param_structs.h deleted file mode 100644 index f076ce15fa..0000000000 --- a/lib/param/param_structs.h +++ /dev/null @@ -1,13 +0,0 @@ -#define LOADPARM_EXTRA_LOCALS \ - struct parmlist_entry *param_opt; \ - char *szService; \ - char *szCopy; \ - char *szInclude; \ - char *szPrintername; \ - int bAvailable; \ - int iMaxPrintJobs; \ - char *volume; \ - struct bitmap *copymap; \ - char dummy[3]; /* for alignment */ - -#include "param_local.h" diff --git a/lib/param/wscript_build b/lib/param/wscript_build new file mode 100644 index 0000000000..c84a99d7ea --- /dev/null +++ b/lib/param/wscript_build @@ -0,0 +1,6 @@ +#!/usr/bin/env python + +bld.SAMBA_GENERATOR('param_local_h', + source= 'param_functions.c ../../script/mkparamdefs.pl', + target='param_local.h', + rule='${PERL} ${SRC[1].abspath(env)} ${SRC[0].abspath(env)} --file ${TGT} --generate-scope=LOCAL') |