summaryrefslogtreecommitdiff
path: root/source3/utils/smbcacls.c
Commit message (Collapse)AuthorAgeFilesLines
* s3:utils: If share is NULL in smbcacls, don't print itAndreas Schneider2019-05-081-2/+2
| | | | | | | Found by GCC 9. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbcacls: add -x argument, prints maximum accessRalph Boehme2019-03-041-0/+40
| | | | Signed-off-by: Ralph Boehme <slow@samba.org>
* s3:utils: Use C99 initializer for poptOption in smbcaclsAndreas Schneider2019-01-281-16/+117
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* smbcacls: Use dom_sid_str_bufVolker Lendecke2018-12-201-1/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* s3:lib: Move popt_common_credentials to separate fileChristof Schmitt2018-09-071-1/+1
| | | | | | | | | | | This is only used by command line utilities and has additional dependencies. Move to a separate file to contain the dependencies to the command line tools. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* smbcacls: no need to fetch the sd when changing ownershipRalph Boehme2017-10-071-10/+6
| | | | | | | | | | | | Reading the SD may be denied but changing ownership could be allowed. As we don't really need the server SD for the change ownership request, don't fetch it. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Oct 7 00:04:54 CEST 2017 on sn-devel-144
* s3: Fix a small spelling mistake in smbcacls.Richard Sharpe2017-09-221-1/+1
| | | | | | | | Signed-off-by: Richard Sharpe <realrichardsharpe@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Fri Sep 22 05:44:09 CEST 2017 on sn-devel-144
* s3/utils: smbcacls failed to detect DIRECTORIES using SMB2 (windows only)Noel Power2017-07-201-11/+3
| | | | | | | | | | | | | | | | | | | | | | | uint16_t get_fileinfo(...) returns file attributes, this function called cli_qfileinfo_basic(cli, fnum, &mode, NULL, NULL, NULL, NULL, NULL, NULL); which was failing with NT_STATUS_ACCESS_DENIED errors when fnum above was obtained via (when using protocol > SMB). Note: This only seems to be an issue when run against a windows server, with smbd SMB1 & SMB2 work fine. status = cli_ntcreate(cli, filename, 0, CREATE_ACCESS_READ, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, 0x0, 0x0, &fnum, NULL); The failing cli_qfileinfo_basic call above is unnecessary as we can already obtain the required information from the cli_ntcreate call Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* s3: libsmb: Correctly save and restore connection tcon in smbclient, ↵Jeremy Allison2017-06-171-2/+10
| | | | | | | | | smbcacls and smbtorture3. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12831 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
* s3: client tools: Call popt_free_cmdline_auth_info() on all normal exits.Jeremy Allison2017-05-091-0/+2
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3: client tools. Remove direct access to struct user_auth_info ↵Jeremy Allison2017-05-091-1/+1
| | | | | | | | | | *cmdline_auth_info. Only access through utility functions. Remove all the local pointer aliases that were just being set to cmdline_auth_info in the client tools. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:smbcacls add prompt for passwordChristian Ambach2017-05-041-0/+1
| | | | | | | | | | | if no password was given, ask for one BUG: https://bugzilla.samba.org/show_bug.cgi?id=12765 Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Christian Ambach <ambi@samba.org> Autobuild-Date(master): Thu May 4 20:36:50 CEST 2017 on sn-devel-144
* s3:popt_common: let POPT_COMMON_CREDENTIALS imply logfile and conffile loadingStefan Metzmacher2016-12-201-3/+2
| | | | | | | | | | | All users of POPT_COMMON_CREDENTIALS basically need the same logic, while some ignore a broken smb.conf and some complain about it. This will allow the future usage of config options in the credential post processing. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:libsmb: don't pass 'passlen' to cli_tree_connect[_send]() and allow pass=NULLStefan Metzmacher2016-12-091-1/+1
| | | | | | | | | | There're no callers which try to pass a raw lm_response directly anymore. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Dec 9 13:09:37 CET 2016 on sn-devel-144
* s3:popt_common: simplify popt_common_credentials handlingStefan Metzmacher2016-11-151-17/+2
| | | | | | | | | | | | | | | | This offers a global 'struct user_auth_info *cmdline_auth_info', similar to the 'cmdline_credentials' we have in source4/lib/cmdline/popt_common.c. And we create that in the POPT_CALLBACK_REASON_PRE stage and finalize it in the POPT_CALLBACK_REASON_POST stage. That means much less boring work for the callers and more freedom to change the user_auth_info internals in future. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* smbcacls: Do not read old ACL for 'set' operationChristof Schmitt2016-04-301-4/+10
| | | | | Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbcacls: fix uninitialized variableUri Simchoni2016-01-201-1/+1
| | | | | | | | | | | | | An uninitialized variable causes "numeric" mode to be used without the -n option. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11682 Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Wed Jan 20 12:12:12 CET 2016 on sn-devel-144
* s3: utils: Convert all uses of uint32/16/8 to _t.Richard Sharpe2015-05-071-7/+7
| | | | | | | | Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu May 7 04:53:39 CEST 2015 on sn-devel-104
* smbcacls: Move sec_desc_print to common fileChristof Schmitt2015-04-251-81/+0
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11237 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbcacls: Move print_ace and parse_ace to common fileChristof Schmitt2015-04-251-354/+0
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11237 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbcacls: Move StringToSid to common fileChristof Schmitt2015-04-251-62/+0
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11237 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbcacls: Move SidToString to common fileChristof Schmitt2015-04-251-85/+1
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11237 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbcacls: Use defines for security flagsChristof Schmitt2015-04-251-9/+10
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11237 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbcacls: Make 'numeric' a local variableChristof Schmitt2015-04-251-20/+25
| | | | | | | | | | This will allow moving code to a shared file without relying on a global variable. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11237 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: load_case_tables() -> smb_init_locale()Volker Lendecke2015-03-241-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbcacls: parse config file argument prior to loadDavid Disseldorp2014-07-071-2/+3
| | | | | | | | | | Fixes usage with the common "-s|--configfile" parameter. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Jul 7 23:30:50 CEST 2014 on sn-devel-104
* s3/smbcacls: use security_ace_equal instead of sec_ace_equalDavid Disseldorp2014-05-291-4/+5
| | | | | | | Both offer the same functionality, sec_ace_equal() will be removed. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3: client : Add extra return parameter to all client open calls.Jeremy Allison2014-05-091-3/+3
| | | | | | | | | | | | | | | Add a return parameter of struct smb_create_returns *cr to cli_ntcreate() cli_ntcreate_recv() cli_nttrans_create() cli_nttrans_create_recv() Always pass in NULL for now. This fixes the create API to always fully return the data the server has given back to us on the open file to the caller. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:utils: avoid argv related const warningsStefan Metzmacher2014-04-021-2/+3
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* CVE-2013-6442: s3:smbcacls - ensure we don't lose an existing ACL when ↵Jeremy Allison2014-03-111-1/+1
| | | | | | | | | | | | | setting owner or group owner. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10327 Bug 10327 - CVE-2013-6442: smbcacls --chown | --chgrp dacl regression Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Karolin Seeger <kseeger@samba.org> Autobuild-Date(master): Tue Mar 11 22:55:54 CET 2014 on sn-devel-104
* s3-utils: Fix scanf format in smbacls.Andreas Schneider2013-11-151-3/+3
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbcacls: Add -m<MAX PROTOCOL> option to smbcacls.Jeremy Allison2013-08-151-0/+4
| | | | | | | | https://bugzilla.samba.org/show_bug.cgi?id=9514 Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3-rpc_cli: pass down ndr_interface_table to cli_rpc_pipe_open_noauth().Günther Deschner2013-08-051-4/+3
| | | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:smbcacls: add --query-security-info and --set-security-info optionsStefan Metzmacher2012-12-021-10/+55
| | | | | | | This allows the caller to specify the security_information flags. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:util: fix usage of popt_burn_cmdline_password()Stefan Metzmacher2012-11-301-1/+0
| | | | | | | | We should only call popt_burn_cmdline_password() after poptFreeContext(), otherwise we remove the password to early. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3fs-client: Burn commandline password of client utils.Andreas Schneider2012-11-081-0/+2
| | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Nov 8 21:24:21 CET 2012 on sn-devel-104
* s3fs-utils: Free the popt context in smbcacls and smbquotas.Andreas Schneider2012-10-301-0/+2
| | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Oct 30 20:22:46 CET 2012 on sn-devel-104
* s3:utils: use cli_tree_connect() instead of cli_tcon_andx()Stefan Metzmacher2012-05-301-1/+1
| | | | | | | metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Wed May 30 12:54:05 CEST 2012 on sn-devel-104
* Only ask for specific permissions required when setting an ACL.Jeremy Allison2012-02-031-3/+12
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri Feb 3 03:07:33 CET 2012 on sn-devel-104
* s3:utils: make use of cli_tree_connect()Stefan Metzmacher2011-11-241-2/+2
| | | | metze
* s3:smbcacls: fix violation of coding conventionsGregor Beck2011-10-121-1/+2
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* s3:smbcacls: make get_domain_sid() staticMichael Adam2011-10-121-1/+1
|
* s3:smbcacls fix leaking talloc stackframce on tcon failureGregor Beck2011-10-121-2/+4
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* s3:smbcacls fix possible SEGFAULTGregor Beck2011-10-121-10/+14
| | | | | | sddl_encode returns NULL on failure Signed-off-by: Michael Adam <obnox@samba.org>
* s3:smbcacls add option domain-sidGregor Beck2011-10-121-5/+16
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* s3:smbcacls get_domain_sid for sddl parsing/formating from lsarpcGregor Beck2011-10-121-2/+72
| | | | | | get_global_sid panics if we are not root and may give the wrong answer anyway. Signed-off-by: Michael Adam <obnox@samba.org>
* s3:smbcacls pretty print acl control fieldGregor Beck2011-10-121-1/+43
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* s3:smbcacls: use lp_load_global()Michael Adam2011-07-281-1/+1
|
* s3-utils/smbcacls.c: replace cli_query_secdesc_old()Björn Baumbach2011-07-231-3/+4
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3-libsmb: rename cli_query_secdesc() to cli_query_secdesc_old()Björn Baumbach2011-07-231-1/+1
| | | | | | Will introduce new cli_query_secdesc() function Signed-off-by: Stefan Metzmacher <metze@samba.org>