tmdns patches

Bastien Nocera <[email protected]> Mon, 03 May 2004 15:41:33 +0100
Newsgroups gmane.network.zeroconf.workers
Message-ID <[email protected]>
--=-72q9sjg8UwttmcO8uQQU
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Heya,

I tried out the latest tmdns. Attached is a couple of patches for it.

- If in debug mode, print an error on the console rather than exiting
directly if the PID file can't be opened (this needs to be done in more
places).
- Don't just exit if the init script is launched without the user being
root. Otherwise normal users can't check the status of the daemon, and
the daemon itself should error out if it can't write a file for a reason
or another.

I tried tmdns on my home network, and it works pretty well, but trying
it at work doesn't get me very far. In debug mode I'm getting a lot of:
[ 28522 ]: answer to client :
;; ns_initparse: Message too long

Is that the bug mentioned in the TODO (the large DNS requests)? Or is it
another problem. I don't know bugger all about the DNS protocol, but if
someone points me to the parts of the code that would need tweaking to
get those packet sizes down, I'm willing to give it a try.

(Also, if somebody gets me CVS access, I could do some spring
cleaning ;)

Cheers

---
Bastien Nocera <[email protected]> 
The ballerina rose gracefully en pointe and extended one slender leg
behind her, like a dog at a lamppost. 

--=-72q9sjg8UwttmcO8uQQU
Content-Disposition: attachment; filename=tmdns-misc-fixes.patch
Content-Type: text/x-patch; name=tmdns-misc-fixes.patch; charset=UTF-8
Content-Transfer-Encoding: 7bit

Index: init.d/init.REDHAT
===================================================================
RCS file: /cvsroot/zeroconf/tmdns/init.d/init.REDHAT,v
retrieving revision 1.4
diff -u -r1.4 init.REDHAT
--- init.d/init.REDHAT	16 Feb 2004 01:33:07 -0000	1.4
+++ init.d/init.REDHAT	3 May 2004 13:39:44 -0000
@@ -21,10 +21,7 @@
                                                                                 
 # More config
 test -f /etc/sysconfig/tmdns && . /etc/sysconfig/tmdns
-                                                                                
-# Check that we are root ... so non-root users stop here
-[ `id -u` = 0 ] || exit 1
-                                                                                
+
 # Check that networking is up.
 [ "${NETWORKING}" = "yes" ] || exit 0
                                                                                 
Index: server/tmdns.c
===================================================================
RCS file: /cvsroot/zeroconf/tmdns/server/tmdns.c,v
retrieving revision 1.31
diff -u -r1.31 tmdns.c
--- server/tmdns.c	3 May 2004 05:16:53 -0000	1.31
+++ server/tmdns.c	3 May 2004 13:39:44 -0000
@@ -310,6 +310,10 @@
         pidfp = fdopen( pidfd , "w" );
     
     if (pidfp == NULL) {
+	if( !config.daemon_mode ) {
+	    fprintf(stderr, "can not open pid file %s : %s\n",
+			    config.pid_file , debug_errmsg(errno) );
+	}
 	syslog(LOG_ERR,"can't open pid file %s : %s\n",
 		config.pid_file , debug_errmsg(errno) );
 	debug("can not open pid file %s : %s\n",

--=-72q9sjg8UwttmcO8uQQU--



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click