- sendto_one_notice(source_p,
- ":X-Line for [%s] is removed",
- name);
- sendto_realops_snomask(SNO_GENERAL, L_ALL,
- "%s has removed the temporary X-Line for: [%s]",
- get_oper_name(source_p), name);
- ilog(L_KLINE, "UX %s %s",
- get_oper_name(source_p), name);
-
- free_conf(aconf);
- dlinkDestroy(ptr, &xline_conf_list);
- return 1;
- }
- }
-
- return 0;
-}
-
-/* remove_xline()
- *
- * inputs - gecos to remove
- * outputs -
- * side effects - removes xline from conf, if exists
- */
-static void
-remove_xline(struct Client *source_p, const char *huntgecos)
-{
- FILE *in, *out;
- char buf[BUFSIZE];
- char buff[BUFSIZE];
- char temppath[BUFSIZE];
- const char *filename;
- const char *gecos;
- mode_t oldumask;
- char *p;
- int error_on_write = 0;
- int found_xline = 0;
-
- filename = ConfigFileEntry.xlinefile;
- ircsnprintf(temppath, sizeof(temppath),
- "%s.tmp", ConfigFileEntry.xlinefile);
-
- if((in = fopen(filename, "r")) == NULL)
- {
- sendto_one_notice(source_p, ":Cannot open %s", filename);
- return;
- }
-
- oldumask = umask(0);
-
- if((out = fopen(temppath, "w")) == NULL)
- {
- sendto_one_notice(source_p, ":Cannot open %s", temppath);
- fclose(in);
- umask(oldumask);
- return;
- }
-
- umask(oldumask);
-
- while (fgets(buf, sizeof(buf), in))
- {
- if(error_on_write)
- {
- if(temppath != NULL)
- (void) unlink(temppath);
-
- break;
- }
-
- strlcpy(buff, buf, sizeof(buff));
-
- if((p = strchr(buff, '\n')) != NULL)
- *p = '\0';