summaryrefslogtreecommitdiff
path: root/source3/utils/smbpasswd.c
Commit message (Collapse)AuthorAgeFilesLines
* s3:smbpasswd: Use cmdline_messaging_contextChristof Schmitt2018-09-071-14/+3
| | | | | | | | | | | smbpasswd does not use POPT_CREDENTIALS. Call cmdline_messaging_context to initialize a messaging_context with proper error checking before calling lp_load_global. 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>
* s3-utils: fix format-truncation in smbpasswdGünther Deschner2018-05-171-23/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ../source3/utils/smbpasswd.c: In function ‘process_root’: ../source3/utils/smbpasswd.c:414:37: error: ‘$’ directive output may be truncated writing 1 byte into a region of size between 0 and 255 [-Werror=format-truncation=] slprintf(buf, sizeof(buf) - 1, "%s$", user_name); ^ In file included from ../source3/include/includes.h:23, from ../source3/utils/smbpasswd.c:19: ../lib/replace/../replace/replace.h:514:18: note: ‘snprintf’ output between 2 and 257 bytes into a destination of size 255 #define slprintf snprintf ../source3/utils/smbpasswd.c:414:3: note: in expansion of macro ‘slprintf’ slprintf(buf, sizeof(buf) - 1, "%s$", user_name); ^~~~~~~~ ../source3/utils/smbpasswd.c:397:35: error: ‘$’ directive output may be truncated writing 1 byte into a region of size between 0 and 255 [-Werror=format-truncation=] slprintf(buf, sizeof(buf)-1, "%s$", user_name); ^ In file included from ../source3/include/includes.h:23, from ../source3/utils/smbpasswd.c:19: ../lib/replace/../replace/replace.h:514:18: note: ‘snprintf’ output between 2 and 257 bytes into a destination of size 255 #define slprintf snprintf ../source3/utils/smbpasswd.c:397:3: note: in expansion of macro ‘slprintf’ slprintf(buf, sizeof(buf)-1, "%s$", user_name); ^~~~~~~~ cc1: some warnings being treated as errors BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437 Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: Guenther Deschner <gd@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org>
* s3:utils: Remove pointless if-clause for remote_machineAndreas Schneider2017-08-231-6/+4
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12975 Review with: git show -U20 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
* s3:utils: Make sure we authenticate against our SAM name in smbpasswdAndreas Schneider2017-08-231-5/+27
| | | | | | | | | | | If a local user wants to change his password using smbpasswd and the machine is a domain member, we need to make sure we authenticate against our SAM and not ask winbind. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12975 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
* s3:utils: Pass domain to password_change() in smbpasswdAndreas Schneider2017-08-231-5/+7
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12975 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
* s3:utils: Make strings const passed to password_change() in smbpasswdAndreas Schneider2017-08-231-2/+3
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12975 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
* s3:libsmb: Move prototye of remote_password_change()Andreas Schneider2017-08-231-0/+1
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12975 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
* s3:libsmb: Pass domain to remote_password_change()Andreas Schneider2017-08-231-1/+2
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12975 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
* s3:utils: Allow to run smbpasswd as userAndreas Schneider2017-08-181-2/+12
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12974 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Aug 18 14:01:27 CEST 2017 on sn-devel-144
* smbpasswd: Initialize messaging for messaging_ctdb_connVolker Lendecke2017-07-251-0/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@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>
* s3-utils: Do not disable the root check in smbpasswd.Andreas Schneider2014-04-171-2/+0
| | | | | | | We will run uid_wrapper as root so that this succeeds. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3: smbpasswd - fix crashes on invalid input.Jeremy Allison2013-12-161-0/+14
| | | | | | | | | | | | | | | | get_pass can return NULL on error. Ensure that this is always the case and fix all callers to cope (some already did). Reported by Joonas Kuorilehto <joneskoo@codenomicon.com> BUG: https://bugzilla.samba.org/show_bug.cgi?id=10320 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Dec 16 15:17:58 CET 2013 on sn-devel-104
* smbpasswd: Don't leak memory.Andreas Schneider2013-02-221-0/+1
| | | | Reviewed-by: Alexander Bokovoy <ab@samba.org>
* s3-utils: Check return value of secrets_init().Andreas Schneider2012-12-211-1/+6
| | | | | | | Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* Correctly check for errors in strlower_m() returns.Jeremy Allison2012-08-091-1/+5
|
* s3-param: Make lp_name_resolve_order() return a listAndrew Bartlett2012-07-191-1/+1
| | | | | | | | | This allows this parameter, one of the few with differing declarations between the loadparm systems, to be brought into common. Andrew Bartlett Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>
* loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.Rusty Russell2012-07-181-2/+2
| | | | | | | | | | They use talloc_tos() internally: hoist that up to the callers, some of whom don't want to us talloc_tos(). A simple patch, but hits a lot of files. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* smbpasswd: always free frame.Rusty Russell2012-07-181-4/+4
| | | | | | | | We're about to exit, so it doesn't really matter, but might as well unify the paths. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* s3:smbpasswd: use lp_load_global()Michael Adam2011-07-281-1/+1
|
* s3-utils Set dyn_CONFIGFILE from -c on smbpasswd command lineAndrew Bartlett2011-05-081-0/+1
| | | | | | | | This is similar to the code in popt_common and allows the smb.conf to be re-loaded from this file later in the code (or for Samba4 plugins to attempt to parse the same smb.conf). Andrew Bartlett
* Fix warning messages caused by addition of null check in fstrcpy macro.Jeremy Allison2011-05-041-2/+2
|
* s3-passdb: add passdb.h where needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3-includes: only include system/passwd.h when needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* lib/util/util_pw: share more code between lib/util/util_pw.c and ↵Günther Deschner2011-03-301-0/+1
| | | | | | source3/lib/username.c Guenther
* s3-debug Remove last direct assignements to DEBUGLEVELAndrew Bartlett2010-11-021-1/+1
| | | | | | | | All future assignments of the debug level should go via lp_set_cmdline("log level", "x") because this will ensure the value is not overwritten in an smb.conf load. Andrew Bartlett
* s3-debug Remove 'AllowDebugChange' and use lp_set_cmdline() insteadAndrew Bartlett2010-11-021-4/+0
| | | | | | | | | By removing this global variable, the API between the two different debug systems is made more similar. Both s3 and s4 now have lp_set_cmdline() which ensures that the smb.conf cannot overwrite these the user-specified log level. Andrew Bartlett
* s3-debug Impove setup_logging() to specify logging to stderrAndrew Bartlett2010-11-021-1/+1
| | | | | | | | This change improves the setup_logging() API so that callers which wish to set up logging to stderr can simply ask for it, rather than directly modify the dbf global variable. Andrew Bartlett
* s3: Remove talloc_autofree_context() from smbpasswdVolker Lendecke2010-09-261-2/+2
| | | | In both cases, pwd is freed immediately
* s3-passdb: include samr.h where needed.Günther Deschner2010-08-061-0/+1
| | | | Guenther
* s3-secrets: only include secrets.h when needed.Günther Deschner2010-08-051-0/+1
| | | | Guenther
* Fix coverity #900. Resource leak.Jeremy Allison2009-06-191-0/+5
| | | | Jeremy.
* Consolidate user create/delete paths in smbpasswdSimo Sorce2009-05-291-27/+15
| | | | | | | | | | | | This patch changes the way smbpasswd behaves when adding/deleting users. smbpasswd now calls pdb_create_user/pdb_delete_user, this means that if add/delete user scripts are configured then they are used to create or delete unix users as well. If the scripts are not defined the behavioris unchanged. This also allow to use smbpasswd -a/-x with ldapsam:editposix to allow automatic creation/deletion of users. Signed-off-by: Günther Deschner <gd@samba.org>
* Don't look up local user for remote changes, even when root.Jim McDonough2009-04-161-6/+10
|
* Minor tidyup of unix account missing code.Jeremy Allison2009-01-091-5/+5
| | | | Jeremy.
* s3/smbpasswd: Check if Unix account exists before asking for the password.Karolin Seeger2009-01-091-0/+9
| | | | | | | Admins shouldn't have to type in the password twice when the passdb account cannot be created because the Unix account is missing. Karolin
* Make us clean under valgrind --leak-check=full by using ↵Jeremy Allison2008-11-061-2/+2
| | | | | | | | | | talloc_autofree_context() instead of NULL. Remove the code in memcache that does a TALLOC_FREE on stored pointers. That's a disaster waiting to happen. If you're storing talloc'ed pointers, you can't know their lifecycle and they should be deleted when their parent context is deleted, so freeing them at some arbitrary point later will be a double-free. Jeremy.
* Fix some nonempty blank linesVolker Lendecke2008-09-011-21/+21
| | | | (This used to be commit 9336cd1c5e5b5d113cd4912d4479dfe609fe261e)
* Developer doesn't cut it - need #define test for NSS_WRAPPER.Jeremy Allison2007-12-121-1/+1
| | | | | | Hopefully this should fix the buildfarm. Jeremy. (This used to be commit 087489b7f2a8cd5868b54dbed3f3eed5d0709ba7)
* Only add the non-root escape on !developer.Jeremy Allison2007-12-121-1/+1
| | | | | Jeremy. (This used to be commit a50c2d159c754c6ff88649ed859f2b3f9c24f6a1)
* Fix the buildfarm until I figure out how to allowJeremy Allison2007-12-121-0/+2
| | | | | | smbpasswd -L for non-root on the buildfarm only. Jeremy. (This used to be commit 1bb5ce824f800d967e2a92e946dd6ce7c4580b93)
* Fix bug #3727 with patch from Steve Langasek <vorlon@debian.org>Jeremy Allison2007-12-121-0/+4
| | | | | Jeremy. (This used to be commit 0723760ba47a465d2ff5a22a680f1b5196eca7d8)
* Remove the char[1024] strings from dynconfig. ReplaceJeremy Allison2007-12-101-1/+1
| | | | | | | them with malloc'ing accessor functions. Should save a lot of static space :-). Jeremy. (This used to be commit 52dc5eaef2106015b3a8b659e818bdb15ad94b05)
* Getting to the home stretch for elimination of pstrings...Jeremy Allison2007-12-031-4/+3
| | | | | Jeremy. (This used to be commit 041163551194102ca67fef52c57d87020a1d09bc)
* Make remote_password_change return malloced error stringsVolker Lendecke2007-11-231-2/+3
| | | | | This fixes a segfault in smbpasswd -r (This used to be commit 49949f0b85007c7c2b3c340c12f3d18909862135)
* Remove pstrings from pam_smbpass - make local_password_changeJeremy Allison2007-11-211-5/+7
| | | | | | return malloced strings. Jeremy. (This used to be commit f652fe2bdb7a3a36e83dcf4b08347543fdffb9f0)
* RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison2007-10-181-5/+5
| | | | | | | | bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
* r24943: Some stackframesVolker Lendecke2007-10-101-1/+5
| | | | (This used to be commit cddb9f11d5fafcd3797cb242775c37f0c04d4f15)
* r23801: The FSF has moved around a lot. This fixes their Mass Ave address.Andrew Tridgell2007-10-101-2/+1
| | | | (This used to be commit 87c91e4362c51819032bfbebbb273c52e203b227)
* r23779: Change from v2 or later to v3 or later.Jeremy Allison2007-10-101-1/+1
| | | | | Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)