- 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';
+ if(aconf->lifetime)
+ {
+ if(!propagated)
+ {
+ sendto_one_notice(source_p, ":Cannot remove global X-Line %s on specific servers", name);
+ return;
+ }
+ ptr = rb_dlinkFind(aconf, &prop_bans);
+ if(ptr == NULL)
+ return;
+ sendto_one_notice(source_p, ":X-Line for [%s] is removed", name);
+ sendto_realops_snomask(SNO_GENERAL, L_ALL,
+ "%s has removed the global X-Line for: [%s]",
+ get_oper_name(source_p), name);
+ ilog(L_KLINE, "UX %s %s", get_oper_name(source_p), name);
+ if(aconf->created < rb_current_time())
+ aconf->created = rb_current_time();
+ else
+ aconf->created++;
+ aconf->hold = aconf->created;
+ operhash_delete(aconf->info.oper);
+ aconf->info.oper = operhash_add(get_oper_name(source_p));
+ aconf->flags |= CONF_FLAGS_MYOPER | CONF_FLAGS_TEMPORARY;
+ sendto_server(NULL, NULL, CAP_BAN|CAP_TS6, NOCAPS,
+ ":%s BAN X * %s %lu %d %d * :*",
+ source_p->id, aconf->host,
+ (unsigned long)aconf->created,
+ 0,
+ (int)(aconf->lifetime - aconf->created));
+ remove_reject_mask(aconf->host, NULL);
+ deactivate_conf(aconf, ptr);
+ return;
+ }
+ else if(propagated && rb_dlink_list_length(&cluster_conf_list))
+ cluster_generic(source_p, "UNXLINE", SHARED_UNXLINE, CAP_CLUSTER, "%s", name);
+ if(!aconf->hold)
+ {
+ bandb_del(BANDB_XLINE, aconf->host, NULL);