1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00
Commit Graph

122 Commits

Author SHA1 Message Date
Jelmer Vernooij
66f13ea1e9 Partially revert 1f0298dd1b
It's fine to catch keyboard interrupts and other kinds of errors when it's done just for resource management, where the error is reraised later.

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Feb 25 17:29:34 CET 2012 on sn-devel-104
2012-02-25 17:29:34 +01:00
Andrew Bartlett
d8f98933fd pydsdb: provide a am_pdc hook like am_rodc to python scripts 2011-12-07 03:09:08 +01:00
Matthieu Patou
fc42b0ab41 s4-python: factorize the definition of get_dsServiceName 2011-12-05 18:23:07 +01:00
Amitay Isaacs
13545d781b s4-samdb: seqence_number() operation must be in a transaction 2011-11-29 16:00:36 +11:00
Giampaolo Lauria
2611003258 samba-tool: Don't set UF_PASSWD_NOTREQD flag on "user disable"
Signed-off-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User: Amitay Isaacs <amitay@samba.org>
Autobuild-Date: Tue Nov 15 02:51:16 CET 2011 on sn-devel-104
2011-11-15 02:51:15 +01:00
Giampaolo Lauria
1cef3212a1 samba-tool: Added new "user disable" command 2011-11-10 14:24:21 +11:00
Giampaolo Lauria
16437edf48 samba-tool: Improve "delegation" command error handling
Change samdb toggle_userAccountFlags fcn to display more
meaningful error messages
Add flags string param to toggle_userAccountFlags
Change call to toggle_userAccountFlags in delegation command
to pass the flag name to be displayed in case of errors
2011-11-03 15:12:27 +01:00
Andrew Tridgell
17fa96b64a s4-samdb: added a few function comments for pydoc
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-09-05 11:19:25 +02:00
Andrew Tridgell
219271bd15 s4-samdb: added host_dns_name(), domain_dns_name() and forest_dns_name()
these will make it easier to get python code right for multi-domain
support
2011-08-25 07:39:38 +10:00
Andrew Tridgell
75a90a952b s4-samdb: added deleteuser() to samdb
This is similar to deletegroup()
2011-08-18 09:26:59 +10:00
Andrew Tridgell
4e4953dd48 s4-samdb: support relative paths in SamDB() connect
don't add the private path unless the database doesn't exist with the
supplied path
2011-08-09 11:56:23 +02:00
Andrew Tridgell
d994ef2056 pysamdb: move normalise_int32() to common module
this will be needed in quite a few places
2011-08-09 11:56:23 +02:00
Andrew Tridgell
2331610a2e s4-samdb: save the url in the samdb class
this is useful for debugging, so we know which database we are dealing
with

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-08-04 16:17:25 +10:00
Andrew Tridgell
03f92508ef samba-tool: use ldb.binary_encode() on search expression elements
this allows us to deal with search elements containing characters that
must be escaped in LDAP

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-07-29 18:17:44 +10:00
Andrew Tridgell
94b820af56 pydsdb: added get_backlink_from_lDAPDisplayName()
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-07-13 12:51:05 +02:00
Andrew Tridgell
02562a0ca9 dsdb: added get_lDAPDisplayName_by_attid
this allows conversion from a DRS attribute ID to a LDAP display name

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-07-11 14:32:45 +10:00
Matthieu Patou
bbd4e27745 s4-python: Add functions to get linkid and systemflags of an attribute
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-11 14:32:44 +10:00
Stefan Metzmacher
4b26fc0980 s4:python/samba/samdb: add toggle_userAccountFlags() helper function
And let enable_account() use it.

Pair-Programmed-With: Björn Baumbach <bb@sernet.de>

metze
2011-06-24 19:06:44 +02:00
Andrew Tridgell
202f0a4b57 pydsdb: added get_syntax_oid_from_lDAPDisplayName()
this gives you access to the syntax oid of an attribute

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-06-22 14:47:08 +10:00
Andrew Tridgell
0c3075cb57 s4-pysamdb: fixed the normalisation of grouptype in group add
ldap integers are signed

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Fri Jun 17 05:43:18 CEST 2011 on sn-devel-104
2011-06-17 05:43:18 +02:00
Andrew Tridgell
665ef94d3c s4-pydsdb: added dsdb_normalise_attributes() call
this call converts a set of attributes to DRSUAPI format and back to
ldb format. This has the effect of normalising the attributes using
the schema syntax rules
2011-06-17 12:32:55 +10:00
Andrew Bartlett
c091a92be5 s4-param Remove 'sam database' parameter
This now just relies on the private dir parameter, which remains.

Andrew Bartlett
2011-06-06 15:02:38 +10:00
Andrew Tridgell
1bc1ac0d08 samba-tool: improved error handling in user setexpiry 2011-06-01 17:24:36 +10:00
Andrew Tridgell
7b3d8b6c90 samba-tool: improved user enable error handling 2011-06-01 17:24:36 +10:00
Matthias Dieter Wallnöfer
573389c8cc s4:password_hash LDB module - allow empty ("") passwords
This seems to have been broken some time ago - till someone on the
mailing list noticed it.

I've also added a testsuite (and some additional SamDB python helpers) which
should prove this.
2010-12-02 11:51:06 +01:00
Andrew Tridgell
dc0c89cf40 s4-samdb: give a better exception if multiple users match in password change 2010-11-29 18:04:42 +11:00
Andrew Tridgell
37bfc4ec38 s4-samba-tool: fixed exception handling in subcommands
this switches to the new pattern of:

 except Exception, e:
 	raise CommandError("some error message", e)
2010-11-29 18:04:42 +11:00
Jelmer Vernooij
eb5a8e29cf s4-python: Some reformatting for the purpose of pydoctor. 2010-11-28 17:23:28 +01:00
Jelmer Vernooij
a7675bd501 s4-python: Fix formatting of docstrings for the purpose of pydoctor. 2010-11-28 05:00:06 +01:00
Nadezhda Ivanova
1e9a7882be s4-tests: Modified create_ou to only accept security.descriptor type for sd to avoid confusion
It used to work with sddl as well, but this is confusing and could lead to errors. It also caused a message about tallocing a security descriptor to appear.

Autobuild-User: Nadezhda Ivanova <nivanova@samba.org>
Autobuild-Date: Thu Nov 25 19:46:42 CET 2010 on sn-devel-104
2010-11-25 19:46:42 +01:00
Nadezhda Ivanova
db403ac35d s4-dsdb: Switched to using a dictionary in create_ou for consistency.
Autobuild-User: Nadezhda Ivanova <nivanova@samba.org>
Autobuild-Date: Thu Nov 25 14:12:52 CET 2010 on sn-devel-104
2010-11-25 14:12:52 +01:00
Nadezhda Ivanova
05b8e078f4 s4-dsdb: Fixed wrong assignment of name attribute to description atribute in create_ou. 2010-11-25 14:25:43 +02:00
Nadezhda Ivanova
c89ecfc2ad s4-dsdb: Extended samdb.newgroup to set the group's security descriptor. 2010-11-24 16:54:18 +01:00
Nadezhda Ivanova
e95a350682 s4-dsdb: Changed filter to find the account of a user by samAccountName
In newuser, a filter by dn was given to setpassword to find the account whose password is to be reset.
It appears however that if given filter of type (dn=CN=smth) Windows fails to return the entry, and the
tests that use newuser fail against it. Changed to use samAccountName instead.
2010-11-23 21:02:03 +01:00
Nadezhda Ivanova
3001a514dd s4-dsdb: Extended samdb.newuser to accept security descriptor for the object and optionally skip password reset
Sometimes for testing purposes we create users without any permissions on their objects and password reset
cannot be performed at that point, and is not necessary. For this purpose we can now optionally skip this step.
The default is still to reset the user password.
Also, a security.descriptor object can be specified during the user creation to override using the default one.
defaultSecurityDescriptor is still used by default.
2010-11-23 17:15:16 +01:00
Nadezhda Ivanova
0c22316ccf s4-dsdb: Added a python method to SamDB for creating organizationalUnits 2010-11-23 14:33:27 +02:00
Nadezhda Ivanova
eaa9733a83 s4-dsdb: Added python helpers for getting and seting dSHeuristics to SamDB 2010-11-23 11:22:26 +02:00
Nadezhda Ivanova
c88b90e9f6 s4-dsdb: Added a helper to python SamDB for retrieving and setting minPwdAge. 2010-11-22 18:52:04 +02:00
Kamen Mazdrashki
c29a8c7ec5 s4-samdb.py: Use ldb.get_default_basedn() to avoid RootDSE search 2010-11-18 22:28:07 +01:00
Andrew Tridgell
cbded38ed5 s4-pydsdb: added DsReplicaAttribute()
this allows us to form a DsReplicaAttribute structure from python
2010-11-05 23:42:08 +11:00
Matthias Dieter Wallnöfer
a9b58f6246 s4:samdb.py - remove a pointless comment
We are only looking for the default DN - but the method name already tells
us this.

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Tue Oct 19 10:03:12 UTC 2010 on sn-devel-104
2010-10-19 10:03:12 +00:00
Matthias Dieter Wallnöfer
8c4f6bcd67 s4:samdb.py - use a more standard way to get to the domain realm/dns name
We do always use the canonical name as a base if we don't have it around yet.
2010-10-19 09:21:04 +00:00
Lukasz Zalewski
87fd2fd157 Addition of userPrincipalName attribute when new account is created 2010-10-19 09:21:04 +00:00
Kamen Mazdrashki
46ac1c3b47 s4-samba.samdb: Fix masking names from outer context
- 'filter' is built-in
- 'ldb' is a module name we imported
2010-10-03 01:24:56 +03:00
Kamen Mazdrashki
edfb8c64f6 s4-samba.samdb: Fix leading indention and trailing ';' 2010-10-03 01:24:55 +03:00
Andrew Tridgell
e72a1e2055 s4-pydsdb: added am_rodc() method on samdb 2010-09-19 11:29:32 -07:00
Andrew Tridgell
2666cc9c16 s4-pydsdb: don't force am_rodc unless it is set by caller
we should normally get the rodc flag by looking at the database, not
by forcing it in the database connect
2010-09-19 11:29:32 -07:00
Andrew Tridgell
54e86d881d s4-pydsdb: expose samdb_partitions_dn() as get_partitions_dn() in python
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-09-09 21:39:24 +10:00
Andrew Tridgell
8438da96ba s4-dsdb: added get_attid_from_lDAPDisplayName() on samdb
This can be used to form the partial_attribute_set list for
GetNCChanges

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-08-25 08:40:04 +10:00
Andrew Tridgell
3d13c9e53a s4-pysamdb: fixed get_domain_sid()
we need to actually return the SID!

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-08-20 20:34:11 +10:00