Changeset 124 for branches/samba-3.0/source/smbd
- Timestamp:
- Mar 12, 2008, 9:08:18 AM (18 years ago)
- Location:
- branches/samba-3.0/source/smbd
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.0/source/smbd/build_options.c
r62 r124 492 492 output(screen, " HAVE_STRING_H\n"); 493 493 #endif 494 #ifdef HAVE_STROPTS_H 495 output(screen, " HAVE_STROPTS_H\n"); 496 #endif 494 497 #ifdef HAVE_SYSCALL_H 495 498 output(screen, " HAVE_SYSCALL_H\n"); … … 1124 1127 output(screen, " HAVE_INOTIFY\n"); 1125 1128 #endif 1129 #ifdef HAVE_INOTIFY_INIT 1130 output(screen, " HAVE_INOTIFY_INIT\n"); 1131 #endif 1126 1132 #ifdef HAVE_IPRINT 1127 1133 output(screen, " HAVE_IPRINT\n"); … … 1265 1271 output(screen, " HAVE_KRB5_PRINCIPAL_GET_COMP_STRING\n"); 1266 1272 #endif 1273 #ifdef HAVE_KRB5_PRINCIPAL_GET_REALM 1274 output(screen, " HAVE_KRB5_PRINCIPAL_GET_REALM\n"); 1275 #endif 1267 1276 #ifdef HAVE_KRB5_PRINC_COMPONENT 1268 1277 output(screen, " HAVE_KRB5_PRINC_COMPONENT\n"); 1269 1278 #endif 1279 #ifdef HAVE_KRB5_PRINC_REALM 1280 output(screen, " HAVE_KRB5_PRINC_REALM\n"); 1281 #endif 1270 1282 #ifdef HAVE_KRB5_PRINC_SIZE 1271 1283 output(screen, " HAVE_KRB5_PRINC_SIZE\n"); … … 1303 1315 #ifdef HAVE_KV5M_KEYTAB 1304 1316 output(screen, " HAVE_KV5M_KEYTAB\n"); 1317 #endif 1318 #ifdef HAVE_LBER_LOG_PRINT_FN 1319 output(screen, " HAVE_LBER_LOG_PRINT_FN\n"); 1305 1320 #endif 1306 1321 #ifdef HAVE_LDAP … … 2434 2449 output(screen, " REPLACE_GETPASS\n"); 2435 2450 #endif 2451 #ifdef REPLACE_GETPASS_BY_GETPASSPHRASE 2452 output(screen, " REPLACE_GETPASS_BY_GETPASSPHRASE\n"); 2453 #endif 2436 2454 #ifdef REPLACE_INET_NTOA 2437 2455 output(screen, " REPLACE_INET_NTOA\n"); … … 2946 2964 #ifdef vfs_netatalk_init 2947 2965 output(screen, " vfs_netatalk_init\n"); 2966 #endif 2967 #ifdef vfs_notify_fam_init 2968 output(screen, " vfs_notify_fam_init\n"); 2948 2969 #endif 2949 2970 #ifdef vfs_posixacl_init -
branches/samba-3.0/source/smbd/chgpasswd.c
r1 r124 127 127 gid_t gid; 128 128 uid_t uid; 129 char * const eptrs[1] = { NULL }; 129 130 130 131 if (pass == NULL) … … 154 155 return (False); 155 156 } 156 #if defined(I_PUSH) && defined(I_FIND) 157 #if defined(TIOCSCTTY) 158 if (ioctl(slave, TIOCSCTTY, 0) < 0) 159 { 160 DEBUG(3, ("Error in ioctl call for slave pty\n")); 161 /* return(False); */ 162 } 163 #elif defined(I_PUSH) && defined(I_FIND) 157 164 if (ioctl(slave, I_FIND, "ptem") == 0) { 158 165 ioctl(slave, I_PUSH, "ptem"); … … 160 167 if (ioctl(slave, I_FIND, "ldterm") == 0) { 161 168 ioctl(slave, I_PUSH, "ldterm"); 162 }163 #elif defined(TIOCSCTTY)164 if (ioctl(slave, TIOCSCTTY, 0) < 0)165 {166 DEBUG(3, ("Error in ioctl call for slave pty\n"));167 /* return(False); */168 169 } 169 170 #endif … … 223 224 224 225 /* execl() password-change application */ 225 if (execl ("/bin/sh", "sh", "-c", passwordprogram, NULL) < 0)226 if (execle("/bin/sh", "sh", "-c", passwordprogram, NULL, eptrs) < 0) 226 227 { 227 228 DEBUG(3, ("Bad status returned from %s\n", passwordprogram)); … … 499 500 if (lp_pam_password_change()) { 500 501 BOOL ret; 502 #ifdef HAVE_SETLOCALE 503 char *prevlocale = setlocale(LC_ALL, "C"); 504 #endif 501 505 502 506 if (as_root) … … 511 515 if (as_root) 512 516 unbecome_root(); 517 518 #ifdef HAVE_SETLOCALE 519 setlocale(LC_ALL, prevlocale); 520 #endif 513 521 514 522 return ret; -
branches/samba-3.0/source/smbd/dosmode.c
r57 r124 453 453 454 454 DEBUG(10,("file_set_dosmode: setting dos mode 0x%x on file %s\n", dosmode, fname)); 455 if (!st || (st && !VALID_STAT(*st))) { 455 456 if (st == NULL) { 457 SET_STAT_INVALID(st1); 456 458 st = &st1; 459 } 460 461 if (!VALID_STAT(*st)) { 457 462 if (SMB_VFS_STAT(conn,fname,st)) 458 463 return(-1); 459 464 } 465 466 unixmode = st->st_mode; 460 467 461 468 get_acl_group_bits(conn, fname, &st->st_mode); … … 466 473 dosmode &= ~aDIR; 467 474 468 if (dos_mode(conn,fname,st) == dosmode) 475 if (dos_mode(conn,fname,st) == dosmode) { 476 st->st_mode = unixmode; 469 477 return(0); 478 } 470 479 471 480 /* Store the DOS attributes in an EA by preference. */ 472 481 if (set_ea_dos_attribute(conn, fname, st, dosmode)) { 482 st->st_mode = unixmode; 473 483 return 0; 474 484 } … … 509 519 notify_fname(conn, NOTIFY_ACTION_MODIFIED, 510 520 FILE_NOTIFY_CHANGE_ATTRIBUTES, fname); 521 st->st_mode = unixmode; 511 522 return 0; 512 523 } … … 541 552 notify_fname(conn, NOTIFY_ACTION_MODIFIED, 542 553 FILE_NOTIFY_CHANGE_ATTRIBUTES, fname); 554 if (ret == 0) { 555 st->st_mode = unixmode; 556 } 543 557 } 544 558 -
branches/samba-3.0/source/smbd/notify.c
r62 r124 66 66 int i; 67 67 UNISTR uni_name; 68 69 uni_name.buffer = NULL; 68 70 69 71 for (i=0; i<num_changes; i++) { -
branches/samba-3.0/source/smbd/notify_inotify.c
r39 r124 31 31 #endif 32 32 33 #ifndef HAVE_INOTIFY_INIT 34 33 35 #include <linux/inotify.h> 34 36 #include <asm/unistd.h> 35 37 36 #ifndef HAVE_INOTIFY_INIT 38 37 39 /* 38 40 glibc doesn't define these functions yet (as of March 2006) … … 52 54 return syscall(__NR_inotify_rm_watch, fd, wd); 53 55 } 56 #else 57 58 #include <sys/inotify.h> 59 54 60 #endif 55 61 -
branches/samba-3.0/source/smbd/open.c
r105 r124 1376 1376 #endif /* O_SYNC */ 1377 1377 1378 if (posix_open & (access_mask & FILE_APPEND_DATA)) {1378 if (posix_open && (access_mask & FILE_APPEND_DATA)) { 1379 1379 flags2 |= O_APPEND; 1380 1380 } … … 1819 1819 lp_store_dos_attributes(SNUM(conn))) { 1820 1820 if (!posix_open) { 1821 file_set_dosmode(conn, fname, 1822 new_dos_attributes | aARCH, NULL, 1823 parent_dir); 1821 SMB_STRUCT_STAT tmp_sbuf; 1822 SET_STAT_INVALID(tmp_sbuf); 1823 if (file_set_dosmode( 1824 conn, fname, 1825 new_dos_attributes | aARCH, 1826 &tmp_sbuf, 1827 parent_dir) == 0) { 1828 unx_mode = tmp_sbuf.st_mode; 1829 } 1824 1830 } 1825 1831 } -
branches/samba-3.0/source/smbd/password.c
r118 r124 92 92 if (vuser == NULL) 93 93 return; 94 94 95 95 SAFE_FREE(vuser->homedir); 96 96 SAFE_FREE(vuser->unix_homedir); 97 97 SAFE_FREE(vuser->logon_script); 98 98 99 if (vuser->auth_ntlmssp_state) { 100 auth_ntlmssp_end(&vuser->auth_ntlmssp_state); 101 } 102 99 103 session_yield(vuser); 100 104 SAFE_FREE(vuser->session_keystr); … … 112 116 SAFE_FREE(vuser->groups); 113 117 TALLOC_FREE(vuser->nt_user_token); 118 119 SAFE_FREE(vuser); 120 num_validated_vuids--; 121 } 122 123 void invalidate_intermediate_vuid(uint16 vuid) 124 { 125 user_struct *vuser = get_partial_auth_user_struct(vuid); 126 127 if (vuser == NULL) 128 return; 129 130 if (vuser->auth_ntlmssp_state) { 131 auth_ntlmssp_end(&vuser->auth_ntlmssp_state); 132 } 133 134 DLIST_REMOVE(validated_users, vuser); 114 135 115 136 SAFE_FREE(vuser); … … 164 185 if (num_validated_vuids >= 0xFFFF-VUID_OFFSET) { 165 186 data_blob_free(&session_key); 187 TALLOC_FREE(server_info); 166 188 return UID_FIELD_INVALID; 167 189 } … … 170 192 DEBUG(0,("Failed to malloc users struct!\n")); 171 193 data_blob_free(&session_key); 194 TALLOC_FREE(server_info); 172 195 return UID_FIELD_INVALID; 173 196 } … … 176 199 177 200 /* Allocate a free vuid. Yes this is a linear search... :-) */ 178 while( get_valid_user_struct(next_vuid) != NULL ) { 201 while( (get_valid_user_struct(next_vuid) != NULL) 202 || (get_partial_auth_user_struct(next_vuid) != NULL) ) { 179 203 next_vuid++; 180 204 /* Check for vuid wrap. */ -
branches/samba-3.0/source/smbd/posix_acls.c
r105 r124 1337 1337 psa1->flags |= (psa2->flags & (SEC_ACE_FLAG_CONTAINER_INHERIT|SEC_ACE_FLAG_OBJECT_INHERIT)); 1338 1338 psa2->flags &= ~(SEC_ACE_FLAG_CONTAINER_INHERIT|SEC_ACE_FLAG_OBJECT_INHERIT); 1339 1339 1340 1340 } else if (psa2->flags & SEC_ACE_FLAG_INHERIT_ONLY) { 1341 1341 1342 1342 psa2->flags |= (psa1->flags & (SEC_ACE_FLAG_CONTAINER_INHERIT|SEC_ACE_FLAG_OBJECT_INHERIT)); 1343 1343 psa1->flags &= ~(SEC_ACE_FLAG_CONTAINER_INHERIT|SEC_ACE_FLAG_OBJECT_INHERIT); 1344 1344 1345 1345 } 1346 1346 } … … 1403 1403 } else if (sid_to_uid( ¤t_ace->trustee, ¤t_ace->unix_ug.uid)) { 1404 1404 current_ace->owner_type = UID_ACE; 1405 current_ace->type = SMB_ACL_USER; 1405 /* If it's the owning user, this is a user_obj, not 1406 * a user. */ 1407 if (current_ace->unix_ug.uid == pst->st_uid) { 1408 current_ace->type = SMB_ACL_USER_OBJ; 1409 } else { 1410 current_ace->type = SMB_ACL_USER; 1411 } 1406 1412 } else if (sid_to_gid( ¤t_ace->trustee, ¤t_ace->unix_ug.gid)) { 1407 1413 current_ace->owner_type = GID_ACE; 1408 current_ace->type = SMB_ACL_GROUP; 1414 /* If it's the primary group, this is a group_obj, not 1415 * a group. */ 1416 if (current_ace->unix_ug.gid == pst->st_gid) { 1417 current_ace->type = SMB_ACL_GROUP_OBJ; 1418 } else { 1419 current_ace->type = SMB_ACL_GROUP; 1420 } 1409 1421 } else { 1410 1422 fstring str; … … 3100 3112 } 3101 3113 3102 static NTSTATUS append_ugw_ace(files_struct *fsp, 3103 SMB_STRUCT_STAT *psbuf, 3104 mode_t unx_mode, 3105 int ugw, 3106 SEC_ACE *se) 3107 { 3108 mode_t perms; 3109 SEC_ACCESS acc; 3110 int nt_acl_type; /* Tru64 has "acl_type" as a macro.. */ 3111 DOM_SID trustee; 3112 3113 switch (ugw) { 3114 case S_IRUSR: 3115 perms = unix_perms_to_acl_perms(unx_mode, 3116 S_IRUSR, 3117 S_IWUSR, 3118 S_IXUSR); 3119 uid_to_sid(&trustee, psbuf->st_uid ); 3120 break; 3121 case S_IRGRP: 3122 perms = unix_perms_to_acl_perms(unx_mode, 3123 S_IRGRP, 3124 S_IWGRP, 3125 S_IXGRP); 3126 gid_to_sid(&trustee, psbuf->st_gid ); 3127 break; 3128 case S_IROTH: 3129 perms = unix_perms_to_acl_perms(unx_mode, 3130 S_IROTH, 3131 S_IWOTH, 3132 S_IXOTH); 3133 sid_copy(&trustee, &global_sid_World); 3134 break; 3135 default: 3136 return NT_STATUS_INVALID_PARAMETER; 3137 } 3138 acc = map_canon_ace_perms(SNUM(fsp->conn), 3139 &nt_acl_type, 3140 perms, 3141 fsp->is_directory); 3142 3143 init_sec_ace(se, 3144 &trustee, 3145 nt_acl_type, 3146 acc, 3147 0); 3148 return NT_STATUS_OK; 3149 } 3150 3151 /**************************************************************************** 3152 If this is an 3114 /**************************************************************************** 3115 Take care of parent ACL inheritance. 3153 3116 ****************************************************************************/ 3154 3117 … … 3169 3132 size_t sd_size; 3170 3133 unsigned int i, j; 3171 mode_t unx_mode;3134 BOOL is_dacl_protected = (psd->type & SE_DESC_DACL_PROTECTED); 3172 3135 3173 3136 ZERO_STRUCT(sbuf); … … 3183 3146 return NT_STATUS_NO_MEMORY; 3184 3147 } 3185 3186 /* Create a default mode for u/g/w. */3187 unx_mode = unix_mode(fsp->conn,3188 aARCH | (fsp->is_directory ? aDIR : 0),3189 fsp->fsp_name,3190 parent_name);3191 3148 3192 3149 status = open_directory(fsp->conn, … … 3214 3171 } 3215 3172 3216 3173 /* 3217 3174 * Make room for potentially all the ACLs from 3218 * the parent, plus the user/group/other triple. 3175 * the parent. We used to add the ugw triple here, 3176 * as we knew we were dealing with POSIX ACLs. 3177 * We no longer need to do so as we can guarentee 3178 * that a default ACL from the parent directory will 3179 * be well formed for POSIX ACLs if it came from a 3180 * POSIX ACL source, and if we're not writing to a 3181 * POSIX ACL sink then we don't care if it's not well 3182 * formed. JRA. 3219 3183 */ 3220 3184 3221 num_aces += parent_sd->dacl->num_aces + 3;3185 num_aces += parent_sd->dacl->num_aces; 3222 3186 3223 3187 if((new_ace = TALLOC_ZERO_ARRAY(mem_ctx, SEC_ACE, … … 3225 3189 return NT_STATUS_NO_MEMORY; 3226 3190 } 3227 3228 DEBUG(10,("append_parent_acl: parent ACL has %u entries. New "3229 "ACL has %u entries\n",3230 parent_sd->dacl->num_aces, num_aces ));3231 3191 3232 3192 /* Start by copying in all the given ACE entries. */ … … 3240 3200 */ 3241 3201 3242 /*3243 * Append u/g/w.3244 */3245 3246 status = append_ugw_ace(fsp, psbuf, unx_mode, S_IRUSR, &new_ace[i++]);3247 if (!NT_STATUS_IS_OK(status)) {3248 return status;3249 }3250 status = append_ugw_ace(fsp, psbuf, unx_mode, S_IRGRP, &new_ace[i++]);3251 if (!NT_STATUS_IS_OK(status)) {3252 return status;3253 }3254 status = append_ugw_ace(fsp, psbuf, unx_mode, S_IROTH, &new_ace[i++]);3255 if (!NT_STATUS_IS_OK(status)) {3256 return status;3257 }3258 3259 3202 /* Finally append any inherited ACEs. */ 3260 3203 for (j = 0; j < parent_sd->dacl->num_aces; j++) { 3261 3204 SEC_ACE *se = &parent_sd->dacl->aces[j]; 3262 uint32 i_flags = se->flags & (SEC_ACE_FLAG_OBJECT_INHERIT|3263 SEC_ACE_FLAG_CONTAINER_INHERIT|3264 SEC_ACE_FLAG_INHERIT_ONLY);3265 3205 3266 3206 if (fsp->is_directory) { 3267 if (i_flags == SEC_ACE_FLAG_OBJECT_INHERIT) { 3268 /* Should only apply to a file - ignore. */ 3207 if (!(se->flags & SEC_ACE_FLAG_CONTAINER_INHERIT)) { 3208 /* Doesn't apply to a directory - ignore. */ 3209 DEBUG(10,("append_parent_acl: directory %s " 3210 "ignoring non container " 3211 "inherit flags %u on ACE with sid %s " 3212 "from parent %s\n", 3213 fsp->fsp_name, 3214 (unsigned int)se->flags, 3215 sid_string_static(&se->trustee), 3216 parent_name)); 3269 3217 continue; 3270 3218 } 3271 3219 } else { 3272 if ((i_flags & (SEC_ACE_FLAG_OBJECT_INHERIT| 3273 SEC_ACE_FLAG_INHERIT_ONLY)) != 3274 SEC_ACE_FLAG_OBJECT_INHERIT) { 3275 /* Should not apply to a file - ignore. */ 3220 if (!(se->flags & SEC_ACE_FLAG_OBJECT_INHERIT)) { 3221 /* Doesn't apply to a file - ignore. */ 3222 DEBUG(10,("append_parent_acl: file %s " 3223 "ignoring non object " 3224 "inherit flags %u on ACE with sid %s " 3225 "from parent %s\n", 3226 fsp->fsp_name, 3227 (unsigned int)se->flags, 3228 sid_string_static(&se->trustee), 3229 parent_name)); 3276 3230 continue; 3277 3231 } 3278 3232 } 3233 3234 if (is_dacl_protected) { 3235 /* If the DACL is protected it means we must 3236 * not overwrite an existing ACE entry with the 3237 * same SID. This is order N^2. Ouch :-(. JRA. */ 3238 unsigned int k; 3239 for (k = 0; k < psd->dacl->num_aces; k++) { 3240 if (sid_equal(&psd->dacl->aces[k].trustee, 3241 &se->trustee)) { 3242 break; 3243 } 3244 } 3245 if (k < psd->dacl->num_aces) { 3246 /* SID matched. Ignore. */ 3247 DEBUG(10,("append_parent_acl: path %s " 3248 "ignoring ACE with protected sid %s " 3249 "from parent %s\n", 3250 fsp->fsp_name, 3251 sid_string_static(&se->trustee), 3252 parent_name)); 3253 continue; 3254 } 3255 } 3256 3279 3257 sec_ace_copy(&new_ace[i], se); 3280 3258 if (se->flags & SEC_ACE_FLAG_NO_PROPAGATE_INHERIT) { … … 3282 3260 } 3283 3261 new_ace[i].flags |= SEC_ACE_FLAG_INHERITED_ACE; 3262 3263 if (fsp->is_directory) { 3264 /* 3265 * Strip off any inherit only. It's applied. 3266 */ 3267 new_ace[i].flags &= ~(SEC_ACE_FLAG_INHERIT_ONLY); 3268 if (se->flags & SEC_ACE_FLAG_NO_PROPAGATE_INHERIT) { 3269 /* No further inheritance. */ 3270 new_ace[i].flags &= 3271 ~(SEC_ACE_FLAG_CONTAINER_INHERIT| 3272 SEC_ACE_FLAG_OBJECT_INHERIT); 3273 } 3274 } else { 3275 /* 3276 * Strip off any container or inherit 3277 * flags, they can't apply to objects. 3278 */ 3279 new_ace[i].flags &= ~(SEC_ACE_FLAG_CONTAINER_INHERIT| 3280 SEC_ACE_FLAG_INHERIT_ONLY| 3281 SEC_ACE_FLAG_NO_PROPAGATE_INHERIT); 3282 } 3283 3284 3284 i++; 3285 3286 DEBUG(10,("append_parent_acl: path %s " 3287 "inheriting ACE with sid %s " 3288 "from parent %s\n", 3289 fsp->fsp_name, 3290 sid_string_static(&se->trustee), 3291 parent_name)); 3292 3285 3293 } 3286 3294 -
branches/samba-3.0/source/smbd/reply.c
r105 r124 5171 5171 status = check_name(conn, fname); 5172 5172 if (!NT_STATUS_IS_OK(status)) { 5173 CloseDir(dir_hnd); 5173 5174 return ERROR_NT(status); 5174 5175 } … … 5176 5177 status = check_name(conn, destname); 5177 5178 if (!NT_STATUS_IS_OK(status)) { 5179 CloseDir(dir_hnd); 5178 5180 return ERROR_NT(status); 5179 5181 } -
branches/samba-3.0/source/smbd/server.c
r71 r124 31 31 32 32 /* a useful macro to debug the last message processed */ 33 #define LAST_MESSAGE() smb_fn_name(last_message)33 #define LAST_MESSAGE() (last_message != -1 ? smb_fn_name(last_message) : "") 34 34 35 35 extern struct auth_context *negprot_global_auth_context; -
branches/samba-3.0/source/smbd/sesssetup.c
r105 r124 629 629 auth_ntlmssp_end(auth_ntlmssp_state); 630 630 /* Kill the intermediate vuid */ 631 invalidate_ vuid(vuid);631 invalidate_intermediate_vuid(vuid); 632 632 } 633 633 … … 695 695 if (!NT_STATUS_IS_OK(status)) { 696 696 /* Kill the intermediate vuid */ 697 invalidate_ vuid(vuid);697 invalidate_intermediate_vuid(vuid); 698 698 return ERROR_NT(nt_status_squash(status)); 699 699 } … … 709 709 if (destroy_vuid) { 710 710 /* Kill the intermediate vuid */ 711 invalidate_ vuid(vuid);711 invalidate_intermediate_vuid(vuid); 712 712 } 713 713 return ret; 714 714 } 715 715 #endif 716 717 if (got_kerberos_mechanism) { 718 invalidate_intermediate_vuid(vuid); 719 DEBUG(3,("reply_spnego_negotiate: network " 720 "misconfiguration, client sent us a " 721 "krb5 ticket and kerberos security " 722 "not enabled")); 723 return ERROR_NT(nt_status_squash(NT_STATUS_LOGON_FAILURE)); 724 } 716 725 717 726 if (*auth_ntlmssp_state) { … … 722 731 if (!NT_STATUS_IS_OK(status)) { 723 732 /* Kill the intermediate vuid */ 724 invalidate_ vuid(vuid);733 invalidate_intermediate_vuid(vuid); 725 734 return ERROR_NT(nt_status_squash(status)); 726 735 } … … 760 769 #endif 761 770 /* Kill the intermediate vuid */ 762 invalidate_ vuid(vuid);763 764 return ERROR_NT(nt_status_squash(NT_STATUS_ INVALID_PARAMETER));771 invalidate_intermediate_vuid(vuid); 772 773 return ERROR_NT(nt_status_squash(NT_STATUS_LOGON_FAILURE)); 765 774 } 766 775 … … 781 790 if (destroy_vuid) { 782 791 /* Kill the intermediate vuid */ 783 invalidate_ vuid(vuid);792 invalidate_intermediate_vuid(vuid); 784 793 } 785 794 return ret; … … 791 800 /* If we get here it wasn't a negTokenTarg auth packet. */ 792 801 data_blob_free(&secblob); 793 802 794 803 if (!*auth_ntlmssp_state) { 795 804 /* Kill the intermediate vuid */ 796 invalidate_ vuid(vuid);805 invalidate_intermediate_vuid(vuid); 797 806 798 807 /* auth before negotiatiate? */ 799 return ERROR_NT( nt_status_squash(NT_STATUS_INVALID_PARAMETER));800 } 801 802 status = auth_ntlmssp_update(*auth_ntlmssp_state, 808 return ERROR_NT(NT_STATUS_LOGON_FAILURE); 809 } 810 811 status = auth_ntlmssp_update(*auth_ntlmssp_state, 803 812 auth, &auth_reply); 804 813 805 814 data_blob_free(&auth); 806 815 807 reply_spnego_ntlmssp(conn, inbuf, outbuf, vuid, 816 reply_spnego_ntlmssp(conn, inbuf, outbuf, vuid, 808 817 auth_ntlmssp_state, 809 818 &auth_reply, status, True); 810 819 811 820 data_blob_free(&auth_reply); 812 821 … … 1117 1126 if (!NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) { 1118 1127 /* Real error - kill the intermediate vuid */ 1119 invalidate_ vuid(vuid);1128 invalidate_intermediate_vuid(vuid); 1120 1129 } 1121 1130 data_blob_free(&blob1); … … 1145 1154 if (!NT_STATUS_IS_OK(status)) { 1146 1155 /* Kill the intermediate vuid */ 1147 invalidate_ vuid(vuid);1156 invalidate_intermediate_vuid(vuid); 1148 1157 data_blob_free(&blob1); 1149 1158 return ERROR_NT(nt_status_squash(status)); -
branches/samba-3.0/source/smbd/trans2.c
r105 r124 2234 2234 } 2235 2235 2236 static void samba_extended_info_version(struct smb_extended_info *extended_info) 2237 { 2238 SMB_ASSERT(extended_info != NULL); 2239 2240 extended_info->samba_magic = SAMBA_EXTENDED_INFO_MAGIC; 2241 extended_info->samba_version = ((SAMBA_VERSION_MAJOR & 0xff) << 24) 2242 | ((SAMBA_VERSION_MINOR & 0xff) << 16) 2243 | ((SAMBA_VERSION_RELEASE & 0xff) << 8); 2244 #ifdef SAMBA_VERSION_REVISION 2245 extended_info->samba_version |= (tolower(*SAMBA_VERSION_REVISION) - 'a' + 1) & 0xff; 2246 #endif 2247 extended_info->samba_subversion = 0; 2248 #ifdef SAMBA_VERSION_RC_RELEASE 2249 extended_info->samba_subversion |= (SAMBA_VERSION_RC_RELEASE & 0xff) << 24; 2250 #else 2251 #ifdef SAMBA_VERSION_PRE_RELEASE 2252 extended_info->samba_subversion |= (SAMBA_VERSION_PRE_RELEASE & 0xff) << 16; 2253 #endif 2254 #endif 2255 #ifdef SAMBA_VERSION_VENDOR_PATCH 2256 extended_info->samba_subversion |= (SAMBA_VERSION_VENDOR_PATCH & 0xffff); 2257 #endif 2258 extended_info->samba_subversion = 0; 2259 #ifdef SAMBA_VERSION_GIT_COMMIT_TIME 2260 unix_to_nt_time(&extended_info->samba_gitcommitdate, SAMBA_VERSION_GIT_COMMIT_TIME); 2261 #endif 2262 2263 memset(extended_info->samba_version_string, 0, 2264 sizeof(extended_info->samba_version_string)); 2265 2266 snprintf (extended_info->samba_version_string, 2267 sizeof(extended_info->samba_version_string), 2268 "%s", samba_version_string()); 2269 } 2270 2236 2271 /**************************************************************************** 2237 2272 Reply to a TRANS2_QFSINFO (query filesystem info). … … 2341 2376 SIVAL(pdata,0,FILE_CASE_PRESERVED_NAMES|FILE_CASE_SENSITIVE_SEARCH| 2342 2377 (lp_nt_acl_support(SNUM(conn)) ? FILE_PERSISTENT_ACLS : 0)| 2378 FILE_UNICODE_ON_DISK| 2343 2379 quota_flag); /* FS ATTRIBUTES */ 2344 2380 … … 2522 2558 #endif /* HAVE_SYS_QUOTAS */ 2523 2559 case SMB_FS_OBJECTID_INFORMATION: 2560 { 2561 /* 2562 * No object id, but we transmit version information. 2563 */ 2564 struct smb_extended_info extended_info; 2565 samba_extended_info_version (&extended_info); 2566 SIVAL(pdata,16,extended_info.samba_magic); 2567 SIVAL(pdata,20,extended_info.samba_version); 2568 SIVAL(pdata,24,extended_info.samba_subversion); 2569 SBIG_UINT(pdata,28,extended_info.samba_gitcommitdate); 2570 memcpy(pdata+36,extended_info.samba_version_string,28); 2524 2571 data_len = 64; 2525 2572 break; 2573 } 2526 2574 2527 2575 /* … … 3310 3358 } 3311 3359 3312 nlink = sbuf.st_nlink;3313 3314 if ((nlink > 0) && S_ISDIR(sbuf.st_mode)) {3315 /* NTFS does not seem to count ".." */3316 nlink -= 1;3317 }3318 3319 if ((nlink > 0) && delete_pending) {3320 nlink -= 1;3321 }3322 3323 3360 if (INFO_LEVEL_IS_UNIX(info_level) && !lp_unix_extensions()) { 3324 3361 return ERROR_NT(NT_STATUS_INVALID_LEVEL); … … 3337 3374 if (!mode) 3338 3375 mode = FILE_ATTRIBUTE_NORMAL; 3376 3377 nlink = sbuf.st_nlink; 3378 3379 if (nlink && (mode&aDIR)) { 3380 nlink = 1; 3381 } 3382 3383 if ((nlink > 0) && delete_pending) { 3384 nlink -= 1; 3385 } 3339 3386 3340 3387 fullpathname = fname;
Note:
See TracChangeset
for help on using the changeset viewer.