From: <ta...@us...> - 2010-01-31 12:30:47
|
Revision: 4336 http://gfarm.svn.sourceforge.net/gfarm/?rev=4336&view=rev Author: tatebe Date: 2010-01-31 12:25:53 +0000 (Sun, 31 Jan 2010) Log Message: ----------- use local_user_map to identify local users. but this should be re-visitted to support multiple gfmds. Modified Paths: -------------- gfarm2fs/trunk/gfarm2fs.c Modified: gfarm2fs/trunk/gfarm2fs.c =================================================================== --- gfarm2fs/trunk/gfarm2fs.c 2010-01-28 13:46:12 UTC (rev 4335) +++ gfarm2fs/trunk/gfarm2fs.c 2010-01-31 12:25:53 UTC (rev 4336) @@ -53,15 +53,23 @@ get_uid(char *user) { struct passwd *pwd; + char *luser; if (strcmp(gfarm_get_global_username(), user) == 0) return getuid(); /* my own file */ - /* assumes that the same username exists on the local system */ - if ((pwd = getpwnam(user)) != NULL) - return pwd->pw_uid; - - /* XXX FIXME - some other's file */ + /* + * XXX - this interface will be changed soon to support + * multiple gfmds. + */ + if (gfarm_global_to_local_username(user, &luser) + == GFARM_ERR_NO_ERROR) { + pwd = getpwnam(luser); + free(luser); + if (pwd != NULL) + return pwd->pw_uid; + } + /* cannot conver to a local account */ return (0); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |