View Issue Details

IDProjectCategoryView StatusLast Update
0002172unrealircdpublic2011-12-25 14:02
ReporterStealth Assigned Tosyzop  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.2.2 
Fixed in Version3.2.8 
Summary0002172: Admin block behavior
DescriptionIf you have an admin block, and forget a semicolon on a line, Unreal will proceed to use the block with no error, but the information will be incorrect/incomplete.

It will use the line with the missing semicolon, but will not use the following line.

See Additional Information for example
Additional InformationBlock:

admin {
        "Location: Some Location, USA.";
        "Stealth Owner admin@***.org";
        "Jen NetAdmin jen@***.org"
        "Sephiroth Admin todd@***.org";
};

Will put out:

Administrative info about irc.***.net
Location: Some Location, USA.
Stealth Owner admin@***.org
Jen NetAdmin jen@***.org
TagsNo tags attached.
Attached Files
s_conf.patch.txt (1,141 bytes)
3rd party modules

Activities

codemastr

2004-11-12 15:00

reporter   ~0008280

Hmm, that's an interesting one. I'll need to think about how that can be solved. The reason it does that is because of the way the parser works. The parser separates things into name value pairs. Meaning password "mypassword" is name = password value = mypassword. So when you do: "abc" "def" it sees that as name = abc value = def. In essence, it said, name = "Jen NetAdmin jen@***.org" value = "Sephiroth Admin todd@***.org" and since Unreal is only looking at the names, the value is ignored. The same would likely happen for anything that uses flags, say oper::flags.

Solving this, however, is actually going to be pretty difficult. I suppose the easiest solution would be to require the name and the value to be on the same line...

Stealth

2004-11-12 17:14

reporter   ~0008283

Last edited: 2004-11-12 17:16

An idea would be to have prople number the lines, like so:

admin {
  1 "Line 1";
  2 "line 2";
};

This may complicate things for people, but its a thought.

<edit>
Or perhaps make Unreal put out all names and values to the person issuing the /admin.
</edit>

codemastr

2004-11-12 17:21

reporter   ~0008284

That solves the problem for this one thing, not for everything. E.g.,

flags {
admin
netadmin;
};

That would exhibit the same problem, and 1..N doesn't make sense for flags.

syzop

2004-11-13 10:08

administrator   ~0008289

I don't see the problem... you forget an ';' and then you blame Unreal? :p
But anyway, I guess you (codemastr) want to make it more simple for users by removing this 'feature'?

More on-topic, in this specific case, adding a warning for such a wrong admin { } block isn't too hard:
--- ../cvs/Unreal3.2/src/s_conf.c 2004-11-09 21:56:02.000000000 +0100
+++ src/s_conf.c 2004-11-13 15:58:35.000000000 +0100
@@ -2902,6 +2902,14 @@
                        errors++;
                        continue;
                }
+ if (cep->ce_vardata)
+ {
+ config_error("%s:%i: Wrong syntax or possibly missing ';' somewhere",
+ cep->ce_fileptr->cf_filename,
+ cep->ce_varlinenum);
+ errors++;
+ continue;
+ }
        }
        requiredstuff.conf_admin = 1;
        return errors;
[or even a nice {#define} function for it ;p]

codemastr

2004-11-13 12:13

reporter   ~0008297

Well yeah, that works, but it's kind of messy because the ; checking is actually done in the initial parsing. So it might confuse users.

aquanight

2004-11-14 17:25

reporter   ~0008325

I would think after parsing the admin / flags block, if a field has a non-empty value string, trigger a config error (which looks to be what syzop suggested :p ). That would seem to be the simplest solution. :-)

fez

2004-11-16 19:39

reporter   ~0008352

Last edited: 2004-11-16 19:41

also note:
you're missing a ; after the 3rd line in admin { }

 -- fez / Eric

edit: syzop already caught that

stskeeps

2007-04-27 05:21

reporter   ~0013815

Bump. Still an issue?

vonitsanet

2007-04-27 05:33

reporter   ~0013822

Tested on: ReleaseID (1.1.1.1.2.1.2.1.2.2234.2.626 2007/01/22

Still an issue. I've seen no warnings and a line from admin block was missing.

WolfSage

2007-06-09 21:02

reporter   ~0014294

The included patch takes care of this by doing the following:

If (inside of a {..} block) there are quoted lines ending without semi-colons, it will treat them as if semi-colons are there, and alert the user that the semi-colon is missing so they can fix it.

This fixes missing semicolons in admin{} blocks, and helped me discover about 5 errors in help.conf which was causing data not to be displayed.

I think this should be committed, but I figured some of you might want to look over it first and make sure it's fine.

stskeeps

2007-06-11 16:29

reporter   ~0014330

Fixed in .2435

syzop

2011-07-19 17:52

administrator   ~0016711

did not check the patch, but if this looks proper, then re-apply this patch in 3.3 :)

syzop

2011-12-25 14:02

administrator   ~0016829

Already fixed in 3.2.8
- 0002172 reported by Stealth, patched by WolfSage, fixing if you have an
  admin block, and forget a semicolon on a line, Unreal will proceed to use
  the block with no error, but the information will be incorrect/incomplete.
  [Backport, WolfSage]

Issue History

Date Modified Username Field Change
2004-11-12 00:54 Stealth New Issue
2004-11-12 15:00 codemastr Note Added: 0008280
2004-11-12 17:14 Stealth Note Added: 0008283
2004-11-12 17:16 Stealth Note Edited: 0008283
2004-11-12 17:21 codemastr Note Added: 0008284
2004-11-13 10:08 syzop Note Added: 0008289
2004-11-13 12:13 codemastr Note Added: 0008297
2004-11-14 17:25 aquanight Note Added: 0008325
2004-11-16 19:39 fez Note Added: 0008352
2004-11-16 19:41 fez Note Edited: 0008352
2007-04-27 05:21 stskeeps Note Added: 0013815
2007-04-27 05:21 stskeeps Status new => feedback
2007-04-27 05:33 vonitsanet Note Added: 0013822
2007-04-27 06:34 stskeeps Status feedback => acknowledged
2007-06-09 20:57 WolfSage File Added: s_conf.patch.txt
2007-06-09 21:02 WolfSage Note Added: 0014294
2007-06-09 21:11 WolfSage Status acknowledged => feedback
2007-06-11 16:29 stskeeps Status feedback => resolved
2007-06-11 16:29 stskeeps Fixed in Version => 3.3-alpha0
2007-06-11 16:29 stskeeps Resolution open => fixed
2007-06-11 16:29 stskeeps Assigned To => stskeeps
2007-06-11 16:29 stskeeps Note Added: 0014330
2011-07-19 17:52 syzop Note Added: 0016711
2011-07-19 17:52 syzop Assigned To stskeeps =>
2011-07-19 17:52 syzop Status resolved => has patch
2011-12-25 14:02 syzop Note Added: 0016829
2011-12-25 14:02 syzop Status has patch => resolved
2011-12-25 14:02 syzop Fixed in Version 3.3-alpha0 => 3.2.8
2011-12-25 14:02 syzop Assigned To => syzop