- Timestamp:
- Sep 30, 2006, 5:24:00 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/common/oursrc/sqladm/signup-sql.c
r3 r4 45 45 env[i] = NULL; 46 46 47 char uid[21]; // 64-bit uid requires 21 48 char gid[21]; // 64-bit gid requires 21 49 int retval = snprintf(uid, 21, "%d", getuid()); 47 char uid_str[21]; // 64-bit uid requires 21 48 char gid_str[21]; // 64-bit gid requires 21 49 int uid_num = getuid(); 50 int retval = snprintf(uid_str, 21, "%d", uid_num); 50 51 if(retval < 0 || retval >= 21) { 51 52 exit(1); 52 53 } 53 retval = snprintf(gid , 21, "%d", getgid());54 retval = snprintf(gid_str, 21, "%d", getgid()); 54 55 if(retval < 0 || retval >= 21) { 55 56 exit(1); 56 57 } 57 58 char *v[5];59 #define SIGNUP_PATH "/afs/athena.mit.edu/contrib/sql/web_scripts/main/batch/signup.php"60 v[0] = SIGNUP_PATH;61 v[1] = getpwuid(getuid())->pw_name;62 v[2] = uid;63 v[3] = gid;64 v[4] = NULL;65 58 66 59 if(setregid(SQL_GID, SQL_GID) != 0) { … … 71 64 } 72 65 73 execle(SIGNUP_PATH, v, env); 66 #define SIGNUP_PATH "/afs/athena.mit.edu/contrib/sql/web_scripts/main/batch/signup.php" 67 execle(SIGNUP_PATH, SIGNUP_PATH, getpwuid(uid_num)->pw_name, uid_str, gid_str, NULL, env); 74 68 return 1; 75 69 }
Note: See TracChangeset
for help on using the changeset viewer.