1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

240 Commits

Author SHA1 Message Date
Noel Power
28719f3edc s3/utils: If dfs path is an ordinary path then really just return it
In cli_resolve_path if the share was a root dfs share then any self
hosted dfs paths end up not being returned as is but being decorated
with fileserver and share. This file path is not suitable for
passing to cli_list so we adjust it here.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-08-31 17:44:38 +00:00
Noel Power
0248fdd09a add new '--propagate-inheritance' option for smbcacls
smbcacls now can take a '--propagate-inheritance' flag to indicate that the
add, delete, modify and set operations now support automatic propagation of
inheritable ACE(s)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-08-31 17:44:38 +00:00
Andreas Schneider
0d0a3bbc83 s3:utils: Remove obsolete force encryption from smbacls
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2020-08-19 16:22:42 +00:00
Andreas Schneider
ba04151a01 s3:libsmb: Remove signing_state from cli_full_connection_creds()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2020-08-19 16:22:42 +00:00
Anubhav Rakshit
cd5a2d015b s3:smbcacls: Add support for DFS path
smbcacls does not handle DFS paths correctly. This is beacuse once the
command encounters a path which returns STATUS_PATH_NOT_COVERED, it does
not attempt a GET REFERRAL.

We use cli_resolve_path API to perform a DFS path resolution to solve
the above problem.

Additionally this removes the known fail against smbcacls tests
Signed-off-by: Anubhav Rakshit <anubhav.rakshit@gmail.com>
Reviewed-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jul  7 23:03:00 UTC 2020 on sn-devel-184
2020-07-07 23:03:00 +00:00
Volker Lendecke
ecc2573544 smbcacls: Fix typo "inherated"->"inherited"
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-28 19:11:39 +00:00
Volker Lendecke
d9027c56a5 smbcacls: Align integer types
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-28 19:11:39 +00:00
Volker Lendecke
358ad2800a smbcacls: Remove the CREATE_ACCESS_READ #define
That only confuses things

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-28 19:11:39 +00:00
Volker Lendecke
41ff557975 smbcacls: Reformat a call to cli_ntcreate()
The next patch will change one of the arguments

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-05-28 19:11:39 +00:00
Stefan Metzmacher
16fbb196fc s3:smbcacls: make use of get_cmdline_auth_info_creds()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2020-05-28 06:43:38 +00:00
Volker Lendecke
ac71d6b2f8 smbcacls: Use ARRAY_DEL_ELEMENT() in sort_acl()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-03-26 14:43:31 +00:00
Andreas Schneider
2b957bde5a s3:utils: If share is NULL in smbcacls, don't print it
Found by GCC 9.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2019-05-08 16:33:24 +00:00
Ralph Boehme
ec8984f8dd smbcacls: add -x argument, prints maximum access
Signed-off-by: Ralph Boehme <slow@samba.org>
2019-03-04 18:11:17 +00:00
Andreas Schneider
5990980cc9 s3:utils: Use C99 initializer for poptOption in smbcacls
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2019-01-28 10:29:13 +01:00
Volker Lendecke
69a3b899f1 smbcacls: Use dom_sid_str_buf
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2018-12-20 23:40:24 +01:00
Christof Schmitt
b7464fd89b s3:lib: Move popt_common_credentials to separate file
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>
2018-09-07 17:26:14 +02:00
Ralph Boehme
a826394a2f smbcacls: no need to fetch the sd when changing ownership
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
2017-10-07 00:04:54 +02:00
Richard Sharpe
835f5068e3 s3: Fix a small spelling mistake in smbcacls.
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
2017-09-22 05:44:08 +02:00
Noel Power
c57dcafb15 s3/utils: smbcacls failed to detect DIRECTORIES using SMB2 (windows only)
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>
2017-07-20 18:49:27 +02:00
Jeremy Allison
bd31d538a2 s3: libsmb: Correctly save and restore connection tcon in smbclient, 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>
2017-06-17 06:39:20 +02:00
Jeremy Allison
47dc643b0d s3: client tools: Call popt_free_cmdline_auth_info() on all normal exits.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2017-05-09 09:56:09 +02:00
Jeremy Allison
bec0cd2ee2 s3: client tools. Remove direct access to struct user_auth_info *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>
2017-05-09 09:56:09 +02:00
Christian Ambach
770edb6aab s3:smbcacls add prompt for password
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
2017-05-04 20:36:50 +02:00
Stefan Metzmacher
4fb0e65a85 s3:popt_common: let POPT_COMMON_CREDENTIALS imply logfile and conffile loading
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>
2016-12-20 01:11:25 +01:00
Stefan Metzmacher
5ca59a1772 s3:libsmb: don't pass 'passlen' to cli_tree_connect[_send]() and allow pass=NULL
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
2016-12-09 13:09:37 +01:00
Stefan Metzmacher
d6d8893d56 s3:popt_common: simplify popt_common_credentials handling
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>
2016-11-15 11:00:26 +01:00
Christof Schmitt
e2642da130 smbcacls: Do not read old ACL for 'set' operation
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-04-30 01:01:42 +02:00
Uri Simchoni
6cff009547 smbcacls: fix uninitialized variable
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
2016-01-20 12:12:12 +01:00
Richard Sharpe
57941aa044 s3: utils: Convert all uses of uint32/16/8 to _t.
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
2015-05-07 04:53:39 +02:00
Christof Schmitt
42c46ab642 smbcacls: Move sec_desc_print to common file
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>
2015-04-25 00:04:24 +02:00
Christof Schmitt
541ddde872 smbcacls: Move print_ace and parse_ace to common file
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>
2015-04-25 00:04:24 +02:00
Christof Schmitt
a519b3e6c6 smbcacls: Move StringToSid to common file
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>
2015-04-25 00:04:24 +02:00
Christof Schmitt
7eeca44f03 smbcacls: Move SidToString to common file
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>
2015-04-25 00:04:23 +02:00
Christof Schmitt
9e1ebdc7ec smbcacls: Use defines for security flags
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>
2015-04-25 00:04:23 +02:00
Christof Schmitt
d0c4969581 smbcacls: Make 'numeric' a local variable
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>
2015-04-25 00:04:23 +02:00
Volker Lendecke
c51300ad89 lib: load_case_tables() -> smb_init_locale()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-24 00:00:20 +01:00
David Disseldorp
49b500a61f smbcacls: parse config file argument prior to load
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
2014-07-07 23:30:50 +02:00
David Disseldorp
bc70d58cbc s3/smbcacls: use security_ace_equal instead of sec_ace_equal
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>
2014-05-29 01:08:25 +02:00
Jeremy Allison
69e24b4e8b s3: client : Add extra return parameter to all client open calls.
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>
2014-05-09 23:10:07 +02:00
Stefan Metzmacher
c2a26fe5e7 s3:utils: avoid argv related const warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:43 +02:00
Jeremy Allison
41d8d99d8a CVE-2013-6442: s3:smbcacls - ensure we don't lose an existing ACL when 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
2014-03-11 22:55:53 +01:00
Andreas Schneider
4c98b9ce8f s3-utils: Fix scanf format in smbacls.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-11-15 11:07:43 -08:00
Jeremy Allison
f6ce50a8ac s3:smbcacls: Add -m<MAX PROTOCOL> option to smbcacls.
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>
2013-08-15 09:07:05 +02:00
Günther Deschner
9813fe2b04 s3-rpc_cli: pass down ndr_interface_table to cli_rpc_pipe_open_noauth().
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-08-05 10:30:00 +02:00
Stefan Metzmacher
0e2e3ff5e8 s3:smbcacls: add --query-security-info and --set-security-info options
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>
2012-12-02 23:08:23 +01:00
Stefan Metzmacher
3101fcccff s3:util: fix usage of popt_burn_cmdline_password()
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>
2012-11-30 11:50:03 +01:00
Andreas Schneider
50d47fc081 s3fs-client: Burn commandline password of client utils.
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
2012-11-08 21:24:21 +01:00
Andreas Schneider
39e58d6845 s3fs-utils: Free the popt context in smbcacls and smbquotas.
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
2012-10-30 20:22:46 +01:00
Stefan Metzmacher
9cae92b485 s3:utils: use cli_tree_connect() instead of cli_tcon_andx()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed May 30 12:54:05 CEST 2012 on sn-devel-104
2012-05-30 12:54:05 +02:00
Jeremy Allison
571ee0b1ff Only ask for specific permissions required when setting an ACL.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Feb  3 03:07:33 CET 2012 on sn-devel-104
2012-02-03 03:07:32 +01:00