[17410] in Athena Bugs

home help back first fref pref prev next nref lref last post

bug in dsc_get_access()

daemon@ATHENA.MIT.EDU (Nickolai Zeldovich)
Fri Dec 3 20:38:54 1999

Message-Id: <199912040138.UAA19786@hal-2000.mit.edu>
To: bugs@MIT.EDU, bug-discuss@MIT.EDU
cc: kolya@MIT.EDU
Date: Fri, 03 Dec 1999 20:38:37 -0500
From: Nickolai Zeldovich <kolya@MIT.EDU>

It seems that if one passes a non-existent meeting to dsc_get_access(),
the request mysteriously fails with 'Connection reset by peer', and any
subsequent discuss requests to the same host fails with the same error
message. I think it would be more reasonable for dsc_get_access() to
return an error code indicating that the meeting does not exist, and
more importantly, avoid making subsequent requests break.

Attached is a program which fails in this way: it tries dsc_get_access()
on a nonexistant meeting, and then tries to dsc_get_mtg_info() on another
meeting on the same server (it will fail the same way on the original mtg
as well). Requests for meetings on other servers appear to be unaffected.
The program otherwise works just fine (if you specify a valid meeting
for the dsc_get_access() call).

[ Of course a workaround would be to check for the meeting's existence in
  some other way before dsc_get_access(), but this still looks like a bug ]

FWIW, this is on a sparc 5 running athena 8.3.23.

-- Nickolai Zeldovich.


#include <stdlib.h>
#include <discuss/interface.h>
#include <discuss/dsname.h>

main(){
  name_blk meetings;
  mtg_info meeting_info;
  int res;
  char *modes, *user;

  meetings.hostname = "charon2.mit.edu";
  meetings.pathname = "/usr/spool/discuss/test2";
  meetings.user_id = "";
  meetings.aliases = NULL;
  meetings.status = 0;
  meetings.date_attended = 0;
  meetings.last = 0;

  user = "*";

  initialize_dsc_error_table();

  dsc_get_access(&meetings, user, &modes, &res);

  printf("dsc_get_access() return code = %d: %s\n", res, error_message(res));
  if(!res) printf("modes bits: %s\n", modes);

  meetings.pathname = "/usr/spool/discuss/test";

  dsc_get_mtg_info(&meetings, &meeting_info, &res);

  printf("dsc_get_mtg_info() return code = %d: %s\n", res, error_message(res));
  if(!res) printf("Full meeting name: %s\n", meeting_info.long_name);
}


home help back first fref pref prev next nref lref last post