i noticed a xgetent bug where it did not spew out the errors correctly.
sorry.

Signed-off-by: Abhishek Kulkarni <[EMAIL PROTECTED]>

Index: libxcpu/user.c
===================================================================
--- libxcpu/user.c      (revision 741)
+++ libxcpu/user.c      (working copy)
@@ -235,8 +235,8 @@
        int n, bufsize = 8192;
        Xkey *akey = NULL;
        Spuser *auser = NULL;
-        Spcfsys *fs;
-        Spcfid *fid;
+        Spcfsys *fs = NULL;
+        Spcfid *fid = NULL;
 
        if (adminkey) {
                akey = xauth_privkey_create(adminkey);
Index: libxcpu/group.c
===================================================================
--- libxcpu/group.c     (revision 741)
+++ libxcpu/group.c     (working copy)
@@ -121,8 +121,8 @@
        int n, bufsize = 8192;
        Xkey *akey = NULL;
        Spuser *auser = NULL;
-       Spcfsys *fs;
-       Spcfid *fid;
+       Spcfsys *fs = NULL;
+       Spcfid *fid = NULL;
        
        if (adminkey) {
                akey = xauth_privkey_create(adminkey);
Index: utils/xgetent.c
===================================================================
--- utils/xgetent.c     (revision 741)
+++ utils/xgetent.c     (working copy)
@@ -150,10 +150,13 @@
        if (!nds)
                goto error;
 
-       if (!strcmp("passwd", db))
-               xp_nodeset_iterate(nds, read_pwent, adminkey);
-       else
-               xp_nodeset_iterate(nds, read_grent, adminkey);
+       if (!strcmp("passwd", db)) {
+               if (xp_nodeset_iterate(nds, read_pwent, adminkey) > 0)
+                       xp_nodeerror_print(argv[0]);
+       } else {
+               if (xp_nodeset_iterate(nds, read_grent, adminkey) > 0)
+                       xp_nodeerror_print(argv[0]);                    
+       }
 
        return 0;
 error:


Reply via email to