Changeset 983
- Timestamp:
- 23/05/06 15:09: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
r773 r983 94 94 transferoption = msg_dir->transferoption ; 95 95 dirname = msg_dir->dirname ; 96 97 #ifdef NDG_AUTH 98 if (bbftpd_private_authz(MSG_CHDIR_V2, (void *)msg_dir, logmessage) != 0) { 99 syslog(BBFTPD_ERR, logmessage); 100 reply(MSG_BAD, logmessage); 101 FREE(logmessage); 102 FREE(buffer); 103 return 0; 104 } 105 #endif // NDG_AUTH 96 106 97 107 if ( (transferoption & TROPT_RFIO) == TROPT_RFIO ) { -
TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/bbftpd_mkdir.c
r773 r983 85 85 buffer[msglen] = '\0' ; 86 86 msg_dir = (struct mess_dir *) buffer ; 87 #ifdef NDG_AUTH 88 if (bbftpd_private_authz(MSG_MKDIR_V2, (void *)msg_dir, logmessage) != 0) { 89 syslog(BBFTPD_ERR, logmessage); 90 reply(MSG_BAD, logmessage); 91 FREE(buffer); 92 FREE(logmessage); 93 return 0; 94 } 95 #endif // NDG_AUTH 96 87 97 transferoption = msg_dir->transferoption ; 88 98 dirname = msg_dir->dirname ; -
TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/bbftpd_private_user.c
r981 r983 18 18 * along with this program; if not, write to the Free Software 19 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 */ 20 */ 21 21 22 22 /**************************************************************************** 23 23 24 25 24 25 26 26 bbftpd_private_user.c v 2.1.0 2001/05/21 - Routines creation 27 27 … … 76 76 ** error with logmessage filled * 77 77 ** It is the duty of the programmer to take care that the buffer is large * 78 ** enought * 78 ** enought * 79 79 ** * 80 80 ** * … … 91 91 *******************************************************************************/ 92 92 93 int bbftpd_private_auth(char *logmessage) 94 { 93 int bbftpd_private_auth(char *logmessage) 94 { 95 95 char msg[NDG_MESSAGE_LEN]; 96 96 /* Send version verification message. */ … … 102 102 } 103 103 104 return 0 ; 104 return 0 ; 105 105 } 106 106 … … 133 133 * bbftpd_private_finalise : 134 134 * 135 * Routine to clean up the private authentication infrastructure when the 136 * daemon exits. This function is the counterpart of bbftpd_private_init and 137 * will be called from the daemon process during exit. NOTE: it will not 135 * Routine to clean up the private authentication infrastructure when the 136 * daemon exits. This function is the counterpart of bbftpd_private_init and 137 * will be called from the daemon process during exit. NOTE: it will not 138 138 * be aware of any actions of child processes. 139 139 * … … 161 161 } 162 162 163 /* 164 ** bbftpd_private_authz : 165 ** 166 ** Routine to authorise individual bbftp commands. The function must return 167 ** OK for the command to proceed. 168 ** 169 ** INPUT variables: 170 ** msgcode : The message code from struct message 171 ** msgstruct : A pointer to a bbftpd structure dependent on the message type (see below) 172 ** 173 ** OUTPUT variables: 174 ** logmessage : to write the error message in case of failure 175 ** 176 ** RETURN: 177 ** -1 Authorisation failed 178 ** 0 OK 179 ** 180 ** msgstruct should be cast to the appropriate structure from structures.h 181 ** acording to msgcode: 182 ** 183 ** MSG_CHDIR_V2 : struct mess_dir 184 ** MSG_CHUMASK : struct mess_int 185 ** MSG_MKLIST_V2 : struct mess_dir 186 ** MSG_MKDIR_V2 : struct mess_dir 187 ** MSG_RM : struct mess_dir 188 ** MSG_STAT : struct mess_dir 189 ** MSG_DF : struct mess_dir 190 ** MSG_RETR_V2 : struct mess_store_v2 191 ** MSG_STORE_V2 : struct mess_store_v2 192 ** 193 */ 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); 199 return 0; 200 201 } 202 203 163 204 #endif // NDG_AUTH -
TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/bbftpd_readcontrol.c
r773 r983 177 177 } 178 178 msg_integer = (struct mess_integer *) receive_buffer ; 179 #ifdef NDG_AUTH 180 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_AUTH 187 179 188 #ifndef WORDS_BIGENDIAN 180 189 myumask = ntohl(msg_integer->myint) ; … … 224 233 receive_buffer[msglen] = '\0' ; 225 234 msg_dir = (struct mess_dir *) receive_buffer ; 235 #ifdef NDG_AUTH 236 if (bbftpd_private_authz(msgcode, (void *)msg_dir, logmessage) != 0) { 237 syslog(BBFTPD_ERR, logmessage); 238 reply(MSG_BAD, logmessage); 239 FREE(receive_buffer); 240 return 0; 241 } 242 #endif // NDG_AUTH 226 243 transferoption = msg_dir->transferoption ; 227 244 syslog(BBFTPD_DEBUG,"Pattern = %s",msg_dir->dirname) ; … … 267 284 } 268 285 msg_store_v2 = (struct mess_store_v2 *) receive_buffer ; 286 #ifdef NDG_AUTH 287 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_AUTH 294 269 295 /* 270 296 ** Set up the transfer parameter, we are going only to store … … 306 332 } 307 333 msg_store_v2 = (struct mess_store_v2 *) receive_buffer ; 334 #ifdef NDG_AUTH 335 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_AUTH 342 308 343 /* 309 344 ** Set up the transfer parameter, we are going only to store -
TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/bbftpd_rm.c
r773 r983 79 79 buffer[msglen] = '\0' ; 80 80 msg_file = (struct mess_dir *) buffer ; 81 #ifdef NDG_AUTH 82 if (bbftpd_private_authz(MSG_RM, (void *)msg_file, logmessage) != 0) { 83 syslog(BBFTPD_ERR, logmessage); 84 reply(MSG_BAD, logmessage); 85 FREE(buffer); 86 FREE(logmessage); 87 return 0; 88 } 89 #endif // NDG_AUTH 90 81 91 transferoption = msg_file->transferoption ; 82 92 filename = msg_file->dirname ; -
TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/bbftpd_stat.c
r773 r983 103 103 buffer[msglen] = '\0' ; 104 104 msg_file = (struct mess_dir *) buffer ; 105 #ifdef NDG_AUTH 106 if (bbftpd_private_authz(MSG_STAT, (void *)msg_file, logmessage) != 0) { 107 syslog(BBFTPD_ERR, logmessage); 108 reply(MSG_BAD, logmessage); 109 FREE(buffer); 110 FREE(logmessage); 111 return 0; 112 } 113 #endif // NDG_AUTH 114 105 115 transferoption = msg_file->transferoption ; 106 116 filename = msg_file->dirname ; -
TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/bbftpd_statfs.c
r773 r983 106 106 buffer[msglen] = '\0' ; 107 107 msg_file = (struct mess_dir *) buffer ; 108 #ifdef NDG_AUTH 109 if (bbftpd_private_authz(MSG_DF, (void *)msg_file, logmessage) != 0) { 110 syslog(BBFTPD_ERR, logmessage); 111 reply(MSG_BAD, logmessage); 112 FREE(buffer); 113 FREE(logmessage); 114 return 0; 115 } 116 #endif // NDG_AUTH 108 117 transferoption = msg_file->transferoption ; 109 118 dirname = msg_file->dirname ; -
TI05-delivery/trunk/src/bbftp-server-3.2.0/includes/daemon_proto.h
r975 r983 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 79 #endif // NDG_AUTH 79 80 /*
Note: See TracChangeset
for help on using the changeset viewer.