~ubuntu-branches/ubuntu/trusty/gq/trusty

« back to all changes in this revision

Viewing changes to src/ldif.c

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2009-10-25 23:34:56 UTC
  • mfrom: (1.1.4 upstream) (3.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091025233456-i794n3yg2cff930j
Tags: 1.3.4-1
* QA upload.
  + Set maintainer to Debian QA Group <packages@qa.debian.org>.
* New upstream release. (Closes: #534705).
  + Does not segfault on amd64. (Closes: #444312).
  + Remove all existing patches and change patch system to quilt.
  + Replace dpatch build-dep with quilt.
* 01_desktop_file.diff - Remove encoding and bogus categories 
  from desktop file.
* Copy in config.{sub,guess} on configure, rm them on clean.
  + Add build-dep on autotools-dev.
* Make clean not ignore errors.
* Add copyright holders and version path to GPL (GPL-2).
* Update watch file to use SF redirector. (Closes: #449749).
* Bump debhelper build-dep and compat to 5.
* Bump Standards Version to 3.8.3.
  + Menu policy transition.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23
23
*/
24
24
 
25
 
/* $Id: ldif.c 955 2006-08-31 19:15:21Z herzi $ */
 
25
/* $Id$ */
26
26
 
27
27
#include <stdlib.h>
28
28
#include <string.h>  /* strlen */
33
33
#include <glib/gi18n.h>
34
34
 
35
35
#include <lber.h>
36
 
#include <ldap.h>
37
36
 
38
37
#ifdef HAVE_CONFIG_H
39
38
# include <config.h>
40
39
#endif /* HAVE_CONFIG_H */
 
40
 
41
41
#include "common.h"
42
 
#include "util.h"
 
42
#include "errorchain.h"
 
43
#include "gq-formfill.h" /* isInternalAttr() */
 
44
#include "gq-ldap.h"
 
45
#include "gq-server-dn.h"
 
46
#include "gq-utilities.h"
43
47
#include "ldif.h"
44
 
#include "formfill.h" /* isInternalAttr() */
45
 
#include "errorchain.h"
46
48
 
47
49
void prepend_ldif_header(GString *out, GList *to_export)
48
50
{
62
64
                      ctime(&stamp));  /* f*** ctime - stupid trailing \n */
63
65
 
64
66
     while(to_export) {
65
 
          struct dn_on_server *dos = to_export->data;
66
 
          if (dos->server != last) {
 
67
          GqServerDn* dos = to_export->data;
 
68
          GqServer  * server = gq_server_dn_get_server(dos);
 
69
          if (server != last) {
67
70
               if (dos->flags == LDAP_SCOPE_SUBTREE) {
68
71
                    g_string_sprintfa(tmp, "# subtree search on server: %s\n",
69
 
                                      dos->server->canon_name);
 
72
                                      server->canon_name);
70
73
               } else {
71
74
                    g_string_sprintfa(tmp, "#    base search on server: %s\n",
72
 
                                      dos->server->canon_name);
 
75
                                      server->canon_name);
73
76
               }
74
77
               g_string_sprintfa(tmp, "#                   binddn: %s\n",
75
 
                                 (dos->server->binddn && strlen(dos->server->binddn))? dos->server->binddn: "(anonymous)");
 
78
                                 (gq_server_get_bind_dn(server) && *gq_server_get_bind_dn(server)) ? gq_server_get_bind_dn(server) : "(anonymous)");
76
79
               g_string_sprintfa(tmp, "#          searching below: ");
77
80
 
78
 
               last = dos->server;
 
81
               last = server;
79
82
          } else {
80
83
               g_string_sprintfa(tmp, "#                           ");
81
84
          }
82
 
          g_string_sprintfa(tmp, "%s\n", dos->dn);
 
85
          g_string_sprintfa(tmp, "%s\n", gq_server_dn_get_dn(dos));
83
86
 
84
87
          to_export = to_export->next;
85
88
     }