svn commit: samba r5311 - in trunk/source: . include nsswitch passdb rpc_parse rpc_server rpcclient smbd
Author: vlendec Date: 2005-02-10 08:09:29 + (Thu, 10 Feb 2005) New Revision: 5311 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=5311 Log: Janitor for herb.. :-) Modified: trunk/source/Makefile.in trunk/source/configure.in trunk/source/include/ntdomain.h trunk/source/include/smb.h trunk/source/nsswitch/winbindd.h trunk/source/nsswitch/winbindd_cm.c trunk/source/nsswitch/winbindd_sid.c trunk/source/passdb/passdb.c trunk/source/rpc_parse/parse_prs.c trunk/source/rpc_parse/parse_rpc.c trunk/source/rpc_server/srv_pipe.c trunk/source/rpcclient/rpcclient.c trunk/source/smbd/nttrans.c trunk/source/smbd/trans2.c Changeset: Sorry, the patch is too large (506 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=5311
svn commit: samba r5312 - in trunk/source: . include nsswitch passdb rpc_parse rpc_server rpcclient smbd
Author: vlendec Date: 2005-02-10 08:12:49 + (Thu, 10 Feb 2005) New Revision: 5312 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=5312 Log: Ouch... Revert the 'janitor for herb', this was too much... :-) Volker Modified: trunk/source/Makefile.in trunk/source/configure.in trunk/source/include/ntdomain.h trunk/source/include/smb.h trunk/source/nsswitch/winbindd.h trunk/source/nsswitch/winbindd_cm.c trunk/source/nsswitch/winbindd_sid.c trunk/source/passdb/passdb.c trunk/source/rpc_parse/parse_prs.c trunk/source/rpc_parse/parse_rpc.c trunk/source/rpc_server/srv_pipe.c trunk/source/rpcclient/rpcclient.c trunk/source/smbd/nttrans.c trunk/source/smbd/trans2.c Changeset: Sorry, the patch is too large (506 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=5312
svn commit: samba r5313 - in trunk/source/smbd: .
Author: vlendec Date: 2005-02-10 08:15:30 + (Thu, 10 Feb 2005) New Revision: 5313 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=5313 Log: Janitor for herb, maybe this time done right ... Modified: trunk/source/smbd/trans2.c Changeset: Modified: trunk/source/smbd/trans2.c === --- trunk/source/smbd/trans2.c 2005-02-10 08:12:49 UTC (rev 5312) +++ trunk/source/smbd/trans2.c 2005-02-10 08:15:30 UTC (rev 5313) @@ -2192,6 +2192,7 @@ return UNIXERROR(def_class,def_code); } +#if defined(HAVE_POSIX_ACLS) / Utility function to count the number of entries in a POSIX acl. / @@ -2306,6 +2307,7 @@ return True; } +#endif / Reply to a TRANS2_QFILEPATHINFO or TRANSACT2_QFILEINFO (query file info by @@ -2871,6 +2873,7 @@ break; } +#if defined(HAVE_POSIX_ACLS) case SMB_QUERY_POSIX_ACL: { SMB_ACL_T file_acl = NULL; @@ -2947,6 +2950,7 @@ data_size = (num_file_acls + num_def_acls)*SMB_POSIX_ACL_ENTRY_SIZE + SMB_POSIX_ACL_HEADER_SIZE; break; } +#endif default: return ERROR_DOS(ERRDOS,ERRunknownlevel); @@ -3756,6 +3760,7 @@ return(-1); } +#if defined(HAVE_POSIX_ACLS) case SMB_SET_POSIX_ACL: { uint16 posix_acl_version; @@ -3805,6 +3810,7 @@ send_trans2_replies(outbuf, bufsize, params, 2, *ppdata, 0); return(-1); } +#endif default: return ERROR_DOS(ERRDOS,ERRunknownlevel);
svn commit: samba-docs r356 - in trunk: .
Author: jelmer Date: 2005-02-10 08:51:11 + (Thu, 10 Feb 2005) New Revision: 356 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=samba-docsrev=356 Log: Add support for building PDF's thru FO rather then docbook2latex. Output files are generated in output/fo-pdf/ Modified: trunk/Makefile trunk/Makefile.settings.in trunk/configure.in Changeset: Modified: trunk/Makefile === --- trunk/Makefile 2005-02-09 21:06:50 UTC (rev 355) +++ trunk/Makefile 2005-02-10 08:51:11 UTC (rev 356) @@ -55,6 +55,7 @@ txt: $(patsubst $(DOCBOOKDIR)/%.xml,$(TXTDIR)/%.txt,$(MAIN_DOCS)) txt-chunks: $(patsubst $(DOCBOOKDIR)/%.xml,$(TXTDIR)/%/,$(MAIN_DOCS)) fo: $(patsubst $(DOCBOOKDIR)/%.xml,$(FODIR)/%.fo,$(MAIN_DOCS)) +fo-pdf: $(patsubst $(DOCBOOKDIR)/%.xml,$(FOPDFDIR)/%.pdf,$(MAIN_DOCS)) tex: $(patsubst $(DOCBOOKDIR)/%.xml,%.tex,$(MAIN_DOCS)) manpages: $(patsubst $(MANPAGEDIR)/%.xml,$(MANDIR)/%,$(MANPAGES)) pearson: $(PEARSONDIR)/Samba-HOWTO-Collection.xml @@ -177,6 +178,11 @@ mkdir -p $(@D) $(XSLTPROC) --output $@ http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl $ +# PDF thru Fo +$(FOPDFDIR)/%.pdf: $(FODIR)/%.fo + mkdir -p $(@D) + $(FOP) $ $@ + $(HTMLHELPDIR)/%: $(DOCBOOKDIR)/%.xml -mkdir -p $@/images $(COPY_IMAGES) html $(DOCBOOKDIR)/$*.xml $* $@ Modified: trunk/Makefile.settings.in === --- trunk/Makefile.settings.in 2005-02-09 21:06:50 UTC (rev 355) +++ trunk/Makefile.settings.in 2005-02-10 08:51:11 UTC (rev 356) @@ -13,6 +13,7 @@ THUMBPDF = @THUMBPDF@ PDFLATEX = TEXINPUTS=xslt/latex:.: @PDFLATEX@ --file-line-error-style LATEX = TEXINPUTS=xslt/latex:.: @LATEX@ --file-line-error-style +FOP = @FOP@ RM = @RM@ PERL = @PERL@ ifndef DEBUG_LATEX @@ -32,6 +33,7 @@ SMBDOTCONFDOC = smbdotconf DOCBOOKDIR = tmp PSDIR = $(OUTPUTDIR) +FOPDFDIR = $(OUTPUTDIR)/fo-pdf PDFDIR = $(OUTPUTDIR) DVIDIR = $(OUTPUTDIR) FODIR = $(OUTPUTDIR) Modified: trunk/configure.in === --- trunk/configure.in 2005-02-09 21:06:50 UTC (rev 355) +++ trunk/configure.in 2005-02-10 08:51:11 UTC (rev 356) @@ -67,6 +67,7 @@ DOCS_TARGET_REQUIRE_PROGRAM(HTML2TEXT, html2text, TXT) DOCS_TARGET_REQUIRE_PROGRAM(PERL, perl, UNDOCUMENTED) DOCS_TARGET_REQUIRE_PROGRAM(XMLLINT, xmllint, VERIFY) +DOCS_TARGET_REQUIRE_PROGRAM(FOP, fop, FOPDF) DOCS_TARGET_REQUIRE_DIR([$SPECIFIED_SOURCEDIR ..], [source/configure.in], SAMBASOURCEDIR, UNDOCUMENTED) AC_MSG_RESULT([]) @@ -84,6 +85,7 @@ DOCS_DEFINE_TARGET(PEARSON, ALL, [pearson-compatible XML], [pearson]) DOCS_DEFINE_TARGET(PLUCKER, HTML, [plucker versions], [plucker]) DOCS_DEFINE_TARGET(VERIFY, ALL, [verifying docbook output], [verify]) +DOCS_DEFINE_TARGET(FOPDF, ALL, [PDF versions thru FO], [fopdf]) DOCS_DEFINE_TARGET(UNDOCUMENTED, MANPAGES, [list of undocumented options], [undocumented]) DOCS_DEFINE_TARGET(TXT, HTML, [text versions], [txt])
svn commit: samba r5314 - in branches/SAMBA_3_0/source/nsswitch: .
Author: vlendec Date: 2005-02-10 13:36:18 + (Thu, 10 Feb 2005) New Revision: 5314 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=5314 Log: Some const, and an uninitialized variable fix. Volker Modified: branches/SAMBA_3_0/source/nsswitch/winbind_nss_linux.c Changeset: Modified: branches/SAMBA_3_0/source/nsswitch/winbind_nss_linux.c === --- branches/SAMBA_3_0/source/nsswitch/winbind_nss_linux.c 2005-02-10 08:15:30 UTC (rev 5313) +++ branches/SAMBA_3_0/source/nsswitch/winbind_nss_linux.c 2005-02-10 13:36:18 UTC (rev 5314) @@ -62,7 +62,7 @@ lib/util_str.c as I really don't want to have to link in any other objects if I can possibly avoid it. */ -BOOL next_token(char **ptr,char *buff,char *sep, size_t bufsize) +BOOL next_token(char **ptr,char *buff,const char *sep, size_t bufsize) { char *s; BOOL quoted; @@ -976,11 +976,11 @@ fprintf(stderr, [%5d]: sidtoname %s\n, getpid(), sid); #endif + ZERO_STRUCT(response); + ZERO_STRUCT(request); + /* we need to fetch the separator first time through */ if (!sep_char) { - ZERO_STRUCT(response); - ZERO_STRUCT(request); - ret = winbindd_request(WINBINDD_INFO, request, response); if (ret != NSS_STATUS_SUCCESS) { *errnop = errno = EINVAL;
svn commit: samba r5315 - in trunk/source/nsswitch: .
Author: vlendec Date: 2005-02-10 13:36:33 + (Thu, 10 Feb 2005) New Revision: 5315 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=5315 Log: Some const, and an uninitialized variable fix. Volker Modified: trunk/source/nsswitch/winbind_nss_linux.c Changeset: Modified: trunk/source/nsswitch/winbind_nss_linux.c === --- trunk/source/nsswitch/winbind_nss_linux.c 2005-02-10 13:36:18 UTC (rev 5314) +++ trunk/source/nsswitch/winbind_nss_linux.c 2005-02-10 13:36:33 UTC (rev 5315) @@ -62,7 +62,7 @@ lib/util_str.c as I really don't want to have to link in any other objects if I can possibly avoid it. */ -BOOL next_token(char **ptr,char *buff,char *sep, size_t bufsize) +BOOL next_token(char **ptr,char *buff,const char *sep, size_t bufsize) { char *s; BOOL quoted; @@ -976,11 +976,11 @@ fprintf(stderr, [%5d]: sidtoname %s\n, getpid(), sid); #endif + ZERO_STRUCT(response); + ZERO_STRUCT(request); + /* we need to fetch the separator first time through */ if (!sep_char) { - ZERO_STRUCT(response); - ZERO_STRUCT(request); - ret = winbindd_request(WINBINDD_INFO, request, response); if (ret != NSS_STATUS_SUCCESS) { *errnop = errno = EINVAL;
svn commit: samba r5316 - in branches/SAMBA_3_0/source/utils: .
Author: vlendec Date: 2005-02-10 17:38:49 + (Thu, 10 Feb 2005) New Revision: 5316 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=5316 Log: Get 'net afskey' into a subcommand of its own, 'net afs key'. Implement 'net afs impersonate', generate a token for a specified user. You obviously need to be root for this operation. Volker Modified: branches/SAMBA_3_0/source/utils/net.c branches/SAMBA_3_0/source/utils/net_help.c Changeset: Modified: branches/SAMBA_3_0/source/utils/net.c === --- branches/SAMBA_3_0/source/utils/net.c 2005-02-10 13:36:33 UTC (rev 5315) +++ branches/SAMBA_3_0/source/utils/net.c 2005-02-10 17:38:49 UTC (rev 5316) @@ -552,14 +552,16 @@ #ifdef WITH_FAKE_KASERVER -int net_afskey_usage(int argc, const char **argv) +int net_help_afs(int argc, const char **argv) { - d_printf( net afskey filename\n + d_printf( net afs key filename\n \tImports a OpenAFS KeyFile into our secrets.tdb\n\n); + d_printf( net afs impersonate user cell\n +\tCreates a token for [EMAIL PROTECTED]); return -1; } -static int net_afskey(int argc, const char **argv) +static int net_afs_key(int argc, const char **argv) { int fd; struct afs_keyfile keyfile; @@ -592,6 +594,42 @@ return 0; } +static int net_afs_impersonate(int argc, const char **argv) +{ + char *token; + + if (argc != 2) { + fprintf(stderr, Usage: net afs impersonate user cell\n); + exit(1); + } + + token = afs_createtoken_str(argv[0], argv[1]); + + if (token == NULL) { + fprintf(stderr, Could not create token\n); + exit(1); + } + + if (!afs_settoken_str(token)) { + fprintf(stderr, Could not set token into kernel\n); + exit(1); + } + + printf(Success: [EMAIL PROTECTED], argv[0], argv[1]); + return 0; +} + +static int net_afs(int argc, const char **argv) +{ + struct functable func[] = { + {key, net_afs_key}, + {impersonate, net_afs_impersonate}, + {help, net_help_afs}, + {NULL, NULL} + }; + return net_run_function(argc, argv, func, net_help_afs); +} + #endif /* WITH_FAKE_KASERVER */ static uint32 get_maxrid(void) @@ -707,7 +745,7 @@ {STATUS, net_status}, {USERSIDLIST, net_usersidlist}, #ifdef WITH_FAKE_KASERVER - {AFSKEY, net_afskey}, + {AFS, net_afs}, #endif {HELP, net_help}, Modified: branches/SAMBA_3_0/source/utils/net_help.c === --- branches/SAMBA_3_0/source/utils/net_help.c 2005-02-10 13:36:33 UTC (rev 5315) +++ branches/SAMBA_3_0/source/utils/net_help.c 2005-02-10 17:38:49 UTC (rev 5316) @@ -269,7 +269,7 @@ {LOOKUP, net_lookup_usage}, {USERSIDLIST, net_usersidlist_usage}, #ifdef WITH_FAKE_KASERVER - {AFSKEY, net_afskey_usage}, + {AFS, net_help_afs}, #endif {HELP, help_usage},
svn commit: samba r5317 - in trunk/source/utils: .
Author: vlendec Date: 2005-02-10 17:40:02 + (Thu, 10 Feb 2005) New Revision: 5317 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=5317 Log: Get 'net afskey' into a subcommand of its own, 'net afs key'. Implement 'net afs impersonate', generate a token for a specified user. You obviously need to be root for this operation. Volker Modified: trunk/source/utils/net.c trunk/source/utils/net_help.c Changeset: Modified: trunk/source/utils/net.c === --- trunk/source/utils/net.c2005-02-10 17:38:49 UTC (rev 5316) +++ trunk/source/utils/net.c2005-02-10 17:40:02 UTC (rev 5317) @@ -552,14 +552,16 @@ #ifdef WITH_FAKE_KASERVER -int net_afskey_usage(int argc, const char **argv) +int net_help_afs(int argc, const char **argv) { - d_printf( net afskey filename\n + d_printf( net afs key filename\n \tImports a OpenAFS KeyFile into our secrets.tdb\n\n); + d_printf( net afs impersonate user cell\n +\tCreates a token for [EMAIL PROTECTED]); return -1; } -static int net_afskey(int argc, const char **argv) +static int net_afs_key(int argc, const char **argv) { int fd; struct afs_keyfile keyfile; @@ -592,6 +594,42 @@ return 0; } +static int net_afs_impersonate(int argc, const char **argv) +{ + char *token; + + if (argc != 2) { + fprintf(stderr, Usage: net afs impersonate user cell\n); + exit(1); + } + + token = afs_createtoken_str(argv[0], argv[1]); + + if (token == NULL) { + fprintf(stderr, Could not create token\n); + exit(1); + } + + if (!afs_settoken_str(token)) { + fprintf(stderr, Could not set token into kernel\n); + exit(1); + } + + printf(Success: [EMAIL PROTECTED], argv[0], argv[1]); + return 0; +} + +static int net_afs(int argc, const char **argv) +{ + struct functable func[] = { + {key, net_afs_key}, + {impersonate, net_afs_impersonate}, + {help, net_help_afs}, + {NULL, NULL} + }; + return net_run_function(argc, argv, func, net_help_afs); +} + #endif /* WITH_FAKE_KASERVER */ static uint32 get_maxrid(void) @@ -707,7 +745,7 @@ {STATUS, net_status}, {USERSIDLIST, net_usersidlist}, #ifdef WITH_FAKE_KASERVER - {AFSKEY, net_afskey}, + {AFS, net_afs}, #endif {HELP, net_help}, Modified: trunk/source/utils/net_help.c === --- trunk/source/utils/net_help.c 2005-02-10 17:38:49 UTC (rev 5316) +++ trunk/source/utils/net_help.c 2005-02-10 17:40:02 UTC (rev 5317) @@ -269,7 +269,7 @@ {LOOKUP, net_lookup_usage}, {USERSIDLIST, net_usersidlist_usage}, #ifdef WITH_FAKE_KASERVER - {AFSKEY, net_afskey_usage}, + {AFS, net_help_afs}, #endif {HELP, help_usage},
svn commit: samba r5318 - in branches/SAMBA_3_0/source/utils: .
Author: sharpe Date: 2005-02-10 18:27:23 + (Thu, 10 Feb 2005) New Revision: 5318 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=5318 Log: Fix a small problem in where we ignore the response from a SamrGetGroupsForUser that says the user is in 0 groups, and we issue an RPC to LookupIds for 0 RIDs. The printing that there are no groups the user is a member of might be overkill in that it might upset existing scripts that don't expect that output. Modified: branches/SAMBA_3_0/source/utils/net_rpc.c branches/SAMBA_3_0/source/utils/profiles.c Changeset: Modified: branches/SAMBA_3_0/source/utils/net_rpc.c === --- branches/SAMBA_3_0/source/utils/net_rpc.c 2005-02-10 17:40:02 UTC (rev 5317) +++ branches/SAMBA_3_0/source/utils/net_rpc.c 2005-02-10 18:27:23 UTC (rev 5318) @@ -1005,26 +1005,32 @@ result = cli_samr_query_usergroups(cli, mem_ctx, user_pol, num_rids, user_gids); + if (!NT_STATUS_IS_OK(result)) goto done; + /* Look up rids */ - rids = TALLOC_ARRAY(mem_ctx, uint32, num_rids); + if (rids) { + rids = TALLOC_ARRAY(mem_ctx, uint32, num_rids); - for (i = 0; i num_rids; i++) -rids[i] = user_gids[i].g_rid; + for (i = 0; i num_rids; i++) + rids[i] = user_gids[i].g_rid; - result = cli_samr_lookup_rids(cli, mem_ctx, domain_pol, - flags, num_rids, rids, - num_names, names, name_types); + result = cli_samr_lookup_rids(cli, mem_ctx, domain_pol, + flags, num_rids, rids, + num_names, names, name_types); - if (!NT_STATUS_IS_OK(result)) { - goto done; - } + if (!NT_STATUS_IS_OK(result)) { + goto done; + } - /* Display results */ + /* Display results */ - for (i = 0; i num_names; i++) - printf(%s\n, names[i]); - + for (i = 0; i num_names; i++) + printf(%s\n, names[i]); + } + else { + printf(no groups\n); + } done: return result; } Modified: branches/SAMBA_3_0/source/utils/profiles.c === --- branches/SAMBA_3_0/source/utils/profiles.c 2005-02-10 17:40:02 UTC (rev 5317) +++ branches/SAMBA_3_0/source/utils/profiles.c 2005-02-10 18:27:23 UTC (rev 5318) @@ -521,7 +521,7 @@ int main(int argc, char *argv[]) { int opt; - int fd, start = 0; + int fd; char *base; struct stat sbuf; REGF_HDR *regf_hdr; @@ -608,10 +608,9 @@ * Now, mmap the file into memory, check the header and start * dealing with the records. We are interested in the sk record */ - start = 0; #ifdef HAVE_MMAP - base = mmap(start, sbuf.st_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + base = mmap(NULL, sbuf.st_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); #else base = (char *)-1; errno = ENOSYS;
svn commit: samba-docs r357 - in trunk: .
Author: jelmer Date: 2005-02-10 18:50:51 + (Thu, 10 Feb 2005) New Revision: 357 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=samba-docsrev=357 Log: Couple of minor fixes Modified: trunk/Makefile Changeset: Modified: trunk/Makefile === --- trunk/Makefile 2005-02-10 08:51:11 UTC (rev 356) +++ trunk/Makefile 2005-02-10 18:50:51 UTC (rev 357) @@ -45,7 +45,7 @@ # Pseudo targets all: $(TARGETS) -everything: manpages pdf html-single html htmlman txt ps fo htmlhelp pearson verify +everything: manpages pdf html-single html htmlman txt ps fo htmlhelp pearson validate release: manpages htmlman html pdf # Output format targets @@ -181,7 +181,7 @@ # PDF thru Fo $(FOPDFDIR)/%.pdf: $(FODIR)/%.fo mkdir -p $(@D) - $(FOP) $ $@ + $(FOP) -q -d $ -pdf $@ $(HTMLHELPDIR)/%: $(DOCBOOKDIR)/%.xml -mkdir -p $@/images @@ -232,7 +232,7 @@ mkdir -p $(@D) $(XMLLINT) --valid --noout --htmlout $ 2 $@ -verify: $(VALIDATEDIR)/Samba-HOWTO-Collection.report.html $(VALIDATEDIR)/Samba-Developers-Guide.report.html $(VALIDATEDIR)/Samba-Guide.report.html +validate: $(VALIDATEDIR)/Samba-HOWTO-Collection.report.html $(VALIDATEDIR)/Samba-Developers-Guide.report.html $(VALIDATEDIR)/Samba-Guide.report.html # Find undocumented parameters
svn commit: samba-web r549 - in trunk/DTD: .
Author: jelmer Date: 2005-02-10 19:55:14 + (Thu, 10 Feb 2005) New Revision: 549 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=samba-webrev=549 Log: Update Samba-doc DTD Modified: trunk/DTD/samba-doc Changeset: Modified: trunk/DTD/samba-doc === --- trunk/DTD/samba-doc 2005-02-08 21:45:35 UTC (rev 548) +++ trunk/DTD/samba-doc 2005-02-10 19:55:14 UTC (rev 549) @@ -1,6 +1,14 @@ -!ELEMENT smbconfexample (description,smbconfoption*,smbconfsection*,smbconfblock*) -!ELEMENT smbconfblock (description,smbconfoption*,smbconfsection*,smbconfblock*) +!-- .. -- +!-- DocBook XML DTD V4.3 . -- +!-- File docbookx.dtd -- + +!ELEMENT smbconfexample (description,smbconfoption*|smbconfsection*|smbconfblock*|smbconfcomment*) +!ELEMENT smbconfblock (description,smbconfoption*|smbconfsection*|smbconfblock*|smbconfcomment*) !ATTLIST smbconfexample id ID #REQUIRED !ATTLIST smbconfblock id ID #REQUIRED +!ELEMENT smbconfcomment (#PCDATA) +!ELEMENT smbconfsection (#PCDATA) +!ELEMENT smbconfoption (#PCDATA) +!ATTLIST ulink noescape CDATA #IMPLIED 0
svn commit: samba-docs r358 - in trunk: . Samba-Developers-Guide Samba-HOWTO-Collection xslt
Author: jelmer Date: 2005-02-10 20:27:44 + (Thu, 10 Feb 2005) New Revision: 358 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=samba-docsrev=358 Log: Fix some warnings Modified: trunk/Makefile trunk/Samba-Developers-Guide/index.xml trunk/Samba-HOWTO-Collection/index.xml trunk/xslt/extract-examples.xsl trunk/xslt/generate-attributions.xsl Changeset: Modified: trunk/Makefile === --- trunk/Makefile 2005-02-10 18:50:51 UTC (rev 357) +++ trunk/Makefile 2005-02-10 20:27:44 UTC (rev 358) @@ -105,8 +105,7 @@ $(XSLTPROC) --output $@ xslt/html.xsl $ %-attributions.xml: - echo para/ $@ - $(XSLTPROC) --xinclude xslt/generate-attributions.xsl $*/index.xml $@ + $(XSLTPROC) --xinclude -o $@ xslt/generate-attributions.xsl $*/index.xml clobber: clean rm Makefile.settings settings.xsl config.status config.log configure @@ -228,9 +227,9 @@ # Validation verification -$(VALIDATEDIR)/%.report.html: $(DOCBOOKDIR)/%.xml +$(VALIDATEDIR)/%.report.html: %/index.xml mkdir -p $(@D) - $(XMLLINT) --valid --noout --htmlout $ 2 $@ + $(XMLLINT) --xinclude --postvalid --noout --htmlout $ 2 $@ validate: $(VALIDATEDIR)/Samba-HOWTO-Collection.report.html $(VALIDATEDIR)/Samba-Developers-Guide.report.html $(VALIDATEDIR)/Samba-Guide.report.html Modified: trunk/Samba-Developers-Guide/index.xml === --- trunk/Samba-Developers-Guide/index.xml 2005-02-10 18:50:51 UTC (rev 357) +++ trunk/Samba-Developers-Guide/index.xml 2005-02-10 20:27:44 UTC (rev 358) @@ -39,8 +39,11 @@ /abstract /bookinfo -xi:include href=../Samba-Developers-Guide-attributions.xml/ +xi:include href=../Samba-Developers-Guide-attributions.xml + xi:fallback/ +/xi:include + !-- Contents -- toc/ Modified: trunk/Samba-HOWTO-Collection/index.xml === --- trunk/Samba-HOWTO-Collection/index.xml 2005-02-10 18:50:51 UTC (rev 357) +++ trunk/Samba-HOWTO-Collection/index.xml 2005-02-10 20:27:44 UTC (rev 358) @@ -19,7 +19,9 @@ ?latex \setcounter{page}{5} ? -xi:include href=../Samba-HOWTO-Collection-attributions.xml/ +xi:include href=../Samba-HOWTO-Collection-attributions.xml + xi:fallback/ +/xi:include ?latex \cleardoublepage ? Modified: trunk/xslt/extract-examples.xsl === --- trunk/xslt/extract-examples.xsl 2005-02-10 18:50:51 UTC (rev 357) +++ trunk/xslt/extract-examples.xsl 2005-02-10 20:27:44 UTC (rev 358) @@ -1,6 +1,6 @@ ?xml version='1.0'? !-- - Extract examples out of XML file +Extract examples out of DocBook/XML file (C) Jelmer Vernooij 2003 -- xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; Modified: trunk/xslt/generate-attributions.xsl === --- trunk/xslt/generate-attributions.xsl2005-02-10 18:50:51 UTC (rev 357) +++ trunk/xslt/generate-attributions.xsl2005-02-10 20:27:44 UTC (rev 358) @@ -4,6 +4,7 @@ (C) Jelmer Vernooij 2003 -- xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; + xmlns:samba=http://www.samba.org/samba/DTD/samba-doc; version=1.1 xsl:output method=xml omit-xml-declaration=yes indent=yes/ @@ -56,7 +57,7 @@ xsl:when test=affiliation/address/email != '' xsl:text lt;/xsl:text xsl:element name=ulink - xsl:attribute name=noescape + xsl:attribute name=samba:noescape xsl:text1/xsl:text /xsl:attribute xsl:attribute name=url
svn commit: samba-web r550 - in trunk/DTD: .
Author: jelmer Date: 2005-02-10 20:44:11 + (Thu, 10 Feb 2005) New Revision: 550 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=samba-webrev=550 Log: Add some more elements to the DTD Modified: trunk/DTD/samba-doc Changeset: Modified: trunk/DTD/samba-doc === --- trunk/DTD/samba-doc 2005-02-10 19:55:14 UTC (rev 549) +++ trunk/DTD/samba-doc 2005-02-10 20:44:11 UTC (rev 550) @@ -2,13 +2,34 @@ !-- DocBook XML DTD V4.3 . -- !-- File docbookx.dtd -- -!ELEMENT smbconfexample (description,smbconfoption*|smbconfsection*|smbconfblock*|smbconfcomment*) -!ELEMENT smbconfblock (description,smbconfoption*|smbconfsection*|smbconfblock*|smbconfcomment*) +!ELEMENT smbconfexample (description,(smbconfoption|smbconfsection|smbconfblock|smbconfcomment)*) +!ELEMENT smbconfblock (description,(smbconfoption|smbconfsection|smbconfblock|smbconfcomment)*) !ATTLIST smbconfexample - id ID #REQUIRED + id ID #IMPLIED !ATTLIST smbconfblock - id ID #REQUIRED + id ID #IMPLIED !ELEMENT smbconfcomment (#PCDATA) !ELEMENT smbconfsection (#PCDATA) !ELEMENT smbconfoption (#PCDATA) -!ATTLIST ulink noescape CDATA #IMPLIED 0 +!ELEMENT ntgroup (#PCDATA) +!ELEMENT ntuser (#PCDATA) +!ELEMENT image (imagedescription?,imagefile) +!ATTLIST image id ID #IMPLIED +!ELEMENT imagedescription (#PCDATA) +!ELEMENT imagefile (#PCDATA) +!ATTLIST imagefile scale CDATA #IMPLIED +!ELEMENT parameterlist (parameter) +!ELEMENT parameter (description,related*,value*) +!ATTLIST parameter + name CDATA #REQUIRED + type CDATA #REQUIRED + context CDATA #REQUIRED + +!ELEMENT description ANY +!ELEMENT related (#PCDATA) +!ELEMENT value (#PCDATA|comment)* +!ATTLIST value + type CDATA #REQUIRED +!ELEMENT comment (#PCDATA) +!ATTLIST ulink + noescape CDATA #IMPLIED
Build status as of Fri Feb 11 00:00:02 2005
URL: http://build.samba.org/ --- /home/build/master/cache/broken_results.txt.old 2005-02-10 00:00:04.0 + +++ /home/build/master/cache/broken_results.txt 2005-02-11 00:00:22.0 + @@ -1,15 +1,15 @@ -Build status as of Thu Feb 10 00:00:02 2005 +Build status as of Fri Feb 11 00:00:02 2005 Build counts: Tree Total Broken Panic -ccache 38 6 0 -distcc 38 3 0 -ppp 22 5 0 -rsync37 4 0 +ccache 37 6 0 +distcc 37 3 0 +ppp 21 5 0 +rsync36 4 0 samba1 1 1 samba-docs 0 0 0 -samba4 40 11 0 -samba_3_038 11 1 +samba4 38 10 0 +samba_3_036 10 1 Currently broken builds: Host Tree Compiler Status @@ -17,8 +17,6 @@ cyberone samba4 gccok/ 2/?/? cyberone samba_3_0gcc 1/?/?/? fusberta samba4 gccok/ 2/?/? -rhonwynsamba4 gcc-4.0ok/ 2/?/? -rhonwynsamba_3_0gcc-4.0ok/ 2/?/? quango ccache gcc 137/?/?/? quango distcc gcc 137/?/?/? quango ppp gccok/ 2/?/? @@ -30,6 +28,7 @@ us4samba_3_0cc ok/ 1/?/? us4samba_3_0gccok/ 1/?/? flock samba4 gccok/ 1/?/? +flock samba_3_0gcc 127/?/?/? opisol10 ccache gccok/ok/ok/ 1 opisol10 ppp gccok/ 1/?/? opisol10 samba4 gccok/ 1/?/? @@ -41,7 +40,6 @@ sol10 samba4 gccok/ 1/?/? sun1 samba4 cc ok/ 2/?/? sun1 samba_3_0cc ok/ 2/?/? -sun1 samba_3_0gccok/ok/ok/ 1 Isis ccache cc 77/?/?/? Isis distcc cc 77/?/?/? Isis rsynccc 77/?/?/?
svn commit: samba r5320 - in branches/SAMBA_4_0/source/build/pidl: .
Author: jelmer Date: 2005-02-11 02:05:47 + (Fri, 11 Feb 2005) New Revision: 5320 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=5320 Log: Treat structs and unions somewhat more similarly: - use same names in hashes (DATA - ELEMENTS, etc) - [case()] and [default] are no longer special case, they're just regular properties Modified: branches/SAMBA_4_0/source/build/pidl/dump.pm branches/SAMBA_4_0/source/build/pidl/header.pm branches/SAMBA_4_0/source/build/pidl/idl.pm branches/SAMBA_4_0/source/build/pidl/idl.yp branches/SAMBA_4_0/source/build/pidl/ndr.pm branches/SAMBA_4_0/source/build/pidl/needed.pm branches/SAMBA_4_0/source/build/pidl/util.pm branches/SAMBA_4_0/source/build/pidl/validator.pm Changeset: Sorry, the patch is too large (1397 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=5320
svn commit: samba r5321 - in branches/SAMBA_4_0/source/script: .
Author: tridge Date: 2005-02-11 02:07:41 + (Fri, 11 Feb 2005) New Revision: 5321 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=5321 Log: added a program that works out the minimal set of #include lines needed for a C file in Samba. It tries compiling without each #include line in turn, and looks for any changes in the compiler output. Note that the output is not guaranteed correct, it might be that an include is needed onlyu on some platforms. To cope with this, it doesn't consider lines with the word needed on them. So add a comment like this: #include foo.h /* needed by systems without kerberos */ and it will know to skip it It also skips any include lines in a #if section. If you are brave, you can give it the option --remove and it will remove lines it thinks are not needed. Please review carefully before committing the results, and watch the build farm for breakage. Added: branches/SAMBA_4_0/source/script/minimal_includes.pl Changeset: Added: branches/SAMBA_4_0/source/script/minimal_includes.pl === --- branches/SAMBA_4_0/source/script/minimal_includes.pl2005-02-11 02:05:47 UTC (rev 5320) +++ branches/SAMBA_4_0/source/script/minimal_includes.pl2005-02-11 02:07:41 UTC (rev 5321) @@ -0,0 +1,150 @@ +#!/usr/bin/perl -w +# find a list of #include lines in C code that might not be needed +# usually called with something like this: +#minimal_includes.pl `find . -name *.c` +# Andrew Tridgell [EMAIL PROTECTED] + +use strict; +use Data::Dumper; +use Getopt::Long; + +my $opt_help = 0; +my $opt_remove = 0; + +# +# write a string into a file +sub FileSave($$) +{ +my($filename) = shift; +my($v) = shift; +local(*FILE); +open(FILE, $filename) || die can't open $filename; +print FILE $v; +close(FILE); +} + +sub load_lines($) +{ + my $fname = shift; + my @lines = split(/^/m, `cat $fname`); + return @lines; +} + +sub save_lines($$) +{ + my $fname = shift; + my $lines = shift; + my $data = join('', @{$lines}); + FileSave($fname, $data); +} + +sub test_compile($) +{ + my $fname = shift; + my $obj; + if ($fname =~ s/(.*)\.c$/$1.o/) { + $obj = $1.o; + } else { + return NOT A C FILE; + } + unlink($obj); + my $ret = `make $obj 21`; + if (!unlink($obj)) { + return COMPILE FAILED; + } + return $ret; +} + +sub test_include() +{ + my $fname = shift; + my $lines = shift; + my $i = shift; + my $original = shift; + my $line = $lines-[$i]; + + $lines-[$i] = ; + save_lines(_testcompile.c, $lines); + + my $out = test_compile(_testcompile.c); + $out =~ s/_testcompile.c/$fname/g; + + if ($out eq $original) { + if ($opt_remove) { + print $fname: removing $line\n; + save_lines($fname, $lines); + return; + } + print $fname: might be able to remove $line\n; + } + + $lines-[$i] = $line; + unlink(_testcompile.c); +} + +sub process_file($) +{ + my $fname = shift; + my @lines = load_lines($fname); + my $num_lines = $#lines; + + my $original = test_compile($fname); + + if ($original eq COMPILE FAILED) { + print Failed to compile $fname\n; + return; + } + + print Processing $fname (with $num_lines lines)\n; + + my $if_level = 0; + + for (my $i=0;$i=$num_lines;$i++) { + my $line = $lines[$i]; + if ($line =~ /^\#\s*if/) { + $if_level++; + } + if ($line =~ /^\#\s*endif/) { + $if_level--; + } + if ($if_level == 0 + $line =~ /^\#\s*include/ + !($line =~ /needed/)) { + test_include($fname, [EMAIL PROTECTED], $i, $original); + } + } +} + + +# +# display help text +sub ShowHelp() +{ +print + minimise includes + Copyright (C) [EMAIL PROTECTED] + + Usage: minimal_includes.pl [options] C files + + Options: + --help show help + --remove remove includes, don't just list them +; +} + + +# main program +GetOptions ( + 'h|help|?' = \$opt_help, + 'remove' = \$opt_remove, + ); + +if ($opt_help) { + ShowHelp(); + exit(0); +} + +for (my $i=0;$i=$#ARGV;$i++) { + my $fname = $ARGV[$i]; + process_file($fname); +} Property changes on: branches/SAMBA_4_0/source/script/minimal_includes.pl
svn commit: samba r5322 - in branches/SAMBA_4_0/source/libcli: . auth composite ldap nbt raw
Author: tridge Date: 2005-02-11 02:08:39 + (Fri, 11 Feb 2005) New Revision: 5322 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=5322 Log: removed a whole bunch of #include lines that minimal_includes.pl thinks are not needed. Now to see how this fares on the build farm :) Modified: branches/SAMBA_4_0/source/libcli/auth/clikrb5.c branches/SAMBA_4_0/source/libcli/auth/credentials.c branches/SAMBA_4_0/source/libcli/auth/gensec_gssapi.c branches/SAMBA_4_0/source/libcli/auth/gensec_krb5.c branches/SAMBA_4_0/source/libcli/auth/gssapi_parse.c branches/SAMBA_4_0/source/libcli/auth/kerberos.c branches/SAMBA_4_0/source/libcli/cliconnect.c branches/SAMBA_4_0/source/libcli/composite/fetchfile.c branches/SAMBA_4_0/source/libcli/ldap/ldap.c branches/SAMBA_4_0/source/libcli/nbt/namequery.c branches/SAMBA_4_0/source/libcli/nbt/namerefresh.c branches/SAMBA_4_0/source/libcli/nbt/nameregister.c branches/SAMBA_4_0/source/libcli/raw/clisession.c branches/SAMBA_4_0/source/libcli/raw/clitransport.c branches/SAMBA_4_0/source/libcli/raw/rawacl.c branches/SAMBA_4_0/source/libcli/raw/raweas.c Changeset: Modified: branches/SAMBA_4_0/source/libcli/auth/clikrb5.c === --- branches/SAMBA_4_0/source/libcli/auth/clikrb5.c 2005-02-11 02:07:41 UTC (rev 5321) +++ branches/SAMBA_4_0/source/libcli/auth/clikrb5.c 2005-02-11 02:08:39 UTC (rev 5322) @@ -23,7 +23,6 @@ #include system/network.h #include system/kerberos.h #include libcli/auth/kerberos.h -#include system/time.h #ifdef HAVE_KRB5 Modified: branches/SAMBA_4_0/source/libcli/auth/credentials.c === --- branches/SAMBA_4_0/source/libcli/auth/credentials.c 2005-02-11 02:07:41 UTC (rev 5321) +++ branches/SAMBA_4_0/source/libcli/auth/credentials.c 2005-02-11 02:08:39 UTC (rev 5322) @@ -25,7 +25,6 @@ #include system/time.h #include auth/auth.h #include lib/crypto/crypto.h -#include librpc/gen_ndr/ndr_netlogon.h /* initialise the credentials state for old-style 64 bit session keys Modified: branches/SAMBA_4_0/source/libcli/auth/gensec_gssapi.c === --- branches/SAMBA_4_0/source/libcli/auth/gensec_gssapi.c 2005-02-11 02:07:41 UTC (rev 5321) +++ branches/SAMBA_4_0/source/libcli/auth/gensec_gssapi.c 2005-02-11 02:08:39 UTC (rev 5322) @@ -23,8 +23,6 @@ #include includes.h #include system/kerberos.h -#include system/time.h -#include libcli/auth/kerberos.h #include auth/auth.h #undef DBGC_CLASS Modified: branches/SAMBA_4_0/source/libcli/auth/gensec_krb5.c === --- branches/SAMBA_4_0/source/libcli/auth/gensec_krb5.c 2005-02-11 02:07:41 UTC (rev 5321) +++ branches/SAMBA_4_0/source/libcli/auth/gensec_krb5.c 2005-02-11 02:08:39 UTC (rev 5322) @@ -26,7 +26,6 @@ #include includes.h #include system/kerberos.h -#include system/time.h #include libcli/auth/kerberos.h #include librpc/gen_ndr/ndr_krb5pac.h #include auth/auth.h Modified: branches/SAMBA_4_0/source/libcli/auth/gssapi_parse.c === --- branches/SAMBA_4_0/source/libcli/auth/gssapi_parse.c2005-02-11 02:07:41 UTC (rev 5321) +++ branches/SAMBA_4_0/source/libcli/auth/gssapi_parse.c2005-02-11 02:08:39 UTC (rev 5322) @@ -25,7 +25,6 @@ #include includes.h #include asn_1.h #include system/kerberos.h -#include libcli/auth/kerberos.h #include libcli/auth/gensec.h /* Modified: branches/SAMBA_4_0/source/libcli/auth/kerberos.c === --- branches/SAMBA_4_0/source/libcli/auth/kerberos.c2005-02-11 02:07:41 UTC (rev 5321) +++ branches/SAMBA_4_0/source/libcli/auth/kerberos.c2005-02-11 02:08:39 UTC (rev 5322) @@ -24,7 +24,6 @@ #include includes.h #include system/kerberos.h #include libcli/auth/kerberos.h -#include system/time.h #include secrets.h #include pstring.h #include ads.h Modified: branches/SAMBA_4_0/source/libcli/cliconnect.c === --- branches/SAMBA_4_0/source/libcli/cliconnect.c 2005-02-11 02:07:41 UTC (rev 5321) +++ branches/SAMBA_4_0/source/libcli/cliconnect.c 2005-02-11 02:08:39 UTC (rev 5322) @@ -21,7 +21,6 @@ */ #include includes.h -#include system/filesys.h #include libcli/raw/libcliraw.h #include libcli/composite/composite.h Modified: branches/SAMBA_4_0/source/libcli/composite/fetchfile.c === --- branches/SAMBA_4_0/source/libcli/composite/fetchfile.c 2005-02-11 02:07:41 UTC (rev 5321) +++ branches/SAMBA_4_0/source/libcli/composite/fetchfile.c 2005-02-11 02:08:39 UTC (rev 5322) @@ -24,7 +24,6 @@ #include includes.h #include
svn commit: samba r5323 - in trunk/source/smbd: .
Author: jra Date: 2005-02-11 02:14:39 + (Fri, 11 Feb 2005) New Revision: 5323 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=5323 Log: In order to process DELETE_ACCESS correctly and return access denied to a WXPSP2 client we must do permission checking in userspace first (this is a race condition but what can you do...). Needed for bugid #2227. Jeremy. Modified: trunk/source/smbd/nttrans.c trunk/source/smbd/posix_acls.c trunk/source/smbd/reply.c Changeset: Modified: trunk/source/smbd/nttrans.c === --- trunk/source/smbd/nttrans.c 2005-02-11 02:08:39 UTC (rev 5322) +++ trunk/source/smbd/nttrans.c 2005-02-11 02:14:39 UTC (rev 5323) @@ -782,6 +782,15 @@ } } + if (desired_access DELETE_ACCESS) { + status = can_delete(conn, fname, file_attributes, bad_path, True); + if (!NT_STATUS_IS_OK(status) !NT_STATUS_EQUAL(status,NT_STATUS_FILE_IS_A_DIRECTORY)) { + restore_case_semantics(conn, file_attributes); + END_PROFILE(SMBntcreateX); + return ERROR_NT(status); + } + } + /* * If it's a request for a directory open, deal with it separately. */ @@ -1321,6 +1330,15 @@ return set_bad_path_error(errno, bad_path, outbuf, ERRDOS,ERRbadpath); } + if (desired_access DELETE_ACCESS) { + status = can_delete(conn, fname, file_attributes, bad_path, True); + if (!NT_STATUS_IS_OK(status) !NT_STATUS_EQUAL(status,NT_STATUS_FILE_IS_A_DIRECTORY)) { + restore_case_semantics(conn, file_attributes); + END_PROFILE(SMBntcreateX); + return ERROR_NT(status); + } + } + /* * If it's a request for a directory open, deal with it separately. */ Modified: trunk/source/smbd/posix_acls.c === --- trunk/source/smbd/posix_acls.c 2005-02-11 02:08:39 UTC (rev 5322) +++ trunk/source/smbd/posix_acls.c 2005-02-11 02:14:39 UTC (rev 5323) @@ -3753,3 +3753,14 @@ SMB_VFS_SYS_ACL_FREE_ACL(conn, file_acl); return True; } + +/ + Actually emulate the in-kernel access checking for write access. We need + this to successfully return ACCESS_DENIED on a file open for delete access. +/ + +BOOL can_delete_file_in_directory(connection_struct *conn, const char *fname) +{ + /* Add acl check here... JRA */ + return True; +} Modified: trunk/source/smbd/reply.c === --- trunk/source/smbd/reply.c 2005-02-11 02:08:39 UTC (rev 5322) +++ trunk/source/smbd/reply.c 2005-02-11 02:14:39 UTC (rev 5323) @@ -1438,7 +1438,7 @@ Check if a user is allowed to rename a file. / -static NTSTATUS can_rename(char *fname,connection_struct *conn, uint16 dirtype, SMB_STRUCT_STAT *pst) +static NTSTATUS can_rename(connection_struct *conn, char *fname, uint16 dirtype, SMB_STRUCT_STAT *pst) { int smb_action; int access_mode; @@ -1479,7 +1479,7 @@ Check if a user is allowed to delete a file. / -static NTSTATUS can_delete(char *fname,connection_struct *conn, int dirtype, BOOL bad_path) +NTSTATUS can_delete(connection_struct *conn, char *fname, int dirtype, BOOL bad_path, BOOL check_is_at_open) { SMB_STRUCT_STAT sbuf; int fmode; @@ -1520,6 +1520,10 @@ if ((fmode ~dirtype) (aHIDDEN | aSYSTEM)) return NT_STATUS_NO_SUCH_FILE; + if (check_is_at_open !can_delete_file_in_directory(conn, fname)) { + return NT_STATUS_ACCESS_DENIED; + } + /* We need a better way to return NT status codes from open... */ unix_ERR_class = 0; unix_ERR_code = 0; @@ -1598,7 +1602,7 @@ if (!has_wild) { pstrcat(directory,/); pstrcat(directory,mask); - error = can_delete(directory,conn,dirtype,bad_path); + error = can_delete(conn,directory,dirtype,bad_path,False); if (!NT_STATUS_IS_OK(error)) return error; @@ -1656,7 +1660,7 @@ } slprintf(fname,sizeof(fname)-1, %s/%s,directory,dname); - error = can_delete(fname,conn,dirtype,bad_path); + error = can_delete(conn,fname,dirtype,bad_path,False); if (!NT_STATUS_IS_OK(error)) {
svn commit: samba r5324 - in branches/SAMBA_3_0/source/smbd: .
Author: jra Date: 2005-02-11 02:14:49 + (Fri, 11 Feb 2005) New Revision: 5324 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=5324 Log: In order to process DELETE_ACCESS correctly and return access denied to a WXPSP2 client we must do permission checking in userspace first (this is a race condition but what can you do...). Needed for bugid #2227. Jeremy. Modified: branches/SAMBA_3_0/source/smbd/nttrans.c branches/SAMBA_3_0/source/smbd/posix_acls.c branches/SAMBA_3_0/source/smbd/reply.c Changeset: Modified: branches/SAMBA_3_0/source/smbd/nttrans.c === --- branches/SAMBA_3_0/source/smbd/nttrans.c2005-02-11 02:14:39 UTC (rev 5323) +++ branches/SAMBA_3_0/source/smbd/nttrans.c2005-02-11 02:14:49 UTC (rev 5324) @@ -780,6 +780,15 @@ } } + if (desired_access DELETE_ACCESS) { + status = can_delete(conn, fname, file_attributes, bad_path, True); + if (!NT_STATUS_IS_OK(status) !NT_STATUS_EQUAL(status,NT_STATUS_FILE_IS_A_DIRECTORY)) { + restore_case_semantics(conn, file_attributes); + END_PROFILE(SMBntcreateX); + return ERROR_NT(status); + } + } + /* * If it's a request for a directory open, deal with it separately. */ @@ -1319,6 +1328,15 @@ return set_bad_path_error(errno, bad_path, outbuf, ERRDOS,ERRbadpath); } + if (desired_access DELETE_ACCESS) { + status = can_delete(conn, fname, file_attributes, bad_path, True); + if (!NT_STATUS_IS_OK(status) !NT_STATUS_EQUAL(status,NT_STATUS_FILE_IS_A_DIRECTORY)) { + restore_case_semantics(conn, file_attributes); + END_PROFILE(SMBntcreateX); + return ERROR_NT(status); + } + } + /* * If it's a request for a directory open, deal with it separately. */ Modified: branches/SAMBA_3_0/source/smbd/posix_acls.c === --- branches/SAMBA_3_0/source/smbd/posix_acls.c 2005-02-11 02:14:39 UTC (rev 5323) +++ branches/SAMBA_3_0/source/smbd/posix_acls.c 2005-02-11 02:14:49 UTC (rev 5324) @@ -3753,3 +3753,14 @@ SMB_VFS_SYS_ACL_FREE_ACL(conn, file_acl); return True; } + +/ + Actually emulate the in-kernel access checking for write access. We need + this to successfully return ACCESS_DENIED on a file open for delete access. +/ + +BOOL can_delete_file_in_directory(connection_struct *conn, const char *fname) +{ + /* Add acl check here... JRA */ + return True; +} Modified: branches/SAMBA_3_0/source/smbd/reply.c === --- branches/SAMBA_3_0/source/smbd/reply.c 2005-02-11 02:14:39 UTC (rev 5323) +++ branches/SAMBA_3_0/source/smbd/reply.c 2005-02-11 02:14:49 UTC (rev 5324) @@ -1438,7 +1438,7 @@ Check if a user is allowed to rename a file. / -static NTSTATUS can_rename(char *fname,connection_struct *conn, uint16 dirtype, SMB_STRUCT_STAT *pst) +static NTSTATUS can_rename(connection_struct *conn, char *fname, uint16 dirtype, SMB_STRUCT_STAT *pst) { int smb_action; int access_mode; @@ -1479,7 +1479,7 @@ Check if a user is allowed to delete a file. / -static NTSTATUS can_delete(char *fname,connection_struct *conn, int dirtype, BOOL bad_path) +NTSTATUS can_delete(connection_struct *conn, char *fname, int dirtype, BOOL bad_path, BOOL check_is_at_open) { SMB_STRUCT_STAT sbuf; int fmode; @@ -1520,6 +1520,10 @@ if ((fmode ~dirtype) (aHIDDEN | aSYSTEM)) return NT_STATUS_NO_SUCH_FILE; + if (check_is_at_open !can_delete_file_in_directory(conn, fname)) { + return NT_STATUS_ACCESS_DENIED; + } + /* We need a better way to return NT status codes from open... */ unix_ERR_class = 0; unix_ERR_code = 0; @@ -1598,7 +1602,7 @@ if (!has_wild) { pstrcat(directory,/); pstrcat(directory,mask); - error = can_delete(directory,conn,dirtype,bad_path); + error = can_delete(conn,directory,dirtype,bad_path,False); if (!NT_STATUS_IS_OK(error)) return error; @@ -1656,7 +1660,7 @@ } slprintf(fname,sizeof(fname)-1, %s/%s,directory,dname); - error = can_delete(fname,conn,dirtype,bad_path); +
svn commit: samba r5326 - in branches/SAMBA_4_0/source/libcli/nbt: .
Author: tridge Date: 2005-02-11 07:20:16 + (Fri, 11 Feb 2005) New Revision: 5326 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=5326 Log: removed the charset conversion from the nbtname code, so we no longer convert from/to DOS strings in NBT names. This will allow us to support all foreign names as a WINS server, as long as they don't contain a 0 byte. Modified: branches/SAMBA_4_0/source/libcli/nbt/nbtname.c Changeset: Modified: branches/SAMBA_4_0/source/libcli/nbt/nbtname.c === --- branches/SAMBA_4_0/source/libcli/nbt/nbtname.c 2005-02-11 06:58:07 UTC (rev 5325) +++ branches/SAMBA_4_0/source/libcli/nbt/nbtname.c 2005-02-11 07:20:16 UTC (rev 5326) @@ -160,8 +160,6 @@ uint32_t max_offset = offset; uint8_t *components[MAX_COMPONENTS]; int i; - ssize_t ret; - void *p; uint8_t *scope; if (!(ndr_flags NDR_SCALARS)) { @@ -192,12 +190,7 @@ status = decompress_name(components[0], r-type); NT_STATUS_NOT_OK_RETURN(status); - ret = convert_string_talloc(ndr, CH_DOS, CH_UNIX, components[0], - strlen(components[0])+1, p); - if (ret = 0) { - return NT_STATUS_BAD_NETWORK_NAME; - } - r-name = p; + r-name = components[0]; /* combine the remaining components into the scope */ scope = components[1]; @@ -206,16 +199,7 @@ NT_STATUS_HAVE_NO_MEMORY(scope); } - if (scope) { - ret = convert_string_talloc(ndr, CH_DOS, CH_UNIX, scope, - strlen(scope)+1, p); - if (ret = 0) { - return NT_STATUS_BAD_NETWORK_NAME; - } - r-scope = p; - } else { - r-scope = NULL; - } + r-scope = scope; return NT_STATUS_OK; } @@ -227,31 +211,18 @@ { uint_t num_components; uint8_t *components[MAX_COMPONENTS]; - void *ptr; char *dname, *dscope=NULL, *p; uint8_t *cname; - ssize_t ret; int i; if (!(ndr_flags NDR_SCALARS)) { return NT_STATUS_OK; } - /* convert to DOS format */ - ret = convert_string_talloc(ndr, CH_UNIX, CH_DOS, r-name, - strlen(r-name)+1, ptr); - if (ret = 0) { - return NT_STATUS_BAD_NETWORK_NAME; - } - dname = strupper_talloc(ndr, ptr); + dname = strupper_talloc(ndr, r-name); NT_STATUS_HAVE_NO_MEMORY(dname); if (r-scope) { - ret = convert_string_talloc(ndr, CH_UNIX, CH_DOS, r-scope, - strlen(r-scope)+1, ptr); - if (ret = 0) { - return NT_STATUS_BAD_NETWORK_NAME; - } - dscope = strupper_talloc(ndr, ptr); + dscope = strupper_talloc(ndr, r-scope); NT_STATUS_HAVE_NO_MEMORY(dscope); }
svn commit: samba r5327 - in trunk/source/utils: .
Author: vlendec Date: 2005-02-11 07:47:28 + (Fri, 11 Feb 2005) New Revision: 5327 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=5327 Log: Merge revision 5318 from 3_0. Volker Modified: trunk/source/utils/net_rpc.c trunk/source/utils/profiles.c Changeset: Modified: trunk/source/utils/net_rpc.c === --- trunk/source/utils/net_rpc.c2005-02-11 07:20:16 UTC (rev 5326) +++ trunk/source/utils/net_rpc.c2005-02-11 07:47:28 UTC (rev 5327) @@ -1005,26 +1005,32 @@ result = cli_samr_query_usergroups(cli, mem_ctx, user_pol, num_rids, user_gids); + if (!NT_STATUS_IS_OK(result)) goto done; + /* Look up rids */ - rids = TALLOC_ARRAY(mem_ctx, uint32, num_rids); + if (rids) { + rids = TALLOC_ARRAY(mem_ctx, uint32, num_rids); - for (i = 0; i num_rids; i++) -rids[i] = user_gids[i].g_rid; + for (i = 0; i num_rids; i++) + rids[i] = user_gids[i].g_rid; - result = cli_samr_lookup_rids(cli, mem_ctx, domain_pol, - flags, num_rids, rids, - num_names, names, name_types); + result = cli_samr_lookup_rids(cli, mem_ctx, domain_pol, + flags, num_rids, rids, + num_names, names, name_types); - if (!NT_STATUS_IS_OK(result)) { - goto done; - } + if (!NT_STATUS_IS_OK(result)) { + goto done; + } - /* Display results */ + /* Display results */ - for (i = 0; i num_names; i++) - printf(%s\n, names[i]); - + for (i = 0; i num_names; i++) + printf(%s\n, names[i]); + } + else { + printf(no groups\n); + } done: return result; } Modified: trunk/source/utils/profiles.c === --- trunk/source/utils/profiles.c 2005-02-11 07:20:16 UTC (rev 5326) +++ trunk/source/utils/profiles.c 2005-02-11 07:47:28 UTC (rev 5327) @@ -521,7 +521,7 @@ int main(int argc, char *argv[]) { int opt; - int fd, start = 0; + int fd; char *base; struct stat sbuf; REGF_HDR *regf_hdr; @@ -608,10 +608,9 @@ * Now, mmap the file into memory, check the header and start * dealing with the records. We are interested in the sk record */ - start = 0; #ifdef HAVE_MMAP - base = mmap(start, sbuf.st_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + base = mmap(NULL, sbuf.st_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); #else base = (char *)-1; errno = ENOSYS;
svn commit: samba r5328 - in branches/SAMBA_4_0/source: libcli/nbt libcli/resolve torture/nbt utils
Author: tridge Date: 2005-02-11 07:54:20 + (Fri, 11 Feb 2005) New Revision: 5328 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=5328 Log: - allow case sensitive nbt name lookups - added --case-sensitive option to nmblookup - added case sensitivity tests to the NBT-WINS test Modified: branches/SAMBA_4_0/source/libcli/nbt/nbtname.c branches/SAMBA_4_0/source/libcli/resolve/nbtlist.c branches/SAMBA_4_0/source/torture/nbt/wins.c branches/SAMBA_4_0/source/utils/nmblookup.c Changeset: Modified: branches/SAMBA_4_0/source/libcli/nbt/nbtname.c === --- branches/SAMBA_4_0/source/libcli/nbt/nbtname.c 2005-02-11 07:47:28 UTC (rev 5327) +++ branches/SAMBA_4_0/source/libcli/nbt/nbtname.c 2005-02-11 07:54:20 UTC (rev 5328) @@ -114,7 +114,7 @@ compress a name component */ static uint8_t *compress_name(TALLOC_CTX *mem_ctx, - uint8_t *name, enum nbt_name_type type) + const uint8_t *name, enum nbt_name_type type) { uint8_t *cname; int i; @@ -211,7 +211,7 @@ { uint_t num_components; uint8_t *components[MAX_COMPONENTS]; - char *dname, *dscope=NULL, *p; + char *dscope=NULL, *p; uint8_t *cname; int i; @@ -219,14 +219,12 @@ return NT_STATUS_OK; } - dname = strupper_talloc(ndr, r-name); - NT_STATUS_HAVE_NO_MEMORY(dname); if (r-scope) { - dscope = strupper_talloc(ndr, r-scope); + dscope = talloc_strdup(ndr, r-scope); NT_STATUS_HAVE_NO_MEMORY(dscope); } - cname = compress_name(ndr, dname, r-type); + cname = compress_name(ndr, r-name, r-type); NT_STATUS_HAVE_NO_MEMORY(cname); /* form the base components */ Modified: branches/SAMBA_4_0/source/libcli/resolve/nbtlist.c === --- branches/SAMBA_4_0/source/libcli/resolve/nbtlist.c 2005-02-11 07:47:28 UTC (rev 5327) +++ branches/SAMBA_4_0/source/libcli/resolve/nbtlist.c 2005-02-11 07:54:20 UTC (rev 5328) @@ -101,6 +101,13 @@ status = nbt_name_dup(state, name, state-name); if (!NT_STATUS_IS_OK(status)) goto failed; + state-name.name = strupper_talloc(state, state-name.name); + if (state-name.name == NULL) goto failed; + if (state-name.scope) { + state-name.scope = strupper_talloc(state, state-name.scope); + if (state-name.scope == NULL) goto failed; + } + state-nbtsock = nbt_name_socket_init(state, event_ctx); if (state-nbtsock == NULL) goto failed; Modified: branches/SAMBA_4_0/source/torture/nbt/wins.c === --- branches/SAMBA_4_0/source/torture/nbt/wins.c2005-02-11 07:47:28 UTC (rev 5327) +++ branches/SAMBA_4_0/source/torture/nbt/wins.c2005-02-11 07:54:20 UTC (rev 5328) @@ -114,6 +114,42 @@ CHECK_VALUE(query.out.num_addrs, 1); CHECK_STRING(query.out.reply_addrs[0], myaddress); + + query.in.name.name = strupper_talloc(mem_ctx, name-name); + if (query.in.name.name + strcmp(query.in.name.name, name-name) != 0) { + printf(check case sensitivity\n); + status = nbt_name_query(nbtsock, mem_ctx, query); + if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { + printf(No response from %s for name query\n, address); + return False; + } + if (!NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) { + printf(Bad response from %s for name query - %s\n, + address, nt_errstr(status)); + return False; + } + } + + query.in.name = *name; + if (name-scope) { + query.in.name.scope = strupper_talloc(mem_ctx, name-scope); + } + if (query.in.name.scope + strcmp(query.in.name.scope, name-scope) != 0) { + printf(check case sensitivity on scope\n); + status = nbt_name_query(nbtsock, mem_ctx, query); + if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { + printf(No response from %s for name query\n, address); + return False; + } + if (!NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) { + printf(Bad response from %s for name query - %s\n, + address, nt_errstr(status)); + return False; + } + } + printf(refresh the name\n); refresh.in.name = *name; refresh.in.wins_servers = str_list_make(mem_ctx, address, NULL); @@ -176,6 +212,7 @@ printf(query the name to make sure