Changeset 987 for TI05-delivery
- Timestamp:
- 23/05/06 16:25:39 (15 years ago)
- Location:
- TI05-delivery/trunk/src/bbftp-server-3.2.0
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/bbftpd_cd.c
r983 r987 96 96 97 97 #ifdef NDG_AUTH 98 if (bbftpd_private_authz(MSG_CHDIR_V2, (void *)msg_dir, logmessage) != 0) { 98 if (bbftpd_private_authz_control(MSG_CHDIR_V2, msg_dir->transferoption, msg_dir->dirname, 99 logmessage) != 0) { 99 100 syslog(BBFTPD_ERR, logmessage); 100 101 reply(MSG_BAD, logmessage); -
TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/bbftpd_mkdir.c
r983 r987 86 86 msg_dir = (struct mess_dir *) buffer ; 87 87 #ifdef NDG_AUTH 88 if (bbftpd_private_authz(MSG_MKDIR_V2, (void *)msg_dir, logmessage) != 0) { 88 if (bbftpd_private_authz_control(MSG_MKDIR_V2, msg_dir->transferoption, msg_dir->dirname, 89 logmessage) != 0) { 89 90 syslog(BBFTPD_ERR, logmessage); 90 91 reply(MSG_BAD, logmessage); -
TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/bbftpd_private_user.c
r983 r987 162 162 163 163 /* 164 ** bbftpd_private_authz : 165 ** 166 ** Routine to authorise individual bbftp commands. The function must return 167 ** OK for the command to proceed. 164 ** bbftpd_private_authz_control : 165 ** 166 ** Routine to authorise bbftp control commands. 168 167 ** 169 168 ** INPUT variables: 170 169 ** msgcode : The message code from struct message 171 ** msgstruct : A pointer to a bbftpd structure dependent on the message type (see below) 170 ** transferoptions : TROPT_* options 171 ** path : path to apply command to 172 172 ** 173 173 ** OUTPUT variables: … … 178 178 ** 0 OK 179 179 ** 180 ** msgstruct should be cast to the appropriate structure from structures.h181 ** acording to msgcode:182 **183 ** MSG_CHDIR_V2 : struct mess_dir184 ** MSG_CHUMASK : struct mess_int185 ** MSG_MKLIST_V2 : struct mess_dir186 ** MSG_MKDIR_V2 : struct mess_dir187 ** MSG_RM : struct mess_dir188 ** MSG_STAT : struct mess_dir189 ** MSG_DF : struct mess_dir190 ** MSG_RETR_V2 : struct mess_store_v2191 ** MSG_STORE_V2 : struct mess_store_v2192 180 ** 193 181 */ 194 int bbftpd_private_authz(int msgcode, void *msgstruct, char *logmessage) 195 { 196 197 // For test purposes just log the authorisation request 198 syslog(LOG_INFO, "Authorisation request: %d", msgcode); 182 int bbftpd_private_authz_control(int msgcode, int transferoption, char *path, char *logmessage) 183 { 184 185 switch (msgcode) { 186 case MSG_CHDIR_V2: 187 syslog(LOG_INFO, "Authz: MSG_DIR 0x%x %s", transferoption, path); 188 break; 189 case MSG_LIST_V2: 190 syslog(LOG_INFO, "Authz: MSG_LIST_V2 0x%x %s", transferoption, path); 191 break; 192 case MSG_MKDIR_V2: 193 syslog(LOG_INFO, "Authz: MSG_MKDIR_V2 0x%x %s", transferoption, path); 194 break; 195 case MSG_RM: 196 syslog(LOG_INFO, "Authz: MSG_RM 0x%x %s", transferoption, path); 197 break; 198 case MSG_STAT: 199 syslog(LOG_INFO, "Authz: MSG_STAT 0x%x %s", transferoption, path); 200 break; 201 case MSG_DF: 202 syslog(LOG_INFO, "Authz: MSG_DF 0x%x %s", transferoption, path); 203 break; 204 default: 205 sprintf(logmessage, "Unrecognised message to authorise %d", msgcode); 206 return -1; 207 } 208 199 209 return 0; 200 201 210 } 202 211 -
TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/bbftpd_readcontrol.c
r983 r987 177 177 } 178 178 msg_integer = (struct mess_integer *) receive_buffer ; 179 #ifdef NDG_AUTH180 if (bbftpd_private_authz(msgcode, (void *)msg_integer, logmessage) != 0) {181 syslog(BBFTPD_ERR, logmessage);182 reply(MSG_BAD, logmessage);183 FREE(receive_buffer);184 return 0;185 }186 #endif // NDG_AUTH187 188 179 #ifndef WORDS_BIGENDIAN 189 180 myumask = ntohl(msg_integer->myint) ; … … 234 225 msg_dir = (struct mess_dir *) receive_buffer ; 235 226 #ifdef NDG_AUTH 236 if (bbftpd_private_authz(msgcode, (void *)msg_dir, logmessage) != 0) { 227 if (bbftpd_private_authz_control(msgcode, msg_dir->transferoption, msg_dir->dirname, 228 logmessage) != 0) { 237 229 syslog(BBFTPD_ERR, logmessage); 238 230 reply(MSG_BAD, logmessage); … … 284 276 } 285 277 msg_store_v2 = (struct mess_store_v2 *) receive_buffer ; 286 #ifdef NDG_AUTH287 if (bbftpd_private_authz(msgcode, (void *)msg_store_v2, logmessage) != 0) {288 syslog(BBFTPD_ERR, logmessage);289 reply(MSG_BAD, logmessage);290 FREE(receive_buffer);291 return 0;292 }293 #endif // NDG_AUTH294 278 295 279 /* … … 332 316 } 333 317 msg_store_v2 = (struct mess_store_v2 *) receive_buffer ; 334 #ifdef NDG_AUTH335 if (bbftpd_private_authz(msgcode, (void *)msg_store_v2, logmessage) != 0) {336 syslog(BBFTPD_ERR, logmessage);337 reply(MSG_BAD, logmessage);338 FREE(receive_buffer);339 return 0;340 }341 #endif // NDG_AUTH342 318 343 319 /* -
TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/bbftpd_rm.c
r983 r987 80 80 msg_file = (struct mess_dir *) buffer ; 81 81 #ifdef NDG_AUTH 82 if (bbftpd_private_authz(MSG_RM, (void *)msg_file, logmessage) != 0) { 82 if (bbftpd_private_authz_control(MSG_RM, msg_file->transferoption, msg_file->dirname, 83 logmessage) != 0) { 83 84 syslog(BBFTPD_ERR, logmessage); 84 85 reply(MSG_BAD, logmessage); -
TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/bbftpd_stat.c
r983 r987 104 104 msg_file = (struct mess_dir *) buffer ; 105 105 #ifdef NDG_AUTH 106 if (bbftpd_private_authz(MSG_STAT, (void *)msg_file, logmessage) != 0) { 106 if (bbftpd_private_authz_control(MSG_STAT, msg_file->transferoption, msg_file->dirname, 107 logmessage) != 0) { 107 108 syslog(BBFTPD_ERR, logmessage); 108 109 reply(MSG_BAD, logmessage); -
TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/bbftpd_statfs.c
r983 r987 107 107 msg_file = (struct mess_dir *) buffer ; 108 108 #ifdef NDG_AUTH 109 if (bbftpd_private_authz(MSG_DF, (void *)msg_file, logmessage) != 0) { 109 if (bbftpd_private_authz_control(MSG_DF, msg_file->transferoption, msg_file->dirname, 110 logmessage) != 0) { 110 111 syslog(BBFTPD_ERR, logmessage); 111 112 reply(MSG_BAD, logmessage); -
TI05-delivery/trunk/src/bbftp-server-3.2.0/includes/daemon_proto.h
r983 r987 76 76 void bbftpd_private_finalise(void); 77 77 void bbftpd_private_auth_finalise(void); 78 int bbftpd_private_authz (int msgcode, void *msgstruct, char *logmessage);78 int bbftpd_private_authz_control(int msgcode, int transferoption, char *path, char *logmessage); 79 79 #endif // NDG_AUTH 80 80 /*
Note: See TracChangeset
for help on using the changeset viewer.