Lines 179-189
entry_generator_fgetpwent (Daemon *daemon,
Link Here
|
179 |
FILE *fp; |
179 |
FILE *fp; |
180 |
struct spwd *shadow_entry; |
180 |
struct spwd *shadow_entry; |
181 |
|
181 |
|
|
|
182 |
/* |
182 |
fp = fopen (PATH_SHADOW, "r"); |
183 |
fp = fopen (PATH_SHADOW, "r"); |
183 |
if (fp == NULL) { |
184 |
if (fp == NULL) { |
184 |
g_warning ("Unable to open %s: %s", PATH_SHADOW, g_strerror (errno)); |
185 |
g_warning ("Unable to open %s: %s", PATH_SHADOW, g_strerror (errno)); |
185 |
return NULL; |
186 |
return NULL; |
186 |
} |
187 |
} |
|
|
188 |
*/ |
187 |
|
189 |
|
188 |
shadow_users = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); |
190 |
shadow_users = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); |
189 |
|
191 |
|
Lines 192-198
entry_generator_fgetpwent (Daemon *daemon,
Link Here
|
192 |
|
194 |
|
193 |
shadow_entry_buffers = g_malloc0 (sizeof (*shadow_entry_buffers)); |
195 |
shadow_entry_buffers = g_malloc0 (sizeof (*shadow_entry_buffers)); |
194 |
|
196 |
|
195 |
ret = fgetspent_r (fp, &shadow_entry_buffers->spbuf, shadow_entry_buffers->buf, sizeof (shadow_entry_buffers->buf), &shadow_entry); |
197 |
ret = getspent_r (&shadow_entry_buffers->spbuf, shadow_entry_buffers->buf, sizeof (shadow_entry_buffers->buf), &shadow_entry); |
196 |
if (ret == 0) { |
198 |
if (ret == 0) { |
197 |
g_hash_table_insert (shadow_users, g_strdup (shadow_entry->sp_namp), shadow_entry_buffers); |
199 |
g_hash_table_insert (shadow_users, g_strdup (shadow_entry->sp_namp), shadow_entry_buffers); |
198 |
} else { |
200 |
} else { |
Lines 204-210
entry_generator_fgetpwent (Daemon *daemon,
Link Here
|
204 |
} |
206 |
} |
205 |
} while (shadow_entry != NULL); |
207 |
} while (shadow_entry != NULL); |
206 |
|
208 |
|
207 |
fclose (fp); |
209 |
//fclose (fp); |
208 |
|
210 |
|
209 |
if (g_hash_table_size (shadow_users) == 0) { |
211 |
if (g_hash_table_size (shadow_users) == 0) { |
210 |
g_clear_pointer (&shadow_users, g_hash_table_unref); |
212 |
g_clear_pointer (&shadow_users, g_hash_table_unref); |
211 |
- |
|
|