]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/idcache.c
Fix reporting jobs from state file + misc
[bacula/bacula] / bacula / src / lib / idcache.c
index 8343df5d0df033e7151bac2b98bd1d540a52529c..1c16780afc8ce977b92a32b4af52a77c135e63eb 100644 (file)
@@ -52,12 +52,17 @@ char *getuser(uid_t uid)
   pwent = getpwuid(uid);
   tail = (struct userid *)malloc(sizeof (struct userid));
   tail->id.u = uid;
+#ifndef HAVE_WIN32
   if (pwent == 0 || strcmp(pwent->pw_name, "????????") == 0) {
       sprintf(usernum_string, "%u", (uint32_t)uid);
       tail->name = bstrdup(usernum_string);
   } else {
       tail->name = bstrdup(pwent->pw_name);
   }
+#else
+      sprintf(usernum_string, "%u", (uint32_t)uid);
+      tail->name = bstrdup(usernum_string);
+#endif
 
   /* Add to the head of the list, so most recently used is first.  */
   tail->next = user_alist;
@@ -102,13 +107,17 @@ char *getgroup(gid_t gid)
   grent = getgrgid(gid);
   tail = (struct userid *)malloc(sizeof (struct userid));
   tail->id.g = gid;
+#ifndef HAVE_WIN32
   if (grent == 0 || strcmp(grent->gr_name, "????????") == 0) {
       sprintf (groupnum_string, "%u", (uint32_t)gid);
       tail->name = bstrdup(groupnum_string);
   } else {
       tail->name = bstrdup(grent->gr_name);
   }
-
+#else
+      sprintf (groupnum_string, "%u", (uint32_t)gid);
+      tail->name = bstrdup(groupnum_string);
+#endif
   /* Add to the head of the list, so most recently used is first.  */
   tail->next = group_alist;
   group_alist = tail;