fixed dynamic devnull class handling
authorpk910 <philipp@zoelle1.de>
Mon, 15 Jul 2013 19:41:30 +0000 (21:41 +0200)
committerpk910 <philipp@zoelle1.de>
Mon, 15 Jul 2013 19:51:41 +0000 (21:51 +0200)
src/mod-hostserv.c
src/opserv.c

index 0b05e0e770cf8b8aa37a981c276fb904a9eca8b0..24de72dc7ee471bcd15e5100b0e81a9e2d90416f 100644 (file)
@@ -1296,7 +1296,7 @@ struct devnull_class hostserv_get_user_priv(struct handle_info *hi) {
                     th.maxchan = devc->maxchan;
                 if(DEVNULL_HAS_PRIV(devc, MAXSENDQ) && (!DEVNULL_HAS_PRIV(&th, MAXSENDQ) || th.maxsendq < devc->maxsendq))
                     th.maxsendq = devc->maxsendq;
-                th.modes |= devc->maxsendq;
+                th.modes |= devc->modes;
                 if(!th.name)
                     th.name = devc->name;
             }
index dddf23bd11e53dc23df4634c6c42860256c53b54..ccede743d5fb9f1ff7b6677cfd83333ee3a48ba4 100644 (file)
@@ -4762,6 +4762,17 @@ struct devnull_class devnull_user_get_class(struct handle_info *hi) {
     struct devnull_class th;
     memset(&th, 0, sizeof(th));
     
+    if(devnull_check_priv_func) {
+        struct devnull_class ext_class = ((struct devnull_class (*)(struct handle_info *))devnull_check_priv_func)(hi);
+        th.modes |= ext_class.modes;
+        if(ext_class.name)
+            th.name = ext_class.name;
+        if(DEVNULL_HAS_PRIV(&th, CHANLIMIT))
+            th.maxchan = ext_class.maxchan;
+        if(DEVNULL_HAS_PRIV(&th, MAXSENDQ))
+            th.maxsendq = ext_class.maxsendq;
+    }
+    
     if(hi->devnull_id) {
         struct devnull_class *thp;
         if((thp = devnull_find_id(hi->devnull_id))) {