From 6d620e0e00723e0d3a5889044a2e19e99c17917a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 27 Mar 2003 23:31:15 +0000 Subject: Also rebuild smbd/vfs.o after reconfiguring (This used to be commit afda828b388381742b4d980b21bed953273eb3aa) --- source3/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/Makefile.in b/source3/Makefile.in index 32c8e73b51..b76cbe0914 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -1189,7 +1189,7 @@ clean: delheaders python_clean # This is quite ugly actually.. But we need to make # sure the changes to include/config.h are used. modules_clean: - @-rm -f @MODULES_CLEAN@ auth/auth.o passdb/pdb_interface.o rpc_server/srv_pipe_hnd.o lib/iconv.o + @-rm -f @MODULES_CLEAN@ auth/auth.o passdb/pdb_interface.o rpc_server/srv_pipe_hnd.o lib/iconv.o smbd/vfs.o # Making this target will just make sure that the prototype files # exist, not necessarily that they are up to date. Since they're -- cgit From 28f7d7588a624cd726c8a721a8f9db5e1cae9936 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 27 Mar 2003 23:36:16 +0000 Subject: Compile @VFS_STATIC@ into smbd and vfstest (This used to be commit 0133c0a2ee36015f6f459da6f4d9472bf5a4dec4) --- source3/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/Makefile.in b/source3/Makefile.in index b76cbe0914..9aca82571f 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -324,7 +324,7 @@ SMBD_OBJ_SRV = smbd/files.o smbd/chgpasswd.o smbd/connection.o \ printing/printfsp.o lib/util_seaccess.o \ smbd/build_options.o \ smbd/change_trust_pw.o \ - $(MANGLE_OBJ) + $(MANGLE_OBJ) @VFS_STATIC@ SMBD_OBJ_BASE = $(PARAM_OBJ) $(SMBD_OBJ_SRV) $(MSDFS_OBJ) $(LIBSMB_OBJ) \ $(RPC_SERVER_OBJ) $(RPC_PARSE_OBJ) $(SECRETS_OBJ) $(UBIQX_OBJ) \ -- cgit From d4b4e02fb88da2ea0398eb7113cb53b93185ee65 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 28 Mar 2003 00:21:01 +0000 Subject: removed a duplicate lump of module stuff in configure.in (This used to be commit 0502c8a06e3bcefd9ea0f16f611bafc66086fbe9) --- source3/configure.in | 7 ------- 1 file changed, 7 deletions(-) diff --git a/source3/configure.in b/source3/configure.in index a299864068..82e4b9a50d 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -3394,13 +3394,6 @@ SMB_MODULE(vfs_fake_perms, \$(VFS_FAKE_PERMS_OBJ), bin/fake_perms.so, VFS) SMB_MODULE(vfs_netatalk, \$(VFS_NETATALK), bin/netatalk.so, VFS) SMB_SUBSYSTEM(VFS) -SMB_MODULE(vfs_recycle, \$(VFS_RECYCLE_OBJ), bin/recycle.so, VFS) -SMB_MODULE(vfs_audit, \$(VFS_AUDIT_OBJ), bin/audit.so, VFS) -SMB_MODULE(vfs_extd_audit, \$(VFS_EXTD_AUDIT_OBJ), bin/extd_audit.so, VFS) -SMB_MODULE(vfs_fake_perms, \$(VFS_FAKE_PERMS_OBJ), bin/fake_perms.so, VFS) -SMB_MODULE(vfs_netatalk, \$(VFS_NETATALK), bin/netatalk.so, VFS) -SMB_SUBSYSTEM(VFS) - AC_DEFINE_UNQUOTED(STRING_STATIC_MODULES, "$string_static_modules", [String list of builtin modules]) AC_SUBST(MODULES_CLEAN) -- cgit From 0e1ad952fbb3dca19d7b28f97f5c8655212ea07b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 28 Mar 2003 00:28:55 +0000 Subject: its VFS_NETATALK_OBJ not VFS_NETATALK (This used to be commit 662e1bea1b5e8ca8fb842f7ef76f848541116760) --- source3/configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/configure.in b/source3/configure.in index 82e4b9a50d..1bc23cf74f 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -3391,7 +3391,7 @@ SMB_MODULE(vfs_recycle, \$(VFS_RECYCLE_OBJ), bin/recycle.so, VFS) SMB_MODULE(vfs_audit, \$(VFS_AUDIT_OBJ), bin/audit.so, VFS) SMB_MODULE(vfs_extd_audit, \$(VFS_EXTD_AUDIT_OBJ), bin/extd_audit.so, VFS) SMB_MODULE(vfs_fake_perms, \$(VFS_FAKE_PERMS_OBJ), bin/fake_perms.so, VFS) -SMB_MODULE(vfs_netatalk, \$(VFS_NETATALK), bin/netatalk.so, VFS) +SMB_MODULE(vfs_netatalk, \$(VFS_NETATALK_OBJ), bin/netatalk.so, VFS) SMB_SUBSYSTEM(VFS) AC_DEFINE_UNQUOTED(STRING_STATIC_MODULES, "$string_static_modules", [String list of builtin modules]) -- cgit From 893cbb759268bb114dcb873fef9f588eaad5263c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 28 Mar 2003 01:05:32 +0000 Subject: it is possible for some of the real time signals to be used by glibc, which then changes SIGRTMIN. It is also possible for bash to leave some real time signals blocked at startup. This fixes both problems. (This used to be commit 8d45bf644aecb6993c2a82b86a4527b33029ed8f) --- source3/include/includes.h | 4 ++++ source3/smbd/notify_kernel.c | 5 ++++- source3/smbd/oplock_linux.c | 5 ++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/source3/include/includes.h b/source3/include/includes.h index f536ea88fe..09c64d896d 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -891,6 +891,10 @@ struct printjob; #define SIGCLD SIGCHLD #endif +#ifndef SIGRTMIN +#define SIGRTMIN 32 +#endif + #ifndef MAP_FILE #define MAP_FILE 0 #endif diff --git a/source3/smbd/notify_kernel.c b/source3/smbd/notify_kernel.c index 8b7ff21ecb..efe93de5af 100644 --- a/source3/smbd/notify_kernel.c +++ b/source3/smbd/notify_kernel.c @@ -39,7 +39,7 @@ static SIG_ATOMIC_T signals_received; #ifndef RT_SIGNAL_NOTIFY -#define RT_SIGNAL_NOTIFY 34 +#define RT_SIGNAL_NOTIFY (SIGRTMIN+2) #endif #ifndef F_SETSIG @@ -233,6 +233,9 @@ struct cnotify_fns *kernel_notify_init(void) cnotify.remove_notify = kernel_remove_notify; cnotify.select_time = -1; + /* the signal can start off blocked due to a bug in bash */ + BlockSignals(False, RT_SIGNAL_NOTIFY); + return &cnotify; } diff --git a/source3/smbd/oplock_linux.c b/source3/smbd/oplock_linux.c index deed0c5107..84083dffc9 100644 --- a/source3/smbd/oplock_linux.c +++ b/source3/smbd/oplock_linux.c @@ -39,7 +39,7 @@ static SIG_ATOMIC_T fd_pending_array[FD_PENDING_SIZE]; #endif #ifndef RT_SIGNAL_LEASE -#define RT_SIGNAL_LEASE 33 +#define RT_SIGNAL_LEASE (SIGRTMIN+1) #endif #ifndef F_SETSIG @@ -296,6 +296,9 @@ struct kernel_oplocks *linux_init_kernel_oplocks(void) koplocks.msg_waiting = linux_oplock_msg_waiting; koplocks.notification_fd = -1; + /* the signal can start off blocked due to a bug in bash */ + BlockSignals(False, RT_SIGNAL_LEASE); + DEBUG(3,("Linux kernel oplocks enabled\n")); return &koplocks; -- cgit From 0995fb1eef32938294c76011a5d5b170ae963ec0 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 28 Mar 2003 02:00:19 +0000 Subject: fix up IPC/LPT:/A: devicetype in tcon_and_X (This used to be commit a9ccae314fdb4b96115d31083f1a4b26209d597c) --- source3/smbd/reply.c | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index bf74d997b8..70f5e0aba2 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -204,16 +204,21 @@ int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt { fstring service; DATA_BLOB password; - fstring devicename; + + /* what the cleint thinks the device is */ + fstring client_devicetype; + /* what the server tells the client the share represents */ + const char *server_devicetype; NTSTATUS nt_status; uint16 vuid = SVAL(inbuf,smb_uid); int passlen = SVAL(inbuf,smb_vwv3); pstring path; char *p, *q; extern BOOL global_encrypted_passwords_negotiated; + START_PROFILE(SMBtconX); - *service = *devicename = 0; + *service = *client_devicetype = 0; /* we might have to close an old one */ if ((SVAL(inbuf,smb_vwv2) & 0x1) && conn) { @@ -250,11 +255,11 @@ int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt else fstrcpy(service,path); - p += srvstr_pull(inbuf, devicename, p, sizeof(devicename), 6, STR_ASCII); + p += srvstr_pull(inbuf, client_devicetype, p, sizeof(client_devicetype), 6, STR_ASCII); - DEBUG(4,("Got device type %s\n",devicename)); + DEBUG(4,("Client requested device type [%s] for share [%s]\n", client_devicetype, service)); - conn = make_connection(service,password,devicename,vuid,&nt_status); + conn = make_connection(service,password,client_devicetype,vuid,&nt_status); data_blob_clear_free(&password); @@ -263,37 +268,31 @@ int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt return ERROR_NT(nt_status); } + if ( IS_IPC(conn) ) + server_devicetype = "IPC"; + else if ( IS_PRINT(conn) ) + server_devicetype = "LPT:"; + else + server_devicetype = "A:"; + if (Protocol < PROTOCOL_NT1) { set_message(outbuf,2,0,True); p = smb_buf(outbuf); - p += srvstr_push(outbuf, p, devicename, -1, + p += srvstr_push(outbuf, p, server_devicetype, -1, STR_TERMINATE|STR_ASCII); set_message_end(outbuf,p); } else { /* NT sets the fstype of IPC$ to the null string */ const char *fsname = IS_IPC(conn) ? "" : lp_fstype(SNUM(conn)); - const char *devicetype; - + set_message(outbuf,3,0,True); - if ( IS_IPC(conn) ) - devicetype = "IPC"; - else if ( IS_PRINT(conn) ) - devicetype = "LPT:"; - else - devicetype = "A:"; - p = smb_buf(outbuf); - p += srvstr_push(outbuf, p, IS_IPC(conn) ? "IPC" : devicetype, -1, + p += srvstr_push(outbuf, p, server_devicetype, -1, STR_TERMINATE|STR_ASCII); p += srvstr_push(outbuf, p, fsname, -1, STR_TERMINATE); p = smb_buf(outbuf); - p += srvstr_push(outbuf, p, IS_IPC(conn) ? "IPC" : devicename, -1, - STR_TERMINATE|STR_ASCII); - p += srvstr_push(outbuf, p, fsname, -1, - STR_TERMINATE); - set_message_end(outbuf,p); /* what does setting this bit do? It is set by NT4 and -- cgit From d9eef2fbc231a434c58ca4c25654680cfc40410d Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 28 Mar 2003 02:02:32 +0000 Subject: don't include proto.h during autoconf tests since it doesn't exist yet; fixed getsmbpass replacement test (This used to be commit ff43a292b9f8e0a39d19cb099913efd899de84fa) --- source3/configure.in | 1 + source3/include/includes.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/source3/configure.in b/source3/configure.in index 1bc23cf74f..e16836dd83 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -1683,6 +1683,7 @@ SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I${srcdir-.}/ -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/popt -I${srcdir-.}/smbwrapper" AC_TRY_COMPILE([ #define REPLACE_GETPASS 1 +#define NO_PROTO_H 1 #define NO_CONFIG_H 1 #define main dont_declare_main #include "${srcdir-.}/lib/getsmbpass.c" diff --git a/source3/include/includes.h b/source3/include/includes.h index 09c64d896d..e8e0751cab 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -855,7 +855,9 @@ struct functable { struct printjob; /***** automatically generated prototypes *****/ +#ifndef NO_PROTO_H #include "proto.h" +#endif /* String routines */ -- cgit From 87e2a1b9dbd327c23044021085fe9f29bd81e19a Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 28 Mar 2003 05:24:21 +0000 Subject: Allow the new modules system to function with builtin vfs modules. If we don't have a vfs path set, just pass the original file name. In future, we need to seperate the default path as a seperate paramater. Andrew Bartlett (This used to be commit 93c91a2e9d325a4b2d092e144e63f743e6e049bc) --- source3/smbd/vfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index a8b350b9cd..3dc55cf536 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -334,7 +334,7 @@ BOOL smbd_vfs_init(connection_struct *conn) handle->handle = NULL; DLIST_ADD(conn->vfs_private, handle); vfs_module = NULL; - if (vfs_path) { + if (vfs_path && *vfs_path) { asprintf(&vfs_module, "%s/%s", vfs_path, vfs_objects[j]); } else { asprintf(&vfs_module, "%s", vfs_objects[j]); -- cgit From a959e5c44a84cd2e4924832aadd024bdccc49207 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 28 Mar 2003 10:02:43 +0000 Subject: Merge from HEAD - get better error strings from the ldap server in pdb_ldap. Andrew Bartlett (This used to be commit 5dc29b10b08658178133aee7b4c47197fadc533a) --- source3/passdb/pdb_ldap.c | 49 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c index c8ae96344a..226c1fc171 100644 --- a/source3/passdb/pdb_ldap.c +++ b/source3/passdb/pdb_ldap.c @@ -649,10 +649,14 @@ static int ldapsam_search_one_user (struct ldapsam_privates *ldap_state, const c rc = ldapsam_search(ldap_state, lp_ldap_suffix (), scope, filter, attr, 0, result); if (rc != LDAP_SUCCESS) { - DEBUG(0,("ldapsam_search_one_user: Problem during the LDAP search: %s\n", - ldap_err2string (rc))); + char *ld_error; + ldap_get_option(ldap_state->ldap_struct, LDAP_OPT_ERROR_STRING, + &ld_error); + DEBUG(0,("ldapsam_search_one_user: Problem during the LDAP search: %s (%s)\n", + ld_error, ldap_err2string (rc))); DEBUG(3,("ldapsam_search_one_user: Query was: %s, %s\n", lp_ldap_suffix(), filter)); + SAFE_FREE(ld_error); } return rc; @@ -914,8 +918,13 @@ static NTSTATUS ldapsam_delete_entry(struct ldapsam_privates *ldap_state, ldap_mods_free(mods, 1); if (rc != LDAP_SUCCESS) { - DEBUG(0, ("could not delete attributes for %s, error: %s\n", - dn, ldap_err2string(rc))); + char *ld_error; + ldap_get_option(ldap_state->ldap_struct, LDAP_OPT_ERROR_STRING, + &ld_error); + + DEBUG(0, ("could not delete attributes for %s, error: %s (%s)\n", + dn, ldap_err2string(rc), ld_error)); + SAFE_FREE(ld_error); ldap_memfree(dn); return NT_STATUS_UNSUCCESSFUL; } @@ -1999,9 +2008,13 @@ static NTSTATUS ldapsam_update_sam_account(struct pdb_methods *my_methods, SAM_A ret = ldapsam_modify_entry(my_methods,newpwd,dn,mods,LDAP_MOD_REPLACE, False); ldap_mods_free(mods,1); - if (NT_STATUS_IS_ERR(ret)) { - DEBUG(0,("failed to modify user with uid = %s\n", - pdb_get_username(newpwd))); + if (!NT_STATUS_IS_OK(ret)) { + char *ld_error; + ldap_get_option(ldap_state->ldap_struct, LDAP_OPT_ERROR_STRING, + &ld_error); + DEBUG(0,("failed to modify user with uid = %s, error: %s (%s)\n", + pdb_get_username(newpwd), ld_error, ldap_err2string(rc))); + SAFE_FREE(ld_error); return ret; } @@ -2159,11 +2172,15 @@ static int ldapsam_search_one_group (struct ldapsam_privates *ldap_state, filter, group_attr, 0, result); if (rc != LDAP_SUCCESS) { + char *ld_error; + ldap_get_option(ldap_state->ldap_struct, LDAP_OPT_ERROR_STRING, + &ld_error); DEBUG(0, ("ldapsam_search_one_group: " - "Problem during the LDAP search: %s\n", - ldap_err2string(rc))); + "Problem during the LDAP search: LDAP error: %s (%s)", + ld_error, ldap_err2string(rc))); DEBUG(3, ("ldapsam_search_one_group: Query was: %s, %s\n", lp_ldap_suffix(), filter)); + SAFE_FREE(ld_error); } return rc; @@ -2414,7 +2431,12 @@ static NTSTATUS ldapsam_add_group_mapping_entry(struct pdb_methods *methods, ldap_mods_free(mods, 1); if (rc != LDAP_SUCCESS) { - DEBUG(0, ("failed to modify group %i\n", map->gid)); + char *ld_error; + ldap_get_option(ldap_state->ldap_struct, LDAP_OPT_ERROR_STRING, + &ld_error); + DEBUG(0, ("failed to add group %i error: %s (%s)\n", map->gid, + ld_error, ldap_err2string(rc))); + SAFE_FREE(ld_error); return NT_STATUS_UNSUCCESSFUL; } @@ -2466,7 +2488,12 @@ static NTSTATUS ldapsam_update_group_mapping_entry(struct pdb_methods *methods, ldap_mods_free(mods, 1); if (rc != LDAP_SUCCESS) { - DEBUG(0, ("failed to modify group %i\n", map->gid)); + char *ld_error; + ldap_get_option(ldap_state->ldap_struct, LDAP_OPT_ERROR_STRING, + &ld_error); + DEBUG(0, ("failed to modify group %i error: %s (%s)\n", map->gid, + ld_error, ldap_err2string(rc))); + SAFE_FREE(ld_error); } DEBUG(2, ("successfully modified group %i in LDAP\n", map->gid)); -- cgit From 6cc35405abaada82ce0202b57ef9d658997bd792 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 28 Mar 2003 15:42:57 +0000 Subject: fix CIDR hosts allow/deny notation (This used to be commit 0dc611569427c8b63b752d0f62f2127dc1479754) --- source3/lib/access.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/lib/access.c b/source3/lib/access.c index 50efdcc5f0..09676dbd58 100644 --- a/source3/lib/access.c +++ b/source3/lib/access.c @@ -33,7 +33,7 @@ static BOOL masked_match(const char *tok, const char *slash, const char *s) if (strlen(slash + 1) > 2) { mask = interpret_addr(slash + 1); } else { - mask = (uint32)((ALLONES << atoi(slash + 1)) ^ ALLONES); + mask = (uint32)((ALLONES >> atoi(slash + 1)) ^ ALLONES); } if (net == INADDR_NONE || mask == INADDR_NONE) { -- cgit From 250b5f83e94619037063dc2996526d76974e8262 Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Fri, 28 Mar 2003 21:07:44 +0000 Subject: Some fixes to URL syntax from coolo. (This used to be commit de49c3f48f85519b31e797730eca82cb979098dc) --- source3/libsmb/libsmbclient.c | 87 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 85 insertions(+), 2 deletions(-) diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c index 440527cd9d..916e388fe0 100644 --- a/source3/libsmb/libsmbclient.c +++ b/source3/libsmb/libsmbclient.c @@ -52,6 +52,82 @@ extern BOOL in_client; */ static int smbc_initialized = 0; +static int +hex2int( unsigned int _char ) +{ + if ( _char >= 'A' && _char <='F') + return _char - 'A' + 10; + if ( _char >= 'a' && _char <='f') + return _char - 'a' + 10; + if ( _char >= '0' && _char <='9') + return _char - '0'; + return -1; +} + +static void +decode_urlpart(char *segment) +{ + int old_length = strlen(segment); + int new_length = 0; + int new_length2 = 0; + int i = 0; + pstring new_segment; + char *new_usegment = 0; + + if ( !old_length ) { + return; + } + + /* make a copy of the old one */ + new_usegment = (char*)malloc( old_length * 3 + 1 ); + + while( i < old_length ) { + int bReencode = False; + unsigned char character = segment[ i++ ]; + if ((character <= ' ') || (character > 127)) + bReencode = True; + + new_usegment [ new_length2++ ] = character; + if (character == '%' ) { + int a = i+1 < old_length ? hex2int( segment[i] ) : -1; + int b = i+1 < old_length ? hex2int( segment[i+1] ) : -1; + if ((a == -1) || (b == -1)) { /* Only replace if sequence is valid */ + /* Contains stray %, make sure to re-encode! */ + bReencode = True; + } else { + /* Valid %xx sequence */ + character = a * 16 + b; /* Replace with value of %dd */ + if (!character) + break; /* Stop at %00 */ + + new_usegment [ new_length2++ ] = (unsigned char) segment[i++]; + new_usegment [ new_length2++ ] = (unsigned char) segment[i++]; + } + } + if (bReencode) { + unsigned int c = character / 16; + new_length2--; + new_usegment [ new_length2++ ] = '%'; + + c += (c > 9) ? ('A' - 10) : '0'; + new_usegment[ new_length2++ ] = c; + + c = character % 16; + c += (c > 9) ? ('A' - 10) : '0'; + new_usegment[ new_length2++ ] = c; + } + + new_segment [ new_length++ ] = character; + } + new_segment [ new_length ] = 0; + + /* this assumes (very safely) that removing %aa sequences + only shortens the string */ + strncpy(segment, new_segment, old_length); + + free(new_usegment); +} + /* * Function to parse a path and turn it into components * @@ -97,7 +173,7 @@ smbc_parse_path(SMBCCTX *context, const char *fname, char *server, char *share, p += 2; /* Skip the // or \\ */ if (*p == (char)0) - return 0; + goto decoding; if (*p == '/') { @@ -158,7 +234,7 @@ smbc_parse_path(SMBCCTX *context, const char *fname, char *server, char *share, } - if (*p == (char)0) return 0; /* That's it ... */ + if (*p == (char)0) goto decoding; /* That's it ... */ if (!next_token(&p, share, "/", sizeof(fstring))) { @@ -170,6 +246,13 @@ smbc_parse_path(SMBCCTX *context, const char *fname, char *server, char *share, all_string_sub(path, "/", "\\", 0); + decoding: + decode_urlpart(path); + decode_urlpart(server); + decode_urlpart(share); + decode_urlpart(user); + decode_urlpart(password); + return 0; } -- cgit From 60cf0f28ce3ebb21511330a0b14a6b2a42b47be0 Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Fri, 28 Mar 2003 21:12:11 +0000 Subject: Fix some uncleanness with testsmbc.c (This used to be commit 73ef6d35bbadc3ea549309119857effe3c1bc7ef) --- examples/libsmbclient/testsmbc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/libsmbclient/testsmbc.c b/examples/libsmbclient/testsmbc.c index 888a9c0d4f..9af845a5ea 100644 --- a/examples/libsmbclient/testsmbc.c +++ b/examples/libsmbclient/testsmbc.c @@ -103,7 +103,7 @@ int main(int argc, char *argv[]) } - fprintf(stdout, "Directory handles: %u, %u, %u\n", dh1, dh2, dh3); + fprintf(stdout, "Directory handles: %u\n", dh1); /* Now, list those directories, but in funny ways ... */ -- cgit From a6fad1ca7220160774148c1caeece45629d87ca6 Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Fri, 28 Mar 2003 21:41:27 +0000 Subject: More patches from coolo. One of these functions needs to be moved elsewhere so other code can use it. (This used to be commit b988e16b7da824864cac6b69910ade27885e7f50) --- source3/libsmb/libsmbclient.c | 120 +++++++++++++++++++++++++++--------------- 1 file changed, 78 insertions(+), 42 deletions(-) diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c index 916e388fe0..f74a0be7f3 100644 --- a/source3/libsmb/libsmbclient.c +++ b/source3/libsmb/libsmbclient.c @@ -1475,9 +1475,47 @@ dir_list_fn(file_info *finfo, const char *mask, void *state) } + +/* Return the IP address and workgroup of a master browser on the + network. */ + +static BOOL find_master_ip_bcast(pstring workgroup, struct in_addr *server_ip) +{ + struct in_addr *ip_list; + int i, count; + + /* Go looking for workgroups by broadcasting on the local network */ + + if (!name_resolve_bcast(MSBROWSE, 1, &ip_list, &count)) { + return False; + } + + for (i = count-1; i < count; i++) { + static fstring name; + + DEBUG(0, ("name_status_find %d %s\n", i, inet_ntoa(ip_list[i]))); + + if (!name_status_find("*", 0, 0x1d, ip_list[i], name)) + continue; + + if (!find_master_ip(name, server_ip)) + continue; + + pstrcpy(workgroup, name); + + DEBUG(4, ("found master browser %s, %s\n", + name, inet_ntoa(ip_list[i]))); + + return True; + } + + return False; +} + static SMBCFILE *smbc_opendir_ctx(SMBCCTX *context, const char *fname) { - fstring server, share, user, password, workgroup; + fstring server, share, user, password; + pstring workgroup; pstring path; SMBCSRV *srv = NULL; SMBCFILE *dir = NULL; @@ -1486,28 +1524,31 @@ static SMBCFILE *smbc_opendir_ctx(SMBCCTX *context, const char *fname) if (!context || !context->internal || !context->internal->_initialized) { + fprintf(stderr, "no valid context\n"); errno = EINVAL; return NULL; } if (!fname) { - + fprintf(stderr, "no valid fname\n"); errno = EINVAL; return NULL; } if (smbc_parse_path(context, fname, server, share, path, user, password)) { - + fprintf(stderr, "no valid path\n"); errno = EINVAL; return NULL; } + fprintf(stderr, "parsed path: fname='%s' server='%s' share='%s' path='%s'\n", fname, server, share, path); + if (user[0] == (char)0) fstrcpy(user, context->user); - fstrcpy(workgroup, context->workgroup); + pstrcpy(workgroup, context->workgroup); dir = malloc(sizeof(*dir)); @@ -1528,9 +1569,12 @@ static SMBCFILE *smbc_opendir_ctx(SMBCCTX *context, const char *fname) dir->dir_list = dir->dir_next = dir->dir_end = NULL; if (server[0] == (char)0) { + struct in_addr server_ip; + + fprintf(stderr, "empty server\n"); if (share[0] != (char)0 || path[0] != (char)0) { - + fprintf(stderr, "share %d path %d\n", share[0], path[0]); errno = EINVAL; if (dir) { SAFE_FREE(dir->fname); @@ -1544,48 +1588,40 @@ static SMBCFILE *smbc_opendir_ctx(SMBCCTX *context, const char *fname) /* first try to get the LMB for our workgroup, and if that fails, */ /* try the DMB */ - if (!(resolve_name(context->workgroup, &rem_ip, 0x1d) || - resolve_name(context->workgroup, &rem_ip, 0x1b))) { - - errno = EINVAL; /* Something wrong with smb.conf? */ - return NULL; + pstrcpy(workgroup, lp_workgroup()); - } - - dir->dir_type = SMBC_WORKGROUP; - - /* find the name of the server ... */ - - if (!name_status_find("*", 0, 0, rem_ip, server)) { - - DEBUG(0,("Could not get the name of local/domain master browser for server %s\n", server)); - errno = EINVAL; - return NULL; - - } - - /* - * Get a connection to IPC$ on the server if we do not already have one - */ - - srv = smbc_server(context, server, "IPC$", workgroup, user, password); - - if (!srv) { - - if (dir) { - SAFE_FREE(dir->fname); - SAFE_FREE(dir); - } - + if (!find_master_ip(lp_workgroup(), &server_ip)) { + DEBUG(4, ("Unable to find master browser for workgroup %s\n", + workgroup)); + if (!find_master_ip_bcast(workgroup, &server_ip)) { + DEBUG(4, ("Unable to find master browser by " + "broadcast\n")); + errno = ENOENT; return NULL; - - } - + } + } + + /* + * Get a connection to IPC$ on the server if we do not already have one + */ + + srv = smbc_server(context, inet_ntoa(server_ip), "IPC$", workgroup, user, password); + + if (!srv) { + + if (dir) { + SAFE_FREE(dir->fname); + SAFE_FREE(dir); + } + return NULL; + } + dir->srv = srv; + dir->dir_type = SMBC_WORKGROUP; /* Now, list the stuff ... */ - if (!cli_NetServerEnum(&srv->cli, workgroup, 0x80000000, list_fn, + if (!cli_NetServerEnum(&srv->cli, workgroup, SV_TYPE_DOMAIN_ENUM, list_fn, (void *)dir)) { if (dir) { @@ -2655,7 +2691,7 @@ SMBCCTX * smbc_init_context(SMBCCTX * context) /* Do we still need this ? */ DEBUGLEVEL = 10; - setup_logging( "libsmbclient", False); + setup_logging( "libsmbclient", True); /* Here we would open the smb.conf file if needed ... */ -- cgit From dfcf1634bc84ff00f8241c326084a705989fb099 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 29 Mar 2003 12:44:42 +0000 Subject: added a simple test for the old SMBtcon interface (This used to be commit c95ae394c5dfe5e0fcc658119213b17bcb95fab5) --- source3/libsmb/cliconnect.c | 43 ++++++++++++++++++++++++++++++++++++++++++- source3/torture/torture.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 1 deletion(-) diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index 763878f9b3..75dcd62c2f 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -750,7 +750,6 @@ BOOL cli_ulogoff(struct cli_state *cli) /**************************************************************************** Send a tconX. ****************************************************************************/ - BOOL cli_send_tconX(struct cli_state *cli, const char *share, const char *dev, const char *pass, int passlen) { @@ -1343,3 +1342,45 @@ name *SMBSERVER with error %s\n", desthost, cli_errstr(cli) )); return True; } + + + + + +/**************************************************************************** + Send an old style tcon. +****************************************************************************/ +NTSTATUS cli_raw_tcon(struct cli_state *cli, + const char *service, const char *pass, const char *dev, + uint16 *max_xmit, uint16 *tid) +{ + char *p; + + memset(cli->outbuf,'\0',smb_size); + memset(cli->inbuf,'\0',smb_size); + + set_message(cli->outbuf, 0, 0, True); + SCVAL(cli->outbuf,smb_com,SMBtcon); + cli_setup_packet(cli); + + p = smb_buf(cli->outbuf); + *p++ = 4; p += clistr_push(cli, p, service, -1, STR_TERMINATE | STR_NOALIGN); + *p++ = 4; p += clistr_push(cli, p, pass, -1, STR_TERMINATE | STR_NOALIGN); + *p++ = 4; p += clistr_push(cli, p, dev, -1, STR_TERMINATE | STR_NOALIGN); + + cli_setup_bcc(cli, p); + + cli_send_smb(cli); + if (!cli_receive_smb(cli)) { + return NT_STATUS_UNEXPECTED_NETWORK_ERROR; + } + + if (cli_is_error(cli)) { + return cli_nt_error(cli); + } + + *max_xmit = SVAL(cli->inbuf, smb_vwv0); + *tid = SVAL(cli->inbuf, smb_vwv1); + + return NT_STATUS_OK; +} diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 327212c6be..6ab5bf6dbb 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -976,6 +976,43 @@ static BOOL run_tcon_test(int dummy) } +/* + checks for old style tcon support + */ +static BOOL run_tcon2_test(int dummy) +{ + static struct cli_state *cli; + uint16 cnum, max_xmit; + char *service; + NTSTATUS status; + + if (!torture_open_connection(&cli)) { + return False; + } + cli_sockopt(cli, sockops); + + printf("starting tcon2 test\n"); + + asprintf(&service, "\\\\%s\\%s", host, share); + + status = cli_raw_tcon(cli, service, password, "?????", &max_xmit, &cnum); + + if (!NT_STATUS_IS_OK(status)) { + printf("tcon2 failed : %s\n", cli_errstr(cli)); + } else { + printf("tcon OK : max_xmit=%d cnum=%d tid=%d\n", + (int)max_xmit, (int)cnum, SVAL(cli->inbuf, smb_tid)); + } + + if (!torture_close_connection(cli)) { + return False; + } + + printf("Passed tcon2 test\n"); + return True; +} + + /* This test checks that @@ -4137,6 +4174,7 @@ static struct { {"CASETABLE", torture_casetable, 0}, {"ERRMAPEXTRACT", run_error_map_extract, 0}, {"PIPE_NUMBER", run_pipe_number, 0}, + {"TCON2", run_tcon2_test, 0}, {NULL, NULL, 0}}; -- cgit From 054e5daf7c362b55310d9159ac90732f6ee5f7e0 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sat, 29 Mar 2003 12:49:54 +0000 Subject: sync packagaing with SAMBA_3_0 (This used to be commit b97f6620aa80df9649775f81055b70146a03ec66) --- packaging/Mandrake/samba-print-pdf.sh | 40 +- packaging/Mandrake/samba2.spec.tmpl | 666 ++++++++++++++++++++++++---------- packaging/Mandrake/smb.conf | 47 ++- packaging/Mandrake/smb.init | 2 +- packaging/Mandrake/wrepld.init | 93 +++++ 5 files changed, 629 insertions(+), 219 deletions(-) create mode 100644 packaging/Mandrake/wrepld.init diff --git a/packaging/Mandrake/samba-print-pdf.sh b/packaging/Mandrake/samba-print-pdf.sh index 3d88f9fb88..07c92b484b 100644 --- a/packaging/Mandrake/samba-print-pdf.sh +++ b/packaging/Mandrake/samba-print-pdf.sh @@ -10,10 +10,14 @@ # Arguments: # $1 = file (usually passed with %s from samba) # $2 = unix prefix to where to place the file (~%u should work) -# $3 = windows prefix to the same location (\\%L\%u should work) +# $3 = windows prefix to the same location (//%L/%u should work) # $4 = user/computer to send a notification to (%u or %m) # $5 = IP address of client (%I) - +# $6 = Name of destination file without extension (%J) +# $7 = PDF setting (prepress,print,screen etc) +# +# If you want to customise any of the following configuration defaults, +# you can place them in the file /etc/samba/print-pdf.conf. PS2PDF=ps2pdf13 OPTIONS="-dAutoFilterColorImages=false -sColorImageFilter=FlateEncode" @@ -22,6 +26,13 @@ KEEP_PS=1 PERMS=640 INFILE=$(basename $INPUT) BASEFILE=pdf-service +PREFIX="$2" +NAME="$6" +WINBASE=$(echo "$3"|sed -e 's,/,\\\\,g') + +# Source config file if it exists: +CONFFILE=/etc/samba/print-pdf.conf +[ -e $CONFFILE ] && . $CONFFILE #make a temp file to use for the output of the PDF OUTPUT=`mktemp -q $2/$BASEFILE-XXXXXX` @@ -29,30 +40,39 @@ if [ $? -ne 0 ]; then echo "$0: Can't create temp file $2/$BASEFILE-XXXXXX, exiting..." exit 1 fi +if [ "$NAME" != "" ]; then + FINALOUTPUT="$PREFIX/$NAME" +else + FINALOUTPUT="$OUTPUT" +fi +if [ "$7" != "" ]; then + OPTIONS="$OPTIONS -dPDFSETTINGS=/${7#pdf-}" +else + OPTIONS="$OPTIONS -dPDFSETTINGS=/default" +fi -WIN_OUTPUT="$3\\`basename $OUTPUT`" +WIN_OUTPUT="$WINBASE\\"`basename "$FINALOUTPUT"` # create the PDF: -$PS2PDF $OPTIONS $INPUT $OUTPUT.pdf >/dev/null 2>&1 +$PS2PDF $OPTIONS $INPUT "$OUTPUT".pdf >/dev/null 2>&1 +mv -f "$OUTPUT".pdf "$FINALOUTPUT".pdf # Generate a message to send to the user, and deal with the original file: MESSAGE=$(echo "Your PDF file has been created as $WIN_OUTPUT.pdf\n") if [ $KEEP_PS ];then - mv $INPUT $OUTPUT.ps + mv -f $INPUT "${FINALOUTPUT}".ps MESSAGE=$(echo "$MESSAGE and your postscript file as $WIN_OUTPUT.ps") # Fix permissions on the generated files - chmod $PERMS $OUTPUT.ps + chmod $PERMS "${FINALOUTPUT}".ps else rm -f $INPUT - chmod $PERMS $OUTPUT.ps $OUTPUT.pdf + chmod $PERMS "${FINALOUTPUT}".ps "${FINALOUTPUT}".pdf # Fix permissions on the generated files fi -chmod $PERMS $OUTPUT.ps $OUTPUT.pdf - #Remove empty file from mktemp: -rm -f $OUTPUT +[ "x$NAME" -eq "x" ] && rm -f $OUTPUT # Send notification to user echo -e $MESSAGE|smbclient -M $4 -I $5 -U "PDF Generator" >/dev/null 2>&1 diff --git a/packaging/Mandrake/samba2.spec.tmpl b/packaging/Mandrake/samba2.spec.tmpl index e21a148486..47f61eea64 100644 --- a/packaging/Mandrake/samba2.spec.tmpl +++ b/packaging/Mandrake/samba2.spec.tmpl @@ -1,7 +1,22 @@ -%define pkg_name samba -%define ver 2.2.5 -%define rel 17mdk -%define vscanver 0.2.5c +# Note that this file exists in Mandrake packaging cvs (as samba3.spec) +# and samba cvs (as packaging/Mandrake/samba2.spec.tmpl). +# Keep in mind that any changes should take both locations into account +# Considerable effort has gone into making this possible, so that only +# one spec file is maintained, please don't break it. +# It should be possible, without any changes to this file, to build +# binary packages on most recent Mandrake releases: +# 1)from official source releases, using 'cd packaging/Mandrake; sh makerpms.sh' +# 2)from cvs snapshots, using 'cd packaging/Mandrake; sh makerpms-cvs.sh ' +# 3)using official source releases and updated Mandrake packaging, by +# 'rpm -ba samba.spec' +# As such, any sources or patches used in a build from a samba release or +# cvs should be submitted for inclusion in samba cvs. + +%define pkg_name samba +%define ver 3.0alpha22 +%define rel 2mdk +%define vscanver 0.3.1 +%define libsmbmajor 0 # Determine whether this is the system samba or not. %define build_system 0 @@ -9,40 +24,35 @@ %define samba_major %{null} %else %define samba_major 3 -%global _iconsdir %{_datadir}/icons/ -%global _miconsdir %{_datadir}/icons/mini -%global _liconsdir %{_datadir}/icons/large -%global _menudir %{_libdir}/menu -#%%%%global __prefix /opt/samba%{samba_major} - -%global _mandir %{_datadir}/man %endif -# 2.2.4 and 1 replace by samba-team at release +# Version and release replaced by samba-team at release from samba cvs %define pversion PVERSION %define prelease PRELEASE -# For testing this setup: -#%define pversion1 2.2.5 -#%define prelease1 %(date +%Y%m%d) #Check to see if p(version|release) has been replaced (1 if replaced) %define have_pversion %(if [ "%pversion" = `echo "pversion" |tr '[:lower:]' '[:upper:]'` ];then echo 0; else echo 1; fi) %define have_prelease %(if [ "%prelease" = `echo "prelease" |tr '[:lower:]' '[:upper:]'` ];then echo 0; else echo 1; fi) +%if %have_pversion +%define source_ver %{pversion} +%else +%define source_ver %{ver} +%endif + # We might have a prerelease: -%define have_pre %(echo %pversion|awk '{p=0} /[a-z,A-Z][a-z,A-Z]/ {p=1} {print p}') +%define have_pre %(echo %source_ver|awk '{p=0} /[a-z,A-Z][a-z,A-Z]/ {p=1} {print p}') %if %have_pre -%define pre_ver %(perl -e '$name="%pversion"; print ($name =~ /(.*?)[a-z]/);') -%define pre_pre %(echo %pversion|sed -e 's/%pre_ver//g') +%define pre_ver %(perl -e '$name="%source_ver"; print ($name =~ /(.*?)[a-z]/);') +%define pre_pre %(echo %source_ver|sed -e 's/%pre_ver//g') %endif - # Check to see if we are running a build from a tarball release from samba.org # (%have_pversion) If so, disable vscan, unless explicitly requested # (--with vscan). -%define build_vscan 1 +%define build_vscan 1 %if %have_pversion -%define build_vscan 0 +%define build_vscan 0 %{?_with_vscan: %define build_vscan 1} %endif @@ -51,7 +61,6 @@ #%define build_cooker %(if [[ `cat /etc/mandrake-release|grep Cooker` ]];then echo 1; else echo 0; fi) %define build_mdk91 %(if [ `awk '{print $4}' /etc/mandrake-release` = 9.1 ];then echo 1; else echo 0; fi) %define build_mdk90 %(if [ `awk '{print $4}' /etc/mandrake-release` = 9.0 ];then echo 1; else echo 0; fi) -%define build_mdk83 %(if [ `awk '{print $4}' /etc/mandrake-release` = 8.3 ];then echo 1; else echo 0; fi) %define build_mdk82 %(if [ `awk '{print $4}' /etc/mandrake-release` = 8.2 ];then echo 1; else echo 0; fi) %define build_mdk81 %(if [ `awk '{print $4}' /etc/mandrake-release` = 8.1 ];then echo 1; else echo 0; fi) %define build_mdk80 %(if [ `awk '{print $4}' /etc/mandrake-release` = 8.0 ];then echo 1; else echo 0; fi) @@ -62,19 +71,20 @@ %define build_acl 1 %define build_winbind 1 %define build_wins 1 -%define build_ldap 1 +%define build_ldap 0 %define build_ads 1 +%define build_scanners 0 +# CUPS supports functionality for 'printcap name = cups' (9.0 and later): +%define build_cupspc 0 # Set defaults for each version %if %build_mdk91 +%define build_cupspc 1 %endif %if %build_mdk90 %endif -%if %build_mdk83 -%endif - %if %build_mdk82 %endif @@ -119,60 +129,69 @@ %{?_with_ads: %{expand: %%define build_non_default 1}} %{?_without_ads: %{expand: %%define build_ads 0}} %{?_without_ads: %{expand: %%define build_non_default 1}} +%{?_with_scanners: %{expand: %%define build_scanners 1}} +%{?_with_scanners: %{expand: %%define build_non_default 1}} # As if that weren't enough, we're going to try building with antivirus # support as an option also -%define build_fprot 0 +%define build_fprot 0 %define build_kaspersky 0 -%define build_mks 0 -%define build_openantivirus 0 -%define build_sophos 0 -%define build_symantec 0 +%define build_mks 0 +%define build_openav 0 +%define build_sophos 0 +%define build_symantec 0 %define build_trend 0 +%if %build_vscan && %build_scanners +#These can be enabled here by default +# (kaspersky requires their library present) +%define build_fprot 1 +%define build_mks 1 +%define build_openav 1 +%define build_sophos 1 +%define build_trend 1 +%endif %if %build_vscan %{?_with_fprot: %{expand: %%global build_fprot 1}} %{?_with_kaspersky: %{expand: %%global build_kaspersky 1}} %{?_with_mks: %{expand: %%global build_mks 1}} -%{?_with_openav: %{expand: %%global build_openantivirus 1}} +%{?_with_openav: %{expand: %%global build_openav 1}} %{?_with_sophos: %{expand: %%global build_sophos 1}} -%{?_with_symantec: %{expand: %%global build_symantec 1}} +#%{?_with_symantec: %{expand: %%global build_symantec 1}} %{?_with_trend: %{expand: %%global build_trend 1}} -%define vscandir "samba-vscan-%{vscanver}" +%global vscandir samba-vscan-%{vscanver} %endif -%define vfsdir "examples.bin/VFS" +%global vfsdir examples.bin/VFS #Workaround missing macros in 8.x: %{!?perl_vendorlib: %{expand: %%global perl_vendorlib %{perl_sitearch}/../}} Summary: Samba SMB server. Name: %{pkg_name}%{samba_major} -%if %have_pversion && %have_pre + +%if %have_pre Version: %{pre_ver} -%define source_ver %{pversion} -%endif -%if %have_pversion && !%have_pre -Version: %{pversion} -%define source_ver %{pversion} -%endif -%if !%have_pversion -Version: %{ver} -%define source_ver %{ver} +%else +Version: %{source_ver} %endif + %if %have_prelease && !%have_pre Release: 1.%{prelease}mdk %endif %if %have_prelease && %have_pre Release: 0.%{pre_pre}.%{prelease}mdk %endif -%if !%have_prelease +%if !%have_prelease && !%have_pre Release: %{rel} %endif +%if !%have_prelease && %have_pre +Release: 0.%{pre_pre}.%{rel} +%endif + License: GPL Group: System/Servers Source: ftp://samba.org/pub/samba/samba-%{source_ver}.tar.bz2 URL: http://www.samba.org Source1: samba.log -Source2: mount.smb Source3: samba.xinetd Source4: swat_48.xpm.bz2 Source5: swat_32.xpm.bz2 @@ -183,23 +202,25 @@ Source8: samba-vscan-%{vscanver}.tar.bz2 %endif Source10: samba-print-pdf.sh.bz2 Patch1: smbw.patch.bz2 -Patch2: samba-glibc21.patch.bz2 -#Patch3: network-recycle_bin.patch.bz2 -Patch5: samba-2.2.0-gawk.patch.bz2 -Patch12: samba-2.2.0-buildroot.patch.bz2 -#Patch16: samba-mkdir.patch.bz2 -Patch17: samba-3.0-smbmount-sbin.patch.bz2 -#Patches 20-22 to get packaging synced from 2.2.2 to 3.0 -Patch20: samba-3.0-smb.conf.patch.bz2 -Patch21: samba-3.0-winbind.init.patch.bz2 -Patch22: samba-3.0-system-auth-winbind.patch.bz2 -Patch23: samba-3alpha20-destdir.patch.bz2 -#Patch24: samba-3.0alpha13-installman.patch.bz2 -Patch25: samba-3.0alpha13-config_lang.patch.bz2 -#Patch 26 belongs with 20-22 -Patch26: samba-3.0-smb.init.patch.bz2 +Patch2: samba-2.2.0-gawk.patch.bz2 +Patch3: samba-2.2.0-buildroot.patch.bz2 +Patch4: samba-3.0-smbmount-sbin.patch.bz2 +%if !%have_pversion +# Version specific patches: current version +Patch101: samba-Makefile-3.0alpha21.patch.bz2 +Patch102: samba-3.0alpha22-mandrake-packaging.patch.bz2 +Patch110: samba-2.2.7a-fix-build.patch.bz2 +%else +# Version specific patches: upcoming version +%endif +# Limbo patches (applied to prereleases, but not preleases, ie destined for +# samba CVS) +%if %have_pversion && %have_pre +%endif Requires: pam >= 0.64, samba-common = %{version} BuildRequires: pam-devel autoconf readline-devel +BuildRequires: libxml2-devel +BuildRequires: mysql-devel %if %build_acl BuildRequires: libacl-devel %endif @@ -208,9 +229,7 @@ BuildRequires: cups-devel %else BuildRequires: libcups-devel %endif -%if %build_ldap BuildRequires: libldap-devel -%endif %if %build_ads BuildRequires: libldap-devel krb5-devel %endif @@ -257,14 +276,15 @@ more information. URL: http://www.samba.org Summary: Samba (SMB) server programs. Requires: %{name}-common = %{version} +PreReq: rpm-helper Group: Networking/Other +%if %build_system Provides: samba Obsoletes: samba -%if %build_system Obsoletes: samba-server-ldap Obsoletes: samba3-server %else -Provides: samba-server +#Provides: samba-server %endif %description server @@ -308,11 +328,11 @@ URL: http://www.samba.org Summary: Samba (SMB) client programs. Group: Networking/Other Requires: %{name}-common = %{version} -Obsoletes: smbfs %if %build_system Obsoletes: samba3-client +Obsoletes: smbfs %else -Provides: samba-client +#Provides: samba-client %endif %description client @@ -333,7 +353,7 @@ Group: System/Servers Obsoletes: samba-common-ldap Obsoletes: samba3-common %else -Provides: samba-common +#Provides: samba-common %endif %description common @@ -353,7 +373,7 @@ Requires: %{name}-common = %{version} %if %build_system Obsoletes: samba3-doc %else -Provides: samba-doc +#Provides: samba-doc %endif %description doc @@ -375,7 +395,7 @@ Group: System/Servers Obsoletes: samba-swat-ldap Obsoletes: samba3-swat %else -Provides: samba-swat +#Provides: samba-swat %endif %description swat @@ -426,12 +446,93 @@ NOTE: This is a prerelease of samba-%{samba_major}, not intended for production use. If something breaks, file a bug report. %endif +%package debug +URL: http://www.samba.org +Summary: Debugging and benchmarking tools for samba +Group: System/Servers +Requires: %{name}-common = %{version} +%if %build_system +Obsoletes: samba3-debug +%else +Provides: samba-debug +%endif + +%description debug +This package provides tools for benchmarking samba, and debugging +the correct operation of tools against smb servers. + +%if %build_system +%package -n libsmbclient%{libsmbmajor} +URL: http://www.samba.org +Summary: SMB Client Library +Group: System/Libraries +Provides: libsmbclient + +%description -n libsmbclient%{libsmbmajor} +This package contains the SMB client library, part of the samba +suite of networking software, allowing other software to access +SMB shares. + +%endif +%if !%build_system +NOTE: This is a prerelease of samba-%{samba_major}, not intended +for production use. If something breaks, file a bug report. +%endif + +%if %build_system +%package -n libsmbclient%{libsmbmajor}-devel +URL: http://www.samba.org +Summary: SMB Client Library Development files +Group: System/Libraries +Provides: libsmbclient-devel + +%description -n libsmbclient%{libsmbmajor}-devel +This package contains the development files for the SMB client +library, part of the samba suite of networking software, allowing +the development of other software to access SMB shares. + +%endif +%if !%build_system +NOTE: This is a prerelease of samba-%{samba_major}, not intended +for production use. If something breaks, file a bug report. +%endif + +%package passdb-mysql +URL: http://www.samba.org +Summary: Samba password database plugin for MySQL +Group: System/Libraries + +%description passdb-mysql +The passdb-mysql package for samba provides a password database +backend allowing samba to store account details in a MySQL +database + +%if !%build_system +NOTE: This is a prerelease of samba-%{samba_major}, not intended +for production use. If something breaks, file a bug report. +%endif + +%package passdb-xml +URL: http://www.samba.org +Summary: Samba password database plugin for XML files +Group: System/Libraries + +%description passdb-xml +The passdb-xml package for samba provides a password database +backend allowing samba to store account details in XML files. + +%if !%build_system +NOTE: This is a prerelease of samba-%{samba_major}, not intended +for production use. If something breaks, file a bug report. +%endif + #Antivirus packages: %if %build_fprot %package vscan-fprot Summary: On-access virus scanning for samba using FPROT Group: System/Servers Requires: %{name}-server = %{version} +Provides: %{name}-vscan Autoreq: 0 %description vscan-fprot A vfs-module for samba to implement on-access scanning using the @@ -443,6 +544,7 @@ FPROT antivirus software (which must be installed to use this). Summary: On-access virus scanning for samba using Kaspersky Group: System/Servers Requires: %{name}-server = %{version} +Provides: %{name}-vscan Autoreq: 0 %description vscan-kaspersky A vfs-module for samba to implement on-access scanning using the @@ -454,19 +556,21 @@ Kaspersky antivirus software (which must be installed to use this). Summary: On-access virus scanning for samba using MKS Group: System/Servers Requires: %{name}-server = %{version} +Provides: %{name}-vscan Autoreq: 0 %description vscan-mks A vfs-module for samba to implement on-access scanning using the MKS antivirus software (which must be installed to use this). %endif -%if %build_openantivirus -%package vscan-openantivirus +%if %build_openav +%package vscan-openav Summary: On-access virus scanning for samba using OpenAntivirus Group: System/Servers Requires: %{name}-server = %{version} +Provides: %{name}-vscan Autoreq: 0 -%description vscan-openantivirus +%description vscan-openav A vfs-module for samba to implement on-access scanning using the OpenAntivirus antivirus software (which must be installed to use this). %endif @@ -476,6 +580,7 @@ OpenAntivirus antivirus software (which must be installed to use this). Summary: On-access virus scanning for samba using Sophos Group: System/Servers Requires: %{name}-server = %{version} +Provides: %{name}-vscan Autoreq: 0 %description vscan-sophos A vfs-module for samba to implement on-access scanning using the @@ -487,6 +592,7 @@ Sophos antivirus software (which must be installed to use this). Summary: On-access virus scanning for samba using Symantec Group: System/Servers Requires: %{name}-server = %{version} +Provides: %{name}-vscan Autoreq: 0 %description vscan-symantec A vfs-module for samba to implement on-access scanning using the @@ -498,6 +604,7 @@ Symantec antivirus software (which must be installed to use this). Summary: On-access virus scanning for samba using Trend Group: System/Servers Requires: %{name}-server = %{version} +Provides: %{name}-vscan Autoreq: 0 %description vscan-trend A vfs-module for samba to implement on-access scanning using the @@ -551,29 +658,51 @@ echo -e "\n%{name}-%{version}-%{release}\n">>%{SOURCE7} %endif #%patch111 -p1 %patch1 -p1 -b .smbw -#%patch3 -p1 -b .net-r_bin -%patch5 -p1 -b .gawk -#%patch6 -p1 -%patch12 -p1 -b .buildroot -%patch17 -p1 -b .sbin -%patch20 -p1 -b .samba222 -%patch21 -p1 -b .samba222 -%patch22 -p1 -b .samba222 -%patch23 -p1 -b .destdir -#%patch24 -p1 -b .langen -%patch25 -p1 -b .multilang -%patch26 -p1 -b .samba222 +%patch2 -p1 -b .gawk +%patch3 -p1 -b .buildroot +%patch4 -p1 -b .sbin +# Version specific patches: current version +%if !%have_pversion +echo "Applying patches for current version: %{ver}" +(cd source +%patch101 +) +%patch102 -p1 -b .mdk +%patch110 -p1 +%else +# Version specific patches: upcoming version +echo "Applying patches for new versions: %{pversion}" +%endif + +# Limbo patches +%if %have_pversion && %have_pre +echo "Appling patches which should only be applied to prereleases" +%endif + +# Fix quota compilation in glibc>2.3 +%if %build_mdk91 +#grep "" source/smbd/quotas.c >/dev/null && \ +perl -pi -e 's@@@' source/smbd/quotas.c +%endif + cp %{SOURCE7} . # Make a copy of examples so that we have a clean one for doc: cp -a examples examples.bin %if %build_vscan -# put antivirus files in examples.bin/VFS/ -for av in fprot kaspersky mks openantivirus sophos symantec trend; do - cp -a %{vscandir}/$av %{vfsdir} +cp -a %{vscandir} %{vfsdir} +#fix stupid directory names: +mv %{vfsdir}/%{vscandir}/openantivirus %{vfsdir}/%{vscandir}/oav +%endif +# Inline replacement of config dir +for av in fprot kaspersky mks oav sophos trend; do + [ -e %{vfsdir}/%{vscandir}/$av/vscan-$av.h ] && perl -pi -e \ + 's,^#define PARAMCONF "/etc/samba,#define PARAMCONF "/etc/%{name},' \ + %{vfsdir}/%{vscandir}/$av/vscan-$av.h done -%endif +#Inline edit vscan header: +perl -pi -e 's/^# define SAMBA_VERSION_MAJOR 2/# define SAMBA_VERSION_MAJOR 3/g' %{vfsdir}/%{vscandir}/include/vscan-global.h # Edit some files when not building system samba: %if !%build_system @@ -586,100 +715,115 @@ perl -pi -e 's/%{pkg_name}/%{name}/g' source/auth/pampass.c autoconf CPPFLAGS="-I/usr/include/openssl"; export CPPFLAGS CFLAGS="$RPM_OPT_FLAGS" +# Don't use --with-fhs now, since it overrides libdir, it sets configdir, +# lockdir,piddir logfilebase,privatedir and swatdir %configure --prefix=%{_prefix} \ - --with-fhs \ - --libdir=/etc/%{name} \ --sysconfdir=/etc/%{name} \ --localstatedir=/var \ - --with-configdir=/etc/%{name} \ - --with-codepagedir=/var/lib/%{name}/codepages \ + --libdir=%{_libdir}/%{name} \ --with-privatedir=/etc/%{name} \ + --with-lockdir=/var/cache/%{name} \ + --with-piddir=/var/run/%{name} \ --with-swatdir=%{_datadir}/swat%{samba_major} \ - --with-smbmount \ - --with-syslog \ + --with-configdir=/etc/%{name} \ + --with-logfilebase=/var/log/%{name} \ +%if !%build_ads + --with-ads=no \ +%endif --with-automount \ + --with-smbmount \ --with-pam \ - --with-vfs \ + --with-pam_smbpass \ +%if %build_ldap + --with-ldapsam \ +%endif + --with-tdbsam \ + --with-syslog \ + --with-quotas \ --with-utmp \ - --with-msdfs \ - --with-smbwrapper \ - --with-manpages-langs=en \ - --with-logfilebase=/var/log/%{name} \ - --with-lockdir=/var/cache/%{name} \ - --with-piddir=/var/run/%{name} \ -%if !%build_system - --program-suffix=%{samba_major} \ -%endif + --with-manpages-langs=en \ %if %build_acl --with-acl-support \ %endif -%if !%build_ldap - --with-ldap=no \ -%endif -%if !%build_ads - --with-ads=no \ -%endif - --with-quotas + --disable-mysqltest \ + --program-suffix=%{samba_major} # --with-pam_smbpass \ # --with-manpages-langs=en,ja,pl \ - -#make CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE" all +# --with-ldap=no \ +#%if !%build_system +# --with-smbwrapper \ +#%endif +# --with-nisplussam \ +# --with-fhs \ + +# For some reason passdb/pdb_xml.c doesn't like the flags below ... +# and the samba team doesn't always make proto before release ... +make proto_exists +make passdb/pdb_xml.o torture +# torture target broken in alpha22 (only on 9.0?) make CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" \ - all smbfilter smbwrapper smbcacls pam_smbpass nsswitch nsswitch/libnss_wins.so debug2html + all libsmbclient debug2html smbfilter wins modules +# all libsmbclient debug2html smbfilter wins torture modules # Build VFS modules (experimental) -cd ../%vfsdir -%configure --prefix=%{prefix} \ - --mandir=%{prefix}/share/man -make +#cd ../%vfsdir +#_configure --prefix=%{prefix} \ +# --mandir=%{prefix}/share/man +#make #make CFLAGS="$RPM_OPT_FLAGS -I../../source -I../../source/include -I../../source/ubiqx \ # -I../../source/smbwrapper -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" ) # Build mkntpasswd in examples/LDAP/ for smbldaptools -( -cd examples.bin/LDAP/smbldap-tools/mkntpwd -make -) +#( +#cd examples.bin/LDAP/smbldap-tools/mkntpwd +#make +#) # Build antivirus vfs objects: %if %build_fprot +echo -e "\n\nBuild antivirus VFS modules\n\n" echo "Building fprot" +(cd %{vfsdir}/%{vscandir}/fprot;make) %endif %if %build_kaspersky echo "Building Kaspersky" -(cd %{vfsdir}/kaspersky;make) +(cd %{vfsdir}/%{vscandir}/kaspersky;make) %endif %if %build_mks echo "Building mks" -(cd %{vfsdir}/mks;make) +(cd %{vfsdir}/%{vscandir}/mks;make) %endif -%if %build_openantivirus +%if %build_openav echo "Building OpenAntivirus" -(cd %{vfsdir}/openantivirus;make) +(cd %{vfsdir}/%{vscandir}/oav;make) %endif %if %build_sophos echo "building sophos" -(cd %{vfsdir}/sophos;make) +(cd %{vfsdir}/%{vscandir}/sophos;make) %endif %if %build_symantec echo "Building symantec" -(cd %{vfsdir}/symantec;make) +(cd %{vfsdir}/%{vscandir}/symantec;make) %endif %if %build_trend echo "Building Trend" -(cd %{vfsdir}/trend;make) +(cd %{vfsdir}/%{vscandir}/trend;make) %endif %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT +#Ensure all docs are readable +chmod a+r docs -R + # Any entries here mean samba makefile is *really* broken: mkdir -p $RPM_BUILD_ROOT/etc/%{name} mkdir -p $RPM_BUILD_ROOT/%{_datadir} +mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{name}/vfs (cd source -make DESTDIR=$RPM_BUILD_ROOT install) +make DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir}/%{name} install installclientlib installmodules) #need to stay mkdir -p $RPM_BUILD_ROOT/sbin @@ -689,18 +833,21 @@ mkdir -p $RPM_BUILD_ROOT/var/cache/%{name} mkdir -p $RPM_BUILD_ROOT/var/log/%{name} mkdir -p $RPM_BUILD_ROOT/var/run/%{name} mkdir -p $RPM_BUILD_ROOT/var/spool/%{name} -mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}/{netlogon,profiles,printers} -mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC} -mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}/codepages/src -mkdir -p $RPM_BUILD_ROOT/lib/security -mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib +mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/%{name}/{netlogon,profiles,printers} +mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/%{name}/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC} +mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/%{name}/codepages/src +mkdir -p $RPM_BUILD_ROOT/%{_lib}/security +mkdir -p $RPM_BUILD_ROOT%{_libdir} mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{name}/vfs mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}/scripts #smbwrapper and pam_winbind not handled by make, pam_smbpass.so doesn't build -install -m 755 source/bin/smbwrapper.so $RPM_BUILD_ROOT%{_libdir}/smbwrapper%{samba_major}.so -#install -m 755 source/bin/pam_smbpass.so $RPM_BUILD_ROOT/lib/security/pam_smbpass.so -install -m 755 source/nsswitch/pam_winbind.so $RPM_BUILD_ROOT/lib/security/pam_winbind%{samba_major}.so +#install -m 755 source/bin/smbwrapper.so $RPM_BUILD_ROOT%{_libdir}/smbwrapper%{samba_major}.so +install -m 755 source/bin/pam_smbpass.so $RPM_BUILD_ROOT/%{_lib}/security/pam_smbpass%{samba_major}.so +install -m 755 source/nsswitch/pam_winbind.so $RPM_BUILD_ROOT/%{_lib}/security/pam_winbind%{samba_major}.so + +# smbsh forgotten +#install -m 755 source/bin/smbsh $RPM_BUILD_ROOT%{_bindir}/ # Install VFS modules #install -m755 %vfsdir/audit.so $RPM_BUILD_ROOT/%{_libdir}/samba/vfs @@ -711,10 +858,12 @@ install -m 755 source/nsswitch/pam_winbind.so $RPM_BUILD_ROOT/lib/security/pam_w # Antivirus support: # mkdir -p $RPM_BUILD_ROOT%{_libdir}/samba/vfs/vscan - for av in fprotd kavp mksd oav sophos symantec trend; do - if [ -d %{vfsdir}/$av -a -e %{vfsdir}/$av/vscan-$av.so ];then - cp %{vfsdir}/$av/vscan-$av.so \ - $RPM_BUILD_ROOT%{_libdir}/samba/vfs/ + for av in fprot kavp mks oav sophos symantec trend; do + if [ -d %{vfsdir}/%{vscandir}/$av -a -e %{vfsdir}/%{vscandir}/$av/vscan-$av*.so ];then + cp %{vfsdir}/%{vscandir}/$av/vscan-$av*.so \ + $RPM_BUILD_ROOT%{_libdir}/%{name}/vfs/ + cp %{vfsdir}/%{vscandir}/$av/vscan-$av*.conf \ + $RPM_BUILD_ROOT%{_sysconfdir}/%{name} fi done @@ -728,15 +877,21 @@ done #libnss_* not handled by make: # Install the nsswitch library extension file for i in wins winbind; do - install -m755 source/nsswitch/libnss_${i}.so $RPM_BUILD_ROOT/lib/libnss_${i}%{samba_major}.so + install -m755 source/nsswitch/libnss_${i}.so $RPM_BUILD_ROOT/%{_lib}/libnss_${i}%{samba_major}.so done # Make link for wins and winbind resolvers -( cd $RPM_BUILD_ROOT/lib; ln -s libnss_wins%{samba_major}.so libnss_wins%{samba_major}.so.2; ln -s libnss_winbind%{samba_major}.so libnss_winbind%{samba_major}.so.2) +( cd $RPM_BUILD_ROOT/%{_lib}; ln -s libnss_wins%{samba_major}.so libnss_wins%{samba_major}.so.2; ln -s libnss_winbind%{samba_major}.so libnss_winbind%{samba_major}.so.2) + +%if 1 +# Debugging stuff (broken in alpha22) +for i in smbtorture msgtest masktest locktest locktest2 nsstest vfstest debug2html;do + install -m755 source/bin/$i $RPM_BUILD_ROOT/%{_bindir} +done +%endif # Install other stuff # install -m644 examples/VFS/recycle/recycle.conf $RPM_BUILD_ROOT/etc/samba/ - install -m644 packaging/Mandrake/smb.conf $RPM_BUILD_ROOT/etc/%{name}/smb.conf install -m644 packaging/Mandrake/smbusers $RPM_BUILD_ROOT/etc/%{name}/smbusers install -m755 packaging/Mandrake/smbprint $RPM_BUILD_ROOT/%{_bindir} #install -m755 packaging/RedHat/smbadduser $RPM_BUILD_ROOT/usr/bin @@ -744,11 +899,12 @@ done install -m755 packaging/Mandrake/smb.init $RPM_BUILD_ROOT/etc/rc.d/init.d/smb%{samba_major} install -m755 packaging/Mandrake/smb.init $RPM_BUILD_ROOT/%{_sbindir}/%{name} install -m755 packaging/Mandrake/winbind.init $RPM_BUILD_ROOT/etc/rc.d/init.d/winbind%{samba_major} + install -m755 packaging/Mandrake/wrepld.init $RPM_BUILD_ROOT/etc/rc.d/init.d/wrepld%{samba_major} install -m755 packaging/Mandrake/winbind.init $RPM_BUILD_ROOT/%{_sbindir}/winbind%{samba_major} install -m644 packaging/Mandrake/samba.pamd $RPM_BUILD_ROOT/etc/pam.d/%{name} install -m644 packaging/Mandrake/system-auth-winbind.pamd $RPM_BUILD_ROOT/etc/pam.d/system-auth-winbind%{samba_major} # - install -m644 $RPM_SOURCE_DIR/samba.log $RPM_BUILD_ROOT/etc/logrotate.d/%{name} + install -m644 %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name} # install -m644 packaging/Mandrake/samba-slapd-include.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/samba-slapd.include # Install smbldap-tools scripts: @@ -779,10 +935,21 @@ install -m700 examples/LDAP/import_smbpasswd.pl $RPM_BUILD_ROOT/%{_datadir}/%{na cat packaging/Mandrake/smb.conf|sed -e 's/^; winbind/ winbind/g;s/^; obey pam/ obey pam/g; s/^; printer admin = @"D/ printer admin = @"D/g;s/^; password server = \*/ password server = \*/g;s/^; template/ template/g; s/^ security = user/ security = domain/g' > packaging/Mandrake/smb-winbind.conf install -m644 packaging/Mandrake/smb-winbind.conf $RPM_BUILD_ROOT/etc/%{name}/smb-winbind.conf +# Some inline fixes for smb.conf for non-winbind use +install -m644 packaging/Mandrake/smb.conf $RPM_BUILD_ROOT/etc/%{name}/smb.conf +cat packaging/Mandrake/smb.conf | \ +sed -e 's/^; printer admin = @adm/ printer admin = @adm/g' >$RPM_BUILD_ROOT/etc/%{name}/smb.conf +%if %build_cupspc +perl -pi -e 's/printcap name = lpstat/printcap name = cups/g' $RPM_BUILD_ROOT/etc/%{name}/smb.conf +perl -pi -e 's/printcap name = lpstat/printcap name = cups/g' $RPM_BUILD_ROOT/etc/%{name}/smb-winbind.conf +%endif + # Link smbmount to /sbin/mount.smb and /sbin/mount.smbfs #I don't think it's possible for make to do this ... - ln -s $RPM_BUILD_ROOT/%{_bindir}/smbmount%{samba_major} $RPM_BUILD_ROOT/sbin/mount.smb%{samba_major} - ln -s $RPM_BUILD_ROOT/%{_bindir}/smbmount%{samba_major} $RPM_BUILD_ROOT/sbin/mount.smbfs%{samba_major} +(cd $RPM_BUILD_ROOT/sbin + ln -s ..%{_bindir}/smbmount%{samba_major} mount.smb%{samba_major} + ln -s ..%{_bindir}/smbmount%{samba_major} mount.smbfs%{samba_major} +) echo 127.0.0.1 localhost > $RPM_BUILD_ROOT/etc/%{name}/lmhosts # Link smbspool to CUPS (does not require installed CUPS) @@ -798,11 +965,11 @@ install -m700 examples/LDAP/import_smbpasswd.pl $RPM_BUILD_ROOT/%{_datadir}/%{na # menu support mkdir -p $RPM_BUILD_ROOT%{_menudir} -cat > $RPM_BUILD_ROOT%{_menudir}/%{name} << EOF -?package(%{name}):command="gnome-moz-remote http://localhost:901/" needs="gnome" \ +cat > $RPM_BUILD_ROOT%{_menudir}/%{name}-swat << EOF +?package(%{name}-swat):command="gnome-moz-remote http://localhost:901/" needs="gnome" \ icon="swat%{samba_major}.xpm" section="Configuration/Networking" title="Samba Configuration" \ longtitle="The Swat Samba Administration Tool" -?package(%{name}):command="sh -c '\$BROWSER http://localhost:901/'" needs="x11" \ +?package(%{name}-swat):command="sh -c '\$BROWSER http://localhost:901/'" needs="x11" \ icon="swat%{samba_major}.xpm" section="Configuration/Networking" title="Samba Configuration" \ longtitle="The Swat Samba Administration Tool" EOF @@ -837,8 +1004,8 @@ done for i in smb winbind;do perl -pi -e 's,/subsys/'$i',/subsys/'$i'%{samba_major},g' $RPM_BUILD_ROOT/etc/rc.d/init.d/${i}%{samba_major} done -for i in /etc/%{name}/smb.conf /etc/rc.d/init.d/smb%{samba_major} %{_sbindir}/%{name} /etc/rc.d/init.d/winbind%{samba_major} %{_sbindir}/winbind%{samba_major} /etc/logrotate.d/%{name} /etc/xinetd.d/swat%{samba_major}; do - perl -pi -e 's,/%{pkg_name},/%{name},g; s,smbd,%{_sbindir}/smbd%{samba_major},g; s,nmbd,%{_sbindir}/nmbd%{samba_major},g; s,winbindd,%{_sbindir}/winbindd%{samba_major},g; s,/usr/sbin/swat,%{_sbindir}/swat%{samba_major},g' $RPM_BUILD_ROOT/$i; +for i in /etc/%{name}/smb.conf /etc/rc.d/init.d/smb%{samba_major} %{_sbindir}/%{name} /etc/rc.d/init.d/winbind%{samba_major} %{_sbindir}/winbind%{samba_major} /etc/logrotate.d/%{name} /etc/xinetd.d/swat%{samba_major} /etc/rc.d/init.d/wrepld%{samba_major}; do + perl -pi -e 's,/%{pkg_name},/%{name},g; s,smbd,%{_sbindir}/smbd%{samba_major},g; s,nmbd,%{_sbindir}/nmbd%{samba_major},g; s,winbindd,%{_sbindir}/winbindd%{samba_major},g; s,/usr/sbin/swat,%{_sbindir}/swat%{samba_major},g;s,wrepld,%{_sbindir}/wrepld%{samba_major},g' $RPM_BUILD_ROOT/$i; done # Fix pam files perl -pi -e 's/winbind/winbind%{samba_major}/g' $RPM_BUILD_ROOT/etc/pam.d/system-auth-winbind%{samba_major} @@ -846,12 +1013,18 @@ perl -pi -e 's/winbind/winbind%{samba_major}/g' $RPM_BUILD_ROOT/etc/pam.d/system perl -pi -e 's,/usr/sbin,%{_sbindir},g' $RPM_BUILD_ROOT/etc/xinetd.d/swat%{samba_major} %endif +#Clean up unpackaged files: +for i in %{_bindir}/pam_smbpass.so %{_bindir}/smbwrapper.so;do +rm -f %{buildroot}/$i +done + %clean rm -rf $RPM_BUILD_ROOT %post server -/sbin/chkconfig --level 35 smb%{samba_major} on +%_post_service smb%{samba_major} +%_post_service wrepld%{samba_major} # Add a unix group for samba machine accounts groupadd -frg 421 machines @@ -895,6 +1068,12 @@ fi # Let's define the proper paths for config files perl -pi -e 's/(\/etc\/)(smb)/\1%{name}\/\2/' /etc/%{name}/smb.conf +# Let's replace lpstat with cups in older smb.conf: +%if %build_cupspc +echo "Updating samba printing configuration if necessary..." +perl -pi -e 's/= lpstat/= cups/' /etc/%{name}/smb.conf +%endif + # Fix the logrotate.d file from smb and nmb to smbd and nmbd if [ -f /etc/logrotate.d/samba ]; then perl -pi -e 's/smb /smbd /' /etc/logrotate.d/samba @@ -956,12 +1135,12 @@ if [ $1 = 0 ]; then fi %endif %build_wins -%preun +%preun server -/sbin/chkconfig --level 35 smb%{samba_major} reset +%_preun_service smb%{samba_major} +%_preun_service wrepld%{samba_major} if [ $1 = 0 ] ; then -%_preun_service smb%{samba_major} # /sbin/chkconfig --level 35 smb reset # Let's not loose /var/cache/samba @@ -1017,18 +1196,26 @@ fi %{_sbindir}/%{name} %{_sbindir}/smbd%{samba_major} %{_sbindir}/nmbd%{samba_major} -#%{_sbindir}/smbcontrol +%{_sbindir}/wrepld%{samba_major} +%{_bindir}/smbcontrol%{samba_major} #%{_sbindir}/mkntpwd -#%{prefix}/bin/addtosmbpass +%{_bindir}/addtosmbpass%{samba_major} %{_bindir}/mksmbpasswd.sh %{_bindir}/smbstatus%{samba_major} %{_bindir}/convert_smbpasswd%{samba_major} %{_bindir}/pdbedit%{samba_major} %{_bindir}/smbgroupedit%{samba_major} -#%attr(755,root,root) /lib/security/pam_smbpass* +%{_bindir}/tdbbackup%{samba_major} +%{_bindir}/profiles%{samba_major} +%attr(755,root,root) /%{_lib}/security/pam_smbpass* +%{_libdir}/%{name}/vfs/vfs_audit.so +%{_libdir}/%{name}/vfs/vfs_netatalk.so +%{_libdir}/%{name}/vfs/vfs_recycle.so +%{_libdir}/%{name}/vfs/vfs_extd_audit.so #/usr/share/swat %attr(-,root,root) %config(noreplace) /etc/%{name}/smbusers -%attr(-,root,root) %config /etc/rc.d/init.d/smb%{samba_major} +%attr(-,root,root) %config %{_initrddir}/smb%{samba_major} +%attr(-,root,root) %config %{_initrddir}/wrepld%{samba_major} %attr(-,root,root) %config(noreplace) /etc/logrotate.d/%{name} %attr(-,root,root) %config(noreplace) /etc/pam.d/%{name} #%attr(-,root,root) %config(noreplace) /etc/%{name}/samba-slapd.include @@ -1037,17 +1224,15 @@ fi %{_mandir}/man7/samba*.7* %{_mandir}/man8/smbd*.8* %{_mandir}/man8/nmbd*.8* +%{_mandir}/man8/pdbedit*.8* +%{_mandir}/man8/smbgroupedit*.8* %{_mandir}/man1/smbcontrol*.1* -%{_mandir}/man5/lmhosts*.5* -%{_mandir}/man5/smb.conf*.5* -%attr(775,root,root) %dir /var/lib/%{name}/netlogon -%attr(775,root,root) %dir /var/lib/%{name}/profiles -%attr(775,root,root) %dir /var/lib/%{name}/printers/* -%dir /var/cache/%{name} -%dir /var/log/%{name} +%attr(775,root,root) %dir %{_localstatedir}/%{name}/netlogon +%attr(775,root,root) %dir %{_localstatedir}/%{name}/profiles +%attr(775,root,root) %dir %{_localstatedir}/%{name}/printers/* %attr(1777,root,root) %dir /var/spool/%{name} %dir %{_datadir}/%{name}/scripts -#%attr(0755,root,root) %{_datadir}/%{name}/scripts/print-pdf +%attr(0755,root,root) %{_datadir}/%{name}/scripts/print-pdf #%attr(0750,root,root) %{_datadir}/%{name}/scripts/smbldap*.pl #%attr(0640,root,root) %config(noreplace) %{_sysconfdir}/%{name}/smbldap_conf.pm #%attr(0644,root,root) %{_datadir}/%{name}/scripts/smbldap_tools.pm @@ -1070,13 +1255,15 @@ fi %config(noreplace) /etc/xinetd.d/swat%{samba_major} #%attr(-,root,root) /sbin/* %{_sbindir}/swat%{samba_major} -%{_menudir}/%{name} +%{_menudir}/%{name}-swat %{_miconsdir}/*.xpm %{_liconsdir}/*.xpm %{_iconsdir}/*.xpm %attr(-,root,root) %{_datadir}/swat%{samba_major}/help/* %attr(-,root,root) %{_datadir}/swat%{samba_major}/images/* %attr(-,root,root) %{_datadir}/swat%{samba_major}/include/* +%lang(ja) %{_datadir}/swat%{samba_major}/lang/ja +%lang(tr) %{_datadir}/swat%{samba_major}/lang/tr %{_mandir}/man8/swat*.8* %files client @@ -1086,7 +1273,7 @@ fi /sbin/mount.smbfs%{samba_major} %attr(755,root,root) %{_bindir}/smbmount%{samba_major} %attr(4755,root,root) %{_bindir}/smbumount%{samba_major} -#%attr(4755,root,root) %{_sbindir}/smbmnt +%attr(4755,root,root) %{_bindir}/smbmnt%{samba_major} %{_mandir}/man8/smbmnt*.8* %{_mandir}/man8/smbmount*.8* %{_mandir}/man8/smbumount*.8* @@ -1103,6 +1290,7 @@ fi /%{_mandir}/man1/findsmb*.1* /%{_mandir}/man1/smbclient*.1* /%{_mandir}/man1/smbtar*.1* +/%{_mandir}/man8/smbspool*.8* %files common %defattr(-,root,root) @@ -1115,32 +1303,40 @@ fi %{_bindir}/testprns%{samba_major} #%{_bindir}/make_printerdef %{_bindir}/rpcclient%{samba_major} -%{_bindir}/smbsh%{samba_major} +#%{_bindir}/smbsh%{samba_major} %{_bindir}/smbpasswd%{samba_major} +%{_bindir}/smbcacls%{samba_major} %{_bindir}/net%{samba_major} %{_bindir}/smbtree%{samba_major} -%{_libdir}/smbwrapper%{samba_major}.so +%{_bindir}/ntlm_auth%{samba_major} +#%{_libdir}/smbwrapper%{samba_major}.so +%{_libdir}/%{name}/*.dat +#%{_libdir}/%{name}/lowcase.dat +#%{_libdir}/%{name}/valid.dat %attr(-,root,root) %config(noreplace) /etc/%{name}/smb.conf %attr(-,root,root) %config(noreplace) /etc/%{name}/smb-winbind.conf %attr(-,root,root) %config(noreplace) /etc/%{name}/lmhosts -%attr(-,root,root) /var/lib/%{name}/codepages -%{_mandir}/man1/make_smbcodepage*.1* -%{_mandir}/man1/make_unicodemap*.1* +%attr(-,root,root) %{_localstatedir}/%{name}/codepages +#%{_mandir}/man1/make_smbcodepage*.1* +#%{_mandir}/man1/make_unicodemap*.1* %{_mandir}/man1/testparm*.1* -%{_mandir}/man1/smbsh*.1* +%{_mandir}/man1/rpcclient*.1* +%exclude %{_mandir}/man1/smbsh*.1* %{_mandir}/man1/testprns*.1* %{_mandir}/man5/smb.conf*.5* %{_mandir}/man5/lmhosts*.5* %{_mandir}/man8/smbpasswd*.8* -/%{_mandir}/man1/smbcacls*.1* +%{_mandir}/man1/smbcacls*.1* +%{_mandir}/man8/net*.8* %if %build_winbind %files winbind %defattr(-,root,root) %{_sbindir}/winbindd%{samba_major} +%{_sbindir}/winbind%{samba_major} %{_bindir}/wbinfo%{samba_major} -%attr(755,root,root) /lib/security/pam_winbind* -%attr(755,root,root) /lib/libnss_winbind%{samba_major}* +%attr(755,root,root) /%{_lib}/security/pam_winbind* +%attr(755,root,root) /%{_lib}/libnss_winbind%{samba_major}* %attr(-,root,root) %config /etc/rc.d/init.d/winbind%{samba_major} %attr(-,root,root) %config(noreplace) /etc/pam.d/system-auth-winbind* %{_mandir}/man8/winbindd*.8* @@ -1150,60 +1346,146 @@ fi %if %build_wins %files -n nss_wins%{samba_major} %defattr(-,root,root) -%attr(755,root,root) /lib/libnss_wins%{samba_major}.so* +%attr(755,root,root) /%{_lib}/libnss_wins%{samba_major}.so* +%endif + +%if 1 +%files debug +%defattr(-,root,root) +%{_bindir}/debug2html%{samba_major} +%{_bindir}/smbtorture%{samba_major} +%{_bindir}/msgtest%{samba_major} +%{_bindir}/masktest%{samba_major} +%{_bindir}/locktest%{samba_major} +%{_bindir}/locktest2%{samba_major} +%{_bindir}/nsstest%{samba_major} +%{_bindir}/vfstest%{samba_major} +%{_mandir}/man1/vfstest%{samba_major}*.1* +%else +%exclude %{_mandir}/man1/vfstest%{samba_major}*.1* +%endif + +%if %build_system +%files -n libsmbclient%{libsmbmajor} +%defattr(-,root,root) +%{_libdir}/libsmbclient.so* +%else +%exclude %{_libdir}/libsmbclient.so* +%endif + +%if %build_system +%files -n libsmbclient%{libsmbmajor}-devel +%defattr(-,root,root) +%{_includedir}/* +%else +%exclude %{_includedir}/* %endif +%files passdb-mysql +%defattr(-,root,root) +%{_libdir}/%{name}/*/pdb_mysql.so + +%files passdb-xml +%defattr(-,root,root) +%{_libdir}/%{name}/*/pdb_xml.so + #Files for antivirus support: %if %build_fprot %files vscan-fprot %defattr(-,root,root) %{_libdir}/%{name}/vfs/vscan-fprotd.so -%doc examples.bin/VFS/fprot/INSTALL +%config(noreplace) %{_sysconfdir}/%{name}/vscan-fprotd.conf +%doc %{vfsdir}/%{vscandir}/INSTALL %endif %if %build_kaspersky %files vscan-kaspersky %defattr(-,root,root) %{_libdir}/%{name}/vfs/vscan-kavp.so -%doc examples.bin/VFS/kaspersky/INSTALL +%config(noreplace) %{_sysconfdir}/%{name}/vscan-kavp.conf +%doc %{vfsdir}/%{vscandir}/INSTALL %endif %if %build_mks %files vscan-mks %defattr(-,root,root) %{_libdir}/%{name}/vfs/vscan-mksd.so -%doc examples.bin/VFS/mks/INSTALL +%config(noreplace) %{_sysconfdir}/%{name}/vscan-mks*.conf +%doc %{vfsdir}/%{vscandir}/INSTALL %endif -%if %build_openantivirus -%files vscan-openantivirus +%if %build_openav +%files vscan-openav %defattr(-,root,root) %{_libdir}/%{name}/vfs/vscan-oav.so -%doc examples.bin/VFS/openantivirus/INSTALL +%config(noreplace) %{_sysconfdir}/%{name}/vscan-oav.conf +%doc %{vfsdir}/%{vscandir}/INSTALL %endif %if %build_sophos %files vscan-sophos %defattr(-,root,root) %{_libdir}/%{name}/vfs/vscan-sophos.so -%doc examples.bin/VFS/sophos/INSTALL +%config(noreplace) %{_sysconfdir}/%{name}/vscan-sophos.conf +%doc %{vfsdir}/%{vscandir}/INSTALL %endif %if %build_symantec %files vscan-symantec %defattr(-,root,root) %{_libdir}/%{name}/vfs/vscan-symantec.so -%doc examples.bin/VFS/symantec/INSTALL +%config(noreplace) %{_sysconfdir}/%{name}/vscan-symantec.conf +%doc %{vfsdir}/%{vscandir}/INSTALL %endif %if %build_trend %files vscan-trend %defattr(-,root,root) %{_libdir}/%{name}/vfs/vscan-trend.so -%doc examples.bin/VFS/trend/INSTALL +%config(noreplace) %{_sysconfdir}/%{name}/vscan-trend.conf +%doc %{vfsdir}/%{vscandir}/INSTALL %endif %changelog +* Thu Mar 06 2003 Buchan Milne 3.0-0.alpha22.2mdk +- Alpha22 +- Add profiles binary to server and ntlm_auth to common +- smbwrapper and torture target broken (only in 9.0?) +- remove unused source 2 + +* Tue Mar 04 2003 Buchan Milne 3.0-0.alpha21.4mdk +- Don't provide samba-{server,client,common} when not system samba (bug #2617) +- Don't build libsmbclient packages when not system samba +- Fix conflict between samba-server and samba3-server (pam_smbpass) +- Fix smbwrapper (from 2.2.7a-5mdk for bug #2356) +- Fix codepage/charset example (bug #1574) + +* Thu Jan 23 2003 Buchan Milne 3.0-0.alpha21.3mdk +- samba-vscan 0.3.1 (and make it build again), including required inline edits +- Make all vscan packages provide samba(3)-vscan +- Build all vscan except kav (requires kaspersky lib) with --with-scanners +- Add vscan-(scanner).conf files +- Explicitly add ldapsam for 2.2 compatability when building --with ldap, + default build now uses new ldap passdb backend (ie you always get ldap) +- Enable (experimental) tdb passdb backend +- Fix file ownership conflicts between server and common +- Cleanup configure, to match order of --help +- Fix libdir location, was being overridden by --with-fhs +- Split off a libsmbclient and -devel package +- Add wins replication init script (patch 102) +- Workaround passdb/pdb_xml.c not compiling +- Workaround missing install targets for smbsh/smbwrapper.so in cvs +- Inline patch smbd/quotas.c for Mandrake >9.0 + +* Wed Nov 27 2002 Buchan Milne 3.0-0.alpha21.2mdk +- Remove patch 20,21,22,23,25,26 (upstream) +- New destdir patch from cvs (18) +- package installed but non-packaged files +- new debug subpackage for vfstest and related files (it was that or nuke the + manpage ;-)) +- use _libdir for libdir instead of _sysconfdir +- Update samba-vscan (untested) + * Mon Oct 28 2002 Buchan Milne 3.0-0.alpha20.3mdk - Fix mount.smbfs3 pointing to smbmount not in package - Remove unnecessary lines from install (now done by make) diff --git a/packaging/Mandrake/smb.conf b/packaging/Mandrake/smb.conf index f68d48cb4b..f2643b774a 100644 --- a/packaging/Mandrake/smb.conf +++ b/packaging/Mandrake/smb.conf @@ -77,6 +77,8 @@ # Uncomment this if you want a guest account, you must add this to /etc/passwd # otherwise the user "nobody" is used ; guest account = pcguest +# Allow users to map to guest: + map to guest = bad user # Security mode. Most people will want user level security. See # security_level.txt for details. @@ -212,27 +214,39 @@ ; logon home = \\%L\%U\.profile # The add user script is used by a domain member to add local user accounts -# that have been authenticated by the domain controller, or by the domain +# that have been authenticated by the domain controller. +# Script for domain member for adding local accounts for authenticated users: +; add user script = /usr/sbin/useradd -s /bin/false %u + +# The add machine script is use by a samba server configured as a domain # controller to add local machine accounts when adding machines to the domain. # The script must work from the command line when replacing the macros, # or the operation will fail. Check that groups exist if forcing a group. # Script for domain controller for adding machines: -; add user script = /usr/sbin/useradd -d /dev/null -g machines -c 'Machine Account' -s /bin/false -M %u +; add machine script = /usr/sbin/useradd -d /dev/null -g machines -c 'Machine Account' -s /bin/false -M %u # Script for domain controller with LDAP backend for adding machines (please # configure in /etc/samba/smbldap_conf.pm first): -; add user script = /usr/share/samba/scripts/smbldap-useradd.pl -w -d /dev/null -g machines -c 'Machine Account' -s /bin/false %u -# Script for domain member for adding local accounts for authenticated users: -; add user script = /usr/sbin/useradd -s /bin/false %u +; add machine script = /usr/share/samba/scripts/smbldap-useradd.pl -w -d /dev/null -g machines -c 'Machine Account' -s /bin/false %u # Domain groups: -# domain admin group is a list of unix users or groups who are made members -# of the Domain Admin group -; domain admin group = root @wheel -# -# domain guest groups is a list of unix users or groups who are made members -# of the Domain Guests group -; domain guest group = nobody @guest - +# Domain groups are now configured by using the smbgroupedit tool + +# Samba Password Database configuration: +# Samba now has runtime-configurable password database backends. Multiple +# passdb backends may be used, but users will only be added to the first one +# Default: +; passdb backend = smbpasswd unixsam +# TDB backen with fallback to smbpasswd and unixsam +; passdb backend = tdbsam_nua smbpasswd unixsam +# LDAP with fallback to smbpasswd unixsam +# Enable SSL by using an ldaps url, or enable tls with 'ldap ssl' below. +; passdb backend = ldapsam_nua:ldaps://ldap.mydomain.com smbpasswd unixsam + +# Non-unix account range: +# This is a range of unix user-id's that samba will map non-unix RIDs to, +# such as machine accounts, when using a _nua passdb backend + non unix account range = 10000-20000 + # LDAP configuration for Domain Controlling: # The account (dn) that samba uses to access the LDAP server # This account needs to have write access to the LDAP tree @@ -297,8 +311,8 @@ # UNIX: ISO8859-1 (Western European), ISO8859-2 (Eastern Eu.), # ISO8859-5 (Russian Cyrillic), KOI8-R (Alt-Russ. Cyril.) # This is an example for french users: -; client code page = 850 -; character set = ISO8859-1 +; dos charset = 850 +; unix charset = ISO8859-1 #============================ Share Definitions ============================== @@ -372,6 +386,7 @@ browseable = yes read only = yes write list = @adm root + guest ok = yes # A useful application of samba is to make a PDF-generation service # To streamline this, install windows postscript drivers (preferably colour) @@ -383,7 +398,7 @@ printable = Yes comment = PDF Generator (only valid users) #print command = /usr/share/samba/scripts/print-pdf file path win_path recipient IP & - print command = /usr/share/samba/scripts/print-pdf %s ~%u \\\\\\\\%L\\\\%u %m %I & + print command = /usr/share/samba/scripts/print-pdf %s ~%u //%L/%u %m %I "%J" & # This one is useful for people to share files ;[tmp] diff --git a/packaging/Mandrake/smb.init b/packaging/Mandrake/smb.init index bdc1518709..c5d3c8dc21 100755 --- a/packaging/Mandrake/smb.init +++ b/packaging/Mandrake/smb.init @@ -29,7 +29,7 @@ start() { # If CUPS is used as printing system, reload smb after a 1 minute delay # to allow the printers to appear properly as samba shares. if killall -0 cupsd 2>/dev/null; then - ( sleep 60 && killproc smbd -HUP ) & + ( sleep 60 && killproc smbd -HUP 1>/dev/null) & fi export TMPDIR="/var/tmp" echo -n "Starting SMB services: " diff --git a/packaging/Mandrake/wrepld.init b/packaging/Mandrake/wrepld.init new file mode 100644 index 0000000000..b8057f5f40 --- /dev/null +++ b/packaging/Mandrake/wrepld.init @@ -0,0 +1,93 @@ +#!/bin/sh +# +# chkconfig: 345 81 45 +# description: Starts and stops the Samba wrepld daemon to provide \ +# WINS replication services between WINS partner servers. + +# Source function library. +if [ -f /etc/init.d/functions ] ; then + . /etc/init.d/functions +elif [ -f /etc/rc.d/init.d/functions ] ; then + . /etc/rc.d/init.d/functions +else + exit 0 +fi + +# Source networking configuration. +. /etc/sysconfig/network + +# Check that networking is up. +[ ${NETWORKING} = "no" ] && exit 0 + +# Check that smb.conf exists. +[ -f /etc/samba/smb.conf ] || exit 0 + +RETVAL=0 + + +start() { + echo -n "Starting WINS Replication services: " + RETVAL=1 + if [ "`grep -i 'wins partners' /etc/samba/smb.conf | egrep -v [\#\;]`" ]; then + daemon wrepld + RETVAL=$? + else + echo "WINS replication is not configured in /etc/samba/smb.conf, not starting" + fi + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/wrepld || \ + RETVAL=1 + return $RETVAL +} +stop() { + echo -n "Shutting down WINS replication services: " + RETVAL=1 + if [ "`grep -i 'wins partners' /etc/samba/smb.conf | egrep -v [\#\;]`" ]; then + killproc wrepld + RETVAL=$? + fi + echo + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/wrepld + return $RETVAL +} +restart() { + stop + start +} +reload() { + export TMPDIR="/var/tmp" + echo -n "Reloading WINS replication: " + killproc wrepld -HUP + RETVAL=$? + echo + return $RETVAL +} +mdkstatus() { + status wrepld +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + restart + ;; + reload) + reload + ;; + status) + mdkstatus + ;; + condrestart) + [ -f /var/lock/subsys/wrepld ] && restart || : + ;; + *) + echo "Usage: $0 {start|stop|restart|status|condrestart}" + exit 1 +esac + +exit $? -- cgit