Bug 12765 - smbcacls fails if no password is specified
Summary: smbcacls fails if no password is specified
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Tools (show other bugs)
Version: 4.6.3
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-03 08:13 UTC by Marc Muehlfeld
Modified: 2017-05-16 07:14 UTC (History)
3 users (show)

See Also:


Attachments
level 10 debug log (8.96 KB, text/plain)
2017-05-03 08:13 UTC, Marc Muehlfeld
no flags Details
proposed patch (772 bytes, patch)
2017-05-04 10:28 UTC, Christian Ambach
no flags Details
patch for 4.6.x/4.5.x with cherry-pick information (1018 bytes, patch)
2017-05-10 22:43 UTC, Christian Ambach
asn: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Muehlfeld 2017-05-03 08:13:39 UTC
Created attachment 13188 [details]
level 10 debug log

Problem description:
If you run an smbcacls command without specifying the password in the -U parameter, the command fails and prints:
> cli_full_connection failed! (NT_STATUS_LOGON_FAILURE)
instead of asking for the password such as other tool do (e. g. "net" or "samba-tool").



Steps to reproduce:
1. Run:
   # smbcacls //M1/DemoShare01 -Uadministrator /
   cli_full_connection failed! (NT_STATUS_LOGON_FAILURE)



Further details:
* The command works if you add the password to the -U parameter. For example:
  # smbcacls //M1/DemoShare01 -Uadministrator%password /
  But this should not be the recommended way.
* Connections also work if you have a valid Kerberos ticket and pass the
  -k option to the command
Comment 1 Christian Ambach 2017-05-04 10:28:00 UTC
Created attachment 13189 [details]
proposed patch

Does this patch help?
Comment 2 Marc Muehlfeld 2017-05-04 11:24:18 UTC
Thanks, Christian. The patch applies without any problems to 4.6.3 and fixes the problem.
Comment 3 Christian Ambach 2017-05-04 12:21:44 UTC
(In reply to Marc Muehlfeld from comment #2)

Thanks for the feedback. Will roll the patch over samba-technical for review and push.
Comment 4 Christian Ambach 2017-05-10 22:43:01 UTC
Created attachment 13207 [details]
patch for 4.6.x/4.5.x with cherry-pick information

Patch applies to 4-6-test and 4-5-test
Comment 5 Andreas Schneider 2017-05-11 10:02:29 UTC
Karolin, please add the patch to the relevant branches. Thanks!
Comment 6 Karolin Seeger 2017-05-12 06:54:58 UTC
(In reply to Andreas Schneider from comment #5)
Pushed to autobuild-v4-{6,5}-test.
Comment 7 Karolin Seeger 2017-05-12 07:25:24 UTC
(In reply to Karolin Seeger from comment #6)

v4-5-test:
[3230/4067] Compiling source3/utils/smbcacls.c
../source3/utils/smbcacls.c: In function ‘main’:
../source3/utils/smbcacls.c:922:2: error: implicit declaration of function ‘popt_common_credentials_post’ [-Werror=implicit-function-declaration]
  popt_common_credentials_post();
  ^
cc1: all warnings being treated as errors
Comment 8 Christian Ambach 2017-05-12 11:02:28 UTC
I've discussed it with Andreas: putting the fix into 4.5 would need a back port of a lot of other changes to make it work. We consider this as too risky. So let's restrict this fix to 4.6.x, the auto build for that should work.
Comment 9 Karolin Seeger 2017-05-16 07:14:45 UTC
(In reply to Christian Ambach from comment #8)
Ok, thanks!

Pushed to v4-6-test.
Closing out bug report.

Thanks!