create_cookie(Name) ->
    Seed = abs(erlang:monotonic_time()
               bxor erlang:unique_integer()),
    Cookie = random_cookie(20, Seed, []),
    case file:open(Name, [write, raw]) of
        {ok, File} ->
            R1 = file:write(File, Cookie),
            ok = file:close(File),
            R2 = file:raw_write_file_info(Name, make_info(Name)),
            case {R1, R2} of
                {ok, ok} ->
                    ok;
                {{error,Reason}, _} ->
                    {error,
                     lists:flatten(
                       io_lib:format("Failed to write to cookie file '~ts': 
~p", [Name, Reason]))};
                {ok, {error, Reason}} ->
                    {error, "Failed to change mode: " ++ atom_to_list(Reason)}
            end;
        {error,Reason} ->
            {error,
             lists:flatten(
               io_lib:format("Failed to create cookie file '~ts': ~p", [Name, 
Reason]))}
    end.


So, R2 = file:raw_write_file_info(Name, make_info(Name)), is failing.
raw_write_file_info is obsolete, and is a wrapper around write_file_info now.
Digging more.... maybe i could invoke an erlang expert.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1808984

Title:
  s390x: erlang.cookie creation fails when changing file permissions

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-z-systems/+bug/1808984/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to