Does anything look wrong in this function?

Jeremy Allison jra at samba.org
Thu Mar 24 02:35:52 UTC 2016


On Wed, Mar 23, 2016 at 07:23:21PM -0700, Richard Sharpe wrote:
> Saw this while working on my DOS ATTRIBUTES stuff:
> 
> NTSTATUS set_create_timespec_ea(connection_struct *conn,
>                                 const struct smb_filename *psmb_fname,
>                                 struct timespec create_time)
> {
>         struct smb_filename *smb_fname;
>         uint32_t dosmode;
>         int ret;
> 
>         if (!lp_store_dos_attributes(SNUM(conn))) {
>                 return NT_STATUS_OK;
>         }
> 
>         smb_fname = synthetic_smb_fname(talloc_tos(), psmb_fname->base_name,
>                                         NULL, &psmb_fname->st);
> 
>         if (smb_fname == NULL) {
>                 return NT_STATUS_NO_MEMORY;
>         }
> 
>         dosmode = dos_mode(conn, smb_fname);
> 
>         smb_fname->st.st_ex_btime = create_time;
> 
>         ret = file_set_dosmode(conn, smb_fname, dosmode, NULL, false);
>         if (ret == -1) {
>                 map_nt_error_from_unix(errno);
>         }
> 
>         DEBUG(10,("set_create_timespec_ea: wrote create time EA for file %s\n",
>                 smb_fname_str_dbg(smb_fname)));
> 
>         return NT_STATUS_OK;
> }

No, what am I missing ?



More information about the samba-technical mailing list