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    741   	opt->val      = val;
   742    742   
   743    743   	return;
   744    744   }
   745    745   
   746    746   /* Resolve a username to a UID */
   747    747   static int filed_user_lookup(const char *user, uid_t *user_id) {
          748  +	char *next;
          749  +	uid_t user_id_check;
          750  +#ifndef NO_GETPWNAM
   748    751   	struct passwd *ent;
   749    752   
   750    753   	ent = getpwnam(user);
   751         -	if (ent == NULL) {
          754  +	if (ent != NULL) {
          755  +		*user_id = ent->pw_uid;
          756  +
          757  +		return(0);
          758  +	}
          759  +#endif
          760  +
          761  +	user_id_check = strtoull(user, &next, 10);
          762  +	if (next == NULL) {
          763  +		return(1);
          764  +	}
          765  +
          766  +	if (next[0] != '\0') {
   752    767   		return(1);
   753    768   	}
   754    769   
   755         -	*user_id = ent->pw_uid;
          770  +	*user_id = user_id_check;
   756    771   
   757    772   	return(0);
   758    773   }
   759    774   
   760    775   /* Run process */
   761    776   int main(int argc, char **argv) {
   762    777   	struct option options[8];