Check-in [e7dc183669]
Overview
Comment:Updated to support disabling getpwnam()
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e7dc1836690f5ccadc2ef1d6180639241956d053
User & Date: rkeene on 2014-02-07 21:10:11
Other Links: manifest | tags
Context
2014-02-07
21:12
Normalized macro names check-in: 25c96dfee9 user: rkeene tags: trunk
21:10
Updated to support disabling getpwnam() check-in: e7dc183669 user: rkeene tags: trunk
21:06
Added install target check-in: 13b69230ce user: rkeene tags: trunk
Changes

Modified filed.c from [2c5e817142] to [27db71537c].

741
742
743
744
745
746
747



748
749
750








751





752
753
754
755

756
757
758
759
760
761
762
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761

762
763
764
765
766
767
768
769

770
771
772
773
774
775
776
777







+
+
+



+
+
+
+
+
+
+
+
-
+
+
+
+
+



-
+







	opt->val      = val;

	return;
}

/* Resolve a username to a UID */
static int filed_user_lookup(const char *user, uid_t *user_id) {
	char *next;
	uid_t user_id_check;
#ifndef NO_GETPWNAM
	struct passwd *ent;

	ent = getpwnam(user);
	if (ent != NULL) {
		*user_id = ent->pw_uid;

		return(0);
	}
#endif

	user_id_check = strtoull(user, &next, 10);
	if (ent == NULL) {
	if (next == NULL) {
		return(1);
	}

	if (next[0] != '\0') {
		return(1);
	}

	*user_id = ent->pw_uid;
	*user_id = user_id_check;

	return(0);
}

/* Run process */
int main(int argc, char **argv) {
	struct option options[8];