From 138b310de4badfc765151c5d31923ad9167b3a14 Mon Sep 17 00:00:00 2001 From: kitsunyan Date: Sun, 26 Apr 2020 08:15:57 +0300 Subject: Fix warnings introduced in nim 1.2 --- src/utils.nim | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/utils.nim') diff --git a/src/utils.nim b/src/utils.nim index c329b68..bb216d3 100644 --- a/src/utils.nim +++ b/src/utils.nim @@ -2,10 +2,10 @@ import hashes, options, os, posix, sequtils, strutils, sugar, tables type - HaltError* = object of Exception + HaltError* = object of CatchableError code*: int - CommandError* = object of Exception + CommandError* = object of CatchableError color*: Option[bool] error*: bool @@ -211,11 +211,11 @@ proc forkWaitRedirect*(call: () -> int): tuple[output: seq[string], code: int] = proc getgrouplist*(user: cstring, group: Gid, groups: ptr cint, ngroups: var cint): cint {.importc, header: "".} -proc setgroups*(size: csize, groups: ptr cint): cint +proc setgroups*(size: csize_t, groups: ptr cint): cint {.importc, header: "".} proc getUser(uid: int): User = - var pw = getpwuid(Uid(uid)) + var pw = getpwuid(uid.Uid) if pw == nil: raise newException(CatchableError, "") var groups: array[100, cint] @@ -254,11 +254,11 @@ proc dropPrivileges*(): bool = let user = initialUser.unsafeGet var groups = user.groups.map(x => x.cint) - if setgroups(user.groups.len, addr(groups[0])) < 0: + if setgroups(user.groups.len.csize_t, addr(groups[0])) < 0: return false - if setgid((Gid) user.gid) != 0: + if setgid(user.gid.Gid) != 0: return false - if setuid((Uid) user.uid) != 0: + if setuid(user.uid.Uid) != 0: return false template replaceExisting(name: string, value: string) = -- cgit v1.2.3-70-g09d2