Professional Web Applications Themes

NetInfo writing without explicitly logging in - Mac Programming

Firstly, I hope no-one's offended by the crossposting, but this is valid in both groups. I'm writing a program to run on a NeXT that needs to be able to write to the NetInfo database. It's going to be run sUID 0, and will be called as an rcmd from another machine. As the program is already running as root, I'd like to do it without authentication (which will be carried out on the remote machine) so that the luser does not need to know root's password (always nice :). [NB: It isn't sufficient for the user to authenticate as ...

  1. #1

    Default NetInfo writing without explicitly logging in

    Firstly, I hope no-one's offended by the crossposting, but this is valid
    in both groups.

    I'm writing a program to run on a NeXT that needs to be able to write to
    the NetInfo database. It's going to be run sUID 0, and will be called
    as an rcmd from another machine. As the program is already running as
    root, I'd like to do it without authentication (which will be carried
    out on the remote machine) so that the luser does not need to know
    root's password (always nice :). [NB: It isn't sufficient for the user
    to authenticate as himself in this case]

    My experience with the NetInfo APIs (minimal as it is) suggests that you
    cannot write to NetInfo without having already called ni_setuser(), and
    ni_setpassword(). Is this in fact the case? If it is, then I'm a bit
    stumped because I don't want to make the database more accessible (i.e.
    users only get root access through this restricted program); neither do
    I want to store root's unencrypted password in a binary, even if it *is*
    obfuscated.

    Any help?

    Thanks,

    Graham
    --
    Graham Lee
    c/o Wadham College,
    Oxford.

    Graham Guest

  2. #2

    Default Re: NetInfo writing without explicitly logging in

    In article <wadham.oxford.ac.uk>,
    Graham Lee <wadham.oxford.ac.uk> wrote: 

    I can't answer your question but I do have an idea about where to look.
    Do the Darwin sources include a NetInfo-aware passwd(1)? It must have
    the same problem when it's used by root to change the password of
    another user. Perhaps looking there would help you out.

    --
    David Evans uwaterloo.ca
    Ph.D. Candidate, Computer/Synth Junkie http://bbcr.uwaterloo.ca/~dfevans/
    University of Waterloo "Default is the value selected by the composer
    Ontario, Canada overridden by your command." - Roland TR-707 Manual
    David Guest

  3. #3

    Default Re: NetInfo writing without explicitly logging in

    David Evans wrote:
     
    >
    > I can't answer your question but I do have an idea about where to look.
    > Do the Darwin sources include a NetInfo-aware passwd(1)? It must have
    > the same problem when it's used by root to change the password of
    > another user. Perhaps looking there would help you out.
    >[/ref]
    Ahah! A great idea, thankyou. I'm not entirely sure how much NI has
    changed between NeXTStep and Darwin, but I'll definitely give it a look.

    Thanks,

    Graham.
    --
    Graham Lee
    c/o Wadham College
    Oxford
    Graham Guest

Similar Threads

  1. explicitly assigning a variable
    By Colin Harris in forum PHP Development
    Replies: 4
    Last Post: February 8th, 12:28 AM
  2. Netinfo Domain Setup???
    By Jeff in forum Mac Networking
    Replies: 1
    Last Post: November 5th, 02:51 AM
  3. NetInfo Manager Bug
    By Paul Nevai in forum Mac Applications & Software
    Replies: 1
    Last Post: July 14th, 01:00 PM
  4. LAN, NetInfo and a portable
    By Sandman in forum Mac Applications & Software
    Replies: 0
    Last Post: July 7th, 09:02 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139