| 40 |
|
#endif |
| 41 |
|
|
| 42 |
|
#if defined(LINUX) || defined(SOLARIS) |
| 43 |
+ |
setutent(); |
| 44 |
|
while((entry=getutent()) != NULL) { |
| 45 |
|
if(entry->ut_type==USER_PROCESS) { |
| 46 |
|
user_tmp=user_list; |
| 53 |
|
nousers++; |
| 54 |
|
} |
| 55 |
|
} |
| 56 |
+ |
endutent(); |
| 57 |
|
#endif |
| 58 |
|
|
| 59 |
|
#ifdef FREEBSD |
| 73 |
|
if(user_tmp!=NULL) free(user_tmp); |
| 74 |
|
nousers++; |
| 75 |
|
} |
| 76 |
+ |
|
| 77 |
+ |
if ((fclose(f)) != 0) { |
| 78 |
+ |
errf("Failed to close file (%m)"); |
| 79 |
+ |
return NULL; |
| 80 |
+ |
} |
| 81 |
+ |
|
| 82 |
|
#endif |
| 83 |
|
if (user_list==NULL) user_list=strdup(""); |
| 84 |
|
xml_user_data=strf("<users><list>%s</list><count>%d</count></users>",user_list,nousers); |