diff --git a/src/nwconn.c b/src/nwconn.c index 150af74..cb5c0c7 100644 --- a/src/nwconn.c +++ b/src/nwconn.c @@ -45,7 +45,6 @@ #include "nwqconn.h" #include "namspace.h" #include "nwshare.h" -#include "nwdbm.h" #include "nwconn.h" #include "trustee.h" #include "nwatalk.h" @@ -87,69 +86,24 @@ static int scan_volume_user_disk_restrictions(uint8 volnr, uint32 sequence, { struct XDATA { uint8 entries; - struct { - uint8 id[4]; - uint8 restriction[4]; - } entry[12]; } *xdata = (struct XDATA *)response; int result = nw_get_volume_name(volnr, NULL, 0); + (void)sequence; + if (result < 0) return result; + /* + * Keep the scan reply empty for now. The per-object quota query can be + * routed through nwbind because it has a concrete object id to resolve, + * but this scan call would need bindery iteration plus UNIX_USER property + * lookups from nwbind-side code. nwconn does not link the bindery database + * helpers, and pulling them into this process would break the existing + * process split. + */ xdata->entries = 0; - -#if QUOTA_SUPPORT - { - NETOBJ obj; - uint32 last_obj_id = MAX_U32; - uint32 restricted_index = 0; - uint8 wild[] = "*"; - int scan_result; - - memset(&obj, 0, sizeof(obj)); - obj.type = 1; /* user */ - xstrcpy(obj.name, wild); - - scan_result = scan_for_obj(&obj, last_obj_id, 1); - while (!scan_result && xdata->entries < 12) { - uint8 more_segments = 0; - uint8 property_flags = 0; - char unix_user[128]; - uint32 restriction = 0x40000000; - uint32 inuse = 0; - - memset(unix_user, 0, sizeof(unix_user)); - if (!nw_get_prop_val_by_obj_id(obj.id, 1, - (uint8 *)"UNIX_USER", 9, - (uint8 *)unix_user, &more_segments, &property_flags)) { - struct passwd *pw; - - unix_user[sizeof(unix_user)-1] = '\0'; - pw = getpwnam(unix_user); - - if (pw && !nw_get_vol_restrictions(volnr, pw->pw_uid, - &restriction, &inuse) && - restriction < 0x40000000) { - if (restricted_index >= sequence) { - U32_TO_BE32(obj.id, xdata->entry[xdata->entries].id); - U32_TO_BE32(restriction, xdata->entry[xdata->entries].restriction); - xdata->entries++; - } - restricted_index++; - } - } - - last_obj_id = obj.id; - memset(&obj, 0, sizeof(obj)); - obj.type = 1; - xstrcpy(obj.name, wild); - scan_result = scan_for_obj(&obj, last_obj_id, 1); - } - } -#endif - - return 1 + (8 * xdata->entries); + return 1; } static int trustee_v3_to_ncp22_rights(int rights)