summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-08-08 19:29:34 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:38:36 -0500
commite1e62d89999629d41cc2b66b12eb37ce190d5db0 (patch)
treebb9732660ea085b6f13b1ddfa7140243e4624410 /source3/torture
parentbe72e2de59b984bccd2e84e658bbbef379e6f13c (diff)
downloadsamba-e1e62d89999629d41cc2b66b12eb37ce190d5db0.tar.gz
samba-e1e62d89999629d41cc2b66b12eb37ce190d5db0.tar.bz2
samba-e1e62d89999629d41cc2b66b12eb37ce190d5db0.zip
r17463: A bit of cleanup work:
Remove some unused code: pdb_find_alias is not used anymore, and nobody I think has ever used the pdb_nop operations for group mapping. smbpasswd and tdb use the default ones and ldap has its own. Make the functions pdb_getgr* return NTSTATUS instead of BOOL. Nobody right now really makes use of it, but it feels wrong to throw away information so early. Volker (This used to be commit f9856f6490fe44fdba97ea86062237d8c74d4bdc)
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/local-groupmap.c43
1 files changed, 24 insertions, 19 deletions
diff --git a/source3/torture/local-groupmap.c b/source3/torture/local-groupmap.c
index bd6f060e71..e83cfece97 100644
--- a/source3/torture/local-groupmap.c
+++ b/source3/torture/local-groupmap.c
@@ -212,16 +212,18 @@ BOOL run_local_groupmap(int dummy)
string_to_sid(&sid, "S-1-5-32-545");
ZERO_STRUCT(map);
- if (!pdb_getgrsid(&map, &sid)) {
- d_fprintf(stderr, "(%s) pdb_getgrsid failed\n",
- __location__);
+ status = pdb_getgrsid(&map, &sid);
+ if (!NT_STATUS_IS_OK(status)) {
+ d_fprintf(stderr, "(%s) pdb_getgrsid failed: %s\n",
+ __location__, nt_errstr(status));
goto fail;
}
ZERO_STRUCT(map1);
- if (!pdb_getgrgid(&map1, map.gid)) {
- d_fprintf(stderr, "(%s) pdb_getgrgid failed\n",
- __location__);
+ status = pdb_getgrgid(&map1, map.gid);
+ if (!NT_STATUS_IS_OK(status)) {
+ d_fprintf(stderr, "(%s) pdb_getgrgid failed: %s\n",
+ __location__, nt_errstr(status));
goto fail;
}
@@ -232,9 +234,10 @@ BOOL run_local_groupmap(int dummy)
}
ZERO_STRUCT(map1);
- if (!pdb_getgrnam(&map1, map.nt_name)) {
- d_fprintf(stderr, "(%s) pdb_getgrnam failed\n",
- __location__);
+ status = pdb_getgrnam(&map1, map.nt_name);
+ if (!NT_STATUS_IS_OK(status)) {
+ d_fprintf(stderr, "(%s) pdb_getgrnam failed: %s\n",
+ __location__, nt_errstr(status));
goto fail;
}
@@ -252,9 +255,10 @@ BOOL run_local_groupmap(int dummy)
GROUP_MAP map, map1;
string_to_sid(&sid, "S-1-5-32-545");
- if (!pdb_getgrsid(&map, &sid)) {
- d_fprintf(stderr, "(%s) did not find S-1-5-32-545\n",
- __location__);
+ status = pdb_getgrsid(&map, &sid);
+ if (!NT_STATUS_IS_OK(status)) {
+ d_fprintf(stderr, "(%s) did not find S-1-5-32-545: "
+ "%s\n", __location__, nt_errstr(status));
goto fail;
}
@@ -267,19 +271,19 @@ BOOL run_local_groupmap(int dummy)
CHECK_STATUS(status, NT_STATUS_UNSUCCESSFUL);
#endif
- if (pdb_getgrsid(&map1, &sid)) {
+ if (NT_STATUS_IS_OK(pdb_getgrsid(&map1, &sid))) {
d_fprintf(stderr, "(%s) getgrsid found deleted "
"entry\n", __location__);
goto fail;
}
- if (pdb_getgrgid(&map1, map.gid)) {
+ if (NT_STATUS_IS_OK(pdb_getgrgid(&map1, map.gid))) {
d_fprintf(stderr, "(%s) getgrgid found deleted "
"entry\n", __location__);
goto fail;
}
- if (pdb_getgrnam(&map1, map.nt_name)) {
+ if (NT_STATUS_IS_OK(pdb_getgrnam(&map1, map.nt_name))) {
d_fprintf(stderr, "(%s) getgrnam found deleted "
"entry\n", __location__);
goto fail;
@@ -295,9 +299,10 @@ BOOL run_local_groupmap(int dummy)
GROUP_MAP map, map1;
string_to_sid(&sid, "S-1-5-32-544");
- if (!pdb_getgrsid(&map, &sid)) {
- d_fprintf(stderr, "(%s) did not find S-1-5-32-544\n",
- __location__);
+ status = pdb_getgrsid(&map, &sid);
+ if (!NT_STATUS_IS_OK(status)) {
+ d_fprintf(stderr, "(%s) did not find S-1-5-32-544: "
+ "%s\n", __location__, nt_errstr(status));
goto fail;
}
@@ -307,7 +312,7 @@ BOOL run_local_groupmap(int dummy)
status = pdb_update_group_mapping_entry(&map);
CHECK_STATUS(status, NT_STATUS_OK);
- if (pdb_getgrgid(&map1, oldgid)) {
+ if (NT_STATUS_IS_OK(pdb_getgrgid(&map1, oldgid))) {
d_fprintf(stderr, "(%s) getgrgid found outdated "
"entry\n", __location__);
goto fail;