Ignore:
Timestamp:
Jun 4, 2010, 3:11:43 PM (15 years ago)
Author:
Silvan Scherrer
Message:

Samba Server 3.5: merged changes from 3.3

Location:
trunk/server/source3/smbd
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/source3/smbd/dosmode.c

    r414 r454  
    180180        if (ro_opts == MAP_READONLY_YES) {
    181181                /* Original Samba method - map inverse of user "w" bit. */
     182#ifndef __OS2__
    182183                if ((smb_fname->st.st_ex_mode & S_IWUSR) == 0) {
     184#else
     185                if (os2_isattribute(smb_fname->base_name, aRONLY) == 0) {
     186#endif
    183187                        result |= aRONLY;
    184188                }
     
    190194        } /* Else never set the readonly bit. */
    191195
     196#ifndef __OS2__
    192197        if (MAP_ARCHIVE(conn) && ((smb_fname->st.st_ex_mode & S_IXUSR) != 0))
     198#else
     199        if (os2_isattribute(smb_fname->base_name, aARCH) == 0)
     200#endif
    193201                result |= aARCH;
    194202
     203#ifndef __OS2__
    195204        if (MAP_SYSTEM(conn) && ((smb_fname->st.st_ex_mode & S_IXGRP) != 0))
     205#else
     206        if (os2_isattribute(smb_fname->base_name, aSYSTEM) == 0)
     207#endif
    196208                result |= aSYSTEM;
    197209
     210#ifndef __OS2__
    198211        if (MAP_HIDDEN(conn) && ((smb_fname->st.st_ex_mode & S_IXOTH) != 0))
     212#else
     213        if (os2_isattribute(smb_fname->base_name, aHIDDEN) == 0)
     214#endif
    199215                result |= aHIDDEN;   
    200216
     
    249265#else
    250266                                ) {
     267#endif
     268
     269#ifdef __OS2__ //on os2 no error in case of ./.. and errno 2
     270        if ((strncmp(smb_fname->base_name, "./..", 4) !=0) || (errno !=2))
    251271#endif
    252272                        DEBUG(1,("get_ea_dos_attributes: Cannot get attribute "
  • trunk/server/source3/smbd/password.c

    r414 r454  
    219219                return -1;
    220220        }
     221
     222#ifdef __OS2__
     223                        /* On OS/2 we use drive letters which have a colon.  This is also the field
     224                           separator in master.passwd, so we use a $ instead of a colon for the drive
     225                           separator, ie e$/user instead of e:/user.  This code simply exchanges any $
     226                           for a : in the user's homedir */
     227                        if (pwd->pw_dir[1] == '$')
     228                                        pwd->pw_dir[1] = ':';
     229#endif
    221230
    222231        DEBUG(3, ("Adding homes service for user '%s' using home directory: "
  • trunk/server/source3/smbd/reply.c

    r429 r454  
    56525652        bool dst_exists, old_is_stream, new_is_stream;
    56535653
     5654/* borrowed from 3.3 source patch by Apple */
     5655#ifdef __OS2__
     5656        bool check_dest_exist = False;
     5657#else
     5658        bool check_dest_exist = True;
     5659#endif
     5660
    56545661        status = check_name(conn, smb_fname_dst_in->base_name);
    56555662        if (!NT_STATUS_IS_OK(status)) {
     
    57895796        dst_exists = SMB_VFS_STAT(conn, smb_fname_dst) == 0;
    57905797
    5791         if(!replace_if_exists && dst_exists) {
     5798        if(check_dest_exist && !replace_if_exists && dst_exists) {
    57925799                DEBUG(3, ("rename_internals_fsp: dest exists doing rename "
    57935800                          "%s -> %s\n", smb_fname_str_dbg(fsp->fsp_name),
  • trunk/server/source3/smbd/server.c

    r429 r454  
    11171117        reopen_logs();
    11181118
     1119#ifdef __OS2__
     1120        unsigned long  _System DosSetPriority (unsigned long  ulScope, unsigned long  ulClass, long lDelta, unsigned long ulID);
     1121        int rc;
     1122        rc = DosSetPriority(
     1123                0,                      /* Scope: only one process */
     1124                4,             /* set to PRTYC_FOREGROUNDSERVER */
     1125                0,                      /* set delta - was 0 */
     1126                0);                     /* Assume current process */
     1127        DEBUG(0,( "Server priority set to PRTYC_FOREGROUNDSERVER\n"));
     1128#endif
     1129
    11191130        DEBUG(0,("smbd version %s started.\n", samba_version_string()));
    11201131        DEBUGADD(0,("%s\n", COPYRIGHT_STARTUP_MESSAGE));
  • trunk/server/source3/smbd/service.c

    r429 r454  
    6868        d = destname;
    6969
     70#ifndef __OS2__
    7071        *d++ = '/'; /* Always start with root. */
    7172
     
    159160                *(d-1) = '\0';
    160161        }
     162#else
     163        /* Assume OS/2 users are smart enough to put a correct path in smb.conf, and simply copy the string */
     164        safe_strcpy(destname, connectpath, strlen(connectpath));
     165#endif 
    161166
    162167        DEBUG(10,("set_conn_connectpath: service %s, connectpath = %s\n",
  • trunk/server/source3/smbd/sesssetup.c

    r429 r454  
    7575        result = 0;
    7676
     77#ifndef __OS2__
    7778        tmp = message_push_string(outbuf, "Unix", STR_TERMINATE);
     79#else
     80        tmp = message_push_string(outbuf, "eCS (OS/2)", STR_TERMINATE);
     81#endif
    7882
    7983        if (tmp == -1) return -1;
  • trunk/server/source3/smbd/trans2.c

    r414 r454  
    128128
    129129        pea->flags = 0;
     130#ifndef __OS2__
    130131        if (strnequal(ea_name, "user.", 5)) {
    131132                pea->name = talloc_strdup(mem_ctx, &ea_name[5]);
    132133        } else {
     134#else
     135                {
     136#endif
    133137                pea->name = talloc_strdup(mem_ctx, ea_name);
    134138        }
     
    287291                fstring dos_ea_name;
    288292
     293#ifndef __OS2__
    289294                if (strnequal(names[i], "system.", 7)
    290295                    || samba_private_attr_name(names[i]))
     296#else
     297                if (samba_private_attr_name(names[i]))
     298#endif
    291299                        continue;
    292300
     
    492500                fstring unix_ea_name;
    493501
     502#ifdef __OS2__
     503                /* All EA's must start with user - except on OS/2 */
     504                fstrcpy(unix_ea_name, ea_list->ea.name);
     505#else
    494506                fstrcpy(unix_ea_name, "user."); /* All EA's must start with user. */
    495507                fstrcat(unix_ea_name, ea_list->ea.name);
     508#endif
    496509
    497510                canonicalize_ea_name(conn, fsp, fname, unix_ea_name);
     
    54545467        }
    54555468
     5469#ifdef __OS2__
     5470        /* YD ticket#60, the file is opened, we cannot write to it,
     5471         * so we can return immediately (see above for more comments).
     5472         */
     5473        else {
     5474#endif
     5475
    54565476        DEBUG(10,("smb_set_file_time: setting utimes to modified values.\n"));
    54575477
     
    54635483                return map_nt_error_from_unix(errno);
    54645484        }
     5485#ifdef __OS2__
     5486        }
     5487#endif
    54655488
    54665489        notify_fname(conn, NOTIFY_ACTION_MODIFIED, action,
  • trunk/server/source3/smbd/vfs.c

    r414 r454  
    716716                return(0);
    717717
     718#ifdef __OS2__
     719        if ((*path == '/' || *path == '\\' || (*path && path[1] == ':')) && strcsequal(LastDir,path))
     720#else
    718721        if (*path == '/' && strcsequal(LastDir,path))
     722#endif
    719723                return(0);
    720724
     
    938942                  resolved_name));
    939943
     944#ifdef __OS2__
     945        if (*resolved_name != '/' && *resolved_name != '\\' && (strlen(resolved_name) <= 1 || resolved_name[1] != ':')) {
     946#else
    940947        if (*resolved_name != '/') {
     948#endif
    941949                DEBUG(0,("check_reduced_name: realpath doesn't return "
    942950                         "absolute paths !\n"));
Note: See TracChangeset for help on using the changeset viewer.