Ticket #27141: macports-min_usable_uid.diff

File macports-min_usable_uid.diff, 4.0 KB (added by mklein-de (Michael Klein), 14 years ago)

Patch against svn rev 72997

  • src/pextlib1.0/Pextlib.c

     
    242242int NextuidCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc UNUSED, Tcl_Obj *CONST objv[] UNUSED)
    243243{
    244244        Tcl_Obj *tcl_result;
     245        Tcl_Obj *tcl_min_usable_uid;
    245246        int cur;
    246247
    247         cur = MIN_USABLE_UID;
     248        tcl_min_usable_uid = Tcl_GetVar2Ex(interp, "min_usable_uid", NULL, 0);
     249        if (tcl_min_usable_uid == NULL ||
     250                Tcl_GetIntFromObj(interp, tcl_min_usable_uid, &cur) != TCL_OK) {
     251                cur = MIN_USABLE_UID;
     252        }
    248253
    249254        while (getpwuid(cur) != NULL) {
    250255                cur++;
     
    259264int NextgidCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc UNUSED, Tcl_Obj *CONST objv[] UNUSED)
    260265{
    261266        Tcl_Obj *tcl_result;
     267        Tcl_Obj *tcl_min_usable_gid;
    262268        int cur;
    263269
    264         cur = MIN_USABLE_GID;
     270        tcl_min_usable_gid = Tcl_GetVar2Ex(interp, "min_usable_gid", NULL, 0);
     271        if (tcl_min_usable_gid == NULL ||
     272                Tcl_GetIntFromObj(interp, tcl_min_usable_gid, &cur) != TCL_OK) {
     273                cur = MIN_USABLE_GID;
     274        }
    265275
    266276        while (getgrgid(cur) != NULL) {
    267277                cur++;
  • src/macports1.0/macports.tcl

     
    4646        rsync_dir startupitem_type place_worksymlink xcodeversion xcodebuildcmd \
    4747        mp_remote_url mp_remote_submit_url configureccache ccache_dir ccache_size configuredistcc configurepipe buildnicevalue buildmakejobs \
    4848        applications_dir frameworks_dir developer_dir universal_archs build_arch macosx_deployment_target \
    49         macportsuser proxy_override_env proxy_http proxy_https proxy_ftp proxy_rsync proxy_skip"
     49        macportsuser proxy_override_env proxy_http proxy_https proxy_ftp proxy_rsync proxy_skip min_usable_uid min_usable_gid"
    5050    variable user_options "submitter_name submitter_email submitter_key"
    5151    variable portinterp_options "\
    5252        portdbpath porturl portpath portbuildpath auto_path prefix prefix_frozen portsharepath \
     
    5555        rsync_server rsync_options rsync_dir startupitem_type place_worksymlink macportsuser \
    5656        mp_remote_url mp_remote_submit_url configureccache ccache_dir ccache_size configuredistcc configurepipe buildnicevalue buildmakejobs \
    5757        applications_dir current_phase frameworks_dir developer_dir universal_archs build_arch \
    58         os_arch os_endian os_version os_major os_platform macosx_version macosx_deployment_target $user_options"
     58        os_arch os_endian os_version os_major os_platform macosx_version macosx_deployment_target min_usable_uid min_usable_gid \$user_options"
    5959
    6060    # deferred options are only computed when needed.
    6161    # they are not exported to the trace thread.
  • configure.ac

     
    225225AC_SUBST(READLINE_LIBS)
    226226
    227227# Lowest non-system-reserved uid and gid (Apple claims <500)
    228 AC_DEFINE([MIN_USABLE_UID], [500], [Lowest non-system-reserved UID.])
    229 AC_DEFINE([MIN_USABLE_GID], [500], [Lowest non-system-reserved GID.])
     228MIN_USABLE_UID=500
     229MIN_USABLE_GID=500
     230AC_DEFINE_UNQUOTED([MIN_USABLE_UID], ${MIN_USABLE_UID}, [Lowest non-system-reserved UID.])
     231AC_DEFINE_UNQUOTED([MIN_USABLE_GID], ${MIN_USABLE_GID}, [Lowest non-system-reserved GID.])
    230232
     233AC_SUBST(MIN_USABLE_UID)
     234AC_SUBST(MIN_USABLE_GID)
     235
    231236# Load tclConfig.sh
    232237SC_PATH_TCLCONFIG
    233238SC_LOAD_TCLCONFIG
  • doc/macports.conf.in

     
    148148# hosts not to go through the proxy (comma-separated, applies to HTTP, HTTPS,
    149149# and FTP, but not rsync):
    150150#proxy_skip            internal1, internal2, internal3
     151
     152# minimum UID/GID numbers for adduser/addgroup commands
     153# UIDs/GIDs < 500 are reserved by Apple
     154#min_usable_uid         @MIN_USABLE_UID@
     155#min_usable_gid         @MIN_USABLE_GID@