+/* $OpenLDAP$ */
+/*
+ * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
/*
* Copyright (c) 1993, 1994 Regents of the University of Michigan.
* All rights reserved.
#include <lber.h>
#include <ldap.h>
-#include <ldapconfig.h>
+
+#include "ldap_defaults.h"
#include "ud.h"
static char * bind_and_fetch(char *name);
if ((dn = bind_and_fetch(name)) == NULL)
return;
- printf("\n The group '%s' will be permanently removed from\n",
- name);
- printf(" the Directory. Are you absolutely sure that you want to\n" ); printf(" remove this entire group? ");
+ printf("\n The entry\n '%s'\n will be permanently removed from", dn);
+ printf(" the Directory.\n Are you absolutely sure that you want to" );
+ printf(" remove this entire group? ");
fflush(stdout);
fetch_buffer(tmp, sizeof(tmp), stdin);
if (!(tmp[0] == 'y' || tmp[0] == 'Y'))
int ld_errno = 0;
ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ld_errno);
if (ld_errno == LDAP_INSUFFICIENT_ACCESS)
- printf(" You do not own the group \"%s\".\n", name);
+ printf(" You do not own the entry\n\t\"%s\".\n", dn);
else
ldap_perror(ld, " ldap_delete_s");
printf(" Group not removed.\n");
}
ldap_uncache_entry(ld, dn);
if (verbose)
+ {
if (name == NULL)
printf(" The group has been removed.\n");
else
printf(" The group \"%s\" has been removed.\n", name);
+ }
Free(dn);
return;
}
char *cp;
if (strchr(s, '<') == NULL) {
for (cp = s; *cp != '@'; cp++)
- if (isspace(*cp))
+ if (isspace((unsigned char)*cp))
*cp = '.';
}
new_value = s;
/* lookup the groups belonging to this person */
sprintf(filter, "owner=%s", dn);
- Free(dn);
+ ldap_memfree(dn);
search_attrs[0] = "cn";
search_attrs[1] = NULL;
if ((rc = ldap_search_s(ld, UD_WHERE_ALL_GROUPS_LIVE, LDAP_SCOPE_SUBTREE,
/* lookup the groups belonging to this person */
sprintf(filter, "member=%s", dn);
- Free(dn);
+ ldap_memfree(dn);
search_attrs[0] = "cn";
search_attrs[1] = NULL;
ldap_msgfree(mp);