users
This commit is contained in:
2 files changed
+17
No files matched your search
+12
@@ -0,0 +1,12 @@
|
||||
#include "users.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <pwd.h>
|
||||
|
||||
void list_users(FILE *output) {
|
||||
struct passwd *pw;
|
||||
while ((pw = getpwent()) != NULL) {
|
||||
fprintf(output, "%s: %s\n", pw->pw_name, pw->pw_dir);
|
||||
}
|
||||
endpwent();
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
#ifndef USERS_H
|
||||
#define USERS_H
|
||||
#include <stdio.h>
|
||||
void list_users(FILE *output);
|
||||
#endif
|
||||
Reference in new issue
Block a user